@gct-paas/render 6.0.0-test.0 → 6.0.3-dev.1
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/loader.esm.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @gct-paas/render v6.0.
|
|
2
|
-
import{ASSIGNMENTSTRATEGY_ENUM as e,BizServiceEnum as t,ButtonTypeEnum as n,DateRangeEnums as r,DefaultDateTypeConst as o,Dependency_ENUM as i,DisplayType as s,EntityModelCategoryEnum as a,ExamineAndApproveStateEnum as u,FIELD_TYPE as c,FieldSysVarDefaultValueEnum as l,FormComponents as d,GLOBAL_VAR_TYPE as f,INNER_EVENT as p,OpinionTypeEnum as h,PluginModeEnum as g,PluginPgkUtil as m,SEARCH_SERVICE as y,SYSTEM_VAR_PREFIX as v,calcStyle as b,cssLoader as w,functionMap as O,innerVarIds as D,isMultipleOperator as E,operator2FuncMap as I,t as S,useNamespace as T,usePermissionStore as C}from"@gct-paas/core";import N from"dayjs";import*as M from"vue";import{TransitionGroup as x,computed as R,createElementBlock as P,createElementVNode as A,createTextVNode as _,createVNode as k,customRef as $,defineComponent as Y,getCurrentInstance as j,getCurrentScope as H,h as F,inject as V,isVNode as B,nextTick as U,onActivated as L,onBeforeUnmount as G,onMounted as K,onScopeDispose as W,onUnmounted as q,openBlock as z,provide as J,reactive as X,readonly as Q,ref as Z,resolveComponent as ee,shallowReactive as te,shallowRef as ne,toRaw as re,toRef as oe,toRefs as ie,toValue as se,unref as ae,watch as ue}from"vue";import{DesignNodeMode as ce,extractFontStyle as le,generateWrapperStyle as de,propsToStyle as fe}from"@gct-paas/schema";import*as pe from"lodash-es";import{cloneDeep as he,differenceBy as ge,get as me,isArray as ye,isEqual as ve,isNull as be,isUndefined as we,merge as Oe,pick as De}from"lodash-es";import Ee from"bignumber.js";import*as Ie from"esprima-next";import Se from"estraverse";import Te from"escodegen";import Ce from"qs";var Ne=Object.create,Me=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,Re=Object.getOwnPropertyNames,Pe=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty,_e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ke=(e,t)=>{let n={};for(var r in e)Me(n,r,{get:e[r],enumerable:!0});return t||Me(n,Symbol.toStringTag,{value:"Module"}),n},$e=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,i=Re(t),s=0,a=i.length;s<a;s++)o=i[s],Ae.call(e,o)||o===n||Me(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(r=xe(t,o))||r.enumerable});return e},Ye=(e,t,n)=>(n=null!=e?Ne(Pe(e)):{},$e(!t&&e&&e.__esModule?n:Me(n,"default",{value:e,enumerable:!0}),e));function je(e){return je="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},je(e)}function He(e,t,n){return(t=function(e){var t=function(e){if("object"!=je(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=je(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==je(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Fe=class{constructor(){He(this,"map",/* @__PURE__ */new Map)}register(e,t,n){const r=n?`${n}:${e}`:e;this.map.has(r)&&console.warn(`重复注册标识: ${r},覆盖之前的组件`),this.map.set(r,t)}unregister(e,t){const n=t?`${t}:${e}`:e;this.map.has(n)?this.map.delete(n):console.warn(`删除未注册组件标识: ${n}`)}get(e,t,n=!1){const r=t?`${t}:${e}`:e,o=this.map.get(r);return o||n||console.warn(`未找到组件,标识: ${r}`),o}keys(){return Array.from(this.map.keys())}},Ve="view-design",Be="id",Ue=/* @__PURE__ */function(e){return e.ACTIVE_TAG="design-active-item",e.DRAG_TAG="design-drop-item",e.INDEX_TAG="design-item-index",e.NODE_ID_TAG="design-item-id",e.DESIGN_NAME="design-item-name",e.GROUP_TAG="design-group-tag",e.DRAG_GROUP_TYPE="drag-group-type",e.IS_INLINE_BLOCK="is-inline-block",e.SELECTOR_INDEX="selector-index",e}({}),Le={WEEK_NOW:e=>{const t=N().startOf("week").add(1,"day"),n=N().endOf("week").add(1,"day"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},MONTH_NOW:e=>{const t=N().startOf("month"),n=N().endOf("month"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},QUARTER_NOW:e=>{const t=N().startOf("quarter"),n=N().endOf("quarter"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},YEAR_NOW:e=>{const t=N().startOf("year"),n=N().endOf("year"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},WEEk_BEFORE:e=>{N.locale("zh-cn");const t=N().startOf("week").subtract(1,"week"),n=t.clone().endOf("week"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},MONTH_BEFORE:e=>{const t=N().add(-1,"month").startOf("month"),n=N().add(-1,"month").endOf("month"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},QUARTER_BEFORE:e=>{const t=N().add(-1,"quarter").startOf("quarter"),n=N().add(-1,"quarter").endOf("quarter"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},YEAR_BEFORE:e=>{const t=N().add(-1,"year").startOf("year"),n=N().add(-1,"year").endOf("year"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},DATE_BEFORE:e=>{const t=N().add(-1,"day");return{disabled:e<t.valueOf(),maxDate:t}},DATE_AFTER:e=>{const t=N();return{disabled:e>t.valueOf(),minDate:t}}},Ge=(e,t)=>{const n=N(e).valueOf(),r=Le[t];if(r){const{disabled:e}=r(n);return e}return!1},Ke=e=>{const t=Le[e];if(t){const{minDate:e,maxDate:n}=t(0);return Object.assign({},e&&{minDate:new Date(e)},n&&{maxDate:new Date(n)})}return{}},We=(e,t)=>{let n;switch(e){case l.SYS_DATE:n=N().format(t??"YYYY-MM-DD");break;case l.SYS_DATE_TIME:n=N().format(t??"YYYY-MM-DD HH:mm:ss");break;case l.SYS_TIME:n=N().format(t??"HH:mm:ss")}return n},qe={YYYY:{valueFormat:"YYYY-01-01",picker:"year",columnsType:["year"]},"YYYY HH":{valueFormat:"YYYY-01-01 HH:00:00",columnsType:["hour"]},"YYYY-MM HH:mm":{valueFormat:"YYYY-MM-01 HH:mm:00",columnsType:["hour","minute"]},"YYYY-MM":{valueFormat:"YYYY-MM-01",picker:"month",columnsType:["year","month"]},"YYYY-MM-DD":{valueFormat:"YYYY-MM-DD",picker:"date",columnsType:["year","month","day"]},"YYYY-MM-DD HH":{valueFormat:"YYYY-MM-DD HH:00:00",columnsType:["hour"]},"YYYY-MM-DD HH:mm":{valueFormat:"YYYY-MM-DD HH:mm:00",columnsType:["hour","minute"]},"YYYY-MM-DD HH:mm:ss":{valueFormat:"YYYY-MM-DD HH:mm:ss",columnsType:["hour","minute","second"]},"HH:mm:ss":{valueFormat:"HH:mm:ss",columnsType:["hour","minute","second"]},"HH:mm":{valueFormat:"HH:mm:00",columnsType:["hour","minute"]},HH:{valueFormat:"HH:00:00",columnsType:["hour"]}},ze={[r.WEEK_NOW]:""},Je=/* @__PURE__ */function(e){return e.DESIGN_RENDER="design-render",e}({}),Xe=/* @__PURE__ */function(e){return e.CUSTOM_HOME="custom-home",e.CARD_VIEW="card-view",e.MOBILE_CARD_VIEW="mobile-card-view",e.DESIGN_EDITOR="design-editor",e}({}),Qe=/* @__PURE__ */function(e){return e.PAGE="PAGE",e.PAGE_LOWER="page",e.FIELD="field",e.PANEL="panel",e.TABS="tabs",e.TAB_ITEM="tab-item",e.MENU_LIST="menu-list",e.SELECT_COMPONENT="select-component",e.GRID="grid",e.GRID_ITEM="grid-item",e.MESSAGE="message",e.WORKBENCH="workbench",e.PERSONAL_CENTER="personal-center",e.TODO="todo",e}({}),Ze=/* @__PURE__ */function(e){return e.DESIGN_EDITOR="design_editor",e}({}),et=class{static register(e,t,n){const r=n?`${n}:${e}`:e;this.map.has(r)&&console.warn(`重复注册组件提供者,标识: ${r},覆盖之前的提供者`),this.map.set(r,t)}static get(e,t){const n=t?`${t}:${e}`:e;if(this.cache.has(n))return this.cache.get(n);const r=this.map.get(n);if(r){const e=r();return this.cache.set(n,e),e}return console.warn(`未找到组件提供者,标识: ${n}`),null}static registerCustomHome(e,t){this.register(e,t,Xe.CUSTOM_HOME)}static registerDesignEditorNode(e,t){this.register(e,t,Xe.DESIGN_EDITOR)}static getCustomHome(e){return this.get(e,Xe.CUSTOM_HOME)}static getDesignEditorNode(e){return this.get(e,Xe.DESIGN_EDITOR)}};He(et,"map",/* @__PURE__ */new Map),He(et,"cache",/* @__PURE__ */new Map);var tt=/* @__PURE__ */Y({name:"DesignRenderItem",props:{model:{type:Object,required:!0}},setup(e,{slots:t}){const n=T("design-render-item"),r=b(e.model.data);return()=>{var e;return k("div",{class:n.b(),style:r},[null===(e=t.default)||void 0===e?void 0:e.call(t)])}}}),nt=class{constructor(){He(this,"context",{})}},rt=class{constructor(){He(this,"isDestroy",!1)}},ot=class{constructor(e){He(this,"model",void 0),He(this,"state",new rt),this.model=e}mounted(){}destroy(){}},it=class extends ot{},st=class extends ot{},at=class{constructor(){He(this,"state",new nt),He(this,"prefix",""),He(this,"preview",!1),He(this,"item",/* @__PURE__ */new Map),He(this,"nodes",[]),He(this,"tree",[])}setTree(e){this.tree=e}setNodes(e){this.reset(),this.nodes=e,this.nodes.forEach(e=>{const t=et.get(e.type,this.prefix);if(t){if(t.createController)return void this.item.set(e.id,t.createController(e));if(t.mode===ce.CONTAINER)return void this.item.set(e.id,new it(e));if(t.mode===ce.ITEM)return void this.item.set(e.id,new st(e))}this.item.set(e.id,new ot(e))})}getNodes(e){if(e){const t=this.getTreeItem(e);return t&&t.children?t.children.map(e=>this.nodes.find(t=>e.id===t.id)):[]}return this.tree.map(e=>this.nodes.find(t=>e.id===t.id))}getTreeItem(e,t=this.tree){if(!e)return null;for(const n of t){if(n.id===e)return n;if(n.children&&n.children.length>0){const t=this.getTreeItem(e,n.children);if(t)return t}}return null}getController(e){return this.item.get(e)}mounted(){}unmounted(){this.reset()}reset(){this.nodes=[],this.item.forEach(e=>{e.destroy()})}};function ut(e){let t=V(Je.DESIGN_RENDER);return t||(t=e?e():new at,t.state=X(t.state),J(Je.DESIGN_RENDER,t),K(()=>{t.mounted()}),q(()=>{t.unmounted()})),t}var ct="undefined"!=typeof window&&"undefined"!=typeof document,lt=("undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope),Object.prototype.toString),dt=()=>{},ft=e=>e();function pt(e,t={}){let n,r,o=dt;const i=e=>{clearTimeout(e),o(),o=dt};let s;return a=>{const u=se(e),c=se(t.maxWait);return n&&i(n),u<=0||void 0!==c&&c<=0?(r&&(i(r),r=void 0),Promise.resolve(a())):new Promise((e,l)=>{o=t.rejectOnCancel?l:e,s=a,c&&!r&&(r=setTimeout(()=>{n&&i(n),r=void 0,e(s())},c)),n=setTimeout(()=>{r&&i(r),r=void 0,e(a())},u)})}}function ht(e){return Array.isArray(e)?e:[e]}function gt(e){const t=Object.create(null);return n=>t[n]||(t[n]=e(n))}var mt=/\B([A-Z])/g,yt=(gt(e=>e.replace(mt,"-$1").toLowerCase()),/-(\w)/g);function vt(e,t,n={}){const{eventFilter:r=ft,...o}=n;return ue(e,(i=r,s=t,function(...e){return new Promise((t,n)=>{Promise.resolve(i(()=>s.apply(this,e),{fn:s,thisArg:this,args:e})).then(t).catch(n)})}),o);var i,s}function bt(e,t=!0,n){!function(e){return e||j()}(n)?t?e():U(e):K(e,n)}function wt(e,t,n={}){const{debounce:r=0,maxWait:o,...i}=n;return vt(e,t,{...i,eventFilter:pt(r,{maxWait:o})})}gt(e=>e.replace(yt,(e,t)=>t?t.toUpperCase():""));var Ot=ct?window:void 0,Dt=ct?window.document:void 0;function Et(...e){const t=R(()=>{const t=ht(se(e[0])).filter(e=>null!=e);return t.every(e=>"string"!=typeof e)?t:void 0});return n=([e,t,n,r],o,i)=>{if(!(null==e?void 0:e.length)||!(null==t?void 0:t.length)||!(null==n?void 0:n.length))return;const s=(a=r,"[object Object]"===lt.call(a)?{...r}:r);var a;const u=e.flatMap(e=>t.flatMap(t=>n.map(n=>((e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)))(e,t,n,s))));i(()=>{u.forEach(e=>e())})},r={flush:"post"},ue(()=>{var n,r;return[null!==(n=null===(r=t.value)||void 0===r?void 0:r.map(e=>function(e){var t;const n=se(e);return null!==(t=null==n?void 0:n.$el)&&void 0!==t?t:n}(e)))&&void 0!==n?n:[Ot].filter(e=>null!=e),ht(se(t.value?e[1]:e[0])),ht(ae(t.value?e[2]:e[1])),se(t.value?e[3]:e[2])]},n,{...r,immediate:!0});var n,r}ct&&window.navigator,ct&&window.location;var It="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},St="__vueuse_ssr_handlers__",Tt=/* @__PURE__ */Ct();function Ct(){return St in It||(It[St]=It[St]||{}),It[St]}var Nt={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Mt="vueuse-storage";function xt(e,t,n,r={}){var o;const{flush:i="pre",deep:s=!0,listenToStorageChanges:a=!0,writeDefaults:u=!0,mergeDefaults:c=!1,shallow:l,window:d=Ot,eventFilter:f,onError:p=e=>{console.error(e)},initOnMounted:h}=r,g=(l?ne:Z)("function"==typeof t?t():t),m=R(()=>se(e));if(!n)try{n=(Tt.getDefaultStorage||(()=>null==Ot?void 0:Ot.localStorage))()}catch(S){p(S)}if(!n)return g;const y=se(t),v=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e?"object":Number.isNaN(e)?"any":"number"}(y),b=null!==(o=r.serializer)&&void 0!==o?o:Nt[v],{pause:w,resume:O}=function(e,t,n={}){const{eventFilter:r,initialState:o="active",...i}=n,{eventFilter:s,pause:a,resume:u,isActive:c}=function(e=ft,t={}){const{initialState:n="active"}=t,r=function(...e){if(1!==e.length)return oe(...e);const t=e[0];return"function"==typeof t?Q($(()=>({get:t,set:dt}))):Z(t)}("active"===n);return{isActive:Q(r),pause:function(){r.value=!1},resume:function(){r.value=!0},eventFilter:(...t)=>{r.value&&e(...t)}}}(r,{initialState:o});return{stop:vt(e,t,{...i,eventFilter:s}),pause:a,resume:u,isActive:c}}(g,e=>function(e){try{const t=n.getItem(m.value);if(null==e)E(t,null),n.removeItem(m.value);else{const r=b.write(e);t!==r&&(n.setItem(m.value,r),E(t,r))}}catch(S){p(S)}}(e),{flush:i,deep:s,eventFilter:f});ue(m,()=>I(),{flush:i});let D=!1;function E(e,t){if(d){const r={key:m.value,oldValue:e,newValue:t,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",r):new CustomEvent(Mt,{detail:r}))}}function I(e){if(!e||e.storageArea===n)if(e&&null==e.key)g.value=y;else if(!e||e.key===m.value){w();try{const t=b.write(g.value);void 0!==e&&(null==e?void 0:e.newValue)===t||(g.value=function(e){const t=e?e.newValue:n.getItem(m.value);if(null==t)return u&&null!=y&&n.setItem(m.value,b.write(y)),y;if(!e&&c){const e=b.read(t);return"function"==typeof c?c(e,y):"object"!==v||Array.isArray(e)?e:{...y,...e}}return"string"!=typeof t?t:b.read(t)}(e))}catch(S){p(S)}finally{e?U(O):O()}}}return d&&a&&(n instanceof Storage?Et(d,"storage",e=>{h&&!D||I(e)},{passive:!0}):Et(d,Mt,e=>{h&&!D||I(e.detail)})),h?bt(()=>{D=!0,I()}):I(),g}function Rt(e,t){const n=(null==t?void 0:t.cache)?te(t.cache):te(/* @__PURE__ */new Map),r=(...e)=>(null==t?void 0:t.getKey)?t.getKey(...e):JSON.stringify(e),o=(t,...r)=>(n.set(t,e(...r)),n.get(t)),i=(...e)=>{const t=r(...e);return n.has(t)?n.get(t):o(t,...e)};return i.load=(...e)=>o(r(...e),...e),i.delete=(...e)=>{n.delete(r(...e))},i.clear=()=>{n.clear()},i.generateKey=r,i.cache=n,i}var Pt=0;Number.POSITIVE_INFINITY;var At=/* @__PURE__ */function(e){return e.SELECT_ID="$VAR_GCT_SELECT_ID",e}({}),_t=function(e,t,n={}){const{window:r=Ot}=n;return xt(e,t,null==r?void 0:r.localStorage,n)}("GCT_APP_GlobalCache",{}),kt=e=>{const t=R({get:()=>_t.value[e]||{},set(t){_t.value[e]=t}});return{selectID:R({get:()=>t.value[At.SELECT_ID],set(e){t.value[At.SELECT_ID]?t.value[At.SELECT_ID]=e:t.value={...t.value,[At.SELECT_ID]:e}}}),cacheMap:t}},$t=class{static async getMap(e,t=!0){if(!e)return Promise.reject();if(!this.responsePromise.has(e)||!t){const t=(async()=>{const t=await _gct.api.apaas.modelMeta.getDetail({modelKey:e});this.modelData.set(e,t);const n=!!(null==t?void 0:t.fieldMetaList)&&t.fieldMetaList.reduce((e,t)=>(t.key&&(e[t.key]=t),e),{});n&&this.FiledData.set(e,n)})();this.responsePromise.set(e,t)}return this.responsePromise.get(e)}static async getConfigByField(e,t,n=!0){return await this.getMap(e,n),this.FiledData.get(e)[t]}static async getConfigByModel(e){return await this.getMap(e),this.modelData.get(e)}static clearCacheMap(e=!1){e&&this.responsePromise.clear(),this.modelData.clear(),this.FiledData.clear()}};async function Yt(e,t=!1){const{modelKey:n,field:r,isCustomField:o,fieldName:i,readonly:s,fieldType:a}=e.props;if(!e.isField&&!t||"table_name_"===r)return{};let u;if(o?u={name:i,type:""}:n&&(u=await $t.getConfigByField(n,r)),!(o||u&&u.type===a))throw new Error("该字段可能已经被删除");if(!u)return{};const{required:c,specificConfig:l}=u;return e.props.fieldRequired=!!c,c&&!s&&(e.props.required=!0),void 0!==(null==l?void 0:l.digits)&&(e.props.precision=l.digits),u}He($t,"modelData",/* @__PURE__ */new Map),He($t,"FiledData",/* @__PURE__ */new Map),He($t,"responsePromise",/* @__PURE__ */new Map),He($t,"silent",!1);var jt=()=>{const e=Z({});return{getFileAttrs:async function({modelKey:t,fieldKey:n}){const r=await $t.getConfigByField(t,n);if(r&&r.specificConfig){const t=De(r.specificConfig,["maxNumber","fileSize","fileTypes"])??{},n=t.fileTypes??[];e.value={maxSize:t.fileSize,maxCount:t.maxNumber,accept:n,acceptStr:Array.isArray(n)&&0!==n.length?n.join("、"):""}}},attrObj:e,getmaxTagLength:async function({modelKey:t,fieldKey:n}){const r=await $t.getConfigByField(t,n);r&&r.specificConfig&&(e.value={maxTagTextLength:(De(r.specificConfig,["codeVisibleNum"])??{}).codeVisibleNum||12})}}},Ht=/* @__PURE__ */Y({name:"DesignRender",props:{model:{type:Object,required:!0},prefix:{type:String,default:""},preview:{type:Boolean,default:!1},context:{type:Object,default:()=>({})}},setup(e){const t=T("design-render"),n=ut();n.prefix=e.prefix,n.preview=e.preview,n.setNodes(e.model.nodes),n.setTree(e.model.tree),ue(()=>e.context,()=>{n.state.context=e.context},{immediate:!0});const r=R(()=>e.model.pageNode?b(e.model.pageNode.data):{}),o=n.getNodes();function i(t,r){const o=et.get(t.type,n.prefix);if(!o)return console.warn(`未找到节点类型为${t.type}的渲染器`),null;let s=null;return s=o.mode===ce.CONTAINER?function(t,r){const o=et.get(t.type,n.prefix),s=n.getNodes(t.id),a=n.getController(t.id);return F(ee(o.component),{key:t.id,c:a,model:t,parent:r,preview:e.preview,context:n.state.context,pageModel:e.model.pageNode},s.map(e=>i(e,t)))}(t,r):o.mode===ce.ITEM?function(t,r){const o=et.get(t.type,n.prefix),i=n.getController(t.id);return F(ee(o.component),{key:t.id,c:i,model:t,parent:r,preview:e.preview,context:n.state.context,pageModel:e.model.pageNode})}(t,r):k("div",null,[_("未支持的适配器模式["),o.mode,_("]")]),k(tt,{model:t},{default:()=>s})}function s(t){if(!e.model.pageNode)return t;const r=et.get(e.model.pageNode.type,n.prefix);if(!r)return console.warn(`未找到页面节点类型为${e.model.pageNode.type}的渲染器`),t;const o=n.getController(e.model.pageNode.id);return F(ee(r.component),{key:e.model.pageNode.id,c:o,model:e.model.pageNode,parent:void 0,preview:e.preview,context:n.state.context},t)}return()=>k("div",{class:t.b(),style:r.value},[s(o.map(e=>i(e)))])}}),Ft={class:"handwriting-pad"},Vt=["width","height"],Bt=/* @__PURE__ */((e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n})(/* @__PURE__ */Y({__name:"HandwritingPad",props:{width:{default:300},height:{default:150},backgroundColor:{default:"transparent"},lineWidth:{default:2},strokeStyle:{default:"#000"}},setup(e,{expose:t}){const n=e,r=Z(null);let o=null,i=!1,s=0,a=0;function u(e){const t=r.value.getBoundingClientRect();return"touches"in e?{x:e.touches[0].clientX-t.left,y:e.touches[0].clientY-t.top}:{x:e.offsetX,y:e.offsetY}}function c(e){e.preventDefault(),i=!0;const{x:t,y:n}=u(e);s=t,a=n}function l(e){if(!i||!o)return;e.preventDefault();const{x:t,y:n}=u(e);o.beginPath(),o.moveTo(s,a),o.lineTo(t,n),o.stroke(),o.closePath(),s=t,a=n}function d(e){e.preventDefault(),i=!1}return K(()=>{o=r.value.getContext("2d"),"transparent"!==n.backgroundColor&&(o.fillStyle=n.backgroundColor,o.fillRect(0,0,n.width,n.height)),o.lineWidth=n.lineWidth,o.strokeStyle=n.strokeStyle}),t({getValue:function(){var e;return null===(e=r.value)||void 0===e?void 0:e.toDataURL()},setValue:function(e){const t=new Image;t.src=e,t.onload=()=>{null==o||o.drawImage(t,0,0)}},clear:function(){null==o||o.clearRect(0,0,n.width,n.height),"transparent"!==n.backgroundColor&&(o.fillStyle=n.backgroundColor,o.fillRect(0,0,n.width,n.height))}}),(t,n)=>(z(),P("div",Ft,[A("canvas",{ref_key:"canvasRef",ref:r,width:e.width,height:e.height,class:"canvas",onMousedown:c,onMousemove:l,onMouseup:d,onMouseleave:d,onTouchstart:c,onTouchmove:l,onTouchend:d},null,40,Vt)]))}}),[["__scopeId","data-v-d5b980b7"]]),Ut=class{static runApp({userInfo:e,env:t,aid:n}){this.ENV=t,this.AID=n,this.userInfo=e}};He(Ut,"ENV",void 0),He(Ut,"AID",void 0),He(Ut,"userInfo",void 0);var Lt={[f.DATE]:{callback:e=>N(e,["YYYY-MM-DD","YYYY/MM/DD"],!0).isValid(),message:"日期变量格式为YYYY-MM-DD,YYYY/MM/DD"},[f.TIME]:{callback:e=>N(e,"HH:mm:ss",!0).isValid(),message:"时间变量格式HH:mm:ss"},[f.DATETIME]:{callback:e=>N(e,["YYYY-MM-DD HH:mm:ss","YYYY/MM/DD HH:mm:ss"]).isValid(),message:"日期时间变量格式为YYYY-MM-DD HH:mm:ss,YYYY/MM/DD HH:mm:ss"}},Gt=/* @__PURE__ */function(e){return e.WEB="web_module",e.MOBILE="mobile_module",e.PAD="pad_module",e}({}),Kt={[Gt.WEB]:{getPageInfo:_gct.api.apaas.webpage.getInfo,getTxnPageInfo:_gct.api.apaas.transaction.getGetVersionById,getDetailPageInfo:_gct.api.apaas.detailPage.getInfo},[Gt.MOBILE]:{getPageInfo:_gct.api.apaas.mobilePage.getInfo},[Gt.PAD]:{getPageInfo:_gct.api.apaas.padPage.getInfo,getTxnPageInfo:_gct.api.apaas.transaction.getGetVersionById}},Wt=Z({}),qt=Z({}),zt=Z({});function Jt(e,t){zt.value[e]=t}var Xt=Z({pageStyle:{},pageConfig:{},pageName:""}),Qt=oe(()=>{const{title:e}=Xt.value.pageConfig||{};return e}),Zt=class e{static setModals(e){this.modalsCache={},null==e||e.forEach(e=>{this.modalsCache[e.id]=e})}static async getModalById(e){if(!e)return Promise.reject();if(/^i?g_modal_/.test(e)&&!this.modalsCache[e]){const[t]=await _api.apaas.appGlobalSettings.getInfo({keys:e,fullInfo:!0})||[];if(null==t?void 0:t.configJson){const n=JSON.parse(t.configJson);this.modalsCache[e]=n}}return this.modalsCache[e]||(console.error(`模态框${e}不存在`),Promise.reject())}static getPremission(e){if(!e)return!0;const t=this.permissions[e];return!t||C().getPermissionByKey(this.pageID,t)}static setPremission(e,t){this.permissions[t]=e}static setContextByKey(e,t){t?this.ContextCache[t]=e:this.ContextCache={page:e}}static getContextByKey(e){return this.ContextCache[e||"page"]}static async initvars(){(await _gct.api.apaas.appGlobalSettings.getList({type:"var",fullInfo:!0})||[]).forEach(e=>{if(e.configJson)try{const t=JSON.parse(e.configJson);qt.value[t.key]=(({value:e,appredis:t,key:n,type:r})=>{var o;const i="dev"!==Ut.ENV&&t,{cacheMap:s}=kt(`${Ut.AID}_${null===(o=Ut.userInfo)||void 0===o?void 0:o.userId}`);return new Proxy({value:e,type:r},{get:(e,t)=>i&&"value"===t?s.value[n]:Reflect.get(e,t),set:(e,t,r,o)=>(i&&"value"===t&&(s.value[n]?s.value[n]=r:s.value={...s.value,[n]:r}),Reflect.set(e,t,r,o))})})({value:t.defaultValue,appredis:t.appredis,key:t.key,type:t.type})}catch(t){console.error("initvars",t)}})}static async inithooks(){(await _gct.api.apaas.appGlobalSettings.getList({type:"event",fullInfo:!0})||[]).forEach(e=>{if(e.configJson)try{const t=new Function(JSON.parse(e.configJson).runJs),n=this.globalHookCaches[e.key];n&&n.push(t)}catch(t){console.error("inithooks",t)}})}static async initPermission(e){this.permissions=e||{}}static async initGlobalS(e){var t;if(this.setModals(e.modals),null===(t=e.pageVars)||void 0===t||t.forEach(e=>{var t;Wt.value[e.key]={value:null===(t=e.varInfo)||void 0===t?void 0:t.defaultValue,type:e.varInfo.type}}),!this.startRuning){this.startRuning=!0;try{await Promise.all([this.initvars(),this.inithooks()])}catch(n){console.log(n)}}}static getGlobalVar(e){const t=qt.value[e];return t?t.value:console.warn("变量key不存在")}static async setGlobalVar(e,t){const n=qt.value[e];if(!n)return console.warn("变量key不存在");n.value=t}static getPageVar(e){const t=Wt.value[e];return t?t.value:console.warn("变量key不存在")}static async setPageVar(e,t){const n=Wt.value[e];if(!n)return console.warn("变量key不存在");await function(e,t){if(t===f.NULL)return!0;const{callback:n,message:r}=Lt[t]||{callback:e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase()===t,value:"变量值必须为"+t};return n(e)?Promise.resolve():Promise.reject(r)}(t,n.type),Wt.value[e]&&(Wt.value[e].value=t)}static getPageGlobalVar(e){var t;return null===(t=Wt.value[e])||void 0===t?void 0:t.value}static setPageGlobalVar(e,t){Wt.value[e]?Wt.value[e].value=t:Wt.value[e]={value:t,type:"string"}}static async initPageByid(e,t=Gt.WEB){this.pageID=e;const n=Kt[t].getPageInfo,r=await n({id:e}),{runtimeJson:o,name:i}=r||{};if(Xt.value.pageName=i,!o)return Promise.reject();const s=JSON.parse(o);return s.widgets.filter(e=>"bottom-button-container"!==e.type).length?(await this.initGlobalS(s),Xt.value.pageConfig=s.pageConfig||{},Xt.value.pageStyle=s.pageStyle||{},{res:r,data:s,name:i}):Promise.reject()}static async initTxnPageByid(e,t=!1){this.pageID=e;const n=Kt[Gt.WEB].getTxnPageInfo,r=await n({id:e}),{runtimeJson:o,detailRuntimeJson:i,name:s}=r||{},a=t?i:o;if(Xt.value.pageName=s,!a)return Promise.reject();const u=JSON.parse(a);return u.widgets.filter(e=>"bottom-button-container"!==e.type).length?(await this.initGlobalS(u),Xt.value.pageConfig=u.pageConfig||{},Xt.value.pageStyle=u.pageStyle||{},{res:r,data:u,name:s}):Promise.reject()}static async initDetailPageById(e){this.pageID=e;const t=Kt[Gt.WEB].getDetailPageInfo,n=await t({id:e}),{runtimeJson:r,name:o}=n||{};if(Xt.value.pageName=o,!r)return Promise.reject();const i=JSON.parse(r);return i.widgets.filter(e=>"bottom-button-container"!==e.type).length?(await this.initGlobalS(i),Xt.value.pageConfig=i.pageConfig||{},Xt.value.pageStyle=i.pageStyle||{},{res:n,data:i,name:o}):Promise.reject()}static async initHistoryByid(e){this.pageID=e;const t=await _gct.api.apaas.pageDesignerLog.getInfo({id:e}),{runtimeJson:n,name:r}=t||{};if(!n)return Promise.reject();Xt.value.pageName=r;const o=JSON.parse(n);return await this.initGlobalS(o),Xt.value.pageConfig=o.pageConfig||{},Xt.value.pageStyle=o.pageStyle||{},{res:t,data:o,name:r}}static usePageHooks(t,n,r,o){const i=Z(!1);return K(async()=>{await U();const e=null==n?void 0:n.pageBeforeMount;if((null==e?void 0:e.name)&&await t.runExportByName(e.name,e.extraParams),o&&await o(t),i.value=!0,null==r?void 0:r.pageMounted)for(const t of this.globalHookCaches.pageMounted)await t();const{extraParams:s,name:a}=(null==n?void 0:n.pageMounted)||{};a&&t.runAsyncExportByName(a,s)}),G(async()=>{Xt.value={};const{extraParams:e,name:o}=(null==n?void 0:n.pageDestroyed)||{};if(o&&t.runExportByName(o,e),null==r?void 0:r.pageDestroyed)for(const t of this.globalHookCaches.pageDestroyed)await t()}),L(async()=>{if(e.setContextByKey(t.context),null==r?void 0:r.pageActivated)for(const e of this.globalHookCaches.pageActivated)await e();const{extraParams:o,name:i}=(null==n?void 0:n.pageActivated)||{};i&&t.runAsyncExportByName(i,o)}),{pageload:i}}};He(Zt,"modalsCache",{}),He(Zt,"pageID",""),He(Zt,"permissions",{}),He(Zt,"ContextCache",{}),He(Zt,"startRuning",!1),He(Zt,"globalHookCaches",{pageMounted:[],pageActivated:[],pageDestroyed:[]});var en=Zt.getPremission.bind(Zt),tn=class{constructor(){He(this,"mode",ce.ITEM),He(this,"type",Ze.DESIGN_EDITOR),He(this,"fieldKey",void 0),He(this,"fieldType",void 0)}createController(e){throw new Error("Method not implemented.")}};function nn(e,t){class n extends tn{constructor(...n){super(...n),He(this,"fieldType",e),He(this,"component",t)}}return{install(){e&&et.registerDesignEditorNode(e,()=>new n)}}}var rn=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_utc=r()}(e,function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var s=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},s.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},s.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var a=s.parse;s.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var u=s.init;s.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else u.call(this)};var c=s.utcOffset;s.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],s=60*+o[1]+ +o[2];return 0===s?0:"+"===i?s:-s}(r),null===r))return this;var s=Math.abs(r)<=16?60*r:r;if(0===s)return this.utc(o);var a=this.clone();if(o)return a.$offset=s,a.$u=!1,a;var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(a=this.local().add(s+u,e)).$offset=s,a.$x.$localOffset=u,a};var l=s.format;s.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},s.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var d=s.toDate;s.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=s.diff;s.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),o=i(e).local();return f.call(r,o,t,n)}}})}),on=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_timezone=r()}(e,function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,o){var i,s=function(e,n,r){void 0===r&&(r={});var o=new Date(e);return function(e,n){void 0===n&&(n={});var r=n.timeZoneName||"short",o=e+"|"+r,i=t[o];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),t[o]=i),i}(n,r).formatToParts(o)},a=function(t,n){for(var r=s(t,n),i=[],a=0;a<r.length;a+=1){var u=r[a],c=u.type,l=u.value,d=e[c];d>=0&&(i[d]=parseInt(l,10))}var f=i[3],p=24===f?0:f,h=i[0]+"-"+i[1]+"-"+i[2]+" "+p+":"+i[4]+":"+i[5]+":000",g=+t;return(o.utc(h).valueOf()-(g-=g%1e3))/6e4},u=r.prototype;u.tz=function(e,t){void 0===e&&(e=i);var n,r=this.utcOffset(),s=this.toDate(),a=s.toLocaleString("en-US",{timeZone:e}),u=Math.round((s-new Date(a))/1e3/60),c=15*-Math.round(s.getTimezoneOffset()/15)-u;if(Number(c)){if(n=o(a,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(c,!0),t){var l=n.utcOffset();n=n.add(r-l,"minute")}}else n=this.utcOffset(0,t);return n.$x.$timezone=e,n},u.offsetName=function(e){var t=this.$x.$timezone||o.tz.guess(),n=s(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return n&&n.value};var c=u.startOf;u.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(n,e,t).tz(this.$x.$timezone,!0)},o.tz=function(e,t,n){var r=n&&t,s=n||t||i,u=a(+o(),s);if("string"!=typeof e)return o(e).tz(s);var c=function(e,t,n){var r=e-60*t*1e3,o=a(r,n);if(t===o)return[r,t];var i=a(r-=60*(o-t)*1e3,n);return o===i?[r,o]:[e-60*Math.min(o,i)*1e3,Math.max(o,i)]}(o.utc(e,r).valueOf(),u,s),l=c[0],d=c[1],f=o(l).utcOffset(d);return f.$x.$timezone=s,f},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(e){i=e}}})}),sn=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_quarterOfYear=r()}(e,function(){var e="month",t="quarter";return function(n,r){var o=r.prototype;o.quarter=function(e){return this.$utils().u(e)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(e-1))};var i=o.add;o.add=function(n,r){return n=Number(n),this.$utils().p(r)===t?this.add(3*n,e):i.bind(this)(n,r)};var s=o.startOf;o.startOf=function(n,r){var o=this.$utils(),i=!!o.u(r)||r;if(o.p(n)===t){var a=this.quarter()-1;return i?this.month(3*a).startOf(e).startOf("day"):this.month(3*a+2).endOf(e).endOf("day")}return s.bind(this)(n,r)}}})}),an=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=function(e,t){t.prototype.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]}}:"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_toArray=function(e,t){t.prototype.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]}}}(e,function(){return function(e,t){t.prototype.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]}}})}),un=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_isoWeek=r()}(e,function(){var e="day";return function(t,n,r){var o=function(t){return t.add(4-t.isoWeekday(),e)},i=n.prototype;i.isoWeekYear=function(){return o(this).year()},i.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,i,s,a=o(this),u=(n=this.isoWeekYear(),s=4-(i=(this.$u?r.utc:r)().year(n).startOf("year")).isoWeekday(),i.isoWeekday()>4&&(s+=7),i.add(s,e));return a.diff(u,"week")+1},i.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var s=i.startOf;i.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return"isoweek"===n.p(e)?r?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(e,t)}}})}),cn=/* @__PURE__ */ke({ABS:()=>tr,ADD:()=>Un,AND:()=>bn,AVERAGE:()=>er,BANKROUND:()=>rr,CONCAT:()=>Nn,COUNT:()=>Ur,DATE2TIMESTAMP:()=>gr,DATEFORMAT:()=>mr,DAY:()=>Tr,DIVISION:()=>Kn,DateAdd:()=>wr,DateSubtract:()=>Or,EQ:()=>On,EXP:()=>ur,FINDSTR:()=>jn,FIXED:()=>Wn,GE:()=>Sn,GET:()=>lr,GT:()=>Tn,HEADPUSH:()=>pr,HOUR:()=>Cr,IF:()=>gn,ISDATERANGE:()=>Yr,ISEMPTY:()=>mn,ISNULL:()=>yn,ISTIMERANGE:()=>jr,ISUNDEFINED:()=>vn,LARGE:()=>Xn,LASTMONTHRANGE:()=>Pr,LASTQUARTER:()=>$r,LASTWEEKRANGE:()=>xr,LASTYEARRANGE:()=>_r,LE:()=>En,LEN:()=>Cn,LN:()=>cr,LOWER:()=>Pn,LT:()=>In,LTRIM:()=>_n,MAX:()=>Jn,MAXABS:()=>nr,MIN:()=>Qn,MINUTE:()=>Nr,MOD:()=>or,MONTH:()=>Sr,MONTHRANGE:()=>Rr,MULTIPLICATION:()=>Gn,NE:()=>Dn,NOW:()=>Dr,OR:()=>wn,PARSENUMBER:()=>Fn,POWER:()=>sr,PUSH:()=>fr,PUT:()=>dr,QUARTER:()=>kr,REDUCE:()=>Ln,REPEAT:()=>$n,REPLACE:()=>Yn,ROUND:()=>qn,ROUNDUP:()=>zn,RSQ:()=>Gr,RTRIM:()=>kn,SEARCHSTR:()=>Hn,SEQMAP:()=>Vr,SMALL:()=>Zn,SPLIT:()=>Vn,SQRT:()=>ar,STDEV:()=>Lr,SUBSTR:()=>xn,SUBSTRING:()=>Mn,SUM:()=>Bn,SUMSQ:()=>Br,TIMESTAMP2DATE:()=>hr,TODAY:()=>Er,TRIM:()=>An,TUPLE:()=>Fr,UPPER:()=>Rn,WEEKRANGE:()=>Mr,YEAR:()=>Ir,YEARRANGE:()=>Ar}),ln=/* @__PURE__ */Ye(rn(),1),dn=/* @__PURE__ */Ye(on(),1),fn=/* @__PURE__ */Ye(sn(),1),pn=/* @__PURE__ */Ye(an(),1),hn=/* @__PURE__ */Ye(un(),1);function gn(e,t,n){return e?t:n}function mn(e){return null==e||""===e||0===e}function yn(e){return be(e)}function vn(e){return we(e)}function bn(...e){return(()=>{for(const t of e)if(!t)return!1;return!0})()}function wn(...e){return e.some(e=>e)}function On(e,t){return ve(e,t)}function Dn(e,t){return e!==t}function En(e,t){return("number"==typeof e&&"number"==typeof t||"string"==typeof e&&"string"==typeof t||e instanceof Date&&t instanceof Date)&&e<=t}function In(e,t){return("number"==typeof e&&"number"==typeof t||"string"==typeof e&&"string"==typeof t||e instanceof Date&&t instanceof Date)&&e<t}function Sn(e,t){return("number"==typeof e&&"number"==typeof t||"string"==typeof e&&"string"==typeof t||e instanceof Date&&t instanceof Date)&&e>=t}function Tn(e,t){return("number"==typeof e&&"number"==typeof t||"string"==typeof e&&"string"==typeof t||e instanceof Date&&t instanceof Date)&&e>t}function Cn(e){return(null==e?void 0:e.length)||0}function Nn(...e){return e.join("")}function Mn(e="",t,n){return(()=>{const r=(t<0?[...e].reverse().join(""):e).slice(Math.abs(t+Number(t<0)),Math.abs(n)+Number(t>=0));return t<0?[...r].reverse().join(""):r})()}function xn(e="",t,n){return(()=>{const r=(t<0?[...e].reverse().join(""):e).slice(Math.abs(t+Number(t<0)),Math.abs(t+Number(t<0))+Math.abs(n));return t<0?[...r].reverse().join(""):r})()}function Rn(e=""){return e.toUpperCase()}function Pn(e=""){return e.toLowerCase()}function An(e=""){return e.trim()}function _n(e=""){return e.replace(/^\s\s*/,"")}function kn(e=""){return e.replace(/\s\s*$/,"")}function $n(e="",t=""){return(null===(n=e.match(new RegExp(t,"g")))||void 0===n?void 0:n.length)||null;var n}function Yn(e="",t="",n=""){return e.replace(new RegExp(t,"g"),n)}function jn(e="",t=""){return e.includes(t)}function Hn(e="",t=""){return(null===(n=e.match(new RegExp(t,"g")))||void 0===n?void 0:n.length)||0;var n}function Fn(e=""){return(()=>{const t=parseFloat(e);return isNaN(t)?null:t})()}function Vn(e="",t=""){return e.split(t)}function Bn(...e){const t=e.flat().filter(e=>""!==e&&null!=e);return t.length?t.reduce(Kr,0):""}function Un(...e){return e.flat().reduce(Kr,0)}function Ln(e,...t){return t.reduce(Wr,e)}function Gn(e,...t){const n=t.flat().filter(e=>""!==e&&null!=e);return n.length?n.reduce(qr,e):""}function Kn(e,...t){return t.reduce(zr,e)}function Wn(e,t){return(()=>{if(t<0)throw new Error("Decimal places should be non-negative.");const[n,r=""]=e.toString().split(".");if(0==t)return n;let o=r.split("");if(o.length>t)o=o.slice(0,t);else{const e=o.length;for(let n=0;n<t-e;n++)o.push("0")}return`${n}.${o.join("")}`})()}function qn(e,t){return(()=>{if(null===e||""===e||void 0===e)return"";if(t<0)throw new Error("Decimal places should be non-negative.");const n=Math.trunc(t),r=Number(e);if(isNaN(r))return"";const o=r>0?(+(Math.round(Number(r+`e${n}`))+`e-${n}`)).toFixed(n):-(+(Math.round(Number(-r+`e${n}`))+`e-${n}`)).toFixed(n);return parseFloat(o+"")})()}function zn(e,t){if(null===e||""===e||void 0===e)return"";if(t<0)throw new Error("Decimal places should be non-negative.");return t=t?parseInt(t+""):0,new Ee(e).decimalPlaces(t,Ee.ROUND_UP).toNumber()}function Jn(...e){const t=e.flat().filter(e=>""!==e&&null!=e);return t.length?Math.max.apply(null,t):""}function Xn(e,t){return(()=>{if(t<1||t>e.length)throw new Error("Invalid value of n. It should be between 1 and the array length.");return e.sort((e,t)=>t-e)[t-1]})()}function Qn(...e){const t=e.flat().filter(e=>""!==e&&null!=e);return t.length?Math.min.apply(null,t):""}function Zn(e,t){return(()=>{if(t<1||t>e.length)throw new Error("Invalid value of n. It should be between 1 and the array length.");return e.sort((e,t)=>e-t)[t-1]})()}function er(...e){const t=e.flat().filter(e=>""!==e&&null!=e),n=t.length;if(!n)return"";let r=new Ee(0);for(const o of t)r=r.plus(o);return r.dividedBy(n).toNumber()}function tr(e){return Math.abs.call(null,e)}function nr(...e){const t=e.flat().filter(e=>null!=e);return t.length?t.reduce((e,t)=>Math.abs(Number(t))>Math.abs(Number(e))?t:e):""}function rr(e,t){if(null===e||""===e||void 0===e)return"";if(t<0)throw new Error("Decimal places should be non-negative.");return t=t?parseInt(t+""):0,new Ee(e).decimalPlaces(t,Ee.ROUND_HALF_EVEN).toNumber()}function or(e,t){return(()=>{if(0===e)throw new Error("The second value should not be zero.");const n=new Ee(e).mod(t).toNumber();return isNaN(n)?"":n})()}function ir(e){if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){const t=e.trim();if(""===t)return null;const n=Number(t);return Number.isFinite(n)?n:null}if("bigint"==typeof e){const t=Number(e);return Number.isFinite(t)?t:null}return null}function sr(e,t){return(()=>{const n=ir(e),r=ir(t);return null===n||null===r?NaN:Math.abs(r)>1e9?r>0?1/0:0:Math.pow(n,r)})()}function ar(e){return(()=>{const t=ir(e);return null===t?NaN:Math.sqrt(t)})()}function ur(e){return(()=>{const t=ir(e);return null===t?NaN:Math.exp(t)})()}function cr(e){return(()=>{const t=ir(e);if(null===t||t<=0)throw new Error("The value must be greater than zero.");return Math.log(t)})()}function lr(e,t){return(()=>{if(Array.isArray(e)){if("number"==typeof t)return e[t];throw new Error("For arrays, the second argument should be a number.")}if("object"==typeof e){if("string"==typeof t)return e[t];throw new Error("For objects, the second argument (b) should be a string.")}throw new Error("Unsupported data type. The first argument (a) should be an array or an object.")})()}function dr(e,t,n){return(()=>{if(Array.isArray(e)){if(!("number"==typeof t&&t>=0&&t<e.length))throw new Error("For arrays, the second argument (b) should be a number.");e[t]=n}else{if("object"!=typeof e)throw new Error("Unsupported data type. The first argument (a) should be an array or an object.");if("string"!=typeof t||!e)throw new Error("For objects, the second argument (b) should be a string.");e[t]=n}return e})()}function fr(e,t){return(()=>{if(!t)throw new Error("For arrays, the second argument should not be null or undefined");return e.push(t),e})()}function pr(e,t){return(()=>{if(!t)throw new Error("For arrays, the second argument should not be null or undefined");return e.unshift(t),e})()}function hr(e){if(e)return(()=>{if(!e)throw new Error("the frist argument should not be null");const t=/* @__PURE__ */new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`})()}function gr(e){if(e)return N(e).unix()}function mr(e,t){if(e)return N(e).format(t)}function yr(e){return/^\d{2}:\d{2}(:\d{2})?$/.test(e.trim())?"time":/^\d{4}-\d{2}-\d{2}$/.test(e.trim())?"date":"datetime"}function vr(e){return"date"===e?"YYYY-MM-DD":"time"===e?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss"}N.extend(ln.default),N.extend(dn.default),N.extend(fn.default),N.extend(pn.default),N.extend(hn.default);var br="2000-01-01 ";function wr(e,t,n,r){if(e)return(()=>{const o=yr(e),i=r??vr(o);return N("time"===o?br+e.trim():e).add(t,n).format(i)})()}function Or(e,t,n,r){if(e)return(()=>{const o=yr(e),i=r??vr(o);return N("time"===o?br+e.trim():e).subtract(t,n).format(i)})()}function Dr(){return N().format("YYYY-MM-DD HH:MM:ss")}function Er(){return N().format("YYYY-MM-DD")}function Ir(e){return N(e).year()}function Sr(e){return N(e).month()}function Tr(e){return N(e).day()}function Cr(e){return N(e).hour()}function Nr(e){return N(e).minute()}function Mr(){return[Hr(N().startOf("week").toDate()),Hr(N().endOf("week").toDate())]}function xr(){return[Hr(N().subtract(1,"week").startOf("week").toDate()),Hr(N().subtract(1,"week").endOf("week").toDate())]}function Rr(){return[Hr(N().startOf("month").toDate()),Hr(N().endOf("month").toDate())]}function Pr(){return[Hr(N().subtract(1,"month").startOf("month").toDate()),Hr(N().subtract(1,"month").endOf("month").toDate())]}function Ar(){return[Hr(N().startOf("year").toDate()),Hr(N().endOf("year").toDate())]}function _r(){return[Hr(N().subtract(1,"year").startOf("year").toDate()),Hr(N().subtract(1,"year").endOf("year").toDate())]}function kr(){return(()=>{const e=Math.floor((N().month()+3)/3);return[Hr(N().quarter(e).startOf("quarter").toDate()),Hr(N().quarter(e).endOf("quarter").toDate())]})()}function $r(){return(()=>{const e=Math.floor((N().month()+3)/3);return[Hr(N().quarter(e-1).startOf("quarter").toDate()),Hr(N().quarter(e-1).endOf("quarter").toDate())]})()}function Yr(e,t){return(()=>{const[n,r]=t;return e>=n&&e<=r})()}function jr(e,t){return(()=>{const[n,r]=t,o=N(e,"HH:mm");if(n>r){const e=N(n,"HH:mm"),t=N(r,"HH:mm").add(1,"day");return o>=e||o<=t}return o>=N(n,"HH:mm")&&o<=N(r,"HH:mm")})()}function Hr(e){return N(e).tz("America/Chicago").format("YYYY-MM-DD HH:mm:ss.SSSSSSSSS ZZ")}function Fr(...e){return[...e]}function Vr(...e){const t=(e.length-e.length%2)/2,n={};return Array(t).forEach(t=>{const r=e[2*t];n[r]=e[2*t+1]}),n}function Br(...e){return 0===(e=e.flat().filter(e=>""!==e&&null!=e)).length?"":e.map(e=>{const t=qr(e,e);return""!==t?t:new Ee(0).toNumber()}).reduce((e,t)=>Kr(e,t)||Ee(0).toNumber(),new Ee(0).toNumber())}function Ur(e){return Array.isArray(e)?e.length:""}function Lr(...e){const t=e.flat().filter(e=>""!==e&&null!=e).map(e=>Number(e)).filter(e=>Number.isFinite(e));if(t.length<2)return"";const n=t.reduce((e,t)=>e+t,0)/t.length,r=t.reduce((e,t)=>{const r=t-n;return e+r*r},0)/(t.length-1);return Math.sqrt(r)}function Gr(e,t){if(!Array.isArray(e)||!Array.isArray(t))return"";const n=e.map(e=>Number(e)).filter(e=>Number.isFinite(e)),r=t.map(e=>Number(e)).filter(e=>Number.isFinite(e));if(n.length<=1||r.length<=1||n.length!==r.length)return"";const o=n.length,i=n.reduce((e,t)=>e+t,0)/o,s=r.reduce((e,t)=>e+t,0)/o;let a=0,u=0,c=0;for(let f=0;f<o;f++){const e=n[f]-i,t=r[f]-s;a+=t*e,u+=e*e,c+=t*t}if(0===u||0===c)return"";const l=a/Math.sqrt(c*u),d=l*l;return Math.min(Math.max(d,0),1)}function Kr(e,t){const n=new Ee(e).plus(new Ee(t)).toNumber();return isNaN(n)?"":n}function Wr(e,t){const n=new Ee(e).minus(new Ee(t)).toNumber();return isNaN(n)?"":n}function qr(e,t){const n=new Ee(e).multipliedBy(new Ee(t)).toNumber();return isNaN(n)?"":n}function zr(e,t){const n=new Ee(e).div(new Ee(t)).toNumber();return isNaN(n)?"":n}window._METHOD_DEBUG_=cn;var Jr=Rt(function(e,t=!1){const n=Ie.parse(e);let r=[];return Se.traverse(n,{enter:function(e){if(e.type===Ie.Syntax.MemberExpression){const t=Qr(e);r.push(t),Object.assign(e,{name:t,type:Ie.Syntax.Identifier})}else e.type===Ie.Syntax.Identifier&&r.push(e.name);r=t?r.filter(e=>!O[e]&&"undefined"!==e):r.filter(e=>!(O[e]||"undefined"===e||D.includes(e)||e.startsWith(v)||e.startsWith("undefined.")))}}),[...new Set(r)]}),Xr=Rt(async function(e,t){const n=Jr(e,!0),r=n.filter(e=>D.includes(e)).sort(),o=n.filter(e=>e.startsWith(v)).sort(),i=await eo([...r,...o]),s=Ie.parse(e);Se.replace(s,{enter(e){if(e.type===Ie.Syntax.BinaryExpression){const{operator:t}=e,n=I[t];return n?{type:Ie.Syntax.CallExpression,arguments:[e.left,e.right],callee:{type:Ie.Syntax.Identifier,name:n},optional:!1}:e}return e}}),Se.traverse(s,{enter:function(e){e.type===Ie.Syntax.CallExpression&&e.callee.type===Ie.Syntax.Identifier&&(e.callee.name=`await Methods.${e.callee.name}`)}});const a=Te.generate(s,{format:{semicolons:!1}}),u={},c=[];i.forEach(e=>{c.push(`const ${e.key} = ${JSON.stringify(e.value)};`)}),Object.keys(t).map(e=>{if(e.includes(".")){const[n="",r]=e.split(".");u[n]||(c.push(`const ${n} = {};`),u[n]=!0),c.push(`${n}.${r} = ${JSON.stringify(t[e])};`)}else c.push(`const ${e} = ${JSON.stringify(t[e])};`)});const l=new Zr("Methods",[...c,"return (async () => {",`const res = ${a};`,"return res;","})()"].join("\n")),d=await l(cn);return console.info("【表达式】",e),console.info("【参数】",t),console.info("【执行语句】",l.toString()),console.info("【执行结果】",d),d});function Qr(e){return e.type===Ie.Syntax.MemberExpression?`${e.object.type===Ie.Syntax.MemberExpression?Qr(e.object):e.object.name}.${e.property.name}`:e.type===Ie.Syntax.Identifier?e.name:""}var Zr=Object.getPrototypeOf(async function(){}).constructor,eo=Rt(async function(e){let t=[];return e.length>0&&(t=await _gct.api.apaas.systemVar.getGetVarByKeys({keys:e.join(",")})),t});window.gct_expression={execute:Xr,identify:Jr};var to={[c.TEXT]:{attrsTransform:[{from:"specificConfig.minValue",to:"minlength"},{from:"specificConfig.maxValue",to:"maxlength"}]},[c.LONG_TEXT]:{attrsTransform:[{from:"specificConfig.minValue",to:"minlength"},{from:"specificConfig.maxValue",to:"maxlength"}]},[c.INTEGER]:{attrsTransform:[{from:"specificConfig.minValue",to:"minValue"},{from:"specificConfig.maxValue",to:"maxValue"}]},[c.LONG]:{attrsTransform:[{from:"specificConfig.minValue",to:"minValue"},{from:"specificConfig.maxValue",to:"maxValue"}]},[c.DOUBLE]:{attrsTransform:[{from:"specificConfig.minValue",to:"minValue"},{from:"specificConfig.maxValue",to:"maxValue"}]},[c.DECIMAL]:{attrsTransform:[{from:"specificConfig.digits",to:"precision"},{from:"specificConfig.minValue",to:"minValue"},{from:"specificConfig.maxValue",to:"maxValue"}]}},no=(e,t)=>{const{attrsTransform:n=[]}=to[e]??{};return n.reduce((e,n)=>{const r=me(t,n.from);return e[n.to]=r,e},{})},ro=class extends m{static async loadRenderPlugin(e,t=[]){try{const n=await this.loadPlugins(e,t);t.forEach(e=>{const t=e.key;n[t]?_gct.register.render.register(t,n[t].default):console.error(`${t} 插件加载失败,请检查插件配置是否正确`)})}catch(n){console.error(n)}}static loadMobilePlugin(e=[]){return this.loadRenderPlugin(g.MOBILE,e)}static loadPadPlugin(e=[]){return this.loadRenderPlugin(g.PAD,e)}static loadWebPlugin(e=[]){return this.loadRenderPlugin(g.WEB,e)}};function oo(e){const{style:t={}}=e||{},n="ignoringStyle"in e?e.ignoringStyle??[]:[],r=fe(t);return{wrapperStyle:de(t,n),wStyle:r,labelFont:le(t.labelFont),contentFont:le(t.contentFont)}}var io=e=>le(e);function so(e,t){return(null==e?void 0:e.map(e=>ao(e,t)))||[]}function ao(e={},t={}){var n;const r=he(e);r._X_ROW_KEY=void 0;const o=(null===(n=Object.keys(t??{}))||void 0===n?void 0:n.length)?Object.keys(r).reduce((e,n)=>{const o=t[n],i=r[n];if(o&&i)try{const t=(i+"").split(",").map(e=>o[e]);e[n]={[i+""]:t}}catch{}return e},{}):r._DICT||{};return{...r,_DICT:o,_OPCT:r.__FOREIGN__&&"object"==typeof r.__FOREIGN__?ao(r.__FOREIGN__,t):{}}}function uo(e,t,n){"object"==typeof t&&Oe(e,ao(t,n))}function co(e,t,n){if("object"!=typeof t)return;for(const o in e)"_OPCT"!==o&&"_NOSUBMIT"!==o&&delete e[o];const r=ao(t,n);r._X_ROW_KEY=t._X_ROW_KEY,Oe(e,r)}function lo(e,t={},n={}){const r=he(t.__FOREIGN__||t),o={_DICT:{}};return Object.keys(r).forEach(t=>{const i=`${e}.${t}`,s=n[t],a=r[t];if(s&&a)try{const e=(a+"").split(",").map(e=>s[e]);o._DICT[i]={[a+""]:e}}catch{}o[i]=a}),{...r,_OPCT:o}}function fo(e={},t={}){const n=he(e);return t&&0!==Object.keys(t).length?Object.keys(n).reduce((e,r)=>{const o=n[r],i=t[r];return i?null==o?(e[r]=o,e):(e[r]=String(o).split(",").map(e=>i[e]??e).filter(Boolean).join(","),e):(e[r]=o,e)},{}):n}function po(e,t,n=!1){var r;if(n||(null==e||null===(r=e.customApi)||void 0===r?void 0:r.value))return t(e);const o="object"==typeof e?Ce.stringify({...e,customApi:null}):e;let i=ho.get(o);return i||(i=(async()=>{try{return await t(e)}catch(n){throw ho.delete(o),n}})(),ho.set(o,i,5e3),i)}var ho=class{static set(e,t,n){this.cachedata[e]={maxAge:n||0,value:t,now:Date.now()}}static get(e){this.reset();const t=this.cachedata[e];return t?t.value:null}static delete(e){return delete this.cachedata[e]}static clear(){this.cachedata={}}static reset(){for(const e in this.cachedata){const t=this.cachedata[e];t&&Date.now()-t.now>t.maxAge&&this.delete(e)}}};async function go({ids:e,refOriginField:t,refOriginFieldType:n,model:r,foreignFields:o}){if(!e)return Promise.reject();const i=await async function({refOriginFieldType:e,modelKey:t,foreignFields:n,ids:r}){if(e===c.RDO_REF){const{data:e={},dict:o={}}=await _gct.api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({modelKey:t,bsKey:"rdoGetVersionByRefId",modelCategory:a.ENTITY},{refId:r},{foreignFields:n});return{data:e,dict:o}}{const{data:e={},dict:o={}}=await _gct.api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({modelKey:t,bsKey:"getOne",modelCategory:a.ENTITY},{},{query:{"id_.eq":r},foreignFields:n});return{data:e,dict:o}}}({refOriginFieldType:n,modelKey:r,foreignFields:o,ids:e});return(null==i?void 0:i.data)?lo(t,i.data,i.dict):void 0}He(ho,"cachedata",{});var mo=e=>po(e,go),yo=[y.CONTAINALL,y.CONTAINANY,y.IN,y.NOTIN];function vo(e,t,n){const{body:r,exp:o,similarField:i}=function(e){const r={};let o,i=n||"";return t.forEach(t=>{const n=t.props.fieldSearchKey||t.props.field,s=t.props.ope||[];let a=e[t.id];(function(e){return null==e||""===e||!!Array.isArray(e)&&(0===e.length||e.every(e=>null==e||""===e))})(a)&&!t.props.useMore||(!o&&n&&(o=n),s.forEach(e=>{a=function(e,t){return yo.indexOf(t)>-1&&"string"==typeof e?e.split(","):e}(a,e);const o=`${n}.${e}:${t.id}`,s=`${t.id}.${e}`;r[o]=t.props.useMore?null:a,i=i.replace(s,o)}))}),{body:r,exp:i,similarField:o}}(function(e,t){if(!t.length)return e;const n=t.filter(e=>e.props.fieldType===c.RDO_REF);return n.length?(n.forEach(t=>{if(e[t.id]){if(!Array.isArray(e[t.id])){const[n,r]=e[t.id].split(":");return r||n}e[t.id]=e[t.id].map(e=>{if(!e)return;const[t,n]=e.split(":");return n||t})}}),e):e}(e,t));return{query:r,exp:o,similarField:i}}var bo=/* @__PURE__ */new Map;async function wo(e,t={}){const{defaultValue:n}=e.props;if(!n)return null;if(Array.isArray(n)){if(!n.includes("CURRENT_ORG"))return null}else if("CURRENT_ORG"!==n)return null;const r=await _api.platform.tenant.getUserInfo();if(r){const t=await _api.apaas.designerCommon.getGetCanBeUsedOrgUser({pageNo:1,pageSize:999999999});if(t){const n=t.data;if(n&&-1!==n.findIndex(e=>e.masterOrgId===r.masterOrgId))return E(e.props.ope)?[r.masterOrgId]:r.masterOrgId}return null}}async function Oo(e,t={}){const{defaultValue:n}=e.props;if(!n)return null;if(Array.isArray(n)){if(!n.includes("CURRENT_USER"))return null}else if("CURRENT_USER"!==n)return null;const r=await _api.platform.user.getInfo();if(r){const t=await _api.apaas.designerCommon.getGetCanBeUsedOrgUser({pageNo:1,pageSize:999999999});if(t){const n=t.data;if(n&&-1!==n.findIndex(e=>e.id===r.userId))return E(e.props.ope)?[r.userId]:r.userId}return null}}async function Do(e,t={}){const{defaultValue:n}=e.props;return n&&0!==n.length?n:null}async function Eo(e,t={}){const{defaultValue:n}=e.props;return null==n?null:n}function Io(e,t,n={}){const{defaultValueType:r,defaultValue:i}=e.props;if(null==r||""==r)return null;const{isRang:s,fieldType:a}=e.props;if(!s){const e=a===c.DATE?"YYYY-MM-DD":"YYYY-MM-DD HH:mm:ss";if(r===o.SystemDate)return N(/* @__PURE__ */new Date).format(e)}if(s){const e=a===c.DATE?"YYYY-MM-DD":"YYYY-MM-DD 00:00:00",t=a===c.DATE?"YYYY-MM-DD":"YYYY-MM-DD 23:59:59",n=null!=i?Number(i):0,u=N();switch(r){case o.SystemDate:return s?[u.format(e),u.format(t)]:u.format(e);case o.PastDays:return[u.subtract(n,"day").format(e),u.subtract(n>0?1:0,"day").format(t)];case o.PastWeeks:return[u.subtract(n,"week").startOf("isoWeek").format(e),u.subtract(n>0?1:0,"week").endOf("isoWeek").format(t)];case o.PastMonths:return[u.subtract(n,"month").startOf("month").format(e),u.subtract(n>0?1:0,"month").endOf("month").format(t)];case o.PastYears:return[u.subtract(n,"year").startOf("year").format(e),u.subtract(n>0?1:0,"year").endOf("year").format(t)];case o.Yesterday:{const n=u.subtract(1,"day");return[n.format(e),n.format(t)]}case o.Past7Days:return[u.subtract(6,"day").format(e),u.format(t)];case o.Past30Days:return[u.subtract(29,"day").format(e),u.format(t)];case o.ThisWeek:return[u.startOf("isoWeek").format(e),u.endOf("isoWeek").format(t)];case o.LastWeek:{const n=u.subtract(1,"week");return[n.startOf("isoWeek").format(e),n.endOf("isoWeek").format(t)]}case o.ThisMonth:return[u.startOf("month").format(e),u.endOf("month").format(t)];case o.LastMonth:{const n=u.subtract(1,"month");return[n.startOf("month").format(e),n.endOf("month").format(t)]}case o.ThisYear:return[u.startOf("year").format(e),u.endOf("year").format(t)];case o.LastYear:{const n=u.subtract(1,"year");return[n.startOf("year").format(e),n.endOf("year").format(t)]}default:return null}}return null}bo.set(c.ORG,wo),bo.set(c.ORG_MULTI,wo),bo.set(c.USER,Oo),bo.set(c.USER_MULTI,Oo),bo.set(c.ENUM,Do),bo.set(c.ENUM_MULTI,Do),bo.set(c.INTEGER,Eo),bo.set(c.LONG,Eo),bo.set(c.DOUBLE,Eo),bo.set(c.DECIMAL,Eo),bo.set(c.TEXT,async function(e,t={}){const{defaultValue:n}=e.props;return n||null}),bo.set(c.LONG_TEXT,Eo),bo.set(c.BOOLEAN,async function(e,t={}){const{defaultValue:n}=e.props;return null==n||""===n?null:n}),bo.set(c.DATE,async function(e,t={}){return Io(e)}),bo.set(c.DATE_TIME,async function(e,t={}){return Io(e)}),bo.set(c.PRINTER,async function(e,t={}){const{defaultValue:n}=e.props;return n&&0!==n.length?n:null});function So(e,t=[]){return"ignoreCase"==(null==t?void 0:t[0])?null==e?void 0:e.replace(/\./g,".i"):e}function To(e,t=[]){return"ignoreCase"==(null==t?void 0:t[0])?null==e?void 0:e.map(e=>{const t=e.split(".");return`${t[0]}.i${t[1]}`}):e}var Co=({searchField:e,keyword:t})=>t&&(null==e?void 0:e.reduce((e,n)=>(e[n.split(".").length>1?n:n+".like"]=t,e),{}))||{},No=e=>{let t={},n="";if(ye(e))t={...e.reduce((e,t)=>(e[t.key+"."+t.ope]=t.value,e),{})};else try{const o=JSON.parse(null==e?void 0:e.dataRule);n=null==o?void 0:o.exp;const i=(null==o?void 0:o.typeMap)||{},s=(null==o?void 0:o.query)||{};for(const e in s)if("VAR"===i[e]){var r;t[e]=null===(r=qt.value)||void 0===r||null===(r=r[s[e]])||void 0===r?void 0:r.value}else t[e]=s[e]}catch(o){console.log(o)}return{query:t,getExp:function(...e){const t=[n,...e].filter(e=>e),r=t.join(",");return t.length>1?`AND(${r})`:r}}},Mo=({collation:e,collationSort:t,collationField:n})=>e?e.filter(e=>e.collationField).map(e=>({sortField:e.collationField,sortType:e.collationSort})):t?[{sortField:n,sortType:t}]:[];function xo(e,t){var n;if((null==t?void 0:t.trim())&&(null==e?void 0:e.length))return(null===(n=e[0])||void 0===n?void 0:n.split(".")[0])||void 0}var Ro=Object.prototype.toString;function Po(e,t){return Ro.call(e)===`[object ${t}]`}function Ao(e){return void 0!==e}function _o(e){return!Ao(e)}function ko(e){return null!==e&&Po(e,"Object")}function $o(e){return Wo(e)||Uo(e)?0===e.length:e instanceof Map||e instanceof Set?0===e.size:!!ko(e)&&0===Object.keys(e).length}function Yo(e){return Po(e,"Date")}function jo(e){return null===e}function Ho(e){return _o(e)&&jo(e)}function Fo(e){return _o(e)||jo(e)}function Vo(e){return Po(e,"Number")}function Bo(e){return Po(e,"Promise")&&ko(e)&&Lo(e.then)&&Lo(e.then)}function Uo(e){return Po(e,"String")}function Lo(e){return"function"==typeof e}function Go(e){return Po(e,"Boolean")}function Ko(e){return Po(e,"RegExp")}function Wo(e){return!!e&&Array.isArray(e)}function qo(e){return"undefined"!=typeof window&&Po(e,"Window")}function zo(e){return ko(e)&&!!e.tagName}function Jo(e){return Po(e,"Map")}function Xo(e){return/^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/.test(e)}function Qo(e){return void 0===e||!e&&0!==e&&"0"!==e||!/[^\s]/.test(e+"")}function Zo(e,t){const n=[],r=e.props.fieldType,o=R(()=>e.props.readonly&&r&&!n.includes(r)&&(void 0===t.value||""===t.value||null===t.value));return{RenderEmptyValue:/* @__PURE__ */Y((e,t)=>()=>_gct.store.getEmptyDisplay),isEmpty:o}}var ei=(e,t)=>["post","put"].includes(t)?(t,n={},r={},o={})=>e({modelKey:t.key,bsKey:t.action,modelCategory:t.modelCategory??a.ENTITY},r,n,o):(t,n={},r={})=>e({modelKey:t.key,bsKey:t.action,modelCategory:t.modelCategory??a.ENTITY},n,r),ti={post:ei(_gct.api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey,"post"),get:ei(_gct.api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey,"get"),put:ei(_gct.api.apaas.modelComprehensive.putBizServiceModelCategoryModelKeyBsKey,"put"),delete:ei(_gct.api.apaas.modelComprehensive.deleteBizServiceModelCategoryModelKeyBsKey,"delete")};async function ni(e,n,...r){return ti[t[e.action]](e,n,...r)}async function ri(e,t,{body:n={},query:r={}}={},o={}){return await _gct.api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey({bsKey:t,modelKey:e,modelCategory:a.ENTITY},r,n,o)}var oi=class e{constructor(){if(He(this,"mask",void 0),He(this,"container",void 0),He(this,"spinner",void 0),e.instance)return e.instance;e.instance=this,this.createLoadingElement(),this.initStyle()}createLoadingElement(){this.mask=document.createElement("div"),this.mask.id="gct-global-loading-mask",this.container=document.createElement("div"),this.container.id="gct-global-loading-container",this.spinner=document.createElement("div"),this.spinner.id="gct-global-loading-spinner",this.container.appendChild(this.spinner),this.mask.appendChild(this.container),document.body.appendChild(this.mask)}initStyle(){Object.assign(this.mask.style,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(255, 255, 255, 0.5)",zIndex:9999,display:"none",justifyContent:"center",alignItems:"center"}),Object.assign(this.container.style,{display:"flex",flexDirection:"column",alignItems:"center",width:"43px",height:"43px",backgroundColor:"transparent",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.15)"}),Object.assign(this.spinner.style,{display:"grid",width:"43px",height:"43px",gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"repeat(2, 1fr)",gap:"3px"});const e=getComputedStyle(document.documentElement).getPropertyValue("--gct-color-primary").trim();[{id:"gct-global-loading-item_1",delay:"0s"},{id:"gct-global-loading-item_2",delay:"0.25s"},{id:"gct-global-loading-item_3",delay:"0.75s"},{id:"gct-global-loading-item_4",delay:"0.5s"}].forEach(t=>{const n=document.createElement("div");n.id=t.id,Object.assign(n.style,{backgroundColor:e,opacity:.2,animation:"globalLoading 1s infinite",animationDelay:t.delay}),this.spinner.appendChild(n)});const t=document.createElement("style");t.textContent="\n @keyframes globalLoading {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0.2;\n }\n }",document.head.appendChild(t)}show(){this.mask.style.display="flex",document.body.style.overflow="hidden"}hide(){this.mask.style.display="none",document.body.style.overflow=""}};He(oi,"instance",void 0);var ii=new oi,si=class{constructor({taskId:e,processInstanceId:t,examineAndApproveState:n=u.MY_CUSTOM,refFormId:r}){He(this,"isHandle",!1),He(this,"buttonConfig",{}),He(this,"fieldConfig",{}),He(this,"processId",""),He(this,"dataId",""),He(this,"taskId",void 0),He(this,"processInstanceId",void 0),He(this,"refFormId",void 0),He(this,"examineAndApproveState",u.MY_CUSTOM),He(this,"fieldStatus",""),He(this,"viewPageKey",void 0),He(this,"isviewPage",void 0),He(this,"isAPPviewPage",void 0),He(this,"nonRelatedPerson",!1),this.taskId=e,this.processInstanceId=t,this.examineAndApproveState=n,this.refFormId=r}async readyProcess(){const{taskId:e,processInstanceId:t}=this;if(this.examineAndApproveState===u.MY_AGENT){await this.getDataInfo();const{node:t,processDefId:r,webViewPageKey:o,mobileViewPageKey:i}=await _gct.api.apaas.pmProcessEngine.getTaskExtension({taskId:e});this.transformByNode(t),this.processId=r;for(const e in this.buttonConfig)e===n.Withdraw&&(this.buttonConfig[e].show=!1);this.viewPageKey=(null==t?void 0:t.webViewPageKey)||o,this.isAPPviewPage=!!(null==t?void 0:t.mobileViewPageKey)||!!i}if(this.examineAndApproveState===u.MY_APPLICATION){await this.getDataInfo();const{node:e,processDefId:r,withdrawOp:o}=await _gct.api.apaas.pmProcessEngine.getInitialTaskExtension({processInstanceId:t})||{};this.transformByNode(e),this.processId=r;for(const t in this.buttonConfig)t===n.End&&(this.buttonConfig[t].show=!1),t===n.Withdraw&&(this.buttonConfig[t].show=!!o),t===n.Resubmit&&(this.buttonConfig[t].show=!1)}if(this.examineAndApproveState===u.MY_DONE){await this.getDataInfo();const{node:t,processDefId:n}=await _gct.api.apaas.pmProcessEngine.getHiTaskExtension({taskId:e});this.transformByNode(t),this.processId=n}if(this.examineAndApproveState===u.MY_CUSTOM){await this.getDataInfo();const{node:e,processDefId:n,btnList:r,webViewPageKey:o,taskId:i,initiatorNode:s}=await _gct.api.apaas.pmProcessEngine.getProcInstExtension({procInstId:t}),a=r||[];this.withdrawByNode(s),this.transformByNode(e),this.processId=n;for(const t in this.buttonConfig){const e=t;this.buttonConfig[e].show&&(this.buttonConfig[e].show=a.includes(t))}if(!e)return void(this.nonRelatedPerson=!0);!a.length||"__initiator__"===(null==e?void 0:e.key)&&!i?this.isviewPage=!0:this.viewPageKey=(null==e?void 0:e.webViewPageKey)||o}if(this.examineAndApproveState===u.MY_CUSTOM_Modal){await this.getDataInfo();const{node:e,btnList:n,taskId:r,processDefId:o,initiatorNode:i}=await _gct.api.apaas.pmProcessEngine.getProcInstExtension({procInstId:t}),s=n||[];this.withdrawByNode(i),this.transformByNode(e),this.processId=o;for(const t in this.buttonConfig){const e=t;this.buttonConfig[e].show&&(this.buttonConfig[e].show=s.includes(t))}if(!e)return void(this.nonRelatedPerson=!0);s.length&&("__initiator__"!==(null==e?void 0:e.key)||r)||(this.isviewPage=!0)}}withdrawByNode(e){if(!e)return;const{buttonConfig:t}=e;JSON.parse(t+"").forEach(e=>{const t=S(`sys.process.paasBpmnButtonEvent.${e.type}`);this.buttonConfig[e.type]={showModel:!1,title:S("sys.process.element.approval")+t,success:t+S("sys.success")+"!",show:e.enable,alias:e.alias,signature:!!e.signature,opinion:{},user:{}}})}transformByNode(e){if(e)try{const{opinionConfig:t,buttonConfig:r,fieldConfig:o}=e,i=JSON.parse(r||"[]"),s=JSON.parse(t||'{"enabled":false,"opinionType":[]}');i.forEach(e=>{const t=S(`sys.process.paasBpmnButtonEvent.${e.type}`);var r,o;this.buttonConfig[e.type]={showModel:![n.Resubmit,n.Withdraw,n.End].includes(e.type),title:S("sys.process.element.approval")+t,success:t+S("sys.success")+"!",show:e.enable,alias:e.alias,signature:!!e.signature,opinion:{show:s.enabled,required:(r=s.opinionType,o=e.type,!!r.includes(h.Required)||!r.includes(h.Optional)&&(r.includes(h.ApproveRequired)||r.includes(h.ApproveRequired)?o===n.Approve:r.includes(h.CountersignRequired)?o===n.Countersign:r.includes(h.ReassignRequired)?o===n.Reassign:r.includes(h.RejectRequired)?o===n.Reject:r.includes(h.RefuseRequired)?o===n.Refuse:void 0))},user:{show:[n.Reassign,n.Countersign].includes(e.type),multiple:n.Countersign===e.type,label:S(`sys.process.user.${e.type}`)}}}),this.fieldConfig=JSON.parse(o+"")}catch(t){console.error("流程信息解析失败",t)}}async getDataInfo(){const{dataId:e}=await _gct.api.apaas.pmProcessEngine.getModel({processInstanceId:this.processInstanceId});this.dataId=e}filterButton(e){return this.nonRelatedPerson||this.examineAndApproveState===u.MY_DONE?[]:e.filter(e=>{if(e.type===d.ProcessApproveButton){const t=this.buttonConfig[e.props.action],n=!!(null==t?void 0:t.show);return n&&(e.props.title=t.alias),n}return!0})}useFieldWidget(e){if(this.nonRelatedPerson)return;const t=e.props.field,{fieldConfig:n,examineAndApproveState:r}=this;if(n&&n[t]){const{permission:r}=n[t];switch(r){case ai.disabled:e.props.disabled=!0,e.props.readonly=!1;break;case ai.editable:e.props.disabled=!1,e.props.readonly=!1;break;case ai.readonly:e.props.readonly=!0}}else e.props.readonly=!0;e.props.disabled||![u.MY_APPLICATION,u.MY_DONE].includes(r)&&!this.isviewPage||(e.props.readonly=!0)}useFieldToShow(e){const t=e.props.field,{fieldConfig:n}=this;if(n&&n[t]){const{permission:r}=n[t];r===ai.hidden&&(e.props.hidden=!0)}}};var ai=/* @__PURE__ */function(e){return e.hidden="hidden",e.readonly="readonly",e.disabled="disabled",e.editable="editable",e}({}),ui=class e{static register(e,t){Object.entries(t).forEach(([t,n])=>{if("function"!=typeof n)return void console.error(`套件 ${e} 注册上下文扩展 ${t} 失败:扩展值必须是函数`);const r=this.extensions.get(t);if(r){const n=r.suiteKey===e?"同一套件重复":"套件间";console.warn(`${n}注册上下文扩展 ${t}:${r.suiteKey} 将被 ${e} 覆盖`)}this.extensions.set(t,{suiteKey:e,method:n})})}apply(t){e.extensions.forEach(({suiteKey:e,method:n},r)=>{this.isReservedKey(t,r)?console.error(`套件 ${e} 的上下文扩展 ${r} 与内置上下文方法冲突,已跳过挂载`):t[r]=(...e)=>n(t,...e)})}isReservedKey(e,t){return t in e}};function ci(e,t){ui.register(e,t)}function li(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function di(e,t,n){li(e,t),t.set(e,n)}function fi(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function pi(e,t,n){return e.set(fi(e,t),n),n}function hi(e,t){return e.get(fi(e,t))}He(ui,"extensions",/* @__PURE__ */new Map);var gi=new ui,mi=/* @__PURE__ */new WeakMap,yi=/* @__PURE__ */new WeakMap,vi=/* @__PURE__ */new WeakSet,bi=class{constructor({js:e,css:t,pageKey:n,ContextVm:r}){var o;li(this,o=vi),o.add(this),He(this,"context",void 0),He(this,"searchVNodes",void 0),He(this,"cssData",void 0),He(this,"pageKey",void 0),He(this,"exports",void 0),di(this,mi,void 0),di(this,yi,void 0),He(this,"ProcessAppRoved",void 0),He(this,"pageLayoutMode",void 0),this.cssData=fi(vi,this,wi).call(this,t),this.searchVNodes={},this.exports={},pi(yi,this,{}),pi(mi,this,{}),this.context=new r({$ref:this.getComponent.bind(this),$asyncRef:this.getSyncComponent.bind(this)}),gi.apply(this.context),fi(vi,this,Oi).call(this,e),Zt.setContextByKey(this.context,n),this.pageKey=n}async runProcessBySaskId({taskId:e,processInstanceId:t,examineAndApproveState:n,refFormId:r}){this.ProcessAppRoved=new si({taskId:e,processInstanceId:t,examineAndApproveState:n,refFormId:r}),await this.ProcessAppRoved.readyProcess()}runContext(e,t){this.context.gctWidgets[e]=t}async runEventByName(e,t={},...n){const r=t[e];let o;if(r){if(Array.isArray(r))o=await async function(e,t,n){const r=e.map(Ti.bind(t,n));await Promise.all(r)}(r,this.context,n);else{const e=this.exports[r.name];if(!e)throw`函数${r.name}不存在`;o=await e(...n,re(r.extraParams))}return o}}async runExportByName(e,...t){try{const n=this.exports[e];if(!n)throw`函数${e}不存在`;return n(...t)}catch(n){console.error(n)}}async runAsyncExportByName(e,...t){try{const n=this.exports[e];if(!n)throw`函数${e}不存在`;return await this.getReadyByFun(n),n(...t)}catch(n){console.error(n)}}initNode(e,t){e&&(hi(yi,this)[e]=t,fi(vi,this,Ei).call(this,e,t))}destroyNode(e){delete hi(yi,this)[e],delete hi(mi,this)[e]}initSearchs(e,t,n){if(e)if(this.searchVNodes[e]){const r=this.searchVNodes[e].find(e=>e.comId===n);r?r.callback=t:this.searchVNodes[e].push({callback:t,comId:n})}else this.searchVNodes[e]=[{callback:t,comId:n}]}cancelInitSearchs(e,t){e&&this.searchVNodes[e]&&(this.searchVNodes[e]=this.searchVNodes[e].filter(e=>e.comId!==t),0===this.searchVNodes[e].length&&delete this.searchVNodes[e])}runTableBySearch(e,t){(this.searchVNodes[e]||[]).forEach(({callback:e})=>e(t))}getComponent(e){const t=hi(yi,this)[e];if(t)return new Si(e,t);console.error(e+"组件不存在或者未初始化")}getSyncComponent(e){if(!e)return Promise.reject("标识不能为空");const t=hi(yi,this)[e];return t?Promise.resolve(new Si(e,t)):new Promise((t,n)=>{const r=setTimeout(()=>{n(e+"不存在或者被隐藏")},3e4);fi(vi,this,Di).call(this,e,n=>{clearTimeout(r),t(new Si(e,n))})})}async getReadyByFun(e){var t;if("function"!=typeof e)return Promise.reject("参数必须是函数");const n=(null===(t=String(e).match(/\$ref\((["'A-Za-z0-9_-]+)\)/g))||void 0===t?void 0:t.map(e=>{var t;const n=null===(t=e.match(/\$ref\(['|"]([A-Za-z0-9_-]+)['|"]\)/))||void 0===t?void 0:t[1];return this.getSyncComponent(n)}))||[];await Promise.all(n)}async processHandle(e,{opinion:t,reassignId:n,signature:r,countersignUserIds:o,button:i}){const{taskId:s,processInstanceId:a}=this.ProcessAppRoved,u={procInstId:a,data:e,opinion:t,button:i,countersignUserIds:o,taskId:s,signature:r,reassignId:n};await _gct.api.apaas.pmProcessEngine.postProcExecute(u)}async checkedProcess(e){const{processId:t}=this.ProcessAppRoved||{};return t?e!==t?Promise.reject(S("sys.process.processInstanceMismatch")):void 0:Promise.reject(S("sys.process.pleaseInitiateTheProcessFirst"))}};function wi(e,t={}){if(!e)return;const{css:n,load:r,unload:o}=function(e,t={}){const n=ne(!1),{document:r=Dt,immediate:o=!0,manual:i=!1,id:s="vueuse_styletag_"+ ++Pt}=t,a=ne(e);let u=()=>{};const c=()=>{if(!r)return;const e=r.getElementById(s)||r.createElement("style");e.isConnected||(e.id=s,t.nonce&&(e.nonce=t.nonce),t.media&&(e.media=t.media),r.head.appendChild(e)),n.value||(u=ue(a,t=>{e.textContent=t},{immediate:!0}),n.value=!0)},l=()=>{r&&n.value&&(u(),r.head.removeChild(r.getElementById(s)),n.value=!1)};var d;return o&&!i&&bt(c),i||(d=l,H()&&W(d,void 0)),{id:s,css:a,unload:l,load:c,isLoaded:Q(n)}}(e,t);return{css:n,load:r,unload:o}}function Oi(e){if(e)try{new Function("exports","CTX",e)(this.exports,this.context)}catch(t){console.error(t,"createFunction")}}function Di(e,t){const n=hi(yi,this)[e];n?t(e,n):hi(mi,this)[e]?hi(mi,this)[e].push(t):hi(mi,this)[e]=[t]}function Ei(e,t){hi(mi,this)[e]&&hi(mi,this)[e].forEach(e=>{e(t)})}var Ii=class{constructor({$ref:e,$asyncRef:t}){He(this,"$ref",void 0),He(this,"$asyncRef",void 0),He(this,"$getModal",void 0),He(this,"$closeModal",void 0),He(this,"$customBizService",ti),He(this,"gctWidgets",{}),He(this,"$utility",{_:pe,cloneDeep:he,differenceBy:ge,dayjs:N,BigNumber:Ee,plus:(e,t)=>new Ee(e).plus(new Ee(t)).toNumber(),minus:(e,t)=>new Ee(e).minus(new Ee(t)).toNumber(),multipliedBy:(e,t)=>new Ee(e).multipliedBy(new Ee(t)).toNumber(),div:(e,t)=>new Ee(e).div(new Ee(t)).toNumber(),transformSourceData:so,transformData:ao}),He(this,"$httpBizService",ni),He(this,"$request",ri),He(this,"$loading",ii),this.$asyncRef=t,this.$ref=e}$getPremission(e){return Zt.getPremission(e)}$setPremission(e,t){Zt.setPremission(e,t)}$getAppGlobalVar(e){return Zt.getGlobalVar(e)}$setAppGlobalVar(e,t){Zt.setGlobalVar(e,t)}$getPageGlobalVar(e){return Zt.getPageGlobalVar(e)}$setPageGlobalVar(e,t){Zt.setPageGlobalVar(e,t)}$getPageVar(e){return Zt.getPageVar(e)}$setPageVar(e,t){Zt.setPageVar(e,t)}$getCtxById(e){return Zt.getContextByKey(e)}$setPropsByKey(e,t){var n;const r=null===(n=this.gctWidgets[e])||void 0===n?void 0:n.props;if(r)for(const o in t)r[o]=t[o]}$getPropsByKey(e,t=[],n){const r=this.gctWidgets[e];if(!r)return{};const o=n||!r.props?r:r.props;return"string"==typeof t&&(t=[t]),t.reduce((e,t)=>(e[t]=o[t],e),{})}},Si=class{constructor(e,t){He(this,"modelKey",void 0),He(this,"getValue",void 0),He(this,"setValue",void 0),He(this,"submit",void 0),He(this,"reload",void 0),He(this,"key",void 0),this.key=e;const n=t.elRef;Object.keys(n).forEach(e=>{this[e]=n[e]})}};async function Ti(e,t){const{name:n,refId:r,scopeId:o,modalTitle:i}=t,s=(null==i?void 0:i.split("."))||[];let a;if(s.length>1){var u;const e=[];Ci(e,(null===(u=this.gctWidgets)||void 0===u?void 0:u[s[0]])||{}),a=e.find(e=>e.id===s[1])||{}}else if(s.length){var c;a=null===(c=this.gctWidgets)||void 0===c?void 0:c[s[0]]}var l;n===p.OPEN_MODAL&&await this.$getModal(r).open({title:null==a||null===(l=a.props)||void 0===l?void 0:l.title}),n===p.CLOSE_MODAL&&(r?await this.$getModal(r).close():await this.$closeModal()),n===p.REFRESH_TABLE&&await(await this.$getCtxById(o).$asyncRef(r)).reload(e?e[0]:null)}function Ci(e,t){const n=t.children||[];for(const o of n)if(o.type&&o.type==d.CustomButton)e.push(o);else{var r;(null===(r=o.children)||void 0===r?void 0:r.length)&&Ci(e,o)}}function Ni({expression:e="",rowData:t=null,immediate:n=!0},r){if(!e||"true"===e)return void r(!0);const o=Jr(e),i=o.reduce((e,t)=>{const n=t.split(".");return e[t]={formKey:n[0],itemKey:n[1]},e},{}),s=R(()=>o.reduce((e,n)=>{const r=n.split("."),o=r[0]+"",i=r[1];if(i){var s;const n=(t?t[i]:null===(s=zt.value[o])||void 0===s?void 0:s[i])??"";e[o]?e[o][i]=n:e[o]={[i]:n}}else if(o.startsWith("$VAR_")||o.startsWith("$IVAR_")){var a;e[o]=(null===(a=qt.value[o])||void 0===a?void 0:a.value)??""}else if(o.startsWith("$PAGERVAR_")||o.startsWith("$IPAGERVAR_")){var u;e[o]=(null===(u=Wt.value[o])||void 0===u?void 0:u.value)??""}return e},{}));function a(t){const n={};Object.keys(i).forEach(e=>{var r;const{formKey:o,itemKey:s}=i[e];n[e]=s?null===(r=t[o])||void 0===r?void 0:r[s]:t[o]}),Xr(e,n).then(r).catch(t=>{console.error("[组件依赖] 表达式计算失败:",e,n,t)})}t&&n&&a(s.value),wt(s,()=>{a(s.value)},{debounce:200,immediate:n&&!t})}async function Mi({expression:e="",rowData:t=null}){if(!e||"true"===e)return!0;const n=Jr(e).reduce((e,t)=>{const n=t.split(".");return e[t]={formKey:n[0],itemKey:n[1]},e},{}),r={};return Object.keys(n).forEach(e=>{const{formKey:o,itemKey:i}=n[e];let s="";var a;if(o.startsWith("$VAR_"))s=(null===(a=qt.value[o])||void 0===a?void 0:a.value)??"";else if(o.startsWith("$PAGERVAR_")){var u;s=(null===(u=Wt.value[o])||void 0===u?void 0:u.value)??""}else if(i){var c;s=(t?t[i]:null===(c=zt.value[o])||void 0===c?void 0:c[i])??""}else s=(t?t[o]:zt.value[o])??"";r[e]=s}),Xr(e,r)}function xi(e,t){return en(t)?e.displayType===s.CONFIG?oe(()=>!e.hidden):function(e){const t=Z(!1);return Ri(e,e=>{t.value=!!e}),t}(e):Z(!1)}function Ri({displayRule:e,tableForm:t},n){if(e){const r=Jr(e),o=r.reduce((e,t)=>{const n=t.split(".");return e[t]={formKey:n[0],itemKey:n[1]},e},{}),i=oe(()=>r.reduce((e,n)=>{var r;const o=n.split("."),i=o[0]+"",s=o[1]+"",a=null===(r={...t,...zt.value}[i])||void 0===r?void 0:r[s];return e[i]?e[i][s]=a:e[i]={[s]:a},e},{}));wt(i,()=>{!function(e,t,n,r){const o={};Object.keys(t).forEach(n=>{var r;const{formKey:i,itemKey:s}=t[n];o[n]=null==e||null===(r=e[i])||void 0===r?void 0:r[s]}),Xr(n,o).then(r).catch(e=>{console.error("[显隐规则] 表达式计算失败:",n,o,e)})}(i.value,o,e,e=>{n(e)})},{immediate:!0,debounce:300})}else n(!0)}function Pi(e,t){const n=X({});return oe(()=>e?e.filter(e=>{const{displayRule:r,hidden:o,displayType:i}=e.props||e;return en(e.id)?i===s.CONFIG?n[e.id]=!o:Ri({displayRule:r,tableForm:t},t=>{n[e.id]=t}):n[e.id]=!1,n[e.id]}):[])}function Ai(e,t){if(!(null==e?void 0:e.length))return;const n=[],r=[];e.forEach((e,t)=>{e.displayRule?r.push({...e,id:t}):n.push({...e,id:t})});const o=_i(r,t),i=_i(n,t);return oe(()=>(null==o?void 0:o.value)||(null==i?void 0:i.value))}function _i(e,t){const n=X({});if(e)return oe(()=>e.find(e=>{const{displayRule:r,hidden:o,displayType:i}=e.props||e;return i===s.CONFIG?n[e.id]=!o:Ri({displayRule:r,tableForm:t},t=>{n[e.id]=t}),n[e.id]}))}function ki(e){var t,n;return(null===(t=e.props)||void 0===t?void 0:t.displayRule)&&(null===(n=e.props)||void 0===n?void 0:n.displayType)===s.RULE?xi(e.props,e.id):$i(e)}function $i(e,t){var n;if(!e.id)return e.props.hidden=!0,Z(!1);if(!en(e.id))return e.props.hidden=!0,Z(!1);const r=V("useProcessFieldEvent",void 0);if(r)return r.useFieldToShow(e),oe(()=>!e.props.hidden);const{displayType:o,displayRule:a}=e.props||{},{value:u,expression:c}=((null===(n=e.props.componentDependency)||void 0===n?void 0:n.configDependency)||{})[i.HIDDEN]||{};return u&&c?(e.props.hidden=!0,Ni({expression:c,rowData:t},t=>{e.props.hidden=!!t})):u?e.props.hidden=!0:o===s.RULE&&a&&(e.props.hidden=!0,Ni({expression:a,rowData:t},t=>{e.props.hidden=!t})),oe(()=>!e.props.hidden)}async function Yi(e,t){var n;if(!e.id)return!1;if(!en(e.id))return e.props.hidden=!0,!1;const r=V("useProcessFieldEvent",void 0);if(r)return r.useFieldToShow(e),!e.props.hidden;const{displayType:o,displayRule:a}=e.props||{},{value:u,expression:c}=((null===(n=e.props.componentDependency)||void 0===n?void 0:n.configDependency)||{})[i.HIDDEN]||{},l=async e=>{try{return await Mi({expression:e,rowData:t})}catch(n){return console.error("[组件依赖] 显隐规则表达式计算失败:",e,n),!0}};return u&&c?(e.props.hidden=!0,e.props.hidden=await!!l(c)):u?e.props.hidden=!0:o===s.RULE&&a&&(e.props.hidden=!0,e.props.hidden=await!!l(a)),!e.props.hidden}function ji(e,t){return e.forEach(e=>{$i(e,t)}),oe(()=>e.filter(e=>!e.props.hidden))}function Hi(e,t){var n;const{value:r,expression:o}=((null===(n=e.props.componentDependency)||void 0===n?void 0:n.configDependency)||{})[i.HIDDEN]||{};r&&o&&Ni({expression:o},e=>{t(e)}),t(e.props.hidden)}function Fi(e){var t;const n=(null===(t=e.props.componentDependency)||void 0===t?void 0:t.configDependency)||{},{value:r,expression:o}=n[i.HIDDEN]||{};r&&o&&Ni({expression:o},t=>{e.props.hidden=!!t});const{value:s,expression:a}=n[i.REQUIRED]||{};s&&a&&Ni({expression:a},t=>{e.props.required=!!t})}function Vi(t,n={},r=!1){var o,s,a;const{readonly:u,field:c,isFieldModel:l,bindFieldLink:d,refOriginField:f,refOriginModelKey:p,refOriginFieldType:h}=t.props,g=(null===(o=t.props.componentDependency)||void 0===o?void 0:o.configDependency)||{},m=V("formReadonly",void 0),y=V("useProcessFieldEvent",void 0);if(y&&y.useFieldWidget(t),!y&&t.formItem&&void 0!==(null==m?void 0:m.value)&&(t.props.readonly=(null==m?void 0:m.value)||t.props.readonly),!y&&!(null==m?void 0:m.value)){var v,b,w,O,D,E,I,S;const e=Z(null),o=Z(!1),s=Z(!1),a=()=>{const n=e.value??u;t.props.readonly=n&&!o.value&&!s.value},c=null===(v=g[i.READONLY])||void 0===v?void 0:v.expression,l=null===(b=g[i.READONLY])||void 0===b?void 0:b.fieldValue,d=null===(w=g[i.READONLY])||void 0===w?void 0:w.value;!l&&d&&c&&Ni({expression:c,rowData:r?n:null},t=>{e.value=!!t,a()});const f=null===(O=g[i.REQUIRED])||void 0===O?void 0:O.expression,p=null===(D=g[i.REQUIRED])||void 0===D?void 0:D.value;!(null===(E=g[i.REQUIRED])||void 0===E?void 0:E.fieldValue)&&p&&f&&Ni({expression:f,rowData:r?n:null},e=>{t.props.required=!!e,o.value=!!e,a()});const h=null===(I=g[i.DISABLED])||void 0===I?void 0:I.expression;(null===(S=g[i.DISABLED])||void 0===S?void 0:S.value)&&h&&Ni({expression:h,rowData:r?n:null},e=>{t.props.disabled=!!e,s.value=!!e,a()})}const T=null===(s=g[i.ASSIGNMENT])||void 0===s?void 0:s.expression,C=null===(a=g[i.ASSIGNMENT])||void 0===a?void 0:a.strategy,N=Z(!1);if(C===e.notCoveredForever){const e=n[c];""!==e&&null!=e&&(N.value=!0)}T&&!u&&Ni({expression:T,rowData:r?n:null,immediate:!1},t=>{(C!==e.notCovered&&C!==e.notCoveredForever||!N.value)&&(n[c]=t)});const M=l?null==d?void 0:d.join("."):c;n._OPCT||(n._OPCT={_DICT:{}});const x=R(()=>l?n._OPCT:n),P=R({get:()=>M?x.value[M]:"",set(t){T&&C===e.alwaysCover||(T&&C===e.notCovered&&(N.value=""!==t&&null!=t&&0!==t&&!1!==t),T&&C===e.notCoveredForever&&(N.value=!0),x.value[M]=t)}});if(l&&f){const e=oe(()=>n[d[0]]),t=d.length>2?[d[1]+".*"]:void 0;wt(e,async()=>{try{const n=await mo({ids:e.value,refOriginField:d[0],refOriginFieldType:h,model:p,foreignFields:t});x.value[M]=n._OPCT[M],x.value._DICT||(x.value._DICT={}),x.value._DICT[M]=n._OPCT._DICT[M]}catch{for(const e in x.value)e.startsWith(M)&&(x.value[e]=void 0)}},{debounce:100,immediate:!0})}return{value:P,formRowData:x,fieldKey:M}}function Bi(e){var t,n,r,o;const{readonly:s}=e.props,a=(null===(t=e.props.componentDependency)||void 0===t?void 0:t.configDependency)||{},u=null===(n=a[i.REQUIRED])||void 0===n?void 0:n.expression,c=null===(r=a[i.REQUIRED])||void 0===r?void 0:r.value;!(null===(o=a[i.REQUIRED])||void 0===o?void 0:o.fieldValue)&&c&&u&&Ni({expression:u},t=>{e.props.required=!!t,e.props.readonly=!t&&s})}var Ui={preview:{type:Boolean,default:!1},c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,required:!0}},Li={preview:{type:Boolean,default:!1},c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,required:!0}},Gi={preview:{type:Boolean,default:!1},c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,required:!0},field:{type:Object,required:!0},value:{type:Object}},Ki=/* @__PURE__ */ke({Vue:()=>M,Vue2:()=>{},del:()=>Ji,install:()=>qi,isVue2:()=>!1,isVue3:()=>!0,set:()=>zi});import*as Wi from"vue";function qi(){}function zi(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function Ji(e,t){Array.isArray(e)?e.splice(t,1):delete e[t]}$e(Ki,Wi,"default");var Xi=Symbol.for("DndContextType");function Qi(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Zi="function"==typeof Symbol&&Symbol.observable||"@@observable",es=function(){return Math.random().toString(36).substring(7).split("").join(".")},ts={INIT:"@@redux/INIT"+es(),REPLACE:"@@redux/REPLACE"+es(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+es()}};function ns(e){var t=typeof e;return"production"!==process.env.NODE_ENV&&(t=function(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";var n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}(e)),t}function rs(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?Qi(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?Qi(1):"Expected the enhancer to be a function. Instead, received: '"+ns(n)+"'");return n(rs)(e,t)}if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Qi(2):"Expected the root reducer to be a function. Instead, received: '"+ns(e)+"'");var o=e,i=t,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function l(){if(u)throw new Error("production"===process.env.NODE_ENV?Qi(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function d(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Qi(4):"Expected the listener to be a function. Instead, received: '"+ns(e)+"'");if(u)throw new Error("production"===process.env.NODE_ENV?Qi(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var t=!0;return c(),a.push(e),function(){if(t){if(u)throw new Error("production"===process.env.NODE_ENV?Qi(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,c();var n=a.indexOf(e);a.splice(n,1),s=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error("production"===process.env.NODE_ENV?Qi(7):"Actions must be plain objects. Instead, the actual type was: '"+ns(e)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?Qi(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(u)throw new Error("production"===process.env.NODE_ENV?Qi(9):"Reducers may not dispatch actions.");try{u=!0,i=o(i,e)}finally{u=!1}for(var t=s=a,n=0;n<t.length;n++)(0,t[n])();return e}return f({type:ts.INIT}),(r={dispatch:f,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Qi(10):"Expected the nextReducer to be a function. Instead, received: '"+ns(e));o=e,f({type:ts.REPLACE})}})[Zi]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error("production"===process.env.NODE_ENV?Qi(11):"Expected the observer to be an object. Instead, received: '"+ns(e)+"'");function n(){e.next&&e.next(l())}return n(),{unsubscribe:t(n)}}})[Zi]=function(){return this},e},r}function os(e,t,...n){if("undefined"!=typeof process&&"production"===process.env.NODE_ENV&&void 0===t)throw new Error("invariant requires an error message argument");if(!e){let e;if(void 0===t)e=/* @__PURE__ */new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let r=0;e=new Error(t.replace(/%s/g,function(){return n[r++]})),e.name="Invariant Violation"}throw e.framesToPop=1,e}}function is(e){return"object"==typeof e}var ss="dnd-core/INIT_COORDS",as="dnd-core/BEGIN_DRAG",us="dnd-core/PUBLISH_DRAG_SOURCE",cs="dnd-core/HOVER",ls="dnd-core/DROP",ds="dnd-core/END_DRAG";function fs(e,t){return{type:ss,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var ps={type:ss,payload:{clientOffset:null,sourceClientOffset:null}};function hs(e){return function(t=[],n={publishSource:!0}){const{publishSource:r=!0,clientOffset:o,getSourceClientOffset:i}=n,s=e.getMonitor(),a=e.getRegistry();e.dispatch(fs(o)),function(e,t,n){os(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(e){os(n.getSource(e),"Expected sourceIds to be registered.")})}(t,s,a);const u=function(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,s);if(null==u)return void e.dispatch(ps);let c=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");!function(e){os("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(i),c=i(u)}e.dispatch(fs(o,c));const l=a.getSource(u).beginDrag(s,u);return null!=l?(function(e){os(is(e),"Item must be an object.")}(l),a.pinSource(u),{type:as,payload:{itemType:a.getSourceType(u),item:l,sourceId:u,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!r}}):void 0}}function gs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ms(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){gs(e,t,n[t])})}return e}function ys(e){return function(t={}){const n=e.getMonitor(),r=e.getRegistry();!function(e){os(e.isDragging(),"Cannot call drop while not dragging."),os(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n),function(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n).forEach((o,i)=>{const s={type:ls,payload:{dropResult:ms({},t,vs(o,i,r,n))}};e.dispatch(s)})}}function vs(e,t,n,r){const o=n.getTarget(e);let i=o?o.drop(r,e):void 0;return function(e){os(void 0===e||is(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:r.getDropResult()),i}function bs(e){return function(){const t=e.getMonitor(),n=e.getRegistry();!function(e){os(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const r=t.getSourceId();return null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:ds}}}function ws(e,t){return null===t?null===e:Array.isArray(e)?e.some(e=>e===t):e===t}function Os(e){return function(t,{clientOffset:n}={}){!function(e){os(Array.isArray(e),"Expected targetIds to be an array.")}(t);const r=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,n){for(let r=e.length-1;r>=0;r--){const o=e[r];ws(t.getTargetType(o),n)||e.splice(r,1)}}(r,i,o.getItemType()),function(e,t,n){os(t.isDragging(),"Cannot call hover while not dragging."),os(!t.didDrop(),"Cannot call hover after drop.");for(let r=0;r<e.length;r++){const t=e[r];os(e.lastIndexOf(t)===r,"Expected targetIds to be unique in the passed array."),os(n.getTarget(t),"Expected targetIds to be registered.")}}(r,o,i),function(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}(r,o,i),{type:cs,payload:{targetIds:r,clientOffset:n||null}}}}function Ds(e){return function(){if(e.getMonitor().isDragging())return{type:us}}}var Es=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:t}=this.store,n=function(e){return{beginDrag:hs(e),publishDragSource:Ds(e),hover:Os(e),drop:ys(e),endDrag:bs(e)}}(this);return Object.keys(n).reduce((r,o)=>{const i=n[o];var s;return r[o]=(s=i,(...n)=>{const r=s.apply(e,n);void 0!==r&&t(r)}),r},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function Is(e,t){return{x:e.x-t.x,y:e.y-t.y}}var Ss=[],Ts=[];Ss.__IS_NONE__=!0,Ts.__IS_ALL__=!0;var Cs=class{subscribeToStateChange(e,t={}){const{handlerIds:n}=t;os("function"==typeof e,"listener must be a function."),os(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let r=this.store.getState().stateId;return this.store.subscribe(()=>{const t=this.store.getState(),o=t.stateId;try{o===r||o===r+1&&!function(e,t){return e!==Ss&&(e===Ts||void 0===t||(n=t,r=e,n.filter(e=>r.indexOf(e)>-1)).length>0);var n,r}(t.dirtyHandlerIds,n)||e()}finally{r=o}})}subscribeToOffsetChange(e){os("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{const n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return os(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);return os(t,`Expected to find a valid target. targetId=${e}`),!(!this.isDragging()||this.didDrop())&&ws(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);return os(t,`Expected to find a valid source. sourceId=${e}`),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:n}=t;if(!this.isDragging())return!1;const r=this.registry.getTargetType(e),o=this.getItemType();if(o&&!ws(r,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const s=i.indexOf(e);return n?s===i.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return t&&n&&r?Is((i=r,{x:(o=t).x+i.x,y:o.y+i.y}),n):null;var o,i}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:n}=e;return t&&n?Is(t,n):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},Ns="undefined"!=typeof global?global:self,Ms=Ns.MutationObserver||Ns.WebKitMutationObserver;function xs(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}var Rs,Ps="function"==typeof Ms?function(e){let t=1;const n=new Ms(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:xs,As=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},_s=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Ps(this.flush),this.requestErrorThrow=xs(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},ks=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new As(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(_s.registerPendingError),$s="dnd-core/ADD_SOURCE",Ys="dnd-core/ADD_TARGET",js="dnd-core/REMOVE_SOURCE",Hs="dnd-core/REMOVE_TARGET";function Fs(e,t){t&&Array.isArray(e)?e.forEach(e=>Fs(e,!1)):os("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(Rs||(Rs={}));var Vs=0;function Bs(e){switch(e[0]){case"S":return Rs.SOURCE;case"T":return Rs.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Us(e,t){const n=e.entries();let r=!1;do{const{done:e,value:[,o]}=n.next();if(o===t)return!0;r=!!e}while(!r);return!1}var Ls=class{addSource(e,t){Fs(e),function(e){os("function"==typeof e.canDrag,"Expected canDrag to be a function."),os("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),os("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const n=this.addHandler(Rs.SOURCE,e,t);return this.store.dispatch(function(e){return{type:$s,payload:{sourceId:e}}}(n)),n}addTarget(e,t){Fs(e,!0),function(e){os("function"==typeof e.canDrop,"Expected canDrop to be a function."),os("function"==typeof e.hover,"Expected hover to be a function."),os("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const n=this.addHandler(Rs.TARGET,e,t);return this.store.dispatch(function(e){return{type:Ys,payload:{targetId:e}}}(n)),n}containsHandler(e){return Us(this.dragSources,e)||Us(this.dropTargets,e)}getSource(e,t=!1){return os(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return os(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return os(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return os(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return Bs(e)===Rs.SOURCE}isTargetId(e){return Bs(e)===Rs.TARGET}removeSource(e){var t;os(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:js,payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},_s.enqueueTask(ks.create(t))}removeTarget(e){os(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:Hs,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);os(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){os(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){const r=function(e){const t=(Vs++).toString();switch(e){case Rs.SOURCE:return`S${t}`;case Rs.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}(e);return this.types.set(r,t),e===Rs.SOURCE?this.dragSources.set(r,n):e===Rs.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=/* @__PURE__ */new Map,this.dragSources=/* @__PURE__ */new Map,this.dropTargets=/* @__PURE__ */new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},Gs=(e,t)=>e===t;function Ks(e=Ss,t){switch(t.type){case cs:break;case $s:case Ys:case Hs:case js:return Ss;default:return Ts}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,o=function(e,t){const n=/* @__PURE__ */new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);const o=[];return n.forEach((e,t)=>{1===e&&o.push(t)}),o}(n,r);if(!(o.length>0)&&function(e,t,n=Gs){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(n,r))return Ss;const i=r[r.length-1],s=n[n.length-1];return i!==s&&(i&&o.push(i),s&&o.push(s)),o}function Ws(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qs={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function zs(e=qs,t){const{payload:n}=t;switch(t.type){case ss:case as:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case cs:return r=e.clientOffset,o=n.clientOffset,!r&&!o||r&&o&&r.x===o.x&&r.y===o.y?e:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Ws(e,t,n[t])})}return e}({},e,{clientOffset:n.clientOffset});case ds:case ls:return qs;default:return e}var r,o}function Js(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Js(e,t,n[t])})}return e}var Qs={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Zs(e=Qs,t){const{payload:n}=t;switch(t.type){case as:return Xs({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case us:return Xs({},e,{isSourcePublic:!0});case cs:return Xs({},e,{targetIds:n.targetIds});case Hs:return-1===e.targetIds.indexOf(n.targetId)?e:Xs({},e,{targetIds:(r=e.targetIds,o=n.targetId,r.filter(e=>e!==o))});case ls:return Xs({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case ds:return Xs({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var r,o}function ea(e=0,t){switch(t.type){case $s:case Ys:return e+1;case js:case Hs:return e-1;default:return e}}function ta(e=0){return e+1}function na(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ra(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){na(e,t,n[t])})}return e}function oa(e={},t){return{dirtyHandlerIds:Ks(e.dirtyHandlerIds,{type:t.type,payload:ra({},t.payload,{prevTargetIds:(n=e,r=[],"dragOperation.targetIds".split(".").reduce((e,t)=>e&&e[t]?e[t]:r||null,n))})}),dragOffset:zs(e.dragOffset,t),refCount:ea(e.refCount,t),dragOperation:Zs(e.dragOperation,t),stateId:ta(e.stateId)};var n,r}function ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sa=0,aa=Symbol.for("__VUE_DND_CONTEXT_INSTANCE__");function ua(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ca(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t;return o[aa]||(o[aa]=function(e,t,n={},r=!1){const o=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return rs(oa,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(r),i=new Es(o,new Cs(o,new Ls(o))),s=e(i,t,n);return i.receiveBackend(s),i}(e,t,n,r)),o[aa]}function ca(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:window}(0,Ki.defineComponent)({name:"DndProvider",props:{manager:{type:Object},backend:{type:Function},context:{type:Object},options:{type:Object},debugMode:{type:Boolean}},setup:function(e,t){var n,r,o,i,s=t.slots,a=(o=function(e){return function(e){return"manager"in e&&e.manager}(e)?[e.manager,!1]:[ua(e.backend,e.context,e.options,e.debugMode),!e.context]}(e),i=2,function(e){if(Array.isArray(e))return e}(o)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(u){a=!0,o=u}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(o,i)||function(e,t){if(e){if("string"==typeof e)return ia(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ia(e,t):void 0}}(o,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=a[0],c=a[1];return c&&++sa,(0,Ki.onUnmounted)(function(){if(c){var e=ca();0===--sa&&(e[aa]=null)}}),n=u,(0,Ki.provide)(Xi,n),function(){var e;return null!==(r=null===(e=s.default)||void 0===e?void 0:e.call(s))&&void 0!==r?r:null}}}),(0,Ki.defineComponent)({props:{connect:{type:Function,required:!0},src:{type:String,required:!0}},setup:function(e){return(0,Ki.watchEffect)(function(){if("undefined"!=typeof Image){var t=!1,n=new Image;return n.src=e.src,n.onload=function(){e.connect(n),t=!0},function(){t&&e.connect(null)}}}),function(){return null}}});var la=!1,da=!1,fa=/* @__PURE__ */function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sourceId=null,this.internalMonitor=t.getMonitor()}var t=e.prototype;return t.receiveHandlerId=function(e){this.sourceId=e},t.getHandlerId=function(){return this.sourceId},t.canDrag=function(){os(!la,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return la=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{la=!1}},t.isDragging=function(){if(!this.sourceId)return!1;os(!da,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return da=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{da=!1}},t.subscribeToStateChange=function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)},t.isDraggingSource=function(e){return this.internalMonitor.isDraggingSource(e)},t.isOverTarget=function(e,t){return this.internalMonitor.isOverTarget(e,t)},t.getTargetIds=function(){return this.internalMonitor.getTargetIds()},t.isSourcePublic=function(){return this.internalMonitor.isSourcePublic()},t.getSourceId=function(){return this.internalMonitor.getSourceId()},t.subscribeToOffsetChange=function(e){return this.internalMonitor.subscribeToOffsetChange(e)},t.canDragSource=function(e){return this.internalMonitor.canDragSource(e)},t.canDropOnTarget=function(e){return this.internalMonitor.canDropOnTarget(e)},t.getItemType=function(){return this.internalMonitor.getItemType()},t.getItem=function(){return this.internalMonitor.getItem()},t.getDropResult=function(){return this.internalMonitor.getDropResult()},t.didDrop=function(){return this.internalMonitor.didDrop()},t.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},t.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},t.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},t.getClientOffset=function(){return this.internalMonitor.getClientOffset()},t.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}(),pa=!1,ha=/* @__PURE__ */function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.targetId=null,this.internalMonitor=t.getMonitor()}var t=e.prototype;return t.receiveHandlerId=function(e){this.targetId=e},t.getHandlerId=function(){return this.targetId},t.subscribeToStateChange=function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)},t.canDrop=function(){if(!this.targetId)return!1;os(!pa,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return pa=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{pa=!1}},t.isOver=function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)},t.getItemType=function(){return this.internalMonitor.getItemType()},t.getItem=function(){return this.internalMonitor.getItem()},t.getDropResult=function(){return this.internalMonitor.getDropResult()},t.didDrop=function(){return this.internalMonitor.didDrop()},t.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},t.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},t.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},t.getClientOffset=function(){return this.internalMonitor.getClientOffset()},t.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();function ga(e){return function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if((t=n)&&t.__v_skip&&function(){throw new Error("Only native element nodes can now be passed to Vue DnD connectors.You can either wrap Component into a <div>, or turn it into a drag source or a drop target itself.")}(),!function(e){return!!(n=e)&&!0===n.__v_isVNode&&"symbol"!=((t=e.type)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t);var t,n}(n)){var o=n;return e(o,r),o}}}function ma(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var o=ga(r);t[n]=function(){return o}}}),t}function ya(e,t,n,r){let o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;const a=Object.prototype.hasOwnProperty.bind(t);for(let u=0;u<i.length;u++){const s=i[u];if(!a(s))return!1;const c=e[s],l=t[s];if(o=n?n.call(r,c,l,s):void 0,!1===o||void 0===o&&c!==l)return!1}return!0}function va(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ba=/* @__PURE__ */function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hooks=ma({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,n.dragPreviewNode=e,n.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceOptionsInternal=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}var t,n,r=e.prototype;return r.receiveHandlerId=function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())},r.reconnect=function(){var e=this.reconnectDragSource();this.reconnectDragPreview(e)},r.reconnectDragSource=function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t},r.reconnectDragPreview=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(t?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)},r.didHandlerIdChange=function(){return this.lastConnectedHandlerId!==this.handlerId},r.didConnectedDragSourceChange=function(){return this.lastConnectedDragSource!==this.dragSource},r.didConnectedDragPreviewChange=function(){return this.lastConnectedDragPreview!==this.dragPreview},r.didDragSourceOptionsChange=function(){return!ya(this.lastConnectedDragSourceOptions,this.dragSourceOptions)},r.didDragPreviewOptionsChange=function(){return!ya(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)},r.disconnectDragSource=function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)},r.disconnectDragPreview=function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null)},r.clearDragSource=function(){this.dragSourceNode=null},r.clearDragPreview=function(){this.dragPreviewNode=null},t=e,(n=[{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"dragSource",get:function(){return this.dragSourceNode}},{key:"dragPreview",get:function(){return this.dragPreviewNode}}])&&va(t.prototype,n),e}();function wa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Oa=/* @__PURE__ */function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hooks=ma({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,(0,Ki.isRef)(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}var t,n,r=e.prototype;return r.reconnect=function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)},r.receiveHandlerId=function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())},r.didHandlerIdChange=function(){return this.lastConnectedHandlerId!==this.handlerId},r.didDropTargetChange=function(){return this.lastConnectedDropTarget!==this.dropTarget},r.didOptionsChange=function(){return!ya(this.lastConnectedDropTargetOptions,this.dropTargetOptions)},r.disconnectDropTarget=function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)},r.clearDropTarget=function(){this.dropTargetRef=null,this.dropTargetNode=null},t=e,(n=[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.value}}])&&wa(t.prototype,n),e}(),Da=/* @__PURE__ */function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.spec=t,this.monitor=n,this.connector=r}var t=e.prototype;return t.beginDrag=function(){var e,t=this.spec,n=this.monitor;return null!=(e="object"==typeof t.item?t.item:"function"==typeof t.item?t.item(n):{})?e:null},t.canDrag=function(){var e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)},t.isDragging=function(e,t){var n=this.spec,r=this.monitor,o=n.isDragging;return o?o(r):t===e.getSourceId()},t.endDrag=function(){var e=this.spec,t=this.monitor,n=this.connector,r=e.end;r&&r(t.getItem(),t),n.reconnect()},e}();function Ea(){var e=(0,Ki.inject)(Xi);return os(null!=e,"Expected drag drop context"),e}function Ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sa(e,t,n){var r=Ea(),o=function(e,t,n){var r=(0,Ki.computed)(function(){return new Da((0,Ki.unref)(e),(0,Ki.unref)(t),(0,Ki.unref)(n))});return(0,Ki.watchEffect)(function(){r.value.spec=(0,Ki.unref)(e)}),r}(e,t,n),i=function(e){return(0,Ki.computed)(function(){var t=(0,Ki.unref)(e).type;return os(null!=t,"spec.type must be defined"),t})}(e);(0,Ki.watchEffect)(function(e){if(null!=(0,Ki.unref)(i)){var s=(c=function(e,t,n){var r=n.getRegistry(),o=r.addSource(e,t);return[o,function(){return r.removeSource(o)}]}((0,Ki.unref)(i),(0,Ki.unref)(o),(0,Ki.unref)(r)),l=2,function(e){if(Array.isArray(e))return e}(c)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(u){a=!0,o=u}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(c,l)||function(e,t){if(e){if("string"==typeof e)return Ia(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ia(e,t):void 0}}(c,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=s[0],u=s[1];(0,Ki.unref)(t).receiveHandlerId(a),(0,Ki.unref)(n).receiveHandlerId(a),e(u)}var c,l})}function Ta(e){return(0,Ki.computed)(function(){return"function"==typeof e?e():e})}var Ca=/* @__PURE__ */Ye(/* @__PURE__ */_e((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!==o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}})());function Na(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ma(e,t,n){var r,o,i=(r=function(e,t,n){var r=(0,Ki.ref)((0,Ki.unref)(t)((0,Ki.unref)(e))),o=function(){var o=(0,Ki.unref)(t)((0,Ki.unref)(e));(0,Ca.default)(r.value,o)||(r.value=o,n&&n())};return(0,Ki.watchEffect)(o),[r,o]}(e,t,n),o=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(u){a=!0,o=u}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(r,o)||function(e,t){if(e){if("string"==typeof e)return Na(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Na(e,t):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],a=i[1];return(0,Ki.watchEffect)(function(t){var n=(0,Ki.unref)(e).getHandlerId();null!=n&&t((0,Ki.unref)(e).subscribeToStateChange(a,{handlerIds:[n]}))}),s}function xa(e,t,n){return Ma(t,e||function(){return{}},function(){return(0,Ki.unref)(n).reconnect()})}function Ra(e,t){var n=(0,Ki.reactive)({el:null,options:(0,Ki.unref)(t)});return(0,Ki.watchEffect)(function(){e(n)},{flush:"post"}),function(e,r){zi(n,"el",e);var o=(0,Ki.unref)(t)||r;return(0,Ca.default)(n.options,o)||zi(n,"options",o),(0,Ki.unref)(e)}}function Pa(e,t){return Ra(function(t){(0,Ki.unref)(e).hooks.dragSource()(t.el,t.options)},(0,Ki.computed)(function(){return(0,Ki.unref)(t).options}))}function Aa(e,t){return Ra(function(t){(0,Ki.unref)(e).hooks.dragPreview()(t.el,t.options)},(0,Ki.computed)(function(){return(0,Ki.unref)(t).previewOptions}))}var _a=/* @__PURE__ */function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.spec=t,this.monitor=n}var t=e.prototype;return t.canDrop=function(){var e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)},t.hover=function(){var e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)},t.drop=function(){var e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)},e}();function ka(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $a(e,t,n){var r=Ea(),o=function(e,t){var n=(0,Ki.computed)(function(){return new _a((0,Ki.unref)(e),(0,Ki.unref)(t))});return(0,Ki.watchEffect)(function(){n.value.spec=(0,Ki.unref)(e)}),n}(e,t),i=function(e){return(0,Ki.computed)(function(){var t=(0,Ki.unref)(e).accept;return os(null!=t,"accept must be defined"),Array.isArray(t)?t:[t]})}(e);(0,Ki.watchEffect)(function(e){var s,a,u=(s=function(e,t,n){var r=(0,Ki.unref)(n).getRegistry(),o=r.addTarget((0,Ki.unref)(e),(0,Ki.unref)(t));return[o,function(){return r.removeTarget(o)}]}(i,o,r),a=2,function(e){if(Array.isArray(e))return e}(s)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(u){a=!0,o=u}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(s,a)||function(e,t){if(e){if("string"==typeof e)return ka(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ka(e,t):void 0}}(s,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=u[0],l=u[1];(0,Ki.unref)(t).receiveHandlerId(c),(0,Ki.unref)(n).receiveHandlerId(c),e(l)})}function Ya(e,t){return Ra(function(t){(0,Ki.unref)(e).hooks.dropTarget()(t.el,t.options)},(0,Ki.computed)(function(){return(0,Ki.unref)(t).options}))}function ja(e){var t,n=Ta(e),r=(t=Ea(),(0,Ki.computed)(function(){return new ha((0,Ki.unref)(t))})),o=function(e){var t=Ea(),n=(0,Ki.computed)(function(){return new Oa((0,Ki.unref)(t).getBackend())});return(0,Ki.watchEffect)(function(t){n.value.dropTargetOptions=(0,Ki.unref)(e)||null,n.value.reconnect(),t(function(){return n.value.disconnectDropTarget()})}),n}((0,Ki.computed)(function(){return(0,Ki.unref)(n).options}));return $a(n,r,o),[xa((0,Ki.computed)(function(){return(0,Ki.unref)(n).collect||function(){return{}}}),r,o),Ya(o,n)]}var Ha=/* @__PURE__ */Y({name:"Vue3DndDraggableItem",props:{group:{type:String,required:!0},index:{type:Number,required:!0},item:{type:Object,required:!0},config:{type:Object,required:!0},add:{type:Function,required:!0},remove:{type:Function,required:!0},move:{type:Function,required:!0}},setup(e){const t=T("vue3-dnd-draggable-item"),n=Z(null),r=Z(!1),{config:o}=e,[i,s,a]=(l={type:o.type,item:()=>({group:e.group,item:e.item}),collect:e=>({canDrag:e.canDrag(),isDragging:e.isDragging()}),canDrag:e=>!o.canDrag||o.canDrag(e),end(t,n){if(o.end)return o.end(t,n);const r=n.getDropResult();r&&r.group!==e.group&&e.remove(t)},options:o.dragOptions,previewOptions:o.previewOptions},f=Ta(l),d=Ea(),p=(0,Ki.computed)(function(){return new fa((0,Ki.unref)(d))}),h=function(e,t){var n=Ea(),r=(0,Ki.computed)(function(){return new ba((0,Ki.unref)(n).getBackend())});return(0,Ki.watchEffect)(function(t){r.value.dragSourceOptions=(0,Ki.unref)(e)||null,(0,Ki.unref)(r).reconnect(),t(function(){r.value.disconnectDragSource()})}),(0,Ki.watchEffect)(function(e){r.value.dragPreviewOptions=(0,Ki.unref)(t)||null,(0,Ki.unref)(r).reconnect(),e(function(){r.value.disconnectDragPreview()})}),r}((0,Ki.computed)(function(){return(0,Ki.unref)(f).options}),(0,Ki.computed)(function(){return(0,Ki.unref)(f).previewOptions})),Sa(f,p,h),[xa((0,Ki.computed)(function(){return(0,Ki.unref)(f).collect||function(){return{}}}),p,h),Pa(h,f),Aa(h,f)]),[u,c]=ja({accept:o.type,collect:e=>({handlerId:e.getHandlerId(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0}),isOver:e.isOver()}),hover(t,s){if(o.hover)return o.hover(t,s);if(!1!==s.canDrop()&&!0!==i.value.isDragging&&e.item!==t.item&&s.isOver({shallow:!0})){const i=n.value.getBoundingClientRect(),a=s.getClientOffset(),u=o.offset??0;let c=0;if("vertical"===o.direction){const{top:e,height:t}=i,{y:n}=a;if(c=n-e-t/2,Math.abs(c)<u)return;r.value=c<0}else if("horizontal"===o.direction){const{left:e,width:t}=i,{x:n}=a;if(c=n-e-t/2,Math.abs(c)<u)return;r.value=c<0}const l=o.key??"id";t.group===e.group?e.move(r.value,e.item[l],t.item[l]):e.add(r.value,e.item[l],t.item)}},canDrop:(e,t)=>o.canDrop?o.canDrop(e,t):!0!==i.value.isDragging,drop:(t,n)=>o.drop?o.drop(t,n):{group:e.group},options:o.dropOptions});var l,d,f,p,h;return!0===e.config.isCustomHandle||e.config.handle||s(n),c(n),a(n),K(()=>{U(()=>{if(e.config.handle&&n.value){const t=n.value.querySelector(e.config.handle);t&&s(t)}})}),{ns:t,elRef:n,dragCollect:i,dropCollect:u,isBeforeHover:r,drag:s,preview:a}},render(){var e,t;return k("div",{ref:"elRef",class:[this.ns.b(),this.ns.is("dragging",this.dragCollect.isDragging),this.ns.is("shallow-over",this.dropCollect.isShallowOver)]},[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t,{item:this.item,index:this.index,isDragging:this.dragCollect.isDragging,isShallowOver:this.dropCollect.isShallowOver,isOver:this.dropCollect.isOver,isBeforeHover:this.isBeforeHover,isAfterHover:!this.isBeforeHover,direction:this.config.direction,drag:this.drag,preview:this.preview})])}}),{toString:Fa}=Object.prototype;function Va(){return(65536*(1+Math.random())|0).toString(16).substring(1)}var Ba=/* @__PURE__ */Y({name:"Vue3DndDraggable",props:{opts:{type:Object,default:()=>({})},items:{type:Array,required:!0}},emits:["add","remove","move"],setup(e,{emit:t}){const n=T("vue3-dnd-draggable"),r=`${Va()+Va()}-${Va()}-${Va()}-${Va()}-${Va()}${Va()}${Va()}`,o=Z(null),{opts:i,items:s}=ie(e),a=R(()=>u.value.key||"id"),u=R(()=>Oe({type:"Vue3DndDraggable",direction:"vertical"},i.value)),[c,l]=ja({accept:u.value.type,collect:e=>({handlerId:e.getHandlerId(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0})}),canDrop:(t,n)=>!(e.items.length>0)&&(!u.value.canDropContainer||u.value.canDropContainer(t,n)),drop:(e,t)=>u.value.dropContainer?u.value.dropContainer(e,t):(!1!==t.canDrop()&&s.value.push(e),{group:r})});return l(o),{ns:n,groupId:r,key:a,rootRef:o,collect:c,config:u,onAdd:(e,n,r)=>{const o=s.value.findIndex(e=>e[a.value]===n);s.value.splice(e?o:o+1,0,r),t("add",r,o)},onRemove:e=>{console.warn("onRemove 未实现",e)},onMove:(e,n,r)=>{const o=s.value.findIndex(e=>e[a.value]===n),i=s.value.findIndex(e=>e[a.value]===r),u=s.value[i],c=e?o:o+1;!e&&c===i||e&&c-1===i||(s.value.splice(c,0,u),c<i?s.value.splice(i+1,1):s.value.splice(i,1),t("move",o,c))}}},render(){let e;return k("div",{ref:"rootRef",class:[this.ns.b(),this.ns.is("over",this.collect.isShallowOver)]},[k(x,{name:"list"},(t=e=this.items.map((e,t)=>k(Ha,{group:this.groupId,key:e[this.key]||t,index:t,item:e,config:this.config,add:this.onAdd,remove:this.onRemove,move:this.onMove},{default:e=>{var t,n;return null===(t=(n=this.$slots).draggableItem)||void 0===t?void 0:t.call(n,e)}})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!B(t)?e:{default:()=>[e]}))]);var t}}),Ua=/* @__PURE__ */ke({default:()=>La}),La={pleaseInitiateTheProcessFirst:"未找到流程数据,请先发起流程",processInstanceMismatch:"流程实例不匹配!",element:{approval:"审批"}},Ga=/* @__PURE__ */ke({default:()=>Ka}),Ka={success:"成功"},Wa=/* @__PURE__ */Object.assign({"./sys/process.ts":Ua,"./sys.ts":Ga}),qa=Symbol.for("@gct-paas/render/setupApp");async function za(e){Reflect.get(window,qa)?console.error("@gct-paas/render renderSetupApp 已执行,请勿重复调用。"):(Reflect.set(window,qa,!0),_gct.i18nUtil.autoRegisterLocale(Wa))}function Ja(){_gct.register.render?console.warn("渲染注册已存在,可能存在重复注册问题,请检查是否有重复引入渲染包的情况"):_gct.register.render=new Fe,window._kit||Object.defineProperty(window,"_kit",{value:{},writable:!1,configurable:!1})}Ja();var Xa=new URL("./index.min.css",import.meta.url);w.load(Xa.href);export{Ii as Context,ui as ContextExtensionRegistry,Je as ControllerType,Be as DESIGN_DATA_KEY_TAG,Ve as DESIGN_TYPE,qe as DateFormat,Le as DateRangeMap,ze as DatepickerRanges,Ue as DesignItemAttribute,Ze as DesignNodeType,Ht as DesignRender,Xe as DesignRenderViewPrefix,bi as Events,$t as FieldSchema,Si as GctComponent,Ut as GlobaAppInfo,Zt as Globals,Bt as HandwritingPad,Gt as PageTypeEnum,tn as RenderDesignEditor,et as RenderNodeRegister,Qe as RenderNodeType,ro as RenderPluginPgkUtil,Fe as RenderRegister,Ba as Vue3DndDraggable,Ha as Vue3DndDraggableItem,uo as addDataByForm,po as cacheAdapter,Xr as calculate,Mi as calculateDepResult,Li as containerNodeProps,bo as defaultValMap,$i as dependencyToShow,Yi as dependencyToShowSync,Zo as emptyValueDisplay,zt as formMap,We as getDefaultDate,Ge as getDisabledDate,So as getIExp,To as getIKeywordFieldKeys,Ke as getMobileDateRange,Ri as getOptionsByDisplayRule,Qt as getPageTitle,en as getPremission,Co as getQueryDateByKeyWord,Mo as getQuerySort,mo as getRefInfoId,xo as getSimilarFieldBySearchField,qt as globalVarCaches,Jr as identify,Yt as initFieldWidgetRuntime,Ni as insetDep,Po as is,Wo as isArray,Go as isBoolean,Yo as isDate,Ao as isDef,zo as isElement,$o as isEmpty,Qo as isEmptyStr,Lo as isFunction,Jo as isMap,jo as isNull,Ho as isNullAndUnDef,Fo as isNullOrUnDef,Vo as isNumber,ko as isObject,Bo as isPromise,Ko as isRegExp,Uo as isString,_o as isUnDef,Xo as isUrl,qo as isWindow,Gi as nodeEditorProps,Ui as nodeProps,Ja as onInit,Xt as pageDataforJson,Wt as pageGlobaVariables,ci as registerContextExtension,za as renderSetupApp,io as schemaToStyle,co as setDataByForm,Jt as setFormData,Fi as tableWidgetByDept,Hi as tableWidgetToShow,lo as transSelectData,ao as transformData,fo as transformDataToDict,no as transformPropsField,so as transformSourceData,jt as useAsyncFileAttrs,Vi as useDependency,Bi as useDependencyByRequired,ki as useDependencyToShow,ji as useDependencyToShowList,ut as useDesignRenderController,Ai as useDisplayRuleColumnByStyles,Pi as useDisplayRuleOptions,kt as useGctSelect,vo as useGetBodyBySearch,No as useQueryfilter,oo as useStyle,xi as useVisibileByRuleHook,nn as widthRenderDesignEditorInstall};
|
|
1
|
+
/*! @gct-paas/render v6.0.3-dev.0 */
|
|
2
|
+
import{ASSIGNMENTSTRATEGY_ENUM as e,BizServiceEnum as t,ButtonTypeEnum as n,DateRangeEnums as r,DefaultDateTypeConst as o,Dependency_ENUM as i,DisplayType as s,EntityModelCategoryEnum as a,ExamineAndApproveStateEnum as u,FIELD_TYPE as c,FieldSysVarDefaultValueEnum as l,FormComponents as d,GLOBAL_VAR_TYPE as f,INNER_EVENT as p,OpinionTypeEnum as h,PluginModeEnum as g,PluginPgkUtil as m,SEARCH_SERVICE as y,SYSTEM_VAR_PREFIX as v,calcStyle as b,cssLoader as w,functionMap as O,innerVarIds as D,isMultipleOperator as E,operator2FuncMap as I,t as S,useNamespace as T,usePermissionStore as C}from"@gct-paas/core";import N from"dayjs";import*as M from"vue";import{TransitionGroup as x,computed as R,createElementBlock as P,createElementVNode as A,createTextVNode as _,createVNode as k,customRef as $,defineComponent as Y,getCurrentInstance as j,getCurrentScope as H,h as F,inject as V,isVNode as B,nextTick as U,onActivated as L,onBeforeUnmount as G,onMounted as K,onScopeDispose as W,onUnmounted as q,openBlock as z,provide as J,reactive as X,readonly as Q,ref as Z,resolveComponent as ee,shallowReactive as te,shallowRef as ne,toRaw as re,toRef as oe,toRefs as ie,toValue as se,unref as ae,watch as ue}from"vue";import{DesignNodeMode as ce,extractFontStyle as le,generateWrapperStyle as de,propsToStyle as fe}from"@gct-paas/schema";import*as pe from"lodash-es";import{cloneDeep as he,differenceBy as ge,get as me,isArray as ye,isEqual as ve,isNull as be,isUndefined as we,merge as Oe,pick as De}from"lodash-es";import Ee from"bignumber.js";import*as Ie from"esprima-next";import Se from"estraverse";import Te from"escodegen";import Ce from"qs";var Ne=Object.create,Me=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,Re=Object.getOwnPropertyNames,Pe=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty,_e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ke=(e,t)=>{let n={};for(var r in e)Me(n,r,{get:e[r],enumerable:!0});return t||Me(n,Symbol.toStringTag,{value:"Module"}),n},$e=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,i=Re(t),s=0,a=i.length;s<a;s++)o=i[s],Ae.call(e,o)||o===n||Me(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(r=xe(t,o))||r.enumerable});return e},Ye=(e,t,n)=>(n=null!=e?Ne(Pe(e)):{},$e(!t&&e&&e.__esModule?n:Me(n,"default",{value:e,enumerable:!0}),e));function je(e){return je="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},je(e)}function He(e,t,n){return(t=function(e){var t=function(e){if("object"!=je(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=je(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==je(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Fe=class{constructor(){He(this,"map",/* @__PURE__ */new Map)}register(e,t,n){const r=n?`${n}:${e}`:e;this.map.has(r)&&console.warn(`重复注册标识: ${r},覆盖之前的组件`),this.map.set(r,t)}unregister(e,t){const n=t?`${t}:${e}`:e;this.map.has(n)?this.map.delete(n):console.warn(`删除未注册组件标识: ${n}`)}get(e,t,n=!1){const r=t?`${t}:${e}`:e,o=this.map.get(r);return o||n||console.warn(`未找到组件,标识: ${r}`),o}keys(){return Array.from(this.map.keys())}},Ve="view-design",Be="id",Ue=/* @__PURE__ */function(e){return e.ACTIVE_TAG="design-active-item",e.DRAG_TAG="design-drop-item",e.INDEX_TAG="design-item-index",e.NODE_ID_TAG="design-item-id",e.DESIGN_NAME="design-item-name",e.GROUP_TAG="design-group-tag",e.DRAG_GROUP_TYPE="drag-group-type",e.IS_INLINE_BLOCK="is-inline-block",e.SELECTOR_INDEX="selector-index",e}({}),Le={WEEK_NOW:e=>{const t=N().startOf("week").add(1,"day"),n=N().endOf("week").add(1,"day"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},MONTH_NOW:e=>{const t=N().startOf("month"),n=N().endOf("month"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},QUARTER_NOW:e=>{const t=N().startOf("quarter"),n=N().endOf("quarter"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},YEAR_NOW:e=>{const t=N().startOf("year"),n=N().endOf("year"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},WEEk_BEFORE:e=>{N.locale("zh-cn");const t=N().startOf("week").subtract(1,"week"),n=t.clone().endOf("week"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},MONTH_BEFORE:e=>{const t=N().add(-1,"month").startOf("month"),n=N().add(-1,"month").endOf("month"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},QUARTER_BEFORE:e=>{const t=N().add(-1,"quarter").startOf("quarter"),n=N().add(-1,"quarter").endOf("quarter"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},YEAR_BEFORE:e=>{const t=N().add(-1,"year").startOf("year"),n=N().add(-1,"year").endOf("year"),r=t.valueOf(),o=n.valueOf();return{disabled:e<r||e>o,minDate:t,maxDate:n}},DATE_BEFORE:e=>{const t=N().add(-1,"day");return{disabled:e<t.valueOf(),maxDate:t}},DATE_AFTER:e=>{const t=N();return{disabled:e>t.valueOf(),minDate:t}}},Ge=(e,t)=>{const n=N(e).valueOf(),r=Le[t];if(r){const{disabled:e}=r(n);return e}return!1},Ke=e=>{const t=Le[e];if(t){const{minDate:e,maxDate:n}=t(0);return Object.assign({},e&&{minDate:new Date(e)},n&&{maxDate:new Date(n)})}return{}},We=(e,t)=>{let n;switch(e){case l.SYS_DATE:n=N().format(t??"YYYY-MM-DD");break;case l.SYS_DATE_TIME:n=N().format(t??"YYYY-MM-DD HH:mm:ss");break;case l.SYS_TIME:n=N().format(t??"HH:mm:ss")}return n},qe={YYYY:{valueFormat:"YYYY-01-01",picker:"year",columnsType:["year"]},"YYYY HH":{valueFormat:"YYYY-01-01 HH:00:00",columnsType:["hour"]},"YYYY-MM HH:mm":{valueFormat:"YYYY-MM-01 HH:mm:00",columnsType:["hour","minute"]},"YYYY-MM":{valueFormat:"YYYY-MM-01",picker:"month",columnsType:["year","month"]},"YYYY-MM-DD":{valueFormat:"YYYY-MM-DD",picker:"date",columnsType:["year","month","day"]},"YYYY-MM-DD HH":{valueFormat:"YYYY-MM-DD HH:00:00",columnsType:["hour"]},"YYYY-MM-DD HH:mm":{valueFormat:"YYYY-MM-DD HH:mm:00",columnsType:["hour","minute"]},"YYYY-MM-DD HH:mm:ss":{valueFormat:"YYYY-MM-DD HH:mm:ss",columnsType:["hour","minute","second"]},"HH:mm:ss":{valueFormat:"HH:mm:ss",columnsType:["hour","minute","second"]},"HH:mm":{valueFormat:"HH:mm:00",columnsType:["hour","minute"]},HH:{valueFormat:"HH:00:00",columnsType:["hour"]}},ze={[r.WEEK_NOW]:""},Je=/* @__PURE__ */function(e){return e.DESIGN_RENDER="design-render",e}({}),Xe=/* @__PURE__ */function(e){return e.CUSTOM_HOME="custom-home",e.CARD_VIEW="card-view",e.MOBILE_CARD_VIEW="mobile-card-view",e.DESIGN_EDITOR="design-editor",e}({}),Qe=/* @__PURE__ */function(e){return e.PAGE="PAGE",e.PAGE_LOWER="page",e.FIELD="field",e.PANEL="panel",e.TABS="tabs",e.TAB_ITEM="tab-item",e.MENU_LIST="menu-list",e.SELECT_COMPONENT="select-component",e.GRID="grid",e.GRID_ITEM="grid-item",e.MESSAGE="message",e.WORKBENCH="workbench",e.PERSONAL_CENTER="personal-center",e.TODO="todo",e}({}),Ze=/* @__PURE__ */function(e){return e.DESIGN_EDITOR="design_editor",e}({}),et=class{static register(e,t,n){const r=n?`${n}:${e}`:e;this.map.has(r)&&console.warn(`重复注册组件提供者,标识: ${r},覆盖之前的提供者`),this.map.set(r,t)}static get(e,t){const n=t?`${t}:${e}`:e;if(this.cache.has(n))return this.cache.get(n);const r=this.map.get(n);if(r){const e=r();return this.cache.set(n,e),e}return console.warn(`未找到组件提供者,标识: ${n}`),null}static registerCustomHome(e,t){this.register(e,t,Xe.CUSTOM_HOME)}static registerDesignEditorNode(e,t){this.register(e,t,Xe.DESIGN_EDITOR)}static getCustomHome(e){return this.get(e,Xe.CUSTOM_HOME)}static getDesignEditorNode(e){return this.get(e,Xe.DESIGN_EDITOR)}};He(et,"map",/* @__PURE__ */new Map),He(et,"cache",/* @__PURE__ */new Map);var tt=/* @__PURE__ */Y({name:"DesignRenderItem",props:{model:{type:Object,required:!0}},setup(e,{slots:t}){const n=T("design-render-item"),r=b(e.model.data);return()=>{var e;return k("div",{class:n.b(),style:r},[null===(e=t.default)||void 0===e?void 0:e.call(t)])}}}),nt=class{constructor(){He(this,"context",{})}},rt=class{constructor(){He(this,"isDestroy",!1)}},ot=class{constructor(e){He(this,"model",void 0),He(this,"state",new rt),this.model=e}mounted(){}destroy(){}},it=class extends ot{},st=class extends ot{},at=class{constructor(){He(this,"state",new nt),He(this,"prefix",""),He(this,"preview",!1),He(this,"item",/* @__PURE__ */new Map),He(this,"nodes",[]),He(this,"tree",[])}setTree(e){this.tree=e}setNodes(e){this.reset(),this.nodes=e,this.nodes.forEach(e=>{const t=et.get(e.type,this.prefix);if(t){if(t.createController)return void this.item.set(e.id,t.createController(e));if(t.mode===ce.CONTAINER)return void this.item.set(e.id,new it(e));if(t.mode===ce.ITEM)return void this.item.set(e.id,new st(e))}this.item.set(e.id,new ot(e))})}getNodes(e){if(e){const t=this.getTreeItem(e);return t&&t.children?t.children.map(e=>this.nodes.find(t=>e.id===t.id)):[]}return this.tree.map(e=>this.nodes.find(t=>e.id===t.id))}getTreeItem(e,t=this.tree){if(!e)return null;for(const n of t){if(n.id===e)return n;if(n.children&&n.children.length>0){const t=this.getTreeItem(e,n.children);if(t)return t}}return null}getController(e){return this.item.get(e)}mounted(){}unmounted(){this.reset()}reset(){this.nodes=[],this.item.forEach(e=>{e.destroy()})}};function ut(e){let t=V(Je.DESIGN_RENDER);return t||(t=e?e():new at,t.state=X(t.state),J(Je.DESIGN_RENDER,t),K(()=>{t.mounted()}),q(()=>{t.unmounted()})),t}var ct="undefined"!=typeof window&&"undefined"!=typeof document,lt=("undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope),Object.prototype.toString),dt=()=>{},ft=e=>e();function pt(e,t={}){let n,r,o=dt;const i=e=>{clearTimeout(e),o(),o=dt};let s;return a=>{const u=se(e),c=se(t.maxWait);return n&&i(n),u<=0||void 0!==c&&c<=0?(r&&(i(r),r=void 0),Promise.resolve(a())):new Promise((e,l)=>{o=t.rejectOnCancel?l:e,s=a,c&&!r&&(r=setTimeout(()=>{n&&i(n),r=void 0,e(s())},c)),n=setTimeout(()=>{r&&i(r),r=void 0,e(a())},u)})}}function ht(e){return Array.isArray(e)?e:[e]}function gt(e){const t=Object.create(null);return n=>t[n]||(t[n]=e(n))}var mt=/\B([A-Z])/g,yt=(gt(e=>e.replace(mt,"-$1").toLowerCase()),/-(\w)/g);function vt(e,t,n={}){const{eventFilter:r=ft,...o}=n;return ue(e,(i=r,s=t,function(...e){return new Promise((t,n)=>{Promise.resolve(i(()=>s.apply(this,e),{fn:s,thisArg:this,args:e})).then(t).catch(n)})}),o);var i,s}function bt(e,t=!0,n){!function(e){return e||j()}(n)?t?e():U(e):K(e,n)}function wt(e,t,n={}){const{debounce:r=0,maxWait:o,...i}=n;return vt(e,t,{...i,eventFilter:pt(r,{maxWait:o})})}gt(e=>e.replace(yt,(e,t)=>t?t.toUpperCase():""));var Ot=ct?window:void 0,Dt=ct?window.document:void 0;function Et(...e){const t=R(()=>{const t=ht(se(e[0])).filter(e=>null!=e);return t.every(e=>"string"!=typeof e)?t:void 0});return n=([e,t,n,r],o,i)=>{if(!(null==e?void 0:e.length)||!(null==t?void 0:t.length)||!(null==n?void 0:n.length))return;const s=(a=r,"[object Object]"===lt.call(a)?{...r}:r);var a;const u=e.flatMap(e=>t.flatMap(t=>n.map(n=>((e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)))(e,t,n,s))));i(()=>{u.forEach(e=>e())})},r={flush:"post"},ue(()=>{var n,r;return[null!==(n=null===(r=t.value)||void 0===r?void 0:r.map(e=>function(e){var t;const n=se(e);return null!==(t=null==n?void 0:n.$el)&&void 0!==t?t:n}(e)))&&void 0!==n?n:[Ot].filter(e=>null!=e),ht(se(t.value?e[1]:e[0])),ht(ae(t.value?e[2]:e[1])),se(t.value?e[3]:e[2])]},n,{...r,immediate:!0});var n,r}ct&&window.navigator,ct&&window.location;var It="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},St="__vueuse_ssr_handlers__",Tt=/* @__PURE__ */Ct();function Ct(){return St in It||(It[St]=It[St]||{}),It[St]}var Nt={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Mt="vueuse-storage";function xt(e,t,n,r={}){var o;const{flush:i="pre",deep:s=!0,listenToStorageChanges:a=!0,writeDefaults:u=!0,mergeDefaults:c=!1,shallow:l,window:d=Ot,eventFilter:f,onError:p=e=>{console.error(e)},initOnMounted:h}=r,g=(l?ne:Z)("function"==typeof t?t():t),m=R(()=>se(e));if(!n)try{n=(Tt.getDefaultStorage||(()=>null==Ot?void 0:Ot.localStorage))()}catch(S){p(S)}if(!n)return g;const y=se(t),v=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e?"object":Number.isNaN(e)?"any":"number"}(y),b=null!==(o=r.serializer)&&void 0!==o?o:Nt[v],{pause:w,resume:O}=function(e,t,n={}){const{eventFilter:r,initialState:o="active",...i}=n,{eventFilter:s,pause:a,resume:u,isActive:c}=function(e=ft,t={}){const{initialState:n="active"}=t,r=function(...e){if(1!==e.length)return oe(...e);const t=e[0];return"function"==typeof t?Q($(()=>({get:t,set:dt}))):Z(t)}("active"===n);return{isActive:Q(r),pause:function(){r.value=!1},resume:function(){r.value=!0},eventFilter:(...t)=>{r.value&&e(...t)}}}(r,{initialState:o});return{stop:vt(e,t,{...i,eventFilter:s}),pause:a,resume:u,isActive:c}}(g,e=>function(e){try{const t=n.getItem(m.value);if(null==e)E(t,null),n.removeItem(m.value);else{const r=b.write(e);t!==r&&(n.setItem(m.value,r),E(t,r))}}catch(S){p(S)}}(e),{flush:i,deep:s,eventFilter:f});ue(m,()=>I(),{flush:i});let D=!1;function E(e,t){if(d){const r={key:m.value,oldValue:e,newValue:t,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",r):new CustomEvent(Mt,{detail:r}))}}function I(e){if(!e||e.storageArea===n)if(e&&null==e.key)g.value=y;else if(!e||e.key===m.value){w();try{const t=b.write(g.value);void 0!==e&&(null==e?void 0:e.newValue)===t||(g.value=function(e){const t=e?e.newValue:n.getItem(m.value);if(null==t)return u&&null!=y&&n.setItem(m.value,b.write(y)),y;if(!e&&c){const e=b.read(t);return"function"==typeof c?c(e,y):"object"!==v||Array.isArray(e)?e:{...y,...e}}return"string"!=typeof t?t:b.read(t)}(e))}catch(S){p(S)}finally{e?U(O):O()}}}return d&&a&&(n instanceof Storage?Et(d,"storage",e=>{h&&!D||I(e)},{passive:!0}):Et(d,Mt,e=>{h&&!D||I(e.detail)})),h?bt(()=>{D=!0,I()}):I(),g}function Rt(e,t){const n=(null==t?void 0:t.cache)?te(t.cache):te(/* @__PURE__ */new Map),r=(...e)=>(null==t?void 0:t.getKey)?t.getKey(...e):JSON.stringify(e),o=(t,...r)=>(n.set(t,e(...r)),n.get(t)),i=(...e)=>{const t=r(...e);return n.has(t)?n.get(t):o(t,...e)};return i.load=(...e)=>o(r(...e),...e),i.delete=(...e)=>{n.delete(r(...e))},i.clear=()=>{n.clear()},i.generateKey=r,i.cache=n,i}var Pt=0;Number.POSITIVE_INFINITY;var At=/* @__PURE__ */function(e){return e.SELECT_ID="$VAR_GCT_SELECT_ID",e}({}),_t=function(e,t,n={}){const{window:r=Ot}=n;return xt(e,t,null==r?void 0:r.localStorage,n)}("GCT_APP_GlobalCache",{}),kt=e=>{const t=R({get:()=>_t.value[e]||{},set(t){_t.value[e]=t}});return{selectID:R({get:()=>t.value[At.SELECT_ID],set(e){t.value[At.SELECT_ID]?t.value[At.SELECT_ID]=e:t.value={...t.value,[At.SELECT_ID]:e}}}),cacheMap:t}},$t=class{static async getMap(e,t=!0){if(!e)return Promise.reject();if(!this.responsePromise.has(e)||!t){const t=(async()=>{const t=await _gct.api.apaas.modelMeta.getDetail({modelKey:e});this.modelData.set(e,t);const n=!!(null==t?void 0:t.fieldMetaList)&&t.fieldMetaList.reduce((e,t)=>(t.key&&(e[t.key]=t),e),{});n&&this.FiledData.set(e,n)})();this.responsePromise.set(e,t)}return this.responsePromise.get(e)}static async getConfigByField(e,t,n=!0){return await this.getMap(e,n),this.FiledData.get(e)[t]}static async getConfigByModel(e){return await this.getMap(e),this.modelData.get(e)}static clearCacheMap(e=!1){e&&this.responsePromise.clear(),this.modelData.clear(),this.FiledData.clear()}};async function Yt(e,t=!1){const{modelKey:n,field:r,isCustomField:o,fieldName:i,readonly:s,fieldType:a}=e.props;if(!e.isField&&!t||"table_name_"===r)return{};let u;if(o?u={name:i,type:""}:n&&(u=await $t.getConfigByField(n,r)),!(o||u&&u.type===a))throw new Error("该字段可能已经被删除");if(!u)return{};const{required:c,specificConfig:l}=u;return e.props.fieldRequired=!!c,c&&!s&&(e.props.required=!0),void 0!==(null==l?void 0:l.digits)&&(e.props.precision=l.digits),u}He($t,"modelData",/* @__PURE__ */new Map),He($t,"FiledData",/* @__PURE__ */new Map),He($t,"responsePromise",/* @__PURE__ */new Map),He($t,"silent",!1);var jt=()=>{const e=Z({});return{getFileAttrs:async function({modelKey:t,fieldKey:n}){const r=await $t.getConfigByField(t,n);if(r&&r.specificConfig){const t=De(r.specificConfig,["maxNumber","fileSize","fileTypes"])??{},n=t.fileTypes??[];e.value={maxSize:t.fileSize,maxCount:t.maxNumber,accept:n,acceptStr:Array.isArray(n)&&0!==n.length?n.join("、"):""}}},attrObj:e,getmaxTagLength:async function({modelKey:t,fieldKey:n}){const r=await $t.getConfigByField(t,n);r&&r.specificConfig&&(e.value={maxTagTextLength:(De(r.specificConfig,["codeVisibleNum"])??{}).codeVisibleNum||12})}}},Ht=/* @__PURE__ */Y({name:"DesignRender",props:{model:{type:Object,required:!0},prefix:{type:String,default:""},preview:{type:Boolean,default:!1},context:{type:Object,default:()=>({})}},setup(e){const t=T("design-render"),n=ut();n.prefix=e.prefix,n.preview=e.preview,n.setNodes(e.model.nodes),n.setTree(e.model.tree),ue(()=>e.context,()=>{n.state.context=e.context},{immediate:!0});const r=R(()=>e.model.pageNode?b(e.model.pageNode.data):{}),o=n.getNodes();function i(t,r){const o=et.get(t.type,n.prefix);if(!o)return console.warn(`未找到节点类型为${t.type}的渲染器`),null;let s=null;return s=o.mode===ce.CONTAINER?function(t,r){const o=et.get(t.type,n.prefix),s=n.getNodes(t.id),a=n.getController(t.id);return F(ee(o.component),{key:t.id,c:a,model:t,parent:r,preview:e.preview,context:n.state.context,pageModel:e.model.pageNode},s.map(e=>i(e,t)))}(t,r):o.mode===ce.ITEM?function(t,r){const o=et.get(t.type,n.prefix),i=n.getController(t.id);return F(ee(o.component),{key:t.id,c:i,model:t,parent:r,preview:e.preview,context:n.state.context,pageModel:e.model.pageNode})}(t,r):k("div",null,[_("未支持的适配器模式["),o.mode,_("]")]),k(tt,{model:t},{default:()=>s})}function s(t){if(!e.model.pageNode)return t;const r=et.get(e.model.pageNode.type,n.prefix);if(!r)return console.warn(`未找到页面节点类型为${e.model.pageNode.type}的渲染器`),t;const o=n.getController(e.model.pageNode.id);return F(ee(r.component),{key:e.model.pageNode.id,c:o,model:e.model.pageNode,parent:void 0,preview:e.preview,context:n.state.context},t)}return()=>k("div",{class:t.b(),style:r.value},[s(o.map(e=>i(e)))])}}),Ft={class:"handwriting-pad"},Vt=["width","height"],Bt=/* @__PURE__ */((e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n})(/* @__PURE__ */Y({__name:"HandwritingPad",props:{width:{default:300},height:{default:150},backgroundColor:{default:"transparent"},lineWidth:{default:2},strokeStyle:{default:"#000"}},setup(e,{expose:t}){const n=e,r=Z(null);let o=null,i=!1,s=0,a=0;function u(e){const t=r.value.getBoundingClientRect();return"touches"in e?{x:e.touches[0].clientX-t.left,y:e.touches[0].clientY-t.top}:{x:e.offsetX,y:e.offsetY}}function c(e){e.preventDefault(),i=!0;const{x:t,y:n}=u(e);s=t,a=n}function l(e){if(!i||!o)return;e.preventDefault();const{x:t,y:n}=u(e);o.beginPath(),o.moveTo(s,a),o.lineTo(t,n),o.stroke(),o.closePath(),s=t,a=n}function d(e){e.preventDefault(),i=!1}return K(()=>{o=r.value.getContext("2d"),"transparent"!==n.backgroundColor&&(o.fillStyle=n.backgroundColor,o.fillRect(0,0,n.width,n.height)),o.lineWidth=n.lineWidth,o.strokeStyle=n.strokeStyle}),t({getValue:function(){var e;return null===(e=r.value)||void 0===e?void 0:e.toDataURL()},setValue:function(e){const t=new Image;t.src=e,t.onload=()=>{null==o||o.drawImage(t,0,0)}},clear:function(){null==o||o.clearRect(0,0,n.width,n.height),"transparent"!==n.backgroundColor&&(o.fillStyle=n.backgroundColor,o.fillRect(0,0,n.width,n.height))}}),(t,n)=>(z(),P("div",Ft,[A("canvas",{ref_key:"canvasRef",ref:r,width:e.width,height:e.height,class:"canvas",onMousedown:c,onMousemove:l,onMouseup:d,onMouseleave:d,onTouchstart:c,onTouchmove:l,onTouchend:d},null,40,Vt)]))}}),[["__scopeId","data-v-d5b980b7"]]),Ut=class{static runApp({userInfo:e,env:t,aid:n}){this.ENV=t,this.AID=n,this.userInfo=e}};He(Ut,"ENV",void 0),He(Ut,"AID",void 0),He(Ut,"userInfo",void 0);var Lt={[f.DATE]:{callback:e=>N(e,["YYYY-MM-DD","YYYY/MM/DD"],!0).isValid(),message:"日期变量格式为YYYY-MM-DD,YYYY/MM/DD"},[f.TIME]:{callback:e=>N(e,"HH:mm:ss",!0).isValid(),message:"时间变量格式HH:mm:ss"},[f.DATETIME]:{callback:e=>N(e,["YYYY-MM-DD HH:mm:ss","YYYY/MM/DD HH:mm:ss"]).isValid(),message:"日期时间变量格式为YYYY-MM-DD HH:mm:ss,YYYY/MM/DD HH:mm:ss"}},Gt=/* @__PURE__ */function(e){return e.WEB="web_module",e.MOBILE="mobile_module",e.PAD="pad_module",e}({}),Kt={[Gt.WEB]:{getPageInfo:_gct.api.apaas.webpage.getInfo,getTxnPageInfo:_gct.api.apaas.transaction.getGetVersionById,getDetailPageInfo:_gct.api.apaas.detailPage.getInfo},[Gt.MOBILE]:{getPageInfo:_gct.api.apaas.mobilePage.getInfo},[Gt.PAD]:{getPageInfo:_gct.api.apaas.padPage.getInfo,getTxnPageInfo:_gct.api.apaas.transaction.getGetVersionById}},Wt=Z({}),qt=Z({}),zt=Z({});function Jt(e,t){zt.value[e]=t}var Xt=Z({pageStyle:{},pageConfig:{},pageName:""}),Qt=oe(()=>{const{title:e}=Xt.value.pageConfig||{};return e}),Zt=class e{static setModals(e){this.modalsCache={},null==e||e.forEach(e=>{this.modalsCache[e.id]=e})}static async getModalById(e){if(!e)return Promise.reject();if(/^i?g_modal_/.test(e)&&!this.modalsCache[e]){const[t]=await _api.apaas.appGlobalSettings.getInfo({keys:e,fullInfo:!0})||[];if(null==t?void 0:t.configJson){const n=JSON.parse(t.configJson);this.modalsCache[e]=n}}return this.modalsCache[e]||(console.error(`模态框${e}不存在`),Promise.reject())}static getPremission(e){if(!e)return!0;const t=this.permissions[e];return!t||C().getPermissionByKey(this.pageID,t)}static setPremission(e,t){this.permissions[t]=e}static setContextByKey(e,t){t?this.ContextCache[t]=e:this.ContextCache={page:e}}static getContextByKey(e){return this.ContextCache[e||"page"]}static async initvars(){(await _gct.api.apaas.appGlobalSettings.getList({type:"var",fullInfo:!0})||[]).forEach(e=>{if(e.configJson)try{const t=JSON.parse(e.configJson);qt.value[t.key]=(({value:e,appredis:t,key:n,type:r})=>{var o;const i="dev"!==Ut.ENV&&t,{cacheMap:s}=kt(`${Ut.AID}_${null===(o=Ut.userInfo)||void 0===o?void 0:o.userId}`);return new Proxy({value:e,type:r},{get:(e,t)=>i&&"value"===t?s.value[n]:Reflect.get(e,t),set:(e,t,r,o)=>(i&&"value"===t&&(s.value[n]?s.value[n]=r:s.value={...s.value,[n]:r}),Reflect.set(e,t,r,o))})})({value:t.defaultValue,appredis:t.appredis,key:t.key,type:t.type})}catch(t){console.error("initvars",t)}})}static async inithooks(){(await _gct.api.apaas.appGlobalSettings.getList({type:"event",fullInfo:!0})||[]).forEach(e=>{if(e.configJson)try{const t=new Function(JSON.parse(e.configJson).runJs),n=this.globalHookCaches[e.key];n&&n.push(t)}catch(t){console.error("inithooks",t)}})}static async initPermission(e){this.permissions=e||{}}static async initGlobalS(e){var t;if(this.setModals(e.modals),null===(t=e.pageVars)||void 0===t||t.forEach(e=>{var t;Wt.value[e.key]={value:null===(t=e.varInfo)||void 0===t?void 0:t.defaultValue,type:e.varInfo.type}}),!this.startRuning){this.startRuning=!0;try{await Promise.all([this.initvars(),this.inithooks()])}catch(n){console.log(n)}}}static getGlobalVar(e){const t=qt.value[e];return t?t.value:console.warn("变量key不存在")}static async setGlobalVar(e,t){const n=qt.value[e];if(!n)return console.warn("变量key不存在");n.value=t}static getPageVar(e){const t=Wt.value[e];return t?t.value:console.warn("变量key不存在")}static async setPageVar(e,t){const n=Wt.value[e];if(!n)return console.warn("变量key不存在");await function(e,t){if(t===f.NULL)return!0;const{callback:n,message:r}=Lt[t]||{callback:e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase()===t,value:"变量值必须为"+t};return n(e)?Promise.resolve():Promise.reject(r)}(t,n.type),Wt.value[e]&&(Wt.value[e].value=t)}static getPageGlobalVar(e){var t;return null===(t=Wt.value[e])||void 0===t?void 0:t.value}static setPageGlobalVar(e,t){Wt.value[e]?Wt.value[e].value=t:Wt.value[e]={value:t,type:"string"}}static async initPageByid(e,t=Gt.WEB){this.pageID=e;const n=Kt[t].getPageInfo,r=await n({id:e}),{runtimeJson:o,name:i}=r||{};if(Xt.value.pageName=i,!o)return Promise.reject();const s=JSON.parse(o);return s.widgets.filter(e=>"bottom-button-container"!==e.type).length?(await this.initGlobalS(s),Xt.value.pageConfig=s.pageConfig||{},Xt.value.pageStyle=s.pageStyle||{},{res:r,data:s,name:i}):Promise.reject()}static async initTxnPageByid(e,t=!1){this.pageID=e;const n=Kt[Gt.WEB].getTxnPageInfo,r=await n({id:e}),{runtimeJson:o,detailRuntimeJson:i,name:s}=r||{},a=t?i:o;if(Xt.value.pageName=s,!a)return Promise.reject();const u=JSON.parse(a);return u.widgets.filter(e=>"bottom-button-container"!==e.type).length?(await this.initGlobalS(u),Xt.value.pageConfig=u.pageConfig||{},Xt.value.pageStyle=u.pageStyle||{},{res:r,data:u,name:s}):Promise.reject()}static async initDetailPageById(e){this.pageID=e;const t=Kt[Gt.WEB].getDetailPageInfo,n=await t({id:e}),{runtimeJson:r,name:o}=n||{};if(Xt.value.pageName=o,!r)return Promise.reject();const i=JSON.parse(r);return i.widgets.filter(e=>"bottom-button-container"!==e.type).length?(await this.initGlobalS(i),Xt.value.pageConfig=i.pageConfig||{},Xt.value.pageStyle=i.pageStyle||{},{res:n,data:i,name:o}):Promise.reject()}static async initHistoryByid(e){this.pageID=e;const t=await _gct.api.apaas.pageDesignerLog.getInfo({id:e}),{runtimeJson:n,name:r}=t||{};if(!n)return Promise.reject();Xt.value.pageName=r;const o=JSON.parse(n);return await this.initGlobalS(o),Xt.value.pageConfig=o.pageConfig||{},Xt.value.pageStyle=o.pageStyle||{},{res:t,data:o,name:r}}static usePageHooks(t,n,r,o){const i=Z(!1);return K(async()=>{await U();const e=null==n?void 0:n.pageBeforeMount;if((null==e?void 0:e.name)&&await t.runExportByName(e.name,e.extraParams),o&&await o(t),i.value=!0,null==r?void 0:r.pageMounted)for(const t of this.globalHookCaches.pageMounted)await t();const{extraParams:s,name:a}=(null==n?void 0:n.pageMounted)||{};a&&t.runAsyncExportByName(a,s)}),G(async()=>{Xt.value={};const{extraParams:e,name:o}=(null==n?void 0:n.pageDestroyed)||{};if(o&&t.runExportByName(o,e),null==r?void 0:r.pageDestroyed)for(const t of this.globalHookCaches.pageDestroyed)await t()}),L(async()=>{if(e.setContextByKey(t.context),null==r?void 0:r.pageActivated)for(const e of this.globalHookCaches.pageActivated)await e();const{extraParams:o,name:i}=(null==n?void 0:n.pageActivated)||{};i&&t.runAsyncExportByName(i,o)}),{pageload:i}}};He(Zt,"modalsCache",{}),He(Zt,"pageID",""),He(Zt,"permissions",{}),He(Zt,"ContextCache",{}),He(Zt,"startRuning",!1),He(Zt,"globalHookCaches",{pageMounted:[],pageActivated:[],pageDestroyed:[]});var en=Zt.getPremission.bind(Zt),tn=class{constructor(){He(this,"mode",ce.ITEM),He(this,"type",Ze.DESIGN_EDITOR),He(this,"fieldKey",void 0),He(this,"fieldType",void 0)}createController(e){throw new Error("Method not implemented.")}};function nn(e,t){class n extends tn{constructor(...n){super(...n),He(this,"fieldType",e),He(this,"component",t)}}return{install(){e&&et.registerDesignEditorNode(e,()=>new n)}}}var rn=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_utc=r()}(e,function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var s=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},s.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},s.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var a=s.parse;s.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var u=s.init;s.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else u.call(this)};var c=s.utcOffset;s.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],s=60*+o[1]+ +o[2];return 0===s?0:"+"===i?s:-s}(r),null===r))return this;var s=Math.abs(r)<=16?60*r:r;if(0===s)return this.utc(o);var a=this.clone();if(o)return a.$offset=s,a.$u=!1,a;var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(a=this.local().add(s+u,e)).$offset=s,a.$x.$localOffset=u,a};var l=s.format;s.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},s.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var d=s.toDate;s.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=s.diff;s.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),o=i(e).local();return f.call(r,o,t,n)}}})}),on=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_timezone=r()}(e,function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,o){var i,s=function(e,n,r){void 0===r&&(r={});var o=new Date(e);return function(e,n){void 0===n&&(n={});var r=n.timeZoneName||"short",o=e+"|"+r,i=t[o];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),t[o]=i),i}(n,r).formatToParts(o)},a=function(t,n){for(var r=s(t,n),i=[],a=0;a<r.length;a+=1){var u=r[a],c=u.type,l=u.value,d=e[c];d>=0&&(i[d]=parseInt(l,10))}var f=i[3],p=24===f?0:f,h=i[0]+"-"+i[1]+"-"+i[2]+" "+p+":"+i[4]+":"+i[5]+":000",g=+t;return(o.utc(h).valueOf()-(g-=g%1e3))/6e4},u=r.prototype;u.tz=function(e,t){void 0===e&&(e=i);var n,r=this.utcOffset(),s=this.toDate(),a=s.toLocaleString("en-US",{timeZone:e}),u=Math.round((s-new Date(a))/1e3/60),c=15*-Math.round(s.getTimezoneOffset()/15)-u;if(Number(c)){if(n=o(a,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(c,!0),t){var l=n.utcOffset();n=n.add(r-l,"minute")}}else n=this.utcOffset(0,t);return n.$x.$timezone=e,n},u.offsetName=function(e){var t=this.$x.$timezone||o.tz.guess(),n=s(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return n&&n.value};var c=u.startOf;u.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(n,e,t).tz(this.$x.$timezone,!0)},o.tz=function(e,t,n){var r=n&&t,s=n||t||i,u=a(+o(),s);if("string"!=typeof e)return o(e).tz(s);var c=function(e,t,n){var r=e-60*t*1e3,o=a(r,n);if(t===o)return[r,t];var i=a(r-=60*(o-t)*1e3,n);return o===i?[r,o]:[e-60*Math.min(o,i)*1e3,Math.max(o,i)]}(o.utc(e,r).valueOf(),u,s),l=c[0],d=c[1],f=o(l).utcOffset(d);return f.$x.$timezone=s,f},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(e){i=e}}})}),sn=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_quarterOfYear=r()}(e,function(){var e="month",t="quarter";return function(n,r){var o=r.prototype;o.quarter=function(e){return this.$utils().u(e)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(e-1))};var i=o.add;o.add=function(n,r){return n=Number(n),this.$utils().p(r)===t?this.add(3*n,e):i.bind(this)(n,r)};var s=o.startOf;o.startOf=function(n,r){var o=this.$utils(),i=!!o.u(r)||r;if(o.p(n)===t){var a=this.quarter()-1;return i?this.month(3*a).startOf(e).startOf("day"):this.month(3*a+2).endOf(e).endOf("day")}return s.bind(this)(n,r)}}})}),an=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=function(e,t){t.prototype.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]}}:"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_toArray=function(e,t){t.prototype.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]}}}(e,function(){return function(e,t){t.prototype.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]}}})}),un=/* @__PURE__ */_e((e,t)=>{!function(n,r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_isoWeek=r()}(e,function(){var e="day";return function(t,n,r){var o=function(t){return t.add(4-t.isoWeekday(),e)},i=n.prototype;i.isoWeekYear=function(){return o(this).year()},i.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,i,s,a=o(this),u=(n=this.isoWeekYear(),s=4-(i=(this.$u?r.utc:r)().year(n).startOf("year")).isoWeekday(),i.isoWeekday()>4&&(s+=7),i.add(s,e));return a.diff(u,"week")+1},i.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var s=i.startOf;i.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return"isoweek"===n.p(e)?r?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(e,t)}}})}),cn=/* @__PURE__ */ke({ABS:()=>tr,ADD:()=>Un,AND:()=>bn,AVERAGE:()=>er,BANKROUND:()=>rr,CONCAT:()=>Nn,COUNT:()=>Ur,DATE2TIMESTAMP:()=>gr,DATEFORMAT:()=>mr,DAY:()=>Tr,DIVISION:()=>Kn,DateAdd:()=>wr,DateSubtract:()=>Or,EQ:()=>On,EXP:()=>ur,FINDSTR:()=>jn,FIXED:()=>Wn,GE:()=>Sn,GET:()=>lr,GT:()=>Tn,HEADPUSH:()=>pr,HOUR:()=>Cr,IF:()=>gn,ISDATERANGE:()=>Yr,ISEMPTY:()=>mn,ISNULL:()=>yn,ISTIMERANGE:()=>jr,ISUNDEFINED:()=>vn,LARGE:()=>Xn,LASTMONTHRANGE:()=>Pr,LASTQUARTER:()=>$r,LASTWEEKRANGE:()=>xr,LASTYEARRANGE:()=>_r,LE:()=>En,LEN:()=>Cn,LN:()=>cr,LOWER:()=>Pn,LT:()=>In,LTRIM:()=>_n,MAX:()=>Jn,MAXABS:()=>nr,MIN:()=>Qn,MINUTE:()=>Nr,MOD:()=>or,MONTH:()=>Sr,MONTHRANGE:()=>Rr,MULTIPLICATION:()=>Gn,NE:()=>Dn,NOW:()=>Dr,OR:()=>wn,PARSENUMBER:()=>Fn,POWER:()=>sr,PUSH:()=>fr,PUT:()=>dr,QUARTER:()=>kr,REDUCE:()=>Ln,REPEAT:()=>$n,REPLACE:()=>Yn,ROUND:()=>qn,ROUNDUP:()=>zn,RSQ:()=>Gr,RTRIM:()=>kn,SEARCHSTR:()=>Hn,SEQMAP:()=>Vr,SMALL:()=>Zn,SPLIT:()=>Vn,SQRT:()=>ar,STDEV:()=>Lr,SUBSTR:()=>xn,SUBSTRING:()=>Mn,SUM:()=>Bn,SUMSQ:()=>Br,TIMESTAMP2DATE:()=>hr,TODAY:()=>Er,TRIM:()=>An,TUPLE:()=>Fr,UPPER:()=>Rn,WEEKRANGE:()=>Mr,YEAR:()=>Ir,YEARRANGE:()=>Ar}),ln=/* @__PURE__ */Ye(rn(),1),dn=/* @__PURE__ */Ye(on(),1),fn=/* @__PURE__ */Ye(sn(),1),pn=/* @__PURE__ */Ye(an(),1),hn=/* @__PURE__ */Ye(un(),1);function gn(e,t,n){return e?t:n}function mn(e){return null==e||""===e||0===e}function yn(e){return be(e)}function vn(e){return we(e)}function bn(...e){return(()=>{for(const t of e)if(!t)return!1;return!0})()}function wn(...e){return e.some(e=>e)}function On(e,t){return ve(e,t)}function Dn(e,t){return e!==t}function En(e,t){return("number"==typeof e&&"number"==typeof t||"string"==typeof e&&"string"==typeof t||e instanceof Date&&t instanceof Date)&&e<=t}function In(e,t){return("number"==typeof e&&"number"==typeof t||"string"==typeof e&&"string"==typeof t||e instanceof Date&&t instanceof Date)&&e<t}function Sn(e,t){return("number"==typeof e&&"number"==typeof t||"string"==typeof e&&"string"==typeof t||e instanceof Date&&t instanceof Date)&&e>=t}function Tn(e,t){return("number"==typeof e&&"number"==typeof t||"string"==typeof e&&"string"==typeof t||e instanceof Date&&t instanceof Date)&&e>t}function Cn(e){return(null==e?void 0:e.length)||0}function Nn(...e){return e.join("")}function Mn(e="",t,n){return(()=>{const r=(t<0?[...e].reverse().join(""):e).slice(Math.abs(t+Number(t<0)),Math.abs(n)+Number(t>=0));return t<0?[...r].reverse().join(""):r})()}function xn(e="",t,n){return(()=>{const r=(t<0?[...e].reverse().join(""):e).slice(Math.abs(t+Number(t<0)),Math.abs(t+Number(t<0))+Math.abs(n));return t<0?[...r].reverse().join(""):r})()}function Rn(e=""){return e.toUpperCase()}function Pn(e=""){return e.toLowerCase()}function An(e=""){return e.trim()}function _n(e=""){return e.replace(/^\s\s*/,"")}function kn(e=""){return e.replace(/\s\s*$/,"")}function $n(e="",t=""){return(null===(n=e.match(new RegExp(t,"g")))||void 0===n?void 0:n.length)||null;var n}function Yn(e="",t="",n=""){return e.replace(new RegExp(t,"g"),n)}function jn(e="",t=""){return e.includes(t)}function Hn(e="",t=""){return(null===(n=e.match(new RegExp(t,"g")))||void 0===n?void 0:n.length)||0;var n}function Fn(e=""){return(()=>{const t=parseFloat(e);return isNaN(t)?null:t})()}function Vn(e="",t=""){return e.split(t)}function Bn(...e){const t=e.flat().filter(e=>""!==e&&null!=e);return t.length?t.reduce(Kr,0):""}function Un(...e){return e.flat().reduce(Kr,0)}function Ln(e,...t){return t.reduce(Wr,e)}function Gn(e,...t){const n=t.flat().filter(e=>""!==e&&null!=e);return n.length?n.reduce(qr,e):""}function Kn(e,...t){return t.reduce(zr,e)}function Wn(e,t){return(()=>{if(t<0)throw new Error("Decimal places should be non-negative.");const[n,r=""]=e.toString().split(".");if(0==t)return n;let o=r.split("");if(o.length>t)o=o.slice(0,t);else{const e=o.length;for(let n=0;n<t-e;n++)o.push("0")}return`${n}.${o.join("")}`})()}function qn(e,t){return(()=>{if(null===e||""===e||void 0===e)return"";if(t<0)throw new Error("Decimal places should be non-negative.");const n=Math.trunc(t),r=Number(e);if(isNaN(r))return"";const o=r>0?(+(Math.round(Number(r+`e${n}`))+`e-${n}`)).toFixed(n):-(+(Math.round(Number(-r+`e${n}`))+`e-${n}`)).toFixed(n);return parseFloat(o+"")})()}function zn(e,t){if(null===e||""===e||void 0===e)return"";if(t<0)throw new Error("Decimal places should be non-negative.");return t=t?parseInt(t+""):0,new Ee(e).decimalPlaces(t,Ee.ROUND_UP).toNumber()}function Jn(...e){const t=e.flat().filter(e=>""!==e&&null!=e);return t.length?Math.max.apply(null,t):""}function Xn(e,t){return(()=>{if(t<1||t>e.length)throw new Error("Invalid value of n. It should be between 1 and the array length.");return e.sort((e,t)=>t-e)[t-1]})()}function Qn(...e){const t=e.flat().filter(e=>""!==e&&null!=e);return t.length?Math.min.apply(null,t):""}function Zn(e,t){return(()=>{if(t<1||t>e.length)throw new Error("Invalid value of n. It should be between 1 and the array length.");return e.sort((e,t)=>e-t)[t-1]})()}function er(...e){const t=e.flat().filter(e=>""!==e&&null!=e),n=t.length;if(!n)return"";let r=new Ee(0);for(const o of t)r=r.plus(o);return r.dividedBy(n).toNumber()}function tr(e){return Math.abs.call(null,e)}function nr(...e){const t=e.flat().filter(e=>null!=e);return t.length?t.reduce((e,t)=>Math.abs(Number(t))>Math.abs(Number(e))?t:e):""}function rr(e,t){if(null===e||""===e||void 0===e)return"";if(t<0)throw new Error("Decimal places should be non-negative.");return t=t?parseInt(t+""):0,new Ee(e).decimalPlaces(t,Ee.ROUND_HALF_EVEN).toNumber()}function or(e,t){return(()=>{if(0===e)throw new Error("The second value should not be zero.");const n=new Ee(e).mod(t).toNumber();return isNaN(n)?"":n})()}function ir(e){if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){const t=e.trim();if(""===t)return null;const n=Number(t);return Number.isFinite(n)?n:null}if("bigint"==typeof e){const t=Number(e);return Number.isFinite(t)?t:null}return null}function sr(e,t){return(()=>{const n=ir(e),r=ir(t);return null===n||null===r?NaN:Math.abs(r)>1e9?r>0?1/0:0:Math.pow(n,r)})()}function ar(e){return(()=>{const t=ir(e);return null===t?NaN:Math.sqrt(t)})()}function ur(e){return(()=>{const t=ir(e);return null===t?NaN:Math.exp(t)})()}function cr(e){return(()=>{const t=ir(e);if(null===t||t<=0)throw new Error("The value must be greater than zero.");return Math.log(t)})()}function lr(e,t){return(()=>{if(Array.isArray(e)){if("number"==typeof t)return e[t];throw new Error("For arrays, the second argument should be a number.")}if("object"==typeof e){if("string"==typeof t)return e[t];throw new Error("For objects, the second argument (b) should be a string.")}throw new Error("Unsupported data type. The first argument (a) should be an array or an object.")})()}function dr(e,t,n){return(()=>{if(Array.isArray(e)){if(!("number"==typeof t&&t>=0&&t<e.length))throw new Error("For arrays, the second argument (b) should be a number.");e[t]=n}else{if("object"!=typeof e)throw new Error("Unsupported data type. The first argument (a) should be an array or an object.");if("string"!=typeof t||!e)throw new Error("For objects, the second argument (b) should be a string.");e[t]=n}return e})()}function fr(e,t){return(()=>{if(!t)throw new Error("For arrays, the second argument should not be null or undefined");return e.push(t),e})()}function pr(e,t){return(()=>{if(!t)throw new Error("For arrays, the second argument should not be null or undefined");return e.unshift(t),e})()}function hr(e){if(e)return(()=>{if(!e)throw new Error("the frist argument should not be null");const t=/* @__PURE__ */new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`})()}function gr(e){if(e)return N(e).unix()}function mr(e,t){if(e)return N(e).format(t)}function yr(e){return/^\d{2}:\d{2}(:\d{2})?$/.test(e.trim())?"time":/^\d{4}-\d{2}-\d{2}$/.test(e.trim())?"date":"datetime"}function vr(e){return"date"===e?"YYYY-MM-DD":"time"===e?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss"}N.extend(ln.default),N.extend(dn.default),N.extend(fn.default),N.extend(pn.default),N.extend(hn.default);var br="2000-01-01 ";function wr(e,t,n,r){if(e)return(()=>{const o=yr(e),i=r??vr(o);return N("time"===o?br+e.trim():e).add(t,n).format(i)})()}function Or(e,t,n,r){if(e)return(()=>{const o=yr(e),i=r??vr(o);return N("time"===o?br+e.trim():e).subtract(t,n).format(i)})()}function Dr(){return N().format("YYYY-MM-DD HH:MM:ss")}function Er(){return N().format("YYYY-MM-DD")}function Ir(e){return N(e).year()}function Sr(e){return N(e).month()}function Tr(e){return N(e).day()}function Cr(e){return N(e).hour()}function Nr(e){return N(e).minute()}function Mr(){return[Hr(N().startOf("week").toDate()),Hr(N().endOf("week").toDate())]}function xr(){return[Hr(N().subtract(1,"week").startOf("week").toDate()),Hr(N().subtract(1,"week").endOf("week").toDate())]}function Rr(){return[Hr(N().startOf("month").toDate()),Hr(N().endOf("month").toDate())]}function Pr(){return[Hr(N().subtract(1,"month").startOf("month").toDate()),Hr(N().subtract(1,"month").endOf("month").toDate())]}function Ar(){return[Hr(N().startOf("year").toDate()),Hr(N().endOf("year").toDate())]}function _r(){return[Hr(N().subtract(1,"year").startOf("year").toDate()),Hr(N().subtract(1,"year").endOf("year").toDate())]}function kr(){return(()=>{const e=Math.floor((N().month()+3)/3);return[Hr(N().quarter(e).startOf("quarter").toDate()),Hr(N().quarter(e).endOf("quarter").toDate())]})()}function $r(){return(()=>{const e=Math.floor((N().month()+3)/3);return[Hr(N().quarter(e-1).startOf("quarter").toDate()),Hr(N().quarter(e-1).endOf("quarter").toDate())]})()}function Yr(e,t){return(()=>{const[n,r]=t;return e>=n&&e<=r})()}function jr(e,t){return(()=>{const[n,r]=t,o=N(e,"HH:mm");if(n>r){const e=N(n,"HH:mm"),t=N(r,"HH:mm").add(1,"day");return o>=e||o<=t}return o>=N(n,"HH:mm")&&o<=N(r,"HH:mm")})()}function Hr(e){return N(e).tz("America/Chicago").format("YYYY-MM-DD HH:mm:ss.SSSSSSSSS ZZ")}function Fr(...e){return[...e]}function Vr(...e){const t=(e.length-e.length%2)/2,n={};return Array(t).forEach(t=>{const r=e[2*t];n[r]=e[2*t+1]}),n}function Br(...e){return 0===(e=e.flat().filter(e=>""!==e&&null!=e)).length?"":e.map(e=>{const t=qr(e,e);return""!==t?t:new Ee(0).toNumber()}).reduce((e,t)=>Kr(e,t)||Ee(0).toNumber(),new Ee(0).toNumber())}function Ur(e){return Array.isArray(e)?e.length:""}function Lr(...e){const t=e.flat().filter(e=>""!==e&&null!=e).map(e=>Number(e)).filter(e=>Number.isFinite(e));if(t.length<2)return"";const n=t.reduce((e,t)=>e+t,0)/t.length,r=t.reduce((e,t)=>{const r=t-n;return e+r*r},0)/(t.length-1);return Math.sqrt(r)}function Gr(e,t){if(!Array.isArray(e)||!Array.isArray(t))return"";const n=e.map(e=>Number(e)).filter(e=>Number.isFinite(e)),r=t.map(e=>Number(e)).filter(e=>Number.isFinite(e));if(n.length<=1||r.length<=1||n.length!==r.length)return"";const o=n.length,i=n.reduce((e,t)=>e+t,0)/o,s=r.reduce((e,t)=>e+t,0)/o;let a=0,u=0,c=0;for(let f=0;f<o;f++){const e=n[f]-i,t=r[f]-s;a+=t*e,u+=e*e,c+=t*t}if(0===u||0===c)return"";const l=a/Math.sqrt(c*u),d=l*l;return Math.min(Math.max(d,0),1)}function Kr(e,t){const n=new Ee(e).plus(new Ee(t)).toNumber();return isNaN(n)?"":n}function Wr(e,t){const n=new Ee(e).minus(new Ee(t)).toNumber();return isNaN(n)?"":n}function qr(e,t){const n=new Ee(e).multipliedBy(new Ee(t)).toNumber();return isNaN(n)?"":n}function zr(e,t){const n=new Ee(e).div(new Ee(t)).toNumber();return isNaN(n)?"":n}var Jr={};Object.defineProperty(window,"_METHOD_DEBUG_",{configurable:!0,enumerable:!0,get:()=>({...Jr,...cn})});var Xr=Rt(function(e,t=!1){const n=Ie.parse(e);let r=[];return Se.traverse(n,{enter:function(e){if(e.type===Ie.Syntax.MemberExpression){const t=Zr(e);r.push(t),Object.assign(e,{name:t,type:Ie.Syntax.Identifier})}else e.type===Ie.Syntax.Identifier&&r.push(e.name);r=t?r.filter(e=>!O[e]&&"undefined"!==e):r.filter(e=>!(O[e]||"undefined"===e||D.includes(e)||e.startsWith(v)||e.startsWith("undefined.")))}}),[...new Set(r)]}),Qr=Rt(async function(e,t){const n=Xr(e,!0),r=n.filter(e=>D.includes(e)).sort(),o=n.filter(e=>e.startsWith(v)).sort(),i=await to([...r,...o]),s=Ie.parse(e);Se.replace(s,{enter(e){if(e.type===Ie.Syntax.BinaryExpression){const{operator:t}=e,n=I[t];return n?{type:Ie.Syntax.CallExpression,arguments:[e.left,e.right],callee:{type:Ie.Syntax.Identifier,name:n},optional:!1}:e}return e}}),Se.traverse(s,{enter:function(e){e.type===Ie.Syntax.CallExpression&&e.callee.type===Ie.Syntax.Identifier&&(e.callee.name=`await Methods.${e.callee.name}`)}});const a=Te.generate(s,{format:{semicolons:!1}}),u={},c=[];i.forEach(e=>{c.push(`const ${e.key} = ${JSON.stringify(e.value)};`)}),Object.keys(t).map(e=>{if(e.includes(".")){const[n="",r]=e.split(".");u[n]||(c.push(`const ${n} = {};`),u[n]=!0),c.push(`${n}.${r} = ${JSON.stringify(t[e])};`)}else c.push(`const ${e} = ${JSON.stringify(t[e])};`)});const l=new eo("Methods",[...c,"return (async () => {",`const res = ${a};`,"return res;","})()"].join("\n")),d=await l({...Jr,...cn});return console.info("【表达式】",e),console.info("【参数】",t),console.info("【执行语句】",l.toString()),console.info("【执行结果】",d),d});function Zr(e){return e.type===Ie.Syntax.MemberExpression?`${e.object.type===Ie.Syntax.MemberExpression?Zr(e.object):e.object.name}.${e.property.name}`:e.type===Ie.Syntax.Identifier?e.name:""}var eo=Object.getPrototypeOf(async function(){}).constructor,to=Rt(async function(e){let t=[];return e.length>0&&(t=await _gct.api.apaas.systemVar.getGetVarByKeys({keys:e.join(",")})),t});window.gct_expression={execute:Qr,identify:Xr,register:function(e,t){"string"==typeof e&&e&&"function"==typeof t?Jr[e]=t:console.warn("[Expression] registerExpressionMethods 参数非法:fnName 需为非空字符串,executor 需为函数")}};var no={[c.TEXT]:{attrsTransform:[{from:"specificConfig.minValue",to:"minlength"},{from:"specificConfig.maxValue",to:"maxlength"}]},[c.LONG_TEXT]:{attrsTransform:[{from:"specificConfig.minValue",to:"minlength"},{from:"specificConfig.maxValue",to:"maxlength"}]},[c.INTEGER]:{attrsTransform:[{from:"specificConfig.minValue",to:"minValue"},{from:"specificConfig.maxValue",to:"maxValue"}]},[c.LONG]:{attrsTransform:[{from:"specificConfig.minValue",to:"minValue"},{from:"specificConfig.maxValue",to:"maxValue"}]},[c.DOUBLE]:{attrsTransform:[{from:"specificConfig.minValue",to:"minValue"},{from:"specificConfig.maxValue",to:"maxValue"}]},[c.DECIMAL]:{attrsTransform:[{from:"specificConfig.digits",to:"precision"},{from:"specificConfig.minValue",to:"minValue"},{from:"specificConfig.maxValue",to:"maxValue"}]}},ro=(e,t)=>{const{attrsTransform:n=[]}=no[e]??{};return n.reduce((e,n)=>{const r=me(t,n.from);return e[n.to]=r,e},{})},oo=class extends m{static async loadRenderPlugin(e,t=[]){try{const n=await this.loadPlugins(e,t);t.forEach(e=>{const t=e.key;n[t]?_gct.register.render.register(t,n[t].default):console.error(`${t} 插件加载失败,请检查插件配置是否正确`)})}catch(n){console.error(n)}}static loadMobilePlugin(e=[]){return this.loadRenderPlugin(g.MOBILE,e)}static loadPadPlugin(e=[]){return this.loadRenderPlugin(g.PAD,e)}static loadWebPlugin(e=[]){return this.loadRenderPlugin(g.WEB,e)}};function io(e){const{style:t={}}=e||{},n="ignoringStyle"in e?e.ignoringStyle??[]:[],r=fe(t);return{wrapperStyle:de(t,n),wStyle:r,labelFont:le(t.labelFont),contentFont:le(t.contentFont)}}var so=e=>le(e);function ao(e,t){return(null==e?void 0:e.map(e=>uo(e,t)))||[]}function uo(e={},t={}){var n;const r=he(e);r._X_ROW_KEY=void 0;const o=(null===(n=Object.keys(t??{}))||void 0===n?void 0:n.length)?Object.keys(r).reduce((e,n)=>{const o=t[n],i=r[n];if(o&&i)try{const t=(i+"").split(",").map(e=>o[e]);e[n]={[i+""]:t}}catch{}return e},{}):r._DICT||{};return{...r,_DICT:o,_OPCT:r.__FOREIGN__&&"object"==typeof r.__FOREIGN__?uo(r.__FOREIGN__,t):{}}}function co(e,t,n){"object"==typeof t&&Oe(e,uo(t,n))}function lo(e,t,n){if("object"!=typeof t)return;for(const o in e)"_OPCT"!==o&&"_NOSUBMIT"!==o&&delete e[o];const r=uo(t,n);r._X_ROW_KEY=t._X_ROW_KEY,Oe(e,r)}function fo(e,t={},n={}){const r=he(t.__FOREIGN__||t),o={_DICT:{}};return Object.keys(r).forEach(t=>{const i=`${e}.${t}`,s=n[t],a=r[t];if(s&&a)try{const e=(a+"").split(",").map(e=>s[e]);o._DICT[i]={[a+""]:e}}catch{}o[i]=a}),{...r,_OPCT:o}}function po(e={},t={}){const n=he(e);return t&&0!==Object.keys(t).length?Object.keys(n).reduce((e,r)=>{const o=n[r],i=t[r];return i?null==o?(e[r]=o,e):(e[r]=String(o).split(",").map(e=>i[e]??e).filter(Boolean).join(","),e):(e[r]=o,e)},{}):n}function ho(e,t,n=!1){var r;if(n||(null==e||null===(r=e.customApi)||void 0===r?void 0:r.value))return t(e);const o="object"==typeof e?Ce.stringify({...e,customApi:null}):e;let i=go.get(o);return i||(i=(async()=>{try{return await t(e)}catch(n){throw go.delete(o),n}})(),go.set(o,i,5e3),i)}var go=class{static set(e,t,n){this.cachedata[e]={maxAge:n||0,value:t,now:Date.now()}}static get(e){this.reset();const t=this.cachedata[e];return t?t.value:null}static delete(e){return delete this.cachedata[e]}static clear(){this.cachedata={}}static reset(){for(const e in this.cachedata){const t=this.cachedata[e];t&&Date.now()-t.now>t.maxAge&&this.delete(e)}}};async function mo({ids:e,refOriginField:t,refOriginFieldType:n,model:r,foreignFields:o}){if(!e)return Promise.reject();const i=await async function({refOriginFieldType:e,modelKey:t,foreignFields:n,ids:r}){if(e===c.RDO_REF){const{data:e={},dict:o={}}=await _gct.api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({modelKey:t,bsKey:"rdoGetVersionByRefId",modelCategory:a.ENTITY},{refId:r},{foreignFields:n});return{data:e,dict:o}}{const{data:e={},dict:o={}}=await _gct.api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({modelKey:t,bsKey:"getOne",modelCategory:a.ENTITY},{},{query:{"id_.eq":r},foreignFields:n});return{data:e,dict:o}}}({refOriginFieldType:n,modelKey:r,foreignFields:o,ids:e});return(null==i?void 0:i.data)?fo(t,i.data,i.dict):void 0}He(go,"cachedata",{});var yo=e=>ho(e,mo),vo=[y.CONTAINALL,y.CONTAINANY,y.IN,y.NOTIN];function bo(e,t,n){const{body:r,exp:o,similarField:i}=function(e){const r={};let o,i=n||"";return t.forEach(t=>{const n=t.props.fieldSearchKey||t.props.field,s=t.props.ope||[];let a=e[t.id];(function(e){return null==e||""===e||!!Array.isArray(e)&&(0===e.length||e.every(e=>null==e||""===e))})(a)&&!t.props.useMore||(!o&&n&&(o=n),s.forEach(e=>{a=function(e,t){return vo.indexOf(t)>-1&&"string"==typeof e?e.split(","):e}(a,e);const o=`${n}.${e}:${t.id}`,s=`${t.id}.${e}`;r[o]=t.props.useMore?null:a,i=i.replace(s,o)}))}),{body:r,exp:i,similarField:o}}(function(e,t){if(!t.length)return e;const n=t.filter(e=>e.props.fieldType===c.RDO_REF);return n.length?(n.forEach(t=>{if(e[t.id]){if(!Array.isArray(e[t.id])){const[n,r]=e[t.id].split(":");return r||n}e[t.id]=e[t.id].map(e=>{if(!e)return;const[t,n]=e.split(":");return n||t})}}),e):e}(e,t));return{query:r,exp:o,similarField:i}}var wo=/* @__PURE__ */new Map;async function Oo(e,t={}){const{defaultValue:n}=e.props;if(!n)return null;if(Array.isArray(n)){if(!n.includes("CURRENT_ORG"))return null}else if("CURRENT_ORG"!==n)return null;const r=await _api.platform.tenant.getUserInfo();if(r){const t=await _api.apaas.designerCommon.getGetCanBeUsedOrgUser({pageNo:1,pageSize:999999999});if(t){const n=t.data;if(n&&-1!==n.findIndex(e=>e.masterOrgId===r.masterOrgId))return E(e.props.ope)?[r.masterOrgId]:r.masterOrgId}return null}}async function Do(e,t={}){const{defaultValue:n}=e.props;if(!n)return null;if(Array.isArray(n)){if(!n.includes("CURRENT_USER"))return null}else if("CURRENT_USER"!==n)return null;const r=await _api.platform.user.getInfo();if(r){const t=await _api.apaas.designerCommon.getGetCanBeUsedOrgUser({pageNo:1,pageSize:999999999});if(t){const n=t.data;if(n&&-1!==n.findIndex(e=>e.id===r.userId))return E(e.props.ope)?[r.userId]:r.userId}return null}}async function Eo(e,t={}){const{defaultValue:n}=e.props;return n&&0!==n.length?n:null}async function Io(e,t={}){const{defaultValue:n}=e.props;return null==n?null:n}function So(e,t,n={}){const{defaultValueType:r,defaultValue:i}=e.props;if(null==r||""==r)return null;const{isRang:s,fieldType:a}=e.props;if(!s){const e=a===c.DATE?"YYYY-MM-DD":"YYYY-MM-DD HH:mm:ss";if(r===o.SystemDate)return N(/* @__PURE__ */new Date).format(e)}if(s){const e=a===c.DATE?"YYYY-MM-DD":"YYYY-MM-DD 00:00:00",t=a===c.DATE?"YYYY-MM-DD":"YYYY-MM-DD 23:59:59",n=null!=i?Number(i):0,u=N();switch(r){case o.SystemDate:return s?[u.format(e),u.format(t)]:u.format(e);case o.PastDays:return[u.subtract(n,"day").format(e),u.subtract(n>0?1:0,"day").format(t)];case o.FutureDays:return[u.add(n>0?1:0,"day").format(e),u.add(n,"day").format(t)];case o.PastWeeks:return[u.subtract(n,"week").startOf("isoWeek").format(e),u.subtract(n>0?1:0,"week").endOf("isoWeek").format(t)];case o.PastMonths:return[u.subtract(n,"month").startOf("month").format(e),u.subtract(n>0?1:0,"month").endOf("month").format(t)];case o.PastYears:return[u.subtract(n,"year").startOf("year").format(e),u.subtract(n>0?1:0,"year").endOf("year").format(t)];case o.Yesterday:{const n=u.subtract(1,"day");return[n.format(e),n.format(t)]}case o.Past7Days:return[u.subtract(6,"day").format(e),u.format(t)];case o.Past30Days:return[u.subtract(29,"day").format(e),u.format(t)];case o.ThisWeek:return[u.startOf("isoWeek").format(e),u.endOf("isoWeek").format(t)];case o.LastWeek:{const n=u.subtract(1,"week");return[n.startOf("isoWeek").format(e),n.endOf("isoWeek").format(t)]}case o.ThisMonth:return[u.startOf("month").format(e),u.endOf("month").format(t)];case o.LastMonth:{const n=u.subtract(1,"month");return[n.startOf("month").format(e),n.endOf("month").format(t)]}case o.ThisYear:return[u.startOf("year").format(e),u.endOf("year").format(t)];case o.LastYear:{const n=u.subtract(1,"year");return[n.startOf("year").format(e),n.endOf("year").format(t)]}default:return null}}return null}wo.set(c.ORG,Oo),wo.set(c.ORG_MULTI,Oo),wo.set(c.USER,Do),wo.set(c.USER_MULTI,Do),wo.set(c.ENUM,Eo),wo.set(c.ENUM_MULTI,Eo),wo.set(c.INTEGER,Io),wo.set(c.LONG,Io),wo.set(c.DOUBLE,Io),wo.set(c.DECIMAL,Io),wo.set(c.TEXT,async function(e,t={}){const{defaultValue:n}=e.props;return n||null}),wo.set(c.LONG_TEXT,Io),wo.set(c.BOOLEAN,async function(e,t={}){const{defaultValue:n}=e.props;return null==n||""===n?null:n}),wo.set(c.DATE,async function(e,t={}){return So(e)}),wo.set(c.DATE_TIME,async function(e,t={}){return So(e)}),wo.set(c.PRINTER,async function(e,t={}){const{defaultValue:n}=e.props;return n&&0!==n.length?n:null});function To(e,t=[]){return"ignoreCase"==(null==t?void 0:t[0])?null==e?void 0:e.replace(/\./g,".i"):e}function Co(e,t=[]){return"ignoreCase"==(null==t?void 0:t[0])?null==e?void 0:e.map(e=>{const t=e.split(".");return`${t[0]}.i${t[1]}`}):e}var No=({searchField:e,keyword:t})=>t&&(null==e?void 0:e.reduce((e,n)=>(e[n.split(".").length>1?n:n+".like"]=t,e),{}))||{},Mo=e=>{let t={},n="";if(ye(e))t={...e.reduce((e,t)=>(e[t.key+"."+t.ope]=t.value,e),{})};else try{const o=JSON.parse(null==e?void 0:e.dataRule);n=null==o?void 0:o.exp;const i=(null==o?void 0:o.typeMap)||{},s=(null==o?void 0:o.query)||{};for(const e in s)if("VAR"===i[e]){var r;t[e]=null===(r=qt.value)||void 0===r||null===(r=r[s[e]])||void 0===r?void 0:r.value}else t[e]=s[e]}catch(o){console.log(o)}return{query:t,getExp:function(...e){const t=[n,...e].filter(e=>e),r=t.join(",");return t.length>1?`AND(${r})`:r}}},xo=({collation:e,collationSort:t,collationField:n})=>e?e.filter(e=>e.collationField).map(e=>({sortField:e.collationField,sortType:e.collationSort})):t?[{sortField:n,sortType:t}]:[];function Ro(e,t){var n;if((null==t?void 0:t.trim())&&(null==e?void 0:e.length))return(null===(n=e[0])||void 0===n?void 0:n.split(".")[0])||void 0}var Po=Object.prototype.toString;function Ao(e,t){return Po.call(e)===`[object ${t}]`}function _o(e){return void 0!==e}function ko(e){return!_o(e)}function $o(e){return null!==e&&Ao(e,"Object")}function Yo(e){return qo(e)||Lo(e)?0===e.length:e instanceof Map||e instanceof Set?0===e.size:!!$o(e)&&0===Object.keys(e).length}function jo(e){return Ao(e,"Date")}function Ho(e){return null===e}function Fo(e){return ko(e)&&Ho(e)}function Vo(e){return ko(e)||Ho(e)}function Bo(e){return Ao(e,"Number")}function Uo(e){return Ao(e,"Promise")&&$o(e)&&Go(e.then)&&Go(e.then)}function Lo(e){return Ao(e,"String")}function Go(e){return"function"==typeof e}function Ko(e){return Ao(e,"Boolean")}function Wo(e){return Ao(e,"RegExp")}function qo(e){return!!e&&Array.isArray(e)}function zo(e){return"undefined"!=typeof window&&Ao(e,"Window")}function Jo(e){return $o(e)&&!!e.tagName}function Xo(e){return Ao(e,"Map")}function Qo(e){return/^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/.test(e)}function Zo(e){return void 0===e||!e&&0!==e&&"0"!==e||!/[^\s]/.test(e+"")}function ei(e,t){const n=[],r=e.props.fieldType,o=R(()=>e.props.readonly&&r&&!n.includes(r)&&(void 0===t.value||""===t.value||null===t.value));return{RenderEmptyValue:/* @__PURE__ */Y((e,t)=>()=>_gct.store.getEmptyDisplay),isEmpty:o}}var ti=(e,t)=>["post","put"].includes(t)?(t,n={},r={},o={})=>e({modelKey:t.key,bsKey:t.action,modelCategory:t.modelCategory??a.ENTITY},r,n,o):(t,n={},r={})=>e({modelKey:t.key,bsKey:t.action,modelCategory:t.modelCategory??a.ENTITY},n,r),ni={post:ti(_gct.api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey,"post"),get:ti(_gct.api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey,"get"),put:ti(_gct.api.apaas.modelComprehensive.putBizServiceModelCategoryModelKeyBsKey,"put"),delete:ti(_gct.api.apaas.modelComprehensive.deleteBizServiceModelCategoryModelKeyBsKey,"delete")};async function ri(e,n,...r){return ni[t[e.action]](e,n,...r)}async function oi(e,t,{body:n={},query:r={}}={},o={}){return await _gct.api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey({bsKey:t,modelKey:e,modelCategory:a.ENTITY},r,n,o)}var ii=class e{constructor(){if(He(this,"mask",void 0),He(this,"container",void 0),He(this,"spinner",void 0),e.instance)return e.instance;e.instance=this,this.createLoadingElement(),this.initStyle()}createLoadingElement(){this.mask=document.createElement("div"),this.mask.id="gct-global-loading-mask",this.container=document.createElement("div"),this.container.id="gct-global-loading-container",this.spinner=document.createElement("div"),this.spinner.id="gct-global-loading-spinner",this.container.appendChild(this.spinner),this.mask.appendChild(this.container),document.body.appendChild(this.mask)}initStyle(){Object.assign(this.mask.style,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(255, 255, 255, 0.5)",zIndex:9999,display:"none",justifyContent:"center",alignItems:"center"}),Object.assign(this.container.style,{display:"flex",flexDirection:"column",alignItems:"center",width:"43px",height:"43px",backgroundColor:"transparent",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.15)"}),Object.assign(this.spinner.style,{display:"grid",width:"43px",height:"43px",gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"repeat(2, 1fr)",gap:"3px"});const e=getComputedStyle(document.documentElement).getPropertyValue("--gct-color-primary").trim();[{id:"gct-global-loading-item_1",delay:"0s"},{id:"gct-global-loading-item_2",delay:"0.25s"},{id:"gct-global-loading-item_3",delay:"0.75s"},{id:"gct-global-loading-item_4",delay:"0.5s"}].forEach(t=>{const n=document.createElement("div");n.id=t.id,Object.assign(n.style,{backgroundColor:e,opacity:.2,animation:"globalLoading 1s infinite",animationDelay:t.delay}),this.spinner.appendChild(n)});const t=document.createElement("style");t.textContent="\n @keyframes globalLoading {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0.2;\n }\n }",document.head.appendChild(t)}show(){this.mask.style.display="flex",document.body.style.overflow="hidden"}hide(){this.mask.style.display="none",document.body.style.overflow=""}};He(ii,"instance",void 0);var si=new ii,ai=class{constructor({taskId:e,processInstanceId:t,examineAndApproveState:n=u.MY_CUSTOM,refFormId:r}){He(this,"isHandle",!1),He(this,"buttonConfig",{}),He(this,"fieldConfig",{}),He(this,"processId",""),He(this,"dataId",""),He(this,"taskId",void 0),He(this,"processInstanceId",void 0),He(this,"refFormId",void 0),He(this,"examineAndApproveState",u.MY_CUSTOM),He(this,"fieldStatus",""),He(this,"viewPageKey",void 0),He(this,"isviewPage",void 0),He(this,"isAPPviewPage",void 0),He(this,"nonRelatedPerson",!1),this.taskId=e,this.processInstanceId=t,this.examineAndApproveState=n,this.refFormId=r}async readyProcess(){const{taskId:e,processInstanceId:t}=this;if(this.examineAndApproveState===u.MY_AGENT){await this.getDataInfo();const{node:t,processDefId:r,webViewPageKey:o,mobileViewPageKey:i}=await _gct.api.apaas.pmProcessEngine.getTaskExtension({taskId:e});this.transformByNode(t),this.processId=r;for(const e in this.buttonConfig)e===n.Withdraw&&(this.buttonConfig[e].show=!1);this.viewPageKey=(null==t?void 0:t.webViewPageKey)||o,this.isAPPviewPage=!!(null==t?void 0:t.mobileViewPageKey)||!!i}if(this.examineAndApproveState===u.MY_APPLICATION){await this.getDataInfo();const{node:e,processDefId:r,withdrawOp:o}=await _gct.api.apaas.pmProcessEngine.getInitialTaskExtension({processInstanceId:t})||{};this.transformByNode(e),this.processId=r;for(const t in this.buttonConfig)t===n.End&&(this.buttonConfig[t].show=!1),t===n.Withdraw&&(this.buttonConfig[t].show=!!o),t===n.Resubmit&&(this.buttonConfig[t].show=!1)}if(this.examineAndApproveState===u.MY_DONE){await this.getDataInfo();const{node:t,processDefId:n}=await _gct.api.apaas.pmProcessEngine.getHiTaskExtension({taskId:e});this.transformByNode(t),this.processId=n}if(this.examineAndApproveState===u.MY_CUSTOM){await this.getDataInfo();const{node:e,processDefId:n,btnList:r,webViewPageKey:o,taskId:i,initiatorNode:s}=await _gct.api.apaas.pmProcessEngine.getProcInstExtension({procInstId:t}),a=r||[];this.withdrawByNode(s),this.transformByNode(e),this.processId=n;for(const t in this.buttonConfig){const e=t;this.buttonConfig[e].show&&(this.buttonConfig[e].show=a.includes(t))}if(!e)return void(this.nonRelatedPerson=!0);!a.length||"__initiator__"===(null==e?void 0:e.key)&&!i?this.isviewPage=!0:this.viewPageKey=(null==e?void 0:e.webViewPageKey)||o}if(this.examineAndApproveState===u.MY_CUSTOM_Modal){await this.getDataInfo();const{node:e,btnList:n,taskId:r,processDefId:o,initiatorNode:i}=await _gct.api.apaas.pmProcessEngine.getProcInstExtension({procInstId:t}),s=n||[];this.withdrawByNode(i),this.transformByNode(e),this.processId=o;for(const t in this.buttonConfig){const e=t;this.buttonConfig[e].show&&(this.buttonConfig[e].show=s.includes(t))}if(!e)return void(this.nonRelatedPerson=!0);s.length&&("__initiator__"!==(null==e?void 0:e.key)||r)||(this.isviewPage=!0)}}withdrawByNode(e){if(!e)return;const{buttonConfig:t}=e;JSON.parse(t+"").forEach(e=>{const t=S(`sys.process.paasBpmnButtonEvent.${e.type}`);this.buttonConfig[e.type]={showModel:!1,title:S("sys.process.element.approval")+t,success:t+S("sys.success")+"!",show:e.enable,alias:e.alias,signature:!!e.signature,opinion:{},user:{}}})}transformByNode(e){if(e)try{const{opinionConfig:t,buttonConfig:r,fieldConfig:o}=e,i=JSON.parse(r||"[]"),s=JSON.parse(t||'{"enabled":false,"opinionType":[]}');i.forEach(e=>{const t=S(`sys.process.paasBpmnButtonEvent.${e.type}`);var r,o;this.buttonConfig[e.type]={showModel:![n.Resubmit,n.Withdraw,n.End].includes(e.type),title:S("sys.process.element.approval")+t,success:t+S("sys.success")+"!",show:e.enable,alias:e.alias,signature:!!e.signature,opinion:{show:s.enabled,required:(r=s.opinionType,o=e.type,!!r.includes(h.Required)||!r.includes(h.Optional)&&(r.includes(h.ApproveRequired)||r.includes(h.ApproveRequired)?o===n.Approve:r.includes(h.CountersignRequired)?o===n.Countersign:r.includes(h.ReassignRequired)?o===n.Reassign:r.includes(h.RejectRequired)?o===n.Reject:r.includes(h.RefuseRequired)?o===n.Refuse:void 0))},user:{show:[n.Reassign,n.Countersign].includes(e.type),multiple:n.Countersign===e.type,label:S(`sys.process.user.${e.type}`)}}}),this.fieldConfig=JSON.parse(o+"")}catch(t){console.error("流程信息解析失败",t)}}async getDataInfo(){const{dataId:e}=await _gct.api.apaas.pmProcessEngine.getModel({processInstanceId:this.processInstanceId});this.dataId=e}filterButton(e){return this.nonRelatedPerson||this.examineAndApproveState===u.MY_DONE?[]:e.filter(e=>{if(e.type===d.ProcessApproveButton){const t=this.buttonConfig[e.props.action],n=!!(null==t?void 0:t.show);return n&&(e.props.title=t.alias),n}return!0})}useFieldWidget(e){if(this.nonRelatedPerson)return;const t=e.props.field,{fieldConfig:n,examineAndApproveState:r}=this;if(n&&n[t]){const{permission:r}=n[t];switch(r){case ui.disabled:e.props.disabled=!0,e.props.readonly=!1;break;case ui.editable:e.props.disabled=!1,e.props.readonly=!1;break;case ui.readonly:e.props.readonly=!0}}else e.props.readonly=!0;e.props.disabled||![u.MY_APPLICATION,u.MY_DONE].includes(r)&&!this.isviewPage||(e.props.readonly=!0)}useFieldToShow(e){const t=e.props.field,{fieldConfig:n}=this;if(n&&n[t]){const{permission:r}=n[t];r===ui.hidden&&(e.props.hidden=!0)}}};var ui=/* @__PURE__ */function(e){return e.hidden="hidden",e.readonly="readonly",e.disabled="disabled",e.editable="editable",e}({}),ci=class e{static register(e,t){Object.entries(t).forEach(([t,n])=>{if("function"!=typeof n)return void console.error(`套件 ${e} 注册上下文扩展 ${t} 失败:扩展值必须是函数`);const r=this.extensions.get(t);if(r){const n=r.suiteKey===e?"同一套件重复":"套件间";console.warn(`${n}注册上下文扩展 ${t}:${r.suiteKey} 将被 ${e} 覆盖`)}this.extensions.set(t,{suiteKey:e,method:n})})}apply(t){e.extensions.forEach(({suiteKey:e,method:n},r)=>{this.isReservedKey(t,r)?console.error(`套件 ${e} 的上下文扩展 ${r} 与内置上下文方法冲突,已跳过挂载`):t[r]=(...e)=>n(t,...e)})}isReservedKey(e,t){return t in e}};function li(e,t){ci.register(e,t)}function di(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fi(e,t,n){di(e,t),t.set(e,n)}function pi(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function hi(e,t,n){return e.set(pi(e,t),n),n}function gi(e,t){return e.get(pi(e,t))}He(ci,"extensions",/* @__PURE__ */new Map);var mi=new ci,yi=/* @__PURE__ */new WeakMap,vi=/* @__PURE__ */new WeakMap,bi=/* @__PURE__ */new WeakSet,wi=class{constructor({js:e,css:t,pageKey:n,ContextVm:r}){var o;di(this,o=bi),o.add(this),He(this,"context",void 0),He(this,"searchVNodes",void 0),He(this,"cssData",void 0),He(this,"pageKey",void 0),He(this,"exports",void 0),fi(this,yi,void 0),fi(this,vi,void 0),He(this,"ProcessAppRoved",void 0),He(this,"pageLayoutMode",void 0),this.cssData=pi(bi,this,Oi).call(this,t),this.searchVNodes={},this.exports={},hi(vi,this,{}),hi(yi,this,{}),this.context=new r({$ref:this.getComponent.bind(this),$asyncRef:this.getSyncComponent.bind(this)}),mi.apply(this.context),pi(bi,this,Di).call(this,e),Zt.setContextByKey(this.context,n),this.pageKey=n}async runProcessBySaskId({taskId:e,processInstanceId:t,examineAndApproveState:n,refFormId:r}){this.ProcessAppRoved=new ai({taskId:e,processInstanceId:t,examineAndApproveState:n,refFormId:r}),await this.ProcessAppRoved.readyProcess()}runContext(e,t){this.context.gctWidgets[e]=t}async runEventByName(e,t={},...n){const r=t[e];let o;if(r){if(Array.isArray(r))o=await async function(e,t,n){const r=e.map(Ci.bind(t,n));await Promise.all(r)}(r,this.context,n);else{const e=this.exports[r.name];if(!e)throw`函数${r.name}不存在`;o=await e(...n,re(r.extraParams))}return o}}async runExportByName(e,...t){try{const n=this.exports[e];if(!n)throw`函数${e}不存在`;return n(...t)}catch(n){console.error(n)}}async runAsyncExportByName(e,...t){try{const n=this.exports[e];if(!n)throw`函数${e}不存在`;return await this.getReadyByFun(n),n(...t)}catch(n){console.error(n)}}initNode(e,t){e&&(gi(vi,this)[e]=t,pi(bi,this,Ii).call(this,e,t))}destroyNode(e){delete gi(vi,this)[e],delete gi(yi,this)[e]}initSearchs(e,t,n){if(e)if(this.searchVNodes[e]){const r=this.searchVNodes[e].find(e=>e.comId===n);r?r.callback=t:this.searchVNodes[e].push({callback:t,comId:n})}else this.searchVNodes[e]=[{callback:t,comId:n}]}cancelInitSearchs(e,t){e&&this.searchVNodes[e]&&(this.searchVNodes[e]=this.searchVNodes[e].filter(e=>e.comId!==t),0===this.searchVNodes[e].length&&delete this.searchVNodes[e])}runTableBySearch(e,t){(this.searchVNodes[e]||[]).forEach(({callback:e})=>e(t))}getComponent(e){const t=gi(vi,this)[e];if(t)return new Ti(e,t);console.error(e+"组件不存在或者未初始化")}getSyncComponent(e){if(!e)return Promise.reject("标识不能为空");const t=gi(vi,this)[e];return t?Promise.resolve(new Ti(e,t)):new Promise((t,n)=>{const r=setTimeout(()=>{n(e+"不存在或者被隐藏")},3e4);pi(bi,this,Ei).call(this,e,n=>{clearTimeout(r),t(new Ti(e,n))})})}async getReadyByFun(e){var t;if("function"!=typeof e)return Promise.reject("参数必须是函数");const n=(null===(t=String(e).match(/\$ref\((["'A-Za-z0-9_-]+)\)/g))||void 0===t?void 0:t.map(e=>{var t;const n=null===(t=e.match(/\$ref\(['|"]([A-Za-z0-9_-]+)['|"]\)/))||void 0===t?void 0:t[1];return this.getSyncComponent(n)}))||[];await Promise.all(n)}async processHandle(e,{opinion:t,reassignId:n,signature:r,countersignUserIds:o,button:i}){const{taskId:s,processInstanceId:a}=this.ProcessAppRoved,u={procInstId:a,data:e,opinion:t,button:i,countersignUserIds:o,taskId:s,signature:r,reassignId:n};await _gct.api.apaas.pmProcessEngine.postProcExecute(u)}async checkedProcess(e){const{processId:t}=this.ProcessAppRoved||{};return t?e!==t?Promise.reject(S("sys.process.processInstanceMismatch")):void 0:Promise.reject(S("sys.process.pleaseInitiateTheProcessFirst"))}};function Oi(e,t={}){if(!e)return;const{css:n,load:r,unload:o}=function(e,t={}){const n=ne(!1),{document:r=Dt,immediate:o=!0,manual:i=!1,id:s="vueuse_styletag_"+ ++Pt}=t,a=ne(e);let u=()=>{};const c=()=>{if(!r)return;const e=r.getElementById(s)||r.createElement("style");e.isConnected||(e.id=s,t.nonce&&(e.nonce=t.nonce),t.media&&(e.media=t.media),r.head.appendChild(e)),n.value||(u=ue(a,t=>{e.textContent=t},{immediate:!0}),n.value=!0)},l=()=>{r&&n.value&&(u(),r.head.removeChild(r.getElementById(s)),n.value=!1)};var d;return o&&!i&&bt(c),i||(d=l,H()&&W(d,void 0)),{id:s,css:a,unload:l,load:c,isLoaded:Q(n)}}(e,t);return{css:n,load:r,unload:o}}function Di(e){if(e)try{new Function("exports","CTX",e)(this.exports,this.context)}catch(t){console.error(t,"createFunction")}}function Ei(e,t){const n=gi(vi,this)[e];n?t(e,n):gi(yi,this)[e]?gi(yi,this)[e].push(t):gi(yi,this)[e]=[t]}function Ii(e,t){gi(yi,this)[e]&&gi(yi,this)[e].forEach(e=>{e(t)})}var Si=class{constructor({$ref:e,$asyncRef:t}){He(this,"$ref",void 0),He(this,"$asyncRef",void 0),He(this,"$getModal",void 0),He(this,"$closeModal",void 0),He(this,"$customBizService",ni),He(this,"gctWidgets",{}),He(this,"$utility",{_:pe,cloneDeep:he,differenceBy:ge,dayjs:N,BigNumber:Ee,plus:(e,t)=>new Ee(e).plus(new Ee(t)).toNumber(),minus:(e,t)=>new Ee(e).minus(new Ee(t)).toNumber(),multipliedBy:(e,t)=>new Ee(e).multipliedBy(new Ee(t)).toNumber(),div:(e,t)=>new Ee(e).div(new Ee(t)).toNumber(),transformSourceData:ao,transformData:uo}),He(this,"$httpBizService",ri),He(this,"$request",oi),He(this,"$loading",si),this.$asyncRef=t,this.$ref=e}$getPremission(e){return Zt.getPremission(e)}$setPremission(e,t){Zt.setPremission(e,t)}$getAppGlobalVar(e){return Zt.getGlobalVar(e)}$setAppGlobalVar(e,t){Zt.setGlobalVar(e,t)}$getPageGlobalVar(e){return Zt.getPageGlobalVar(e)}$setPageGlobalVar(e,t){Zt.setPageGlobalVar(e,t)}$getPageVar(e){return Zt.getPageVar(e)}$setPageVar(e,t){Zt.setPageVar(e,t)}$getCtxById(e){return Zt.getContextByKey(e)}$setPropsByKey(e,t){var n;const r=null===(n=this.gctWidgets[e])||void 0===n?void 0:n.props;if(r)for(const o in t)r[o]=t[o]}$getPropsByKey(e,t=[],n){const r=this.gctWidgets[e];if(!r)return{};const o=n||!r.props?r:r.props;return"string"==typeof t&&(t=[t]),t.reduce((e,t)=>(e[t]=o[t],e),{})}},Ti=class{constructor(e,t){He(this,"modelKey",void 0),He(this,"getValue",void 0),He(this,"setValue",void 0),He(this,"submit",void 0),He(this,"reload",void 0),He(this,"key",void 0),this.key=e;const n=t.elRef;Object.keys(n).forEach(e=>{this[e]=n[e]})}};async function Ci(e,t){const{name:n,refId:r,scopeId:o,modalTitle:i}=t,s=(null==i?void 0:i.split("."))||[];let a;if(s.length>1){var u;const e=[];Ni(e,(null===(u=this.gctWidgets)||void 0===u?void 0:u[s[0]])||{}),a=e.find(e=>e.id===s[1])||{}}else if(s.length){var c;a=null===(c=this.gctWidgets)||void 0===c?void 0:c[s[0]]}var l;n===p.OPEN_MODAL&&await this.$getModal(r).open({title:null==a||null===(l=a.props)||void 0===l?void 0:l.title}),n===p.CLOSE_MODAL&&(r?await this.$getModal(r).close():await this.$closeModal()),n===p.REFRESH_TABLE&&await(await this.$getCtxById(o).$asyncRef(r)).reload(e?e[0]:null)}function Ni(e,t){const n=t.children||[];for(const o of n)if(o.type&&o.type==d.CustomButton)e.push(o);else{var r;(null===(r=o.children)||void 0===r?void 0:r.length)&&Ni(e,o)}}function Mi({expression:e="",rowData:t=null,immediate:n=!0},r){if(!e||"true"===e)return void r(!0);const o=Xr(e),i=o.reduce((e,t)=>{const n=t.split(".");return e[t]={formKey:n[0],itemKey:n[1]},e},{}),s=R(()=>o.reduce((e,n)=>{const r=n.split("."),o=r[0]+"",i=r[1];if(i){var s;const n=(t?t[i]:null===(s=zt.value[o])||void 0===s?void 0:s[i])??"";e[o]?e[o][i]=n:e[o]={[i]:n}}else if(o.startsWith("$VAR_")||o.startsWith("$IVAR_")){var a;e[o]=(null===(a=qt.value[o])||void 0===a?void 0:a.value)??""}else if(o.startsWith("$PAGERVAR_")||o.startsWith("$IPAGERVAR_")){var u;e[o]=(null===(u=Wt.value[o])||void 0===u?void 0:u.value)??""}return e},{}));function a(t){const n={};Object.keys(i).forEach(e=>{var r;const{formKey:o,itemKey:s}=i[e];n[e]=s?null===(r=t[o])||void 0===r?void 0:r[s]:t[o]}),Qr(e,n).then(r).catch(t=>{console.error("[组件依赖] 表达式计算失败:",e,n,t)})}t&&n&&a(s.value),wt(s,()=>{a(s.value)},{debounce:200,immediate:n&&!t})}async function xi({expression:e="",rowData:t=null}){if(!e||"true"===e)return!0;const n=Xr(e).reduce((e,t)=>{const n=t.split(".");return e[t]={formKey:n[0],itemKey:n[1]},e},{}),r={};return Object.keys(n).forEach(e=>{const{formKey:o,itemKey:i}=n[e];let s="";var a;if(o.startsWith("$VAR_"))s=(null===(a=qt.value[o])||void 0===a?void 0:a.value)??"";else if(o.startsWith("$PAGERVAR_")){var u;s=(null===(u=Wt.value[o])||void 0===u?void 0:u.value)??""}else if(i){var c;s=(t?t[i]:null===(c=zt.value[o])||void 0===c?void 0:c[i])??""}else s=(t?t[o]:zt.value[o])??"";r[e]=s}),Qr(e,r)}function Ri(e,t){return en(t)?e.displayType===s.CONFIG?oe(()=>!e.hidden):function(e){const t=Z(!1);return Pi(e,e=>{t.value=!!e}),t}(e):Z(!1)}function Pi({displayRule:e,tableForm:t},n){if(e){const r=Xr(e),o=r.reduce((e,t)=>{const n=t.split(".");return e[t]={formKey:n[0],itemKey:n[1]},e},{}),i=oe(()=>r.reduce((e,n)=>{var r;const o=n.split("."),i=o[0]+"",s=o[1]+"",a=null===(r={...t,...zt.value}[i])||void 0===r?void 0:r[s];return e[i]?e[i][s]=a:e[i]={[s]:a},e},{}));wt(i,()=>{!function(e,t,n,r){const o={};Object.keys(t).forEach(n=>{var r;const{formKey:i,itemKey:s}=t[n];o[n]=null==e||null===(r=e[i])||void 0===r?void 0:r[s]}),Qr(n,o).then(r).catch(e=>{console.error("[显隐规则] 表达式计算失败:",n,o,e)})}(i.value,o,e,e=>{n(e)})},{immediate:!0,debounce:300})}else n(!0)}function Ai(e,t){const n=X({});return oe(()=>e?e.filter(e=>{const{displayRule:r,hidden:o,displayType:i}=e.props||e;return en(e.id)?i===s.CONFIG?n[e.id]=!o:Pi({displayRule:r,tableForm:t},t=>{n[e.id]=t}):n[e.id]=!1,n[e.id]}):[])}function _i(e,t){if(!(null==e?void 0:e.length))return;const n=[],r=[];e.forEach((e,t)=>{e.displayRule?r.push({...e,id:t}):n.push({...e,id:t})});const o=ki(r,t),i=ki(n,t);return oe(()=>(null==o?void 0:o.value)||(null==i?void 0:i.value))}function ki(e,t){const n=X({});if(e)return oe(()=>e.find(e=>{const{displayRule:r,hidden:o,displayType:i}=e.props||e;return i===s.CONFIG?n[e.id]=!o:Pi({displayRule:r,tableForm:t},t=>{n[e.id]=t}),n[e.id]}))}function $i(e){var t,n;return(null===(t=e.props)||void 0===t?void 0:t.displayRule)&&(null===(n=e.props)||void 0===n?void 0:n.displayType)===s.RULE?Ri(e.props,e.id):Yi(e)}function Yi(e,t){var n;if(!e.id)return e.props.hidden=!0,Z(!1);if(!en(e.id))return e.props.hidden=!0,Z(!1);const r=V("useProcessFieldEvent",void 0);if(r)return r.useFieldToShow(e),oe(()=>!e.props.hidden);const{displayType:o,displayRule:a}=e.props||{},{value:u,expression:c}=((null===(n=e.props.componentDependency)||void 0===n?void 0:n.configDependency)||{})[i.HIDDEN]||{};return u&&c?(e.props.hidden=!0,Mi({expression:c,rowData:t},t=>{e.props.hidden=!!t})):u?e.props.hidden=!0:o===s.RULE&&a&&(e.props.hidden=!0,Mi({expression:a,rowData:t},t=>{e.props.hidden=!t})),oe(()=>!e.props.hidden)}async function ji(e,t){var n;if(!e.id)return!1;if(!en(e.id))return e.props.hidden=!0,!1;const r=V("useProcessFieldEvent",void 0);if(r)return r.useFieldToShow(e),!e.props.hidden;const{displayType:o,displayRule:a}=e.props||{},{value:u,expression:c}=((null===(n=e.props.componentDependency)||void 0===n?void 0:n.configDependency)||{})[i.HIDDEN]||{},l=async e=>{try{return await xi({expression:e,rowData:t})}catch(n){return console.error("[组件依赖] 显隐规则表达式计算失败:",e,n),!0}};return u&&c?(e.props.hidden=!0,e.props.hidden=await!!l(c)):u?e.props.hidden=!0:o===s.RULE&&a&&(e.props.hidden=!0,e.props.hidden=await!!l(a)),!e.props.hidden}function Hi(e,t){return e.forEach(e=>{Yi(e,t)}),oe(()=>e.filter(e=>!e.props.hidden))}function Fi(e,t){var n;const{value:r,expression:o}=((null===(n=e.props.componentDependency)||void 0===n?void 0:n.configDependency)||{})[i.HIDDEN]||{};r&&o&&Mi({expression:o},e=>{t(e)}),t(e.props.hidden)}function Vi(e){var t;const n=(null===(t=e.props.componentDependency)||void 0===t?void 0:t.configDependency)||{},{value:r,expression:o}=n[i.HIDDEN]||{};r&&o&&Mi({expression:o},t=>{e.props.hidden=!!t});const{value:s,expression:a}=n[i.REQUIRED]||{};s&&a&&Mi({expression:a},t=>{e.props.required=!!t})}function Bi(t,n={},r=!1){var o,s,a;const{readonly:u,field:c,isFieldModel:l,bindFieldLink:d,refOriginField:f,refOriginModelKey:p,refOriginFieldType:h}=t.props,g=(null===(o=t.props.componentDependency)||void 0===o?void 0:o.configDependency)||{},m=V("formReadonly",void 0),y=V("useProcessFieldEvent",void 0);if(y&&y.useFieldWidget(t),!y&&t.formItem&&void 0!==(null==m?void 0:m.value)&&(t.props.readonly=(null==m?void 0:m.value)||t.props.readonly),!y&&!(null==m?void 0:m.value)){var v,b,w,O,D,E,I,S;const e=Z(null),o=Z(!1),s=Z(!1),a=()=>{const n=e.value??u;t.props.readonly=n&&!o.value&&!s.value},c=null===(v=g[i.READONLY])||void 0===v?void 0:v.expression,l=null===(b=g[i.READONLY])||void 0===b?void 0:b.fieldValue,d=null===(w=g[i.READONLY])||void 0===w?void 0:w.value;!l&&d&&c&&Mi({expression:c,rowData:r?n:null},t=>{e.value=!!t,a()});const f=null===(O=g[i.REQUIRED])||void 0===O?void 0:O.expression,p=null===(D=g[i.REQUIRED])||void 0===D?void 0:D.value;!(null===(E=g[i.REQUIRED])||void 0===E?void 0:E.fieldValue)&&p&&f&&Mi({expression:f,rowData:r?n:null},e=>{t.props.required=!!e,o.value=!!e,a()});const h=null===(I=g[i.DISABLED])||void 0===I?void 0:I.expression;(null===(S=g[i.DISABLED])||void 0===S?void 0:S.value)&&h&&Mi({expression:h,rowData:r?n:null},e=>{t.props.disabled=!!e,s.value=!!e,a()})}const T=null===(s=g[i.ASSIGNMENT])||void 0===s?void 0:s.expression,C=null===(a=g[i.ASSIGNMENT])||void 0===a?void 0:a.strategy,N=Z(!1);if(C===e.notCoveredForever){const e=n[c];""!==e&&null!=e&&(N.value=!0)}T&&!u&&Mi({expression:T,rowData:r?n:null,immediate:!1},t=>{(C!==e.notCovered&&C!==e.notCoveredForever||!N.value)&&(n[c]=t)});const M=l?null==d?void 0:d.join("."):c;n._OPCT||(n._OPCT={_DICT:{}});const x=R(()=>l?n._OPCT:n),P=R({get:()=>M?x.value[M]:"",set(t){T&&C===e.alwaysCover||(T&&C===e.notCovered&&(N.value=""!==t&&null!=t&&0!==t&&!1!==t),T&&C===e.notCoveredForever&&(N.value=!0),x.value[M]=t)}});if(l&&f){const e=oe(()=>n[d[0]]),t=d.length>2?[d[1]+".*"]:void 0;wt(e,async()=>{try{const n=await yo({ids:e.value,refOriginField:d[0],refOriginFieldType:h,model:p,foreignFields:t});x.value[M]=n._OPCT[M],x.value._DICT||(x.value._DICT={}),x.value._DICT[M]=n._OPCT._DICT[M]}catch{for(const e in x.value)e.startsWith(M)&&(x.value[e]=void 0)}},{debounce:100,immediate:!0})}return{value:P,formRowData:x,fieldKey:M}}function Ui(e){var t,n,r,o;const{readonly:s}=e.props,a=(null===(t=e.props.componentDependency)||void 0===t?void 0:t.configDependency)||{},u=null===(n=a[i.REQUIRED])||void 0===n?void 0:n.expression,c=null===(r=a[i.REQUIRED])||void 0===r?void 0:r.value;!(null===(o=a[i.REQUIRED])||void 0===o?void 0:o.fieldValue)&&c&&u&&Mi({expression:u},t=>{e.props.required=!!t,e.props.readonly=!t&&s})}var Li={preview:{type:Boolean,default:!1},c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,required:!0}},Gi={preview:{type:Boolean,default:!1},c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,required:!0}},Ki={preview:{type:Boolean,default:!1},c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,required:!0},field:{type:Object,required:!0},value:{type:Object}},Wi=/* @__PURE__ */ke({Vue:()=>M,Vue2:()=>{},del:()=>Xi,install:()=>zi,isVue2:()=>!1,isVue3:()=>!0,set:()=>Ji});import*as qi from"vue";function zi(){}function Ji(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function Xi(e,t){Array.isArray(e)?e.splice(t,1):delete e[t]}$e(Wi,qi,"default");var Qi=Symbol.for("DndContextType");function Zi(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var es="function"==typeof Symbol&&Symbol.observable||"@@observable",ts=function(){return Math.random().toString(36).substring(7).split("").join(".")},ns={INIT:"@@redux/INIT"+ts(),REPLACE:"@@redux/REPLACE"+ts(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ts()}};function rs(e){var t=typeof e;return"production"!==process.env.NODE_ENV&&(t=function(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";var n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}(e)),t}function os(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?Zi(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?Zi(1):"Expected the enhancer to be a function. Instead, received: '"+rs(n)+"'");return n(os)(e,t)}if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Zi(2):"Expected the root reducer to be a function. Instead, received: '"+rs(e)+"'");var o=e,i=t,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function l(){if(u)throw new Error("production"===process.env.NODE_ENV?Zi(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function d(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Zi(4):"Expected the listener to be a function. Instead, received: '"+rs(e)+"'");if(u)throw new Error("production"===process.env.NODE_ENV?Zi(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var t=!0;return c(),a.push(e),function(){if(t){if(u)throw new Error("production"===process.env.NODE_ENV?Zi(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,c();var n=a.indexOf(e);a.splice(n,1),s=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error("production"===process.env.NODE_ENV?Zi(7):"Actions must be plain objects. Instead, the actual type was: '"+rs(e)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?Zi(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(u)throw new Error("production"===process.env.NODE_ENV?Zi(9):"Reducers may not dispatch actions.");try{u=!0,i=o(i,e)}finally{u=!1}for(var t=s=a,n=0;n<t.length;n++)(0,t[n])();return e}return f({type:ns.INIT}),(r={dispatch:f,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Zi(10):"Expected the nextReducer to be a function. Instead, received: '"+rs(e));o=e,f({type:ns.REPLACE})}})[es]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error("production"===process.env.NODE_ENV?Zi(11):"Expected the observer to be an object. Instead, received: '"+rs(e)+"'");function n(){e.next&&e.next(l())}return n(),{unsubscribe:t(n)}}})[es]=function(){return this},e},r}function is(e,t,...n){if("undefined"!=typeof process&&"production"===process.env.NODE_ENV&&void 0===t)throw new Error("invariant requires an error message argument");if(!e){let e;if(void 0===t)e=/* @__PURE__ */new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let r=0;e=new Error(t.replace(/%s/g,function(){return n[r++]})),e.name="Invariant Violation"}throw e.framesToPop=1,e}}function ss(e){return"object"==typeof e}var as="dnd-core/INIT_COORDS",us="dnd-core/BEGIN_DRAG",cs="dnd-core/PUBLISH_DRAG_SOURCE",ls="dnd-core/HOVER",ds="dnd-core/DROP",fs="dnd-core/END_DRAG";function ps(e,t){return{type:as,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var hs={type:as,payload:{clientOffset:null,sourceClientOffset:null}};function gs(e){return function(t=[],n={publishSource:!0}){const{publishSource:r=!0,clientOffset:o,getSourceClientOffset:i}=n,s=e.getMonitor(),a=e.getRegistry();e.dispatch(ps(o)),function(e,t,n){is(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(e){is(n.getSource(e),"Expected sourceIds to be registered.")})}(t,s,a);const u=function(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,s);if(null==u)return void e.dispatch(hs);let c=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");!function(e){is("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(i),c=i(u)}e.dispatch(ps(o,c));const l=a.getSource(u).beginDrag(s,u);return null!=l?(function(e){is(ss(e),"Item must be an object.")}(l),a.pinSource(u),{type:us,payload:{itemType:a.getSourceType(u),item:l,sourceId:u,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!r}}):void 0}}function ms(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ys(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ms(e,t,n[t])})}return e}function vs(e){return function(t={}){const n=e.getMonitor(),r=e.getRegistry();!function(e){is(e.isDragging(),"Cannot call drop while not dragging."),is(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n),function(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n).forEach((o,i)=>{const s={type:ds,payload:{dropResult:ys({},t,bs(o,i,r,n))}};e.dispatch(s)})}}function bs(e,t,n,r){const o=n.getTarget(e);let i=o?o.drop(r,e):void 0;return function(e){is(void 0===e||ss(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:r.getDropResult()),i}function ws(e){return function(){const t=e.getMonitor(),n=e.getRegistry();!function(e){is(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const r=t.getSourceId();return null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:fs}}}function Os(e,t){return null===t?null===e:Array.isArray(e)?e.some(e=>e===t):e===t}function Ds(e){return function(t,{clientOffset:n}={}){!function(e){is(Array.isArray(e),"Expected targetIds to be an array.")}(t);const r=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,n){for(let r=e.length-1;r>=0;r--){const o=e[r];Os(t.getTargetType(o),n)||e.splice(r,1)}}(r,i,o.getItemType()),function(e,t,n){is(t.isDragging(),"Cannot call hover while not dragging."),is(!t.didDrop(),"Cannot call hover after drop.");for(let r=0;r<e.length;r++){const t=e[r];is(e.lastIndexOf(t)===r,"Expected targetIds to be unique in the passed array."),is(n.getTarget(t),"Expected targetIds to be registered.")}}(r,o,i),function(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}(r,o,i),{type:ls,payload:{targetIds:r,clientOffset:n||null}}}}function Es(e){return function(){if(e.getMonitor().isDragging())return{type:cs}}}var Is=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:t}=this.store,n=function(e){return{beginDrag:gs(e),publishDragSource:Es(e),hover:Ds(e),drop:vs(e),endDrag:ws(e)}}(this);return Object.keys(n).reduce((r,o)=>{const i=n[o];var s;return r[o]=(s=i,(...n)=>{const r=s.apply(e,n);void 0!==r&&t(r)}),r},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function Ss(e,t){return{x:e.x-t.x,y:e.y-t.y}}var Ts=[],Cs=[];Ts.__IS_NONE__=!0,Cs.__IS_ALL__=!0;var Ns=class{subscribeToStateChange(e,t={}){const{handlerIds:n}=t;is("function"==typeof e,"listener must be a function."),is(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let r=this.store.getState().stateId;return this.store.subscribe(()=>{const t=this.store.getState(),o=t.stateId;try{o===r||o===r+1&&!function(e,t){return e!==Ts&&(e===Cs||void 0===t||(n=t,r=e,n.filter(e=>r.indexOf(e)>-1)).length>0);var n,r}(t.dirtyHandlerIds,n)||e()}finally{r=o}})}subscribeToOffsetChange(e){is("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{const n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return is(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);return is(t,`Expected to find a valid target. targetId=${e}`),!(!this.isDragging()||this.didDrop())&&Os(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);return is(t,`Expected to find a valid source. sourceId=${e}`),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:n}=t;if(!this.isDragging())return!1;const r=this.registry.getTargetType(e),o=this.getItemType();if(o&&!Os(r,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const s=i.indexOf(e);return n?s===i.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return t&&n&&r?Ss((i=r,{x:(o=t).x+i.x,y:o.y+i.y}),n):null;var o,i}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:n}=e;return t&&n?Ss(t,n):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},Ms="undefined"!=typeof global?global:self,xs=Ms.MutationObserver||Ms.WebKitMutationObserver;function Rs(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}var Ps,As="function"==typeof xs?function(e){let t=1;const n=new xs(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:Rs,_s=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},ks=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=As(this.flush),this.requestErrorThrow=Rs(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},$s=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new _s(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(ks.registerPendingError),Ys="dnd-core/ADD_SOURCE",js="dnd-core/ADD_TARGET",Hs="dnd-core/REMOVE_SOURCE",Fs="dnd-core/REMOVE_TARGET";function Vs(e,t){t&&Array.isArray(e)?e.forEach(e=>Vs(e,!1)):is("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(Ps||(Ps={}));var Bs=0;function Us(e){switch(e[0]){case"S":return Ps.SOURCE;case"T":return Ps.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ls(e,t){const n=e.entries();let r=!1;do{const{done:e,value:[,o]}=n.next();if(o===t)return!0;r=!!e}while(!r);return!1}var Gs=class{addSource(e,t){Vs(e),function(e){is("function"==typeof e.canDrag,"Expected canDrag to be a function."),is("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),is("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const n=this.addHandler(Ps.SOURCE,e,t);return this.store.dispatch(function(e){return{type:Ys,payload:{sourceId:e}}}(n)),n}addTarget(e,t){Vs(e,!0),function(e){is("function"==typeof e.canDrop,"Expected canDrop to be a function."),is("function"==typeof e.hover,"Expected hover to be a function."),is("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const n=this.addHandler(Ps.TARGET,e,t);return this.store.dispatch(function(e){return{type:js,payload:{targetId:e}}}(n)),n}containsHandler(e){return Ls(this.dragSources,e)||Ls(this.dropTargets,e)}getSource(e,t=!1){return is(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return is(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return is(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return is(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return Us(e)===Ps.SOURCE}isTargetId(e){return Us(e)===Ps.TARGET}removeSource(e){var t;is(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:Hs,payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},ks.enqueueTask($s.create(t))}removeTarget(e){is(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:Fs,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);is(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){is(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){const r=function(e){const t=(Bs++).toString();switch(e){case Ps.SOURCE:return`S${t}`;case Ps.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}(e);return this.types.set(r,t),e===Ps.SOURCE?this.dragSources.set(r,n):e===Ps.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=/* @__PURE__ */new Map,this.dragSources=/* @__PURE__ */new Map,this.dropTargets=/* @__PURE__ */new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},Ks=(e,t)=>e===t;function Ws(e=Ts,t){switch(t.type){case ls:break;case Ys:case js:case Fs:case Hs:return Ts;default:return Cs}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,o=function(e,t){const n=/* @__PURE__ */new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);const o=[];return n.forEach((e,t)=>{1===e&&o.push(t)}),o}(n,r);if(!(o.length>0)&&function(e,t,n=Ks){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(n,r))return Ts;const i=r[r.length-1],s=n[n.length-1];return i!==s&&(i&&o.push(i),s&&o.push(s)),o}function qs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zs={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Js(e=zs,t){const{payload:n}=t;switch(t.type){case as:case us:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case ls:return r=e.clientOffset,o=n.clientOffset,!r&&!o||r&&o&&r.x===o.x&&r.y===o.y?e:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){qs(e,t,n[t])})}return e}({},e,{clientOffset:n.clientOffset});case fs:case ds:return zs;default:return e}var r,o}function Xs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Xs(e,t,n[t])})}return e}var Zs={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function ea(e=Zs,t){const{payload:n}=t;switch(t.type){case us:return Qs({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case cs:return Qs({},e,{isSourcePublic:!0});case ls:return Qs({},e,{targetIds:n.targetIds});case Fs:return-1===e.targetIds.indexOf(n.targetId)?e:Qs({},e,{targetIds:(r=e.targetIds,o=n.targetId,r.filter(e=>e!==o))});case ds:return Qs({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case fs:return Qs({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var r,o}function ta(e=0,t){switch(t.type){case Ys:case js:return e+1;case Hs:case Fs:return e-1;default:return e}}function na(e=0){return e+1}function ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ra(e,t,n[t])})}return e}function ia(e={},t){return{dirtyHandlerIds:Ws(e.dirtyHandlerIds,{type:t.type,payload:oa({},t.payload,{prevTargetIds:(n=e,r=[],"dragOperation.targetIds".split(".").reduce((e,t)=>e&&e[t]?e[t]:r||null,n))})}),dragOffset:Js(e.dragOffset,t),refCount:ta(e.refCount,t),dragOperation:ea(e.dragOperation,t),stateId:na(e.stateId)};var n,r}function sa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var aa=0,ua=Symbol.for("__VUE_DND_CONTEXT_INSTANCE__");function ca(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:la(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t;return o[ua]||(o[ua]=function(e,t,n={},r=!1){const o=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return os(ia,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(r),i=new Is(o,new Ns(o,new Gs(o))),s=e(i,t,n);return i.receiveBackend(s),i}(e,t,n,r)),o[ua]}function la(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:window}(0,Wi.defineComponent)({name:"DndProvider",props:{manager:{type:Object},backend:{type:Function},context:{type:Object},options:{type:Object},debugMode:{type:Boolean}},setup:function(e,t){var n,r,o,i,s=t.slots,a=(o=function(e){return function(e){return"manager"in e&&e.manager}(e)?[e.manager,!1]:[ca(e.backend,e.context,e.options,e.debugMode),!e.context]}(e),i=2,function(e){if(Array.isArray(e))return e}(o)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(u){a=!0,o=u}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(o,i)||function(e,t){if(e){if("string"==typeof e)return sa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sa(e,t):void 0}}(o,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=a[0],c=a[1];return c&&++aa,(0,Wi.onUnmounted)(function(){if(c){var e=la();0===--aa&&(e[ua]=null)}}),n=u,(0,Wi.provide)(Qi,n),function(){var e;return null!==(r=null===(e=s.default)||void 0===e?void 0:e.call(s))&&void 0!==r?r:null}}}),(0,Wi.defineComponent)({props:{connect:{type:Function,required:!0},src:{type:String,required:!0}},setup:function(e){return(0,Wi.watchEffect)(function(){if("undefined"!=typeof Image){var t=!1,n=new Image;return n.src=e.src,n.onload=function(){e.connect(n),t=!0},function(){t&&e.connect(null)}}}),function(){return null}}});var da=!1,fa=!1,pa=/* @__PURE__ */function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sourceId=null,this.internalMonitor=t.getMonitor()}var t=e.prototype;return t.receiveHandlerId=function(e){this.sourceId=e},t.getHandlerId=function(){return this.sourceId},t.canDrag=function(){is(!da,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return da=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{da=!1}},t.isDragging=function(){if(!this.sourceId)return!1;is(!fa,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return fa=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{fa=!1}},t.subscribeToStateChange=function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)},t.isDraggingSource=function(e){return this.internalMonitor.isDraggingSource(e)},t.isOverTarget=function(e,t){return this.internalMonitor.isOverTarget(e,t)},t.getTargetIds=function(){return this.internalMonitor.getTargetIds()},t.isSourcePublic=function(){return this.internalMonitor.isSourcePublic()},t.getSourceId=function(){return this.internalMonitor.getSourceId()},t.subscribeToOffsetChange=function(e){return this.internalMonitor.subscribeToOffsetChange(e)},t.canDragSource=function(e){return this.internalMonitor.canDragSource(e)},t.canDropOnTarget=function(e){return this.internalMonitor.canDropOnTarget(e)},t.getItemType=function(){return this.internalMonitor.getItemType()},t.getItem=function(){return this.internalMonitor.getItem()},t.getDropResult=function(){return this.internalMonitor.getDropResult()},t.didDrop=function(){return this.internalMonitor.didDrop()},t.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},t.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},t.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},t.getClientOffset=function(){return this.internalMonitor.getClientOffset()},t.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}(),ha=!1,ga=/* @__PURE__ */function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.targetId=null,this.internalMonitor=t.getMonitor()}var t=e.prototype;return t.receiveHandlerId=function(e){this.targetId=e},t.getHandlerId=function(){return this.targetId},t.subscribeToStateChange=function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)},t.canDrop=function(){if(!this.targetId)return!1;is(!ha,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return ha=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ha=!1}},t.isOver=function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)},t.getItemType=function(){return this.internalMonitor.getItemType()},t.getItem=function(){return this.internalMonitor.getItem()},t.getDropResult=function(){return this.internalMonitor.getDropResult()},t.didDrop=function(){return this.internalMonitor.didDrop()},t.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},t.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},t.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},t.getClientOffset=function(){return this.internalMonitor.getClientOffset()},t.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();function ma(e){return function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if((t=n)&&t.__v_skip&&function(){throw new Error("Only native element nodes can now be passed to Vue DnD connectors.You can either wrap Component into a <div>, or turn it into a drag source or a drop target itself.")}(),!function(e){return!!(n=e)&&!0===n.__v_isVNode&&"symbol"!=((t=e.type)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t);var t,n}(n)){var o=n;return e(o,r),o}}}function ya(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var o=ma(r);t[n]=function(){return o}}}),t}function va(e,t,n,r){let o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;const a=Object.prototype.hasOwnProperty.bind(t);for(let u=0;u<i.length;u++){const s=i[u];if(!a(s))return!1;const c=e[s],l=t[s];if(o=n?n.call(r,c,l,s):void 0,!1===o||void 0===o&&c!==l)return!1}return!0}function ba(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var wa=/* @__PURE__ */function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hooks=ya({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,n.dragPreviewNode=e,n.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceOptionsInternal=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}var t,n,r=e.prototype;return r.receiveHandlerId=function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())},r.reconnect=function(){var e=this.reconnectDragSource();this.reconnectDragPreview(e)},r.reconnectDragSource=function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t},r.reconnectDragPreview=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(t?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)},r.didHandlerIdChange=function(){return this.lastConnectedHandlerId!==this.handlerId},r.didConnectedDragSourceChange=function(){return this.lastConnectedDragSource!==this.dragSource},r.didConnectedDragPreviewChange=function(){return this.lastConnectedDragPreview!==this.dragPreview},r.didDragSourceOptionsChange=function(){return!va(this.lastConnectedDragSourceOptions,this.dragSourceOptions)},r.didDragPreviewOptionsChange=function(){return!va(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)},r.disconnectDragSource=function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)},r.disconnectDragPreview=function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null)},r.clearDragSource=function(){this.dragSourceNode=null},r.clearDragPreview=function(){this.dragPreviewNode=null},t=e,(n=[{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"dragSource",get:function(){return this.dragSourceNode}},{key:"dragPreview",get:function(){return this.dragPreviewNode}}])&&ba(t.prototype,n),e}();function Oa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Da=/* @__PURE__ */function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hooks=ya({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,(0,Wi.isRef)(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}var t,n,r=e.prototype;return r.reconnect=function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)},r.receiveHandlerId=function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())},r.didHandlerIdChange=function(){return this.lastConnectedHandlerId!==this.handlerId},r.didDropTargetChange=function(){return this.lastConnectedDropTarget!==this.dropTarget},r.didOptionsChange=function(){return!va(this.lastConnectedDropTargetOptions,this.dropTargetOptions)},r.disconnectDropTarget=function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)},r.clearDropTarget=function(){this.dropTargetRef=null,this.dropTargetNode=null},t=e,(n=[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.value}}])&&Oa(t.prototype,n),e}(),Ea=/* @__PURE__ */function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.spec=t,this.monitor=n,this.connector=r}var t=e.prototype;return t.beginDrag=function(){var e,t=this.spec,n=this.monitor;return null!=(e="object"==typeof t.item?t.item:"function"==typeof t.item?t.item(n):{})?e:null},t.canDrag=function(){var e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)},t.isDragging=function(e,t){var n=this.spec,r=this.monitor,o=n.isDragging;return o?o(r):t===e.getSourceId()},t.endDrag=function(){var e=this.spec,t=this.monitor,n=this.connector,r=e.end;r&&r(t.getItem(),t),n.reconnect()},e}();function Ia(){var e=(0,Wi.inject)(Qi);return is(null!=e,"Expected drag drop context"),e}function Sa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ta(e,t,n){var r=Ia(),o=function(e,t,n){var r=(0,Wi.computed)(function(){return new Ea((0,Wi.unref)(e),(0,Wi.unref)(t),(0,Wi.unref)(n))});return(0,Wi.watchEffect)(function(){r.value.spec=(0,Wi.unref)(e)}),r}(e,t,n),i=function(e){return(0,Wi.computed)(function(){var t=(0,Wi.unref)(e).type;return is(null!=t,"spec.type must be defined"),t})}(e);(0,Wi.watchEffect)(function(e){if(null!=(0,Wi.unref)(i)){var s=(c=function(e,t,n){var r=n.getRegistry(),o=r.addSource(e,t);return[o,function(){return r.removeSource(o)}]}((0,Wi.unref)(i),(0,Wi.unref)(o),(0,Wi.unref)(r)),l=2,function(e){if(Array.isArray(e))return e}(c)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(u){a=!0,o=u}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(c,l)||function(e,t){if(e){if("string"==typeof e)return Sa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sa(e,t):void 0}}(c,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=s[0],u=s[1];(0,Wi.unref)(t).receiveHandlerId(a),(0,Wi.unref)(n).receiveHandlerId(a),e(u)}var c,l})}function Ca(e){return(0,Wi.computed)(function(){return"function"==typeof e?e():e})}var Na=/* @__PURE__ */Ye(/* @__PURE__ */_e((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!==o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}})());function Ma(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xa(e,t,n){var r,o,i=(r=function(e,t,n){var r=(0,Wi.ref)((0,Wi.unref)(t)((0,Wi.unref)(e))),o=function(){var o=(0,Wi.unref)(t)((0,Wi.unref)(e));(0,Na.default)(r.value,o)||(r.value=o,n&&n())};return(0,Wi.watchEffect)(o),[r,o]}(e,t,n),o=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(u){a=!0,o=u}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(r,o)||function(e,t){if(e){if("string"==typeof e)return Ma(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ma(e,t):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],a=i[1];return(0,Wi.watchEffect)(function(t){var n=(0,Wi.unref)(e).getHandlerId();null!=n&&t((0,Wi.unref)(e).subscribeToStateChange(a,{handlerIds:[n]}))}),s}function Ra(e,t,n){return xa(t,e||function(){return{}},function(){return(0,Wi.unref)(n).reconnect()})}function Pa(e,t){var n=(0,Wi.reactive)({el:null,options:(0,Wi.unref)(t)});return(0,Wi.watchEffect)(function(){e(n)},{flush:"post"}),function(e,r){Ji(n,"el",e);var o=(0,Wi.unref)(t)||r;return(0,Na.default)(n.options,o)||Ji(n,"options",o),(0,Wi.unref)(e)}}function Aa(e,t){return Pa(function(t){(0,Wi.unref)(e).hooks.dragSource()(t.el,t.options)},(0,Wi.computed)(function(){return(0,Wi.unref)(t).options}))}function _a(e,t){return Pa(function(t){(0,Wi.unref)(e).hooks.dragPreview()(t.el,t.options)},(0,Wi.computed)(function(){return(0,Wi.unref)(t).previewOptions}))}var ka=/* @__PURE__ */function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.spec=t,this.monitor=n}var t=e.prototype;return t.canDrop=function(){var e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)},t.hover=function(){var e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)},t.drop=function(){var e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)},e}();function $a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ya(e,t,n){var r=Ia(),o=function(e,t){var n=(0,Wi.computed)(function(){return new ka((0,Wi.unref)(e),(0,Wi.unref)(t))});return(0,Wi.watchEffect)(function(){n.value.spec=(0,Wi.unref)(e)}),n}(e,t),i=function(e){return(0,Wi.computed)(function(){var t=(0,Wi.unref)(e).accept;return is(null!=t,"accept must be defined"),Array.isArray(t)?t:[t]})}(e);(0,Wi.watchEffect)(function(e){var s,a,u=(s=function(e,t,n){var r=(0,Wi.unref)(n).getRegistry(),o=r.addTarget((0,Wi.unref)(e),(0,Wi.unref)(t));return[o,function(){return r.removeTarget(o)}]}(i,o,r),a=2,function(e){if(Array.isArray(e))return e}(s)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(u){a=!0,o=u}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(s,a)||function(e,t){if(e){if("string"==typeof e)return $a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$a(e,t):void 0}}(s,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=u[0],l=u[1];(0,Wi.unref)(t).receiveHandlerId(c),(0,Wi.unref)(n).receiveHandlerId(c),e(l)})}function ja(e,t){return Pa(function(t){(0,Wi.unref)(e).hooks.dropTarget()(t.el,t.options)},(0,Wi.computed)(function(){return(0,Wi.unref)(t).options}))}function Ha(e){var t,n=Ca(e),r=(t=Ia(),(0,Wi.computed)(function(){return new ga((0,Wi.unref)(t))})),o=function(e){var t=Ia(),n=(0,Wi.computed)(function(){return new Da((0,Wi.unref)(t).getBackend())});return(0,Wi.watchEffect)(function(t){n.value.dropTargetOptions=(0,Wi.unref)(e)||null,n.value.reconnect(),t(function(){return n.value.disconnectDropTarget()})}),n}((0,Wi.computed)(function(){return(0,Wi.unref)(n).options}));return Ya(n,r,o),[Ra((0,Wi.computed)(function(){return(0,Wi.unref)(n).collect||function(){return{}}}),r,o),ja(o,n)]}var Fa=/* @__PURE__ */Y({name:"Vue3DndDraggableItem",props:{group:{type:String,required:!0},index:{type:Number,required:!0},item:{type:Object,required:!0},config:{type:Object,required:!0},add:{type:Function,required:!0},remove:{type:Function,required:!0},move:{type:Function,required:!0}},setup(e){const t=T("vue3-dnd-draggable-item"),n=Z(null),r=Z(!1),{config:o}=e,[i,s,a]=(l={type:o.type,item:()=>({group:e.group,item:e.item}),collect:e=>({canDrag:e.canDrag(),isDragging:e.isDragging()}),canDrag:e=>!o.canDrag||o.canDrag(e),end(t,n){if(o.end)return o.end(t,n);const r=n.getDropResult();r&&r.group!==e.group&&e.remove(t)},options:o.dragOptions,previewOptions:o.previewOptions},f=Ca(l),d=Ia(),p=(0,Wi.computed)(function(){return new pa((0,Wi.unref)(d))}),h=function(e,t){var n=Ia(),r=(0,Wi.computed)(function(){return new wa((0,Wi.unref)(n).getBackend())});return(0,Wi.watchEffect)(function(t){r.value.dragSourceOptions=(0,Wi.unref)(e)||null,(0,Wi.unref)(r).reconnect(),t(function(){r.value.disconnectDragSource()})}),(0,Wi.watchEffect)(function(e){r.value.dragPreviewOptions=(0,Wi.unref)(t)||null,(0,Wi.unref)(r).reconnect(),e(function(){r.value.disconnectDragPreview()})}),r}((0,Wi.computed)(function(){return(0,Wi.unref)(f).options}),(0,Wi.computed)(function(){return(0,Wi.unref)(f).previewOptions})),Ta(f,p,h),[Ra((0,Wi.computed)(function(){return(0,Wi.unref)(f).collect||function(){return{}}}),p,h),Aa(h,f),_a(h,f)]),[u,c]=Ha({accept:o.type,collect:e=>({handlerId:e.getHandlerId(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0}),isOver:e.isOver()}),hover(t,s){if(o.hover)return o.hover(t,s);if(!1!==s.canDrop()&&!0!==i.value.isDragging&&e.item!==t.item&&s.isOver({shallow:!0})){const i=n.value.getBoundingClientRect(),a=s.getClientOffset(),u=o.offset??0;let c=0;if("vertical"===o.direction){const{top:e,height:t}=i,{y:n}=a;if(c=n-e-t/2,Math.abs(c)<u)return;r.value=c<0}else if("horizontal"===o.direction){const{left:e,width:t}=i,{x:n}=a;if(c=n-e-t/2,Math.abs(c)<u)return;r.value=c<0}const l=o.key??"id";t.group===e.group?e.move(r.value,e.item[l],t.item[l]):e.add(r.value,e.item[l],t.item)}},canDrop:(e,t)=>o.canDrop?o.canDrop(e,t):!0!==i.value.isDragging,drop:(t,n)=>o.drop?o.drop(t,n):{group:e.group},options:o.dropOptions});var l,d,f,p,h;return!0===e.config.isCustomHandle||e.config.handle||s(n),c(n),a(n),K(()=>{U(()=>{if(e.config.handle&&n.value){const t=n.value.querySelector(e.config.handle);t&&s(t)}})}),{ns:t,elRef:n,dragCollect:i,dropCollect:u,isBeforeHover:r,drag:s,preview:a}},render(){var e,t;return k("div",{ref:"elRef",class:[this.ns.b(),this.ns.is("dragging",this.dragCollect.isDragging),this.ns.is("shallow-over",this.dropCollect.isShallowOver)]},[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t,{item:this.item,index:this.index,isDragging:this.dragCollect.isDragging,isShallowOver:this.dropCollect.isShallowOver,isOver:this.dropCollect.isOver,isBeforeHover:this.isBeforeHover,isAfterHover:!this.isBeforeHover,direction:this.config.direction,drag:this.drag,preview:this.preview})])}}),{toString:Va}=Object.prototype;function Ba(){return(65536*(1+Math.random())|0).toString(16).substring(1)}var Ua=/* @__PURE__ */Y({name:"Vue3DndDraggable",props:{opts:{type:Object,default:()=>({})},items:{type:Array,required:!0}},emits:["add","remove","move"],setup(e,{emit:t}){const n=T("vue3-dnd-draggable"),r=`${Ba()+Ba()}-${Ba()}-${Ba()}-${Ba()}-${Ba()}${Ba()}${Ba()}`,o=Z(null),{opts:i,items:s}=ie(e),a=R(()=>u.value.key||"id"),u=R(()=>Oe({type:"Vue3DndDraggable",direction:"vertical"},i.value)),[c,l]=Ha({accept:u.value.type,collect:e=>({handlerId:e.getHandlerId(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0})}),canDrop:(t,n)=>!(e.items.length>0)&&(!u.value.canDropContainer||u.value.canDropContainer(t,n)),drop:(e,t)=>u.value.dropContainer?u.value.dropContainer(e,t):(!1!==t.canDrop()&&s.value.push(e),{group:r})});return l(o),{ns:n,groupId:r,key:a,rootRef:o,collect:c,config:u,onAdd:(e,n,r)=>{const o=s.value.findIndex(e=>e[a.value]===n);s.value.splice(e?o:o+1,0,r),t("add",r,o)},onRemove:e=>{console.warn("onRemove 未实现",e)},onMove:(e,n,r)=>{const o=s.value.findIndex(e=>e[a.value]===n),i=s.value.findIndex(e=>e[a.value]===r),u=s.value[i],c=e?o:o+1;!e&&c===i||e&&c-1===i||(s.value.splice(c,0,u),c<i?s.value.splice(i+1,1):s.value.splice(i,1),t("move",o,c))}}},render(){let e;return k("div",{ref:"rootRef",class:[this.ns.b(),this.ns.is("over",this.collect.isShallowOver)]},[k(x,{name:"list"},(t=e=this.items.map((e,t)=>k(Fa,{group:this.groupId,key:e[this.key]||t,index:t,item:e,config:this.config,add:this.onAdd,remove:this.onRemove,move:this.onMove},{default:e=>{var t,n;return null===(t=(n=this.$slots).draggableItem)||void 0===t?void 0:t.call(n,e)}})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!B(t)?e:{default:()=>[e]}))]);var t}}),La=/* @__PURE__ */ke({default:()=>Ga}),Ga={pleaseInitiateTheProcessFirst:"未找到流程数据,请先发起流程",processInstanceMismatch:"流程实例不匹配!",element:{approval:"审批"}},Ka=/* @__PURE__ */ke({default:()=>Wa}),Wa={success:"成功"},qa=/* @__PURE__ */Object.assign({"./sys/process.ts":La,"./sys.ts":Ka}),za=Symbol.for("@gct-paas/render/setupApp");async function Ja(e){Reflect.get(window,za)?console.error("@gct-paas/render renderSetupApp 已执行,请勿重复调用。"):(Reflect.set(window,za,!0),_gct.i18nUtil.autoRegisterLocale(qa))}function Xa(){_gct.register.render?console.warn("渲染注册已存在,可能存在重复注册问题,请检查是否有重复引入渲染包的情况"):_gct.register.render=new Fe,window._kit||Object.defineProperty(window,"_kit",{value:{},writable:!1,configurable:!1})}Xa();var Qa=new URL("./index.min.css",import.meta.url);w.load(Qa.href);export{Si as Context,ci as ContextExtensionRegistry,Je as ControllerType,Be as DESIGN_DATA_KEY_TAG,Ve as DESIGN_TYPE,qe as DateFormat,Le as DateRangeMap,ze as DatepickerRanges,Ue as DesignItemAttribute,Ze as DesignNodeType,Ht as DesignRender,Xe as DesignRenderViewPrefix,wi as Events,$t as FieldSchema,Ti as GctComponent,Ut as GlobaAppInfo,Zt as Globals,Bt as HandwritingPad,Gt as PageTypeEnum,tn as RenderDesignEditor,et as RenderNodeRegister,Qe as RenderNodeType,oo as RenderPluginPgkUtil,Fe as RenderRegister,Ua as Vue3DndDraggable,Fa as Vue3DndDraggableItem,co as addDataByForm,ho as cacheAdapter,Qr as calculate,xi as calculateDepResult,Gi as containerNodeProps,wo as defaultValMap,Yi as dependencyToShow,ji as dependencyToShowSync,ei as emptyValueDisplay,zt as formMap,We as getDefaultDate,Ge as getDisabledDate,To as getIExp,Co as getIKeywordFieldKeys,Ke as getMobileDateRange,Pi as getOptionsByDisplayRule,Qt as getPageTitle,en as getPremission,No as getQueryDateByKeyWord,xo as getQuerySort,yo as getRefInfoId,Ro as getSimilarFieldBySearchField,qt as globalVarCaches,Xr as identify,Yt as initFieldWidgetRuntime,Mi as insetDep,Ao as is,qo as isArray,Ko as isBoolean,jo as isDate,_o as isDef,Jo as isElement,Yo as isEmpty,Zo as isEmptyStr,Go as isFunction,Xo as isMap,Ho as isNull,Fo as isNullAndUnDef,Vo as isNullOrUnDef,Bo as isNumber,$o as isObject,Uo as isPromise,Wo as isRegExp,Lo as isString,ko as isUnDef,Qo as isUrl,zo as isWindow,Ki as nodeEditorProps,Li as nodeProps,Xa as onInit,Xt as pageDataforJson,Wt as pageGlobaVariables,li as registerContextExtension,Ja as renderSetupApp,so as schemaToStyle,lo as setDataByForm,Jt as setFormData,Vi as tableWidgetByDept,Fi as tableWidgetToShow,fo as transSelectData,uo as transformData,po as transformDataToDict,ro as transformPropsField,ao as transformSourceData,jt as useAsyncFileAttrs,Bi as useDependency,Ui as useDependencyByRequired,$i as useDependencyToShow,Hi as useDependencyToShowList,ut as useDesignRenderController,_i as useDisplayRuleColumnByStyles,Ai as useDisplayRuleOptions,kt as useGctSelect,bo as useGetBodyBySearch,Mo as useQueryfilter,io as useStyle,Ri as useVisibileByRuleHook,nn as widthRenderDesignEditorInstall};
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { UseMemoizeReturn } from '@vueuse/core';
|
|
2
|
+
/**
|
|
3
|
+
* 运行时注册单个公式函数执行器(第三方/业务方在预览态/运行态调用)
|
|
4
|
+
* @param fnName 函数名,必须与公式编辑器注册时的 id 完全一致(大小写敏感);
|
|
5
|
+
* 与内置函数(methods.ts)重名时内置优先,扩展不会覆盖平台行为
|
|
6
|
+
* @param executor 执行体,支持同步/async 函数(引擎按 await 调用)
|
|
7
|
+
*/
|
|
8
|
+
export declare function registerExpressionMethods(fnName: string, executor: (...args: any[]) => any): void;
|
|
9
|
+
/**
|
|
10
|
+
* 按函数名卸载已注册的执行器;不传参数则清空全部
|
|
11
|
+
* @param names 函数名列表
|
|
12
|
+
*/
|
|
13
|
+
export declare function unregisterExpressionMethods(...names: string[]): void;
|
|
2
14
|
export declare const identify: UseMemoizeReturn<string[], [expr: string, isAll?: boolean | undefined]>;
|
|
3
15
|
export declare const calculate: UseMemoizeReturn<Promise<IObject | number>, [
|
|
4
16
|
expr: string,
|
|
@@ -5,7 +5,30 @@ import * as esprima from "esprima-next";
|
|
|
5
5
|
import estraverse from "estraverse";
|
|
6
6
|
import escodegen from "escodegen";
|
|
7
7
|
//#region src/utils/expression/index.ts
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* 运行时注册的业务函数执行器。
|
|
10
|
+
* 公式编辑器注册的业务函数(options.functions)只随定义携带可选的 execute,
|
|
11
|
+
* 表达式持久化仅保存函数名;执行体必须在会执行表达式的应用启动时注册到这里。
|
|
12
|
+
*/
|
|
13
|
+
var extensionMethods = {};
|
|
14
|
+
Object.defineProperty(window, "_METHOD_DEBUG_", {
|
|
15
|
+
configurable: true,
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: () => ({
|
|
18
|
+
...extensionMethods,
|
|
19
|
+
...methods_exports
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* 运行时注册单个公式函数执行器(第三方/业务方在预览态/运行态调用)
|
|
24
|
+
* @param fnName 函数名,必须与公式编辑器注册时的 id 完全一致(大小写敏感);
|
|
25
|
+
* 与内置函数(methods.ts)重名时内置优先,扩展不会覆盖平台行为
|
|
26
|
+
* @param executor 执行体,支持同步/async 函数(引擎按 await 调用)
|
|
27
|
+
*/
|
|
28
|
+
function registerExpressionMethods(fnName, executor) {
|
|
29
|
+
if (typeof fnName === "string" && fnName && typeof executor === "function") extensionMethods[fnName] = executor;
|
|
30
|
+
else console.warn("[Expression] registerExpressionMethods 参数非法:fnName 需为非空字符串,executor 需为函数");
|
|
31
|
+
}
|
|
9
32
|
var identify = useMemoize(_identify);
|
|
10
33
|
var calculate = useMemoize(_calc);
|
|
11
34
|
function _deepCalcName(node) {
|
|
@@ -80,7 +103,10 @@ async function _calc(expr, values) {
|
|
|
80
103
|
"return res;",
|
|
81
104
|
"})()"
|
|
82
105
|
].join("\n"));
|
|
83
|
-
const result = await calcFunc(
|
|
106
|
+
const result = await calcFunc({
|
|
107
|
+
...extensionMethods,
|
|
108
|
+
...methods_exports
|
|
109
|
+
});
|
|
84
110
|
console.info("【表达式】", expr);
|
|
85
111
|
console.info("【参数】", values);
|
|
86
112
|
console.info("【执行语句】", calcFunc.toString());
|
|
@@ -111,7 +137,9 @@ function _identify(expr, isAll = false) {
|
|
|
111
137
|
}
|
|
112
138
|
window.gct_expression = {
|
|
113
139
|
execute: calculate,
|
|
114
|
-
identify
|
|
140
|
+
identify,
|
|
141
|
+
/** 控制台快速注册执行体做临时验证:gct_expression.register('MY_FN', v => ...) */
|
|
142
|
+
register: registerExpressionMethods
|
|
115
143
|
};
|
|
116
144
|
//#endregion
|
|
117
145
|
export { calculate, identify };
|
|
@@ -199,6 +199,7 @@ function date_and_date_time(widget, _format, _params = {}) {
|
|
|
199
199
|
switch (defaultValueType) {
|
|
200
200
|
case DefaultDateTypeConst.SystemDate: return isRang ? [now.format(fs), now.format(fe)] : now.format(fs);
|
|
201
201
|
case DefaultDateTypeConst.PastDays: return [now.subtract(num, "day").format(fs), now.subtract(num > 0 ? 1 : 0, "day").format(fe)];
|
|
202
|
+
case DefaultDateTypeConst.FutureDays: return [now.add(num > 0 ? 1 : 0, "day").format(fs), now.add(num, "day").format(fe)];
|
|
202
203
|
case DefaultDateTypeConst.PastWeeks: return [now.subtract(num, "week").startOf("isoWeek").format(fs), now.subtract(num > 0 ? 1 : 0, "week").endOf("isoWeek").format(fe)];
|
|
203
204
|
case DefaultDateTypeConst.PastMonths: return [now.subtract(num, "month").startOf("month").format(fs), now.subtract(num > 0 ? 1 : 0, "month").endOf("month").format(fe)];
|
|
204
205
|
case DefaultDateTypeConst.PastYears: return [now.subtract(num, "year").startOf("year").format(fs), now.subtract(num > 0 ? 1 : 0, "year").endOf("year").format(fe)];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/render",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.3-dev.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台网页端底包",
|
|
6
6
|
"loader": "dist/loader.esm.min.js",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"qx-util": "^0.4.8",
|
|
45
45
|
"vue": "^3.5.30",
|
|
46
46
|
"vue3-dnd": "^2.1.0",
|
|
47
|
-
"@gct-paas/core
|
|
48
|
-
"@gct-paas/core": "6.0.
|
|
49
|
-
"@gct-paas/scss": "6.0.
|
|
50
|
-
"@gct-paas/schema": "6.0.
|
|
47
|
+
"@gct-paas/core": "6.0.3-dev.1",
|
|
48
|
+
"@gct-paas/core-web": "6.0.3-dev.1",
|
|
49
|
+
"@gct-paas/scss": "6.0.3-dev.1",
|
|
50
|
+
"@gct-paas/schema": "6.0.3-dev.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/escodegen": "^0.0.10",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@gct-paas/api": "^6.0.0-dev.17",
|
|
59
59
|
"vue": ">=3",
|
|
60
|
-
"@gct-paas/core": "6.0.
|
|
61
|
-
"@gct-paas/
|
|
62
|
-
"@gct-paas/
|
|
63
|
-
"@gct-paas/schema": "6.0.
|
|
60
|
+
"@gct-paas/core-web": "6.0.3-dev.1",
|
|
61
|
+
"@gct-paas/scss": "6.0.3-dev.1",
|
|
62
|
+
"@gct-paas/core": "6.0.3-dev.1",
|
|
63
|
+
"@gct-paas/schema": "6.0.3-dev.1"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",
|