@farris/ui-vue 1.8.5-beta.3 → 1.8.5-beta.4

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.
Files changed (61) hide show
  1. package/components/batch-editor/index.esm.js +6850 -6840
  2. package/components/batch-editor/index.umd.cjs +20 -20
  3. package/components/button/index.esm.js +6852 -6842
  4. package/components/button/index.umd.cjs +20 -20
  5. package/components/button-edit/index.esm.js +140 -140
  6. package/components/button-edit/index.umd.cjs +1 -1
  7. package/components/button-group/index.esm.js +46 -45
  8. package/components/button-group/index.umd.cjs +1 -1
  9. package/components/common/index.esm.js +16 -12
  10. package/components/common/index.umd.cjs +1 -1
  11. package/components/component/index.esm.js +411 -411
  12. package/components/component/index.umd.cjs +2 -2
  13. package/components/data-view/index.esm.js +6500 -6487
  14. package/components/data-view/index.umd.cjs +21 -21
  15. package/components/designer-canvas/index.esm.js +269 -269
  16. package/components/designer-canvas/index.umd.cjs +1 -1
  17. package/components/expression-editor/index.esm.js +458 -458
  18. package/components/expression-editor/index.umd.cjs +2 -2
  19. package/components/filter-condition-editor/index.esm.js +386 -386
  20. package/components/filter-condition-editor/index.umd.cjs +1 -1
  21. package/components/flow-canvas/index.esm.js +1100 -1100
  22. package/components/flow-canvas/index.umd.cjs +7 -7
  23. package/components/mapping-editor/index.esm.js +243 -243
  24. package/components/mapping-editor/index.umd.cjs +2 -2
  25. package/components/message-box/index.esm.js +82 -82
  26. package/components/message-box/index.umd.cjs +1 -1
  27. package/components/modal/index.esm.js +76 -76
  28. package/components/modal/index.umd.cjs +1 -1
  29. package/components/order/index.esm.js +139 -138
  30. package/components/order/index.umd.cjs +1 -1
  31. package/components/query-solution/index.esm.js +891 -891
  32. package/components/query-solution/index.umd.cjs +1 -1
  33. package/components/response-toolbar/index.esm.js +151 -149
  34. package/components/response-toolbar/index.umd.cjs +1 -1
  35. package/components/schema-selector/index.esm.js +947 -941
  36. package/components/schema-selector/index.umd.cjs +6 -6
  37. package/components/section/index.esm.js +121 -121
  38. package/components/section/index.umd.cjs +2 -2
  39. package/components/sort-condition-editor/index.esm.js +539 -539
  40. package/components/sort-condition-editor/index.umd.cjs +1 -1
  41. package/components/tabs/index.esm.js +448 -442
  42. package/components/tabs/index.umd.cjs +1 -1
  43. package/designer/button-edit/index.esm.js +97 -97
  44. package/designer/button-edit/index.umd.cjs +1 -1
  45. package/designer/data-grid/index.esm.js +6483 -6470
  46. package/designer/data-grid/index.umd.cjs +21 -21
  47. package/designer/farris-designer.all.esm.js +1891 -1885
  48. package/designer/farris-designer.all.umd.cjs +14 -14
  49. package/designer/radio-group/index.esm.js +183 -183
  50. package/designer/radio-group/index.umd.cjs +2 -2
  51. package/designer/response-toolbar/index.esm.js +558 -556
  52. package/designer/response-toolbar/index.umd.cjs +1 -1
  53. package/designer/tabs/index.esm.js +416 -416
  54. package/designer/tabs/index.umd.cjs +2 -2
  55. package/farris.all.esm.js +9133 -9119
  56. package/farris.all.umd.cjs +35 -35
  57. package/package.json +1 -1
  58. package/types/common/index.d.ts +1 -0
  59. package/types/common/utils/attrs.d.ts +26 -0
  60. package/types/modal/src/composition/type.d.ts +2 -0
  61. package/types/tabs/src/composition/types.d.ts +2 -0
@@ -1 +1 @@
1
- (function(B,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es"),require("../locale/index.umd.js"),require("bignumber.js"),require("../common/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../common/index.umd.js/utils/resolve-field"),require("../input-group/index.umd.js"),require("../button/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../dynamic-view/index.umd.js"),require("../section/index.umd.js"),require("../accordion/index.umd.js"),require("../../designer/avatar/index.umd.js"),require("../../designer/approval-logs/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../table/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../../designer/dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../../designer/nav/index.umd.js"),require("../number-range/index.umd.js"),require("../../designer/number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../field-search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../../designer/modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../../designer/wizard/index.umd.js"),require("../tooltip/index.umd.js"),require("../property-panel/index.umd.js"),require("../notify/index.umd.js"),require("../drawer/index.umd.js"),require("../collection-property-editor/index.umd.js/src/use-button-items.designer")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../locale/index.umd.js","bignumber.js","../common/index.umd.js","@vueuse/core","../data-view/index.umd.js","../common/index.umd.js/utils/resolve-field","../input-group/index.umd.js","../button/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../dynamic-view/index.umd.js","../section/index.umd.js","../accordion/index.umd.js","../../designer/avatar/index.umd.js","../../designer/approval-logs/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../table/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../../designer/dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../../designer/nav/index.umd.js","../number-range/index.umd.js","../../designer/number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../search-box/index.umd.js","../field-search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../text/index.umd.js","../../designer/time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../../designer/modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../../designer/wizard/index.umd.js","../tooltip/index.umd.js","../property-panel/index.umd.js","../notify/index.umd.js","../drawer/index.umd.js","../collection-property-editor/index.umd.js/src/use-button-items.designer"],n):(B=typeof globalThis<"u"?globalThis:B||self,n(B["designer-canvas"]={},B.Vue,B.LodashES,B.locale,B.BigNumber,B.common,B.VueUseCore,B.dataView,B.resolveField,B.FInputGroup,B.FButton,B.dynamicResolver,B.designerCanvas,B.dynamicView,B.FSection,B.FAccordion,B.FAvatar,B.FApprovalLogs,B.FButtonEdit,B.FButtonGroup,B.FCalendar,B.FCapsule,B.FCheckbox,B.FCheckboxGroup,B.FComboList,B.FComboTree,B.FComponent,B.FColorPicker,B.FContentContainer,B.FTable,B.FDatePicker,B.FDataGrid,B.FDropdown,B.FDynamicForm$1,B.FEventsEditor,B.FFilterBar,B.FFieldSelector,B.FBindingSelector,B.FImageCropper,B.FInputGroup$1,B.FLayout,B.FListNav,B.FListView,B.FLookup,B.FMappingEditor,B.FNav,B.FNumberRange,B.FNumberSpinner,B.FOrder,B.FPageHeader,B.FPageFooter,B.FPagination,B.FProgress,B.FQuerySolution,B.FRadioGroup,B.FRate,B.FResponseToolbar,B.FResponseLayout,B.FResponseLayoutEditorSetting,B.FSearchBox,B.FFieldSearchBox,B.FSection$1,B.FSmokeDetector,B.FSplitter,B.FStep$1,B.FSwitch,B.FTabs,B.FTags,B.FText,B.FTimePicker,B.FTransfer,B.FTreeview,B.FUploader,B.FVerifyDetail,B.FVideo,B.FTextArea,B.FSchemaSelector,B.FTreeGrid$1,B.FEventParameter,B.FFilterConditionEditor,B.FFieldset,B.FSortConditionEditor,B.FMenuLookup,B.FDrawer,B.FJsonEditor,B.FPropertyEditor,B.FExpressionEditor,B.FCodeEditor,B.FHtmlTemplate,B.FCollectionPropertyEditor,B.FModal$1,B.FExternalContainer,B.FLanguageTextbox,B.FImage,B.FComment,B.FWizard,B.FTooltip,null,B.notify,B.FDrawer$1))})(this,function(B,n,Se,Ue,ra,De,Po,de,Oo,Lo,ct,je,pt,Je,Ao,Qt,Jt,Zt,en,tn,nn,on,At,Nt,rn,qo,an,sn,ln,cn,un,dn,fn,mn,Ro,pn,_o,gn,hn,vn,yn,Cn,bn,wn,Uo,Sn,xn,Tn,Nn,Vn,Fn,En,Mn,jn,Dn,kn,Bn,In,Pn,On,Ln,An,qn,Rn,_n,Un,$n,zn,Hn,Wn,Gn,Yn,Kn,Xn,Qn,Jn,$o,Zn,zo,Ho,eo,Wo,Go,to,Yo,Ko,Xo,Qo,no,Jo,Zo,oo,ro,io,ao,so,er,ia,tr,lo){"use strict";var na=Object.defineProperty;var oa=(B,n,Se)=>n in B?na(B,n,{enumerable:!0,configurable:!0,writable:!0,value:Se}):B[n]=Se;var we=(B,n,Se)=>oa(B,typeof n!="symbol"?n+"":n,Se);const Ze=n.ref(0);function nr(){Ze.value++}function or(e,t){const o=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.top>=o.top,a=r.top<=o.bottom;return i&&a}function qt(e){const t=e.querySelector(".component-btn-group");if(!t)return;t.style.display="";const o=t.getBoundingClientRect();if(!(o.top===0&&o.left===0)){const r=t.querySelector("div");if(r){const i=r.getBoundingClientRect();r.style.top=o.top+"px";let a=o.left-i.width;const s=document.querySelector(".editorDiv");if(s){const u=s.getBoundingClientRect();a<u.left&&({left:a}=e.getBoundingClientRect())}r.style.left=a+"px"}}}function co(e){var o,r,i,a,s;if(!window.scrollContainerList)return;const t=Array.from(window.scrollContainerList);if(t.length)if(t.length===1){const u=t[0],l=document.querySelector(`[id=${u}]`);if(l&&l.contains(e))return l}else{const{componentInstance:u}=e;if(((o=u==null?void 0:u.value)==null?void 0:o.scrollElementId)===((r=u==null?void 0:u.value.schema)==null?void 0:r.id))return e;if(((i=u==null?void 0:u.value)==null?void 0:i.scrollElementId)===`${(a=u==null?void 0:u.value.schema)==null?void 0:a.id}-design-item`)return e.parentElement;if((s=u.value.parent)!=null&&s.elementRef)return co(u.value.parent.elementRef)}}function Vt(e){if(!e)return;const t=e.getBoundingClientRect();if(t.width===0&&t.height===0)return;const o=e.querySelector(".component-btn-group");if(o){let r=!0;const i=co(e);if(i&&(r=or(e,i)),!r){o.style.display="none";return}qt(e)}}function gt(e){if(!e)return;let t;e.className.includes("dgComponentSelected")?t=e:t=e.querySelector(".dgComponentSelected"),t&&Vt(t)}function rr(){const e=document.querySelector(".dgComponentSelected");if(!e)return;const t=e.querySelector(".component-btn-group");t&&t.getBoundingClientRect().top!==0&&qt(e)}const uo={modelValue:{type:Object,default:{}},componentId:{type:String,default:""},components:{type:Array},canvasMode:{type:String,default:"PC"}};var nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ft(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var fo={exports:{}};(function(e,t){(function(o){e.exports=o()})(function(){return function(){function o(r,i,a){function s(d,m){if(!i[d]){if(!r[d]){var p=typeof Ft=="function"&&Ft;if(!m&&p)return p(d,!0);if(u)return u(d,!0);var C=new Error("Cannot find module '"+d+"'");throw C.code="MODULE_NOT_FOUND",C}var c=i[d]={exports:{}};r[d][0].call(c.exports,function(f){var S=r[d][1][f];return s(S||f)},c,c.exports,o,r,i,a)}return i[d].exports}for(var u=typeof Ft=="function"&&Ft,l=0;l<a.length;l++)s(a[l]);return s}return o}()({1:[function(o,r,i){var a={},s="(?:^|\\s)",u="(?:\\s|$)";function l(p){var C=a[p];return C?C.lastIndex=0:a[p]=C=new RegExp(s+p+u,"g"),C}function d(p,C){var c=p.className;c.length?l(C).test(c)||(p.className+=" "+C):p.className=C}function m(p,C){p.className=p.className.replace(l(C)," ").trim()}r.exports={add:d,rm:m}},{}],2:[function(o,r,i){(function(a){var s=o("contra/emitter"),u=o("crossvent"),l=o("./classes"),d=document,m=d.documentElement;function p(M,$){var R=arguments.length;R===1&&Array.isArray(M)===!1&&($=M,M=[]);var j,_,I,q,D,U,ne,N,P,oe=null,re,Z,he=!1,xe=0,fe,ee=$||{};ee.moves===void 0&&(ee.moves=g),ee.accepts===void 0&&(ee.accepts=g),ee.invalid===void 0&&(ee.invalid=at),ee.containers===void 0&&(ee.containers=M||[]),ee.isContainer===void 0&&(ee.isContainer=b),ee.copy===void 0&&(ee.copy=!1),ee.copySortSource===void 0&&(ee.copySortSource=!1),ee.revertOnSpill===void 0&&(ee.revertOnSpill=!1),ee.removeOnSpill===void 0&&(ee.removeOnSpill=!1),ee.direction===void 0&&(ee.direction="vertical"),ee.ignoreInputTextSelection===void 0&&(ee.ignoreInputTextSelection=!0),ee.mirrorContainer===void 0&&(ee.mirrorContainer=d.body);var T=s({containers:ee.containers,start:Be,end:ut,cancel:ot,remove:ft,destroy:ke,canMove:Oe,dragging:!1});return ee.removeOnSpill===!0&&T.on("over",Ve).on("out",ze),ae(),T;function ie(k){return T.containers.indexOf(k)!==-1||ee.isContainer(k)}function ae(k){var K=k?"remove":"add";f(m,K,"mousedown",Le),f(m,K,"mouseup",Xe)}function le(k){var K=k?"remove":"add";f(m,K,"mousemove",Te)}function ye(k){var K=k?"remove":"add";u[K](m,"selectstart",qe),u[K](m,"click",qe)}function ke(){ae(!0),Xe({})}function qe(k){re&&k.preventDefault()}function Le(k){q=k.clientX,D=k.clientY;var K=S(k)!==1||k.metaKey||k.ctrlKey;if(!K){var J=k.target,se=Pe(J);se&&(re=se,le(),k.type==="mousedown"&&(y(J)?J.focus():k.preventDefault()))}}function Te(k){if(re){if(S(k)===0){Xe({});return}if(!(k.clientX!==void 0&&Math.abs(k.clientX-q)<=(ee.slideFactorX||0)&&k.clientY!==void 0&&Math.abs(k.clientY-D)<=(ee.slideFactorY||0))){if(ee.ignoreInputTextSelection){var K=F("clientX",k)||0,J=F("clientY",k)||0,se=d.elementFromPoint(K,J);if(y(se))return}var Ce=re;le(!0),ye(),ut(),Ee(Ce),l.add(N||I,"gu-transit"),lt(),yt(),xe=0,ce(k)}}}function Pe(k){if(!(T.dragging&&j)&&!ie(k)){for(var K=k;V(k)&&ie(V(k))===!1;)if(ee.invalid(k,K)||(k=V(k),!k))return;var J=V(k);if(J&&!ee.invalid(k,K)){var se=ee.moves(k,J,K,v(k));if(se)return{item:k,source:J}}}}function Oe(k){return!!Pe(k)}function Be(k){var K=Pe(k);K&&Ee(K)}function Ee(k){Yt(k.item,k.source)&&(N=k.item.cloneNode(!0),T.emit("cloned",N,k.item,"copy")),_=k.source,I=k.item,U=ne=v(k.item),T.dragging=!0,T.emit("drag",I,_)}function at(){return!1}function ut(){if(T.dragging){var k=N||I;et(k,V(k))}}function dt(){re=!1,le(!0),ye(!0)}function Xe(k){if(dt(),!!T.dragging){var K=N||I,J=F("clientX",k)||0,se=F("clientY",k)||0,Ce=E(j,J,se),be=A(Ce,J,se);be&&(N&&ee.copySortSource||!N||be!==_)?et(K,be):ee.removeOnSpill?ft():ot()}}function et(k,K){var J=V(k);N&&ee.copySortSource&&K===_&&J.removeChild(I),Me(K)?T.emit("cancel",k,_):T.emit("drop",k,K,_,ne),st()}function ft(){if(T.dragging){var k=N||I,K=V(k);K&&K.removeChild(k),T.emit(N?"cancel":"remove",k,K,_),st()}}function ot(k){if(T.dragging){var K=arguments.length>0?k:ee.revertOnSpill,J=N||I,se=V(J),Ce=Me(se);Ce===!1&&K&&(N?se&&se.removeChild(N):_.insertBefore(J,U)),Ce||K?T.emit("cancel",J,_,_):T.emit("drop",J,se,_,ne),st()}}function st(){var k=N||I;dt(),mt(),It(),k&&l.rm(k,"gu-transit"),P&&clearTimeout(P),T.dragging=!1,oe&&T.emit("out",k,oe,_),T.emit("dragend",k,xe),_=I=N=U=ne=P=oe=null}function Me(k,K){var J;return K!==void 0?J=K:j?J=ne:J=v(N||I),k===_&&J===U}function A(k,K,J){for(var se=k;se&&!Ce();)se=V(se);return se;function Ce(){var be=ie(se);if(be===!1)return!1;var Re=Pt(se,k),$e=Lt(se,Re,K,J),We=Me(se,$e);return We?!0:ee.accepts(I,se,_,$e)}}function ce(k){if(!j)return;k.preventDefault();var K=F("clientX",k)||0,J=F("clientY",k)||0;j.style.left=K-2+"px",j.style.top=J-2+"px";var se=N||I,Ce=E(j,K,J),be=A(Ce,K,J),Re=be!==null&&be!==oe;(Re||be===null)&&(He(),oe=be,Ge()),Ot(Ce,J);var $e=V(se);if(be===_&&N&&!ee.copySortSource){$e&&$e.removeChild(se);return}var We,Qe=Pt(be,Ce);if(he=zt(Qe,be),Qe!==null)We=Lt(be,Qe,K,J);else if(ee.revertOnSpill===!0&&!N)We=U,be=_;else{N&&$e&&$e.removeChild(se),N&&Z&&(Z.style.display="none");return}Z.style.display="block",Ne(We,se,Re),We?Wt(Qe,We):Gt(be);function Ae(_e){T.emit(_e,se,oe,_)}function Ge(){Re&&Ae("over")}function He(){oe&&Ae("out")}}function Ne(k,K,J){(k===K||k===v(K))&&(ne=v(K)),(k===null&&J||k!==K&&k!==v(K))&&(ne=k)}function Ve(k){l.rm(k,"gu-hide")}function ze(k){T.dragging&&l.add(k,"gu-hide")}function yt(){j||(j=document.createElement("div"),j.style="background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;",j.innerHTML=ee.getMirrorText&&ee.getMirrorText(I)||"控件",l.add(j,"gu-mirror"),ee.mirrorContainer.appendChild(j),f(m,"add","mousemove",ce),l.add(ee.mirrorContainer,"gu-unselectable"),T.emit("cloned",j,I,"mirror"))}function lt(){if(Z=document.createElement("div"),l.add(Z,"gu-insertion"),I){var k=I.getBoundingClientRect();Z.style.left=k.left+"px",Z.style.top=k.top+"px"}he=!1,ee.mirrorContainer.appendChild(Z)}function mt(){j&&(l.rm(ee.mirrorContainer,"gu-unselectable"),f(m,"remove","mousemove",ce),V(j).removeChild(j),j=null)}function It(){Z&&(V(Z).removeChild(Z),Z=null)}function Pt(k,K){for(var J=K;J!==k&&V(J)!==k;)J=V(J);return J===m?null:J}function zt(k,K){if(!K)return he;var J=k||K&&K.lastElementChild;if(!J)return!0;var se=getComputedStyle(k),Ce=/^inline/.test(se.getPropertyValue("display"))||/^(left|right)$/.test(se.getPropertyValue("float"));if(Ce)return!0;if(K){var be=getComputedStyle(K),Re=be.getPropertyValue("display");if(/flex$/.test(Re)){var $e=be.getPropertyValue("flex-direction")||"row";if($e==="row"||$e==="row-reverse")return!Ht(K)}return!1}return!0}function Ht(k){if(!k.children||!k.children.length)return!1;for(const K of Array.from(k.children)){const se=(K.className&&K.className.split(" ")||[]).filter(Ce=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Ce));if(!se.length)return!1;for(const Ce of se){const be=Ce.slice(Ce.lastIndexOf("-")+1);if(parseInt(be,10)!==12)return!1}}return!0}function Wt(k,K){const J=K.getBoundingClientRect();if(Z.style.left=J.left+"px",Z.style.top=J.top+"px",he){if(Z.style.height=J.height+"px",Z.style.width="4px",k){const se=k.getBoundingClientRect();se.top!==J.top&&(Z.style.left=se.right+"px",Z.style.top=se.top+"px",Z.style.height=se.height+"px")}}else if(Z.style.height="4px",Z.style.width=J.width+"px",fe){const se=fe.getBoundingClientRect();J.top<se.top&&(Z.style.display="none")}K===I&&I&&(Z.style.display="none")}function Gt(k){ne=null;var K=k.lastElementChild;if(K){var J=K.getBoundingClientRect();he?(Z.style.left=J.right+"px",Z.style.top=J.top+"px",Z.style.height=J.height+"px",Z.style.width="4px"):(Z.style.left=J.left+"px",Z.style.top=J.bottom+"px",Z.style.height="4px",Z.style.width=J.width+"px"),K===I&&I&&(Z.style.display="none")}else Z.style.display="none"}function Ot(k,K){if(!ee.mirrorContainer.contains(k)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(fe=C(k),!fe||!fe.contains(k)))return;const J=document.querySelector(".dgComponentSelected"),se=fe.getBoundingClientRect();if(K-30<se.top&&fe.scrollTop>0){let Ce=fe.scrollTop<10?fe.scrollTop:10;fe.scrollBy(0,-1*Ce),J&&fe.contains(J)&&(xe=xe+-1*Ce)}if(K+30>se.bottom&&fe.scrollTop<fe.scrollHeight-fe.clientHeight){const Ce=fe.scrollHeight-fe.clientHeight-fe.scrollTop;let be=Ce<10?Ce:10;fe.scrollBy(0,be),J&&fe.contains(J)&&(xe=xe+be)}}function Lt(k,K,J,se){var Ce=ee.direction==="horizontal",be=ee.direction==="mixed",Re=K!==k?We():$e();return Re;function $e(){var Ae=k.children.length,Ge,He,_e;for(Ge=0;Ge<Ae;Ge++)if(He=k.children[Ge],_e=He.getBoundingClientRect(),Ce&&_e.left+_e.width/2>J||!be&&!Ce&&_e.top+_e.height/2>se||be&&_e.left+_e.width>J&&_e.top+_e.height>se)return He;return null}function We(){var Ae=K.getBoundingClientRect();if(be){var Ge=se-Ae.top,He=J-Ae.left,_e=Ae.bottom-se,Ct=Ae.right-J,bt=Math.min(He,Ct,Ge,_e),wt;return he?wt=Ct<He:wt=_e===bt||Ct===bt||He===bt,Qe(wt)}return Qe(Ce?J>Ae.left+w(Ae)/2:se>Ae.top+O(Ae)/2)}function Qe(Ae){return Ae?v(K):K}}function Yt(k,K){return typeof ee.copy=="boolean"?ee.copy:ee.copy(k,K)}}function C(M){const $=Array.from(window.scrollContainerList);if($.length===1){const j=Array.from(window.scrollContainerList)[0];return document.getElementById(j)}const R=c($);for(const j of R)if(j.contains(M))return j;return null}function c(M){const $=[];return M.forEach(R=>{const j=document.getElementById(R);j&&$.push(j)}),$.sort((R,j)=>R.contains(j)?1:j.contains(R)?-1:0),$}function f(M,$,R,j){var _={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},I={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},q={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?u[$](M,I[R],j):a.navigator.msPointerEnabled?u[$](M,q[R],j):(u[$](M,_[R],j),u[$](M,R,j))}function S(M){if(M.touches!==void 0)return M.touches.length;if(M.which!==void 0&&M.which!==0)return M.which;if(M.buttons!==void 0)return M.buttons;var $=M.button;if($!==void 0)return $&1?1:$&2?3:$&4?2:0}function E(M,$,R){M=M||{};var j=M.className||"",_;return M.className+=" gu-hide",_=d.elementFromPoint($,R),M.className=j,_}function b(){return!1}function g(){return!0}function w(M){return M.width||M.right-M.left}function O(M){return M.height||M.bottom-M.top}function V(M){return M.parentNode===d?null:M.parentNode}function y(M){return M.tagName==="INPUT"||M.tagName==="TEXTAREA"||M.tagName==="SELECT"||h(M)}function h(M){return!M||M.contentEditable==="false"?!1:M.contentEditable==="true"?!0:h(V(M))}function v(M){return M.nextElementSibling||$();function $(){var R=M;do R=R.nextSibling;while(R&&R.nodeType!==1);return R}}function x(M){return M.targetTouches&&M.targetTouches.length?M.targetTouches[0]:M.changedTouches&&M.changedTouches.length?M.changedTouches[0]:M}function F(M,$){var R=x($),j={pageX:"clientX",pageY:"clientY"};return M in j&&!(M in R)&&j[M]in R&&(M=j[M]),R[M]}r.exports=p}).call(this,typeof nt<"u"?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(o,r,i){r.exports=function(s,u){return Array.prototype.slice.call(s,u)}},{}],4:[function(o,r,i){var a=o("ticky");r.exports=function(u,l,d){u&&a(function(){u.apply(d||null,l||[])})}},{ticky:10}],5:[function(o,r,i){var a=o("atoa"),s=o("./debounce");r.exports=function(l,d){var m=d||{},p={};return l===void 0&&(l={}),l.on=function(C,c){return p[C]?p[C].push(c):p[C]=[c],l},l.once=function(C,c){return c._once=!0,l.on(C,c),l},l.off=function(C,c){var f=arguments.length;if(f===1)delete p[C];else if(f===0)p={};else{var S=p[C];if(!S)return l;S.splice(S.indexOf(c),1)}return l},l.emit=function(){var C=a(arguments);return l.emitterSnapshot(C.shift()).apply(this,C)},l.emitterSnapshot=function(C){var c=(p[C]||[]).slice(0);return function(){var f=a(arguments),S=this||l;if(C==="error"&&m.throws!==!1&&!c.length)throw f.length===1?f[0]:f;return c.forEach(function(b){m.async?s(b,f,S):b.apply(S,f),b._once&&l.off(C,b)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(o,r,i){(function(a){var s=o("custom-event"),u=o("./eventmap"),l=a.document,d=C,m=f,p=[];a.addEventListener||(d=c,m=S),r.exports={add:d,remove:m,fabricate:E};function C(V,y,h,v){return V.addEventListener(y,h,v)}function c(V,y,h){return V.attachEvent("on"+y,g(V,y,h))}function f(V,y,h,v){return V.removeEventListener(y,h,v)}function S(V,y,h){var v=w(V,y,h);if(v)return V.detachEvent("on"+y,v)}function E(V,y,h){var v=u.indexOf(y)===-1?F():x();V.dispatchEvent?V.dispatchEvent(v):V.fireEvent("on"+y,v);function x(){var M;return l.createEvent?(M=l.createEvent("Event"),M.initEvent(y,!0,!0)):l.createEventObject&&(M=l.createEventObject()),M}function F(){return new s(y,{detail:h})}}function b(V,y,h){return function(x){var F=x||a.event;F.target=F.target||F.srcElement,F.preventDefault=F.preventDefault||function(){F.returnValue=!1},F.stopPropagation=F.stopPropagation||function(){F.cancelBubble=!0},F.which=F.which||F.keyCode,h.call(V,F)}}function g(V,y,h){var v=w(V,y,h)||b(V,y,h);return p.push({wrapper:v,element:V,type:y,fn:h}),v}function w(V,y,h){var v=O(V,y,h);if(v){var x=p[v].wrapper;return p.splice(v,1),x}}function O(V,y,h){var v,x;for(v=0;v<p.length;v++)if(x=p[v],x.element===V&&x.type===y&&x.fn===h)return v}}).call(this,typeof nt<"u"?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(o,r,i){(function(a){var s=[],u="",l=/^on/;for(u in a)l.test(u)&&s.push(u.slice(2));r.exports=s}).call(this,typeof nt<"u"?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(o,r,i){(function(a){var s=a.CustomEvent;function u(){try{var l=new s("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}r.exports=u()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(d,m){var p=document.createEvent("CustomEvent");return m?p.initCustomEvent(d,m.bubbles,m.cancelable,m.detail):p.initCustomEvent(d,!1,!1,void 0),p}:function(d,m){var p=document.createEventObject();return p.type=d,m?(p.bubbles=!!m.bubbles,p.cancelable=!!m.cancelable,p.detail=m.detail):(p.bubbles=!1,p.cancelable=!1,p.detail=void 0),p}}).call(this,typeof nt<"u"?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(o,r,i){var a=r.exports={},s,u;function l(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?u=clearTimeout:u=d}catch{u=d}})();function m(O){if(s===setTimeout)return setTimeout(O,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(O,0);try{return s(O,0)}catch{try{return s.call(null,O,0)}catch{return s.call(this,O,0)}}}function p(O){if(u===clearTimeout)return clearTimeout(O);if((u===d||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(O);try{return u(O)}catch{try{return u.call(null,O)}catch{return u.call(this,O)}}}var C=[],c=!1,f,S=-1;function E(){!c||!f||(c=!1,f.length?C=f.concat(C):S=-1,C.length&&b())}function b(){if(!c){var O=m(E);c=!0;for(var V=C.length;V;){for(f=C,C=[];++S<V;)f&&f[S].run();S=-1,V=C.length}f=null,c=!1,p(O)}}a.nextTick=function(O){var V=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)V[y-1]=arguments[y];C.push(new g(O,V)),C.length===1&&!c&&m(b)};function g(O,V){this.fun=O,this.array=V}g.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function w(){}a.on=w,a.addListener=w,a.once=w,a.off=w,a.removeListener=w,a.removeAllListeners=w,a.emit=w,a.prependListener=w,a.prependOnceListener=w,a.listeners=function(O){return[]},a.binding=function(O){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(O){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(o,r,i){(function(a){var s=typeof a=="function",u;s?u=function(l){a(l)}:u=function(l){setTimeout(l,0)},r.exports=u}).call(this,o("timers").setImmediate)},{timers:11}],11:[function(o,r,i){(function(a,s){var u=o("process/browser.js").nextTick,l=Function.prototype.apply,d=Array.prototype.slice,m={},p=0;i.setTimeout=function(){return new C(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new C(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(c){c.close()};function C(c,f){this._id=c,this._clearFn=f}C.prototype.unref=C.prototype.ref=function(){},C.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(c,f){clearTimeout(c._idleTimeoutId),c._idleTimeout=f},i.unenroll=function(c){clearTimeout(c._idleTimeoutId),c._idleTimeout=-1},i._unrefActive=i.active=function(c){clearTimeout(c._idleTimeoutId);var f=c._idleTimeout;f>=0&&(c._idleTimeoutId=setTimeout(function(){c._onTimeout&&c._onTimeout()},f))},i.setImmediate=typeof a=="function"?a:function(c){var f=p++,S=arguments.length<2?!1:d.call(arguments,1);return m[f]=!0,u(function(){m[f]&&(S?c.apply(null,S):c.call(null),i.clearImmediate(f))}),f},i.clearImmediate=typeof s=="function"?s:function(c){delete m[c]}}).call(this,o("timers").setImmediate,o("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(fo);var ar=fo.exports;const mo=ir(ar),sr={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},lr={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},Rt=n.defineComponent({name:"Toast",props:lr,emits:["close","click"],setup:(e,t)=>{const o=n.ref(e.animate),r="fadeOut",i=n.computed(()=>e.options),a=n.ref(!1),s=n.computed(()=>i.value.title&&i.value.message),u=n.computed(()=>!i.value.title&&i.value.message),l=n.computed(()=>{const g={animated:a.value,toast:!0,"toast--only-content":!s.value};return g[e.animate]=!1,g[r]=a.value,g["toasty-type-"+i.value.type]=!0,i.value.theme&&(g[i.value.theme]=!0),g}),d=n.computed(()=>{const O=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,V={"f-icon":!0};return V[O]=!0,V}),m=n.computed(()=>i.value.title||i.value.message),p=n.computed(()=>e.showCloseButton),C=n.computed(()=>!!i.value.buttons||!!t.slots.default),c=n.computed(()=>Ue.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function f(g){g.stopPropagation(),g.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function S(g,w){}function E(g){return`f-preten-link ${g.customClass?g.customClass:""}`}n.watch(o,()=>{o.value});const b=()=>{var g;return n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((g=i.value.buttons)==null?void 0:g.map(w=>n.createVNode("span",{class:E(w),onClick:O=>void 0},[w.text]))),t.slots.default&&t.slots.default()])])};return()=>n.createVNode("div",{class:l.value,style:"min-height:44px"},[p.value&&n.createVNode("button",{title:Ue.LocaleService.getLocaleValue("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:f},[n.createVNode("span",{class:"f-icon modal_close"},null)]),m.value&&n.createVNode("section",{class:"modal-tips"},[!s.value&&n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:d.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[s.value&&n.createVNode(n.Fragment,null,[n.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:i.value.title},null),n.createVNode("p",{class:"toast-msg",innerHTML:i.value.message,style:c.value},null),C.value&&b()]),u.value&&(i.value.buttons?n.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:c.value,innerHTML:i.value.message},null),n.createVNode("div",{class:"after-toast-title text-right ml-auto"},[b()])]):n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:c.value,innerHTML:i.value.message},null))])])])}}),cr=["moz","ms","webkit"];function ur(){let e=0;return t=>{const o=new Date().getTime(),r=Math.max(0,16-(o-e)),i=setTimeout(()=>{t(o+r)},r);return e=o+r,i}}function dr(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const e=cr.filter(t=>`${t}RequestAnimationFrame`in window)[0];return e?window[`${e}RequestAnimationFrame`]:ur()}dr(),n.ref("");function po(){if(typeof window>"u"||typeof navigator>"u")return!1;const e=navigator.userAgent||navigator.vendor||window.opera,t=[/iPhone/i,/iPod/i,/Android.*Mobile/i,/webOS/i,/BlackBerry/i,/IEMobile/i,/Opera Mini/i,/Harmony/i],o=[/iPad/i,/Android(?!.*Mobile)/i,/Tablet/i,/PlayBook/i,/Kindle/i,/Silk/i];for(const l of o)if(l.test(e))return!1;for(const l of t)if(l.test(e))return!0;if(typeof screen>"u")return!1;const r="ontouchstart"in window||navigator.maxTouchPoints>0,i=screen.width,a=screen.height,s=Math.min(i,a);return!!(r&&s<=768)}function fr(){const e=po();return e&&document.body.classList.add("f-mobile"),e}typeof document<"u"&&fr();const Et=n.defineComponent({name:"Notify",props:sr,emits:["close","empty"],setup(e,t){var S;const o=po(),i=`farris-notify-${(S=e.options)!=null&&S.type?e.options.type:"info"}}`,a=n.computed(()=>({"farris-notify":!0,[i]:o})),s={left:12,right:12,top:20,bottom:12},u=n.ref(),l=n.ref(e.options),d=n.ref(e.showCloseButton),m=n.computed(()=>e.position||"bottom-right"),p=n.computed(()=>e.timeout!=null?e.timeout:3e3),C=n.computed(()=>{const E=e.bottom?e.bottom:s.bottom,b=e.top?e.top:s.top,g={transition:"all 0.2s ease",left:m.value.indexOf("left")>-1?`${e.left?e.left:s.left}px`:"",right:m.value.indexOf("right")>-1?`${e.right?e.right:s.right}px`:"",top:m.value.indexOf("top")>-1?`${b}px`:"",bottom:m.value.indexOf("bottom")>-1?`${E}px`:""};return m.value.indexOf("center")>-1&&(g.left="50%",g.marginLeft="calc(-24rem / 2)",m.value==="center-center"&&(g.top="50%",g.transform="translate(-50%, -50%)")),g});function c(E){t.emit("close")}p.value&&setTimeout(()=>{c()},p.value),t.expose({closeToast:c,container:u,notifyPosition:m});function f(E,b){c()}return()=>{var E;return o?n.createVNode("div",{class:a.value,ref:u},[(E=e.options)==null?void 0:E.message]):n.createVNode("div",{class:a.value,style:C.value,ref:u},[n.createVNode(Rt,{options:l.value,showCloseButton:d.value,animate:e.animate,onClose:b=>f(b,l.value)},null)])}}});class _t{constructor(){we(this,"notifyRefs",[]);we(this,"globalConfig",n.reactive({}))}escapeAllHtml(t){if(typeof t!="string"||!t)return"";const o=document.createElement("div");return o.textContent=t||"",o.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(t){const o=this,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...t}),a=document.createElement("div");a.style.display="contents";const s=n.createApp({setup(){var d;const u=n.ref();function l(){u.value.container.style.transform="scale(0)",setTimeout(()=>{o.updateNotifyPositionForClose(i,u),s.unmount()},220)}if(i.position.indexOf("top")>-1){const m=o.getNotifyInstances(i.position),p=m[m.length-1];if(p){const C=p.value.container.getBoundingClientRect();i.top=C.bottom}}return i.safeHtml&&((d=i.options)!=null&&d.message)&&(i.options.message=o.escapeAllHtml(i.options.message)),n.onUnmounted(()=>{document.body.removeChild(a)}),n.onMounted(()=>{o.updateNotifyPositionForCreate(i,u)}),()=>n.createVNode(n.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[n.createVNode(Et,n.mergeProps({ref:u},i,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(Ue.LocaleService.i18n),s.mount(a),s}getNotifyInstances(t){return this.notifyRefs.filter(o=>o.value.notifyPosition===t)}updateNotifyPositionForCreate(t,o){if(this.notifyRefs&&this.notifyRefs.length){const r=window.innerHeight;t.position.indexOf("bottom")>-1&&this.getNotifyInstances(t.position).forEach(i=>{const a=i.value.container.getBoundingClientRect();i.value.container.style.bottom=a.height+r-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,o]}updateNotifyPositionForClose(t,o){const r=this.notifyRefs.indexOf(o);if(t.position.indexOf("top")>-1){const i=this.getNotifyInstances(t.position),a=i.indexOf(o);i.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}r>-1&&this.notifyRefs.splice(r,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,o){let r="",i="",a,s,u;typeof o=="string"?r=o:o&&(r=o.message||"",i=o.title||"",s=o.position||null,u=o.showCloseButton!=null?o.showCloseButton:null,a=o.timeout!=null?o.timeout:null);const d={options:{type:t,message:r,title:i}};return s!=null&&(d.position=s),u!=null&&(d.showCloseButton=u),a!=null&&(d.timeout=a),d}info(t){const o=this.buildNotifyProps("info",t);return this.show(o)}success(t){const o=this.buildNotifyProps("success",t);return this.show(o)}warning(t){const o=this.buildNotifyProps("warning",t);return this.show(o)}error(t){const o=this.buildNotifyProps("error",t);return this.show(o)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const mr=Symbol("NOTIFY_SERVICE_TOKEN");Et.install=e=>{e.component(Et.name,Et),e.component(Rt.name,Rt);const t=new _t;e.provide(mr,t),e.provide("FNotifyService",t)};const pr={designerHostService:{type:Object,default:{}},componentType:{type:String,default:""},bindingEntityId:{type:String,default:""},steps:{type:Array,default:["selectEntity","selectFields"]},targetComponentInstance:{type:Object,default:{}}};`${Ue.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const gr={customClass:{type:String,default:""},sort:{type:Object},filter:{type:Object},autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",required:!0},loadData:{type:Function},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,mode:"server",size:-1}},rowNumber:{type:Object,default:{enable:!0,width:36,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!1}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1},emptyTemplate:{type:Object},summary:{type:Object,default:{enable:!1,groupFields:["numericField1","numericField2"]}},autoHeight:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},checkboxPosition:{type:String,default:"after-expand"},enableColumnSettingSolution:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:""},customSearch:{type:Function},beforeEditCell:{type:Function,default:e=>!0},focusOnEditingCell:{type:Boolean,default:!0}},hr="enum",vr="boolean";function yr(e){const{formatter:t}=e;return!t||typeof t=="function"?null:t}function Cr(e,t){const o=t.options||t,{data:r}=o;if(!r||!r.length)return"";const i=Object.prototype.hasOwnProperty.call(o,"valueField")&&o.valueField||"value",a=Object.prototype.hasOwnProperty.call(o,"textField")&&o.textField||"name";if(typeof e=="string"&&e.includes(",")){const u=e.split(","),l=r.reduce((m,p)=>(m[p[i]]=p,m),{}),d=u.map(m=>{var p;return(p=l[m])==null?void 0:p[a]}).filter(m=>m!=null);return d.length?d.join(","):""}const s=r.find(u=>u[i]===e);return(s==null?void 0:s[a])??(e==null?"":String(e))}function br(e,t){if(e==null)return"";const o=t.options||t,r=e?o==null?void 0:o.trueText:o==null?void 0:o.falseText;return r==null?"":String(r)}function wr(e,t){const o=Oo.resolveField(t,e.field),r=yr(e),i=r==null?void 0:r.type;return i===hr?Cr(o,r):i===vr||e.dataType==="boolean"?br(o,r||{}):o==null?"":String(o)}function Sr(e,t,o,r,i,a,s,u,l,d,m,p,C,c,f,S,E,b,g){const{calculateCellPositionInRow:w}=a,{columnContext:O,hasLeftFixedColumn:V,hasRightFixedColumn:y}=s,{gridDataStyle:h,leftFixedGridDataStyle:v,rightFixedGridDataStyle:x}=c,{renderDataRow:F}=de.getHierarchyRow(e,t,O,E,u,l,d,m,p,C,c,f,S,b,g),M=[F];function $(q,D){const U=w(q);return E.value.filter(ne=>ne.visible!==!1).map((ne,N)=>M[ne.type](ne,U,D,N))}function R(){return n.createVNode("div",{ref:r,class:"fv-grid-content-left-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:v.value},[$(O.value.leftColumns.filter(q=>q.visible),"left")])])}function j(){return n.createVNode("div",{ref:o,class:"fv-grid-content-primary"},[n.createVNode("div",{class:"fv-grid-data",style:h.value},[$(O.value.primaryColumns.filter(q=>q.visible),"primary")])])}function _(){return n.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:x.value},[$(O.value.rightColumns.filter(q=>q.visible),"right")])])}function I(){const q=[];return V.value&&q.push(R()),q.push(j()),y.value&&q.push(_()),q}return{renderDataArea:I}}const Ut=n.defineComponent({name:"FTreeGrid",props:gr,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","selectItem","filterChanged","unSelectAll","selectAll","sortChanged","selectionUpdate","beginEditCell","endEditCell"],setup(e,t){var Bo,Io;const o=n.ref(!1),r=n.ref(!1),i=0,a=n.ref(((Bo=e.rowOption)==null?void 0:Bo.height)||28);let s=[],u=[];const l=n.ref(20),d=n.ref(e.columns),m=de.useIdentify(e),{idField:p}=m,C=n.ref(),c=n.ref(),f=n.ref(),S=n.ref(),E=n.ref(),b=n.ref([]),g=n.ref(!1),w=n.ref(((Io=e.rowOption)==null?void 0:Io.wrapContent)||!1),O=de.useGroupData(e,m),V=de.useFilter(e,t),y=de.useHierarchy(e),{collapseField:h}=y,{showLoading:v,renderLoading:x}=de.useLoading(e,C),F=de.useDataView(e,new Map,V,y,m),{dataView:M}=F,$=de.useSelection(e,F,m,b,t),{showSelection:R,selectedValues:j}=$,_=de.useSelectHierarchyItem(e,b,F,m,$,t),I=n.computed(()=>e.disabled),q=n.computed(()=>e.virtualized?Math.min(F.dataView.value.length,l.value):F.dataView.value.length),D=de.usePagination(e,F),{shouldRenderPagination:U}=D,{containerStyleObject:ne}=de.useDataViewContainerStyle(e,b),N=n.ref(""),P=n.ref([]),oe=n.computed(()=>e.searchable||!1),re=n.ref(0),Z=n.computed(()=>P.value.length?`${re.value+1}/${P.value.length}`:""),he=n.computed(()=>Ue.LocaleService.getRealPropertyValue(e.searchPlaceholder,"","datagrid.search.placeholder")),xe=n.computed(()=>Ue.LocaleService.getLocaleValue("datagrid.search.search")),fe=n.computed(()=>Ue.LocaleService.getLocaleValue("datagrid.search.prev")),ee=n.computed(()=>Ue.LocaleService.getLocaleValue("datagrid.search.next")),T=n.computed(()=>Ue.LocaleService.getLocaleValue("datagrid.search.clear")),ie=de.useCommandColumn(e),{applyCommands:ae}=ie;ae(d);const{applyColumnSetting:le,removeColumnSetting:ye}=de.useSettingColumn(e);e.showSetting&&le(d);const ke=de.useColumn(e,t),qe=de.useSort(e),{applyColumnSorter:Le,columnContext:Te,updateColumnRenderContext:Pe}=ke;Le(F,qe);const Oe=de.useGroupColumn(e,Te),Be=de.useRow(e,t,$,m),Ee=de.useEdit(e,t,m,Be,b),at=de.useVisualDataBound(e,F,a),ut=de.useVisualDataCell(e,Ee,at),dt=de.useVisualDataRow(e,F,Ee,y,m,at,ut,a),Xe=de.useVisualData(e,d,F,q,i,dt),{getVisualData:et}=Xe,ft=de.useCellPosition(e,Te,a,o),ot=de.useSidebar(e,$),{sidebarWidth:st}=ot,Me=de.useVirtualScroll(e,F,b,Te,Xe,q,i,st,a,o),{onWheel:A,dataGridWidth:ce,viewPortHeight:Ne,viewPortWidth:Ve,resetScroll:ze,updateVisibleRowsOnLatestVisibleScope:yt}=Me,lt=de.useFitColumn(e,Te,c,Ve,Oe),{calculateColumnsSize:mt}=lt,It=de.useFilterHistory(),Pt=de.useColumnFilter(c,E,F,It,Me),zt=de.useDragColumn(e,t,ke,F,Oe,O,Me),Ht=n.computed(()=>{const L={"fv-grid":!0,"fv-grid-bordered":e.showBorder,"fv-grid-horizontal-bordered":e.showHorizontalLines,"fv-datagrid-strip":e.showStripe};return De.getCustomClass(L,e.customClass)}),Wt=n.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":g.value,"fv-grid-wrap-content":w.value,"fv-grid-scrollbar-visible":Me.shouldShowVirticalScrollbar.value&&g.value})),{renderDataArea:Gt}=Sr(e,t,f,S,E,ft,ke,F,Ee,y,Be,$,_,Me,Xe,at,b,a,o),Ot=n.ref(null);function Lt(L,G){var ue,me;e.enableColumnSettingSolution&&((me=(ue=Ot.value)==null?void 0:ue.persistColumnWidths)==null||me.call(ue,G))}const{renderGridHeader:Yt,renderGridColumnResizeOverlay:k,shouldShowHeader:K}=de.getColumnHeader(e,t,c,S,E,ke,F,zt,Pt,V,It,lt,Oe,$,ot,qe,Me,Ve,b,r,Lt),{renderDataGridSidebar:J}=de.getSidebar(e,Be,$,ot,Me),{renderDisableMask:se}=de.getDisableMask(),{renderHorizontalScrollbar:Ce}=de.getHorizontalScrollbar(e,c,Me),{renderVerticalScrollbar:be}=de.getVerticalScrollbar(e,c,Me);let Re=null;function $e(){var L,G,ue;if(c.value&&c.value.clientHeight>0&&((L=c.value)==null?void 0:L.clientWidth)>0){const me=Math.ceil(c.value.clientHeight/a.value);me>l.value&&(l.value=me,yt()),Ne.value=((G=f.value)==null?void 0:G.clientHeight)||0,ce.value=((ue=c.value)==null?void 0:ue.clientWidth)||0,f.value&&(Ve.value=f.value.clientWidth)}c.value&&(c.value.clientHeight>0||c.value.clientWidth>0)&&mt()}function We(){Re!==null&&cancelAnimationFrame(Re),Re=requestAnimationFrame(()=>{Re=null,$e()})}n.onMounted(()=>{c.value&&(l.value=Math.max(Math.ceil(c.value.clientHeight/a.value),l.value),b.value=et(0,q.value+i-1),Po.useResizeObserver(c.value,We),mt(),n.nextTick(()=>{c.value&&(ce.value=c.value.clientWidth),f.value&&(Ve.value=f.value.clientWidth,Ne.value=f.value.clientHeight)})),v.value&&x()}),n.onUnmounted(()=>{Re!==null&&cancelAnimationFrame(Re)});function Qe(L){F.collapseTo(L),F.reOrderVisibleIndex(),ze()}function Ae(L){F.expandTo(L),F.reOrderVisibleIndex(),ze()}function Ge(){const L=$.getSelectionRow();return L?L.dataIndex-1:-1}function He(L){const G=L!==void 0?L:Ge(),ue=F.insertNewDataItem(G===-1?0:G);return b.value=et(0,q.value+i-1),ue}function _e(){const L=Ge();F.insertNewChildDataItem(L),b.value=et(0,q.value+i-1)}function Ct(L,G){const ue=b.value.find(ge=>ge.raw[p.value]===G),me=ue?ue.dataIndex-1:-1;F.insertNewChildDataItems(L,me)}function bt(){const L=Ge(),G=_.getNextSelectableHierarchyItemId(L);F.removeHierarchyDataItem(L),b.value=et(0,q.value+i-1),G&&_.selectItemById(G)}function wt(L){Ee.onEditingRow(L)}function Ci(L){Ee.acceptEditingRow(L)}function bi(L){Ee.cancelEditingRow(L)}function St(L){L&&(d.value=L,ae(d),e.showSetting&&le(d),Pe(d.value),Le(F,qe),mt())}n.watch(()=>e.columns,L=>{if(e.showSetting&&e.enableColumnSettingSolution){St(d.value);return}St(L)});function wi(L,G){if(L){const ue=!!(G!=null&&G.keepScrollTop||G!=null&&G.keepScrollPosition),me=ue?Me.offsetY.value:0;F.load(L),F.reOrderVisibleIndex(),de.refreshScrollAfterDataSourceLoad({keepScroll:ue,savedOffsetY:me,resetScroll:ze,scrollTo:Me.scrollTo})}}function Kt(L){Be.activeRowById(L)}function Si(L,G={isCurrent:!0}){G!=null&&G.isCurrent&&Kt(L),_.selectItemById(L)}function xi(L){const G=b.value.find(ue=>ue.raw[m.idField.value]===L);G&&Be.clickRowItem(G)}function Ti(L){_.selectItemByIds(L)}function Ni(){return $.getSelectedItems()}function Mo(){$.clearSelection()}function Vi(){$.emptyCurrentRowId()}const Fi=n.computed(()=>!b.value||!b.value.length),{renderEmpty:Ei}=de.getEmpty(e,t);function Mi(){return $.getSelectionRow()}function ji(L,G={clearCurrent:!0}){G!=null&&G.clearCurrent&&Kt(""),_.unSelectItemByIds(L)}function Di(){return $.currentSelectedDataId.value}function ki(L,G,ue){const me=M.value.find(ge=>ge[p.value]===L);if(me){if(Object.keys(me).forEach(ve=>{Object.prototype.hasOwnProperty.call(G,ve)&&(me[ve]=G[ve])}),ue){const{collapseField:ve,disabledField:Ye,checkedField:tt,visibleField:Ke,hasChildren:Tt}=ue;ve&&!Se.isUndefined(G[ve])&&(me.__fv_collapse__=G[ve]),tt&&!Se.isUndefined(G[tt])&&(me.__fv_checked__=G[tt]),Ye&&!Se.isUndefined(G[Ye])&&(me.__fv_disabled__=G[Ye]),Ke&&!Se.isUndefined(G[Ke])&&(me.__fv_visible__=G[Ke]),Se.isUndefined(Tt)||(me.__fv_hasChildren__=Tt)}const ge=b.value.find(ve=>ve.raw[p.value]===L),pe=b.value.findIndex(ve=>ve.raw[p.value]===L);if(ge){if(ge.raw=me,Object.keys(ge.data).forEach(ve=>{ge.data[ve].updateData(me)}),ue){const{collapseField:ve,disabledField:Ye,checkedField:tt,visibleField:Ke,hasChildren:Tt}=ue;ve&&!Se.isUndefined(G[ve])&&(ge.collapse=G[ve]),tt&&!Se.isUndefined(G[tt])&&(ge.checked=G[tt]),Ye&&!Se.isUndefined(G[Ye])&&(ge.disabled=G[Ye]),Ke&&!Se.isUndefined(G[Ke])&&(ge.visible=G[Ke]),Se.isUndefined(Tt)||(ge.raw.__fv_hasChildren__=Tt)}b.value=[...b.value.slice(0,pe),ge,...b.value.slice(pe+1)],F.updateSummary()}}}function Bi(L){return Object.prototype.hasOwnProperty.call(L,"raw")?F.hasRealChildren(L.raw):F.hasRealChildren(L)}function Ii(L){const G=F.dataView.value.find(ue=>ue[p.value]===L);return G?G[h.value]:""}function Pi(){return h.value}n.watch(()=>e.showSetting,(L,G)=>{L!==G&&(L?le(d):ye(d),St(d.value))});function Oi(L){return b.value.filter(G=>L.includes(G.raw[e.idField]))}function jo(L){const G=m.idField.value,ue=b.value.find(me=>me.raw[G]===L);ue&&Be.changeRow(ue)}function Li(){$.keepSelectingOnPaging.value||Mo(),F.updateVisibleDataSummary(b.value)}function Ai(){Ee.endEditCell()}function qi(L){$.updateSelectedValues(L)}function Ri(L){$.removeSelectedValues(L)}const _i=100;function Ui(L,G){const ue=G[L].__fv_layer__||0;let me=L+1;for(;me<G.length&&(G[me].__fv_layer__||0)>ue;)me++;return me-1}function $i(L){const G=F.dataView.value,ue=y.collapseField.value,me=L.__fv_index__,ge=L.__fv_layer__||0;if(typeof me!="number"||L.__fv_visible__===!1||L[ue])return;let pe=me+1;for(;pe<G.length;){const ve=G[pe];if((ve.__fv_layer__||0)<=ge)break;if(ve.__fv_visible__=!0,ve[ue]){pe=Ui(pe,G)+1;continue}pe++}}function zi(L){let G=L;const ue=[];let me=0;for(;G&&G[y.parentIdField.value]&&me<_i;){me++;const ge=F.rawView.value.find(pe=>pe[m.idField.value]===G[y.parentIdField.value]);if(ge)ge[y.collapseField.value]&&ue.push(ge),G=ge;else break}ue.reverse().forEach(ge=>{ge[y.collapseField.value]=!1,F.toggleChildrenVisibiltyByCollapseStatus(ge),$i(ge)})}function Hi(L,G){if(L.length!==G.length)return!1;const ue=L.map(ge=>ge[m.idField.value]).sort(),me=G.map(ge=>ge[m.idField.value]).sort();return ue.every((ge,pe)=>ge===me[pe])}function Xt(){const L=P.value[re.value];L&&(zi(L),n.nextTick(()=>{F.reOrderVisibleIndex();const G=L[m.idField.value],ue=L.__fv_visible_index__;ue!==void 0&&ue!==""&&ue>=0?(Me.scrollToRowByIndex(ue),n.nextTick(()=>{jo(G)})):console.warn("搜索结果的节点不在当前可见范围内,无法定位",G)}))}function Do(){!N.value.trim()||!P.value.length||(re.value=(re.value+1)%P.value.length,Xt())}function Wi(){if(!N.value.trim()){P.value=[],re.value=0;return}const L=[],G=N.value.toLowerCase().trim();F.rawView.value.forEach(me=>{let ge=!1;e.customSearch?ge=e.customSearch(G,me,e.columns):e.columns.forEach(pe=>{if(!ge&&pe.field){const ve=wr(pe,me);ve&&ve.toLowerCase().includes(G)&&(ge=!0)}}),ge&&L.push(me)});const ue=!Hi(L,P.value);L.length>0?ue?(P.value=L,re.value=0,Xt()):Do():(P.value=[],re.value=0)}function Gi(){if(!N.value.trim()||!P.value.length)return;const L=P.value.length;re.value=(re.value-1+L)%L,Xt()}const xt=Se.debounce(Wi,300);function ko(){xt.cancel(),N.value="",P.value=[],re.value=0}n.watch(N,L=>{L.trim()||(xt.cancel(),P.value=[],re.value=0)}),n.onUnmounted(()=>{xt.cancel()});function Yi(L){if(L.key==="Enter"){if(!N.value.trim())return;xt()}}function Ki(){N.value.trim()&&xt()}t.expose({activeRowById:Kt,addNewDataItem:He,addNewChildDataItem:_e,addChildrenToNode:Ct,collapseTo:Qe,expandTo:Ae,removeDataItem:bt,editDataItem:wt,acceptDataItem:Ci,cancelDataItem:bi,updateColumns:St,updateDataSource:wi,selectItemById:Si,selectItemByIds:Ti,getSelectedItems:Ni,clearSelection:Mo,getSelectionRow:Mi,clickRowItemById:xi,unSelectItemByIds:ji,getCurrentRowId:Di,reassignRowData:ki,hasChildren:Bi,getCollapseField:Pi,getCollapseStatusById:Ii,getVisibleDataByIds:Oi,selectRowById:jo,updateDerivedData:Li,emptyCurrentRowId:Vi,calculateColumnsSize:mt,endEditCell:Ai,updateSelectedValues:qi,removeSelectedValues:Ri});const Xi=n.computed(()=>{const L={};return Me.shouldShowHorizontalScrollbar.value&&g.value&&(L.paddingBottom="10px"),Me.shouldShowVirticalScrollbar.value&&g.value,L}),Qi=n.computed(()=>({...ne.value,borderRadius:"5px"})),{renderDataGridPagination:Ea}=de.getPagination(e,t,F,Me,D,$),Ji=n.computed(()=>({"d-flex":!0,"justify-content-between":U.value&&R.value,"justify-content-end":U.value&&!R.value,"position-relative":!0})),Zi=n.computed(()=>({"d-flex":!0,"align-items-center":!0}));function ea(L){const G=L.map(pe=>pe.id),ue=[...d.value,...s,...u];ue.filter(pe=>pe.dataType!==de.COMMAND_COLUMN_DATA_TYPE&&pe.dataType!==de.SETTING_COLUMN_DATA_TYPE).forEach(pe=>{const ve=L.find(Ye=>Ye.id===pe.id);ve&&(pe.width=ve.actualWidth||pe.width||120,ve.actualWidth!==void 0&&(pe.actualWidth=ve.actualWidth),pe.title=ve.title,pe.halign=ve.halign,pe.align=ve.align,pe.fixed=ve.fixed)}),u=ue.filter(pe=>pe.dataType===de.COMMAND_COLUMN_DATA_TYPE||pe.dataType===de.SETTING_COLUMN_DATA_TYPE);const me=ue.filter(pe=>pe.dataType!==de.COMMAND_COLUMN_DATA_TYPE&&pe.dataType!==de.SETTING_COLUMN_DATA_TYPE),ge=me.filter(pe=>G.includes(pe.id));s=me.filter(pe=>!G.includes(pe.id)),ge.sort((pe,ve)=>{const Ye=L.findIndex(Ke=>Ke.id===pe.id),tt=L.findIndex(Ke=>Ke.id===ve.id);return Ye-tt}),St(ge)}const{renderDataGridSummary:ta}=de.getSummary(e,F,ke);return()=>e.visible&&n.createVNode(n.Fragment,null,[oe.value&&n.createVNode("div",{class:"fv-grid-search",style:{padding:"8px 12px",border:"1px solid #e0e0e0",borderBottom:"none",borderRadius:"4px 4px 0 0"}},[n.createVNode("div",{style:{display:"flex",alignItems:"center"}},[n.createVNode(Lo,{value:N.value,onInput:L=>N.value=L,"onUpdate:value":L=>N.value=L||"",onClear:ko,onKeydown:Yi,placeholder:he.value,style:{flex:1}},null),Z.value&&n.createVNode("span",{class:"fv-grid-search-count",style:{marginLeft:"8px",fontSize:"12px",color:"#888",whiteSpace:"nowrap"}},[Z.value]),n.createVNode(ct,{type:"link",title:fe.value,disabled:!P.value.length,onClick:Gi,style:{cursor:"pointer",marginLeft:"4px"}},{default:()=>[n.createVNode("i",{class:"f-icon f-icon-arrow-chevron-up"},null)]}),n.createVNode(ct,{type:"link",title:ee.value,disabled:!P.value.length,onClick:Do,style:{cursor:"pointer",marginLeft:"4px"}},{default:()=>[n.createVNode("i",{class:"f-icon f-icon-arrow-chevron-down"},null)]}),n.createVNode(ct,{type:"link",title:xe.value,onClick:Ki,style:{cursor:"pointer",marginLeft:"4px"}},{default:()=>[n.createVNode("i",{class:"f-icon f-icon-search"},null)]}),N.value&&n.createVNode(ct,{type:"link",title:T.value,onClick:ko,style:{cursor:"pointer",marginLeft:"4px"}},{default:()=>[n.createVNode("i",{class:"f-icon f-icon-close"},null)]})])]),n.createVNode("div",{ref:C,class:Ht.value,style:Qi.value,onWheel:A},[c.value&&K.value&&Yt(),n.createVNode("div",{ref:c,class:Wt.value,onMouseover:()=>g.value=!0,onMouseleave:()=>g.value=!1,onTouchstart:L=>{L.stopPropagation(),g.value=!0,Me.onTouchstartScrollThumb(L,c)},onTouchend:L=>{g.value=!1},style:Xi.value},[c.value&&J(b),c.value&&Gt(),c.value&&Fi.value&&Ei(),c.value&&Ce(),c.value&&be()]),c.value&&ta(),R.value&&n.createVNode("div",{class:Ji.value},[R.value&&n.createVNode("div",{class:Zi.value},[n.createVNode("div",null,["已选:"+j.value.length,n.createTextVNode(" 条")])])]),k(),I.value&&se()]),e.enableColumnSettingSolution&&n.createVNode(de.ColumnSettingSolution,{ref:Ot,columns:[...d.value,...s],componentId:e.id,modelValue:r.value,"onUpdate:modelValue":L=>r.value=L,onChangeColumnSetting:ea},null)])}});De.withInstall(Ut);function go(e){const{designerHostService:t}=e,o=new Map,r=n.ref(),i=n.ref(),a=n.ref([{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"displayedTypeName",title:"字段类型"}]),s={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},u=n.ref(!1),l=n.ref(e.componentType);function d(E){const b=[];return E.forEach(g=>{let w=[];g.type&&g.type.fields&&g.type.fields.length>0&&(w=d(g.type.fields));const O=Se.cloneDeep(g),V=g.multiLanguage?"多语言":g.type.displayName,y=w.length?!1:!o.has(g.id);y&&(u.value=!0),b.push({data:Object.assign({displayedTypeName:V,selectable:y},O),children:w})}),b}function m(E){switch(E){case"data-grid":case"tree-grid":return"data-grid";case"response-form":return"form";default:return E}}function p(E){var b,g;if(E&&(((b=E.schema)==null?void 0:b.type)===((g=Fe.drawer)==null?void 0:g.type)||E.parent&&p(E.parent)))return!0}function C(E){if(o.clear(),!E)return;const b=p(e.targetComponentInstance);let g=m(l.value);["frame","table","form"].includes(g)&&(g="form");const{formSchemaUtils:w,schemaService:O}=t;w.getFormSchema().module.viewmodels.forEach(V=>{if(!V.fields||V.fields.length===0)return;const y=w.getComponentByViewModelId(V.id);let h=y.componentType;["frame","table","form"].includes(h)&&(h="form");const v=O.getTableInfoByViewModelId(V.id);if(h!==g||!v||v.id!==E.id)return;const x=w.checkComponentExistInDrawer(y.id);b&&x&&V.fields.forEach(F=>{o.set(F.id,!0)}),!b&&!x&&V.fields.forEach(F=>{o.set(F.id,!0)})})}function c(E){C(E);const{fields:b}=E.type;u.value=!1,r.value=d(b),i.value&&i.value.updateDataSource(r.value)}const f={customRowStatus:E=>(E.disabled=!E.raw.selectable,E)};function S(){return i.value.getSelectedItems().map(b=>b.data)}return{fieldTreeGridRef:i,resolveFieldDataSource:c,occupiedFieldMap:o,fieldDataSource:r,fieldTreeRowOption:f,fieldColumns:a,fieldSelectionOption:s,checkAndGetSelectedFields:S,hasSelectableField:u,currentComponentType:l}}function xr(e){const{designerHostService:t}=e,o=new Map,r=n.ref(),i=n.ref(),a=n.ref([{field:"name",title:"实体名称"}]),s=n.ref(),u=n.ref(!1);function l(f){const S=go(e);return S.resolveFieldDataSource(f),S.hasSelectableField.value?(s.value=s.value||f,!0):!1}function d(f){return!(e.bindingEntityId&&e.bindingEntityId!==f.id||!l(f))}function m(f,S=""){var O;if(!f)return;const E=Se.cloneDeep(f),b=S?`${S}/${E.label}`:"/";o.set(E.label,b.replace("//","/"));const g=d(E),w={data:Object.assign({selectable:g},E),children:[]};if(E.type.entities&&E.type.entities.length){const V=E.type.entities.map(y=>m(y,b));w.children=w.children.concat(V)}return e.bindingEntityId===f.id&&(s.value=f),((O=s.value)==null?void 0:O.id)===f.id&&!S&&(u.value=!0),w}function p(){var b;const{formSchemaUtils:f}=t,S=(b=f.getFormSchema().module.entity[0])==null?void 0:b.entities[0];o.clear();const E=m(S);i.value=[E]}function C(){var S;const f=r.value.getSelectionRow();if(!f||!((S=f.raw)!=null&&S.data)){const E=new _t;E.globalConfig={position:"top-center"},E.warning({message:"请先选择实体"});return}return f.raw.data}return{entityTreeGridRef:r,entityDataSource:i,resolveEntityDataSource:p,entityBindToMap:o,checkAndGetSelectedEntity:C,entityColumns:a,entityTreeRowOption:{customRowStatus:f=>(f.disabled=!f.raw.selectable,f)},initialSelectedEntity:s,isMainEntityInitialSelected:u}}const Tr=new Map([["appearance",je.resolveAppearance]]);function Nr(e,t){const{formSchemaUtils:o,designViewModelUtils:r}=t;function i(u,l){var d,m,p,C;return(m=(d=l==null?void 0:l.parentComponentInstance)==null?void 0:d.schema)==null||m.type,(C=(p=o.getFormSchema())==null?void 0:p.module)==null||C.templateId,u}function a(u){const l=e.getSchemaByType("component");return Object.assign(l,{id:`${u.componentId}-component`,contents:[],type:"step",appearance:{},steps:[],fill:!1,direction:"vertical",activeIndex:0}),l}function s(u){const l=a(u);return i(l,u)}return{createComponent:s}}function Vr(e,t,o,r){var a,s,u,l,d,m;const i=o.parentComponentInstance;if(i&&r){const p=Math.random().toString(36).slice(2,6),C={componentId:`step-${p}`,componentName:((a=o.bindingSourceContext)==null?void 0:a.entityTitle)||((u=(s=o.bindingSourceContext)==null?void 0:s.bindingEntity)==null?void 0:u.name)||`列表-${p}`,componentType:"step",parentContainerId:i.schema.id,parentComponentInstance:i,bindTo:((l=o.bindingSourceContext)==null?void 0:l.bindTo)||"",dataSource:(m=(d=o.bindingSourceContext)==null?void 0:d.bindingEntity)==null?void 0:m.label},{createComponent:c}=Nr(e,r);return c(C)}else return t}const Fr={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/step.schema.json",title:"step",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for step",type:"string"},type:{description:"The type string of step",type:"string",default:"step"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},visible:{description:"",type:"boolean",default:!0},direction:{description:"排列方式",type:"enum",default:"horizontal"},steps:{description:"步骤条",type:"array"},activeIndex:{description:"当前索引",type:"number",default:0},clickable:{description:"是否允许点击",type:"boolean",default:!0},fill:{description:"是否填充",type:"boolean",default:!0},stepsMessage:{description:"步骤条",type:"array"},stepDataSourceType:{description:"数据源类型",type:"enum",default:"static"},beforeClickStep:{description:"步骤条点击前事件",type:"string"},stepTemplate:{description:"步骤条模板",type:"string"}},required:["id","type"]},$t={direction:{type:String,default:"horizontal"},fill:{type:Boolean,default:!1},height:{type:Number,default:0},clickable:{type:Boolean,default:!0},steps:{type:Array,default:[{id:"1",title:"审批中(示例)",description:"正在审批"},{id:"2",title:"复核中(示例)",description:"等待复核"}]},activeIndex:{type:Number,default:0},visible:{type:Boolean,default:!0},beforeClickStep:{type:Object,default:()=>()=>!0},onClick:{type:Function,default:()=>{}},customClass:{type:String,default:""},stepTemplate:{type:Object}},ho=je.createPropsResolver($t,Fr,Tr,Vr),rt=n.defineComponent({name:"FStep",props:$t,emits:["click"],setup(e,t){const o=n.ref(0),r=n.ref(e.activeIndex),i=n.computed(()=>({"f-progress-step-list":e.direction==="horizontal","f-progress-step-list-block":e.direction==="vertical","f-progress-step-horizontal-fill":e.direction==="horizontal"&&e.fill,"f-progress-step-vertical-fill":e.direction==="vertical"&&e.fill})),a=n.computed(()=>({overflow:"auto"}));function s(g,w){const O={step:!0,active:w===r.value,clickable:!g.disabled,current:w===r.value};return w<r.value&&(O.finish=!0),O}function u(g,w){const O={steps:e.steps,step:g,index:w,activeIndex:r.value,direction:e.direction};Promise.resolve().then(()=>e.beforeClickStep?e.beforeClickStep(O):!0).then(V=>{if(V&&!g.disabled){const y={step:g,stepIndex:w};r.value=w,t.emit("click",y)}})}function l(g,w){const O={"f-progressstep-row":!0,"step-active":w===r.value,"step-current":w===r.value};return w<r.value&&(O["step-finish"]=!0),O}function d(g,w){return{"step-icon":!0,"step-success":w,"f-icon":w,"f-icon-check":w}}function m(g,w){const O=[];return w>=r.value||w===o.value?O.push(n.createVNode("span",{class:"step-icon"},[w+1])):O.push(n.createVNode("span",{class:d(g,!0)},null)),O}function p(g,w){return{"step-name":!0,"step-name-success":w<r.value}}function C(g,w){return n.createVNode("div",{class:"f-progress-step-title"},[n.createVNode("p",{class:p(g,w)},[g.title])])}function c(g,w){return{"f-progress-step-line":!0,"f-progress-step-line-success":w===r.value}}function f(g,w){return w!==e.steps.length-1}const S=n.computed(()=>({triangle:!0}));function E(){return e.steps.map((g,w)=>n.createVNode("li",{class:s(g,w),onClick:O=>u(g,w)},[e.stepTemplate?e.stepTemplate({step:g,index:w,length:e.steps.length,activeIndex:r.value,direction:e.direction}):t.slots.stepTemplate?t.slots.stepTemplate({step:g,index:w,length:e.steps.length,activeIndex:r.value,direction:e.direction}):n.createVNode("div",{class:l(g,w)},[n.createVNode("div",{class:"f-progress-step-content"},[m(g,w),C(g,w)]),f(g,w)&&n.createVNode("div",{class:c(g,w)},[n.createVNode("span",{class:S.value},null)])])]))}n.watch(()=>e.activeIndex,g=>{e.activeIndex>-1&&e.activeIndex<=e.steps.length&&(r.value=g)});const b=n.computed(()=>{const g={"f-progress-step":!0};return De.getCustomClass(g,e.customClass)});return()=>n.createVNode("div",{class:b.value},[n.createVNode("ul",{class:i.value,style:a.value},[E()])])}}),Fe={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},table:{type:"table",name:"表格布局"},"table-td":{type:"table-td",name:"单元格"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"drawer-toolbar-item":{type:"drawer-toolbar-item",name:"抽屉工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},"drawer-toolbar":{type:"drawer-toolbar",name:"抽屉工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},nav:{type:"nav",name:"标签类导航"},"list-view":{type:"list-view",name:"列表"},"filter-bar":{type:"filter-bar",name:"筛选条"},"language-textbox":{type:"language-textbox",name:"多语输入框"},image:{type:"image",name:"图像"},avatar:{type:"avatar",name:"头像"},"discussion-editor":{type:"discussion-editor",name:"评论编辑区"},"discussion-list":{type:"discussion-list",name:"评论列表"},comment:{type:"comment",name:"评论区"},"approval-logs":{type:"approval-logs",name:"审批记录"},"rich-text-editor":{type:"rich-text-editor",name:"富文本",icon:"rich-text-box"},calendar:{type:"calendar",name:"日历",icon:"date-picker"},wizard:{type:"wizard",name:"向导",icon:"wizard"},"wizard-page":{type:"wizard-page",name:"向导页",icon:"wizard"},"wizard-page-detail":{type:"wizard-page-detail",name:"向导详情",icon:"wizard"},step:{type:"step",name:"步骤条",icon:"step"},"dynamic-form":{type:"dynamic-form",name:"动态表单"},"field-search-box":{type:"field-search-box",name:"智能搜索框"}};class Er{constructor(t){we(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);we(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});we(this,"getExpressionConverter",(t,o)=>({convertFrom:(r,i,a,s)=>{const u=a.getExpressionRuleValue(t,o||i);return u&&u.value||""},convertTo:(r,i,a,s,u)=>{var l;if(i==="dataPicking"&&(a!=null&&a.target)){const d=`${a.target}_dataPicking`;((l=a.rules)==null?void 0:l.some(p=>p.id===d&&p.value))?r.dictPickingExpressionId=d:delete r.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=t}getExpressionRule(t,o){const r=this.getExpressionData();if(!r)return"";const i=r.find(s=>s.target===t);if(!i)return"";const a=i.rules.find(s=>s.type===o);return a||""}getContextFormVariables(){const{module:t}=this.formSchemaService.getFormSchema();if(!t.viewmodels||t.viewmodels.length===0)return[];const o=this.formSchemaService.getRootViewModelId(),r=this.formSchemaService.getViewModelById(o);if(!r||!r.states||r.states.length===0)return[];const i=[];return r.states.filter(a=>a.category==="remote").forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(t,o,r="label"){return{id:t.id,name:t.name,bindingPath:t[r],parents:o,type:"field"}}buildEntityFieldsTreeData(t=null,o){const r=[];return t==null||t.forEach(i=>{var u;const a=this.createTreeNode(i,o);let s=[];(u=i.type)!=null&&u.fields&&(s=this.buildEntityFieldsTreeData(i.type.fields,[...o,i.label])),r.push({data:a,children:s,expanded:!0})}),r}buildChildEntityTreeData(t=null,o){const r=[];return t==null||t.forEach(i=>{var l,d;const a=this.createTreeNode(i,o);a.type="entity";const s=this.buildEntityFieldsTreeData((l=i.type)==null?void 0:l.fields,[...o,i.label]),u=this.buildChildEntityTreeData((d=i.type)==null?void 0:d.entities,[...o,i.label]);u!=null&&u.length&&(s==null||s.push(...u)),r.push({data:a,children:s||[],expanded:!0})}),r}getEntitiesTreeData(){const t=this.formSchemaService.getSchemaEntities();if(!(t!=null&&t.length))return[];const o=t[0];if(!(o!=null&&o.type))return[];const r=this.buildEntityFieldsTreeData(o.type.fields,[o.code]),i=this.buildChildEntityTreeData(o.type.entities,[o.code]);return i!=null&&i.length&&(r==null||r.push(...i)),{entityCode:o.code,fields:[{data:this.createTreeNode(o,[],"code"),children:r||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(t,o,r){const i=r==="Field"?t.binding.field:t.id,a=this.getExpressionRule(i,o),s=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(o)&&a?a.message:"",...s};return a.messageType!=null&&(u.messageType=a.messageType),u}buildRule(t,o,r,i){const{expression:a,message:s,messageType:u}=o,l={id:`${t}_${r}`,type:r,value:a};return(r==="validate"||r==="dataPicking"||r==="required")&&(l.message=s),r==="dataPicking"&&(l.messageType=u),r==="validate"&&i&&(l.elementId=i),l}getExpressionData(){const{expressions:t}=this.formSchemaService.getFormSchema().module;return t||[]}updateExpression(t,o,r,i){const a=o==="Field"?t.binding.field:t.id,s=this.buildRule(a,r,i,t.type==="form-group"?t.id:"");let l=this.getExpressionData().find(m=>m.targetType===o&&m.target===a);const d=m=>m.value.trim()==="";if(l){const m=l.rules.find(p=>p.id===s.id);if(m)d(s)?l.rules=l.rules.filter(p=>p.id!==s.id):(Object.assign(m,s),i==="validate"&&t.type==="form-group"&&(m.elementId=t.id));else{if(d(s))return null;l.rules=l.rules||[],l.rules.push(s)}}else{if(d(s))return null;l={target:`${a}`,rules:[s],targetType:o}}return l}getExpressionEditorOptions(t,o,r,i){return r.reduce((a,s)=>{var l,d;const u=o==="Field"?(l=t==null?void 0:t.binding)==null?void 0:l.field:t.id;return a[s]={hide:o==="Field"?!!((d=t==null?void 0:t.binding)!=null&&d.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(u),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(t,s,o),onSubmitModal:m=>{const p=this.updateExpression(t,o,m,s);if(i){const C=this.buildRule(u,m,s);i(C)}return p}}},a},{})}getExpressionInfo(t,o,r){const i=o==="Field"?t.binding.field:t.id,a=this.getExpressionRule(i,r),s={value:a&&a.value,targetId:i,targetType:o,expressionType:r};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(t,o,r=["compute","dependency","validate"],i){var a;return{description:"表达式",title:"表达式",hide:!(t.binding&&((a=t.binding)==null?void 0:a.type)==="Form"),properties:{...this.getExpressionEditorOptions(t,o,r,i)}}}getExpressionOptions(t,o,r){const i=this.getExpressionInfo(t,o,r);return{dialogTitle:`${this.expressionNames[r]||"表达式"}编辑器`,singleExpand:!1,showMessage:r==="required",beforeOpen:()=>this.onBeforeOpenExpression(t,r,o),expressionInfo:i}}}function Mr(e){const{formSchemaUtils:t,formStateMachineUtils:o}=e;function r(l,d=""){return{path:d+l.code,field:l.id,fullPath:l.code}}function i(l,d=""){const m=t.getViewModelById(l);return m?m.states.map(p=>r(p,d)):[]}function a(l){const d=t.getRootViewModelId(),m=i(l);if(l===d)return m;const p=i(d,"root-component.");return[...m,...p]}function s(l){return l.binding&&l.binding.path||l.id||""}function u(){return o&&o.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:u}}function jr(e,t,o,r){const{getVariables:i,getControlName:a,getStateMachines:s}=Mr(e);return(u,l=[],d={},m={},p)=>{const C=l&&l.length>0?l:["Const","Variable","StateMachine","Expression"],c={type:"property-editor",propertyTypes:C};return C.forEach(f=>{switch(f){case"Const":Object.assign(c,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},d);break;case"Expression":break;case"StateMachine":c.stateMachines=s();break;case"Variable":Object.assign(c,{controlName:a(u),newVariablePrefix:"is",newVariableType:"Boolean",variables:i(t),parentComponentId:o==="root-component"?"":"root-component",onBeforeOpenVariables:S=>{S.value=i(t)}},m),(r==null?void 0:r.designerMode)==="PC_RTC"&&(c.newVariablePrefix="ext_"+c.newVariablePrefix);break}}),c}}class Dr{constructor(t,o){we(this,"componentId");we(this,"viewModelId");we(this,"eventsEditorUtils");we(this,"formSchemaUtils");we(this,"formMetadataConverter");we(this,"designViewModelUtils");we(this,"designViewModelField");we(this,"controlCreatorUtils");we(this,"designerHostService");we(this,"designerContext");we(this,"modalService",null);we(this,"formRule",null);we(this,"schemaService",null);we(this,"metadataService",null);we(this,"propertyConfig",{type:"object",categories:{}});we(this,"expressionProperty");var r;this.componentId=t,this.designerHostService=o,this.eventsEditorUtils=o.eventsEditorUtils,this.formSchemaUtils=o.formSchemaUtils,this.formMetadataConverter=o.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=o.designViewModelUtils,this.controlCreatorUtils=o.controlCreatorUtils,this.metadataService=o.metadataService,this.schemaService=o.schemaService,this.designerContext=o.designerContext,this.modalService=o.modalService,this.expressionProperty=new Er(this.formSchemaUtils)}inResponsiveForm(){var t;return!!((t=this.designerContext)!=null&&t.responsiveForm)}getFormDesignerInstance(){var t,o;return(o=(t=this.designerContext)==null?void 0:t.instances)==null?void 0:o.formDesigner.value}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var r;const o=t.binding&&t.binding.type==="Form"&&t.binding.field;if(o){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===o)}t.updateOn=(r=this.designViewModelField)==null?void 0:r.updateOn}}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:t.type,name:pt.DgControl[t.type]&&pt.DgControl[t.type].name}]}}}}}getAppearanceConfig(t=null,o={},r){const i={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const s in o)a[s]=Object.assign(a[s]||{},o[s]);return{...i,properties:{...a},setPropertyRelates(s,u){if(s){switch(s&&s.propertyID){case"class":case"style":{pt.canvasChanged.value++;break}}r&&r(s,t,u)}}}}getPropertyEditorParams(t,o=[],r="visible",i={},a={},s=""){const l=jr(this.designerHostService,this.viewModelId,this.componentId,this.designerContext)(t,o,i,a,s||r);if((l.propertyTypes||[]).indexOf("Expression")>-1){const m=this.getRealTargetType(t);l.expressionConfig=this.getExpressionOptions(t,m,s||r)}return l}getVisibleProperty(t,o=""){var a;let r=["Const","Variable","StateMachine","Expression"];return o==="gridFieldEditor"?r=["Const","Expression"]:o==="form-group"&&!((a=t.binding)!=null&&a.field)?r=["Const","Variable","StateMachine","Custom"]:o==="dataGrid"||o==="treeGrid"||o==="wizard"?r=["Const","Variable","Expression"]:(t.type.indexOf("toolbar-item")>-1||o==="form-group")&&(r=["Const","Variable","StateMachine","Custom","Expression"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(t,r,"visible")}}}getBehaviorConfig(t,o="",r={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(t,o);for(const l in r)s[l]=Object.assign(s[l]||{},r[l]);const u=this;return{...a,properties:{...s},setPropertyRelates(l,d){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(t,l);break}i&&i(l,d)}}}}afterMutilEditorChanged(t,o){this.addNewVariableToViewModel(o,this.viewModelId),this.updateExpressionValue(o,t),this.clearExpression(o,t)}updateElementByParentContainer(t,o){const r=o&&o.parent&&o.parent.schema;if(!r)return;const i=r.contents.findIndex(s=>s.id===t),a=Se.cloneDeep(r.contents[i]);r.contents.splice(i,1),r.contents.splice(i,0,a),pt.refreshCanvas()}addNewVariableToViewModel(t,o){const r=t.propertyValue;if(!(r&&typeof r=="object")||!(r.type==="Variable"&&r.isNewVariable))return;const s={id:r.field,category:"locale",code:r.fullPath,name:r.fullPath,type:r.newVariableType||"String",isRtcVariable:this.designerContext.designerMode==="PC_RTC"?!0:void 0};delete r.newVariableType,delete r.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(s)}getExpressions(){let t=[];return this.formRule?(this.formRule.expressions=this.formRule.expressions||[],t=this.formRule.expressions||[]):t=this.formSchemaUtils.getExpressions(),t}updateExpressionValue(t,o){const r=t.propertyValue;if(!((r&&r.type)==="Expression"&&r.expressionInfo))return;const{expressionId:s,expressionInfo:u}=r,{targetId:l,targetType:d,expressionType:m,value:p,message:C}=u,c=this.getExpressions();let f=c.find(E=>E.target===l);f||(f={target:l,rules:[],targetType:d},c.push(f));const S=f.rules.find(E=>E.type===m);if(S)S.id=s,S.value=p,S.message=C,(m==="minDate"||m==="maxDate"||m==="defaultTime")&&(S.elementId=o.id);else{const E={id:s,type:m,value:p,message:C,elementId:o.id};f.rules.push(E)}delete r.expressionInfo}clearExpression(t,o){const r=t.propertyValue;if(r&&r.type==="Expression")return;const a=t.propertyID,s=this.getExpressions(),u=o.binding?o.binding.field:o.id,l=s.find(d=>d.target===u);!l||!l.rules||(l.rules=l.rules.filter(d=>d.type!==a))}getExpressionOptions(t,o,r){return this.expressionProperty.getExpressionOptions(t,o,r)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item","drawer-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}createBaseEventProperty(t){const o={};return o[this.viewModelId]={type:"events-editor",editor:{initialData:t,viewSourceHandle:r=>{var i;((i=r.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(r)}}},o}}class kr extends Dr{constructor(t,o){super(t,o)}getPropertyConfig(t){const o=this;this.getBasicPropConfig(t),this.getAppearanceProperties(t);const r=this.getPropertyEditorParams(t,["Variable"]);return this.propertyConfig.categories.behavior=this.getBehaviorConfig(t,"step",{activeIndex:{title:"当前步骤变量",type:"array",description:"当前步骤变量",editor:r},stepTemplate:{description:"步骤条模板",title:"步骤条模板",type:"string",editor:{type:"code-editor",language:"html"}},stepDataSourceType:{title:"数据源类型",type:"enum",description:"数据源类型",editor:{data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},steps:{title:"步骤条",type:"array",description:"步骤条信息",visible:!t.stepDataSourceType||t.stepDataSourceType==="static",editor:{columns:[{field:"id",title:"值",dataType:"string"},{field:"title",title:"名称",dataType:"string"}],type:"item-collection-editor",valueField:"id",nameField:"title",requiredFields:["id","title"],uniqueFields:["id","title"]},refreshPanelAfterChanged:!0},stepsMessage:{title:"数据源",type:"array",description:"数据源",visible:t.stepDataSourceType==="dynamic",editor:r}},(i,a)=>{switch(i.propertyValue,i.propertyID){case"stepsMessage":case"activeIndex":{o.afterMutilEditorChanged(t,i);break}}}),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){const o=super.getBasicPropConfig(t);this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{...o.properties}}}assembleSchemaEntityToTree(t,o,r,i="",a=[]){const s=i?`${i}/${t.label}`:"/";return a.push({id:t.id,name:t.name,label:t.label,layer:o,parent:r&&r.id,bindTo:s.replace("//","/")}),t.type.entities&&t.type.entities.length&&t.type.entities.map(u=>this.assembleSchemaEntityToTree(u,o+1,t,s,a)),a}getAppearanceProperties(t){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{title:"class样式",type:"string",description:"组件的class样式"},fill:{title:"是否填充",type:"boolean",description:"是否填充"},direction:{title:"排列方式",type:"enum",description:"排列方式",editor:{data:[{id:"vertical",name:"垂直"},{id:"horizontal",name:"水平"}]}}}}}getEventPropConfig(t){var s;const o=[{label:"onClick",name:"点击事件"},{label:"beforeClickStep",name:"步骤点击前事件"}];(s=t.pagination)==null||s.enable;const r=this,i=r.eventsEditorUtils.formProperties(t,r.viewModelId,o),a=r.createBaseEventProperty(i);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:De.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(u,l){const d=u.propertyValue;delete t[r.viewModelId],d&&(d.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(t,r.viewModelId,d.events,d))}}}}function Br(e,t){const o=e.schema;function r(){return""}function i(m){return!1}function a(){return!0}function s(){return!0}function u(){return!0}function l(m){return new kr(m,t).getPropertyConfig(o)}function d(){var m,p,C,c;if(e&&t){const f=(m=e==null?void 0:e.componentInstance)==null?void 0:m.value.belongedComponentId;let S="",E="";const{formSchemaUtils:b}=t;if(f){const w=b.getRootViewModelId(),O=b.getComponentByViewModelId(w),V=b.selectNode(O,y=>y.contents&&y.contents.find(h=>h.component===f));(V==null?void 0:V.type)===((p=Fe["tab-page"])==null?void 0:p.type)&&((C=V==null?void 0:V.contents)!=null&&C.length)&&(S=V.title||""),(V==null?void 0:V.type)===((c=Fe.section)==null?void 0:c.type)&&(V==null?void 0:V.showHeader)!==!1&&(S=V.mainTitle||""),S=S?`${S} > `:"",E=S?V.id:""}const g=Fe["list-view"].name;t==null||t.formSchemaUtils.getControlBasicInfoMap().set(e.schema.id,{componentTitle:g,parentPathName:`${S}${g}`,reliedComponentId:E})}}return{canAccepts:i,checkCanDeleteComponent:a,checkCanMoveComponent:s,hideNestedPaddingInDesginerView:u,getPropsConfig:l,setComponentBasicInfoMap:d,getDesignerClass:r}}const Ir=n.defineComponent({name:"FStepDesign",props:$t,emits:[],setup(e,t){const o=n.ref(0),r=n.ref(0),i=n.ref(),a=n.inject("designer-host-service"),s=n.inject("design-item-context"),u=Br(s,a),l=pt.useDesignerComponent(i,s,u),d=[{id:"firstStep",title:"步骤一",description:"步骤一"},{id:"secondStep",title:"步骤二",description:"步骤二"}];n.onMounted(()=>{i.value.componentInstance=l}),t.expose(l.value);const m=n.computed(()=>({"f-progress-step-list":e.direction==="horizontal","f-progress-step-list-block":e.direction==="vertical","f-progress-step-horizontal-fill":e.direction==="horizontal"&&e.fill,"f-progress-step-vertical-fill":e.direction==="vertical"&&e.fill})),p=n.computed(()=>({overflow:"auto"}));function C(h,v){const x={step:!0,active:v===o.value,clickable:e.clickable,"click-disable":h.disabled,current:v===o.value};return v<o.value&&(x.finish=!0),h.status&&(x[h.status]=!0),h.hasOwnProperty("class")&&h.class.split(" ").reduce((F,M)=>(F[M]=!0,F),x),x}function c(h,v){}function f(h,v){const x={"f-progressstep-row":!0,"step-active":v===o.value,"step-current":v===o.value};return v<o.value&&(x["step-finish"]=!0),h.status&&(x["step-"+h.status]=!0),x}function S(h,v){const x={"step-icon":!0,"step-success":v,"k-icon":v,"k-i-check":v};return h.hasOwnProperty("icon")&&h.class.split(" ").reduce((F,M)=>(F[M]=!0,F),x),x}function E(h,v){const x=[];return h.icon?x.push(n.createVNode("span",{class:S(h,!1)},null)):v>=o.value||v===r.value?x.push(n.createVNode("span",{class:"step-icon"},[v+1])):x.push(n.createVNode("span",{class:S(h,!0)},null)),x}function b(h,v){return{"step-name":!0,"step-name-success":v<o.value}}function g(h,v){return n.createVNode("div",{class:"f-progress-step-title"},[n.createVNode("p",{class:b(h,v)},[h.title])])}function w(h,v){return{"f-progress-step-line":!0,"f-progress-step-line-success":v===o.value}}function O(h,v){return v!==e.steps.length-1}const V=n.computed(()=>({triangle:!0}));function y(){return e.steps&&e.steps.length>0?e.steps.map((h,v)=>n.createVNode("li",{class:C(h,v),onClick:x=>void 0},[n.createVNode("div",{class:f(h,v)},[n.createVNode("div",{class:"f-progress-step-content"},[E(h,v),g(h,v)]),O(h,v)&&n.createVNode("div",{class:w(h,v)},[n.createVNode("span",{class:V.value},null)])])])):d.map((h,v)=>n.createVNode("li",{class:C(h,v),onClick:x=>void 0},[n.createVNode("div",{class:f(h,v)},[n.createVNode("div",{class:"f-progress-step-content"},[E(h,v),g(h,v)]),O(h,v)&&v!==d.length-1&&n.createVNode("div",{class:w(h,v)},[n.createVNode("span",{class:V.value},null)])])]))}return()=>n.createVNode("div",{ref:i,class:"f-progress-step"},[n.createVNode("ul",{class:m.value,style:p.value},[y()])])}});function Pr(){function e(t,o){const r={};return r.beforeClickStep=i=>o.call("beforeClickStep",t,[i,t]),r}return{resolve:e}}const Or=Pr();rt.install=e=>{e.component(rt.name,rt)},rt.register=(e,t,o,r)=>{e.step=rt,t.step=ho,r.step={callbackResolver:Or}},rt.registerDesigner=(e,t,o)=>{e.step=Ir,t.step=ho};const Lr="root-viewmodel";class Ar{constructor(t,o){we(this,"formSchemaUtils");we(this,"controlCreatorUtils");we(this,"designViewModelUtils");this.resolver=t,this.designerHostService=o,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(t){const o=this.createComponentRefNode(t),r=this.createComponentNode(t),i=this.createViewModeNode(t),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(i),a.module.components.push(r),this.designViewModelUtils.assembleDesignViewModel(),o}createComponentRefNode(t){const o=this.resolver.getSchemaByType("component-ref");return Object.assign(o,{id:`${t.componentId}-component-ref`,component:`${t.componentId}-component`}),o}createComponentNode(t){const o=this.resolver.getSchemaByType("component"),r=this.createFormComponentContents(t);return Object.assign(o,{id:`${t.componentId}-component`,viewModel:`${t.componentId}-component-viewmodel`,componentType:t.componentType,appearance:{class:this.getFormComponentClass(t)},formColumns:t.formColumns,contents:r}),o}getFormComponentClass(t){var r,i;const{templateId:o}=this.formSchemaUtils.getFormSchema().module;if(o==="double-list-in-tab-template"&&((i=(r=t.parentComponentInstance)==null?void 0:r.schema)==null?void 0:i.type)==="tab-page"){const a=t.parentComponentInstance.parent&&t.parentComponentInstance.parent.schema;if((a==null?void 0:a.type)==="tabs"&&(a==null?void 0:a.fill)===!0)return"f-struct-wrapper f-utils-fill-flex-column"}return"f-struct-wrapper"}createFormComponentContents(t){var u,l;const o=this.resolver.getSchemaByType("section");Object.assign(o,{id:t.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:t.componentName});const r=this.resolver.getSchemaByType("response-form"),i=[];Object.assign(r,{id:t.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:i,controlsInline:!0}),o.contents=[r];const{selectedFields:a}=t;a==null||a.forEach(d=>{if(d.$type===De.FormSchemaEntityField$Type.SimpleField){const m=Se.cloneDeep(d),p=this.resolveControlClassByFormColumns(t),C=this.controlCreatorUtils.setFormFieldProperty(m,"",p);C&&i.push(C)}});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;if(s==="double-list-in-tab-template"&&((l=(u=t.parentComponentInstance)==null?void 0:u.schema)==null?void 0:l.type)==="tab-page"){const d=t.parentComponentInstance.parent&&t.parentComponentInstance.parent.schema;(d==null?void 0:d.type)==="tabs"&&(d==null?void 0:d.fill)===!0&&(o.appearance.class="f-section-grid f-section-in-main px-0 pt-0",o.fill=!0)}return[o]}resolveControlClassByFormColumns(t){let o="";switch(t.formColumns){case 1:{o="col-12 col-md-12 col-xl-12 col-el-12";break}case 2:{o="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{o="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{o="col-12 col-md-6 col-xl-3 col-el-2";break}}return o}createViewModeNode(t){return{id:`${t.componentId}-component-viewmodel`,code:`${t.componentId}-component-viewmodel`,name:t.componentName,bindTo:t.bindTo,parent:Lr,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const o=[],{selectedFields:r}=t;return r==null||r.forEach(i=>{if(i.$type===De.FormSchemaEntityField$Type.SimpleField){let a="blur";const s=i.type.name;(s===De.FormSchemaEntityFieldTypeName.Enum||s===De.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),o.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}}),o}}function vo(e,t,o,r){var a,s,u,l,d,m;const i=o.parentComponentInstance;if(i&&r){const p=(a=i.schema)==null?void 0:a.type,c={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=o.bindingSourceContext)==null?void 0:s.entityTitle)||((l=(u=o.bindingSourceContext)==null?void 0:u.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:p==="splitter-pane"?1:4,parentContainerId:i.schema.id,parentComponentInstance:i,bindTo:((d=o.bindingSourceContext)==null?void 0:d.bindTo)||"/",selectedFields:(m=o.bindingSourceContext)==null?void 0:m.bindingEntityFields};return new Ar(e,r).createComponent(c)}else return t}const qr={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"}},required:["id","type","contents"]},yo=new Map([["appearance",je.resolveAppearance]]),Rr={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dynamic-form.schema.json",title:"dynamic-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"dynamic-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"},headerTitleRenderFunction:{description:"",type:"function",default:null},headerContentRenderFunction:{description:"",type:"function",default:null},footerRenderFunction:{description:"",type:"function",default:null},mode:{description:"",type:"string",default:"quick"},footerStyle:{description:"",type:"string",default:""},headerStyle:{description:"",type:"string",default:""},toolbar:{description:"",type:"array",default:[]},moreButtonClass:{description:"",type:"string",default:"btn-link"},onClick:{description:"",type:"string",default:""},onChange:{description:"",type:"string"},callback:{description:"",type:"string"}},required:["id","type","contents"],events:{onClick:"点击事件",onChange:"ֵ值变化事件",event:"内部控件事件",callback:"内部控件属性回调事件"}};var ht=(e=>(e.Header="header",e.Footer="footer",e))(ht||{}),Mt=(e=>(e.QUICK="quick",e.FULL="full",e))(Mt||{});const jt={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0},fields:{type:Array,default:[]},formData:{type:Object,default:null},layout:{type:String,default:"col-12 col-md-6 col-xl-3 col-el-2"}},_r=Object.assign({},jt,{canRenderForm:{type:Boolean,default:!0},callback:{type:Function},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!1},headerTitleRenderFunction:{type:Function},headerContentRenderFunction:{type:Function},footerRenderFunction:{type:Function},showFooter:{type:Boolean,default:!1},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},enableAccordion:{type:Boolean,default:!0},mode:{type:String,default:Mt.QUICK},toolbar:{type:[Array,Function],default:[]},headerStyle:{type:[String,Function],default:""},footerStyle:{type:[String,Function],default:""},moreButtonClass:{type:String,default:"btn-link"}});je.createPropsResolver(jt,qr,yo,vo),je.createPropsResolver(jt,Rr,yo,vo);function Ur(e,t){function o(s){return e.value&&e.value[s]}const r=[];function i(s){r.push(s)}function a(s,u,l){const d=e.value?e.value[s]:void 0;e.value&&(e.value[s]=l),u&&(t&&(t.emit("update:modelValue",{elementId:s,field:u,value:l,modelValue:e.value}),t.emit("change",{elementId:s,field:u,value:l,modelValue:e.value})),r.forEach(m=>{m({elementId:s,field:u,value:l,oldValue:d,modelValue:e.value})}))}return{getValue:o,setValue:a,onValueChange:i}}const Dt=n.defineComponent({name:"FDynamicForm",props:_r,emits:["update:modelValue","change","event","click"],setup(e,t){const o=n.ref(e.fields),r=new Map,i=n.ref(e.callback);Je.loadRegister();const a=Je.useComponentManager(),s=n.ref(e.formData||{}),u=Ur(s,t);Je.useEntityState(o.value).setup();const d=new Map,m=n.ref(e.canRenderForm);let p=[],C=[],c=[];const f=e.mode===Mt.FULL?"contents":"fields",{mergeArray:S,resolveCallbacks:E,resolveEvents:b}=Je.useDynamicViewUtils(),g=n.computed(()=>{const T=Ue.LocaleService.getLocale(),ie=e.fields&&e.fields.length>0;let ae={"f-form-layout":ie,"farris-form":ie,"f-dynamic-form":!(e.showHeader||e.showFooter)};return ae=De.getCustomClass(ae,e.customClass),e.adaptForLanguage&&T&&(ae["farris-form-controls-inline"]=T!=="en"),ae});function w(){function T(ie,ae){const{id:le}=ie||{},{field:ye}=ie.binding||{};return{modelValue:ae.getValue(le),"onUpdate:modelValue":ke=>{ae.setValue(le,ye||le,ke)}}}return{resolve:T}}function O(T){const ie=w();return u.getValue(T.id)===void 0&&Object.hasOwnProperty.call(T,"modelValue")&&u.setValue(T.id,void 0,T.modelValue),ie.resolve(T,u)}function V(T){const ie={};return T&&Object.entries(T).forEach(([ae,le])=>{ie[ae]=()=>Array.isArray(le)?le.map(ye=>F(ye)):F(le)}),ie}function y(T){return T.type?T.type:T[f]?"fieldset":"form-group"}function h(T){const ie=y(T),ae=T.customClass||"";return ae||(ie==="fieldset"?"col-12 px-0":p.length===0&&C.length===0||T.id&&c.find(le=>le[f]?le[f].find(ye=>ye.id===T.id):le.id===T.id)?e.layout:"unset-item")}function v(T){const ie=y(T);let ae={},le="",ye={},ke={};if(e.mode===Mt.FULL){ye={...b(T,t,ie)},ke={...E(T,i,ie)};const Te=Je.componentPropsConverter[ie];ae=Te?Te(T):{},le=h(ae)}else{le=h(T);const{fields:Te,customClass:Pe,...Oe}=T;ae=Oe}return{props:{...{...ae,customClass:le,...O(T)},key:T.id,ref:Te=>{if(Te&&T.id&&!a.has(T.id)){a.register(T.id,Te);const Pe={token:T.id,name:"component:ready",type:y(T),payloads:[n.ref(Te)],schema:T};t.emit("event",Pe)}},onVnodeUnmounted:Te=>{if(T.id&&a.has(T.id)){a.remove(T.id);const Pe={token:T.id,name:"component:unmounted",type:y(T),payloads:[Te],schema:T};t.emit("event",Pe)}}},eventProps:ye,callbackProps:ke}}function x(T,ie){return Array.isArray(T)?T.map(ae=>ie(ae)):ie(T)}function F(T,ie){var Le;const ae=y(T),le=Je.componentMap[ae];if(T.id&&r.set(T.id,T),!le)return null;const ye=()=>T[f]?T[f].map(Te=>F(Te)):null,ke=(Te,Pe,Oe)=>{let Be;return Oe&&Oe.length>0?Be=n.createVNode(Te,{...Pe},Oe):Be=n.createVNode(Te,{...Pe},null),Be},qe=((Le=d.get(T.id))==null?void 0:Le.props)||{};return T[f]&&T[f].length>0?ke(le,qe,[ye()]):T.slots?ke(le,qe,[...Object.values(V(T.slots))]):ke(le,qe)}function M(T){const ie=y(T);if(!Je.componentMap[ie])return;const{props:le,eventProps:ye,callbackProps:ke}=v(T),qe=Je.resolverMap[ie],Le=qe?qe.editorResolver:null,{componentEventProps:Te,editorEventProps:Pe}=ye,{componentCallbackProps:Oe,editorCallbackProps:Be}=ke;if(Te&&Object.keys(Te).length>0&&Object.assign(le,Te),Oe&&Object.keys(Oe).length>0&&Object.assign(le,Oe),Le&&Pe&&Object.keys(Pe).length>0){const Ee=Le.resolve(T);Object.assign(Ee,Pe)}if(Le&&Be&&Object.keys(Be).length>0){const Ee=Le.resolve(T);Object.assign(Ee,Be)}if(le&&Object.keys(le).length>0){const Ee=d.get(T.id);Ee?Se.merge(Ee==null?void 0:Ee.props,le):d.set(T.id,n.reactive({props:le}))}!T[f]||!Array.isArray(T[f])||T[f].forEach(Ee=>M(Ee))}function $(T){const ie=y(T);Je.componentMap[ie]&&(R(T),!(!T[f]||!Array.isArray(T[f]))&&T[f].forEach(le=>$(le)))}function R(T){const ie=O(T);if(ie&&Object.keys(ie).length>0){const ae=d.get(T.id);if(!ae)d.set(T.id,n.reactive({props:ie}));else{const le={...ae==null?void 0:ae.props};Object.keys(ie).forEach(ye=>{le[ye]=ie[ye]}),Object.assign(ae==null?void 0:ae.props,le)}}}n.onMounted(()=>{}),n.watch(()=>e.formData,T=>{s.value=T}),n.watch(()=>s.value,T=>{x(o.value,$)},{deep:!0});function j(T,ie=""){return ie?T.filter(ae=>ae.position===ie):T.filter(ae=>!ae.position||[ht.Header,ht.Footer].indexOf(ae.position)<0)}function _(T){T&&(p=j(T,ht.Header),p.length&&x(p,M),C=j(T,ht.Footer),C.length&&x(C,M),c=j(T),c.length&&x(c,M))}n.watch(()=>e.fields,T=>{r.clear(),a.clear(),s.value=e.formData||{},d.clear(),o.value=T,_(T)}),_(e.fields);function I(T){T.$forceUpdate&&T.$forceUpdate()}function q(T){return u.getValue(T)}function D(){return s.value}function U(T,ie){u.setValue(T,void 0,ie);const ae=r.get(T);ae&&R(ae)}function ne(T){var ie;return(ie=d.get(T))==null?void 0:ie.props}function N(T,ie){const ae=d.get(T);Se.mergeWith(ae==null?void 0:ae.props,ie,S)}t.expose({componentManager:a,rerender:I,getProps:ne,setProps:N,getControlValue:q,setControlValue:U,getValues:D});function P(T=[]){return T.length>0&&x(T,F)}function oe(T){return n.withDirectives(n.createVNode("div",{class:g.value,style:e.customStyle},[t.slots.default&&t.slots.default(),T.length>0&&x(T,F)]),[[n.resolveDirective("area-response")]])}function re(){const T={};let ie="f-dynamic-form-section--header-content",ae="f-dynamic-form-section--footer";return e.showHeader&&(t.slots.headerTitle&&(T.headerTitle=()=>{var le,ye;return(ye=(le=t.slots).headerTitle)==null?void 0:ye.call(le)}),ie+=e.headerContentRenderFunction||t.slots.headerContent?" f-dynamic-form-section--header-cotnent-tmpl":"",t.slots.headerContent?T.headerContent=()=>{var le,ye;return(ye=(le=t.slots).headerContent)==null?void 0:ye.call(le)}:!e.headerContentRenderFunction&&p.length>0&&(T.headerContent=()=>n.withDirectives(n.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline f-dynamic-form-section--fields"},[P(p)]),[[n.resolveDirective("area-response")]]))),e.showFooter&&(ae+=e.footerRenderFunction||t.slots.footer?" f-dynamic-form-section--footer-tmpl":0,t.slots.footer?T.footer=()=>{var le,ye;return(ye=(le=t.slots).footer)==null?void 0:ye.call(le)}:!e.footerRenderFunction&&C.length>0&&(ae+=C.length>0?" f-form-layout farris-form farris-form-controls-inline f-dynamic-form-section--fields":"",T.footer=()=>P(C))),{slots:T,footerClass:ae,headerContentClass:ie}}const Z=n.computed(()=>typeof e.toolbar=="function"?e.toolbar():e.toolbar),he=n.computed(()=>e.headerStyle?typeof e.headerStyle=="function"?e.headerStyle():e.headerStyle:""),xe=n.computed(()=>e.footerStyle?typeof e.footerStyle=="function"?e.footerStyle():e.footerStyle:"");function fe(T,ie){t.emit("click",T,ie)}function ee(){const{slots:T,footerClass:ie,headerContentClass:ae}=re();return n.createVNode(Ao,{customClass:"f-dynamic-form-section",showHeader:e.showHeader,mainTitle:e.mainTitle,enableAccordion:e.enableAccordion?"default":"",headerContentClass:ae,footerClass:ie,buttons:Z.value,headerStyle:he.value,footerStyle:xe.value,headerTitleRenderFunction:e.showHeader&&e.headerTitleRenderFunction?()=>e.headerTitleRenderFunction():null,headerContentRenderFunction:e.showHeader&&e.headerContentRenderFunction?()=>e.headerContentRenderFunction():null,footerRenderFunction:e.showFooter&&e.footerRenderFunction?()=>e.footerRenderFunction():null,buttonsClass:"col-auto",onClick:fe,moreButtonClass:e.moreButtonClass},{default:()=>oe(c),...T})}return()=>e.visible?e.showHeader||e.showFooter?ee():m.value&&oe(o.value)||!m.value&&P(o.value):null}}),Co=n.defineComponent({name:"FResponseForm",props:jt,emits:[],setup(e,t){var p;const o=n.ref(),r=n.ref(),i=n.computed(()=>{const C=Ue.LocaleService.getLocale(),c=e.fields&&e.fields.length>0;let f={"drag-container":!0,"f-form-layout":c,"farris-form":c};return f=De.getCustomClass(f,e.customClass),e.adaptForLanguage&&C&&(f["farris-form-controls-inline"]=C!=="en"),f}),a=(p=r.value)==null?void 0:p.componentManager;function s(C){r.value.render(C)}function u(C){return r.value.getControlValue(C)}function l(C,c){r.value.setControlValue(C,c)}function d(C){return r.value.getProps(C)}function m(C,c){r.value.setProps(C,c)}return t.expose({componentManager:a,rerender:s,getProps:d,setProps:m,getControlValue:u,setControlValue:l}),()=>e.visible&&n.withDirectives(n.createVNode("div",{ref:o,class:i.value,style:e.customStyle},[t.slots.default&&t.slots.default(),e.fields&&e.fields.length>0&&n.createVNode(Dt,{ref:r,fields:e.fields,canRenderForm:!1,formData:e.formData,layout:e.layout},null)]),[[n.resolveDirective("area-response")]])}}),$r={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number],default:null},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},showLabelType:{type:String,default:"visible"},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null},fill:{type:Boolean,default:!1},enableTips:{type:Boolean,default:!1},tipsContent:{type:[Object,String],default:""},linkLabel:{type:String,default:!1}},zr={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""},showType:{type:String,default:"visible"},isLink:{type:Boolean,default:!1}},Hr=n.defineComponent({name:"FDynamicFormLabel",props:zr,emits:["clickLabel"],setup(e,t){n.ref(e.title||e.text);const o=n.ref(e.required),r=n.ref(e.text),i=n.ref(e.valid),a=n.ref(e.inValidTip);n.watch(()=>e.text,()=>{r.value=e.text}),n.watch(()=>e.required,(C,c)=>{C!==c&&(o.value=C)}),n.watch([()=>e.valid,()=>e.inValidTip],([C,c])=>{i.value=C,a.value=c});const s=n.computed(()=>i.value?r.value:a.value),u=n.computed(()=>i.value?"":"color:red"),l=n.computed(()=>({"col-form-label":!0,"f-width-auto":o.value&&(e.showType==="none"||!r.value)})),d=n.computed(()=>e.showType==="force-none"?!1:e.showType==="reserve-space"||o.value||e.showType!=="none"),m=()=>{e.showType!=="reserve-space"&&t.emit("clickLabel")},p=n.computed(()=>({"farris-label-text":!0,"f-pretend-link":!!e.isLink&&e.showType!=="reserve-space"}));return()=>d.value&&n.createVNode("label",{class:l.value,title:s.value,style:u.value},[!i.value&&n.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:a.value},null),n.createVNode("span",{class:p.value,onClick:m},[o.value&&n.createVNode("span",{class:"farris-label-info text-danger"},[n.createTextVNode("*")]),e.showType==="visible"&&r.value])])}}),{globalStorageKey:Wr}=De.useThirdComponent(),z={},H={},W={},Y={};async function Gr(){{const e={schemaMap:je.schemaMap,propertyConfigSchemaMap:je.propertyConfigSchemaMap,propertyEffectMap:je.propertyEffectMap,schemaResolverMap:je.schemaResolverMap};Jt.register(z,H,W,Y),Qt.register(z,H,W,Y),Zt.register(z,H,W,Y,e),en.register(z,H,W,Y),tn.register(z,H,W,Y),ct.register(z,H,W,Y),nn.register(z,H,W,Y,e),on.register(z,H,W,Y),At.register(z,H,W,Y,e),Nt.register(z,H,W,Y,e),At.register(z,H,W,Y,e),Nt.register(z,H,W,Y,e),rn.register(z,H,W,Y,e),qo.register(z,H,W,Y,e),an.register(z,H,W,Y),ln.register(z,H,W,Y,e),cn.register(z,H,W,Y,e),sn.register(z,H,W,Y,e),un.register(z,H,W,Y,e),dn.register(z,H,W,Y,e),fn.register(z,H,W,Y),mn.register(z,H,W,Y,e),Ro.register(z,H,W,Y),Xo.register(z,H,W,Y),pn.register(z,H,W,Y,e),_o.register(z,H,W,Y),Ho.register(z,H,W,Y),hn.register(z,H,W,Y,e),vn.register(z,H,W,Y,e),yn.register(z,H,W,Y,e),bn.register(z,H,W,Y,e),Cn.register(z,H,W,Y),wn.register(z,H,W,Y,e),Uo.register(z,H,W,Y),Sn.register(z,H,W,Y,e),xn.register(z,H,W,Y,e),Tn.register(z,H,W,Y,e),Nn.register(z,H,W,Y),Vn.register(z,H,W,Y,e),Fn.register(z,H,W,Y),En.register(z,H,W,Y,e),Mn.register(z,H,W,Y,e),jn.register(z,H,W,Y,e),Dn.register(z,H,W,Y,e),kn.register(z,H,W,Y,e),In.register(z,H,W,Y,e),Pn.register(z,H,W,Y),Bn.register(z,H,W,Y,e),$o.register(z,H,W),On.register(z,H,W,Y,e),Ln.register(z,H,W,Y,e),An.register(z,H,W,Y,e),qn.register(z,H,W,Y),Rn.register(z,H,W,Y,e),_n.register(z,H,W,Y,e),Un.register(z,H,W,Y,e),Wo.register(z,H,W,Y),$n.register(z,H,W,Y,e),zn.register(z,H,W,Y,e),Hn.register(z,H,W,Y),Wn.register(z,H,W,Y,e),Gn.register(z,H,W,Y,e),Yn.register(z,H,W,Y,e),Xn.register(z,H,W,Y),Kn.register(z,H,W,Y,e),Qn.register(z,H,W,Y),Jn.register(z,H,W,Y,e),Zn.register(z,H,W,Y,e),gn.register(z,H,W,Y,e),zo.register(z,H,W,Y,e),eo.register(z,H,W,Y,e),Go.register(z,H,W,Y,e),to.register(z,H,W,Y,e),Yo.register(z,H,W,Y,e),Ko.register(z,H,W,Y,e),Qo.register(z,H,W,Y),no.register(z,H,W,Y,e),Jo.register(z,H,W,Y),Zo.register(z,H,W,Y),oo.register(z,H,W,Y),ro.register(z,H,W,Y,e),io.register(z,H,W,Y,e),ao.register(z,H,W,Y,e),so.register(z,H,W,Y,e);const t=window[Wr];if(t)for(const o in t)t[o].createPropsResolver=je.createPropsResolver,t[o].register(z,H,W)}}function bo(){Gr();function e(s){const u=z[s];if(!u)throw new Error(`Could not find the editor of type '${s}'`);return u}function t(s,u){const l=H[s];return l?l(u):{}}function o(s){switch(s){case"check-box":return"onChangeValue";case"switch":return"onModelValueChanged";case"check-group":return"onChangeValue";case"combo-list":case"combo-tree":return"onChange";case"combo-lookup":return"";case"year-range":case"year-picker":case"month-range":case"month-picker":case"date-range":case"datetime-range":case"datetime-picker":return"onDatePicked";case"date-picker":return"onUpdate:modelValue";case"time-picker":return"onValueChange";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-editor":case"language-textbox":case"rich-text-editor":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":case"item-collection-editor":case"response-form-layout-setting":case"response-layout-editor-setting":case"response-layout-splitter":case"menu-lookup":case"json-editor":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onChange";case"query-solution-config":case"solution-preset":case"filter-bar-config":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged";case"collection-property-editor":return"onValueChange";default:return"onUpdate:modelValue"}}function r(s){switch(s){case"combo-list":case"input-group":case"textarea":return"onClear"}}function i(s){switch(s){case"input-group":case"textarea":return"onMousedownEvent"}}function a(s){switch(s){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:t,resolveEditorType:e,getChangeFunctionName:o,getClearFunctionName:r,getMousedownFunctionName:i,getMouseupFunctionName:a}}const Yr={errors:{type:Object,default:null}},Kr=n.defineComponent({name:"FValidationMessage",props:Yr,emits:[],setup(e,t){const o=n.ref(e.errors);n.watch(()=>e.errors,a=>{o.value=a});const r=n.ref(!0),i=n.computed(()=>{if(o.value){const a=Object.keys(o.value).map(s=>{var u;return(u=o.value[s])==null?void 0:u.name});return a.length?a.join(" "):""}return""});return()=>i.value&&n.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>r.value=!r.value},[!r.value&&n.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),r.value&&n.createVNode("span",{class:"f-feedback-message"},[i.value])])}}),kt=n.defineComponent({name:"FDynamicFormGroup",props:$r,emits:["change","update:modelValue","clickLabel"],setup(e,t){var $;const o=n.ref(e.id),r=n.ref(e.customClass),i=n.ref(e.editor),a=n.ref(e.label),s=n.ref(e.modelValue),u=n.ref(e.readonly),l=n.ref((($=e.editor)==null?void 0:$.required)||e.required),d=n.ref(e.showLabel),m=n.ref(e.visible);n.ref(e.type);const p=n.ref(),C=n.ref(e.errors),c=De.isMobilePhone(),f=n.ref(e.editor.type||"input-group"),S=n.computed(()=>d.value?e.showLabelType:"none"),{resolveEditorProps:E,resolveEditorType:b,getChangeFunctionName:g,getClearFunctionName:w}=bo(),O=n.computed(()=>{const R={"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":u.value,"align-items-start":i.value.type==="textarea"||i.value.type==="rich-text-editor","form-group--in-mobile":c};return R["form-group--has-"+f.value]=!0,R}),V=n.computed(()=>{if(e.fill)return{maxWidth:"none"}});function y(R,j,_){s.value=j!==void 0?j:R,t.emit("update:modelValue",s.value),t.emit("change",s.value,{newValue:R,newModelValue:j,parameters:_})}function h(R){return(...j)=>{typeof R=="function"&&R(...j)}}function v(R){return(j,_,I)=>{y(j,_,I),typeof R=="function"&&R(j,_,I)}}const x=n.computed(()=>{const R=i.value.type||"input-group",j=b(R),_=E(R,i.value),I=g(R),q=w(i.value.type);return q&&(_[q]=h(_[q])),I&&(_[I]=v(_[I])),(_.id==null||_.id==="")&&(_.id=o.value),R==="number-range"&&i.value.onBeginValueChange&&typeof i.value.onBeginValueChange=="function"?(i.value.onBeginValueChange&&typeof i.value.onBeginValueChange=="function"&&(_.onBeginValueChange=i.value.onBeginValueChange),i.value.onEndValueChange&&typeof i.value.onEndValueChange=="function"&&(_.onEndValueChange=i.value.onEndValueChange)):R==="lookup"&&i.value["onUpdate:idValue"]&&typeof i.value["onUpdate:idValue"]=="function"?(_["onUpdate:idValue"]=i.value["onUpdate:idValue"],_.id=o.value):R==="collection-property-editor"&&i.value.onSelectionChange&&typeof i.value.onSelectionChange=="function"?_.onSelectionChange=i.value.onSelectionChange:R==="property-editor"&&(_.onBeforeOpenVariables=i.value.onBeforeOpenVariables),(R==="lookup"||R==="combo-list"||R==="date-picker")&&(_.title=a.value),()=>n.createVNode(j,n.mergeProps({ref:p},_,{modelValue:s.value,"onUpdate:modelValue":D=>s.value=D}),t.slots)});function F(){return n.createVNode(Kr,{id:`${o.value}-validation-message`,errors:C.value},null)}n.watch([()=>e.id,()=>e.customClass,()=>e.editor,()=>e.label,()=>e.modelValue,()=>e.readonly,()=>e.required,()=>e.showLabel,()=>e.visible,()=>e.errors],([R,j,_,I,q,D,U,ne,N,P])=>{var oe;o.value=R,r.value=j,i.value=_,a.value=I,s.value=q,u.value=D,l.value=((oe=i.value)==null?void 0:oe.required)||U,d.value=ne,m.value=N,C.value=P});function M(R){t.emit("clickLabel",R)}return t.expose({editorRef:p}),()=>m.value&&n.createVNode("div",{id:`${o.value}-form-group`,class:r.value,style:e.customStyle},[n.createVNode("div",{class:"farris-group-wrap",style:V.value},[n.createVNode("div",{class:O.value},[t.slots.label?t.slots.label():n.createVNode(Hr,{id:`${o.value}-lable`,showType:S.value,required:l.value,text:a.value,title:a.value,isLink:!!e.linkLabel,onClickLabel:M},null),n.createVNode("div",{class:"farris-input-wrap"},[t.slots.content?t.slots.content():x.value(),F()]),!!e.enableTips&&n.createVNode(er,null,{default:()=>[n.createVNode("span",{class:"farris-label-tips ml-1"},[n.createVNode("i",{class:"f-icon f-icon-description-tips"},null)])],contentTemplate:e.tipsContent})])])])}}),Xr={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},wo=n.defineComponent({name:"FDynamicFormInput",props:Xr,emits:["change","update:modelValue","mousedown","mouseup"],setup(e,t){const o=n.ref(e.id),r=n.ref(e.editor),i=n.ref(e.modelValue),{resolveEditorProps:a,resolveEditorType:s,getChangeFunctionName:u,getMousedownFunctionName:l,getMouseupFunctionName:d,getClearFunctionName:m}=bo();function p(g,w,O){i.value=w!==void 0?w:g,t.emit("update:modelValue",i.value),t.emit("change",i.value,{newValue:g,newModelValue:w,parameters:O})}function C(g){t.emit("mousedown",g)}function c(g){t.emit("mouseup",g)}function f(){t.emit("update:modelValue","")}function S(g){return(...w)=>{f(),typeof g=="function"&&g(...w)}}function E(g){return(w,O,V)=>{p(w,O,V),typeof g=="function"&&g(w,O,V)}}const b=n.computed(()=>{const g=s(r.value.type),w=a(r.value.type,r.value);w.focusOnCreated=e.focusOnCreated,w.selectOnCreated=e.selectOnCreated;const O=u(r.value.type),V=m(r.value.type);V&&(w[V]=S(w[V])),O&&(w[O]=E(w[O]));const y=l(r.value.type);w[y]=C;const h=d(r.value.type);return w[h]=c,w.id=o.value,()=>n.createVNode(g,n.mergeProps(w,{modelValue:i.value,"onUpdate:modelValue":v=>i.value=v}),null)});return n.watch([()=>e.id,()=>e.editor,()=>e.modelValue],([g,w,O])=>{o.value=g,r.value=w,i.value=O}),()=>b.value()}});Dt.install=e=>{e.component(Co.name,Co).component(wo.name,wo).component(Dt.name,Dt).component(kt.name,kt)};const Qr=n.defineComponent({name:"FEntityBindingSelector",props:pr,emits:["submit","cancel"],setup(e,t){const o=xr(e),{entityColumns:r,entityTreeGridRef:i,entityDataSource:a,checkAndGetSelectedEntity:s,resolveEntityDataSource:u,entityTreeRowOption:l,initialSelectedEntity:d,isMainEntityInitialSelected:m}=o,p=go(e),{fieldColumns:C,resolveFieldDataSource:c,fieldDataSource:f,fieldTreeGridRef:S,fieldTreeRowOption:E,fieldSelectionOption:b,checkAndGetSelectedFields:g,currentComponentType:w}=p,O=new _t;O.globalConfig={position:"top-center"};const V=[{name:"卡片面板",value:"response-form"},{name:"表格",value:"data-grid"}],y=n.ref(),h=n.ref(""),v=n.ref([{id:"selectComponentType",title:"选择组件类型"},{id:"selectEntity",title:"选择实体"},{id:"selectFields",title:"选择显示字段"}]),x=n.ref(0),F=n.ref(""),M=n.computed(()=>P=>({"f-utils-fill":!0,border:P!=="selectComponentType","mx-3":!0,"my-2":!0,"position-relative":!0,"d-none":v.value[x.value].id!==P}));function $(){e.bindingEntityId&&(d!=null&&d.value)&&(h.value=d.value.name),e.componentType||(y.value=m.value?"response-form":"data-grid")}function R(){const P=s();P&&(c(P),S.value.updateDataSource(f.value))}n.onBeforeMount(()=>{e.steps&&(v.value=v.value.filter(P=>e.steps.includes(P.id))),F.value=v.value[0].id,u(),$()}),n.onMounted(()=>{var P,oe;i&&((P=d.value)!=null&&P.id)&&i.value.selectRowById((oe=d.value)==null?void 0:oe.id),v.value.length===1&&v.value[0].id==="selectFields"&&R()});function j(P){var oe;(oe=S==null?void 0:S.value)!=null&&oe.emptyCurrentRowId&&S.value.emptyCurrentRowId()}function _(){return n.createVNode(Ut,{key:1,ref:i,fit:!0,data:a.value,idField:"id",columns:r.value,rowNumber:{enable:!1},"row-option":l,columnOption:{fitColumns:!0}},null)}function I(){return n.createVNode(Ut,{key:2,ref:S,hierarchy:{cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}},fit:!0,data:f.value,idField:"id",columns:C.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},"row-option":E,selection:b},null)}function q(){const P={editable:!1,type:"combo-list",data:V,idField:"value",valueField:"value",textField:"name"},oe={type:"input-group",enableClear:!1};return n.createVNode("div",null,[n.createVNode("div",{class:"f-utils-fill"},[n.createVNode("div",{class:"f-section py-0"},[n.createVNode("div",{class:"f-section-header"},[n.createVNode("div",{class:"f-title"},[n.createVNode("h4",{class:"f-title-text"},[n.createTextVNode("组件信息")])])]),n.createVNode("div",{class:"f-section-content"},[n.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[n.createVNode(kt,{label:"组件类型",customClass:"col-12",modelValue:y.value,"onUpdate:modelValue":re=>y.value=re,required:"true",editor:P,onChange:j},null),n.createVNode(kt,{label:"组件标题",customClass:"col-12",modelValue:h.value,"onUpdate:modelValue":re=>h.value=re,required:"true",editor:oe},null)])])])])])}function D(){x.value--,F.value=v.value[x.value].id}function U(){var P;switch(F.value){case"selectEntity":{R();break}case"selectComponentType":{if(!y.value){O.warning("请先选择组件类型");return}if(!((P=h.value)!=null&&P.trim())){O.warning("请先填写组件标题");return}w.value=y.value,c(d.value),S.value.updateDataSource(f.value);break}}x.value++,F.value=v.value[x.value].id}function ne(){t.emit("cancel")}function N(){var re;const P=s(),oe=g();if(P){const Z={bindingType:"entity"};Z.bindingEntity=P,Z.bindTo=o.entityBindToMap.get(((re=Z.bindingEntity)==null?void 0:re.label)||""),Z.bindingEntityFields=oe,Z.entityTitle=h.value,t.emit("submit",{bindingContext:Z,componentType:y.value})}}return()=>{var P;return n.createVNode("div",{class:"h-100 d-flex flex-column"},[((P=v.value)==null?void 0:P.length)>1?n.createVNode(rt,{steps:v.value,activeIndex:x,style:"align-self:center"},null):"",n.createVNode("div",{class:M.value("selectEntity"),style:"border-radius:10px;"},[_()]),n.createVNode("div",{class:M.value("selectComponentType"),style:"border-radius:10px;"},[q()]),n.createVNode("div",{class:M.value("selectFields"),style:"border-radius:10px;"},[I()]),n.createVNode("div",{class:"modal-footer"},[n.createVNode("button",{class:"btn btn-secondary",onClick:ne},[n.createTextVNode("取消")]),x.value!==0?n.createVNode("button",{class:"btn btn-secondary",onClick:D},[n.createTextVNode("上一步")]):"",x.value!==v.value.length-1?n.createVNode("button",{class:"btn btn-primary",onClick:U},[n.createTextVNode("下一步")]):"",x.value===v.value.length-1?n.createVNode("button",{class:"btn btn-primary",onClick:N},[n.createTextVNode("确定")]):""])])}}});function So(e){let t,o;function r(y,h,v){var F;const x={componentType:y.getAttribute("data-controltype")||"",componentFeature:y.getAttribute("data-feature")||"",componentCategory:y.getAttribute("data-category")||"",label:y.getAttribute("data-controlTypeName")||"",sourceType:y.getAttribute("data-sourceType")||"move",parentComponentInstance:v.componentInstance.value,sourceElement:y,sourceContainer:h,targetContainer:v,bindingSourceContext:null,bindingTargetId:y.getAttribute("data-fieldId")||""};return y.componentInstance&&(x.componentType=(F=y.componentInstance.value.schema)==null?void 0:F.type),x}function i(y){var x,F;const{bindingContext:h,componentType:v}=y;o.bindingSourceContext=h,v&&(o.componentType=v),(x=t==null?void 0:t.modalRef)!=null&&x.value.close&&((F=t==null?void 0:t.modalRef)==null||F.value.close())}function a(){var y,h;o.bindingSourceContext=void 0,(y=t==null?void 0:t.modalRef)!=null&&y.value.close&&((h=t==null?void 0:t.modalRef)==null||h.value.close())}function s(){const{componentType:y,bindingTargetId:h,parentComponentInstance:v}=o;let x=[];return y&&(y==="list-view"||y==="calendar"||y==="uploader"?x=["selectEntity"]:x=["selectEntity","selectFields"]),h&&(x=["selectComponentType","selectFields"]),()=>n.createVNode(n.Fragment,null,[n.createVNode(Qr,{componentType:y,bindingEntityId:h,steps:x,designerHostService:e,targetComponentInstance:v,onSubmit:i,onCancel:a},{default:()=>[n.createTextVNode(" ")]}),n.createTextVNode(" ")])}function u(){return new Promise((y,h)=>{const{componentType:v}=o,x=v==="list-view"||v==="calendar"||v==="uploader";t=e.modalService.open({title:"选择绑定",width:x?550:800,height:x?400:600,fitContent:!1,showButtons:!1,render:s(),enableEsc:!1,rejectCallback:()=>{o.bindingSourceContext=void 0},closedCallback:()=>{y(o)},draggable:!0})})}function l(){var y,h;o.bindingSourceContext=void 0,(y=t==null?void 0:t.modalRef)!=null&&y.value.close&&((h=t==null?void 0:t.modalRef)==null||h.value.close())}function d(y){let h="",v="";return Fe["field-set"]&&y.schema.type===Fe["field-set"].type&&(h=y.schema.id,v=y.schema.title),{groupId:h,groupName:v}}function m(y){var $,R;if(!y||!y.selectedData||!y.bindingType)return;const{selectedData:h,bindingType:v}=y,{groupId:x,groupName:F}=d(o.parentComponentInstance),M={bindingType:"field"};if(v==="Form"){const j=h;M.entityFieldNode=j,M.designViewModelField=Se.merge({},j,{groupId:x,groupName:F}),o.bindingSourceContext=M}else{const j=h;M.variableFieldNode=Se.merge({},j,{groupId:x,groupName:F}),o.bindingSourceContext=M}($=t==null?void 0:t.modalRef)!=null&&$.value.close&&((R=t==null?void 0:t.modalRef)==null||R.value.close())}function p(){var y,h;o.bindingSourceContext=null,(y=t==null?void 0:t.modalRef)!=null&&y.value.close&&((h=t==null?void 0:t.modalRef)==null||h.value.close())}function C(){const{parentComponentInstance:y}=o,v={viewModelId:e.formSchemaUtils.getViewModelIdByComponentId(y==null?void 0:y.belongedComponentId),designerHostService:e,disableOccupiedFields:!0,componentSchema:{editor:{type:o.componentType}}},x={enable:!1};return()=>n.createVNode(n.Fragment,null,[n.createVNode(gn.FBindingSelectorContainer,{editorParams:v,showCustomFooter:!0,bindingType:x,onSubmit:m,onCancel:l,onSkip:p},{default:()=>[n.createTextVNode(" ")]}),n.createTextVNode(" ")])}function c(){return new Promise((y,h)=>{t=e.modalService.open({title:"选择绑定",width:800,height:600,fitContent:!1,showButtons:!1,render:C(),enableEsc:!1,rejectCallback:()=>{o.bindingSourceContext=void 0},closedCallback:()=>{y(o)},draggable:!0})})}function f(){const{formSchemaUtils:y}=e,h=o.parentComponentInstance.belongedComponentId,v=new Set,x=y.getFormSchema().module,F=x.components.find(j=>j.id===h),M=y.getViewModelById(F.viewModel);let $=F.componentType;const R=y.checkComponentExistInDrawer(F.id);return($==="frame"||$==="table")&&($="form"),x.viewmodels.forEach(j=>{if(!j.fields||j.fields.length===0)return;const _=x.components.find(D=>D.viewModel===j.id);let{componentType:I}=_;if((I==="frame"||I==="table")&&(I="form"),I!==$||j.bindTo!==M.bindTo)return;const q=y.checkComponentExistInDrawer(_.id);R&&q&&j.fields.forEach(D=>{v.add(D.id)}),!R&&!q&&j.fields.forEach(D=>{v.add(D.id)})}),v}function S(){const{bindingTargetId:y,parentComponentInstance:h}=o;if(!y){o.bindingSourceContext=void 0;return}if(f().has(y)){const x=new tr.FNotifyService;x.globalConfig={position:"top-center"},x.warning("表单已经包含此字段,请勿重复添加"),o.bindingSourceContext=void 0;return}else{const x={bindingType:"field"},F=e.formSchemaUtils.getComponentById(h.belongedComponentId),M=e.schemaService.getFieldByIDAndVMID(y,F.viewModel),$=Se.merge({},M.schemaField);x.entityFieldNode=$;const{groupId:R,groupName:j}=d(o.parentComponentInstance);x.designViewModelField=Se.merge({},$,{groupId:R,groupName:j}),o.bindingSourceContext=x}}function E(){return o.bindingTargetId?S():c()}function b(){const{schemaService:y}=e,h=y.getPrimaryField(),v=y.getSchemaEntities();if(!(!h||!v))return v[0].type.fields.find(x=>x.bindingField===h)}function g(){const{componentType:y}=o;if(y===Fe["approval-logs"].type){const h=b();if(!h)return;const v={bindingType:"field",entityFieldNode:h};o.bindingSourceContext=v}}function w(){const{parentComponentInstance:y}=o,h=y.addNewChildComponentSchema(o,e);o.componentSchema=h}async function O(){const{componentCategory:y}=o;switch(y){case"input":{await E();break}case"dataCollection":{await u();break}case"approval":{g();break}}}async function V(y,h,v){return o=r(y,h,v),await O(),o.bindingSourceContext===void 0?null:(w(),o)}return{getComponentResolveContext:r,resolveComponentCreationContextByDrop:V}}function Jr(e,t){let o;function r(c,f,S){var b,g;if(c.contains(f)||f.classList.contains("no-drop"))return!1;const E=!0;if(c.componentInstance&&c.componentInstance.value.getDragScopeElement){const w=c.componentInstance.value.getDragScopeElement();if(w&&!w.contains(f))return!1}if((g=(b=f.componentInstance)==null?void 0:b.value)!=null&&g.externalContainerId)return!1;if(f.componentInstance&&f.componentInstance.value.canAccepts){const O=So(e).getComponentResolveContext(c,S,f);return f.componentInstance.value.canAccepts(O)}return E}function i(c,f){const S=f.getBoundingClientRect(),E=c.getBoundingClientRect(),b=E.top>=S.top,g=E.top<S.bottom;return b&&g}function a(c,f){const S=c.querySelector(".dgComponentSelected");if(!(!S||f===0)&&i(S,c)){const E=S.querySelector(".component-btn-group");if(E){const b=E.querySelector("div");if(b&&b.style.top){const g=Number.parseFloat(b.style.top);b.style.top=g-f+"px"}}}}function s(c,f,S){let E=-1;if(!f)return-1;if(c.componentInstance.value.contents)if(S&&S.componentInstance){if(S.getAttribute("data-noattach"))E=Number(S.getAttribute("data-position"));else{const b=S.componentInstance.value.schema;let g={id:b.id};b.type==="component"&&(g={component:b.id}),E=Se.findIndex(c.componentInstance.value.contents,g),E=E===-1?0:E}E!==-1&&c.componentInstance.value.contents.splice(E,0,f)}else c.componentInstance.value.contents.push(f);return E}function u(c,f,S,E){So(e).resolveComponentCreationContextByDrop(c,S,f).then(g=>{if(!g)return;const w=g.componentSchema;w&&(t!=null&&t.appendIdentifyForNewControl&&t.appendIdentifyForNewControl(w),s(f,w,E))}),f.contains(c)&&f.removeChild(c)}function l(c,f,S,E){let b,g=-1;if(c.componentInstance&&c.componentInstance.value.triggerBelongedComponentToMoveWhenMoved){const V=c.componentInstance.value.getBelongedComponentInstance(c.componentInstance);V&&(c=n.ref(V.elementRef).value.parentElement,S=c.parentElement)}const w=c.componentInstance&&c.componentInstance.value.schema;let O={id:w&&w.id};(w==null?void 0:w.type)==="component"&&(O={component:w&&w.id}),g=Se.findIndex(S.componentInstance.value.contents,O),g!==-1&&S.componentInstance.value.contents&&(b=S.componentInstance.value.contents.splice(g,1),b=b[0]),s(f,b,E),S.componentInstance&&S.componentInstance.value.onChildElementMovedOut&&S.componentInstance.value.onChildElementMovedOut(c),f.componentInstance&&f.componentInstance.value.onAcceptMovedChildElement&&f.componentInstance.value.onAcceptMovedChildElement(c,S)}function d(c,f,S,E){if(!f||c.contains(f))return;switch(c.getAttribute("data-sourceType")){case"control":case"field":case"entity":{u(c,f,S,E);break}default:S.componentInstance.value.contents?l(c,f,S,E):f.contains(c)&&f.removeChild(c)}Ze.value++}function m(c){o&&o.destroy(),mo&&(o=mo([],{mirrorContainer:c,direction:"mixed",revertOnSpill:!0,moves(f,S,E){let b=!0;return f.classList.contains("no-drag")&&(b=!1),f.componentInstance&&(b=!!E.getAttribute("data-dragging-icon")),b},copy(f){return f.classList.contains("drag-copy")},getMirrorText(f){return f.componentInstance&&f.componentInstance.value.getDraggingDisplayText?f.componentInstance.value.getDraggingDisplayText():f.innerText||"控件"},accepts(f,S,E){const b=r(f,S,E),g=c.lastElementChild;return b?g.className=g.className.replace("undroppable",""):g.className.includes("undroppable")||(g.className+=" undroppable"),b}}).on("over",(f,S)=>{S.className+=" drag-over"}).on("out",(f,S)=>{S.className=S.className.replace("drag-over","").replace(" ","")}).on("drop",(f,S,E,b)=>{d(f,S,E,b)}).on("dragend",(f,S)=>{a(c,S)}))}function p(c,f){if(!c)return;if(f.noDragDrop)return c;const S=c.querySelector(`[data-dragref='${f.id}-container']`)||c;o&&S&&o.containers.push(S)}function C(){return o}return{attachComponents:p,initializeDragula:m,getDragulaInstance:C}}const Zr={id:{type:String,default:""},componentId:{type:String,default:""},type:{type:String,default:""},canDelete:{type:Boolean,default:!0},canMove:{type:Boolean,default:!0},canSelectParent:{type:Boolean,default:!0},customButtons:{type:Array,default:[]},customClass:{type:String,default:""},customStyle:{type:String,default:""},modelValue:{type:Object},ignore:{type:Boolean,default:!1}},X={},Q={},te={},{globalStorageKey:ei}=De.useThirdComponent();function ti(){{const e={schemaMap:je.schemaMapForDesigner,propertyConfigSchemaMap:je.propertyConfigSchemaMapForDesigner,propertyEffectMap:je.propertyEffectMapForDesigner,schemaResolverMap:je.schemaResolverMapForDesigner};Jt.registerDesigner(X,Q,te,e),Qt.registerDesigner(X,Q,te,e),Zt.registerDesigner(X,Q,te,e),en.registerDesigner(X,Q,te,e),tn.registerDesigner(X,Q,te,e),nn.registerDesigner(X,Q,te,e),on.registerDesigner(X,Q,te,e),At.registerDesigner(X,Q,te,e),Nt.registerDesigner(X,Q,te,e),Nt.registerDesigner(X,Q,te,e),sn.registerDesigner(X,Q,te,e),rn.registerDesigner(X,Q,te,e),ln.registerDesigner(X,Q,te,e),cn.registerDesigner(X,Q,te,e),dn.registerDesigner(X,Q,te,e),un.registerDesigner(X,Q,te,e),fn.registerDesigner(X,Q,te),mn.registerDesigner(X,Q,te,e),oo.registerDesigner(X,Q,te),pn.registerDesigner(X,Q,te,e),hn.registerDesigner(X,Q,te,e),vn.registerDesigner(X,Q,te,e),yn.registerDesigner(X,Q,te,e),bn.registerDesigner(X,Q,te,e),Cn.registerDesigner(X,Q,te),Sn.registerDesigner(X,Q,te,e),wn.registerDesigner(X,Q,te,e),ro.registerDesigner(X,Q,te,e),xn.registerDesigner(X,Q,te,e),Tn.registerDesigner(X,Q,te,e),Nn.registerDesigner(X,Q,te),Vn.registerDesigner(X,Q,te,e),Fn.registerDesigner(X,Q,te),En.registerDesigner(X,Q,te,e),Mn.registerDesigner(X,Q,te,e),jn.registerDesigner(X,Q,te,e),Dn.registerDesigner(X,Q,te,e),In.registerDesigner(X,Q,te,e),Pn.registerDesigner(X,Q,te,e),Bn.registerDesigner(X,Q,te,e),kn.registerDesigner(X,Q,te,e),On.registerDesigner(X,Q,te,e),Ln.registerDesigner(X,Q,te,e),An.registerDesigner(X,Q,te,e),qn.registerDesigner(X,Q,te),Rn.registerDesigner(X,Q,te,e),_n.registerDesigner(X,Q,te,e),Un.registerDesigner(X,Q,te,e),$n.registerDesigner(X,Q,te,e),zn.registerDesigner(X,Q,te,e),Hn.registerDesigner(X,Q,te),Wn.registerDesigner(X,Q,te,e),Gn.registerDesigner(X,Q,te,e),Yn.registerDesigner(X,Q,te,e),Kn.registerDesigner(X,Q,te,e),Xn.registerDesigner(X,Q,te),an.registerDesigner(X,Q),Qn.registerDesigner(X,Q,te),Jn.registerDesigner(X,Q,te,e),Zn.registerDesigner(X,Q,te,e),eo.registerDesigner(X,Q,te,e),to.registerDesigner(X,Q,te,e),no.registerDesigner(X,Q,te,e),io.registerDesigner(X,Q,te,e),ao.registerDesigner(X,Q,te,e),ct.registerDesigner(X,Q,te,e),so.registerDesigner(X,Q,te,e);const t=window[ei];if(t)for(const o in t)t[o].createPropsResolver=je.createPropsResolver,t[o].registerDesigner(X,Q,te)}}function ni(e){const t={schemaMap:je.schemaMapForDesigner,propertyConfigSchemaMap:je.propertyConfigSchemaMapForDesigner,propertyEffectMap:je.propertyEffectMapForDesigner,schemaResolverMap:je.schemaResolverMapForDesigner};e.forEach(o=>{o.registerDesigner&&o.registerDesigner(X,Q,te,t)})}const oi={id:{type:String}},ri=n.defineComponent({name:"FDesignerPlaceholder",props:oi,emits:[],setup(e){const t=n.computed(()=>({"drag-and-drop-alert":!0,"no-drag":!0,"w-100":!0})),o=n.computed(()=>({height:"60px",display:"flex","justify-content":"center","align-items":"center",margin:0,padding:".75rem 1.25rem",border:"1px solid transparent","border-radius":"3px",color:"#315585","background-color":"#dfedff","border-color":"#d2e6ff"}));return()=>n.createVNode("div",{class:t.value,style:o.value,role:"alert","data-noattach":"true","data-position":"0"},[n.createTextVNode("拖拽组件到这里")])}});function ii(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!n.isVNode(e)}const Bt=n.defineComponent({name:"FDesignerItem",props:Zr,emits:["selectionChange","dragEnd"],setup(e,t){const o=n.ref(`${e.modelValue.id}-component`),r=n.ref(e.canMove),i=n.ref(e.canDelete),a=n.ref(!1),s=n.ref(e.modelValue),u=n.ref(e.componentId||""),l=n.ref(""),d=n.ref(""),m=n.ref(e.customClass),p=n.ref(),C=n.inject("canvas-dragula"),c=n.ref(),f=n.inject("design-item-context");function S(N){N&&Object.assign(s.value,N)}const E={designerItemElementRef:p,componentInstance:c,schema:s.value,parent:f,setupContext:t,updateContextSchema:S};n.provide("design-item-context",E);const b=n.inject("useFormSchema"),g=n.inject("designer-host-service"),w=n.inject("external-container-id"),O=n.computed(()=>{var Z,he,xe;const N=(Z=c.value)!=null&&Z.shouldApplyClassToComponent?(he=c.value)==null?void 0:he.shouldApplyClassToComponent():!0,P=e.modelValue.appearance&&e.modelValue.appearance.class||"",oe=((xe=c.value)==null?void 0:xe.getCustomButtons)&&c.value.getCustomButtons();let re={"farris-component":!0,"flex-fill":s.value.id==="root-component","position-relative":r.value&&i.value||(oe==null?void 0:oe.length),"farris-nested":a.value,"can-move":r.value,"d-none":p.value&&p.value.classList.contains("d-none"),dgComponentSelected:p.value&&p.value.classList.contains("dgComponentSelected"),dgComponentFocused:p.value&&p.value.classList.contains("dgComponentFocused")};return re[`farris-component-${s.value.type}`]=!0,re=N?De.getCustomClass(re,P):re,re=De.getCustomClass(re,d.value),re=De.getCustomClass(re,m.value),re}),V=n.computed(()=>{var re,Z;const N={},P=(re=c.value)!=null&&re.shouldApplyClassToComponent?(Z=c.value)==null?void 0:Z.shouldApplyClassToComponent():!0,oe=e.modelValue.appearance&&e.modelValue.appearance.style||"";return oe&&P&&oe.split(";").reduce((he,xe)=>{const[fe,ee]=xe.split(":");return he[fe]=ee,he},N),l.value&&l.value.split(";").reduce((he,xe)=>{const[fe,ee]=xe.split(":");return fe&&(he[fe]=ee),he},N),N});function y(N,P){var Z,he,xe;if(N&&(N.preventDefault(),N.stopPropagation()),(Z=g==null?void 0:g.designerContext)!=null&&Z.checkCanDeleteControl&&!g.designerContext.checkCanDeleteControl(P))return;if(c.value.triggerBelongedComponentToDeleteWhenDeleted){const fe=c.value.getBelongedComponentInstance(c);if(fe&&fe.parent){const ee=n.ref(fe==null?void 0:fe.parent),T=ee.value.contents.findIndex(ie=>ie.id===fe.schema.id);(xe=(he=ee.value)==null?void 0:he.contents)==null||xe.splice(T,1),Ze.value++}return}c.value.onRemoveComponent(g);let oe=f,re=fe=>fe.id===P.id;if(P.type==="component"&&(oe=f==null?void 0:f.parent,re=fe=>fe.component===P.id),oe&&oe.schema.contents){const fe=oe.schema.contents.findIndex(re);oe.schema.contents.splice(fe,1),Ze.value++,t.emit("selectionChange")}}function h(N){return i.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:P=>{y(P,N)}},[n.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function v(){return r.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[n.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function x(){var P;const N=((P=c.value)==null?void 0:P.getCustomButtons)&&c.value.getCustomButtons();return N&&!!N.length&&N.map(oe=>n.createVNode("div",{role:"button",class:`btn component-settings-button ${oe.class||""}`,title:oe.title,ref:oe.id,onClick:re=>oe.onClick&&oe.onClick(re)},[n.createVNode("i",{class:oe.icon},null)]))}function F(N){return n.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[n.createVNode("div",null,[h(N),v(),x()])])}function M(N,P,oe,re){t.emit("selectionChange",N,P,oe,re)}function $(){t.emit("dragEnd")}function R(){return n.createVNode("div",{class:"no-drag w-100","data-noattach":"true","data-position":"0",style:"height: 60px; display: flex; justify-content: center; align-items: center; margin: 0px; border-radius: 3px; color: #2d2f33; background-color: #d4d6d9;"},[n.createTextVNode("未识别的组件")])}function j(N){let P;const oe=N.type,re=X[oe],Z=Q[oe],he=Z?Z(N):{};he.customClass=e.ignore?he.customClass:"",he.customStyle=e.ignore?he.customStyle:"",he.componentId=u.value,he.id=N.id;const xe=N.contents&&N.contents.length===0;return N.contents&&!!N.contents.length&&re?n.createVNode(re,n.mergeProps({ref:c},he),ii(P=N.contents.map(ee=>n.createVNode(Bt,{key:ee.id,modelValue:ee,"onUpdate:modelValue":T=>ee=T,componentId:u.value,onSelectionChange:M,onDragEnd:$},null)))?P:{default:()=>[P]}):re?xe?n.createVNode(re,n.mergeProps({ref:c},he),{default:()=>[n.createVNode(ri,null,null)]}):n.createVNode(re,n.mergeProps({ref:c},he),null):R()}function _(){const N=b.externalFormSchema.get(w);if(N!=null&&N.content)return N==null?void 0:N.content}function I(N){if(N.type==="component-ref"){const re=(w?_():b==null?void 0:b.getFormSchema()).module.components.find(he=>he.id===N.component),Z=n.ref(re);if(re)return n.createVNode(Bt,{key:re.id,modelValue:Z.value,"onUpdate:modelValue":he=>Z.value=he,componentId:re.id,onSelectionChange:M,onDragEnd:$},null)}}n.watch([()=>e.modelValue,()=>e.componentId],([N,P])=>{s.value=N,o.value=`${N.id}-component`,P&&(u.value=P),n.triggerRef(p)},{deep:!0});function q(N){window.scrollContainerList||(window.scrollContainerList=new Set);const P=N.getAttribute("id");P&&(window.scrollContainerList.add(P),N.componentInstance.value&&(N.componentInstance.value.scrollElementId=P))}function D(N){const P=N==null?void 0:N.target;q(P),gt(P)}function U(){var N,P;if(p.value){(P=(N=s.value)==null?void 0:N.contents)!=null&&P.length&&p.value.addEventListener("scroll",D);const oe=p.value.querySelector(".drag-container");oe&&oe.addEventListener("scroll",D)}}n.onMounted(()=>{if(p.value&&c.value&&c.value.schema){const N=p.value.querySelector(`[data-dragref='${c.value.schema.id}-container']`);C&&N&&C.attachComponents(N,s.value),a.value=c.value.canNested!==void 0?c.value.canNested:a.value,i.value=c.value.canDelete!==void 0?c.value.canDelete:i.value,r.value=c.value.canMove!==void 0?c.value.canMove:r.value,l.value=c.value.styles||"",d.value=c.value.designerClass||"",p.value&&(p.value.componentInstance=c,p.value.designItemContext=E),c.value.belongedComponentId=u.value,c.value.setComponentBasicInfoMap(g),c.value.externalContainerId=w}U(),Ze.value++}),n.onBeforeUnmount(()=>{p.value&&p.value.removeEventListener("scroll",D)});function ne(N){var re;if(N&&(N.preventDefault(),N.stopPropagation()),w){const Z=document.getElementById(`${w}-design-item`);Z&&Z.click();return}let P=E.designerItemElementRef;const oe=p.value;if(oe){const Z=document.getElementsByClassName("dgComponentFocused");Z&&Z.length===1&&Z[0]===p.value||(Array.from(Z).forEach(xe=>xe.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(xe=>xe.classList.remove("dgComponentSelected")),oe.classList.add("dgComponentFocused"),t.emit("selectionChange",s.value.type,s.value,u.value,c.value))}(re=c.value)!=null&&re.getDraggableDesignItemElement&&(P=c.value.getDraggableDesignItemElement(E)),P!=null&&P.value&&P.value.classList.add("dgComponentSelected"),Vt(P==null?void 0:P.value)}return()=>{const N=w?`${w}-`:"";return s.value.type==="component-ref"?I(s.value):n.createVNode("div",{id:`${N}${s.value.id}-design-item`,ref:p,class:O.value,style:V.value,onClick:ne},[F(s.value),j(s.value)])}}}),ai={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showFloatingClose:{type:Boolean,default:!1},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},openedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},position:{type:String,default:"center"},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},maximized:{type:Boolean,default:!1},useTransform:{type:Boolean,default:!0}};class Ie{constructor(t,o){this.x=t,this.y=o}static getTransformInfo(t){const r=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(r.length>=6){const i=parseInt(r[4],10),a=parseInt(r[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(t,o=null){if(this.isMouseEvent(t))return new Ie(t.clientX,t.clientY);if(o===null||t.changedTouches.length===1)return new Ie(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let r=0;r<t.changedTouches.length;r++)if(t.changedTouches[r].target===o)return new Ie(t.changedTouches[r].clientX,t.changedTouches[r].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const o=new Ie(0,0);if(window){const r=window.getComputedStyle(t);if(r){const i=parseInt(r.getPropertyValue("left"),10),a=parseInt(r.getPropertyValue("top"),10);o.x=isNaN(i)?0:i,o.y=isNaN(a)?0:a}return o}return null}static copy(t){return new Ie(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class it{constructor(t,o){this.width=t,this.height=o}static getCurrent(t){const o=new it(0,0);if(window){const r=window.getComputedStyle(t);return r&&(o.width=parseInt(r.getPropertyValue("width"),10),o.height=parseInt(r.getPropertyValue("height"),10)),o}return null}static copy(t){return new it(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function si(e,t){const o=n.ref(),r=n.ref(),i=n.ref(),a=n.ref(),s=n.ref(),u=n.ref(),l=n.ref(),d=n.ref(),m=n.ref(),p=n.ref(),C=n.ref(),c=n.ref(e.resizeable),f=n.ref(),S=n.ref(e.draggable),E=n.ref(!1);function b(){const D=r.value||document.body,U=window.getComputedStyle(D);if(!U||!o.value)return;const ne=Ie.getTransformInfo(o.value),N={};l.value&&(N.deltaL=o.value.offsetLeft-l.value.x,N.deltaT=o.value.offsetTop-l.value.y);const P=U.getPropertyValue("position");N.width=D.clientWidth,N.height=D.clientHeight,N.pr=parseInt(U.getPropertyValue("padding-right"),10),N.pb=parseInt(U.getPropertyValue("padding-bottom"),10),N.position=U.getPropertyValue("position"),P==="static"&&(D.style.position="relative"),N.translateX=ne.x,N.translateY=ne.y,p.value=N}function g(D){if(o.value){a.value=it.getCurrent(o.value),s.value=Ie.getCurrent(o.value),u.value=a.value?it.copy(a.value):null,l.value=s.value?Ie.copy(s.value):null,b();const U=D.target.getAttribute("type")||"";d.value={n:!!U.match(/n/),s:!!U.match(/s/),w:!!U.match(/w/),e:!!U.match(/e/)}}}function w(){var D,U,ne,N;if(o.value){const P=o.value;d.value&&((d.value.n||d.value.s)&&((D=u.value)!=null&&D.height)&&(P.style.height=u.value.height+"px"),(d.value.w||d.value.e)&&((U=u.value)!=null&&U.width)&&(P.style.width=u.value.width+"px"),l.value&&((ne=l.value)!=null&&ne.x&&(P.style.left=l.value.x+"px"),(N=l.value)!=null&&N.y&&(P.style.top=l.value.y+"px")))}}function O(){const D=e.minHeight?e.minHeight:1,U=e.minWidth?e.minWidth:1;u.value&&l.value&&d.value&&a.value&&(u.value.height<D&&(u.value.height=D,d.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-D))),u.value.width<U&&(u.value.width=U,d.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-U))),e.maxHeight&&u.value.height>e.maxHeight&&(u.value.height=e.maxHeight,s.value&&d.value.n&&(l.value.y=s.value.y+(a.value.height-e.maxHeight))),e.maxWidth&&u.value.width>e.maxWidth&&(u.value.width=e.maxWidth,d.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-e.maxWidth))))}function V(){if(r.value){const D=p.value;if(l.value&&u.value&&d.value&&a.value){const U=D.width-D.pr-D.deltaL-D.translateX-l.value.x,ne=D.height-D.pb-D.deltaT-D.translateY-l.value.y;d.value.n&&l.value.y+D.translateY<0&&s.value&&(l.value.y=-D.translateY,u.value.height=a.value.height+s.value.y+D.translateY),d.value.w&&l.value.x+D.translateX<0&&s.value&&(l.value.x=-D.translateX,u.value.width=a.value.width+s.value.x+D.translateX),u.value.width>U&&(u.value.width=U),u.value.height>ne&&(u.value.height=ne)}}}function y(D){if(!i.value||!a.value||!s.value||!d.value)return;D.subtract(i.value);const U=D.x,ne=D.y;d.value.n?(l.value.y=s.value.y+ne,u.value.height=a.value.height-ne):d.value.s&&(u.value.height=a.value.height+ne),d.value.e?u.value.width=a.value.width+U:d.value.w&&(u.value.width=a.value.width-U,l.value.x=s.value.x+U),V(),O(),w()}function h(D){if(!m.value)return;const U=Ie.fromEvent(D);U&&y(U)}function v(){if(o.value){const{width:D,height:U,x:ne,y:N}=o.value.getBoundingClientRect(),P=Ie.getTransformInfo(o.value);return{size:{width:D,height:U},position:{x:ne-P.x,y:N-P.y}}}return null}function x(D){if(o.value){const U=v();C.value=U}i.value=void 0,a.value=null,s.value=null,u.value=null,l.value=null,d.value=null,m.value=null,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",x)}function F(){document.addEventListener("mousemove",h),document.addEventListener("mouseup",x)}function M(D){D instanceof MouseEvent&&D.button===2||S.value&&(document.body.click(),D.stopPropagation(),D.preventDefault(),i.value=Ie.fromEvent(D),m.value=D.target,g(D),F())}function $(D){return o.value=D,c.value&&n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:U=>M(U)},null)])}function R(D=!0){document.body.click();const U=r.value||document.body,ne=it.getCurrent(U),N=o.value;D&&N&&(f.value=v(),f.value.transform=N.style.transform),ne&&N&&(u.value=ne,u.value.height-=14,u.value.width-=14,N.style.height=u.value.height+"px",N.style.width=u.value.width+"px",N.style.left="7px",N.style.top="7px",N.style.transform="",C.value={size:u.value,position:{x:0,y:0}},S.value=!1,E.value=!0)}function j(){var D,U;if(document.body.click(),f.value){const ne={width:f.value.size.width||0,height:f.value.size.height||0},N={x:(window.innerWidth-ne.width)/2,y:(window.innerHeight-ne.height)/2};(D=u.value)==null||D.set(ne),(U=l.value)==null||U.set(N);const P=o.value;P.style.height=ne.height+"px",P.style.width=ne.width+"px",P.style.left=`${N.x}px`,P.style.top=`${N.y}px`,P.style.transform="",C.value={size:ne,position:N},S.value=e.draggable,E.value=!1}}function _(){if(o.value){const D=it.getCurrent(o.value);if(D){const{width:U,height:ne}=D;o.value.style.left=`${(window.innerWidth-U)/2}px`,o.value.style.top=`${(window.innerHeight-ne)/2}px`,o.value.style.transform=""}}}function I(){const D=()=>{E.value?R(!1):_(),document.body.click()};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}}const q=I();return{renderResizeBar:$,boundingElement:r,resizedEventParam:C,maximize:R,restore:j,allowDrag:S,isMaximized:E,unWindowResizeHandle:q,moveToCenter:_}}function li(e,t,o){const r=n.ref(),i=n.ref(e.draggable),a=n.ref(e.lockAxis),s=n.ref(),u=n.ref(),l=n.ref(!1),d=n.ref(new Ie(0,0)),m=n.ref(new Ie(0,0)),p=n.ref(new Ie(0,0)),C=n.ref(new Ie(0,0));n.watch(()=>o.value,h=>{s.value.style.cursor=h?"move":"default"});function c(h,v){if(v.tagName==="BUTTON")return!1;if(v===h)return!0;for(const x in v.children)if(Object.prototype.hasOwnProperty.call(v.children,x)&&c(h,v.children[x]))return!0;return!1}function f(){var F,M;let h=p.value.x+m.value.x,v=p.value.y+m.value.y;a.value==="x"?(h=((F=d.value)==null?void 0:F.x)||0,p.value.x=0):a.value==="y"&&(v=((M=d.value)==null?void 0:M.y)||0,p.value.y=0);const x=`translate3d(${Math.round(h)}px, ${Math.round(v)}px, 0px)`;r.value&&(r.value.style.transform=x),C.value.x=h,C.value.y=v}function S(){if(!u.value||!r.value)return null;const h=u.value.getBoundingClientRect(),v=r.value.getBoundingClientRect(),x={top:h.top<v.top,right:h.right>v.right,bottom:h.bottom>v.bottom,left:h.left<v.left};return x.top||(p.value.y-=v.top-h.top),x.bottom||(p.value.y-=v.bottom-h.bottom),x.right||(p.value.x-=v.right-h.right),x.left||(p.value.x-=v.left-h.left),f(),x}function E(h){h&&(d.value&&h.subtract(d.value),p.value.set(h),f(),S())}function b(h){l.value&&i.value&&(h.stopPropagation(),h.preventDefault(),E(Ie.fromEvent(h,s.value)))}function g(){var h;if(l.value){if(l.value=!1,m.value.add(p.value),p.value.reset(),(h=r.value)==null||h.classList.remove("ng-dragging"),!e.useTransform&&r.value){const{left:v,top:x}=r.value.getBoundingClientRect();r.value.style.left=Math.ceil(v)+"px",r.value.style.top=Math.ceil(x)+"px",r.value.style.transform="none"}t.emit("stopMove"),document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",g)}}function w(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",b),document.addEventListener("mouseup",g))}function O(){if(r.value){const h=Ie.getTransformInfo(r.value);m.value.set(h);return}m.value.reset()}function V(h){if(!o.value||h instanceof MouseEvent&&h.button===2)return;const v=h.target||h.srcElement;s.value!==void 0&&v&&!c(v,s.value)||i.value!==!1&&(document.body.click(),h.stopPropagation(),h.preventDefault(),d.value=Ie.fromEvent(h,r.value),O(),w())}function y(h,v,x){if(i.value&&v){if(h)s.value=h;else if(e.dragHandle){if(e.dragHandle instanceof HTMLElement)s.value=e.dragHandle;else if(typeof e.dragHandle=="string"){const F=v.querySelector(e.dragHandle);F&&(s.value=F)}}r.value=v,u.value=x,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",V)):i.value=!1}}return{registerDraggle:y,resetTranslate:O}}function xo(e,t){if(e){const o=r=>{r.key.toLowerCase()===e.toLowerCase()&&t({event:r,key:e})};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}}}function ci(e,t){const o=n.ref(e.enableEsc);let r=null;return o.value?(r=xo("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:r}):null}function ui(e,t){const o=n.ref(e.enableEnter);let r=null;return o.value?(r=xo("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:r}):null}const vt=n.defineComponent({name:"FModal",props:ai,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove","buttonClick"],setup(e,t){const o=n.ref(e.width||300),r=n.ref(e.height||200),i=n.ref(e.modelValue),a=n.ref(""),s=n.ref(e.class),u=n.ref(e.fitContent),l=n.ref(e.showHeader),d=n.ref(""),m=n.ref(e.showCloseButton),p=n.ref(e.showMaxButton),C=n.ref(!1),c=n.ref(e.dialogType),f=n.ref(e.src),S=n.ref(""),E=n.ref(e.showButtons),b=n.ref(e.title),g=n.ref(e.containment||null),w=n.ref();b.value==="错误提示"&&(b.value=Ue.LocaleService.getLocaleValue("messageBox.errorTitle"));const O=n.ref(!1);function V(){const A=document.querySelectorAll(".farris-modal").length;(!A||A-1<=0)&&w.value===document.querySelectorAll(".farris-modal")[0]&&document.body.classList.remove("modal-open"),w.value&&w.value.classList.remove("show")}function y(A,ce){const Ne=ce?"accept":"cancel";Promise.resolve().then(()=>{var Ve;return(Ve=e.beforeClose)==null?void 0:Ve.call(e,{closeType:Ne})}).then(Ve=>{Ve&&(i.value=!1,t.emit("update:modelValue",!1),ce!=null&&t.emit(ce?"accept":"cancel"),t.emit("closed",A),V())})}const h=[{name:"cancel",text:Ue.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:A=>{y(A,!1)}},{name:"accept",text:Ue.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:A=>{y(A,!0)}}],v=n.ref(e.buttons&&e.buttons.length?e.buttons:h),x=n.computed(()=>!!d.value),F=n.computed(()=>!!E.value&&!!v.value),M=n.ref(),$=n.ref(),R=n.ref(e.maximized||!1),{renderResizeBar:j,maximize:_,restore:I,boundingElement:q,resizedEventParam:D,allowDrag:U,unWindowResizeHandle:ne,moveToCenter:N}=si(e),{registerDraggle:P}=li(e,t,U);function oe(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}n.watch(()=>e.title,(A,ce)=>{A!==ce&&(b.value=A)}),n.watch(()=>e.modelValue,(A,ce)=>{A!==ce&&(i.value=A,i.value&&e.draggable&&n.nextTick(()=>{$.value&&!g.value&&(g.value=$.value.parentElement,q.value=g.value,P(M.value,$.value,q.value),N())}),A||(g.value&&(g.value=null),V())),i.value?O.value=oe():(R.value=!1,U.value=e.draggable)}),n.watch(()=>e.showHeader,(A,ce)=>{A!==ce&&(l.value=A)}),n.watch(()=>e.showButtons,(A,ce)=>{A!==ce&&(E.value=A)}),n.watch(()=>D.value,(A,ce)=>{const Ne=A||{},Ve=ce||{};JSON.stringify(Ne)!==JSON.stringify(Ve)&&t.emit("resize",{newSize:A,oldSize:ce,isMaximized:R.value})}),n.watch([()=>e.width,()=>e.height],(A,ce)=>{(A[0]!==ce[0]||A[1]!==ce[1])&&(o.value=A[0]||500,r.value=A[1]||600)}),n.watch(()=>e.class,(A,ce)=>{s.value=A});const re=n.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),Z=n.computed(()=>{var Ne;const A={modal:!0,"farris-modal":!0,fade:!0,"fe-cmp-page-modal":!!e.showFloatingClose};A["f-modal-fitContent"]=!!u.value,A.show=!!re.value;const ce=(Ne=e.maskClass)==null?void 0:Ne.split(" ");return ce==null||ce.reduce((Ve,ze)=>(Ve[ze]=!0,Ve),A),A}),he=n.computed(()=>{var Ne;const A={"modal-dialog":!0},ce=(Ne=s.value)==null?void 0:Ne.split(" ");return ce==null||ce.reduce((Ve,ze)=>(Ve[ze]=!0,Ve),A),A}),xe=()=>De.isMobilePhone()&&!e.isMessager||!!e.fullscreen,fe=n.computed(()=>{const A=document.documentElement.clientWidth,ce=document.documentElement.clientHeight;if(R.value)return{position:"fixed",top:"0px",left:"0px",width:"100vw",height:"100vh",margin:"0"};const Ne=Math.min(o.value,A),Ve=e.position==="right"?"100%":u.value?"auto":`${Math.min(r.value,ce-10)}px`,ze=`${(window.innerHeight-(Ve==="100%"||Ve==="auto"?0:parseInt(Ve)))/2}px`,yt=e.position==="right"?`${window.innerWidth-Ne}px`:`${(window.innerWidth-Ne)/2}px`,lt={position:"absolute",top:ze,left:yt,width:De.isMobilePhone()?"auto":`${Ne}px`,height:Ve};return e.mask||(lt.pointerEvents="auto"),lt}),ee=n.ref(De.getMaxZIndex()||1050),T=n.computed(()=>{const A={display:"block",overflow:"hidden"};return e.mask||(A.pointerEvents="none",A.backgroundColor="transparent"),O.value&&(A.backgroundColor="transparent"),A.zIndex=ee.value,A}),ie=n.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value,"is-mobile":xe()})),ae=n.computed(()=>{const A={display:l.value?"":"none"};return A["pointer-events"]=U.value?"auto":"none",A}),le=n.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:R.value})),ye=n.computed(()=>({"modal-body":!0,"f-utils-flex-column":c.value==="iframe","f-utils-fill":!0}));function ke(){return{height:`${e.footerHeight||60}px`}}const qe=n.computed(()=>{const A={textAlgin:S.value},ce=ke();return Object.assign(A,ce)});function Le(A){if(A==null||A.stopPropagation(),R.value){R.value=!1,I();return}_(),R.value=!0}async function Te(A,ce){A.handle?await A.handle(ce,A)&&t.emit("closed",ce):t.emit("buttonClick",{button:A,$event:ce})}function Pe(A){A.width&&(o.value=A.width),A.height&&(r.value=A.height),A.buttons&&(v.value=A.buttons),A.title&&(b.value=A.title)}let Oe=null,Be=null;n.onBeforeMount(()=>{O.value=oe()}),n.onMounted(()=>{$.value&&!g.value&&(g.value=$.value.parentElement,q.value=g.value,P(M.value,$.value,q.value)),re.value&&document.body.classList.add("modal-open"),Oe=ci(e,t),Be=ui(e,t)}),n.onUnmounted(()=>{ne&&ne(),Oe&&Oe.remove(),Be&&Be.remove()}),t.expose({modalElementRef:$,updateModalOptions:Pe,close:y,maxDialog:Le,isMaximized:R,disableButtons:(A,ce=!0)=>{v.value.forEach(Ne=>{Ne.name&&A.includes(Ne.name)&&(Ne.disabled=ce)})}});function Ee(){return n.createVNode("div",{class:"action-wrapper",onClick:A=>y(A,!1)},[n.createVNode("span",{class:"close-icon"},[n.createVNode("i",{class:"f-icon f-icon-close"},null)])])}function at(){return n.createVNode("ul",null,[C.value&&n.createVNode("li",{class:"f-btn-icon f-bare"},[n.createVNode("span",{class:"f-icon modal_minimize"},null)]),p.value&&n.createVNode("li",{onClick:Le,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[n.createVNode("span",{class:le.value},null)]),m.value&&n.createVNode("li",{class:"f-btn-icon f-bare",onClick:A=>y(A,!1),style:"pointer-events: auto;"},[n.createVNode("span",{class:"f-icon modal_close"},null)])])}const ut=A=>{A.preventDefault();const ce=A.currentTarget,Ne=A.deltaY*.5;ce.scrollLeft+=Ne};function dt(){return n.createVNode("div",{class:"modal-footer",style:qe.value},[v.value&&n.createVNode("div",{class:"buttons",onWheel:ut},[v.value.map(A=>{var Ve;const ce=n.ref(A.disabled),Ne=A.class||((Ve=A.appearance)==null?void 0:Ve.class);return n.createVNode("button",{name:A.name,style:A.styles,type:"button",disabled:ce.value,class:Ne+(A.iconClass?" btn-icontext":"")+(A.visible===!1?"d-none":""),onClick:ze=>{Te(A,ze)}},[!!A.iconClass&&n.createVNode("i",{class:A.iconClass},null),A.text])})])])}function Xe(A){p.value&&Le()}function et(){return n.createVNode(n.Fragment,null,[R.value&&n.createVNode("div",{class:"modal-header",style:"position: absolute;background: transparent;height: 45px;width: 100%;",onDblclick:A=>Xe()},null),n.createVNode("div",{ref:M,class:"modal-header",style:ae.value,onDblclick:A=>Xe()},[t.slots.headerTemplate?t.slots.headerTemplate():n.createVNode("div",{class:"modal-title"},[x.value&&n.createVNode("span",{class:d.value,style:"margin-right: 8px"},null),n.createVNode("span",{class:"modal-title-label"},[b.value])]),n.createVNode("div",{class:"actions"},[at()])])])}function ft(){return t.slots.footerTemplate?t.slots.footerTemplate():F.value&&dt()}function ot(A){if(A.stopPropagation(),e.allowClickMaskToClose){if(A.target!==w.value)return;y(A,!1)}}function st(){var A,ce;return n.createVNode("div",{id:a.value,class:he.value,style:fe.value,ref:$},[e.showFloatingClose&&Ee(),n.createVNode("div",{class:ie.value},[l.value&&et(),n.createVNode("div",{class:ye.value},[(ce=(A=t.slots).default)==null?void 0:ce.call(A),c.value==="iframe"&&n.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:f.value},null)]),ft()]),!u.value&&$.value&&!R.value&&j($.value)])}function Me(A){return A||"body"}return n.watchEffect(()=>{re.value&&(ee.value=De.getMaxZIndex()||1050)}),()=>n.createVNode(n.Teleport,{to:Me(e.host)},{default:()=>[re.value&&n.createVNode(n.Transition,{name:"fade",appear:!0},{default:()=>[n.createVNode("div",{ref:w,class:Z.value,style:T.value,onClick:ot},[st()])]})]})}});function To(e){if(e.content&&e.content.render)return e.content.render;if(e.render&&typeof e.render=="function")return e.render}function di(e){const t=document.createElement("div");t.style.display="contents";const o=e.type||"modal",r=n.createApp({setup(i,a){n.onUnmounted(()=>{document.body.removeChild(t)});const s=n.ref(),u=n.ref(e.class||""),l=n.ref(!0),d=n.ref(e.title||""),m=To(e),p=e.closedCallback||(V=>{}),C=V=>{l.value=!1,r.unmount(),p(V)};if(a.expose({ref:s}),o==="drawer")return()=>n.createVNode(lo,{ref:s,modelValue:l.value,"onUpdate:modelValue":V=>l.value=V,id:"modal-service-drawer",title:d.value,width:e.width,height:e.height,position:e.position,backgroundColor:e.backgroundColor,host:e.host,showMask:e.showMask,allowClickMaskToClose:e.allowClickMaskToClose,transparent:e.transparent,showHeader:e.showHeader,showFooter:e.showButtons,buttons:e.buttons,beforeClose:e.beforeClose,customClass:u.value,onAfterClose:C},{default:()=>[m&&m(r)]});const c=n.ref(!!e.showButtons),f=n.ref(!!e.showHeader),S=n.ref(e.showCloseButton==null?!0:e.showCloseButton),E=n.ref(!!e.showFloatingClose),b=e.acceptCallback||(()=>{}),g=e.rejectCallback||(()=>{}),w=e.resizeHandle||(V=>{}),O=e.stopMoveHandle||(V=>{});return()=>n.createVNode(vt,{ref:s,class:u.value,modelValue:l.value,"onUpdate:modelValue":V=>l.value=V,title:d.value,width:e.width,height:e.height,buttons:e.buttons,"show-header":f.value,"show-buttons":c.value,"show-close-button":S.value,"show-max-button":!1,showFloatingClose:E.value,onAccept:b,onCancel:g,fitContent:e.fitContent==null?!0:e.fitContent,onClosed:C,onResize:w,onStopMove:O},{default:()=>[m&&m(r)]})}});return document.body.appendChild(t),r.use(Ue.LocaleService.i18n),r.mount(t),r}class fi{constructor(t){we(this,"appContext",null);we(this,"modalRef",n.ref());we(this,"activeModalIndex",n.ref(0));we(this,"modalRefs",{});we(this,"isUseEscCloseModal",n.ref(!1));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.modalRefs[this.activeModalIndex.value]}adaptToWindow(t,o){const{width:r,height:i}={width:window.innerWidth,height:window.innerHeight};return r<t&&(t=r-14),i<o&&(o=i-14),{width:t,height:o}}static show(t){const o=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return di(o)}close(t){var o,r;t?(r=t.value)==null||r.close():(o=this.getCurrentModal())==null||o.close()}open(t){const o=document.createDocumentFragment(),r=t.type||"modal";t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const i=n.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0,maximized:!1},t)),a=n.ref(!0),s=To(i.value),u=i.value.closedCallback||((b,g)=>{}),l=i.value.openedCallback||(b=>{});let d;const m=b=>{var w;a.value=!1;const g=(w=b==null?void 0:b.target)==null?void 0:w.classList.contains("modal_close");u(b,this.isUseEscCloseModal.value?"esc":g?"icon":"button")},p=b=>{m(b),d&&n.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],n.render(null,o),d=null,this.modalRef.value=null,this.modalRefs){const g=Object.keys(this.modalRefs).map(w=>Number(w));g.length>0?this.activeModalIndex.value=Math.max(...g):this.activeModalIndex.value=0,this.modalRefs[this.activeModalIndex.value]&&(this.modalRef.value=this.modalRefs[this.activeModalIndex.value])}this.isUseEscCloseModal.value=!1})},C=n.ref();let c;if(r==="drawer")c=()=>n.createVNode(lo,n.mergeProps({ref:C,modelValue:a.value,"onUpdate:modelValue":b=>a.value=b,id:"modal-service-drawer"},i.value,{onAfterClose:p}),{default:()=>[s&&s(this.app)]});else{const b=i.value.acceptCallback||(()=>{}),g=i.value.rejectCallback||(()=>{}),w=i.value.resizeHandle||(x=>{}),O=t.stopMoveHandle||(x=>{}),V=x=>{var F;this.isUseEscCloseModal.value=!0,(F=this.getCurrentModal())==null||F.close(x==null?void 0:x.event)},{width:y,height:h}=i.value,v=this.adaptToWindow(Number(y)||500,Number(h)||320);Object.assign(i.value,v),c=()=>n.createVNode(vt,n.mergeProps({ref:C,modelValue:a.value,"onUpdate:modelValue":x=>a.value=x},i.value,{isMessager:i.value.class&&i.value.class.indexOf("modal-message")>-1,onAccept:b,onCancel:g,onClosed:p,onResize:w,onEsc:V,onStopMove:O,maximized:i.value.maximized}),{default:()=>[s&&s(this.app)]})}d=(b=>{const g=n.h(c,b);return g.appContext=this.appContext,n.render(g,o),g})({...i.value}),this.activeModalIndex.value++;const S=this.activeModalIndex.value;this.modalRefs[S]=C.value;const E=b=>{i.value={...i.value,...b},d&&n.render(n.cloneVNode(d,{...i}),o)};return n.nextTick(()=>{this.modalRefs[S]=C.value,this.modalRef.value=C.value,l(new Event("opened"))}),{update:E,destroy:p,modalRef:C,close:()=>{var b;(b=C.value)==null||b.close()},disableButtons:(b,g=!0)=>{var w,O;(O=(w=C.value)==null?void 0:w.disableButtons)==null||O.call(w,b,g)}}}}const No=Symbol("FModalService");vt.install=e=>{e.component(vt.name,vt);const t=new fi(e);e.provide(No,t),e.provide("FModalService",t)};const Vo=n.ref(0);function Fo(){Vo.value++}const mi=n.defineComponent({name:"FDesignerCanvas",props:uo,emits:["init","selectionChange","canvasChanged","dragEnd"],setup(e,t){const o=n.ref(),r=n.ref(),i=n.ref(),a=n.ref(),s=n.ref(),u=n.ref(),l=n.ref(e.componentId),d=n.ref(e.canvasMode);let m,p;const C=n.inject("designerContext"),c={eventsEditorUtils:n.inject("eventsEditorUtils"),formSchemaUtils:n.inject("useFormSchema"),formMetadataConverter:n.inject("formMetadataConverter"),designViewModelUtils:n.inject("designViewModelUtils"),controlCreatorUtils:n.inject("controlCreatorUtils"),metadataService:n.inject("Meatdata_Http_Service_Token"),schemaService:n.inject("schemaService"),useFormCommand:n.inject("useFormCommand"),modalService:n.inject(No),formStateMachineUtils:n.inject("useFormStateMachine"),messagerService:n.inject("FMessageBoxService"),designerContext:C,componentSchemaService:n.inject("SchemaService"),dialogCodeView:n.inject("dialogCodeView")};n.provide("designer-host-service",c);const f=Jr(c,C);e.components&&ni(e.components),ti(),n.provide("canvas-dragula",f),n.provide("design-item-context",{designerItemElementRef:s,componentInstance:u,schema:r.value,parent:void 0});const S=n.computed(()=>({"d-flex":!0,"flex-fill":!0,"flex-column":!0})),E=n.computed(()=>({editorPanel:!0,"d-flex":!0,"flex-fill":!0,"flex-column":!0,[d.value]:!0}));n.watch([()=>e.modelValue,()=>e.componentId,()=>e.canvasMode],([V,y,h])=>{o.value=V,l.value=y,d.value=h}),n.watch(Ze,()=>{gt(i.value),t.emit("canvasChanged")},{flush:"post"});function b(){m=new ResizeObserver(()=>{p&&clearTimeout(p),p=setTimeout(()=>{gt(a.value)})}),m.observe(a.value)}function g(V,y,h,v){t.emit("selectionChange",V,y,h,v)}function w(){t.emit("dragEnd")}function O(){a.value.addEventListener("scroll",V=>{gt(a.value)})}return n.onMounted(()=>{i.value&&f.initializeDragula(i.value),o.value=e.modelValue,t.emit("init",f),b(),O()}),n.onUnmounted(()=>{m&&(m.unobserve(i.value),m.disconnect(),m=null)}),t.expose({refreshCanvas:Fo,changeCanvas:nr,designerCanvasElementRef:i,designerCanvasContainerElementRef:a,designerHostService:c}),()=>n.createVNode("div",{class:"editorDiv flex-fill h-100",ref:a},[n.createVNode("div",{class:E.value},[n.createVNode("div",{ref:i,class:S.value},[o.value&&n.createVNode(Bt,{key:Vo.value,modelValue:o.value,"onUpdate:modelValue":V=>o.value=V,onSelectionChange:g,componentId:l.value,onDragEnd:w},null)])])])}}),pi={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}};function Eo(e,t,o){var v;const r=o&&o.getStyles&&o.getStyles()||"",i=n.ref();let a;function s(){return o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function u(){return!1}function l(){return o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function d(){return o&&o.checkCanAddComponent?o.checkCanAddComponent():!0}function m(x){if(!x||!x.value)return null;const F=n.ref(x==null?void 0:x.value.parent),M=m(F);return M||null}function p(x=t){var R;const{componentInstance:F,designerItemElementRef:M}=x;if(!F||!F.value)return null;const{getCustomButtons:$}=F.value;return F.value.canMove||F.value.canAdd||F.value.canDelete||$&&((R=$())!=null&&R.length)?M:p(x.parent)}function C(){if(o&&o.getCustomButtons)return o.getCustomButtons()}function c(x){return!!o&&o.canAccepts(x)}function f(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function S(){}function E(x,F){!x||!F||o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(x,F)}function b(x){const{componentType:F}=x,M=n.inject("designer-host-service");let $=je.getSchemaByTypeForDesigner(F,x,M);o&&o.onResolveNewComponentSchema&&($=o.onResolveNewComponentSchema(x,$));const R=F.toLowerCase().replace(/-/g,"_");return $&&!$.id&&$.type===F&&($.id=`${R}_${Math.random().toString().slice(2,6)}`),$}function g(x){}function w(...x){return o&&o.getPropsConfig?o.getPropsConfig(...x):[]}function O(){}function V(x){var M;if(!(t!=null&&t.schema))return;if(o!=null&&o.setComponentBasicInfoMap){o.setComponentBasicInfoMap();return}let F="";if(o!=null&&o.getComponentTitle)F=o.getComponentTitle();else{const{text:$,title:R,label:j,mainTitle:_,name:I,type:q}=t.schema;F=$||R||j||_||I||((M=Fe[q])==null?void 0:M.name)}F&&(!a&&x&&(a=x.formSchemaUtils),a.getControlBasicInfoMap().set(t.schema.id,{componentTitle:F,parentPathName:F}))}function y(x){var R;const{changeObject:F}=x,{propertyID:M,propertyValue:$}=F;["text","title","label","name","mainTitle"].includes((R=x==null?void 0:x.changeObject)==null?void 0:R.propertyID)&&M&&$&&V()}function h(x){if(y(x),o&&o.onPropertyChanged)return o.onPropertyChanged(x)}return i.value={canMove:s(),canSelectParent:u(),canAdd:d(),canDelete:l(),canNested:!1,contents:[],elementRef:e,parent:(v=t.parent)==null?void 0:v.componentInstance,schema:t.schema,styles:r,canAccepts:c,getBelongedComponentInstance:m,getDraggableDesignItemElement:p,getDraggingDisplayText:f,getPropConfig:w,getDragScopeElement:S,onAcceptMovedChildElement:E,onChildElementMovedOut:g,addNewChildComponentSchema:b,onRemoveComponent:O,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||n.ref(!1),onPropertyChanged:h,getCustomButtons:C,setComponentBasicInfoMap:V},i}const gi=n.defineComponent({name:"FDesignerInnerItem",props:pi,emits:["selectionChange","addComponent","removeComponent","clickButton"],setup(e,t){const o=n.ref(e.canMove),r=n.ref(e.canAdd),i=n.ref(e.canDelete),a=n.ref(!1),s=n.ref(e.contentKey),u=n.ref(e.childType),l=n.ref(e.childLabel),d=n.ref(e.modelValue),m=n.ref(""),p=n.ref(),C=n.inject("canvas-dragula"),c=n.ref(),f=n.inject("design-item-context"),S={designerItemElementRef:p,componentInstance:c,schema:d.value,parent:f,setupContext:t};n.provide("design-item-context",S);const E=n.inject("designer-host-service"),b=n.inject("external-container-id"),g=n.computed(()=>{var D;const I=((D=c.value)==null?void 0:D.getCustomButtons)&&c.value.getCustomButtons();return{"farris-component":!0,"flex-fill":e.id==="root-component","position-relative":o.value||i.value||(I==null?void 0:I.length),"farris-nested":a.value,"can-move":o.value,"d-none":p.value&&p.value.classList.contains("d-none")}}),w=n.computed(()=>{const I={};return m.value&&m.value.split(";").reduce((q,D)=>{const[U,ne]=D.split(":");return U&&(q[U]=ne),q},I),I});function O(I,q){if(f&&f.schema[s.value]){const D=f.schema[s.value].findIndex(U=>U.id===q.id);if(D>-1){const U=f.schema[s.value].length,ne=f.schema[s.value][D%U];f.designerItemElementRef.value.querySelector(`#${ne.id}-design-item`),f.schema[s.value].splice(D,1),Ze.value++,t.emit("removeComponent"),t.emit("selectionChange")}}}function V(I){if(c.value.addNewChildComponentSchema){const q={componentType:u.value,label:l.value,parentComponentInstance:c.value,targetPosition:-1},D=c.value.addNewChildComponentSchema(q);d.value[s.value].push(D),t.emit("addComponent")}}function y(){return r.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:I=>{V()}},[n.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function h(I){return i.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:n.withModifiers(q=>O(q,I),["stop"])},[n.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function v(){return o.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[n.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function x(){var q;const I=((q=c.value)==null?void 0:q.getCustomButtons)&&c.value.getCustomButtons();return I&&!!I.length&&I.map(D=>n.createVNode("div",{role:"button",class:`btn component-settings-button ${D.class||""} ${D.text?"settings-button-extend":""}`,title:D.title,ref:D.id,onClick:U=>D.onClick&&D.onClick(U)},[n.createVNode("i",{class:"f-icon "+D.icon},null),D.text&&n.createVNode("span",{class:"icon-text"},[D.text])]))}function F(I){return n.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[n.createVNode("div",null,[y(),v(),h(I),x()])])}n.watch(()=>e.modelValue,I=>{d.value=I,S.schema=I});function M(I){window.scrollContainerList||(window.scrollContainerList=new Set);const q=I.getAttribute("id");q&&window.scrollContainerList.add(q)}function $(I){const q=I.target;M(q),gt(q)}function R(){var I,q;(q=(I=d.value)==null?void 0:I.contents)!=null&&q.length&&p.value&&p.value.addEventListener("scroll",$)}function j(){const I=p.value,q=n.ref(I.children[1]);return Eo(q,S).value}n.onMounted(()=>{if(p.value){const I=p.value.querySelector(`[data-dragref='${d.value.id}-container']`);c.value=I&&I.componentInstance?I.componentInstance.value:j(),C&&I&&C.attachComponents(I,d.value),a.value=c.value.canNested!==void 0?c.value.canNested:a.value,r.value=c.value.canAdd!==void 0?c.value.canAdd:r.value,i.value=c.value.canDelete!==void 0?c.value.canDelete:i.value,o.value=c.value.canMove!==void 0?c.value.canMove:o.value,m.value=c.value.styles||"",p.value&&(p.value.componentInstance=c,p.value.designItemContext=S),c.value.setComponentBasicInfoMap(E)}R(),Ze.value++}),n.onBeforeUnmount(()=>{p.value&&p.value.removeEventListener("scroll",$)});function _(I){if(I&&(I.preventDefault(),I.stopPropagation()),b){const U=document.getElementById(`${b}-design-item`);U&&U.click();return}let q=S.designerItemElementRef;const D=p.value;if(D){const U=document.getElementsByClassName("dgComponentFocused");U&&U.length===1&&U[0]===p.value&&p.value.classList.contains("dgComponentSelected")||(Array.from(U).forEach(N=>N.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(N=>N.classList.remove("dgComponentSelected")),D.classList.add("dgComponentFocused"),t.emit("selectionChange",d.value.type,d.value,e.componentId,c.value),c.value.getDraggableDesignItemElement&&(q=c.value.getDraggableDesignItemElement(S),q&&q.value&&q.value.classList.add("dgComponentSelected")))}Vt(q==null?void 0:q.value)}return()=>n.createVNode("div",{id:`${e.id}-design-item`,ref:p,class:g.value,style:w.value,onClick:_},[F(d.value),t.slots.default&&t.slots.default()])}});function hi(e,t,o){var R;const r=o&&o.getStyles&&o.getStyles()||"",i=o&&o.getDesignerClass&&o.getDesignerClass()||"",a=n.ref();let s;function u(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function l(){return!1}function d(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function m(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:o&&o.hideNestedPaddingInDesginerView?o.hideNestedPaddingInDesginerView():!1}function p(j){if(!j||!j.value)return null;if(j.value.schema&&j.value.schema.type==="component")return j.value;const _=n.ref(j==null?void 0:j.value.parent),I=p(_);return I||null}function C(j=t){var D;if(o!=null&&o.getDraggableDesignItemElement)return o.getDraggableDesignItemElement(j);const{componentInstance:_,designerItemElementRef:I}=j;if(!_||!_.value)return null;const{getCustomButtons:q}=_.value;return _.value.canMove||q&&((D=q())!=null&&D.length)?I:C(j.parent)}function c(j){return!!o&&o.canAccepts(j)}function f(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function S(){}function E(j,_){var I;!j||!_||(o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(j,_),(I=t==null?void 0:t.setupContext)==null||I.emit("dragEnd"))}function b(j,_){const{componentType:I}=j;let q=je.getSchemaByTypeForDesigner(I,j,_);o&&o.onResolveNewComponentSchema&&(q=o.onResolveNewComponentSchema(j,q));const D=I.toLowerCase().replace(/-/g,"_");return q&&!q.id&&q.type===I&&(q.id=`${D}_${Math.random().toString().slice(2,6)}`),q}function g(j){j&&o!=null&&o.onChildElementMovedOut&&o.onChildElementMovedOut(j)}function w(...j){if(o&&o.getPropsConfig)return o.getPropsConfig(...j)}function O(){if(o&&o.getDesignerHostService)return o.getDesignerHostService()}function V(j){if(!j)return;const _=t==null?void 0:t.schema,{formSchemaUtils:I}=j;if(_&&I.getExpressions().length){const q=I.getExpressions().findIndex(D=>D.target===_.id);q>-1&&I.getExpressions().splice(q,1)}}function y(j){if(!j||!(t!=null&&t.schema))return;const _=t.schema,{formSchemaUtils:I}=j;I.removeCommunicationInComponent(_)}function h(j){o&&o.onRemoveComponent&&o.onRemoveComponent(),V(j),y(j),t!=null&&t.schema.contents&&t.schema.contents.map(_=>{let I=_.id;_.type==="component-ref"&&(I=_.component);const q=e.value.querySelectorAll(`#${I}-design-item`);q!=null&&q.length&&Array.from(q).map(D=>{var U;(U=D==null?void 0:D.componentInstance)!=null&&U.value.onRemoveComponent&&D.componentInstance.value.onRemoveComponent(j)})})}function v(){if(o&&o.getCustomButtons)return o.getCustomButtons()}function x(j){var I,q;if(!((I=t==null?void 0:t.schema)!=null&&I.id))return;if(!s&&j&&(s=j.formSchemaUtils),o!=null&&o.setComponentBasicInfoMap){o.setComponentBasicInfoMap();return}let _="";if(o!=null&&o.getComponentTitle)_=o.getComponentTitle();else{const{text:D,title:U,label:ne,mainTitle:N,name:P,type:oe}=t.schema;_=D||U||ne||N||P||((q=Fe[oe])==null?void 0:q.name)}_&&s.getControlBasicInfoMap().set(t.schema.id,{componentTitle:_,parentPathName:_})}function F(j){var D;const{changeObject:_}=j,{propertyID:I,propertyValue:q}=_;if(["text","title","label","name","mainTitle"].includes((D=j==null?void 0:j.changeObject)==null?void 0:D.propertyID)&&I&&q&&(x(),s)){const U=s.getControlBasicInfoMap(),ne=U.keys().toArray().filter(N=>{var P,oe;return((P=U.get(N))==null?void 0:P.reliedComponentId)===((oe=t==null?void 0:t.schema)==null?void 0:oe.id)});ne!=null&&ne.length&&ne.forEach(N=>{const P=U.get(N).parentPathName.split(" > ");P[0]=q,U.get(N).parentPathName=P.join(" > ")})}}function M(j){if(F(j),o&&o.onPropertyChanged)return o.onPropertyChanged(j)}function $(){return o!=null&&o.shouldApplyClassToComponent?o.shouldApplyClassToComponent():!0}return a.value={canMove:u(),canSelectParent:l(),canDelete:d(),canNested:!m(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:(R=t==null?void 0:t.parent)==null?void 0:R.componentInstance,schema:t==null?void 0:t.schema,styles:r,designerClass:i,canAccepts:c,getBelongedComponentInstance:p,getDraggableDesignItemElement:C,getDraggingDisplayText:f,getPropConfig:w,getDesignerHostService:O,getDragScopeElement:S,onAcceptMovedChildElement:E,onChildElementMovedOut:g,addNewChildComponentSchema:b,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||n.ref(!1),onRemoveComponent:h,getCustomButtons:v,onPropertyChanged:M,setComponentBasicInfoMap:x,updateContextSchema:t==null?void 0:t.updateContextSchema,shouldApplyClassToComponent:$},a}class vi{getTemplateRule(t,o){const r=o==null?void 0:o.formSchemaUtils,i=r==null?void 0:r.getFormTemplateRule(),a={canAccept:!0,canDelete:!0,canMove:!0};if(!i)return a;const s=this.getComponentContext(t),{componentClassList:u}=s;return u.forEach(l=>{if(!l||!i[l])return;const{canMove:d,canDelete:m,canAccept:p}=i[l];a.canMove=a.canMove&&this.resolveRuleValue(d,s),a.canDelete=a.canDelete&&this.resolveRuleValue(m,s),a.canAccept=a.canAccept&&this.resolveRuleValue(p,s)}),a}resolveRuleValue(t,o){return typeof t=="boolean"?t:this.parseRuleValueSchema(t,o)}parseRuleValueSchema(t,o){const r=t.invalidContext||[];let i=!0;for(const a of r){const{firstLevelChild:s,secondLevelChild:u,parent:l,...d}=a;if(d&&o.component){let m=!0;for(const p of Object.keys(d))if(d[p]!==o.component[p]){m=!1;break}if(!m){i=!1;continue}}if(a.firstLevelChild){if(a.firstLevelChild.class){const{firstLevelChildClassList:m}=o;if(m&&!m.includes(a.firstLevelChild.class)){i=!1;continue}}if(a.firstLevelChild.type){const{firstLevelChildSchema:m}=o;if(!m||m.type!==a.firstLevelChild.type){i=!1;continue}}}if(a.secondLevelChild){if(a.secondLevelChild.class){const{secondLevelChildClassList:m}=o;if(m&&!m.includes(a.secondLevelChild.class)){i=!1;continue}}if(a.secondLevelChild.type){const{secondLevelChildSchema:m}=o;if(!m||m.type!==a.secondLevelChild.type){i=!1;continue}}}if(a.parent){if(a.parent.class){const{parentClassList:m}=o;if(m&&!m.includes(a.parent.class)){i=!1;continue}}if(a.parent.type){const{parentSchema:m}=o;if(m&&m.type!==a.parent.type){i=!1;continue}}}i=!0;break}return!i}getComponentContext(t){var S,E,b,g;const o=t.schema,r=o.appearance&&o.appearance.class||"",i=r.split(" ")||[],a=o.contents||[],s=a.length?a[0]:null,u=s&&s.appearance?s.appearance.class:"",l=u?u.split(" "):[],d=(S=s==null?void 0:s.contents)!=null&&S.length?s==null?void 0:s.contents[0]:null,m=d&&d.appearance?d.appearance.class:"",p=m?m.split(" "):[],C=o.type==="component"?(b=(E=t.parent)==null?void 0:E.parent)==null?void 0:b.schema:(g=t.parent)==null?void 0:g.schema,c=C&&C.appearance&&C.appearance.class||"",f=c?c.split(" "):[];return{componentClass:r,componentClassList:i,childContents:a,firstLevelChildSchema:s,firstLevelChildClass:u,firstLevelChildClassList:l,secondLevelChildSchema:d,secondLevelChildClass:m,secondLevelChildClassList:p,parentSchema:C,parentClass:c,parentClassList:f,component:o}}}function yi(){function e(t,o){var s;if(!t)return!1;const r=((s=t.targetContainer)==null?void 0:s.componentInstance)&&t.targetContainer.componentInstance.value;if(!r)return!1;const i=r.schema.type,a=o==null?void 0:o.formSchemaUtils.getComponentById(r.belongedComponentId);return!((t.componentCategory==="input"||t.componentType==="form-group")&&![Fe["response-layout-item"].type,Fe["response-form"].type,Fe.fieldset.type].includes(i)||(t.componentType===Fe.tabs.type||t.componentType===Fe.section.type)&&((a==null?void 0:a.componentType)!=="frame"||![Fe["content-container"].type,Fe["splitter-pane"].type,Fe["response-layout-item"].type,Fe.drawer.type].includes(i))||[Fe["query-solution"].type,Fe["filter-bar"].type,Fe.drawer.type].includes(t.componentType)||t.componentType===Fe.fieldset.type&&i!==Fe["response-form"].type||t.componentCategory==="dataCollection"&&(a==null?void 0:a.componentType)!=="frame")}return{basalDragulaRuleForContainer:e}}B.DgControl=Fe,B.FDesignerCanvas=mi,B.FDesignerInnerItem=gi,B.FDesignerItem=Bt,B.UseTemplateDragAndDropRules=vi,B.canvasChanged=Ze,B.componentMap=X,B.componentPropsConverter=Q,B.designerCanvasProps=uo,B.refreshCanvas=Fo,B.setPositionForSelectedElement=qt,B.setPositionOfButtonGroup=Vt,B.setPositionOfSelectedComponentBtnGroup=rr,B.useDesignerComponent=hi,B.useDesignerInnerComponent=Eo,B.useDragulaCommonRule=yi,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
1
+ (function(B,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es"),require("../locale/index.umd.js"),require("bignumber.js"),require("../common/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../common/index.umd.js/utils/resolve-field"),require("../input-group/index.umd.js"),require("../button/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../dynamic-view/index.umd.js"),require("../section/index.umd.js"),require("../accordion/index.umd.js"),require("../../designer/avatar/index.umd.js"),require("../../designer/approval-logs/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../table/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../../designer/dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../../designer/nav/index.umd.js"),require("../number-range/index.umd.js"),require("../../designer/number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../field-search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../../designer/modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../../designer/wizard/index.umd.js"),require("../tooltip/index.umd.js"),require("../property-panel/index.umd.js"),require("../notify/index.umd.js"),require("../drawer/index.umd.js"),require("../collection-property-editor/index.umd.js/src/use-button-items.designer")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../locale/index.umd.js","bignumber.js","../common/index.umd.js","@vueuse/core","../data-view/index.umd.js","../common/index.umd.js/utils/resolve-field","../input-group/index.umd.js","../button/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../dynamic-view/index.umd.js","../section/index.umd.js","../accordion/index.umd.js","../../designer/avatar/index.umd.js","../../designer/approval-logs/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../table/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../../designer/dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../../designer/nav/index.umd.js","../number-range/index.umd.js","../../designer/number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../search-box/index.umd.js","../field-search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../text/index.umd.js","../../designer/time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../../designer/modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../../designer/wizard/index.umd.js","../tooltip/index.umd.js","../property-panel/index.umd.js","../notify/index.umd.js","../drawer/index.umd.js","../collection-property-editor/index.umd.js/src/use-button-items.designer"],n):(B=typeof globalThis<"u"?globalThis:B||self,n(B["designer-canvas"]={},B.Vue,B.LodashES,B.locale,B.BigNumber,B.common,B.VueUseCore,B.dataView,B.resolveField,B.FInputGroup,B.FButton,B.dynamicResolver,B.designerCanvas,B.dynamicView,B.FSection,B.FAccordion,B.FAvatar,B.FApprovalLogs,B.FButtonEdit,B.FButtonGroup,B.FCalendar,B.FCapsule,B.FCheckbox,B.FCheckboxGroup,B.FComboList,B.FComboTree,B.FComponent,B.FColorPicker,B.FContentContainer,B.FTable,B.FDatePicker,B.FDataGrid,B.FDropdown,B.FDynamicForm$1,B.FEventsEditor,B.FFilterBar,B.FFieldSelector,B.FBindingSelector,B.FImageCropper,B.FInputGroup$1,B.FLayout,B.FListNav,B.FListView,B.FLookup,B.FMappingEditor,B.FNav,B.FNumberRange,B.FNumberSpinner,B.FOrder,B.FPageHeader,B.FPageFooter,B.FPagination,B.FProgress,B.FQuerySolution,B.FRadioGroup,B.FRate,B.FResponseToolbar,B.FResponseLayout,B.FResponseLayoutEditorSetting,B.FSearchBox,B.FFieldSearchBox,B.FSection$1,B.FSmokeDetector,B.FSplitter,B.FStep$1,B.FSwitch,B.FTabs,B.FTags,B.FText,B.FTimePicker,B.FTransfer,B.FTreeview,B.FUploader,B.FVerifyDetail,B.FVideo,B.FTextArea,B.FSchemaSelector,B.FTreeGrid$1,B.FEventParameter,B.FFilterConditionEditor,B.FFieldset,B.FSortConditionEditor,B.FMenuLookup,B.FDrawer,B.FJsonEditor,B.FPropertyEditor,B.FExpressionEditor,B.FCodeEditor,B.FHtmlTemplate,B.FCollectionPropertyEditor,B.FModal$1,B.FExternalContainer,B.FLanguageTextbox,B.FImage,B.FComment,B.FWizard,B.FTooltip,null,B.notify,B.FDrawer$1))})(this,function(B,n,Se,Ue,ra,je,Po,de,Oo,Lo,ct,De,pt,Je,Ao,Qt,Jt,Zt,en,tn,nn,on,At,Nt,rn,qo,an,sn,ln,cn,un,dn,fn,mn,Ro,pn,_o,gn,hn,vn,yn,Cn,bn,wn,Uo,Sn,xn,Tn,Nn,Vn,Fn,En,Mn,jn,Dn,kn,Bn,In,Pn,On,Ln,An,qn,Rn,_n,Un,$n,zn,Hn,Wn,Gn,Yn,Kn,Xn,Qn,Jn,$o,Zn,zo,Ho,eo,Wo,Go,to,Yo,Ko,Xo,Qo,no,Jo,Zo,oo,ro,io,ao,so,er,ia,tr,lo){"use strict";var na=Object.defineProperty;var oa=(B,n,Se)=>n in B?na(B,n,{enumerable:!0,configurable:!0,writable:!0,value:Se}):B[n]=Se;var we=(B,n,Se)=>oa(B,typeof n!="symbol"?n+"":n,Se);const Ze=n.ref(0);function nr(){Ze.value++}function or(e,t){const o=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.top>=o.top,a=r.top<=o.bottom;return i&&a}function qt(e){const t=e.querySelector(".component-btn-group");if(!t)return;t.style.display="";const o=t.getBoundingClientRect();if(!(o.top===0&&o.left===0)){const r=t.querySelector("div");if(r){const i=r.getBoundingClientRect();r.style.top=o.top+"px";let a=o.left-i.width;const s=document.querySelector(".editorDiv");if(s){const u=s.getBoundingClientRect();a<u.left&&({left:a}=e.getBoundingClientRect())}r.style.left=a+"px"}}}function co(e){var o,r,i,a,s;if(!window.scrollContainerList)return;const t=Array.from(window.scrollContainerList);if(t.length)if(t.length===1){const u=t[0],l=document.querySelector(`[id=${u}]`);if(l&&l.contains(e))return l}else{const{componentInstance:u}=e;if(((o=u==null?void 0:u.value)==null?void 0:o.scrollElementId)===((r=u==null?void 0:u.value.schema)==null?void 0:r.id))return e;if(((i=u==null?void 0:u.value)==null?void 0:i.scrollElementId)===`${(a=u==null?void 0:u.value.schema)==null?void 0:a.id}-design-item`)return e.parentElement;if((s=u.value.parent)!=null&&s.elementRef)return co(u.value.parent.elementRef)}}function Vt(e){if(!e)return;const t=e.getBoundingClientRect();if(t.width===0&&t.height===0)return;const o=e.querySelector(".component-btn-group");if(o){let r=!0;const i=co(e);if(i&&(r=or(e,i)),!r){o.style.display="none";return}qt(e)}}function gt(e){if(!e)return;let t;e.className.includes("dgComponentSelected")?t=e:t=e.querySelector(".dgComponentSelected"),t&&Vt(t)}function rr(){const e=document.querySelector(".dgComponentSelected");if(!e)return;const t=e.querySelector(".component-btn-group");t&&t.getBoundingClientRect().top!==0&&qt(e)}const uo={modelValue:{type:Object,default:{}},componentId:{type:String,default:""},components:{type:Array},canvasMode:{type:String,default:"PC"}};var nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ft(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var fo={exports:{}};(function(e,t){(function(o){e.exports=o()})(function(){return function(){function o(r,i,a){function s(d,m){if(!i[d]){if(!r[d]){var p=typeof Ft=="function"&&Ft;if(!m&&p)return p(d,!0);if(u)return u(d,!0);var C=new Error("Cannot find module '"+d+"'");throw C.code="MODULE_NOT_FOUND",C}var c=i[d]={exports:{}};r[d][0].call(c.exports,function(f){var S=r[d][1][f];return s(S||f)},c,c.exports,o,r,i,a)}return i[d].exports}for(var u=typeof Ft=="function"&&Ft,l=0;l<a.length;l++)s(a[l]);return s}return o}()({1:[function(o,r,i){var a={},s="(?:^|\\s)",u="(?:\\s|$)";function l(p){var C=a[p];return C?C.lastIndex=0:a[p]=C=new RegExp(s+p+u,"g"),C}function d(p,C){var c=p.className;c.length?l(C).test(c)||(p.className+=" "+C):p.className=C}function m(p,C){p.className=p.className.replace(l(C)," ").trim()}r.exports={add:d,rm:m}},{}],2:[function(o,r,i){(function(a){var s=o("contra/emitter"),u=o("crossvent"),l=o("./classes"),d=document,m=d.documentElement;function p(M,$){var R=arguments.length;R===1&&Array.isArray(M)===!1&&($=M,M=[]);var j,_,I,q,D,U,ne,N,P,oe=null,re,Z,he=!1,xe=0,fe,ee=$||{};ee.moves===void 0&&(ee.moves=g),ee.accepts===void 0&&(ee.accepts=g),ee.invalid===void 0&&(ee.invalid=at),ee.containers===void 0&&(ee.containers=M||[]),ee.isContainer===void 0&&(ee.isContainer=b),ee.copy===void 0&&(ee.copy=!1),ee.copySortSource===void 0&&(ee.copySortSource=!1),ee.revertOnSpill===void 0&&(ee.revertOnSpill=!1),ee.removeOnSpill===void 0&&(ee.removeOnSpill=!1),ee.direction===void 0&&(ee.direction="vertical"),ee.ignoreInputTextSelection===void 0&&(ee.ignoreInputTextSelection=!0),ee.mirrorContainer===void 0&&(ee.mirrorContainer=d.body);var T=s({containers:ee.containers,start:Be,end:ut,cancel:ot,remove:ft,destroy:ke,canMove:Oe,dragging:!1});return ee.removeOnSpill===!0&&T.on("over",Ve).on("out",ze),ae(),T;function ie(k){return T.containers.indexOf(k)!==-1||ee.isContainer(k)}function ae(k){var K=k?"remove":"add";f(m,K,"mousedown",Le),f(m,K,"mouseup",Xe)}function le(k){var K=k?"remove":"add";f(m,K,"mousemove",Te)}function ye(k){var K=k?"remove":"add";u[K](m,"selectstart",qe),u[K](m,"click",qe)}function ke(){ae(!0),Xe({})}function qe(k){re&&k.preventDefault()}function Le(k){q=k.clientX,D=k.clientY;var K=S(k)!==1||k.metaKey||k.ctrlKey;if(!K){var J=k.target,se=Pe(J);se&&(re=se,le(),k.type==="mousedown"&&(y(J)?J.focus():k.preventDefault()))}}function Te(k){if(re){if(S(k)===0){Xe({});return}if(!(k.clientX!==void 0&&Math.abs(k.clientX-q)<=(ee.slideFactorX||0)&&k.clientY!==void 0&&Math.abs(k.clientY-D)<=(ee.slideFactorY||0))){if(ee.ignoreInputTextSelection){var K=F("clientX",k)||0,J=F("clientY",k)||0,se=d.elementFromPoint(K,J);if(y(se))return}var Ce=re;le(!0),ye(),ut(),Ee(Ce),l.add(N||I,"gu-transit"),lt(),yt(),xe=0,ce(k)}}}function Pe(k){if(!(T.dragging&&j)&&!ie(k)){for(var K=k;V(k)&&ie(V(k))===!1;)if(ee.invalid(k,K)||(k=V(k),!k))return;var J=V(k);if(J&&!ee.invalid(k,K)){var se=ee.moves(k,J,K,v(k));if(se)return{item:k,source:J}}}}function Oe(k){return!!Pe(k)}function Be(k){var K=Pe(k);K&&Ee(K)}function Ee(k){Yt(k.item,k.source)&&(N=k.item.cloneNode(!0),T.emit("cloned",N,k.item,"copy")),_=k.source,I=k.item,U=ne=v(k.item),T.dragging=!0,T.emit("drag",I,_)}function at(){return!1}function ut(){if(T.dragging){var k=N||I;et(k,V(k))}}function dt(){re=!1,le(!0),ye(!0)}function Xe(k){if(dt(),!!T.dragging){var K=N||I,J=F("clientX",k)||0,se=F("clientY",k)||0,Ce=E(j,J,se),be=A(Ce,J,se);be&&(N&&ee.copySortSource||!N||be!==_)?et(K,be):ee.removeOnSpill?ft():ot()}}function et(k,K){var J=V(k);N&&ee.copySortSource&&K===_&&J.removeChild(I),Me(K)?T.emit("cancel",k,_):T.emit("drop",k,K,_,ne),st()}function ft(){if(T.dragging){var k=N||I,K=V(k);K&&K.removeChild(k),T.emit(N?"cancel":"remove",k,K,_),st()}}function ot(k){if(T.dragging){var K=arguments.length>0?k:ee.revertOnSpill,J=N||I,se=V(J),Ce=Me(se);Ce===!1&&K&&(N?se&&se.removeChild(N):_.insertBefore(J,U)),Ce||K?T.emit("cancel",J,_,_):T.emit("drop",J,se,_,ne),st()}}function st(){var k=N||I;dt(),mt(),It(),k&&l.rm(k,"gu-transit"),P&&clearTimeout(P),T.dragging=!1,oe&&T.emit("out",k,oe,_),T.emit("dragend",k,xe),_=I=N=U=ne=P=oe=null}function Me(k,K){var J;return K!==void 0?J=K:j?J=ne:J=v(N||I),k===_&&J===U}function A(k,K,J){for(var se=k;se&&!Ce();)se=V(se);return se;function Ce(){var be=ie(se);if(be===!1)return!1;var Re=Pt(se,k),$e=Lt(se,Re,K,J),We=Me(se,$e);return We?!0:ee.accepts(I,se,_,$e)}}function ce(k){if(!j)return;k.preventDefault();var K=F("clientX",k)||0,J=F("clientY",k)||0;j.style.left=K-2+"px",j.style.top=J-2+"px";var se=N||I,Ce=E(j,K,J),be=A(Ce,K,J),Re=be!==null&&be!==oe;(Re||be===null)&&(He(),oe=be,Ge()),Ot(Ce,J);var $e=V(se);if(be===_&&N&&!ee.copySortSource){$e&&$e.removeChild(se);return}var We,Qe=Pt(be,Ce);if(he=zt(Qe,be),Qe!==null)We=Lt(be,Qe,K,J);else if(ee.revertOnSpill===!0&&!N)We=U,be=_;else{N&&$e&&$e.removeChild(se),N&&Z&&(Z.style.display="none");return}Z.style.display="block",Ne(We,se,Re),We?Wt(Qe,We):Gt(be);function Ae(_e){T.emit(_e,se,oe,_)}function Ge(){Re&&Ae("over")}function He(){oe&&Ae("out")}}function Ne(k,K,J){(k===K||k===v(K))&&(ne=v(K)),(k===null&&J||k!==K&&k!==v(K))&&(ne=k)}function Ve(k){l.rm(k,"gu-hide")}function ze(k){T.dragging&&l.add(k,"gu-hide")}function yt(){j||(j=document.createElement("div"),j.style="background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;",j.innerHTML=ee.getMirrorText&&ee.getMirrorText(I)||"控件",l.add(j,"gu-mirror"),ee.mirrorContainer.appendChild(j),f(m,"add","mousemove",ce),l.add(ee.mirrorContainer,"gu-unselectable"),T.emit("cloned",j,I,"mirror"))}function lt(){if(Z=document.createElement("div"),l.add(Z,"gu-insertion"),I){var k=I.getBoundingClientRect();Z.style.left=k.left+"px",Z.style.top=k.top+"px"}he=!1,ee.mirrorContainer.appendChild(Z)}function mt(){j&&(l.rm(ee.mirrorContainer,"gu-unselectable"),f(m,"remove","mousemove",ce),V(j).removeChild(j),j=null)}function It(){Z&&(V(Z).removeChild(Z),Z=null)}function Pt(k,K){for(var J=K;J!==k&&V(J)!==k;)J=V(J);return J===m?null:J}function zt(k,K){if(!K)return he;var J=k||K&&K.lastElementChild;if(!J)return!0;var se=getComputedStyle(k),Ce=/^inline/.test(se.getPropertyValue("display"))||/^(left|right)$/.test(se.getPropertyValue("float"));if(Ce)return!0;if(K){var be=getComputedStyle(K),Re=be.getPropertyValue("display");if(/flex$/.test(Re)){var $e=be.getPropertyValue("flex-direction")||"row";if($e==="row"||$e==="row-reverse")return!Ht(K)}return!1}return!0}function Ht(k){if(!k.children||!k.children.length)return!1;for(const K of Array.from(k.children)){const se=(K.className&&K.className.split(" ")||[]).filter(Ce=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Ce));if(!se.length)return!1;for(const Ce of se){const be=Ce.slice(Ce.lastIndexOf("-")+1);if(parseInt(be,10)!==12)return!1}}return!0}function Wt(k,K){const J=K.getBoundingClientRect();if(Z.style.left=J.left+"px",Z.style.top=J.top+"px",he){if(Z.style.height=J.height+"px",Z.style.width="4px",k){const se=k.getBoundingClientRect();se.top!==J.top&&(Z.style.left=se.right+"px",Z.style.top=se.top+"px",Z.style.height=se.height+"px")}}else if(Z.style.height="4px",Z.style.width=J.width+"px",fe){const se=fe.getBoundingClientRect();J.top<se.top&&(Z.style.display="none")}K===I&&I&&(Z.style.display="none")}function Gt(k){ne=null;var K=k.lastElementChild;if(K){var J=K.getBoundingClientRect();he?(Z.style.left=J.right+"px",Z.style.top=J.top+"px",Z.style.height=J.height+"px",Z.style.width="4px"):(Z.style.left=J.left+"px",Z.style.top=J.bottom+"px",Z.style.height="4px",Z.style.width=J.width+"px"),K===I&&I&&(Z.style.display="none")}else Z.style.display="none"}function Ot(k,K){if(!ee.mirrorContainer.contains(k)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(fe=C(k),!fe||!fe.contains(k)))return;const J=document.querySelector(".dgComponentSelected"),se=fe.getBoundingClientRect();if(K-30<se.top&&fe.scrollTop>0){let Ce=fe.scrollTop<10?fe.scrollTop:10;fe.scrollBy(0,-1*Ce),J&&fe.contains(J)&&(xe=xe+-1*Ce)}if(K+30>se.bottom&&fe.scrollTop<fe.scrollHeight-fe.clientHeight){const Ce=fe.scrollHeight-fe.clientHeight-fe.scrollTop;let be=Ce<10?Ce:10;fe.scrollBy(0,be),J&&fe.contains(J)&&(xe=xe+be)}}function Lt(k,K,J,se){var Ce=ee.direction==="horizontal",be=ee.direction==="mixed",Re=K!==k?We():$e();return Re;function $e(){var Ae=k.children.length,Ge,He,_e;for(Ge=0;Ge<Ae;Ge++)if(He=k.children[Ge],_e=He.getBoundingClientRect(),Ce&&_e.left+_e.width/2>J||!be&&!Ce&&_e.top+_e.height/2>se||be&&_e.left+_e.width>J&&_e.top+_e.height>se)return He;return null}function We(){var Ae=K.getBoundingClientRect();if(be){var Ge=se-Ae.top,He=J-Ae.left,_e=Ae.bottom-se,Ct=Ae.right-J,bt=Math.min(He,Ct,Ge,_e),wt;return he?wt=Ct<He:wt=_e===bt||Ct===bt||He===bt,Qe(wt)}return Qe(Ce?J>Ae.left+w(Ae)/2:se>Ae.top+O(Ae)/2)}function Qe(Ae){return Ae?v(K):K}}function Yt(k,K){return typeof ee.copy=="boolean"?ee.copy:ee.copy(k,K)}}function C(M){const $=Array.from(window.scrollContainerList);if($.length===1){const j=Array.from(window.scrollContainerList)[0];return document.getElementById(j)}const R=c($);for(const j of R)if(j.contains(M))return j;return null}function c(M){const $=[];return M.forEach(R=>{const j=document.getElementById(R);j&&$.push(j)}),$.sort((R,j)=>R.contains(j)?1:j.contains(R)?-1:0),$}function f(M,$,R,j){var _={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},I={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},q={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?u[$](M,I[R],j):a.navigator.msPointerEnabled?u[$](M,q[R],j):(u[$](M,_[R],j),u[$](M,R,j))}function S(M){if(M.touches!==void 0)return M.touches.length;if(M.which!==void 0&&M.which!==0)return M.which;if(M.buttons!==void 0)return M.buttons;var $=M.button;if($!==void 0)return $&1?1:$&2?3:$&4?2:0}function E(M,$,R){M=M||{};var j=M.className||"",_;return M.className+=" gu-hide",_=d.elementFromPoint($,R),M.className=j,_}function b(){return!1}function g(){return!0}function w(M){return M.width||M.right-M.left}function O(M){return M.height||M.bottom-M.top}function V(M){return M.parentNode===d?null:M.parentNode}function y(M){return M.tagName==="INPUT"||M.tagName==="TEXTAREA"||M.tagName==="SELECT"||h(M)}function h(M){return!M||M.contentEditable==="false"?!1:M.contentEditable==="true"?!0:h(V(M))}function v(M){return M.nextElementSibling||$();function $(){var R=M;do R=R.nextSibling;while(R&&R.nodeType!==1);return R}}function x(M){return M.targetTouches&&M.targetTouches.length?M.targetTouches[0]:M.changedTouches&&M.changedTouches.length?M.changedTouches[0]:M}function F(M,$){var R=x($),j={pageX:"clientX",pageY:"clientY"};return M in j&&!(M in R)&&j[M]in R&&(M=j[M]),R[M]}r.exports=p}).call(this,typeof nt<"u"?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(o,r,i){r.exports=function(s,u){return Array.prototype.slice.call(s,u)}},{}],4:[function(o,r,i){var a=o("ticky");r.exports=function(u,l,d){u&&a(function(){u.apply(d||null,l||[])})}},{ticky:10}],5:[function(o,r,i){var a=o("atoa"),s=o("./debounce");r.exports=function(l,d){var m=d||{},p={};return l===void 0&&(l={}),l.on=function(C,c){return p[C]?p[C].push(c):p[C]=[c],l},l.once=function(C,c){return c._once=!0,l.on(C,c),l},l.off=function(C,c){var f=arguments.length;if(f===1)delete p[C];else if(f===0)p={};else{var S=p[C];if(!S)return l;S.splice(S.indexOf(c),1)}return l},l.emit=function(){var C=a(arguments);return l.emitterSnapshot(C.shift()).apply(this,C)},l.emitterSnapshot=function(C){var c=(p[C]||[]).slice(0);return function(){var f=a(arguments),S=this||l;if(C==="error"&&m.throws!==!1&&!c.length)throw f.length===1?f[0]:f;return c.forEach(function(b){m.async?s(b,f,S):b.apply(S,f),b._once&&l.off(C,b)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(o,r,i){(function(a){var s=o("custom-event"),u=o("./eventmap"),l=a.document,d=C,m=f,p=[];a.addEventListener||(d=c,m=S),r.exports={add:d,remove:m,fabricate:E};function C(V,y,h,v){return V.addEventListener(y,h,v)}function c(V,y,h){return V.attachEvent("on"+y,g(V,y,h))}function f(V,y,h,v){return V.removeEventListener(y,h,v)}function S(V,y,h){var v=w(V,y,h);if(v)return V.detachEvent("on"+y,v)}function E(V,y,h){var v=u.indexOf(y)===-1?F():x();V.dispatchEvent?V.dispatchEvent(v):V.fireEvent("on"+y,v);function x(){var M;return l.createEvent?(M=l.createEvent("Event"),M.initEvent(y,!0,!0)):l.createEventObject&&(M=l.createEventObject()),M}function F(){return new s(y,{detail:h})}}function b(V,y,h){return function(x){var F=x||a.event;F.target=F.target||F.srcElement,F.preventDefault=F.preventDefault||function(){F.returnValue=!1},F.stopPropagation=F.stopPropagation||function(){F.cancelBubble=!0},F.which=F.which||F.keyCode,h.call(V,F)}}function g(V,y,h){var v=w(V,y,h)||b(V,y,h);return p.push({wrapper:v,element:V,type:y,fn:h}),v}function w(V,y,h){var v=O(V,y,h);if(v){var x=p[v].wrapper;return p.splice(v,1),x}}function O(V,y,h){var v,x;for(v=0;v<p.length;v++)if(x=p[v],x.element===V&&x.type===y&&x.fn===h)return v}}).call(this,typeof nt<"u"?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(o,r,i){(function(a){var s=[],u="",l=/^on/;for(u in a)l.test(u)&&s.push(u.slice(2));r.exports=s}).call(this,typeof nt<"u"?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(o,r,i){(function(a){var s=a.CustomEvent;function u(){try{var l=new s("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}r.exports=u()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(d,m){var p=document.createEvent("CustomEvent");return m?p.initCustomEvent(d,m.bubbles,m.cancelable,m.detail):p.initCustomEvent(d,!1,!1,void 0),p}:function(d,m){var p=document.createEventObject();return p.type=d,m?(p.bubbles=!!m.bubbles,p.cancelable=!!m.cancelable,p.detail=m.detail):(p.bubbles=!1,p.cancelable=!1,p.detail=void 0),p}}).call(this,typeof nt<"u"?nt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(o,r,i){var a=r.exports={},s,u;function l(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?u=clearTimeout:u=d}catch{u=d}})();function m(O){if(s===setTimeout)return setTimeout(O,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(O,0);try{return s(O,0)}catch{try{return s.call(null,O,0)}catch{return s.call(this,O,0)}}}function p(O){if(u===clearTimeout)return clearTimeout(O);if((u===d||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(O);try{return u(O)}catch{try{return u.call(null,O)}catch{return u.call(this,O)}}}var C=[],c=!1,f,S=-1;function E(){!c||!f||(c=!1,f.length?C=f.concat(C):S=-1,C.length&&b())}function b(){if(!c){var O=m(E);c=!0;for(var V=C.length;V;){for(f=C,C=[];++S<V;)f&&f[S].run();S=-1,V=C.length}f=null,c=!1,p(O)}}a.nextTick=function(O){var V=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)V[y-1]=arguments[y];C.push(new g(O,V)),C.length===1&&!c&&m(b)};function g(O,V){this.fun=O,this.array=V}g.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function w(){}a.on=w,a.addListener=w,a.once=w,a.off=w,a.removeListener=w,a.removeAllListeners=w,a.emit=w,a.prependListener=w,a.prependOnceListener=w,a.listeners=function(O){return[]},a.binding=function(O){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(O){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(o,r,i){(function(a){var s=typeof a=="function",u;s?u=function(l){a(l)}:u=function(l){setTimeout(l,0)},r.exports=u}).call(this,o("timers").setImmediate)},{timers:11}],11:[function(o,r,i){(function(a,s){var u=o("process/browser.js").nextTick,l=Function.prototype.apply,d=Array.prototype.slice,m={},p=0;i.setTimeout=function(){return new C(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new C(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(c){c.close()};function C(c,f){this._id=c,this._clearFn=f}C.prototype.unref=C.prototype.ref=function(){},C.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(c,f){clearTimeout(c._idleTimeoutId),c._idleTimeout=f},i.unenroll=function(c){clearTimeout(c._idleTimeoutId),c._idleTimeout=-1},i._unrefActive=i.active=function(c){clearTimeout(c._idleTimeoutId);var f=c._idleTimeout;f>=0&&(c._idleTimeoutId=setTimeout(function(){c._onTimeout&&c._onTimeout()},f))},i.setImmediate=typeof a=="function"?a:function(c){var f=p++,S=arguments.length<2?!1:d.call(arguments,1);return m[f]=!0,u(function(){m[f]&&(S?c.apply(null,S):c.call(null),i.clearImmediate(f))}),f},i.clearImmediate=typeof s=="function"?s:function(c){delete m[c]}}).call(this,o("timers").setImmediate,o("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(fo);var ar=fo.exports;const mo=ir(ar),sr={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},lr={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},Rt=n.defineComponent({name:"Toast",props:lr,emits:["close","click"],setup:(e,t)=>{const o=n.ref(e.animate),r="fadeOut",i=n.computed(()=>e.options),a=n.ref(!1),s=n.computed(()=>i.value.title&&i.value.message),u=n.computed(()=>!i.value.title&&i.value.message),l=n.computed(()=>{const g={animated:a.value,toast:!0,"toast--only-content":!s.value};return g[e.animate]=!1,g[r]=a.value,g["toasty-type-"+i.value.type]=!0,i.value.theme&&(g[i.value.theme]=!0),g}),d=n.computed(()=>{const O=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,V={"f-icon":!0};return V[O]=!0,V}),m=n.computed(()=>i.value.title||i.value.message),p=n.computed(()=>e.showCloseButton),C=n.computed(()=>!!i.value.buttons||!!t.slots.default),c=n.computed(()=>Ue.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function f(g){g.stopPropagation(),g.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function S(g,w){}function E(g){return`f-preten-link ${g.customClass?g.customClass:""}`}n.watch(o,()=>{o.value});const b=()=>{var g;return n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((g=i.value.buttons)==null?void 0:g.map(w=>n.createVNode("span",{class:E(w),onClick:O=>void 0},[w.text]))),t.slots.default&&t.slots.default()])])};return()=>n.createVNode("div",{class:l.value,style:"min-height:44px"},[p.value&&n.createVNode("button",{title:Ue.LocaleService.getLocaleValue("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:f},[n.createVNode("span",{class:"f-icon modal_close"},null)]),m.value&&n.createVNode("section",{class:"modal-tips"},[!s.value&&n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:d.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[s.value&&n.createVNode(n.Fragment,null,[n.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:i.value.title},null),n.createVNode("p",{class:"toast-msg",innerHTML:i.value.message,style:c.value},null),C.value&&b()]),u.value&&(i.value.buttons?n.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:c.value,innerHTML:i.value.message},null),n.createVNode("div",{class:"after-toast-title text-right ml-auto"},[b()])]):n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:c.value,innerHTML:i.value.message},null))])])])}}),cr=["moz","ms","webkit"];function ur(){let e=0;return t=>{const o=new Date().getTime(),r=Math.max(0,16-(o-e)),i=setTimeout(()=>{t(o+r)},r);return e=o+r,i}}function dr(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const e=cr.filter(t=>`${t}RequestAnimationFrame`in window)[0];return e?window[`${e}RequestAnimationFrame`]:ur()}dr(),n.ref("");function po(){if(typeof window>"u"||typeof navigator>"u")return!1;const e=navigator.userAgent||navigator.vendor||window.opera,t=[/iPhone/i,/iPod/i,/Android.*Mobile/i,/webOS/i,/BlackBerry/i,/IEMobile/i,/Opera Mini/i,/Harmony/i],o=[/iPad/i,/Android(?!.*Mobile)/i,/Tablet/i,/PlayBook/i,/Kindle/i,/Silk/i];for(const l of o)if(l.test(e))return!1;for(const l of t)if(l.test(e))return!0;if(typeof screen>"u")return!1;const r="ontouchstart"in window||navigator.maxTouchPoints>0,i=screen.width,a=screen.height,s=Math.min(i,a);return!!(r&&s<=768)}function fr(){const e=po();return e&&document.body.classList.add("f-mobile"),e}typeof document<"u"&&fr();const Et=n.defineComponent({name:"Notify",props:sr,emits:["close","empty"],setup(e,t){var S;const o=po(),i=`farris-notify-${(S=e.options)!=null&&S.type?e.options.type:"info"}}`,a=n.computed(()=>({"farris-notify":!0,[i]:o})),s={left:12,right:12,top:20,bottom:12},u=n.ref(),l=n.ref(e.options),d=n.ref(e.showCloseButton),m=n.computed(()=>e.position||"bottom-right"),p=n.computed(()=>e.timeout!=null?e.timeout:3e3),C=n.computed(()=>{const E=e.bottom?e.bottom:s.bottom,b=e.top?e.top:s.top,g={transition:"all 0.2s ease",left:m.value.indexOf("left")>-1?`${e.left?e.left:s.left}px`:"",right:m.value.indexOf("right")>-1?`${e.right?e.right:s.right}px`:"",top:m.value.indexOf("top")>-1?`${b}px`:"",bottom:m.value.indexOf("bottom")>-1?`${E}px`:""};return m.value.indexOf("center")>-1&&(g.left="50%",g.marginLeft="calc(-24rem / 2)",m.value==="center-center"&&(g.top="50%",g.transform="translate(-50%, -50%)")),g});function c(E){t.emit("close")}p.value&&setTimeout(()=>{c()},p.value),t.expose({closeToast:c,container:u,notifyPosition:m});function f(E,b){c()}return()=>{var E;return o?n.createVNode("div",{class:a.value,ref:u},[(E=e.options)==null?void 0:E.message]):n.createVNode("div",{class:a.value,style:C.value,ref:u},[n.createVNode(Rt,{options:l.value,showCloseButton:d.value,animate:e.animate,onClose:b=>f(b,l.value)},null)])}}});class _t{constructor(){we(this,"notifyRefs",[]);we(this,"globalConfig",n.reactive({}))}escapeAllHtml(t){if(typeof t!="string"||!t)return"";const o=document.createElement("div");return o.textContent=t||"",o.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(t){const o=this,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...t}),a=document.createElement("div");a.style.display="contents";const s=n.createApp({setup(){var d;const u=n.ref();function l(){u.value.container.style.transform="scale(0)",setTimeout(()=>{o.updateNotifyPositionForClose(i,u),s.unmount()},220)}if(i.position.indexOf("top")>-1){const m=o.getNotifyInstances(i.position),p=m[m.length-1];if(p){const C=p.value.container.getBoundingClientRect();i.top=C.bottom}}return i.safeHtml&&((d=i.options)!=null&&d.message)&&(i.options.message=o.escapeAllHtml(i.options.message)),n.onUnmounted(()=>{document.body.removeChild(a)}),n.onMounted(()=>{o.updateNotifyPositionForCreate(i,u)}),()=>n.createVNode(n.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[n.createVNode(Et,n.mergeProps({ref:u},i,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(Ue.LocaleService.i18n),s.mount(a),s}getNotifyInstances(t){return this.notifyRefs.filter(o=>o.value.notifyPosition===t)}updateNotifyPositionForCreate(t,o){if(this.notifyRefs&&this.notifyRefs.length){const r=window.innerHeight;t.position.indexOf("bottom")>-1&&this.getNotifyInstances(t.position).forEach(i=>{const a=i.value.container.getBoundingClientRect();i.value.container.style.bottom=a.height+r-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,o]}updateNotifyPositionForClose(t,o){const r=this.notifyRefs.indexOf(o);if(t.position.indexOf("top")>-1){const i=this.getNotifyInstances(t.position),a=i.indexOf(o);i.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}r>-1&&this.notifyRefs.splice(r,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,o){let r="",i="",a,s,u;typeof o=="string"?r=o:o&&(r=o.message||"",i=o.title||"",s=o.position||null,u=o.showCloseButton!=null?o.showCloseButton:null,a=o.timeout!=null?o.timeout:null);const d={options:{type:t,message:r,title:i}};return s!=null&&(d.position=s),u!=null&&(d.showCloseButton=u),a!=null&&(d.timeout=a),d}info(t){const o=this.buildNotifyProps("info",t);return this.show(o)}success(t){const o=this.buildNotifyProps("success",t);return this.show(o)}warning(t){const o=this.buildNotifyProps("warning",t);return this.show(o)}error(t){const o=this.buildNotifyProps("error",t);return this.show(o)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const mr=Symbol("NOTIFY_SERVICE_TOKEN");Et.install=e=>{e.component(Et.name,Et),e.component(Rt.name,Rt);const t=new _t;e.provide(mr,t),e.provide("FNotifyService",t)};const pr={designerHostService:{type:Object,default:{}},componentType:{type:String,default:""},bindingEntityId:{type:String,default:""},steps:{type:Array,default:["selectEntity","selectFields"]},targetComponentInstance:{type:Object,default:{}}};`${Ue.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const gr={customClass:{type:String,default:""},sort:{type:Object},filter:{type:Object},autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",required:!0},loadData:{type:Function},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,mode:"server",size:-1}},rowNumber:{type:Object,default:{enable:!0,width:36,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!1}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1},emptyTemplate:{type:Object},summary:{type:Object,default:{enable:!1,groupFields:["numericField1","numericField2"]}},autoHeight:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},checkboxPosition:{type:String,default:"after-expand"},enableColumnSettingSolution:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:""},customSearch:{type:Function},beforeEditCell:{type:Function,default:e=>!0},focusOnEditingCell:{type:Boolean,default:!0}},hr="enum",vr="boolean";function yr(e){const{formatter:t}=e;return!t||typeof t=="function"?null:t}function Cr(e,t){const o=t.options||t,{data:r}=o;if(!r||!r.length)return"";const i=Object.prototype.hasOwnProperty.call(o,"valueField")&&o.valueField||"value",a=Object.prototype.hasOwnProperty.call(o,"textField")&&o.textField||"name";if(typeof e=="string"&&e.includes(",")){const u=e.split(","),l=r.reduce((m,p)=>(m[p[i]]=p,m),{}),d=u.map(m=>{var p;return(p=l[m])==null?void 0:p[a]}).filter(m=>m!=null);return d.length?d.join(","):""}const s=r.find(u=>u[i]===e);return(s==null?void 0:s[a])??(e==null?"":String(e))}function br(e,t){if(e==null)return"";const o=t.options||t,r=e?o==null?void 0:o.trueText:o==null?void 0:o.falseText;return r==null?"":String(r)}function wr(e,t){const o=Oo.resolveField(t,e.field),r=yr(e),i=r==null?void 0:r.type;return i===hr?Cr(o,r):i===vr||e.dataType==="boolean"?br(o,r||{}):o==null?"":String(o)}function Sr(e,t,o,r,i,a,s,u,l,d,m,p,C,c,f,S,E,b,g){const{calculateCellPositionInRow:w}=a,{columnContext:O,hasLeftFixedColumn:V,hasRightFixedColumn:y}=s,{gridDataStyle:h,leftFixedGridDataStyle:v,rightFixedGridDataStyle:x}=c,{renderDataRow:F}=de.getHierarchyRow(e,t,O,E,u,l,d,m,p,C,c,f,S,b,g),M=[F];function $(q,D){const U=w(q);return E.value.filter(ne=>ne.visible!==!1).map((ne,N)=>M[ne.type](ne,U,D,N))}function R(){return n.createVNode("div",{ref:r,class:"fv-grid-content-left-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:v.value},[$(O.value.leftColumns.filter(q=>q.visible),"left")])])}function j(){return n.createVNode("div",{ref:o,class:"fv-grid-content-primary"},[n.createVNode("div",{class:"fv-grid-data",style:h.value},[$(O.value.primaryColumns.filter(q=>q.visible),"primary")])])}function _(){return n.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:x.value},[$(O.value.rightColumns.filter(q=>q.visible),"right")])])}function I(){const q=[];return V.value&&q.push(R()),q.push(j()),y.value&&q.push(_()),q}return{renderDataArea:I}}const Ut=n.defineComponent({name:"FTreeGrid",props:gr,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","selectItem","filterChanged","unSelectAll","selectAll","sortChanged","selectionUpdate","beginEditCell","endEditCell"],setup(e,t){var Bo,Io;const o=n.ref(!1),r=n.ref(!1),i=0,a=n.ref(((Bo=e.rowOption)==null?void 0:Bo.height)||28);let s=[],u=[];const l=n.ref(20),d=n.ref(e.columns),m=de.useIdentify(e),{idField:p}=m,C=n.ref(),c=n.ref(),f=n.ref(),S=n.ref(),E=n.ref(),b=n.ref([]),g=n.ref(!1),w=n.ref(((Io=e.rowOption)==null?void 0:Io.wrapContent)||!1),O=de.useGroupData(e,m),V=de.useFilter(e,t),y=de.useHierarchy(e),{collapseField:h}=y,{showLoading:v,renderLoading:x}=de.useLoading(e,C),F=de.useDataView(e,new Map,V,y,m),{dataView:M}=F,$=de.useSelection(e,F,m,b,t),{showSelection:R,selectedValues:j}=$,_=de.useSelectHierarchyItem(e,b,F,m,$,t),I=n.computed(()=>e.disabled),q=n.computed(()=>e.virtualized?Math.min(F.dataView.value.length,l.value):F.dataView.value.length),D=de.usePagination(e,F),{shouldRenderPagination:U}=D,{containerStyleObject:ne}=de.useDataViewContainerStyle(e,b),N=n.ref(""),P=n.ref([]),oe=n.computed(()=>e.searchable||!1),re=n.ref(0),Z=n.computed(()=>P.value.length?`${re.value+1}/${P.value.length}`:""),he=n.computed(()=>Ue.LocaleService.getRealPropertyValue(e.searchPlaceholder,"","datagrid.search.placeholder")),xe=n.computed(()=>Ue.LocaleService.getLocaleValue("datagrid.search.search")),fe=n.computed(()=>Ue.LocaleService.getLocaleValue("datagrid.search.prev")),ee=n.computed(()=>Ue.LocaleService.getLocaleValue("datagrid.search.next")),T=n.computed(()=>Ue.LocaleService.getLocaleValue("datagrid.search.clear")),ie=de.useCommandColumn(e),{applyCommands:ae}=ie;ae(d);const{applyColumnSetting:le,removeColumnSetting:ye}=de.useSettingColumn(e);e.showSetting&&le(d);const ke=de.useColumn(e,t),qe=de.useSort(e),{applyColumnSorter:Le,columnContext:Te,updateColumnRenderContext:Pe}=ke;Le(F,qe);const Oe=de.useGroupColumn(e,Te),Be=de.useRow(e,t,$,m),Ee=de.useEdit(e,t,m,Be,b),at=de.useVisualDataBound(e,F,a),ut=de.useVisualDataCell(e,Ee,at),dt=de.useVisualDataRow(e,F,Ee,y,m,at,ut,a),Xe=de.useVisualData(e,d,F,q,i,dt),{getVisualData:et}=Xe,ft=de.useCellPosition(e,Te,a,o),ot=de.useSidebar(e,$),{sidebarWidth:st}=ot,Me=de.useVirtualScroll(e,F,b,Te,Xe,q,i,st,a,o),{onWheel:A,dataGridWidth:ce,viewPortHeight:Ne,viewPortWidth:Ve,resetScroll:ze,updateVisibleRowsOnLatestVisibleScope:yt}=Me,lt=de.useFitColumn(e,Te,c,Ve,Oe),{calculateColumnsSize:mt}=lt,It=de.useFilterHistory(),Pt=de.useColumnFilter(c,E,F,It,Me),zt=de.useDragColumn(e,t,ke,F,Oe,O,Me),Ht=n.computed(()=>{const L={"fv-grid":!0,"fv-grid-bordered":e.showBorder,"fv-grid-horizontal-bordered":e.showHorizontalLines,"fv-datagrid-strip":e.showStripe};return je.getCustomClass(L,e.customClass)}),Wt=n.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":g.value,"fv-grid-wrap-content":w.value,"fv-grid-scrollbar-visible":Me.shouldShowVirticalScrollbar.value&&g.value})),{renderDataArea:Gt}=Sr(e,t,f,S,E,ft,ke,F,Ee,y,Be,$,_,Me,Xe,at,b,a,o),Ot=n.ref(null);function Lt(L,G){var ue,me;e.enableColumnSettingSolution&&((me=(ue=Ot.value)==null?void 0:ue.persistColumnWidths)==null||me.call(ue,G))}const{renderGridHeader:Yt,renderGridColumnResizeOverlay:k,shouldShowHeader:K}=de.getColumnHeader(e,t,c,S,E,ke,F,zt,Pt,V,It,lt,Oe,$,ot,qe,Me,Ve,b,r,Lt),{renderDataGridSidebar:J}=de.getSidebar(e,Be,$,ot,Me),{renderDisableMask:se}=de.getDisableMask(),{renderHorizontalScrollbar:Ce}=de.getHorizontalScrollbar(e,c,Me),{renderVerticalScrollbar:be}=de.getVerticalScrollbar(e,c,Me);let Re=null;function $e(){var L,G,ue;if(c.value&&c.value.clientHeight>0&&((L=c.value)==null?void 0:L.clientWidth)>0){const me=Math.ceil(c.value.clientHeight/a.value);me>l.value&&(l.value=me,yt()),Ne.value=((G=f.value)==null?void 0:G.clientHeight)||0,ce.value=((ue=c.value)==null?void 0:ue.clientWidth)||0,f.value&&(Ve.value=f.value.clientWidth)}c.value&&(c.value.clientHeight>0||c.value.clientWidth>0)&&mt()}function We(){Re!==null&&cancelAnimationFrame(Re),Re=requestAnimationFrame(()=>{Re=null,$e()})}n.onMounted(()=>{c.value&&(l.value=Math.max(Math.ceil(c.value.clientHeight/a.value),l.value),b.value=et(0,q.value+i-1),Po.useResizeObserver(c.value,We),mt(),n.nextTick(()=>{c.value&&(ce.value=c.value.clientWidth),f.value&&(Ve.value=f.value.clientWidth,Ne.value=f.value.clientHeight)})),v.value&&x()}),n.onUnmounted(()=>{Re!==null&&cancelAnimationFrame(Re)});function Qe(L){F.collapseTo(L),F.reOrderVisibleIndex(),ze()}function Ae(L){F.expandTo(L),F.reOrderVisibleIndex(),ze()}function Ge(){const L=$.getSelectionRow();return L?L.dataIndex-1:-1}function He(L){const G=L!==void 0?L:Ge(),ue=F.insertNewDataItem(G===-1?0:G);return b.value=et(0,q.value+i-1),ue}function _e(){const L=Ge();F.insertNewChildDataItem(L),b.value=et(0,q.value+i-1)}function Ct(L,G){const ue=b.value.find(ge=>ge.raw[p.value]===G),me=ue?ue.dataIndex-1:-1;F.insertNewChildDataItems(L,me)}function bt(){const L=Ge(),G=_.getNextSelectableHierarchyItemId(L);F.removeHierarchyDataItem(L),b.value=et(0,q.value+i-1),G&&_.selectItemById(G)}function wt(L){Ee.onEditingRow(L)}function Ci(L){Ee.acceptEditingRow(L)}function bi(L){Ee.cancelEditingRow(L)}function St(L){L&&(d.value=L,ae(d),e.showSetting&&le(d),Pe(d.value),Le(F,qe),mt())}n.watch(()=>e.columns,L=>{if(e.showSetting&&e.enableColumnSettingSolution){St(d.value);return}St(L)});function wi(L,G){if(L){const ue=!!(G!=null&&G.keepScrollTop||G!=null&&G.keepScrollPosition),me=ue?Me.offsetY.value:0;F.load(L),F.reOrderVisibleIndex(),de.refreshScrollAfterDataSourceLoad({keepScroll:ue,savedOffsetY:me,resetScroll:ze,scrollTo:Me.scrollTo})}}function Kt(L){Be.activeRowById(L)}function Si(L,G={isCurrent:!0}){G!=null&&G.isCurrent&&Kt(L),_.selectItemById(L)}function xi(L){const G=b.value.find(ue=>ue.raw[m.idField.value]===L);G&&Be.clickRowItem(G)}function Ti(L){_.selectItemByIds(L)}function Ni(){return $.getSelectedItems()}function Mo(){$.clearSelection()}function Vi(){$.emptyCurrentRowId()}const Fi=n.computed(()=>!b.value||!b.value.length),{renderEmpty:Ei}=de.getEmpty(e,t);function Mi(){return $.getSelectionRow()}function ji(L,G={clearCurrent:!0}){G!=null&&G.clearCurrent&&Kt(""),_.unSelectItemByIds(L)}function Di(){return $.currentSelectedDataId.value}function ki(L,G,ue){const me=M.value.find(ge=>ge[p.value]===L);if(me){if(Object.keys(me).forEach(ve=>{Object.prototype.hasOwnProperty.call(G,ve)&&(me[ve]=G[ve])}),ue){const{collapseField:ve,disabledField:Ye,checkedField:tt,visibleField:Ke,hasChildren:Tt}=ue;ve&&!Se.isUndefined(G[ve])&&(me.__fv_collapse__=G[ve]),tt&&!Se.isUndefined(G[tt])&&(me.__fv_checked__=G[tt]),Ye&&!Se.isUndefined(G[Ye])&&(me.__fv_disabled__=G[Ye]),Ke&&!Se.isUndefined(G[Ke])&&(me.__fv_visible__=G[Ke]),Se.isUndefined(Tt)||(me.__fv_hasChildren__=Tt)}const ge=b.value.find(ve=>ve.raw[p.value]===L),pe=b.value.findIndex(ve=>ve.raw[p.value]===L);if(ge){if(ge.raw=me,Object.keys(ge.data).forEach(ve=>{ge.data[ve].updateData(me)}),ue){const{collapseField:ve,disabledField:Ye,checkedField:tt,visibleField:Ke,hasChildren:Tt}=ue;ve&&!Se.isUndefined(G[ve])&&(ge.collapse=G[ve]),tt&&!Se.isUndefined(G[tt])&&(ge.checked=G[tt]),Ye&&!Se.isUndefined(G[Ye])&&(ge.disabled=G[Ye]),Ke&&!Se.isUndefined(G[Ke])&&(ge.visible=G[Ke]),Se.isUndefined(Tt)||(ge.raw.__fv_hasChildren__=Tt)}b.value=[...b.value.slice(0,pe),ge,...b.value.slice(pe+1)],F.updateSummary()}}}function Bi(L){return Object.prototype.hasOwnProperty.call(L,"raw")?F.hasRealChildren(L.raw):F.hasRealChildren(L)}function Ii(L){const G=F.dataView.value.find(ue=>ue[p.value]===L);return G?G[h.value]:""}function Pi(){return h.value}n.watch(()=>e.showSetting,(L,G)=>{L!==G&&(L?le(d):ye(d),St(d.value))});function Oi(L){return b.value.filter(G=>L.includes(G.raw[e.idField]))}function jo(L){const G=m.idField.value,ue=b.value.find(me=>me.raw[G]===L);ue&&Be.changeRow(ue)}function Li(){$.keepSelectingOnPaging.value||Mo(),F.updateVisibleDataSummary(b.value)}function Ai(){Ee.endEditCell()}function qi(L){$.updateSelectedValues(L)}function Ri(L){$.removeSelectedValues(L)}const _i=100;function Ui(L,G){const ue=G[L].__fv_layer__||0;let me=L+1;for(;me<G.length&&(G[me].__fv_layer__||0)>ue;)me++;return me-1}function $i(L){const G=F.dataView.value,ue=y.collapseField.value,me=L.__fv_index__,ge=L.__fv_layer__||0;if(typeof me!="number"||L.__fv_visible__===!1||L[ue])return;let pe=me+1;for(;pe<G.length;){const ve=G[pe];if((ve.__fv_layer__||0)<=ge)break;if(ve.__fv_visible__=!0,ve[ue]){pe=Ui(pe,G)+1;continue}pe++}}function zi(L){let G=L;const ue=[];let me=0;for(;G&&G[y.parentIdField.value]&&me<_i;){me++;const ge=F.rawView.value.find(pe=>pe[m.idField.value]===G[y.parentIdField.value]);if(ge)ge[y.collapseField.value]&&ue.push(ge),G=ge;else break}ue.reverse().forEach(ge=>{ge[y.collapseField.value]=!1,F.toggleChildrenVisibiltyByCollapseStatus(ge),$i(ge)})}function Hi(L,G){if(L.length!==G.length)return!1;const ue=L.map(ge=>ge[m.idField.value]).sort(),me=G.map(ge=>ge[m.idField.value]).sort();return ue.every((ge,pe)=>ge===me[pe])}function Xt(){const L=P.value[re.value];L&&(zi(L),n.nextTick(()=>{F.reOrderVisibleIndex();const G=L[m.idField.value],ue=L.__fv_visible_index__;ue!==void 0&&ue!==""&&ue>=0?(Me.scrollToRowByIndex(ue),n.nextTick(()=>{jo(G)})):console.warn("搜索结果的节点不在当前可见范围内,无法定位",G)}))}function Do(){!N.value.trim()||!P.value.length||(re.value=(re.value+1)%P.value.length,Xt())}function Wi(){if(!N.value.trim()){P.value=[],re.value=0;return}const L=[],G=N.value.toLowerCase().trim();F.rawView.value.forEach(me=>{let ge=!1;e.customSearch?ge=e.customSearch(G,me,e.columns):e.columns.forEach(pe=>{if(!ge&&pe.field){const ve=wr(pe,me);ve&&ve.toLowerCase().includes(G)&&(ge=!0)}}),ge&&L.push(me)});const ue=!Hi(L,P.value);L.length>0?ue?(P.value=L,re.value=0,Xt()):Do():(P.value=[],re.value=0)}function Gi(){if(!N.value.trim()||!P.value.length)return;const L=P.value.length;re.value=(re.value-1+L)%L,Xt()}const xt=Se.debounce(Wi,300);function ko(){xt.cancel(),N.value="",P.value=[],re.value=0}n.watch(N,L=>{L.trim()||(xt.cancel(),P.value=[],re.value=0)}),n.onUnmounted(()=>{xt.cancel()});function Yi(L){if(L.key==="Enter"){if(!N.value.trim())return;xt()}}function Ki(){N.value.trim()&&xt()}t.expose({activeRowById:Kt,addNewDataItem:He,addNewChildDataItem:_e,addChildrenToNode:Ct,collapseTo:Qe,expandTo:Ae,removeDataItem:bt,editDataItem:wt,acceptDataItem:Ci,cancelDataItem:bi,updateColumns:St,updateDataSource:wi,selectItemById:Si,selectItemByIds:Ti,getSelectedItems:Ni,clearSelection:Mo,getSelectionRow:Mi,clickRowItemById:xi,unSelectItemByIds:ji,getCurrentRowId:Di,reassignRowData:ki,hasChildren:Bi,getCollapseField:Pi,getCollapseStatusById:Ii,getVisibleDataByIds:Oi,selectRowById:jo,updateDerivedData:Li,emptyCurrentRowId:Vi,calculateColumnsSize:mt,endEditCell:Ai,updateSelectedValues:qi,removeSelectedValues:Ri});const Xi=n.computed(()=>{const L={};return Me.shouldShowHorizontalScrollbar.value&&g.value&&(L.paddingBottom="10px"),Me.shouldShowVirticalScrollbar.value&&g.value,L}),Qi=n.computed(()=>({...ne.value,borderRadius:"5px"})),{renderDataGridPagination:Ea}=de.getPagination(e,t,F,Me,D,$),Ji=n.computed(()=>({"d-flex":!0,"justify-content-between":U.value&&R.value,"justify-content-end":U.value&&!R.value,"position-relative":!0})),Zi=n.computed(()=>({"d-flex":!0,"align-items-center":!0}));function ea(L){const G=L.map(pe=>pe.id),ue=[...d.value,...s,...u];ue.filter(pe=>pe.dataType!==de.COMMAND_COLUMN_DATA_TYPE&&pe.dataType!==de.SETTING_COLUMN_DATA_TYPE).forEach(pe=>{const ve=L.find(Ye=>Ye.id===pe.id);ve&&(pe.width=ve.actualWidth||pe.width||120,ve.actualWidth!==void 0&&(pe.actualWidth=ve.actualWidth),pe.title=ve.title,pe.halign=ve.halign,pe.align=ve.align,pe.fixed=ve.fixed)}),u=ue.filter(pe=>pe.dataType===de.COMMAND_COLUMN_DATA_TYPE||pe.dataType===de.SETTING_COLUMN_DATA_TYPE);const me=ue.filter(pe=>pe.dataType!==de.COMMAND_COLUMN_DATA_TYPE&&pe.dataType!==de.SETTING_COLUMN_DATA_TYPE),ge=me.filter(pe=>G.includes(pe.id));s=me.filter(pe=>!G.includes(pe.id)),ge.sort((pe,ve)=>{const Ye=L.findIndex(Ke=>Ke.id===pe.id),tt=L.findIndex(Ke=>Ke.id===ve.id);return Ye-tt}),St(ge)}const{renderDataGridSummary:ta}=de.getSummary(e,F,ke);return()=>e.visible&&n.createVNode(n.Fragment,null,[oe.value&&n.createVNode("div",{class:"fv-grid-search",style:{padding:"8px 12px",border:"1px solid #e0e0e0",borderBottom:"none",borderRadius:"4px 4px 0 0"}},[n.createVNode("div",{style:{display:"flex",alignItems:"center"}},[n.createVNode(Lo,{value:N.value,onInput:L=>N.value=L,"onUpdate:value":L=>N.value=L||"",onClear:ko,onKeydown:Yi,placeholder:he.value,style:{flex:1}},null),Z.value&&n.createVNode("span",{class:"fv-grid-search-count",style:{marginLeft:"8px",fontSize:"12px",color:"#888",whiteSpace:"nowrap"}},[Z.value]),n.createVNode(ct,{type:"link",title:fe.value,disabled:!P.value.length,onClick:Gi,style:{cursor:"pointer",marginLeft:"4px"}},{default:()=>[n.createVNode("i",{class:"f-icon f-icon-arrow-chevron-up"},null)]}),n.createVNode(ct,{type:"link",title:ee.value,disabled:!P.value.length,onClick:Do,style:{cursor:"pointer",marginLeft:"4px"}},{default:()=>[n.createVNode("i",{class:"f-icon f-icon-arrow-chevron-down"},null)]}),n.createVNode(ct,{type:"link",title:xe.value,onClick:Ki,style:{cursor:"pointer",marginLeft:"4px"}},{default:()=>[n.createVNode("i",{class:"f-icon f-icon-search"},null)]}),N.value&&n.createVNode(ct,{type:"link",title:T.value,onClick:ko,style:{cursor:"pointer",marginLeft:"4px"}},{default:()=>[n.createVNode("i",{class:"f-icon f-icon-close"},null)]})])]),n.createVNode("div",{ref:C,class:Ht.value,style:Qi.value,onWheel:A},[c.value&&K.value&&Yt(),n.createVNode("div",{ref:c,class:Wt.value,onMouseover:()=>g.value=!0,onMouseleave:()=>g.value=!1,onTouchstart:L=>{L.stopPropagation(),g.value=!0,Me.onTouchstartScrollThumb(L,c)},onTouchend:L=>{g.value=!1},style:Xi.value},[c.value&&J(b),c.value&&Gt(),c.value&&Fi.value&&Ei(),c.value&&Ce(),c.value&&be()]),c.value&&ta(),R.value&&n.createVNode("div",{class:Ji.value},[R.value&&n.createVNode("div",{class:Zi.value},[n.createVNode("div",null,["已选:"+j.value.length,n.createTextVNode(" 条")])])]),k(),I.value&&se()]),e.enableColumnSettingSolution&&n.createVNode(de.ColumnSettingSolution,{ref:Ot,columns:[...d.value,...s],componentId:e.id,modelValue:r.value,"onUpdate:modelValue":L=>r.value=L,onChangeColumnSetting:ea},null)])}});je.withInstall(Ut);function go(e){const{designerHostService:t}=e,o=new Map,r=n.ref(),i=n.ref(),a=n.ref([{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"displayedTypeName",title:"字段类型"}]),s={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},u=n.ref(!1),l=n.ref(e.componentType);function d(E){const b=[];return E.forEach(g=>{let w=[];g.type&&g.type.fields&&g.type.fields.length>0&&(w=d(g.type.fields));const O=Se.cloneDeep(g),V=g.multiLanguage?"多语言":g.type.displayName,y=w.length?!1:!o.has(g.id);y&&(u.value=!0),b.push({data:Object.assign({displayedTypeName:V,selectable:y},O),children:w})}),b}function m(E){switch(E){case"data-grid":case"tree-grid":return"data-grid";case"response-form":return"form";default:return E}}function p(E){var b,g;if(E&&(((b=E.schema)==null?void 0:b.type)===((g=Fe.drawer)==null?void 0:g.type)||E.parent&&p(E.parent)))return!0}function C(E){if(o.clear(),!E)return;const b=p(e.targetComponentInstance);let g=m(l.value);["frame","table","form"].includes(g)&&(g="form");const{formSchemaUtils:w,schemaService:O}=t;w.getFormSchema().module.viewmodels.forEach(V=>{if(!V.fields||V.fields.length===0)return;const y=w.getComponentByViewModelId(V.id);let h=y.componentType;["frame","table","form"].includes(h)&&(h="form");const v=O.getTableInfoByViewModelId(V.id);if(h!==g||!v||v.id!==E.id)return;const x=w.checkComponentExistInDrawer(y.id);b&&x&&V.fields.forEach(F=>{o.set(F.id,!0)}),!b&&!x&&V.fields.forEach(F=>{o.set(F.id,!0)})})}function c(E){C(E);const{fields:b}=E.type;u.value=!1,r.value=d(b),i.value&&i.value.updateDataSource(r.value)}const f={customRowStatus:E=>(E.disabled=!E.raw.selectable,E)};function S(){return i.value.getSelectedItems().map(b=>b.data)}return{fieldTreeGridRef:i,resolveFieldDataSource:c,occupiedFieldMap:o,fieldDataSource:r,fieldTreeRowOption:f,fieldColumns:a,fieldSelectionOption:s,checkAndGetSelectedFields:S,hasSelectableField:u,currentComponentType:l}}function xr(e){const{designerHostService:t}=e,o=new Map,r=n.ref(),i=n.ref(),a=n.ref([{field:"name",title:"实体名称"}]),s=n.ref(),u=n.ref(!1);function l(f){const S=go(e);return S.resolveFieldDataSource(f),S.hasSelectableField.value?(s.value=s.value||f,!0):!1}function d(f){return!(e.bindingEntityId&&e.bindingEntityId!==f.id||!l(f))}function m(f,S=""){var O;if(!f)return;const E=Se.cloneDeep(f),b=S?`${S}/${E.label}`:"/";o.set(E.label,b.replace("//","/"));const g=d(E),w={data:Object.assign({selectable:g},E),children:[]};if(E.type.entities&&E.type.entities.length){const V=E.type.entities.map(y=>m(y,b));w.children=w.children.concat(V)}return e.bindingEntityId===f.id&&(s.value=f),((O=s.value)==null?void 0:O.id)===f.id&&!S&&(u.value=!0),w}function p(){var b;const{formSchemaUtils:f}=t,S=(b=f.getFormSchema().module.entity[0])==null?void 0:b.entities[0];o.clear();const E=m(S);i.value=[E]}function C(){var S;const f=r.value.getSelectionRow();if(!f||!((S=f.raw)!=null&&S.data)){const E=new _t;E.globalConfig={position:"top-center"},E.warning({message:"请先选择实体"});return}return f.raw.data}return{entityTreeGridRef:r,entityDataSource:i,resolveEntityDataSource:p,entityBindToMap:o,checkAndGetSelectedEntity:C,entityColumns:a,entityTreeRowOption:{customRowStatus:f=>(f.disabled=!f.raw.selectable,f)},initialSelectedEntity:s,isMainEntityInitialSelected:u}}const Tr=new Map([["appearance",De.resolveAppearance]]);function Nr(e,t){const{formSchemaUtils:o,designViewModelUtils:r}=t;function i(u,l){var d,m,p,C;return(m=(d=l==null?void 0:l.parentComponentInstance)==null?void 0:d.schema)==null||m.type,(C=(p=o.getFormSchema())==null?void 0:p.module)==null||C.templateId,u}function a(u){const l=e.getSchemaByType("component");return Object.assign(l,{id:`${u.componentId}-component`,contents:[],type:"step",appearance:{},steps:[],fill:!1,direction:"vertical",activeIndex:0}),l}function s(u){const l=a(u);return i(l,u)}return{createComponent:s}}function Vr(e,t,o,r){var a,s,u,l,d,m;const i=o.parentComponentInstance;if(i&&r){const p=Math.random().toString(36).slice(2,6),C={componentId:`step-${p}`,componentName:((a=o.bindingSourceContext)==null?void 0:a.entityTitle)||((u=(s=o.bindingSourceContext)==null?void 0:s.bindingEntity)==null?void 0:u.name)||`列表-${p}`,componentType:"step",parentContainerId:i.schema.id,parentComponentInstance:i,bindTo:((l=o.bindingSourceContext)==null?void 0:l.bindTo)||"",dataSource:(m=(d=o.bindingSourceContext)==null?void 0:d.bindingEntity)==null?void 0:m.label},{createComponent:c}=Nr(e,r);return c(C)}else return t}const Fr={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/step.schema.json",title:"step",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for step",type:"string"},type:{description:"The type string of step",type:"string",default:"step"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},visible:{description:"",type:"boolean",default:!0},direction:{description:"排列方式",type:"enum",default:"horizontal"},steps:{description:"步骤条",type:"array"},activeIndex:{description:"当前索引",type:"number",default:0},clickable:{description:"是否允许点击",type:"boolean",default:!0},fill:{description:"是否填充",type:"boolean",default:!0},stepsMessage:{description:"步骤条",type:"array"},stepDataSourceType:{description:"数据源类型",type:"enum",default:"static"},beforeClickStep:{description:"步骤条点击前事件",type:"string"},stepTemplate:{description:"步骤条模板",type:"string"}},required:["id","type"]},$t={direction:{type:String,default:"horizontal"},fill:{type:Boolean,default:!1},height:{type:Number,default:0},clickable:{type:Boolean,default:!0},steps:{type:Array,default:[{id:"1",title:"审批中(示例)",description:"正在审批"},{id:"2",title:"复核中(示例)",description:"等待复核"}]},activeIndex:{type:Number,default:0},visible:{type:Boolean,default:!0},beforeClickStep:{type:Object,default:()=>()=>!0},onClick:{type:Function,default:()=>{}},customClass:{type:String,default:""},stepTemplate:{type:Object}},ho=De.createPropsResolver($t,Fr,Tr,Vr),rt=n.defineComponent({name:"FStep",props:$t,emits:["click"],setup(e,t){const o=n.ref(0),r=n.ref(e.activeIndex),i=n.computed(()=>({"f-progress-step-list":e.direction==="horizontal","f-progress-step-list-block":e.direction==="vertical","f-progress-step-horizontal-fill":e.direction==="horizontal"&&e.fill,"f-progress-step-vertical-fill":e.direction==="vertical"&&e.fill})),a=n.computed(()=>({overflow:"auto"}));function s(g,w){const O={step:!0,active:w===r.value,clickable:!g.disabled,current:w===r.value};return w<r.value&&(O.finish=!0),O}function u(g,w){const O={steps:e.steps,step:g,index:w,activeIndex:r.value,direction:e.direction};Promise.resolve().then(()=>e.beforeClickStep?e.beforeClickStep(O):!0).then(V=>{if(V&&!g.disabled){const y={step:g,stepIndex:w};r.value=w,t.emit("click",y)}})}function l(g,w){const O={"f-progressstep-row":!0,"step-active":w===r.value,"step-current":w===r.value};return w<r.value&&(O["step-finish"]=!0),O}function d(g,w){return{"step-icon":!0,"step-success":w,"f-icon":w,"f-icon-check":w}}function m(g,w){const O=[];return w>=r.value||w===o.value?O.push(n.createVNode("span",{class:"step-icon"},[w+1])):O.push(n.createVNode("span",{class:d(g,!0)},null)),O}function p(g,w){return{"step-name":!0,"step-name-success":w<r.value}}function C(g,w){return n.createVNode("div",{class:"f-progress-step-title"},[n.createVNode("p",{class:p(g,w)},[g.title])])}function c(g,w){return{"f-progress-step-line":!0,"f-progress-step-line-success":w===r.value}}function f(g,w){return w!==e.steps.length-1}const S=n.computed(()=>({triangle:!0}));function E(){return e.steps.map((g,w)=>n.createVNode("li",{class:s(g,w),onClick:O=>u(g,w)},[e.stepTemplate?e.stepTemplate({step:g,index:w,length:e.steps.length,activeIndex:r.value,direction:e.direction}):t.slots.stepTemplate?t.slots.stepTemplate({step:g,index:w,length:e.steps.length,activeIndex:r.value,direction:e.direction}):n.createVNode("div",{class:l(g,w)},[n.createVNode("div",{class:"f-progress-step-content"},[m(g,w),C(g,w)]),f(g,w)&&n.createVNode("div",{class:c(g,w)},[n.createVNode("span",{class:S.value},null)])])]))}n.watch(()=>e.activeIndex,g=>{e.activeIndex>-1&&e.activeIndex<=e.steps.length&&(r.value=g)});const b=n.computed(()=>{const g={"f-progress-step":!0};return je.getCustomClass(g,e.customClass)});return()=>n.createVNode("div",{class:b.value},[n.createVNode("ul",{class:i.value,style:a.value},[E()])])}}),Fe={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},table:{type:"table",name:"表格布局"},"table-td":{type:"table-td",name:"单元格"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"drawer-toolbar-item":{type:"drawer-toolbar-item",name:"抽屉工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},"drawer-toolbar":{type:"drawer-toolbar",name:"抽屉工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},nav:{type:"nav",name:"标签类导航"},"list-view":{type:"list-view",name:"列表"},"filter-bar":{type:"filter-bar",name:"筛选条"},"language-textbox":{type:"language-textbox",name:"多语输入框"},image:{type:"image",name:"图像"},avatar:{type:"avatar",name:"头像"},"discussion-editor":{type:"discussion-editor",name:"评论编辑区"},"discussion-list":{type:"discussion-list",name:"评论列表"},comment:{type:"comment",name:"评论区"},"approval-logs":{type:"approval-logs",name:"审批记录"},"rich-text-editor":{type:"rich-text-editor",name:"富文本",icon:"rich-text-box"},calendar:{type:"calendar",name:"日历",icon:"date-picker"},wizard:{type:"wizard",name:"向导",icon:"wizard"},"wizard-page":{type:"wizard-page",name:"向导页",icon:"wizard"},"wizard-page-detail":{type:"wizard-page-detail",name:"向导详情",icon:"wizard"},step:{type:"step",name:"步骤条",icon:"step"},"dynamic-form":{type:"dynamic-form",name:"动态表单"},"field-search-box":{type:"field-search-box",name:"智能搜索框"}};class Er{constructor(t){we(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);we(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});we(this,"getExpressionConverter",(t,o)=>({convertFrom:(r,i,a,s)=>{const u=a.getExpressionRuleValue(t,o||i);return u&&u.value||""},convertTo:(r,i,a,s,u)=>{var l;if(i==="dataPicking"&&(a!=null&&a.target)){const d=`${a.target}_dataPicking`;((l=a.rules)==null?void 0:l.some(p=>p.id===d&&p.value))?r.dictPickingExpressionId=d:delete r.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=t}getExpressionRule(t,o){const r=this.getExpressionData();if(!r)return"";const i=r.find(s=>s.target===t);if(!i)return"";const a=i.rules.find(s=>s.type===o);return a||""}getContextFormVariables(){const{module:t}=this.formSchemaService.getFormSchema();if(!t.viewmodels||t.viewmodels.length===0)return[];const o=this.formSchemaService.getRootViewModelId(),r=this.formSchemaService.getViewModelById(o);if(!r||!r.states||r.states.length===0)return[];const i=[];return r.states.filter(a=>a.category==="remote").forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(t,o,r="label"){return{id:t.id,name:t.name,bindingPath:t[r],parents:o,type:"field"}}buildEntityFieldsTreeData(t=null,o){const r=[];return t==null||t.forEach(i=>{var u;const a=this.createTreeNode(i,o);let s=[];(u=i.type)!=null&&u.fields&&(s=this.buildEntityFieldsTreeData(i.type.fields,[...o,i.label])),r.push({data:a,children:s,expanded:!0})}),r}buildChildEntityTreeData(t=null,o){const r=[];return t==null||t.forEach(i=>{var l,d;const a=this.createTreeNode(i,o);a.type="entity";const s=this.buildEntityFieldsTreeData((l=i.type)==null?void 0:l.fields,[...o,i.label]),u=this.buildChildEntityTreeData((d=i.type)==null?void 0:d.entities,[...o,i.label]);u!=null&&u.length&&(s==null||s.push(...u)),r.push({data:a,children:s||[],expanded:!0})}),r}getEntitiesTreeData(){const t=this.formSchemaService.getSchemaEntities();if(!(t!=null&&t.length))return[];const o=t[0];if(!(o!=null&&o.type))return[];const r=this.buildEntityFieldsTreeData(o.type.fields,[o.code]),i=this.buildChildEntityTreeData(o.type.entities,[o.code]);return i!=null&&i.length&&(r==null||r.push(...i)),{entityCode:o.code,fields:[{data:this.createTreeNode(o,[],"code"),children:r||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(t,o,r){const i=r==="Field"?t.binding.field:t.id,a=this.getExpressionRule(i,o),s=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(o)&&a?a.message:"",...s};return a.messageType!=null&&(u.messageType=a.messageType),u}buildRule(t,o,r,i){const{expression:a,message:s,messageType:u}=o,l={id:`${t}_${r}`,type:r,value:a};return(r==="validate"||r==="dataPicking"||r==="required")&&(l.message=s),r==="dataPicking"&&(l.messageType=u),r==="validate"&&i&&(l.elementId=i),l}getExpressionData(){const{expressions:t}=this.formSchemaService.getFormSchema().module;return t||[]}updateExpression(t,o,r,i){const a=o==="Field"?t.binding.field:t.id,s=this.buildRule(a,r,i,t.type==="form-group"?t.id:"");let l=this.getExpressionData().find(m=>m.targetType===o&&m.target===a);const d=m=>m.value.trim()==="";if(l){const m=l.rules.find(p=>p.id===s.id);if(m)d(s)?l.rules=l.rules.filter(p=>p.id!==s.id):(Object.assign(m,s),i==="validate"&&t.type==="form-group"&&(m.elementId=t.id));else{if(d(s))return null;l.rules=l.rules||[],l.rules.push(s)}}else{if(d(s))return null;l={target:`${a}`,rules:[s],targetType:o}}return l}getExpressionEditorOptions(t,o,r,i){return r.reduce((a,s)=>{var l,d;const u=o==="Field"?(l=t==null?void 0:t.binding)==null?void 0:l.field:t.id;return a[s]={hide:o==="Field"?!!((d=t==null?void 0:t.binding)!=null&&d.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(u),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(t,s,o),onSubmitModal:m=>{const p=this.updateExpression(t,o,m,s);if(i){const C=this.buildRule(u,m,s);i(C)}return p}}},a},{})}getExpressionInfo(t,o,r){const i=o==="Field"?t.binding.field:t.id,a=this.getExpressionRule(i,r),s={value:a&&a.value,targetId:i,targetType:o,expressionType:r};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(t,o,r=["compute","dependency","validate"],i){var a;return{description:"表达式",title:"表达式",hide:!(t.binding&&((a=t.binding)==null?void 0:a.type)==="Form"),properties:{...this.getExpressionEditorOptions(t,o,r,i)}}}getExpressionOptions(t,o,r){const i=this.getExpressionInfo(t,o,r);return{dialogTitle:`${this.expressionNames[r]||"表达式"}编辑器`,singleExpand:!1,showMessage:r==="required",beforeOpen:()=>this.onBeforeOpenExpression(t,r,o),expressionInfo:i}}}function Mr(e){const{formSchemaUtils:t,formStateMachineUtils:o}=e;function r(l,d=""){return{path:d+l.code,field:l.id,fullPath:l.code}}function i(l,d=""){const m=t.getViewModelById(l);return m?m.states.map(p=>r(p,d)):[]}function a(l){const d=t.getRootViewModelId(),m=i(l);if(l===d)return m;const p=i(d,"root-component.");return[...m,...p]}function s(l){return l.binding&&l.binding.path||l.id||""}function u(){return o&&o.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:u}}function jr(e,t,o,r){const{getVariables:i,getControlName:a,getStateMachines:s}=Mr(e);return(u,l=[],d={},m={},p)=>{const C=l&&l.length>0?l:["Const","Variable","StateMachine","Expression"],c={type:"property-editor",propertyTypes:C};return C.forEach(f=>{switch(f){case"Const":Object.assign(c,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},d);break;case"Expression":break;case"StateMachine":c.stateMachines=s();break;case"Variable":Object.assign(c,{controlName:a(u),newVariablePrefix:"is",newVariableType:"Boolean",variables:i(t),parentComponentId:o==="root-component"?"":"root-component",onBeforeOpenVariables:S=>{S.value=i(t)}},m),(r==null?void 0:r.designerMode)==="PC_RTC"&&(c.newVariablePrefix="ext_"+c.newVariablePrefix);break}}),c}}class Dr{constructor(t,o){we(this,"componentId");we(this,"viewModelId");we(this,"eventsEditorUtils");we(this,"formSchemaUtils");we(this,"formMetadataConverter");we(this,"designViewModelUtils");we(this,"designViewModelField");we(this,"controlCreatorUtils");we(this,"designerHostService");we(this,"designerContext");we(this,"modalService",null);we(this,"formRule",null);we(this,"schemaService",null);we(this,"metadataService",null);we(this,"propertyConfig",{type:"object",categories:{}});we(this,"expressionProperty");var r;this.componentId=t,this.designerHostService=o,this.eventsEditorUtils=o.eventsEditorUtils,this.formSchemaUtils=o.formSchemaUtils,this.formMetadataConverter=o.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=o.designViewModelUtils,this.controlCreatorUtils=o.controlCreatorUtils,this.metadataService=o.metadataService,this.schemaService=o.schemaService,this.designerContext=o.designerContext,this.modalService=o.modalService,this.expressionProperty=new Er(this.formSchemaUtils)}inResponsiveForm(){var t;return!!((t=this.designerContext)!=null&&t.responsiveForm)}getFormDesignerInstance(){var t,o;return(o=(t=this.designerContext)==null?void 0:t.instances)==null?void 0:o.formDesigner.value}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var r;const o=t.binding&&t.binding.type==="Form"&&t.binding.field;if(o){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===o)}t.updateOn=(r=this.designViewModelField)==null?void 0:r.updateOn}}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:t.type,name:pt.DgControl[t.type]&&pt.DgControl[t.type].name}]}}}}}getAppearanceConfig(t=null,o={},r){const i={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const s in o)a[s]=Object.assign(a[s]||{},o[s]);return{...i,properties:{...a},setPropertyRelates(s,u){if(s){switch(s&&s.propertyID){case"class":case"style":{pt.canvasChanged.value++;break}}r&&r(s,t,u)}}}}getPropertyEditorParams(t,o=[],r="visible",i={},a={},s=""){const l=jr(this.designerHostService,this.viewModelId,this.componentId,this.designerContext)(t,o,i,a,s||r);if((l.propertyTypes||[]).indexOf("Expression")>-1){const m=this.getRealTargetType(t);l.expressionConfig=this.getExpressionOptions(t,m,s||r)}return l}getVisibleProperty(t,o=""){var a;let r=["Const","Variable","StateMachine","Expression"];return o==="gridFieldEditor"?r=["Const","Expression"]:o==="form-group"&&!((a=t.binding)!=null&&a.field)?r=["Const","Variable","StateMachine","Custom"]:o==="dataGrid"||o==="treeGrid"||o==="wizard"?r=["Const","Variable","Expression"]:(t.type.indexOf("toolbar-item")>-1||o==="form-group")&&(r=["Const","Variable","StateMachine","Custom","Expression"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(t,r,"visible")}}}getBehaviorConfig(t,o="",r={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(t,o);for(const l in r)s[l]=Object.assign(s[l]||{},r[l]);const u=this;return{...a,properties:{...s},setPropertyRelates(l,d){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(t,l);break}i&&i(l,d)}}}}afterMutilEditorChanged(t,o){this.addNewVariableToViewModel(o,this.viewModelId),this.updateExpressionValue(o,t),this.clearExpression(o,t)}updateElementByParentContainer(t,o){const r=o&&o.parent&&o.parent.schema;if(!r)return;const i=r.contents.findIndex(s=>s.id===t),a=Se.cloneDeep(r.contents[i]);r.contents.splice(i,1),r.contents.splice(i,0,a),pt.refreshCanvas()}addNewVariableToViewModel(t,o){const r=t.propertyValue;if(!(r&&typeof r=="object")||!(r.type==="Variable"&&r.isNewVariable))return;const s={id:r.field,category:"locale",code:r.fullPath,name:r.fullPath,type:r.newVariableType||"String",isRtcVariable:this.designerContext.designerMode==="PC_RTC"?!0:void 0};delete r.newVariableType,delete r.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(s)}getExpressions(){let t=[];return this.formRule?(this.formRule.expressions=this.formRule.expressions||[],t=this.formRule.expressions||[]):t=this.formSchemaUtils.getExpressions(),t}updateExpressionValue(t,o){const r=t.propertyValue;if(!((r&&r.type)==="Expression"&&r.expressionInfo))return;const{expressionId:s,expressionInfo:u}=r,{targetId:l,targetType:d,expressionType:m,value:p,message:C}=u,c=this.getExpressions();let f=c.find(E=>E.target===l);f||(f={target:l,rules:[],targetType:d},c.push(f));const S=f.rules.find(E=>E.type===m);if(S)S.id=s,S.value=p,S.message=C,(m==="minDate"||m==="maxDate"||m==="defaultTime")&&(S.elementId=o.id);else{const E={id:s,type:m,value:p,message:C,elementId:o.id};f.rules.push(E)}delete r.expressionInfo}clearExpression(t,o){const r=t.propertyValue;if(r&&r.type==="Expression")return;const a=t.propertyID,s=this.getExpressions(),u=o.binding?o.binding.field:o.id,l=s.find(d=>d.target===u);!l||!l.rules||(l.rules=l.rules.filter(d=>d.type!==a))}getExpressionOptions(t,o,r){return this.expressionProperty.getExpressionOptions(t,o,r)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item","drawer-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}createBaseEventProperty(t){const o={};return o[this.viewModelId]={type:"events-editor",editor:{initialData:t,viewSourceHandle:r=>{var i;((i=r.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(r)}}},o}}class kr extends Dr{constructor(t,o){super(t,o)}getPropertyConfig(t){const o=this;this.getBasicPropConfig(t),this.getAppearanceProperties(t);const r=this.getPropertyEditorParams(t,["Variable"]);return this.propertyConfig.categories.behavior=this.getBehaviorConfig(t,"step",{activeIndex:{title:"当前步骤变量",type:"array",description:"当前步骤变量",editor:r},stepTemplate:{description:"步骤条模板",title:"步骤条模板",type:"string",editor:{type:"code-editor",language:"html"}},stepDataSourceType:{title:"数据源类型",type:"enum",description:"数据源类型",editor:{data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},steps:{title:"步骤条",type:"array",description:"步骤条信息",visible:!t.stepDataSourceType||t.stepDataSourceType==="static",editor:{columns:[{field:"id",title:"值",dataType:"string"},{field:"title",title:"名称",dataType:"string"}],type:"item-collection-editor",valueField:"id",nameField:"title",requiredFields:["id","title"],uniqueFields:["id","title"]},refreshPanelAfterChanged:!0},stepsMessage:{title:"数据源",type:"array",description:"数据源",visible:t.stepDataSourceType==="dynamic",editor:r}},(i,a)=>{switch(i.propertyValue,i.propertyID){case"stepsMessage":case"activeIndex":{o.afterMutilEditorChanged(t,i);break}}}),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){const o=super.getBasicPropConfig(t);this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{...o.properties}}}assembleSchemaEntityToTree(t,o,r,i="",a=[]){const s=i?`${i}/${t.label}`:"/";return a.push({id:t.id,name:t.name,label:t.label,layer:o,parent:r&&r.id,bindTo:s.replace("//","/")}),t.type.entities&&t.type.entities.length&&t.type.entities.map(u=>this.assembleSchemaEntityToTree(u,o+1,t,s,a)),a}getAppearanceProperties(t){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{title:"class样式",type:"string",description:"组件的class样式"},fill:{title:"是否填充",type:"boolean",description:"是否填充"},direction:{title:"排列方式",type:"enum",description:"排列方式",editor:{data:[{id:"vertical",name:"垂直"},{id:"horizontal",name:"水平"}]}}}}}getEventPropConfig(t){var s;const o=[{label:"onClick",name:"点击事件"},{label:"beforeClickStep",name:"步骤点击前事件"}];(s=t.pagination)==null||s.enable;const r=this,i=r.eventsEditorUtils.formProperties(t,r.viewModelId,o),a=r.createBaseEventProperty(i);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:je.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(u,l){const d=u.propertyValue;delete t[r.viewModelId],d&&(d.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(t,r.viewModelId,d.events,d))}}}}function Br(e,t){const o=e.schema;function r(){return""}function i(m){return!1}function a(){return!0}function s(){return!0}function u(){return!0}function l(m){return new kr(m,t).getPropertyConfig(o)}function d(){var m,p,C,c;if(e&&t){const f=(m=e==null?void 0:e.componentInstance)==null?void 0:m.value.belongedComponentId;let S="",E="";const{formSchemaUtils:b}=t;if(f){const w=b.getRootViewModelId(),O=b.getComponentByViewModelId(w),V=b.selectNode(O,y=>y.contents&&y.contents.find(h=>h.component===f));(V==null?void 0:V.type)===((p=Fe["tab-page"])==null?void 0:p.type)&&((C=V==null?void 0:V.contents)!=null&&C.length)&&(S=V.title||""),(V==null?void 0:V.type)===((c=Fe.section)==null?void 0:c.type)&&(V==null?void 0:V.showHeader)!==!1&&(S=V.mainTitle||""),S=S?`${S} > `:"",E=S?V.id:""}const g=Fe["list-view"].name;t==null||t.formSchemaUtils.getControlBasicInfoMap().set(e.schema.id,{componentTitle:g,parentPathName:`${S}${g}`,reliedComponentId:E})}}return{canAccepts:i,checkCanDeleteComponent:a,checkCanMoveComponent:s,hideNestedPaddingInDesginerView:u,getPropsConfig:l,setComponentBasicInfoMap:d,getDesignerClass:r}}const Ir=n.defineComponent({name:"FStepDesign",props:$t,emits:[],setup(e,t){const o=n.ref(0),r=n.ref(0),i=n.ref(),a=n.inject("designer-host-service"),s=n.inject("design-item-context"),u=Br(s,a),l=pt.useDesignerComponent(i,s,u),d=[{id:"firstStep",title:"步骤一",description:"步骤一"},{id:"secondStep",title:"步骤二",description:"步骤二"}];n.onMounted(()=>{i.value.componentInstance=l}),t.expose(l.value);const m=n.computed(()=>({"f-progress-step-list":e.direction==="horizontal","f-progress-step-list-block":e.direction==="vertical","f-progress-step-horizontal-fill":e.direction==="horizontal"&&e.fill,"f-progress-step-vertical-fill":e.direction==="vertical"&&e.fill})),p=n.computed(()=>({overflow:"auto"}));function C(h,v){const x={step:!0,active:v===o.value,clickable:e.clickable,"click-disable":h.disabled,current:v===o.value};return v<o.value&&(x.finish=!0),h.status&&(x[h.status]=!0),h.hasOwnProperty("class")&&h.class.split(" ").reduce((F,M)=>(F[M]=!0,F),x),x}function c(h,v){}function f(h,v){const x={"f-progressstep-row":!0,"step-active":v===o.value,"step-current":v===o.value};return v<o.value&&(x["step-finish"]=!0),h.status&&(x["step-"+h.status]=!0),x}function S(h,v){const x={"step-icon":!0,"step-success":v,"k-icon":v,"k-i-check":v};return h.hasOwnProperty("icon")&&h.class.split(" ").reduce((F,M)=>(F[M]=!0,F),x),x}function E(h,v){const x=[];return h.icon?x.push(n.createVNode("span",{class:S(h,!1)},null)):v>=o.value||v===r.value?x.push(n.createVNode("span",{class:"step-icon"},[v+1])):x.push(n.createVNode("span",{class:S(h,!0)},null)),x}function b(h,v){return{"step-name":!0,"step-name-success":v<o.value}}function g(h,v){return n.createVNode("div",{class:"f-progress-step-title"},[n.createVNode("p",{class:b(h,v)},[h.title])])}function w(h,v){return{"f-progress-step-line":!0,"f-progress-step-line-success":v===o.value}}function O(h,v){return v!==e.steps.length-1}const V=n.computed(()=>({triangle:!0}));function y(){return e.steps&&e.steps.length>0?e.steps.map((h,v)=>n.createVNode("li",{class:C(h,v),onClick:x=>void 0},[n.createVNode("div",{class:f(h,v)},[n.createVNode("div",{class:"f-progress-step-content"},[E(h,v),g(h,v)]),O(h,v)&&n.createVNode("div",{class:w(h,v)},[n.createVNode("span",{class:V.value},null)])])])):d.map((h,v)=>n.createVNode("li",{class:C(h,v),onClick:x=>void 0},[n.createVNode("div",{class:f(h,v)},[n.createVNode("div",{class:"f-progress-step-content"},[E(h,v),g(h,v)]),O(h,v)&&v!==d.length-1&&n.createVNode("div",{class:w(h,v)},[n.createVNode("span",{class:V.value},null)])])]))}return()=>n.createVNode("div",{ref:i,class:"f-progress-step"},[n.createVNode("ul",{class:m.value,style:p.value},[y()])])}});function Pr(){function e(t,o){const r={};return r.beforeClickStep=i=>o.call("beforeClickStep",t,[i,t]),r}return{resolve:e}}const Or=Pr();rt.install=e=>{e.component(rt.name,rt)},rt.register=(e,t,o,r)=>{e.step=rt,t.step=ho,r.step={callbackResolver:Or}},rt.registerDesigner=(e,t,o)=>{e.step=Ir,t.step=ho};const Lr="root-viewmodel";class Ar{constructor(t,o){we(this,"formSchemaUtils");we(this,"controlCreatorUtils");we(this,"designViewModelUtils");this.resolver=t,this.designerHostService=o,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(t){const o=this.createComponentRefNode(t),r=this.createComponentNode(t),i=this.createViewModeNode(t),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(i),a.module.components.push(r),this.designViewModelUtils.assembleDesignViewModel(),o}createComponentRefNode(t){const o=this.resolver.getSchemaByType("component-ref");return Object.assign(o,{id:`${t.componentId}-component-ref`,component:`${t.componentId}-component`}),o}createComponentNode(t){const o=this.resolver.getSchemaByType("component"),r=this.createFormComponentContents(t);return Object.assign(o,{id:`${t.componentId}-component`,viewModel:`${t.componentId}-component-viewmodel`,componentType:t.componentType,appearance:{class:this.getFormComponentClass(t)},formColumns:t.formColumns,contents:r}),o}getFormComponentClass(t){var r,i;const{templateId:o}=this.formSchemaUtils.getFormSchema().module;if(o==="double-list-in-tab-template"&&((i=(r=t.parentComponentInstance)==null?void 0:r.schema)==null?void 0:i.type)==="tab-page"){const a=t.parentComponentInstance.parent&&t.parentComponentInstance.parent.schema;if((a==null?void 0:a.type)==="tabs"&&(a==null?void 0:a.fill)===!0)return"f-struct-wrapper f-utils-fill-flex-column"}return"f-struct-wrapper"}createFormComponentContents(t){var u,l;const o=this.resolver.getSchemaByType("section");Object.assign(o,{id:t.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:t.componentName});const r=this.resolver.getSchemaByType("response-form"),i=[];Object.assign(r,{id:t.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:i,controlsInline:!0}),o.contents=[r];const{selectedFields:a}=t;a==null||a.forEach(d=>{if(d.$type===je.FormSchemaEntityField$Type.SimpleField){const m=Se.cloneDeep(d),p=this.resolveControlClassByFormColumns(t),C=this.controlCreatorUtils.setFormFieldProperty(m,"",p);C&&i.push(C)}});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;if(s==="double-list-in-tab-template"&&((l=(u=t.parentComponentInstance)==null?void 0:u.schema)==null?void 0:l.type)==="tab-page"){const d=t.parentComponentInstance.parent&&t.parentComponentInstance.parent.schema;(d==null?void 0:d.type)==="tabs"&&(d==null?void 0:d.fill)===!0&&(o.appearance.class="f-section-grid f-section-in-main px-0 pt-0",o.fill=!0)}return[o]}resolveControlClassByFormColumns(t){let o="";switch(t.formColumns){case 1:{o="col-12 col-md-12 col-xl-12 col-el-12";break}case 2:{o="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{o="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{o="col-12 col-md-6 col-xl-3 col-el-2";break}}return o}createViewModeNode(t){return{id:`${t.componentId}-component-viewmodel`,code:`${t.componentId}-component-viewmodel`,name:t.componentName,bindTo:t.bindTo,parent:Lr,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const o=[],{selectedFields:r}=t;return r==null||r.forEach(i=>{if(i.$type===je.FormSchemaEntityField$Type.SimpleField){let a="blur";const s=i.type.name;(s===je.FormSchemaEntityFieldTypeName.Enum||s===je.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),o.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}}),o}}function vo(e,t,o,r){var a,s,u,l,d,m;const i=o.parentComponentInstance;if(i&&r){const p=(a=i.schema)==null?void 0:a.type,c={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=o.bindingSourceContext)==null?void 0:s.entityTitle)||((l=(u=o.bindingSourceContext)==null?void 0:u.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:p==="splitter-pane"?1:4,parentContainerId:i.schema.id,parentComponentInstance:i,bindTo:((d=o.bindingSourceContext)==null?void 0:d.bindTo)||"/",selectedFields:(m=o.bindingSourceContext)==null?void 0:m.bindingEntityFields};return new Ar(e,r).createComponent(c)}else return t}const qr={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"}},required:["id","type","contents"]},yo=new Map([["appearance",De.resolveAppearance]]),Rr={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dynamic-form.schema.json",title:"dynamic-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"dynamic-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"},headerTitleRenderFunction:{description:"",type:"function",default:null},headerContentRenderFunction:{description:"",type:"function",default:null},footerRenderFunction:{description:"",type:"function",default:null},mode:{description:"",type:"string",default:"quick"},footerStyle:{description:"",type:"string",default:""},headerStyle:{description:"",type:"string",default:""},toolbar:{description:"",type:"array",default:[]},moreButtonClass:{description:"",type:"string",default:"btn-link"},onClick:{description:"",type:"string",default:""},onChange:{description:"",type:"string"},callback:{description:"",type:"string"}},required:["id","type","contents"],events:{onClick:"点击事件",onChange:"ֵ值变化事件",event:"内部控件事件",callback:"内部控件属性回调事件"}};var ht=(e=>(e.Header="header",e.Footer="footer",e))(ht||{}),Mt=(e=>(e.QUICK="quick",e.FULL="full",e))(Mt||{});const jt={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0},fields:{type:Array,default:[]},formData:{type:Object,default:null},layout:{type:String,default:"col-12 col-md-6 col-xl-3 col-el-2"}},_r=Object.assign({},jt,{canRenderForm:{type:Boolean,default:!0},callback:{type:Function},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!1},headerTitleRenderFunction:{type:Function},headerContentRenderFunction:{type:Function},footerRenderFunction:{type:Function},showFooter:{type:Boolean,default:!1},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},enableAccordion:{type:Boolean,default:!0},mode:{type:String,default:Mt.QUICK},toolbar:{type:[Array,Function],default:[]},headerStyle:{type:[String,Function],default:""},footerStyle:{type:[String,Function],default:""},moreButtonClass:{type:String,default:"btn-link"}});De.createPropsResolver(jt,qr,yo,vo),De.createPropsResolver(jt,Rr,yo,vo);function Ur(e,t){function o(s){return e.value&&e.value[s]}const r=[];function i(s){r.push(s)}function a(s,u,l){const d=e.value?e.value[s]:void 0;e.value&&(e.value[s]=l),u&&(t&&(t.emit("update:modelValue",{elementId:s,field:u,value:l,modelValue:e.value}),t.emit("change",{elementId:s,field:u,value:l,modelValue:e.value})),r.forEach(m=>{m({elementId:s,field:u,value:l,oldValue:d,modelValue:e.value})}))}return{getValue:o,setValue:a,onValueChange:i}}const Dt=n.defineComponent({name:"FDynamicForm",props:_r,emits:["update:modelValue","change","event","click"],setup(e,t){const o=n.ref(e.fields),r=new Map,i=n.ref(e.callback);Je.loadRegister();const a=Je.useComponentManager(),s=n.ref(e.formData||{}),u=Ur(s,t);Je.useEntityState(o.value).setup();const d=new Map,m=n.ref(e.canRenderForm);let p=[],C=[],c=[];const f=e.mode===Mt.FULL?"contents":"fields",{mergeArray:S,resolveCallbacks:E,resolveEvents:b}=Je.useDynamicViewUtils(),g=n.computed(()=>{const T=Ue.LocaleService.getLocale(),ie=e.fields&&e.fields.length>0;let ae={"f-form-layout":ie,"farris-form":ie,"f-dynamic-form":!(e.showHeader||e.showFooter)};return ae=je.getCustomClass(ae,e.customClass),e.adaptForLanguage&&T&&(ae["farris-form-controls-inline"]=T!=="en"),ae});function w(){function T(ie,ae){const{id:le}=ie||{},{field:ye}=ie.binding||{};return{modelValue:ae.getValue(le),"onUpdate:modelValue":ke=>{ae.setValue(le,ye||le,ke)}}}return{resolve:T}}function O(T){const ie=w();return u.getValue(T.id)===void 0&&Object.hasOwnProperty.call(T,"modelValue")&&u.setValue(T.id,void 0,T.modelValue),ie.resolve(T,u)}function V(T){const ie={};return T&&Object.entries(T).forEach(([ae,le])=>{ie[ae]=()=>Array.isArray(le)?le.map(ye=>F(ye)):F(le)}),ie}function y(T){return T.type?T.type:T[f]?"fieldset":"form-group"}function h(T){const ie=y(T),ae=T.customClass||"";return ae||(ie==="fieldset"?"col-12 px-0":p.length===0&&C.length===0||T.id&&c.find(le=>le[f]?le[f].find(ye=>ye.id===T.id):le.id===T.id)?e.layout:"unset-item")}function v(T){const ie=y(T);let ae={},le="",ye={},ke={};if(e.mode===Mt.FULL){ye={...b(T,t,ie)},ke={...E(T,i,ie)};const Te=Je.componentPropsConverter[ie];ae=Te?Te(T):{},le=h(ae)}else{le=h(T);const{fields:Te,customClass:Pe,...Oe}=T;ae=Oe}return{props:{...{...ae,customClass:le,...O(T)},key:T.id,ref:Te=>{if(Te&&T.id&&!a.has(T.id)){a.register(T.id,Te);const Pe={token:T.id,name:"component:ready",type:y(T),payloads:[n.ref(Te)],schema:T};t.emit("event",Pe)}},onVnodeUnmounted:Te=>{if(T.id&&a.has(T.id)){a.remove(T.id);const Pe={token:T.id,name:"component:unmounted",type:y(T),payloads:[Te],schema:T};t.emit("event",Pe)}}},eventProps:ye,callbackProps:ke}}function x(T,ie){return Array.isArray(T)?T.map(ae=>ie(ae)):ie(T)}function F(T,ie){var Le;const ae=y(T),le=Je.componentMap[ae];if(T.id&&r.set(T.id,T),!le)return null;const ye=()=>T[f]?T[f].map(Te=>F(Te)):null,ke=(Te,Pe,Oe)=>{let Be;return Oe&&Oe.length>0?Be=n.createVNode(Te,{...Pe},Oe):Be=n.createVNode(Te,{...Pe},null),Be},qe=((Le=d.get(T.id))==null?void 0:Le.props)||{};return T[f]&&T[f].length>0?ke(le,qe,[ye()]):T.slots?ke(le,qe,[...Object.values(V(T.slots))]):ke(le,qe)}function M(T){const ie=y(T);if(!Je.componentMap[ie])return;const{props:le,eventProps:ye,callbackProps:ke}=v(T),qe=Je.resolverMap[ie],Le=qe?qe.editorResolver:null,{componentEventProps:Te,editorEventProps:Pe}=ye,{componentCallbackProps:Oe,editorCallbackProps:Be}=ke;if(Te&&Object.keys(Te).length>0&&Object.assign(le,Te),Oe&&Object.keys(Oe).length>0&&Object.assign(le,Oe),Le&&Pe&&Object.keys(Pe).length>0){const Ee=Le.resolve(T);Object.assign(Ee,Pe)}if(Le&&Be&&Object.keys(Be).length>0){const Ee=Le.resolve(T);Object.assign(Ee,Be)}if(le&&Object.keys(le).length>0){const Ee=d.get(T.id);Ee?Se.merge(Ee==null?void 0:Ee.props,le):d.set(T.id,n.reactive({props:le}))}!T[f]||!Array.isArray(T[f])||T[f].forEach(Ee=>M(Ee))}function $(T){const ie=y(T);Je.componentMap[ie]&&(R(T),!(!T[f]||!Array.isArray(T[f]))&&T[f].forEach(le=>$(le)))}function R(T){const ie=O(T);if(ie&&Object.keys(ie).length>0){const ae=d.get(T.id);if(!ae)d.set(T.id,n.reactive({props:ie}));else{const le={...ae==null?void 0:ae.props};Object.keys(ie).forEach(ye=>{le[ye]=ie[ye]}),Object.assign(ae==null?void 0:ae.props,le)}}}n.onMounted(()=>{}),n.watch(()=>e.formData,T=>{s.value=T}),n.watch(()=>s.value,T=>{x(o.value,$)},{deep:!0});function j(T,ie=""){return ie?T.filter(ae=>ae.position===ie):T.filter(ae=>!ae.position||[ht.Header,ht.Footer].indexOf(ae.position)<0)}function _(T){T&&(p=j(T,ht.Header),p.length&&x(p,M),C=j(T,ht.Footer),C.length&&x(C,M),c=j(T),c.length&&x(c,M))}n.watch(()=>e.fields,T=>{r.clear(),a.clear(),s.value=e.formData||{},d.clear(),o.value=T,_(T)}),_(e.fields);function I(T){T.$forceUpdate&&T.$forceUpdate()}function q(T){return u.getValue(T)}function D(){return s.value}function U(T,ie){u.setValue(T,void 0,ie);const ae=r.get(T);ae&&R(ae)}function ne(T){var ie;return(ie=d.get(T))==null?void 0:ie.props}function N(T,ie){const ae=d.get(T);Se.mergeWith(ae==null?void 0:ae.props,ie,S)}t.expose({componentManager:a,rerender:I,getProps:ne,setProps:N,getControlValue:q,setControlValue:U,getValues:D});function P(T=[]){return T.length>0&&x(T,F)}function oe(T){return n.withDirectives(n.createVNode("div",{class:g.value,style:e.customStyle},[t.slots.default&&t.slots.default(),T.length>0&&x(T,F)]),[[n.resolveDirective("area-response")]])}function re(){const T={};let ie="f-dynamic-form-section--header-content",ae="f-dynamic-form-section--footer";return e.showHeader&&(t.slots.headerTitle&&(T.headerTitle=()=>{var le,ye;return(ye=(le=t.slots).headerTitle)==null?void 0:ye.call(le)}),ie+=e.headerContentRenderFunction||t.slots.headerContent?" f-dynamic-form-section--header-cotnent-tmpl":"",t.slots.headerContent?T.headerContent=()=>{var le,ye;return(ye=(le=t.slots).headerContent)==null?void 0:ye.call(le)}:!e.headerContentRenderFunction&&p.length>0&&(T.headerContent=()=>n.withDirectives(n.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline f-dynamic-form-section--fields"},[P(p)]),[[n.resolveDirective("area-response")]]))),e.showFooter&&(ae+=e.footerRenderFunction||t.slots.footer?" f-dynamic-form-section--footer-tmpl":0,t.slots.footer?T.footer=()=>{var le,ye;return(ye=(le=t.slots).footer)==null?void 0:ye.call(le)}:!e.footerRenderFunction&&C.length>0&&(ae+=C.length>0?" f-form-layout farris-form farris-form-controls-inline f-dynamic-form-section--fields":"",T.footer=()=>P(C))),{slots:T,footerClass:ae,headerContentClass:ie}}const Z=n.computed(()=>typeof e.toolbar=="function"?e.toolbar():e.toolbar),he=n.computed(()=>e.headerStyle?typeof e.headerStyle=="function"?e.headerStyle():e.headerStyle:""),xe=n.computed(()=>e.footerStyle?typeof e.footerStyle=="function"?e.footerStyle():e.footerStyle:"");function fe(T,ie){t.emit("click",T,ie)}function ee(){const{slots:T,footerClass:ie,headerContentClass:ae}=re();return n.createVNode(Ao,{customClass:"f-dynamic-form-section",showHeader:e.showHeader,mainTitle:e.mainTitle,enableAccordion:e.enableAccordion?"default":"",headerContentClass:ae,footerClass:ie,buttons:Z.value,headerStyle:he.value,footerStyle:xe.value,headerTitleRenderFunction:e.showHeader&&e.headerTitleRenderFunction?()=>e.headerTitleRenderFunction():null,headerContentRenderFunction:e.showHeader&&e.headerContentRenderFunction?()=>e.headerContentRenderFunction():null,footerRenderFunction:e.showFooter&&e.footerRenderFunction?()=>e.footerRenderFunction():null,buttonsClass:"col-auto",onClick:fe,moreButtonClass:e.moreButtonClass},{default:()=>oe(c),...T})}return()=>e.visible?e.showHeader||e.showFooter?ee():m.value&&oe(o.value)||!m.value&&P(o.value):null}}),Co=n.defineComponent({name:"FResponseForm",props:jt,emits:[],setup(e,t){var p;const o=n.ref(),r=n.ref(),i=n.computed(()=>{const C=Ue.LocaleService.getLocale(),c=e.fields&&e.fields.length>0;let f={"drag-container":!0,"f-form-layout":c,"farris-form":c};return f=je.getCustomClass(f,e.customClass),e.adaptForLanguage&&C&&(f["farris-form-controls-inline"]=C!=="en"),f}),a=(p=r.value)==null?void 0:p.componentManager;function s(C){r.value.render(C)}function u(C){return r.value.getControlValue(C)}function l(C,c){r.value.setControlValue(C,c)}function d(C){return r.value.getProps(C)}function m(C,c){r.value.setProps(C,c)}return t.expose({componentManager:a,rerender:s,getProps:d,setProps:m,getControlValue:u,setControlValue:l}),()=>e.visible&&n.withDirectives(n.createVNode("div",{ref:o,class:i.value,style:e.customStyle},[t.slots.default&&t.slots.default(),e.fields&&e.fields.length>0&&n.createVNode(Dt,{ref:r,fields:e.fields,canRenderForm:!1,formData:e.formData,layout:e.layout},null)]),[[n.resolveDirective("area-response")]])}}),$r={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number],default:null},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},showLabelType:{type:String,default:"visible"},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null},fill:{type:Boolean,default:!1},enableTips:{type:Boolean,default:!1},tipsContent:{type:[Object,String],default:""},linkLabel:{type:String,default:!1}},zr={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""},showType:{type:String,default:"visible"},isLink:{type:Boolean,default:!1}},Hr=n.defineComponent({name:"FDynamicFormLabel",props:zr,emits:["clickLabel"],setup(e,t){n.ref(e.title||e.text);const o=n.ref(e.required),r=n.ref(e.text),i=n.ref(e.valid),a=n.ref(e.inValidTip);n.watch(()=>e.text,()=>{r.value=e.text}),n.watch(()=>e.required,(C,c)=>{C!==c&&(o.value=C)}),n.watch([()=>e.valid,()=>e.inValidTip],([C,c])=>{i.value=C,a.value=c});const s=n.computed(()=>i.value?r.value:a.value),u=n.computed(()=>i.value?"":"color:red"),l=n.computed(()=>({"col-form-label":!0,"f-width-auto":o.value&&(e.showType==="none"||!r.value)})),d=n.computed(()=>e.showType==="force-none"?!1:e.showType==="reserve-space"||o.value||e.showType!=="none"),m=()=>{e.showType!=="reserve-space"&&t.emit("clickLabel")},p=n.computed(()=>({"farris-label-text":!0,"f-pretend-link":!!e.isLink&&e.showType!=="reserve-space"}));return()=>d.value&&n.createVNode("label",{class:l.value,title:s.value,style:u.value},[!i.value&&n.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:a.value},null),n.createVNode("span",{class:p.value,onClick:m},[o.value&&n.createVNode("span",{class:"farris-label-info text-danger"},[n.createTextVNode("*")]),e.showType==="visible"&&r.value])])}}),{globalStorageKey:Wr}=je.useThirdComponent(),z={},H={},W={},Y={};async function Gr(){{const e={schemaMap:De.schemaMap,propertyConfigSchemaMap:De.propertyConfigSchemaMap,propertyEffectMap:De.propertyEffectMap,schemaResolverMap:De.schemaResolverMap};Jt.register(z,H,W,Y),Qt.register(z,H,W,Y),Zt.register(z,H,W,Y,e),en.register(z,H,W,Y),tn.register(z,H,W,Y),ct.register(z,H,W,Y),nn.register(z,H,W,Y,e),on.register(z,H,W,Y),At.register(z,H,W,Y,e),Nt.register(z,H,W,Y,e),At.register(z,H,W,Y,e),Nt.register(z,H,W,Y,e),rn.register(z,H,W,Y,e),qo.register(z,H,W,Y,e),an.register(z,H,W,Y),ln.register(z,H,W,Y,e),cn.register(z,H,W,Y,e),sn.register(z,H,W,Y,e),un.register(z,H,W,Y,e),dn.register(z,H,W,Y,e),fn.register(z,H,W,Y),mn.register(z,H,W,Y,e),Ro.register(z,H,W,Y),Xo.register(z,H,W,Y),pn.register(z,H,W,Y,e),_o.register(z,H,W,Y),Ho.register(z,H,W,Y),hn.register(z,H,W,Y,e),vn.register(z,H,W,Y,e),yn.register(z,H,W,Y,e),bn.register(z,H,W,Y,e),Cn.register(z,H,W,Y),wn.register(z,H,W,Y,e),Uo.register(z,H,W,Y),Sn.register(z,H,W,Y,e),xn.register(z,H,W,Y,e),Tn.register(z,H,W,Y,e),Nn.register(z,H,W,Y),Vn.register(z,H,W,Y,e),Fn.register(z,H,W,Y),En.register(z,H,W,Y,e),Mn.register(z,H,W,Y,e),jn.register(z,H,W,Y,e),Dn.register(z,H,W,Y,e),kn.register(z,H,W,Y,e),In.register(z,H,W,Y,e),Pn.register(z,H,W,Y),Bn.register(z,H,W,Y,e),$o.register(z,H,W),On.register(z,H,W,Y,e),Ln.register(z,H,W,Y,e),An.register(z,H,W,Y,e),qn.register(z,H,W,Y),Rn.register(z,H,W,Y,e),_n.register(z,H,W,Y,e),Un.register(z,H,W,Y,e),Wo.register(z,H,W,Y),$n.register(z,H,W,Y,e),zn.register(z,H,W,Y,e),Hn.register(z,H,W,Y),Wn.register(z,H,W,Y,e),Gn.register(z,H,W,Y,e),Yn.register(z,H,W,Y,e),Xn.register(z,H,W,Y),Kn.register(z,H,W,Y,e),Qn.register(z,H,W,Y),Jn.register(z,H,W,Y,e),Zn.register(z,H,W,Y,e),gn.register(z,H,W,Y,e),zo.register(z,H,W,Y,e),eo.register(z,H,W,Y,e),Go.register(z,H,W,Y,e),to.register(z,H,W,Y,e),Yo.register(z,H,W,Y,e),Ko.register(z,H,W,Y,e),Qo.register(z,H,W,Y),no.register(z,H,W,Y,e),Jo.register(z,H,W,Y),Zo.register(z,H,W,Y),oo.register(z,H,W,Y),ro.register(z,H,W,Y,e),io.register(z,H,W,Y,e),ao.register(z,H,W,Y,e),so.register(z,H,W,Y,e);const t=window[Wr];if(t)for(const o in t)t[o].createPropsResolver=De.createPropsResolver,t[o].register(z,H,W)}}function bo(){Gr();function e(s){const u=z[s];if(!u)throw new Error(`Could not find the editor of type '${s}'`);return u}function t(s,u){const l=H[s];return l?l(u):{}}function o(s){switch(s){case"check-box":return"onChangeValue";case"switch":return"onModelValueChanged";case"check-group":return"onChangeValue";case"combo-list":case"combo-tree":return"onChange";case"combo-lookup":return"";case"year-range":case"year-picker":case"month-range":case"month-picker":case"date-range":case"datetime-range":case"datetime-picker":return"onDatePicked";case"date-picker":return"onUpdate:modelValue";case"time-picker":return"onValueChange";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-editor":case"language-textbox":case"rich-text-editor":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":case"item-collection-editor":case"response-form-layout-setting":case"response-layout-editor-setting":case"response-layout-splitter":case"menu-lookup":case"json-editor":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onChange";case"query-solution-config":case"solution-preset":case"filter-bar-config":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged";case"collection-property-editor":return"onValueChange";default:return"onUpdate:modelValue"}}function r(s){switch(s){case"combo-list":case"input-group":case"textarea":return"onClear"}}function i(s){switch(s){case"input-group":case"textarea":return"onMousedownEvent"}}function a(s){switch(s){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:t,resolveEditorType:e,getChangeFunctionName:o,getClearFunctionName:r,getMousedownFunctionName:i,getMouseupFunctionName:a}}const Yr={errors:{type:Object,default:null}},Kr=n.defineComponent({name:"FValidationMessage",props:Yr,emits:[],setup(e,t){const o=n.ref(e.errors);n.watch(()=>e.errors,a=>{o.value=a});const r=n.ref(!0),i=n.computed(()=>{if(o.value){const a=Object.keys(o.value).map(s=>{var u;return(u=o.value[s])==null?void 0:u.name});return a.length?a.join(" "):""}return""});return()=>i.value&&n.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>r.value=!r.value},[!r.value&&n.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),r.value&&n.createVNode("span",{class:"f-feedback-message"},[i.value])])}}),kt=n.defineComponent({name:"FDynamicFormGroup",props:$r,emits:["change","update:modelValue","clickLabel"],setup(e,t){var $;const o=n.ref(e.id),r=n.ref(e.customClass),i=n.ref(e.editor),a=n.ref(e.label),s=n.ref(e.modelValue),u=n.ref(e.readonly),l=n.ref((($=e.editor)==null?void 0:$.required)||e.required),d=n.ref(e.showLabel),m=n.ref(e.visible);n.ref(e.type);const p=n.ref(),C=n.ref(e.errors),c=je.isMobilePhone(),f=n.ref(e.editor.type||"input-group"),S=n.computed(()=>d.value?e.showLabelType:"none"),{resolveEditorProps:E,resolveEditorType:b,getChangeFunctionName:g,getClearFunctionName:w}=bo(),O=n.computed(()=>{const R={"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":u.value,"align-items-start":i.value.type==="textarea"||i.value.type==="rich-text-editor","form-group--in-mobile":c};return R["form-group--has-"+f.value]=!0,R}),V=n.computed(()=>{if(e.fill)return{maxWidth:"none"}});function y(R,j,_){s.value=j!==void 0?j:R,t.emit("update:modelValue",s.value),t.emit("change",s.value,{newValue:R,newModelValue:j,parameters:_})}function h(R){return(...j)=>{typeof R=="function"&&R(...j)}}function v(R){return(j,_,I)=>{y(j,_,I),typeof R=="function"&&R(j,_,I)}}const x=n.computed(()=>{const R=i.value.type||"input-group",j=b(R),_=E(R,i.value),I=g(R),q=w(i.value.type);return q&&(_[q]=h(_[q])),I&&(_[I]=v(_[I])),(_.id==null||_.id==="")&&(_.id=o.value),R==="number-range"&&i.value.onBeginValueChange&&typeof i.value.onBeginValueChange=="function"?(i.value.onBeginValueChange&&typeof i.value.onBeginValueChange=="function"&&(_.onBeginValueChange=i.value.onBeginValueChange),i.value.onEndValueChange&&typeof i.value.onEndValueChange=="function"&&(_.onEndValueChange=i.value.onEndValueChange)):R==="lookup"&&i.value["onUpdate:idValue"]&&typeof i.value["onUpdate:idValue"]=="function"?(_["onUpdate:idValue"]=i.value["onUpdate:idValue"],_.id=o.value):R==="collection-property-editor"&&i.value.onSelectionChange&&typeof i.value.onSelectionChange=="function"?_.onSelectionChange=i.value.onSelectionChange:R==="property-editor"&&(_.onBeforeOpenVariables=i.value.onBeforeOpenVariables),(R==="lookup"||R==="combo-list"||R==="date-picker")&&(_.title=a.value),()=>n.createVNode(j,n.mergeProps({ref:p},_,{modelValue:s.value,"onUpdate:modelValue":D=>s.value=D}),t.slots)});function F(){return n.createVNode(Kr,{id:`${o.value}-validation-message`,errors:C.value},null)}n.watch([()=>e.id,()=>e.customClass,()=>e.editor,()=>e.label,()=>e.modelValue,()=>e.readonly,()=>e.required,()=>e.showLabel,()=>e.visible,()=>e.errors],([R,j,_,I,q,D,U,ne,N,P])=>{var oe;o.value=R,r.value=j,i.value=_,a.value=I,s.value=q,u.value=D,l.value=((oe=i.value)==null?void 0:oe.required)||U,d.value=ne,m.value=N,C.value=P});function M(R){t.emit("clickLabel",R)}return t.expose({editorRef:p}),()=>m.value&&n.createVNode("div",{id:`${o.value}-form-group`,class:r.value,style:e.customStyle},[n.createVNode("div",{class:"farris-group-wrap",style:V.value},[n.createVNode("div",{class:O.value},[t.slots.label?t.slots.label():n.createVNode(Hr,{id:`${o.value}-lable`,showType:S.value,required:l.value,text:a.value,title:a.value,isLink:!!e.linkLabel,onClickLabel:M},null),n.createVNode("div",{class:"farris-input-wrap"},[t.slots.content?t.slots.content():x.value(),F()]),!!e.enableTips&&n.createVNode(er,null,{default:()=>[n.createVNode("span",{class:"farris-label-tips ml-1"},[n.createVNode("i",{class:"f-icon f-icon-description-tips"},null)])],contentTemplate:e.tipsContent})])])])}}),Xr={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},wo=n.defineComponent({name:"FDynamicFormInput",props:Xr,emits:["change","update:modelValue","mousedown","mouseup"],setup(e,t){const o=n.ref(e.id),r=n.ref(e.editor),i=n.ref(e.modelValue),{resolveEditorProps:a,resolveEditorType:s,getChangeFunctionName:u,getMousedownFunctionName:l,getMouseupFunctionName:d,getClearFunctionName:m}=bo();function p(g,w,O){i.value=w!==void 0?w:g,t.emit("update:modelValue",i.value),t.emit("change",i.value,{newValue:g,newModelValue:w,parameters:O})}function C(g){t.emit("mousedown",g)}function c(g){t.emit("mouseup",g)}function f(){t.emit("update:modelValue","")}function S(g){return(...w)=>{f(),typeof g=="function"&&g(...w)}}function E(g){return(w,O,V)=>{p(w,O,V),typeof g=="function"&&g(w,O,V)}}const b=n.computed(()=>{const g=s(r.value.type),w=a(r.value.type,r.value);w.focusOnCreated=e.focusOnCreated,w.selectOnCreated=e.selectOnCreated;const O=u(r.value.type),V=m(r.value.type);V&&(w[V]=S(w[V])),O&&(w[O]=E(w[O]));const y=l(r.value.type);w[y]=C;const h=d(r.value.type);return w[h]=c,w.id=o.value,()=>n.createVNode(g,n.mergeProps(w,{modelValue:i.value,"onUpdate:modelValue":v=>i.value=v}),null)});return n.watch([()=>e.id,()=>e.editor,()=>e.modelValue],([g,w,O])=>{o.value=g,r.value=w,i.value=O}),()=>b.value()}});Dt.install=e=>{e.component(Co.name,Co).component(wo.name,wo).component(Dt.name,Dt).component(kt.name,kt)};const Qr=n.defineComponent({name:"FEntityBindingSelector",props:pr,emits:["submit","cancel"],setup(e,t){const o=xr(e),{entityColumns:r,entityTreeGridRef:i,entityDataSource:a,checkAndGetSelectedEntity:s,resolveEntityDataSource:u,entityTreeRowOption:l,initialSelectedEntity:d,isMainEntityInitialSelected:m}=o,p=go(e),{fieldColumns:C,resolveFieldDataSource:c,fieldDataSource:f,fieldTreeGridRef:S,fieldTreeRowOption:E,fieldSelectionOption:b,checkAndGetSelectedFields:g,currentComponentType:w}=p,O=new _t;O.globalConfig={position:"top-center"};const V=[{name:"卡片面板",value:"response-form"},{name:"表格",value:"data-grid"}],y=n.ref(),h=n.ref(""),v=n.ref([{id:"selectComponentType",title:"选择组件类型"},{id:"selectEntity",title:"选择实体"},{id:"selectFields",title:"选择显示字段"}]),x=n.ref(0),F=n.ref(""),M=n.computed(()=>P=>({"f-utils-fill":!0,border:P!=="selectComponentType","mx-3":!0,"my-2":!0,"position-relative":!0,"d-none":v.value[x.value].id!==P}));function $(){e.bindingEntityId&&(d!=null&&d.value)&&(h.value=d.value.name),e.componentType||(y.value=m.value?"response-form":"data-grid")}function R(){const P=s();P&&(c(P),S.value.updateDataSource(f.value))}n.onBeforeMount(()=>{e.steps&&(v.value=v.value.filter(P=>e.steps.includes(P.id))),F.value=v.value[0].id,u(),$()}),n.onMounted(()=>{var P,oe;i&&((P=d.value)!=null&&P.id)&&i.value.selectRowById((oe=d.value)==null?void 0:oe.id),v.value.length===1&&v.value[0].id==="selectFields"&&R()});function j(P){var oe;(oe=S==null?void 0:S.value)!=null&&oe.emptyCurrentRowId&&S.value.emptyCurrentRowId()}function _(){return n.createVNode(Ut,{key:1,ref:i,fit:!0,data:a.value,idField:"id",columns:r.value,rowNumber:{enable:!1},"row-option":l,columnOption:{fitColumns:!0}},null)}function I(){return n.createVNode(Ut,{key:2,ref:S,hierarchy:{cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}},fit:!0,data:f.value,idField:"id",columns:C.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},"row-option":E,selection:b},null)}function q(){const P={editable:!1,type:"combo-list",data:V,idField:"value",valueField:"value",textField:"name"},oe={type:"input-group",enableClear:!1};return n.createVNode("div",null,[n.createVNode("div",{class:"f-utils-fill"},[n.createVNode("div",{class:"f-section py-0"},[n.createVNode("div",{class:"f-section-header"},[n.createVNode("div",{class:"f-title"},[n.createVNode("h4",{class:"f-title-text"},[n.createTextVNode("组件信息")])])]),n.createVNode("div",{class:"f-section-content"},[n.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[n.createVNode(kt,{label:"组件类型",customClass:"col-12",modelValue:y.value,"onUpdate:modelValue":re=>y.value=re,required:"true",editor:P,onChange:j},null),n.createVNode(kt,{label:"组件标题",customClass:"col-12",modelValue:h.value,"onUpdate:modelValue":re=>h.value=re,required:"true",editor:oe},null)])])])])])}function D(){x.value--,F.value=v.value[x.value].id}function U(){var P;switch(F.value){case"selectEntity":{R();break}case"selectComponentType":{if(!y.value){O.warning("请先选择组件类型");return}if(!((P=h.value)!=null&&P.trim())){O.warning("请先填写组件标题");return}w.value=y.value,c(d.value),S.value.updateDataSource(f.value);break}}x.value++,F.value=v.value[x.value].id}function ne(){t.emit("cancel")}function N(){var re;const P=s(),oe=g();if(P){const Z={bindingType:"entity"};Z.bindingEntity=P,Z.bindTo=o.entityBindToMap.get(((re=Z.bindingEntity)==null?void 0:re.label)||""),Z.bindingEntityFields=oe,Z.entityTitle=h.value,t.emit("submit",{bindingContext:Z,componentType:y.value})}}return()=>{var P;return n.createVNode("div",{class:"h-100 d-flex flex-column"},[((P=v.value)==null?void 0:P.length)>1?n.createVNode(rt,{steps:v.value,activeIndex:x,style:"align-self:center"},null):"",n.createVNode("div",{class:M.value("selectEntity"),style:"border-radius:10px;"},[_()]),n.createVNode("div",{class:M.value("selectComponentType"),style:"border-radius:10px;"},[q()]),n.createVNode("div",{class:M.value("selectFields"),style:"border-radius:10px;"},[I()]),n.createVNode("div",{class:"modal-footer"},[n.createVNode("button",{class:"btn btn-secondary",onClick:ne},[n.createTextVNode("取消")]),x.value!==0?n.createVNode("button",{class:"btn btn-secondary",onClick:D},[n.createTextVNode("上一步")]):"",x.value!==v.value.length-1?n.createVNode("button",{class:"btn btn-primary",onClick:U},[n.createTextVNode("下一步")]):"",x.value===v.value.length-1?n.createVNode("button",{class:"btn btn-primary",onClick:N},[n.createTextVNode("确定")]):""])])}}});function So(e){let t,o;function r(y,h,v){var F;const x={componentType:y.getAttribute("data-controltype")||"",componentFeature:y.getAttribute("data-feature")||"",componentCategory:y.getAttribute("data-category")||"",label:y.getAttribute("data-controlTypeName")||"",sourceType:y.getAttribute("data-sourceType")||"move",parentComponentInstance:v.componentInstance.value,sourceElement:y,sourceContainer:h,targetContainer:v,bindingSourceContext:null,bindingTargetId:y.getAttribute("data-fieldId")||""};return y.componentInstance&&(x.componentType=(F=y.componentInstance.value.schema)==null?void 0:F.type),x}function i(y){var x,F;const{bindingContext:h,componentType:v}=y;o.bindingSourceContext=h,v&&(o.componentType=v),(x=t==null?void 0:t.modalRef)!=null&&x.value.close&&((F=t==null?void 0:t.modalRef)==null||F.value.close())}function a(){var y,h;o.bindingSourceContext=void 0,(y=t==null?void 0:t.modalRef)!=null&&y.value.close&&((h=t==null?void 0:t.modalRef)==null||h.value.close())}function s(){const{componentType:y,bindingTargetId:h,parentComponentInstance:v}=o;let x=[];return y&&(y==="list-view"||y==="calendar"||y==="uploader"?x=["selectEntity"]:x=["selectEntity","selectFields"]),h&&(x=["selectComponentType","selectFields"]),()=>n.createVNode(n.Fragment,null,[n.createVNode(Qr,{componentType:y,bindingEntityId:h,steps:x,designerHostService:e,targetComponentInstance:v,onSubmit:i,onCancel:a},{default:()=>[n.createTextVNode(" ")]}),n.createTextVNode(" ")])}function u(){return new Promise((y,h)=>{const{componentType:v}=o,x=v==="list-view"||v==="calendar"||v==="uploader";t=e.modalService.open({title:"选择绑定",width:x?550:800,height:x?400:600,fitContent:!1,showButtons:!1,render:s(),enableEsc:!1,rejectCallback:()=>{o.bindingSourceContext=void 0},closedCallback:()=>{y(o)},draggable:!0})})}function l(){var y,h;o.bindingSourceContext=void 0,(y=t==null?void 0:t.modalRef)!=null&&y.value.close&&((h=t==null?void 0:t.modalRef)==null||h.value.close())}function d(y){let h="",v="";return Fe["field-set"]&&y.schema.type===Fe["field-set"].type&&(h=y.schema.id,v=y.schema.title),{groupId:h,groupName:v}}function m(y){var $,R;if(!y||!y.selectedData||!y.bindingType)return;const{selectedData:h,bindingType:v}=y,{groupId:x,groupName:F}=d(o.parentComponentInstance),M={bindingType:"field"};if(v==="Form"){const j=h;M.entityFieldNode=j,M.designViewModelField=Se.merge({},j,{groupId:x,groupName:F}),o.bindingSourceContext=M}else{const j=h;M.variableFieldNode=Se.merge({},j,{groupId:x,groupName:F}),o.bindingSourceContext=M}($=t==null?void 0:t.modalRef)!=null&&$.value.close&&((R=t==null?void 0:t.modalRef)==null||R.value.close())}function p(){var y,h;o.bindingSourceContext=null,(y=t==null?void 0:t.modalRef)!=null&&y.value.close&&((h=t==null?void 0:t.modalRef)==null||h.value.close())}function C(){const{parentComponentInstance:y}=o,v={viewModelId:e.formSchemaUtils.getViewModelIdByComponentId(y==null?void 0:y.belongedComponentId),designerHostService:e,disableOccupiedFields:!0,componentSchema:{editor:{type:o.componentType}}},x={enable:!1};return()=>n.createVNode(n.Fragment,null,[n.createVNode(gn.FBindingSelectorContainer,{editorParams:v,showCustomFooter:!0,bindingType:x,onSubmit:m,onCancel:l,onSkip:p},{default:()=>[n.createTextVNode(" ")]}),n.createTextVNode(" ")])}function c(){return new Promise((y,h)=>{t=e.modalService.open({title:"选择绑定",width:800,height:600,fitContent:!1,showButtons:!1,render:C(),enableEsc:!1,rejectCallback:()=>{o.bindingSourceContext=void 0},closedCallback:()=>{y(o)},draggable:!0})})}function f(){const{formSchemaUtils:y}=e,h=o.parentComponentInstance.belongedComponentId,v=new Set,x=y.getFormSchema().module,F=x.components.find(j=>j.id===h),M=y.getViewModelById(F.viewModel);let $=F.componentType;const R=y.checkComponentExistInDrawer(F.id);return($==="frame"||$==="table")&&($="form"),x.viewmodels.forEach(j=>{if(!j.fields||j.fields.length===0)return;const _=x.components.find(D=>D.viewModel===j.id);let{componentType:I}=_;if((I==="frame"||I==="table")&&(I="form"),I!==$||j.bindTo!==M.bindTo)return;const q=y.checkComponentExistInDrawer(_.id);R&&q&&j.fields.forEach(D=>{v.add(D.id)}),!R&&!q&&j.fields.forEach(D=>{v.add(D.id)})}),v}function S(){const{bindingTargetId:y,parentComponentInstance:h}=o;if(!y){o.bindingSourceContext=void 0;return}if(f().has(y)){const x=new tr.FNotifyService;x.globalConfig={position:"top-center"},x.warning("表单已经包含此字段,请勿重复添加"),o.bindingSourceContext=void 0;return}else{const x={bindingType:"field"},F=e.formSchemaUtils.getComponentById(h.belongedComponentId),M=e.schemaService.getFieldByIDAndVMID(y,F.viewModel),$=Se.merge({},M.schemaField);x.entityFieldNode=$;const{groupId:R,groupName:j}=d(o.parentComponentInstance);x.designViewModelField=Se.merge({},$,{groupId:R,groupName:j}),o.bindingSourceContext=x}}function E(){return o.bindingTargetId?S():c()}function b(){const{schemaService:y}=e,h=y.getPrimaryField(),v=y.getSchemaEntities();if(!(!h||!v))return v[0].type.fields.find(x=>x.bindingField===h)}function g(){const{componentType:y}=o;if(y===Fe["approval-logs"].type){const h=b();if(!h)return;const v={bindingType:"field",entityFieldNode:h};o.bindingSourceContext=v}}function w(){const{parentComponentInstance:y}=o,h=y.addNewChildComponentSchema(o,e);o.componentSchema=h}async function O(){const{componentCategory:y}=o;switch(y){case"input":{await E();break}case"dataCollection":{await u();break}case"approval":{g();break}}}async function V(y,h,v){return o=r(y,h,v),await O(),o.bindingSourceContext===void 0?null:(w(),o)}return{getComponentResolveContext:r,resolveComponentCreationContextByDrop:V}}function Jr(e,t){let o;function r(c,f,S){var b,g;if(c.contains(f)||f.classList.contains("no-drop"))return!1;const E=!0;if(c.componentInstance&&c.componentInstance.value.getDragScopeElement){const w=c.componentInstance.value.getDragScopeElement();if(w&&!w.contains(f))return!1}if((g=(b=f.componentInstance)==null?void 0:b.value)!=null&&g.externalContainerId)return!1;if(f.componentInstance&&f.componentInstance.value.canAccepts){const O=So(e).getComponentResolveContext(c,S,f);return f.componentInstance.value.canAccepts(O)}return E}function i(c,f){const S=f.getBoundingClientRect(),E=c.getBoundingClientRect(),b=E.top>=S.top,g=E.top<S.bottom;return b&&g}function a(c,f){const S=c.querySelector(".dgComponentSelected");if(!(!S||f===0)&&i(S,c)){const E=S.querySelector(".component-btn-group");if(E){const b=E.querySelector("div");if(b&&b.style.top){const g=Number.parseFloat(b.style.top);b.style.top=g-f+"px"}}}}function s(c,f,S){let E=-1;if(!f)return-1;if(c.componentInstance.value.contents)if(S&&S.componentInstance){if(S.getAttribute("data-noattach"))E=Number(S.getAttribute("data-position"));else{const b=S.componentInstance.value.schema;let g={id:b.id};b.type==="component"&&(g={component:b.id}),E=Se.findIndex(c.componentInstance.value.contents,g),E=E===-1?0:E}E!==-1&&c.componentInstance.value.contents.splice(E,0,f)}else c.componentInstance.value.contents.push(f);return E}function u(c,f,S,E){So(e).resolveComponentCreationContextByDrop(c,S,f).then(g=>{if(!g)return;const w=g.componentSchema;w&&(t!=null&&t.appendIdentifyForNewControl&&t.appendIdentifyForNewControl(w),s(f,w,E))}),f.contains(c)&&f.removeChild(c)}function l(c,f,S,E){let b,g=-1;if(c.componentInstance&&c.componentInstance.value.triggerBelongedComponentToMoveWhenMoved){const V=c.componentInstance.value.getBelongedComponentInstance(c.componentInstance);V&&(c=n.ref(V.elementRef).value.parentElement,S=c.parentElement)}const w=c.componentInstance&&c.componentInstance.value.schema;let O={id:w&&w.id};(w==null?void 0:w.type)==="component"&&(O={component:w&&w.id}),g=Se.findIndex(S.componentInstance.value.contents,O),g!==-1&&S.componentInstance.value.contents&&(b=S.componentInstance.value.contents.splice(g,1),b=b[0]),s(f,b,E),S.componentInstance&&S.componentInstance.value.onChildElementMovedOut&&S.componentInstance.value.onChildElementMovedOut(c),f.componentInstance&&f.componentInstance.value.onAcceptMovedChildElement&&f.componentInstance.value.onAcceptMovedChildElement(c,S)}function d(c,f,S,E){if(!f||c.contains(f))return;switch(c.getAttribute("data-sourceType")){case"control":case"field":case"entity":{u(c,f,S,E);break}default:S.componentInstance.value.contents?l(c,f,S,E):f.contains(c)&&f.removeChild(c)}Ze.value++}function m(c){o&&o.destroy(),mo&&(o=mo([],{mirrorContainer:c,direction:"mixed",revertOnSpill:!0,moves(f,S,E){let b=!0;return f.classList.contains("no-drag")&&(b=!1),f.componentInstance&&(b=!!E.getAttribute("data-dragging-icon")),b},copy(f){return f.classList.contains("drag-copy")},getMirrorText(f){return f.componentInstance&&f.componentInstance.value.getDraggingDisplayText?f.componentInstance.value.getDraggingDisplayText():f.innerText||"控件"},accepts(f,S,E){const b=r(f,S,E),g=c.lastElementChild;return b?g.className=g.className.replace("undroppable",""):g.className.includes("undroppable")||(g.className+=" undroppable"),b}}).on("over",(f,S)=>{S.className+=" drag-over"}).on("out",(f,S)=>{S.className=S.className.replace("drag-over","").replace(" ","")}).on("drop",(f,S,E,b)=>{d(f,S,E,b)}).on("dragend",(f,S)=>{a(c,S)}))}function p(c,f){if(!c)return;if(f.noDragDrop)return c;const S=c.querySelector(`[data-dragref='${f.id}-container']`)||c;o&&S&&o.containers.push(S)}function C(){return o}return{attachComponents:p,initializeDragula:m,getDragulaInstance:C}}const Zr={id:{type:String,default:""},componentId:{type:String,default:""},type:{type:String,default:""},canDelete:{type:Boolean,default:!0},canMove:{type:Boolean,default:!0},canSelectParent:{type:Boolean,default:!0},customButtons:{type:Array,default:[]},customClass:{type:String,default:""},customStyle:{type:String,default:""},modelValue:{type:Object},ignore:{type:Boolean,default:!1}},X={},Q={},te={},{globalStorageKey:ei}=je.useThirdComponent();function ti(){{const e={schemaMap:De.schemaMapForDesigner,propertyConfigSchemaMap:De.propertyConfigSchemaMapForDesigner,propertyEffectMap:De.propertyEffectMapForDesigner,schemaResolverMap:De.schemaResolverMapForDesigner};Jt.registerDesigner(X,Q,te,e),Qt.registerDesigner(X,Q,te,e),Zt.registerDesigner(X,Q,te,e),en.registerDesigner(X,Q,te,e),tn.registerDesigner(X,Q,te,e),nn.registerDesigner(X,Q,te,e),on.registerDesigner(X,Q,te,e),At.registerDesigner(X,Q,te,e),Nt.registerDesigner(X,Q,te,e),Nt.registerDesigner(X,Q,te,e),sn.registerDesigner(X,Q,te,e),rn.registerDesigner(X,Q,te,e),ln.registerDesigner(X,Q,te,e),cn.registerDesigner(X,Q,te,e),dn.registerDesigner(X,Q,te,e),un.registerDesigner(X,Q,te,e),fn.registerDesigner(X,Q,te),mn.registerDesigner(X,Q,te,e),oo.registerDesigner(X,Q,te),pn.registerDesigner(X,Q,te,e),hn.registerDesigner(X,Q,te,e),vn.registerDesigner(X,Q,te,e),yn.registerDesigner(X,Q,te,e),bn.registerDesigner(X,Q,te,e),Cn.registerDesigner(X,Q,te),Sn.registerDesigner(X,Q,te,e),wn.registerDesigner(X,Q,te,e),ro.registerDesigner(X,Q,te,e),xn.registerDesigner(X,Q,te,e),Tn.registerDesigner(X,Q,te,e),Nn.registerDesigner(X,Q,te),Vn.registerDesigner(X,Q,te,e),Fn.registerDesigner(X,Q,te),En.registerDesigner(X,Q,te,e),Mn.registerDesigner(X,Q,te,e),jn.registerDesigner(X,Q,te,e),Dn.registerDesigner(X,Q,te,e),In.registerDesigner(X,Q,te,e),Pn.registerDesigner(X,Q,te,e),Bn.registerDesigner(X,Q,te,e),kn.registerDesigner(X,Q,te,e),On.registerDesigner(X,Q,te,e),Ln.registerDesigner(X,Q,te,e),An.registerDesigner(X,Q,te,e),qn.registerDesigner(X,Q,te),Rn.registerDesigner(X,Q,te,e),_n.registerDesigner(X,Q,te,e),Un.registerDesigner(X,Q,te,e),$n.registerDesigner(X,Q,te,e),zn.registerDesigner(X,Q,te,e),Hn.registerDesigner(X,Q,te),Wn.registerDesigner(X,Q,te,e),Gn.registerDesigner(X,Q,te,e),Yn.registerDesigner(X,Q,te,e),Kn.registerDesigner(X,Q,te,e),Xn.registerDesigner(X,Q,te),an.registerDesigner(X,Q),Qn.registerDesigner(X,Q,te),Jn.registerDesigner(X,Q,te,e),Zn.registerDesigner(X,Q,te,e),eo.registerDesigner(X,Q,te,e),to.registerDesigner(X,Q,te,e),no.registerDesigner(X,Q,te,e),io.registerDesigner(X,Q,te,e),ao.registerDesigner(X,Q,te,e),ct.registerDesigner(X,Q,te,e),so.registerDesigner(X,Q,te,e);const t=window[ei];if(t)for(const o in t)t[o].createPropsResolver=De.createPropsResolver,t[o].registerDesigner(X,Q,te)}}function ni(e){const t={schemaMap:De.schemaMapForDesigner,propertyConfigSchemaMap:De.propertyConfigSchemaMapForDesigner,propertyEffectMap:De.propertyEffectMapForDesigner,schemaResolverMap:De.schemaResolverMapForDesigner};e.forEach(o=>{o.registerDesigner&&o.registerDesigner(X,Q,te,t)})}const oi={id:{type:String}},ri=n.defineComponent({name:"FDesignerPlaceholder",props:oi,emits:[],setup(e){const t=n.computed(()=>({"drag-and-drop-alert":!0,"no-drag":!0,"w-100":!0})),o=n.computed(()=>({height:"60px",display:"flex","justify-content":"center","align-items":"center",margin:0,padding:".75rem 1.25rem",border:"1px solid transparent","border-radius":"3px",color:"#315585","background-color":"#dfedff","border-color":"#d2e6ff"}));return()=>n.createVNode("div",{class:t.value,style:o.value,role:"alert","data-noattach":"true","data-position":"0"},[n.createTextVNode("拖拽组件到这里")])}});function ii(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!n.isVNode(e)}const Bt=n.defineComponent({name:"FDesignerItem",props:Zr,emits:["selectionChange","dragEnd"],setup(e,t){const o=n.ref(`${e.modelValue.id}-component`),r=n.ref(e.canMove),i=n.ref(e.canDelete),a=n.ref(!1),s=n.ref(e.modelValue),u=n.ref(e.componentId||""),l=n.ref(""),d=n.ref(""),m=n.ref(e.customClass),p=n.ref(),C=n.inject("canvas-dragula"),c=n.ref(),f=n.inject("design-item-context");function S(N){N&&Object.assign(s.value,N)}const E={designerItemElementRef:p,componentInstance:c,schema:s.value,parent:f,setupContext:t,updateContextSchema:S};n.provide("design-item-context",E);const b=n.inject("useFormSchema"),g=n.inject("designer-host-service"),w=n.inject("external-container-id"),O=n.computed(()=>{var Z,he,xe;const N=(Z=c.value)!=null&&Z.shouldApplyClassToComponent?(he=c.value)==null?void 0:he.shouldApplyClassToComponent():!0,P=e.modelValue.appearance&&e.modelValue.appearance.class||"",oe=((xe=c.value)==null?void 0:xe.getCustomButtons)&&c.value.getCustomButtons();let re={"farris-component":!0,"flex-fill":s.value.id==="root-component","position-relative":r.value&&i.value||(oe==null?void 0:oe.length),"farris-nested":a.value,"can-move":r.value,"d-none":p.value&&p.value.classList.contains("d-none"),dgComponentSelected:p.value&&p.value.classList.contains("dgComponentSelected"),dgComponentFocused:p.value&&p.value.classList.contains("dgComponentFocused")};return re[`farris-component-${s.value.type}`]=!0,re=N?je.getCustomClass(re,P):re,re=je.getCustomClass(re,d.value),re=je.getCustomClass(re,m.value),re}),V=n.computed(()=>{var re,Z;const N={},P=(re=c.value)!=null&&re.shouldApplyClassToComponent?(Z=c.value)==null?void 0:Z.shouldApplyClassToComponent():!0,oe=e.modelValue.appearance&&e.modelValue.appearance.style||"";return oe&&P&&oe.split(";").reduce((he,xe)=>{const[fe,ee]=xe.split(":");return he[fe]=ee,he},N),l.value&&l.value.split(";").reduce((he,xe)=>{const[fe,ee]=xe.split(":");return fe&&(he[fe]=ee),he},N),N});function y(N,P){var Z,he,xe;if(N&&(N.preventDefault(),N.stopPropagation()),(Z=g==null?void 0:g.designerContext)!=null&&Z.checkCanDeleteControl&&!g.designerContext.checkCanDeleteControl(P))return;if(c.value.triggerBelongedComponentToDeleteWhenDeleted){const fe=c.value.getBelongedComponentInstance(c);if(fe&&fe.parent){const ee=n.ref(fe==null?void 0:fe.parent),T=ee.value.contents.findIndex(ie=>ie.id===fe.schema.id);(xe=(he=ee.value)==null?void 0:he.contents)==null||xe.splice(T,1),Ze.value++}return}c.value.onRemoveComponent(g);let oe=f,re=fe=>fe.id===P.id;if(P.type==="component"&&(oe=f==null?void 0:f.parent,re=fe=>fe.component===P.id),oe&&oe.schema.contents){const fe=oe.schema.contents.findIndex(re);oe.schema.contents.splice(fe,1),Ze.value++,t.emit("selectionChange")}}function h(N){return i.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:P=>{y(P,N)}},[n.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function v(){return r.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[n.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function x(){var P;const N=((P=c.value)==null?void 0:P.getCustomButtons)&&c.value.getCustomButtons();return N&&!!N.length&&N.map(oe=>n.createVNode("div",{role:"button",class:`btn component-settings-button ${oe.class||""}`,title:oe.title,ref:oe.id,onClick:re=>oe.onClick&&oe.onClick(re)},[n.createVNode("i",{class:oe.icon},null)]))}function F(N){return n.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[n.createVNode("div",null,[h(N),v(),x()])])}function M(N,P,oe,re){t.emit("selectionChange",N,P,oe,re)}function $(){t.emit("dragEnd")}function R(){return n.createVNode("div",{class:"no-drag w-100","data-noattach":"true","data-position":"0",style:"height: 60px; display: flex; justify-content: center; align-items: center; margin: 0px; border-radius: 3px; color: #2d2f33; background-color: #d4d6d9;"},[n.createTextVNode("未识别的组件")])}function j(N){let P;const oe=N.type,re=X[oe],Z=Q[oe],he=Z?Z(N):{};he.customClass=e.ignore?he.customClass:"",he.customStyle=e.ignore?he.customStyle:"",he.componentId=u.value,he.id=N.id;const xe=N.contents&&N.contents.length===0;return N.contents&&!!N.contents.length&&re?n.createVNode(re,n.mergeProps({ref:c},he),ii(P=N.contents.map(ee=>n.createVNode(Bt,{key:ee.id,modelValue:ee,"onUpdate:modelValue":T=>ee=T,componentId:u.value,onSelectionChange:M,onDragEnd:$},null)))?P:{default:()=>[P]}):re?xe?n.createVNode(re,n.mergeProps({ref:c},he),{default:()=>[n.createVNode(ri,null,null)]}):n.createVNode(re,n.mergeProps({ref:c},he),null):R()}function _(){const N=b.externalFormSchema.get(w);if(N!=null&&N.content)return N==null?void 0:N.content}function I(N){if(N.type==="component-ref"){const re=(w?_():b==null?void 0:b.getFormSchema()).module.components.find(he=>he.id===N.component),Z=n.ref(re);if(re)return n.createVNode(Bt,{key:re.id,modelValue:Z.value,"onUpdate:modelValue":he=>Z.value=he,componentId:re.id,onSelectionChange:M,onDragEnd:$},null)}}n.watch([()=>e.modelValue,()=>e.componentId],([N,P])=>{s.value=N,o.value=`${N.id}-component`,P&&(u.value=P),n.triggerRef(p)},{deep:!0});function q(N){window.scrollContainerList||(window.scrollContainerList=new Set);const P=N.getAttribute("id");P&&(window.scrollContainerList.add(P),N.componentInstance.value&&(N.componentInstance.value.scrollElementId=P))}function D(N){const P=N==null?void 0:N.target;q(P),gt(P)}function U(){var N,P;if(p.value){(P=(N=s.value)==null?void 0:N.contents)!=null&&P.length&&p.value.addEventListener("scroll",D);const oe=p.value.querySelector(".drag-container");oe&&oe.addEventListener("scroll",D)}}n.onMounted(()=>{if(p.value&&c.value&&c.value.schema){const N=p.value.querySelector(`[data-dragref='${c.value.schema.id}-container']`);C&&N&&C.attachComponents(N,s.value),a.value=c.value.canNested!==void 0?c.value.canNested:a.value,i.value=c.value.canDelete!==void 0?c.value.canDelete:i.value,r.value=c.value.canMove!==void 0?c.value.canMove:r.value,l.value=c.value.styles||"",d.value=c.value.designerClass||"",p.value&&(p.value.componentInstance=c,p.value.designItemContext=E),c.value.belongedComponentId=u.value,c.value.setComponentBasicInfoMap(g),c.value.externalContainerId=w}U(),Ze.value++}),n.onBeforeUnmount(()=>{p.value&&p.value.removeEventListener("scroll",D)});function ne(N){var re;if(N&&(N.preventDefault(),N.stopPropagation()),w){const Z=document.getElementById(`${w}-design-item`);Z&&Z.click();return}let P=E.designerItemElementRef;const oe=p.value;if(oe){const Z=document.getElementsByClassName("dgComponentFocused");Z&&Z.length===1&&Z[0]===p.value||(Array.from(Z).forEach(xe=>xe.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(xe=>xe.classList.remove("dgComponentSelected")),oe.classList.add("dgComponentFocused"),t.emit("selectionChange",s.value.type,s.value,u.value,c.value))}(re=c.value)!=null&&re.getDraggableDesignItemElement&&(P=c.value.getDraggableDesignItemElement(E)),P!=null&&P.value&&P.value.classList.add("dgComponentSelected"),Vt(P==null?void 0:P.value)}return()=>{const N=w?`${w}-`:"";return s.value.type==="component-ref"?I(s.value):n.createVNode("div",{id:`${N}${s.value.id}-design-item`,ref:p,class:O.value,style:V.value,onClick:ne},[F(s.value),j(s.value)])}}}),ai={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showFloatingClose:{type:Boolean,default:!1},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},openedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},position:{type:String,default:"center"},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},maximized:{type:Boolean,default:!1},useTransform:{type:Boolean,default:!0}};class Ie{constructor(t,o){this.x=t,this.y=o}static getTransformInfo(t){const r=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(r.length>=6){const i=parseInt(r[4],10),a=parseInt(r[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(t,o=null){if(this.isMouseEvent(t))return new Ie(t.clientX,t.clientY);if(o===null||t.changedTouches.length===1)return new Ie(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let r=0;r<t.changedTouches.length;r++)if(t.changedTouches[r].target===o)return new Ie(t.changedTouches[r].clientX,t.changedTouches[r].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const o=new Ie(0,0);if(window){const r=window.getComputedStyle(t);if(r){const i=parseInt(r.getPropertyValue("left"),10),a=parseInt(r.getPropertyValue("top"),10);o.x=isNaN(i)?0:i,o.y=isNaN(a)?0:a}return o}return null}static copy(t){return new Ie(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class it{constructor(t,o){this.width=t,this.height=o}static getCurrent(t){const o=new it(0,0);if(window){const r=window.getComputedStyle(t);return r&&(o.width=parseInt(r.getPropertyValue("width"),10),o.height=parseInt(r.getPropertyValue("height"),10)),o}return null}static copy(t){return new it(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function si(e,t){const o=n.ref(),r=n.ref(),i=n.ref(),a=n.ref(),s=n.ref(),u=n.ref(),l=n.ref(),d=n.ref(),m=n.ref(),p=n.ref(),C=n.ref(),c=n.ref(e.resizeable),f=n.ref(),S=n.ref(e.draggable),E=n.ref(!1);function b(){const D=r.value||document.body,U=window.getComputedStyle(D);if(!U||!o.value)return;const ne=Ie.getTransformInfo(o.value),N={};l.value&&(N.deltaL=o.value.offsetLeft-l.value.x,N.deltaT=o.value.offsetTop-l.value.y);const P=U.getPropertyValue("position");N.width=D.clientWidth,N.height=D.clientHeight,N.pr=parseInt(U.getPropertyValue("padding-right"),10),N.pb=parseInt(U.getPropertyValue("padding-bottom"),10),N.position=U.getPropertyValue("position"),P==="static"&&(D.style.position="relative"),N.translateX=ne.x,N.translateY=ne.y,p.value=N}function g(D){if(o.value){a.value=it.getCurrent(o.value),s.value=Ie.getCurrent(o.value),u.value=a.value?it.copy(a.value):null,l.value=s.value?Ie.copy(s.value):null,b();const U=D.target.getAttribute("type")||"";d.value={n:!!U.match(/n/),s:!!U.match(/s/),w:!!U.match(/w/),e:!!U.match(/e/)}}}function w(){var D,U,ne,N;if(o.value){const P=o.value;d.value&&((d.value.n||d.value.s)&&((D=u.value)!=null&&D.height)&&(P.style.height=u.value.height+"px"),(d.value.w||d.value.e)&&((U=u.value)!=null&&U.width)&&(P.style.width=u.value.width+"px"),l.value&&((ne=l.value)!=null&&ne.x&&(P.style.left=l.value.x+"px"),(N=l.value)!=null&&N.y&&(P.style.top=l.value.y+"px")))}}function O(){const D=e.minHeight?e.minHeight:1,U=e.minWidth?e.minWidth:1;u.value&&l.value&&d.value&&a.value&&(u.value.height<D&&(u.value.height=D,d.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-D))),u.value.width<U&&(u.value.width=U,d.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-U))),e.maxHeight&&u.value.height>e.maxHeight&&(u.value.height=e.maxHeight,s.value&&d.value.n&&(l.value.y=s.value.y+(a.value.height-e.maxHeight))),e.maxWidth&&u.value.width>e.maxWidth&&(u.value.width=e.maxWidth,d.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-e.maxWidth))))}function V(){if(r.value){const D=p.value;if(l.value&&u.value&&d.value&&a.value){const U=D.width-D.pr-D.deltaL-D.translateX-l.value.x,ne=D.height-D.pb-D.deltaT-D.translateY-l.value.y;d.value.n&&l.value.y+D.translateY<0&&s.value&&(l.value.y=-D.translateY,u.value.height=a.value.height+s.value.y+D.translateY),d.value.w&&l.value.x+D.translateX<0&&s.value&&(l.value.x=-D.translateX,u.value.width=a.value.width+s.value.x+D.translateX),u.value.width>U&&(u.value.width=U),u.value.height>ne&&(u.value.height=ne)}}}function y(D){if(!i.value||!a.value||!s.value||!d.value)return;D.subtract(i.value);const U=D.x,ne=D.y;d.value.n?(l.value.y=s.value.y+ne,u.value.height=a.value.height-ne):d.value.s&&(u.value.height=a.value.height+ne),d.value.e?u.value.width=a.value.width+U:d.value.w&&(u.value.width=a.value.width-U,l.value.x=s.value.x+U),V(),O(),w()}function h(D){if(!m.value)return;const U=Ie.fromEvent(D);U&&y(U)}function v(){if(o.value){const{width:D,height:U,x:ne,y:N}=o.value.getBoundingClientRect(),P=Ie.getTransformInfo(o.value);return{size:{width:D,height:U},position:{x:ne-P.x,y:N-P.y}}}return null}function x(D){if(o.value){const U=v();C.value=U}i.value=void 0,a.value=null,s.value=null,u.value=null,l.value=null,d.value=null,m.value=null,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",x)}function F(){document.addEventListener("mousemove",h),document.addEventListener("mouseup",x)}function M(D){D instanceof MouseEvent&&D.button===2||S.value&&(document.body.click(),D.stopPropagation(),D.preventDefault(),i.value=Ie.fromEvent(D),m.value=D.target,g(D),F())}function $(D){return o.value=D,c.value&&n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:U=>M(U)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:U=>M(U)},null)])}function R(D=!0){document.body.click();const U=r.value||document.body,ne=it.getCurrent(U),N=o.value;D&&N&&(f.value=v(),f.value.transform=N.style.transform),ne&&N&&(u.value=ne,u.value.height-=14,u.value.width-=14,N.style.height=u.value.height+"px",N.style.width=u.value.width+"px",N.style.left="7px",N.style.top="7px",N.style.transform="",C.value={size:u.value,position:{x:0,y:0}},S.value=!1,E.value=!0)}function j(){var D,U;if(document.body.click(),f.value){const ne={width:f.value.size.width||0,height:f.value.size.height||0},N={x:(window.innerWidth-ne.width)/2,y:(window.innerHeight-ne.height)/2};(D=u.value)==null||D.set(ne),(U=l.value)==null||U.set(N);const P=o.value;P.style.height=ne.height+"px",P.style.width=ne.width+"px",P.style.left=`${N.x}px`,P.style.top=`${N.y}px`,P.style.transform="",C.value={size:ne,position:N},S.value=e.draggable,E.value=!1}}function _(){if(o.value){const D=it.getCurrent(o.value);if(D){const{width:U,height:ne}=D;o.value.style.left=`${(window.innerWidth-U)/2}px`,o.value.style.top=`${(window.innerHeight-ne)/2}px`,o.value.style.transform=""}}}function I(){const D=()=>{E.value?R(!1):_(),document.body.click()};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}}const q=I();return{renderResizeBar:$,boundingElement:r,resizedEventParam:C,maximize:R,restore:j,allowDrag:S,isMaximized:E,unWindowResizeHandle:q,moveToCenter:_}}function li(e,t,o){const r=n.ref(),i=n.ref(e.draggable),a=n.ref(e.lockAxis),s=n.ref(),u=n.ref(),l=n.ref(!1),d=n.ref(new Ie(0,0)),m=n.ref(new Ie(0,0)),p=n.ref(new Ie(0,0)),C=n.ref(new Ie(0,0));n.watch(()=>o.value,h=>{s.value.style.cursor=h?"move":"default"});function c(h,v){if(v.tagName==="BUTTON")return!1;if(v===h)return!0;for(const x in v.children)if(Object.prototype.hasOwnProperty.call(v.children,x)&&c(h,v.children[x]))return!0;return!1}function f(){var F,M;let h=p.value.x+m.value.x,v=p.value.y+m.value.y;a.value==="x"?(h=((F=d.value)==null?void 0:F.x)||0,p.value.x=0):a.value==="y"&&(v=((M=d.value)==null?void 0:M.y)||0,p.value.y=0);const x=`translate3d(${Math.round(h)}px, ${Math.round(v)}px, 0px)`;r.value&&(r.value.style.transform=x),C.value.x=h,C.value.y=v}function S(){if(!u.value||!r.value)return null;const h=u.value.getBoundingClientRect(),v=r.value.getBoundingClientRect(),x={top:h.top<v.top,right:h.right>v.right,bottom:h.bottom>v.bottom,left:h.left<v.left};return x.top||(p.value.y-=v.top-h.top),x.bottom||(p.value.y-=v.bottom-h.bottom),x.right||(p.value.x-=v.right-h.right),x.left||(p.value.x-=v.left-h.left),f(),x}function E(h){h&&(d.value&&h.subtract(d.value),p.value.set(h),f(),S())}function b(h){l.value&&i.value&&(h.stopPropagation(),h.preventDefault(),E(Ie.fromEvent(h,s.value)))}function g(){var h;if(l.value){if(l.value=!1,m.value.add(p.value),p.value.reset(),(h=r.value)==null||h.classList.remove("ng-dragging"),!e.useTransform&&r.value){const{left:v,top:x}=r.value.getBoundingClientRect();r.value.style.left=Math.ceil(v)+"px",r.value.style.top=Math.ceil(x)+"px",r.value.style.transform="none"}t.emit("stopMove"),document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",g)}}function w(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",b),document.addEventListener("mouseup",g))}function O(){if(r.value){const h=Ie.getTransformInfo(r.value);m.value.set(h);return}m.value.reset()}function V(h){if(!o.value||h instanceof MouseEvent&&h.button===2)return;const v=h.target||h.srcElement;s.value!==void 0&&v&&!c(v,s.value)||i.value!==!1&&(document.body.click(),h.stopPropagation(),h.preventDefault(),d.value=Ie.fromEvent(h,r.value),O(),w())}function y(h,v,x){if(i.value&&v){if(h)s.value=h;else if(e.dragHandle){if(e.dragHandle instanceof HTMLElement)s.value=e.dragHandle;else if(typeof e.dragHandle=="string"){const F=v.querySelector(e.dragHandle);F&&(s.value=F)}}r.value=v,u.value=x,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",V)):i.value=!1}}return{registerDraggle:y,resetTranslate:O}}function xo(e,t){if(e){const o=r=>{r.key.toLowerCase()===e.toLowerCase()&&t({event:r,key:e})};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}}}function ci(e,t){const o=n.ref(e.enableEsc);let r=null;return o.value?(r=xo("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:r}):null}function ui(e,t){const o=n.ref(e.enableEnter);let r=null;return o.value?(r=xo("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:r}):null}const vt=n.defineComponent({name:"FModal",props:ai,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove","buttonClick"],setup(e,t){const o=n.ref(e.width||300),r=n.ref(e.height||200),i=n.ref(e.modelValue),a=n.ref(""),s=n.ref(e.class),u=n.ref(e.fitContent),l=n.ref(e.showHeader),d=n.ref(""),m=n.ref(e.showCloseButton),p=n.ref(e.showMaxButton),C=n.ref(!1),c=n.ref(e.dialogType),f=n.ref(e.src),S=n.ref(""),E=n.ref(e.showButtons),b=n.ref(e.title),g=n.ref(e.containment||null),w=n.ref();b.value==="错误提示"&&(b.value=Ue.LocaleService.getLocaleValue("messageBox.errorTitle"));const O=n.ref(!1);function V(){const A=document.querySelectorAll(".farris-modal").length;(!A||A-1<=0)&&w.value===document.querySelectorAll(".farris-modal")[0]&&document.body.classList.remove("modal-open"),w.value&&w.value.classList.remove("show")}function y(A,ce){const Ne=ce?"accept":"cancel";Promise.resolve().then(()=>{var Ve;return(Ve=e.beforeClose)==null?void 0:Ve.call(e,{closeType:Ne})}).then(Ve=>{Ve&&(i.value=!1,t.emit("update:modelValue",!1),ce!=null&&t.emit(ce?"accept":"cancel"),t.emit("closed",A),V())})}const h=[{name:"cancel",text:Ue.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:A=>{y(A,!1)}},{name:"accept",text:Ue.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:A=>{y(A,!0)}}],v=n.ref(e.buttons&&e.buttons.length?e.buttons:h),x=n.computed(()=>!!d.value),F=n.computed(()=>!!E.value&&!!v.value),M=n.ref(),$=n.ref(),R=n.ref(e.maximized||!1),{renderResizeBar:j,maximize:_,restore:I,boundingElement:q,resizedEventParam:D,allowDrag:U,unWindowResizeHandle:ne,moveToCenter:N}=si(e),{registerDraggle:P}=li(e,t,U);function oe(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}n.watch(()=>e.title,(A,ce)=>{A!==ce&&(b.value=A)}),n.watch(()=>e.modelValue,(A,ce)=>{A!==ce&&(i.value=A,i.value&&e.draggable&&n.nextTick(()=>{$.value&&!g.value&&(g.value=$.value.parentElement,q.value=g.value,P(M.value,$.value,q.value),N())}),A||(g.value&&(g.value=null),V())),i.value?O.value=oe():(R.value=!1,U.value=e.draggable)}),n.watch(()=>e.showHeader,(A,ce)=>{A!==ce&&(l.value=A)}),n.watch(()=>e.showButtons,(A,ce)=>{A!==ce&&(E.value=A)}),n.watch(()=>D.value,(A,ce)=>{const Ne=A||{},Ve=ce||{};JSON.stringify(Ne)!==JSON.stringify(Ve)&&t.emit("resize",{newSize:A,oldSize:ce,isMaximized:R.value})}),n.watch([()=>e.width,()=>e.height],(A,ce)=>{(A[0]!==ce[0]||A[1]!==ce[1])&&(o.value=A[0]||500,r.value=A[1]||600)}),n.watch(()=>e.class,(A,ce)=>{s.value=A});const re=n.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),Z=n.computed(()=>{var Ne;const A={modal:!0,"farris-modal":!0,fade:!0,"fe-cmp-page-modal":!!e.showFloatingClose};A["f-modal-fitContent"]=!!u.value,A.show=!!re.value;const ce=(Ne=e.maskClass)==null?void 0:Ne.split(" ");return ce==null||ce.reduce((Ve,ze)=>(Ve[ze]=!0,Ve),A),A}),he=n.computed(()=>{var Ne;const A={"modal-dialog":!0},ce=(Ne=s.value)==null?void 0:Ne.split(" ");return ce==null||ce.reduce((Ve,ze)=>(Ve[ze]=!0,Ve),A),A}),xe=()=>je.isMobilePhone()&&!e.isMessager||!!e.fullscreen,fe=n.computed(()=>{const A=document.documentElement.clientWidth,ce=document.documentElement.clientHeight;if(R.value)return{position:"fixed",top:"0px",left:"0px",width:"100vw",height:"100vh",margin:"0"};const Ne=Math.min(o.value,A),Ve=e.position==="right"?"100%":u.value?"auto":`${Math.min(r.value,ce-10)}px`,ze=`${(window.innerHeight-(Ve==="100%"||Ve==="auto"?0:parseInt(Ve)))/2}px`,yt=e.position==="right"?`${window.innerWidth-Ne}px`:`${(window.innerWidth-Ne)/2}px`,lt={position:"absolute",top:ze,left:yt,width:je.isMobilePhone()?"auto":`${Ne}px`,height:Ve};return e.mask||(lt.pointerEvents="auto"),lt}),ee=n.ref(je.getMaxZIndex()||1050),T=n.computed(()=>{const A={display:"block",overflow:"hidden"};return e.mask||(A.pointerEvents="none",A.backgroundColor="transparent"),O.value&&(A.backgroundColor="transparent"),A.zIndex=ee.value,A}),ie=n.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value,"is-mobile":xe()})),ae=n.computed(()=>{const A={display:l.value?"":"none"};return A["pointer-events"]=U.value?"auto":"none",A}),le=n.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:R.value})),ye=n.computed(()=>({"modal-body":!0,"f-utils-flex-column":c.value==="iframe","f-utils-fill":!0}));function ke(){return{height:`${e.footerHeight||60}px`}}const qe=n.computed(()=>{const A={textAlgin:S.value},ce=ke();return Object.assign(A,ce)});function Le(A){if(A==null||A.stopPropagation(),R.value){R.value=!1,I();return}_(),R.value=!0}async function Te(A,ce){A.handle?await A.handle(ce,A)&&t.emit("closed",ce):t.emit("buttonClick",{button:A,$event:ce})}function Pe(A){A.width&&(o.value=A.width),A.height&&(r.value=A.height),A.buttons&&(v.value=A.buttons),A.title&&(b.value=A.title)}let Oe=null,Be=null;n.onBeforeMount(()=>{O.value=oe()}),n.onMounted(()=>{$.value&&!g.value&&(g.value=$.value.parentElement,q.value=g.value,P(M.value,$.value,q.value)),re.value&&document.body.classList.add("modal-open"),Oe=ci(e,t),Be=ui(e,t)}),n.onUnmounted(()=>{ne&&ne(),Oe&&Oe.remove(),Be&&Be.remove()}),t.expose({modalElementRef:$,updateModalOptions:Pe,close:y,maxDialog:Le,isMaximized:R,disableButtons:(A,ce=!0)=>{v.value.forEach(Ne=>{Ne.name&&A.includes(Ne.name)&&(Ne.disabled=ce)})}});function Ee(){return n.createVNode("div",{class:"action-wrapper",onClick:A=>y(A,!1)},[n.createVNode("span",{class:"close-icon"},[n.createVNode("i",{class:"f-icon f-icon-close"},null)])])}function at(){return n.createVNode("ul",null,[C.value&&n.createVNode("li",{class:"f-btn-icon f-bare"},[n.createVNode("span",{class:"f-icon modal_minimize"},null)]),p.value&&n.createVNode("li",{onClick:Le,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[n.createVNode("span",{class:le.value},null)]),m.value&&n.createVNode("li",{class:"f-btn-icon f-bare",onClick:A=>y(A,!1),style:"pointer-events: auto;"},[n.createVNode("span",{class:"f-icon modal_close"},null)])])}const ut=A=>{A.preventDefault();const ce=A.currentTarget,Ne=A.deltaY*.5;ce.scrollLeft+=Ne};function dt(){return n.createVNode("div",{class:"modal-footer",style:qe.value},[v.value&&n.createVNode("div",{class:"buttons",onWheel:ut},[v.value.map(A=>{var Ve;const ce=n.ref(A.disabled),Ne=A.class||((Ve=A.appearance)==null?void 0:Ve.class)||"btn btn-secondary";return n.createVNode("button",n.mergeProps(je.extractDataAttrs(A),{name:A.name,style:A.styles,type:"button",disabled:ce.value,class:Ne+(A.iconClass?" btn-icontext":"")+(A.visible===!1?"d-none":""),onClick:ze=>{Te(A,ze)}}),[!!A.iconClass&&n.createVNode("i",{class:A.iconClass},null),A.text])})])])}function Xe(A){p.value&&Le()}function et(){return n.createVNode(n.Fragment,null,[R.value&&n.createVNode("div",{class:"modal-header",style:"position: absolute;background: transparent;height: 45px;width: 100%;",onDblclick:A=>Xe()},null),n.createVNode("div",{ref:M,class:"modal-header",style:ae.value,onDblclick:A=>Xe()},[t.slots.headerTemplate?t.slots.headerTemplate():n.createVNode("div",{class:"modal-title"},[x.value&&n.createVNode("span",{class:d.value,style:"margin-right: 8px"},null),n.createVNode("span",{class:"modal-title-label"},[b.value])]),n.createVNode("div",{class:"actions"},[at()])])])}function ft(){return t.slots.footerTemplate?t.slots.footerTemplate():F.value&&dt()}function ot(A){if(A.stopPropagation(),e.allowClickMaskToClose){if(A.target!==w.value)return;y(A,!1)}}function st(){var A,ce;return n.createVNode("div",{id:a.value,class:he.value,style:fe.value,ref:$},[e.showFloatingClose&&Ee(),n.createVNode("div",{class:ie.value},[l.value&&et(),n.createVNode("div",{class:ye.value},[(ce=(A=t.slots).default)==null?void 0:ce.call(A),c.value==="iframe"&&n.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:f.value},null)]),ft()]),!u.value&&$.value&&!R.value&&j($.value)])}function Me(A){return A||"body"}return n.watchEffect(()=>{re.value&&(ee.value=je.getMaxZIndex()||1050)}),()=>n.createVNode(n.Teleport,{to:Me(e.host)},{default:()=>[re.value&&n.createVNode(n.Transition,{name:"fade",appear:!0},{default:()=>[n.createVNode("div",{ref:w,class:Z.value,style:T.value,onClick:ot},[st()])]})]})}});function To(e){if(e.content&&e.content.render)return e.content.render;if(e.render&&typeof e.render=="function")return e.render}function di(e){const t=document.createElement("div");t.style.display="contents";const o=e.type||"modal",r=n.createApp({setup(i,a){n.onUnmounted(()=>{document.body.removeChild(t)});const s=n.ref(),u=n.ref(e.class||""),l=n.ref(!0),d=n.ref(e.title||""),m=To(e),p=e.closedCallback||(V=>{}),C=V=>{l.value=!1,r.unmount(),p(V)};if(a.expose({ref:s}),o==="drawer")return()=>n.createVNode(lo,{ref:s,modelValue:l.value,"onUpdate:modelValue":V=>l.value=V,id:"modal-service-drawer",title:d.value,width:e.width,height:e.height,position:e.position,backgroundColor:e.backgroundColor,host:e.host,showMask:e.showMask,allowClickMaskToClose:e.allowClickMaskToClose,transparent:e.transparent,showHeader:e.showHeader,showFooter:e.showButtons,buttons:e.buttons,beforeClose:e.beforeClose,customClass:u.value,onAfterClose:C},{default:()=>[m&&m(r)]});const c=n.ref(!!e.showButtons),f=n.ref(!!e.showHeader),S=n.ref(e.showCloseButton==null?!0:e.showCloseButton),E=n.ref(!!e.showFloatingClose),b=e.acceptCallback||(()=>{}),g=e.rejectCallback||(()=>{}),w=e.resizeHandle||(V=>{}),O=e.stopMoveHandle||(V=>{});return()=>n.createVNode(vt,{ref:s,class:u.value,modelValue:l.value,"onUpdate:modelValue":V=>l.value=V,title:d.value,width:e.width,height:e.height,buttons:e.buttons,"show-header":f.value,"show-buttons":c.value,"show-close-button":S.value,"show-max-button":!1,showFloatingClose:E.value,onAccept:b,onCancel:g,fitContent:e.fitContent==null?!0:e.fitContent,onClosed:C,onResize:w,onStopMove:O},{default:()=>[m&&m(r)]})}});return document.body.appendChild(t),r.use(Ue.LocaleService.i18n),r.mount(t),r}class fi{constructor(t){we(this,"appContext",null);we(this,"modalRef",n.ref());we(this,"activeModalIndex",n.ref(0));we(this,"modalRefs",{});we(this,"isUseEscCloseModal",n.ref(!1));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.modalRefs[this.activeModalIndex.value]}adaptToWindow(t,o){const{width:r,height:i}={width:window.innerWidth,height:window.innerHeight};return r<t&&(t=r-14),i<o&&(o=i-14),{width:t,height:o}}static show(t){const o=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return di(o)}close(t){var o,r;t?(r=t.value)==null||r.close():(o=this.getCurrentModal())==null||o.close()}open(t){const o=document.createDocumentFragment(),r=t.type||"modal";t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const i=n.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0,maximized:!1},t)),a=n.ref(!0),s=To(i.value),u=i.value.closedCallback||((b,g)=>{}),l=i.value.openedCallback||(b=>{});let d;const m=b=>{var w;a.value=!1;const g=(w=b==null?void 0:b.target)==null?void 0:w.classList.contains("modal_close");u(b,this.isUseEscCloseModal.value?"esc":g?"icon":"button")},p=b=>{m(b),d&&n.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],n.render(null,o),d=null,this.modalRef.value=null,this.modalRefs){const g=Object.keys(this.modalRefs).map(w=>Number(w));g.length>0?this.activeModalIndex.value=Math.max(...g):this.activeModalIndex.value=0,this.modalRefs[this.activeModalIndex.value]&&(this.modalRef.value=this.modalRefs[this.activeModalIndex.value])}this.isUseEscCloseModal.value=!1})},C=n.ref();let c;if(r==="drawer")c=()=>n.createVNode(lo,n.mergeProps({ref:C,modelValue:a.value,"onUpdate:modelValue":b=>a.value=b,id:"modal-service-drawer"},i.value,{onAfterClose:p}),{default:()=>[s&&s(this.app)]});else{const b=i.value.acceptCallback||(()=>{}),g=i.value.rejectCallback||(()=>{}),w=i.value.resizeHandle||(x=>{}),O=t.stopMoveHandle||(x=>{}),V=x=>{var F;this.isUseEscCloseModal.value=!0,(F=this.getCurrentModal())==null||F.close(x==null?void 0:x.event)},{width:y,height:h}=i.value,v=this.adaptToWindow(Number(y)||500,Number(h)||320);Object.assign(i.value,v),c=()=>n.createVNode(vt,n.mergeProps({ref:C,modelValue:a.value,"onUpdate:modelValue":x=>a.value=x},i.value,{isMessager:i.value.class&&i.value.class.indexOf("modal-message")>-1,onAccept:b,onCancel:g,onClosed:p,onResize:w,onEsc:V,onStopMove:O,maximized:i.value.maximized}),{default:()=>[s&&s(this.app)]})}d=(b=>{const g=n.h(c,b);return g.appContext=this.appContext,n.render(g,o),g})({...i.value}),this.activeModalIndex.value++;const S=this.activeModalIndex.value;this.modalRefs[S]=C.value;const E=b=>{i.value={...i.value,...b},d&&n.render(n.cloneVNode(d,{...i}),o)};return n.nextTick(()=>{this.modalRefs[S]=C.value,this.modalRef.value=C.value,l(new Event("opened"))}),{update:E,destroy:p,modalRef:C,close:()=>{var b;(b=C.value)==null||b.close()},disableButtons:(b,g=!0)=>{var w,O;(O=(w=C.value)==null?void 0:w.disableButtons)==null||O.call(w,b,g)}}}}const No=Symbol("FModalService");vt.install=e=>{e.component(vt.name,vt);const t=new fi(e);e.provide(No,t),e.provide("FModalService",t)};const Vo=n.ref(0);function Fo(){Vo.value++}const mi=n.defineComponent({name:"FDesignerCanvas",props:uo,emits:["init","selectionChange","canvasChanged","dragEnd"],setup(e,t){const o=n.ref(),r=n.ref(),i=n.ref(),a=n.ref(),s=n.ref(),u=n.ref(),l=n.ref(e.componentId),d=n.ref(e.canvasMode);let m,p;const C=n.inject("designerContext"),c={eventsEditorUtils:n.inject("eventsEditorUtils"),formSchemaUtils:n.inject("useFormSchema"),formMetadataConverter:n.inject("formMetadataConverter"),designViewModelUtils:n.inject("designViewModelUtils"),controlCreatorUtils:n.inject("controlCreatorUtils"),metadataService:n.inject("Meatdata_Http_Service_Token"),schemaService:n.inject("schemaService"),useFormCommand:n.inject("useFormCommand"),modalService:n.inject(No),formStateMachineUtils:n.inject("useFormStateMachine"),messagerService:n.inject("FMessageBoxService"),designerContext:C,componentSchemaService:n.inject("SchemaService"),dialogCodeView:n.inject("dialogCodeView")};n.provide("designer-host-service",c);const f=Jr(c,C);e.components&&ni(e.components),ti(),n.provide("canvas-dragula",f),n.provide("design-item-context",{designerItemElementRef:s,componentInstance:u,schema:r.value,parent:void 0});const S=n.computed(()=>({"d-flex":!0,"flex-fill":!0,"flex-column":!0})),E=n.computed(()=>({editorPanel:!0,"d-flex":!0,"flex-fill":!0,"flex-column":!0,[d.value]:!0}));n.watch([()=>e.modelValue,()=>e.componentId,()=>e.canvasMode],([V,y,h])=>{o.value=V,l.value=y,d.value=h}),n.watch(Ze,()=>{gt(i.value),t.emit("canvasChanged")},{flush:"post"});function b(){m=new ResizeObserver(()=>{p&&clearTimeout(p),p=setTimeout(()=>{gt(a.value)})}),m.observe(a.value)}function g(V,y,h,v){t.emit("selectionChange",V,y,h,v)}function w(){t.emit("dragEnd")}function O(){a.value.addEventListener("scroll",V=>{gt(a.value)})}return n.onMounted(()=>{i.value&&f.initializeDragula(i.value),o.value=e.modelValue,t.emit("init",f),b(),O()}),n.onUnmounted(()=>{m&&(m.unobserve(i.value),m.disconnect(),m=null)}),t.expose({refreshCanvas:Fo,changeCanvas:nr,designerCanvasElementRef:i,designerCanvasContainerElementRef:a,designerHostService:c}),()=>n.createVNode("div",{class:"editorDiv flex-fill h-100",ref:a},[n.createVNode("div",{class:E.value},[n.createVNode("div",{ref:i,class:S.value},[o.value&&n.createVNode(Bt,{key:Vo.value,modelValue:o.value,"onUpdate:modelValue":V=>o.value=V,onSelectionChange:g,componentId:l.value,onDragEnd:w},null)])])])}}),pi={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}};function Eo(e,t,o){var v;const r=o&&o.getStyles&&o.getStyles()||"",i=n.ref();let a;function s(){return o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function u(){return!1}function l(){return o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function d(){return o&&o.checkCanAddComponent?o.checkCanAddComponent():!0}function m(x){if(!x||!x.value)return null;const F=n.ref(x==null?void 0:x.value.parent),M=m(F);return M||null}function p(x=t){var R;const{componentInstance:F,designerItemElementRef:M}=x;if(!F||!F.value)return null;const{getCustomButtons:$}=F.value;return F.value.canMove||F.value.canAdd||F.value.canDelete||$&&((R=$())!=null&&R.length)?M:p(x.parent)}function C(){if(o&&o.getCustomButtons)return o.getCustomButtons()}function c(x){return!!o&&o.canAccepts(x)}function f(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function S(){}function E(x,F){!x||!F||o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(x,F)}function b(x){const{componentType:F}=x,M=n.inject("designer-host-service");let $=De.getSchemaByTypeForDesigner(F,x,M);o&&o.onResolveNewComponentSchema&&($=o.onResolveNewComponentSchema(x,$));const R=F.toLowerCase().replace(/-/g,"_");return $&&!$.id&&$.type===F&&($.id=`${R}_${Math.random().toString().slice(2,6)}`),$}function g(x){}function w(...x){return o&&o.getPropsConfig?o.getPropsConfig(...x):[]}function O(){}function V(x){var M;if(!(t!=null&&t.schema))return;if(o!=null&&o.setComponentBasicInfoMap){o.setComponentBasicInfoMap();return}let F="";if(o!=null&&o.getComponentTitle)F=o.getComponentTitle();else{const{text:$,title:R,label:j,mainTitle:_,name:I,type:q}=t.schema;F=$||R||j||_||I||((M=Fe[q])==null?void 0:M.name)}F&&(!a&&x&&(a=x.formSchemaUtils),a.getControlBasicInfoMap().set(t.schema.id,{componentTitle:F,parentPathName:F}))}function y(x){var R;const{changeObject:F}=x,{propertyID:M,propertyValue:$}=F;["text","title","label","name","mainTitle"].includes((R=x==null?void 0:x.changeObject)==null?void 0:R.propertyID)&&M&&$&&V()}function h(x){if(y(x),o&&o.onPropertyChanged)return o.onPropertyChanged(x)}return i.value={canMove:s(),canSelectParent:u(),canAdd:d(),canDelete:l(),canNested:!1,contents:[],elementRef:e,parent:(v=t.parent)==null?void 0:v.componentInstance,schema:t.schema,styles:r,canAccepts:c,getBelongedComponentInstance:m,getDraggableDesignItemElement:p,getDraggingDisplayText:f,getPropConfig:w,getDragScopeElement:S,onAcceptMovedChildElement:E,onChildElementMovedOut:g,addNewChildComponentSchema:b,onRemoveComponent:O,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||n.ref(!1),onPropertyChanged:h,getCustomButtons:C,setComponentBasicInfoMap:V},i}const gi=n.defineComponent({name:"FDesignerInnerItem",props:pi,emits:["selectionChange","addComponent","removeComponent","clickButton"],setup(e,t){const o=n.ref(e.canMove),r=n.ref(e.canAdd),i=n.ref(e.canDelete),a=n.ref(!1),s=n.ref(e.contentKey),u=n.ref(e.childType),l=n.ref(e.childLabel),d=n.ref(e.modelValue),m=n.ref(""),p=n.ref(),C=n.inject("canvas-dragula"),c=n.ref(),f=n.inject("design-item-context"),S={designerItemElementRef:p,componentInstance:c,schema:d.value,parent:f,setupContext:t};n.provide("design-item-context",S);const E=n.inject("designer-host-service"),b=n.inject("external-container-id"),g=n.computed(()=>{var D;const I=((D=c.value)==null?void 0:D.getCustomButtons)&&c.value.getCustomButtons();return{"farris-component":!0,"flex-fill":e.id==="root-component","position-relative":o.value||i.value||(I==null?void 0:I.length),"farris-nested":a.value,"can-move":o.value,"d-none":p.value&&p.value.classList.contains("d-none")}}),w=n.computed(()=>{const I={};return m.value&&m.value.split(";").reduce((q,D)=>{const[U,ne]=D.split(":");return U&&(q[U]=ne),q},I),I});function O(I,q){if(f&&f.schema[s.value]){const D=f.schema[s.value].findIndex(U=>U.id===q.id);if(D>-1){const U=f.schema[s.value].length,ne=f.schema[s.value][D%U];f.designerItemElementRef.value.querySelector(`#${ne.id}-design-item`),f.schema[s.value].splice(D,1),Ze.value++,t.emit("removeComponent"),t.emit("selectionChange")}}}function V(I){if(c.value.addNewChildComponentSchema){const q={componentType:u.value,label:l.value,parentComponentInstance:c.value,targetPosition:-1},D=c.value.addNewChildComponentSchema(q);d.value[s.value].push(D),t.emit("addComponent")}}function y(){return r.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:I=>{V()}},[n.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function h(I){return i.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:n.withModifiers(q=>O(q,I),["stop"])},[n.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function v(){return o.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[n.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function x(){var q;const I=((q=c.value)==null?void 0:q.getCustomButtons)&&c.value.getCustomButtons();return I&&!!I.length&&I.map(D=>n.createVNode("div",{role:"button",class:`btn component-settings-button ${D.class||""} ${D.text?"settings-button-extend":""}`,title:D.title,ref:D.id,onClick:U=>D.onClick&&D.onClick(U)},[n.createVNode("i",{class:"f-icon "+D.icon},null),D.text&&n.createVNode("span",{class:"icon-text"},[D.text])]))}function F(I){return n.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[n.createVNode("div",null,[y(),v(),h(I),x()])])}n.watch(()=>e.modelValue,I=>{d.value=I,S.schema=I});function M(I){window.scrollContainerList||(window.scrollContainerList=new Set);const q=I.getAttribute("id");q&&window.scrollContainerList.add(q)}function $(I){const q=I.target;M(q),gt(q)}function R(){var I,q;(q=(I=d.value)==null?void 0:I.contents)!=null&&q.length&&p.value&&p.value.addEventListener("scroll",$)}function j(){const I=p.value,q=n.ref(I.children[1]);return Eo(q,S).value}n.onMounted(()=>{if(p.value){const I=p.value.querySelector(`[data-dragref='${d.value.id}-container']`);c.value=I&&I.componentInstance?I.componentInstance.value:j(),C&&I&&C.attachComponents(I,d.value),a.value=c.value.canNested!==void 0?c.value.canNested:a.value,r.value=c.value.canAdd!==void 0?c.value.canAdd:r.value,i.value=c.value.canDelete!==void 0?c.value.canDelete:i.value,o.value=c.value.canMove!==void 0?c.value.canMove:o.value,m.value=c.value.styles||"",p.value&&(p.value.componentInstance=c,p.value.designItemContext=S),c.value.setComponentBasicInfoMap(E)}R(),Ze.value++}),n.onBeforeUnmount(()=>{p.value&&p.value.removeEventListener("scroll",$)});function _(I){if(I&&(I.preventDefault(),I.stopPropagation()),b){const U=document.getElementById(`${b}-design-item`);U&&U.click();return}let q=S.designerItemElementRef;const D=p.value;if(D){const U=document.getElementsByClassName("dgComponentFocused");U&&U.length===1&&U[0]===p.value&&p.value.classList.contains("dgComponentSelected")||(Array.from(U).forEach(N=>N.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(N=>N.classList.remove("dgComponentSelected")),D.classList.add("dgComponentFocused"),t.emit("selectionChange",d.value.type,d.value,e.componentId,c.value),c.value.getDraggableDesignItemElement&&(q=c.value.getDraggableDesignItemElement(S),q&&q.value&&q.value.classList.add("dgComponentSelected")))}Vt(q==null?void 0:q.value)}return()=>n.createVNode("div",{id:`${e.id}-design-item`,ref:p,class:g.value,style:w.value,onClick:_},[F(d.value),t.slots.default&&t.slots.default()])}});function hi(e,t,o){var R;const r=o&&o.getStyles&&o.getStyles()||"",i=o&&o.getDesignerClass&&o.getDesignerClass()||"",a=n.ref();let s;function u(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function l(){return!1}function d(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function m(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:o&&o.hideNestedPaddingInDesginerView?o.hideNestedPaddingInDesginerView():!1}function p(j){if(!j||!j.value)return null;if(j.value.schema&&j.value.schema.type==="component")return j.value;const _=n.ref(j==null?void 0:j.value.parent),I=p(_);return I||null}function C(j=t){var D;if(o!=null&&o.getDraggableDesignItemElement)return o.getDraggableDesignItemElement(j);const{componentInstance:_,designerItemElementRef:I}=j;if(!_||!_.value)return null;const{getCustomButtons:q}=_.value;return _.value.canMove||q&&((D=q())!=null&&D.length)?I:C(j.parent)}function c(j){return!!o&&o.canAccepts(j)}function f(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function S(){}function E(j,_){var I;!j||!_||(o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(j,_),(I=t==null?void 0:t.setupContext)==null||I.emit("dragEnd"))}function b(j,_){const{componentType:I}=j;let q=De.getSchemaByTypeForDesigner(I,j,_);o&&o.onResolveNewComponentSchema&&(q=o.onResolveNewComponentSchema(j,q));const D=I.toLowerCase().replace(/-/g,"_");return q&&!q.id&&q.type===I&&(q.id=`${D}_${Math.random().toString().slice(2,6)}`),q}function g(j){j&&o!=null&&o.onChildElementMovedOut&&o.onChildElementMovedOut(j)}function w(...j){if(o&&o.getPropsConfig)return o.getPropsConfig(...j)}function O(){if(o&&o.getDesignerHostService)return o.getDesignerHostService()}function V(j){if(!j)return;const _=t==null?void 0:t.schema,{formSchemaUtils:I}=j;if(_&&I.getExpressions().length){const q=I.getExpressions().findIndex(D=>D.target===_.id);q>-1&&I.getExpressions().splice(q,1)}}function y(j){if(!j||!(t!=null&&t.schema))return;const _=t.schema,{formSchemaUtils:I}=j;I.removeCommunicationInComponent(_)}function h(j){o&&o.onRemoveComponent&&o.onRemoveComponent(),V(j),y(j),t!=null&&t.schema.contents&&t.schema.contents.map(_=>{let I=_.id;_.type==="component-ref"&&(I=_.component);const q=e.value.querySelectorAll(`#${I}-design-item`);q!=null&&q.length&&Array.from(q).map(D=>{var U;(U=D==null?void 0:D.componentInstance)!=null&&U.value.onRemoveComponent&&D.componentInstance.value.onRemoveComponent(j)})})}function v(){if(o&&o.getCustomButtons)return o.getCustomButtons()}function x(j){var I,q;if(!((I=t==null?void 0:t.schema)!=null&&I.id))return;if(!s&&j&&(s=j.formSchemaUtils),o!=null&&o.setComponentBasicInfoMap){o.setComponentBasicInfoMap();return}let _="";if(o!=null&&o.getComponentTitle)_=o.getComponentTitle();else{const{text:D,title:U,label:ne,mainTitle:N,name:P,type:oe}=t.schema;_=D||U||ne||N||P||((q=Fe[oe])==null?void 0:q.name)}_&&s.getControlBasicInfoMap().set(t.schema.id,{componentTitle:_,parentPathName:_})}function F(j){var D;const{changeObject:_}=j,{propertyID:I,propertyValue:q}=_;if(["text","title","label","name","mainTitle"].includes((D=j==null?void 0:j.changeObject)==null?void 0:D.propertyID)&&I&&q&&(x(),s)){const U=s.getControlBasicInfoMap(),ne=U.keys().toArray().filter(N=>{var P,oe;return((P=U.get(N))==null?void 0:P.reliedComponentId)===((oe=t==null?void 0:t.schema)==null?void 0:oe.id)});ne!=null&&ne.length&&ne.forEach(N=>{const P=U.get(N).parentPathName.split(" > ");P[0]=q,U.get(N).parentPathName=P.join(" > ")})}}function M(j){if(F(j),o&&o.onPropertyChanged)return o.onPropertyChanged(j)}function $(){return o!=null&&o.shouldApplyClassToComponent?o.shouldApplyClassToComponent():!0}return a.value={canMove:u(),canSelectParent:l(),canDelete:d(),canNested:!m(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:(R=t==null?void 0:t.parent)==null?void 0:R.componentInstance,schema:t==null?void 0:t.schema,styles:r,designerClass:i,canAccepts:c,getBelongedComponentInstance:p,getDraggableDesignItemElement:C,getDraggingDisplayText:f,getPropConfig:w,getDesignerHostService:O,getDragScopeElement:S,onAcceptMovedChildElement:E,onChildElementMovedOut:g,addNewChildComponentSchema:b,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||n.ref(!1),onRemoveComponent:h,getCustomButtons:v,onPropertyChanged:M,setComponentBasicInfoMap:x,updateContextSchema:t==null?void 0:t.updateContextSchema,shouldApplyClassToComponent:$},a}class vi{getTemplateRule(t,o){const r=o==null?void 0:o.formSchemaUtils,i=r==null?void 0:r.getFormTemplateRule(),a={canAccept:!0,canDelete:!0,canMove:!0};if(!i)return a;const s=this.getComponentContext(t),{componentClassList:u}=s;return u.forEach(l=>{if(!l||!i[l])return;const{canMove:d,canDelete:m,canAccept:p}=i[l];a.canMove=a.canMove&&this.resolveRuleValue(d,s),a.canDelete=a.canDelete&&this.resolveRuleValue(m,s),a.canAccept=a.canAccept&&this.resolveRuleValue(p,s)}),a}resolveRuleValue(t,o){return typeof t=="boolean"?t:this.parseRuleValueSchema(t,o)}parseRuleValueSchema(t,o){const r=t.invalidContext||[];let i=!0;for(const a of r){const{firstLevelChild:s,secondLevelChild:u,parent:l,...d}=a;if(d&&o.component){let m=!0;for(const p of Object.keys(d))if(d[p]!==o.component[p]){m=!1;break}if(!m){i=!1;continue}}if(a.firstLevelChild){if(a.firstLevelChild.class){const{firstLevelChildClassList:m}=o;if(m&&!m.includes(a.firstLevelChild.class)){i=!1;continue}}if(a.firstLevelChild.type){const{firstLevelChildSchema:m}=o;if(!m||m.type!==a.firstLevelChild.type){i=!1;continue}}}if(a.secondLevelChild){if(a.secondLevelChild.class){const{secondLevelChildClassList:m}=o;if(m&&!m.includes(a.secondLevelChild.class)){i=!1;continue}}if(a.secondLevelChild.type){const{secondLevelChildSchema:m}=o;if(!m||m.type!==a.secondLevelChild.type){i=!1;continue}}}if(a.parent){if(a.parent.class){const{parentClassList:m}=o;if(m&&!m.includes(a.parent.class)){i=!1;continue}}if(a.parent.type){const{parentSchema:m}=o;if(m&&m.type!==a.parent.type){i=!1;continue}}}i=!0;break}return!i}getComponentContext(t){var S,E,b,g;const o=t.schema,r=o.appearance&&o.appearance.class||"",i=r.split(" ")||[],a=o.contents||[],s=a.length?a[0]:null,u=s&&s.appearance?s.appearance.class:"",l=u?u.split(" "):[],d=(S=s==null?void 0:s.contents)!=null&&S.length?s==null?void 0:s.contents[0]:null,m=d&&d.appearance?d.appearance.class:"",p=m?m.split(" "):[],C=o.type==="component"?(b=(E=t.parent)==null?void 0:E.parent)==null?void 0:b.schema:(g=t.parent)==null?void 0:g.schema,c=C&&C.appearance&&C.appearance.class||"",f=c?c.split(" "):[];return{componentClass:r,componentClassList:i,childContents:a,firstLevelChildSchema:s,firstLevelChildClass:u,firstLevelChildClassList:l,secondLevelChildSchema:d,secondLevelChildClass:m,secondLevelChildClassList:p,parentSchema:C,parentClass:c,parentClassList:f,component:o}}}function yi(){function e(t,o){var s;if(!t)return!1;const r=((s=t.targetContainer)==null?void 0:s.componentInstance)&&t.targetContainer.componentInstance.value;if(!r)return!1;const i=r.schema.type,a=o==null?void 0:o.formSchemaUtils.getComponentById(r.belongedComponentId);return!((t.componentCategory==="input"||t.componentType==="form-group")&&![Fe["response-layout-item"].type,Fe["response-form"].type,Fe.fieldset.type].includes(i)||(t.componentType===Fe.tabs.type||t.componentType===Fe.section.type)&&((a==null?void 0:a.componentType)!=="frame"||![Fe["content-container"].type,Fe["splitter-pane"].type,Fe["response-layout-item"].type,Fe.drawer.type].includes(i))||[Fe["query-solution"].type,Fe["filter-bar"].type,Fe.drawer.type].includes(t.componentType)||t.componentType===Fe.fieldset.type&&i!==Fe["response-form"].type||t.componentCategory==="dataCollection"&&(a==null?void 0:a.componentType)!=="frame")}return{basalDragulaRuleForContainer:e}}B.DgControl=Fe,B.FDesignerCanvas=mi,B.FDesignerInnerItem=gi,B.FDesignerItem=Bt,B.UseTemplateDragAndDropRules=vi,B.canvasChanged=Ze,B.componentMap=X,B.componentPropsConverter=Q,B.designerCanvasProps=uo,B.refreshCanvas=Fo,B.setPositionForSelectedElement=qt,B.setPositionOfButtonGroup=Vt,B.setPositionOfSelectedComponentBtnGroup=rr,B.useDesignerComponent=hi,B.useDesignerInnerComponent=Eo,B.useDragulaCommonRule=yi,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});