@farris/ui-vue 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/components/avatar/index.esm.js +2 -1
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/checkbox/index.esm.js +2 -1
  4. package/components/checkbox/index.umd.cjs +1 -1
  5. package/components/combo-list/index.esm.js +2 -1
  6. package/components/combo-list/index.umd.cjs +1 -1
  7. package/components/condition/index.css +1 -1
  8. package/components/condition/index.esm.js +715 -704
  9. package/components/condition/index.umd.cjs +1 -1
  10. package/components/content-container/index.css +1 -1
  11. package/components/content-container/index.esm.js +1180 -1169
  12. package/components/content-container/index.umd.cjs +1 -1
  13. package/components/data-grid/index.css +1 -1
  14. package/components/data-grid/index.esm.js +2949 -2901
  15. package/components/data-grid/index.umd.cjs +1 -1
  16. package/components/data-view/index.css +1 -1
  17. package/components/data-view/index.esm.js +609 -598
  18. package/components/data-view/index.umd.cjs +1 -1
  19. package/components/date-picker/index.esm.js +3 -2
  20. package/components/date-picker/index.umd.cjs +1 -1
  21. package/components/designer-canvas/index.css +1 -1
  22. package/components/designer-canvas/index.esm.js +2081 -2062
  23. package/components/designer-canvas/index.umd.cjs +1 -1
  24. package/components/designer-outline/index.css +1 -1
  25. package/components/drawer/index.esm.js +23 -21
  26. package/components/drawer/index.umd.cjs +1 -1
  27. package/components/dynamic-form/index.css +1 -1
  28. package/components/dynamic-form/index.esm.js +2745 -2691
  29. package/components/dynamic-form/index.umd.cjs +1 -1
  30. package/components/external-container/index.css +1 -1
  31. package/components/external-container/index.esm.js +1322 -1311
  32. package/components/external-container/index.umd.cjs +1 -1
  33. package/components/field-selector/index.css +1 -1
  34. package/components/field-selector/index.esm.js +85 -74
  35. package/components/field-selector/index.umd.cjs +1 -1
  36. package/components/filter-bar/index.esm.js +4618 -4320
  37. package/components/filter-bar/index.umd.cjs +3 -3
  38. package/components/flow-canvas/index.css +1 -1
  39. package/components/flow-canvas/index.esm.js +1982 -1963
  40. package/components/flow-canvas/index.umd.cjs +1 -1
  41. package/components/input-group/index.esm.js +2 -1
  42. package/components/input-group/index.umd.cjs +1 -1
  43. package/components/list-view/index.css +1 -1
  44. package/components/list-view/index.esm.js +822 -811
  45. package/components/list-view/index.umd.cjs +1 -1
  46. package/components/lookup/index.css +1 -1
  47. package/components/lookup/index.esm.js +3268 -3219
  48. package/components/lookup/index.umd.cjs +1 -1
  49. package/components/mapping-editor/index.css +1 -1
  50. package/components/mapping-editor/index.esm.js +1985 -1937
  51. package/components/mapping-editor/index.umd.cjs +1 -1
  52. package/components/number-range/index.esm.js +136 -135
  53. package/components/number-range/index.umd.cjs +1 -1
  54. package/components/number-spinner/index.esm.js +2 -1
  55. package/components/number-spinner/index.umd.cjs +1 -1
  56. package/components/order/index.esm.js +2 -1
  57. package/components/order/index.umd.cjs +1 -1
  58. package/components/property-editor/index.esm.js +2 -1
  59. package/components/property-editor/index.umd.cjs +1 -1
  60. package/components/property-panel/index.esm.js +295 -283
  61. package/components/property-panel/index.umd.cjs +2 -2
  62. package/components/query-solution/index.css +1 -1
  63. package/components/query-solution/index.esm.js +5430 -5374
  64. package/components/query-solution/index.umd.cjs +7 -7
  65. package/components/radio-group/index.esm.js +2 -1
  66. package/components/radio-group/index.umd.cjs +1 -1
  67. package/components/schema-selector/index.css +1 -1
  68. package/components/schema-selector/index.esm.js +1259 -1248
  69. package/components/schema-selector/index.umd.cjs +2 -2
  70. package/components/section/index.css +1 -1
  71. package/components/section/index.esm.js +1272 -1261
  72. package/components/section/index.umd.cjs +1 -1
  73. package/components/switch/index.esm.js +2 -1
  74. package/components/switch/index.umd.cjs +1 -1
  75. package/components/textarea/index.esm.js +14 -13
  76. package/components/textarea/index.umd.cjs +1 -1
  77. package/components/time-picker/index.esm.js +2 -1
  78. package/components/time-picker/index.umd.cjs +1 -1
  79. package/components/tree-grid/index.css +1 -1
  80. package/components/tree-grid/index.esm.js +715 -704
  81. package/components/tree-grid/index.umd.cjs +1 -1
  82. package/components/tree-view/index.css +1 -1
  83. package/components/tree-view/index.esm.js +107 -96
  84. package/components/tree-view/index.umd.cjs +1 -1
  85. package/farris.all.esm.js +14687 -14334
  86. package/farris.all.umd.cjs +11 -11
  87. package/index.css +1 -1
  88. package/package.json +1 -1
  89. package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
  90. package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +6 -0
  91. package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.props.d.ts +8 -0
  92. package/types/dynamic-form/src/composition/form-binding-resolver-design.d.ts +6 -0
  93. package/types/filter-bar/src/components/drawer.component.d.ts +4 -0
  94. package/types/filter-bar/src/components/filter-item/filter-item.component.d.ts +10 -0
  95. package/types/filter-bar/src/components/filter-item/filter-item.props.d.ts +3 -0
  96. package/types/filter-bar/src/components/filter-item-condition/filter-item-condition.component.d.ts +11 -0
  97. package/types/filter-bar/src/components/filter-item-condition/filter-item-condition.props.d.ts +3 -0
  98. package/types/filter-bar/src/composition/types.d.ts +2 -0
  99. package/types/filter-bar/src/composition/use-condition.d.ts +19 -0
  100. package/types/filter-bar/src/filter-bar.component.d.ts +2 -1
  101. package/types/filter-bar/src/types.d.ts +4 -6
  102. package/types/filter-bar/src/components/filter-item.component.d.ts +0 -5
  103. /package/types/filter-bar/src/components/{toolbar-component.d.ts → toolbar.component.d.ts} +0 -0
@@ -1,11 +1,11 @@
1
- (function(J,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("lodash-es"),require("../dynamic-form/index.umd.js"),require("../designer-canvas/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../modal/index.umd.js"),require("../transfer/index.umd.js"),require("../tabs/index.umd.js"),require("../order/index.umd.js"),require("../condition/index.umd.js"),require("../checkbox/index.umd.js"),require("../filter-bar/index.umd.js"),require("../pagination/index.umd.js"),require("../search-box/index.umd.js"),require("../tags/index.umd.js"),require("../common/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../color-picker/index.umd.js"),require("../combo-list/index.umd.js"),require("../content-container/index.umd.js"),require("../data-grid/index.umd.js"),require("../date-picker/index.umd.js"),require("../dropdown/index.umd.js"),require("../external-container/index.umd.js"),require("../events-editor/index.umd.js"),require("../image-cropper/index.umd.js"),require("../input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../nav/index.umd.js"),require("../number-spinner/index.umd.js"),require("../number-range/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../component/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../tree-grid/index.umd.js"),require("../binding-selector/index.umd.js"),require("../notify/index.umd.js"),require("../combo-tree/index.umd.js"),require("../field-selector/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../schema-selector/index.umd.js"),require("../event-parameter/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("bignumber.js"),require("../popover/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../dynamic-form/index.umd.js","../designer-canvas/index.umd.js","@vueuse/core","../data-view/index.umd.js","../modal/index.umd.js","../transfer/index.umd.js","../tabs/index.umd.js","../order/index.umd.js","../condition/index.umd.js","../checkbox/index.umd.js","../filter-bar/index.umd.js","../pagination/index.umd.js","../search-box/index.umd.js","../tags/index.umd.js","../common/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../color-picker/index.umd.js","../combo-list/index.umd.js","../content-container/index.umd.js","../data-grid/index.umd.js","../date-picker/index.umd.js","../dropdown/index.umd.js","../external-container/index.umd.js","../events-editor/index.umd.js","../image-cropper/index.umd.js","../input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../nav/index.umd.js","../number-spinner/index.umd.js","../number-range/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../component/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../tree-grid/index.umd.js","../binding-selector/index.umd.js","../notify/index.umd.js","../combo-tree/index.umd.js","../field-selector/index.umd.js","../mapping-editor/index.umd.js","../schema-selector/index.umd.js","../event-parameter/index.umd.js","../dynamic-resolver/index.umd.js","bignumber.js","../popover/index.umd.js"],o):(J=typeof globalThis<"u"?globalThis:J||self,o(J["query-solution"]={},J.Vue,J.LodashES,J.FDynamicForm,J.designerCanvas,J.VueUseCore,J.dataView,J.modal,J.FTransfer$1,J.FTabs,J.FOrder,J.FConditionList$1,J.FCheckbox,J.FFilterBar,J.FPagination,J.FSearchBox,J.FTags,J.common,J.FAccordion,J.FAvatar,J.FButtonEdit$1,J.FButtonGroup,J.FCalendar,J.FCapsule,J.FColorPicker,J.FComboList,J.FContentContainer,J.FDataGrid,J.FDatePicker,J.FDropdown,null,J.FEventsEditor,J.FImageCropper,J.FInputGroup,J.FLayout,J.FListNav,J.FListView$1,J.FLookup,J.FNav,J.FNumberSpinner,J.FNumberRange,J.FPageHeader,J.FPageFooter,J.FProgress,J.FQuerySolution$1,J.FRadioGroup,J.FRate,J.FResponseToolbar,J.FResponseLayout,J.FResponseLayoutEditorSetting,J.FSection,J.FSmokeDetector,J.FSplitter,J.FStep,J.FSwitch,J.FText,J.FTimePicker,J.FTreeview,J.FUploader,J.FVerifyDetail,J.FComponent,J.FVideo,J.FTextArea,J.FTreeGrid$1,J.FBindingSelector,J.notify,J.FComboTree,J.FFieldSelector,J.FMappingEditor,J.FSchemaSelector,J.FEventParameter,J.dynamicResolver,J.BigNumber,J.FPopover))})(this,function(J,o,be,un,dn,Zn,he,Hr,fn,Wr,Ur,zr,Et,Gr,Xr,Yr,eo,Te,Jr,Qr,to,Kr,Zr,ei,ti,pn,ni,no,oi,ri,Ed,ii,ai,oo,si,li,ci,ui,di,fi,pi,mi,hi,gi,yi,ro,vi,bi,Ci,wi,Si,xi,Fi,Ti,_i,Ni,Vi,io,ki,Ei,Ii,Mi,Oi,Bi,Pi,Ri,ji,$i,Di,Ai,Li,jt,Id,qi){"use strict";var Vd=Object.defineProperty;var kd=(J,o,be)=>o in J?Vd(J,o,{enumerable:!0,configurable:!0,writable:!0,value:be}):J[o]=be;var z=(J,o,be)=>kd(J,typeof o!="symbol"?o+"":o,be);const $t={},ao={};function mn(e){const{properties:t,title:n,ignore:r}=e,i=r&&Array.isArray(r),a=Object.keys(t).reduce((s,c)=>((!i||!r.find(u=>u===c))&&(s[c]=t[c].type==="object"&&t[c].properties?mn(t[c]):be.cloneDeep(t[c].default)),s),{});if(n&&(!i||!r.find(s=>s==="id"))){const s=n.toLowerCase().replace(/-/g,"_");a.id=`${s}_${Math.random().toString().slice(2,6)}`}return a}function Hi(e){const{properties:t,title:n,required:r}=e;if(r&&Array.isArray(r)){const i=r.reduce((a,s)=>(a[s]=t[s].type==="object"&&t[s].properties?mn(t[s]):be.cloneDeep(t[s].default),a),{});if(n&&r.find(a=>a==="id")){const a=n.toLowerCase().replace(/-/g,"_");i.id=`${a}_${Math.random().toString().slice(2,6)}`}return i}return{type:n}}function Dt(e,t={},n){const r=$t[e];if(r){let i=Hi(r);const a=ao[e];return i=a?a({getSchemaByType:Dt},i,t,n):i,i}return null}function hn(e,t){const n=mn(t);return Object.keys(n).reduce((r,i)=>(Object.prototype.hasOwnProperty.call(e,i)&&(r[i]&&be.isPlainObject(r[i])&&be.isPlainObject(e[i]||!e[i])?Object.assign(r[i],e[i]||{}):r[i]=e[i]),r),n),n}function Wi(e,t){return Object.keys(e).filter(r=>e[r]!=null).reduce((r,i)=>{if(t.has(i)){const a=t.get(i);if(typeof a=="string")r[a]=e[i];else{const s=a(i,e[i],e);Object.assign(r,s)}}else r[i]=e[i];return r},{})}function Ui(e,t,n=new Map){const r=hn(e,t);return Wi(r,n)}function so(e){var n;const t=e.type;if(t){const r=$t[t];if(!r)return e;const i=hn(e,r),a=((n=e.editor)==null?void 0:n.type)||"";if(a){const s=$t[a],c=hn(e.editor,s);i.editor=c}return i}return e}function zi(e={}){function t(d,f,l,p){if(typeof l=="number")return p[d].length===l;if(typeof l=="object"){const m=Object.keys(l)[0],g=l[m];if(m==="not")return Number(p[d].length)!==Number(g);if(m==="moreThan")return Number(p[d].length)>=Number(g);if(m==="lessThan")return Number(p[d].length)<=Number(g)}return!1}function n(d,f,l,p){return p[d]&&p[d].propertyValue&&String(p[d].propertyValue.value)===String(l)}const r=new Map([["length",t],["getProperty",n]]);Object.keys(e).reduce((d,f)=>(d.set(f,e[f]),d),r);function i(d,f){const l=d;return typeof f=="number"?[{target:l,operator:"length",param:null,value:Number(f)}]:typeof f=="boolean"?[{target:l,operator:"getProperty",param:d,value:!!f}]:typeof f=="object"?Object.keys(f).map(p=>{if(p==="length")return{target:l,operator:"length",param:null,value:f[p]};const m=p,g=f[p];return{target:l,operator:"getProperty",param:m,value:g}}):[]}function a(d){return Object.keys(d).reduce((l,p)=>{const m=i(p,d[p]);return l.push(...m),l},[])}function s(d,f){if(r.has(d.operator)){const l=r.get(d.operator);return l&&l(d.target,d.param,d.value,f)||!1}return!1}function c(d,f){return a(d).reduce((m,g)=>m&&s(g,f),!0)}function u(d,f){const l=Object.keys(d),p=l.includes("allOf"),m=l.includes("anyOf"),g=p||m,y=(g?d[g?p?"allOf":"anyOf":"allOf"]:[d]).map(F=>c(F,f));return p?!y.includes(!1):y.includes(!0)}return{parseValueSchema:u}}const Gi={convertTo:(e,t,n,r)=>{e.appearance||(e.appearance={}),e.appearance[t]=n},convertFrom:(e,t,n)=>e.appearance?e.appearance[t]:e[t]},Xi={convertFrom:(e,t,n)=>e.buttons&&e.buttons.length?`共 ${e.buttons.length} 项`:"无"},Yi={convertTo:(e,t,n,r)=>{e.editor&&(e.editor[t]=n)},convertFrom:(e,t,n)=>e.editor&&Object.prototype.hasOwnProperty.call(e.editor,t)?e.editor[t]:e[t]},ae={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},Ji={convertFrom:(e,t,n)=>{var i;const r=e.editor&&e.editor[t]?e.editor[t]:e[t];return((i=ae[r])==null?void 0:i.name)||r}},Qi={convertTo:(e,t,n,r)=>{e[t]=e[t]},convertFrom:(e,t,n)=>e.editor?n.getRealEditorType(e.editor.type):""},Ki={convertFrom:(e,t)=>e.binding?e.binding.path:"",convertTo:(e,t,n)=>{if(n&&n.length>0){const r=n[0];e.binding||(e.binding={}),e.binding.type="Form",e.binding.path=r.bindingField,e.binding.field=r.id,e.binding.fullPath=r.path,e.path=r.bindingPath}}},Zi={convertTo:(e,t,n,r)=>{e.pagination||(e.pagination={}),e.pagination[t]=n},convertFrom:(e,t,n)=>e.pagination?e.pagination[t]:e[t]},ea={convertTo:(e,t,n,r)=>{e.rowNumber||(e.rowNumber={}),e.rowNumber[t]=n},convertFrom:(e,t,n)=>e.rowNumber?e.rowNumber[t]:e[t]},ta={convertTo:(e,t,n,r)=>{e.selection||(e.selection={}),e.selection[t]=n},convertFrom:(e,t,n)=>e.selection?e.selection[t]:e[t]},na={convertFrom:(e,t,n)=>e[t]&&e[t].length?`共 ${e[t].length} 项`:""},oa={convertTo:(e,t,n,r)=>{e.editor[t]=n.value},convertFrom:(e,t,n)=>e.editor&&Object.prototype.hasOwnProperty.call(e.editor,t)?e.editor[t]:e[t]},ra={convertFrom:(e,t)=>e[t]||"",convertTo:(e,t,n)=>{e[t]=n}},At={},gn=new Map([["/converter/appearance.converter",Gi],["/converter/buttons.converter",Xi],["/converter/property-editor.converter",Yi],["/converter/items-count.converter",na],["/converter/type.converter",Ji],["/converter/change-editor.converter",Qi],["/converter/form-group-label.converter",ra],["/converter/field-selector.converter",Ki],["/converter/pagination.converter",Zi],["/converter/row-number.converter",ea],["/converter/grid-selection.converter",ta],["/converter/enum-data.converter",oa]]),ia={},aa=new Map([["string",{type:"input-group",enableClear:!1}],["boolean",{type:"combo-list",textField:"name",valueField:"value",idField:"value",enableClear:!1,editable:!1,maxHeight:64,data:[{value:!0,name:"是"},{value:!1,name:"否"}]}],["enum",{type:"combo-list",maxHeight:128,enableClear:!1,editable:!1}],["array",{type:"button-edit"}],["number",{type:"number-spinner",placeholder:""}],["events-editor",{type:"events-editor",hide:!0}]]),sa=zi();function lo(e,t){return()=>sa.parseValueSchema(e,t)}function la(e,t,n){return e.includes("visible")&&t.visible!==void 0?typeof t.visible=="boolean"?()=>!!t.visible:t.visible===void 0?!0:lo(t.visible,n):()=>!0}function ca(e,t,n){return e.includes("readonly")&&t.readonly!==void 0?typeof t.readonly=="boolean"?()=>!!t.readonly:lo(t.readonly,n):()=>!1}function ua(e,t){const n=e.$converter||t;return typeof n=="string"&&n&&gn.has(n)?gn.get(n)||null:n||null}function yn(e,t,n,r,i,a="",s=""){return Object.keys(e).map(u=>{const d=o.ref(1),f=u,l=e[u],p=Object.keys(l),m=l.title,g=l.type,b=aa.get(g)||{type:"input-group",enableClear:!1},v=l.editor?Object.assign({},b,l.editor):Object.assign({},b),y=la(p,l,t),C=ca(p,l,t);v.readonly=v.readonly===void 0?C():v.readonly;const F=l.type==="cascade"?yn(l.properties,t,n,r,i,a,s):[],w=!0;let S=ua(l,s);const N=o.computed({get(){if(d.value){if(["class","style"].find(V=>V===f)&&!S&&(S=gn.get("/converter/appearance.converter")||null),S&&S.convertFrom)return S.convertFrom(n,u,i,a);const T=n[u];return typeof T=="string"&&T===""?l.defaultValue||"":T}return null},set(T){d.value+=1,S&&S.convertTo?(S.convertTo(r,u,T,i,a),S.convertTo(n,u,T,i,a)):(r[u]=T,n[u]=T)}}),{refreshPanelAfterChanged:h,description:_,isExpand:x}=l,k={propertyID:f,propertyName:m,propertyType:g,propertyValue:N,editor:v,visible:y,readonly:C,cascadeConfig:F,hideCascadeTitle:w,refreshPanelAfterChanged:h,description:_,isExpand:x};return t[f]=k,k})}function da(e,t,n,r,i=""){const a=t.$ref.schema,s=t.$ref.converter,c=n[a],u=c.type,d=so(c),f={},l=At[u];if(l&&l.categories){const p=l.categories[e],m=p==null?void 0:p.title;s&&Object.keys(p.properties).forEach(v=>{p.properties[v].$converter=s});const g=(p==null?void 0:p.properties)||{},b=yn(g,f,d,c,r,i);return{categoryId:e,categoryName:m,properties:b}}return{categoryId:e,categoryName:"",properties:[]}}function vn(e,t,n,r,i){const a=e.type,s=so(e),c={};let u=i||At[a];if(u&&Object.keys(u).length===0&&n&&n.getPropConfig&&(u=n.getPropConfig(r)),u&&u.categories){const d=[];return Object.keys(u.categories).map(f=>{const l=u.categories[f];if(l.$ref){d.push(da(f,l,e,t,r));return}const p=l==null?void 0:l.title,m=l==null?void 0:l.tabId,g=l==null?void 0:l.tabName,b=l==null?void 0:l.hide,v=l==null?void 0:l.hideTitle,y=yn(l.properties||{},c,s,e,t,r,l.$converter),{setPropertyRelates:C}=l;d.push({categoryId:f,categoryName:p,tabId:m,tabName:g,hide:b,properties:y,hideTitle:v,setPropertyRelates:C})}),d}return[]}function Ue(e,t,n=new Map,r=(s,c,u,d)=>c,i={},a=s=>s){return $t[t.title]=t,ao[t.title]=r,At[t.title]=i,ia[t.title]=a,(s={})=>{const c=Ui(s,t,n),u=Object.keys(e).reduce((d,f)=>(d[f]=e[f].default,d),{});return Object.assign(u,c)}}function ht(e,t){return{customClass:t.class,customStyle:t.style}}function fa(){function e(t,n){const{dataSource:r}=t||{};return r===void 0?{}:{}}return{resolve:e}}function pa(){function e(t,n){return t.selectItemById(n)}return{selectItemById:e}}function ma(){function e(t,n){const{columns:r}=n;return t.updateColumns(r)}return{updateColumns:e}}var Je=(e=>(e.Equal="0",e.NotEqual="1",e.Greater="2",e.GreaterOrEqual="3",e.Less="4",e.LessOrEqual="5",e.Like="6",e.LikeStartWith="7",e.LikeEndWith="8",e.In="9",e.NotIn="10",e))(Je||{});const ha=[{value:"0",name:"等于"},{value:"1",name:"不等于"},{value:"2",name:"大于"},{value:"3",name:"大于等于"},{value:"4",name:"小于"},{value:"5",name:"小于等于"},{value:"6",name:"包含"},{value:"7",name:"开始是"},{value:"8",name:"结束是"}],ga={"button-edit":["0","1"," 6","7","8"],"check-box":["0"],"combo-list":["0","1"],"combo-lookup":["0","1"," 6","7","8"],"date-picker":["0","1","2","3","4","5"],"date-range":[],"datetime-picker":["0","1","2","3","4","5"],"datetime-range":[],"month-picker":["0","1","2","3","4","5"],"month-range":[],"year-picker":["0","1","2","3","4","5"],"year-range":[],"input-group":["0","1","6","7","8"],lookup:["0","1"],"number-range":[],"number-spinner":["0"," 1","2","3","4","5"],"radio-group":["0"],text:["0","1"," 6","7","8"]};function ya(e,t,n){const{fieldMap:r}=n;function i(a){const s=r.get(a.fieldCode);if(!s)return[];const c=s.editor.type,u=new Set(ga[c]);return ha.filter(f=>u.has(f.value))}return{getCompareOperators:i}}const bn={conditions:{type:Array,default:[]},fields:{type:Array,default:[]},key:{type:String,default:""},isControlInline:{type:Boolean,default:!0}};class co{constructor(t={value:[]}){z(this,"editorType","check-box");z(this,"value");z(this,"valueType","boolean");const r=(Array.isArray(t.value)?t.value:typeof t.value=="string"?t.value.split(","):[]).map(i=>JSON.parse(i));this.value=r}clear(){this.value=[]}setValue(t){this.value=t}getValue(){return this.value}getDisplayText(){return this.value.map(t=>t?"是":"否").join(",")}isEmpty(){return this.value.length===0}}class uo{constructor(t={textValue:"",value:"",valueField:""}){z(this,"editorType","combo-lookup");z(this,"textValue");z(this,"value");z(this,"valueField");z(this,"valueType","text");this.textValue=t.textValue,this.value=t.value,this.valueField=t.valueField}clear(){this.value="",this.valueField="",this.textValue=""}getPropValue(t,n){if(n.length>1){const r=n.shift();return t[r]?this.getPropValue(t[r],n):null}return t[n[0]]}getTextValue(t){const n=t.split("."),r=this.value.split(",").map(i=>this.getPropValue(i,be.cloneDeep(n)));return r&&r.length?r.join(","):""}getValue(){const t=this.valueField.split("."),n=this.value.split(",").map(r=>this.getPropValue(r,be.cloneDeep(t)));return n&&n.length?n.join(","):""}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.valueField}}class fo{constructor(t={value:""}){z(this,"editorType","date-picker");z(this,"value");z(this,"valueType","datetime");this.value=t.value}setValue(t){this.value=t.formatted}getValue(){return this.value}getDisplayText(){return this.getValue()}isEmpty(){return!this.value}clear(){this.value=void 0}}class Lt{constructor(t={begin:"",end:""}){z(this,"editorType","date-range");z(this,"begin","");z(this,"end","");z(this,"valueType","datetime");this.begin=t.begin,this.end=t.end}clear(){this.begin="",this.end=""}getValue(){return!this.begin||!this.end?"":`${this.begin}~${this.end}`}getDisplayText(){return this.getValue()}setValue(t){t.dataRange?(this.begin=t.dataRange.split(t.delimiter)[0],this.end=t.dataRange.split(t.delimiter)[1]):this.clear()}isEmpty(){return!this.begin||!this.end}}class po{constructor(t={value:""}){z(this,"editorType","datetime-picker");z(this,"value");z(this,"valueType","datetime");this.value=t.value}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=t.formatted}isEmpty(){return!this.value}}class mo{constructor(t={value:""}){z(this,"editorType","combo-list");z(this,"value");z(this,"valueType","enum");this.value=t.value}clear(){this.value=[]}getValue(){return this.value}getDisplayText(){return this.value.map(t=>t.name).join(",")}setValue(t){this.value=t.value}isEmpty(){return!this.value&&this.value!==!1}}class va{constructor(t={value:[],displayText:"",displayField:"",isInputText:!1}){z(this,"editorType","input-group");z(this,"value");z(this,"valueType","text");z(this,"displayText");z(this,"valueField");z(this,"isInputText");this.value=t.value,this.displayText=t.displayText,this.valueField=t.displayField,this.isInputText=t.isInputText}clear(){this.value=[],this.displayText="",this.valueField=""}getPropValue(t,n){if(n.length>1){const r=n.shift();return t[r]?this.getPropValue(t[r],n):""}return t[n[0]]}getTextValue(t){const n=t.split("."),r=this.value.map(i=>this.getPropValue(i,be.cloneDeep(n)));return r&&r.length?r.join(","):""}getValue(){const t=this.valueField.split(".")||[],n=this.value.map(r=>this.getPropValue(r,be.cloneDeep(t)));return n&&n.length?n.join(","):""}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.displayText&&!this.value.length}}class ho{constructor(t={mapFields:[],value:"",valueField:"",isInputText:!1}){z(this,"editorType","lookup");z(this,"idValue");z(this,"mapFields");z(this,"value");z(this,"valueField");z(this,"valueType","text");z(this,"isInputText");this.value=t.value,this.valueField=t.valueField,this.mapFields=t.mapFields,this.idValue=t.mapFields.map(n=>n.id).join(","),this.isInputText=t.isInputText}clear(){this.value="",this.idValue="",this.mapFields=[]}getValue(){return this.mapFields.map(t=>t[this.valueField||"id"]).join(",")}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.mapFields.length}}class go{constructor(t={value:""}){z(this,"editorType","month-picker");z(this,"value");z(this,"valueType","datetime");this.value=t.value}setValue(t){this.value=t.formatted}getValue(){return this.value}getDisplayText(){return this.getValue()}clear(){this.value=void 0}isEmpty(){return!this.value}}class yo{constructor(t={begin:"",end:""}){z(this,"editorType","month-range");z(this,"begin");z(this,"end");z(this,"valueType","datetime");this.begin=t.begin,this.end=t.end}clear(){this.begin="",this.end=""}getValue(){return!this.begin||!this.end?"":`${this.begin}~${this.end}`}getDisplayText(){return this.getValue()}setValue(t){t.dataRange?(this.begin=t.dataRange.split(t.delimiter)[0],this.end=t.dataRange.split(t.delimiter)[1]):this.clear()}isEmpty(){return!this.begin||!this.end}}class vo{constructor(t={begin:null,end:null}){z(this,"editorType","number-range");z(this,"begin");z(this,"end");z(this,"valueType","number");this.begin=t.begin==null?null:parseFloat(t.begin),this.end=t.end==null?null:parseFloat(t.end)}clear(){this.begin=null,this.end=null}getValue(){return{begin:this.begin,end:this.end}}getDisplayText(){return this.getValue()}setValue(t){this.begin=t.begin==null?null:parseFloat(t.begin),this.end=t.end==null?null:parseFloat(t.end)}isEmpty(){return this.begin==null&&this.end==null}}class bo{constructor(t={value:""}){z(this,"editorType","number-spinner");z(this,"value");z(this,"valueType","number");this.value=t.value==null?null:parseFloat(t.value)}clear(){this.value=null}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=isNaN(parseFloat(t))?null:t}isEmpty(){return this.value==null||isNaN(this.value)}}class Co{constructor(t={value:null}){z(this,"editorType","radio-group");z(this,"value");z(this,"valueType","enum");this.value=t.value}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=t}isEmpty(){return!this.value}}class qt{constructor(t={value:""}){z(this,"editorType","text");z(this,"value");z(this,"valueType","text");this.value=t.value}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=t}isEmpty(){return!this.value}}function wo(){function e(t,n){switch(t){case"check-box":return new co(n);case"combo-list":return new mo(n);case"combo-lookup":return new uo(n);case"input-group":return new va(n);case"date-picker":return new fo(n);case"date-range":return new Lt(n);case"datetime-picker":return new po(n);case"datetime-range":return new Lt(n);case"lookup":return new ho(n);case"month-picker":return new go(n);case"month-range":return new yo(n);case"number-range":return new vo(n);case"number-spinner":return new bo(n);case"radio-group":return new Co(n);default:return new qt(n)}}return{createConditionValue:e}}function Cn(e,t){const n=o.ref(e.fields),r=o.ref([]),i=new Map,{createConditionValue:a}=wo();function s(f){switch(f.editor?f.editor.type:"input-group"){case"date-range":f.editor.type="date-picker";break;case"datetime-range":f.editor.type="datetime-picker";break;case"number-range":f.editor.type="number-spinner";break}return f.editor}function c(f){return f.map(p=>Object.assign({},p)).map(p=>(p.editor=s(p),p))}function u(f=!0){n.value.reduce((l,p)=>(f||(p.editor=s(p)),l.set(p.labelCode,p),l),i)}function d(f){return f.forEach(l=>{if(l){const p=i.get(l.fieldCode);l.value=a(p.editor.type,l.value)}}),f}return{convertToSingleControl:c,fields:n,fieldMap:i,fieldConditions:r,loadFieldConfigs:u,initialConditionValue:d}}function So(e,t,n){const r=o.ref(null),i=o.ref(n),a=o.ref(0);function s(f,l){let p=null;return function(){const m=arguments;p?(clearTimeout(p),p=setTimeout(()=>{p=null,f(...m)},200)):(f(...m),p=setTimeout(()=>{p=null},200))}}function c(){i.value&&(r.value=new ResizeObserver(s(f=>{const l=f[0];a.value=l.contentRect.width})),r.value.observe(i.value))}function u(f){let p="col-12";return f>250*6?p="col-2":f>250*4?p="col-3":f>250*3?p="col-4":f>250*2&&(p="col-6"),p}const d=o.computed(()=>u(a.value));return o.watch([n],([f])=>{i.value=f,c()}),{conditionClass:d,resizeObserver:r}}const Ht=o.defineComponent({name:"FConditionFields",props:bn,emits:["valueChange","blur","focus","click","input"],setup(e,t){const n=o.ref(),r=o.ref(e.key);o.ref(e.isControlInline);const i=o.ref(e.conditions),a=Cn(e),{initialConditionValue:s,fieldMap:c,loadFieldConfigs:u}=a,d=So(e,t,n),{conditionClass:f,resizeObserver:l}=d;u(!0),s(i.value),o.onBeforeUnmount(()=>{var v;(v=l.value)==null||v.unobserve(n.value)}),o.watch(()=>e.conditions,()=>{i.value=e.conditions,s(i.value)});const p=o.computed(()=>({"f-utils-flex-row-wrap":!0,"farris-form":!0,"farris-form-controls-inline":e.isControlInline})),m=o.computed(()=>"col-12 col-md-6 col-xl-3 col-el-2 ");function g(v,y){t.emit("valueChange",v,y)}function b(){return i.value.map(v=>{var F,w,S,N;const y=(F=c.get(v.fieldCode))==null?void 0:F.editor;let C=!0;return((w=v.value)==null?void 0:w.editorType)==="lookup"&&y?(y.idValue=v.value.idValue,y.onClear=()=>{v.value.idValue="",v.value.mapFields=[],g("",v)},y["onUpdate:dataMapping"]=h=>{v.value.mapFields=h.items,g(v.value.getValue(),v)},C=!1):((S=v.value)==null?void 0:S.editorType)==="number-range"&&y&&(y.beginValue=v.value.begin,y.onBeginValueChange=h=>{v.value.begin=h,g(h,v)},y.endValue=v.value.end,y.onEndValueChange=h=>{v.value.end=h,g(h,v)},C=!1),o.createVNode(un.FDynamicFormGroup,{customClass:((N=y==null?void 0:y.appearance)==null?void 0:N.class)||m.value,label:v.fieldName,editor:y,required:y==null?void 0:y.required,modelValue:v.value.value,"onUpdate:modelValue":h=>v.value.value=h,onChange:h=>{C&&g(h,v)}},null)})}return()=>o.withDirectives(o.createVNode("div",{class:p.value,key:r.value,ref:n},[b()]),[[o.resolveDirective("area-response")]])}}),wn=new Map([["appearance",ht]]),ba=new Map([]);var Sn=(e=>(e.String="String",e.DateTime="DateTime",e.Date="Date",e.Enum="Enum",e.Boolean="Boolean",e.Number="Number",e.Text="Text",e.BigNumber="BigNumber",e))(Sn||{});const Ca="root-viewmodel";class wa{constructor(t,n){z(this,"formSchemaUtils");z(this,"controlCreatorUtils");z(this,"designViewModelUtils");this.resolver=t,this.designerHostService=n,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(t){const n=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(),n}createComponentRefNode(t){const n=this.resolver.getSchemaByType("component-ref");return Object.assign(n,{id:`${t.componentId}-component-ref`,component:`${t.componentId}-component`}),n}createComponentNode(t){const n=this.resolver.getSchemaByType("component"),r=this.createFormComponentContents(t);return Object.assign(n,{id:`${t.componentId}-component`,viewModel:`${t.componentId}-component-viewmodel`,componentType:t.componentType,appearance:{class:this.getFormComponentClass()},formColumns:t.formColumns,contents:r}),n}getFormComponentClass(){const{templateId:t}=this.formSchemaUtils.getFormSchema().module;return t==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(t){const n=this.resolver.getSchemaByType("section");Object.assign(n,{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}),n.contents=[r];const{selectedFields:a}=t;a==null||a.forEach(c=>{const u=be.cloneDeep(c),d=this.resolveControlClassByFormColumns(t),f=this.controlCreatorUtils.setFormFieldProperty(u,"",d);f&&i.push(f)});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;return s==="double-list-in-tab-template"&&(n.appearance.class="f-section-grid f-section-in-main px-0 pt-0",n.fill=!0),[n]}resolveControlClassByFormColumns(t){let n="";switch(t.formColumns){case 1:{n="col-12";break}case 2:{n="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{n="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{n="col-12 col-md-6 col-xl-3 col-el-2";break}}return n}createViewModeNode(t){return{id:`${t.componentId}-component-viewmodel`,code:`${t.componentId}-component-viewmodel`,name:t.componentName,bindTo:t.bindTo,parent:Ca,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const n=[],{selectedFields:r}=t;return r==null||r.forEach(i=>{let a="blur";const s=i.type.name;(s===Sn.Enum||s===Sn.Boolean)&&(a="change"),n.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}),n}}function Sa(e,t,n,r){var a,s,c,u,d,f;const i=n.parentComponentInstance;if(i&&r){const l=(a=i.schema)==null?void 0:a.type,m={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=n.bindingSourceContext)==null?void 0:s.entityTitle)||((u=(c=n.bindingSourceContext)==null?void 0:c.bindingEntity)==null?void 0:u.name)||"标题",componentType:"form",formColumns:l==="splitter-pane"?1:4,parentContainerId:i.schema.id,bindTo:((d=n.bindingSourceContext)==null?void 0:d.bindTo)||"/",selectedFields:(f=n.bindingSourceContext)==null?void 0:f.bindingEntityFields};return new wa(e,r).createComponent(m)}else return t}function xa(e,t,n){return t}Ue({customClass:{type:String,default:""},customStyle:{type:String,defaut:""}},{$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:[]}},required:["id","type","contents"]},wn,Sa);const xo={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input 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:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}}},required:["id","type","editor"]},Wt={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:""},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},type:{type:String,default:"input-group"}};Ue(Wt,xo,wn,void 0);function xn(e,t,n){var N;const r=n&&n.getStyles&&n.getStyles()||"",i=n&&n.getDesignerClass&&n.getDesignerClass()||"",a=o.ref();function s(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function c(){return!1}function u(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function d(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function f(h){if(!h||!h.value)return null;if(h.value.schema&&h.value.schema.type==="component")return h.value;const _=o.ref(h==null?void 0:h.value.parent),x=f(_);return x||null}function l(h=t){var T;const{componentInstance:_,designerItemElementRef:x}=h;if(!_||!_.value)return null;const{getCustomButtons:k}=_.value;return _.value.canMove||k&&((T=k())!=null&&T.length)?x:l(h.parent)}function p(h){return!!n&&n.canAccepts(h)}function m(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function g(){}function b(h,_){!h||!_||n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(h,_)}function v(h,_){const{componentType:x}=h;let k=Dt(x,h,_);n&&n.onResolveNewComponentSchema&&(k=n.onResolveNewComponentSchema(h,k));const T=x.toLowerCase().replace(/-/g,"_");return k&&!k.id&&k.type===x&&(k.id=`${T}_${Math.random().toString().slice(2,6)}`),k}function y(h){}function C(...h){if(n&&n.getPropsConfig)return n.getPropsConfig(...h)}function F(){n&&n.onRemoveComponent&&n.onRemoveComponent(),t!=null&&t.schema.contents&&t.schema.contents.map(h=>{let _=h.id;h.type==="component-ref"&&(_=h.component);const x=e.value.querySelectorAll(`#${_}-design-item`);x!=null&&x.length&&Array.from(x).map(k=>{var T;(T=k==null?void 0:k.componentInstance)!=null&&T.value.onRemoveComponent&&k.componentInstance.value.onRemoveComponent()})})}function w(){if(n&&n.getCustomButtons)return n.getCustomButtons()}function S(h){if(n&&n.onPropertyChanged)return n.onPropertyChanged(h)}return a.value={canMove:s(),canSelectParent:c(),canDelete:u(),canNested:!d(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:(N=t==null?void 0:t.parent)==null?void 0:N.componentInstance,schema:t==null?void 0:t.schema,styles:r,designerClass:i,canAccepts:p,getBelongedComponentInstance:f,getDraggableDesignItemElement:l,getDraggingDisplayText:m,getPropConfig:C,getDragScopeElement:g,onAcceptMovedChildElement:b,onChildElementMovedOut:y,addNewChildComponentSchema:v,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||o.ref(!1),onRemoveComponent:F,getCustomButtons:w,onPropertyChanged:S},a}class Fo{constructor(t,n){z(this,"componentId");z(this,"viewModelId");z(this,"eventsEditorUtils");z(this,"formSchemaUtils");z(this,"formMetadataConverter");z(this,"designViewModelUtils");z(this,"designViewModelField");z(this,"controlCreatorUtils");z(this,"designerHostService");z(this,"schemaService",null);z(this,"metadataService",null);z(this,"propertyConfig",{type:"object",categories:{}});var r;this.componentId=t,this.designerHostService=n,this.eventsEditorUtils=n.eventsEditorUtils,this.formSchemaUtils=n.formSchemaUtils,this.formMetadataConverter=n.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=n.designViewModelUtils,this.controlCreatorUtils=n.controlCreatorUtils,this.metadataService=n.metadataService,this.schemaService=n.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var r;const n=t.binding&&t.binding.type==="Form"&&t.binding.field;if(n){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===n)}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",editable:!1,data:[{value:t.type,name:ae[t.type].name}]}}}}}getAppearanceConfig(t=null){return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(t,n){const r=n&&n.parent&&n.parent.schema;if(!r)return;const i=r.contents.findIndex(s=>s.id===t),a=be.cloneDeep(r.contents[i]);r.contents.splice(i,1),r.contents.splice(i,0,a)}}class Fa{constructor(){z(this,"label","");z(this,"id","");z(this,"columnInSM",12);z(this,"columnInMD",6);z(this,"columnInLG",3);z(this,"columnInEL",2);z(this,"displayWidthInSM",1);z(this,"displayWidthInMD",1);z(this,"displayWidthInLG",1);z(this,"displayWidthInEL",1);z(this,"displayColumnCountAtBreakPoint","md");z(this,"tagRow",0);z(this,"showTopBorder",0);z(this,"group",1);z(this,"isSupportedClass",!0);z(this,"fieldSetId","")}}function Ta(e){let t,n;const r=new Map;let i=[];function a(f,l){const m=f.split(" ").filter(C=>C.startsWith("col-"));if(m.length===0){l.isSupportedClass=!1;return}let g=m.find(C=>/^col-([1-9]|10|11|12)$/.test(C)),b=m.find(C=>/^col-md-([1-9]|10|11|12)$/.test(C)),v=m.find(C=>/^col-xl-([1-9]|10|11|12)$/.test(C)),y=m.find(C=>/^col-el-([1-9]|10|11|12)$/.test(C));g=g||"col-12",l.columnInSM=parseInt(g.replace("col-",""),10),l.displayWidthInSM=l.columnInSM/12,l.displayWidthInSM!==1&&(l.isSupportedClass=!1),b=b||"col-md-"+l.columnInSM,l.columnInMD=parseInt(b.replace("col-md-",""),10),l.displayWidthInMD=l.columnInMD/6,[1,2].includes(l.displayWidthInMD)||(l.isSupportedClass=!1),v=v||"col-xl-"+l.columnInMD,l.columnInLG=parseInt(v.replace("col-xl-",""),10),l.displayWidthInLG=l.columnInLG/3,[1,2,3,4].includes(l.displayWidthInLG)||(l.isSupportedClass=!1),y=y||"col-el-"+l.columnInLG,l.columnInEL=parseInt(y.replace("col-el-",""),10),l.displayWidthInEL=l.columnInEL/2,[1,2,3,4,5,6].includes(l.displayWidthInEL)||(l.isSupportedClass=!1)}function s(f,l,p,m=!1){let g=!1;f.contents.forEach(b=>{if(b.type==="fieldset"){p+=1,s(b,l,p,!0),g=!0;return}g&&(p+=1,g=!1);const v=b.appearance&&b.appearance.class,y=new Fa;v?a(v,y):y.isSupportedClass=!1,y.label=b.label||b.id,y.id=b.id,y.group=p,m&&(y.fieldSetId=f.id),n===b.id&&(t=p),r.set(b.id,b),l.push(y)})}function c(f){const l=e.getComponentById(f);if(!l||!l.componentType||!l.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const p=e.selectNode(l,m=>m.type===dn.DgControl["response-form"].type);return!p||!p.contents||p.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:p}}function u(f,l){l=l||f.id;const{result:p,message:m,formNode:g}=c(l);if(!p)return{result:p,message:m};n=f.id,i=[],r.clear();const b=g.contents[0].type===dn.DgControl.fieldset.type?0:1;s(g,i,b);const v=i.find(C=>!C.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:v?"customize":"standard"},importData:i}}function d(f,l){l=l;const{result:p,formNode:m}=c(l);if(!p)return"";const g=[];return f.forEach(b=>{var C;const v=r.get(b.id),y=v.appearance&&v.appearance.class;if(y){const w=y.split(" ").filter(k=>!k.startsWith("col-")),S="col-"+b.columnInSM,N="col-md-"+b.columnInMD,h="col-xl-"+b.columnInLG,_="col-el-"+b.columnInEL,x=[S,N,h,_].concat(w);v.appearance.class=x.join(" ")}if(b.fieldSetId){const F=m.contents.find(S=>S.id===b.fieldSetId),w=g.find(S=>S.id===b.fieldSetId);w?(C=w.contents)==null||C.push(v):(g.push(F),F.contents=[v])}else g.push(v)}),m.contents=g,m.id}return{checkCanFindFormNode:c,checkCanOpenLayoutEditor:u,changeFormControlsByResponseLayoutConfig:d,getResonseFormLayoutConfig:s}}const Ut=o.ref(0);function _a(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.top>=n.top,a=r.top<=n.bottom;return i&&a}function Na(e){const t=e.querySelector(".component-btn-group");if(!t)return;t.style.display="";const n=t.getBoundingClientRect(),r=t.querySelector("div");if(r){const i=r.getBoundingClientRect();r.style.top=n.top+"px";let a=n.left-i.width;const s=document.querySelector(".editorDiv");if(s){const c=s.getBoundingClientRect();a<c.left&&({left:a}=e.getBoundingClientRect())}r.style.left=a+"px"}}function Va(e){if(!window.scrollContainerList)return;const t=Array.from(window.scrollContainerList);if(t.length&&t.length===1){const n=t[0],r=document.querySelector(`[id=${n}]`);if(r&&r.contains(e))return r}}function To(e){if(!e)return;const t=e.getBoundingClientRect();if(t.width===0&&t.height===0)return;const n=e.querySelector(".component-btn-group");if(n){let r=!0;const i=Va(e);if(i&&(r=_a(e,i)),!r){n.style.display="none";return}Na(e)}}function ka(e){if(!e)return;let t;e.className.includes("dgComponentSelected")?t=e:t=e.querySelector(".dgComponentSelected"),t&&To(t)}var gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zt(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 Ea={exports:{}};(function(e,t){(function(n){e.exports=n()})(function(){return function(){function n(r,i,a){function s(d,f){if(!i[d]){if(!r[d]){var l=typeof zt=="function"&&zt;if(!f&&l)return l(d,!0);if(c)return c(d,!0);var p=new Error("Cannot find module '"+d+"'");throw p.code="MODULE_NOT_FOUND",p}var m=i[d]={exports:{}};r[d][0].call(m.exports,function(g){var b=r[d][1][g];return s(b||g)},m,m.exports,n,r,i,a)}return i[d].exports}for(var c=typeof zt=="function"&&zt,u=0;u<a.length;u++)s(a[u]);return s}return n}()({1:[function(n,r,i){var a={},s="(?:^|\\s)",c="(?:\\s|$)";function u(l){var p=a[l];return p?p.lastIndex=0:a[l]=p=new RegExp(s+l+c,"g"),p}function d(l,p){var m=l.className;m.length?u(p).test(m)||(l.className+=" "+p):l.className=p}function f(l,p){l.className=l.className.replace(u(p)," ").trim()}r.exports={add:d,rm:f}},{}],2:[function(n,r,i){(function(a){var s=n("contra/emitter"),c=n("crossvent"),u=n("./classes"),d=document,f=d.documentElement;function l(T,V){var I=arguments.length;I===1&&Array.isArray(T)===!1&&(V=T,T=[]);var E,M,B,O,R,q,L,X,te,ie=null,ue,$,ne=!1,pe=0,oe,A=V||{};A.moves===void 0&&(A.moves=C),A.accepts===void 0&&(A.accepts=C),A.invalid===void 0&&(A.invalid=Pe),A.containers===void 0&&(A.containers=T||[]),A.isContainer===void 0&&(A.isContainer=y),A.copy===void 0&&(A.copy=!1),A.copySortSource===void 0&&(A.copySortSource=!1),A.revertOnSpill===void 0&&(A.revertOnSpill=!1),A.removeOnSpill===void 0&&(A.removeOnSpill=!1),A.direction===void 0&&(A.direction="vertical"),A.ignoreInputTextSelection===void 0&&(A.ignoreInputTextSelection=!0),A.mirrorContainer===void 0&&(A.mirrorContainer=d.body);var Y=s({containers:A.containers,start:U,end:Xe,cancel:lt,remove:et,destroy:Be,canMove:re,dragging:!1});return A.removeOnSpill===!0&&Y.on("over",P).on("out",W),Ce(),Y;function we(D){return Y.containers.indexOf(D)!==-1||A.isContainer(D)}function Ce(D){var H=D?"remove":"add";g(f,H,"mousedown",G),g(f,H,"mouseup",Ke)}function je(D){var H=D?"remove":"add";g(f,H,"mousemove",Q)}function $e(D){var H=D?"remove":"add";c[H](f,"selectstart",me),c[H](f,"click",me)}function Be(){Ce(!0),Ke({})}function me(D){ue&&D.preventDefault()}function G(D){O=D.clientX,R=D.clientY;var H=b(D)!==1||D.metaKey||D.ctrlKey;if(!H){var Z=D.target,fe=ee(Z);fe&&(ue=fe,je(),D.type==="mousedown"&&(N(Z)?Z.focus():D.preventDefault()))}}function Q(D){if(ue){if(b(D)===0){Ke({});return}if(!(D.clientX!==void 0&&Math.abs(D.clientX-O)<=(A.slideFactorX||0)&&D.clientY!==void 0&&Math.abs(D.clientY-R)<=(A.slideFactorY||0))){if(A.ignoreInputTextSelection){var H=k("clientX",D)||0,Z=k("clientY",D)||0,fe=d.elementFromPoint(H,Z);if(N(fe))return}var Se=ue;je(!0),$e(),Xe(),ge(Se),u.add(X||B,"gu-transit"),ve(),K(),pe=0,ft(D)}}}function ee(D){if(!(Y.dragging&&E)&&!we(D)){for(var H=D;S(D)&&we(S(D))===!1;)if(A.invalid(D,H)||(D=S(D),!D))return;var Z=S(D);if(Z&&!A.invalid(D,H)){var fe=A.moves(D,Z,H,_(D));if(fe)return{item:D,source:Z}}}}function re(D){return!!ee(D)}function U(D){var H=ee(D);H&&ge(H)}function ge(D){kt(D.item,D.source)&&(X=D.item.cloneNode(!0),Y.emit("cloned",X,D.item,"copy")),M=D.source,B=D.item,q=L=_(D.item),Y.dragging=!0,Y.emit("drag",B,M)}function Pe(){return!1}function Xe(){if(Y.dragging){var D=X||B;Ze(D,S(D))}}function st(){ue=!1,je(!0),$e(!0)}function Ke(D){if(st(),!!Y.dragging){var H=X||B,Z=k("clientX",D)||0,fe=k("clientY",D)||0,Se=v(E,Z,fe),_e=dt(Se,Z,fe);_e&&(X&&A.copySortSource||!X||_e!==M)?Ze(H,_e):A.removeOnSpill?et():lt()}}function Ze(D,H){var Z=S(D);X&&A.copySortSource&&H===M&&Z.removeChild(B),ot(H)?Y.emit("cancel",D,M):Y.emit("drop",D,H,M,L),ct()}function et(){if(Y.dragging){var D=X||B,H=S(D);H&&H.removeChild(D),Y.emit(X?"cancel":"remove",D,H,M),ct()}}function lt(D){if(Y.dragging){var H=arguments.length>0?D:A.revertOnSpill,Z=X||B,fe=S(Z),Se=ot(fe);Se===!1&&H&&(X?fe&&fe.removeChild(X):M.insertBefore(Z,q)),Se||H?Y.emit("cancel",Z,M,M):Y.emit("drop",Z,fe,M,L),ct()}}function ct(){var D=X||B;st(),xe(),Re(),D&&u.rm(D,"gu-transit"),te&&clearTimeout(te),Y.dragging=!1,ie&&Y.emit("out",D,ie,M),Y.emit("dragend",D,pe),M=B=X=q=L=te=ie=null}function ot(D,H){var Z;return H!==void 0?Z=H:E?Z=L:Z=_(X||B),D===M&&Z===q}function dt(D,H,Z){for(var fe=D;fe&&!Se();)fe=S(fe);return fe;function Se(){var _e=we(fe);if(_e===!1)return!1;var mt=Ee(fe,D),tt=Ye(fe,mt,H,Z),ut=ot(fe,tt);return ut?!0:A.accepts(B,fe,M,tt)}}function ft(D){if(!E)return;D.preventDefault();var H=k("clientX",D)||0,Z=k("clientY",D)||0;E.style.left=H-2+"px",E.style.top=Z-2+"px";var fe=X||B,Se=v(E,H,Z),_e=dt(Se,H,Z),mt=_e!==null&&_e!==ie;(mt||_e===null)&&(rt(),ie=_e,Ct()),Ie(Se,Z);var tt=S(fe);if(_e===M&&X&&!A.copySortSource){tt&&tt.removeChild(fe);return}var ut,bt=Ee(_e,Se);if(ne=Fe(bt,_e),bt!==null)ut=Ye(_e,bt,H,Z);else if(A.revertOnSpill===!0&&!X)ut=q,_e=M;else{X&&tt&&tt.removeChild(fe),X&&$&&($.style.display="none");return}$.style.display="block",pt(ut,fe,mt),ut?Ve(bt,ut):ke(_e);function Le(We){Y.emit(We,fe,ie,M)}function Ct(){mt&&Le("over")}function rt(){ie&&Le("out")}}function pt(D,H,Z){(D===H||D===_(H))&&(L=_(H)),(D===null&&Z||D!==H&&D!==_(H))&&(L=D)}function P(D){u.rm(D,"gu-hide")}function W(D){Y.dragging&&u.add(D,"gu-hide")}function K(){E||(E=document.createElement("div"),E.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;",E.innerHTML=A.getMirrorText&&A.getMirrorText(B)||"控件",u.add(E,"gu-mirror"),A.mirrorContainer.appendChild(E),g(f,"add","mousemove",ft),u.add(A.mirrorContainer,"gu-unselectable"),Y.emit("cloned",E,B,"mirror"))}function ve(){if($=document.createElement("div"),u.add($,"gu-insertion"),B){var D=B.getBoundingClientRect();$.style.left=D.left+"px",$.style.top=D.top+"px"}ne=!1,A.mirrorContainer.appendChild($)}function xe(){E&&(u.rm(A.mirrorContainer,"gu-unselectable"),g(f,"remove","mousemove",ft),S(E).removeChild(E),E=null)}function Re(){$&&(S($).removeChild($),$=null)}function Ee(D,H){for(var Z=H;Z!==D&&S(Z)!==D;)Z=S(Z);return Z===f?null:Z}function Fe(D,H){if(!H)return ne;var Z=D||H&&H.lastElementChild;if(!Z)return!0;var fe=getComputedStyle(D),Se=/^inline/.test(fe.getPropertyValue("display"))||/^(left|right)$/.test(fe.getPropertyValue("float"));if(Se)return!0;if(H){var _e=getComputedStyle(H),mt=_e.getPropertyValue("display");if(/flex$/.test(mt)){var tt=_e.getPropertyValue("flex-direction")||"row";if(tt==="row"||tt==="row-reverse")return!Oe(H)}return!1}return!0}function Oe(D){if(!D.children||!D.children.length)return!1;for(const H of Array.from(D.children)){const fe=(H.className&&H.className.split(" ")||[]).filter(Se=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Se));if(!fe.length)return!1;for(const Se of fe){const _e=Se.slice(Se.lastIndexOf("-")+1);if(parseInt(_e,10)!==12)return!1}}return!0}function Ve(D,H){const Z=H.getBoundingClientRect();if($.style.left=Z.left+"px",$.style.top=Z.top+"px",ne){if($.style.height=Z.height+"px",$.style.width="4px",D){const fe=D.getBoundingClientRect();fe.top!==Z.top&&($.style.left=fe.right+"px",$.style.top=fe.top+"px",$.style.height=fe.height+"px")}}else if($.style.height="4px",$.style.width=Z.width+"px",oe){const fe=oe.getBoundingClientRect();Z.top<fe.top&&($.style.display="none")}H===B&&B&&($.style.display="none")}function ke(D){L=null;var H=D.lastElementChild;if(H){var Z=H.getBoundingClientRect();ne?($.style.left=Z.right+"px",$.style.top=Z.top+"px",$.style.height=Z.height+"px",$.style.width="4px"):($.style.left=Z.left+"px",$.style.top=Z.bottom+"px",$.style.height="4px",$.style.width=Z.width+"px"),H===B&&B&&($.style.display="none")}else $.style.display="none"}function Ie(D,H){if(!A.mirrorContainer.contains(D)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(oe=p(D),!oe||!oe.contains(D)))return;const Z=document.querySelector(".dgComponentSelected"),fe=oe.getBoundingClientRect();if(H-30<fe.top&&oe.scrollTop>0){let Se=oe.scrollTop<10?oe.scrollTop:10;oe.scrollBy(0,-1*Se),Z&&oe.contains(Z)&&(pe=pe+-1*Se)}if(H+30>fe.bottom&&oe.scrollTop<oe.scrollHeight-oe.clientHeight){const Se=oe.scrollHeight-oe.clientHeight-oe.scrollTop;let _e=Se<10?Se:10;oe.scrollBy(0,_e),Z&&oe.contains(Z)&&(pe=pe+_e)}}function Ye(D,H,Z,fe){var Se=A.direction==="horizontal",_e=A.direction==="mixed",mt=H!==D?ut():tt();return mt;function tt(){var Le=D.children.length,Ct,rt,We;for(Ct=0;Ct<Le;Ct++)if(rt=D.children[Ct],We=rt.getBoundingClientRect(),Se&&We.left+We.width/2>Z||!_e&&!Se&&We.top+We.height/2>fe||_e&&We.left+We.width>Z&&We.top+We.height>fe)return rt;return null}function ut(){var Le=H.getBoundingClientRect();if(_e){var Ct=fe-Le.top,rt=Z-Le.left,We=Le.bottom-fe,Jn=Le.right-Z,Qn=Math.min(rt,Jn,Ct,We),Kn;return ne?Kn=Jn<rt:Kn=We===Qn||Jn===Qn||rt===Qn,bt(Kn)}return bt(Se?Z>Le.left+F(Le)/2:fe>Le.top+w(Le)/2)}function bt(Le){return Le?_(H):H}}function kt(D,H){return typeof A.copy=="boolean"?A.copy:A.copy(D,H)}}function p(T){const V=Array.from(window.scrollContainerList);if(V.length===1){const E=Array.from(window.scrollContainerList)[0];return document.getElementById(E)}const I=m(V);for(const E of I)if(E.contains(T))return E;return null}function m(T){const V=[];return T.forEach(I=>{const E=document.getElementById(I);E&&V.push(E)}),V.sort((I,E)=>I.contains(E)?1:E.contains(I)?-1:0),V}function g(T,V,I,E){var M={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},B={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},O={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?c[V](T,B[I],E):a.navigator.msPointerEnabled?c[V](T,O[I],E):(c[V](T,M[I],E),c[V](T,I,E))}function b(T){if(T.touches!==void 0)return T.touches.length;if(T.which!==void 0&&T.which!==0)return T.which;if(T.buttons!==void 0)return T.buttons;var V=T.button;if(V!==void 0)return V&1?1:V&2?3:V&4?2:0}function v(T,V,I){T=T||{};var E=T.className||"",M;return T.className+=" gu-hide",M=d.elementFromPoint(V,I),T.className=E,M}function y(){return!1}function C(){return!0}function F(T){return T.width||T.right-T.left}function w(T){return T.height||T.bottom-T.top}function S(T){return T.parentNode===d?null:T.parentNode}function N(T){return T.tagName==="INPUT"||T.tagName==="TEXTAREA"||T.tagName==="SELECT"||h(T)}function h(T){return!T||T.contentEditable==="false"?!1:T.contentEditable==="true"?!0:h(S(T))}function _(T){return T.nextElementSibling||V();function V(){var I=T;do I=I.nextSibling;while(I&&I.nodeType!==1);return I}}function x(T){return T.targetTouches&&T.targetTouches.length?T.targetTouches[0]:T.changedTouches&&T.changedTouches.length?T.changedTouches[0]:T}function k(T,V){var I=x(V),E={pageX:"clientX",pageY:"clientY"};return T in E&&!(T in I)&&E[T]in I&&(T=E[T]),I[T]}r.exports=l}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(n,r,i){r.exports=function(s,c){return Array.prototype.slice.call(s,c)}},{}],4:[function(n,r,i){var a=n("ticky");r.exports=function(c,u,d){c&&a(function(){c.apply(d||null,u||[])})}},{ticky:10}],5:[function(n,r,i){var a=n("atoa"),s=n("./debounce");r.exports=function(u,d){var f=d||{},l={};return u===void 0&&(u={}),u.on=function(p,m){return l[p]?l[p].push(m):l[p]=[m],u},u.once=function(p,m){return m._once=!0,u.on(p,m),u},u.off=function(p,m){var g=arguments.length;if(g===1)delete l[p];else if(g===0)l={};else{var b=l[p];if(!b)return u;b.splice(b.indexOf(m),1)}return u},u.emit=function(){var p=a(arguments);return u.emitterSnapshot(p.shift()).apply(this,p)},u.emitterSnapshot=function(p){var m=(l[p]||[]).slice(0);return function(){var g=a(arguments),b=this||u;if(p==="error"&&f.throws!==!1&&!m.length)throw g.length===1?g[0]:g;return m.forEach(function(y){f.async?s(y,g,b):y.apply(b,g),y._once&&u.off(p,y)}),u}},u}},{"./debounce":4,atoa:3}],6:[function(n,r,i){(function(a){var s=n("custom-event"),c=n("./eventmap"),u=a.document,d=p,f=g,l=[];a.addEventListener||(d=m,f=b),r.exports={add:d,remove:f,fabricate:v};function p(S,N,h,_){return S.addEventListener(N,h,_)}function m(S,N,h){return S.attachEvent("on"+N,C(S,N,h))}function g(S,N,h,_){return S.removeEventListener(N,h,_)}function b(S,N,h){var _=F(S,N,h);if(_)return S.detachEvent("on"+N,_)}function v(S,N,h){var _=c.indexOf(N)===-1?k():x();S.dispatchEvent?S.dispatchEvent(_):S.fireEvent("on"+N,_);function x(){var T;return u.createEvent?(T=u.createEvent("Event"),T.initEvent(N,!0,!0)):u.createEventObject&&(T=u.createEventObject()),T}function k(){return new s(N,{detail:h})}}function y(S,N,h){return function(x){var k=x||a.event;k.target=k.target||k.srcElement,k.preventDefault=k.preventDefault||function(){k.returnValue=!1},k.stopPropagation=k.stopPropagation||function(){k.cancelBubble=!0},k.which=k.which||k.keyCode,h.call(S,k)}}function C(S,N,h){var _=F(S,N,h)||y(S,N,h);return l.push({wrapper:_,element:S,type:N,fn:h}),_}function F(S,N,h){var _=w(S,N,h);if(_){var x=l[_].wrapper;return l.splice(_,1),x}}function w(S,N,h){var _,x;for(_=0;_<l.length;_++)if(x=l[_],x.element===S&&x.type===N&&x.fn===h)return _}}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(n,r,i){(function(a){var s=[],c="",u=/^on/;for(c in a)u.test(c)&&s.push(c.slice(2));r.exports=s}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(n,r,i){(function(a){var s=a.CustomEvent;function c(){try{var u=new s("cat",{detail:{foo:"bar"}});return u.type==="cat"&&u.detail.foo==="bar"}catch{}return!1}r.exports=c()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(d,f){var l=document.createEvent("CustomEvent");return f?l.initCustomEvent(d,f.bubbles,f.cancelable,f.detail):l.initCustomEvent(d,!1,!1,void 0),l}:function(d,f){var l=document.createEventObject();return l.type=d,f?(l.bubbles=!!f.bubbles,l.cancelable=!!f.cancelable,l.detail=f.detail):(l.bubbles=!1,l.cancelable=!1,l.detail=void 0),l}}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,r,i){var a=r.exports={},s,c;function u(){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=u}catch{s=u}try{typeof clearTimeout=="function"?c=clearTimeout:c=d}catch{c=d}})();function f(w){if(s===setTimeout)return setTimeout(w,0);if((s===u||!s)&&setTimeout)return s=setTimeout,setTimeout(w,0);try{return s(w,0)}catch{try{return s.call(null,w,0)}catch{return s.call(this,w,0)}}}function l(w){if(c===clearTimeout)return clearTimeout(w);if((c===d||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(w);try{return c(w)}catch{try{return c.call(null,w)}catch{return c.call(this,w)}}}var p=[],m=!1,g,b=-1;function v(){!m||!g||(m=!1,g.length?p=g.concat(p):b=-1,p.length&&y())}function y(){if(!m){var w=f(v);m=!0;for(var S=p.length;S;){for(g=p,p=[];++b<S;)g&&g[b].run();b=-1,S=p.length}g=null,m=!1,l(w)}}a.nextTick=function(w){var S=new Array(arguments.length-1);if(arguments.length>1)for(var N=1;N<arguments.length;N++)S[N-1]=arguments[N];p.push(new C(w,S)),p.length===1&&!m&&f(y)};function C(w,S){this.fun=w,this.array=S}C.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function F(){}a.on=F,a.addListener=F,a.once=F,a.off=F,a.removeListener=F,a.removeAllListeners=F,a.emit=F,a.prependListener=F,a.prependOnceListener=F,a.listeners=function(w){return[]},a.binding=function(w){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(w){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(n,r,i){(function(a){var s=typeof a=="function",c;s?c=function(u){a(u)}:c=function(u){setTimeout(u,0)},r.exports=c}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,r,i){(function(a,s){var c=n("process/browser.js").nextTick,u=Function.prototype.apply,d=Array.prototype.slice,f={},l=0;i.setTimeout=function(){return new p(u.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new p(u.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(m){m.close()};function p(m,g){this._id=m,this._clearFn=g}p.prototype.unref=p.prototype.ref=function(){},p.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(m,g){clearTimeout(m._idleTimeoutId),m._idleTimeout=g},i.unenroll=function(m){clearTimeout(m._idleTimeoutId),m._idleTimeout=-1},i._unrefActive=i.active=function(m){clearTimeout(m._idleTimeoutId);var g=m._idleTimeout;g>=0&&(m._idleTimeoutId=setTimeout(function(){m._onTimeout&&m._onTimeout()},g))},i.setImmediate=typeof a=="function"?a:function(m){var g=l++,b=arguments.length<2?!1:d.call(arguments,1);return f[g]=!0,c(function(){f[g]&&(b?m.apply(null,b):m.call(null),i.clearImmediate(g))}),g},i.clearImmediate=typeof s=="function"?s:function(m){delete f[m]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Ea);const Ia={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}},Ma={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},Fn=o.defineComponent({name:"Toast",props:Ma,emits:["close","click"],setup:(e,t)=>{const n=o.ref(e.animate),r="fadeOut",i=o.computed(()=>e.options),a=o.ref(!1),s=o.computed(()=>{const y={animated:a.value,toast:!0};return y[e.animate]=!1,y[r]=a.value,y[i.value.type]=!0,i.value.theme&&(y[i.value.theme]=!0),y}),c=o.computed(()=>{const F=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,w={"f-icon":!0};return w[F]=!0,w}),u=o.computed(()=>i.value.title||i.value.message),d=o.computed(()=>i.value.title&&i.value.message),f=o.computed(()=>!i.value.title&&i.value.message),l=o.computed(()=>e.showCloseButton),p=o.computed(()=>!!i.value.buttons||!!t.slots.default);function m(y){y.stopPropagation(),y.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function g(y,C){}function b(y){return`f-preten-link ${y.customClass?y.customClass:""}`}o.watch(n,()=>{n.value});const v=()=>{var y;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((y=i.value.buttons)==null?void 0:y.map(C=>o.createVNode("span",{class:b(C),onClick:F=>void 0},[C.text]))),t.slots.default&&t.slots.default()])])};return()=>o.createVNode("div",{class:s.value},[l.value&&o.createVNode("button",{title:"close",class:"toast-close f-btn-icon f-bare",onClick:m},[o.createVNode("span",{class:"f-icon modal_close"},null)]),u.value&&o.createVNode("section",{class:"modal-tips"},[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:c.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[d.value&&o.createVNode(o.Fragment,null,[o.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:i.value.title},null),o.createVNode("p",{class:"toast-msg",innerHTML:i.value.message},null),p.value&&v()]),f.value&&(i.value.buttons?o.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:i.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[v()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:i.value.message},null))])])])}}),Gt=o.defineComponent({name:"Notify",props:Ia,emits:["close","empty"],setup(e,t){const n=o.computed(()=>({"farris-notify":!0})),r={left:12,right:12,top:20,bottom:12},i=o.ref(),a=o.ref(e.options),s=o.ref(e.showCloseButton),c=o.computed(()=>e.position||"bottom-right"),u=o.computed(()=>e.timeout!=null?e.timeout:3e3),d=o.computed(()=>{const p=e.bottom?e.bottom:r.bottom,m=e.top?e.top:r.top,g={transition:"all 0.2s ease",left:c.value.indexOf("left")>-1?`${e.left?e.left:r.left}px`:"",right:c.value.indexOf("right")>-1?`${e.right?e.right:r.right}px`:"",top:c.value.indexOf("top")>-1?`${m}px`:"",bottom:c.value.indexOf("bottom")>-1?`${p}px`:""};return c.value.indexOf("center")>-1&&(g.left="50%",g.marginLeft="calc(-24rem / 2)",c.value==="center-center"&&(g.top="50%",g.transform="translate(-50%, -50%)")),g});function f(p){t.emit("close")}u.value&&setTimeout(()=>{f()},u.value),t.expose({closeToast:f,container:i,notifyPosition:c});function l(p,m){f()}return()=>o.createVNode("div",{class:n.value,style:d.value,ref:i},[o.createVNode(Fn,{options:a.value,showCloseButton:s.value,animate:e.animate,onClose:p=>l(p,a.value)},null)])}});class _o{constructor(){z(this,"notifyRefs",[]);z(this,"globalConfig",o.reactive({}))}createNotifyInstance(t){const n=this,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0},this.globalConfig,{...t}),a=document.createElement("div");a.style.display="contents";const s=o.createApp({setup(){const c=o.ref();function u(){c.value.container.style.transform="scale(0)",setTimeout(()=>{n.updateNotifyPositionForClose(i,c),s.unmount()},220)}if(i.position.indexOf("top")>-1){const d=n.getNotifyInstances(i.position),f=d[d.length-1];if(f){const l=f.value.container.getBoundingClientRect();i.top=l.bottom}}return o.onUnmounted(()=>{document.body.removeChild(a)}),o.onMounted(()=>{n.updateNotifyPositionForCreate(i,c)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(Gt,o.mergeProps({ref:c},i,{onClose:u}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.mount(a),s}getNotifyInstances(t){return this.notifyRefs.filter(n=>n.value.notifyPosition===t)}updateNotifyPositionForCreate(t,n){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,n]}updateNotifyPositionForClose(t,n){const r=this.notifyRefs.indexOf(n);if(t.position.indexOf("top")>-1){const i=this.getNotifyInstances(t.position),a=i.indexOf(n);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,n){let r="",i="",a,s,c;typeof n=="string"?r=n:n&&(r=n.message||"",i=n.title||"",s=n.position||null,c=n.showCloseButton!=null?n.showCloseButton:null,a=n.timeout!=null?n.timeout:null);const d={options:{type:t,message:r,title:i}};return s!=null&&(d.position=s),c!=null&&(d.showCloseButton=c),a!=null&&(d.timeout=a),d}info(t){const n=this.buildNotifyProps("info",t);return this.show(n)}success(t){const n=this.buildNotifyProps("success",t);return this.show(n)}warning(t){const n=this.buildNotifyProps("warning",t);return this.show(n)}error(t){const n=this.buildNotifyProps("error",t);return this.show(n)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const Oa=Symbol("NOTIFY_SERVICE_TOKEN");Gt.install=e=>{e.component(Gt.name,Gt),e.component(Fn.name,Fn);const t=new _o;e.provide(Oa,t),e.provide("FNotifyService",t)};const No=new Map([["appearance",ht],["column","columnOption"]]);function Ba(e,t,n){var l;const r=n.parentComponentInstance,i=r.schema.type,a=String(((l=r.schema.appearance)==null?void 0:l.class)||"").split(" "),s=i==="section"||i==="tab-page",c=a.includes("f-page-content-nav"),u=a.includes("f-page-main"),d=e.getSchemaByType("component");d.id=`${t.id}-component`,d.componentType="data-grid";let f="";return f+=s?"f-struct-data-grid-in-card f-struct-is-subgrid":"",f+=c?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",f+=u?"f-struct-data-grid f-struct-wrapper":"",d.appearance={class:f},d.contents=[t],d}function Pa(e,t,n){const r=n.parentComponentInstance,i=String(r.schema.appearance.class||"").split(" "),a=i.includes("f-page-content-nav"),s=i.includes("f-page-main"),c=e.getSchemaByType("section");c.id=`${t.id}-section`;let u="";return u+=a?"f-section-in-nav ":"",u+=s?"f-section-in-managelist ":"",u+="f-section-grid",c.appearance={class:u},c.contents=[t],c}function Ra(e,t,n){const r=e.getSchemaByType("content-container");return r.id=`${t.id}-layout`,r.appearance={class:"f-grid-is-sub f-utils-flex-column"},r.contents=[t],r}function Vo(e,t,n){const i=n.parentComponentInstance.schema.type,a=i==="section"||i==="tab-page";t.appearance={class:"f-component-grid"};const c=(a?Ra:Pa)(e,t,n);return Ba(e,c,n)}const ko={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tree-grid.schema.json",title:"tree-grid",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"tree-grid"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},fit:{type:"boolean",default:!1},showStripe:{type:"boolean",default:!0},showBorder:{type:"boolean",default:!1},showTreeNodeIcons:{type:"boolean",default:!1},showSetting:{type:"boolean",default:!1},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},dataSource:{description:"",type:"string",default:""},columns:{description:"",type:"array",default:[]},identifyField:{description:"",type:"string"},editable:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},cell:{type:"object",properties:{highlightFocusingCell:{description:"",type:"boolean",default:!1},mergeCell:{description:"",type:"boolean",default:!1},showEditableIcon:{description:"",type:"boolean",default:!1}}},column:{type:"object",properties:{fitColumns:{description:"",type:"boolean",default:!1},fitMode:{description:"",type:"string",default:"average"},groups:{description:"",type:"array",default:[]},reorderColumn:{description:"Enable to drag column to reorder",type:"boolean",default:!1},resizeColumn:{type:"boolean",default:!0},resizeColumnOnDoubleClick:{description:"",type:"boolean",default:!0}}},command:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},commands:{type:"array",default:[]},commandColumnWidth:{description:"",type:"number",default:120},onClickDeleteCommand:{description:"",type:"string",default:""},onClickEditCommand:{description:"",type:"string",default:""}}},contextMenu:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},customizaiton:{type:"object",properties:{enableScheme:{description:"",type:"boolean",default:!1},enableSetting:{description:"",type:"boolean",default:!1}}},edit:{type:"obejct",properties:{mode:{description:"",type:"string",default:"cell",enum:["cell","row","card"]},selectOnEditing:{description:"",type:"boolean",default:!1},onAppendRow:{description:"",type:"string",default:""},onBeforeEdit:{description:"",type:"string",default:""}}},filter:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},filterStyle:{description:"",type:"string",default:"filter-column",enum:["filter-column","filter-row"]},mode:{description:"",type:"string",default:"server",enum:["client","server"]},showSummary:{description:"",type:"boolean",default:!0},onFilterChange:{description:"",type:"string",default:""}}},footer:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customFooterStyle:{description:"",type:"object"},footerDataCommand:{description:"",type:"string",default:""},footerDataFrom:{description:"",type:"string",default:"client"},footerHeight:{description:"",type:"number",default:29},footerPosition:{description:"",type:"string",default:"bottom"},footerTemplate:{description:"",type:"string",default:""}}},group:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customGroupRow:{description:"",type:"object"},customGroupRowStyle:{description:"",type:"obejct"},customSummaryStyle:{description:"",type:"obejct"},groupColSpan:{description:"",type:"number",default:1},groupFields:{description:"",type:"array",default:[]},showGroupedColumn:{description:"",type:"boolean",default:!0},showGroupPanel:{description:"",type:"boolean",default:!1},showSummary:{description:"",type:"boolean",default:!1},summaryPosition:{description:"",type:"string",default:"separate",enum:["separate","merge-to-group"]},disableGroupOnEditing:{description:"",type:"boolean",default:!0},expandGroupRows:{description:"",type:"boolean",default:!0}}},header:{type:"object",properties:{wrapHeadings:{description:"",type:"boolean",default:!1}}},pagination:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},disablePagination:{description:"",type:"string",default:""},contentTemplate:{description:"",type:"string",default:""},index:{description:"",type:"number",default:1},mode:{description:"",type:"string",default:"server",enum:["server","client"]},showGoto:{description:"",type:"boolean",default:!1},showIndex:{description:"",type:"boolean",default:!0},showLimits:{description:"",type:"boolean",default:!1},showPageInfo:{description:"",type:"boolean",default:!0},size:{description:"",type:"number",default:20},sizeLimits:{description:"",type:"array",default:[10,20,30,50,100]},onPageChange:{description:"",type:"string",default:""},onPageSizeChange:{description:"",type:"string",default:""}}},row:{type:"object",properties:{customRowStyle:{description:"",type:"object"},disable:{description:"",type:"obejct"},height:{description:"",type:"number",default:30},showHovering:{type:"boolean",default:!0},wrapContent:{type:"boolean",default:!1}}},rowNumber:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},heading:{description:"",type:"string",default:"序号"},width:{description:"",type:"number",default:36},onClickRow:{description:"",type:"string",default:""},onDoubleClickRow:{description:"",type:"string",default:""}}},selection:{type:"object",properties:{enableSelectRow:{description:"允许选中行",type:"boolean",default:!0},enable:{description:"",type:"boolean",default:!0},checkOnSelect:{description:"",type:"boolean",default:!1},clearSelectionOnEmpty:{description:"",type:"boolean",default:!0},customSelectionItem:{description:"",type:"object"},focusSelection:{description:"",type:"string",default:"current",enum:["current","all"]},keepSelectingOnClick:{description:"",type:"boolean",default:!0},keepSelectingOnPaging:{description:"",type:"boolean",default:!0},multiSelect:{description:"",type:"boolean",default:!1},selectionMode:{description:"",type:"string",default:"default"},selectOnCheck:{description:"",type:"boolean",default:!1},selectOnEditing:{description:"",type:"boolean",default:!1},showCheckbox:{description:"",type:"boolean",default:!1},showCheckAll:{description:"",type:"boolean",default:!1},showSelection:{description:"",type:"boolean",default:!1},onBeforeSelect:{description:"",type:"string",default:""},onBeforeUnCheck:{description:"",type:"",default:""},onBeforeUnSelect:{description:"",type:"string",default:""},onCheckAll:{description:"",type:"string",default:""},onChecked:{description:"",type:"string",default:""},onSelectionChange:{description:"",type:"string",default:""},onUnCheckAll:{description:"",type:"string",default:""},onUnChecked:{description:"",type:"string",default:""},onCheckedChange:{description:"",type:"string"}}},sort:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},fields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},multiSort:{description:"",type:"boolean",default:!1}}},summary:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customSummaryStyle:{description:"",type:"object"},groupFields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},position:{description:"",type:"boolean",default:"bottom",enum:["bottom","top","both"]}}},toolbar:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},visualization:{autoHeight:{description:"",type:"boolean",default:!1},emptyDataHeight:{description:"",type:"number",default:36},emptyTemplate:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:300},scrollBarShowMode:{description:"",type:"string",default:"auto"},showBorder:{description:"",type:"boolean",default:!1},showScrollArrow:{description:"",type:"boolean",default:!1},striped:{description:"",type:"boolean",default:!0},useBlankWhenDataIsEmpty:{description:"",type:"boolean",default:!1}},onSelectionChange:{description:"行切换事件",type:"string",default:""}},required:["id","type","columns"]},Tn={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:{autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},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,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:32,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},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}},ja=Ue(Tn,ko,No,Vo),$a=pa(),Da=fa(),Eo=Object.assign({},Tn,{componentId:{type:String,default:""}}),Aa=Ue(Eo,ko,No,Vo),La=ma();var Qe=(e=>(e[e.readonly=0]="readonly",e[e.editable=1]="editable",e[e.editing=2]="editing",e))(Qe||{}),it=(e=>(e[e.initial=0]="initial",e[e.editing=1]="editing",e))(it||{}),It=(e=>(e[e.data=0]="data",e[e.group=1]="group",e[e.summary=2]="summary",e))(It||{}),De=(e=>(e[e.none=0]="none",e[e.filterable=1]="filterable",e[e.sortable=2]="sortable",e[e.filtered=4]="filtered",e[e.sorted=8]="sorted",e[e.ascending=16]="ascending",e[e.descending=32]="descending",e))(De||{}),_n=(e=>(e.NONE="none",e.NUMBER="number",e.DATE="date",e.TEXT="boolean",e.IMAGE="boolean2",e.ENUM="enum",e.CUSTOM="custom",e))(_n||{});function qa(e,t){var m;const n=String(Date.now()),r=((m=e.rowOption)==null?void 0:m.height)||28,i=o.ref(t.value.primaryColumnsWidth);function a(g){const b={};return g.reduce((v,y,C)=>{const F=C<g.length-1?g[C+1]:null;return C===0&&(v[y.field]={left:0}),y.actualWidth!==void 0&&(v[y.field].width=y.actualWidth),F&&(v[F.field]={left:v[y.field].left+(y.actualWidth||0)}),v},b),b}function s(g,b,v){const y=r*(v+1),F=b[g.field].left-y+(b[g.field].width||0),w=g.parent.height?`${g.parent.height}px`:"";return{left:`${y}px`,width:`${F}px`,height:`${w}`}}function c(g,b,v){return{right:"0px",height:`${g.parent.height?`${g.parent.height}px`:""}`}}function u(g,b){const v=g.parent.height?`${g.parent.height}px`:"";return{left:`${b[g.field].left}px`,height:`${v}`,width:isNaN(Number(b[g.field].width))?"100%":`${b[g.field].width}px`}}function d(g,b,v){const C=(b.spanned||[]).reduce((w,S)=>w+(S.parent.height||0),0)+(g.height||0);return{top:`${g.top}px`,left:`${v[b.field].left}px`,width:`${v[b.field].width}px`,height:`${C}px`,padding:`calc(${C/2}px - 1rem) 0`}}function f(g,b){return`${n}_${g.type}_r_${g.index}_c_${b}_${g.refreshKey||""}`}function l(g){return`${n}_${g.type}_r_${g.index}_${g.refreshKey||""}`}function p(g){const b=g.height?`${g.height}px`:"";return{top:`${g.top}px`,width:isNaN(i.value)?"100%":`${i.value}px`,height:`${b}`}}return o.watch(t,()=>{i.value=t.value.primaryColumnsWidth}),{calculateCellPositionInRow:a,cellKey:f,cellPosition:u,groupCellPosition:s,rowKey:l,rowPosition:p,rowSpanCellPosition:d,summaryCellPosition:c}}function Ha(e,t,n){const{hasChildrenField:r}=n,i=o.ref("#9399a0"),a=o.ref(28);function s(){return[].concat(...t.value.filter(p=>p.raw.__fv_descendant_index__.length!==0).map(p=>[...p.raw.__fv_descendant_index__.slice(-1)]).flat()).sort((p,m)=>Number(p)-Number(m))}function c(f){const l=new Array(t.value.length).fill(0);if(e.showLines){const p=s();t.value.forEach((m,g)=>{const b=p.includes(g),v=m.raw[r.value];l[g]=`repeating-linear-gradient(90deg, ${i.value} 0 1px, transparent 0px 2px) ${v?"-10px":"0px"} ${a.value/2}px/20px 1px no-repeat,repeating-linear-gradient(${i.value} 0 1px, transparent 0px 2px) 0px 0px/1px ${b?"50%":"100%"} no-repeat`}),l[0]=""}return l[f]}function u(f,l,p){return p[f].parents.set(f,!0).forEach(g=>{p[g].childsLength=p[g].childWithLines.filter(b=>l[b].visible).length}),l}function d(f){const m=f.raw.__fv_parent_index__===void 0||f.raw.__fv_parent_index__===-1?0:8,g=0,b=f.raw[r.value],v=f.visible?{left:`${f.layer*10+f.layer*m+g}px`,background:c(f.index),display:"flex",width:"100%",position:"relative",paddingLeft:"0.75rem"}:{display:"none"};return b||(v.paddingLeft="2rem"),v}return{hierarchyCellContentStyle:d,handleCollapsedPaddingBottom:u}}function Wa(e,t,n){const r=o.ref(e.iconField);function i(a,s){if(r.value)return a.raw[e.iconField];let c="";return a.raw[n.value]!==!0?c=t.value.leafnodes:c=a.collapse?t.value.fold:t.value.unfold,c}return{treeNodeIconsClass:i}}function Ua(e,t,n,r,i,a,s,c){const{dataView:u,fold:d,hasRealChildren:f,unFold:l,reOrderVisibleIndex:p}=r,{collapseField:m,hasChildrenField:g}=i,{reCalculateVisualDataRows:b,updateVirticalScroll:v}=a;function y(w,S){var x,k;const N=S[w],h=N.__fv_parents__?(x=N.__fv_parents__)==null?void 0:x.size:0;let _=w+1;for(;_<S.length;){const T=S[_];if((T.__fv_parents__?(k=T.__fv_parents__)==null?void 0:k.size:0)>h)_++;else break}return _-1}function C(w,S){const N=u.value[w];N[m.value]=!N[m.value],N[g.value]=f(N);const h=N[m.value];let _=!1,x=w;for(;x<u.value.length;){const k=u.value[x];if((typeof k.__fv_parent_index__=="number"?Number(k.__fv_parent_index__):-1)>S)k.__fv_visible__=!h,k[m.value]&&(x=y(x,u.value)),_=!0;else if(_){x++;break}x++}p()}function F(w){if(w.raw[g.value]){const N=typeof w.raw.__fv_parent_index__=="number"?Number(w.raw.__fv_parent_index__):-1,h=Number(w.raw.__fv_index__);C(h,N),b(),v()}t.emit("expandNode",{row:w})}return{toggleTreeNode:F}}function za(e,t,n,r,i,a,s,c,u,d,f,l,p){const{onClickCell:m}=a,{gridRowClass:g,onClickRow:b,onMouseoverRow:v,onMouseoutRow:y}=c,{enableMultiSelect:C,select:F,unSelect:w,selectItem:S}=u;o.ref(e.cellHeight);const N=o.ref(e.treeNodeIconsData||{}),{hasChildrenField:h,shouldShowCheckBox:_,shouldShowIcon:x}=s,{toggleTreeNode:k}=Ua(e,t,r,i,s,f),{toggleSelectHierarchyItem:T}=d,{cellKey:V,cellPosition:I,rowKey:E,rowPosition:M}=qa(e,n),{hierarchyCellContentStyle:B}=Ha(e,r,s),{treeNodeIconsClass:O}=Wa(e,N,h);function R(A,Y){const we=A.raw[h.value];return{"fv-tree-node-toggle":we&&A.collapse,"fv-tree-node-toggle-minus":we&&!A.collapse}}function q(A,Y){A.stopPropagation(),k(Y)}function L(A,Y){return o.createVNode("div",{class:R(A),onClick:we=>q(we,A)},null)}function X(A,Y){return x.value&&o.createVNode("div",{id:"treeNodeIcons",class:O(A,Y)},null)}function te(A){C.value?(A.checked?F(A):w(A),T(A)):S(A)}function ie(A,Y){return _.value&&o.createVNode(Et.FCheckbox,{id:"checkbox_for_"+V(A,Y.index),indeterminate:A.indeterminate,disabled:A.disabled,checked:A.checked,"onUpdate:checked":we=>A.checked=we,onChange:()=>te(A)},null)}function ue(A,Y){return o.createVNode("span",{title:Y.data},[Y.mode===Qe.editing?Y.getEditor(Y):Y.formatter?Y.formatter(Y,A):Y.data!=null?Y.data.toString():Y.data])}function $(A,Y,we){return o.createVNode("div",{ref:Y.setRef,key:V(A,Y.index),class:"fv-grid-hierarchy-cell",style:I(Y,we)},[o.createVNode("div",{style:B(A)},[L(A),X(A,Y),ie(A,Y),ue(A,Y)])])}function ne(A,Y,we){return o.createVNode("div",{ref:Y.setRef,key:V(A,Y.index),class:"fv-grid-cell",style:I(Y,we),onClick:Ce=>m(Ce,Y,A,Y.column)},[t.slots.cellTemplate?t.slots.cellTemplate({cell:Y,row:A}):Y.mode===Qe.editing?Y.getEditor(Y):Y.formatter?Y.formatter(Y,A):Y.data!=null?Y.data.toString():Y.data])}function pe(A,Y){return Y==="left"&&n.value.leftColumns.length>0&&n.value.leftColumns[0].field===A.field||Y==="primary"&&n.value.primaryColumns.length>0&&n.value.primaryColumns[0].field===A.field}function oe(A,Y,we="primary"){return o.createVNode("div",{ref:A.setRef,key:E(A),class:g(A),style:M(A),onMouseover:Ce=>v(Ce,A),onMouseout:Ce=>y(Ce,A),onClick:Ce=>b(Ce,A)},[Object.values(A.data).filter(Ce=>Y[Ce.field]&&Ce.rowSpan===1).map(Ce=>pe(Ce,we)?$(A,Ce,Y):ne(A,Ce,Y))])}return{renderDataRow:oe}}function Ga(e,t,n){const{horizontalScrollThumbStyle:r,onMouseDownScrollThumb:i,shouldShowHorizontalScrollbar:a}=n;function s(){return a.value&&o.createVNode("div",{class:"fv-grid-horizontal-scroll"},[o.createVNode("div",{class:"fv-grid-horizontal-scroll-thumb",style:r.value,onMousedown:c=>i(c,t,"horizontal")},null)])}return{renderHorizontalScrollbar:s}}function Xa(){function e(r,i){switch(r.command){case"edit":case"remove":return i.status===it.initial;case"accept":case"cancel":return i.status===it.editing;default:return!r.hidden}}function t(r,i,a){switch(r.onClick(i,a.dataIndex,a),r.command){case"edit":a.status,it.editing;break;case"accept":case"cancel":a.status,it.initial;break}}function n(r,i){return o.createVNode("div",null,[r.commands&&r.commands.map(a=>e(a,i)&&o.createVNode(o.resolveComponent("f-button"),{class:"ml-2",type:a.type,size:a.size||"small",onClick:s=>t(a,s,i)},{default:()=>[o.createTextVNode(" "),a.text,o.createTextVNode(" ")]}))])}return{renderCommandColumn:n}}function Ya(e){const t=o.ref(e.minHeight),n=o.ref(e.minWidth),r=o.ref(e.height),i=o.ref(e.width),a=o.computed(()=>r.value<=0?0:Math.max(r.value,t.value)),s=o.computed(()=>i.value<=0?0:Math.max(i.value,n.value));return o.watch([()=>e.height,()=>e.width,()=>e.minHeight,()=>e.minWidth],([u,d,f,l])=>{t.value=Number(f),n.value=Number(l),r.value=Number(u),i.value=Number(d)}),{containerStyleObject:o.computed(()=>({height:a.value>0?`${a.value}px`:e.fit?"100%":"",width:s.value>0?`${s.value}px`:e.fit?"100%":"",flex:"1 1 0"}))}}const Ja="";function Qa(e){const n={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]},r=o.ref(n);function i(){r.value={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]}}const a=o.ref(e.summary),s=o.computed(()=>{const F=a.value;return(F==null?void 0:F.groupFields)||[]});function c(){r.value.rightColumns.forEach(S=>{S.showSetting=!1}),r.value.primaryColumns.forEach(S=>{S.showSetting=!1});const F=r.value.rightColumns.filter(S=>S.visible),w=r.value.primaryColumns.filter(S=>S.visible);F.length>0?F[F.length-1].showSetting=!0:w.length>0&&(w[w.length-1].showSetting=!0)}function u(F){i();const w=new Map;return s.value&&s.value.reduce((S,N)=>(S.set(N,!0),S),w),F.reduce((S,N)=>(N.visible=N.visible!==!1,N.filter=N.filter||Ja,N.fixed==="left"?(r.value.leftColumns.push(N),r.value.leftColumnsMap.set(N.field,N),r.value.leftColumnsWidth+=N.actualWidth):N.fixed==="right"?(r.value.rightColumns.push(N),r.value.rightColumnsMap.set(N.field,N),r.value.rightColumnsWidth+=N.actualWidth):(r.value.primaryColumns.push(N),r.value.primaryColumnsMap.set(N.field,N),r.value.primaryColumnsWidth+=N.actualWidth),w.has(N.field)&&r.value.summaryColumns.push(N),S),r),c(),r}u(e.columns);const d=o.computed(()=>r.value.leftColumns.length>0),f=o.computed(()=>r.value.rightColumns.length>0);function l(F,w){return w.sortable&&w.sort&&w.sort!=="none"&&F.push(w),F}function p(F,w){return F.sortOrder=F.sortOrder||0,w.sortOrder=w.sortOrder||0,F.sortOrder===w.sortOrder?0:F.sortOrder<w.sortOrder?-1:1}function m(F,w){return F.sortOrder=F.sortOrder||0,w.sortOrder=w.sortOrder||0,F.sortOrder===w.sortOrder?0:F.sortOrder<w.sortOrder?1:-1}function g(F,w){return w.filterable&&F.push(w),F}function b(){const F=[];return r.value.leftColumns.reduce(g,F),r.value.primaryColumns.reduce(g,F),r.value.rightColumns.reduce(g,F),F}function v(){const F=[];r.value.leftColumns.reduce(l,F),r.value.primaryColumns.reduce(l,F),r.value.rightColumns.reduce(l,F);const w=Math.max(...F.map(S=>S.sortOrder||0));return F.sort(m).map(S=>{const N=S.sortOrder||w+1;return S.sortOrder=N,S}).sort(p).map((S,N)=>{const h=N+1;return S.sortOrder=h,S})}function y(F,w,S){const N=F.map(h=>{const _=S.getSorterByColumn(h),x=h.sort==="asc",k=h.sort==="desc",T=x?_.ascend:k?_.decend:void 0;return{field:h.field,compare:T}});w.setSorters(N)}function C(F,w){const S=v();y(S,F,w)}return{applyColumnSorter:C,collectionFilterableColumns:b,applySortableColumns:y,collectionSortableColumns:v,columnContext:r,hasLeftFixedColumn:d,hasRightFixedColumn:f,updateColumnRenderContext:u,updateColumnSettingIcon:c}}o.ref([{name:"七天",selectable:!0},{name:"一个月",selectable:!0},{name:"三个月",selectable:!0},{name:"半年",selectable:!0}]);function Ka(e){const n=o.ref(e.commandOption.enable||!1),r=o.ref(e.commandOption.commands||[]);function i(a){if(n.value&&!(a.value.findIndex(c=>c.dataType==="commands")>-1)){const c={field:"__commands__",title:"操作",width:120,fixed:"right",dataType:"commands",commands:r.value,visible:!0};a.value.push(c)}}return{applyCommands:i}}function Za(e,t){var d;const n=o.ref((d=e.columnOption)==null?void 0:d.groups);function r(f,l,p,m,g){const b={actualWidth:0,children:[],depth:1,field:f.field,layer:1,left:0,parent:p,resizable:!0,title:f.title||"",status:De.none,popoverRef:o.ref(),showPopover:!1,column:null,sortType:"none"},v=m||b;if(f.group){let y=1;f.group.reduce((C,F)=>{if(typeof F=="string"){const w=l.get(F);w&&(g.fieldToRootMap.set(F,v),C.actualWidth+=w.actualWidth,C.children.push(w))}else{const w=r(F,l,C,v,g);y=Math.max(y,w.depth),C.actualWidth+=w.actualWidth,C.children.push(w)}return C},b),b.depth+=y}return t.value.headerDepth=Math.max(t.value.headerDepth,b.depth),b}function i(f){const l={groupedCells:new Map,fieldToRootMap:new Map};return n.value&&n.value.reduce((p,m)=>{const g=r(m,f,null,null,l);return p.groupedCells.set(m.field,g),p},l),l}function a(f){if(!f||f.length===0)return 0;const l=f[0];return l.children&&l.children.length>0&&(l.left=a(l.children)),l.left}function s(f,l){const p=t.value.headerDepth;f.forEach(m=>{m.layer=l?l.layer+1:1;const g=m.children&&m.children.length===0;m.depth=g?p-(m.layer-1):1,m.left=g?m.left:a(m.children),m.children&&s(m.children,m)})}function c(f,l){const p=new Map;return f.forEach(m=>{const g=l.fieldToRootMap.get(m.field),b=g!=null;b&&!p.has(g.field)&&p.set(g.field,g),b||p.set(m.field,m)}),s(Array.from(p.values())),p}function u(f){let l=new Map,p=0;if(f.reduce((m,g)=>{let b=De.none;b=g.filterable?b|De.filterable:b,b=g.sort&&g.sort!=="none"?b|De.sorted|(g.sort==="asc"?De.ascending:De.descending):b;const v=g.field;return m.set(v,{actualWidth:g.actualWidth||0,children:[],depth:1,layer:1,left:p,field:v,parent:null,resizable:g.resizable===void 0?!0:g.resizable,title:g.title,status:b,popoverRef:o.ref(),showPopover:!1,column:g,filterValue:null,sortType:g.sort||"none",showSetting:g.showSetting}),p+=g.actualWidth||0,m},l),n.value){const m=i(l);l=c(l,m)}return l}return{getGridHeaderCells:u}}function es(e,t){var y;const{idField:n}=t,r=o.ref(e.summary),i=o.ref(e.group),a=o.ref(((y=e.group)==null?void 0:y.groupFields)||[]),s=o.computed(()=>{var C;return(C=e.group)==null?void 0:C.enable}),c=o.computed(()=>{var C;return(C=e.group)==null?void 0:C.showGroupPanel}),u=o.computed(()=>{const C=r.value;return(C==null?void 0:C.groupFields)||[]}),d=o.computed(()=>{const C=i.value;return C&&C.showSummary}),f=new Map;let l=[];function p(C,F,w,S,N){const h=S[w];h&&(F.reduce((_,x,k)=>{var I;const T=x[h];let V=_.get(T);if(!V){const E=u.value.reduce((M,B)=>(M.set(B,0),M),new Map);V={field:h,title:((I=N.get(h))==null?void 0:I.title)||h,value:T,layer:w,details:[],groupSummaries:E},_.set(T,V)}return u.value&&u.value.forEach(E=>{if(V){const M=V.groupSummaries.get(E)||0;V.groupSummaries.set(E,M+x[E])}}),V.details.push(x),_},C),w<S.length-1&&C.forEach((_,x)=>{_.nestGroup=new Map,p(_.nestGroup,_.details,w+1,S,N),_.details=[]}))}function m(C,F){return e.group&&e.group.formatter?e.group.formatter(C.value,{...C,total:F}):`${C.title}:${C.value} (${F})`}function g(C){const F=[];return C.forEach(w=>{const S={__fv_data_grid_group_collapse__:!1,__fv_data_grid_group_field__:w.field,__fv_data_grid_group_layer__:w.layer,__fv_data_grid_group_row__:!0,__fv_data_grid_group_value__:w.value};let N=0;if(F.push(S),w.nestGroup){const h=g(w.nestGroup);F.push(...h),N+=h.length}if(w.details&&w.details.length&&(F.push(...w.details),N+=w.details.length),d.value){const h={__fv_data_grid_group_field__:w.field,__fv_data_grid_group_layer__:w.layer,__fv_data_grid_group_summary__:!0};h[n.value]=`summary_of_${w.field}_${w.value}`,h[w.field]=Array.from(w.groupSummaries.entries()).reduce((_,[x,k])=>`${_} ${x} total:${k} `,""),F.push(h)}w.groupSummaries&&w.groupSummaries.size&&w.groupSummaries.forEach((h,_)=>{S[_]=h}),S[n.value]=`group_of_${w.field}_${w.value}`,S[w.field]=m(w,N)}),F.forEach((w,S)=>{w.__fv_data_index__=S}),F}function b(C,F,w){return!C||C.length===0||!F.length?F:(C.join(","),f.clear(),l=[],F=F.filter(S=>!S.__fv_data_grid_group_row__),p(f,F,0,C,w),l=g(f),l)}function v(C){return{"f-icon":!0,"f-icon-arrow-chevron-down":!0,"fv-grid-group-row-icon-collapse":C.collapse}}return{collpaseGroupIconClass:v,generateGroupData:b,groupFields:a,shouldGroupingData:s,showGroupPanel:c}}function ts(e,t,n,r){const i=o.ref(!!e.hierarchy),{idField:a}=r,{collapseField:s,hasChildrenField:c,parentIdField:u}=n,d=new Map;function f(V,I){const E=new Map;return V.reduce((M,B)=>{const O=B[u.value]!==void 0?B[u.value]:"";if(O&&I.has(O)){const q=I.get(O);B.__fv_parent_index__=q.__fv_index__,q.__fv_hasChildren__=!0}const R=M.has(O)?M.get(O):[];return R.push(B),M.set(O,R),M},E),E}function l(V){const I=new Map;return V.reduce((E,M)=>{const B=M[a.value];return E.set(B,M),E},I),I}function p(V){V.forEach(I=>{const E=I[a.value];I.__fv_children_index__.map(B=>V[B]).forEach(B=>{B.__fv_parents__=new Map([...I.__fv_parents__.entries(),[E,!0]])})})}function m(V){V.forEach(I=>{const E=new Set(I.__fv_children_index__);I.__fv_children_index__=[...E].sort((M,B)=>M-B)})}function g(V,I){V.forEach(E=>{const M=E.__fv_parents__;Array.from(M.keys()).map(B=>I.get(B)).forEach(B=>{B.__fv_children_index__.push(E.__fv_index__)})}),m(V)}function b(V){V.forEach(I=>{I.__fv_child_with_lines__=[],I.__fv_child_length__=I.__fv_descendant_index__.length,I.__fv_descendant_index__.map(E=>V[E]).reduce((E,M)=>(E.__fv_child_length__+=M.__fv_children_index__.length,E.__fv_child_with_lines__.push(...M.__fv_children_index__,M.__fv_index__),E),I)})}function v(V,I){return{id:V,index:I,parentId:"",parentIndex:-1,parents:new Map,children:new Map,descendant:new Map}}function y(V,I){Array.from(I.keys()).forEach(E=>{I.get(E).reduce((B,O)=>{const R=O[a.value],q=V.get(O[a.value]),L=V.get(E);return L&&(L.children.set(R,q),L.children.set(R,q),q.parentId=E,q.parentIndex=L.index,q.parents.set(E,L)),B},V)})}function C(V){V.children.forEach(E=>{E.parents=new Map([...V.parents.entries(),[V.id,V]]),C(E)})}function F(V,I){V.filter(E=>E[u.value]===void 0||E[u.value]==="").forEach(E=>{const M=E[a.value],B=I.get(M);C(B)})}function w(V){Array.from(V.values()).forEach(I=>{Array.from(I.parents.values()).forEach(E=>{E.descendant.set(I.id,I)})})}function S(V){d.clear(),V.forEach((M,B)=>{const O=M[a.value];d.set(O,v(O,B))});const I=l(V),E=f(V,I);return y(d,E),F(V,d),w(d),d}function N(V){const I=V[a.value],E=d.get(I);return E&&E.children.size>0}function h(V){return V[c.value]&&!N(V)}function _(V){S(t.value);const I=l(V),E=f(V,I);return V.forEach((M,B)=>{var L;const O=M[a.value],R=E.has(O)?(L=E.get(O))==null?void 0:L.map(X=>X.__fv_index__):[],q=v(O,B);M.__fv_graph_node__=q,M.__fv_children_index__=R,M.__fv_descendant_index__=[...R],M.__fv_parents__=new Map,h(M)&&(M[s.value]=!0)}),p(V),g(V,I),e.showLines&&b(V),V}function x(V,I,E){const B=E.value[V][a.value],O=d.get(B);if(O){const R=d.get(O.parentId);let q=E.value.length-1;if(R){const L=Array.from(R.children.keys()).indexOf(O.id);if(L===R.children.size-1){const te=Array.from(R.descendant.values())[R.descendant.size-1];q=E.value.findIndex(ue=>ue[a.value]===te.id)+1}else{const te=Array.from(R.children.values())[L+1];q=E.value.findIndex(ue=>ue[a.value]===te.id)}I[c.value]=!1,I[u.value]=R.id,E.value.splice(q,0,I)}}}function k(V,I,E){const M=E.value[V],B=M[a.value];if(d.get(B)){const q=E.value.findIndex(L=>L[a.value]===B)+1;M[c.value]=!0,M[s.value]=!1,I[c.value]=!1,I[u.value]=B,E.value.splice(q,0,I)}}function T(V,I){const E=V[a.value],M=d.get(E),B=Array.from(M.descendant.keys());B.unshift(E);const O=d.get(M.parentId);if(O&&(O.children.delete(E),O.children.size===0)){const q=I.find(L=>L[a.value]===M.parentId);q[c.value]=!1,q[s.value]=!1}return I.filter(q=>B.indexOf(q.id)===-1)}return{generateHierarchyData:_,hasRealChildren:N,insertSibling:x,insertChild:k,shouldStratifyData:i,trimmedOriginalData:T}}function ns(e,t,n,r,i){var pt;const a=new Map,s=new Map,c=new Map,u=new Map,d=new Map,f=o.ref([]),l=o.ref([]),p=es(e,i),{generateGroupData:m,groupFields:g,shouldGroupingData:b}=p,v=o.ref(e.data),y=ts(e,v,r,i),{generateHierarchyData:C,hasRealChildren:F,insertSibling:w,insertChild:S,shouldStratifyData:N,trimmedOriginalData:h}=y,{idField:_,reviseIdentifyField:x}=i,k=o.ref(e.newDataItem),T=o.ref(e.data||[]),V=o.ref(e.data),{flatTreeData:I}=Ms(e);function E(P){return I(P)}if(e.data&&((pt=e.data[0])!=null&&pt.children)){const P=E(e.data);v.value=P,T.value=P,V.value=P}const M=o.ref(e.summary),B=o.computed(()=>{const P=M.value;return(P==null?void 0:P.groupFields)||[]});let O=new Map;const R=o.ref(T.value.length),q=o.ref(e.pagination);function L(){return q.value&&q.value.enable&&q.value.size>0?q.value.size:T.value.length}const X=o.ref(1),te=o.computed(()=>q.value&&q.value.enable&&q.value.mode==="client"),ie=new _o;function ue(){var Oe;T.value=v.value,te.value&&(R.value=T.value.length),b.value&&(T.value=m(g.value,v.value,t)),O=B.value.reduce((Ve,ke)=>(Ve.set(ke,0),Ve),O);const P=0,W=L(),K=(X.value-1)*W,xe=K>T.value.length-1?P:K,Re=Math.min(xe+W,T.value.length);let Ee=0;const Fe=[];if(T.value.length){x(T.value);const Ve=_.value!==e.idField;for(let ke=xe;ke<Re;ke++){const Ie=T.value[ke];Ie.__fv_data_grid_group_row__?(Ee=0,Ie.__fv_data_index__=""):Ie.__fv_data_grid_group_summary__?Ie.__fv_data_index__="":(Ee++,Ie.__fv_data_index__=Ee+(X.value-1)*W),Ie.__fv_index__=ke,Ie.__fv_visible_index__=ke,e.rowOption&&e.rowOption.disabledField&&(Ie.__fv_disabled__=Ie[(Oe=e.rowOption)==null?void 0:Oe.disabledField]),Ve&&(Ie[_.value]=ke),B.value.forEach(Ye=>{const kt=O.get(Ye)||0;O.set(Ye,kt+Ie[Ye])}),Fe.push(Ie)}}return N.value&&C(Fe),V.value=[...Fe],Fe}const $=o.ref(ue()),ne=o.computed(()=>$.value.filter(P=>P.__fv_visible__!==!1));function pe(){ne.value.forEach((P,W)=>(P.__fv_visible_index__=W,P))}function oe(P,W,K=!1){const xe=(K?ue():[...V.value]).filter(Fe=>n.apply(Fe)),Re=P&&P.length?xe.filter(Fe=>P.reduce((Oe,Ve)=>Oe&&Ve.filter(Fe),!0)):xe,Ee=W&&W.length?Re.sort((Fe,Oe)=>{const Ve=[...W],ke=Ve.shift();let Ie=ke.compare(Fe[ke.field],Oe[ke.field]);for(;Ie===0&&Ve.length!==0;){const Ye=Ve.shift();Ye&&(Ie=Ye.compare(Fe[Ye.field],Oe[Ye.field]))}return Ie}):Re;return $.value=Ee.map((Fe,Oe)=>{if(Fe.__fv_data_grid_group_row__){const Ve=`group_of_${Fe.__fv_data_grid_group_field__}_${Fe.__fv_data_grid_group_value__}`;Fe.__fv_data_grid_group_collapse__=!!a.get(Ve)}return Fe.__fv_index__=Oe,Fe.__fv_visible_index__=Oe,Fe}),$.value}function A(P){return d.clear(),l.value=P,l.value.reduce((W,K)=>(W.set(K.field,K),W),d),oe([],l.value)}function Y(P,W){return d.set(P,W),l.value=Array.from(d.values()),oe([],l.value)}function we(P){return d.delete(P),l.value=Array.from(d.values()),oe([],l.value)}function Ce(P,W){return s.set(P,W),f.value=Array.from(s.values()),oe([],Array.from(d.values()))}function je(P){return s.delete(P),f.value=Array.from(s.values()),oe([],Array.from(d.values()),!0)}function $e(){return s.clear(),f.value=[],oe([],Array.from(d.values()),!0)}function Be(P,W){const K=`group_of_${P}_${W}`;a.set(K,!0);const ve=xe=>xe[P]!==W;return c.set(`collapse_${P}_${W}`,{field:P,fieldName:P,fieldType:"string",filterValue:W,filter:ve}),oe(Array.from(c.values()),Array.from(d.values()))}function me(P,W){const K=`group_of_${P}_${W}`;return a.set(K,!1),c.delete(`collapse_${P}_${W}`),oe(Array.from(c.values()),Array.from(d.values()),!0)}function G(P){const W=P.raw[_.value],K=ve=>!ve.__fv_parents__.has(W);u.set(`fold_${W}`,{field:"id",fieldName:"id",fieldType:"string",filterValue:String(W),filter:K}),oe(Array.from(u.values()),Array.from(d.values())),C($.value)}function Q(P){const W=P[_.value];u.delete(`fold_${W}`)}function ee(P){Q(P.raw),oe(Array.from(u.values()),Array.from(d.values()),!0),C($.value)}function re(){const P=ue();$.value=P,e.hierarchy&&(oe(Array.from(u.values()),Array.from(d.values())),C($.value))}function U(P){const K=P&&P.length&&P[0].children?E(P):P;v.value=K,re()}function ge(P,W,K){return(P&&P.length?$.value.filter((xe,Re)=>P.reduce((Ee,Fe)=>Ee&&Fe.filter(xe),!0)):$.value).slice(W,K)}function Pe(P){const W=L(),K=P*W;0<K&&K<=R.value&&(X.value=P,re())}function Xe(P){v.value.push(be.cloneDeep(P)),$.value=ue()}function st(P=0){if(!(P>-1))return!1;const K=k.value();e.hierarchy?w(P,K,v):v.value.splice(P,0,K),re()}function Ke(P=0){if(!(P>-1&&e.hierarchy))return!1;const K=k.value(),ve=v.value[P];Q(ve),S(P,K,v),re()}function Ze(P){const W=P?P-1:0;v.value.splice(W,1),re()}function et(P){const W=v.value.findIndex(K=>K[_.value]===P);W!==-1&&(v.value.splice(W,1),re())}function lt(P){const W=P>-1?v.value[P]:null;if(!(W&&W.deletable!==!1))return!1;v.value=h(W,v.value),re()}function ct(){const P=c.size>0?Array.from(c.values()):[];return oe(P,Array.from(d.values()))}function ot(P){q.value&&(q.value.size=P,re())}function dt(P,W){const K=v.value[Number(P)-1];K.editable!==!1?(K.name=W,re()):ie.show({showCloseButton:!1,timeout:3e3,animate:"fadeIn",toasts:[{type:"string",title:"提示",msg:"当前节点禁止编辑"}]})}function ft(P){return P.map(K=>{const ve=V.value.findIndex(xe=>xe[_.value]===K);return ve>-1?V.value[ve]:null}).filter(K=>K!=null)}return{addFilter:Ce,addNewDataItem:Xe,addSorter:Y,changePageSizeTo:ot,collapse:Be,dataView:$,editDataItem:dt,expand:me,filters:f,fold:G,getRange:ge,getSelectionItems:ft,hasRealChildren:F,insertNewChildDataItem:Ke,insertNewDataItem:st,load:U,navigatePageTo:Pe,pageIndex:X,rawView:V,refresh:ct,removeAllFilter:$e,removeDataItem:Ze,removeDataItemById:et,removeFilter:je,removeHierarchyDataItem:lt,removeSorter:we,reOrderVisibleIndex:pe,setSorters:A,sorters:l,summaries:O,totalItems:R,unFold:ee,updateDataView:re,visibleDataItems:ne}}const os=["equal","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","contain","startWidth","endWidth","in","notIn"],rs={equal:(e,t,n)=>e&&e[t]===n,notEqual:(e,t,n)=>e&&e[t]!==n,contain:(e,t,n)=>e?(e[t]||"").indexOf(n)>-1:!1,startWidth:(e,t,n)=>e?(e[t]||"").startsWith(n):!1,endWidth:(e,t,n)=>e?(e[t]||"").endsWith(n):!1},is={equal:(e,t,n)=>e&&e[t]===n,in:(e,t,n)=>{if(e){const r=e[t];return n.indexOf(r)>-1}return!1},notEqual:(e,t,n)=>e&&e[t]!==n},as={equal:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()===r}return!1},notEqual:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()!==r}return!1},greaterThan:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()>r}return!1},greaterThanOrEqual:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()>=r}return!1},lessThan:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()<r}return!1},lessThanOrEqual:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()<=r}return!1}},ss={equal:(e,t,n)=>e?String(n).split(",").includes(String(e[t])):!1,in:(e,t,n)=>{if(e){const r=e[t];return n.indexOf(r)>-1}return!1},notEqual:(e,t,n)=>e?String(n).split(",").findIndex(i=>i===String(e[t]))===-1:!1},ls={equal:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):r===i}return!1},notEqual:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?!0:r!==i}return!1},greaterThan:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):i>r}return!1},greaterThanOrEqual:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):i>=r}return!1},lessThan:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):i<r}return!1},lessThanOrEqual:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):i<=r}return!1}},cs=new Map([["boolean",is],["datetime",as],["enum",ss],["number",ls],["text",rs]]);function us(){const e=o.ref([]),t=new Map,{loadConditionGroup:n}=Xo();function r(v,y){switch(v){case"check-box":return new co({value:y});case"combo-list":return new mo({value:y});case"combo-lookup":return new uo({value:y});case"input-group":return new qt({value:y});case"date-picker":return new fo({value:y});case"date-range":return new Lt({value:y});case"datetime-picker":return new po({value:y});case"datetime-range":return new Lt({value:y});case"lookup":return new ho({value:y});case"month-picker":return new go({value:y});case"month-range":return new yo({value:y});case"number-range":return new vo({value:y});case"number-spinner":return new bo({value:y});case"radio-group":return new Co({value:y});default:return new qt({value:y})}}const i=new Map([["boolean","check-box"],["date","date-picker"],["datetime","datetime-picker"],["number","number-spinner"],["string","text"],["text","text"],["enum","combo-list"],["reference","lookup"]]),a=new Map([["boolean",Je.In],["date",Je.Equal],["datetime",Je.Equal],["number",Je.Equal],["string",Je.Equal],["text",Je.Equal],["enum",Je.In],["reference",Je.Equal]]);function s(v){var C;const y=v.dataType||"string";return((C=v.editor)==null?void 0:C.type)||i.get(y)||"text"}function c(v){var k,T,V,I,E;const y=`field_filter_${v.field}`,C=Date.now(),F=v.field,w=((k=v.column)==null?void 0:k.title)||"",S=((T=v.column)==null?void 0:T.dataType)||"string",N=a.get(S)||Je.Equal,h=((I=(V=v.column)==null?void 0:V.editor)==null?void 0:I.type)||i.get(S)||"text",_=r(h,(E=v.column)==null?void 0:E.filter),x=h==="lookup"||h==="combo-lookup"?Tt.SmartHelp:h==="combo-list"?Tt.Enum:Tt.Value;t.set(y,{id:y,fieldCode:F,fieldName:w,compareType:N,valueType:x,value:_,conditionId:C}),e.value=Array.from(t.values())}function u(v){const y=`field_filter_${v.field}`;t.delete(y),e.value=Array.from(t.values())}function d(v){t.delete(v),e.value=Array.from(t.values())}function f(){t.clear(),e.value=[]}function l(v){const{valueType:y}=v.value,C=v.compareType||"0",F=os[Number(C)];return cs.get(y)[F]}function p(v){const y=v.relation===2?0:1,C=v.items.map(w=>{const S=l(w);return h=>S(h,w.fieldCode,w.value.getValue())}),F=v.children&&v.children.length?v.children.map(w=>p(w)):[];return{relation:y,filterFunctions:C,children:F}}function m(){const v=n(e.value);return p(v)}function g(v,y){const C=y.filterFunctions.map(w=>w(v)),F=y.children.map(w=>g(v,w));return y.relation===1?C.every(w=>w)&&F.every(w=>w):C.includes(!0)||F.includes(!0)}function b(v){const y=m();return g(v,y)}return{addColumnFilter:c,apply:b,clearCondition:f,conditions:e,getFilterEditorType:s,removeColumnFilter:u,removeCondition:d}}function ds(e){o.ref(e.selection.showCheckbox||!1);const t=o.computed(()=>{var s;return((s=e.hierarchy)==null?void 0:s.collapseField)||"__fv_collapse__"}),n=o.computed(()=>{var s;return((s=e.hierarchy)==null?void 0:s.hasChildrenField)||"__fv_hasChildren__"}),r=o.computed(()=>{var s;return((s=e.hierarchy)==null?void 0:s.parentIdField)||"parent"}),i=o.computed(()=>e.hierarchy&&e.selection.showCheckbox),a=o.computed(()=>(e.treeNodeIconsData.fold||e.iconField)&&e.showTreeNodeIcons);return{collapseField:t,hasChildrenField:n,parentIdField:r,shouldShowCheckBox:i,shouldShowIcon:a}}function fs(e,t,n,r,i,a,s,c){var pt;const{dataView:u,visibleDataItems:d}=t,{getVisualData:f,maxVisibleRowIndex:l,minVisibleRowIndex:p}=i,m=o.computed(()=>r.value.primaryColumnsWidth),g=o.computed(()=>r.value.leftColumnsWidth),b=o.computed(()=>r.value.rightColumnsWidth),v=((pt=e.rowOption)==null?void 0:pt.height)||28,y=o.ref(0),C=o.ref(0);let F=0,w=a.value-1;const S=o.ref(0),N=o.ref(0),h=o.ref(0),_=o.ref(e.virtualized),x=24,k=1.5;let T;function V(){const P=d.value;if(P.length<=0)return 0;const W=l.value<P.length?P[l.value]:P[P.length-1];return W.__fv_data_position__>P.length*v?P.length*v:(W.__fv_data_position__||0)+(W.__fv_data_height__||0)+Math.max(P.length-1-l.value,0)*v}const I=o.computed(()=>{const P=V(),W=d.value;let K=W.length>a.value+s?(a.value+s)/W.length:N.value/Math.max(P,N.value),ve=Math.floor(K*N.value);for(;N.value>0&&ve<x;)K*=k,ve=Math.floor(K*N.value);return ve}),E=o.computed(()=>Math.floor(h.value/Math.max(m.value,h.value)*S.value)),M=0,B=0,O=o.computed(()=>S.value-(g.value+m.value+b.value+c.value));function R(P){const K=Math.floor(P/v)+1,ve=d.value;return ve.length>K?ve[K].__fv_visible_index__-1:0}function q(P,W,K){let ve=P,xe=W;const Re=W-P+1;if(Re<s+a.value+s){const Ee=s+a.value+s-Re,Fe=W+Ee<=K,Oe=0+Ee<=P;if(Fe)xe+=Ee,w=xe;else if(Oe)ve-=Ee,F=ve;else{const Ve=K-W,ke=Ee-Ve;xe=Math.min(W+Ve,K),ve=Math.max(P-ke,0)}}return{actualStart:ve,actualEnd:xe}}function L(P){var Ve,ke;const W=d.value;if(!W.length){n.value=[];return}const K=(Ve=e.pagination)!=null&&Ve.enable?0:Math.max(F-s,0),ve=W[W.length-1].__fv_visible_index__,xe=(ke=e.pagination)!=null&&ke.enable?W.length-1:Math.min(w+s,ve),{actualStart:Re,actualEnd:Ee}=q(K,xe,ve),Fe=W[Re-1],Oe=f(Re,Ee,Fe,P);Oe.length&&(n.value=[...Oe])}const X=o.computed(()=>V()>N.value),te=o.computed(()=>Math.floor(m.value)>h.value);function ie(P,W){let K=P;const ve=K>M,xe=X.value;xe&&K<N.value-W&&(K=N.value-W),(!xe||ve)&&(K=M),y.value!==K&&(y.value=K)}function ue(){_.value&&(F=R(Math.abs(y.value)),w=F+a.value-1,(F<p.value||w>l.value-s/2)&&L())}function $(P){let W=y.value+P;W>M&&(W=M);const K=V();ie(W,K),ue()}function ne(P){if(!te.value){C.value=0;return}let W=C.value+P;W>B&&(W=B),W<O.value&&(W=O.value),C.value!==W&&(C.value=W)}function pe(){Math.abs(C.value)+h.value>m.value&&(C.value=Math.min(h.value-m.value,0))}function oe(){y.value=0,F=0,w=a.value-1,L()}function A(){const P=V();ie(y.value,P)}o.watch([h,m],()=>{ne(0)});function Y(P){let{deltaX:W}=P.deltaX,K=-1*P.deltaY;return typeof W>"u"&&(W=-1*P.wheelDeltaX/6),typeof K>"u"&&(K=P.wheelDeltaY/6),P.deltaMode&&P.deltaMode===1&&(W*=10,K*=10),P.shiftKey?{deltaY:-K,deltaX:-W}:{deltaX:W,deltaY:K}}function we(P){if(e.disabled||!X.value)return;P.preventDefault(),P.stopPropagation();const{deltaX:W,deltaY:K}=Y(P);$(K),ne(W)}const Ce=o.computed(()=>({height:`${u.value.length*v}px`,width:`${g.value}px`,transform:`translateY(${y.value}px)`})),je=o.computed(()=>({transform:`translateY(${y.value}px)`})),$e=o.computed(()=>({height:`${u.value.length*v}px`,width:`${m.value}px`,transform:`translate(${C.value}px, ${y.value}px)`})),Be=o.computed(()=>({transform:`translate(${C.value}px, ${y.value}px)`})),me=o.computed(()=>({height:`${u.value.length*v}px`,width:`${b.value}px`,transform:`translateY(${y.value}px)`})),G=o.computed(()=>({transform:`translateY(${y.value}px)`})),Q=o.computed(()=>({height:`${u.value.length*v}px`,width:`${c.value}px`,transform:`translateY(${y.value}px)`})),ee=o.computed(()=>({width:`${g.value}px`})),re=o.computed(()=>({transform:`translateX(${C.value}px)`})),U=o.computed(()=>({width:`${b.value}px`})),ge=o.computed(()=>{const P=V();return ie(y.value,P),y.value/(N.value-P)*(N.value-I.value)}),Pe=o.computed(()=>({height:`${I.value}px`,top:`${ge.value}px`})),Xe=o.computed(()=>C.value/O.value*(S.value-E.value)),st=o.computed(()=>({width:`${E.value}px`,left:`${Xe.value}px`})),Ke=o.ref(!1),Ze=o.ref(-1),et=o.ref(-1),lt=o.ref();function ct(P){if(Ke.value&&et.value!==-1){const W=et.value-P.pageX,K=S.value-E.value;if(Math.abs(W)<=K){const ve=W/(h.value-E.value)*(m.value-h.value);ne(ve),et.value=P.pageX}}}function ot(P){if(Ke.value&&Ze.value!==-1){const W=Ze.value-P.pageY,K=V(),ve=K-I.value;if(Math.abs(W)<=ve){const xe=W/(N.value-I.value)*(K-N.value);$(xe),Ze.value=P.pageY}}}function dt(P){Ke.value=!1,Ze.value=-1,et.value=-1,document.removeEventListener("mouseup",dt),document.removeEventListener("mousemove",ct),T&&document.removeEventListener("mousemove",T),document.body.style.userSelect="",lt.value&&(lt.value.style.opacity=null)}function ft(P,W,K){var Re;Ke.value=!0;const ve=(Re=P.target)==null?void 0:Re.parentElement;ve&&(ve.style.opacity="1",lt.value=ve);const xe=K==="horizontal"?ct:ot;K==="vertical"&&(Ze.value=P.pageY),K==="horizontal"&&(et.value=P.pageX),W.value&&(T||(T=be.throttle(xe,100)),W.value,document.addEventListener("mousemove",T),document.addEventListener("mouseup",dt),document.body.style.userSelect="none")}return{dataGridWidth:S,fitHorizontalScroll:pe,gridDataStyle:$e,gridHeaderColumnsStyle:re,gridMergedDataStyle:Be,gridSideStyle:Q,horizontalScrollThumbStyle:st,leftFixedGridDataStyle:Ce,leftFixedGridHeaderColumnsStyle:ee,leftFixedGridMergedDataStyle:je,offsetX:C,offsetY:y,onMouseDownScrollThumb:ft,onWheel:we,reCalculateVisualDataRows:L,resetScroll:oe,rightFixedGridDataStyle:me,rightFixedGridHeaderColumnsStyle:U,rightFixedGridMergedDataStyle:G,shouldShowHorizontalScrollbar:te,shouldShowVirticalScrollbar:X,updateVirticalScroll:A,updateVisibleRowsOnLatestVisibleScope:ue,verticalScrollThumbStyle:Pe,viewPortWidth:h,viewPortHeight:N}}function ps(e,t,n,r,i,a,s,c){const u=o.ref(r.value-1+i),d=o.ref(0),{renderDataRow:f}=a,l=f,p=f;function m(v){let y=f;return v.__fv_data_grid_group_row__&&(y=l),v.__fv_data_grid_group_summary__&&(y=p),y}function g(v,y,C,F){const{visibleDataItems:w}=n,S=[],N=w.value;if(N.length>0){const h=F?Date.now().toString():"";for(let _=v,x=0;_<=y;_++,x++){const k=N[_],T=N[_-1]||C,V=S[x-1],I=T?(T.__fv_data_position__||0)+(T.__fv_data_height__||0):0,M=m(k)(k,T,V,_,I,t.value,S);M.refreshKey=h,S.push(M)}}return d.value=S.length>0?S[0].index:0,u.value=S.length>0?S[S.length-1].index:0,S}function b(v,y,C){const F=y.groupField||"",{groupValue:w}=y;n[v](F,w);const{dataView:S}=n,N=C[0].index,h=Math.min(N+r.value+i+1,S.value.length-1);return g(N,h)}return{getVisualData:g,maxVisibleRowIndex:u,minVisibleRowIndex:d,toggleGroupRow:b}}function ms(e){var i;const t=((i=e.rowOption)==null?void 0:i.height)||28;function n(a,s){const c=a.pre;if(c){const u=c?c.__fv_data_position__!==void 0?c.__fv_data_position__:c.__fv_index__*t:0,d=c?c.__fv_data_height__!==void 0?c.__fv_data_height__:t:0,f=a.visible?u+d:c.__fv_data_position__;a.top=f,s.__fv_data_position__=f}else a.top=0,s.__fv_data_position__=0}function r(a,s,c){if(a&&!s.ref){s.ref=a;const u=s.parent;s.cellHeight!==a.offsetHeight&&(s.cellHeight=a.offsetHeight),s.cellHeight&&s.cellHeight>(u.height||0)&&(u.height=s.cellHeight,c.__fv_data_height__=u.height),n(u,c)}}return{updateRowPosition:n,updateVisualInfomation:r}}function hs(){function e(t,n){const{formatter:r}=t,i=Te.resolveField(n.raw,t.field);if(i.includes(",")){const s=i.split(","),c=r.data.reduce((d,f)=>(d[f.value]=f,d),{});return s.map(d=>c[d].name).join(",")}const a=r.data.find(s=>s.value===i);return(a==null?void 0:a.name)||""}return{renderEnumColumn:e}}function gs(){function e(r,i){return r?o.createVNode("span",{innerHTML:i.formatter.trueText},null):o.createVNode("span",{innerHTML:i.formatter.falseText},null)}function t(r,i){var a,s;return r?(a=i.formatter)==null?void 0:a.trueText:(s=i.formatter)==null?void 0:s.falseText}function n(r,i){const{formatter:a}=r,s=Te.resolveField(i.raw,r.field);if(a.type===_n.TEXT)return t(s,r);if(a.type===_n.IMAGE)return e(s,r)}return{renderBooleanColumn:n}}function ys(){const{formatTo:e}=Te.useDateFormat();function t(r,i){return e(r,i.formatter.dateFormat)}function n(r,i){const a=Te.resolveField(i.raw,r.field);return t(a,r)}return{renderDateColumn:n}}function vs(){const{formatTo:e}=Te.useNumberFormat();function t(r,i){const{formatter:a}=i,s={precision:a.precision,prefix:a.prefix||"",suffix:a.suffix||"",decimalSeparator:a.decimal||".",groupSeparator:a.thousand||""};return e(r,s)}function n(r,i){const a=Te.resolveField(i.raw,r.field);return t(a,r)}return{renderNumberColumn:n}}function bs(){const{renderBooleanColumn:e}=gs(),{renderEnumColumn:t}=hs(),{renderNumberColumn:n}=vs(),{renderDateColumn:r}=ys();function i(c){return c}function a(c,u){const{formatter:d}=u;return d.customFormat?new Function(`return ${d.customFormat}`)():c}function s(c,u,d){const f=Te.resolveField(d.raw,[u.field]),{formatter:l}=u;return l.type==="none"?f:l.type==="custom"?a(f,u):l.type==="enum"?t(u,d):l.type==="number"?n(u,d):l.type==="boolean"?e(u,d):l.type==="date"?r(u,d):f}return{renderFormatColumn:s}}function Cs(e,t,n){var v;const r=o.ref(e.mergeCell);(v=o.ref(e.rowOption).value)!=null&&v.wrapContent;const{updateVisualInfomation:a}=n,{renderCommandColumn:s}=Xa(),{renderFormatColumn:c}=bs();function u(y,C,F,w,S,N=1){const h={colSpan:N,rowSpan:1,index:F,field:y,data:Te.resolveField(w,y),editingData:Te.resolveField(w,y),parent:S,mode:C,align:"left",valign:"start",showEllipsis:!0,getEditor:_=>_.data,setRef:_=>a(_,h,w),update:()=>{},accept:()=>{},cancel:()=>{},updateData:()=>{}};return h}function d(y,C,F){return y.getEditor=w=>t.getEditor(w,C,w.parent),y.setRef=w=>a(w,y,F),y.update=w=>{w!==void 0&&(y.editingData=w)},y.accept=()=>{Te.setFieldValue(y.editingData,F,C.field),y.data=Te.resolveField(F,C.field)},y.cancel=()=>{y.editingData=y.data},y.updateData=w=>{Te.setFieldValue(Te.resolveField(w,C.field),F,C.field),y.data=Te.resolveField(F,C.field),y.editingData=Te.resolveField(F,C.field)},y}function f(y,C){C.dataType==="commands"?y.formatter=(F,w)=>s(C,w):C.formatter&&(y.formatter=(F,w)=>typeof C.formatter=="function"?C.formatter(F,w):c(C.dataType,C,w))}function l(y,C,F){const w=C&&C.data[F];if(w&&w.data===y.data){const N=w&&w.spannedBy||w;N.rowSpan++,N.spanned=N.spanned||[],N.spanned.push(y),y.colSpan=0,y.rowSpan=0,y.spannedBy=N}}function p(y,C,F){r.value&&l(y,C,F.field)}function m(y,C){C.showEllipsis!==void 0&&(y.showEllipsis=C.showEllipsis),y.column=C,y.align=C.align||"left",y.valign=C.valign||"middle"}function g(y,C,F,w){m(y,C),d(y,C,w),f(y,C),p(y,F,C)}function b(y,C,F,w,S){const N=y.readonly?Qe.readonly:Qe.editable,h=u(y.field,N,C,F,w);return g(h,y,S,F),h}return{createCellByColumn:b,createCellByField:u,updateCellByColumn:g}}function ws(e,t,n,r,i,a){var C,F;const s=o.ref(e.rowOption),c=((C=s.value)==null?void 0:C.height)||28,u=((F=s.value)==null?void 0:F.wrapContent)||!1,{idField:d}=r,{collapseField:f}=n,{updateRowPosition:l}=i,{createCellByColumn:p}=a,m=(w,S,N,h)=>{Te.setFieldValue(Te.resolveField(w,h),S,h),N.data[h].data=Te.resolveField(S,h),N.data[h].editingData=Te.resolveField(S,h)};function g(w,S,N,h,_,x,k){var $,ne,pe;const{__fv_data_grid_group_field__:T,__fv_data_grid_group_value__:V,__fv_data_index__:I}=N,E=N.__fv_data_grid_group_layer__||(N.__fv_parents__?($=N.__fv_parents__)==null?void 0:$.size:0)||0,M=typeof N.parent=="number"?Number(N.parent):-1,B=N.__fv_data_grid_group_collapse__||N[f.value],O=N.__fv_visible__===void 0?!0:N.__fv_visible__,R=N.__fv_checked__,q=N.__fv_indeterminate__,L=N.__fv_disabled__||N[((ne=e.rowOption)==null?void 0:ne.disabledField)||"disabled"],X=k==null?void 0:k.find(oe=>oe.raw[d.value]===N.parent),te=X&&X.collapse;h&&(h.parent,N.parent);const ie=te||X&&!X.visible,ue={collapse:B,data:{},dataIndex:I,groupField:T,groupValue:V,layer:E,index:S,parentIndex:M,pre:h,top:x,type:w,raw:N,checked:R,disabled:L,indeterminate:q,setRef:oe=>{ue.ref=oe},visible:O&&!ie,status:it.initial,updateCell:(oe,A)=>{m(oe,N,ue,A)},updateCells:(oe,A)=>{A.forEach(Y=>{m(oe,N,ue,Y)})}};return h||(N.__fv_data_position__=0),u||(ue.height=c,N.__fv_data_height__=ue.height,l(ue,N)),(pe=s.value)!=null&&pe.customRowStatus&&(s.value.customRowStatus(ue),N.__fv_collapse__=ue.collapse,N.__fv_disabled__=ue.disabled,N.__fv_visible__=ue.visible),ue}function b(w,S,N,h,_,x,k){const T=g(It.data,_,S,N,h,x,k);return w.forEach((V,I)=>{T.data[V.field]=p(V,_,S,T,h)}),T}function v(w,S,N,h,_){return Object.assign(w,{index:S,dataIndex:N,top:h,pre:_})}function y(w,S,N,h,_,x,k){const T=w.__fv_data_index__,V=w[d.value],I=t.getEditingSnapshot(V);return I===null?b(x,w,S,N,h,_,k):v(I,h,T,_,S)}return{createEmptyRow:g,createNewRowFromDataItem:b,renderDataRow:y}}function Ss(e,t,n,r){var T;const{idField:i}=n,a=o.ref(e.editable),s=o.ref(e.editOption),c=o.ref(((T=e.rowOption)==null?void 0:T.wrapContent)||!1),{onClickRow:u}=r;o.watch(()=>e.editable,()=>{a.value=e.editable}),o.watch(()=>{var V;return(V=e.editOption)==null?void 0:V.editMode},V=>{s.value.editMode=V});const d=new Map([["boolean","check-box"],["datetime","date-picker"],["enum","combo-list"],["number","number-spinner"],["string","input-group"],["text","text"],["commands","commands-editor"]]);let f,l,p,m;function g(V){return l&&l.raw[i.value]===V?l:null}const b=o.reactive({});function v(V,I,E={}){V.mode=Qe.editing,f=V,l=I,p=Te.resolveField(I==null?void 0:I.raw,V.field),m=E}function y(V){V.accept(),V.mode=Qe.editable,f=null,t.emit("endEditCell",{cell:V,row:l,newValue:Te.resolveField(l==null?void 0:l.raw,V.field),oldValue:p,column:m,editor:b})}function C(V){if(document.body.classList.contains("lookup-modal-open"))return;const E=V.target.closest(".fv-grid-cell");f&&f.ref&&f.ref===E||(f&&(y(f),l&&(l=void 0)),document.body.removeEventListener("click",C))}function F(V,I,E,M={}){V.stopPropagation(),u(V,E),a.value&&s.value.editMode==="cell"&&I.mode===Qe.editable&&(f&&y(f),Promise.resolve().then(()=>be.isUndefined(e.beforeEditCell)?!0:typeof e.beforeEditCell=="function"?e.beforeEditCell({row:E,cell:I,rawData:E.raw,column:M}):e.beforeEditCell).then(B=>{B&&(v(I,E,M),document.body.removeEventListener("click",C),document.body.addEventListener("click",C))}))}function w(V){Object.values(V.data).filter(I=>I.mode===Qe.editable&&I.field!=="__commands__").forEach(I=>{I.mode=Qe.editing}),V.status=it.editing,l=V}function S(V,I){Object.values(V.data).filter(E=>E.mode===Qe.editing).forEach(E=>{I?E.accept():E.cancel(),E.mode=Qe.editable}),V.status=it.initial,l===V&&(l=void 0)}function N(V){a.value&&s.value.editMode==="row"&&l!==V&&(l&&S(l,!1),w(V))}function h(V){S(V,!0),V.status=it.initial}function _(V){S(V,!1),V.status=it.initial}function x(V,I,E){const M=I.dataType,B=I.editor||{type:d.get(M)||"input-group"};return!c.value&&B.type==="text"&&(B.type="input-group"),B?(B.context={rowData:E.raw,column:I,cell:V,editor:b},o.createVNode(un.FDynamicFormInput,{focusOnCreated:e.focusOnEditingCell,selectOnCreated:e.selectOnEditingCell,editor:B,modelValue:V.editingData,"onUpdate:modelValue":O=>V.editingData=O,id:I.id},null)):V.data}function k(){f&&y(f)}return{onClickCell:F,onEditingRow:N,acceptEditingRow:h,cancelEditingRow:_,getEditingSnapshot:g,getEditor:x,endEditCell:k}}function xs(e){const t=o.ref(e.idField);function n(r){if(r&&r.length){const i=r[0];Object.keys(i).includes(t.value)||(t.value="__fv_indetify__")}}return{idField:t,reviseIdentifyField:n}}function Fs(e,t,n,r){const{idField:i}=r,{currentSelectedDataId:a,multiSelectOnClickRow:s,multiSelectOnClickRowWithShift:c,selectItem:u,selectedValues:d,toggleSelectItem:f,enableSelectRow:l}=n,p=o.ref(0),m=o.ref(-1);function g(h){return l.value&&(c.value?d.value.includes(h.raw[i.value]):h.raw[i.value]===a.value)}function b(h){var x;const _={"fv-grid-row":h.type===It.data,"fv-grid-group-row":h.type===It.group,"fv-grid-summary-row":h.type===It.summary,"fv-grid-row-hover":h.index===m.value,"fv-grid-row-selected":g(h),"fv-grid-row-odd":h.dataIndex%2>0,"fv-grid-row-even":h.dataIndex%2===0,"fv-grid-disabled":h.disabled};if((x=e.rowOption)!=null&&x.customRowStyle){const k=e.rowOption.customRowStyle(h.raw)||{};return Object.assign({},_,k)}return _}function v(h){var x;const _={"fv-grid-cell":!0};if((x=e.rowOption)!=null&&x.customCellStyle){const k=e.rowOption.customCellStyle(h)||{};return Object.assign({},_,k)}return _}function y(h){p.value+=1,setTimeout(()=>{p.value===1&&t.emit("clickRow",h.index,h.raw),p.value=0},250),p.value>1&&(t.emit("doubleClickRow",h.index,h.raw),p.value=0)}function C(h,_){if(_.disabled)return;c.value&&h.shiftKey||s.value?f(_):u(_),y(_)}function F(h){h.disabled||(a.value=h.raw[i.value],y(h))}function w(h,_){}function S(h,_){}function N(h){var x;const _={"fv-grid-sidebar-row":!0,"fv-grid-sidebar-row-hover":h.index===m.value,"fv-grid-sidebar-row-selected":g(h),"fv-grid-sidebar-row-odd":h.dataIndex%2>0,"fv-grid-sidebar-row-even":h.dataIndex%2===0,"d-flex":!0,"align-items-center":!0};if((x=e.rowOption)!=null&&x.customRowStyle){const k=e.rowOption.customRowStyle(h.raw)||{};return Object.assign({},_,k)}return _}return{clickRowItem:F,gridCellClass:v,gridRowClass:b,onClickRow:C,onMouseoverRow:w,sidebarRowClass:N,onMouseoutRow:S}}function Ts(e,t,n,r,i){const{idField:a}=n,s=o.ref(""),c=o.computed(()=>e.selection.enableSelectRow),u=o.ref(e.selection.multiSelect??!1),d=o.ref(e.selection.multiSelectMode),f=o.ref(e.selection.showCheckbox),l=o.ref(e.selection.showSelectAll),p=o.ref(e.selectionValues);o.watch(()=>e.selection.showSelectAll,($,ne)=>{$!==ne&&(l.value=$)});function m(){return t.getSelectionItems(p.value)}function g(){const $=r.value.reduce((pe,oe)=>(pe.set(oe.raw[a.value],oe),pe),new Map);return p.value.map(pe=>$.get(pe)).filter(pe=>!!pe)}const b=o.computed(()=>c.value&&u.value),v=o.computed(()=>!!e.hierarchy),y=o.computed(()=>{const $=f.value&&d.value==="DependOnCheck";return b.value&&$}),C=o.computed(()=>b.value&&!f.value),F=o.computed(()=>b.value&&f.value&&d.value==="OnCheckAndClick");o.computed(()=>F.value);function w(){const $=t.getSelectionItems(p.value);i.emit("selectionChange",$)}function S($){i.emit("unSelectItem",$)}function N(){r.value.forEach(ne=>{ne.checked=!1,ne.indeterminate=!1,ne.raw.__fv_checked__=!1,ne.raw.__fv_indeterminate__=!1}),g().forEach(ne=>{ne.checked=!0,ne.raw.__fv_checked__=!0})}o.watch(()=>r.value,()=>{N()}),o.watch(()=>e.selectionValues,$=>{p.value=$,N()},{immediate:!0}),o.watch(()=>e.selection,$=>{u.value=!!$.multiSelect,d.value=$.multiSelectMode||"DependOnCheck",f.value=!!$.showCheckbox});const h=o.computed(()=>!u.value);function _($){return $.raw[a.value]}function x($){return p.value.findIndex(pe=>pe===_($))}function k(){g().forEach(pe=>{pe.checked=!1}),t.getSelectionItems(p.value).forEach(pe=>{pe.__fv_checked__=!1}),p.value=[],s.value=""}function T($){const ne=$.raw;ne.__fv_checked__=!0,ne.__fv_indeterminate__=!1;const pe=new Set(p.value);pe.add(ne[a.value]),p.value=Array.from(pe.values()),$.checked=!0,$.indeterminate=!1}function V($){const ne=$.raw;ne.__fv_checked__=!1,ne.__fv_indeterminate__=!1,p.value=p.value.filter(pe=>pe!==ne[a.value]),$.checked=!1,$.indeterminate=!1}function I($){T($),s.value=$.raw[a.value]}function E($){V($),s.value=""}function M($){const ne=$.raw;ne.__fv_checked__=!1,ne.__fv_indeterminate__=!0,p.value=p.value.filter(pe=>pe!==ne[a.value]),$.checked=!1,$.indeterminate=!0}function B($){h.value&&k(),$.checked?V($):T($),w()}function O($){h.value&&k(),$.checked?E($):I($),w(),$.checked||S($)}function R($){$.raw[a.value]!==s.value&&(k(),I($),w())}function q($){const ne=r.value.find(pe=>pe.raw[a.value]===$);ne&&R(ne)}function L($){const ne=r.value.filter(pe=>$.includes(pe.raw[a.value]));ne&&ne.length&&(k(),ne.forEach(pe=>{I(pe)}),w())}function X($){for(const ne of $)if(p.value.includes(ne)){const pe=r.value.find(oe=>oe.raw[a.value]===ne);pe&&E(pe)}}function te(){r.value.forEach($=>I($)),w()}function ie(){p.value.splice(0,p.value.length),r.value.forEach($=>{const ne=$.raw;ne.__fv_checked__=!1,ne.__fv_indeterminate__=!1,$.checked=!1,$.indeterminate=!1}),w()}function ue(){return r.value.find($=>$.raw[a.value]===s.value)}return{clearSelection:k,currentSelectedDataId:s,enableMultiSelect:u,enableSelectRow:c,findIndexInSelectedItems:x,getSelectedItems:m,getSelectionRow:ue,indeterminate:M,isSelectingHirarchyItem:v,multiSelectMode:d,multiSelectOnClickRow:F,multiSelectOnClickRowWithShift:C,multiSelectOnlyOnCheck:y,select:I,selectAll:te,selectedValues:p,selectItem:R,selectItemById:q,selectItemByIds:L,showCheckBox:f,showSelectAll:l,toggleSelectItem:O,toggleSelectItemWithoutRow:B,unSelect:E,unSelectAll:ie,unSelectItemByIds:X}}function _s(e,t){var v,y;const n=String(Date.now()),r=50,{showCheckBox:i,showSelectAll:a}=t,s=o.ref(((v=e.rowNumber)==null?void 0:v.enable)??!1),c=o.computed(()=>e.hierarchy&&i.value&&e.selection.enableSelectRow&&e.selection.multiSelect?!1:i.value),u=o.ref(s.value?((y=e.rowNumber)==null?void 0:y.width)??32:0),d=o.ref(c.value?r:0),f=o.computed(()=>{var C;return s.value?((C=e.rowNumber)==null?void 0:C.heading)??"序号":""}),l=o.computed(()=>(c.value&&!e.hierarchy?Number(d.value):0)+(s.value?Number(u.value):0));o.watch(()=>e.rowNumber,C=>{C&&C.enable!==void 0&&(s.value=C.enable),C&&C.width!==void 0&&(u.value=C.width)});function p(C){return{top:`${C.top}px`,width:`${l.value}px`,height:`${C.height||""}px`}}const m=o.computed(()=>({width:`${l.value}px`}));function g(C){return`${n}_${C.type}_r_${C.index}_${C.refreshKey||""}`}function b(C){return`${n}_${C.type}_r_${C.index}_${C.refreshKey||""}`}return{showRowNumer:s,showSidebarCheckBox:c,sidebarCellPosition:p,sidebarCornerCellStyle:m,sidebarTitle:f,sidebarWidth:l,rowKey:b,cellKey:g}}const Ns={ascend:(e,t)=>e===t?0:e===!1?-1:1,decend:(e,t)=>e===t?0:e===!0?-1:1},Vs={ascend:(e,t)=>{const n=new Date(new Date(e).toLocaleDateString()).valueOf(),r=new Date(new Date(t).toLocaleDateString()).valueOf();return n===r?0:n<r?-1:1},decend:(e,t)=>{const n=new Date(new Date(e).toLocaleDateString()).valueOf(),r=new Date(new Date(t).toLocaleDateString()).valueOf();return n===r?0:n<r?1:-1}},ks={ascend:(e,t)=>e===t?0:e<t?-1:1,decend:(e,t)=>e===t?0:e<t?1:-1},Es={ascend:(e,t)=>e===t?0:e<t?-1:1,decend:(e,t)=>e===t?0:e<t?1:-1};function Is(e){const t=new Map([["boolean","boolean-sorter"],["date","datetime-sorter"],["datetime","datetime-sorter"],["number","numeric-sorter"],["string","text-sorter"],["text","text-sorter"],["enum","text-sorter"],["reference","text-sorter"]]),n=new Map([["boolean-sorter",Ns],["datetime-sorter",Vs],["numeric-sorter",ks],["text-sorter",Es]]);function r(s){const c=(s==null?void 0:s.dataType)||"string",u=t.get(c)||"text-sorter";return n.get(u)||(s==null?void 0:s.sorter)}function i(s){return r(s.column)}function a(s,c){const u=i(s),d=(s.status&De.sortable)===De.sortable&&(s.status&De.sorted)===De.sorted,f=(s.status&De.ascending)===De.ascending,l=(s.status&De.descending)===De.descending;if(d&&u){const p=f?u.ascend:l?u.decend:void 0;p?c.addSorter(s.field,{field:s.field,compare:p}):c.removeSorter(s.field)}else c.removeSorter(s.field)}return{getSorterByColumn:r,updateSorter:a}}function Ms(e){const t="parent",n="layer",r="hasChildren",i=(a,s=1,c=[],u=null)=>(a=a||[],a.reduce((d,f)=>(f.id=f.id||f.data[e.idField],f[t]=u,f[n]=s,f[r]=!1,Object.keys(f.data).forEach(l=>{Object.keys(f).includes(l)||(f[l]=f.data[l])}),c.push(f),f.children&&f.children.length&&(f[r]=!0,i(f.children,s+1,c,f.id)),d),c),c);return{flatTreeData:i}}function Os(e,t,n,r,i,a,s,c,u,d,f,l,p,m,g,b,v){const{calculateCellPositionInRow:y}=a,{columnContext:C,hasLeftFixedColumn:F,hasRightFixedColumn:w}=s,{gridDataStyle:S,leftFixedGridDataStyle:N,rightFixedGridDataStyle:h}=m,{renderDataRow:_}=za(e,t,C,v,c,u,d,f,l,p,m),x=[_];function k(M,B){const O=y(M);return v.value.filter(R=>R.visible!==!1).map(R=>x[R.type](R,O,B))}function T(){return o.createVNode("div",{ref:r,class:"fv-grid-content-left-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:N.value},[k(C.value.leftColumns.filter(M=>M.visible),"left")])])}function V(){return o.createVNode("div",{ref:n,class:"fv-grid-content-primary"},[o.createVNode("div",{class:"fv-grid-data",style:S.value},[k(C.value.primaryColumns.filter(M=>M.visible),"primary")])])}function I(){return o.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:h.value},[k(C.value.rightColumns.filter(M=>M.visible),"right")])])}function E(){const M=[];return F.value&&M.push(T()),M.push(V()),w.value&&M.push(I()),M}return{renderDataArea:E}}const Xt=o.defineComponent({name:"FTreeGrid",props:Tn,emits:["selectionChange","clickRow","expandNode"],setup(e,t){var kt,D;const r=((kt=e.rowOption)==null?void 0:kt.height)||28,i=o.ref(20),a=o.ref(e.columns),s=he.useIdentify(e),c=o.ref(),u=o.ref(),d=o.ref(),f=o.ref(),l=o.ref(),p=o.ref([]),m=o.ref(!1),g=o.ref(((D=e.rowOption)==null?void 0:D.wrapContent)||!1),b=he.useGroupData(e,s),v=he.useFilter(),y=he.useHierarchy(e),{showLoading:C,renderLoading:F}=he.useLoading(e,c),w=he.useDataView(e,new Map,v,y,s),S=he.useSelection(e,w,s,p,t),N=he.useSelectHierarchyItem(e,p,s,S,t),h=o.computed(()=>e.disabled),_=o.computed(()=>e.virtualized?Math.min(w.dataView.value.length,i.value):w.dataView.value.length),{containerStyleObject:x}=he.useDataViewContainerStyle(e),k=he.useCommandColumn(e),{applyCommands:T}=k;T(a);const V=he.useColumn(e),I=he.useSort(e),{applyColumnSorter:E,columnContext:M,updateColumnRenderContext:B}=V;E(w,I);const O=he.useGroupColumn(e,M),R=he.useRow(e,t,S,s),q=he.useEdit(e,t,s,R),L=he.useVisualDataBound(e),X=he.useVisualDataCell(e,q,L),te=he.useVisualDataRow(e,q,y,s,L,X),ie=he.useVisualData(e,a,w,_,0,te),{getVisualData:ue}=ie,$=he.useCellPosition(e,M),ne=he.useSidebar(e,S),{sidebarWidth:pe}=ne,oe=he.useVirtualScroll(e,w,p,M,ie,_,0,pe),{onWheel:A,dataGridWidth:Y,viewPortHeight:we,viewPortWidth:Ce,resetScroll:je,updateVisibleRowsOnLatestVisibleScope:$e}=oe,Be=he.useFitColumn(e,M,u,Ce,O),{calculateColumnsSize:me}=Be,G=he.useFilterHistory(),Q=he.useColumnFilter(u,l,w,G,oe),ee=he.useDragColumn(e,t,V,w,O,b,oe),re=o.computed(()=>({"fv-grid":!0,"fv-grid-bordered":e.showBorder,"fv-grid-horizontal-bordered":e.showHorizontalLines,"fv-datagrid-strip":e.showStripe})),U=o.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":m.value,"fv-grid-wrap-content":g.value})),{renderDataArea:ge}=Os(e,t,d,f,l,$,V,w,q,y,R,S,N,oe,ie,L,p),{renderGridHeader:Pe,renderGridColumnResizeOverlay:Xe,shouldShowHeader:st}=he.getColumnHeader(e,t,u,f,l,V,w,ee,Q,v,G,Be,O,S,ne,I,oe,Ce,p),{renderDataGridSidebar:Ke}=he.getSidebar(e,R,S,ne,oe),{renderDisableMask:Ze}=he.getDisableMask(),{renderHorizontalScrollbar:et}=he.getHorizontalScrollbar(e,u,oe),{renderVerticalScrollbar:lt}=he.getVerticalScrollbar(e,u,oe);function ct(){var H,Z,fe;if(u.value&&u.value.clientHeight>0&&((H=u.value)==null?void 0:H.clientWidth)>0){const Se=Math.ceil(u.value.clientHeight/r);Se>i.value&&(i.value=Se,$e()),we.value=((Z=d.value)==null?void 0:Z.clientHeight)||0,Y.value=((fe=u.value)==null?void 0:fe.clientWidth)||0,me()}}o.onMounted(()=>{u.value&&(i.value=Math.max(Math.ceil(u.value.clientHeight/r),i.value),p.value=ue(0,_.value+0-1),Zn.useResizeObserver(u.value,ct),me(),o.nextTick(()=>{u.value&&(Y.value=u.value.clientWidth),d.value&&(Ce.value=d.value.clientWidth,we.value=d.value.clientHeight)})),C.value&&F()}),o.onUnmounted(()=>{}),o.watch(Ce,()=>{u.value&&me()});function ot(){const H=S.getSelectionRow();return H?H.dataIndex-1:-1}function dt(){const H=ot();w.insertNewDataItem(H),p.value=ue(0,_.value+0-1)}function ft(){const H=ot();w.insertNewChildDataItem(H),p.value=ue(0,_.value+0-1)}function pt(){const H=ot(),Z=N.getNextSelectableHierarchyItemId(H);w.removeHierarchyDataItem(H),p.value=ue(0,_.value+0-1),Z&&S.selectItemById(Z)}function P(H){q.onEditingRow(H)}function W(H){q.acceptEditingRow(H)}function K(H){q.cancelEditingRow(H)}function ve(H){H&&(a.value=H,T(a),B(a.value),E(w,I),me())}function xe(H){H&&(w.load(H),je())}function Re(H){S.selectItemById(H)}function Ee(H){const Z=p.value.find(fe=>fe.raw[s.idField.value]===H);Z&&R.clickRowItem(Z)}function Fe(H){S.selectItemByIds(H)}function Oe(){return S.getSelectedItems()}function Ve(){S.clearSelection()}const ke=o.computed(()=>!p.value||!p.value.length),{renderEmpty:Ie}=he.getEmpty(t);function Ye(){return S.getSelectionRow()}return t.expose({addNewDataItem:dt,addNewChildDataItem:ft,removeDataItem:pt,editDataItem:P,acceptDataItem:W,cancelDataItem:K,updateColumns:ve,updateDataSource:xe,selectItemById:Re,selectItemByIds:Fe,getSelectedItems:Oe,clearSelection:Ve,getSelectionRow:Ye,clickRowItemById:Ee}),()=>o.createVNode("div",{ref:c,class:re.value,style:x.value,onWheel:A},[u.value&&st.value&&Pe(),o.createVNode("div",{ref:u,class:U.value,onMouseover:()=>m.value=!0,onMouseleave:()=>m.value=!1},[u.value&&Ke(p),u.value&&ge(),u.value&&ke.value&&Ie(),u.value&&et(),u.value&&lt()]),Xe(),h.value&&Ze()])}}),Bs={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}},Io={},Mo={},Ps={id:{type:String}},Rs=o.defineComponent({name:"FDesignerPlaceholder",props:Ps,emits:[],setup(e){const t=o.computed(()=>({"drag-and-drop-alert":!0,"no-drag":!0,"w-100":!0})),n=o.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()=>o.createVNode("div",{class:t.value,style:n.value,role:"alert","data-noattach":"true","data-position":"0"},[o.createTextVNode("拖拽组件到这里")])}});function js(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!o.isVNode(e)}const Nn=o.defineComponent({name:"FDesignerItem",props:Bs,emits:["selectionChange"],setup(e,t){const n=o.ref(`${e.modelValue.id}-component`),r=o.ref(e.canMove),i=o.ref(e.canDelete),a=o.ref(!1),s=o.ref(e.modelValue),c=o.ref(e.componentId||""),u=o.ref(""),d=o.ref(""),f=o.ref(e.customClass),l=o.ref(),p=o.inject("canvas-dragula"),m=o.ref(),g=o.inject("design-item-context"),b={designerItemElementRef:l,componentInstance:m,schema:s.value,parent:g,setupContext:t};o.provide("design-item-context",b);const v=o.inject("useFormSchema"),y=o.computed(()=>{var R;const M=e.modelValue.appearance&&e.modelValue.appearance.class||"",B=((R=m.value)==null?void 0:R.getCustomButtons)&&m.value.getCustomButtons();let O={"farris-component":!0,"flex-fill":s.value.id==="root-component","position-relative":r.value&&i.value||(B==null?void 0:B.length),"farris-nested":a.value,"can-move":r.value,"d-none":l.value&&l.value.classList.contains("d-none"),dgComponentSelected:l.value&&l.value.classList.contains("dgComponentSelected"),dgComponentFocused:l.value&&l.value.classList.contains("dgComponentFocused")};return O[`farris-component-${s.value.type}`]=!0,O=Te.getCustomClass(O,M),O=Te.getCustomClass(O,d.value),O=Te.getCustomClass(O,f.value),O}),C=o.computed(()=>{const M={},B=e.modelValue.appearance&&e.modelValue.appearance.style||"";return B&&B.split(";").reduce((O,R)=>{const[q,L]=R.split(":");return O[q]=L,O},M),u.value&&u.value.split(";").reduce((O,R)=>{const[q,L]=R.split(":");return q&&(O[q]=L),O},M),M});function F(M,B){var q,L;if(M&&(M.preventDefault(),M.stopPropagation()),m.value.triggerBelongedComponentToDeleteWhenDeleted){const X=m.value.getBelongedComponentInstance(m);if(X&&X.parent){const te=o.ref(X==null?void 0:X.parent),ie=te.value.contents.findIndex(ue=>ue.id===X.schema.id);(L=(q=te.value)==null?void 0:q.contents)==null||L.splice(ie,1),Ut.value++}return}m.value.onRemoveComponent();let O=g,R=X=>X.id===B.id;if(B.type==="component"&&(O=g==null?void 0:g.parent,R=X=>X.component===B.id),O&&O.schema.contents){const X=O.schema.contents.findIndex(R);O.schema.contents.splice(X,1),Ut.value++,t.emit("selectionChange")}}function w(M){return i.value&&o.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:B=>{F(B,M)}},[o.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function S(){return r.value&&o.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[o.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function N(){var B;const M=((B=m.value)==null?void 0:B.getCustomButtons)&&m.value.getCustomButtons();return M&&!!M.length&&M.map(O=>o.createVNode("div",{role:"button",class:`btn component-settings-button ${O.class||""}`,title:O.title,ref:O.id,onClick:R=>O.onClick&&O.onClick(R)},[o.createVNode("i",{class:O.icon},null)]))}function h(M){return o.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[o.createVNode("div",null,[w(M),S(),N()])])}function _(M,B,O,R){t.emit("selectionChange",M,B,O,R)}function x(M){let B;const O=M.type,R=Io[O],q=Mo[O],L=q?q(M):{};L.customClass=e.ignore?L.customClass:"",L.componentId=c.value,L.id=M.id;const X=M.contents&&M.contents.length===0;return M.contents&&!!M.contents.length&&R?o.createVNode(R,o.mergeProps({ref:m},L),js(B=M.contents.map(ie=>o.createVNode(Nn,{key:ie.id,modelValue:ie,"onUpdate:modelValue":ue=>ie=ue,componentId:c.value,onSelectionChange:_},null)))?B:{default:()=>[B]}):R?X?o.createVNode(R,o.mergeProps({ref:m},L),{default:()=>[o.createVNode(Rs,null,null)]}):o.createVNode(R,o.mergeProps({ref:m},L),null):o.createVNode("div",null,null)}function k(M){if(M.type==="component-ref"){let O=v==null?void 0:v.getFormSchema().module.components.find(R=>R.id===M.component);if(O)return o.createVNode(Nn,{key:O.id,modelValue:O,"onUpdate:modelValue":R=>O=R,componentId:O.id,onSelectionChange:_},null)}}o.watch(()=>e.modelValue,M=>{s.value=M,n.value=`${M.id}-component`});function T(M){window.scrollContainerList||(window.scrollContainerList=new Set);const B=M.getAttribute("id");B&&window.scrollContainerList.add(B)}function V(M){const B=M==null?void 0:M.target;T(B),ka(B)}function I(){var M,B;(B=(M=s.value)==null?void 0:M.contents)!=null&&B.length&&l.value&&l.value.addEventListener("scroll",V)}o.onMounted(()=>{if(l.value&&m.value&&m.value.schema){const M=l.value.querySelector(`[data-dragref='${m.value.schema.id}-container']`);p&&M&&p.attachComponents(M,s.value),a.value=m.value.canNested!==void 0?m.value.canNested:a.value,i.value=m.value.canDelete!==void 0?m.value.canDelete:i.value,r.value=m.value.canMove!==void 0?m.value.canMove:r.value,u.value=m.value.styles||"",d.value=m.value.designerClass||"",l.value&&(l.value.componentInstance=m,l.value.designItemContext=b),m.value.belongedComponentId=c.value}I(),Ut.value++}),o.onBeforeUnmount(()=>{l.value&&l.value.removeEventListener("scroll",V)});function E(M){M&&(M.preventDefault(),M.stopPropagation());let B=b.designerItemElementRef;const O=l.value;if(O){const R=document.getElementsByClassName("dgComponentFocused");R&&R.length===1&&R[0]===l.value||(Array.from(R).forEach(L=>L.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(L=>L.classList.remove("dgComponentSelected")),O.classList.add("dgComponentFocused"),t.emit("selectionChange",s.value.type,s.value,c.value,m.value),m.value.getDraggableDesignItemElement&&(B=m.value.getDraggableDesignItemElement(b),B&&B.value&&B.value.classList.add("dgComponentSelected")))}To(B==null?void 0:B.value)}return()=>s.value.type==="component-ref"?k(s.value):o.createVNode("div",{id:`${s.value.id}-design-item`,ref:l,class:y.value,style:C.value,onClick:E},[h(s.value),x(s.value)])}});function $s(e,t,n,r,i="data-grid-column"){const{columnContext:a,hasLeftFixedColumn:s,hasRightFixedColumn:c}=n,{gridHeaderColumnsStyle:u,leftFixedGridHeaderColumnsStyle:d,rightFixedGridHeaderColumnsStyle:f}=r,l=a.value.defaultColumnWidth,p=32,m=new Map([[0,0]]);function g(k,T){const V=m.get(T)||0,I={height:`${k.depth*p}px`,left:`${k.left}px`,top:`${(k.layer-1)*p}px`,width:`${k.actualWidth}px`,padding:0};return a.value.headerDepth>1&&(I["line-height"]=`${k.depth*p}px`),m.set(T+1,V+(k.actualWidth||l)),I}const b=o.computed(()=>({"fv-grid-header":!0,"fv-grid-header-group-columns":a.value.headerDepth>1})),v=o.computed(()=>({height:`${a.value.headerDepth*p}px`})),y=function(k){return t.showSetting&&!!k.showSetting};function C(){return o.createVNode("span",{class:"fv-grid-settings-icon d-flex align-items-center"},[o.createVNode("i",{class:"f-icon f-icon-home-setup"},null)])}function F(k,T,V,I){var E;(E=e==null?void 0:e.setupContext)==null||E.emit("selectionChange",k,T,V,I)}function w(k){var V,I;return"w-100 d-flex align-items-center justify-content-"+(((V=k.column)==null?void 0:V.halign)==="center"?"center":((I=k.column)==null?void 0:I.halign)==="right"?"end pr-2":"start pl-2")}function S(k,T,V){var E;const I=o.ref(k.column);return o.createVNode("div",{class:"fv-grid-header-cell",style:g(k,V)},[o.createVNode(Nn,{modelValue:I.value,"onUpdate:modelValue":M=>I.value=M,customClass:w(k),canAdd:!1,canDelete:!1,canMove:!1,key:(E=I.value)==null?void 0:E.id,type:i,componentId:t.componentId,onSelectionChange:F},null),y(k)&&C(),k.resizable&&o.createVNode("span",{class:"fv-column-resize-bar"},null)])}function N(k){return k.map((T,V)=>{const I=[];if(I.push(S(T,k,V)),T.children&&T.children.length){const E=N(T.children);I.push(...E)}return I})}function h(){return o.createVNode("div",{class:"fv-grid-header-left-fixed"},[o.createVNode("div",{class:"fv-grid-header-columns",style:d.value},[N(a.value.leftHeaderColumns)])])}function _(){return o.createVNode("div",{class:"fv-grid-header-right-fixed"},[o.createVNode("div",{class:"fv-grid-header-columns",style:f.value},[N(a.value.rightHeaderColumns)])])}function x(){return o.createVNode("div",{class:b.value,style:v.value},[s.value&&h(),o.createVNode("div",{class:"fv-grid-header-primary"},[o.createVNode("div",{class:"fv-grid-header-columns",style:u.value},[N(a.value.primaryHeaderColumns)])]),c.value&&_()])}return{renderGridHeader:x}}class Ds extends Fo{constructor(t,n){super(t,n)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){var s,c,u;const n=(u=(c=(s=this.formSchemaUtils.getFormSchema())==null?void 0:s.module)==null?void 0:c.entity[0])==null?void 0:u.entities[0],r=this.assembleSchemaEntityToTree(n,0),i=this,a=super.getBasicPropConfig(t);this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{...a.properties,dataSource:{description:"绑定数据源",title:"绑定数据源",editor:{type:"combo-tree",textField:"name",valueField:"label",data:r,editable:!1},readonly:!0}},setPropertyRelates(d,f){switch(d&&d.propertyID){case"dataSource":{const l=i.formSchemaUtils.getViewModelById(i.viewModelId);if(l){const p=r.find(m=>m.label===d.propertyValue);l.bindTo=p.bindTo}i.designViewModelUtils.assembleDesignViewModel();break}}}}}getAppearanceProperties(t){var n,r,i;this.propertyConfig.categories.appearance={title:"外观",properties:{columns:{title:"列设置",description:"列设置",$converter:"/converter/items-count.converter",editor:{type:"grid-field-editor",viewModelId:this.viewModelId,gridData:t,gridType:"tree-grid-column"},refreshPanelAfterChanged:!0},fit:{title:"适配父组件尺寸",type:"boolean",description:"是否适配父组件尺寸",visible:!1},showStripe:{title:"显示条纹",type:"boolean",description:"是否显示条纹"},showBorder:{title:"显示边框",type:"boolean",description:"是否显示边框"}},setPropertyRelates(a,s){switch(a&&a.propertyID){case"useBlankWhenDataIsEmpty":t.emptyDataHeight=t.useBlankWhenDataIsEmpty?36:240;break;case"fields":t.fields=a.propertyValue||[];break}}},this.propertyConfig.categories.pagination={title:"分页",$converter:"/converter/pagination.converter",properties:{enable:{title:"启用分页",type:"boolean",refreshPanelAfterChanged:!0,editor:{readonly:!0}},mode:{visible:((n=t.pagination)==null?void 0:n.enable)||!1,title:"分页交互模式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"client",name:"客户端"},{value:"server",name:"服务器端"}]}},showIndex:{visible:((r=t.pagination)==null?void 0:r.enable)||!1,title:"显示页码",type:"boolean"},showLimits:{visible:((i=t.pagination)==null?void 0:i.enable)||!1,title:"显示每页记录数",type:"boolean"}}}}getEventPropConfig(t){const n=[{label:"onSelectionChange",name:"行切换事件"},{label:"onClickRow",name:"行点击事件"}],r=this,i=r.eventsEditorUtils.formProperties(t,r.viewModelId,n),a={};a[r.viewModelId]={type:"events-editor",editor:{initialData:i}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(s,c){const u=s.propertyValue;delete t[r.viewModelId],u&&(u.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(t,r.viewModelId,u.events,u)),t.remoteSort=!!t.columnSorted}}}assembleSchemaEntityToTree(t,n,r,i="",a=[]){const s=i?`${i}/${t.label}`:"/";return a.push({id:t.id,name:t.name,label:t.label,layer:n,parent:r&&r.id,bindTo:s.replace("//","/")}),t.type.entities&&t.type.entities.length&&t.type.entities.map(c=>this.assembleSchemaEntityToTree(c,n+1,t,s,a)),a}}function As(e,t){const n=e.schema,r=o.ref(!0),i=o.ref(!0);function a(f){return f&&f.sourceType==="control"?f.componentCategory==="input":!1}function s(){return!1}function c(){return!1}function u(){return!0}function d(f){return new Ds(f,t).getPropertyConfig(n)}return{canAccepts:a,checkCanDeleteComponent:s,checkCanMoveComponent:c,hideNestedPaddingInDesginerView:u,triggerBelongedComponentToMoveWhenMoved:r,triggerBelongedComponentToDeleteWhenDeleted:i,getPropsConfig:d}}function Ls(e,t,n,r,i){const{getGridHeaderCells:a}=i,s=120,c=50,u=o.computed(()=>{var h;return((h=e.rowNumber)==null?void 0:h.enable)||!1}),d=o.computed(()=>{var h,_;return((h=e.selection)==null?void 0:h.multiSelect)||((_=e.selection)==null?void 0:_.showCheckbox)||!1}),f=o.computed(()=>{var h;return 0+(u.value?((h=e.rowNumber)==null?void 0:h.width)||32:0)+(d.value?c:0)}),l=o.computed(()=>{var h;return(h=e.columnOption)==null?void 0:h.fitColumns}),p=o.computed(()=>{var h;return l.value&&((h=e.columnOption)==null?void 0:h.fitMode)||"none"});function m(h,_,x){const k=parseInt(h.width,10)/100;return x*k}function g(h,_,x){return typeof h.width=="string"?m(h,_,x):h.width||s}function b(h,_){const x=[],k=[];let T=0;h.value.primaryColumns.filter(E=>E.visible).forEach(E=>{typeof E.width=="string"?k.push(E):(E.width=E.width||s,T+=E.width,x.push(E))});const V=_*(x.length/h.value.primaryColumns.filter(E=>E.visible).length);x.forEach(E=>{const M=V*(E.width/T);E.actualWidth=M,h.value.primaryColumnsWidth+=E.actualWidth});const I=_-V;k.forEach(E=>{const M=m(E,h.value,I);E.actualWidth=M,h.value.primaryColumnsWidth+=E.actualWidth})}function v(h,_){const x=[],k=[],T=new WeakMap;let V=0,I=0;if(h.value.primaryColumns.filter(M=>M.visible).forEach(M=>{if(typeof M.width=="string"){const B=m(M,h.value,_);T.set(M,B),V+=B,k.push(M)}else M.width=M.width||s,I+=M.width,x.push(M)}),_-V>I){const M=_-V;k.forEach(B=>{B.actualWidth=T.get(B)||s,h.value.primaryColumnsWidth+=B.actualWidth}),x.forEach(B=>{B.actualWidth=M*(B.width/I),h.value.primaryColumnsWidth+=B.actualWidth})}else b(h,_)}function y(h,_){h.value.primaryColumns.filter(x=>x.visible).forEach(x=>{x.actualWidth=g(x,h.value,_),h.value.primaryColumnsWidth+=x.actualWidth})}const C={expand:v,none:y,percentage:b};function F(h){h.value.leftHeaderColumns=Array.from(a(h.value.leftColumns.filter(_=>_.visible)).values()),h.value.primaryHeaderColumns=Array.from(a(h.value.primaryColumns.filter(_=>_.visible)).values()),h.value.rightHeaderColumns=Array.from(a(h.value.rightColumns.filter(_=>_.visible)).values())}function w(h){h.value.leftColumnsWidth=0,h.value.primaryColumnsWidth=0,h.value.rightColumnsWidth=0,h.value.leftColumns.filter(_=>_.visible).forEach(_=>{h.value.leftColumnsWidth+=_.actualWidth||0}),h.value.primaryColumns.filter(_=>_.visible).forEach(_=>{h.value.primaryColumnsWidth+=_.actualWidth||0}),h.value.rightColumns.filter(_=>_.visible).forEach(_=>{h.value.rightColumnsWidth+=_.actualWidth||0}),h.value=Object.assign({},h.value)}function S(h,_,x){var B;let k=0;const T=h.value.primaryColumns,V=h.value.rightColumns;h.value.rightColumns.filter(O=>O.visible).forEach(O=>{O.actualWidth=g(O,h.value,_),k+=O.actualWidth});const I=x-k,E=C[p.value];if(E&&E(h,I),h.value.primaryColumnsWidth+k<=x)return h.value.primaryColumns=[...T,...V],h.value.primaryColumnsWidth+=k,h.value.rightColumns=[],h.value.rightColumnsWidth=0,!0;const M=new Map;return M.set("primary",[]),M.set("right",[]),h.value.primaryColumns.reduce((O,R)=>{var q,L;return R.fixed==="right"?(q=O.get("right"))==null||q.push(R):(L=O.get("primary"))==null||L.push(R),O},M),(B=M.get("right"))!=null&&B.length&&(h.value.primaryColumns=[...M.get("primary")||[]],h.value.rightColumns=[...M.get("right")||[]]),h.value.primaryColumnsWidth=0,h.value.rightColumnsWidth=0,!1}function N(){if(n.value){t.value.leftColumnsWidth=0,t.value.primaryColumnsWidth=0,t.value.rightColumnsWidth=0;const h=n.value.clientWidth-f.value;t.value.leftColumns.filter(x=>x.visible).forEach(x=>{x.actualWidth=g(x,t.value,h),t.value.leftColumnsWidth+=x.actualWidth});const _=h-t.value.leftColumnsWidth;if(S(t,h,_))r.value=_;else{t.value.rightColumns.filter(T=>T.visible).forEach(T=>{T.actualWidth=g(T,t.value,h),t.value.rightColumnsWidth+=T.actualWidth});const x=h-t.value.leftColumnsWidth-t.value.rightColumnsWidth,k=C[p.value];k&&k(t,x),r.value=x}F(t),t.value=Object.assign({},t.value)}}return o.watch(()=>{var h;return(h=e.columnOption)==null?void 0:h.fitColumns},(h,_)=>{h!==_&&h&&N()}),o.watch(p,(h,_)=>{h!==_&&l.value&&N()}),{calculateColumnHeaders:F,calculateColumnsSize:N,calculateColumnsWidth:w}}const qs=o.defineComponent({name:"FTreeGridDesign",props:Eo,emits:[],setup(e,t){var Q,ee;const n=o.ref(),r=0,i=((Q=e.rowOption)==null?void 0:Q.height)||28,a=o.ref(20),s=o.ref(e.columns),c=xs(e),u=o.ref(),d=o.ref(),f=o.ref([]),l=o.ref(!1),p=o.ref(((ee=e.rowOption)==null?void 0:ee.wrapContent)||!1),m=o.inject("designer-host-service"),g=o.inject("design-item-context"),b=As(g,m),v=xn(n,g,b);v.value.designerClass="f-utils-fill-flex-column";const y=us(),C=ds(e),F=ns(e,new Map,y,C,c),w=Ts(e,F,c,f,t),S=o.computed(()=>F.dataView.value.length),{containerStyleObject:N}=Ya(e),h=Ka(e),{applyCommands:_}=h;_(s);const x=Qa(e),{applyColumnSorter:k,columnContext:T,updateColumnRenderContext:V}=x,I=Is(),E=Za(e,T),M=Fs(e,t,w,c),B=Ss(e,t,c,M),O=ms(e),R=Cs(e,B,O),q=ws(e,B,C,c,O,R),L=ps(e,s,F,S,r,q),{getVisualData:X}=L,te=_s(e,w),{sidebarWidth:ie}=te;f.value=X(0,S.value+r-1);const ue=fs(e,F,f,T,L,S,r,ie),{onWheel:$,dataGridWidth:ne,viewPortHeight:pe,viewPortWidth:oe,updateVisibleRowsOnLatestVisibleScope:A}=ue,Y=Ls(e,T,u,oe,E),{calculateColumnsSize:we}=Y,Ce=o.computed(()=>({"drag-container":!0,"fv-grid":!0,"fv-grid-bordered":e.showBorder,"fv-datagrid-strip":e.showStripe})),je=o.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":l.value,"fv-grid-wrap-content":p.value})),{renderGridHeader:$e}=$s(g,e,x,ue,"tree-grid-column"),{renderHorizontalScrollbar:Be}=Ga(e,u,ue);function me(){var U,ge;const re=Math.ceil(u.value.clientHeight/i);re>a.value&&(a.value=re,A()),pe.value=((U=d.value)==null?void 0:U.clientHeight)||0,ne.value=((ge=u.value)==null?void 0:ge.clientWidth)||0,we()}o.onMounted(()=>{n.value.componentInstance=v,u.value&&(a.value=Math.max(Math.ceil(u.value.clientHeight/i),a.value),f.value=X(0,S.value+r-1),Zn.useResizeObserver(u.value,me),we(),o.nextTick(()=>{u.value&&(ne.value=u.value.clientWidth),d.value&&(oe.value=d.value.clientWidth,pe.value=d.value.clientHeight)}))});function G(re){re&&(s.value=re,_(s),V(s.value),k(F,I),we())}return o.watch(()=>e.columns,re=>{G(re)}),o.watch(oe,()=>{u.value&&we()}),t.expose(v.value),()=>o.createVNode("div",{ref:n,class:Ce.value,style:N.value,onWheel:$,dragref:`${g.schema.id}-container`},[u.value&&$e(),o.createVNode("div",{ref:u,class:je.value,onMouseover:()=>{l.value=!0},onMouseleave:()=>{l.value=!1}},[Be()])])}});Xt.register=(e,t,n,r)=>{e["tree-grid"]=Xt,t["tree-grid"]=ja,r["tree-grid"]={bindingResolver:Da,selectionItemResolver:$a,updateColumnsResolver:La}},Xt.registerDesigner=(e,t,n)=>{e["tree-grid"]=qs,t["tree-grid"]=Aa},Te.withInstall(Xt);const Hs=new Map([["appearance",ht]]);function Ws(e,t,n){return t}Ue({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},onClick:{type:Function,default:()=>{}}},{$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},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},Hs,Ws,{title:"step",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}});const Us={class:{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},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},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},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:""}};class Me{constructor(t,n){this.x=t,this.y=n}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,n=null){if(this.isMouseEvent(t))return new Me(t.clientX,t.clientY);if(n===null||t.changedTouches.length===1)return new Me(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let r=0;r<t.changedTouches.length;r++)if(t.changedTouches[r].target===n)return new Me(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 n=new Me(0,0);if(window){const r=window.getComputedStyle(t);if(r){const i=parseInt(r.getPropertyValue("left"),10),a=parseInt(r.getPropertyValue("top"),10);n.x=isNaN(i)?0:i,n.y=isNaN(a)?0:a}return n}return null}static copy(t){return new Me(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 wt{constructor(t,n){this.width=t,this.height=n}static getCurrent(t){const n=new wt(0,0);if(window){const r=window.getComputedStyle(t);return r&&(n.width=parseInt(r.getPropertyValue("width"),10),n.height=parseInt(r.getPropertyValue("height"),10)),n}return null}static copy(t){return new wt(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function zs(e,t){const n=o.ref(),r=o.ref(),i=o.ref(),a=o.ref(),s=o.ref(),c=o.ref(),u=o.ref(),d=o.ref(),f=o.ref(),l=o.ref(),p=o.ref(),m=o.ref(),g=o.ref(e.draggable),b=o.ref(!1);function v(){const O=r.value||document.body,R=window.getComputedStyle(O);if(!R||!n.value)return;const q=Me.getTransformInfo(n.value),L={};u.value&&(L.deltaL=n.value.offsetLeft-u.value.x,L.deltaT=n.value.offsetTop-u.value.y);const X=R.getPropertyValue("position");L.width=O.clientWidth,L.height=O.clientHeight,L.pr=parseInt(R.getPropertyValue("padding-right"),10),L.pb=parseInt(R.getPropertyValue("padding-bottom"),10),L.position=R.getPropertyValue("position"),X==="static"&&(O.style.position="relative"),L.translateX=q.x,L.translateY=q.y,l.value=L}function y(O){if(n.value){a.value=wt.getCurrent(n.value),s.value=Me.getCurrent(n.value),c.value=a.value?wt.copy(a.value):null,u.value=s.value?Me.copy(s.value):null,v();const R=O.target.getAttribute("type")||"";d.value={n:!!R.match(/n/),s:!!R.match(/s/),w:!!R.match(/w/),e:!!R.match(/e/)}}}function C(){var O,R,q,L;if(n.value){const X=n.value;d.value&&((d.value.n||d.value.s)&&((O=c.value)!=null&&O.height)&&(X.style.height=c.value.height+"px"),(d.value.w||d.value.e)&&((R=c.value)!=null&&R.width)&&(X.style.width=c.value.width+"px"),u.value&&((q=u.value)!=null&&q.x&&(X.style.left=u.value.x+"px"),(L=u.value)!=null&&L.y&&(X.style.top=u.value.y+"px")))}}function F(){const O=e.minHeight?e.minHeight:1,R=e.minWidth?e.minWidth:1;c.value&&u.value&&d.value&&a.value&&(c.value.height<O&&(c.value.height=O,d.value.n&&s.value&&(u.value.y=s.value.y+(a.value.height-O))),c.value.width<R&&(c.value.width=R,d.value.w&&s.value&&(u.value.x=s.value.x+(a.value.width-R))),e.maxHeight&&c.value.height>e.maxHeight&&(c.value.height=e.maxHeight,s.value&&d.value.n&&(u.value.y=s.value.y+(a.value.height-e.maxHeight))),e.maxWidth&&c.value.width>e.maxWidth&&(c.value.width=e.maxWidth,d.value.w&&s.value&&(u.value.x=s.value.x+(a.value.width-e.maxWidth))))}function w(){if(r.value){const O=l.value;if(u.value&&c.value&&d.value&&a.value){const R=O.width-O.pr-O.deltaL-O.translateX-u.value.x,q=O.height-O.pb-O.deltaT-O.translateY-u.value.y;d.value.n&&u.value.y+O.translateY<0&&s.value&&(u.value.y=-O.translateY,c.value.height=a.value.height+s.value.y+O.translateY),d.value.w&&u.value.x+O.translateX<0&&s.value&&(u.value.x=-O.translateX,c.value.width=a.value.width+s.value.x+O.translateX),c.value.width>R&&(c.value.width=R),c.value.height>q&&(c.value.height=q)}}}function S(O){if(!i.value||!a.value||!s.value||!d.value)return;O.subtract(i.value);const R=O.x,q=O.y;d.value.n?(u.value.y=s.value.y+q,c.value.height=a.value.height-q):d.value.s&&(c.value.height=a.value.height+q),d.value.e?c.value.width=a.value.width+R:d.value.w&&(c.value.width=a.value.width-R,u.value.x=s.value.x+R),w(),F(),C()}function N(O){if(!f.value)return;const R=Me.fromEvent(O);R&&S(R)}function h(){if(n.value){const{width:O,height:R,x:q,y:L}=n.value.getBoundingClientRect(),X=Me.getTransformInfo(n.value);return{size:{width:O,height:R},position:{x:q-X.x,y:L-X.y}}}return null}function _(O){if(n.value){const R=h();p.value=R}i.value=void 0,a.value=null,s.value=null,c.value=null,u.value=null,d.value=null,f.value=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",_)}function x(){document.addEventListener("mousemove",N),document.addEventListener("mouseup",_)}function k(O){O instanceof MouseEvent&&O.button===2||g.value&&(document.body.click(),O.stopPropagation(),O.preventDefault(),i.value=Me.fromEvent(O),f.value=O.target,y(O),x())}function T(O){return n.value=O,o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:R=>k(R)},null)])}function V(O=!0){document.body.click();const R=r.value||document.body,q=wt.getCurrent(R),L=n.value;O&&L&&(m.value=h(),m.value.transform=L.style.transform),q&&L&&(c.value=q,L.style.height=c.value.height-14+"px",L.style.width=c.value.width-14+"px",L.style.left="7px",L.style.top="7px",L.style.transform="",p.value={size:c.value,position:{x:0,y:0}},g.value=!1,b.value=!0)}function I(){var O,R;if(document.body.click(),m.value){const q={width:m.value.size.width||0,height:m.value.size.height||0},L={x:(window.innerWidth-q.width)/2,y:(window.innerHeight-q.height)/2};(O=c.value)==null||O.set(q),(R=u.value)==null||R.set(L);const X=n.value;X.style.height=q.height+"px",X.style.width=q.width+"px",X.style.left=`${L.x}px`,X.style.top=`${L.y}px`,X.style.transform="",p.value={size:q,position:L},g.value=e.draggable,b.value=!1}}function E(){if(n.value){const O=wt.getCurrent(n.value);if(O){const{width:R,height:q}=O;n.value.style.left=`${(window.innerWidth-R)/2}px`,n.value.style.top=`${(window.innerHeight-q)/2}px`,n.value.style.transform=""}}}function M(){const O=()=>{b.value?V(!1):E(),document.body.click()};return window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)}}const B=M();return{renderResizeBar:T,boundingElement:r,resizedEventParam:p,maximize:V,restore:I,allowDrag:g,isMaximized:b,unWindowResizeHandle:B}}function Gs(e,t,n){const r=o.ref(),i=o.ref(e.draggable),a=o.ref(e.lockAxis),s=o.ref(),c=o.ref(),u=o.ref(!1),d=o.ref(new Me(0,0)),f=o.ref(new Me(0,0)),l=o.ref(new Me(0,0)),p=o.ref(new Me(0,0));o.watch(()=>n.value,h=>{s.value.style.cursor=h?"move":"default"});function m(h,_){if(_.tagName==="BUTTON")return!1;if(_===h)return!0;for(const x in _.children)if(Object.prototype.hasOwnProperty.call(_.children,x)&&m(h,_.children[x]))return!0;return!1}function g(){var k,T;let h=l.value.x+f.value.x,_=l.value.y+f.value.y;a.value==="x"?(h=((k=d.value)==null?void 0:k.x)||0,l.value.x=0):a.value==="y"&&(_=((T=d.value)==null?void 0:T.y)||0,l.value.y=0);const x=`translate3d(${Math.round(h)}px, ${Math.round(_)}px, 0px)`;r.value&&(r.value.style.transform=x),p.value.x=h,p.value.y=_}function b(){if(!c.value||!r.value)return null;const h=c.value.getBoundingClientRect(),_=r.value.getBoundingClientRect(),x={top:h.top<_.top,right:h.right>_.right,bottom:h.bottom>_.bottom,left:h.left<_.left};return x.top||(l.value.y-=_.top-h.top),x.bottom||(l.value.y-=_.bottom-h.bottom),x.right||(l.value.x-=_.right-h.right),x.left||(l.value.x-=_.left-h.left),g(),x}function v(h){h&&(d.value&&h.subtract(d.value),l.value.set(h),g(),b())}function y(h){u.value&&i.value&&(h.stopPropagation(),h.preventDefault(),v(Me.fromEvent(h,s.value)))}function C(){var h;u.value&&(u.value=!1,f.value.add(l.value),l.value.reset(),(h=r.value)==null||h.classList.remove("ng-dragging"),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",C))}function F(){!u.value&&s.value&&(u.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",y),document.addEventListener("mouseup",C))}function w(){if(r.value){const h=Me.getTransformInfo(r.value);f.value.set(h);return}f.value.reset()}function S(h){if(!n.value||h instanceof MouseEvent&&h.button===2)return;const _=h.target||h.srcElement;s.value!==void 0&&_&&!m(_,s.value)||i.value!==!1&&(document.body.click(),h.stopPropagation(),h.preventDefault(),d.value=Me.fromEvent(h,r.value),w(),F())}function N(h,_,x){if(i.value&&_){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 k=_.querySelector(e.dragHandle);k&&(s.value=k)}}r.value=_,c.value=x,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",S)):i.value=!1}}return{registerDraggle:N,resetTranslate:w}}function Oo(e,t){if(e){const n=r=>{r.key.toLowerCase()===e.toLowerCase()&&t({event:r,key:e})};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}}}function Xs(e,t){const n=o.ref(e.enableEsc);let r=null;return n.value?(r=Oo("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:r}):null}function Ys(e,t){const n=o.ref(e.enableEnter);let r=null;return n.value?(r=Oo("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:r}):null}const Mt=o.defineComponent({name:"FModal",props:Us,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter"],setup(e,t){const n=o.ref(e.width||300),r=o.ref(e.height||200),i=o.ref(e.modelValue),a=o.ref(""),s=o.ref(e.class),c=o.ref(e.fitContent),u=o.ref(e.showHeader),d=o.ref(""),f=o.ref(e.showCloseButton),l=o.ref(e.showMaxButton),p=o.ref(!1),m=o.ref(e.dialogType),g=o.ref(e.src),b=o.ref(""),v=o.ref(e.showButtons),y=o.ref(e.title),C=o.ref(e.resizeable),F=o.ref(e.containment||null),w=o.ref();function S(U,ge){i.value=!1,t.emit("update:modelValue",!1),ge!=null&&t.emit(ge?"accept":"cancel"),t.emit("closed",U)}const N=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:U=>{S(U,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:U=>{S(U,!0)}}],h=o.ref(e.buttons&&e.buttons.length?e.buttons:N),_=o.computed(()=>!!d.value),x=o.computed(()=>!!v.value&&!!h.value),k=o.ref(),T=o.ref(),V=o.ref(!1),{renderResizeBar:I,maximize:E,restore:M,boundingElement:B,resizedEventParam:O,allowDrag:R,unWindowResizeHandle:q}=zs(e),{registerDraggle:L}=Gs(e,t,R);function X(){const U=document.querySelectorAll(".farris-modal").length;(!U||U-1<=0)&&document.body.classList.remove("modal-open"),w.value&&w.value.classList.remove("show")}o.watch(()=>e.title,(U,ge)=>{U!==ge&&(y.value=U)}),o.watch(()=>e.modelValue,(U,ge)=>{U!==ge&&(i.value=U,U||X())}),o.watch(()=>e.showHeader,(U,ge)=>{U!==ge&&(u.value=U)}),o.watch(()=>e.showButtons,(U,ge)=>{U!==ge&&(v.value=U)}),o.watch(()=>O.value,(U,ge)=>{const Pe=U||{},Xe=ge||{};JSON.stringify(Pe)!==JSON.stringify(Xe)&&t.emit("resize",{newSize:U,oldSize:ge})});const te=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),ie=o.computed(()=>{const U={modal:!0,"farris-modal":!0,fade:!0};return U["f-modal-fitContent"]=!!c.value,U.show=!!te.value,U}),ue=o.computed(()=>{var Pe;const U={"modal-dialog":!0},ge=(Pe=s.value)==null?void 0:Pe.split(" ");return ge==null||ge.reduce((Xe,st)=>(Xe[st]=!0,Xe),U),U}),$=o.computed(()=>({position:"absolute",top:`${(window.innerHeight-r.value)/2}px`,left:`${(window.innerWidth-n.value)/2}px`,width:`${n.value}px`,height:c.value?"auto":`${r.value}px`})),ne=o.computed(()=>({"modal-content":!0,"modal-content-has-header":u.value})),pe=o.computed(()=>{const U={display:u.value?"":"none"};return U["pointer-events"]=R.value?"auto":"none",U}),oe=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:V.value})),A=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":m.value==="iframe"}));function Y(){return{}}const we=o.computed(()=>{const U={textAlgin:b.value},ge=Y();return Object.assign(U,ge)});function Ce(U){if(U.stopPropagation(),V.value){V.value=!1,M();return}E(),V.value=!0}async function je(U,ge){U.handle&&await U.handle(ge,U)&&t.emit("closed",ge)}function $e(U){U.width&&(n.value=U.width),U.height&&(r.value=U.height),U.buttons&&(h.value=U.buttons),U.title&&(y.value=U.title)}let Be=null,me=null;o.onMounted(()=>{T.value&&!F.value&&(F.value=T.value.parentElement,B.value=F.value,L(k.value,T.value,B.value)),te.value&&document.body.classList.add("modal-open"),Be=Xs(e,t),me=Ys(e,t)}),o.onUnmounted(()=>{q&&q(),Be&&Be.remove(),me&&me.remove()}),t.expose({modalElementRef:T,updateModalOptions:$e,close:S,maxDialog:Ce});function G(){return o.createVNode("ul",null,[p.value&&o.createVNode("li",{class:"f-btn-icon f-bare"},[o.createVNode("span",{class:"f-icon modal_minimize"},null)]),l.value&&o.createVNode("li",{onClick:Ce,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:oe.value},null)]),f.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:U=>S(U,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function Q(){return o.createVNode("div",{class:"modal-footer",style:we.value},[h.value&&h.value.map(U=>o.createVNode("button",{name:U.name,type:"button",class:U.class+(U.iconClass?" btn-icontext":""),onClick:ge=>{je(U,ge)}},[!!U.iconClass&&o.createVNode("i",{class:U.iconClass},null),U.text]))])}function ee(){return o.createVNode("div",{ref:k,class:"modal-header",style:pe.value},[o.createVNode("div",{class:"modal-title"},[_.value&&o.createVNode("span",{class:d.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[y.value])]),o.createVNode("div",{class:"actions"},[G()])])}function re(U){U.stopPropagation()}return()=>o.createVNode(o.Teleport,{to:"body"},{default:()=>[te.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>{var U,ge;return[o.createVNode("div",{class:ie.value,style:"display: block",ref:w,onClick:re},[o.createVNode("div",{id:a.value,class:ue.value,style:$.value,ref:T},[o.createVNode("div",{class:ne.value},[u.value&&ee(),o.createVNode("div",{class:A.value},[(ge=(U=t.slots).default)==null?void 0:ge.call(U),m.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:g.value},null)]),x.value&&Q()]),!c.value&&C.value&&T.value&&!V.value&&I(T.value)])])]}})]})}});function Bo(e){if(e.content&&e.content.render)return e.content.render;if(e.render&&typeof e.render=="function")return e.render}function Js(e){const t=document.createElement("div");t.style.display="contents";const n=o.createApp({setup(r,i){o.onUnmounted(()=>{document.body.removeChild(t)});const a=o.ref(),s=o.ref(e.class||""),c=o.ref(!!e.showButtons),u=o.ref(!!e.showHeader),d=o.ref(e.showCloseButton==null?!0:e.showCloseButton),f=o.ref(!0),l=o.ref(e.title||""),p=e.acceptCallback||(()=>{}),m=e.rejectCallback||(()=>{}),g=e.closedCallback||(C=>{}),b=e.resizeHandle||(C=>{}),v=Bo(e),y=C=>{f.value=!1,n.unmount(),g(C)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(Mt,{ref:a,class:s.value,modelValue:f.value,"onUpdate:modelValue":C=>f.value=C,title:l.value,width:e.width,height:e.height,buttons:e.buttons,"show-header":u.value,"show-buttons":c.value,"show-close-button":d.value,"show-max-button":!1,onAccept:p,onCancel:m,fitContent:e.fitContent==null?!0:e.fitContent,onClosed:y,onResize:b},{default:()=>[v&&v(n)]})}});return document.body.appendChild(t),n.mount(t),n}class Po{constructor(t){z(this,"appContext",null);z(this,"modalRef",o.ref());z(this,"activeModalIndex",o.ref(0));z(this,"modalRefs",{});z(this,"isUseEscCloseModal",o.ref(!1));z(this,"activeModalInstance",o.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(t,n){const{width:r,height:i}={width:window.innerWidth,height:window.innerHeight};return r<t&&(t=r),i<n&&(n=i),{width:t,height:n}}static show(t){const n=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return Js(n)}open(t){const n=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const r=o.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),i=o.ref(!0),a=r.value.acceptCallback||(()=>{}),s=r.value.rejectCallback||(()=>{}),c=r.value.closedCallback||((w,S)=>{}),u=r.value.resizeHandle||(w=>{});let d;const f=Bo(r.value),l=w=>{var N;i.value=!1;const S=(N=w==null?void 0:w.target)==null?void 0:N.classList.contains("modal_close");c(w,this.isUseEscCloseModal.value?"esc":S?"icon":"button")},p=w=>{l(w),d&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,n),d=null,this.modalRef.value=null,this.modalRefs){const S=Object.keys(this.modalRefs).map(N=>Number(N));S.length>0?this.activeModalIndex.value=Math.max(...S):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},m=w=>{var S;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((S=this.activeModalInstance.value)==null||S.close(w==null?void 0:w.event))},{width:g,height:b}=r.value,v=this.adaptToWindow(g||500,b||320);Object.assign(r.value,v);const y=()=>o.createVNode(Mt,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":w=>i.value=w},r.value,{onAccept:a,onCancel:s,onClosed:p,onResize:u,onEsc:m}),{default:()=>[f&&f(this.app)]});return d=(w=>{const S=o.h(y,w);return S.appContext=this.appContext,o.render(S,n),S})({...r.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:w=>{r.value={...r.value,...w},d&&o.render(o.cloneVNode(d,{...r}),n)},destroy:p,modalRef:this.activeModalInstance}}}const Ro=Symbol("FModalService");Mt.install=e=>{e.component(Mt.name,Mt);const t=new Po(e);e.provide(Ro,t),e.provide("FModalService",t)};function jo(e){const t=e.nativeElement?e.nativeElement:e;return t.classList!==void 0&&t.classList!==null?t:null}function $o(e,t){if(t===void 0)return;const n=jo(e);n&&n.classList.remove(t)}function Vn(e,t){if(t===void 0)return;const n=jo(e);n&&n.classList.add(t)}const kn=[{size:"sm",width:576},{size:"md",width:768},{size:"lg",width:888},{size:"xl",width:1200},{size:"el",width:1690}];function Do(e){e.resizeObserver&&(e.resizeObserver.disconnect(),e.sharedObject=null)}function Ao(e,t,n=0){const r=[];if(!t)return;const i=n||t.getBoundingClientRect().width,a=parseFloat(i);for(let s=0;s<kn.length;s++)kn[s].width<=a&&r.push(kn[s].size);if(e.className.join(",")!==r.join(",")){if(e.className.length-r.length>0)for(let c=r.length;c<e.className.length;c++)$o(t,"f-area-response--"+e.className[c]);else for(let c=e.className.length;c<r.length;c++)Vn(t,"f-area-response--"+r[c]);e.className=[...r]}}function Qs(e,t){e.enable&&e.autoWidth?e.resizeObserver||(e.resizeObserver=new ResizeObserver(n=>{if(!n||n.length<1||!n[0].contentRect)return;const r=n[0].contentRect;Math.abs(parseInt(r.width+"")-e.width)>e.threshold&&(Ao(e,t,r.width),e.width=parseInt(r.width+""))}),e.resizeObserver.observe(t)):Do(e)}function Lo(e,t){if(e.enable)Vn(t,"f-area-response"),Ao(e,t);else{$o(t,"f-area-response");for(let n=e.className.length;n>0;n--)Vn(t,"f-area-response--"+e.className[n]);e.className=[]}Qs(e,t)}function qo(e,t){t.value&&Object.prototype.hasOwnProperty.call(t.value,"enable")&&(e.enable=t.value.enable),t.value&&Object.prototype.hasOwnProperty.call(t.value,"autoWidth")&&(e.autoWidth=t.value.autoWidth)}const Ks={mounted:(e,t,n)=>{n.sharedObject={className:[],resizeObserver:null,enable:!0,autoWidth:!0,threshold:10,width:0},qo(n.sharedObject,t),Lo(n.sharedObject,e)},updated:function(e,t,n,r){n.sharedObject=r.sharedObject,qo(n.sharedObject,t),Lo(n.sharedObject,e)},beforeUnmount(e,t,n){Do(n.sharedObject)}},Zs={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String}},Ho=o.defineComponent({name:"FDynamicFormLabel",props:Zs,emits:[],setup(e,t){const n=o.ref(e.title||e.text),r=o.ref(e.required),i=o.ref(e.text);return o.watch(()=>e.text,()=>{i.value=e.text}),o.watch(()=>e.required,(a,s)=>{a!==s&&(r.value=a)}),()=>i.value&&o.createVNode("label",{class:"col-form-label",title:n.value},[r.value&&o.createVNode("span",{class:"farris-label-info text-danger"},[o.createTextVNode("*")]),o.createVNode("span",{class:"farris-label-text"},[i.value])])}}),se={},le={},ce={},de={};let Wo=!1;function el(){Wo||(Wo=!0,Qr.register(se,le,ce,de),Jr.register(se,le,ce,de),to.register(se,le,ce,de),Kr.register(se,le,ce,de),Zr.register(se,le,ce,de),ei.register(se,le,ce,de),Et.register(se,le,ce,de),pn.register(se,le,ce,de),ji.register(se,le,ce,de),Ii.register(se,le,ce,de),ni.register(se,le,ce,de),ti.register(se,le,ce,de),oi.register(se,le,ce,de),no.register(se,le,ce,de),ri.register(se,le,ce,de),un.register(se,le,ce,de),ii.register(se,le,ce,de),Gr.register(se,le,ce,de),$i.register(se,le,ce,de),ai.register(se,le,ce,de),oo.register(se,le,ce,de),si.register(se,le,ce,de),ci.register(se,le,ce,de),li.register(se,le,ce,de),ui.register(se,le,ce,de),Di.register(se,le,ce,de),di.register(se,le,ce,de),pi.register(se,le,ce,de),fi.register(se,le,ce,de),Ur.register(se,le,ce,de),mi.register(se,le,ce,de),hi.register(se,le,ce,de),Xr.register(se,le,ce,de),gi.register(se,le,ce,de),yi.register(se,le,ce,de),ro.register(se,le,ce,de),vi.register(se,le,ce,de),Ci.register(se,le,ce,de),wi.register(se,le,ce,de),bi.register(se,le,ce,de),Ai.register(se,le,ce),Yr.register(se,le,ce,de),Si.register(se,le,ce,de),xi.register(se,le,ce,de),Fi.register(se,le,ce,de),Ti.register(se,le,ce,de),_i.register(se,le,ce,de),Wr.register(se,le,ce,de),eo.register(se,le,ce,de),Ni.register(se,le,ce,de),Vi.register(se,le,ce,de),fn.register(se,le,ce,de),io.register(se,le,ce,de),Ei.register(se,le,ce,de),ki.register(se,le,ce,de),Mi.register(se,le,ce,de),Oi.register(se,le,ce,de),Bi.register(se,le,ce,de),Pi.register(se,le,ce,de),Li.register(se,le,ce,de))}function tl(){el();function e(i){const a=se[i];if(!a)throw new Error(`Could not find the editor of type '${i}'`);return a}function t(i,a){const s=le[i];return s?s(a):{}}function n(i){switch(i){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"date-picker":return"onDatePicked";case"date-range":return"";case"datetime-picker":return"";case"datetime-range":return"";case"month-picker":return"";case"month-range":return"";case"year-picker":return"";case"year-range":return"";case"input-group":return"onChange";case"lookup":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"response-layout-editor-setting":return"onChange";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":return"onChange";case"item-collection-editor":return"onChange";case"response-form-layout-setting":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onValueChange";case"query-solution-config":case"solution-preset":return"onFieldsChanged"}}function r(i){switch(i){case"combo-list":case"input-group":case"textarea":return"onClear"}}return{resolveEditorProps:t,resolveEditorType:e,getChangeFunctionName:n,getClearFunctionName:r}}const Uo=o.defineComponent({name:"FDynamicFormGroup",props:Wt,emits:["change","update:modelValue"],setup(e,t){var w;const n=o.ref(e.id),r=o.ref(e.customClass),i=o.ref(e.editor),a=o.ref(e.label),s=o.ref(e.modelValue),c=o.ref(e.readonly),u=o.ref(((w=e.editor)==null?void 0:w.required)||e.required),d=o.ref(e.showLabel),f=o.ref(e.visible);o.ref(e.type);const l=o.ref(),{resolveEditorProps:p,resolveEditorType:m,getChangeFunctionName:g,getClearFunctionName:b}=tl(),v=o.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":c.value}));function y(S,N){s.value=N!==void 0?N:S,t.emit("update:modelValue",s.value),t.emit("change",s.value)}function C(){t.emit("update:modelValue","")}const F=o.computed(()=>{const S=i.value.type||"input-group",N=m(S),h=p(S,i.value),_=g(S),x=b(i.value.type);return x&&(h[x]=C),h[_]=y,(h.id==null||h.id==="")&&(h.id=n.value),S==="number-range"&&i.value.onBeginValueChange&&typeof i.value.onBeginValueChange=="function"?(i.value.onBeginValueChange&&typeof i.value.onBeginValueChange=="function"&&(h.onBeginValueChange=i.value.onBeginValueChange),i.value.onEndValueChange&&typeof i.value.onEndValueChange=="function"&&(h.onEndValueChange=i.value.onEndValueChange)):S==="lookup"&&i.value["onUpdate:idValue"]&&typeof i.value["onUpdate:idValue"]=="function"&&(h["onUpdate:idValue"]=i.value["onUpdate:idValue"]),()=>o.createVNode(N,o.mergeProps({ref:l},h,{modelValue:s.value,"onUpdate:modelValue":k=>s.value=k}),t.slots)});return o.watch([()=>e.id,()=>e.customClass,()=>e.editor,()=>e.label,()=>e.modelValue,()=>e.readonly,()=>e.required,()=>e.showLabel,()=>e.visible],([S,N,h,_,x,k,T,V,I])=>{var E;n.value=S,r.value=N,i.value=h,a.value=_,s.value=x,c.value=k,u.value=((E=i.value)==null?void 0:E.required)||T,d.value=V,f.value=I}),t.expose({editorRef:l}),()=>f.value&&o.createVNode("div",{id:`${n.value}-input-group`,class:r.value,style:e.customStyle},[o.createVNode("div",{class:"farris-group-wrap"},[o.createVNode("div",{class:v.value},[d.value&&o.createVNode(Ho,{id:`${n.value}-lable`,required:u.value,text:a.value,title:a.value},null),o.createVNode("div",{class:"farris-input-wrap"},[F.value()])])])])}}),nl=new Map([["appearance",ht]]);function ol(e,t,n){return t}const rl={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/input-group.schema.json",title:"input-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"input-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},labelWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabIndex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"enum",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""},addonDisabled:{description:"",type:"boolean",default:!1},addonContent:{description:"",type:"string",default:""},autoHeight:{description:"",type:"boolean",default:!1},enableAddon:{description:"",type:"boolean",default:!1},addonType:{description:"",type:"string",enum:["button","static"],default:"button"},enableClear:{description:"",type:"boolean",default:!0},enableViewPassword:{description:"",type:"boolean",default:!1},inputType:{description:"",type:"string",enum:["input","password","text"],default:"input"},maxHeight:{description:"",type:"number",default:500},popUp:{description:"",type:"object",properties:{footerButtons:{type:"array",default:[]},height:{type:"number",default:600},dataMapping:{type:"object"},contents:{type:"array",default:[]},showMaxButton:{type:"boolean",default:!0},showCloseButton:{type:"boolean",default:!0},showFooter:{type:"boolean",default:!0},title:{type:"string",default:""},width:{type:"number",default:800}}},showButtonWhenDisabled:{description:"",type:"boolean",default:!1},onClear:{description:"",type:"string",default:""}},required:["type"],ignore:["id","appearance","binding","visible"]},zo={id:{Type:String,default:""},autocomplete:{Type:String,default:"off"},customClass:{Type:String,default:""},disabled:{Type:Boolean,default:!1},editable:{Type:Boolean,default:!0},enableClear:{Type:Boolean,default:!0},enableTitle:{Type:Boolean,default:!0},enableViewPassword:{Type:Boolean,default:!0},forcePlaceholder:{Type:Boolean,default:!1},groupText:{Type:String,default:""},type:{Type:String,default:"text"},max:{type:[Number,String]},min:{type:[Number,String]},maxLength:{Type:Number||void 0,default:void 0},minLength:{Type:Number||void 0,default:void 0},modelValue:{Type:String||Boolean,default:""},showBorder:{Type:Boolean,default:!0},step:{Type:Number,default:1},placeholder:{Type:String,default:""},precision:{Type:Number,default:0},readonly:{Type:Boolean,default:!1},showButtonWhenDisabled:{Type:Boolean,default:!1},tabIndex:{Type:Number||void 0,default:void 0},textAlign:{Type:String,default:"left"},useExtendInfo:{Type:Boolean,default:!1},extendInfo:{Type:String,default:""},value:{Type:String,default:""},autoHeight:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},rows:{type:Number,default:2},showCount:{type:Boolean,default:!1},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},updateOn:{type:String,default:"blur"}};Ue(zo,rl,nl,ol);function il(e,t){const n=o.ref(e.groupText),r=o.computed(()=>e.showButtonWhenDisabled&&(e.readonly||e.disabled)),i=o.computed(()=>e.enableClear||!!e.groupText);return{appendedButtonClass:o.computed(()=>({"input-group-append":!0,"append-force-show":r.value})),appendedContent:n,shouldShowAppendedButton:i}}function al(e,t,n,r){const{appendedContent:i}=r,a=o.ref(e.enableViewPassword),s=o.computed(()=>e.type==="password"),c='<span class="f-icon f-icon-eye" style="color: rgb(56, 143, 255);"></span>',u='<span class="f-icon f-icon-eye"></span>',d=o.ref(!1);o.watch(()=>[e.readonly,e.disabled],([p,m])=>{s.value&&(n.value=p||m?"password":n.value,i.value=p||m?u:i.value)});function f(){return d.value=!d.value,n.value=d.value?"text":"password",i.value=d.value?c:u,!1}function l(){n.value=s.value?"password":"text",i.value=s.value?a.value?u:"":i.value}return l(),{isPassword:s,onClickAppendedButton:f}}function sl(e,t,n,r,i){const{appendedButtonClass:a,appendedContent:s}=n,c=o.computed(()=>e.showButtonWhenDisabled&&(!e.editable||!e.readonly)&&!e.disabled),u=o.computed(()=>s.value&&!t.slots.groupTextTemplate),d=o.computed(()=>!!t.slots.groupTextTemplate),{clearButtonClass:f,clearButtonStyle:l,onClearValue:p,shouldShowClearButton:m}=r;function g(){return o.createVNode("span",{id:"clearIcon",class:f.value,style:l.value,onClick:h=>p(h)},[o.createVNode("i",{class:"f-icon modal_close"},null)])}function b(h){t.emit("iconMouseEnter",h)}function v(h){t.emit("iconMouseLeave",h)}function y(h){c.value&&t.emit("clickHandle",{originalEvent:h}),h.stopPropagation()}const C=e.type==="password"?i.onClickAppendedButton:y;function F(){return o.createVNode("span",{class:"input-group-text",onMouseenter:h=>b(h),onMouseleave:h=>v(h),innerHTML:s.value,onClick:h=>C(h)},null)}function w(){return t.slots.groupTextTemplate&&t.slots.groupTextTemplate()}function S(){return u.value?F:d.value?w:""}const N=S();return()=>o.createVNode("div",{class:a.value},[m.value&&g(),N&&N()])}const Vt=class Vt{static getEditorTypesByMDataType(t){const n=Vt.fieldControlTypeMapping[t];return n||[{key:"",value:""}]}static getAllInputTypes(){const t=[];for(const n in Vt.fieldControlTypeMapping)Vt.fieldControlTypeMapping[n].forEach(r=>{t.find(i=>i.key===r.key&&i.value===r.value)||t.push({key:r.key,value:r.value})});return t}static mappingDomPropAndSchemaProp(t){var i;const n=(i=t.editor)==null?void 0:i.type;if(!n)return[];const r=[];switch(r.push({domField:"editor.required",schemaField:"require"}),r.push({domField:"editor.readonly",schemaField:"readonly"}),n){case ae["data-grid-column"].type:case ae["tree-grid-column"].type:{r.push({domField:"title",schemaField:"name"});break}default:r.push({domField:"label",schemaField:"name"})}return(n===ae["input-group"].type||n===ae.textarea.type||n===ae["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),n===ae["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(n===ae["combo-list"].type||n===ae["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),n===ae["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),n===ae["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),n===ae.lookup.type&&(r.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),r.push({domField:"editor.valueField",schemaField:"editor.valueField"}),r.push({domField:"editor.textField",schemaField:"editor.textField"}),r.push({domField:"editor.displayType",schemaField:"editor.displayType"}),r.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),r.push({domField:"editor.helpId",schemaField:"editor.helpId"})),r.push({domField:"path",schemaField:"bindingPath"}),r.push({domField:"binding.path",schemaField:"bindingField"}),r.push({domField:"binding.fullPath",schemaField:"path"}),(n===ae["data-grid-column"].type||n===ae["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};z(Vt,"fieldControlTypeMapping",{String:[{key:ae["input-group"].type,value:ae["input-group"].name},{key:ae.lookup.type,value:ae.lookup.name},{key:ae["date-picker"].type,value:ae["date-picker"].name},{key:ae["check-group"].type,value:ae["check-group"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name},{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae.textarea.type,value:ae.textarea.name}],Text:[{key:ae.textarea.type,value:ae.textarea.name},{key:ae.lookup.type,value:ae.lookup.name}],Decimal:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Integer:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Number:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],BigNumber:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Date:[{key:ae["date-picker"].type,value:ae["date-picker"].name}],DateTime:[{key:ae["date-picker"].type,value:ae["date-picker"].name}],Boolean:[{key:ae.switch.type,value:ae.switch.name},{key:ae["check-box"].type,value:ae["check-box"].name}],Enum:[{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name}],Object:[{key:ae.lookup.type,value:ae.lookup.name},{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name}]});let Yt=Vt;class Go extends Fo{constructor(n,r){super(n,r);z(this,"responseLayoutEditorFunction");this.responseLayoutEditorFunction=Ta(this.formSchemaUtils)}getPropertyConfig(n,r){return this.propertyConfig.categories.basic=this.getBasicProperties(n,r),this.propertyConfig.categories.appearance=this.getAppearanceProperties(n,r),this.propertyConfig.categories.editor=this.getEditorProperties(n),this.propertyConfig}getBasicProperties(n,r){var a;const i=this;return this.setDesignViewModelField(n),{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",refreshPanelAfterChanged:!0,$converter:"/converter/change-editor.converter",editor:{type:"combo-list",textField:"value",valueField:"key",editable:!1,data:i.designViewModelField?Yt.getEditorTypesByMDataType((a=i.designViewModelField.type)==null?void 0:a.name):Yt.getAllInputTypes()}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:n,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"}}},setPropertyRelates(s,c){if(s)switch(s&&s.propertyID){case"type":{i.changeControlType(n,s,r);break}case"label":{s.needRefreshControlTree=!0;break}}}}}getAppearanceProperties(n,r){const i=this;return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的内联样式",$converter:"/converter/appearance.converter"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",initialState:i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(n,i.componentId)}}},setPropertyRelates(a,s){if(a)switch(a&&a.propertyID){case"responseLayout":i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(a.propertyValue,i.componentId||n.id),i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId),i.updateElementByParentContainer(n.id,r),delete n.responseLayout;break;case"class":i.updateUnifiedLayoutAfterControlChanged(a.propertyValue,n.id,this.componentId),i.updateElementByParentContainer(n.id,r);break}}}}getEditorProperties(n){return this.getComponentConfig(n)}changeControlType(n,r,i){var f,l,p,m;const a=r.propertyValue,s=i&&i.parent&&i.parent.schema;if(!s)return;const c=s.contents.findIndex(g=>g.id===n.id),u=s.contents[c];let d;this.designViewModelField&&(this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,{editor:{$type:a},name:this.designViewModelField.name,require:this.designViewModelField.require,readonly:this.designViewModelField.readonly},!1),d=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)),d||(d=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(d,{id:u.id,appearance:u.appearance,size:u.size,label:u.label,binding:u.binding,visible:u.visible}),Object.assign(d.editor,{isTextArea:d.isTextArea&&u.isTextArea,placeholder:(f=u.editor)==null?void 0:f.placeholder,holdPlace:(l=u.editor)==null?void 0:l.holdPlace,readonly:(p=u.editor)==null?void 0:p.readonly,required:(m=u.editor)==null?void 0:m.required}),s.contents.splice(c,1),s.contents.splice(c,0,d),i.schema=Object.assign(u,d),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(g=>g.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(g=>g.classList.remove("dgComponentFocused")),Ut.value++}getComponentConfig(n,r={},i={},a){const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter"},r),c=Object.assign({readonly:{description:"",title:"只读",type:"boolean",editor:{enableClear:!0,editable:!0}},disabled:{description:"",title:"禁用",type:"boolean",visible:!1},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}},i);return{...s,properties:{...c},setPropertyRelates:a}}updateUnifiedLayoutAfterControlChanged(n,r,i){const a=n.split(" ");let s=a.find(l=>/^col-([1-9]|10|11|12)$/.test(l)),c=a.find(l=>/^col-md-([1-9]|10|11|12)$/.test(l)),u=a.find(l=>/^col-xl-([1-9]|10|11|12)$/.test(l)),d=a.find(l=>/^col-el-([1-9]|10|11|12)$/.test(l));s=s||"col-12",c=c||"col-md-"+s.replace("col-",""),u=u||"col-xl-"+c.replace("col-md-",""),d=d||"col-el-"+u.replace("col-xl-","");const f={id:r,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(c.replace("col-md-",""),10),columnInLG:parseInt(u.replace("col-xl-",""),10),columnInEL:parseInt(d.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(i,f)}updateUnifiedLayoutAfterResponseLayoutChanged(n,r){const{formNode:i}=this.responseLayoutEditorFunction.checkCanFindFormNode(n);if(!i||!i.unifiedLayout)return;const a=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i,a,1),r){const g=a.find(b=>b.id===r.id);Object.assign(g||{},r)}const s=a.map(g=>g.columnInSM),c=a.map(g=>g.columnInMD),u=a.map(g=>g.columnInLG),d=a.map(g=>g.columnInEL),f=this.checkIsUniqueColumn(s)?s[0]:null,l=this.checkIsUniqueColumn(c)?c[0]:null,p=this.checkIsUniqueColumn(u)?u[0]:null,m=this.checkIsUniqueColumn(d)?d[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:f,uniqueColClassInMD:l,uniqueColClassInLG:p,uniqueColClassInEL:m})}checkIsUniqueColumn(n){const r=new Set(n);return Array.from(r).length===1}getItemCollectionEditor(n,r,i){return r=r||"value",i=i||"name",{editor:{columns:[{field:r,title:"值",dataType:"string"},{field:i,title:"名称",dataType:"string"},{field:"disabled",title:"禁用",visible:!1,dataType:"boolean",editor:{type:"switch"}}],type:"item-collection-editor",valueField:r,nameField:i,requiredFields:[r,i],uniqueFields:[r,i],readonly:this.checkEnumDataReadonly(n)}}}checkEnumDataReadonly(n){return!n.binding||n.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===Te.FormSchemaEntityFieldType$Type.EnumType)}}class ll extends Go{constructor(t,n){super(t,n)}}function cl(e,t){const n=e.schema;function r(i,a){return new ll(i,t).getPropertyConfig(n,a)}return{getPropsConfig:r}}const ul=o.defineComponent({name:"FInputGroupDesign",props:zo,emits:["updateExtendInfo","clear","valueChange","clickHandle","blurHandle","focusHandle","enterHandle","iconMouseEnter","iconMouseLeave","keyupHandle","keydownHandle","inputClick"],setup(e,t){const n=o.ref(e.modelValue),r=o.ref(e.modelValue),i=Te.useTextBoxDesign(e,t,n,r),{inputGroupClass:a,inputType:s,inputGroupStyle:c}=i,u=il(e),{shouldShowAppendedButton:d}=u,f=Te.useClear(e,t,i),{onMouseEnter:l,onMouseLeave:p}=f,m=al(e,t,s,u),g=o.ref(),b=o.inject("designer-host-service"),v=o.inject("design-item-context"),y=cl(v,b),C=dn.useDesignerComponent(g,v,y);o.onMounted(()=>{g.value.componentInstance=C}),t.expose(C.value);const F=sl(e,t,u,f,m),w=o.ref();return()=>o.createVNode("div",{id:"inputGroup",ref:g,class:a.value,style:c.value,onMouseenter:l,onMouseleave:p},[o.createVNode("input",{ref:w,class:"form-control",readonly:!0,placeholder:e.placeholder},null),d.value&&F()])}});function dl(){function e(i,a){const s=Mo[i];return s?s(a):{}}function t(i){return Io[i]||ul}function n(i){}function r(i){}return{getChangeFunctionName:n,getClearFunctionName:r,resolveEditorProps:e,resolveEditorType:t}}const fl=o.defineComponent({name:"FDynamicFormGroupDesign",props:Wt,emits:["change","update:modelValue"],setup(e,t){var b;const n=o.ref(e.id),r=o.ref(e.customClass),i=o.ref(e.editor),a=o.ref(e.label),s=o.ref(e.modelValue),c=o.ref(!0),u=o.ref(((b=e.editor)==null?void 0:b.required)===!0),d=o.ref(e.showLabel);o.ref(e.type);const f=o.ref(),{resolveEditorProps:l,resolveEditorType:p}=dl(),m=o.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":c.value,"form-group-in-canvas":!0})),g=o.computed(()=>{const v=i.value.type||"input-group",y=p(v),C=l(v,i.value);return()=>o.createVNode(y,o.mergeProps({ref:f},C,{modelValue:s.value,"onUpdate:modelValue":F=>s.value=F}),null)});return o.watch([()=>e.id,()=>e.customClass,()=>e.editor,()=>e.label,()=>e.modelValue,()=>e.readonly,()=>e.showLabel],([v,y,C,F,w,S,N])=>{var h;n.value=v,r.value=y,i.value={...C},a.value=F,s.value=w,c.value=S,u.value=((h=i.value)==null?void 0:h.required)===!0,d.value=N},{deep:!0}),t.expose({editorRef:f}),()=>o.createVNode("div",{id:`${n.value}-input-group`,class:r.value,design_test:!0},[o.createVNode("div",{class:"farris-group-wrap"},[o.createVNode("div",{class:m.value},[d.value&&o.createVNode(Ho,{id:`${n.value}-lable`,required:u.value,text:a.value,title:a.value},null),o.createVNode("div",{class:"farris-input-wrap"},[g.value()])])])])}});function pl(e,t){function n(){return!0}function r(){return!0}function i(){return!1}function a(){return!0}function s(d){var b;const f=t==null?void 0:t.designViewModelUtils,l=t==null?void 0:t.formSchemaUtils,p=(b=e==null?void 0:e.componentInstance.value)==null?void 0:b.belongedComponentId;if(!p||!f||!l)return;const m=l.getViewModelIdByComponentId(p),g=f.getDgViewModel(m);g&&g.removeField([d])}function c(d){const f=t==null?void 0:t.formSchemaUtils;if(f.getExpressions().length){const l=f.getExpressions().findIndex(p=>p.fieldId===d);l>-1&&f.getExpressions().splice(l,1)}}function u(){const{schema:d}=e,f=d.binding&&d.binding.field;f&&(s(f),c(f))}return{canAccepts:i,checkCanDeleteComponent:r,checkCanMoveComponent:n,hideNestedPaddingInDesginerView:a,onRemoveComponent:u}}const ml=o.defineComponent({name:"FFormGroupDesign",props:Wt,emits:[],setup(e,t){const n=o.ref(),r=o.inject("design-item-context"),i=o.inject("designer-host-service"),a=pl(r,i),s=xn(n,r,a);return o.onMounted(()=>{n.value.componentInstance=s,s.value.getPropConfig=(...c)=>{var d,f,l;let u=At[e.editor.type];return u&&Object.keys(u).length===0&&((d=n.value)!=null&&d.editorRef)&&((l=(f=n.value)==null?void 0:f.editorRef)!=null&&l.getPropConfig)&&(u=n.value.editorRef.getPropConfig(...c,s.value)),u}}),t.expose(s.value),()=>o.createVNode(fl,o.mergeProps(e,{ref:n}),null)}});Ue({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number],default:""},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},xo,wn,void 0);const hl={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/grid-field-editor.schema.json",title:"response-form-layout-setting",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"response-form-layout-setting"},initialState:{description:"",type:"object"}},required:["id","type"]},gl={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};jt.createPropsResolver(gl,hl,ba,xa);const yl={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function En(){return new DOMException("The request is not allowed","NotAllowedError")}async function vl(e){if(!navigator.clipboard)throw En();return navigator.clipboard.writeText(e)}async function bl(e){const t=document.createElement("span");t.textContent=e,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const n=window.getSelection(),r=window.document.createRange();n==null||n.removeAllRanges(),r.selectNode(t),n==null||n.addRange(r);let i=!1;try{i=window.document.execCommand("copy")}finally{n==null||n.removeAllRanges(),window.document.body.removeChild(t)}if(!i)throw En()}async function Cl(e){try{await vl(e)}catch(t){try{await bl(e)}catch(n){throw n||t||En()}}}function wl(){async function e(t){await Cl(t)}return{onCopy:e}}function Sl(e,t,n,r){const i=o.ref(14),a=o.ref(140),s=o.ref(""),c=o.ref(r.value.length),u=o.computed(()=>r.value),d=o.computed(()=>({"font-size":`${i.value}px`,height:"100%"}));function f(l){if(l.currentTarget){const p=l.currentTarget.value||"";c.value=p.length}}return()=>o.createVNode(o.Fragment,null,[o.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:d.value,rows:"4",maxlength:a.value,onInput:l=>f(l)},[u.value]),o.createVNode("span",{class:"textarea-wordcount",title:s.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[c.value+" / "+a.value])])}function xl(e,t,n,r){const i=Sl(e,t,n,r),a=new Map([["text-area",i]]);function s(c){return a.get(c)||null}return{getEditorRender:s}}function Fl(){const e=o.ref(!1),t=o.ref("复制成功");return{feedbackStyle:o.computed(()=>{const r={position:"absolute",left:"50%",top:"50%",width:"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease"};return r.opacity=e.value?"0.8":"0",r.display=e.value?"":"none",r}),feedbackMessage:t,toShowFeedback:e}}function Tl(e,t){const n=t.getEditorRender(e.promptEditorType);return()=>n&&n()}function _l(e){const t=o.computed(()=>!!e.value&&!!e.value.date),n=o.computed(()=>`发生时间 : ${e.value&&e.value.date||""}`),r=o.computed(()=>!!e.value&&!!e.value.detail),i=o.computed(()=>"详细信息 : "+(e.value&&e.value.detail||"")),a="exp_switch_"+new Date().getTime();return()=>o.createVNode("div",{class:"toast-msg-detail"},[t.value&&o.createVNode("div",null,[n.value]),r.value&&o.createVNode("div",{class:"exception_wrap"},[o.createVNode("input",{type:"checkbox",id:a,class:"d-none exp_switch"},null),o.createVNode("div",{class:"exception_error_msg"},[o.createVNode("label",{class:"swith",htmlFor:a},null),o.createVNode("div",{innerHTML:i.value},null)])])])}function Nl(e){return()=>o.createVNode("p",{class:"toast-msg-detail",innerHTML:e.value},null)}function Vl(e,t,n,r){const i=o.ref(e.exceptionInfo),a=o.computed(()=>{const p={"f-icon":!0},m=`f-icon-${t.value}`;return p[m]=!0,p}),s=o.computed(()=>n.value||i.value&&i.value.message),c=o.computed(()=>r.value),u=o.computed(()=>!!r.value),d=o.computed(()=>!!i.value);function f(){return d.value?_l(i):u.value?Nl(c):()=>null}const l=f();return()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:a.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[o.createVNode("p",{class:"toast-msg-title",innerHTML:s.value},null),l()])])}function kl(e,t,n){const{onCopy:r}=t,{toShowFeedback:i}=n,a=o.ref("复制成功"),s=o.ref("复制详细信息"),c=o.ref(e.exceptionInfo||{date:"",message:"",detail:""}),u=o.computed(()=>c.value&&c.value.detail||"");function d(f){r(u.value).catch(l=>{a.value="复制失败"}).finally(()=>{i.value=!0,setTimeout(()=>{i.value=!1},700)})}return()=>o.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[o.createVNode("span",{onClick:d,style:"cursor: pointer;"},[s.value])])}function El(e,t,n,r){const i=o.ref(e.type),a=o.ref(e.buttons),s=o.ref(e.exceptionInfo),c=o.ref(e.okButtonText),u=o.ref(e.cancelButtonText),d=o.ref(!0),f=o.ref(!0),l=o.computed(()=>!!(a.value&&a.value.length)),p=o.computed(()=>s.value&&s.value.date&&s.value.message&&s.value.detail),m=o.computed(()=>!(a.value&&a.value.length)&&(c.value||u.value)),g=o.computed(()=>f.value&&c.value),b=o.computed(()=>d.value&&u.value),v=kl(e,n,r);function y(F){i.value==="question"&&t.emit("reject"),t.emit("close")}function C(F){i.value==="question"&&t.emit("accept"),t.emit("close")}return()=>o.createVNode("div",{class:"modal-footer"},[p.value&&v(),m.value&&b.value&&o.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:y},[u.value]),m.value&&g.value&&o.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:C},[c.value]),l.value&&a.value.length&&a.value.map(F=>o.createVNode("button",{type:"button",onClick:F.handle,class:F.class},[F.iconClass&&o.createVNode("span",{class:F.iconClass},null),F.text]))])}const Jt=o.defineComponent({name:"FMessageBox",props:yl,emits:["accept","reject","close"],setup(e,t){const n=o.ref(e.type),r=o.ref(e.title),i=o.ref(e.detail),a=o.computed(()=>{const v={"modal-tips":!0,"d-flex":!0,"flex-row":!0},y=`messager-type-${n.value}`;return v[y]=!0,v}),s=o.computed(()=>{const v={};return n.value==="prompt"?v.padding="0.5rem 0.5rem 1rem 1.5rem":n.value==="error"&&(v.padding="0.5rem 1.5rem 1rem 1.5rem"),v}),c=wl(),u=xl(e,n,r,i),d=Fl(),{feedbackStyle:f,feedbackMessage:l}=d;function p(){return o.createVNode("div",{style:f.value},[l.value])}function m(){switch(n.value){case"prompt":return Tl(e,u);default:return Vl(e,n,r,i)}}const g=m(),b=El(e,t,c,d);return()=>o.createVNode("div",{class:"farris-messager"},[o.createVNode("section",{class:a.value,style:s.value},[g()]),b(),p()])}});class yt{static show(t){const n=o.reactive({...t}),r=!1,i=n.type==="error"||n.type==="prompt",a=n.type==="error"?"错误提示":n.type==="prompt"&&n.title||"",s=n.acceptCallback||(()=>{}),c=n.rejectCallback||(()=>{});let u=null,d=new Po(u);const f=()=>{u&&(u==null||u.destroy(),d=null)};return u=d==null?void 0:d.open({class:"modal-message modal-message-type-info",title:a,showButtons:r,showHeader:i,width:n.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>o.createVNode(Jt,o.mergeProps(n,{onAccept:s,onReject:c,onClose:f}),null)}),d==null?void 0:d.getCurrentModal()}static info(t,n){const r=o.reactive({type:"info",title:t,detail:n,okButtonText:"知道了",cancelButtonText:""});yt.show(r)}static warning(t,n){const r=o.reactive({type:"warning",title:t,detail:n,okButtonText:"知道了",cancelButtonText:""});yt.show(r)}static success(t,n){const r=o.reactive({type:"success",title:t,detail:n,okButtonText:"关闭",cancelButtonText:""});yt.show(r)}static error(t,n,r){const i=o.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:r,message:t,detail:n}});yt.show(i)}static prompt(t,n){const r=o.reactive({type:"prompt",title:t,detail:n,okButtonText:"确定",cancelButtonText:"取消"});yt.show(r)}static question(t,n,r,i){const a=o.reactive({type:"question",title:t,detail:n,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:r,rejectCallback:i});yt.show(a)}}Jt.install=e=>{e.component(Jt.name,Jt),e.provide("FMessageBoxService",yt)};var Tt=(e=>(e[e.Value=0]="Value",e[e.SmartHelp=1]="SmartHelp",e[e.Enum=2]="Enum",e[e.Express=3]="Express",e))(Tt||{});function Xo(){const e=o.ref({relation:0,items:[],children:[],path:[],groupId:0,level:0}),t=new Map,n=new Map;let r=0;function i(){return{id:"",fieldCode:"",fieldName:"",compareType:Je.Equal,valueType:Tt.Value,value:new qt,relation:0,conditionId:Date.now()}}function a(x,k){return{relation:x,items:[],children:[],path:[],groupId:++r,level:k}}function s(){const x=Object.assign({},e.value);n.forEach((k,T)=>{k.groupId===x.groupId&&n.set(T,x)}),t.forEach((k,T)=>{k.groupId===x.groupId&&t.set(T,x)}),e.value=x}function c(x){const k=new Map;let T=0;return x.forEach((V,I)=>{var E,M;if(T+=((E=V.lBracket)==null?void 0:E.length)||0,k.set(I,T),T-=((M=V.rBracket)==null?void 0:M.length)||0,T<0)throw new Error("The right bracket is out of range.")}),k}function u(x,k,T,V,I){for(let E=0;E<k;E++){const M=x+(E+1),B=a(I,M);T.children.push(B),n.set(B.groupId,T),T=T.children[T.children.length-1],V.push(T)}return T}function d(x,k,T,V,I){for(let O=k;O<=0;O++)V.pop();const E=V[V.length-1];if(!E)throw new Error("The group path is out of range");const M=x+k,B=a(I,M);return E.children.push(B),n.set(B.groupId,E),T=E.children[E.children.length-1],V.push(T),T}function f(x,k,T,V){T.pop();const I=T[T.length-1],E=a(V,x);return I.children.push(E),n.set(E.groupId,I),k=I.children[I.children.length-1],T.push(k),k}function l(x,k,T,V,I,E){let M=x[x.length-1];if(!M)throw new Error("The group path is out of range");const B=k.get(V)||0,O=k.get(T)||0;if(T<0||T===V)return x[x.length-1];const R=B-O,q=I&&I.relation!==void 0?I.relation:1;return M=R>0?u(O,R,M,x,q):M,M=R<0?d(O,R,M,x,q):M,M=R===0&&O>0&&B>0&&I&&E&&!!I.rBracket&&!!E.lBracket?f(O,M,x,q):M,M}function p(x){const T={relation:x.length&&x[0].relation!==void 0?x[0].relation:1,items:[],children:[],path:[],groupId:0,level:0},V=[T],I=c(x);return x.forEach((E,M)=>{const B=M-1,O=x[B],R=l(V,I,B,M,O,E);R.items.push(E),t.set(E.conditionId,R)}),e.value=T,T}function m(){const x=i();t.set(x.conditionId,e.value),e.value.items.push(x)}function g(x){if(!x)return;const k=t.get(x.conditionId);if(k){const T=k.items.findIndex(I=>I.conditionId===x.conditionId)+1,V=i();t.set(V.conditionId,k),k.items.splice(T,0,V),s()}}function b(x,k,T,V){x.reduce((I,E)=>{const M=E.conditionId!==void 0,B=E.groupId!==void 0;if(M){const O=E;T.push(O),I.items.set(O.conditionId,O)}if(B){const O=E;V.push(O),I.groups.set(O.groupId,O)}return I},k)}function v(x,k,T,V,I){x&&(x.items=k.length?x.items.filter(E=>!T.has(E.conditionId)):x.items,x.children=V.length?x.children.filter(E=>!I.has(E.groupId)):x.children)}function y(x,k,T){k.forEach(V=>{x.items.push(V),t.set(V.conditionId,x)}),T.forEach(V=>{x.children.push(V),n.set(V.groupId,x)})}function C(x){const k=x[0],T=k.conditionId!==void 0?t.get(k.conditionId):n.get(k.groupId),V={items:new Map,groups:new Map},I=[],E=[];if(T){b(x,V,I,E),v(T,I,V.items,E,V.groups);const M=a(T.relation,T.level+1);y(M,I,E),T.children.push(M),n.set(M.groupId,T),s()}}function F(x){const k=[...x.items],T=[...x.children],V=n.get(x.groupId);V&&(V.children=V.children.filter(I=>I.groupId!==x.groupId),n.delete(x.groupId),k.forEach(I=>{V.items.push(I),t.set(I.conditionId,V)}),T.forEach(I=>{V.children.push(I),n.set(I.groupId,V)}),s())}function w(x){x.relation=x.relation===1?2:1,s()}let S;function N(x){const{relation:k}=x;return(x.children&&x.children.length?x.children.map((V,I,E)=>{const M=S(V);return M[0].lBracket=(M[0].lBracket||"")+"(",M[M.length-1].rBracket=(M[M.length-1].rBracket||"")+")",M[M.length-1].relation=I<E.length-1?k:0,M}):[]).flat()}S=(x=e.value)=>{const{relation:k}=x,T=x.items.map((I,E,M)=>(I.lBracket=E===0?"(":"",I.rBracket=E===M.length-1?")":"",I.relation=E<M.length-1?k||1:0,I)),V=N(x);return[...T,...V]};function h(x){const k=x||e.value;if(k.children.length&&k.children.forEach(T=>{h(T)}),k.level===0&&!k.items.length&&k.children.length===1){const T=k.children[0];e.value.relation=T.relation,F(T)}else k.items.length===0&&k.children.length<=1&&F(k)}function _(x){const k=t.get(x.conditionId);k&&(k.items=k.items.filter(T=>T.conditionId!==x.conditionId),t.delete(x.conditionId),h(),s())}return{addCondition:m,changeGroupRelation:w,conditionGroupMap:t,getConditions:S,group:C,groupParentMap:n,insertConditionTo:g,loadConditionGroup:p,refresh:s,removeCondition:_,rootGroup:e,unGroup:F}}function Il(e,t,n){const r=o.ref(new Set),i=o.ref(new Set),{conditionGroupMap:a,groupParentMap:s}=n;let c,u;function d(y){let C=c.level<=y.level?c:y,F=c.level>y.level?c:y;const w=[];for(;F&&C&&F!==C;)F.level>C.level?(w.push(F),F=s.get(F.groupId)):F.level===C.level&&(C=s.get(C.groupId),C&&w.unshift(C));return w}function f(y){i.value.add(y.groupId),y.items.forEach(C=>r.value.add(C.conditionId)),y.children.forEach(C=>f(C))}function l(y){const{conditionId:C}=y;r.value.add(C),c=r.value.size===0?a.get(C):c;const F=a.get(y.conditionId);d(F).forEach(S=>f(S))}const p=o.computed(()=>r.value.size===0&&i.value.size===1),m=function(y){i.value.delete(y.groupId),y.items.forEach(F=>u(F)),y.children.forEach(F=>!p.value&&m(F));const C=s.get(y.groupId);C&&i.value.has(C.groupId)&&m(C)};u=function(y){const{conditionId:C}=y;if(r.value.has(C)&&r.value.delete(C),i.value.size>0){const F=a.get(C);F&&i.value.has(F.groupId)&&m(F)}};function g(y){const{conditionId:C}=y;r.value.size===0&&(c=a.get(C)),r.value.has(C)?u(y):l(y)}function b(){const y=[];return c&&(c.items.filter(C=>r.value.has(C.conditionId)).forEach(C=>y.push(C)),c.children.filter(C=>i.value.has(C.groupId)).forEach(C=>y.push(C))),y}function v(){r.value.clear(),i.value.clear()}return{clear:v,getSelectedGroupItem:b,selectedItems:r,toggleSelect:g}}const Qt=o.defineComponent({name:"FConditionList",props:bn,emits:["valueChange","labelCodeChange","compareTypeChange"],setup(e,t){const n=o.ref(e.key),r=o.ref(e.conditions),i=Cn(e),{convertToSingleControl:a,fields:s,fieldMap:c,loadFieldConfigs:u}=i,d=Xo(),{addCondition:f,changeGroupRelation:l,getConditions:p,group:m,insertConditionTo:g,loadConditionGroup:b,refresh:v,removeCondition:y,rootGroup:C,unGroup:F}=d,{createConditionValue:w}=wo(),S=Il(e,t,d),{selectedItems:N,toggleSelect:h}=S,{getCompareOperators:_}=ya(e,t,i);u(!1),s.value=a(s.value),b(r.value);function x(te){var ue;const ie=((ue=c.get(te.fieldCode))==null?void 0:ue.editor)||{type:"text"};te.value=w(ie.type,void 0),t.emit("labelCodeChange",te)}function k(te,ie){t.emit("compareTypeChange",ie)}function T(){}t.expose({getConditions:p});function V(te,ie){t.emit("valueChange",te,ie)}function I(te){return o.createVNode("div",{class:"condition-list-item-type mr-3"},[o.createVNode(pn,{"value-field":"labelCode","text-field":"name","id-field":"id",data:s.value,modelValue:te.fieldCode,"onUpdate:modelValue":ie=>te.fieldCode=ie,onChange:ie=>x(te)},null)])}function E(te){return o.createVNode("div",{class:"condition-list-item-compare mr-3"},[o.createVNode(pn,{"value-field":"value","text-field":"name","id-field":"id",data:_(te),modelValue:te.compareType,"onUpdate:modelValue":ie=>te.compareType=ie,onChange:ie=>k(ie,te)},null)])}function M(te){var ie;return o.createVNode("div",{class:"condition-list-item-control mr-3"},[o.createVNode(Uo,{editor:(ie=c.get(te.fieldCode))==null?void 0:ie.editor,showLabel:!1,modelValue:te.value.value,"onUpdate:modelValue":ue=>te.value.value=ue,onChange:ue=>{V(ue,te)}},null)])}function B(te){return[o.createVNode("div",{class:"condition-list-item-extend"},[o.createVNode("span",{class:"f-icon f-icon-plus-sm mr-2",onClick:()=>g(te)},null),o.createVNode("span",{class:"f-icon f-icon-minus-sm",onClick:()=>y(te)},null)]),o.createVNode("div",{class:"custom-control custom-checkbox"},[o.createVNode("input",{title:"selection",class:"custom-control-input",type:"checkbox",checked:N.value.has(te.conditionId)},null),o.createVNode("label",{class:"custom-control-label",onClick:()=>h(te)},null)])]}function O(te){return te.items.map(ie=>o.createVNode("div",{class:"condition-list-item",key:ie.conditionId},[I(ie),E(ie),M(ie),B(ie)]))}function R(te){return o.createVNode("div",{class:"condition-list-relation"},[o.createVNode("span",{class:"condition-list-relation-close f-icon-filter-cancel btn-link",onClick:()=>F(te)},null),o.createVNode("span",{class:"condition-list-relation-text btn-link",onClick:()=>l(te)},[te.relation===1?"与":"或"])])}function q(te){return o.createVNode("div",{class:"condition-list-content"},[o.createVNode("div",{class:"condition-list-content-group"},[O(te),te.children&&te.children.map(ie=>q(ie))]),R(te)])}function L(){m(S.getSelectedGroupItem()),S.clear()}function X(){return o.createVNode("div",{class:"condition-list-bottom"},[o.createVNode("div",{class:"add-condition-btn mb-1 mr-3",onClick:f},[o.createVNode("span",{class:"f-icon f-icon-filter-add"},null),o.createVNode("span",{class:"ml-1"},[o.createTextVNode("添加条件")])]),o.createVNode("div",{class:"add-condition-btn mb-1",onClick:L},[o.createVNode("span",{class:"f-icon f-icon-filter-grouping"},null),o.createVNode("span",{class:"ml-1"},[o.createTextVNode("生成条件组")])]),o.createVNode("div",{class:"condition-list-reset add-condition-btn",onClick:T},[o.createTextVNode("重置")])])}return()=>o.createVNode("div",{class:"condition-list",key:n.value},[o.createVNode("div",{class:"condition-list-body"},[q(C.value)]),X()])}});Qt.install=e=>{e.component(Ht.name,Ht).component(Qt.name,Qt)};function Ml(e,t){return{solutions:[{id:"default",code:"default",name:"默认筛选方案",conditions:t.map((i,a)=>{const{id:s,labelCode:c,name:u}=i,d=Je.Equal,f=Tt.Value;return{id:s,fieldCode:c,fieldName:u,compareType:d,valueType:f,value:{},conditionId:a}}),isSystem:!0,isDefault:!0,type:"",mode:"1"}]}}const Ol=new Map([["appearance",ht],["preset",Ml]]),Bl={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/query-solution.schema.json",title:"query-solution",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a query solution",type:"string"},type:{description:"The type string of query solution component",type:"string",default:"query-solution"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},formId:{description:"",type:"string",default:!0},isControlInline:{description:"",type:"boolean",default:!0},expanded:{description:"",type:"boolean",default:!0},fields:{description:"",type:"array",default:[]},presetFields:{description:"",type:"array"},solutions:{description:"",type:"array"},presetQuerySolutionName:{description:"",type:"string",default:"默认筛选方案"},filterText:{description:"",type:"string",default:"筛选"}}};function Yo(){function e(){const n=r=>{const i=Math.random()*16|0;return(r==="x"?i:i&3|8).toString(16)};return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n)}function t(n,r){const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=[];let s;if(r=r||i.length,n)for(s=0;s<n;s++)a[s]=i[0|Math.random()*r];else{let c;for(a[8]=a[13]=a[18]=a[23]="-",a[14]="4",s=0;s<36;s++)a[s]||(c=0|Math.random()*16,a[s]=i[s===19?c&3|8:c])}return a.join("")}return{guid:e,uuid:t}}const Pl=["moz","ms","webkit"];function Rl(){let e=0;return t=>{const n=new Date().getTime(),r=Math.max(0,16-(n-e)),i=setTimeout(()=>{t(n+r)},r);return e=n+r,i}}function jl(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const e=Pl.filter(t=>`${t}RequestAnimationFrame`in window)[0];return e?window[`${e}RequestAnimationFrame`]:Rl()}jl();function $l(e,t){const n=t==null?void 0:t.formSchemaUtils,r=e.parentComponentInstance,i="54bddc89-5f7e-4b91-9c45-80dd6606cfe9";function a(c){const u=r.belongedComponentId,d=n.getViewModelIdByComponentId(u),f=n.getViewModelById(d);let l;if(f&&f.commands){let m=f.commands.find(b=>b.handlerName==="Filter"&&b.cmpId===i);if(!m)l=Yo().guid(),m={id:l,code:"rootviewmodelFilter1",name:"过滤并加载数据1",params:[{name:"filter",shownName:"过滤条件",value:"{UISTATE~/#{root-component}/originalFilterConditionList}"},{name:"sort",shownName:"排序条件",value:""}],handlerName:"Filter",cmpId:i,shortcut:{},extensions:[]},f.commands.push(m);else if(m.params&&m.params.length){const b=m.params.find(v=>v.name==="filter");b&&(b.value="{UISTATE~/#{root-component}/originalFilterConditionList}")}const g=m.code;c.onQuery=g}const p=n.getFormSchema().module.webcmds;if(p){let m=p.find(g=>g.id===i);m||(m={id:i,path:"igix/Web/WebCmp/bo-webcmp/metadata/webcmd/data-commands",name:"LoadCommands.webcmd",refedHandlers:[]},n.getFormSchema().module.webcmds.push(m)),l&&m.refedHandlers.push({host:l,handler:"Filter"})}}function s(){const c=Dt(ae.section.type),u=Dt(ae["query-solution"].type);if(!c||!u)return;const d=Math.random().toString(36).slice(2,6);Object.assign(c,{id:"solution-container-"+d,appearance:{class:"f-section-scheme f-section-in-managelist"},showHeader:!1,contents:[u]}),Object.assign(u,{id:"solution-"+d,fields:[],presetFields:[],formId:n.getFormMetadataBasicInfo().code});const f=r.schema;f&&(f.appearance?f.appearance.class&&!f.appearance.class.includes("f-page-has-scheme")&&(f.appearance.class+=" f-page-has-scheme"):f.appearance.class="f-page-has-scheme");const l=r.belongedComponentId,p=n.getViewModelIdByComponentId(l),m=n.getViewModelById(p);m!=null&&m.states&&(m.states.find(b=>b.code==="originalFilterConditionList")||m.states.push({id:Yo().guid(),category:"locale",code:"originalFilterConditionList",name:"筛选方案筛选条件",type:"String"})),a(u);const g=t==null?void 0:t.useFormCommand;return g&&g.checkCommands(),c}return{createQuerySolution:s}}function Dl(e,t,n,r){if(n.parentComponentInstance&&r){const s=$l(n,r).createQuerySolution();if(s)return s}return t}const Kt={formId:{type:String,default:""},fields:{type:Array,default:[]},presetFields:{type:Array,default:[]},solutions:{type:Array,default:[]},isControlInline:{type:Boolean,default:!0},filterText:{type:String,default:"筛选"},expanded:{type:Boolean,default:!0},openAdvancedMode:{type:Boolean,default:!1},presetQuerySolutionName:{type:String,default:"默认筛选方案"}},In=Ue(Kt,Bl,Ol,Dl);var at=(e=>(e[e.Value=0]="Value",e[e.Express=1]="Express",e))(at||{}),Ae=(e=>(e[e.Empty=0]="Empty",e[e.And=1]="And",e[e.Or=2]="Or",e))(Ae||{}),ze=(e=>(e[e.Equal=0]="Equal",e[e.NotEqual=1]="NotEqual",e[e.Greater=2]="Greater",e[e.GreaterOrEqual=3]="GreaterOrEqual",e[e.Less=4]="Less",e[e.LessOrEqual=5]="LessOrEqual",e[e.Like=6]="Like",e[e.LikeStartWith=7]="LikeStartWith",e[e.LikeEndWith=8]="LikeEndWith",e[e.NotLike=9]="NotLike",e[e.NotLikeStartWith=10]="NotLikeStartWith",e[e.NotLikeEndWith=11]="NotLikeEndWith",e[e.Is=12]="Is",e[e.IsNot=13]="IsNot",e[e.In=14]="In",e[e.NotIn=15]="NotIn",e))(ze||{});function Al(e,t){function n(l){const p=l.value,m=[];return m.push({FilterField:l.fieldCode,Compare:l.compareType||l.compareType===0?l.compareType:ze.Like,Value:p.value,Relation:l.relation||l.relation===0?l.relation:Ae.And,Expresstype:at.Value,Lbracket:l.Lbracket||null,Rbracket:l.Rbracket||null}),m}function r(l){const p=l.value.getValue();return[{FilterField:l.fieldCode,Compare:l.compareType||l.compareType===0?l.compareType:ze.Equal,Value:p,Relation:l.relation||l.relation===0?l.relation:Ae.And,Expresstype:at.Value,Lbracket:l.Lbracket||null,Rbracket:l.Rbracket||null}]}function i(l){const p=[],m=l.value.getValue();return m.begin!=null&&p.push({FilterField:l.fieldCode,Compare:ze.GreaterOrEqual,Value:m.begin,Relation:Ae.And,Expresstype:at.Value}),m.end!=null&&p.push({FilterField:l.fieldCode,Compare:ze.LessOrEqual,Value:m.end,Relation:Ae.And,Expresstype:at.Value}),p}function a(l){const p=[],m=l.value.getValue();return m===""?[]:(m.split(",").forEach(g=>{g&&p.push({FilterField:l.fieldCode,Compare:l.compareType||l.compareType===0?l.compareType:ze.Equal,Value:g,Relation:l.compareType===ze.NotEqual?Ae.And:Ae.Or,Expresstype:at.Value})}),p.length>0?(p[0].Lbracket=l.Lbracket?l.Lbracket+"(":"(",p[p.length-1].Rbracket=l.Rbracket?l.Rbracket+")":")",p[p.length-1].Relation=l.relation||l.relation===0?l.relation:Ae.And,p):[])}function s(l){const p=[],m=l.value.getValue();return p.push({FilterField:l.fieldCode,Compare:l.compareType||l.compareType===0?l.compareType:ze.Equal,Value:m,Relation:l.relation||l.relation===0?l.relation:Ae.And,Expresstype:at.Value,Lbracket:l.Lbracket||null,Rbracket:l.Rbracket||null}),p}function c(l,p){const m=[],g=l.value.getValue();return p.editor.enumValueType==="string"?(g.split(",").forEach(b=>{m.push({FilterField:l.fieldCode,Compare:l.compareType||l.compareType===0?l.compareType:ze.Equal,Value:b,Relation:l.compareType===ze.NotEqual?Ae.And:Ae.Or,Expresstype:at.Value})}),m[0].Lbracket=l.Lbracket?l.Lbracket+"(":"(",m[m.length-1].Rbracket=l.Rbracket?l.Rbracket+")":")",m[m.length-1].Relation=l.relation||l.relation===0?l.relation:Ae.And):(p.editor.enumValueType==="int"||p.editor.enumValueType==="boolean")&&m.push({FilterField:l.fieldCode,Compare:l.compareType||l.compareType===0?l.compareType:ze.Equal,Value:g,Relation:l.compareType===ze.NotEqual?Ae.And:Ae.Or,Expresstype:at.Value}),m}function u(l){const p=l.value.getValue();return[{FilterField:l.fieldCode,Compare:l.compareType||l.compareType===0?l.compareType:ze.Equal,Value:p,Relation:l.relation||l.relation===0?l.relation:Ae.And,Expresstype:at.Value,Lbracket:l.Lbracket||null,Rbracket:l.Rbracket||null}]}function d(l,p){let m=[];switch(l.value.editorType){case"input-group":m=n(l);break;case"number-spinner":m=r(l);break;case"number-range":m=i(l);break;case"lookup":m=a(l);break;case"date-picker":m=s(l);break;case"combo-list":m=c(l,p);break;case"radio-group":m=u(l);break;default:m=[]}return m}function f(l,p){const m=[];return l.forEach(g=>{if(!g.value.isEmpty()){const b=p.find(y=>y.id===g.id),v=d(g,b);m.push(...v)}}),m}return{getFilterConditions:f}}function Ll(e,t,n,r,i,a){const{createConditionValue:s}=zr.useConditionValue(),{getFilterConditions:c}=Al(),{loadSolution:u}=n;function d(){return((1+Math.random())*65536|0).toString(16).substring(1)}function f(){return d()+d()+"-"+d()+"-"+d()+"-"+d()+"-"+d()+d()+d()}function l(b){const v={id:b.id,fieldCode:b.labelCode,fieldName:b.name,required:b.editor.required,value:s(b.controlType)};return b.controlType==="lookup"&&(v.value.valueField=b.editor.valueField),v}function p(){return{id:f(),code:"Default",name:e.presetQuerySolutionName||"默认筛选条件",belongId:e.formId,mode:"1",type:"preset",isDefault:!1,isSystem:!0,conditions:e.presetFields.map(v=>l(v))}}function m(){var y;const b=(y=i.value)==null?void 0:y.conditions.filter(C=>{var F;return!((F=C.value)!=null&&F.isEmpty())}),v=c(b,a.value);t.emit("conditionChange",v)}function g(){u().then(b=>{if(b&&b.data){const v=b.data.map(y=>{const C=JSON.parse(y.queryConditionString);return y.conditions=C.filter(F=>a.value.find(w=>w.labelCode===F.fieldCode)).map(F=>{var w;return F.value=s((w=F.value)==null?void 0:w.editorType,F.value),F}),y});if(!v.length){const y=p();v.push(y)}if(r.value=v,i.value){const y=r.value.find(C=>{var F;return C.id===((F=i.value)==null?void 0:F.id)});y?i.value=be.cloneDeep(y):i.value=be.cloneDeep(r.value[0])}else i.value=be.cloneDeep(r.value[0]);m()}}).catch(()=>{const b=p();r.value=[b],i.value=be.cloneDeep(b)})}return{getDefaultSolution:p,loadAllSolution:g,getGuid:f,handleQuery:m,fieldToCondition:l}}const ql={solutions:{type:Array,default:[]}},Hl=o.defineComponent({name:"FSolutionManager",props:ql,emits:["changeDelete"],setup(e,t){const n=[{field:"code",title:"名称",width:80,resizable:!0,dataType:"string"},{field:"type",title:"类型",width:200,dataType:"string",editor:{type:"combo-list",data:[{id:"private",name:"用户个人方案"}]}}],r={private:"用户个人方案",public:"系统公共方案",org:"组织公共方案"},i=o.ref([]),a=o.ref([]),s=o.ref();function c(){const f=e.solutions.filter(l=>!i.value.includes(l.id)&&!l.isSystem).map(l=>({id:l.id,code:l.code,type:r[l.type]}));a.value=f,s.value.updateDataSource(f)}o.onMounted(()=>{c()});function u(f){const l=f.raw.id;i.value.includes(l)||(i.value=[...i.value,l],t.emit("changeDelete",i.value),c())}function d(){const f={enable:!0,commands:[{text:"删除",type:"danger",command:"remove",onClick(l,p,m){u(m)}}]};return o.createVNode(no.FDataGrid,{ref:s,columns:n,data:a.value,commandOption:f,columnOption:{fitColumns:!0}},null)}return()=>o.createVNode("div",{class:"ml-3 mr-3 w-100 h-100"},[d()])}});function Wl(e,t,n,r,i,a,s){const c=[{id:"private",text:"用户个人方案"}],u=new Ri.FNotifyService,d=o.ref(""),f=o.ref("private"),l=o.ref([]),p=o.ref([]),m=o.ref(e.expanded),{createSolution:g,updateSolution:b,getAuth:v,batchUpdate:y}=n,{getGuid:C,loadAllSolution:F,handleQuery:w,fieldToCondition:S}=r,N=o.inject(Hr.F_MODAL_SERVICE_TOKEN,null),h=o.computed(()=>a.value?a.value.name:""),_=o.computed(()=>!a.value||a.value.mode!=="2"),x=o.ref(!1),k=o.computed(()=>({"dropdown-menu":!0,show:x.value})),T=o.computed(()=>({"z-index":99}));function V(me){a.value=me,w()}function I(){var me;try{(me=a.value)==null||me.conditions.map(G=>{if(G.required&&(!G.value||G.value.isEmpty()))throw"查询前请填写必填项:"+G.fieldName}),t.emit("query")}catch(G){u.warning({message:G,position:"top-center"})}}const E=o.computed(()=>({transform:m.value?"rotate(0deg)":"rotate(180deg)"}));function M(){if(!a.value){console.warn("no querysolution");return}a.value.conditions.forEach(me=>{me.value&&me.value.clear()}),w()}function B(){a.value&&v().then(me=>{const{data:G}=me,Q=be.cloneDeep(a.value);if(!G.success&&(Q.type==="public"||Q.type==="org")){u.warning({message:"您暂无权限修改公共类型方案。",position:"top-center"});return}else Q.queryConditionString=JSON.stringify(Q.conditions),b(Q).then(ee=>F()),t.emit("save",a.value)})}function O(){return o.createVNode("div",{class:"m-3"},[o.createVNode("div",{class:"farris-group-wrap"},[o.createVNode("div",{class:"form-group farris-form-group"},[o.createVNode("div",{class:"farris-input-wrap"},[o.createVNode(oo.FInputGroup,{modelValue:d.value,"onUpdate:modelValue":me=>d.value=me},null)])])]),o.createVNode(ro,{data:c,name:"",textField:"text",valueField:"id",modelValue:f.value,"onUpdate:modelValue":me=>f.value=me},null)])}function R(){if(a.value){if(!d.value){u.warning({message:"请填写方案名称",position:"top-center"});return}}else return;v().then(me=>{const{data:G}=me;if(!G.success&&(f.value==="public"||f.value==="org")){u.warning({message:"您暂无权限修改公共类型方案。",position:"top-center"});return}else{const Q=be.cloneDeep(a.value);Q.id=C(),Q.isSystem=!1,Q.code=d.value,Q.name=d.value,Q.type=f.value,Q.queryConditionString=JSON.stringify(Q.conditions),g(Q).then(ee=>F()),f.value="private",d.value=""}})}function q(){f.value="private",d.value=""}function L(){const me=e.formId,G=l.value;y({belongId:me,deletedIds:G}).then(Q=>{F()}),l.value=[]}function X(){l.value=[]}function te(me){l.value=me}function ie(){N==null||N.open({width:600,height:600,title:"新增方案",acceptCallback:R,rejectCallback:q,render:()=>O()}),t.emit("saveAs",a.value)}function ue(){N==null||N.open({width:600,height:550,fitContent:!1,title:"方案管理",acceptCallback:L,rejectCallback:X,render:()=>o.createVNode(Hl,{solutions:i.value,onChangeDelete:te},null)})}function $(){var G;const me=i.value.map(Q=>o.createVNode("li",{class:"dropdown-item",onClick:()=>V(Q)},[Q.name]));return me.push(o.createVNode("li",{class:"solution-header-title-btns"},[!((G=a.value)!=null&&G.isSystem)&&o.createVNode("span",{class:"dropdown-item-btn f-cursor-pointer",onClick:B},[o.createTextVNode("保存")]),o.createVNode("span",{class:"dropdown-item-btn f-cursor-pointer ml-2 mr-2",onClick:ie},[o.createTextVNode("另存为")]),o.createVNode("span",{class:"dropdown-item-btn f-cursor-pointer ml-2 mr-2",onClick:ue},[o.createTextVNode("管理")])])),o.createVNode("ul",{class:k.value},[me])}function ne(me){me.stopPropagation(),x.value=!x.value}function pe(){return o.createVNode("div",null,null)}function oe(){if(a.value){const me=a.value.conditions||[],G=[];p.value.forEach(Q=>{const ee=me.find(re=>re.id===Q.id);if(ee)G.push(ee);else{const re=s.value.find(U=>U.id===Q.id);re&&G.push(S(re))}}),a.value.conditions=G}p.value=[],w()}function A(){p.value=[]}function Y(me){p.value=me}function we(){var Q;p.value=[];const me=((Q=a.value)==null?void 0:Q.conditions.map(ee=>({id:ee.id||"",name:ee.fieldName||""})))||[],G=s.value.map(ee=>({id:ee.id,name:ee.name}))||[];p.value=me,N==null||N.open({width:900,height:600,title:"筛选条件配置",acceptCallback:oe,rejectCallback:A,render:()=>o.createVNode(fn.FTransfer,{selections:me,"data-source":G,class:"query-solution-config-transfer ml-3",onChange:Y},null)})}function Ce(){m.value=!m.value}function je(){return o.createVNode("div",{class:"solution-action"},[o.createVNode("div",{class:"btn-group"},[o.createVNode("button",{type:"button",class:"btn btn-primary ",onClick:I},[e.filterText])]),_.value&&o.createVNode("div",{class:"icon-group ml-2",onClick:M},[o.createVNode("span",{class:"f-icon f-icon-remove f-cursor-pointer"},null)]),E.value&&o.createVNode("div",{class:"icon-group ml-2",onClick:we},[o.createVNode("span",{class:"f-icon f-icon-home-setup f-cursor-pointer"},null)]),o.createVNode("div",{class:"icon-group ml-2",onClick:Ce},[o.createVNode("span",{class:"f-icon f-icon-packup f-cursor-pointer",style:E.value},null)])])}function $e(){return o.createVNode("div",{class:"solution-header"},[o.createVNode("div",{class:"btn-group mr-3",onClick:ne},[o.createVNode("div",{class:"solution-header-title"},[h.value,o.createVNode("span",{class:"f-icon f-accordion-expand"},null)]),$(),x.value&&o.createVNode("div",{class:"position-fixed w-100 h-100",style:T.value,onClick:ne},null)]),pe(),je()])}function Be(){s.value=e.fields.map(me=>{const G=be.cloneDeep(me);return G.editor.type||(G.editor.type=me.controlType),(G.editor.type==="number-spinner"||G.editor.type==="number-range")&&(G.editor.showZero=!0,G.editor.nullable=!0),G.editor.type==="combo-list"&&(G.editor.enableClear=!0),G})}return{expanded:m,renderHeader:$e,loadFields:Be}}function Jo(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ul}=Object.prototype,{getPrototypeOf:Mn}=Object,Zt=(e=>t=>{const n=Ul.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),nt=e=>(e=e.toLowerCase(),t=>Zt(t)===e),en=e=>t=>typeof t===e,{isArray:_t}=Array,Ot=en("undefined");function zl(e){return e!==null&&!Ot(e)&&e.constructor!==null&&!Ot(e.constructor)&&Ge(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Qo=nt("ArrayBuffer");function Gl(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Qo(e.buffer),t}const Xl=en("string"),Ge=en("function"),Ko=en("number"),tn=e=>e!==null&&typeof e=="object",Yl=e=>e===!0||e===!1,nn=e=>{if(Zt(e)!=="object")return!1;const t=Mn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Jl=nt("Date"),Ql=nt("File"),Kl=nt("Blob"),Zl=nt("FileList"),ec=e=>tn(e)&&Ge(e.pipe),tc=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ge(e.append)&&((t=Zt(e))==="formdata"||t==="object"&&Ge(e.toString)&&e.toString()==="[object FormData]"))},nc=nt("URLSearchParams"),[oc,rc,ic,ac]=["ReadableStream","Request","Response","Headers"].map(nt),sc=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Bt(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),_t(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),s=a.length;let c;for(r=0;r<s;r++)c=a[r],t.call(null,e[c],c,e)}}function Zo(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const St=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,er=e=>!Ot(e)&&e!==St;function On(){const{caseless:e}=er(this)&&this||{},t={},n=(r,i)=>{const a=e&&Zo(t,i)||i;nn(t[a])&&nn(r)?t[a]=On(t[a],r):nn(r)?t[a]=On({},r):_t(r)?t[a]=r.slice():t[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Bt(arguments[r],n);return t}const lc=(e,t,n,{allOwnKeys:r}={})=>(Bt(t,(i,a)=>{n&&Ge(i)?e[a]=Jo(i,n):e[a]=i},{allOwnKeys:r}),e),cc=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),uc=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},dc=(e,t,n,r)=>{let i,a,s;const c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],(!r||r(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=n!==!1&&Mn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},fc=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},pc=e=>{if(!e)return null;if(_t(e))return e;let t=e.length;if(!Ko(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},mc=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Mn(Uint8Array)),hc=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},gc=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},yc=nt("HTMLFormElement"),vc=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),tr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),bc=nt("RegExp"),nr=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Bt(n,(i,a)=>{let s;(s=t(i,a,e))!==!1&&(r[a]=s||i)}),Object.defineProperties(e,r)},Cc=e=>{nr(e,(t,n)=>{if(Ge(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ge(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wc=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return _t(e)?r(e):r(String(e).split(t)),n},Sc=()=>{},xc=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Bn="abcdefghijklmnopqrstuvwxyz",or="0123456789",rr={DIGIT:or,ALPHA:Bn,ALPHA_DIGIT:Bn+Bn.toUpperCase()+or},Fc=(e=16,t=rr.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Tc(e){return!!(e&&Ge(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const _c=e=>{const t=new Array(10),n=(r,i)=>{if(tn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const a=_t(r)?[]:{};return Bt(r,(s,c)=>{const u=n(s,i+1);!Ot(u)&&(a[c]=u)}),t[i]=void 0,a}}return r};return n(e,0)},Nc=nt("AsyncFunction"),Vc=e=>e&&(tn(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),ir=((e,t)=>e?setImmediate:t?((n,r)=>(St.addEventListener("message",({source:i,data:a})=>{i===St&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),St.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ge(St.postMessage)),kc=typeof queueMicrotask<"u"?queueMicrotask.bind(St):typeof process<"u"&&process.nextTick||ir,j={isArray:_t,isArrayBuffer:Qo,isBuffer:zl,isFormData:tc,isArrayBufferView:Gl,isString:Xl,isNumber:Ko,isBoolean:Yl,isObject:tn,isPlainObject:nn,isReadableStream:oc,isRequest:rc,isResponse:ic,isHeaders:ac,isUndefined:Ot,isDate:Jl,isFile:Ql,isBlob:Kl,isRegExp:bc,isFunction:Ge,isStream:ec,isURLSearchParams:nc,isTypedArray:mc,isFileList:Zl,forEach:Bt,merge:On,extend:lc,trim:sc,stripBOM:cc,inherits:uc,toFlatObject:dc,kindOf:Zt,kindOfTest:nt,endsWith:fc,toArray:pc,forEachEntry:hc,matchAll:gc,isHTMLForm:yc,hasOwnProperty:tr,hasOwnProp:tr,reduceDescriptors:nr,freezeMethods:Cc,toObjectSet:wc,toCamelCase:vc,noop:Sc,toFiniteNumber:xc,findKey:Zo,global:St,isContextDefined:er,ALPHABET:rr,generateString:Fc,isSpecCompliantForm:Tc,toJSONObject:_c,isAsyncFn:Nc,isThenable:Vc,setImmediate:ir,asap:kc};function ye(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}j.inherits(ye,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:j.toJSONObject(this.config),code:this.code,status:this.status}}});const ar=ye.prototype,sr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{sr[e]={value:e}}),Object.defineProperties(ye,sr),Object.defineProperty(ar,"isAxiosError",{value:!0}),ye.from=(e,t,n,r,i,a)=>{const s=Object.create(ar);return j.toFlatObject(e,s,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),ye.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,a&&Object.assign(s,a),s};const Ec=null;function Pn(e){return j.isPlainObject(e)||j.isArray(e)}function lr(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function cr(e,t,n){return e?e.concat(t).map(function(i,a){return i=lr(i),!n&&a?"["+i+"]":i}).join(n?".":""):t}function Ic(e){return j.isArray(e)&&!e.some(Pn)}const Mc=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function on(e,t,n){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=j.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,v){return!j.isUndefined(v[b])});const r=n.metaTokens,i=n.visitor||f,a=n.dots,s=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(i))throw new TypeError("visitor must be a function");function d(g){if(g===null)return"";if(j.isDate(g))return g.toISOString();if(!u&&j.isBlob(g))throw new ye("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(g)||j.isTypedArray(g)?u&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function f(g,b,v){let y=g;if(g&&!v&&typeof g=="object"){if(j.endsWith(b,"{}"))b=r?b:b.slice(0,-2),g=JSON.stringify(g);else if(j.isArray(g)&&Ic(g)||(j.isFileList(g)||j.endsWith(b,"[]"))&&(y=j.toArray(g)))return b=lr(b),y.forEach(function(F,w){!(j.isUndefined(F)||F===null)&&t.append(s===!0?cr([b],w,a):s===null?b:b+"[]",d(F))}),!1}return Pn(g)?!0:(t.append(cr(v,b,a),d(g)),!1)}const l=[],p=Object.assign(Mc,{defaultVisitor:f,convertValue:d,isVisitable:Pn});function m(g,b){if(!j.isUndefined(g)){if(l.indexOf(g)!==-1)throw Error("Circular reference detected in "+b.join("."));l.push(g),j.forEach(g,function(y,C){(!(j.isUndefined(y)||y===null)&&i.call(t,y,j.isString(C)?C.trim():C,b,p))===!0&&m(y,b?b.concat(C):[C])}),l.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return m(e),t}function ur(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Rn(e,t){this._pairs=[],e&&on(e,this,t)}const dr=Rn.prototype;dr.append=function(t,n){this._pairs.push([t,n])},dr.toString=function(t){const n=t?function(r){return t.call(this,r,ur)}:ur;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Oc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fr(e,t,n){if(!t)return e;const r=n&&n.encode||Oc,i=n&&n.serialize;let a;if(i?a=i(t,n):a=j.isURLSearchParams(t)?t.toString():new Rn(t,n).toString(r),a){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class pr{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){j.forEach(this.handlers,function(r){r!==null&&t(r)})}}const mr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Bc={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Rn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},jn=typeof window<"u"&&typeof document<"u",$n=typeof navigator=="object"&&navigator||void 0,Pc=jn&&(!$n||["ReactNative","NativeScript","NS"].indexOf($n.product)<0),Rc=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",jc=jn&&window.location.href||"http://localhost",qe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:jn,hasStandardBrowserEnv:Pc,hasStandardBrowserWebWorkerEnv:Rc,navigator:$n,origin:jc},Symbol.toStringTag,{value:"Module"})),...Bc};function $c(e,t){return on(e,new qe.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return qe.isNode&&j.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function Dc(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ac(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function hr(e){function t(n,r,i,a){let s=n[a++];if(s==="__proto__")return!0;const c=Number.isFinite(+s),u=a>=n.length;return s=!s&&j.isArray(i)?i.length:s,u?(j.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!c):((!i[s]||!j.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],a)&&j.isArray(i[s])&&(i[s]=Ac(i[s])),!c)}if(j.isFormData(e)&&j.isFunction(e.entries)){const n={};return j.forEachEntry(e,(r,i)=>{t(Dc(r),i,n,0)}),n}return null}function Lc(e,t,n){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Pt={transitional:mr,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=j.isObject(t);if(a&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return i?JSON.stringify(hr(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return $c(t,this.formSerializer).toString();if((c=j.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return on(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),Lc(t)):t}],transformResponse:[function(t){const n=this.transitional||Pt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(c){if(s)throw c.name==="SyntaxError"?ye.from(c,ye.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qe.classes.FormData,Blob:qe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],e=>{Pt.headers[e]={}});const qc=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Hc=e=>{const t={};let n,r,i;return e&&e.split(`
2
- `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&qc[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},gr=Symbol("internals");function Rt(e){return e&&String(e).trim().toLowerCase()}function rn(e){return e===!1||e==null?e:j.isArray(e)?e.map(rn):String(e)}function Wc(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Uc=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Dn(e,t,n,r,i){if(j.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!j.isString(t)){if(j.isString(r))return t.indexOf(r)!==-1;if(j.isRegExp(r))return r.test(t)}}function zc(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Gc(e,t){const n=j.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,a,s){return this[r].call(this,t,i,a,s)},configurable:!0})})}class He{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function a(c,u,d){const f=Rt(u);if(!f)throw new Error("header name must be a non-empty string");const l=j.findKey(i,f);(!l||i[l]===void 0||d===!0||d===void 0&&i[l]!==!1)&&(i[l||u]=rn(c))}const s=(c,u)=>j.forEach(c,(d,f)=>a(d,f,u));if(j.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(j.isString(t)&&(t=t.trim())&&!Uc(t))s(Hc(t),n);else if(j.isHeaders(t))for(const[c,u]of t.entries())a(u,c,r);else t!=null&&a(n,t,r);return this}get(t,n){if(t=Rt(t),t){const r=j.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Wc(i);if(j.isFunction(n))return n.call(this,i,r);if(j.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Rt(t),t){const r=j.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Dn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function a(s){if(s=Rt(s),s){const c=j.findKey(r,s);c&&(!n||Dn(r,r[c],c,n))&&(delete r[c],i=!0)}}return j.isArray(t)?t.forEach(a):a(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const a=n[r];(!t||Dn(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const n=this,r={};return j.forEach(this,(i,a)=>{const s=j.findKey(r,a);if(s){n[s]=rn(i),delete n[a];return}const c=t?zc(a):String(a).trim();c!==a&&delete n[a],n[c]=rn(i),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return j.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&j.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[gr]=this[gr]={accessors:{}}).accessors,i=this.prototype;function a(s){const c=Rt(s);r[c]||(Gc(i,s),r[c]=!0)}return j.isArray(t)?t.forEach(a):a(t),this}}He.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),j.reduceDescriptors(He.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),j.freezeMethods(He);function An(e,t){const n=this||Pt,r=t||n,i=He.from(r.headers);let a=r.data;return j.forEach(e,function(c){a=c.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function yr(e){return!!(e&&e.__CANCEL__)}function Nt(e,t,n){ye.call(this,e??"canceled",ye.ERR_CANCELED,t,n),this.name="CanceledError"}j.inherits(Nt,ye,{__CANCEL__:!0});function vr(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ye("Request failed with status code "+n.status,[ye.ERR_BAD_REQUEST,ye.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Xc(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Yc(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,a=0,s;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),f=r[a];s||(s=d),n[i]=u,r[i]=d;let l=a,p=0;for(;l!==i;)p+=n[l++],l=l%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),d-s<t)return;const m=f&&d-f;return m?Math.round(p*1e3/m):void 0}}function Jc(e,t){let n=0,r=1e3/t,i,a;const s=(d,f=Date.now())=>{n=f,i=null,a&&(clearTimeout(a),a=null),e.apply(null,d)};return[(...d)=>{const f=Date.now(),l=f-n;l>=r?s(d,f):(i=d,a||(a=setTimeout(()=>{a=null,s(i)},r-l)))},()=>i&&s(i)]}const an=(e,t,n=3)=>{let r=0;const i=Yc(50,250);return Jc(a=>{const s=a.loaded,c=a.lengthComputable?a.total:void 0,u=s-r,d=i(u),f=s<=c;r=s;const l={loaded:s,total:c,progress:c?s/c:void 0,bytes:u,rate:d||void 0,estimated:d&&c&&f?(c-s)/d:void 0,event:a,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(l)},n)},br=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Cr=e=>(...t)=>j.asap(()=>e(...t)),Qc=qe.hasStandardBrowserEnv?function(){const t=qe.navigator&&/(msie|trident)/i.test(qe.navigator.userAgent),n=document.createElement("a");let r;function i(a){let s=a;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const c=j.isString(s)?i(s):s;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),Kc=qe.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const s=[e+"="+encodeURIComponent(t)];j.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),j.isString(r)&&s.push("path="+r),j.isString(i)&&s.push("domain="+i),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Zc(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function eu(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function wr(e,t){return e&&!Zc(t)?eu(e,t):t}const Sr=e=>e instanceof He?{...e}:e;function xt(e,t){t=t||{};const n={};function r(d,f,l){return j.isPlainObject(d)&&j.isPlainObject(f)?j.merge.call({caseless:l},d,f):j.isPlainObject(f)?j.merge({},f):j.isArray(f)?f.slice():f}function i(d,f,l){if(j.isUndefined(f)){if(!j.isUndefined(d))return r(void 0,d,l)}else return r(d,f,l)}function a(d,f){if(!j.isUndefined(f))return r(void 0,f)}function s(d,f){if(j.isUndefined(f)){if(!j.isUndefined(d))return r(void 0,d)}else return r(void 0,f)}function c(d,f,l){if(l in t)return r(d,f);if(l in e)return r(void 0,d)}const u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c,headers:(d,f)=>i(Sr(d),Sr(f),!0)};return j.forEach(Object.keys(Object.assign({},e,t)),function(f){const l=u[f]||i,p=l(e[f],t[f],f);j.isUndefined(p)&&l!==c||(n[f]=p)}),n}const xr=e=>{const t=xt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=t;t.headers=s=He.from(s),t.url=fr(wr(t.baseURL,t.url),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let u;if(j.isFormData(n)){if(qe.hasStandardBrowserEnv||qe.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((u=s.getContentType())!==!1){const[d,...f]=u?u.split(";").map(l=>l.trim()).filter(Boolean):[];s.setContentType([d||"multipart/form-data",...f].join("; "))}}if(qe.hasStandardBrowserEnv&&(r&&j.isFunction(r)&&(r=r(t)),r||r!==!1&&Qc(t.url))){const d=i&&a&&Kc.read(a);d&&s.set(i,d)}return t},tu=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=xr(e);let a=i.data;const s=He.from(i.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:d}=i,f,l,p,m,g;function b(){m&&m(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function y(){if(!v)return;const F=He.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),S={data:!c||c==="text"||c==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:F,config:e,request:v};vr(function(h){n(h),b()},function(h){r(h),b()},S),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(y)},v.onabort=function(){v&&(r(new ye("Request aborted",ye.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new ye("Network Error",ye.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let w=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const S=i.transitional||mr;i.timeoutErrorMessage&&(w=i.timeoutErrorMessage),r(new ye(w,S.clarifyTimeoutError?ye.ETIMEDOUT:ye.ECONNABORTED,e,v)),v=null},a===void 0&&s.setContentType(null),"setRequestHeader"in v&&j.forEach(s.toJSON(),function(w,S){v.setRequestHeader(S,w)}),j.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),c&&c!=="json"&&(v.responseType=i.responseType),d&&([p,g]=an(d,!0),v.addEventListener("progress",p)),u&&v.upload&&([l,m]=an(u),v.upload.addEventListener("progress",l),v.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(f=F=>{v&&(r(!F||F.type?new Nt(null,e,v):F),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const C=Xc(i.url);if(C&&qe.protocols.indexOf(C)===-1){r(new ye("Unsupported protocol "+C+":",ye.ERR_BAD_REQUEST,e));return}v.send(a||null)})},nu=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const a=function(d){if(!i){i=!0,c();const f=d instanceof Error?d:this.reason;r.abort(f instanceof ye?f:new Nt(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,a(new ye(`timeout ${t} of ms exceeded`,ye.ETIMEDOUT))},t);const c=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(a):d.removeEventListener("abort",a)}),e=null)};e.forEach(d=>d.addEventListener("abort",a));const{signal:u}=r;return u.unsubscribe=()=>j.asap(c),u}},ou=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},ru=async function*(e,t){for await(const n of iu(e))yield*ou(n,t)},iu=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Fr=(e,t,n,r)=>{const i=ru(e,t);let a=0,s,c=u=>{s||(s=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:d,value:f}=await i.next();if(d){c(),u.close();return}let l=f.byteLength;if(n){let p=a+=l;n(p)}u.enqueue(new Uint8Array(f))}catch(d){throw c(d),d}},cancel(u){return c(u),i.return()}},{highWaterMark:2})},sn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Tr=sn&&typeof ReadableStream=="function",au=sn&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),_r=(e,...t)=>{try{return!!e(...t)}catch{return!1}},su=Tr&&_r(()=>{let e=!1;const t=new Request(qe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Nr=64*1024,Ln=Tr&&_r(()=>j.isReadableStream(new Response("").body)),ln={stream:Ln&&(e=>e.body)};sn&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ln[t]&&(ln[t]=j.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ye(`Response type '${t}' is not supported`,ye.ERR_NOT_SUPPORT,r)})})})(new Response);const lu=async e=>{if(e==null)return 0;if(j.isBlob(e))return e.size;if(j.isSpecCompliantForm(e))return(await new Request(qe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(j.isArrayBufferView(e)||j.isArrayBuffer(e))return e.byteLength;if(j.isURLSearchParams(e)&&(e=e+""),j.isString(e))return(await au(e)).byteLength},cu=async(e,t)=>{const n=j.toFiniteNumber(e.getContentLength());return n??lu(t)},qn={http:Ec,xhr:tu,fetch:sn&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:s,onDownloadProgress:c,onUploadProgress:u,responseType:d,headers:f,withCredentials:l="same-origin",fetchOptions:p}=xr(e);d=d?(d+"").toLowerCase():"text";let m=nu([i,a&&a.toAbortSignal()],s),g;const b=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let v;try{if(u&&su&&n!=="get"&&n!=="head"&&(v=await cu(f,r))!==0){let S=new Request(t,{method:"POST",body:r,duplex:"half"}),N;if(j.isFormData(r)&&(N=S.headers.get("content-type"))&&f.setContentType(N),S.body){const[h,_]=br(v,an(Cr(u)));r=Fr(S.body,Nr,h,_)}}j.isString(l)||(l=l?"include":"omit");const y="credentials"in Request.prototype;g=new Request(t,{...p,signal:m,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:y?l:void 0});let C=await fetch(g);const F=Ln&&(d==="stream"||d==="response");if(Ln&&(c||F&&b)){const S={};["status","statusText","headers"].forEach(x=>{S[x]=C[x]});const N=j.toFiniteNumber(C.headers.get("content-length")),[h,_]=c&&br(N,an(Cr(c),!0))||[];C=new Response(Fr(C.body,Nr,h,()=>{_&&_(),b&&b()}),S)}d=d||"text";let w=await ln[j.findKey(ln,d)||"text"](C,e);return!F&&b&&b(),await new Promise((S,N)=>{vr(S,N,{data:w,headers:He.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:g})})}catch(y){throw b&&b(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new ye("Network Error",ye.ERR_NETWORK,e,g),{cause:y.cause||y}):ye.from(y,y&&y.code,e,g)}})};j.forEach(qn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Vr=e=>`- ${e}`,uu=e=>j.isFunction(e)||e===null||e===!1,kr={getAdapter:e=>{e=j.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){n=e[a];let s;if(r=n,!uu(n)&&(r=qn[(s=String(n)).toLowerCase()],r===void 0))throw new ye(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+a]=r}if(!r){const a=Object.entries(i).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=t?a.length>1?`since :
4
- `+a.map(Vr).join(`
5
- `):" "+Vr(a[0]):"as no adapter specified";throw new ye("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:qn};function Hn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function Er(e){return Hn(e),e.headers=He.from(e.headers),e.data=An.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),kr.getAdapter(e.adapter||Pt.adapter)(e).then(function(r){return Hn(e),r.data=An.call(e,e.transformResponse,r),r.headers=He.from(r.headers),r},function(r){return yr(r)||(Hn(e),r&&r.response&&(r.response.data=An.call(e,e.transformResponse,r.response),r.response.headers=He.from(r.response.headers))),Promise.reject(r)})}const Ir="1.7.7",Wn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Mr={};Wn.transitional=function(t,n,r){function i(a,s){return"[Axios v"+Ir+"] Transitional option '"+a+"'"+s+(r?". "+r:"")}return(a,s,c)=>{if(t===!1)throw new ye(i(s," has been removed"+(n?" in "+n:"")),ye.ERR_DEPRECATED);return n&&!Mr[s]&&(Mr[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,s,c):!0}};function du(e,t,n){if(typeof e!="object")throw new ye("options must be an object",ye.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],s=t[a];if(s){const c=e[a],u=c===void 0||s(c,a,e);if(u!==!0)throw new ye("option "+a+" must be "+u,ye.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ye("Unknown option "+a,ye.ERR_BAD_OPTION)}}const Un={assertOptions:du,validators:Wn},vt=Un.validators;class Ft{constructor(t){this.defaults=t,this.interceptors={request:new pr,response:new pr}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=xt(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&Un.assertOptions(r,{silentJSONParsing:vt.transitional(vt.boolean),forcedJSONParsing:vt.transitional(vt.boolean),clarifyTimeoutError:vt.transitional(vt.boolean)},!1),i!=null&&(j.isFunction(i)?n.paramsSerializer={serialize:i}:Un.assertOptions(i,{encode:vt.function,serialize:vt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=a&&j.merge(a.common,a[n.method]);a&&j.forEach(["delete","get","head","post","put","patch","common"],g=>{delete a[g]}),n.headers=He.concat(s,a);const c=[];let u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(u=u&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let f,l=0,p;if(!u){const g=[Er.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,d),p=g.length,f=Promise.resolve(n);l<p;)f=f.then(g[l++],g[l++]);return f}p=c.length;let m=n;for(l=0;l<p;){const g=c[l++],b=c[l++];try{m=g(m)}catch(v){b.call(this,v);break}}try{f=Er.call(this,m)}catch(g){return Promise.reject(g)}for(l=0,p=d.length;l<p;)f=f.then(d[l++],d[l++]);return f}getUri(t){t=xt(this.defaults,t);const n=wr(t.baseURL,t.url);return fr(n,t.params,t.paramsSerializer)}}j.forEach(["delete","get","head","options"],function(t){Ft.prototype[t]=function(n,r){return this.request(xt(r||{},{method:t,url:n,data:(r||{}).data}))}}),j.forEach(["post","put","patch"],function(t){function n(r){return function(a,s,c){return this.request(xt(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}Ft.prototype[t]=n(),Ft.prototype[t+"Form"]=n(!0)});class zn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const s=new Promise(c=>{r.subscribe(c),a=c}).then(i);return s.cancel=function(){r.unsubscribe(a)},s},t(function(a,s,c){r.reason||(r.reason=new Nt(a,s,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new zn(function(i){t=i}),cancel:t}}}function fu(e){return function(n){return e.apply(null,n)}}function pu(e){return j.isObject(e)&&e.isAxiosError===!0}const Gn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Gn).forEach(([e,t])=>{Gn[t]=e});function Or(e){const t=new Ft(e),n=Jo(Ft.prototype.request,t);return j.extend(n,Ft.prototype,t,{allOwnKeys:!0}),j.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Or(xt(e,i))},n}const Ne=Or(Pt);Ne.Axios=Ft,Ne.CanceledError=Nt,Ne.CancelToken=zn,Ne.isCancel=yr,Ne.VERSION=Ir,Ne.toFormData=on,Ne.AxiosError=ye,Ne.Cancel=Ne.CanceledError,Ne.all=function(t){return Promise.all(t)},Ne.spread=fu,Ne.isAxiosError=pu,Ne.mergeConfig=xt,Ne.AxiosHeaders=He,Ne.formToJSON=e=>hr(j.isHTMLForm(e)?new FormData(e):e),Ne.getAdapter=kr.getAdapter,Ne.HttpStatusCode=Gn,Ne.default=Ne;function mu(e,t){const n="/api/runtime/sys/v1.0/querysolution",r="default";function i(d){const l={headers:{"Content-Type":"application/json",sessionid:r},sessionid:r};return Ne.post(n,d,l)}function a(){const d={headers:{"Content-Type":"application/json",sessionid:r},sessionid:r};return Ne.get(`/api/runtime/sys/v1.0/querysolution/belongId/${e.formId}`,d)}function s(d){const l={headers:{"Content-Type":"application/json",sessionid:r}};return Ne.put(n,d,l)}function c(d){const l={headers:{"Content-Type":"application/json",sessionid:r}},p=`${n}/batch`;return Ne.put(p,d,l)}function u(){const f={headers:{"Content-Type":"application/json",sessionid:r}},l=`${n}/componentType/QuerySolution`;return Ne.get(l,f)}return{createSolution:i,loadSolution:a,updateSolution:s,getAuth:u,batchUpdate:c}}const cn=o.defineComponent({name:"FQuerySolution",props:Kt,emits:["save","saveAs","delete","change","conditionChange","query"],setup(e,t){const n=o.ref(),r=o.ref(e.isControlInline),i=o.ref([]),a=o.ref(null),s=mu(e),c=Ll(e,t,s,i,a,n),u=Wl(e,t,s,c,i,a,n),{loadAllSolution:d,handleQuery:f}=c,{renderHeader:l,loadFields:p,expanded:m}=u;o.onMounted(()=>{p(),d()});const g=o.computed(()=>a.value?a.value.mode:"1"),b={1:Ht,2:Qt},v=o.computed(()=>({"farris-panel":!0,"position-relative":!0,"query-solution":!0})),y=o.computed(()=>({border:"none"}));function C(N,h){t.emit("change",N,h),f()}function F(N){var h;t.emit("change",N),t.emit("conditionChange",be.cloneDeep((h=a.value)==null?void 0:h.conditions))}function w(N,h){var _;t.emit("change",N,h),t.emit("conditionChange",be.cloneDeep((_=a.value)==null?void 0:_.conditions))}function S(){const N=b[g.value]||Ht;return a.value&&o.createVNode(N,{key:a.value.id,fields:n.value,conditions:a.value.conditions,isControlInline:r.value,onValueChange:(h,_)=>C(h,_),onLabelCodeChange:h=>F(h),onCompareTypeChange:(h,_)=>w(h,_)},null)}return()=>o.createVNode("div",{class:v.value,tabindex:"1",style:y.value},[l(),m.value&&S()])}}),hu=o.defineComponent({name:"FConditionFieldsDesign",directives:{"area-response":Ks},props:bn,emits:["valueChange","blur","focus","click","input"],setup(e,t){const n=o.ref(),r=o.ref(e.key);o.ref(e.isControlInline);const i=o.ref(e.conditions),a=Cn(e),{initialConditionValue:s,fieldMap:c,loadFieldConfigs:u}=a,d=So(e,t,n),{conditionClass:f,resizeObserver:l}=d;u(!0),o.onBeforeUnmount(()=>{var b;(b=l.value)==null||b.unobserve(n.value)}),o.watch(()=>e.conditions,()=>{i.value=e.conditions});const p=o.computed(()=>({"f-utils-flex-row-wrap":!0,"farris-form":!0,"farris-form-controls-inline":e.isControlInline})),m=o.computed(()=>"col-12 col-md-6 col-xl-3 col-el-2 ");function g(){return i.value.map(b=>{var y,C;const v=(y=c.get(b.fieldCode))==null?void 0:y.editor;return v&&(v.disabled=!0),o.createVNode(ml,{customClass:((C=v==null?void 0:v.appearance)==null?void 0:C.class)||m.value,label:b.fieldName,required:v==null?void 0:v.required,editor:v,type:"form-group"},null)})}return()=>o.withDirectives(o.createVNode("div",{class:p.value,key:r.value,ref:n},[g()]),[[o.resolveDirective("area-response")]])}}),gu={convertFrom:(e,t)=>e[t],convertTo:(e,t,n)=>{const r=e.presetFields,i=[];r.forEach(a=>{const s=n.find(c=>c.id===a.id);s&&i.push(s)}),e[t]=n,e.presetFields=i}},yu={convertFrom:(e,t)=>e[t].map(n=>({id:n.id,name:n.name+"("+n.code+")"})),convertTo:(e,t,n)=>{const r=[],{fields:i}=e;n.forEach(a=>{const s=i.find(c=>c.id===a.id);s&&r.push(s)}),e[t]=r}};class vu extends Go{getPropertyConfig(t,n){return this.propertyConfig.categories.basic=this.getBasicPropConfig(t),this.getAppearanceConfig(),this.getBehaviorConfig(t),this.getQuerySolutionConfig(t),this.getEventPropConfig(t),this.propertyConfig}getBehaviorConfig(t){this.propertyConfig.categories.apperance={description:"Basic Infomation",title:"行为",properties:{isControlInline:{description:"控件标签同行展示",type:"boolean",title:"控件标签同行展示"},presetQuerySolutionName:{description:"系统预置筛选方案名称",type:"string",title:"系统预置筛选方案名称"},filterText:{description:"筛选按钮文本",type:"string",title:"筛选按钮文本"},expanded:{description:"展开",type:"boolean",title:"展开"}}}}getQuerySolutionConfig(t){const n=this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);let r=[];n.forEach(i=>{i.children.length>0?i.children.forEach(a=>{r.push(a.data)}):r.push(i.data)}),r=r.filter(i=>i.$type==="SimpleField"),this.propertyConfig.categories.control={description:"Basic Infomation",title:"编辑器",properties:{fields:{description:"筛选方案字段设置",title:"筛选方案字段",type:"",refreshPanelAfterChanged:!0,editor:{type:"query-solution-config",fieldsConfig:r,formSchemaUtils:this.formSchemaUtils,metadataService:this.metadataService,viewModelId:this.viewModelId,designViewModelUtils:this.designViewModelUtils,eventsEditorUtils:this.eventsEditorUtils},$converter:gu},presetFields:{description:"系统预置字段",title:"系统预置字段",type:"",editor:{type:"solution-preset",dataSource:t.fields},$converter:yu}}}}getEventPropConfig(t){const n=[{label:"onQuery",name:"查询事件"}],r=this,i=r.eventsEditorUtils.formProperties(t,r.viewModelId,n),a={};a[r.viewModelId]={type:"events-editor",editor:{initialData:i}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(s,c){const u=s.propertyValue;delete t[r.viewModelId],u&&(u.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(t,r.viewModelId,u.events,u)),t.remoteSort=!!t.columnSorted}}}}function bu(e,t){function n(c,u){const d=e.schema;return new vu(c,t).getPropertyConfig(d,u)}function r(){return!1}function i(){return!1}function a(){return!1}function s(){var l,p,m,g,b,v;if((p=(l=e==null?void 0:e.parent)==null?void 0:l.parent)!=null&&p.schema){const y=(m=e==null?void 0:e.parent)==null?void 0:m.parent.schema;(g=y.appearance)!=null&&g.class&&((b=y.appearance)!=null&&b.class.includes("f-page-has-scheme"))&&(y.appearance.class=(v=y.appearance)==null?void 0:v.class.replace("f-page-has-scheme","").replace(" ",""))}const{formSchemaUtils:c}=t,u=e.componentInstance.value.belongedComponentId,d=c.getViewModelIdByComponentId(u),f=c.getViewModelById(d);if(f&&f.states){const y=f.states.findIndex(C=>C.code==="originalFilterConditionList");y>-1&&f.states.splice(y,1)}}return{getPropsConfig:n,canAccepts:r,checkCanDeleteComponent:i,checkCanMoveComponent:a,onRemoveComponent:s}}const Cu=o.defineComponent({name:"FQuerySolutionDesign",props:Kt,emits:["save","saveAs"],setup(e,t){const n=o.ref(e.fields),r=o.ref([]),i=o.ref(),a=o.ref(1),s=o.inject("design-item-context"),c=o.inject("designer-host-service"),u=bu(s,c),d=xn(i,s,u);o.onMounted(()=>{i.value.componentInstance=d}),t.expose(d.value);const f=o.computed(()=>e.presetQuerySolutionName||""),l=o.computed(()=>e.filterText||"");o.watch(()=>e.presetFields,C=>{const F=be.cloneDeep(C);F.forEach(w=>{w.editor.type=w.controlType}),n.value=F,r.value=n.value.map(w=>({id:w.id,fieldCode:w.labelCode,fieldName:w.name,value:null})),a.value=a.value+1},{immediate:!0});const p=o.ref(!0),m=o.computed(()=>({"farris-panel":!0,"position-relative":!0,"query-solution":!0})),g=o.computed(()=>({border:"none"}));function b(){return o.createVNode("div",{class:"solution-action"},[o.createVNode("div",{class:"btn-group"},[o.createVNode("button",{type:"button",class:"btn btn-primary "},[l.value])]),p.value&&o.createVNode("div",{class:"icon-group ml-2"},[o.createVNode("span",{class:"icon-group-remove",title:"清空"},[o.createVNode("span",{class:"f-icon f-icon-remove"},null)])])])}function v(){return o.createVNode("div",{class:"solution-header"},[o.createVNode("div",{class:"btn-group mr-3"},[o.createVNode("div",{class:"solution-header-title"},[f.value,o.createVNode("span",{class:"f-icon f-accordion-expand"},null)])]),b()])}function y(){const C=hu;return o.createVNode(C,{fields:n.value,conditions:r.value,key:a.value,isControlInline:e.isControlInline},null)}return()=>o.createVNode("div",{ref:i,class:m.value,tabindex:"1",style:g.value},[v(),y()])}}),wu={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/query-solution-config.schema.json",title:"query-solution-config",description:"A Farris Container Component",properties:{fieldsConfig:{description:"筛选配置项",type:"array"},designViewModelUtils:{description:"",type:"object"},formSchemaUtils:{description:"",type:"object"},metadataService:{description:"",type:"object"},viewModelId:{description:"",type:"array"},eventsEditorUtils:{description:"",type:"object"}}},Su=new Map([["appearance",ht]]);function xu(e,t,n){return t}const Br={fieldsConfig:{type:Array,default:[]},modelValue:{type:Array,default:[]},source:{type:String,default:"query-solution"},onFieldsChanged:{type:Function,default:null},formSchemaUtils:{type:Object,default:{}},metadataService:{type:Object,default:{}},designViewModelUtils:{type:Object,default:{}},eventsEditorUtils:{type:Object,default:{}},viewModelId:{type:String,default:""}},Fu=Ue(Br,wu,Su,xu),Tu={width:{type:String,default:"300px"},height:{type:Number,default:10},isWidePanel:{type:Boolean,default:!1},enableSearch:{type:Boolean,default:!0},mode:{type:String,default:"panel"},isPersitOpenState:{type:Boolean,default:!1},isShowPanel:{type:Boolean,default:!1},propertyName:{type:String,default:""},propertyConfig:{type:Array},propertyData:{type:Object,default:{}},showCloseBtn:{type:Boolean,default:!1},selectedTabId:{type:String,default:""},isWhiteTheme:{type:Boolean,default:!0},schema:{type:Object,default:{}},propertyChanged:{type:Function}},_u={category:{type:Object,default:{}},categoryKey:{type:String},propertyData:{type:Object,default:{}},valueChanged:{type:Function},triggerRefreshPanel:{type:Function}},Nu={elementConfig:{type:Object,default:{}},category:{type:Object,default:{}}},Vu=o.defineComponent({name:"FPropertyPanelItem",props:Nu,emits:["propertyChange","triggerRefreshPanel"],setup(e,t){var f;const n=o.ref((f=e.category)==null?void 0:f.categoryId),r=o.ref(e.elementConfig.propertyID),i=o.ref(e.elementConfig.propertyName);o.ref(e.elementConfig.editor);const a=o.ref(e.elementConfig.propertyValue),s=o.computed(()=>{const l=e.elementConfig.visible;return{"farris-group-wrap":!0,"property-item":!0,"d-none":!(typeof l=="boolean"?l:l===void 0?!0:l())}});o.watch(()=>{var l;return(l=e.elementConfig)==null?void 0:l.propertyValue},l=>{a.value=l}),o.watch(()=>{var l;return(l=e.elementConfig)==null?void 0:l.propertyName},l=>{i.value=l});function c(l){e.elementConfig.propertyValue=l;const p={propertyID:e.elementConfig.propertyID,propertyValue:l};t.emit("propertyChange",p),e.elementConfig.refreshPanelAfterChanged&&t.emit("triggerRefreshPanel")}const u=e.elementConfig.description?`<div style="color: gray; "> 描述 :${e.elementConfig.description}</div>`:"",d=o.reactive({content:`
1
+ (function(J,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("lodash-es"),require("../dynamic-form/index.umd.js"),require("../designer-canvas/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../modal/index.umd.js"),require("../transfer/index.umd.js"),require("../tabs/index.umd.js"),require("../order/index.umd.js"),require("../condition/index.umd.js"),require("../checkbox/index.umd.js"),require("../filter-bar/index.umd.js"),require("../pagination/index.umd.js"),require("../search-box/index.umd.js"),require("../tags/index.umd.js"),require("../common/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../color-picker/index.umd.js"),require("../combo-list/index.umd.js"),require("../content-container/index.umd.js"),require("../data-grid/index.umd.js"),require("../date-picker/index.umd.js"),require("../dropdown/index.umd.js"),require("../external-container/index.umd.js"),require("../events-editor/index.umd.js"),require("../image-cropper/index.umd.js"),require("../input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../nav/index.umd.js"),require("../number-spinner/index.umd.js"),require("../number-range/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../component/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../tree-grid/index.umd.js"),require("../binding-selector/index.umd.js"),require("../notify/index.umd.js"),require("../combo-tree/index.umd.js"),require("../field-selector/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../schema-selector/index.umd.js"),require("../event-parameter/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("bignumber.js"),require("../popover/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../dynamic-form/index.umd.js","../designer-canvas/index.umd.js","@vueuse/core","../data-view/index.umd.js","../modal/index.umd.js","../transfer/index.umd.js","../tabs/index.umd.js","../order/index.umd.js","../condition/index.umd.js","../checkbox/index.umd.js","../filter-bar/index.umd.js","../pagination/index.umd.js","../search-box/index.umd.js","../tags/index.umd.js","../common/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../color-picker/index.umd.js","../combo-list/index.umd.js","../content-container/index.umd.js","../data-grid/index.umd.js","../date-picker/index.umd.js","../dropdown/index.umd.js","../external-container/index.umd.js","../events-editor/index.umd.js","../image-cropper/index.umd.js","../input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../nav/index.umd.js","../number-spinner/index.umd.js","../number-range/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../component/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../tree-grid/index.umd.js","../binding-selector/index.umd.js","../notify/index.umd.js","../combo-tree/index.umd.js","../field-selector/index.umd.js","../mapping-editor/index.umd.js","../schema-selector/index.umd.js","../event-parameter/index.umd.js","../dynamic-resolver/index.umd.js","bignumber.js","../popover/index.umd.js"],o):(J=typeof globalThis<"u"?globalThis:J||self,o(J["query-solution"]={},J.Vue,J.LodashES,J.FDynamicForm,J.designerCanvas,J.VueUseCore,J.dataView,J.modal,J.FTransfer$1,J.FTabs,J.FOrder,J.FConditionList$1,J.FCheckbox,J.FFilterBar,J.FPagination,J.FSearchBox,J.FTags,J.common,J.FAccordion,J.FAvatar,J.FButtonEdit$1,J.FButtonGroup,J.FCalendar,J.FCapsule,J.FColorPicker,J.FComboList,J.FContentContainer,J.FDataGrid,J.FDatePicker,J.FDropdown,null,J.FEventsEditor,J.FImageCropper,J.FInputGroup,J.FLayout,J.FListNav,J.FListView$1,J.FLookup,J.FNav,J.FNumberSpinner,J.FNumberRange,J.FPageHeader,J.FPageFooter,J.FProgress,J.FQuerySolution$1,J.FRadioGroup,J.FRate,J.FResponseToolbar,J.FResponseLayout,J.FResponseLayoutEditorSetting,J.FSection,J.FSmokeDetector,J.FSplitter,J.FStep,J.FSwitch,J.FText,J.FTimePicker,J.FTreeview,J.FUploader,J.FVerifyDetail,J.FComponent,J.FVideo,J.FTextArea,J.FTreeGrid$1,J.FBindingSelector,J.notify,J.FComboTree,J.FFieldSelector,J.FMappingEditor,J.FSchemaSelector,J.FEventParameter,J.dynamicResolver,J.BigNumber,J.FPopover))})(this,function(J,o,be,un,dn,eo,he,Ur,fn,zr,Gr,Xr,Et,Yr,Jr,Qr,to,Te,Kr,Zr,no,ei,ti,ni,oi,pn,ri,oo,ii,ai,Od,li,si,ro,ci,ui,di,fi,pi,mi,hi,gi,yi,vi,bi,io,Ci,wi,Si,xi,Fi,Ti,_i,Ni,Vi,ki,Ei,ao,Ii,Mi,Oi,Bi,Pi,Ri,ji,Di,$i,Ai,Li,qi,Wi,jt,Bd,Hi){"use strict";var Id=Object.defineProperty;var Md=(J,o,be)=>o in J?Id(J,o,{enumerable:!0,configurable:!0,writable:!0,value:be}):J[o]=be;var z=(J,o,be)=>Md(J,typeof o!="symbol"?o+"":o,be);const Dt={},lo={};function mn(e){const{properties:t,title:n,ignore:r}=e,i=r&&Array.isArray(r),a=Object.keys(t).reduce((l,c)=>((!i||!r.find(u=>u===c))&&(l[c]=t[c].type==="object"&&t[c].properties?mn(t[c]):be.cloneDeep(t[c].default)),l),{});if(n&&(!i||!r.find(l=>l==="id"))){const l=n.toLowerCase().replace(/-/g,"_");a.id=`${l}_${Math.random().toString().slice(2,6)}`}return a}function Ui(e){const{properties:t,title:n,required:r}=e;if(r&&Array.isArray(r)){const i=r.reduce((a,l)=>(a[l]=t[l].type==="object"&&t[l].properties?mn(t[l]):be.cloneDeep(t[l].default),a),{});if(n&&r.find(a=>a==="id")){const a=n.toLowerCase().replace(/-/g,"_");i.id=`${a}_${Math.random().toString().slice(2,6)}`}return i}return{type:n}}function $t(e,t={},n){const r=Dt[e];if(r){let i=Ui(r);const a=lo[e];return i=a?a({getSchemaByType:$t},i,t,n):i,i}return null}function hn(e,t){const n=mn(t);return Object.keys(n).reduce((r,i)=>(Object.prototype.hasOwnProperty.call(e,i)&&(r[i]&&be.isPlainObject(r[i])&&be.isPlainObject(e[i]||!e[i])?Object.assign(r[i],e[i]||{}):r[i]=e[i]),r),n),n}function zi(e,t){return Object.keys(e).filter(r=>e[r]!=null).reduce((r,i)=>{if(t.has(i)){const a=t.get(i);if(typeof a=="string")r[a]=e[i];else{const l=a(i,e[i],e);Object.assign(r,l)}}else r[i]=e[i];return r},{})}function Gi(e,t,n=new Map){const r=hn(e,t);return zi(r,n)}function so(e){var n;const t=e.type;if(t){const r=Dt[t];if(!r)return e;const i=hn(e,r),a=((n=e.editor)==null?void 0:n.type)||"";if(a){const l=Dt[a],c=hn(e.editor,l);i.editor=c}return i}return e}function Xi(e={}){function t(d,f,s,p){if(typeof s=="number")return p[d].length===s;if(typeof s=="object"){const m=Object.keys(s)[0],g=s[m];if(m==="not")return Number(p[d].length)!==Number(g);if(m==="moreThan")return Number(p[d].length)>=Number(g);if(m==="lessThan")return Number(p[d].length)<=Number(g)}return!1}function n(d,f,s,p){return p[d]&&p[d].propertyValue&&String(p[d].propertyValue.value)===String(s)}const r=new Map([["length",t],["getProperty",n]]);Object.keys(e).reduce((d,f)=>(d.set(f,e[f]),d),r);function i(d,f){const s=d;return typeof f=="number"?[{target:s,operator:"length",param:null,value:Number(f)}]:typeof f=="boolean"?[{target:s,operator:"getProperty",param:d,value:!!f}]:typeof f=="object"?Object.keys(f).map(p=>{if(p==="length")return{target:s,operator:"length",param:null,value:f[p]};const m=p,g=f[p];return{target:s,operator:"getProperty",param:m,value:g}}):[]}function a(d){return Object.keys(d).reduce((s,p)=>{const m=i(p,d[p]);return s.push(...m),s},[])}function l(d,f){if(r.has(d.operator)){const s=r.get(d.operator);return s&&s(d.target,d.param,d.value,f)||!1}return!1}function c(d,f){return a(d).reduce((m,g)=>m&&l(g,f),!0)}function u(d,f){const s=Object.keys(d),p=s.includes("allOf"),m=s.includes("anyOf"),g=p||m,y=(g?d[g?p?"allOf":"anyOf":"allOf"]:[d]).map(F=>c(F,f));return p?!y.includes(!1):y.includes(!0)}return{parseValueSchema:u}}const Yi={convertTo:(e,t,n,r)=>{e.appearance||(e.appearance={}),e.appearance[t]=n},convertFrom:(e,t,n)=>e.appearance?e.appearance[t]:e[t]},Ji={convertFrom:(e,t,n)=>e.buttons&&e.buttons.length?`共 ${e.buttons.length} 项`:"无"},Qi={convertTo:(e,t,n,r)=>{e.editor&&(e.editor[t]=n)},convertFrom:(e,t,n)=>e.editor&&Object.prototype.hasOwnProperty.call(e.editor,t)?e.editor[t]:e[t]},ae={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},Ki={convertFrom:(e,t,n)=>{var i;const r=e.editor&&e.editor[t]?e.editor[t]:e[t];return((i=ae[r])==null?void 0:i.name)||r}},Zi={convertTo:(e,t,n,r)=>{e[t]=e[t]},convertFrom:(e,t,n)=>e.editor?n.getRealEditorType(e.editor.type):""},ea={convertFrom:(e,t)=>e.binding?e.binding.path:"",convertTo:(e,t,n)=>{if(n&&n.length>0){const r=n[0];e.binding||(e.binding={}),e.binding.type="Form",e.binding.path=r.bindingField,e.binding.field=r.id,e.binding.fullPath=r.path,e.path=r.bindingPath}}},ta={convertTo:(e,t,n,r)=>{e.pagination||(e.pagination={}),e.pagination[t]=n},convertFrom:(e,t,n)=>e.pagination?e.pagination[t]:e[t]},na={convertTo:(e,t,n,r)=>{e.rowNumber||(e.rowNumber={}),e.rowNumber[t]=n},convertFrom:(e,t,n)=>e.rowNumber?e.rowNumber[t]:e[t]},oa={convertTo:(e,t,n,r)=>{e.selection||(e.selection={}),e.selection[t]=n},convertFrom:(e,t,n)=>e.selection?e.selection[t]:e[t]},ra={convertFrom:(e,t,n)=>e[t]&&e[t].length?`共 ${e[t].length} 项`:""},ia={convertTo:(e,t,n,r)=>{e.editor[t]=n.value},convertFrom:(e,t,n)=>e.editor&&Object.prototype.hasOwnProperty.call(e.editor,t)?e.editor[t]:e[t]},aa={convertFrom:(e,t)=>e[t]||"",convertTo:(e,t,n)=>{e[t]=n}},At={},gn=new Map([["/converter/appearance.converter",Yi],["/converter/buttons.converter",Ji],["/converter/property-editor.converter",Qi],["/converter/items-count.converter",ra],["/converter/type.converter",Ki],["/converter/change-editor.converter",Zi],["/converter/form-group-label.converter",aa],["/converter/field-selector.converter",ea],["/converter/pagination.converter",ta],["/converter/row-number.converter",na],["/converter/grid-selection.converter",oa],["/converter/enum-data.converter",ia]]),la={},sa=new Map([["string",{type:"input-group",enableClear:!1}],["boolean",{type:"combo-list",textField:"name",valueField:"value",idField:"value",enableClear:!1,editable:!1,maxHeight:64,data:[{value:!0,name:"是"},{value:!1,name:"否"}]}],["enum",{type:"combo-list",maxHeight:128,enableClear:!1,editable:!1}],["array",{type:"button-edit"}],["number",{type:"number-spinner",placeholder:""}],["events-editor",{type:"events-editor",hide:!0}]]),ca=Xi();function co(e,t){return()=>ca.parseValueSchema(e,t)}function ua(e,t,n){return e.includes("visible")&&t.visible!==void 0?typeof t.visible=="boolean"?()=>!!t.visible:t.visible===void 0?!0:co(t.visible,n):()=>!0}function da(e,t,n){return e.includes("readonly")&&t.readonly!==void 0?typeof t.readonly=="boolean"?()=>!!t.readonly:co(t.readonly,n):()=>!1}function fa(e,t){const n=e.$converter||t;return typeof n=="string"&&n&&gn.has(n)?gn.get(n)||null:n||null}function yn(e,t,n,r,i,a="",l=""){return Object.keys(e).map(u=>{const d=o.ref(1),f=u,s=e[u],p=Object.keys(s),m=s.title,g=s.type,b=sa.get(g)||{type:"input-group",enableClear:!1},v=s.editor?Object.assign({},b,s.editor):Object.assign({},b),y=ua(p,s,t),C=da(p,s,t);v.readonly=v.readonly===void 0?C():v.readonly;const F=s.type==="cascade"?yn(s.properties,t,n,r,i,a,l):[],w=!0;let S=fa(s,l);const N=o.computed({get(){if(d.value){if(["class","style"].find(V=>V===f)&&!S&&(S=gn.get("/converter/appearance.converter")||null),S&&S.convertFrom)return S.convertFrom(n,u,i,a);const T=n[u];return typeof T=="string"&&T===""?s.defaultValue||"":T}return null},set(T){d.value+=1,S&&S.convertTo?(S.convertTo(r,u,T,i,a),S.convertTo(n,u,T,i,a)):(r[u]=T,n[u]=T)}}),{refreshPanelAfterChanged:h,description:_,isExpand:x}=s,k={propertyID:f,propertyName:m,propertyType:g,propertyValue:N,editor:v,visible:y,readonly:C,cascadeConfig:F,hideCascadeTitle:w,refreshPanelAfterChanged:h,description:_,isExpand:x};return t[f]=k,k})}function pa(e,t,n,r,i=""){const a=t.$ref.schema,l=t.$ref.converter,c=n[a],u=c.type,d=so(c),f={},s=At[u];if(s&&s.categories){const p=s.categories[e],m=p==null?void 0:p.title;l&&Object.keys(p.properties).forEach(v=>{p.properties[v].$converter=l});const g=(p==null?void 0:p.properties)||{},b=yn(g,f,d,c,r,i);return{categoryId:e,categoryName:m,properties:b}}return{categoryId:e,categoryName:"",properties:[]}}function vn(e,t,n,r,i){const a=e.type,l=so(e),c={};let u=i||At[a];if(u&&Object.keys(u).length===0&&n&&n.getPropConfig&&(u=n.getPropConfig(r)),u&&u.categories){const d=[];return Object.keys(u.categories).map(f=>{const s=u.categories[f];if(s.$ref){d.push(pa(f,s,e,t,r));return}const p=s==null?void 0:s.title,m=s==null?void 0:s.tabId,g=s==null?void 0:s.tabName,b=s==null?void 0:s.hide,v=s==null?void 0:s.hideTitle,y=yn(s.properties||{},c,l,e,t,r,s.$converter),{setPropertyRelates:C}=s;d.push({categoryId:f,categoryName:p,tabId:m,tabName:g,hide:b,properties:y,hideTitle:v,setPropertyRelates:C})}),d}return[]}function Ue(e,t,n=new Map,r=(l,c,u,d)=>c,i={},a=l=>l){return Dt[t.title]=t,lo[t.title]=r,At[t.title]=i,la[t.title]=a,(l={})=>{const c=Gi(l,t,n),u=Object.keys(e).reduce((d,f)=>(d[f]=e[f].default,d),{});return Object.assign(u,c)}}function ht(e,t){return{customClass:t.class,customStyle:t.style}}function ma(){function e(t,n){const{dataSource:r}=t||{};return r===void 0?{}:{}}return{resolve:e}}function ha(){function e(t,n){return t.selectItemById(n)}return{selectItemById:e}}function ga(){function e(t,n){const{columns:r}=n;return t.updateColumns(r)}return{updateColumns:e}}var Je=(e=>(e.Equal="0",e.NotEqual="1",e.Greater="2",e.GreaterOrEqual="3",e.Less="4",e.LessOrEqual="5",e.Like="6",e.LikeStartWith="7",e.LikeEndWith="8",e.In="9",e.NotIn="10",e))(Je||{});const ya=[{value:"0",name:"等于"},{value:"1",name:"不等于"},{value:"2",name:"大于"},{value:"3",name:"大于等于"},{value:"4",name:"小于"},{value:"5",name:"小于等于"},{value:"6",name:"包含"},{value:"7",name:"开始是"},{value:"8",name:"结束是"}],va={"button-edit":["0","1"," 6","7","8"],"check-box":["0"],"combo-list":["0","1"],"combo-lookup":["0","1"," 6","7","8"],"date-picker":["0","1","2","3","4","5"],"date-range":[],"datetime-picker":["0","1","2","3","4","5"],"datetime-range":[],"month-picker":["0","1","2","3","4","5"],"month-range":[],"year-picker":["0","1","2","3","4","5"],"year-range":[],"input-group":["0","1","6","7","8"],lookup:["0","1"],"number-range":[],"number-spinner":["0"," 1","2","3","4","5"],"radio-group":["0"],text:["0","1"," 6","7","8"]};function ba(e,t,n){const{fieldMap:r}=n;function i(a){const l=r.get(a.fieldCode);if(!l)return[];const c=l.editor.type,u=new Set(va[c]);return ya.filter(f=>u.has(f.value))}return{getCompareOperators:i}}const bn={conditions:{type:Array,default:[]},fields:{type:Array,default:[]},key:{type:String,default:""},isControlInline:{type:Boolean,default:!0}};class uo{constructor(t={value:[]}){z(this,"editorType","check-box");z(this,"value");z(this,"valueType","boolean");const r=(Array.isArray(t.value)?t.value:typeof t.value=="string"?t.value.split(","):[]).map(i=>JSON.parse(i));this.value=r}clear(){this.value=[]}setValue(t){this.value=t}getValue(){return this.value}getDisplayText(){return this.value.map(t=>t?"是":"否").join(",")}isEmpty(){return this.value.length===0}}class fo{constructor(t={textValue:"",value:"",valueField:""}){z(this,"editorType","combo-lookup");z(this,"textValue");z(this,"value");z(this,"valueField");z(this,"valueType","text");this.textValue=t.textValue,this.value=t.value,this.valueField=t.valueField}clear(){this.value="",this.valueField="",this.textValue=""}getPropValue(t,n){if(n.length>1){const r=n.shift();return t[r]?this.getPropValue(t[r],n):null}return t[n[0]]}getTextValue(t){const n=t.split("."),r=this.value.split(",").map(i=>this.getPropValue(i,be.cloneDeep(n)));return r&&r.length?r.join(","):""}getValue(){const t=this.valueField.split("."),n=this.value.split(",").map(r=>this.getPropValue(r,be.cloneDeep(t)));return n&&n.length?n.join(","):""}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.valueField}}class po{constructor(t={value:""}){z(this,"editorType","date-picker");z(this,"value");z(this,"valueType","datetime");this.value=t.value}setValue(t){this.value=t.formatted}getValue(){return this.value}getDisplayText(){return this.getValue()}isEmpty(){return!this.value}clear(){this.value=void 0}}class Lt{constructor(t={begin:"",end:""}){z(this,"editorType","date-range");z(this,"begin","");z(this,"end","");z(this,"valueType","datetime");this.begin=t.begin,this.end=t.end}clear(){this.begin="",this.end=""}getValue(){return!this.begin||!this.end?"":`${this.begin}~${this.end}`}getDisplayText(){return this.getValue()}setValue(t){t.dataRange?(this.begin=t.dataRange.split(t.delimiter)[0],this.end=t.dataRange.split(t.delimiter)[1]):this.clear()}isEmpty(){return!this.begin||!this.end}}class mo{constructor(t={value:""}){z(this,"editorType","datetime-picker");z(this,"value");z(this,"valueType","datetime");this.value=t.value}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=t.formatted}isEmpty(){return!this.value}}class ho{constructor(t={value:""}){z(this,"editorType","combo-list");z(this,"value");z(this,"valueType","enum");this.value=t.value}clear(){this.value=""}getValue(){return this.value}getDisplayText(){return this.value}setValue(t){this.value=t.value}isEmpty(){return!this.value&&this.value!==!1}}class Ca{constructor(t={value:"",displayText:"",displayField:"",isInputText:!1}){z(this,"editorType","input-group");z(this,"value");z(this,"valueType","text");z(this,"displayText");z(this,"valueField");z(this,"isInputText");this.value=t.value,this.displayText=t.displayText,this.valueField=t.displayField,this.isInputText=t.isInputText}clear(){this.value="",this.displayText="",this.valueField=""}getPropValue(t,n){if(n.length>1){const r=n.shift();return t[r]?this.getPropValue(t[r],n):""}return t[n[0]]}getTextValue(t){const n=t.split("."),r=this.value.map(i=>this.getPropValue(i,be.cloneDeep(n)));return r&&r.length?r.join(","):""}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.displayText&&!this.value.length}}class go{constructor(t={mapFields:[],value:"",valueField:"",isInputText:!1}){z(this,"editorType","lookup");z(this,"idValue");z(this,"mapFields");z(this,"value");z(this,"valueField");z(this,"valueType","text");z(this,"isInputText");this.value=t.value,this.valueField=t.valueField,this.mapFields=t.mapFields,this.idValue=t.mapFields.map(n=>n.id).join(","),this.isInputText=t.isInputText}clear(){this.value="",this.idValue="",this.mapFields=[]}getValue(){return this.mapFields.map(t=>t[this.valueField||"id"]).join(",")}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.mapFields.length}}class yo{constructor(t={value:""}){z(this,"editorType","month-picker");z(this,"value");z(this,"valueType","datetime");this.value=t.value}setValue(t){this.value=t.formatted}getValue(){return this.value}getDisplayText(){return this.getValue()}clear(){this.value=void 0}isEmpty(){return!this.value}}class vo{constructor(t={begin:"",end:""}){z(this,"editorType","month-range");z(this,"begin");z(this,"end");z(this,"valueType","datetime");this.begin=t.begin,this.end=t.end}clear(){this.begin="",this.end=""}getValue(){return!this.begin||!this.end?"":`${this.begin}~${this.end}`}getDisplayText(){return this.getValue()}setValue(t){t.dataRange?(this.begin=t.dataRange.split(t.delimiter)[0],this.end=t.dataRange.split(t.delimiter)[1]):this.clear()}isEmpty(){return!this.begin||!this.end}}class bo{constructor(t={begin:null,end:null}){z(this,"editorType","number-range");z(this,"begin");z(this,"end");z(this,"valueType","number");this.begin=t.begin==null?null:parseFloat(t.begin),this.end=t.end==null?null:parseFloat(t.end)}clear(){this.begin=null,this.end=null}getValue(){return{begin:this.begin,end:this.end}}getDisplayText(){return this.getValue()}setValue(t){this.begin=t.begin==null?null:parseFloat(t.begin),this.end=t.end==null?null:parseFloat(t.end)}isEmpty(){return this.begin==null&&this.end==null}}class Co{constructor(t={value:""}){z(this,"editorType","number-spinner");z(this,"value");z(this,"valueType","number");this.value=t.value==null?null:parseFloat(t.value)}clear(){this.value=null}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=isNaN(parseFloat(t))?null:t}isEmpty(){return this.value==null||isNaN(this.value)}}class wo{constructor(t={value:null}){z(this,"editorType","radio-group");z(this,"value");z(this,"valueType","enum");this.value=t.value}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=t}isEmpty(){return!this.value}}class qt{constructor(t={value:""}){z(this,"editorType","text");z(this,"value");z(this,"valueType","text");this.value=t.value}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=t}isEmpty(){return!this.value}}function So(){function e(t,n){switch(t){case"check-box":return new uo(n);case"combo-list":return new ho(n);case"combo-lookup":return new fo(n);case"input-group":return new Ca(n);case"date-picker":return new po(n);case"date-range":return new Lt(n);case"datetime-picker":return new mo(n);case"datetime-range":return new Lt(n);case"lookup":return new go(n);case"month-picker":return new yo(n);case"month-range":return new vo(n);case"number-range":return new bo(n);case"number-spinner":return new Co(n);case"radio-group":return new wo(n);default:return new qt(n)}}return{createConditionValue:e}}function Cn(e,t){const n=o.ref(e.fields),r=o.ref([]),i=new Map,{createConditionValue:a}=So();function l(f){switch(f.editor?f.editor.type:"input-group"){case"date-range":f.editor.type="date-picker";break;case"datetime-range":f.editor.type="datetime-picker";break;case"number-range":f.editor.type="number-spinner";break}return f.editor}function c(f){return f.map(p=>Object.assign({},p)).map(p=>(p.editor=l(p),p))}function u(f=!0){n.value.reduce((s,p)=>(f||(p.editor=l(p)),s.set(p.labelCode,p),s),i)}function d(f){return f.forEach(s=>{if(s){const p=i.get(s.fieldCode);s.value=a(p.editor.type,s.value)}}),f}return{convertToSingleControl:c,fields:n,fieldMap:i,fieldConditions:r,loadFieldConfigs:u,initialConditionValue:d}}function xo(e,t,n){const r=o.ref(null),i=o.ref(n),a=o.ref(0);function l(f,s){let p=null;return function(){const m=arguments;p?(clearTimeout(p),p=setTimeout(()=>{p=null,f(...m)},200)):(f(...m),p=setTimeout(()=>{p=null},200))}}function c(){i.value&&(r.value=new ResizeObserver(l(f=>{const s=f[0];a.value=s.contentRect.width})),r.value.observe(i.value))}function u(f){let p="col-12";return f>250*6?p="col-2":f>250*4?p="col-3":f>250*3?p="col-4":f>250*2&&(p="col-6"),p}const d=o.computed(()=>u(a.value));return o.watch([n],([f])=>{i.value=f,c()}),{conditionClass:d,resizeObserver:r}}const Wt=o.defineComponent({name:"FConditionFields",props:bn,emits:["valueChange","blur","focus","click","input"],setup(e,t){const n=o.ref(),r=o.ref(e.key);o.ref(e.isControlInline);const i=o.ref(e.conditions),a=Cn(e),{initialConditionValue:l,fieldMap:c,loadFieldConfigs:u}=a,d=xo(e,t,n),{conditionClass:f,resizeObserver:s}=d;u(!0),l(i.value),o.onBeforeUnmount(()=>{var v;(v=s.value)==null||v.unobserve(n.value)}),o.watch(()=>e.conditions,()=>{i.value=e.conditions,l(i.value)});const p=o.computed(()=>({"f-utils-flex-row-wrap":!0,"farris-form":!0,"farris-form-controls-inline":e.isControlInline})),m=o.computed(()=>"col-12 col-md-6 col-xl-3 col-el-2 ");function g(v,y){t.emit("valueChange",v,y)}function b(){return i.value.map(v=>{var F,w,S,N;const y=(F=c.get(v.fieldCode))==null?void 0:F.editor;let C=!0;return((w=v.value)==null?void 0:w.editorType)==="lookup"&&y?(y.idValue=v.value.idValue,y.onClear=()=>{v.value.idValue="",v.value.mapFields=[],g("",v)},y["onUpdate:dataMapping"]=h=>{v.value.mapFields=h.items,g(v.value.getValue(),v)},C=!1):((S=v.value)==null?void 0:S.editorType)==="number-range"&&y&&(y.beginValue=v.value.begin,y.onBeginValueChange=h=>{v.value.begin=h,g(h,v)},y.endValue=v.value.end,y.onEndValueChange=h=>{v.value.end=h,g(h,v)},C=!1),o.createVNode(un.FDynamicFormGroup,{customClass:((N=y==null?void 0:y.appearance)==null?void 0:N.class)||m.value,label:v.fieldName,editor:y,required:y==null?void 0:y.required,modelValue:v.value.value,"onUpdate:modelValue":h=>v.value.value=h,onChange:h=>{C&&g(h,v)}},null)})}return()=>o.withDirectives(o.createVNode("div",{class:p.value,key:r.value,ref:n},[b()]),[[o.resolveDirective("area-response")]])}}),wn=new Map([["appearance",ht]]),wa=new Map([]);var Fo=(e=>(e.SimpleField="SimpleField",e.ComplexField="ComplexField",e))(Fo||{}),Sn=(e=>(e.String="String",e.DateTime="DateTime",e.Date="Date",e.Enum="Enum",e.Boolean="Boolean",e.Number="Number",e.Text="Text",e.BigNumber="BigNumber",e))(Sn||{});const Sa="root-viewmodel";class xa{constructor(t,n){z(this,"formSchemaUtils");z(this,"controlCreatorUtils");z(this,"designViewModelUtils");this.resolver=t,this.designerHostService=n,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(t){const n=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(),n}createComponentRefNode(t){const n=this.resolver.getSchemaByType("component-ref");return Object.assign(n,{id:`${t.componentId}-component-ref`,component:`${t.componentId}-component`}),n}createComponentNode(t){const n=this.resolver.getSchemaByType("component"),r=this.createFormComponentContents(t);return Object.assign(n,{id:`${t.componentId}-component`,viewModel:`${t.componentId}-component-viewmodel`,componentType:t.componentType,appearance:{class:this.getFormComponentClass()},formColumns:t.formColumns,contents:r}),n}getFormComponentClass(){const{templateId:t}=this.formSchemaUtils.getFormSchema().module;return t==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(t){const n=this.resolver.getSchemaByType("section");Object.assign(n,{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}),n.contents=[r];const{selectedFields:a}=t;a==null||a.forEach(c=>{const u=be.cloneDeep(c),d=this.resolveControlClassByFormColumns(t),f=this.controlCreatorUtils.setFormFieldProperty(u,"",d);f&&i.push(f)});const{templateId:l}=this.formSchemaUtils.getFormSchema().module;return l==="double-list-in-tab-template"&&(n.appearance.class="f-section-grid f-section-in-main px-0 pt-0",n.fill=!0),[n]}resolveControlClassByFormColumns(t){let n="";switch(t.formColumns){case 1:{n="col-12";break}case 2:{n="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{n="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{n="col-12 col-md-6 col-xl-3 col-el-2";break}}return n}createViewModeNode(t){return{id:`${t.componentId}-component-viewmodel`,code:`${t.componentId}-component-viewmodel`,name:t.componentName,bindTo:t.bindTo,parent:Sa,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const n=[],{selectedFields:r}=t;return r==null||r.forEach(i=>{let a="blur";const l=i.type.name;(l===Sn.Enum||l===Sn.Boolean)&&(a="change"),n.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}),n}}function Fa(e,t,n,r){var a,l,c,u,d,f;const i=n.parentComponentInstance;if(i&&r){const s=(a=i.schema)==null?void 0:a.type,m={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((l=n.bindingSourceContext)==null?void 0:l.entityTitle)||((u=(c=n.bindingSourceContext)==null?void 0:c.bindingEntity)==null?void 0:u.name)||"标题",componentType:"form",formColumns:s==="splitter-pane"?1:4,parentContainerId:i.schema.id,bindTo:((d=n.bindingSourceContext)==null?void 0:d.bindTo)||"/",selectedFields:(f=n.bindingSourceContext)==null?void 0:f.bindingEntityFields};return new xa(e,r).createComponent(m)}else return t}function Ta(e,t,n){return t}Ue({customClass:{type:String,default:""},customStyle:{type:String,defaut:""}},{$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:[]}},required:["id","type","contents"]},wn,Fa);const To={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input 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:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}}},required:["id","type","editor"]},Ht={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:""},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},type:{type:String,default:"input-group"},componentId:{type:String,default:""}};Ue(Ht,To,wn,void 0);function xn(e,t,n){var N;const r=n&&n.getStyles&&n.getStyles()||"",i=n&&n.getDesignerClass&&n.getDesignerClass()||"",a=o.ref();function l(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function c(){return!1}function u(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function d(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function f(h){if(!h||!h.value)return null;if(h.value.schema&&h.value.schema.type==="component")return h.value;const _=o.ref(h==null?void 0:h.value.parent),x=f(_);return x||null}function s(h=t){var T;const{componentInstance:_,designerItemElementRef:x}=h;if(!_||!_.value)return null;const{getCustomButtons:k}=_.value;return _.value.canMove||k&&((T=k())!=null&&T.length)?x:s(h.parent)}function p(h){return!!n&&n.canAccepts(h)}function m(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function g(){}function b(h,_){!h||!_||n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(h,_)}function v(h,_){const{componentType:x}=h;let k=$t(x,h,_);n&&n.onResolveNewComponentSchema&&(k=n.onResolveNewComponentSchema(h,k));const T=x.toLowerCase().replace(/-/g,"_");return k&&!k.id&&k.type===x&&(k.id=`${T}_${Math.random().toString().slice(2,6)}`),k}function y(h){}function C(...h){if(n&&n.getPropsConfig)return n.getPropsConfig(...h)}function F(){n&&n.onRemoveComponent&&n.onRemoveComponent(),t!=null&&t.schema.contents&&t.schema.contents.map(h=>{let _=h.id;h.type==="component-ref"&&(_=h.component);const x=e.value.querySelectorAll(`#${_}-design-item`);x!=null&&x.length&&Array.from(x).map(k=>{var T;(T=k==null?void 0:k.componentInstance)!=null&&T.value.onRemoveComponent&&k.componentInstance.value.onRemoveComponent()})})}function w(){if(n&&n.getCustomButtons)return n.getCustomButtons()}function S(h){if(n&&n.onPropertyChanged)return n.onPropertyChanged(h)}return a.value={canMove:l(),canSelectParent:c(),canDelete:u(),canNested:!d(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:(N=t==null?void 0:t.parent)==null?void 0:N.componentInstance,schema:t==null?void 0:t.schema,styles:r,designerClass:i,canAccepts:p,getBelongedComponentInstance:f,getDraggableDesignItemElement:s,getDraggingDisplayText:m,getPropConfig:C,getDragScopeElement:g,onAcceptMovedChildElement:b,onChildElementMovedOut:y,addNewChildComponentSchema:v,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||o.ref(!1),onRemoveComponent:F,getCustomButtons:w,onPropertyChanged:S},a}class _o{constructor(t,n){z(this,"componentId");z(this,"viewModelId");z(this,"eventsEditorUtils");z(this,"formSchemaUtils");z(this,"formMetadataConverter");z(this,"designViewModelUtils");z(this,"designViewModelField");z(this,"controlCreatorUtils");z(this,"designerHostService");z(this,"schemaService",null);z(this,"metadataService",null);z(this,"propertyConfig",{type:"object",categories:{}});var r;this.componentId=t,this.designerHostService=n,this.eventsEditorUtils=n.eventsEditorUtils,this.formSchemaUtils=n.formSchemaUtils,this.formMetadataConverter=n.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=n.designViewModelUtils,this.controlCreatorUtils=n.controlCreatorUtils,this.metadataService=n.metadataService,this.schemaService=n.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var r;const n=t.binding&&t.binding.type==="Form"&&t.binding.field;if(n){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===n)}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",editable:!1,data:[{value:t.type,name:ae[t.type].name}]}}}}}getAppearanceConfig(t=null){return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(t,n){const r=n&&n.parent&&n.parent.schema;if(!r)return;const i=r.contents.findIndex(l=>l.id===t),a=be.cloneDeep(r.contents[i]);r.contents.splice(i,1),r.contents.splice(i,0,a)}}class _a{constructor(){z(this,"label","");z(this,"id","");z(this,"columnInSM",12);z(this,"columnInMD",6);z(this,"columnInLG",3);z(this,"columnInEL",2);z(this,"displayWidthInSM",1);z(this,"displayWidthInMD",1);z(this,"displayWidthInLG",1);z(this,"displayWidthInEL",1);z(this,"displayColumnCountAtBreakPoint","md");z(this,"tagRow",0);z(this,"showTopBorder",0);z(this,"group",1);z(this,"isSupportedClass",!0);z(this,"fieldSetId","")}}function Na(e){let t,n;const r=new Map;let i=[];function a(f,s){const m=f.split(" ").filter(C=>C.startsWith("col-"));if(m.length===0){s.isSupportedClass=!1;return}let g=m.find(C=>/^col-([1-9]|10|11|12)$/.test(C)),b=m.find(C=>/^col-md-([1-9]|10|11|12)$/.test(C)),v=m.find(C=>/^col-xl-([1-9]|10|11|12)$/.test(C)),y=m.find(C=>/^col-el-([1-9]|10|11|12)$/.test(C));g=g||"col-12",s.columnInSM=parseInt(g.replace("col-",""),10),s.displayWidthInSM=s.columnInSM/12,s.displayWidthInSM!==1&&(s.isSupportedClass=!1),b=b||"col-md-"+s.columnInSM,s.columnInMD=parseInt(b.replace("col-md-",""),10),s.displayWidthInMD=s.columnInMD/6,[1,2].includes(s.displayWidthInMD)||(s.isSupportedClass=!1),v=v||"col-xl-"+s.columnInMD,s.columnInLG=parseInt(v.replace("col-xl-",""),10),s.displayWidthInLG=s.columnInLG/3,[1,2,3,4].includes(s.displayWidthInLG)||(s.isSupportedClass=!1),y=y||"col-el-"+s.columnInLG,s.columnInEL=parseInt(y.replace("col-el-",""),10),s.displayWidthInEL=s.columnInEL/2,[1,2,3,4,5,6].includes(s.displayWidthInEL)||(s.isSupportedClass=!1)}function l(f,s,p,m=!1){let g=!1;f.contents.forEach(b=>{if(b.type==="fieldset"){p+=1,l(b,s,p,!0),g=!0;return}g&&(p+=1,g=!1);const v=b.appearance&&b.appearance.class,y=new _a;v?a(v,y):y.isSupportedClass=!1,y.label=b.label||b.id,y.id=b.id,y.group=p,m&&(y.fieldSetId=f.id),n===b.id&&(t=p),r.set(b.id,b),s.push(y)})}function c(f){const s=e.getComponentById(f);if(!s||!s.componentType||!s.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const p=e.selectNode(s,m=>m.type===dn.DgControl["response-form"].type);return!p||!p.contents||p.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:p}}function u(f,s){s=s||f.id;const{result:p,message:m,formNode:g}=c(s);if(!p)return{result:p,message:m};n=f.id,i=[],r.clear();const b=g.contents[0].type===dn.DgControl.fieldset.type?0:1;l(g,i,b);const v=i.find(C=>!C.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:v?"customize":"standard"},importData:i}}function d(f,s){s=s;const{result:p,formNode:m}=c(s);if(!p)return"";const g=[];return f.forEach(b=>{var C;const v=r.get(b.id),y=v.appearance&&v.appearance.class;if(y){const w=y.split(" ").filter(k=>!k.startsWith("col-")),S="col-"+b.columnInSM,N="col-md-"+b.columnInMD,h="col-xl-"+b.columnInLG,_="col-el-"+b.columnInEL,x=[S,N,h,_].concat(w);v.appearance.class=x.join(" ")}if(b.fieldSetId){const F=m.contents.find(S=>S.id===b.fieldSetId),w=g.find(S=>S.id===b.fieldSetId);w?(C=w.contents)==null||C.push(v):(g.push(F),F.contents=[v])}else g.push(v)}),m.contents=g,m.id}return{checkCanFindFormNode:c,checkCanOpenLayoutEditor:u,changeFormControlsByResponseLayoutConfig:d,getResonseFormLayoutConfig:l}}const Ut=o.ref(0);function Va(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.top>=n.top,a=r.top<=n.bottom;return i&&a}function ka(e){const t=e.querySelector(".component-btn-group");if(!t)return;t.style.display="";const n=t.getBoundingClientRect(),r=t.querySelector("div");if(r){const i=r.getBoundingClientRect();r.style.top=n.top+"px";let a=n.left-i.width;const l=document.querySelector(".editorDiv");if(l){const c=l.getBoundingClientRect();a<c.left&&({left:a}=e.getBoundingClientRect())}r.style.left=a+"px"}}function Ea(e){if(!window.scrollContainerList)return;const t=Array.from(window.scrollContainerList);if(t.length&&t.length===1){const n=t[0],r=document.querySelector(`[id=${n}]`);if(r&&r.contains(e))return r}}function No(e){if(!e)return;const t=e.getBoundingClientRect();if(t.width===0&&t.height===0)return;const n=e.querySelector(".component-btn-group");if(n){let r=!0;const i=Ea(e);if(i&&(r=Va(e,i)),!r){n.style.display="none";return}ka(e)}}function Ia(e){if(!e)return;let t;e.className.includes("dgComponentSelected")?t=e:t=e.querySelector(".dgComponentSelected"),t&&No(t)}var gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zt(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 Ma={exports:{}};(function(e,t){(function(n){e.exports=n()})(function(){return function(){function n(r,i,a){function l(d,f){if(!i[d]){if(!r[d]){var s=typeof zt=="function"&&zt;if(!f&&s)return s(d,!0);if(c)return c(d,!0);var p=new Error("Cannot find module '"+d+"'");throw p.code="MODULE_NOT_FOUND",p}var m=i[d]={exports:{}};r[d][0].call(m.exports,function(g){var b=r[d][1][g];return l(b||g)},m,m.exports,n,r,i,a)}return i[d].exports}for(var c=typeof zt=="function"&&zt,u=0;u<a.length;u++)l(a[u]);return l}return n}()({1:[function(n,r,i){var a={},l="(?:^|\\s)",c="(?:\\s|$)";function u(s){var p=a[s];return p?p.lastIndex=0:a[s]=p=new RegExp(l+s+c,"g"),p}function d(s,p){var m=s.className;m.length?u(p).test(m)||(s.className+=" "+p):s.className=p}function f(s,p){s.className=s.className.replace(u(p)," ").trim()}r.exports={add:d,rm:f}},{}],2:[function(n,r,i){(function(a){var l=n("contra/emitter"),c=n("crossvent"),u=n("./classes"),d=document,f=d.documentElement;function s(T,V){var I=arguments.length;I===1&&Array.isArray(T)===!1&&(V=T,T=[]);var E,M,B,O,R,q,L,X,te,ie=null,ue,D,ne=!1,pe=0,oe,A=V||{};A.moves===void 0&&(A.moves=C),A.accepts===void 0&&(A.accepts=C),A.invalid===void 0&&(A.invalid=Pe),A.containers===void 0&&(A.containers=T||[]),A.isContainer===void 0&&(A.isContainer=y),A.copy===void 0&&(A.copy=!1),A.copySortSource===void 0&&(A.copySortSource=!1),A.revertOnSpill===void 0&&(A.revertOnSpill=!1),A.removeOnSpill===void 0&&(A.removeOnSpill=!1),A.direction===void 0&&(A.direction="vertical"),A.ignoreInputTextSelection===void 0&&(A.ignoreInputTextSelection=!0),A.mirrorContainer===void 0&&(A.mirrorContainer=d.body);var Y=l({containers:A.containers,start:U,end:Xe,cancel:st,remove:et,destroy:Be,canMove:re,dragging:!1});return A.removeOnSpill===!0&&Y.on("over",P).on("out",H),Ce(),Y;function we($){return Y.containers.indexOf($)!==-1||A.isContainer($)}function Ce($){var W=$?"remove":"add";g(f,W,"mousedown",G),g(f,W,"mouseup",Ke)}function je($){var W=$?"remove":"add";g(f,W,"mousemove",Q)}function De($){var W=$?"remove":"add";c[W](f,"selectstart",me),c[W](f,"click",me)}function Be(){Ce(!0),Ke({})}function me($){ue&&$.preventDefault()}function G($){O=$.clientX,R=$.clientY;var W=b($)!==1||$.metaKey||$.ctrlKey;if(!W){var Z=$.target,fe=ee(Z);fe&&(ue=fe,je(),$.type==="mousedown"&&(N(Z)?Z.focus():$.preventDefault()))}}function Q($){if(ue){if(b($)===0){Ke({});return}if(!($.clientX!==void 0&&Math.abs($.clientX-O)<=(A.slideFactorX||0)&&$.clientY!==void 0&&Math.abs($.clientY-R)<=(A.slideFactorY||0))){if(A.ignoreInputTextSelection){var W=k("clientX",$)||0,Z=k("clientY",$)||0,fe=d.elementFromPoint(W,Z);if(N(fe))return}var Se=ue;je(!0),De(),Xe(),ge(Se),u.add(X||B,"gu-transit"),ve(),K(),pe=0,ft($)}}}function ee($){if(!(Y.dragging&&E)&&!we($)){for(var W=$;S($)&&we(S($))===!1;)if(A.invalid($,W)||($=S($),!$))return;var Z=S($);if(Z&&!A.invalid($,W)){var fe=A.moves($,Z,W,_($));if(fe)return{item:$,source:Z}}}}function re($){return!!ee($)}function U($){var W=ee($);W&&ge(W)}function ge($){kt($.item,$.source)&&(X=$.item.cloneNode(!0),Y.emit("cloned",X,$.item,"copy")),M=$.source,B=$.item,q=L=_($.item),Y.dragging=!0,Y.emit("drag",B,M)}function Pe(){return!1}function Xe(){if(Y.dragging){var $=X||B;Ze($,S($))}}function lt(){ue=!1,je(!0),De(!0)}function Ke($){if(lt(),!!Y.dragging){var W=X||B,Z=k("clientX",$)||0,fe=k("clientY",$)||0,Se=v(E,Z,fe),_e=dt(Se,Z,fe);_e&&(X&&A.copySortSource||!X||_e!==M)?Ze(W,_e):A.removeOnSpill?et():st()}}function Ze($,W){var Z=S($);X&&A.copySortSource&&W===M&&Z.removeChild(B),ot(W)?Y.emit("cancel",$,M):Y.emit("drop",$,W,M,L),ct()}function et(){if(Y.dragging){var $=X||B,W=S($);W&&W.removeChild($),Y.emit(X?"cancel":"remove",$,W,M),ct()}}function st($){if(Y.dragging){var W=arguments.length>0?$:A.revertOnSpill,Z=X||B,fe=S(Z),Se=ot(fe);Se===!1&&W&&(X?fe&&fe.removeChild(X):M.insertBefore(Z,q)),Se||W?Y.emit("cancel",Z,M,M):Y.emit("drop",Z,fe,M,L),ct()}}function ct(){var $=X||B;lt(),xe(),Re(),$&&u.rm($,"gu-transit"),te&&clearTimeout(te),Y.dragging=!1,ie&&Y.emit("out",$,ie,M),Y.emit("dragend",$,pe),M=B=X=q=L=te=ie=null}function ot($,W){var Z;return W!==void 0?Z=W:E?Z=L:Z=_(X||B),$===M&&Z===q}function dt($,W,Z){for(var fe=$;fe&&!Se();)fe=S(fe);return fe;function Se(){var _e=we(fe);if(_e===!1)return!1;var mt=Ee(fe,$),tt=Ye(fe,mt,W,Z),ut=ot(fe,tt);return ut?!0:A.accepts(B,fe,M,tt)}}function ft($){if(!E)return;$.preventDefault();var W=k("clientX",$)||0,Z=k("clientY",$)||0;E.style.left=W-2+"px",E.style.top=Z-2+"px";var fe=X||B,Se=v(E,W,Z),_e=dt(Se,W,Z),mt=_e!==null&&_e!==ie;(mt||_e===null)&&(rt(),ie=_e,Ct()),Ie(Se,Z);var tt=S(fe);if(_e===M&&X&&!A.copySortSource){tt&&tt.removeChild(fe);return}var ut,bt=Ee(_e,Se);if(ne=Fe(bt,_e),bt!==null)ut=Ye(_e,bt,W,Z);else if(A.revertOnSpill===!0&&!X)ut=q,_e=M;else{X&&tt&&tt.removeChild(fe),X&&D&&(D.style.display="none");return}D.style.display="block",pt(ut,fe,mt),ut?Ve(bt,ut):ke(_e);function Le(He){Y.emit(He,fe,ie,M)}function Ct(){mt&&Le("over")}function rt(){ie&&Le("out")}}function pt($,W,Z){($===W||$===_(W))&&(L=_(W)),($===null&&Z||$!==W&&$!==_(W))&&(L=$)}function P($){u.rm($,"gu-hide")}function H($){Y.dragging&&u.add($,"gu-hide")}function K(){E||(E=document.createElement("div"),E.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;",E.innerHTML=A.getMirrorText&&A.getMirrorText(B)||"控件",u.add(E,"gu-mirror"),A.mirrorContainer.appendChild(E),g(f,"add","mousemove",ft),u.add(A.mirrorContainer,"gu-unselectable"),Y.emit("cloned",E,B,"mirror"))}function ve(){if(D=document.createElement("div"),u.add(D,"gu-insertion"),B){var $=B.getBoundingClientRect();D.style.left=$.left+"px",D.style.top=$.top+"px"}ne=!1,A.mirrorContainer.appendChild(D)}function xe(){E&&(u.rm(A.mirrorContainer,"gu-unselectable"),g(f,"remove","mousemove",ft),S(E).removeChild(E),E=null)}function Re(){D&&(S(D).removeChild(D),D=null)}function Ee($,W){for(var Z=W;Z!==$&&S(Z)!==$;)Z=S(Z);return Z===f?null:Z}function Fe($,W){if(!W)return ne;var Z=$||W&&W.lastElementChild;if(!Z)return!0;var fe=getComputedStyle($),Se=/^inline/.test(fe.getPropertyValue("display"))||/^(left|right)$/.test(fe.getPropertyValue("float"));if(Se)return!0;if(W){var _e=getComputedStyle(W),mt=_e.getPropertyValue("display");if(/flex$/.test(mt)){var tt=_e.getPropertyValue("flex-direction")||"row";if(tt==="row"||tt==="row-reverse")return!Oe(W)}return!1}return!0}function Oe($){if(!$.children||!$.children.length)return!1;for(const W of Array.from($.children)){const fe=(W.className&&W.className.split(" ")||[]).filter(Se=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Se));if(!fe.length)return!1;for(const Se of fe){const _e=Se.slice(Se.lastIndexOf("-")+1);if(parseInt(_e,10)!==12)return!1}}return!0}function Ve($,W){const Z=W.getBoundingClientRect();if(D.style.left=Z.left+"px",D.style.top=Z.top+"px",ne){if(D.style.height=Z.height+"px",D.style.width="4px",$){const fe=$.getBoundingClientRect();fe.top!==Z.top&&(D.style.left=fe.right+"px",D.style.top=fe.top+"px",D.style.height=fe.height+"px")}}else if(D.style.height="4px",D.style.width=Z.width+"px",oe){const fe=oe.getBoundingClientRect();Z.top<fe.top&&(D.style.display="none")}W===B&&B&&(D.style.display="none")}function ke($){L=null;var W=$.lastElementChild;if(W){var Z=W.getBoundingClientRect();ne?(D.style.left=Z.right+"px",D.style.top=Z.top+"px",D.style.height=Z.height+"px",D.style.width="4px"):(D.style.left=Z.left+"px",D.style.top=Z.bottom+"px",D.style.height="4px",D.style.width=Z.width+"px"),W===B&&B&&(D.style.display="none")}else D.style.display="none"}function Ie($,W){if(!A.mirrorContainer.contains($)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(oe=p($),!oe||!oe.contains($)))return;const Z=document.querySelector(".dgComponentSelected"),fe=oe.getBoundingClientRect();if(W-30<fe.top&&oe.scrollTop>0){let Se=oe.scrollTop<10?oe.scrollTop:10;oe.scrollBy(0,-1*Se),Z&&oe.contains(Z)&&(pe=pe+-1*Se)}if(W+30>fe.bottom&&oe.scrollTop<oe.scrollHeight-oe.clientHeight){const Se=oe.scrollHeight-oe.clientHeight-oe.scrollTop;let _e=Se<10?Se:10;oe.scrollBy(0,_e),Z&&oe.contains(Z)&&(pe=pe+_e)}}function Ye($,W,Z,fe){var Se=A.direction==="horizontal",_e=A.direction==="mixed",mt=W!==$?ut():tt();return mt;function tt(){var Le=$.children.length,Ct,rt,He;for(Ct=0;Ct<Le;Ct++)if(rt=$.children[Ct],He=rt.getBoundingClientRect(),Se&&He.left+He.width/2>Z||!_e&&!Se&&He.top+He.height/2>fe||_e&&He.left+He.width>Z&&He.top+He.height>fe)return rt;return null}function ut(){var Le=W.getBoundingClientRect();if(_e){var Ct=fe-Le.top,rt=Z-Le.left,He=Le.bottom-fe,Qn=Le.right-Z,Kn=Math.min(rt,Qn,Ct,He),Zn;return ne?Zn=Qn<rt:Zn=He===Kn||Qn===Kn||rt===Kn,bt(Zn)}return bt(Se?Z>Le.left+F(Le)/2:fe>Le.top+w(Le)/2)}function bt(Le){return Le?_(W):W}}function kt($,W){return typeof A.copy=="boolean"?A.copy:A.copy($,W)}}function p(T){const V=Array.from(window.scrollContainerList);if(V.length===1){const E=Array.from(window.scrollContainerList)[0];return document.getElementById(E)}const I=m(V);for(const E of I)if(E.contains(T))return E;return null}function m(T){const V=[];return T.forEach(I=>{const E=document.getElementById(I);E&&V.push(E)}),V.sort((I,E)=>I.contains(E)?1:E.contains(I)?-1:0),V}function g(T,V,I,E){var M={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},B={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},O={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?c[V](T,B[I],E):a.navigator.msPointerEnabled?c[V](T,O[I],E):(c[V](T,M[I],E),c[V](T,I,E))}function b(T){if(T.touches!==void 0)return T.touches.length;if(T.which!==void 0&&T.which!==0)return T.which;if(T.buttons!==void 0)return T.buttons;var V=T.button;if(V!==void 0)return V&1?1:V&2?3:V&4?2:0}function v(T,V,I){T=T||{};var E=T.className||"",M;return T.className+=" gu-hide",M=d.elementFromPoint(V,I),T.className=E,M}function y(){return!1}function C(){return!0}function F(T){return T.width||T.right-T.left}function w(T){return T.height||T.bottom-T.top}function S(T){return T.parentNode===d?null:T.parentNode}function N(T){return T.tagName==="INPUT"||T.tagName==="TEXTAREA"||T.tagName==="SELECT"||h(T)}function h(T){return!T||T.contentEditable==="false"?!1:T.contentEditable==="true"?!0:h(S(T))}function _(T){return T.nextElementSibling||V();function V(){var I=T;do I=I.nextSibling;while(I&&I.nodeType!==1);return I}}function x(T){return T.targetTouches&&T.targetTouches.length?T.targetTouches[0]:T.changedTouches&&T.changedTouches.length?T.changedTouches[0]:T}function k(T,V){var I=x(V),E={pageX:"clientX",pageY:"clientY"};return T in E&&!(T in I)&&E[T]in I&&(T=E[T]),I[T]}r.exports=s}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(n,r,i){r.exports=function(l,c){return Array.prototype.slice.call(l,c)}},{}],4:[function(n,r,i){var a=n("ticky");r.exports=function(c,u,d){c&&a(function(){c.apply(d||null,u||[])})}},{ticky:10}],5:[function(n,r,i){var a=n("atoa"),l=n("./debounce");r.exports=function(u,d){var f=d||{},s={};return u===void 0&&(u={}),u.on=function(p,m){return s[p]?s[p].push(m):s[p]=[m],u},u.once=function(p,m){return m._once=!0,u.on(p,m),u},u.off=function(p,m){var g=arguments.length;if(g===1)delete s[p];else if(g===0)s={};else{var b=s[p];if(!b)return u;b.splice(b.indexOf(m),1)}return u},u.emit=function(){var p=a(arguments);return u.emitterSnapshot(p.shift()).apply(this,p)},u.emitterSnapshot=function(p){var m=(s[p]||[]).slice(0);return function(){var g=a(arguments),b=this||u;if(p==="error"&&f.throws!==!1&&!m.length)throw g.length===1?g[0]:g;return m.forEach(function(y){f.async?l(y,g,b):y.apply(b,g),y._once&&u.off(p,y)}),u}},u}},{"./debounce":4,atoa:3}],6:[function(n,r,i){(function(a){var l=n("custom-event"),c=n("./eventmap"),u=a.document,d=p,f=g,s=[];a.addEventListener||(d=m,f=b),r.exports={add:d,remove:f,fabricate:v};function p(S,N,h,_){return S.addEventListener(N,h,_)}function m(S,N,h){return S.attachEvent("on"+N,C(S,N,h))}function g(S,N,h,_){return S.removeEventListener(N,h,_)}function b(S,N,h){var _=F(S,N,h);if(_)return S.detachEvent("on"+N,_)}function v(S,N,h){var _=c.indexOf(N)===-1?k():x();S.dispatchEvent?S.dispatchEvent(_):S.fireEvent("on"+N,_);function x(){var T;return u.createEvent?(T=u.createEvent("Event"),T.initEvent(N,!0,!0)):u.createEventObject&&(T=u.createEventObject()),T}function k(){return new l(N,{detail:h})}}function y(S,N,h){return function(x){var k=x||a.event;k.target=k.target||k.srcElement,k.preventDefault=k.preventDefault||function(){k.returnValue=!1},k.stopPropagation=k.stopPropagation||function(){k.cancelBubble=!0},k.which=k.which||k.keyCode,h.call(S,k)}}function C(S,N,h){var _=F(S,N,h)||y(S,N,h);return s.push({wrapper:_,element:S,type:N,fn:h}),_}function F(S,N,h){var _=w(S,N,h);if(_){var x=s[_].wrapper;return s.splice(_,1),x}}function w(S,N,h){var _,x;for(_=0;_<s.length;_++)if(x=s[_],x.element===S&&x.type===N&&x.fn===h)return _}}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(n,r,i){(function(a){var l=[],c="",u=/^on/;for(c in a)u.test(c)&&l.push(c.slice(2));r.exports=l}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(n,r,i){(function(a){var l=a.CustomEvent;function c(){try{var u=new l("cat",{detail:{foo:"bar"}});return u.type==="cat"&&u.detail.foo==="bar"}catch{}return!1}r.exports=c()?l:typeof document<"u"&&typeof document.createEvent=="function"?function(d,f){var s=document.createEvent("CustomEvent");return f?s.initCustomEvent(d,f.bubbles,f.cancelable,f.detail):s.initCustomEvent(d,!1,!1,void 0),s}:function(d,f){var s=document.createEventObject();return s.type=d,f?(s.bubbles=!!f.bubbles,s.cancelable=!!f.cancelable,s.detail=f.detail):(s.bubbles=!1,s.cancelable=!1,s.detail=void 0),s}}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,r,i){var a=r.exports={},l,c;function u(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?l=setTimeout:l=u}catch{l=u}try{typeof clearTimeout=="function"?c=clearTimeout:c=d}catch{c=d}})();function f(w){if(l===setTimeout)return setTimeout(w,0);if((l===u||!l)&&setTimeout)return l=setTimeout,setTimeout(w,0);try{return l(w,0)}catch{try{return l.call(null,w,0)}catch{return l.call(this,w,0)}}}function s(w){if(c===clearTimeout)return clearTimeout(w);if((c===d||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(w);try{return c(w)}catch{try{return c.call(null,w)}catch{return c.call(this,w)}}}var p=[],m=!1,g,b=-1;function v(){!m||!g||(m=!1,g.length?p=g.concat(p):b=-1,p.length&&y())}function y(){if(!m){var w=f(v);m=!0;for(var S=p.length;S;){for(g=p,p=[];++b<S;)g&&g[b].run();b=-1,S=p.length}g=null,m=!1,s(w)}}a.nextTick=function(w){var S=new Array(arguments.length-1);if(arguments.length>1)for(var N=1;N<arguments.length;N++)S[N-1]=arguments[N];p.push(new C(w,S)),p.length===1&&!m&&f(y)};function C(w,S){this.fun=w,this.array=S}C.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function F(){}a.on=F,a.addListener=F,a.once=F,a.off=F,a.removeListener=F,a.removeAllListeners=F,a.emit=F,a.prependListener=F,a.prependOnceListener=F,a.listeners=function(w){return[]},a.binding=function(w){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(w){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(n,r,i){(function(a){var l=typeof a=="function",c;l?c=function(u){a(u)}:c=function(u){setTimeout(u,0)},r.exports=c}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,r,i){(function(a,l){var c=n("process/browser.js").nextTick,u=Function.prototype.apply,d=Array.prototype.slice,f={},s=0;i.setTimeout=function(){return new p(u.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new p(u.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(m){m.close()};function p(m,g){this._id=m,this._clearFn=g}p.prototype.unref=p.prototype.ref=function(){},p.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(m,g){clearTimeout(m._idleTimeoutId),m._idleTimeout=g},i.unenroll=function(m){clearTimeout(m._idleTimeoutId),m._idleTimeout=-1},i._unrefActive=i.active=function(m){clearTimeout(m._idleTimeoutId);var g=m._idleTimeout;g>=0&&(m._idleTimeoutId=setTimeout(function(){m._onTimeout&&m._onTimeout()},g))},i.setImmediate=typeof a=="function"?a:function(m){var g=s++,b=arguments.length<2?!1:d.call(arguments,1);return f[g]=!0,c(function(){f[g]&&(b?m.apply(null,b):m.call(null),i.clearImmediate(g))}),g},i.clearImmediate=typeof l=="function"?l:function(m){delete f[m]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Ma);const Oa={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}},Ba={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},Fn=o.defineComponent({name:"Toast",props:Ba,emits:["close","click"],setup:(e,t)=>{const n=o.ref(e.animate),r="fadeOut",i=o.computed(()=>e.options),a=o.ref(!1),l=o.computed(()=>{const y={animated:a.value,toast:!0};return y[e.animate]=!1,y[r]=a.value,y[i.value.type]=!0,i.value.theme&&(y[i.value.theme]=!0),y}),c=o.computed(()=>{const F=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,w={"f-icon":!0};return w[F]=!0,w}),u=o.computed(()=>i.value.title||i.value.message),d=o.computed(()=>i.value.title&&i.value.message),f=o.computed(()=>!i.value.title&&i.value.message),s=o.computed(()=>e.showCloseButton),p=o.computed(()=>!!i.value.buttons||!!t.slots.default);function m(y){y.stopPropagation(),y.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function g(y,C){}function b(y){return`f-preten-link ${y.customClass?y.customClass:""}`}o.watch(n,()=>{n.value});const v=()=>{var y;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((y=i.value.buttons)==null?void 0:y.map(C=>o.createVNode("span",{class:b(C),onClick:F=>void 0},[C.text]))),t.slots.default&&t.slots.default()])])};return()=>o.createVNode("div",{class:l.value},[s.value&&o.createVNode("button",{title:"close",class:"toast-close f-btn-icon f-bare",onClick:m},[o.createVNode("span",{class:"f-icon modal_close"},null)]),u.value&&o.createVNode("section",{class:"modal-tips"},[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:c.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[d.value&&o.createVNode(o.Fragment,null,[o.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:i.value.title},null),o.createVNode("p",{class:"toast-msg",innerHTML:i.value.message},null),p.value&&v()]),f.value&&(i.value.buttons?o.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:i.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[v()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:i.value.message},null))])])])}}),Gt=o.defineComponent({name:"Notify",props:Oa,emits:["close","empty"],setup(e,t){const n=o.computed(()=>({"farris-notify":!0})),r={left:12,right:12,top:20,bottom:12},i=o.ref(),a=o.ref(e.options),l=o.ref(e.showCloseButton),c=o.computed(()=>e.position||"bottom-right"),u=o.computed(()=>e.timeout!=null?e.timeout:3e3),d=o.computed(()=>{const p=e.bottom?e.bottom:r.bottom,m=e.top?e.top:r.top,g={transition:"all 0.2s ease",left:c.value.indexOf("left")>-1?`${e.left?e.left:r.left}px`:"",right:c.value.indexOf("right")>-1?`${e.right?e.right:r.right}px`:"",top:c.value.indexOf("top")>-1?`${m}px`:"",bottom:c.value.indexOf("bottom")>-1?`${p}px`:""};return c.value.indexOf("center")>-1&&(g.left="50%",g.marginLeft="calc(-24rem / 2)",c.value==="center-center"&&(g.top="50%",g.transform="translate(-50%, -50%)")),g});function f(p){t.emit("close")}u.value&&setTimeout(()=>{f()},u.value),t.expose({closeToast:f,container:i,notifyPosition:c});function s(p,m){f()}return()=>o.createVNode("div",{class:n.value,style:d.value,ref:i},[o.createVNode(Fn,{options:a.value,showCloseButton:l.value,animate:e.animate,onClose:p=>s(p,a.value)},null)])}});class Vo{constructor(){z(this,"notifyRefs",[]);z(this,"globalConfig",o.reactive({}))}createNotifyInstance(t){const n=this,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0},this.globalConfig,{...t}),a=document.createElement("div");a.style.display="contents";const l=o.createApp({setup(){const c=o.ref();function u(){c.value.container.style.transform="scale(0)",setTimeout(()=>{n.updateNotifyPositionForClose(i,c),l.unmount()},220)}if(i.position.indexOf("top")>-1){const d=n.getNotifyInstances(i.position),f=d[d.length-1];if(f){const s=f.value.container.getBoundingClientRect();i.top=s.bottom}}return o.onUnmounted(()=>{document.body.removeChild(a)}),o.onMounted(()=>{n.updateNotifyPositionForCreate(i,c)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(Gt,o.mergeProps({ref:c},i,{onClose:u}),null)]})}});return l.provide("NotifyService",this),document.body.appendChild(a),l.mount(a),l}getNotifyInstances(t){return this.notifyRefs.filter(n=>n.value.notifyPosition===t)}updateNotifyPositionForCreate(t,n){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,n]}updateNotifyPositionForClose(t,n){const r=this.notifyRefs.indexOf(n);if(t.position.indexOf("top")>-1){const i=this.getNotifyInstances(t.position),a=i.indexOf(n);i.slice(a+1).forEach(l=>{l.value.container.style.top=l.value.container.offsetTop-l.value.container.offsetHeight+"px"})}r>-1&&this.notifyRefs.splice(r,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,n){let r="",i="",a,l,c;typeof n=="string"?r=n:n&&(r=n.message||"",i=n.title||"",l=n.position||null,c=n.showCloseButton!=null?n.showCloseButton:null,a=n.timeout!=null?n.timeout:null);const d={options:{type:t,message:r,title:i}};return l!=null&&(d.position=l),c!=null&&(d.showCloseButton=c),a!=null&&(d.timeout=a),d}info(t){const n=this.buildNotifyProps("info",t);return this.show(n)}success(t){const n=this.buildNotifyProps("success",t);return this.show(n)}warning(t){const n=this.buildNotifyProps("warning",t);return this.show(n)}error(t){const n=this.buildNotifyProps("error",t);return this.show(n)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const Pa=Symbol("NOTIFY_SERVICE_TOKEN");Gt.install=e=>{e.component(Gt.name,Gt),e.component(Fn.name,Fn);const t=new Vo;e.provide(Pa,t),e.provide("FNotifyService",t)};const ko=new Map([["appearance",ht],["column","columnOption"]]);function Ra(e,t,n){var s;const r=n.parentComponentInstance,i=r.schema.type,a=String(((s=r.schema.appearance)==null?void 0:s.class)||"").split(" "),l=i==="section"||i==="tab-page",c=a.includes("f-page-content-nav"),u=a.includes("f-page-main"),d=e.getSchemaByType("component");d.id=`${t.id}-component`,d.componentType="data-grid";let f="";return f+=l?"f-struct-data-grid-in-card f-struct-is-subgrid":"",f+=c?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",f+=u?"f-struct-data-grid f-struct-wrapper":"",d.appearance={class:f},d.contents=[t],d}function ja(e,t,n){const r=n.parentComponentInstance,i=String(r.schema.appearance.class||"").split(" "),a=i.includes("f-page-content-nav"),l=i.includes("f-page-main"),c=e.getSchemaByType("section");c.id=`${t.id}-section`;let u="";return u+=a?"f-section-in-nav ":"",u+=l?"f-section-in-managelist ":"",u+="f-section-grid",c.appearance={class:u},c.contents=[t],c}function Da(e,t,n){const r=e.getSchemaByType("content-container");return r.id=`${t.id}-layout`,r.appearance={class:"f-grid-is-sub f-utils-flex-column"},r.contents=[t],r}function Eo(e,t,n){const i=n.parentComponentInstance.schema.type,a=i==="section"||i==="tab-page";t.appearance={class:"f-component-grid"};const c=(a?Da:ja)(e,t,n);return Ra(e,c,n)}const Io={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tree-grid.schema.json",title:"tree-grid",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"tree-grid"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},fit:{type:"boolean",default:!1},showStripe:{type:"boolean",default:!0},showBorder:{type:"boolean",default:!1},showTreeNodeIcons:{type:"boolean",default:!1},showSetting:{type:"boolean",default:!1},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},dataSource:{description:"",type:"string",default:""},columns:{description:"",type:"array",default:[]},identifyField:{description:"",type:"string"},editable:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},cell:{type:"object",properties:{highlightFocusingCell:{description:"",type:"boolean",default:!1},mergeCell:{description:"",type:"boolean",default:!1},showEditableIcon:{description:"",type:"boolean",default:!1}}},column:{type:"object",properties:{fitColumns:{description:"",type:"boolean",default:!1},fitMode:{description:"",type:"string",default:"average"},groups:{description:"",type:"array",default:[]},reorderColumn:{description:"Enable to drag column to reorder",type:"boolean",default:!1},resizeColumn:{type:"boolean",default:!0},resizeColumnOnDoubleClick:{description:"",type:"boolean",default:!0}}},command:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},commands:{type:"array",default:[]},commandColumnWidth:{description:"",type:"number",default:120},onClickDeleteCommand:{description:"",type:"string",default:""},onClickEditCommand:{description:"",type:"string",default:""}}},contextMenu:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},customizaiton:{type:"object",properties:{enableScheme:{description:"",type:"boolean",default:!1},enableSetting:{description:"",type:"boolean",default:!1}}},edit:{type:"obejct",properties:{mode:{description:"",type:"string",default:"cell",enum:["cell","row","card"]},selectOnEditing:{description:"",type:"boolean",default:!1},onAppendRow:{description:"",type:"string",default:""},onBeforeEdit:{description:"",type:"string",default:""}}},filter:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},filterStyle:{description:"",type:"string",default:"filter-column",enum:["filter-column","filter-row"]},mode:{description:"",type:"string",default:"server",enum:["client","server"]},showSummary:{description:"",type:"boolean",default:!0},onFilterChange:{description:"",type:"string",default:""}}},footer:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customFooterStyle:{description:"",type:"object"},footerDataCommand:{description:"",type:"string",default:""},footerDataFrom:{description:"",type:"string",default:"client"},footerHeight:{description:"",type:"number",default:29},footerPosition:{description:"",type:"string",default:"bottom"},footerTemplate:{description:"",type:"string",default:""}}},group:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customGroupRow:{description:"",type:"object"},customGroupRowStyle:{description:"",type:"obejct"},customSummaryStyle:{description:"",type:"obejct"},groupColSpan:{description:"",type:"number",default:1},groupFields:{description:"",type:"array",default:[]},showGroupedColumn:{description:"",type:"boolean",default:!0},showGroupPanel:{description:"",type:"boolean",default:!1},showSummary:{description:"",type:"boolean",default:!1},summaryPosition:{description:"",type:"string",default:"separate",enum:["separate","merge-to-group"]},disableGroupOnEditing:{description:"",type:"boolean",default:!0},expandGroupRows:{description:"",type:"boolean",default:!0}}},header:{type:"object",properties:{wrapHeadings:{description:"",type:"boolean",default:!1}}},pagination:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},disablePagination:{description:"",type:"string",default:""},contentTemplate:{description:"",type:"string",default:""},index:{description:"",type:"number",default:1},mode:{description:"",type:"string",default:"server",enum:["server","client"]},showGoto:{description:"",type:"boolean",default:!1},showIndex:{description:"",type:"boolean",default:!0},showLimits:{description:"",type:"boolean",default:!1},showPageInfo:{description:"",type:"boolean",default:!0},size:{description:"",type:"number",default:20},sizeLimits:{description:"",type:"array",default:[10,20,30,50,100]},onPageChange:{description:"",type:"string",default:""},onPageSizeChange:{description:"",type:"string",default:""}}},row:{type:"object",properties:{customRowStyle:{description:"",type:"object"},disable:{description:"",type:"obejct"},height:{description:"",type:"number",default:30},showHovering:{type:"boolean",default:!0},wrapContent:{type:"boolean",default:!1}}},rowNumber:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},heading:{description:"",type:"string",default:"序号"},width:{description:"",type:"number",default:36},onClickRow:{description:"",type:"string",default:""},onDoubleClickRow:{description:"",type:"string",default:""}}},selection:{type:"object",properties:{enableSelectRow:{description:"允许选中行",type:"boolean",default:!0},enable:{description:"",type:"boolean",default:!0},checkOnSelect:{description:"",type:"boolean",default:!1},clearSelectionOnEmpty:{description:"",type:"boolean",default:!0},customSelectionItem:{description:"",type:"object"},focusSelection:{description:"",type:"string",default:"current",enum:["current","all"]},keepSelectingOnClick:{description:"",type:"boolean",default:!0},keepSelectingOnPaging:{description:"",type:"boolean",default:!0},multiSelect:{description:"",type:"boolean",default:!1},selectionMode:{description:"",type:"string",default:"default"},selectOnCheck:{description:"",type:"boolean",default:!1},selectOnEditing:{description:"",type:"boolean",default:!1},showCheckbox:{description:"",type:"boolean",default:!1},showCheckAll:{description:"",type:"boolean",default:!1},showSelection:{description:"",type:"boolean",default:!1},onBeforeSelect:{description:"",type:"string",default:""},onBeforeUnCheck:{description:"",type:"",default:""},onBeforeUnSelect:{description:"",type:"string",default:""},onCheckAll:{description:"",type:"string",default:""},onChecked:{description:"",type:"string",default:""},onSelectionChange:{description:"",type:"string",default:""},onUnCheckAll:{description:"",type:"string",default:""},onUnChecked:{description:"",type:"string",default:""},onCheckedChange:{description:"",type:"string"}}},sort:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},fields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},multiSort:{description:"",type:"boolean",default:!1}}},summary:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customSummaryStyle:{description:"",type:"object"},groupFields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},position:{description:"",type:"boolean",default:"bottom",enum:["bottom","top","both"]}}},toolbar:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},visualization:{autoHeight:{description:"",type:"boolean",default:!1},emptyDataHeight:{description:"",type:"number",default:36},emptyTemplate:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:300},scrollBarShowMode:{description:"",type:"string",default:"auto"},showBorder:{description:"",type:"boolean",default:!1},showScrollArrow:{description:"",type:"boolean",default:!1},striped:{description:"",type:"boolean",default:!0},useBlankWhenDataIsEmpty:{description:"",type:"boolean",default:!1}},onSelectionChange:{description:"行切换事件",type:"string",default:""}},required:["id","type","columns"]},Tn={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:{autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},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,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:32,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},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}},$a=Ue(Tn,Io,ko,Eo),Aa=ha(),La=ma(),Mo=Object.assign({},Tn,{componentId:{type:String,default:""}}),qa=Ue(Mo,Io,ko,Eo),Wa=ga();var Qe=(e=>(e[e.readonly=0]="readonly",e[e.editable=1]="editable",e[e.editing=2]="editing",e))(Qe||{}),it=(e=>(e[e.initial=0]="initial",e[e.editing=1]="editing",e))(it||{}),It=(e=>(e[e.data=0]="data",e[e.group=1]="group",e[e.summary=2]="summary",e))(It||{}),$e=(e=>(e[e.none=0]="none",e[e.filterable=1]="filterable",e[e.sortable=2]="sortable",e[e.filtered=4]="filtered",e[e.sorted=8]="sorted",e[e.ascending=16]="ascending",e[e.descending=32]="descending",e))($e||{}),_n=(e=>(e.NONE="none",e.NUMBER="number",e.DATE="date",e.TEXT="boolean",e.IMAGE="boolean2",e.ENUM="enum",e.CUSTOM="custom",e))(_n||{});function Ha(e,t){var m;const n=String(Date.now()),r=((m=e.rowOption)==null?void 0:m.height)||28,i=o.ref(t.value.primaryColumnsWidth);function a(g){const b={};return g.reduce((v,y,C)=>{const F=C<g.length-1?g[C+1]:null;return C===0&&(v[y.field]={left:0}),y.actualWidth!==void 0&&(v[y.field].width=y.actualWidth),F&&(v[F.field]={left:v[y.field].left+(y.actualWidth||0)}),v},b),b}function l(g,b,v){const y=r*(v+1),F=b[g.field].left-y+(b[g.field].width||0),w=g.parent.height?`${g.parent.height}px`:"";return{left:`${y}px`,width:`${F}px`,height:`${w}`}}function c(g,b,v){return{right:"0px",height:`${g.parent.height?`${g.parent.height}px`:""}`}}function u(g,b){const v=g.parent.height?`${g.parent.height}px`:"";return{left:`${b[g.field].left}px`,height:`${v}`,width:isNaN(Number(b[g.field].width))?"100%":`${b[g.field].width}px`}}function d(g,b,v){const C=(b.spanned||[]).reduce((w,S)=>w+(S.parent.height||0),0)+(g.height||0);return{top:`${g.top}px`,left:`${v[b.field].left}px`,width:`${v[b.field].width}px`,height:`${C}px`,padding:`calc(${C/2}px - 1rem) 0`}}function f(g,b){return`${n}_${g.type}_r_${g.index}_c_${b}_${g.refreshKey||""}`}function s(g){return`${n}_${g.type}_r_${g.index}_${g.refreshKey||""}`}function p(g){const b=g.height?`${g.height}px`:"";return{top:`${g.top}px`,width:isNaN(i.value)?"100%":`${i.value}px`,height:`${b}`}}return o.watch(t,()=>{i.value=t.value.primaryColumnsWidth}),{calculateCellPositionInRow:a,cellKey:f,cellPosition:u,groupCellPosition:l,rowKey:s,rowPosition:p,rowSpanCellPosition:d,summaryCellPosition:c}}function Ua(e,t,n){const{hasChildrenField:r}=n,i=o.ref("#9399a0"),a=o.ref(28);function l(){return[].concat(...t.value.filter(p=>p.raw.__fv_descendant_index__.length!==0).map(p=>[...p.raw.__fv_descendant_index__.slice(-1)]).flat()).sort((p,m)=>Number(p)-Number(m))}function c(f){const s=new Array(t.value.length).fill(0);if(e.showLines){const p=l();t.value.forEach((m,g)=>{const b=p.includes(g),v=m.raw[r.value];s[g]=`repeating-linear-gradient(90deg, ${i.value} 0 1px, transparent 0px 2px) ${v?"-10px":"0px"} ${a.value/2}px/20px 1px no-repeat,repeating-linear-gradient(${i.value} 0 1px, transparent 0px 2px) 0px 0px/1px ${b?"50%":"100%"} no-repeat`}),s[0]=""}return s[f]}function u(f,s,p){return p[f].parents.set(f,!0).forEach(g=>{p[g].childsLength=p[g].childWithLines.filter(b=>s[b].visible).length}),s}function d(f){const m=f.raw.__fv_parent_index__===void 0||f.raw.__fv_parent_index__===-1?0:8,g=0,b=f.raw[r.value],v=f.visible?{left:`${f.layer*10+f.layer*m+g}px`,background:c(f.index),display:"flex",width:"100%",position:"relative",paddingLeft:"0.75rem"}:{display:"none"};return b||(v.paddingLeft="2rem"),v}return{hierarchyCellContentStyle:d,handleCollapsedPaddingBottom:u}}function za(e,t,n){const r=o.ref(e.iconField);function i(a,l){if(r.value)return a.raw[e.iconField];let c="";return a.raw[n.value]!==!0?c=t.value.leafnodes:c=a.collapse?t.value.fold:t.value.unfold,c}return{treeNodeIconsClass:i}}function Ga(e,t,n,r,i,a,l,c){const{dataView:u,fold:d,hasRealChildren:f,unFold:s,reOrderVisibleIndex:p}=r,{collapseField:m,hasChildrenField:g}=i,{reCalculateVisualDataRows:b,updateVirticalScroll:v}=a;function y(w,S){var x,k;const N=S[w],h=N.__fv_parents__?(x=N.__fv_parents__)==null?void 0:x.size:0;let _=w+1;for(;_<S.length;){const T=S[_];if((T.__fv_parents__?(k=T.__fv_parents__)==null?void 0:k.size:0)>h)_++;else break}return _-1}function C(w,S){const N=u.value[w];N[m.value]=!N[m.value],N[g.value]=f(N);const h=N[m.value];let _=!1,x=w;for(;x<u.value.length;){const k=u.value[x];if((typeof k.__fv_parent_index__=="number"?Number(k.__fv_parent_index__):-1)>S)k.__fv_visible__=!h,k[m.value]&&(x=y(x,u.value)),_=!0;else if(_){x++;break}x++}p()}function F(w){if(w.raw[g.value]){const N=typeof w.raw.__fv_parent_index__=="number"?Number(w.raw.__fv_parent_index__):-1,h=Number(w.raw.__fv_index__);C(h,N),b(),v()}t.emit("expandNode",{row:w})}return{toggleTreeNode:F}}function Xa(e,t,n,r,i,a,l,c,u,d,f,s,p){const{onClickCell:m}=a,{gridRowClass:g,onClickRow:b,onMouseoverRow:v,onMouseoutRow:y}=c,{enableMultiSelect:C,select:F,unSelect:w,selectItem:S}=u;o.ref(e.cellHeight);const N=o.ref(e.treeNodeIconsData||{}),{hasChildrenField:h,shouldShowCheckBox:_,shouldShowIcon:x}=l,{toggleTreeNode:k}=Ga(e,t,r,i,l,f),{toggleSelectHierarchyItem:T}=d,{cellKey:V,cellPosition:I,rowKey:E,rowPosition:M}=Ha(e,n),{hierarchyCellContentStyle:B}=Ua(e,r,l),{treeNodeIconsClass:O}=za(e,N,h);function R(A,Y){const we=A.raw[h.value];return{"fv-tree-node-toggle":we&&A.collapse,"fv-tree-node-toggle-minus":we&&!A.collapse}}function q(A,Y){A.stopPropagation(),k(Y)}function L(A,Y){return o.createVNode("div",{class:R(A),onClick:we=>q(we,A)},null)}function X(A,Y){return x.value&&o.createVNode("div",{id:"treeNodeIcons",class:O(A,Y)},null)}function te(A){C.value?(A.checked?F(A):w(A),T(A)):S(A)}function ie(A,Y){return _.value&&o.createVNode(Et.FCheckbox,{id:"checkbox_for_"+V(A,Y.index),indeterminate:A.indeterminate,disabled:A.disabled,checked:A.checked,"onUpdate:checked":we=>A.checked=we,onChange:()=>te(A)},null)}function ue(A,Y){return o.createVNode("span",{title:Y.data},[Y.mode===Qe.editing?Y.getEditor(Y):Y.formatter?Y.formatter(Y,A):Y.data!=null?Y.data.toString():Y.data])}function D(A,Y,we){return o.createVNode("div",{ref:Y.setRef,key:V(A,Y.index),class:"fv-grid-hierarchy-cell",style:I(Y,we)},[o.createVNode("div",{style:B(A)},[L(A),X(A,Y),ie(A,Y),ue(A,Y)])])}function ne(A,Y,we){return o.createVNode("div",{ref:Y.setRef,key:V(A,Y.index),class:"fv-grid-cell",style:I(Y,we),onClick:Ce=>m(Ce,Y,A,Y.column)},[t.slots.cellTemplate?t.slots.cellTemplate({cell:Y,row:A}):Y.mode===Qe.editing?Y.getEditor(Y):Y.formatter?Y.formatter(Y,A):Y.data!=null?Y.data.toString():Y.data])}function pe(A,Y){return Y==="left"&&n.value.leftColumns.length>0&&n.value.leftColumns[0].field===A.field||Y==="primary"&&n.value.primaryColumns.length>0&&n.value.primaryColumns[0].field===A.field}function oe(A,Y,we="primary"){return o.createVNode("div",{ref:A.setRef,key:E(A),class:g(A),style:M(A),onMouseover:Ce=>v(Ce,A),onMouseout:Ce=>y(Ce,A),onClick:Ce=>b(Ce,A)},[Object.values(A.data).filter(Ce=>Y[Ce.field]&&Ce.rowSpan===1).map(Ce=>pe(Ce,we)?D(A,Ce,Y):ne(A,Ce,Y))])}return{renderDataRow:oe}}function Ya(e,t,n){const{horizontalScrollThumbStyle:r,onMouseDownScrollThumb:i,shouldShowHorizontalScrollbar:a}=n;function l(){return a.value&&o.createVNode("div",{class:"fv-grid-horizontal-scroll"},[o.createVNode("div",{class:"fv-grid-horizontal-scroll-thumb",style:r.value,onMousedown:c=>i(c,t,"horizontal")},null)])}return{renderHorizontalScrollbar:l}}function Ja(){function e(r,i){switch(r.command){case"edit":case"remove":return i.status===it.initial;case"accept":case"cancel":return i.status===it.editing;default:return!r.hidden}}function t(r,i,a){switch(r.onClick(i,a.dataIndex,a),r.command){case"edit":a.status,it.editing;break;case"accept":case"cancel":a.status,it.initial;break}}function n(r,i){return o.createVNode("div",null,[r.commands&&r.commands.map(a=>e(a,i)&&o.createVNode(o.resolveComponent("f-button"),{class:"ml-2",type:a.type,size:a.size||"small",onClick:l=>t(a,l,i)},{default:()=>[o.createTextVNode(" "),a.text,o.createTextVNode(" ")]}))])}return{renderCommandColumn:n}}function Qa(e){const t=o.ref(e.minHeight),n=o.ref(e.minWidth),r=o.ref(e.height),i=o.ref(e.width),a=o.computed(()=>r.value<=0?0:Math.max(r.value,t.value)),l=o.computed(()=>i.value<=0?0:Math.max(i.value,n.value));return o.watch([()=>e.height,()=>e.width,()=>e.minHeight,()=>e.minWidth],([u,d,f,s])=>{t.value=Number(f),n.value=Number(s),r.value=Number(u),i.value=Number(d)}),{containerStyleObject:o.computed(()=>({height:a.value>0?`${a.value}px`:e.fit?"100%":"",width:l.value>0?`${l.value}px`:e.fit?"100%":"",flex:"1 1 0"}))}}const Ka="";function Za(e){const n={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]},r=o.ref(n);function i(){r.value={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]}}const a=o.ref(e.summary),l=o.computed(()=>{const F=a.value;return(F==null?void 0:F.groupFields)||[]});function c(){r.value.rightColumns.forEach(S=>{S.showSetting=!1}),r.value.primaryColumns.forEach(S=>{S.showSetting=!1});const F=r.value.rightColumns.filter(S=>S.visible),w=r.value.primaryColumns.filter(S=>S.visible);F.length>0?F[F.length-1].showSetting=!0:w.length>0&&(w[w.length-1].showSetting=!0)}function u(F){i();const w=new Map;return l.value&&l.value.reduce((S,N)=>(S.set(N,!0),S),w),F.reduce((S,N)=>(N.visible=N.visible!==!1,N.filter=N.filter||Ka,N.fixed==="left"?(r.value.leftColumns.push(N),r.value.leftColumnsMap.set(N.field,N),r.value.leftColumnsWidth+=N.actualWidth):N.fixed==="right"?(r.value.rightColumns.push(N),r.value.rightColumnsMap.set(N.field,N),r.value.rightColumnsWidth+=N.actualWidth):(r.value.primaryColumns.push(N),r.value.primaryColumnsMap.set(N.field,N),r.value.primaryColumnsWidth+=N.actualWidth),w.has(N.field)&&r.value.summaryColumns.push(N),S),r),c(),r}u(e.columns);const d=o.computed(()=>r.value.leftColumns.length>0),f=o.computed(()=>r.value.rightColumns.length>0);function s(F,w){return w.sortable&&w.sort&&w.sort!=="none"&&F.push(w),F}function p(F,w){return F.sortOrder=F.sortOrder||0,w.sortOrder=w.sortOrder||0,F.sortOrder===w.sortOrder?0:F.sortOrder<w.sortOrder?-1:1}function m(F,w){return F.sortOrder=F.sortOrder||0,w.sortOrder=w.sortOrder||0,F.sortOrder===w.sortOrder?0:F.sortOrder<w.sortOrder?1:-1}function g(F,w){return w.filterable&&F.push(w),F}function b(){const F=[];return r.value.leftColumns.reduce(g,F),r.value.primaryColumns.reduce(g,F),r.value.rightColumns.reduce(g,F),F}function v(){const F=[];r.value.leftColumns.reduce(s,F),r.value.primaryColumns.reduce(s,F),r.value.rightColumns.reduce(s,F);const w=Math.max(...F.map(S=>S.sortOrder||0));return F.sort(m).map(S=>{const N=S.sortOrder||w+1;return S.sortOrder=N,S}).sort(p).map((S,N)=>{const h=N+1;return S.sortOrder=h,S})}function y(F,w,S){const N=F.map(h=>{const _=S.getSorterByColumn(h),x=h.sort==="asc",k=h.sort==="desc",T=x?_.ascend:k?_.decend:void 0;return{field:h.field,compare:T}});w.setSorters(N)}function C(F,w){const S=v();y(S,F,w)}return{applyColumnSorter:C,collectionFilterableColumns:b,applySortableColumns:y,collectionSortableColumns:v,columnContext:r,hasLeftFixedColumn:d,hasRightFixedColumn:f,updateColumnRenderContext:u,updateColumnSettingIcon:c}}o.ref([{name:"七天",selectable:!0},{name:"一个月",selectable:!0},{name:"三个月",selectable:!0},{name:"半年",selectable:!0}]);function el(e){const n=o.ref(e.commandOption.enable||!1),r=o.ref(e.commandOption.commands||[]);function i(a){if(n.value&&!(a.value.findIndex(c=>c.dataType==="commands")>-1)){const c={field:"__commands__",title:"操作",width:120,fixed:"right",dataType:"commands",commands:r.value,visible:!0};a.value.push(c)}}return{applyCommands:i}}function tl(e,t){var d;const n=o.ref((d=e.columnOption)==null?void 0:d.groups);function r(f,s,p,m,g){const b={actualWidth:0,children:[],depth:1,field:f.field,layer:1,left:0,parent:p,resizable:!0,title:f.title||"",status:$e.none,popoverRef:o.ref(),showPopover:!1,column:null,sortType:"none"},v=m||b;if(f.group){let y=1;f.group.reduce((C,F)=>{if(typeof F=="string"){const w=s.get(F);w&&(g.fieldToRootMap.set(F,v),C.actualWidth+=w.actualWidth,C.children.push(w))}else{const w=r(F,s,C,v,g);y=Math.max(y,w.depth),C.actualWidth+=w.actualWidth,C.children.push(w)}return C},b),b.depth+=y}return t.value.headerDepth=Math.max(t.value.headerDepth,b.depth),b}function i(f){const s={groupedCells:new Map,fieldToRootMap:new Map};return n.value&&n.value.reduce((p,m)=>{const g=r(m,f,null,null,s);return p.groupedCells.set(m.field,g),p},s),s}function a(f){if(!f||f.length===0)return 0;const s=f[0];return s.children&&s.children.length>0&&(s.left=a(s.children)),s.left}function l(f,s){const p=t.value.headerDepth;f.forEach(m=>{m.layer=s?s.layer+1:1;const g=m.children&&m.children.length===0;m.depth=g?p-(m.layer-1):1,m.left=g?m.left:a(m.children),m.children&&l(m.children,m)})}function c(f,s){const p=new Map;return f.forEach(m=>{const g=s.fieldToRootMap.get(m.field),b=g!=null;b&&!p.has(g.field)&&p.set(g.field,g),b||p.set(m.field,m)}),l(Array.from(p.values())),p}function u(f){let s=new Map,p=0;if(f.reduce((m,g)=>{let b=$e.none;b=g.filterable?b|$e.filterable:b,b=g.sort&&g.sort!=="none"?b|$e.sorted|(g.sort==="asc"?$e.ascending:$e.descending):b;const v=g.field;return m.set(v,{actualWidth:g.actualWidth||0,children:[],depth:1,layer:1,left:p,field:v,parent:null,resizable:g.resizable===void 0?!0:g.resizable,title:g.title,status:b,popoverRef:o.ref(),showPopover:!1,column:g,filterValue:null,sortType:g.sort||"none",showSetting:g.showSetting}),p+=g.actualWidth||0,m},s),n.value){const m=i(s);s=c(s,m)}return s}return{getGridHeaderCells:u}}function nl(e,t){var y;const{idField:n}=t,r=o.ref(e.summary),i=o.ref(e.group),a=o.ref(((y=e.group)==null?void 0:y.groupFields)||[]),l=o.computed(()=>{var C;return(C=e.group)==null?void 0:C.enable}),c=o.computed(()=>{var C;return(C=e.group)==null?void 0:C.showGroupPanel}),u=o.computed(()=>{const C=r.value;return(C==null?void 0:C.groupFields)||[]}),d=o.computed(()=>{const C=i.value;return C&&C.showSummary}),f=new Map;let s=[];function p(C,F,w,S,N){const h=S[w];h&&(F.reduce((_,x,k)=>{var I;const T=x[h];let V=_.get(T);if(!V){const E=u.value.reduce((M,B)=>(M.set(B,0),M),new Map);V={field:h,title:((I=N.get(h))==null?void 0:I.title)||h,value:T,layer:w,details:[],groupSummaries:E},_.set(T,V)}return u.value&&u.value.forEach(E=>{if(V){const M=V.groupSummaries.get(E)||0;V.groupSummaries.set(E,M+x[E])}}),V.details.push(x),_},C),w<S.length-1&&C.forEach((_,x)=>{_.nestGroup=new Map,p(_.nestGroup,_.details,w+1,S,N),_.details=[]}))}function m(C,F){return e.group&&e.group.formatter?e.group.formatter(C.value,{...C,total:F}):`${C.title}:${C.value} (${F})`}function g(C){const F=[];return C.forEach(w=>{const S={__fv_data_grid_group_collapse__:!1,__fv_data_grid_group_field__:w.field,__fv_data_grid_group_layer__:w.layer,__fv_data_grid_group_row__:!0,__fv_data_grid_group_value__:w.value};let N=0;if(F.push(S),w.nestGroup){const h=g(w.nestGroup);F.push(...h),N+=h.length}if(w.details&&w.details.length&&(F.push(...w.details),N+=w.details.length),d.value){const h={__fv_data_grid_group_field__:w.field,__fv_data_grid_group_layer__:w.layer,__fv_data_grid_group_summary__:!0};h[n.value]=`summary_of_${w.field}_${w.value}`,h[w.field]=Array.from(w.groupSummaries.entries()).reduce((_,[x,k])=>`${_} ${x} total:${k} `,""),F.push(h)}w.groupSummaries&&w.groupSummaries.size&&w.groupSummaries.forEach((h,_)=>{S[_]=h}),S[n.value]=`group_of_${w.field}_${w.value}`,S[w.field]=m(w,N)}),F.forEach((w,S)=>{w.__fv_data_index__=S}),F}function b(C,F,w){return!C||C.length===0||!F.length?F:(C.join(","),f.clear(),s=[],F=F.filter(S=>!S.__fv_data_grid_group_row__),p(f,F,0,C,w),s=g(f),s)}function v(C){return{"f-icon":!0,"f-icon-arrow-chevron-down":!0,"fv-grid-group-row-icon-collapse":C.collapse}}return{collpaseGroupIconClass:v,generateGroupData:b,groupFields:a,shouldGroupingData:l,showGroupPanel:c}}function ol(e,t,n,r){const i=o.ref(!!e.hierarchy),{idField:a}=r,{collapseField:l,hasChildrenField:c,parentIdField:u}=n,d=new Map;function f(V,I){const E=new Map;return V.reduce((M,B)=>{const O=B[u.value]!==void 0?B[u.value]:"";if(O&&I.has(O)){const q=I.get(O);B.__fv_parent_index__=q.__fv_index__,q.__fv_hasChildren__=!0}const R=M.has(O)?M.get(O):[];return R.push(B),M.set(O,R),M},E),E}function s(V){const I=new Map;return V.reduce((E,M)=>{const B=M[a.value];return E.set(B,M),E},I),I}function p(V){V.forEach(I=>{const E=I[a.value];I.__fv_children_index__.map(B=>V[B]).forEach(B=>{B.__fv_parents__=new Map([...I.__fv_parents__.entries(),[E,!0]])})})}function m(V){V.forEach(I=>{const E=new Set(I.__fv_children_index__);I.__fv_children_index__=[...E].sort((M,B)=>M-B)})}function g(V,I){V.forEach(E=>{const M=E.__fv_parents__;Array.from(M.keys()).map(B=>I.get(B)).forEach(B=>{B.__fv_children_index__.push(E.__fv_index__)})}),m(V)}function b(V){V.forEach(I=>{I.__fv_child_with_lines__=[],I.__fv_child_length__=I.__fv_descendant_index__.length,I.__fv_descendant_index__.map(E=>V[E]).reduce((E,M)=>(E.__fv_child_length__+=M.__fv_children_index__.length,E.__fv_child_with_lines__.push(...M.__fv_children_index__,M.__fv_index__),E),I)})}function v(V,I){return{id:V,index:I,parentId:"",parentIndex:-1,parents:new Map,children:new Map,descendant:new Map}}function y(V,I){Array.from(I.keys()).forEach(E=>{I.get(E).reduce((B,O)=>{const R=O[a.value],q=V.get(O[a.value]),L=V.get(E);return L&&(L.children.set(R,q),L.children.set(R,q),q.parentId=E,q.parentIndex=L.index,q.parents.set(E,L)),B},V)})}function C(V){V.children.forEach(E=>{E.parents=new Map([...V.parents.entries(),[V.id,V]]),C(E)})}function F(V,I){V.filter(E=>E[u.value]===void 0||E[u.value]==="").forEach(E=>{const M=E[a.value],B=I.get(M);C(B)})}function w(V){Array.from(V.values()).forEach(I=>{Array.from(I.parents.values()).forEach(E=>{E.descendant.set(I.id,I)})})}function S(V){d.clear(),V.forEach((M,B)=>{const O=M[a.value];d.set(O,v(O,B))});const I=s(V),E=f(V,I);return y(d,E),F(V,d),w(d),d}function N(V){const I=V[a.value],E=d.get(I);return E&&E.children.size>0}function h(V){return V[c.value]&&!N(V)}function _(V){S(t.value);const I=s(V),E=f(V,I);return V.forEach((M,B)=>{var L;const O=M[a.value],R=E.has(O)?(L=E.get(O))==null?void 0:L.map(X=>X.__fv_index__):[],q=v(O,B);M.__fv_graph_node__=q,M.__fv_children_index__=R,M.__fv_descendant_index__=[...R],M.__fv_parents__=new Map,h(M)&&(M[l.value]=!0)}),p(V),g(V,I),e.showLines&&b(V),V}function x(V,I,E){const B=E.value[V][a.value],O=d.get(B);if(O){const R=d.get(O.parentId);let q=E.value.length-1;if(R){const L=Array.from(R.children.keys()).indexOf(O.id);if(L===R.children.size-1){const te=Array.from(R.descendant.values())[R.descendant.size-1];q=E.value.findIndex(ue=>ue[a.value]===te.id)+1}else{const te=Array.from(R.children.values())[L+1];q=E.value.findIndex(ue=>ue[a.value]===te.id)}I[c.value]=!1,I[u.value]=R.id,E.value.splice(q,0,I)}}}function k(V,I,E){const M=E.value[V],B=M[a.value];if(d.get(B)){const q=E.value.findIndex(L=>L[a.value]===B)+1;M[c.value]=!0,M[l.value]=!1,I[c.value]=!1,I[u.value]=B,E.value.splice(q,0,I)}}function T(V,I){const E=V[a.value],M=d.get(E),B=Array.from(M.descendant.keys());B.unshift(E);const O=d.get(M.parentId);if(O&&(O.children.delete(E),O.children.size===0)){const q=I.find(L=>L[a.value]===M.parentId);q[c.value]=!1,q[l.value]=!1}return I.filter(q=>B.indexOf(q.id)===-1)}return{generateHierarchyData:_,hasRealChildren:N,insertSibling:x,insertChild:k,shouldStratifyData:i,trimmedOriginalData:T}}function rl(e,t,n,r,i){var pt;const a=new Map,l=new Map,c=new Map,u=new Map,d=new Map,f=o.ref([]),s=o.ref([]),p=nl(e,i),{generateGroupData:m,groupFields:g,shouldGroupingData:b}=p,v=o.ref(e.data),y=ol(e,v,r,i),{generateHierarchyData:C,hasRealChildren:F,insertSibling:w,insertChild:S,shouldStratifyData:N,trimmedOriginalData:h}=y,{idField:_,reviseIdentifyField:x}=i,k=o.ref(e.newDataItem),T=o.ref(e.data||[]),V=o.ref(e.data),{flatTreeData:I}=Bl(e);function E(P){return I(P)}if(e.data&&((pt=e.data[0])!=null&&pt.children)){const P=E(e.data);v.value=P,T.value=P,V.value=P}const M=o.ref(e.summary),B=o.computed(()=>{const P=M.value;return(P==null?void 0:P.groupFields)||[]});let O=new Map;const R=o.ref(T.value.length),q=o.ref(e.pagination);function L(){return q.value&&q.value.enable&&q.value.size>0?q.value.size:T.value.length}const X=o.ref(1),te=o.computed(()=>q.value&&q.value.enable&&q.value.mode==="client"),ie=new Vo;function ue(){var Oe;T.value=v.value,te.value&&(R.value=T.value.length),b.value&&(T.value=m(g.value,v.value,t)),O=B.value.reduce((Ve,ke)=>(Ve.set(ke,0),Ve),O);const P=0,H=L(),K=(X.value-1)*H,xe=K>T.value.length-1?P:K,Re=Math.min(xe+H,T.value.length);let Ee=0;const Fe=[];if(T.value.length){x(T.value);const Ve=_.value!==e.idField;for(let ke=xe;ke<Re;ke++){const Ie=T.value[ke];Ie.__fv_data_grid_group_row__?(Ee=0,Ie.__fv_data_index__=""):Ie.__fv_data_grid_group_summary__?Ie.__fv_data_index__="":(Ee++,Ie.__fv_data_index__=Ee+(X.value-1)*H),Ie.__fv_index__=ke,Ie.__fv_visible_index__=ke,e.rowOption&&e.rowOption.disabledField&&(Ie.__fv_disabled__=Ie[(Oe=e.rowOption)==null?void 0:Oe.disabledField]),Ve&&(Ie[_.value]=ke),B.value.forEach(Ye=>{const kt=O.get(Ye)||0;O.set(Ye,kt+Ie[Ye])}),Fe.push(Ie)}}return N.value&&C(Fe),V.value=[...Fe],Fe}const D=o.ref(ue()),ne=o.computed(()=>D.value.filter(P=>P.__fv_visible__!==!1));function pe(){ne.value.forEach((P,H)=>(P.__fv_visible_index__=H,P))}function oe(P,H,K=!1){const xe=(K?ue():[...V.value]).filter(Fe=>n.apply(Fe)),Re=P&&P.length?xe.filter(Fe=>P.reduce((Oe,Ve)=>Oe&&Ve.filter(Fe),!0)):xe,Ee=H&&H.length?Re.sort((Fe,Oe)=>{const Ve=[...H],ke=Ve.shift();let Ie=ke.compare(Fe[ke.field],Oe[ke.field]);for(;Ie===0&&Ve.length!==0;){const Ye=Ve.shift();Ye&&(Ie=Ye.compare(Fe[Ye.field],Oe[Ye.field]))}return Ie}):Re;return D.value=Ee.map((Fe,Oe)=>{if(Fe.__fv_data_grid_group_row__){const Ve=`group_of_${Fe.__fv_data_grid_group_field__}_${Fe.__fv_data_grid_group_value__}`;Fe.__fv_data_grid_group_collapse__=!!a.get(Ve)}return Fe.__fv_index__=Oe,Fe.__fv_visible_index__=Oe,Fe}),D.value}function A(P){return d.clear(),s.value=P,s.value.reduce((H,K)=>(H.set(K.field,K),H),d),oe([],s.value)}function Y(P,H){return d.set(P,H),s.value=Array.from(d.values()),oe([],s.value)}function we(P){return d.delete(P),s.value=Array.from(d.values()),oe([],s.value)}function Ce(P,H){return l.set(P,H),f.value=Array.from(l.values()),oe([],Array.from(d.values()))}function je(P){return l.delete(P),f.value=Array.from(l.values()),oe([],Array.from(d.values()),!0)}function De(){return l.clear(),f.value=[],oe([],Array.from(d.values()),!0)}function Be(P,H){const K=`group_of_${P}_${H}`;a.set(K,!0);const ve=xe=>xe[P]!==H;return c.set(`collapse_${P}_${H}`,{field:P,fieldName:P,fieldType:"string",filterValue:H,filter:ve}),oe(Array.from(c.values()),Array.from(d.values()))}function me(P,H){const K=`group_of_${P}_${H}`;return a.set(K,!1),c.delete(`collapse_${P}_${H}`),oe(Array.from(c.values()),Array.from(d.values()),!0)}function G(P){const H=P.raw[_.value],K=ve=>!ve.__fv_parents__.has(H);u.set(`fold_${H}`,{field:"id",fieldName:"id",fieldType:"string",filterValue:String(H),filter:K}),oe(Array.from(u.values()),Array.from(d.values())),C(D.value)}function Q(P){const H=P[_.value];u.delete(`fold_${H}`)}function ee(P){Q(P.raw),oe(Array.from(u.values()),Array.from(d.values()),!0),C(D.value)}function re(){const P=ue();D.value=P,e.hierarchy&&(oe(Array.from(u.values()),Array.from(d.values())),C(D.value))}function U(P){const K=P&&P.length&&P[0].children?E(P):P;v.value=K,re()}function ge(P,H,K){return(P&&P.length?D.value.filter((xe,Re)=>P.reduce((Ee,Fe)=>Ee&&Fe.filter(xe),!0)):D.value).slice(H,K)}function Pe(P){const H=L(),K=P*H;0<K&&K<=R.value&&(X.value=P,re())}function Xe(P){v.value.push(be.cloneDeep(P)),D.value=ue()}function lt(P=0){if(!(P>-1))return!1;const K=k.value();e.hierarchy?w(P,K,v):v.value.splice(P,0,K),re()}function Ke(P=0){if(!(P>-1&&e.hierarchy))return!1;const K=k.value(),ve=v.value[P];Q(ve),S(P,K,v),re()}function Ze(P){const H=P?P-1:0;v.value.splice(H,1),re()}function et(P){const H=v.value.findIndex(K=>K[_.value]===P);H!==-1&&(v.value.splice(H,1),re())}function st(P){const H=P>-1?v.value[P]:null;if(!(H&&H.deletable!==!1))return!1;v.value=h(H,v.value),re()}function ct(){const P=c.size>0?Array.from(c.values()):[];return oe(P,Array.from(d.values()))}function ot(P){q.value&&(q.value.size=P,re())}function dt(P,H){const K=v.value[Number(P)-1];K.editable!==!1?(K.name=H,re()):ie.show({showCloseButton:!1,timeout:3e3,animate:"fadeIn",toasts:[{type:"string",title:"提示",msg:"当前节点禁止编辑"}]})}function ft(P){return P.map(K=>{const ve=V.value.findIndex(xe=>xe[_.value]===K);return ve>-1?V.value[ve]:null}).filter(K=>K!=null)}return{addFilter:Ce,addNewDataItem:Xe,addSorter:Y,changePageSizeTo:ot,collapse:Be,dataView:D,editDataItem:dt,expand:me,filters:f,fold:G,getRange:ge,getSelectionItems:ft,hasRealChildren:F,insertNewChildDataItem:Ke,insertNewDataItem:lt,load:U,navigatePageTo:Pe,pageIndex:X,rawView:V,refresh:ct,removeAllFilter:De,removeDataItem:Ze,removeDataItemById:et,removeFilter:je,removeHierarchyDataItem:st,removeSorter:we,reOrderVisibleIndex:pe,setSorters:A,sorters:s,summaries:O,totalItems:R,unFold:ee,updateDataView:re,visibleDataItems:ne}}const il=["equal","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","contain","startWidth","endWidth","in","notIn"],al={equal:(e,t,n)=>e&&e[t]===n,notEqual:(e,t,n)=>e&&e[t]!==n,contain:(e,t,n)=>e?(e[t]||"").indexOf(n)>-1:!1,startWidth:(e,t,n)=>e?(e[t]||"").startsWith(n):!1,endWidth:(e,t,n)=>e?(e[t]||"").endsWith(n):!1},ll={equal:(e,t,n)=>e&&e[t]===n,in:(e,t,n)=>{if(e){const r=e[t];return n.indexOf(r)>-1}return!1},notEqual:(e,t,n)=>e&&e[t]!==n},sl={equal:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()===r}return!1},notEqual:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()!==r}return!1},greaterThan:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()>r}return!1},greaterThanOrEqual:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()>=r}return!1},lessThan:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()<r}return!1},lessThanOrEqual:(e,t,n)=>{if(e){const r=new Date(new Date(n).toLocaleDateString()).valueOf();return new Date(new Date(e[t]).toLocaleDateString()).valueOf()<=r}return!1}},cl={equal:(e,t,n)=>e?String(n).split(",").includes(String(e[t])):!1,in:(e,t,n)=>{if(e){const r=e[t];return n.indexOf(r)>-1}return!1},notEqual:(e,t,n)=>e?String(n).split(",").findIndex(i=>i===String(e[t]))===-1:!1},ul={equal:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):r===i}return!1},notEqual:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?!0:r!==i}return!1},greaterThan:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):i>r}return!1},greaterThanOrEqual:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):i>=r}return!1},lessThan:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):i<r}return!1},lessThanOrEqual:(e,t,n)=>{if(e){const r=Number.parseFloat(String(n)),i=Number.parseFloat(String(e[t]));return isNaN(r)?isNaN(i):i<=r}return!1}},dl=new Map([["boolean",ll],["datetime",sl],["enum",cl],["number",ul],["text",al]]);function fl(){const e=o.ref([]),t=new Map,{loadConditionGroup:n}=Jo();function r(v,y){switch(v){case"check-box":return new uo({value:y});case"combo-list":return new ho({value:y});case"combo-lookup":return new fo({value:y});case"input-group":return new qt({value:y});case"date-picker":return new po({value:y});case"date-range":return new Lt({value:y});case"datetime-picker":return new mo({value:y});case"datetime-range":return new Lt({value:y});case"lookup":return new go({value:y});case"month-picker":return new yo({value:y});case"month-range":return new vo({value:y});case"number-range":return new bo({value:y});case"number-spinner":return new Co({value:y});case"radio-group":return new wo({value:y});default:return new qt({value:y})}}const i=new Map([["boolean","check-box"],["date","date-picker"],["datetime","datetime-picker"],["number","number-spinner"],["string","text"],["text","text"],["enum","combo-list"],["reference","lookup"]]),a=new Map([["boolean",Je.In],["date",Je.Equal],["datetime",Je.Equal],["number",Je.Equal],["string",Je.Equal],["text",Je.Equal],["enum",Je.In],["reference",Je.Equal]]);function l(v){var C;const y=v.dataType||"string";return((C=v.editor)==null?void 0:C.type)||i.get(y)||"text"}function c(v){var k,T,V,I,E;const y=`field_filter_${v.field}`,C=Date.now(),F=v.field,w=((k=v.column)==null?void 0:k.title)||"",S=((T=v.column)==null?void 0:T.dataType)||"string",N=a.get(S)||Je.Equal,h=((I=(V=v.column)==null?void 0:V.editor)==null?void 0:I.type)||i.get(S)||"text",_=r(h,(E=v.column)==null?void 0:E.filter),x=h==="lookup"||h==="combo-lookup"?Tt.SmartHelp:h==="combo-list"?Tt.Enum:Tt.Value;t.set(y,{id:y,fieldCode:F,fieldName:w,compareType:N,valueType:x,value:_,conditionId:C}),e.value=Array.from(t.values())}function u(v){const y=`field_filter_${v.field}`;t.delete(y),e.value=Array.from(t.values())}function d(v){t.delete(v),e.value=Array.from(t.values())}function f(){t.clear(),e.value=[]}function s(v){const{valueType:y}=v.value,C=v.compareType||"0",F=il[Number(C)];return dl.get(y)[F]}function p(v){const y=v.relation===2?0:1,C=v.items.map(w=>{const S=s(w);return h=>S(h,w.fieldCode,w.value.getValue())}),F=v.children&&v.children.length?v.children.map(w=>p(w)):[];return{relation:y,filterFunctions:C,children:F}}function m(){const v=n(e.value);return p(v)}function g(v,y){const C=y.filterFunctions.map(w=>w(v)),F=y.children.map(w=>g(v,w));return y.relation===1?C.every(w=>w)&&F.every(w=>w):C.includes(!0)||F.includes(!0)}function b(v){const y=m();return g(v,y)}return{addColumnFilter:c,apply:b,clearCondition:f,conditions:e,getFilterEditorType:l,removeColumnFilter:u,removeCondition:d}}function pl(e){o.ref(e.selection.showCheckbox||!1);const t=o.computed(()=>{var l;return((l=e.hierarchy)==null?void 0:l.collapseField)||"__fv_collapse__"}),n=o.computed(()=>{var l;return((l=e.hierarchy)==null?void 0:l.hasChildrenField)||"__fv_hasChildren__"}),r=o.computed(()=>{var l;return((l=e.hierarchy)==null?void 0:l.parentIdField)||"parent"}),i=o.computed(()=>e.hierarchy&&e.selection.showCheckbox),a=o.computed(()=>(e.treeNodeIconsData.fold||e.iconField)&&e.showTreeNodeIcons);return{collapseField:t,hasChildrenField:n,parentIdField:r,shouldShowCheckBox:i,shouldShowIcon:a}}function ml(e,t,n,r,i,a,l,c){var pt;const{dataView:u,visibleDataItems:d}=t,{getVisualData:f,maxVisibleRowIndex:s,minVisibleRowIndex:p}=i,m=o.computed(()=>r.value.primaryColumnsWidth),g=o.computed(()=>r.value.leftColumnsWidth),b=o.computed(()=>r.value.rightColumnsWidth),v=((pt=e.rowOption)==null?void 0:pt.height)||28,y=o.ref(0),C=o.ref(0);let F=0,w=a.value-1;const S=o.ref(0),N=o.ref(0),h=o.ref(0),_=o.ref(e.virtualized),x=24,k=1.5;let T;function V(){const P=d.value;if(P.length<=0)return 0;const H=s.value<P.length?P[s.value]:P[P.length-1];return H.__fv_data_position__>P.length*v?P.length*v:(H.__fv_data_position__||0)+(H.__fv_data_height__||0)+Math.max(P.length-1-s.value,0)*v}const I=o.computed(()=>{const P=V(),H=d.value;let K=H.length>a.value+l?(a.value+l)/H.length:N.value/Math.max(P,N.value),ve=Math.floor(K*N.value);for(;N.value>0&&ve<x;)K*=k,ve=Math.floor(K*N.value);return ve}),E=o.computed(()=>Math.floor(h.value/Math.max(m.value,h.value)*S.value)),M=0,B=0,O=o.computed(()=>S.value-(g.value+m.value+b.value+c.value));function R(P){const K=Math.floor(P/v)+1,ve=d.value;return ve.length>K?ve[K].__fv_visible_index__-1:0}function q(P,H,K){let ve=P,xe=H;const Re=H-P+1;if(Re<l+a.value+l){const Ee=l+a.value+l-Re,Fe=H+Ee<=K,Oe=0+Ee<=P;if(Fe)xe+=Ee,w=xe;else if(Oe)ve-=Ee,F=ve;else{const Ve=K-H,ke=Ee-Ve;xe=Math.min(H+Ve,K),ve=Math.max(P-ke,0)}}return{actualStart:ve,actualEnd:xe}}function L(P){var Ve,ke;const H=d.value;if(!H.length){n.value=[];return}const K=(Ve=e.pagination)!=null&&Ve.enable?0:Math.max(F-l,0),ve=H[H.length-1].__fv_visible_index__,xe=(ke=e.pagination)!=null&&ke.enable?H.length-1:Math.min(w+l,ve),{actualStart:Re,actualEnd:Ee}=q(K,xe,ve),Fe=H[Re-1],Oe=f(Re,Ee,Fe,P);Oe.length&&(n.value=[...Oe])}const X=o.computed(()=>V()>N.value),te=o.computed(()=>Math.floor(m.value)>h.value);function ie(P,H){let K=P;const ve=K>M,xe=X.value;xe&&K<N.value-H&&(K=N.value-H),(!xe||ve)&&(K=M),y.value!==K&&(y.value=K)}function ue(){_.value&&(F=R(Math.abs(y.value)),w=F+a.value-1,(F<p.value||w>s.value-l/2)&&L())}function D(P){let H=y.value+P;H>M&&(H=M);const K=V();ie(H,K),ue()}function ne(P){if(!te.value){C.value=0;return}let H=C.value+P;H>B&&(H=B),H<O.value&&(H=O.value),C.value!==H&&(C.value=H)}function pe(){Math.abs(C.value)+h.value>m.value&&(C.value=Math.min(h.value-m.value,0))}function oe(){y.value=0,F=0,w=a.value-1,L()}function A(){const P=V();ie(y.value,P)}o.watch([h,m],()=>{ne(0)});function Y(P){let{deltaX:H}=P.deltaX,K=-1*P.deltaY;return typeof H>"u"&&(H=-1*P.wheelDeltaX/6),typeof K>"u"&&(K=P.wheelDeltaY/6),P.deltaMode&&P.deltaMode===1&&(H*=10,K*=10),P.shiftKey?{deltaY:-K,deltaX:-H}:{deltaX:H,deltaY:K}}function we(P){if(e.disabled||!X.value)return;P.preventDefault(),P.stopPropagation();const{deltaX:H,deltaY:K}=Y(P);D(K),ne(H)}const Ce=o.computed(()=>({height:`${u.value.length*v}px`,width:`${g.value}px`,transform:`translateY(${y.value}px)`})),je=o.computed(()=>({transform:`translateY(${y.value}px)`})),De=o.computed(()=>({height:`${u.value.length*v}px`,width:`${m.value}px`,transform:`translate(${C.value}px, ${y.value}px)`})),Be=o.computed(()=>({transform:`translate(${C.value}px, ${y.value}px)`})),me=o.computed(()=>({height:`${u.value.length*v}px`,width:`${b.value}px`,transform:`translateY(${y.value}px)`})),G=o.computed(()=>({transform:`translateY(${y.value}px)`})),Q=o.computed(()=>({height:`${u.value.length*v}px`,width:`${c.value}px`,transform:`translateY(${y.value}px)`})),ee=o.computed(()=>({width:`${g.value}px`})),re=o.computed(()=>({transform:`translateX(${C.value}px)`})),U=o.computed(()=>({width:`${b.value}px`})),ge=o.computed(()=>{const P=V();return ie(y.value,P),y.value/(N.value-P)*(N.value-I.value)}),Pe=o.computed(()=>({height:`${I.value}px`,top:`${ge.value}px`})),Xe=o.computed(()=>C.value/O.value*(S.value-E.value)),lt=o.computed(()=>({width:`${E.value}px`,left:`${Xe.value}px`})),Ke=o.ref(!1),Ze=o.ref(-1),et=o.ref(-1),st=o.ref();function ct(P){if(Ke.value&&et.value!==-1){const H=et.value-P.pageX,K=S.value-E.value;if(Math.abs(H)<=K){const ve=H/(h.value-E.value)*(m.value-h.value);ne(ve),et.value=P.pageX}}}function ot(P){if(Ke.value&&Ze.value!==-1){const H=Ze.value-P.pageY,K=V(),ve=K-I.value;if(Math.abs(H)<=ve){const xe=H/(N.value-I.value)*(K-N.value);D(xe),Ze.value=P.pageY}}}function dt(P){Ke.value=!1,Ze.value=-1,et.value=-1,document.removeEventListener("mouseup",dt),document.removeEventListener("mousemove",ct),T&&document.removeEventListener("mousemove",T),document.body.style.userSelect="",st.value&&(st.value.style.opacity=null)}function ft(P,H,K){var Re;Ke.value=!0;const ve=(Re=P.target)==null?void 0:Re.parentElement;ve&&(ve.style.opacity="1",st.value=ve);const xe=K==="horizontal"?ct:ot;K==="vertical"&&(Ze.value=P.pageY),K==="horizontal"&&(et.value=P.pageX),H.value&&(T||(T=be.throttle(xe,100)),H.value,document.addEventListener("mousemove",T),document.addEventListener("mouseup",dt),document.body.style.userSelect="none")}return{dataGridWidth:S,fitHorizontalScroll:pe,gridDataStyle:De,gridHeaderColumnsStyle:re,gridMergedDataStyle:Be,gridSideStyle:Q,horizontalScrollThumbStyle:lt,leftFixedGridDataStyle:Ce,leftFixedGridHeaderColumnsStyle:ee,leftFixedGridMergedDataStyle:je,offsetX:C,offsetY:y,onMouseDownScrollThumb:ft,onWheel:we,reCalculateVisualDataRows:L,resetScroll:oe,rightFixedGridDataStyle:me,rightFixedGridHeaderColumnsStyle:U,rightFixedGridMergedDataStyle:G,shouldShowHorizontalScrollbar:te,shouldShowVirticalScrollbar:X,updateVirticalScroll:A,updateVisibleRowsOnLatestVisibleScope:ue,verticalScrollThumbStyle:Pe,viewPortWidth:h,viewPortHeight:N}}function hl(e,t,n,r,i,a,l,c){const u=o.ref(r.value-1+i),d=o.ref(0),{renderDataRow:f}=a,s=f,p=f;function m(v){let y=f;return v.__fv_data_grid_group_row__&&(y=s),v.__fv_data_grid_group_summary__&&(y=p),y}function g(v,y,C,F){const{visibleDataItems:w}=n,S=[],N=w.value;if(N.length>0){const h=F?Date.now().toString():"";for(let _=v,x=0;_<=y;_++,x++){const k=N[_],T=N[_-1]||C,V=S[x-1],I=T?(T.__fv_data_position__||0)+(T.__fv_data_height__||0):0,M=m(k)(k,T,V,_,I,t.value,S);M.refreshKey=h,S.push(M)}}return d.value=S.length>0?S[0].index:0,u.value=S.length>0?S[S.length-1].index:0,S}function b(v,y,C){const F=y.groupField||"",{groupValue:w}=y;n[v](F,w);const{dataView:S}=n,N=C[0].index,h=Math.min(N+r.value+i+1,S.value.length-1);return g(N,h)}return{getVisualData:g,maxVisibleRowIndex:u,minVisibleRowIndex:d,toggleGroupRow:b}}function gl(e){var i;const t=((i=e.rowOption)==null?void 0:i.height)||28;function n(a,l){const c=a.pre;if(c){const u=c?c.__fv_data_position__!==void 0?c.__fv_data_position__:c.__fv_index__*t:0,d=c?c.__fv_data_height__!==void 0?c.__fv_data_height__:t:0,f=a.visible?u+d:c.__fv_data_position__;a.top=f,l.__fv_data_position__=f}else a.top=0,l.__fv_data_position__=0}function r(a,l,c){if(a&&!l.ref){l.ref=a;const u=l.parent;l.cellHeight!==a.offsetHeight&&(l.cellHeight=a.offsetHeight),l.cellHeight&&l.cellHeight>(u.height||0)&&(u.height=l.cellHeight,c.__fv_data_height__=u.height),n(u,c)}}return{updateRowPosition:n,updateVisualInfomation:r}}function yl(){function e(t,n){const{formatter:r}=t,i=Te.resolveField(n.raw,t.field);if(i.includes(",")){const l=i.split(","),c=r.data.reduce((d,f)=>(d[f.value]=f,d),{});return l.map(d=>c[d].name).join(",")}const a=r.data.find(l=>l.value===i);return(a==null?void 0:a.name)||""}return{renderEnumColumn:e}}function vl(){function e(r,i){return r?o.createVNode("span",{innerHTML:i.formatter.trueText},null):o.createVNode("span",{innerHTML:i.formatter.falseText},null)}function t(r,i){var a,l;return r?(a=i.formatter)==null?void 0:a.trueText:(l=i.formatter)==null?void 0:l.falseText}function n(r,i){const{formatter:a}=r,l=Te.resolveField(i.raw,r.field);if(a.type===_n.TEXT)return t(l,r);if(a.type===_n.IMAGE)return e(l,r)}return{renderBooleanColumn:n}}function bl(){const{formatTo:e}=Te.useDateFormat();function t(r,i){return e(r,i.formatter.dateFormat)}function n(r,i){const a=Te.resolveField(i.raw,r.field);return t(a,r)}return{renderDateColumn:n}}function Cl(){const{formatTo:e}=Te.useNumberFormat();function t(r,i){const{formatter:a}=i,l={precision:a.precision,prefix:a.prefix||"",suffix:a.suffix||"",decimalSeparator:a.decimal||".",groupSeparator:a.thousand||""};return e(r,l)}function n(r,i){const a=Te.resolveField(i.raw,r.field);return t(a,r)}return{renderNumberColumn:n}}function wl(){const{renderBooleanColumn:e}=vl(),{renderEnumColumn:t}=yl(),{renderNumberColumn:n}=Cl(),{renderDateColumn:r}=bl();function i(c){return c}function a(c,u){const{formatter:d}=u;return d.customFormat?new Function(`return ${d.customFormat}`)():c}function l(c,u,d){const f=Te.resolveField(d.raw,[u.field]),{formatter:s}=u;return s.type==="none"?f:s.type==="custom"?a(f,u):s.type==="enum"?t(u,d):s.type==="number"?n(u,d):s.type==="boolean"?e(u,d):s.type==="date"?r(u,d):f}return{renderFormatColumn:l}}function Sl(e,t,n){var v;const r=o.ref(e.mergeCell);(v=o.ref(e.rowOption).value)!=null&&v.wrapContent;const{updateVisualInfomation:a}=n,{renderCommandColumn:l}=Ja(),{renderFormatColumn:c}=wl();function u(y,C,F,w,S,N=1){const h={colSpan:N,rowSpan:1,index:F,field:y,data:Te.resolveField(w,y),editingData:Te.resolveField(w,y),parent:S,mode:C,align:"left",valign:"start",showEllipsis:!0,getEditor:_=>_.data,setRef:_=>a(_,h,w),update:()=>{},accept:()=>{},cancel:()=>{},updateData:()=>{}};return h}function d(y,C,F){return y.getEditor=w=>t.getEditor(w,C,w.parent),y.setRef=w=>a(w,y,F),y.update=w=>{w!==void 0&&(y.editingData=w)},y.accept=()=>{Te.setFieldValue(y.editingData,F,C.field),y.data=Te.resolveField(F,C.field)},y.cancel=()=>{y.editingData=y.data},y.updateData=w=>{Te.setFieldValue(Te.resolveField(w,C.field),F,C.field),y.data=Te.resolveField(F,C.field),y.editingData=Te.resolveField(F,C.field)},y}function f(y,C){C.dataType==="commands"?y.formatter=(F,w)=>l(C,w):C.formatter&&(y.formatter=(F,w)=>typeof C.formatter=="function"?C.formatter(F,w):c(C.dataType,C,w))}function s(y,C,F){const w=C&&C.data[F];if(w&&w.data===y.data){const N=w&&w.spannedBy||w;N.rowSpan++,N.spanned=N.spanned||[],N.spanned.push(y),y.colSpan=0,y.rowSpan=0,y.spannedBy=N}}function p(y,C,F){r.value&&s(y,C,F.field)}function m(y,C){C.showEllipsis!==void 0&&(y.showEllipsis=C.showEllipsis),y.column=C,y.align=C.align||"left",y.valign=C.valign||"middle"}function g(y,C,F,w){m(y,C),d(y,C,w),f(y,C),p(y,F,C)}function b(y,C,F,w,S){const N=y.readonly?Qe.readonly:Qe.editable,h=u(y.field,N,C,F,w);return g(h,y,S,F),h}return{createCellByColumn:b,createCellByField:u,updateCellByColumn:g}}function xl(e,t,n,r,i,a){var C,F;const l=o.ref(e.rowOption),c=((C=l.value)==null?void 0:C.height)||28,u=((F=l.value)==null?void 0:F.wrapContent)||!1,{idField:d}=r,{collapseField:f}=n,{updateRowPosition:s}=i,{createCellByColumn:p}=a,m=(w,S,N,h)=>{Te.setFieldValue(Te.resolveField(w,h),S,h),N.data[h].data=Te.resolveField(S,h),N.data[h].editingData=Te.resolveField(S,h)};function g(w,S,N,h,_,x,k){var D,ne,pe;const{__fv_data_grid_group_field__:T,__fv_data_grid_group_value__:V,__fv_data_index__:I}=N,E=N.__fv_data_grid_group_layer__||(N.__fv_parents__?(D=N.__fv_parents__)==null?void 0:D.size:0)||0,M=typeof N.parent=="number"?Number(N.parent):-1,B=N.__fv_data_grid_group_collapse__||N[f.value],O=N.__fv_visible__===void 0?!0:N.__fv_visible__,R=N.__fv_checked__,q=N.__fv_indeterminate__,L=N.__fv_disabled__||N[((ne=e.rowOption)==null?void 0:ne.disabledField)||"disabled"],X=k==null?void 0:k.find(oe=>oe.raw[d.value]===N.parent),te=X&&X.collapse;h&&(h.parent,N.parent);const ie=te||X&&!X.visible,ue={collapse:B,data:{},dataIndex:I,groupField:T,groupValue:V,layer:E,index:S,parentIndex:M,pre:h,top:x,type:w,raw:N,checked:R,disabled:L,indeterminate:q,setRef:oe=>{ue.ref=oe},visible:O&&!ie,status:it.initial,updateCell:(oe,A)=>{m(oe,N,ue,A)},updateCells:(oe,A)=>{A.forEach(Y=>{m(oe,N,ue,Y)})}};return h||(N.__fv_data_position__=0),u||(ue.height=c,N.__fv_data_height__=ue.height,s(ue,N)),(pe=l.value)!=null&&pe.customRowStatus&&(l.value.customRowStatus(ue),N.__fv_collapse__=ue.collapse,N.__fv_disabled__=ue.disabled,N.__fv_visible__=ue.visible),ue}function b(w,S,N,h,_,x,k){const T=g(It.data,_,S,N,h,x,k);return w.forEach((V,I)=>{T.data[V.field]=p(V,_,S,T,h)}),T}function v(w,S,N,h,_){return Object.assign(w,{index:S,dataIndex:N,top:h,pre:_})}function y(w,S,N,h,_,x,k){const T=w.__fv_data_index__,V=w[d.value],I=t.getEditingSnapshot(V);return I===null?b(x,w,S,N,h,_,k):v(I,h,T,_,S)}return{createEmptyRow:g,createNewRowFromDataItem:b,renderDataRow:y}}function Fl(e,t,n,r){var T;const{idField:i}=n,a=o.ref(e.editable),l=o.ref(e.editOption),c=o.ref(((T=e.rowOption)==null?void 0:T.wrapContent)||!1),{onClickRow:u}=r;o.watch(()=>e.editable,()=>{a.value=e.editable}),o.watch(()=>{var V;return(V=e.editOption)==null?void 0:V.editMode},V=>{l.value.editMode=V});const d=new Map([["boolean","check-box"],["datetime","date-picker"],["enum","combo-list"],["number","number-spinner"],["string","input-group"],["text","text"],["commands","commands-editor"]]);let f,s,p,m;function g(V){return s&&s.raw[i.value]===V?s:null}const b=o.reactive({});function v(V,I,E={}){V.mode=Qe.editing,f=V,s=I,p=Te.resolveField(I==null?void 0:I.raw,V.field),m=E}function y(V){V.accept(),V.mode=Qe.editable,f=null,t.emit("endEditCell",{cell:V,row:s,newValue:Te.resolveField(s==null?void 0:s.raw,V.field),oldValue:p,column:m,editor:b})}function C(V){if(document.body.classList.contains("lookup-modal-open"))return;const E=V.target.closest(".fv-grid-cell");f&&f.ref&&f.ref===E||(f&&(y(f),s&&(s=void 0)),document.body.removeEventListener("click",C))}function F(V,I,E,M={}){V.stopPropagation(),u(V,E),a.value&&l.value.editMode==="cell"&&I.mode===Qe.editable&&(f&&y(f),Promise.resolve().then(()=>be.isUndefined(e.beforeEditCell)?!0:typeof e.beforeEditCell=="function"?e.beforeEditCell({row:E,cell:I,rawData:E.raw,column:M}):e.beforeEditCell).then(B=>{B&&(v(I,E,M),document.body.removeEventListener("click",C),document.body.addEventListener("click",C))}))}function w(V){Object.values(V.data).filter(I=>I.mode===Qe.editable&&I.field!=="__commands__").forEach(I=>{I.mode=Qe.editing}),V.status=it.editing,s=V}function S(V,I){Object.values(V.data).filter(E=>E.mode===Qe.editing).forEach(E=>{I?E.accept():E.cancel(),E.mode=Qe.editable}),V.status=it.initial,s===V&&(s=void 0)}function N(V){a.value&&l.value.editMode==="row"&&s!==V&&(s&&S(s,!1),w(V))}function h(V){S(V,!0),V.status=it.initial}function _(V){S(V,!1),V.status=it.initial}function x(V,I,E){const M=I.dataType,B=I.editor||{type:d.get(M)||"input-group"};return!c.value&&B.type==="text"&&(B.type="input-group"),B?(B.context={rowData:E.raw,column:I,cell:V,editor:b},o.createVNode(un.FDynamicFormInput,{focusOnCreated:e.focusOnEditingCell,selectOnCreated:e.selectOnEditingCell,editor:B,modelValue:V.editingData,"onUpdate:modelValue":O=>V.editingData=O,id:I.id},null)):V.data}function k(){f&&y(f)}return{onClickCell:F,onEditingRow:N,acceptEditingRow:h,cancelEditingRow:_,getEditingSnapshot:g,getEditor:x,endEditCell:k}}function Tl(e){const t=o.ref(e.idField);function n(r){if(r&&r.length){const i=r[0];Object.keys(i).includes(t.value)||(t.value="__fv_indetify__")}}return{idField:t,reviseIdentifyField:n}}function _l(e,t,n,r){const{idField:i}=r,{currentSelectedDataId:a,multiSelectOnClickRow:l,multiSelectOnClickRowWithShift:c,selectItem:u,selectedValues:d,toggleSelectItem:f,enableSelectRow:s}=n,p=o.ref(0),m=o.ref(-1);function g(h){return s.value&&(c.value?d.value.includes(h.raw[i.value]):h.raw[i.value]===a.value)}function b(h){var x;const _={"fv-grid-row":h.type===It.data,"fv-grid-group-row":h.type===It.group,"fv-grid-summary-row":h.type===It.summary,"fv-grid-row-hover":h.index===m.value,"fv-grid-row-selected":g(h),"fv-grid-row-odd":h.dataIndex%2>0,"fv-grid-row-even":h.dataIndex%2===0,"fv-grid-disabled":h.disabled};if((x=e.rowOption)!=null&&x.customRowStyle){const k=e.rowOption.customRowStyle(h.raw)||{};return Object.assign({},_,k)}return _}function v(h){var x;const _={"fv-grid-cell":!0};if((x=e.rowOption)!=null&&x.customCellStyle){const k=e.rowOption.customCellStyle(h)||{};return Object.assign({},_,k)}return _}function y(h){p.value+=1,setTimeout(()=>{p.value===1&&t.emit("clickRow",h.index,h.raw),p.value=0},250),p.value>1&&(t.emit("doubleClickRow",h.index,h.raw),p.value=0)}function C(h,_){if(_.disabled)return;c.value&&h.shiftKey||l.value?f(_):u(_),y(_)}function F(h){h.disabled||(a.value=h.raw[i.value],y(h))}function w(h,_){}function S(h,_){}function N(h){var x;const _={"fv-grid-sidebar-row":!0,"fv-grid-sidebar-row-hover":h.index===m.value,"fv-grid-sidebar-row-selected":g(h),"fv-grid-sidebar-row-odd":h.dataIndex%2>0,"fv-grid-sidebar-row-even":h.dataIndex%2===0,"d-flex":!0,"align-items-center":!0};if((x=e.rowOption)!=null&&x.customRowStyle){const k=e.rowOption.customRowStyle(h.raw)||{};return Object.assign({},_,k)}return _}return{clickRowItem:F,gridCellClass:v,gridRowClass:b,onClickRow:C,onMouseoverRow:w,sidebarRowClass:N,onMouseoutRow:S}}function Nl(e,t,n,r,i){const{idField:a}=n,l=o.ref(""),c=o.computed(()=>e.selection.enableSelectRow),u=o.ref(e.selection.multiSelect??!1),d=o.ref(e.selection.multiSelectMode),f=o.ref(e.selection.showCheckbox),s=o.ref(e.selection.showSelectAll),p=o.ref(e.selectionValues);o.watch(()=>e.selection.showSelectAll,(D,ne)=>{D!==ne&&(s.value=D)});function m(){return t.getSelectionItems(p.value)}function g(){const D=r.value.reduce((pe,oe)=>(pe.set(oe.raw[a.value],oe),pe),new Map);return p.value.map(pe=>D.get(pe)).filter(pe=>!!pe)}const b=o.computed(()=>c.value&&u.value),v=o.computed(()=>!!e.hierarchy),y=o.computed(()=>{const D=f.value&&d.value==="DependOnCheck";return b.value&&D}),C=o.computed(()=>b.value&&!f.value),F=o.computed(()=>b.value&&f.value&&d.value==="OnCheckAndClick");o.computed(()=>F.value);function w(){const D=t.getSelectionItems(p.value);i.emit("selectionChange",D)}function S(D){i.emit("unSelectItem",D)}function N(){r.value.forEach(ne=>{ne.checked=!1,ne.indeterminate=!1,ne.raw.__fv_checked__=!1,ne.raw.__fv_indeterminate__=!1}),g().forEach(ne=>{ne.checked=!0,ne.raw.__fv_checked__=!0})}o.watch(()=>r.value,()=>{N()}),o.watch(()=>e.selectionValues,D=>{p.value=D,N()},{immediate:!0}),o.watch(()=>e.selection,D=>{u.value=!!D.multiSelect,d.value=D.multiSelectMode||"DependOnCheck",f.value=!!D.showCheckbox});const h=o.computed(()=>!u.value);function _(D){return D.raw[a.value]}function x(D){return p.value.findIndex(pe=>pe===_(D))}function k(){g().forEach(pe=>{pe.checked=!1}),t.getSelectionItems(p.value).forEach(pe=>{pe.__fv_checked__=!1}),p.value=[],l.value=""}function T(D){const ne=D.raw;ne.__fv_checked__=!0,ne.__fv_indeterminate__=!1;const pe=new Set(p.value);pe.add(ne[a.value]),p.value=Array.from(pe.values()),D.checked=!0,D.indeterminate=!1}function V(D){const ne=D.raw;ne.__fv_checked__=!1,ne.__fv_indeterminate__=!1,p.value=p.value.filter(pe=>pe!==ne[a.value]),D.checked=!1,D.indeterminate=!1}function I(D){T(D),l.value=D.raw[a.value]}function E(D){V(D),l.value=""}function M(D){const ne=D.raw;ne.__fv_checked__=!1,ne.__fv_indeterminate__=!0,p.value=p.value.filter(pe=>pe!==ne[a.value]),D.checked=!1,D.indeterminate=!0}function B(D){h.value&&k(),D.checked?V(D):T(D),w()}function O(D){h.value&&k(),D.checked?E(D):I(D),w(),D.checked||S(D)}function R(D){D.raw[a.value]!==l.value&&(k(),I(D),w())}function q(D){const ne=r.value.find(pe=>pe.raw[a.value]===D);ne&&R(ne)}function L(D){const ne=r.value.filter(pe=>D.includes(pe.raw[a.value]));ne&&ne.length&&(k(),ne.forEach(pe=>{I(pe)}),w())}function X(D){for(const ne of D)if(p.value.includes(ne)){const pe=r.value.find(oe=>oe.raw[a.value]===ne);pe&&E(pe)}}function te(){r.value.forEach(D=>I(D)),w()}function ie(){p.value.splice(0,p.value.length),r.value.forEach(D=>{const ne=D.raw;ne.__fv_checked__=!1,ne.__fv_indeterminate__=!1,D.checked=!1,D.indeterminate=!1}),w()}function ue(){return r.value.find(D=>D.raw[a.value]===l.value)}return{clearSelection:k,currentSelectedDataId:l,enableMultiSelect:u,enableSelectRow:c,findIndexInSelectedItems:x,getSelectedItems:m,getSelectionRow:ue,indeterminate:M,isSelectingHirarchyItem:v,multiSelectMode:d,multiSelectOnClickRow:F,multiSelectOnClickRowWithShift:C,multiSelectOnlyOnCheck:y,select:I,selectAll:te,selectedValues:p,selectItem:R,selectItemById:q,selectItemByIds:L,showCheckBox:f,showSelectAll:s,toggleSelectItem:O,toggleSelectItemWithoutRow:B,unSelect:E,unSelectAll:ie,unSelectItemByIds:X}}function Vl(e,t){var v,y;const n=String(Date.now()),r=50,{showCheckBox:i,showSelectAll:a}=t,l=o.ref(((v=e.rowNumber)==null?void 0:v.enable)??!1),c=o.computed(()=>e.hierarchy&&i.value&&e.selection.enableSelectRow&&e.selection.multiSelect?!1:i.value),u=o.ref(l.value?((y=e.rowNumber)==null?void 0:y.width)??32:0),d=o.ref(c.value?r:0),f=o.computed(()=>{var C;return l.value?((C=e.rowNumber)==null?void 0:C.heading)??"序号":""}),s=o.computed(()=>(c.value&&!e.hierarchy?Number(d.value):0)+(l.value?Number(u.value):0));o.watch(()=>e.rowNumber,C=>{C&&C.enable!==void 0&&(l.value=C.enable),C&&C.width!==void 0&&(u.value=C.width)});function p(C){return{top:`${C.top}px`,width:`${s.value}px`,height:`${C.height||""}px`}}const m=o.computed(()=>({width:`${s.value}px`}));function g(C){return`${n}_${C.type}_r_${C.index}_${C.refreshKey||""}`}function b(C){return`${n}_${C.type}_r_${C.index}_${C.refreshKey||""}`}return{showRowNumer:l,showSidebarCheckBox:c,sidebarCellPosition:p,sidebarCornerCellStyle:m,sidebarTitle:f,sidebarWidth:s,rowKey:b,cellKey:g}}const kl={ascend:(e,t)=>e===t?0:e===!1?-1:1,decend:(e,t)=>e===t?0:e===!0?-1:1},El={ascend:(e,t)=>{const n=new Date(new Date(e).toLocaleDateString()).valueOf(),r=new Date(new Date(t).toLocaleDateString()).valueOf();return n===r?0:n<r?-1:1},decend:(e,t)=>{const n=new Date(new Date(e).toLocaleDateString()).valueOf(),r=new Date(new Date(t).toLocaleDateString()).valueOf();return n===r?0:n<r?1:-1}},Il={ascend:(e,t)=>e===t?0:e<t?-1:1,decend:(e,t)=>e===t?0:e<t?1:-1},Ml={ascend:(e,t)=>e===t?0:e<t?-1:1,decend:(e,t)=>e===t?0:e<t?1:-1};function Ol(e){const t=new Map([["boolean","boolean-sorter"],["date","datetime-sorter"],["datetime","datetime-sorter"],["number","numeric-sorter"],["string","text-sorter"],["text","text-sorter"],["enum","text-sorter"],["reference","text-sorter"]]),n=new Map([["boolean-sorter",kl],["datetime-sorter",El],["numeric-sorter",Il],["text-sorter",Ml]]);function r(l){const c=(l==null?void 0:l.dataType)||"string",u=t.get(c)||"text-sorter";return n.get(u)||(l==null?void 0:l.sorter)}function i(l){return r(l.column)}function a(l,c){const u=i(l),d=(l.status&$e.sortable)===$e.sortable&&(l.status&$e.sorted)===$e.sorted,f=(l.status&$e.ascending)===$e.ascending,s=(l.status&$e.descending)===$e.descending;if(d&&u){const p=f?u.ascend:s?u.decend:void 0;p?c.addSorter(l.field,{field:l.field,compare:p}):c.removeSorter(l.field)}else c.removeSorter(l.field)}return{getSorterByColumn:r,updateSorter:a}}function Bl(e){const t="parent",n="layer",r="hasChildren",i=(a,l=1,c=[],u=null)=>(a=a||[],a.reduce((d,f)=>(f.id=f.id||f.data[e.idField],f[t]=u,f[n]=l,f[r]=!1,Object.keys(f.data).forEach(s=>{Object.keys(f).includes(s)||(f[s]=f.data[s])}),c.push(f),f.children&&f.children.length&&(f[r]=!0,i(f.children,l+1,c,f.id)),d),c),c);return{flatTreeData:i}}function Pl(e,t,n,r,i,a,l,c,u,d,f,s,p,m,g,b,v){const{calculateCellPositionInRow:y}=a,{columnContext:C,hasLeftFixedColumn:F,hasRightFixedColumn:w}=l,{gridDataStyle:S,leftFixedGridDataStyle:N,rightFixedGridDataStyle:h}=m,{renderDataRow:_}=Xa(e,t,C,v,c,u,d,f,s,p,m),x=[_];function k(M,B){const O=y(M);return v.value.filter(R=>R.visible!==!1).map(R=>x[R.type](R,O,B))}function T(){return o.createVNode("div",{ref:r,class:"fv-grid-content-left-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:N.value},[k(C.value.leftColumns.filter(M=>M.visible),"left")])])}function V(){return o.createVNode("div",{ref:n,class:"fv-grid-content-primary"},[o.createVNode("div",{class:"fv-grid-data",style:S.value},[k(C.value.primaryColumns.filter(M=>M.visible),"primary")])])}function I(){return o.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:h.value},[k(C.value.rightColumns.filter(M=>M.visible),"right")])])}function E(){const M=[];return F.value&&M.push(T()),M.push(V()),w.value&&M.push(I()),M}return{renderDataArea:E}}const Xt=o.defineComponent({name:"FTreeGrid",props:Tn,emits:["selectionChange","clickRow","expandNode"],setup(e,t){var kt,$;const r=((kt=e.rowOption)==null?void 0:kt.height)||28,i=o.ref(20),a=o.ref(e.columns),l=he.useIdentify(e),c=o.ref(),u=o.ref(),d=o.ref(),f=o.ref(),s=o.ref(),p=o.ref([]),m=o.ref(!1),g=o.ref((($=e.rowOption)==null?void 0:$.wrapContent)||!1),b=he.useGroupData(e,l),v=he.useFilter(),y=he.useHierarchy(e),{showLoading:C,renderLoading:F}=he.useLoading(e,c),w=he.useDataView(e,new Map,v,y,l),S=he.useSelection(e,w,l,p,t),N=he.useSelectHierarchyItem(e,p,l,S,t),h=o.computed(()=>e.disabled),_=o.computed(()=>e.virtualized?Math.min(w.dataView.value.length,i.value):w.dataView.value.length),{containerStyleObject:x}=he.useDataViewContainerStyle(e),k=he.useCommandColumn(e),{applyCommands:T}=k;T(a);const V=he.useColumn(e),I=he.useSort(e),{applyColumnSorter:E,columnContext:M,updateColumnRenderContext:B}=V;E(w,I);const O=he.useGroupColumn(e,M),R=he.useRow(e,t,S,l),q=he.useEdit(e,t,l,R),L=he.useVisualDataBound(e),X=he.useVisualDataCell(e,q,L),te=he.useVisualDataRow(e,q,y,l,L,X),ie=he.useVisualData(e,a,w,_,0,te),{getVisualData:ue}=ie,D=he.useCellPosition(e,M),ne=he.useSidebar(e,S),{sidebarWidth:pe}=ne,oe=he.useVirtualScroll(e,w,p,M,ie,_,0,pe),{onWheel:A,dataGridWidth:Y,viewPortHeight:we,viewPortWidth:Ce,resetScroll:je,updateVisibleRowsOnLatestVisibleScope:De}=oe,Be=he.useFitColumn(e,M,u,Ce,O),{calculateColumnsSize:me}=Be,G=he.useFilterHistory(),Q=he.useColumnFilter(u,s,w,G,oe),ee=he.useDragColumn(e,t,V,w,O,b,oe),re=o.computed(()=>({"fv-grid":!0,"fv-grid-bordered":e.showBorder,"fv-grid-horizontal-bordered":e.showHorizontalLines,"fv-datagrid-strip":e.showStripe})),U=o.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":m.value,"fv-grid-wrap-content":g.value})),{renderDataArea:ge}=Pl(e,t,d,f,s,D,V,w,q,y,R,S,N,oe,ie,L,p),{renderGridHeader:Pe,renderGridColumnResizeOverlay:Xe,shouldShowHeader:lt}=he.getColumnHeader(e,t,u,f,s,V,w,ee,Q,v,G,Be,O,S,ne,I,oe,Ce,p),{renderDataGridSidebar:Ke}=he.getSidebar(e,R,S,ne,oe),{renderDisableMask:Ze}=he.getDisableMask(),{renderHorizontalScrollbar:et}=he.getHorizontalScrollbar(e,u,oe),{renderVerticalScrollbar:st}=he.getVerticalScrollbar(e,u,oe);function ct(){var W,Z,fe;if(u.value&&u.value.clientHeight>0&&((W=u.value)==null?void 0:W.clientWidth)>0){const Se=Math.ceil(u.value.clientHeight/r);Se>i.value&&(i.value=Se,De()),we.value=((Z=d.value)==null?void 0:Z.clientHeight)||0,Y.value=((fe=u.value)==null?void 0:fe.clientWidth)||0,me()}}o.onMounted(()=>{u.value&&(i.value=Math.max(Math.ceil(u.value.clientHeight/r),i.value),p.value=ue(0,_.value+0-1),eo.useResizeObserver(u.value,ct),me(),o.nextTick(()=>{u.value&&(Y.value=u.value.clientWidth),d.value&&(Ce.value=d.value.clientWidth,we.value=d.value.clientHeight)})),C.value&&F()}),o.onUnmounted(()=>{}),o.watch(Ce,()=>{u.value&&me()});function ot(){const W=S.getSelectionRow();return W?W.dataIndex-1:-1}function dt(){const W=ot();w.insertNewDataItem(W),p.value=ue(0,_.value+0-1)}function ft(){const W=ot();w.insertNewChildDataItem(W),p.value=ue(0,_.value+0-1)}function pt(){const W=ot(),Z=N.getNextSelectableHierarchyItemId(W);w.removeHierarchyDataItem(W),p.value=ue(0,_.value+0-1),Z&&S.selectItemById(Z)}function P(W){q.onEditingRow(W)}function H(W){q.acceptEditingRow(W)}function K(W){q.cancelEditingRow(W)}function ve(W){W&&(a.value=W,T(a),B(a.value),E(w,I),me())}function xe(W){W&&(w.load(W),je())}function Re(W){S.selectItemById(W)}function Ee(W){const Z=p.value.find(fe=>fe.raw[l.idField.value]===W);Z&&R.clickRowItem(Z)}function Fe(W){S.selectItemByIds(W)}function Oe(){return S.getSelectedItems()}function Ve(){S.clearSelection()}const ke=o.computed(()=>!p.value||!p.value.length),{renderEmpty:Ie}=he.getEmpty(t);function Ye(){return S.getSelectionRow()}return t.expose({addNewDataItem:dt,addNewChildDataItem:ft,removeDataItem:pt,editDataItem:P,acceptDataItem:H,cancelDataItem:K,updateColumns:ve,updateDataSource:xe,selectItemById:Re,selectItemByIds:Fe,getSelectedItems:Oe,clearSelection:Ve,getSelectionRow:Ye,clickRowItemById:Ee}),()=>o.createVNode("div",{ref:c,class:re.value,style:x.value,onWheel:A},[u.value&&lt.value&&Pe(),o.createVNode("div",{ref:u,class:U.value,onMouseover:()=>m.value=!0,onMouseleave:()=>m.value=!1},[u.value&&Ke(p),u.value&&ge(),u.value&&ke.value&&Ie(),u.value&&et(),u.value&&st()]),Xe(),h.value&&Ze()])}}),Rl={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}},Oo={},Bo={},jl={id:{type:String}},Dl=o.defineComponent({name:"FDesignerPlaceholder",props:jl,emits:[],setup(e){const t=o.computed(()=>({"drag-and-drop-alert":!0,"no-drag":!0,"w-100":!0})),n=o.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()=>o.createVNode("div",{class:t.value,style:n.value,role:"alert","data-noattach":"true","data-position":"0"},[o.createTextVNode("拖拽组件到这里")])}});function $l(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!o.isVNode(e)}const Nn=o.defineComponent({name:"FDesignerItem",props:Rl,emits:["selectionChange"],setup(e,t){const n=o.ref(`${e.modelValue.id}-component`),r=o.ref(e.canMove),i=o.ref(e.canDelete),a=o.ref(!1),l=o.ref(e.modelValue),c=o.ref(e.componentId||""),u=o.ref(""),d=o.ref(""),f=o.ref(e.customClass),s=o.ref(),p=o.inject("canvas-dragula"),m=o.ref(),g=o.inject("design-item-context"),b={designerItemElementRef:s,componentInstance:m,schema:l.value,parent:g,setupContext:t};o.provide("design-item-context",b);const v=o.inject("useFormSchema"),y=o.computed(()=>{var R;const M=e.modelValue.appearance&&e.modelValue.appearance.class||"",B=((R=m.value)==null?void 0:R.getCustomButtons)&&m.value.getCustomButtons();let O={"farris-component":!0,"flex-fill":l.value.id==="root-component","position-relative":r.value&&i.value||(B==null?void 0:B.length),"farris-nested":a.value,"can-move":r.value,"d-none":s.value&&s.value.classList.contains("d-none"),dgComponentSelected:s.value&&s.value.classList.contains("dgComponentSelected"),dgComponentFocused:s.value&&s.value.classList.contains("dgComponentFocused")};return O[`farris-component-${l.value.type}`]=!0,O=Te.getCustomClass(O,M),O=Te.getCustomClass(O,d.value),O=Te.getCustomClass(O,f.value),O}),C=o.computed(()=>{const M={},B=e.modelValue.appearance&&e.modelValue.appearance.style||"";return B&&B.split(";").reduce((O,R)=>{const[q,L]=R.split(":");return O[q]=L,O},M),u.value&&u.value.split(";").reduce((O,R)=>{const[q,L]=R.split(":");return q&&(O[q]=L),O},M),M});function F(M,B){var q,L;if(M&&(M.preventDefault(),M.stopPropagation()),m.value.triggerBelongedComponentToDeleteWhenDeleted){const X=m.value.getBelongedComponentInstance(m);if(X&&X.parent){const te=o.ref(X==null?void 0:X.parent),ie=te.value.contents.findIndex(ue=>ue.id===X.schema.id);(L=(q=te.value)==null?void 0:q.contents)==null||L.splice(ie,1),Ut.value++}return}m.value.onRemoveComponent();let O=g,R=X=>X.id===B.id;if(B.type==="component"&&(O=g==null?void 0:g.parent,R=X=>X.component===B.id),O&&O.schema.contents){const X=O.schema.contents.findIndex(R);O.schema.contents.splice(X,1),Ut.value++,t.emit("selectionChange")}}function w(M){return i.value&&o.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:B=>{F(B,M)}},[o.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function S(){return r.value&&o.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[o.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function N(){var B;const M=((B=m.value)==null?void 0:B.getCustomButtons)&&m.value.getCustomButtons();return M&&!!M.length&&M.map(O=>o.createVNode("div",{role:"button",class:`btn component-settings-button ${O.class||""}`,title:O.title,ref:O.id,onClick:R=>O.onClick&&O.onClick(R)},[o.createVNode("i",{class:O.icon},null)]))}function h(M){return o.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[o.createVNode("div",null,[w(M),S(),N()])])}function _(M,B,O,R){t.emit("selectionChange",M,B,O,R)}function x(M){let B;const O=M.type,R=Oo[O],q=Bo[O],L=q?q(M):{};L.customClass=e.ignore?L.customClass:"",L.componentId=c.value,L.id=M.id;const X=M.contents&&M.contents.length===0;return M.contents&&!!M.contents.length&&R?o.createVNode(R,o.mergeProps({ref:m},L),$l(B=M.contents.map(ie=>o.createVNode(Nn,{key:ie.id,modelValue:ie,"onUpdate:modelValue":ue=>ie=ue,componentId:c.value,onSelectionChange:_},null)))?B:{default:()=>[B]}):R?X?o.createVNode(R,o.mergeProps({ref:m},L),{default:()=>[o.createVNode(Dl,null,null)]}):o.createVNode(R,o.mergeProps({ref:m},L),null):o.createVNode("div",null,null)}function k(M){if(M.type==="component-ref"){let O=v==null?void 0:v.getFormSchema().module.components.find(R=>R.id===M.component);if(O)return o.createVNode(Nn,{key:O.id,modelValue:O,"onUpdate:modelValue":R=>O=R,componentId:O.id,onSelectionChange:_},null)}}o.watch(()=>e.modelValue,M=>{l.value=M,n.value=`${M.id}-component`});function T(M){window.scrollContainerList||(window.scrollContainerList=new Set);const B=M.getAttribute("id");B&&window.scrollContainerList.add(B)}function V(M){const B=M==null?void 0:M.target;T(B),Ia(B)}function I(){var M,B;(B=(M=l.value)==null?void 0:M.contents)!=null&&B.length&&s.value&&s.value.addEventListener("scroll",V)}o.onMounted(()=>{if(s.value&&m.value&&m.value.schema){const M=s.value.querySelector(`[data-dragref='${m.value.schema.id}-container']`);p&&M&&p.attachComponents(M,l.value),a.value=m.value.canNested!==void 0?m.value.canNested:a.value,i.value=m.value.canDelete!==void 0?m.value.canDelete:i.value,r.value=m.value.canMove!==void 0?m.value.canMove:r.value,u.value=m.value.styles||"",d.value=m.value.designerClass||"",s.value&&(s.value.componentInstance=m,s.value.designItemContext=b),m.value.belongedComponentId=c.value}I(),Ut.value++}),o.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",V)});function E(M){M&&(M.preventDefault(),M.stopPropagation());let B=b.designerItemElementRef;const O=s.value;if(O){const R=document.getElementsByClassName("dgComponentFocused");R&&R.length===1&&R[0]===s.value||(Array.from(R).forEach(L=>L.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(L=>L.classList.remove("dgComponentSelected")),O.classList.add("dgComponentFocused"),t.emit("selectionChange",l.value.type,l.value,c.value,m.value),m.value.getDraggableDesignItemElement&&(B=m.value.getDraggableDesignItemElement(b),B&&B.value&&B.value.classList.add("dgComponentSelected")))}No(B==null?void 0:B.value)}return()=>l.value.type==="component-ref"?k(l.value):o.createVNode("div",{id:`${l.value.id}-design-item`,ref:s,class:y.value,style:C.value,onClick:E},[h(l.value),x(l.value)])}});function Al(e,t,n,r,i="data-grid-column"){const{columnContext:a,hasLeftFixedColumn:l,hasRightFixedColumn:c}=n,{gridHeaderColumnsStyle:u,leftFixedGridHeaderColumnsStyle:d,rightFixedGridHeaderColumnsStyle:f}=r,s=a.value.defaultColumnWidth,p=32,m=new Map([[0,0]]);function g(k,T){const V=m.get(T)||0,I={height:`${k.depth*p}px`,left:`${k.left}px`,top:`${(k.layer-1)*p}px`,width:`${k.actualWidth}px`,padding:0};return a.value.headerDepth>1&&(I["line-height"]=`${k.depth*p}px`),m.set(T+1,V+(k.actualWidth||s)),I}const b=o.computed(()=>({"fv-grid-header":!0,"fv-grid-header-group-columns":a.value.headerDepth>1})),v=o.computed(()=>({height:`${a.value.headerDepth*p}px`})),y=function(k){return t.showSetting&&!!k.showSetting};function C(){return o.createVNode("span",{class:"fv-grid-settings-icon d-flex align-items-center"},[o.createVNode("i",{class:"f-icon f-icon-home-setup"},null)])}function F(k,T,V,I){var E;(E=e==null?void 0:e.setupContext)==null||E.emit("selectionChange",k,T,V,I)}function w(k){var V,I;return"w-100 d-flex align-items-center justify-content-"+(((V=k.column)==null?void 0:V.halign)==="center"?"center":((I=k.column)==null?void 0:I.halign)==="right"?"end pr-2":"start pl-2")}function S(k,T,V){var E;const I=o.ref(k.column);return o.createVNode("div",{class:"fv-grid-header-cell",style:g(k,V)},[o.createVNode(Nn,{modelValue:I.value,"onUpdate:modelValue":M=>I.value=M,customClass:w(k),canAdd:!1,canDelete:!1,canMove:!1,key:(E=I.value)==null?void 0:E.id,type:i,componentId:t.componentId,onSelectionChange:F},null),y(k)&&C(),k.resizable&&o.createVNode("span",{class:"fv-column-resize-bar"},null)])}function N(k){return k.map((T,V)=>{const I=[];if(I.push(S(T,k,V)),T.children&&T.children.length){const E=N(T.children);I.push(...E)}return I})}function h(){return o.createVNode("div",{class:"fv-grid-header-left-fixed"},[o.createVNode("div",{class:"fv-grid-header-columns",style:d.value},[N(a.value.leftHeaderColumns)])])}function _(){return o.createVNode("div",{class:"fv-grid-header-right-fixed"},[o.createVNode("div",{class:"fv-grid-header-columns",style:f.value},[N(a.value.rightHeaderColumns)])])}function x(){return o.createVNode("div",{class:b.value,style:v.value},[l.value&&h(),o.createVNode("div",{class:"fv-grid-header-primary"},[o.createVNode("div",{class:"fv-grid-header-columns",style:u.value},[N(a.value.primaryHeaderColumns)])]),c.value&&_()])}return{renderGridHeader:x}}class Ll extends _o{constructor(t,n){super(t,n)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){var l,c,u;const n=(u=(c=(l=this.formSchemaUtils.getFormSchema())==null?void 0:l.module)==null?void 0:c.entity[0])==null?void 0:u.entities[0],r=this.assembleSchemaEntityToTree(n,0),i=this,a=super.getBasicPropConfig(t);this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{...a.properties,dataSource:{description:"绑定数据源",title:"绑定数据源",editor:{type:"combo-tree",textField:"name",valueField:"label",data:r,editable:!1},readonly:!0}},setPropertyRelates(d,f){switch(d&&d.propertyID){case"dataSource":{const s=i.formSchemaUtils.getViewModelById(i.viewModelId);if(s){const p=r.find(m=>m.label===d.propertyValue);s.bindTo=p.bindTo}i.designViewModelUtils.assembleDesignViewModel();break}}}}}getAppearanceProperties(t){var n,r,i;this.propertyConfig.categories.appearance={title:"外观",properties:{columns:{title:"列设置",description:"列设置",$converter:"/converter/items-count.converter",editor:{type:"grid-field-editor",viewModelId:this.viewModelId,gridData:t,gridType:"tree-grid-column"},refreshPanelAfterChanged:!0},fit:{title:"适配父组件尺寸",type:"boolean",description:"是否适配父组件尺寸",visible:!1},showStripe:{title:"显示条纹",type:"boolean",description:"是否显示条纹"},showBorder:{title:"显示边框",type:"boolean",description:"是否显示边框"}},setPropertyRelates(a,l){switch(a&&a.propertyID){case"useBlankWhenDataIsEmpty":t.emptyDataHeight=t.useBlankWhenDataIsEmpty?36:240;break;case"fields":t.fields=a.propertyValue||[];break}}},this.propertyConfig.categories.pagination={title:"分页",$converter:"/converter/pagination.converter",properties:{enable:{title:"启用分页",type:"boolean",refreshPanelAfterChanged:!0,editor:{readonly:!0}},mode:{visible:((n=t.pagination)==null?void 0:n.enable)||!1,title:"分页交互模式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"client",name:"客户端"},{value:"server",name:"服务器端"}]}},showIndex:{visible:((r=t.pagination)==null?void 0:r.enable)||!1,title:"显示页码",type:"boolean"},showLimits:{visible:((i=t.pagination)==null?void 0:i.enable)||!1,title:"显示每页记录数",type:"boolean"}}}}getEventPropConfig(t){const n=[{label:"onSelectionChange",name:"行切换事件"},{label:"onClickRow",name:"行点击事件"}],r=this,i=r.eventsEditorUtils.formProperties(t,r.viewModelId,n),a={};a[r.viewModelId]={type:"events-editor",editor:{initialData:i}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(l,c){const u=l.propertyValue;delete t[r.viewModelId],u&&(u.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(t,r.viewModelId,u.events,u)),t.remoteSort=!!t.columnSorted}}}assembleSchemaEntityToTree(t,n,r,i="",a=[]){const l=i?`${i}/${t.label}`:"/";return a.push({id:t.id,name:t.name,label:t.label,layer:n,parent:r&&r.id,bindTo:l.replace("//","/")}),t.type.entities&&t.type.entities.length&&t.type.entities.map(c=>this.assembleSchemaEntityToTree(c,n+1,t,l,a)),a}}function ql(e,t){const n=e.schema,r=o.ref(!0),i=o.ref(!0);function a(f){return f&&f.sourceType==="control"?f.componentCategory==="input":!1}function l(){return!1}function c(){return!1}function u(){return!0}function d(f){return new Ll(f,t).getPropertyConfig(n)}return{canAccepts:a,checkCanDeleteComponent:l,checkCanMoveComponent:c,hideNestedPaddingInDesginerView:u,triggerBelongedComponentToMoveWhenMoved:r,triggerBelongedComponentToDeleteWhenDeleted:i,getPropsConfig:d}}function Wl(e,t,n,r,i){const{getGridHeaderCells:a}=i,l=120,c=50,u=o.computed(()=>{var h;return((h=e.rowNumber)==null?void 0:h.enable)||!1}),d=o.computed(()=>{var h,_;return((h=e.selection)==null?void 0:h.multiSelect)||((_=e.selection)==null?void 0:_.showCheckbox)||!1}),f=o.computed(()=>{var h;return 0+(u.value?((h=e.rowNumber)==null?void 0:h.width)||32:0)+(d.value?c:0)}),s=o.computed(()=>{var h;return(h=e.columnOption)==null?void 0:h.fitColumns}),p=o.computed(()=>{var h;return s.value&&((h=e.columnOption)==null?void 0:h.fitMode)||"none"});function m(h,_,x){const k=parseInt(h.width,10)/100;return x*k}function g(h,_,x){return typeof h.width=="string"?m(h,_,x):h.width||l}function b(h,_){const x=[],k=[];let T=0;h.value.primaryColumns.filter(E=>E.visible).forEach(E=>{typeof E.width=="string"?k.push(E):(E.width=E.width||l,T+=E.width,x.push(E))});const V=_*(x.length/h.value.primaryColumns.filter(E=>E.visible).length);x.forEach(E=>{const M=V*(E.width/T);E.actualWidth=M,h.value.primaryColumnsWidth+=E.actualWidth});const I=_-V;k.forEach(E=>{const M=m(E,h.value,I);E.actualWidth=M,h.value.primaryColumnsWidth+=E.actualWidth})}function v(h,_){const x=[],k=[],T=new WeakMap;let V=0,I=0;if(h.value.primaryColumns.filter(M=>M.visible).forEach(M=>{if(typeof M.width=="string"){const B=m(M,h.value,_);T.set(M,B),V+=B,k.push(M)}else M.width=M.width||l,I+=M.width,x.push(M)}),_-V>I){const M=_-V;k.forEach(B=>{B.actualWidth=T.get(B)||l,h.value.primaryColumnsWidth+=B.actualWidth}),x.forEach(B=>{B.actualWidth=M*(B.width/I),h.value.primaryColumnsWidth+=B.actualWidth})}else b(h,_)}function y(h,_){h.value.primaryColumns.filter(x=>x.visible).forEach(x=>{x.actualWidth=g(x,h.value,_),h.value.primaryColumnsWidth+=x.actualWidth})}const C={expand:v,none:y,percentage:b};function F(h){h.value.leftHeaderColumns=Array.from(a(h.value.leftColumns.filter(_=>_.visible)).values()),h.value.primaryHeaderColumns=Array.from(a(h.value.primaryColumns.filter(_=>_.visible)).values()),h.value.rightHeaderColumns=Array.from(a(h.value.rightColumns.filter(_=>_.visible)).values())}function w(h){h.value.leftColumnsWidth=0,h.value.primaryColumnsWidth=0,h.value.rightColumnsWidth=0,h.value.leftColumns.filter(_=>_.visible).forEach(_=>{h.value.leftColumnsWidth+=_.actualWidth||0}),h.value.primaryColumns.filter(_=>_.visible).forEach(_=>{h.value.primaryColumnsWidth+=_.actualWidth||0}),h.value.rightColumns.filter(_=>_.visible).forEach(_=>{h.value.rightColumnsWidth+=_.actualWidth||0}),h.value=Object.assign({},h.value)}function S(h,_,x){var B;let k=0;const T=h.value.primaryColumns,V=h.value.rightColumns;h.value.rightColumns.filter(O=>O.visible).forEach(O=>{O.actualWidth=g(O,h.value,_),k+=O.actualWidth});const I=x-k,E=C[p.value];if(E&&E(h,I),h.value.primaryColumnsWidth+k<=x)return h.value.primaryColumns=[...T,...V],h.value.primaryColumnsWidth+=k,h.value.rightColumns=[],h.value.rightColumnsWidth=0,!0;const M=new Map;return M.set("primary",[]),M.set("right",[]),h.value.primaryColumns.reduce((O,R)=>{var q,L;return R.fixed==="right"?(q=O.get("right"))==null||q.push(R):(L=O.get("primary"))==null||L.push(R),O},M),(B=M.get("right"))!=null&&B.length&&(h.value.primaryColumns=[...M.get("primary")||[]],h.value.rightColumns=[...M.get("right")||[]]),h.value.primaryColumnsWidth=0,h.value.rightColumnsWidth=0,!1}function N(){if(n.value){t.value.leftColumnsWidth=0,t.value.primaryColumnsWidth=0,t.value.rightColumnsWidth=0;const h=n.value.clientWidth-f.value;t.value.leftColumns.filter(x=>x.visible).forEach(x=>{x.actualWidth=g(x,t.value,h),t.value.leftColumnsWidth+=x.actualWidth});const _=h-t.value.leftColumnsWidth;if(S(t,h,_))r.value=_;else{t.value.rightColumns.filter(T=>T.visible).forEach(T=>{T.actualWidth=g(T,t.value,h),t.value.rightColumnsWidth+=T.actualWidth});const x=h-t.value.leftColumnsWidth-t.value.rightColumnsWidth,k=C[p.value];k&&k(t,x),r.value=x}F(t),t.value=Object.assign({},t.value)}}return o.watch(()=>{var h;return(h=e.columnOption)==null?void 0:h.fitColumns},(h,_)=>{h!==_&&h&&N()}),o.watch(p,(h,_)=>{h!==_&&s.value&&N()}),{calculateColumnHeaders:F,calculateColumnsSize:N,calculateColumnsWidth:w}}const Hl=o.defineComponent({name:"FTreeGridDesign",props:Mo,emits:[],setup(e,t){var Q,ee;const n=o.ref(),r=0,i=((Q=e.rowOption)==null?void 0:Q.height)||28,a=o.ref(20),l=o.ref(e.columns),c=Tl(e),u=o.ref(),d=o.ref(),f=o.ref([]),s=o.ref(!1),p=o.ref(((ee=e.rowOption)==null?void 0:ee.wrapContent)||!1),m=o.inject("designer-host-service"),g=o.inject("design-item-context"),b=ql(g,m),v=xn(n,g,b);v.value.designerClass="f-utils-fill-flex-column";const y=fl(),C=pl(e),F=rl(e,new Map,y,C,c),w=Nl(e,F,c,f,t),S=o.computed(()=>F.dataView.value.length),{containerStyleObject:N}=Qa(e),h=el(e),{applyCommands:_}=h;_(l);const x=Za(e),{applyColumnSorter:k,columnContext:T,updateColumnRenderContext:V}=x,I=Ol(),E=tl(e,T),M=_l(e,t,w,c),B=Fl(e,t,c,M),O=gl(e),R=Sl(e,B,O),q=xl(e,B,C,c,O,R),L=hl(e,l,F,S,r,q),{getVisualData:X}=L,te=Vl(e,w),{sidebarWidth:ie}=te;f.value=X(0,S.value+r-1);const ue=ml(e,F,f,T,L,S,r,ie),{onWheel:D,dataGridWidth:ne,viewPortHeight:pe,viewPortWidth:oe,updateVisibleRowsOnLatestVisibleScope:A}=ue,Y=Wl(e,T,u,oe,E),{calculateColumnsSize:we}=Y,Ce=o.computed(()=>({"drag-container":!0,"fv-grid":!0,"fv-grid-bordered":e.showBorder,"fv-datagrid-strip":e.showStripe})),je=o.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":s.value,"fv-grid-wrap-content":p.value})),{renderGridHeader:De}=Al(g,e,x,ue,"tree-grid-column"),{renderHorizontalScrollbar:Be}=Ya(e,u,ue);function me(){var U,ge;const re=Math.ceil(u.value.clientHeight/i);re>a.value&&(a.value=re,A()),pe.value=((U=d.value)==null?void 0:U.clientHeight)||0,ne.value=((ge=u.value)==null?void 0:ge.clientWidth)||0,we()}o.onMounted(()=>{n.value.componentInstance=v,u.value&&(a.value=Math.max(Math.ceil(u.value.clientHeight/i),a.value),f.value=X(0,S.value+r-1),eo.useResizeObserver(u.value,me),we(),o.nextTick(()=>{u.value&&(ne.value=u.value.clientWidth),d.value&&(oe.value=d.value.clientWidth,pe.value=d.value.clientHeight)}))});function G(re){re&&(l.value=re,_(l),V(l.value),k(F,I),we())}return o.watch(()=>e.columns,re=>{G(re)}),o.watch(oe,()=>{u.value&&we()}),t.expose(v.value),()=>o.createVNode("div",{ref:n,class:Ce.value,style:N.value,onWheel:D,dragref:`${g.schema.id}-container`},[u.value&&De(),o.createVNode("div",{ref:u,class:je.value,onMouseover:()=>{s.value=!0},onMouseleave:()=>{s.value=!1}},[Be()])])}});Xt.register=(e,t,n,r)=>{e["tree-grid"]=Xt,t["tree-grid"]=$a,r["tree-grid"]={bindingResolver:La,selectionItemResolver:Aa,updateColumnsResolver:Wa}},Xt.registerDesigner=(e,t,n)=>{e["tree-grid"]=Hl,t["tree-grid"]=qa},Te.withInstall(Xt);const Ul=new Map([["appearance",ht]]);function zl(e,t,n){return t}Ue({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},onClick:{type:Function,default:()=>{}}},{$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},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},Ul,zl,{title:"step",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}});const Gl={class:{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},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},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},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:""}};class Me{constructor(t,n){this.x=t,this.y=n}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,n=null){if(this.isMouseEvent(t))return new Me(t.clientX,t.clientY);if(n===null||t.changedTouches.length===1)return new Me(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let r=0;r<t.changedTouches.length;r++)if(t.changedTouches[r].target===n)return new Me(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 n=new Me(0,0);if(window){const r=window.getComputedStyle(t);if(r){const i=parseInt(r.getPropertyValue("left"),10),a=parseInt(r.getPropertyValue("top"),10);n.x=isNaN(i)?0:i,n.y=isNaN(a)?0:a}return n}return null}static copy(t){return new Me(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 wt{constructor(t,n){this.width=t,this.height=n}static getCurrent(t){const n=new wt(0,0);if(window){const r=window.getComputedStyle(t);return r&&(n.width=parseInt(r.getPropertyValue("width"),10),n.height=parseInt(r.getPropertyValue("height"),10)),n}return null}static copy(t){return new wt(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function Xl(e,t){const n=o.ref(),r=o.ref(),i=o.ref(),a=o.ref(),l=o.ref(),c=o.ref(),u=o.ref(),d=o.ref(),f=o.ref(),s=o.ref(),p=o.ref(),m=o.ref(),g=o.ref(e.draggable),b=o.ref(!1);function v(){const O=r.value||document.body,R=window.getComputedStyle(O);if(!R||!n.value)return;const q=Me.getTransformInfo(n.value),L={};u.value&&(L.deltaL=n.value.offsetLeft-u.value.x,L.deltaT=n.value.offsetTop-u.value.y);const X=R.getPropertyValue("position");L.width=O.clientWidth,L.height=O.clientHeight,L.pr=parseInt(R.getPropertyValue("padding-right"),10),L.pb=parseInt(R.getPropertyValue("padding-bottom"),10),L.position=R.getPropertyValue("position"),X==="static"&&(O.style.position="relative"),L.translateX=q.x,L.translateY=q.y,s.value=L}function y(O){if(n.value){a.value=wt.getCurrent(n.value),l.value=Me.getCurrent(n.value),c.value=a.value?wt.copy(a.value):null,u.value=l.value?Me.copy(l.value):null,v();const R=O.target.getAttribute("type")||"";d.value={n:!!R.match(/n/),s:!!R.match(/s/),w:!!R.match(/w/),e:!!R.match(/e/)}}}function C(){var O,R,q,L;if(n.value){const X=n.value;d.value&&((d.value.n||d.value.s)&&((O=c.value)!=null&&O.height)&&(X.style.height=c.value.height+"px"),(d.value.w||d.value.e)&&((R=c.value)!=null&&R.width)&&(X.style.width=c.value.width+"px"),u.value&&((q=u.value)!=null&&q.x&&(X.style.left=u.value.x+"px"),(L=u.value)!=null&&L.y&&(X.style.top=u.value.y+"px")))}}function F(){const O=e.minHeight?e.minHeight:1,R=e.minWidth?e.minWidth:1;c.value&&u.value&&d.value&&a.value&&(c.value.height<O&&(c.value.height=O,d.value.n&&l.value&&(u.value.y=l.value.y+(a.value.height-O))),c.value.width<R&&(c.value.width=R,d.value.w&&l.value&&(u.value.x=l.value.x+(a.value.width-R))),e.maxHeight&&c.value.height>e.maxHeight&&(c.value.height=e.maxHeight,l.value&&d.value.n&&(u.value.y=l.value.y+(a.value.height-e.maxHeight))),e.maxWidth&&c.value.width>e.maxWidth&&(c.value.width=e.maxWidth,d.value.w&&l.value&&(u.value.x=l.value.x+(a.value.width-e.maxWidth))))}function w(){if(r.value){const O=s.value;if(u.value&&c.value&&d.value&&a.value){const R=O.width-O.pr-O.deltaL-O.translateX-u.value.x,q=O.height-O.pb-O.deltaT-O.translateY-u.value.y;d.value.n&&u.value.y+O.translateY<0&&l.value&&(u.value.y=-O.translateY,c.value.height=a.value.height+l.value.y+O.translateY),d.value.w&&u.value.x+O.translateX<0&&l.value&&(u.value.x=-O.translateX,c.value.width=a.value.width+l.value.x+O.translateX),c.value.width>R&&(c.value.width=R),c.value.height>q&&(c.value.height=q)}}}function S(O){if(!i.value||!a.value||!l.value||!d.value)return;O.subtract(i.value);const R=O.x,q=O.y;d.value.n?(u.value.y=l.value.y+q,c.value.height=a.value.height-q):d.value.s&&(c.value.height=a.value.height+q),d.value.e?c.value.width=a.value.width+R:d.value.w&&(c.value.width=a.value.width-R,u.value.x=l.value.x+R),w(),F(),C()}function N(O){if(!f.value)return;const R=Me.fromEvent(O);R&&S(R)}function h(){if(n.value){const{width:O,height:R,x:q,y:L}=n.value.getBoundingClientRect(),X=Me.getTransformInfo(n.value);return{size:{width:O,height:R},position:{x:q-X.x,y:L-X.y}}}return null}function _(O){if(n.value){const R=h();p.value=R}i.value=void 0,a.value=null,l.value=null,c.value=null,u.value=null,d.value=null,f.value=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",_)}function x(){document.addEventListener("mousemove",N),document.addEventListener("mouseup",_)}function k(O){O instanceof MouseEvent&&O.button===2||g.value&&(document.body.click(),O.stopPropagation(),O.preventDefault(),i.value=Me.fromEvent(O),f.value=O.target,y(O),x())}function T(O){return n.value=O,o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:R=>k(R)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:R=>k(R)},null)])}function V(O=!0){document.body.click();const R=r.value||document.body,q=wt.getCurrent(R),L=n.value;O&&L&&(m.value=h(),m.value.transform=L.style.transform),q&&L&&(c.value=q,L.style.height=c.value.height-14+"px",L.style.width=c.value.width-14+"px",L.style.left="7px",L.style.top="7px",L.style.transform="",p.value={size:c.value,position:{x:0,y:0}},g.value=!1,b.value=!0)}function I(){var O,R;if(document.body.click(),m.value){const q={width:m.value.size.width||0,height:m.value.size.height||0},L={x:(window.innerWidth-q.width)/2,y:(window.innerHeight-q.height)/2};(O=c.value)==null||O.set(q),(R=u.value)==null||R.set(L);const X=n.value;X.style.height=q.height+"px",X.style.width=q.width+"px",X.style.left=`${L.x}px`,X.style.top=`${L.y}px`,X.style.transform="",p.value={size:q,position:L},g.value=e.draggable,b.value=!1}}function E(){if(n.value){const O=wt.getCurrent(n.value);if(O){const{width:R,height:q}=O;n.value.style.left=`${(window.innerWidth-R)/2}px`,n.value.style.top=`${(window.innerHeight-q)/2}px`,n.value.style.transform=""}}}function M(){const O=()=>{b.value?V(!1):E(),document.body.click()};return window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)}}const B=M();return{renderResizeBar:T,boundingElement:r,resizedEventParam:p,maximize:V,restore:I,allowDrag:g,isMaximized:b,unWindowResizeHandle:B}}function Yl(e,t,n){const r=o.ref(),i=o.ref(e.draggable),a=o.ref(e.lockAxis),l=o.ref(),c=o.ref(),u=o.ref(!1),d=o.ref(new Me(0,0)),f=o.ref(new Me(0,0)),s=o.ref(new Me(0,0)),p=o.ref(new Me(0,0));o.watch(()=>n.value,h=>{l.value.style.cursor=h?"move":"default"});function m(h,_){if(_.tagName==="BUTTON")return!1;if(_===h)return!0;for(const x in _.children)if(Object.prototype.hasOwnProperty.call(_.children,x)&&m(h,_.children[x]))return!0;return!1}function g(){var k,T;let h=s.value.x+f.value.x,_=s.value.y+f.value.y;a.value==="x"?(h=((k=d.value)==null?void 0:k.x)||0,s.value.x=0):a.value==="y"&&(_=((T=d.value)==null?void 0:T.y)||0,s.value.y=0);const x=`translate3d(${Math.round(h)}px, ${Math.round(_)}px, 0px)`;r.value&&(r.value.style.transform=x),p.value.x=h,p.value.y=_}function b(){if(!c.value||!r.value)return null;const h=c.value.getBoundingClientRect(),_=r.value.getBoundingClientRect(),x={top:h.top<_.top,right:h.right>_.right,bottom:h.bottom>_.bottom,left:h.left<_.left};return x.top||(s.value.y-=_.top-h.top),x.bottom||(s.value.y-=_.bottom-h.bottom),x.right||(s.value.x-=_.right-h.right),x.left||(s.value.x-=_.left-h.left),g(),x}function v(h){h&&(d.value&&h.subtract(d.value),s.value.set(h),g(),b())}function y(h){u.value&&i.value&&(h.stopPropagation(),h.preventDefault(),v(Me.fromEvent(h,l.value)))}function C(){var h;u.value&&(u.value=!1,f.value.add(s.value),s.value.reset(),(h=r.value)==null||h.classList.remove("ng-dragging"),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",C))}function F(){!u.value&&l.value&&(u.value=!0,l.value.classList.add("ng-dragging"),document.addEventListener("mousemove",y),document.addEventListener("mouseup",C))}function w(){if(r.value){const h=Me.getTransformInfo(r.value);f.value.set(h);return}f.value.reset()}function S(h){if(!n.value||h instanceof MouseEvent&&h.button===2)return;const _=h.target||h.srcElement;l.value!==void 0&&_&&!m(_,l.value)||i.value!==!1&&(document.body.click(),h.stopPropagation(),h.preventDefault(),d.value=Me.fromEvent(h,r.value),w(),F())}function N(h,_,x){if(i.value&&_){if(h)l.value=h;else if(e.dragHandle){if(e.dragHandle instanceof HTMLElement)l.value=e.dragHandle;else if(typeof e.dragHandle=="string"){const k=_.querySelector(e.dragHandle);k&&(l.value=k)}}r.value=_,c.value=x,l.value?(l.value.classList.add("ng-draggable"),l.value.addEventListener("mousedown",S)):i.value=!1}}return{registerDraggle:N,resetTranslate:w}}function Po(e,t){if(e){const n=r=>{r.key.toLowerCase()===e.toLowerCase()&&t({event:r,key:e})};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}}}function Jl(e,t){const n=o.ref(e.enableEsc);let r=null;return n.value?(r=Po("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:r}):null}function Ql(e,t){const n=o.ref(e.enableEnter);let r=null;return n.value?(r=Po("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:r}):null}const Mt=o.defineComponent({name:"FModal",props:Gl,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter"],setup(e,t){const n=o.ref(e.width||300),r=o.ref(e.height||200),i=o.ref(e.modelValue),a=o.ref(""),l=o.ref(e.class),c=o.ref(e.fitContent),u=o.ref(e.showHeader),d=o.ref(""),f=o.ref(e.showCloseButton),s=o.ref(e.showMaxButton),p=o.ref(!1),m=o.ref(e.dialogType),g=o.ref(e.src),b=o.ref(""),v=o.ref(e.showButtons),y=o.ref(e.title),C=o.ref(e.resizeable),F=o.ref(e.containment||null),w=o.ref();function S(U,ge){i.value=!1,t.emit("update:modelValue",!1),ge!=null&&t.emit(ge?"accept":"cancel"),t.emit("closed",U)}const N=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:U=>{S(U,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:U=>{S(U,!0)}}],h=o.ref(e.buttons&&e.buttons.length?e.buttons:N),_=o.computed(()=>!!d.value),x=o.computed(()=>!!v.value&&!!h.value),k=o.ref(),T=o.ref(),V=o.ref(!1),{renderResizeBar:I,maximize:E,restore:M,boundingElement:B,resizedEventParam:O,allowDrag:R,unWindowResizeHandle:q}=Xl(e),{registerDraggle:L}=Yl(e,t,R);function X(){const U=document.querySelectorAll(".farris-modal").length;(!U||U-1<=0)&&document.body.classList.remove("modal-open"),w.value&&w.value.classList.remove("show")}o.watch(()=>e.title,(U,ge)=>{U!==ge&&(y.value=U)}),o.watch(()=>e.modelValue,(U,ge)=>{U!==ge&&(i.value=U,U||X())}),o.watch(()=>e.showHeader,(U,ge)=>{U!==ge&&(u.value=U)}),o.watch(()=>e.showButtons,(U,ge)=>{U!==ge&&(v.value=U)}),o.watch(()=>O.value,(U,ge)=>{const Pe=U||{},Xe=ge||{};JSON.stringify(Pe)!==JSON.stringify(Xe)&&t.emit("resize",{newSize:U,oldSize:ge})});const te=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),ie=o.computed(()=>{const U={modal:!0,"farris-modal":!0,fade:!0};return U["f-modal-fitContent"]=!!c.value,U.show=!!te.value,U}),ue=o.computed(()=>{var Pe;const U={"modal-dialog":!0},ge=(Pe=l.value)==null?void 0:Pe.split(" ");return ge==null||ge.reduce((Xe,lt)=>(Xe[lt]=!0,Xe),U),U}),D=o.computed(()=>({position:"absolute",top:`${(window.innerHeight-r.value)/2}px`,left:`${(window.innerWidth-n.value)/2}px`,width:`${n.value}px`,height:c.value?"auto":`${r.value}px`})),ne=o.computed(()=>({"modal-content":!0,"modal-content-has-header":u.value})),pe=o.computed(()=>{const U={display:u.value?"":"none"};return U["pointer-events"]=R.value?"auto":"none",U}),oe=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:V.value})),A=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":m.value==="iframe"}));function Y(){return{}}const we=o.computed(()=>{const U={textAlgin:b.value},ge=Y();return Object.assign(U,ge)});function Ce(U){if(U.stopPropagation(),V.value){V.value=!1,M();return}E(),V.value=!0}async function je(U,ge){U.handle&&await U.handle(ge,U)&&t.emit("closed",ge)}function De(U){U.width&&(n.value=U.width),U.height&&(r.value=U.height),U.buttons&&(h.value=U.buttons),U.title&&(y.value=U.title)}let Be=null,me=null;o.onMounted(()=>{T.value&&!F.value&&(F.value=T.value.parentElement,B.value=F.value,L(k.value,T.value,B.value)),te.value&&document.body.classList.add("modal-open"),Be=Jl(e,t),me=Ql(e,t)}),o.onUnmounted(()=>{q&&q(),Be&&Be.remove(),me&&me.remove()}),t.expose({modalElementRef:T,updateModalOptions:De,close:S,maxDialog:Ce});function G(){return o.createVNode("ul",null,[p.value&&o.createVNode("li",{class:"f-btn-icon f-bare"},[o.createVNode("span",{class:"f-icon modal_minimize"},null)]),s.value&&o.createVNode("li",{onClick:Ce,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:oe.value},null)]),f.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:U=>S(U,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function Q(){return o.createVNode("div",{class:"modal-footer",style:we.value},[h.value&&h.value.map(U=>o.createVNode("button",{name:U.name,type:"button",class:U.class+(U.iconClass?" btn-icontext":""),onClick:ge=>{je(U,ge)}},[!!U.iconClass&&o.createVNode("i",{class:U.iconClass},null),U.text]))])}function ee(){return o.createVNode("div",{ref:k,class:"modal-header",style:pe.value},[o.createVNode("div",{class:"modal-title"},[_.value&&o.createVNode("span",{class:d.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[y.value])]),o.createVNode("div",{class:"actions"},[G()])])}function re(U){U.stopPropagation()}return()=>o.createVNode(o.Teleport,{to:"body"},{default:()=>[te.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>{var U,ge;return[o.createVNode("div",{class:ie.value,style:"display: block",ref:w,onClick:re},[o.createVNode("div",{id:a.value,class:ue.value,style:D.value,ref:T},[o.createVNode("div",{class:ne.value},[u.value&&ee(),o.createVNode("div",{class:A.value},[(ge=(U=t.slots).default)==null?void 0:ge.call(U),m.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:g.value},null)]),x.value&&Q()]),!c.value&&C.value&&T.value&&!V.value&&I(T.value)])])]}})]})}});function Ro(e){if(e.content&&e.content.render)return e.content.render;if(e.render&&typeof e.render=="function")return e.render}function Kl(e){const t=document.createElement("div");t.style.display="contents";const n=o.createApp({setup(r,i){o.onUnmounted(()=>{document.body.removeChild(t)});const a=o.ref(),l=o.ref(e.class||""),c=o.ref(!!e.showButtons),u=o.ref(!!e.showHeader),d=o.ref(e.showCloseButton==null?!0:e.showCloseButton),f=o.ref(!0),s=o.ref(e.title||""),p=e.acceptCallback||(()=>{}),m=e.rejectCallback||(()=>{}),g=e.closedCallback||(C=>{}),b=e.resizeHandle||(C=>{}),v=Ro(e),y=C=>{f.value=!1,n.unmount(),g(C)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(Mt,{ref:a,class:l.value,modelValue:f.value,"onUpdate:modelValue":C=>f.value=C,title:s.value,width:e.width,height:e.height,buttons:e.buttons,"show-header":u.value,"show-buttons":c.value,"show-close-button":d.value,"show-max-button":!1,onAccept:p,onCancel:m,fitContent:e.fitContent==null?!0:e.fitContent,onClosed:y,onResize:b},{default:()=>[v&&v(n)]})}});return document.body.appendChild(t),n.mount(t),n}class jo{constructor(t){z(this,"appContext",null);z(this,"modalRef",o.ref());z(this,"activeModalIndex",o.ref(0));z(this,"modalRefs",{});z(this,"isUseEscCloseModal",o.ref(!1));z(this,"activeModalInstance",o.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(t,n){const{width:r,height:i}={width:window.innerWidth,height:window.innerHeight};return r<t&&(t=r),i<n&&(n=i),{width:t,height:n}}static show(t){const n=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return Kl(n)}open(t){const n=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const r=o.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),i=o.ref(!0),a=r.value.acceptCallback||(()=>{}),l=r.value.rejectCallback||(()=>{}),c=r.value.closedCallback||((w,S)=>{}),u=r.value.resizeHandle||(w=>{});let d;const f=Ro(r.value),s=w=>{var N;i.value=!1;const S=(N=w==null?void 0:w.target)==null?void 0:N.classList.contains("modal_close");c(w,this.isUseEscCloseModal.value?"esc":S?"icon":"button")},p=w=>{s(w),d&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,n),d=null,this.modalRef.value=null,this.modalRefs){const S=Object.keys(this.modalRefs).map(N=>Number(N));S.length>0?this.activeModalIndex.value=Math.max(...S):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},m=w=>{var S;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((S=this.activeModalInstance.value)==null||S.close(w==null?void 0:w.event))},{width:g,height:b}=r.value,v=this.adaptToWindow(g||500,b||320);Object.assign(r.value,v);const y=()=>o.createVNode(Mt,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":w=>i.value=w},r.value,{onAccept:a,onCancel:l,onClosed:p,onResize:u,onEsc:m}),{default:()=>[f&&f(this.app)]});return d=(w=>{const S=o.h(y,w);return S.appContext=this.appContext,o.render(S,n),S})({...r.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:w=>{r.value={...r.value,...w},d&&o.render(o.cloneVNode(d,{...r}),n)},destroy:p,modalRef:this.activeModalInstance}}}const Do=Symbol("FModalService");Mt.install=e=>{e.component(Mt.name,Mt);const t=new jo(e);e.provide(Do,t),e.provide("FModalService",t)};var Vn=(e=>(e.Form="Form",e.Variable="Variable",e))(Vn||{});function $o(e){const t=e.nativeElement?e.nativeElement:e;return t.classList!==void 0&&t.classList!==null?t:null}function Ao(e,t){if(t===void 0)return;const n=$o(e);n&&n.classList.remove(t)}function kn(e,t){if(t===void 0)return;const n=$o(e);n&&n.classList.add(t)}const En=[{size:"sm",width:576},{size:"md",width:768},{size:"lg",width:888},{size:"xl",width:1200},{size:"el",width:1690}];function Lo(e){e.resizeObserver&&(e.resizeObserver.disconnect(),e.sharedObject=null)}function qo(e,t,n=0){const r=[];if(!t)return;const i=n||t.getBoundingClientRect().width,a=parseFloat(i);for(let l=0;l<En.length;l++)En[l].width<=a&&r.push(En[l].size);if(e.className.join(",")!==r.join(",")){if(e.className.length-r.length>0)for(let c=r.length;c<e.className.length;c++)Ao(t,"f-area-response--"+e.className[c]);else for(let c=e.className.length;c<r.length;c++)kn(t,"f-area-response--"+r[c]);e.className=[...r]}}function Zl(e,t){e.enable&&e.autoWidth?e.resizeObserver||(e.resizeObserver=new ResizeObserver(n=>{if(!n||n.length<1||!n[0].contentRect)return;const r=n[0].contentRect;Math.abs(parseInt(r.width+"")-e.width)>e.threshold&&(qo(e,t,r.width),e.width=parseInt(r.width+""))}),e.resizeObserver.observe(t)):Lo(e)}function Wo(e,t){if(e.enable)kn(t,"f-area-response"),qo(e,t);else{Ao(t,"f-area-response");for(let n=e.className.length;n>0;n--)kn(t,"f-area-response--"+e.className[n]);e.className=[]}Zl(e,t)}function Ho(e,t){t.value&&Object.prototype.hasOwnProperty.call(t.value,"enable")&&(e.enable=t.value.enable),t.value&&Object.prototype.hasOwnProperty.call(t.value,"autoWidth")&&(e.autoWidth=t.value.autoWidth)}const es={mounted:(e,t,n)=>{n.sharedObject={className:[],resizeObserver:null,enable:!0,autoWidth:!0,threshold:10,width:0},Ho(n.sharedObject,t),Wo(n.sharedObject,e)},updated:function(e,t,n,r){n.sharedObject=r.sharedObject,Ho(n.sharedObject,t),Wo(n.sharedObject,e)},beforeUnmount(e,t,n){Lo(n.sharedObject)}},ts={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""}},Uo=o.defineComponent({name:"FDynamicFormLabel",props:ts,emits:[],setup(e,t){const n=o.ref(e.title||e.text),r=o.ref(e.required),i=o.ref(e.text),a=o.ref(e.valid),l=o.ref(e.inValidTip);o.watch(()=>e.text,()=>{i.value=e.text}),o.watch(()=>e.required,(d,f)=>{d!==f&&(r.value=d)}),o.watch([()=>e.valid,()=>e.inValidTip],([d,f])=>{a.value=d,l.value=f});const c=o.computed(()=>a.value?n.value:l.value),u=o.computed(()=>a.value?"":"color:red");return()=>i.value&&o.createVNode("label",{class:"col-form-label",title:c.value,style:u.value},[!a.value&&o.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:l.value},null),r.value&&o.createVNode("span",{class:"farris-label-info text-danger"},[o.createTextVNode("*")]),o.createVNode("span",{class:"farris-label-text"},[i.value])])}}),le={},se={},ce={},de={};let zo=!1;function ns(){zo||(zo=!0,Zr.register(le,se,ce,de),Kr.register(le,se,ce,de),no.register(le,se,ce,de),ei.register(le,se,ce,de),ti.register(le,se,ce,de),ni.register(le,se,ce,de),Et.register(le,se,ce,de),pn.register(le,se,ce,de),$i.register(le,se,ce,de),Oi.register(le,se,ce,de),ri.register(le,se,ce,de),oi.register(le,se,ce,de),ii.register(le,se,ce,de),oo.register(le,se,ce,de),ai.register(le,se,ce,de),un.register(le,se,ce,de),li.register(le,se,ce,de),Yr.register(le,se,ce,de),Ai.register(le,se,ce,de),si.register(le,se,ce,de),ro.register(le,se,ce,de),ci.register(le,se,ce,de),di.register(le,se,ce,de),ui.register(le,se,ce,de),fi.register(le,se,ce,de),Li.register(le,se,ce,de),pi.register(le,se,ce,de),hi.register(le,se,ce,de),mi.register(le,se,ce,de),Gr.register(le,se,ce,de),gi.register(le,se,ce,de),yi.register(le,se,ce,de),Jr.register(le,se,ce,de),vi.register(le,se,ce,de),bi.register(le,se,ce,de),io.register(le,se,ce,de),Ci.register(le,se,ce,de),Si.register(le,se,ce,de),xi.register(le,se,ce,de),wi.register(le,se,ce,de),qi.register(le,se,ce),Qr.register(le,se,ce,de),Fi.register(le,se,ce,de),Ti.register(le,se,ce,de),_i.register(le,se,ce,de),Ni.register(le,se,ce,de),Vi.register(le,se,ce,de),zr.register(le,se,ce,de),to.register(le,se,ce,de),ki.register(le,se,ce,de),Ei.register(le,se,ce,de),fn.register(le,se,ce,de),ao.register(le,se,ce,de),Mi.register(le,se,ce,de),Ii.register(le,se,ce,de),Bi.register(le,se,ce,de),Pi.register(le,se,ce,de),Ri.register(le,se,ce,de),ji.register(le,se,ce,de),Wi.register(le,se,ce,de))}function os(){ns();function e(i){const a=le[i];if(!a)throw new Error(`Could not find the editor of type '${i}'`);return a}function t(i,a){const l=se[i];return l?l(a):{}}function n(i){switch(i){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"date-picker":return"onDatePicked";case"date-range":return"";case"datetime-picker":return"";case"datetime-range":return"";case"month-picker":return"";case"month-range":return"";case"year-picker":return"";case"year-range":return"";case"input-group":return"onChange";case"lookup":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"response-layout-editor-setting":return"onChange";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":return"onChange";case"item-collection-editor":return"onChange";case"response-form-layout-setting":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onValueChange";case"query-solution-config":case"solution-preset":return"onFieldsChanged"}}function r(i){switch(i){case"combo-list":case"input-group":case"textarea":return"onClear"}}return{resolveEditorProps:t,resolveEditorType:e,getChangeFunctionName:n,getClearFunctionName:r}}const Go=o.defineComponent({name:"FDynamicFormGroup",props:Ht,emits:["change","update:modelValue"],setup(e,t){var w;const n=o.ref(e.id),r=o.ref(e.customClass),i=o.ref(e.editor),a=o.ref(e.label),l=o.ref(e.modelValue),c=o.ref(e.readonly),u=o.ref(((w=e.editor)==null?void 0:w.required)||e.required),d=o.ref(e.showLabel),f=o.ref(e.visible);o.ref(e.type);const s=o.ref(),{resolveEditorProps:p,resolveEditorType:m,getChangeFunctionName:g,getClearFunctionName:b}=os(),v=o.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":c.value}));function y(S,N){l.value=N!==void 0?N:S,t.emit("update:modelValue",l.value),t.emit("change",l.value)}function C(){t.emit("update:modelValue","")}const F=o.computed(()=>{const S=i.value.type||"input-group",N=m(S),h=p(S,i.value),_=g(S),x=b(i.value.type);return x&&(h[x]=C),h[_]=y,(h.id==null||h.id==="")&&(h.id=n.value),S==="number-range"&&i.value.onBeginValueChange&&typeof i.value.onBeginValueChange=="function"?(i.value.onBeginValueChange&&typeof i.value.onBeginValueChange=="function"&&(h.onBeginValueChange=i.value.onBeginValueChange),i.value.onEndValueChange&&typeof i.value.onEndValueChange=="function"&&(h.onEndValueChange=i.value.onEndValueChange)):S==="lookup"&&i.value["onUpdate:idValue"]&&typeof i.value["onUpdate:idValue"]=="function"&&(h["onUpdate:idValue"]=i.value["onUpdate:idValue"]),()=>o.createVNode(N,o.mergeProps({ref:s},h,{modelValue:l.value,"onUpdate:modelValue":k=>l.value=k}),t.slots)});return o.watch([()=>e.id,()=>e.customClass,()=>e.editor,()=>e.label,()=>e.modelValue,()=>e.readonly,()=>e.required,()=>e.showLabel,()=>e.visible],([S,N,h,_,x,k,T,V,I])=>{var E;n.value=S,r.value=N,i.value=h,a.value=_,l.value=x,c.value=k,u.value=((E=i.value)==null?void 0:E.required)||T,d.value=V,f.value=I}),t.expose({editorRef:s}),()=>f.value&&o.createVNode("div",{id:`${n.value}-input-group`,class:r.value,style:e.customStyle},[o.createVNode("div",{class:"farris-group-wrap"},[o.createVNode("div",{class:v.value},[d.value&&o.createVNode(Uo,{id:`${n.value}-lable`,required:u.value,text:a.value,title:a.value},null),o.createVNode("div",{class:"farris-input-wrap"},[F.value()])])])])}}),rs=new Map([["appearance",ht]]);function is(e,t,n){return t}const as={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/input-group.schema.json",title:"input-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"input-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},labelWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabIndex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"enum",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""},addonDisabled:{description:"",type:"boolean",default:!1},addonContent:{description:"",type:"string",default:""},autoHeight:{description:"",type:"boolean",default:!1},enableAddon:{description:"",type:"boolean",default:!1},addonType:{description:"",type:"string",enum:["button","static"],default:"button"},enableClear:{description:"",type:"boolean",default:!0},enableViewPassword:{description:"",type:"boolean",default:!1},inputType:{description:"",type:"string",enum:["input","password","text"],default:"input"},maxHeight:{description:"",type:"number",default:500},popUp:{description:"",type:"object",properties:{footerButtons:{type:"array",default:[]},height:{type:"number",default:600},dataMapping:{type:"object"},contents:{type:"array",default:[]},showMaxButton:{type:"boolean",default:!0},showCloseButton:{type:"boolean",default:!0},showFooter:{type:"boolean",default:!0},title:{type:"string",default:""},width:{type:"number",default:800}}},showButtonWhenDisabled:{description:"",type:"boolean",default:!1},onClear:{description:"",type:"string",default:""}},required:["type"],ignore:["id","appearance","binding","visible"]},Xo={id:{Type:String,default:""},autocomplete:{Type:String,default:"off"},customClass:{Type:String,default:""},disabled:{Type:Boolean,default:!1},editable:{Type:Boolean,default:!0},enableClear:{Type:Boolean,default:!0},enableTitle:{Type:Boolean,default:!0},enableViewPassword:{Type:Boolean,default:!0},forcePlaceholder:{Type:Boolean,default:!1},groupText:{Type:String,default:""},type:{Type:String,default:"text"},max:{type:[Number,String]},min:{type:[Number,String]},maxLength:{Type:Number||void 0,default:void 0},minLength:{Type:Number||void 0,default:void 0},modelValue:{Type:String||Boolean,default:""},showBorder:{Type:Boolean,default:!0},step:{Type:Number,default:1},placeholder:{Type:String,default:""},precision:{Type:Number,default:0},readonly:{Type:Boolean,default:!1},showButtonWhenDisabled:{Type:Boolean,default:!1},tabIndex:{Type:Number||void 0,default:void 0},textAlign:{Type:String,default:"left"},useExtendInfo:{Type:Boolean,default:!1},extendInfo:{Type:String,default:""},value:{Type:String,default:""},autoHeight:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},rows:{type:Number,default:2},showCount:{type:Boolean,default:!1},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},updateOn:{type:String,default:"blur"}};Ue(Xo,as,rs,is);function ls(e,t){const n=o.ref(e.groupText),r=o.computed(()=>e.showButtonWhenDisabled&&(e.readonly||e.disabled)),i=o.computed(()=>e.enableClear||!!e.groupText);return{appendedButtonClass:o.computed(()=>({"input-group-append":!0,"append-force-show":r.value})),appendedContent:n,shouldShowAppendedButton:i}}function ss(e,t,n,r){const{appendedContent:i}=r,a=o.ref(e.enableViewPassword),l=o.computed(()=>e.type==="password"),c='<span class="f-icon f-icon-eye" style="color: rgb(56, 143, 255);"></span>',u='<span class="f-icon f-icon-eye"></span>',d=o.ref(!1);o.watch(()=>[e.readonly,e.disabled],([p,m])=>{l.value&&(n.value=p||m?"password":n.value,i.value=p||m?u:i.value)});function f(){return d.value=!d.value,n.value=d.value?"text":"password",i.value=d.value?c:u,!1}function s(){n.value=l.value?"password":"text",i.value=l.value?a.value?u:"":i.value}return s(),{isPassword:l,onClickAppendedButton:f}}function cs(e,t,n,r,i){const{appendedButtonClass:a,appendedContent:l}=n,c=o.computed(()=>e.showButtonWhenDisabled&&(!e.editable||!e.readonly)&&!e.disabled),u=o.computed(()=>l.value&&!t.slots.groupTextTemplate),d=o.computed(()=>!!t.slots.groupTextTemplate),{clearButtonClass:f,clearButtonStyle:s,onClearValue:p,shouldShowClearButton:m}=r;function g(){return o.createVNode("span",{id:"clearIcon",class:f.value,style:s.value,onClick:h=>p(h)},[o.createVNode("i",{class:"f-icon modal_close"},null)])}function b(h){t.emit("iconMouseEnter",h)}function v(h){t.emit("iconMouseLeave",h)}function y(h){c.value&&t.emit("clickHandle",{originalEvent:h}),h.stopPropagation()}const C=e.type==="password"?i.onClickAppendedButton:y;function F(){return o.createVNode("span",{class:"input-group-text",onMouseenter:h=>b(h),onMouseleave:h=>v(h),innerHTML:l.value,onClick:h=>C(h)},null)}function w(){return t.slots.groupTextTemplate&&t.slots.groupTextTemplate()}function S(){return u.value?F:d.value?w:""}const N=S();return()=>o.createVNode("div",{class:a.value},[m.value&&g(),N&&N()])}const Vt=class Vt{static getEditorTypesByMDataType(t){const n=Vt.fieldControlTypeMapping[t];return n||[{key:"",value:""}]}static getAllInputTypes(){const t=[];for(const n in Vt.fieldControlTypeMapping)Vt.fieldControlTypeMapping[n].forEach(r=>{t.find(i=>i.key===r.key&&i.value===r.value)||t.push({key:r.key,value:r.value})});return t}static mappingDomPropAndSchemaProp(t){var i;const n=(i=t.editor)==null?void 0:i.type;if(!n)return[];const r=[];switch(r.push({domField:"editor.required",schemaField:"require"}),r.push({domField:"editor.readonly",schemaField:"readonly"}),n){case ae["data-grid-column"].type:case ae["tree-grid-column"].type:{r.push({domField:"title",schemaField:"name"});break}default:r.push({domField:"label",schemaField:"name"})}return(n===ae["input-group"].type||n===ae.textarea.type||n===ae["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),n===ae["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(n===ae["combo-list"].type||n===ae["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),n===ae["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),n===ae["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),n===ae.lookup.type&&(r.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),r.push({domField:"editor.valueField",schemaField:"editor.valueField"}),r.push({domField:"editor.textField",schemaField:"editor.textField"}),r.push({domField:"editor.displayType",schemaField:"editor.displayType"}),r.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),r.push({domField:"editor.helpId",schemaField:"editor.helpId"})),r.push({domField:"path",schemaField:"bindingPath"}),r.push({domField:"binding.path",schemaField:"bindingField"}),r.push({domField:"binding.fullPath",schemaField:"path"}),(n===ae["data-grid-column"].type||n===ae["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};z(Vt,"fieldControlTypeMapping",{String:[{key:ae["input-group"].type,value:ae["input-group"].name},{key:ae.lookup.type,value:ae.lookup.name},{key:ae["date-picker"].type,value:ae["date-picker"].name},{key:ae["check-group"].type,value:ae["check-group"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name},{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae.textarea.type,value:ae.textarea.name}],Text:[{key:ae.textarea.type,value:ae.textarea.name},{key:ae.lookup.type,value:ae.lookup.name}],Decimal:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Integer:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Number:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],BigNumber:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Date:[{key:ae["date-picker"].type,value:ae["date-picker"].name}],DateTime:[{key:ae["date-picker"].type,value:ae["date-picker"].name}],Boolean:[{key:ae.switch.type,value:ae.switch.name},{key:ae["check-box"].type,value:ae["check-box"].name}],Enum:[{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name}],Object:[{key:ae.lookup.type,value:ae.lookup.name},{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name}]});let Yt=Vt;class Yo extends _o{constructor(n,r){super(n,r);z(this,"responseLayoutEditorFunction");this.responseLayoutEditorFunction=Na(this.formSchemaUtils)}getPropertyConfig(n,r){return this.propertyConfig.categories.basic=this.getBasicProperties(n,r),this.propertyConfig.categories.appearance=this.getAppearanceProperties(n,r),this.propertyConfig.categories.editor=this.getEditorProperties(n),this.propertyConfig}getBasicProperties(n,r){var a;const i=this;return this.setDesignViewModelField(n),{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",refreshPanelAfterChanged:!0,$converter:"/converter/change-editor.converter",editor:{type:"combo-list",textField:"value",valueField:"key",editable:!1,data:i.designViewModelField?Yt.getEditorTypesByMDataType((a=i.designViewModelField.type)==null?void 0:a.name):Yt.getAllInputTypes()}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:n,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"},refreshPanelAfterChanged:!0}},setPropertyRelates(l,c){if(l)switch(l&&l.propertyID){case"type":{i.changeControlType(n,l,r);break}case"label":{l.needRefreshControlTree=!0;break}}}}}getAppearanceProperties(n,r){const i=this;return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的内联样式",$converter:"/converter/appearance.converter"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",initialState:i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(n,i.componentId)}}},setPropertyRelates(a,l){if(a)switch(a&&a.propertyID){case"responseLayout":i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(a.propertyValue,i.componentId||n.id),i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId),i.updateElementByParentContainer(n.id,r),delete n.responseLayout;break;case"class":i.updateUnifiedLayoutAfterControlChanged(a.propertyValue,n.id,this.componentId),i.updateElementByParentContainer(n.id,r);break}}}}getEditorProperties(n){return this.getComponentConfig(n)}changeControlType(n,r,i){var f,s,p,m;const a=r.propertyValue,l=i&&i.parent&&i.parent.schema;if(!l)return;const c=l.contents.findIndex(g=>g.id===n.id),u=l.contents[c];let d;this.designViewModelField&&(this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,{editor:{$type:a},name:this.designViewModelField.name,require:this.designViewModelField.require,readonly:this.designViewModelField.readonly},!1),d=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)),d||(d=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(d,{id:u.id,appearance:u.appearance,size:u.size,label:u.label,binding:u.binding,visible:u.visible}),Object.assign(d.editor,{isTextArea:d.isTextArea&&u.isTextArea,placeholder:(f=u.editor)==null?void 0:f.placeholder,holdPlace:(s=u.editor)==null?void 0:s.holdPlace,readonly:(p=u.editor)==null?void 0:p.readonly,required:(m=u.editor)==null?void 0:m.required}),l.contents.splice(c,1),l.contents.splice(c,0,d),i.schema=Object.assign(u,d),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(g=>g.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(g=>g.classList.remove("dgComponentFocused")),Ut.value++}getComponentConfig(n,r={},i={},a){const l=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter"},r),c=Object.assign({readonly:{description:"",title:"只读",type:"boolean",editor:{enableClear:!0,editable:!0}},disabled:{description:"",title:"禁用",type:"boolean",visible:!1},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}},i);return{...l,properties:{...c},setPropertyRelates:a}}updateUnifiedLayoutAfterControlChanged(n,r,i){const a=n.split(" ");let l=a.find(s=>/^col-([1-9]|10|11|12)$/.test(s)),c=a.find(s=>/^col-md-([1-9]|10|11|12)$/.test(s)),u=a.find(s=>/^col-xl-([1-9]|10|11|12)$/.test(s)),d=a.find(s=>/^col-el-([1-9]|10|11|12)$/.test(s));l=l||"col-12",c=c||"col-md-"+l.replace("col-",""),u=u||"col-xl-"+c.replace("col-md-",""),d=d||"col-el-"+u.replace("col-xl-","");const f={id:r,columnInSM:parseInt(l.replace("col-",""),10),columnInMD:parseInt(c.replace("col-md-",""),10),columnInLG:parseInt(u.replace("col-xl-",""),10),columnInEL:parseInt(d.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(i,f)}updateUnifiedLayoutAfterResponseLayoutChanged(n,r){const{formNode:i}=this.responseLayoutEditorFunction.checkCanFindFormNode(n);if(!i||!i.unifiedLayout)return;const a=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i,a,1),r){const g=a.find(b=>b.id===r.id);Object.assign(g||{},r)}const l=a.map(g=>g.columnInSM),c=a.map(g=>g.columnInMD),u=a.map(g=>g.columnInLG),d=a.map(g=>g.columnInEL),f=this.checkIsUniqueColumn(l)?l[0]:null,s=this.checkIsUniqueColumn(c)?c[0]:null,p=this.checkIsUniqueColumn(u)?u[0]:null,m=this.checkIsUniqueColumn(d)?d[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:f,uniqueColClassInMD:s,uniqueColClassInLG:p,uniqueColClassInEL:m})}checkIsUniqueColumn(n){const r=new Set(n);return Array.from(r).length===1}getItemCollectionEditor(n,r,i){return r=r||"value",i=i||"name",{editor:{columns:[{field:r,title:"值",dataType:"string"},{field:i,title:"名称",dataType:"string"},{field:"disabled",title:"禁用",visible:!1,dataType:"boolean",editor:{type:"switch"}}],type:"item-collection-editor",valueField:r,nameField:i,requiredFields:[r,i],uniqueFields:[r,i],readonly:this.checkEnumDataReadonly(n)}}}checkEnumDataReadonly(n){return!n.binding||n.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===Te.FormSchemaEntityFieldType$Type.EnumType)}}class us extends Yo{constructor(t,n){super(t,n)}}function ds(e,t){const n=e.schema;function r(i,a){return new us(i,t).getPropertyConfig(n,a)}return{getPropsConfig:r}}const fs=o.defineComponent({name:"FInputGroupDesign",props:Xo,emits:["updateExtendInfo","clear","valueChange","clickHandle","blurHandle","focusHandle","enterHandle","iconMouseEnter","iconMouseLeave","keyupHandle","keydownHandle","inputClick"],setup(e,t){const n=o.ref(e.modelValue),r=o.ref(e.modelValue),i=Te.useTextBoxDesign(e,t,n,r),{inputGroupClass:a,inputType:l,inputGroupStyle:c}=i,u=ls(e),{shouldShowAppendedButton:d}=u,f=Te.useClear(e,t,i),{onMouseEnter:s,onMouseLeave:p}=f,m=ss(e,t,l,u),g=o.ref(),b=o.inject("designer-host-service"),v=o.inject("design-item-context"),y=ds(v,b),C=dn.useDesignerComponent(g,v,y);o.onMounted(()=>{g.value.componentInstance=C}),t.expose(C.value);const F=cs(e,t,u,f,m),w=o.ref();return()=>o.createVNode("div",{id:"inputGroup",ref:g,class:a.value,style:c.value,onMouseenter:s,onMouseleave:p},[o.createVNode("input",{ref:w,class:"form-control",readonly:!0,placeholder:e.placeholder},null),d.value&&F()])}});function ps(){function e(i,a){const l=Bo[i];return l?l(a):{}}function t(i){return Oo[i]||fs}function n(i){}function r(i){}return{getChangeFunctionName:n,getClearFunctionName:r,resolveEditorProps:e,resolveEditorType:t}}const ms={width:{type:String,default:"300px"},height:{type:Number,default:10},isWidePanel:{type:Boolean,default:!1},enableSearch:{type:Boolean,default:!0},mode:{type:String,default:"panel"},isPersitOpenState:{type:Boolean,default:!1},isShowPanel:{type:Boolean,default:!1},propertyName:{type:String,default:""},propertyConfig:{type:Array},propertyData:{type:Object,default:{}},showCloseBtn:{type:Boolean,default:!1},selectedTabId:{type:String,default:""},isWhiteTheme:{type:Boolean,default:!0},schema:{type:Object,default:{}},propertyChanged:{type:Function}},hs={category:{type:Object,default:{}},categoryKey:{type:String},propertyData:{type:Object,default:{}},valueChanged:{type:Function},triggerRefreshPanel:{type:Function}},gs={elementConfig:{type:Object,default:{}},category:{type:Object,default:{}}},ys=o.defineComponent({name:"FPropertyPanelItem",props:gs,emits:["propertyChange","triggerRefreshPanel"],setup(e,t){var f;const n=o.ref((f=e.category)==null?void 0:f.categoryId),r=o.ref(e.elementConfig.propertyID),i=o.ref(e.elementConfig.propertyName);o.ref(e.elementConfig.editor);const a=o.ref(e.elementConfig.propertyValue),l=o.computed(()=>{const s=e.elementConfig.visible;return{"farris-group-wrap":!0,"property-item":!0,"d-none":!(typeof s=="boolean"?s:s===void 0?!0:s())}});o.watch(()=>{var s;return(s=e.elementConfig)==null?void 0:s.propertyValue},s=>{a.value=s}),o.watch(()=>{var s;return(s=e.elementConfig)==null?void 0:s.propertyName},s=>{i.value=s});function c(s){e.elementConfig.propertyValue=s;const p={propertyID:e.elementConfig.propertyID,propertyValue:s};t.emit("propertyChange",p),e.elementConfig.refreshPanelAfterChanged&&t.emit("triggerRefreshPanel")}const u=e.elementConfig.description?`<div style="color: gray; "> 描述 :${e.elementConfig.description}</div>`:"",d=o.reactive({content:`
7
2
  <div>
8
3
  <div style="color: black; ">${e.elementConfig.propertyName}</div>
9
4
  <div style="color: gray; ">ID:${e.elementConfig.propertyID}</div>
10
5
  ${u}
11
- </div>`,placement:"left"});return()=>o.createVNode("div",{class:s.value},[e.elementConfig.propertyName&&o.withDirectives(o.createVNode("label",{class:`col-form-label ${n.value}-${r.value}`},[o.createVNode("span",{class:"farris-label-text"},[i.value])]),[[o.resolveDirective("tooltip"),d]]),o.createVNode(Uo,{id:r.value,showLabel:!1,editor:e.elementConfig.editor,modelValue:a.value,onChange:c,editorParams:e.elementConfig.editorParams},null)])}}),ku=o.defineComponent({name:"FPropertyPanelItemList",props:_u,emits:["valueChanged","submitModal","triggerRefreshPanel"],setup(e,t){const n=o.ref(e.category);function r(m){if(!m.hideCascadeTitle)return o.createVNode("div",{class:"farris-input-wrap"},[o.createVNode("input",{title:"summary",type:"input",class:"form-control form-control-sm",value:m.cascadeSummary,readonly:!0},null)])}function i(m,g){g.isExpand=!g.isExpand}function a(m){return o.createVNode("div",{class:"landscape"},[o.createVNode("button",{title:"expand-button",class:["btn f-btn-collapse-expand f-btn-mx px-1",{"f-state-expand":m.isExpand}],onClick:g=>i(g,m)},[o.createVNode("span",null,null)])])}function s(m){return o.createVNode("div",{class:`f-section-formgroup-legend ${n.value.categoryId}-${m.propertyID}`},[o.createVNode("div",{class:"f-header px-0 my-0 col-form-label",style:"font-size: inherit;"},[o.createVNode("div",{class:"wrap"},[o.createVNode("span",{class:["f-icon mr-1",{"f-icon-arrow-60-right":!m.isExpand,"f-icon-arrow-60-down":m.isExpand}]},null),o.createVNode("span",{class:"farris-label-text"},[m.propertyName])])])])}function c(m){return`${e.categoryKey}_${m.propertyID}`}function u(m){m.categoryId=n.value.categoryId,n.value.enableCascade&&(m.propertyPath=n.value.parentPropertyID),n.value.setPropertyRelates&&n.value.setPropertyRelates(m,e.propertyData),t.emit("valueChanged",{changeObject:m})}function d(){t.emit("triggerRefreshPanel")}function f(m){return o.createVNode("div",{class:"px-2 mb-2"},[o.createVNode(Vu,{key:c(m),elementConfig:m,category:n.value,onPropertyChange:u,onTriggerRefreshPanel:d},null)])}function l(m){var g;return o.createVNode("div",{class:"propertyCascadeItem farris-panel px-2 mb-2"},[o.createVNode("div",{class:["farris-panel-item card",{hidden:!m.isExpand}]},[o.createVNode("div",{class:"card-header",onClick:b=>i(b,m)},[o.createVNode("div",{class:"panel-item-title"},[o.createVNode("div",{class:"form-group farris-form-group line-item"},[s(m),r(m),a(m)])])]),o.createVNode("div",{class:["card-body",{hidden:!m.isExpand}]},[(g=m.cascadeConfig)==null?void 0:g.map(b=>f(b))])])])}o.watch(()=>e.category,()=>{n.value=e.category});function p(m){return m.propertyType==="cascade"?l:f}return()=>o.createVNode(o.Fragment,null,[n.value.properties.map(m=>p(m)(m))])}}),Eu=o.defineComponent({name:"FPropertyPanel",props:Tu,emits:["propertyChanged"],setup(e,t){const n=o.ref(e.width),r=o.ref(e.isWidePanel),i=o.ref(e.enableSearch),a=o.ref(e.mode),s=o.ref(e.isPersitOpenState),c=o.ref(e.isShowPanel),u=o.ref(),d=o.ref(),f=o.ref(e.showCloseBtn),l=o.ref(e.selectedTabId),p=o.ref(!0),m=o.ref(e.isWhiteTheme);let g=[],b=[];const v=o.ref(""),y=o.ref(),C=o.ref(),F=o.inject("SchemaService");let w=[],S=null,N="";const h=o.ref(),_=o.ref(0);function x(){b=[],h.value&&h.value.categoryList&&Array.isArray(h.value.categoryList)&&h.value.categoryList.length>0&&h.value.categoryList.forEach(Q=>{if(Q.properties&&Array.isArray(Q.properties)&&Q.properties.length>0){const ee=Q.properties.map(re=>(re.category=Q,re.propertyType==="cascade"&&re.cascadeConfig&&re.cascadeConfig.map(U=>{U.category=Q,U.cascadeParent=re,b=b.concat(U)}),re));b=b.concat(ee)}})}function k(G){let Q=G.offsetTop,ee=G.offsetParent;for(;ee!==null;)Q+=ee.offsetTop,ee=ee.offsetParent;return Q}function T(G,Q){G&&Q&&Object.keys(Q).length>0&&Object.keys(Q).forEach(ee=>{var U;const re=Q[ee];(U=G.style)==null||U.setProperty(ee,re)})}function V(){return b.filter(Q=>{const ee=Q.propertyID.toLowerCase(),re=Q.propertyName.toLowerCase();return Q.visible?!!(ee&&ee.includes(v.value)||re&&re.includes(v.value)):!1})}function I(G,Q,ee){if(G===0){const re=k(Q),ge=k(ee)-re-5;Q==null||Q.scroll({top:ge,behavior:"smooth"})}}function E(G){w&&w.length>0&&(w.forEach(ee=>{ee.style.cssText=""}),w=[]),v.value=(G||"").toLowerCase();const Q=document.querySelector(".panel-body");if(!v.value)y.value&&Q&&(Q.scrollTop=0);else if(x(),b&&b.length>0){const ee=V();ee&&ee.length>0&&setTimeout(()=>{ee.forEach((re,U)=>{re.category.status="open",re.cascadeParent&&(re.cascadeParent.isExpand=!0);const ge=re.propertyType==="cascade"?`.${re.category.categoryId}-${re.propertyID} .farris-label-text`:`.property-item .${re.category.categoryId}-${re.propertyID}.col-form-label`,Pe=document.querySelector(ge);Pe&&(I(U,Q,Pe),T(Pe,{color:"#5B89FE"}),w.push(Pe))})},50)}}function M(G){E(G)}function B(G){const{value:Q}=G.target;G.key==="Enter"&&M(Q)}function O(G){const{value:Q}=G.target;M(Q)}function R(){s.value||(p.value=!1),t.emit("closePropertyPanel")}function q(G){v.value="",E()}function L(G){!G.status||G.status==="open"?G.status="closed":G.status="open"}function X(){var G,Q;if(g=[],!u.value||u.value.length===0){g=[{tabId:"default",tabName:"属性",categoryList:[]}],h.value=null;return}if((G=u==null?void 0:u.value)==null||G.forEach(ee=>{if(ee.tabId){const re=g.find(U=>U.tabId===ee.tabId);re?(re.categoryList.push(ee),re.hide&&(re.hide=ee.hide||ee.properties.length===0)):g.push({tabId:ee.tabId,tabName:ee.tabName,categoryList:[ee],hide:ee.hide||ee.properties.length===0})}else{const re=g.find(U=>U.tabId==="default");re?re.categoryList.push(ee):g.push({tabId:"default",tabName:"属性",categoryList:[ee]})}}),l.value){const ee=g==null?void 0:g.find(re=>re.tabId===l.value&&!re.hide);h.value=ee||g[0]}else h.value=g[0];l.value=(Q=h.value)==null?void 0:Q.tabId}o.watch(()=>[e.schema,e.isShowPanel],()=>{d.value=e.schema,!e.schema||!e.schema.type?u.value=[]:u.value=vn(d.value,F,S,N),X(),q(v.value),_.value++}),o.onMounted(()=>{X()});function te(G,Q){(!d.value||Q)&&(d.value=Q||e.schema),u.value=vn(d.value,F,S,N,G),X(),q(v.value),_.value++}function ie(G,Q){S=G,N=Q}function ue(){a.value=a.value==="panel"?"sidebar":"panel",a.value==="panel"?(setTimeout(()=>{M()},100),n.value="300px"):n.value="41px"}function $(){if(f.value)return o.createVNode("div",{class:"title-actions"},[o.createVNode("div",{class:"monaco-toolbar"},[o.createVNode("div",{class:"monaco-action-bar animated"},[o.createVNode("ul",{class:"actions-container",role:"toolbar"},[o.createVNode("li",{class:"action-item",onClick:R},[o.createVNode("span",{class:"f-icon f-icon-close"},null)])])])])])}function ne(){u.value=vn(d.value,F,S,N),X()}function pe(){var G;if(i.value&&((G=h.value)==null?void 0:G.tabId)!=="commands")return o.createVNode("div",{class:"search"},[o.createVNode("div",{class:"input-group f-state-editable border-left-0 border-right-0"},[o.createVNode("input",{class:"form-control f-utils-fill text-left pt-3 pb-3 textbox",type:"text",placeholder:"输入属性名称或编号快速定位",autocomplete:"off",onKeyup:Q=>B(Q),value:v.value},null),o.createVNode("div",{class:"input-group-append",style:"margin-left: 0px;"},[o.createVNode("span",{class:"input-group-text input-group-clear",style:[{display:v.value&&v.value.length>0?"":"none"}],onClick:Q=>q()},[o.createVNode("i",{class:"f-icon modal_close"},null)]),o.createVNode("span",{class:"input-group-text input-group-clear",onClick:Q=>O(Q)},[o.createVNode("i",{class:"f-icon f-icon-search"},null)])])])])}function oe(G){return`${e.propertyName}_${G.categoryId}`}function A(G){t.emit("propertyChanged",{...G,designerItem:S})}function Y(){var G,Q;if(h.value)return o.createVNode("div",{class:"panel-body",ref:C},[o.createVNode("ul",{class:["property-grid",{"wide-panel":r.value}]},[(Q=(G=h.value)==null?void 0:G.categoryList)==null?void 0:Q.map(ee=>o.createVNode("li",{key:oe(ee),"data-category-id":ee==null?void 0:ee.categoryId},[!ee.hide&&!ee.hideTitle&&o.createVNode("span",{class:"group-label",onClick:()=>L(ee)},[o.createVNode("span",{class:["f-icon mr-2",{"f-legend-show":ee.status==="closed"},{"f-legend-collapse":ee.status==="open"||ee.status===void 0}]},null),ee.categoryName]),o.createVNode("div",{hidden:ee.status==="closed"},[o.createVNode(ku,{key:`${ee==null?void 0:ee.categoryId}-${_.value}`,category:ee,propertyData:d.value,onTriggerRefreshPanel:ne,onValueChanged:A},null)])]))])])}function we(){if(a.value==="sidebar")return o.createVNode("div",{class:"side-panel h-100",onClick:ue},[o.createVNode("i",{class:"f-icon f-icon-engineering w-100 icon"},null),o.createVNode("span",null,[o.createTextVNode("属性")])])}function Ce(){return{display:p.value?"block":"none",width:n.value}}function je(){return o.createVNode("div",{class:"switcher"},[o.createVNode("i",{class:"f-icon f-icon-exhale-discount",style:[{transform:a.value==="sidebar"?"none":"rotate(180deg)"}],onClick:ue},null)])}function $e(G){h.value=G,l.value=h.value.tabId,v.value=""}function Be(){return g.map(G=>o.createVNode("div",{class:["title-label",{active:h.value&&h.value.tabId===G.tabId},{hidden:G.hide}],onClick:()=>$e(G)},[o.createVNode("span",null,[G.tabName])]))}o.onMounted(()=>{M(v.value)}),o.onBeforeMount(()=>{s.value&&(p.value=c.value),X(),M(v.value)});function me(){_.value++}return t.expose({updatePropertyConfig:te,updateDesignerItem:ie,reloadPropertyPanel:me}),()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{ref:y,class:["property-panel",{"white-theme":m.value}],style:Ce()},[o.createVNode("div",{class:"propertyPanel panel flex-column",hidden:a.value!=="panel"},[o.createVNode("div",{class:["title d-flex",{"p-right":f.value},{only:g.length===1}]},[Be(),$()]),pe(),Y()]),je(),we()])])}}),Iu={"input-group":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"}},"number-spinner":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},precision:{description:"精度",title:"精度",type:"number"},max:{description:"最大值",title:"最大值",type:"number",editor:{type:"number-spinner",nullable:!0}},min:{description:"最小值",title:"最小值",type:"number",editor:{type:"number-spinner",nullable:!0}}},"number-range":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},precision:{description:"精度",title:"精度",type:"number"},max:{description:"最大值",title:"最大值",type:"number",editor:{type:"number-spinner",nullable:!0}},min:{description:"最小值",title:"最小值",type:"number",editor:{type:"number-spinner",nullable:!0}}},"combo-list":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},enumValueType:{description:"值类型",title:"值类型",type:"select",editor:{type:"combo-list",data:[{value:"int",name:"整型"},{value:"string",name:"字符串"},{value:"boolean",name:"布尔"}],valueField:"value",textField:"name",idField:"value"}}},lookup:{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},helpId:{description:"帮助元数据ID",title:"帮助元数据ID",type:"string"},displayName:{description:"帮助元数据名称",title:"帮助元数据名称",type:"string",readonly:!0},uri:{description:"uri",title:"uri",type:"string",readonly:!0},textField:{description:"文本字段",title:"文本字段",type:"string"},valueField:{description:"值字段",title:"值字段",type:"string"},idField:{description:"标识字段",title:"标识字段",type:"string",readonly:!0},displayType:{description:"类型: 树列表、列表、双列表、左树右列表",title:"展示类型",type:"string",editor:{type:"combo-list",editable:!1,disabled:!0,data:[{text:"列表",value:"List"},{text:"树列表",value:"TreeList"},{text:"双列表",value:"NavList"},{text:"左树右列表",value:"NavTreeList"}],textField:"text",idField:"value",valueField:"value"}},mapFields:{description:"映射",title:"映射",type:"string"},multiSelect:{description:"是否多选",title:"是否多选",type:"boolean"}},"combo-lookup":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},helpId:{description:"帮助元数据",title:"帮助元数据",type:"string"},uri:{description:"uri",title:"uri",type:"string"},textField:{description:"文本字段",title:"文本字段",type:"string"},valueField:{description:"值字段",title:"值字段",type:"string"},idField:{description:"标识字段",title:"标识字段",type:"string"},mapFields:{description:"映射",title:"映射",type:"string"},multiSelect:{description:"是否多选",title:"是否多选",type:"boolean"},editable:{description:"允许编辑",title:"允许编辑",type:"boolean"},nosearch:{description:"任意输入",title:"任意输入",type:"boolean"},displayFields:{description:"展示字段",title:"展示字段",type:"string"},clearFields:{description:"值变化时清空字段",title:"值变化时清空字段",type:"string"},dialogTitle:{description:"面板标题",title:"面板标题",type:"string"},enableMultiFieldSearch:{description:"多字段查询",title:"多字段查询",type:"boolean"}},"date-range":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},"date-picker":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},valueFormat:{description:"查询格式",title:"查询格式",type:"enum",editor:{data:[{name:"yyyy-MM-dd",id:"yyyy-MM-dd"},{name:"yyyy/MM/dd",id:"yyyy/MM/dd"},{name:"yyyyMMdd",id:"yyyyMMdd"},{name:"MM/dd/yyyy",id:"MM/dd/yyyy"}]}},displayFormat:{description:"显示格式",title:"显示格式",type:"enum",editor:{data:[{name:"yyyy-MM-dd",id:"yyyy-MM-dd"},{name:"yyyy/MM/dd",id:"yyyy/MM/dd"},{name:"yyyyMMdd",id:"yyyyMMdd"},{name:"MM/dd/yyyy",id:"MM/dd/yyyy"},{name:"yyyy年MM月dd日",id:"yyyy年MM月dd日"}]}}},"date-time":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},"single-date-time":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},month:{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},"single-year":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},"radio-group":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},direction:{description:"布局方向",title:"布局方向",type:"select",editor:{type:"combo-list",data:[{text:"水平",value:"horizontal"},{text:"垂直",value:"vertical"}],textField:"text",idField:"value",valueField:"value"}},showLabel:{description:"是否显示标签",title:"是否显示标签",type:"boolean"}}},Mu=new Map([["appearance",jt.resolveAppearance]]);function Ou(e,t,n){return t}const Bu={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/button-edit.schema.json",title:"button-edit",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"button-edit"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},forcePlaceholder:{description:"",type:"boolean",default:!1},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""},autoComplete:{description:"",type:"boolean",default:!1},buttonContent:{description:"",type:"string",default:""},enableClear:{description:"",type:"boolean",default:!0},inputType:{description:"",type:"string",enum:["text","tag"],default:"text"},multiSelect:{description:"",type:"boolean",default:!1},popup:{description:"",type:"object",properties:{footerButtons:{type:"array",default:[]},height:{type:"number",default:600},dataMapping:{type:"object"},contents:{type:"array",default:[]},showMaxButton:{type:"boolean",default:!0},showCloseButton:{type:"boolean",default:!0},showFooter:{type:"boolean",default:!0},title:{type:"string",default:""},width:{type:"number",default:800}}},separator:{type:"string",default:","},showButtonWhenDisabled:{description:"",type:"boolean",default:!1},wrapText:{type:"boolean",default:!1},onClear:{description:"",type:"string",default:""}},required:["id","type"]},Pu={title:"buttonEdit",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{editable:{description:"",title:"允许编辑",type:"boolean"},readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"},textAlign:{description:"",title:"对齐方式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中"},{value:"right",name:"右对齐"}]}}}}}},Pr={id:String,buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},buttonBehavior:{type:String,default:"Popup"},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},showButtonWhenDisabled:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:Number,tabIndex:Number,popupHost:{type:Object},popupRightBoundary:{type:Object},popupOffsetX:{type:Object},popupOnInput:{type:Boolean,default:!1},popupOnFocus:{type:Boolean,default:!1},popupOnClick:{type:Boolean,default:!1},popupMinWidth:{type:Number,default:160},modalOptions:{type:Object,default:{}},wrapText:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","},textAlign:{type:String,default:"left"},beforeClickButton:{type:Function,default:null},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},beforeOpen:{type:Function,default:null},updateOn:{type:String,default:"change"},keepWidthWithReference:{type:Boolean,default:!0},placement:{type:String,default:"bottom-left"}};Ue(Pr,Bu,Mu,Ou,Pu);const Ru={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object},backgroundColor:{type:String,default:""}},ju=o.defineComponent({name:"FOverlay",props:Ru,emits:["click"],setup(e,t){const n=o.ref(e.popupContentPosition),r=o.ref(e.host),i=o.computed(()=>({backgroundColor:e.backgroundColor||"",pointerEvents:"auto"}));function a(c){t.emit("click"),c.preventDefault(),c.stopPropagation()}o.computed(()=>{const c=r.value;if(c){const u=c.getBoundingClientRect(),{left:d,top:f,height:l}=u;return{left:d,top:f+l}}return n.value});const s=o.computed(()=>({}));return()=>o.createVNode(o.Teleport,{to:"body"},{default:()=>{var c,u;return[o.createVNode("div",{class:"overlay-container",onClick:d=>a(d),style:i.value},[o.createVNode("div",{style:s.value},[(u=(c=t.slots).default)==null?void 0:u.call(c)])])]}})}});function $u(e){if(e.content&&e.content.render)return e.content.render;if(e.render&&typeof e.render=="function")return e.render}function Du(e){const t=document.createElement("div");t.style.display="contents";let n;const r=e.onClickCallback||(()=>{}),i=()=>{r(),n&&n.unmount()};return n=o.createApp({setup(){o.onUnmounted(()=>{document.body.removeChild(t)});const a=$u(e);return()=>o.createVNode(ju,{"popup-content-position":e.popupPosition,host:e.host,onClick:i,backgroundColor:e.backgroundColor},{default:()=>[a&&a()]})}}),document.body.appendChild(t),n.mount(t),n}class Au{static show(t){return Du(t)}}function Rr(e,t){function n(){const r=e.beforeOpen||e.beforeClickButton||null;let i=Promise.resolve(!0);if(r){const a=r(t.value);if(typeof a>"u")return i;typeof a=="boolean"?i=Promise.resolve(a):i=a}return i}return{judgeCanOpen:n}}function Lu(e,t,n,r,i){const a=o.ref(e.buttonBehavior),s=o.ref(e.popupOnInput),c=o.computed(()=>({"input-group-append":!0,"append-force-show":e.showButtonWhenDisabled&&(e.readonly||e.disable)})),{judgeCanOpen:u}=Rr(e,i),d=o.computed(()=>e.showButtonWhenDisabled||(!e.editable||!e.readonly)&&!e.disable),f=o.inject(Ro,null),l=o.ref();async function p(b){if(await u()&&d.value){const v=!!t.slots.default;if(a.value==="Modal"){const y=e.modalOptions,C=f==null?void 0:f.open({...y,render:()=>t.slots.default&&t.slots.default()});l.value=C==null?void 0:C.modalRef}a.value==="Overlay"&&Au.show({host:document.body,backgroundColor:"rgba(0,0,0,.15)",render:()=>t.slots.default&&t.slots.default()}),v&&a.value==="Popup"&&r.togglePopup(!0),v&&s.value&&r.hidePopup(),t.emit("clickButton",{origin:b,value:e.modelValue})}}function m(b){t.emit("mouseEnterIcon",b)}function g(b){t.emit("mouseLeaveIcon",b)}return{buttonGroupClass:c,onClickButton:p,onMouseEnterButton:m,onMouseLeaveButton:g,modalRef:l}}function qu(e,t,n,r,i,a){const s=o.ref(!1),c=o.computed(()=>e.enableClear&&!e.readonly&&!e.disable),{changeTextBoxValue:u}=a;function d(m){s.value=m}o.watch(i,()=>{d(!!i.value)});function f(m){const g=!e.readonly&&!e.disable&&e.editable,b=!e.editable;m.stopPropagation(),(g||b)&&(u(""),d(!s.value),t.emit("clear"))}function l(m){if(c.value){if(!n.value){d(!1);return}!e.disable&&!e.readonly&&d(!0)}}function p(m){c.value&&d(!1)}return{enableClearButton:c,showClearButton:s,onClearValue:f,onMouseEnterTextBox:l,onMouseLeaveTextBox:p}}function Hu(e,t,n,r,i){const a=o.computed(()=>e.popupOnInput),s=o.computed(()=>e.popupOnFocus),{shouldPopupContent:c}=i,u=o.computed(()=>e.enableTitle?n.value:""),d=o.computed(()=>(e.disable||e.readonly)&&!e.forcePlaceholder?"":e.placeholder),f=o.computed(()=>e.readonly||!e.editable),l=o.ref(!1),p=o.computed(()=>!e.disable&&l.value),m=o.computed(()=>({"text-left":e.textAlign==="left","text-center":e.textAlign==="center","text-right":e.textAlign==="right","form-control":!0,"f-utils-fill":!0})),g=o.computed(()=>({"input-group":!0,"f-state-disabled":e.disable,"f-state-editable":e.editable&&!e.disable&&!e.readonly,"f-state-readonly":e.readonly&&!e.disable,"f-state-focus":p.value}));function b(x,k=!0){n.value=x,k&&(t.emit("change",x),t.emit("update:modelValue",x))}function v(x){c.value=!1,b(x,!0)}o.watch(()=>e.modelValue,x=>{n.value=x});function y(x){l.value=!1,t.emit("blur",x),x.stopPropagation()}function C(x){t.emit("click",x),!e.disable&&!e.readonly&&e.popupOnClick&&i.togglePopup()}function F(x){e.disable||(l.value=!0,f.value||(t.emit("focus",x),s.value&&!c.value&&i.popup()))}function w(x){t.emit("input",x.target.value);const k=x.target.value;r.value=k,n.value!==k&&b(k,e.updateOn==="change"),a.value&&!c.value&&i.popup()}function S(x){x.target.tagName!=="INPUT"&&x.preventDefault(),x.stopPropagation()}function N(x){t.emit("keydown",x)}function h(x){x.key==="Enter"&&(a.value||s.value)&&i.hidePopup(),t.emit("keyup",x)}function _(x){const k=x.target.value;x.stopPropagation(),b(k)}return{hasFocusedTextBox:p,isTextBoxReadonly:f,textBoxClass:m,textBoxPlaceholder:d,textBoxTitle:u,inputGroupClass:g,changeTextBoxValue:b,commitValue:v,onBlurTextBox:y,onClickTextBox:C,onFocusTextBox:F,onInput:w,onKeyDownTextBox:N,onKeyUpTextBox:h,onMouseDownTextBox:S,onTextBoxValueChange:_}}function Wu(e,t,n,r){const i=o.ref(),a=o.ref(!1),{judgeCanOpen:s}=Rr(e,r);function c(){const l=i.value;l&&l.show(n.value)}async function u(l=!1){if(!!t.slots.default){if(!l&&!a.value&&!await s())return;a.value=!a.value,await o.nextTick(),c()}}async function d(l=!1){if(!!t.slots.default){if(!l&&!await s())return;a.value=!0,await o.nextTick(),c()}}function f(){a.value=!1}return{hidePopup:f,popup:d,shouldPopupContent:a,togglePopup:u,popoverRef:i}}function Uu(e,t,n){const r=o.ref(),{isTextBoxReadonly:i,textBoxClass:a,textBoxPlaceholder:s,textBoxTitle:c,onBlurTextBox:u,onClickTextBox:d,onFocusTextBox:f,onInput:l,onKeyDownTextBox:p,onKeyUpTextBox:m,onMouseDownTextBox:g,onTextBoxValueChange:b}=n;return o.onMounted(()=>{var v,y;e.selectOnCreated&&((v=r.value)==null||v.select()),e.focusOnCreated&&((y=r.value)==null||y.focus())}),()=>o.createVNode("input",{ref:r,name:"input-group-value",autocomplete:e.autoComplete?"on":"off",class:a.value,disabled:e.disable,maxlength:e.maxLength,minlength:e.minLength,placeholder:s.value,readonly:i.value,tabindex:e.tabIndex,title:c.value,type:e.inputType,value:t.value,onBlur:u,onChange:b,onClick:d,onFocus:f,onInput:l,onKeydown:p,onKeyup:m,onMousedown:g},null)}function zu(e,t,n){const r=o.ref(e.separator),{changeTextBoxValue:i}=n,a=o.computed(()=>t.value?t.value.split(r.value).map(c=>({name:c,selectable:!0})):[]);function s(c){i(c.map(u=>u.name).join(r.value),!0)}return()=>o.createVNode(eo,{id:`${e.id}-tag-editor`,class:"form-control",data:a.value,showClose:!0,showInput:!0,onChange:s},null)}function Gu(e,t,n,r){const{buttonGroupClass:i,onClickButton:a,onMouseEnterButton:s,onMouseLeaveButton:c}=n,{enableClearButton:u,showClearButton:d,onClearValue:f}=r,l=o.ref();return{renderButtonGroup:()=>o.createVNode("div",{id:`${e.id}-button-group`,class:i.value},[u.value&&o.withDirectives(o.createVNode("span",{class:"input-group-text input-group-clear",onClick:f},[o.createVNode("i",{class:"f-icon modal_close"},null)]),[[o.vShow,d.value]]),t.slots.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",onClick:a,onMouseenter:s,onMouseleave:c},[t.slots.buttonContent()]):e.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",innerHTML:e.buttonContent,ref:l,onClick:a,onMouseenter:s,onMouseleave:c},null):null]),buttonHandleElement:l}}function Xu(e,t,n){const r=o.ref(e.popupMinWidth),{hidePopup:i,popoverRef:a}=n;return()=>o.createVNode(qi,{id:`${e.id}-popover`,ref:a,visible:!0,placement:e.placement,host:e.popupHost,"keep-width-with-reference":e.keepWidthWithReference,fitContent:!0,"right-boundary":e.popupRightBoundary,minWidth:r.value,offsetX:e.popupOffsetX,onHidden:i},{default:()=>{var s,c;return[(c=(s=t.slots).default)==null?void 0:c.call(s)]}})}const Yu=o.defineComponent({name:"FButtonEdit",props:Pr,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue"],setup(e,t){const n=o.ref(),r=o.ref(e.customClass),i=o.ref(e.modelValue),a=Wu(e,t,n,i),{shouldPopupContent:s,hidePopup:c,togglePopup:u}=a,d=Lu(e,t,n,a,i),f=o.ref(""),l=Hu(e,t,i,f,a),{hasFocusedTextBox:p,commitValue:m,inputGroupClass:g}=l,b=qu(e,t,i,p,f,l),{onMouseEnterTextBox:v,onMouseLeaveTextBox:y}=b,C=o.computed(()=>{const x={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!e.wrapText};return r.value&&r.value.split(" ").reduce((k,T)=>(k[T]=!0,k),x),x});function F(){return e.multiSelect&&e.inputType==="tag"?zu(e,i,l):Uu(e,i,l)}let w=F();o.watch([()=>e.multiSelect,()=>e.inputType],()=>{w=F()});const{renderButtonGroup:S,buttonHandleElement:N}=Gu(e,t,d,b),h=Xu(e,t,a),_={commitValue:m,elementRef:n,hidePopup:c,shouldPopupContent:s,togglePopup:u,openDialog:()=>{N.value&&e.buttonBehavior==="Modal"&&N.value.click()},getModal:()=>{var x;return e.buttonBehavior==="Modal"?(x=d.modalRef.value)==null?void 0:x.value:null}};return o.onMounted(()=>{n.value.componentInstance=_,window.onresize=()=>{document.body.click()}}),t.expose(_),()=>o.createVNode(o.Fragment,null,[o.createVNode("div",o.mergeProps(t.attrs,{ref:n,class:C.value,id:e.id}),[o.createVNode("div",{id:`${e.id}-input-group`,class:g.value,onMouseenter:v,onMouseleave:y},[w(),S()])]),s.value&&h()])}}),Ju={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/field-selector.schema.json",title:"field-selector",description:"A Farris Input Component",type:"object",properties:{disabled:{description:"",type:"boolean",default:"false"},readonly:{description:"",type:"boolean",default:"false"},modelValue:{description:"",type:"object",default:null},data:{description:"",type:"array",default:[]},idField:{description:"",type:"string",default:"id"},columns:{description:"",type:"array",default:[]},title:{description:"",type:"string",default:"字段选择器"},modalWidth:{description:"",type:"number",default:800},modalHeight:{description:"",type:"number",default:600},multiSelect:{description:"",type:"boolean",default:!1},separator:{description:"",type:"string",default:","},bindingData:{description:"",type:"array",default:[]},textField:{description:"",type:"string",default:"code"},beforeOpenDialog:{description:"",type:"object",default:null},editorParams:{description:"",type:"object",default:null},onSubmitModal:{description:"",type:"object",default:null},onFieldSelected:{description:"",type:"object",default:null},repositoryToken:{description:"",type:"object",default:null}}},Qu=[{field:"code",title:"绑定字段"},{field:"name",title:"名称"},{field:"fieldType",title:"字段类型"}],Xn=Symbol("Field_Selector Component Repository Service Token");Ue({disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},modelValue:{type:[String,Array],default:null},data:{type:Array,default:[]},idField:{type:String,default:"id"},columns:{type:Array,default:Qu},title:{type:String,default:"字段选择器"},modalWidth:{type:Number,default:800},modalHeight:{type:Number,default:600},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","},bindingData:{type:Array,default:[]},textField:{type:String,default:"code"},beforeOpenDialog:{type:Function,default:null},editorParams:{type:Object,default:null},onSubmitModal:{type:Function,default:null},onFieldSelected:{type:Function,default:null},repositoryToken:{type:Symbol,default:null}},Ju);const Ku=Symbol("schema_repository_token"),Zu={convertFrom:(e,t)=>e[t],convertTo:(e,t,n)=>{e[t]=n.value}};function ed(e,t){const n={"input-group":{key:"input-group",value:"文本"},"number-spinner":{key:"number-spinner",value:"数值"},"number-range":{key:"number-range",value:"数值区间"},lookup:{key:"lookup",value:"弹出帮助"},"combo-lookup":{key:"combo-lookup",value:"下拉帮助"},"date-picker":{key:"date-picker",value:"日期"},"combo-list":{key:"combo-list",value:"下拉面板"},"radio-group":{key:"radio-group",value:"单选"}};function r(p){const m=e.fieldsConfig.find(b=>b.id===p.id);let g=[];if(m){switch(m.type.name){case"Enum":case"Boolean":g=[n["radio-group"],n["combo-list"]];break;case"Number":case"Integer":case"Decimal":case"BigNumber":g=[n["number-spinner"],n["number-range"]];break;case"String":g=[n["input-group"],n.lookup,n["date-picker"],n["radio-group"],n["combo-list"]];break;case"Date":case"DateTime":g=[n["date-picker"]];break}return g}else return[{key:"input-group",value:"文本"}]}function i(p){return{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"标识",title:"标识",type:"string",readonly:!0},code:{description:"编号",title:"控件编号",type:"string",readonly:!0},labelCode:{description:"标签",title:"标签",type:"string",readonly:!0},name:{description:"控件名称",title:"控件名称",type:"string"},controlType:{description:"控件类型",title:"控件类型",type:"string",editor:{type:"combo-list",data:r(p),valueField:"key",textField:"value",idField:"id",editable:!1,multiSelect:!1}}}}}function a(p){let m="form_group_"+Date.now();return p&&(m=p.replaceAll("-","_").replaceAll(".","_")),"lookup."+m}function s(p){const m={description:"帮助元数据",title:"帮助元数据",type:"string",refreshPanelAfterChanged:!0,editor:{type:"schema-selector",title:"选择数据源",editorParams:{propertyData:p,formBasicInfo:e.formSchemaUtils.getFormMetadataBasicInfo()},viewOptions:[{id:"recommend",title:"推荐",type:"List",dataSource:"Recommand",enableGroup:!0,groupField:"category",groupFormatter:(y,C)=>`${y==="local"?"本地元数据":"最近使用"}`},{id:"total",title:"全部",type:"List",dataSource:"Total"}],repositoryToken:Ku,onSubmitModal:y=>{if(y){const C=e.formSchemaUtils.getFormMetadataBasicInfo();return e.metadataService.getPickMetadata(C.relativePath,y[0].data).then(F=>{const w=JSON.parse(F==null?void 0:F.metadata.content);return p.helpId=w.id,p.displayName=w.name,p.displayType=w.displayType,p.textField=w.textField,p.valueField=w.valueField,p.idField=w.idField,p.uri=a(w.id),p.dataSource={displayName:w.name,idField:w.idField,uri:p.uri},null})}}}},g={description:"显示文本字段",title:"文本字段",type:"string",editor:{type:"field-selector",bindingType:{enable:!1},textField:"bindingPath",editorParams:{propertyData:p,formBasicInfo:e.formSchemaUtils.getFormMetadataBasicInfo()},columns:[{field:"name",title:"名称"},{field:"code",title:"编号"},{field:"bindingPath",title:"绑定字段"}],repositoryToken:Xn,onSubmitModal:y=>(p.textField=y[0].bindingPath,null)}},b={description:"显示值字段",title:"值字段",type:"string",editor:{type:"field-selector",bindingType:{enable:!1},textField:"bindingPath",editorParams:{propertyData:p,formBasicInfo:e.formSchemaUtils.getFormMetadataBasicInfo()},columns:[{field:"name",title:"名称"},{field:"code",title:"编号"},{field:"bindingPath",title:"绑定字段"}],repositoryToken:Xn,onSubmitModal:y=>(p.valueField=y[0].bindingPath,null)}},v={description:"字段映射",title:"字段映射",type:"string",editor:{type:"mapping-editor",modalWidth:800,modalHeight:600,editable:!1,editorParams:{propertyData:p,formBasicInfo:e.formSchemaUtils.getFormMetadataBasicInfo()},fromData:{editable:!1,formatter:(y,C)=>`${C.raw[y.field]} [${C.raw.bindingPath}]`,idField:"id",textField:"bindingPath",valueField:"bindingPath",repositoryToken:Xn},toData:{idField:"id",textField:"bindingPath",valueField:"bindingPath",dataSource:e.designViewModelUtils.getAllFields2TreeByVMId(e.viewModelId),formatter:(y,C)=>`${C.raw[y.field]} [${C.raw.bindingPath}]`}}};return{helpId:m,textField:g,valueField:b,mappingFields:v}}function c(p){return{enumValues:{description:"枚举值",title:"枚举值",type:"string",editor:{columns:[{field:"value",title:"值",dataType:"string"},{field:"name",title:"名称",dataType:"string"},{field:"disabled",title:"禁用",visible:!1,dataType:"boolean",editor:{type:"switch"}}],type:"item-collection-editor",valueField:"value",nameField:"name",requiredFields:["value","name"],uniqueFields:["value","name"]},$converter:Zu}}}function u(p){const{controlType:m}=p,g={description:"",title:"控件",properties:Iu[m]};if(m==="lookup"||m==="combo-lookup"){const{helpId:b,textField:v,valueField:y,mappingFields:C}=s(p);g.properties.helpId=b,g.properties.textField=v,g.properties.valueField=y,g.properties.mapFields=C}else if(m==="radio-group"||m==="combo-list"){const{enumValues:b}=c();g.properties.data=b}else if(m==="date-picker"){const b=e.fieldsConfig.find(v=>v.id===p.id);if(b&&(b.type.name==="Date"||b.type.name==="DateTime")){const{valueFormat:v,...y}=g.properties;g.properties=y}}return g}function d(p){const m=[{label:"valueChangedCmd",name:"值变化事件"}];switch(p){case"combo-lookup":case"lookup":m.push({label:"preEventCmd",name:"帮助前事件"},{label:"preEventCmd",name:"帮助前事件"});break;case"combo-list":m.push({label:"beforeShow",name:"面板展开前事件"},{label:"afterShow",name:"面板关闭后事件"});break}return m}function f(p){const m=d(p.controlType),g=e.eventsEditorUtils.formProperties(p,e.viewModelId,m),b={};return b[e.viewModelId]={type:"events-editor",editor:{initialData:g}},{title:"事件",hideTitle:!0,properties:b,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(y,C){const F=y.propertyValue;delete p[e.viewModelId],F&&(F.setPropertyRelates=this.setPropertyRelates,e.eventsEditorUtils.saveRelatedParameters(p,e.viewModelId,F.events,F)),p.remoteSort=!!p.columnSorted}}}function l(p){const m=i(p),g=u(p);return f(p),{title:"query-solution-config",description:"A Farris Component",type:"object",categories:{basic:m,control:g}}}return{getPropertyConfig:l}}function td(e,t,n,r){const i=o.ref(),a=o.ref("query-solution-config"),s=o.ref({}),c=o.ref(),u=o.ref(null),{getPropertyConfig:d}=ed(e);o.watch(()=>{var b;return(b=n.value)==null?void 0:b.id},(b,v)=>{if(!b)u.value=null;else if(b!==v){const y=r.get(b);u.value=y}});function f(b){return{id:b.id,code:b.code||b.id,labelCode:b.labelCode,name:b.name,controlType:b.controlType}}function l(b,v){const y={class:"",required:!1};let C={};switch(b){case"input-group":break;case"number-range":case"number-spinner":C={precision:2,max:null,min:null};break;case"combo-list":C={uri:"",multiSelect:!1,data:(v==null?void 0:v.data)||[],valueField:"value",textField:"name",idField:"value",enumValueType:(v==null?void 0:v.enumValueType)||"string"};break;case"lookup":C={helpId:"",uri:"",textField:"",valueField:"",idField:"",mapFields:"",multiSelect:!1,panelHeight:null};break;case"combo-lookup":C={helpId:"",uri:"",textField:"",valueField:"",idField:"",mapFields:"",multiSelect:!1,editable:!1,nosearch:!1,clearFields:"",dialogTitle:"",enableMultiFieldSearch:!1};break;case"date-range":case"date-picker":C={valueFormat:"yyyy-MM-dd",displayFormat:"yyyy-MM-dd"};break;case"radio-group":C={direction:"horizontal",showLabel:!1,data:(v==null?void 0:v.data)||[]};break}return{...y,...C}}function p(b){const v={class:"",required:!1,isExtend:!1};let y={};switch(b){case"input-group":break;case"number-range":case"number-spinner":y={precision:2,max:null,min:null};break;case"combo-list":y={uri:"",enumValue:[],multiSelect:!1};break;case"lookup":y={helpId:"",uri:"",textField:"",valueField:"",idField:"",mapFields:"",multiSelect:!1,panelHeight:null};break;case"combo-lookup":y={helpId:"",uri:"",textField:"",valueField:"",idField:"",mapFields:"",multiSelect:!1,editable:!1,nosearch:!1,clearFields:"",dialogTitle:"",enableMultiFieldSearch:!1};break;case"date-range":case"date-picker":y={valueFormat:"yyyy-MM-dd",displayFormat:"yyyy-MM-dd"};break;case"radio-group":y={direction:"horizontal",showLabel:!1};break}return{...v,...y}}function m(b,v){return e.source==="query-solution"?l(b,v):p(b)}o.watch(()=>{var b,v;return[(b=u.value)==null?void 0:b.id,(v=u.value)==null?void 0:v.controlType]},([b,v],[y,C])=>{if(!b)i.value.updatePropertyConfig({},{});else if(b!==y){const F=d(u.value);i.value.updatePropertyConfig(F,u.value)}else if(v!==C){const F=r.get(b),w=f(F);w.controlType=v;const S={...w,...m(v,F)};r.set(b,S),u.value=r.get(b);const N=d(u.value);i.value.updatePropertyConfig(N,u.value)}});function g(){return o.createVNode(Eu,{propertyConfig:c.value,ref:i,propertyName:a.value,schema:s.value},{default:()=>[o.createTextVNode(" ")]})}return{renderPanel:g,getExtendSchemaProerty:m}}const nd=new Map([["appearance",ht]]);function od(e,t,n){return t}const rd={title:"transfer",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},id={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/transfer.schema.json",title:"transfer",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for transfer",type:"string"},type:{description:"The type string of transfer",type:"string",default:"transfer"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},jr={dataSource:{type:Array,default:[]},displayType:{type:String,default:"List"},enableSearch:{type:Boolean,default:!0},identifyField:{type:String,default:"id"},textField:{type:String,default:"name"},placeholder:{type:String,default:""},selections:{type:Array,default:[]},selectionValues:{type:Array,default:[]},rowOption:{type:Object}};Ue(jr,id,nd,od,rd);const ad=new Map([["appearance",ht]]);function sd(e,t,n){return t}const ld={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/list-view.schema.json",title:"list-view",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for list-view",type:"string"},type:{description:"The type string of list-view",type:"string",default:"list-view"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},cd={title:"list-view",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},$r={columns:{type:Array,default:[{field:"name",title:"",dataType:"string"}]},data:{type:Array,default:[]},draggable:{type:Boolean,default:!1},multiSelect:{Type:Boolean,default:!1},multiSelectMode:{Type:String,default:"OnCheck"},idField:{Type:String,default:"id"},valueField:{Type:String,default:"id"},textField:{Type:String,default:"name"},titleField:{Type:String,default:"name"},view:{Type:String,default:"ContentView"},size:{Type:String,default:"default"},placeholder:{type:String,default:""},header:{Type:String,default:"ContentHeader"},headerClass:{Type:String,default:""},itemClass:{Type:String,default:""},selectionValues:{type:Array,default:[]},group:{type:Object},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},keepOrder:{type:Boolean,default:!1},disableField:{type:String,default:"disabled"},enableHighlightSearch:{type:Boolean,default:!0},virtualized:{type:Boolean,default:!0}};Ue($r,ld,ad,sd,cd);function ud(e,t){function n(a){const s=[];let c=a.nextNode();for(;c;)s.push(c),c=a.nextNode();return s}function r(a,s){const c=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);return n(c).map(l=>({textNode:l,text:(l.textContent||"").toLocaleLowerCase()})).map(({textNode:l,text:p})=>{const m=[];let g=0;for(;g<p.length;){const b=p.indexOf(s,g);if(b===-1)break;m.push(b),g=b+s.length}return m.map(b=>{const v=new Range;return v.setStart(l,b),v.setEnd(l,b+s.length),v})}).flat()}function i(a){if(!CSS.highlights||(CSS.highlights.clear(),!a||!t))return;const s=r(t.value,a.toLocaleLowerCase()),c=new Highlight(...s);CSS.highlights.set("search-result",c)}return{search:i}}function Dr(e,t,n,r,i,a,s,c,u,d){const f=o.ref(e.size),l=o.ref(e.textField),p=o.ref(e.titleField),m=o.ref(e.disableField),g=o.computed(()=>{var _,x;return((_=e.selection)==null?void 0:_.multiSelect)&&((x=e.selection)==null?void 0:x.showCheckbox)}),{onMouseenterItem:b,onMouseoverItem:v,onMouseoutItem:y}=a,{getKey:C,listViewItemClass:F,onCheckItem:w,onClickItem:S}=s,N=o.computed(()=>e.itemClass?{}:{margin:f.value==="small"?"0.25rem 0":"8px 0"});function h(_,x,k){return _.checked=c.findIndexInSelectedItems(_)>-1,o.createVNode("li",{class:F(_,x),id:C(_,x),key:C(_,x),onClick:T=>S(T,_,x),onMouseenter:T=>b(T,_,x),onMouseover:T=>v(T,_,x),onMouseout:T=>y(T,_,x)},[g.value&&o.createVNode("div",{class:"f-list-select",onClick:T=>T.stopPropagation()},[o.createVNode(Et.FCheckbox,{id:"list-"+C(_,x),customClass:"listview-checkbox",disabled:_[m.value],checked:_.checked,"onUpdate:checked":T=>_.checked=T,onChange:T=>{w(_,x,!T.checked)}},null)]),o.createVNode("div",{class:"f-list-content"},[o.createVNode("div",{style:N.value,title:_.raw[p.value]||_.raw[l.value]},[_.raw[l.value]])])])}return{renderItem:h}}function dd(e,t,n,r,i,a,s,c,u,d){const f=o.ref(e.multiSelect),l=o.ref(e.disableField),{onMouseenterItem:p,onMouseoverItem:m,onMouseoutItem:g}=a,{getKey:b,listViewItemClass:v,onCheckItem:y,onClickItem:C}=s;function F(S,N,h){return t.slots.content?o.createVNode(o.Fragment,null,[t.slots.content&&t.slots.content({item:S.raw,index:N,selectedItem:h})]):o.createVNode("div",{style:"margin: 10px 0;"},[S.raw.name])}function w(S,N,h){return o.createVNode("li",{class:v(S,N),id:b(S,N),key:b(S,N),onClick:_=>C(_,S,N),onMouseenter:_=>p(_,S,N),onMouseover:_=>m(_,S,N),onMouseout:_=>g(_,S,N)},[f.value&&o.createVNode("div",{class:"f-list-select",onClick:_=>_.stopPropagation()},[o.createVNode(Et.FCheckbox,{id:"list-"+b(S,N),customClass:"listview-checkbox",disabled:S[l.value]||!S.checked,checked:S.checked,"onUpdate:checked":_=>S.checked=_,onChange:_=>y(S,N,!_.checked)},null)]),o.createVNode("div",{class:"f-list-content"},[F(S,N,h)])])}return{renderItem:w}}function fd(e,t,n,r,i,a,s,c,u,d){const f=o.ref(e.multiSelect),l=o.ref(e.disableField),{onMouseenterItem:p,onMouseoverItem:m,onMouseoutItem:g}=a,{getKey:b,listViewItemClass:v,onCheckItem:y,onClickItem:C}=s,{dragstart:F,dragenter:w,dragover:S,dragend:N}=r,{removeItem:h}=u,_=o.computed(()=>({margin:f.value?"10px 0":"10px 0px 10px 14px"}));function x(I){return o.createVNode("div",{style:_.value},[I.raw.name])}function k(){return t.slots.itemContent?t.slots.itemContent:x}const T=k();function V(I,E,M){return o.createVNode("li",{class:v(I,E),id:b(I,E),key:b(I,E),onClick:B=>C(B,I,E),onMouseenter:B=>p(B,I,E),onMouseover:B=>m(B,I,E),onMouseout:B=>g(B,I,E),draggable:"true",onDragstart:B=>F(B,I,E),onDragenter:B=>w(B,E),onDragend:B=>N(B,I),onDragover:B=>S(B,E)},[f.value&&o.createVNode("div",{class:"f-list-select",onClick:B=>B.stopPropagation()},[o.createVNode(Et.FCheckbox,{id:"list-"+b(I,E),customClass:"listview-checkbox",disabled:I[l.value]||!I.checked,checked:I.checked,"onUpdate:checked":B=>I.checked=B,onChange:B=>y(I,E,!B.checked)},null)]),o.createVNode("div",{class:"f-list-content"},[T(I)]),o.createVNode("div",{class:"f-list-remove",onClick:B=>h(E)},[o.createVNode("div",{class:"f-list-remove-icon"},[o.createVNode("i",{class:"f-icon f-icon-remove_face"},null)])]),o.createVNode("div",{class:"f-list-handle"},[o.createVNode("div",null,[o.createVNode("i",{class:"f-icon f-icon-drag-vertical"},null)])])])}return{renderItem:V}}function pd(e,t,n,r,i,a,s,c,u,d){var b;const f=o.ref(((b=e.group)==null?void 0:b.groupFields)||[]),{collpaseGroupIconClass:l}=i,{toggleGroupRow:p}=d;function m(v,y){y.collapse=!y.collapse,n.value=p(y.collapse?"collapse":"expand",y,n.value)}function g(v,y,C){return v.layer>-1&&o.createVNode("div",{class:"f-navlookup-recentHeader",onClick:F=>m(F,v)},[o.createVNode("div",{class:"fv-grid-group-row-icon"},[o.createVNode("span",{class:l(v)},null)]),o.createVNode("div",{class:"f-navlookup-recommandLabel"},[v.raw[f.value[v.layer]]])])}return{renderItem:g}}function md(e,t,n,r){const i=o.ref(e.idField),{dataView:a}=n,s=o.ref(-1),c=o.ref(!1),{activeIndex:u,focusedItemId:d,hoverIndex:f,resumeHover:l,suspendHover:p}=r;function m(y,C,F){y.stopPropagation(),p(),C&&setTimeout(()=>{s.value=F,c.value=!0,C.moving=!0})}function g(y,C){if(y.preventDefault(),s.value!==C){const F=a.value[s.value],w=a.value;w.splice(s.value,1),w.splice(C,0,F),s.value=C}}function b(y,C){y.preventDefault(),y.dataTransfer&&(y.dataTransfer.dropEffect="move")}function v(y,C){C&&(C.moving=!1),a.value.forEach((F,w)=>{F.__fv_index__=w}),c.value=!1,l(),f.value=C.raw.__fv_index__,u.value=C.raw.__fv_index__,d.value=C.raw[i.value],t.emit("change",a.value),t.emit("activeChange",C)}return{dragstart:m,dragenter:g,dragover:b,dragend:v,isDragging:c}}function hd(e,t,n){const{dataView:r}=n;function i(a){if(a>-1&&a<r.value.length){const s=r.value.splice(a,1);t.emit("removeItem",s[0])}}return{removeItem:i}}function gd(e,t,n,r,i,a){const s=o.ref(e.idField),c=o.ref(e.disableField),u=o.ref(e.draggable),d=o.ref(e.itemClass),f=o.ref(e.selection.multiSelect??!1),l=o.ref(e.selection.multiSelectMode),{isDragging:p}=r,{activeIndex:m,focusedItemId:g,hoverIndex:b}=i,{clearSelection:v,getSelectedItems:y,toggleSelectItem:C}=a,F=o.ref(y());function w(T,V){const I={"f-list-view-group-item":!0,"f-list-view-draggable-item":u.value,"f-un-click":!T.checked,"f-un-select":!!T.raw[c.value],"f-listview-active":T.raw.__fv_index__===m.value,"f-listview-hover":!p.value&&V===b.value,moving:!!T.moving};return d.value.split(" ").reduce((M,B)=>(M[B]=!0,M),I),I}function S(T,V){return T.raw[s.value]||""}const N=o.computed(()=>!f.value);function h(T,V,I){T.checked=I,!T.raw[c.value]&&(N.value&&(g.value=T.raw[s.value]),C(T))}const _=o.computed(()=>f.value&&l.value==="OnCheckClearByClick"),x=o.computed(()=>!f.value||f.value&&(l.value==="OnCheckAndClick"||l.value==="OnClick"));function k(T,V,I){if(V.raw[c.value]){T.preventDefault(),T.stopPropagation();return}g.value=V.raw[s.value],m.value=I,_.value&&v(),x.value&&(C(V),F.value=y()),t.emit("clickItem",{data:F.value,index:I}),t.emit("activeChange",F.value)}return{getKey:S,listViewItemClass:w,onCheckItem:h,onClickItem:k}}function yd(e,t,n,r,i,a,s,c){const u=o.ref(e.view),d=o.ref(e.view==="CardView"),f=o.ref({}),l=o.ref("暂无数据"),p=md(e,t,r,a),m=hd(e,t,r),g=gd(e,t,n,p,a,s),b=o.computed(()=>({"f-list-view-group":!0,"f-list-view-group-multiselect":e.multiSelect,"d-flex":d.value,"flex-wrap":d.value})),v=o.computed(()=>!!n.value&&n.value.length>0),y=o.computed(()=>n.value.length===0);o.computed(()=>y.value&&!t.slots.empty);function C(){return u.value==="SingleView"?Dr:u.value==="DraggableView"?fd:(u.value==="ContentView"||u.value==="CardView")&&t.slots.content?dd:Dr}const F=C(),{renderItem:w}=F(e,t,n,p,i,a,g,s,m,c),{renderItem:S}=pd(e,t,n,p,i,a,g,s,m,c),N=[w,S];function h(){return n.value.filter(k=>k.visible!==!1).map((k,T)=>N[k.type](k,T,f))}function _(){return o.createVNode("div",{class:"f-list-view-emptydata"},[o.createVNode("p",{class:"f-empty-title"},[t.slots.empty?t.slots.empty():l.value])])}function x(){return o.createVNode("ul",{class:b.value,style:"list-style: none;"},[v.value&&h(),y.value&&_()])}return{renderListArea:x}}function vd(e,t,n){function r(){return t.slots.header&&o.createVNode("div",{class:"f-list-view-header"},[t.slots.header()])}return{renderHeader:r}}function Ar(e,t,n){const r=o.ref(e.headerClass),i=o.ref(e.placeholder),a=o.ref(""),s=o.computed(()=>!a.value),c=o.computed(()=>!!a.value);function u(p){a.value=""}o.watch(a,p=>{e.enableHighlightSearch&&n.search(p),t.emit("afterSearch",p)});const d=o.computed(()=>{const p={"form-group":!0,"farris-form-group":!0};return r.value&&r.value.split(" ").reduce((g,b)=>(g[b]=!0,g),p),p});function f(p){}function l(){return o.createVNode("div",{class:"f-list-view-header",onClick:o.withModifiers(()=>f,["prevent","stop"])},[o.createVNode("div",{class:d.value},[o.createVNode("div",{class:"farris-input-wrap"},[o.createVNode("div",{class:"f-cmp-inputgroup"},[o.createVNode("div",{class:"input-group f-state-editable"},[o.withDirectives(o.createVNode("input",{class:"form-control f-utils-fill text-left","onUpdate:modelValue":p=>a.value=p,name:"input-group-value",type:"text",placeholder:i.value,autocomplete:"off"},null),[[o.vModelText,a.value]]),o.createVNode("div",{class:"input-group-append"},[c.value&&o.createVNode("span",{class:"input-group-text input-group-clear",onClick:p=>u()},[o.createVNode("i",{class:"f-icon f-icon-close-circle"},null)]),s.value&&o.createVNode("span",{class:"input-group-text"},[o.createVNode("span",{class:"f-icon f-icon-search"},null)])])])])])])])}return{renderHeader:l}}function bd(){const e=o.ref(""),t=o.ref(-1),n=o.ref(""),r=o.ref(-1),i=o.ref(!1);function a(l,p,m){r.value=m}function s(l,p,m){i.value||(r.value=m)}function c(l,p,m){r.value=-1}function u(){i.value=!0}function d(){i.value=!1}function f(){t.value=-1,e.value=""}return{activeIndex:t,focusedItemId:n,hoverIndex:r,clearActiveItem:f,onMouseenterItem:a,onMouseoverItem:s,onMouseoutItem:c,resumeHover:d,suspendHover:u}}const Lr=o.defineComponent({name:"FListView",props:$r,emits:["afterSearch","checkValuesChange","clickItem","selectionChange","removeItem","change","activeChange"],setup(e,t){const n=o.ref(),r=o.ref(!0),i=o.ref(!1),a=o.ref([]),s=0,c=o.ref(e.columns),u=he.useFilter(),d=he.useIdentify(e),f=he.useHierarchy(e),l=he.useGroupData(e,d),p=he.useDataView(e,new Map,u,f,d),m=he.useSelection(e,p,d,a,t),g=ud(e,n),b=o.computed(()=>p.dataView.value.length),v=he.useRow(e,t,m,d),y=he.useEdit(e,t,d,v),C=he.useVisualDataBound(e),F=he.useVisualDataCell(e,{},C),w=he.useVisualDataRow(e,y,f,d,C,F),S=he.useVisualGroupRow(e,d,F,w),N=he.useVisualSummaryRow(e,d,F,w),h=he.useVisualData(e,c,p,b,s,w,S,N),{getVisualData:_}=h;a.value=_(0,b.value+s-1);const x=o.computed(()=>{const L={"f-list-view":!0,"f-list-view-multiple":e.multiSelect};return e.size!=="default"&&(L[`${e.size}-item`]=!0),L}),k=o.computed(()=>!!t.slots.footer||r.value);function T(){return e.header==="SearchBar"?Ar:e.header==="ContentHeader"?vd:Ar}const V=T(),{renderHeader:I}=V(e,t,g),E=bd(),{renderListArea:M}=yd(e,t,a,p,l,E,m,h);function B(L){g.search(L)}function O(L){L&&(p.load(L),a.value=_(0,b.value+s-1))}function R(){m.clearSelection(),E.clearActiveItem()}t.expose({search:B,updateDataSource:O,clearSelection:R});function q(L){e.multiSelect&&(L.preventDefault(),L.stopPropagation())}return()=>o.createVNode("div",{class:x.value,onClick:q},[I(),o.createVNode("div",{ref:n,class:"f-list-view-content",onMouseover:()=>{i.value=!0},onMouseleave:()=>{i.value=!1}},[M()]),k.value&&o.createVNode("div",{class:"f-list-view-footer"},[t.slots.footer&&t.slots.footer()])])}}),Cd=o.defineComponent({name:"FTransfer",props:jr,emits:["change","activeChange"],setup(e,t){const n=o.ref(e.identifyField),r=o.ref("已选:"),i=o.ref("项数据"),a=o.ref(e.displayType),s=o.ref(!1),c=o.ref(e.dataSource),u=o.ref(e.selections||[]),d=o.computed(()=>u.value.map(x=>x[n.value])),f=new Map,l=o.ref();function p(){const x=new Map,k=e.selectionValues||[];k.length&&k.reduce((V,I)=>(V.set(I,!0),V),x);const T=e.selections||[];T.length&&(x.clear(),T.reduce((V,I)=>(V.set(I[n.value],!0),V),x)),u.value.length||(u.value=c.value.filter(V=>x.has(V[n.value])).map(V=>Object.assign({},V))),c.value.forEach(V=>{const I=V[n.value],E=x.has(I);V.checked=E,E&&f.set(I,V)})}p();const m=o.computed(()=>a.value==="List"),g=o.computed(()=>a.value==="Tree");function b(x){u.value=x.map(k=>Object.assign({},k)),t.emit("change",u.value)}function v(){return o.createVNode(Lr,{class:"f-utils-fill",data:c.value,multiSelect:!0,itemClass:"f-transfer-list-item",selection:{enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!1,showSelection:!0},draggable:!1,header:"Search",headerClass:"transfer-search-box",selectionValues:d.value,onSelectionChange:b},{default:()=>[o.createTextVNode(" ")]})}function y(){return o.createVNode(io,{data:c.value,rowOption:e.rowOption,selection:{enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!1,showSelection:!0},selectionValues:d.value,onSelectionChange:b},null)}function C(){return o.createVNode("div",{class:"f-utils-fill option-pane d-flex flex-column"},[o.createVNode("div",{class:"f-utils-flex-column option-pane-content f-utils-fill"},[o.createVNode("div",{class:"container columns-box d-flex f-utils-fill"},[m.value&&v(),g.value&&y()])])])}function F(x){const k=x[n.value];if(k!==null||k!==void 0){u.value=u.value.filter(V=>V[n.value]!==k);const T=f.get(k);T&&(T.checked=!1,f.delete(k)),t.emit("change",u.value)}}o.watch(u,x=>{l.value.updateDataSource(x)});function w(x){const k=new Map;u.value.reduce((T,V)=>(T.set(V[n.value],V),T),k),u.value=x.map(T=>k.get(T[n.value])),t.emit("change",u.value)}function S(x){t.emit("activeChange",x)}function N(){return o.createVNode(Lr,{ref:l,style:"flex:1",data:u.value,draggable:!0,view:"DraggableView","keep-order":!0,onChange:w,onRemoveItem:F,onActiveChange:S},null)}function h(){return o.createVNode("div",{class:"f-utils-fill selection-pane d-flex flex-column"},[o.createVNode("div",{class:"f-utils-flex-column selection-pane-content f-utils-fill"},[o.createVNode("div",{class:"selection-pane-title"},[o.createVNode("span",{class:"selection-title"},[r.value]),o.createVNode("span",{class:"selection-count"},[u.value&&u.value.length]),o.createVNode("span",{class:"selection-item-title"},[i.value])]),o.createVNode("div",{class:"container columns-box f-utils-fill d-flex"},[N()])])])}const _=o.computed(()=>({"f-transfer":!0,row:!0,"f-utils-fill":s.value}));return()=>o.createVNode("div",{class:_.value,style:"height:480px"},[C(),h()])}});function wd(e,t,n,r,i){const a=o.ref(!1),s=o.ref(),c=o.ref([]),u=o.ref([]),d=o.ref([]),{getExtendSchemaProerty:f}=i;function l(S){n.value=S.length?S[0]:null}function p(S){u.value=S}function m(S,N){return f(S,N)}function g(S){if(S.$type!=="SimpleField")return;let N="",h={};switch(S.type.name){case"String":{N="input-group",h=m("input-group");break}case"Number":case"Integer":case"Decimal":case"BigNumber":{N="number-range",h=m("number-spinner");break}case"Date":case"DateTime":{N="date-picker",h=m("date-picker");break}case"Enum":{N="combo-list";const x={data:S.type.enumValues,enumValueType:"string"};h=m("combo-list",x);break}case"Boolean":{N="combo-list";const x={data:S.type.enumValues||[{name:"true",value:!0},{name:"false",value:!1}],enumValueType:"boolean"};h=m("combo-list",x);break}default:N="input-group",h=m("input-group")}if(!h)return;const _={id:S.id,labelCode:S.path,code:S.code,name:S.name,placeHolder:"",controlType:N,...h};return r.set(_.id,be.cloneDeep(_)),_}function b(){return be.cloneDeep(e.fieldsConfig).map(h=>g(h))}function v(){return b()}function y(){d.value=v();const S={},N=be.cloneDeep(e.modelValue)||[];u.value=[],N.forEach(h=>{const _=d.value.find(x=>x.id===h.id);_&&(S[h.id]={...h.editor,id:_.id,code:_.code,labelCode:_.labelCode,name:h.name,controlType:h.controlType},delete S[h.id].type,u.value.push(S[h.id]),r.set(h.id,be.cloneDeep(S[h.id])))}),a.value=!0,s.value=be.cloneDeep(S),c.value=be.cloneDeep(u.value)}function C(){const S=[];u.value.forEach(N=>{const h=r.get(N.id);if(h){const{id:_,code:x,labelCode:k,name:T,controlType:V,...I}=h,E={id:_,code:x,labelCode:k,name:T,controlType:V,editor:I};E.editor.type=V,S.push(E)}}),t.emit("update:modelValue",S),e.onFieldsChanged&&typeof e.onFieldsChanged=="function"&&e.onFieldsChanged(S),a.value=!1,n.value=null}function F(){u.value=be.cloneDeep(c.value),a.value=!1,n.value=null}function w(){return a.value?o.createVNode(Cd,{selections:u.value,"data-source":d.value,class:"query-solution-config-transfer",onActiveChange:l,onChange:p},null):null}return{renderTransfer:w,initData:y,selectPanels:u,confirm:C,cancel:F}}const Yn=o.defineComponent({name:"FQuerySolutionConfig",props:Br,emits:["update:modelValue"],setup(e,t){const n=o.ref(null),r=o.computed(()=>"共"+e.modelValue.length+"项"),i=new Map,a=td(e,t,n,i),{renderPanel:s}=a,{renderTransfer:c,initData:u,confirm:d,cancel:f}=wd(e,t,n,i,a);function l(){d()}function p(){f()}const m={fitContent:!1,width:900,height:600,draggable:!0,title:"筛选方案配置",acceptCallback:l,rejectCallback:p};function g(){return o.createVNode(o.Fragment,null,[c(),s()])}return()=>o.createVNode(Yu,{id:e.id,"button-behavior":"Modal","modal-options":m,modelValue:r.value,"onUpdate:modelValue":b=>r.value=b,onClickButton:()=>u()},{default:()=>[o.createVNode("div",{class:"query-solution-config d-flex f-utils-absolute-all"},[g()])]})}}),Sd=new Map([["appearance",jt.resolveAppearance]]);function xd(e,t,n){return t}const Fd={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/query-solution-config.schema.json",title:"solution-preset",description:"A Farris Container Component",properties:{dataSource:{description:"筛选配置项",type:"array"}}},qr={dataSource:{type:Array,default:[]},modelValue:{type:Array,default:[]},onFieldsChanged:{type:Function,default:null}},Td=jt.createPropsResolver(qr,Fd,Sd,xd),_d=o.defineComponent({name:"FSolutionPreset",props:qr,emits:["change"],setup(e,t){const n=o.ref(be.cloneDeep(e.modelValue)),r=o.ref(be.cloneDeep(e.dataSource)),i=o.computed(()=>"共"+e.modelValue.length+"项");o.watch(()=>e.modelValue,d=>{n.value=be.cloneDeep(d)}),o.watch(()=>e.dataSource,d=>{r.value=be.cloneDeep(d)});function a(d){n.value=be.cloneDeep(d)}function s(){e.onFieldsChanged&&typeof e.onFieldsChanged=="function"&&e.onFieldsChanged(n.value)}function c(){}const u={fitContent:!1,width:900,height:600,draggable:!0,title:"筛选方案配置",acceptCallback:s,rejectCallback:c};return()=>o.createVNode(to.FButtonEdit,{"button-behavior":"Modal","modal-options":u,modelValue:i.value,"onUpdate:modelValue":d=>i.value=d,editable:!1},{default:()=>[o.createVNode("div",{class:"f-utils-absolute-all"},[o.createVNode(fn.FTransfer,{selections:n.value,"data-source":r.value,class:"mx-2",onChange:a},null)])]})}}),Nd={install(e){e.component(cn.name,cn),e.component(Yn.name,Yn)},register(e,t,n,r){e["query-solution"]=cn,e["query-solution-config"]=Yn,e["solution-preset"]=_d,t["query-solution"]=In,t["query-solution-config"]=Fu,t["solution-preset"]=Td},registerDesigner(e,t,n){e["query-solution"]=Cu,t["query-solution"]=In}};J.FQuerySolution=cn,J.default=Nd,J.propsResolver=In,J.querySolutionProps=Kt,Object.defineProperties(J,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
6
+ </div>`,placement:"left"});return()=>o.createVNode("div",{class:l.value},[e.elementConfig.propertyName&&o.withDirectives(o.createVNode("label",{class:`col-form-label ${n.value}-${r.value}`},[o.createVNode("span",{class:"farris-label-text"},[i.value])]),[[o.resolveDirective("tooltip"),d]]),o.createVNode(Go,{id:r.value,showLabel:!1,editor:e.elementConfig.editor,modelValue:a.value,onChange:c,editorParams:e.elementConfig.editorParams},null)])}}),vs=o.defineComponent({name:"FPropertyPanelItemList",props:hs,emits:["valueChanged","submitModal","triggerRefreshPanel"],setup(e,t){const n=o.ref(e.category);function r(m){if(!m.hideCascadeTitle)return o.createVNode("div",{class:"farris-input-wrap"},[o.createVNode("input",{title:"summary",type:"input",class:"form-control form-control-sm",value:m.cascadeSummary,readonly:!0},null)])}function i(m,g){g.isExpand=!g.isExpand}function a(m){return o.createVNode("div",{class:"landscape"},[o.createVNode("button",{title:"expand-button",class:["btn f-btn-collapse-expand f-btn-mx px-1",{"f-state-expand":m.isExpand}],onClick:g=>i(g,m)},[o.createVNode("span",null,null)])])}function l(m){return o.createVNode("div",{class:`f-section-formgroup-legend ${n.value.categoryId}-${m.propertyID}`},[o.createVNode("div",{class:"f-header px-0 my-0 col-form-label",style:"font-size: inherit;"},[o.createVNode("div",{class:"wrap"},[o.createVNode("span",{class:["f-icon mr-1",{"f-icon-arrow-60-right":!m.isExpand,"f-icon-arrow-60-down":m.isExpand}]},null),o.createVNode("span",{class:"farris-label-text"},[m.propertyName])])])])}function c(m){return`${e.categoryKey}_${m.propertyID}`}function u(m){m.categoryId=n.value.categoryId,n.value.enableCascade&&(m.propertyPath=n.value.parentPropertyID),n.value.setPropertyRelates&&n.value.setPropertyRelates(m,e.propertyData),t.emit("valueChanged",{changeObject:m})}function d(){t.emit("triggerRefreshPanel")}function f(m){return o.createVNode("div",{class:"px-2 mb-2"},[o.createVNode(ys,{key:c(m),elementConfig:m,category:n.value,onPropertyChange:u,onTriggerRefreshPanel:d},null)])}function s(m){var g;return o.createVNode("div",{class:"propertyCascadeItem farris-panel px-2 mb-2"},[o.createVNode("div",{class:["farris-panel-item card",{hidden:!m.isExpand}]},[o.createVNode("div",{class:"card-header",onClick:b=>i(b,m)},[o.createVNode("div",{class:"panel-item-title"},[o.createVNode("div",{class:"form-group farris-form-group line-item"},[l(m),r(m),a(m)])])]),o.createVNode("div",{class:["card-body",{hidden:!m.isExpand}]},[(g=m.cascadeConfig)==null?void 0:g.map(b=>f(b))])])])}o.watch(()=>e.category,()=>{n.value=e.category});function p(m){return m.propertyType==="cascade"?s:f}return()=>o.createVNode(o.Fragment,null,[n.value.properties.map(m=>p(m)(m))])}}),bs=o.defineComponent({name:"FPropertyPanel",props:ms,emits:["propertyChanged"],setup(e,t){const n=o.ref(e.width),r=o.ref(e.isWidePanel),i=o.ref(e.enableSearch),a=o.ref(e.mode),l=o.ref(e.isPersitOpenState),c=o.ref(e.isShowPanel),u=o.ref(),d=o.ref(),f=o.ref(e.showCloseBtn),s=o.ref(e.selectedTabId),p=o.ref(!0),m=o.ref(e.isWhiteTheme);let g=[],b=[];const v=o.ref(""),y=o.ref(),C=o.ref(),F=o.inject("SchemaService");let w=[],S=null,N="";const h=o.ref(),_=o.ref(0);function x(){b=[],h.value&&h.value.categoryList&&Array.isArray(h.value.categoryList)&&h.value.categoryList.length>0&&h.value.categoryList.forEach(Q=>{if(Q.properties&&Array.isArray(Q.properties)&&Q.properties.length>0){const ee=Q.properties.map(re=>(re.category=Q,re.propertyType==="cascade"&&re.cascadeConfig&&re.cascadeConfig.map(U=>{U.category=Q,U.cascadeParent=re,b=b.concat(U)}),re));b=b.concat(ee)}})}function k(G){let Q=G.offsetTop,ee=G.offsetParent;for(;ee!==null;)Q+=ee.offsetTop,ee=ee.offsetParent;return Q}function T(G,Q){G&&Q&&Object.keys(Q).length>0&&Object.keys(Q).forEach(ee=>{var U;const re=Q[ee];(U=G.style)==null||U.setProperty(ee,re)})}function V(){return b.filter(Q=>{const ee=Q.propertyID.toLowerCase(),re=Q.propertyName.toLowerCase();return Q.visible?!!(ee&&ee.includes(v.value)||re&&re.includes(v.value)):!1})}function I(G,Q,ee){if(G===0){const re=k(Q),ge=k(ee)-re-5;Q==null||Q.scroll({top:ge,behavior:"smooth"})}}function E(G){w&&w.length>0&&(w.forEach(ee=>{ee.style.cssText=""}),w=[]),v.value=(G||"").toLowerCase();const Q=document.querySelector(".panel-body");if(!v.value)y.value&&Q&&(Q.scrollTop=0);else if(x(),b&&b.length>0){const ee=V();ee&&ee.length>0&&setTimeout(()=>{ee.forEach((re,U)=>{re.category.status="open",re.cascadeParent&&(re.cascadeParent.isExpand=!0);const ge=re.propertyType==="cascade"?`.${re.category.categoryId}-${re.propertyID} .farris-label-text`:`.property-item .${re.category.categoryId}-${re.propertyID}.col-form-label`,Pe=document.querySelector(ge);Pe&&(I(U,Q,Pe),T(Pe,{color:"#5B89FE"}),w.push(Pe))})},50)}}function M(G){E(G)}function B(G){const{value:Q}=G.target;G.key==="Enter"&&M(Q)}function O(G){const{value:Q}=G.target;M(Q)}function R(){l.value||(p.value=!1),t.emit("closePropertyPanel")}function q(G){v.value="",E()}function L(G){!G.status||G.status==="open"?G.status="closed":G.status="open"}function X(){var G,Q;if(g=[],!u.value||u.value.length===0){g=[{tabId:"default",tabName:"属性",categoryList:[]}],h.value=null;return}if((G=u==null?void 0:u.value)==null||G.forEach(ee=>{if(ee.tabId){const re=g.find(U=>U.tabId===ee.tabId);re?(re.categoryList.push(ee),re.hide&&(re.hide=ee.hide||ee.properties.length===0)):g.push({tabId:ee.tabId,tabName:ee.tabName,categoryList:[ee],hide:ee.hide||ee.properties.length===0})}else{const re=g.find(U=>U.tabId==="default");re?re.categoryList.push(ee):g.push({tabId:"default",tabName:"属性",categoryList:[ee]})}}),s.value){const ee=g==null?void 0:g.find(re=>re.tabId===s.value&&!re.hide);h.value=ee||g[0]}else h.value=g[0];s.value=(Q=h.value)==null?void 0:Q.tabId}o.watch(()=>[e.schema,e.isShowPanel],()=>{d.value=e.schema,!e.schema||!e.schema.type?u.value=[]:u.value=vn(d.value,F,S,N),X(),q(v.value),_.value++}),o.onMounted(()=>{X()});function te(G,Q){(!d.value||Q)&&(d.value=Q||e.schema),u.value=vn(d.value,F,S,N,G),X(),q(v.value),_.value++}function ie(G,Q){S=G,N=Q}function ue(){a.value=a.value==="panel"?"sidebar":"panel",a.value==="panel"?(setTimeout(()=>{M()},100),n.value="300px"):n.value="41px"}function D(){if(f.value)return o.createVNode("div",{class:"title-actions"},[o.createVNode("div",{class:"monaco-toolbar"},[o.createVNode("div",{class:"monaco-action-bar animated"},[o.createVNode("ul",{class:"actions-container",role:"toolbar"},[o.createVNode("li",{class:"action-item",onClick:R},[o.createVNode("span",{class:"f-icon f-icon-close"},null)])])])])])}function ne(){u.value=vn(d.value,F,S,N),X()}function pe(){var G;if(i.value&&((G=h.value)==null?void 0:G.tabId)!=="commands")return o.createVNode("div",{class:"search"},[o.createVNode("div",{class:"input-group f-state-editable border-left-0 border-right-0"},[o.createVNode("input",{class:"form-control f-utils-fill text-left pt-3 pb-3 textbox",type:"text",placeholder:"输入属性名称或编号快速定位",autocomplete:"off",onKeyup:Q=>B(Q),value:v.value},null),o.createVNode("div",{class:"input-group-append",style:"margin-left: 0px;"},[o.createVNode("span",{class:"input-group-text input-group-clear",style:[{display:v.value&&v.value.length>0?"":"none"}],onClick:Q=>q()},[o.createVNode("i",{class:"f-icon modal_close"},null)]),o.createVNode("span",{class:"input-group-text input-group-clear",onClick:Q=>O(Q)},[o.createVNode("i",{class:"f-icon f-icon-search"},null)])])])])}function oe(G){return`${e.propertyName}_${G.categoryId}`}function A(G){t.emit("propertyChanged",{...G,designerItem:S})}function Y(){var G,Q;if(h.value)return o.createVNode("div",{class:"panel-body",ref:C},[o.createVNode("ul",{class:["property-grid",{"wide-panel":r.value}]},[(Q=(G=h.value)==null?void 0:G.categoryList)==null?void 0:Q.map(ee=>o.createVNode("li",{key:oe(ee),"data-category-id":ee==null?void 0:ee.categoryId},[!ee.hide&&!ee.hideTitle&&o.createVNode("span",{class:"group-label",onClick:()=>L(ee)},[o.createVNode("span",{class:["f-icon mr-2",{"f-legend-show":ee.status==="closed"},{"f-legend-collapse":ee.status==="open"||ee.status===void 0}]},null),ee.categoryName]),o.createVNode("div",{hidden:ee.status==="closed"},[o.createVNode(vs,{key:`${ee==null?void 0:ee.categoryId}-${_.value}`,category:ee,propertyData:d.value,onTriggerRefreshPanel:ne,onValueChanged:A},null)])]))])])}function we(){if(a.value==="sidebar")return o.createVNode("div",{class:"side-panel h-100",onClick:ue},[o.createVNode("i",{class:"f-icon f-icon-engineering w-100 icon"},null),o.createVNode("span",null,[o.createTextVNode("属性")])])}function Ce(){return{display:p.value?"block":"none",width:n.value}}function je(){return o.createVNode("div",{class:"switcher"},[o.createVNode("i",{class:"f-icon f-icon-exhale-discount",style:[{transform:a.value==="sidebar"?"none":"rotate(180deg)"}],onClick:ue},null)])}function De(G){h.value=G,s.value=h.value.tabId,v.value=""}function Be(){return g.map(G=>o.createVNode("div",{class:["title-label",{active:h.value&&h.value.tabId===G.tabId},{hidden:G.hide}],onClick:()=>De(G)},[o.createVNode("span",null,[G.tabName])]))}o.onMounted(()=>{M(v.value)}),o.onBeforeMount(()=>{l.value&&(p.value=c.value),X(),M(v.value)});function me(){_.value++}return t.expose({updatePropertyConfig:te,updateDesignerItem:ie,reloadPropertyPanel:me}),()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{ref:y,class:["property-panel",{"white-theme":m.value}],style:Ce()},[o.createVNode("div",{class:"propertyPanel panel flex-column",hidden:a.value!=="panel"},[o.createVNode("div",{class:["title d-flex",{"p-right":f.value},{only:g.length===1}]},[Be(),D()]),pe(),Y()]),je(),we()])])}});function Cs(e,t,n){function r(){const l=n.componentId;if(!l)return!1;const c=e.formSchemaUtils.getViewModelIdByComponentId(l);if(!c)return!1;const{schema:u}=t,{designViewModelUtils:d}=e,s=d.getDgViewModel(c).fields.find(p=>p.id===u.binding.field);return!(!s||s.$type!==Fo.SimpleField)}function i(){const{schema:l}=t;return!!e.formSchemaUtils.getVariableById(l.binding.field)}function a(){var u;const{schema:l}=t;let c=!0;if(!e||!((u=l.binding)!=null&&u.field))return c;switch(l.binding.type){case Vn.Form:{c=r();break}case Vn.Variable:c=i()}return c}return{checkBindingFieldValidation:a}}const ws=o.defineComponent({name:"FDynamicFormGroupDesign",props:Ht,emits:["change","update:modelValue"],setup(e,t){var F;const n=o.ref(e.id),r=o.ref(e.customClass),i=o.ref(e.editor),a=o.ref(e.label),l=o.ref(e.modelValue),c=o.ref(!0),u=o.ref(((F=e.editor)==null?void 0:F.required)===!0),d=o.ref(e.showLabel);o.ref(e.type);const f=o.ref(),s=o.inject("designer-host-service"),p=o.inject("design-item-context"),{resolveEditorProps:m,resolveEditorType:g}=ps(),b=o.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":c.value,"form-group-in-canvas":!0})),v=o.computed(()=>{const w=i.value.type||"input-group",S=g(w),N=m(w,i.value);return()=>o.createVNode(S,o.mergeProps({ref:f},N,{modelValue:l.value,"onUpdate:modelValue":h=>l.value=h}),null)});o.watch([()=>e.id,()=>e.customClass,()=>e.editor,()=>e.label,()=>e.modelValue,()=>e.readonly,()=>e.showLabel],([w,S,N,h,_,x,k])=>{var T;n.value=w,r.value=S,i.value={...N},a.value=h,l.value=_,c.value=x,u.value=((T=i.value)==null?void 0:T.required)===!0,d.value=k},{deep:!0});const{checkBindingFieldValidation:y}=Cs(s,p,e);function C(){const w=y();return o.createVNode(Uo,{id:`${n.value}-lable`,required:u.value,text:a.value,title:a.value,valid:w,inValidTip:"绑定信息已失效,请切换绑定或移除控件"},null)}return t.expose({editorRef:f}),()=>o.createVNode("div",{id:`${n.value}-input-group`,class:r.value},[o.createVNode("div",{class:"farris-group-wrap"},[o.createVNode("div",{class:b.value},[d.value&&C(),o.createVNode("div",{class:"farris-input-wrap"},[v.value()])])])])}});function Ss(e,t){function n(){return!0}function r(){return!0}function i(){return!1}function a(){return!0}function l(d){var b;const f=t==null?void 0:t.designViewModelUtils,s=t==null?void 0:t.formSchemaUtils,p=(b=e==null?void 0:e.componentInstance.value)==null?void 0:b.belongedComponentId;if(!p||!f||!s)return;const m=s.getViewModelIdByComponentId(p),g=f.getDgViewModel(m);g&&g.removeField([d])}function c(d){const f=t==null?void 0:t.formSchemaUtils;if(f.getExpressions().length){const s=f.getExpressions().findIndex(p=>p.fieldId===d);s>-1&&f.getExpressions().splice(s,1)}}function u(){const{schema:d}=e,f=d.binding&&d.binding.field;f&&(l(f),c(f))}return{canAccepts:i,checkCanDeleteComponent:r,checkCanMoveComponent:n,hideNestedPaddingInDesginerView:a,onRemoveComponent:u}}const xs=o.defineComponent({name:"FFormGroupDesign",props:Ht,emits:[],setup(e,t){const n=o.ref(),r=o.inject("design-item-context"),i=o.inject("designer-host-service"),a=Ss(r,i),l=xn(n,r,a);return o.onMounted(()=>{n.value.componentInstance=l,l.value.getPropConfig=(...c)=>{var d,f,s;let u=At[e.editor.type];return u&&Object.keys(u).length===0&&((d=n.value)!=null&&d.editorRef)&&((s=(f=n.value)==null?void 0:f.editorRef)!=null&&s.getPropConfig)&&(u=n.value.editorRef.getPropConfig(...c,l.value)),u}}),t.expose(l.value),()=>o.createVNode(ws,o.mergeProps(e,{ref:n}),null)}});Ue({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number],default:""},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},To,wn,void 0);const Fs={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/grid-field-editor.schema.json",title:"response-form-layout-setting",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"response-form-layout-setting"},initialState:{description:"",type:"object"}},required:["id","type"]},Ts={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};jt.createPropsResolver(Ts,Fs,wa,Ta);const _s={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function In(){return new DOMException("The request is not allowed","NotAllowedError")}async function Ns(e){if(!navigator.clipboard)throw In();return navigator.clipboard.writeText(e)}async function Vs(e){const t=document.createElement("span");t.textContent=e,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const n=window.getSelection(),r=window.document.createRange();n==null||n.removeAllRanges(),r.selectNode(t),n==null||n.addRange(r);let i=!1;try{i=window.document.execCommand("copy")}finally{n==null||n.removeAllRanges(),window.document.body.removeChild(t)}if(!i)throw In()}async function ks(e){try{await Ns(e)}catch(t){try{await Vs(e)}catch(n){throw n||t||In()}}}function Es(){async function e(t){await ks(t)}return{onCopy:e}}function Is(e,t,n,r){const i=o.ref(14),a=o.ref(140),l=o.ref(""),c=o.ref(r.value.length),u=o.computed(()=>r.value),d=o.computed(()=>({"font-size":`${i.value}px`,height:"100%"}));function f(s){if(s.currentTarget){const p=s.currentTarget.value||"";c.value=p.length}}return()=>o.createVNode(o.Fragment,null,[o.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:d.value,rows:"4",maxlength:a.value,onInput:s=>f(s)},[u.value]),o.createVNode("span",{class:"textarea-wordcount",title:l.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[c.value+" / "+a.value])])}function Ms(e,t,n,r){const i=Is(e,t,n,r),a=new Map([["text-area",i]]);function l(c){return a.get(c)||null}return{getEditorRender:l}}function Os(){const e=o.ref(!1),t=o.ref("复制成功");return{feedbackStyle:o.computed(()=>{const r={position:"absolute",left:"50%",top:"50%",width:"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease"};return r.opacity=e.value?"0.8":"0",r.display=e.value?"":"none",r}),feedbackMessage:t,toShowFeedback:e}}function Bs(e,t){const n=t.getEditorRender(e.promptEditorType);return()=>n&&n()}function Ps(e){const t=o.computed(()=>!!e.value&&!!e.value.date),n=o.computed(()=>`发生时间 : ${e.value&&e.value.date||""}`),r=o.computed(()=>!!e.value&&!!e.value.detail),i=o.computed(()=>"详细信息 : "+(e.value&&e.value.detail||"")),a="exp_switch_"+new Date().getTime();return()=>o.createVNode("div",{class:"toast-msg-detail"},[t.value&&o.createVNode("div",null,[n.value]),r.value&&o.createVNode("div",{class:"exception_wrap"},[o.createVNode("input",{type:"checkbox",id:a,class:"d-none exp_switch"},null),o.createVNode("div",{class:"exception_error_msg"},[o.createVNode("label",{class:"swith",htmlFor:a},null),o.createVNode("div",{innerHTML:i.value},null)])])])}function Rs(e){return()=>o.createVNode("p",{class:"toast-msg-detail",innerHTML:e.value},null)}function js(e,t,n,r){const i=o.ref(e.exceptionInfo),a=o.computed(()=>{const p={"f-icon":!0},m=`f-icon-${t.value}`;return p[m]=!0,p}),l=o.computed(()=>n.value||i.value&&i.value.message),c=o.computed(()=>r.value),u=o.computed(()=>!!r.value),d=o.computed(()=>!!i.value);function f(){return d.value?Ps(i):u.value?Rs(c):()=>null}const s=f();return()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:a.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[o.createVNode("p",{class:"toast-msg-title",innerHTML:l.value},null),s()])])}function Ds(e,t,n){const{onCopy:r}=t,{toShowFeedback:i}=n,a=o.ref("复制成功"),l=o.ref("复制详细信息"),c=o.ref(e.exceptionInfo||{date:"",message:"",detail:""}),u=o.computed(()=>c.value&&c.value.detail||"");function d(f){r(u.value).catch(s=>{a.value="复制失败"}).finally(()=>{i.value=!0,setTimeout(()=>{i.value=!1},700)})}return()=>o.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[o.createVNode("span",{onClick:d,style:"cursor: pointer;"},[l.value])])}function $s(e,t,n,r){const i=o.ref(e.type),a=o.ref(e.buttons),l=o.ref(e.exceptionInfo),c=o.ref(e.okButtonText),u=o.ref(e.cancelButtonText),d=o.ref(!0),f=o.ref(!0),s=o.computed(()=>!!(a.value&&a.value.length)),p=o.computed(()=>l.value&&l.value.date&&l.value.message&&l.value.detail),m=o.computed(()=>!(a.value&&a.value.length)&&(c.value||u.value)),g=o.computed(()=>f.value&&c.value),b=o.computed(()=>d.value&&u.value),v=Ds(e,n,r);function y(F){i.value==="question"&&t.emit("reject"),t.emit("close")}function C(F){i.value==="question"&&t.emit("accept"),t.emit("close")}return()=>o.createVNode("div",{class:"modal-footer"},[p.value&&v(),m.value&&b.value&&o.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:y},[u.value]),m.value&&g.value&&o.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:C},[c.value]),s.value&&a.value.length&&a.value.map(F=>o.createVNode("button",{type:"button",onClick:F.handle,class:F.class},[F.iconClass&&o.createVNode("span",{class:F.iconClass},null),F.text]))])}const Jt=o.defineComponent({name:"FMessageBox",props:_s,emits:["accept","reject","close"],setup(e,t){const n=o.ref(e.type),r=o.ref(e.title),i=o.ref(e.detail),a=o.computed(()=>{const v={"modal-tips":!0,"d-flex":!0,"flex-row":!0},y=`messager-type-${n.value}`;return v[y]=!0,v}),l=o.computed(()=>{const v={};return n.value==="prompt"?v.padding="0.5rem 0.5rem 1rem 1.5rem":n.value==="error"&&(v.padding="0.5rem 1.5rem 1rem 1.5rem"),v}),c=Es(),u=Ms(e,n,r,i),d=Os(),{feedbackStyle:f,feedbackMessage:s}=d;function p(){return o.createVNode("div",{style:f.value},[s.value])}function m(){switch(n.value){case"prompt":return Bs(e,u);default:return js(e,n,r,i)}}const g=m(),b=$s(e,t,c,d);return()=>o.createVNode("div",{class:"farris-messager"},[o.createVNode("section",{class:a.value,style:l.value},[g()]),b(),p()])}});class yt{static show(t){const n=o.reactive({...t}),r=!1,i=n.type==="error"||n.type==="prompt",a=n.type==="error"?"错误提示":n.type==="prompt"&&n.title||"",l=n.acceptCallback||(()=>{}),c=n.rejectCallback||(()=>{});let u=null,d=new jo(u);const f=()=>{u&&(u==null||u.destroy(),d=null)};return u=d==null?void 0:d.open({class:"modal-message modal-message-type-info",title:a,showButtons:r,showHeader:i,width:n.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>o.createVNode(Jt,o.mergeProps(n,{onAccept:l,onReject:c,onClose:f}),null)}),d==null?void 0:d.getCurrentModal()}static info(t,n){const r=o.reactive({type:"info",title:t,detail:n,okButtonText:"知道了",cancelButtonText:""});yt.show(r)}static warning(t,n){const r=o.reactive({type:"warning",title:t,detail:n,okButtonText:"知道了",cancelButtonText:""});yt.show(r)}static success(t,n){const r=o.reactive({type:"success",title:t,detail:n,okButtonText:"关闭",cancelButtonText:""});yt.show(r)}static error(t,n,r){const i=o.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:r,message:t,detail:n}});yt.show(i)}static prompt(t,n){const r=o.reactive({type:"prompt",title:t,detail:n,okButtonText:"确定",cancelButtonText:"取消"});yt.show(r)}static question(t,n,r,i){const a=o.reactive({type:"question",title:t,detail:n,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:r,rejectCallback:i});yt.show(a)}}Jt.install=e=>{e.component(Jt.name,Jt),e.provide("FMessageBoxService",yt)};var Tt=(e=>(e[e.Value=0]="Value",e[e.SmartHelp=1]="SmartHelp",e[e.Enum=2]="Enum",e[e.Express=3]="Express",e))(Tt||{});function Jo(){const e=o.ref({relation:0,items:[],children:[],path:[],groupId:0,level:0}),t=new Map,n=new Map;let r=0;function i(){return{id:"",fieldCode:"",fieldName:"",compareType:Je.Equal,valueType:Tt.Value,value:new qt,relation:0,conditionId:Date.now()}}function a(x,k){return{relation:x,items:[],children:[],path:[],groupId:++r,level:k}}function l(){const x=Object.assign({},e.value);n.forEach((k,T)=>{k.groupId===x.groupId&&n.set(T,x)}),t.forEach((k,T)=>{k.groupId===x.groupId&&t.set(T,x)}),e.value=x}function c(x){const k=new Map;let T=0;return x.forEach((V,I)=>{var E,M;if(T+=((E=V.lBracket)==null?void 0:E.length)||0,k.set(I,T),T-=((M=V.rBracket)==null?void 0:M.length)||0,T<0)throw new Error("The right bracket is out of range.")}),k}function u(x,k,T,V,I){for(let E=0;E<k;E++){const M=x+(E+1),B=a(I,M);T.children.push(B),n.set(B.groupId,T),T=T.children[T.children.length-1],V.push(T)}return T}function d(x,k,T,V,I){for(let O=k;O<=0;O++)V.pop();const E=V[V.length-1];if(!E)throw new Error("The group path is out of range");const M=x+k,B=a(I,M);return E.children.push(B),n.set(B.groupId,E),T=E.children[E.children.length-1],V.push(T),T}function f(x,k,T,V){T.pop();const I=T[T.length-1],E=a(V,x);return I.children.push(E),n.set(E.groupId,I),k=I.children[I.children.length-1],T.push(k),k}function s(x,k,T,V,I,E){let M=x[x.length-1];if(!M)throw new Error("The group path is out of range");const B=k.get(V)||0,O=k.get(T)||0;if(T<0||T===V)return x[x.length-1];const R=B-O,q=I&&I.relation!==void 0?I.relation:1;return M=R>0?u(O,R,M,x,q):M,M=R<0?d(O,R,M,x,q):M,M=R===0&&O>0&&B>0&&I&&E&&!!I.rBracket&&!!E.lBracket?f(O,M,x,q):M,M}function p(x){const T={relation:x.length&&x[0].relation!==void 0?x[0].relation:1,items:[],children:[],path:[],groupId:0,level:0},V=[T],I=c(x);return x.forEach((E,M)=>{const B=M-1,O=x[B],R=s(V,I,B,M,O,E);R.items.push(E),t.set(E.conditionId,R)}),e.value=T,T}function m(){const x=i();t.set(x.conditionId,e.value),e.value.items.push(x)}function g(x){if(!x)return;const k=t.get(x.conditionId);if(k){const T=k.items.findIndex(I=>I.conditionId===x.conditionId)+1,V=i();t.set(V.conditionId,k),k.items.splice(T,0,V),l()}}function b(x,k,T,V){x.reduce((I,E)=>{const M=E.conditionId!==void 0,B=E.groupId!==void 0;if(M){const O=E;T.push(O),I.items.set(O.conditionId,O)}if(B){const O=E;V.push(O),I.groups.set(O.groupId,O)}return I},k)}function v(x,k,T,V,I){x&&(x.items=k.length?x.items.filter(E=>!T.has(E.conditionId)):x.items,x.children=V.length?x.children.filter(E=>!I.has(E.groupId)):x.children)}function y(x,k,T){k.forEach(V=>{x.items.push(V),t.set(V.conditionId,x)}),T.forEach(V=>{x.children.push(V),n.set(V.groupId,x)})}function C(x){const k=x[0],T=k.conditionId!==void 0?t.get(k.conditionId):n.get(k.groupId),V={items:new Map,groups:new Map},I=[],E=[];if(T){b(x,V,I,E),v(T,I,V.items,E,V.groups);const M=a(T.relation,T.level+1);y(M,I,E),T.children.push(M),n.set(M.groupId,T),l()}}function F(x){const k=[...x.items],T=[...x.children],V=n.get(x.groupId);V&&(V.children=V.children.filter(I=>I.groupId!==x.groupId),n.delete(x.groupId),k.forEach(I=>{V.items.push(I),t.set(I.conditionId,V)}),T.forEach(I=>{V.children.push(I),n.set(I.groupId,V)}),l())}function w(x){x.relation=x.relation===1?2:1,l()}let S;function N(x){const{relation:k}=x;return(x.children&&x.children.length?x.children.map((V,I,E)=>{const M=S(V);return M[0].lBracket=(M[0].lBracket||"")+"(",M[M.length-1].rBracket=(M[M.length-1].rBracket||"")+")",M[M.length-1].relation=I<E.length-1?k:0,M}):[]).flat()}S=(x=e.value)=>{const{relation:k}=x,T=x.items.map((I,E,M)=>(I.lBracket=E===0?"(":"",I.rBracket=E===M.length-1?")":"",I.relation=E<M.length-1?k||1:0,I)),V=N(x);return[...T,...V]};function h(x){const k=x||e.value;if(k.children.length&&k.children.forEach(T=>{h(T)}),k.level===0&&!k.items.length&&k.children.length===1){const T=k.children[0];e.value.relation=T.relation,F(T)}else k.items.length===0&&k.children.length<=1&&F(k)}function _(x){const k=t.get(x.conditionId);k&&(k.items=k.items.filter(T=>T.conditionId!==x.conditionId),t.delete(x.conditionId),h(),l())}return{addCondition:m,changeGroupRelation:w,conditionGroupMap:t,getConditions:S,group:C,groupParentMap:n,insertConditionTo:g,loadConditionGroup:p,refresh:l,removeCondition:_,rootGroup:e,unGroup:F}}function As(e,t,n){const r=o.ref(new Set),i=o.ref(new Set),{conditionGroupMap:a,groupParentMap:l}=n;let c,u;function d(y){let C=c.level<=y.level?c:y,F=c.level>y.level?c:y;const w=[];for(;F&&C&&F!==C;)F.level>C.level?(w.push(F),F=l.get(F.groupId)):F.level===C.level&&(C=l.get(C.groupId),C&&w.unshift(C));return w}function f(y){i.value.add(y.groupId),y.items.forEach(C=>r.value.add(C.conditionId)),y.children.forEach(C=>f(C))}function s(y){const{conditionId:C}=y;r.value.add(C),c=r.value.size===0?a.get(C):c;const F=a.get(y.conditionId);d(F).forEach(S=>f(S))}const p=o.computed(()=>r.value.size===0&&i.value.size===1),m=function(y){i.value.delete(y.groupId),y.items.forEach(F=>u(F)),y.children.forEach(F=>!p.value&&m(F));const C=l.get(y.groupId);C&&i.value.has(C.groupId)&&m(C)};u=function(y){const{conditionId:C}=y;if(r.value.has(C)&&r.value.delete(C),i.value.size>0){const F=a.get(C);F&&i.value.has(F.groupId)&&m(F)}};function g(y){const{conditionId:C}=y;r.value.size===0&&(c=a.get(C)),r.value.has(C)?u(y):s(y)}function b(){const y=[];return c&&(c.items.filter(C=>r.value.has(C.conditionId)).forEach(C=>y.push(C)),c.children.filter(C=>i.value.has(C.groupId)).forEach(C=>y.push(C))),y}function v(){r.value.clear(),i.value.clear()}return{clear:v,getSelectedGroupItem:b,selectedItems:r,toggleSelect:g}}const Qt=o.defineComponent({name:"FConditionList",props:bn,emits:["valueChange","labelCodeChange","compareTypeChange"],setup(e,t){const n=o.ref(e.key),r=o.ref(e.conditions),i=Cn(e),{convertToSingleControl:a,fields:l,fieldMap:c,loadFieldConfigs:u}=i,d=Jo(),{addCondition:f,changeGroupRelation:s,getConditions:p,group:m,insertConditionTo:g,loadConditionGroup:b,refresh:v,removeCondition:y,rootGroup:C,unGroup:F}=d,{createConditionValue:w}=So(),S=As(e,t,d),{selectedItems:N,toggleSelect:h}=S,{getCompareOperators:_}=ba(e,t,i);u(!1),l.value=a(l.value),b(r.value);function x(te){var ue;const ie=((ue=c.get(te.fieldCode))==null?void 0:ue.editor)||{type:"text"};te.value=w(ie.type,void 0),t.emit("labelCodeChange",te)}function k(te,ie){t.emit("compareTypeChange",ie)}function T(){}t.expose({getConditions:p});function V(te,ie){t.emit("valueChange",te,ie)}function I(te){return o.createVNode("div",{class:"condition-list-item-type mr-3"},[o.createVNode(pn,{"value-field":"labelCode","text-field":"name","id-field":"id",data:l.value,modelValue:te.fieldCode,"onUpdate:modelValue":ie=>te.fieldCode=ie,onChange:ie=>x(te)},null)])}function E(te){return o.createVNode("div",{class:"condition-list-item-compare mr-3"},[o.createVNode(pn,{"value-field":"value","text-field":"name","id-field":"id",data:_(te),modelValue:te.compareType,"onUpdate:modelValue":ie=>te.compareType=ie,onChange:ie=>k(ie,te)},null)])}function M(te){var ie;return o.createVNode("div",{class:"condition-list-item-control mr-3"},[o.createVNode(Go,{editor:(ie=c.get(te.fieldCode))==null?void 0:ie.editor,showLabel:!1,modelValue:te.value.value,"onUpdate:modelValue":ue=>te.value.value=ue,onChange:ue=>{V(ue,te)}},null)])}function B(te){return[o.createVNode("div",{class:"condition-list-item-extend"},[o.createVNode("span",{class:"f-icon f-icon-plus-sm mr-2",onClick:()=>g(te)},null),o.createVNode("span",{class:"f-icon f-icon-minus-sm",onClick:()=>y(te)},null)]),o.createVNode("div",{class:"custom-control custom-checkbox"},[o.createVNode("input",{title:"selection",class:"custom-control-input",type:"checkbox",checked:N.value.has(te.conditionId)},null),o.createVNode("label",{class:"custom-control-label",onClick:()=>h(te)},null)])]}function O(te){return te.items.map(ie=>o.createVNode("div",{class:"condition-list-item",key:ie.conditionId},[I(ie),E(ie),M(ie),B(ie)]))}function R(te){return o.createVNode("div",{class:"condition-list-relation"},[o.createVNode("span",{class:"condition-list-relation-close f-icon-filter-cancel btn-link",onClick:()=>F(te)},null),o.createVNode("span",{class:"condition-list-relation-text btn-link",onClick:()=>s(te)},[te.relation===1?"与":"或"])])}function q(te){return o.createVNode("div",{class:"condition-list-content"},[o.createVNode("div",{class:"condition-list-content-group"},[O(te),te.children&&te.children.map(ie=>q(ie))]),R(te)])}function L(){m(S.getSelectedGroupItem()),S.clear()}function X(){return o.createVNode("div",{class:"condition-list-bottom"},[o.createVNode("div",{class:"add-condition-btn mb-1 mr-3",onClick:f},[o.createVNode("span",{class:"f-icon f-icon-filter-add"},null),o.createVNode("span",{class:"ml-1"},[o.createTextVNode("添加条件")])]),o.createVNode("div",{class:"add-condition-btn mb-1",onClick:L},[o.createVNode("span",{class:"f-icon f-icon-filter-grouping"},null),o.createVNode("span",{class:"ml-1"},[o.createTextVNode("生成条件组")])]),o.createVNode("div",{class:"condition-list-reset add-condition-btn",onClick:T},[o.createTextVNode("重置")])])}return()=>o.createVNode("div",{class:"condition-list",key:n.value},[o.createVNode("div",{class:"condition-list-body"},[q(C.value)]),X()])}});Qt.install=e=>{e.component(Wt.name,Wt).component(Qt.name,Qt)};function Ls(e,t){return{solutions:[{id:"default",code:"default",name:"默认筛选方案",conditions:t.map((i,a)=>{const{id:l,labelCode:c,name:u}=i,d=Je.Equal,f=Tt.Value;return{id:l,fieldCode:c,fieldName:u,compareType:d,valueType:f,value:{},conditionId:a}}),isSystem:!0,isDefault:!0,type:"",mode:"1"}]}}const qs=new Map([["appearance",ht],["preset",Ls]]),Ws={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/query-solution.schema.json",title:"query-solution",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a query solution",type:"string"},type:{description:"The type string of query solution component",type:"string",default:"query-solution"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},formId:{description:"",type:"string",default:!0},isControlInline:{description:"",type:"boolean",default:!0},expanded:{description:"",type:"boolean",default:!0},fields:{description:"",type:"array",default:[]},presetFields:{description:"",type:"array"},solutions:{description:"",type:"array"},presetQuerySolutionName:{description:"",type:"string",default:"默认筛选方案"},filterText:{description:"",type:"string",default:"筛选"}}};function Qo(){function e(){const n=r=>{const i=Math.random()*16|0;return(r==="x"?i:i&3|8).toString(16)};return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n)}function t(n,r){const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=[];let l;if(r=r||i.length,n)for(l=0;l<n;l++)a[l]=i[0|Math.random()*r];else{let c;for(a[8]=a[13]=a[18]=a[23]="-",a[14]="4",l=0;l<36;l++)a[l]||(c=0|Math.random()*16,a[l]=i[l===19?c&3|8:c])}return a.join("")}return{guid:e,uuid:t}}const Hs=["moz","ms","webkit"];function Us(){let e=0;return t=>{const n=new Date().getTime(),r=Math.max(0,16-(n-e)),i=setTimeout(()=>{t(n+r)},r);return e=n+r,i}}function zs(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const e=Hs.filter(t=>`${t}RequestAnimationFrame`in window)[0];return e?window[`${e}RequestAnimationFrame`]:Us()}zs();function Gs(e,t){const n=t==null?void 0:t.formSchemaUtils,r=e.parentComponentInstance,i="54bddc89-5f7e-4b91-9c45-80dd6606cfe9";function a(c){const u=r.belongedComponentId,d=n.getViewModelIdByComponentId(u),f=n.getViewModelById(d);let s;if(f&&f.commands){let m=f.commands.find(b=>b.handlerName==="Filter"&&b.cmpId===i);if(!m)s=Qo().guid(),m={id:s,code:"rootviewmodelFilter1",name:"过滤并加载数据1",params:[{name:"filter",shownName:"过滤条件",value:"{UISTATE~/#{root-component}/originalFilterConditionList}"},{name:"sort",shownName:"排序条件",value:""}],handlerName:"Filter",cmpId:i,shortcut:{},extensions:[]},f.commands.push(m);else if(m.params&&m.params.length){const b=m.params.find(v=>v.name==="filter");b&&(b.value="{UISTATE~/#{root-component}/originalFilterConditionList}")}const g=m.code;c.onQuery=g}const p=n.getFormSchema().module.webcmds;if(p){let m=p.find(g=>g.id===i);m||(m={id:i,path:"igix/Web/WebCmp/bo-webcmp/metadata/webcmd/data-commands",name:"LoadCommands.webcmd",refedHandlers:[]},n.getFormSchema().module.webcmds.push(m)),s&&m.refedHandlers.push({host:s,handler:"Filter"})}}function l(){const c=$t(ae.section.type),u=$t(ae["query-solution"].type);if(!c||!u)return;const d=Math.random().toString(36).slice(2,6);Object.assign(c,{id:"solution-container-"+d,appearance:{class:"f-section-scheme f-section-in-managelist"},showHeader:!1,contents:[u]}),Object.assign(u,{id:"solution-"+d,fields:[],presetFields:[],formId:n.getFormMetadataBasicInfo().code});const f=r.schema;f&&(f.appearance?f.appearance.class&&!f.appearance.class.includes("f-page-has-scheme")&&(f.appearance.class+=" f-page-has-scheme"):f.appearance.class="f-page-has-scheme");const s=r.belongedComponentId,p=n.getViewModelIdByComponentId(s),m=n.getViewModelById(p);m!=null&&m.states&&(m.states.find(b=>b.code==="originalFilterConditionList")||m.states.push({id:Qo().guid(),category:"locale",code:"originalFilterConditionList",name:"筛选方案筛选条件",type:"String"})),a(u);const g=t==null?void 0:t.useFormCommand;return g&&g.checkCommands(),c}return{createQuerySolution:l}}function Xs(e,t,n,r){if(n.parentComponentInstance&&r){const l=Gs(n,r).createQuerySolution();if(l)return l}return t}const Kt={formId:{type:String,default:""},fields:{type:Array,default:[]},presetFields:{type:Array,default:[]},solutions:{type:Array,default:[]},isControlInline:{type:Boolean,default:!0},filterText:{type:String,default:"筛选"},expanded:{type:Boolean,default:!0},openAdvancedMode:{type:Boolean,default:!1},presetQuerySolutionName:{type:String,default:"默认筛选方案"}},Mn=Ue(Kt,Ws,qs,Xs);var at=(e=>(e[e.Value=0]="Value",e[e.Express=1]="Express",e))(at||{}),Ae=(e=>(e[e.Empty=0]="Empty",e[e.And=1]="And",e[e.Or=2]="Or",e))(Ae||{}),ze=(e=>(e[e.Equal=0]="Equal",e[e.NotEqual=1]="NotEqual",e[e.Greater=2]="Greater",e[e.GreaterOrEqual=3]="GreaterOrEqual",e[e.Less=4]="Less",e[e.LessOrEqual=5]="LessOrEqual",e[e.Like=6]="Like",e[e.LikeStartWith=7]="LikeStartWith",e[e.LikeEndWith=8]="LikeEndWith",e[e.NotLike=9]="NotLike",e[e.NotLikeStartWith=10]="NotLikeStartWith",e[e.NotLikeEndWith=11]="NotLikeEndWith",e[e.Is=12]="Is",e[e.IsNot=13]="IsNot",e[e.In=14]="In",e[e.NotIn=15]="NotIn",e))(ze||{});function Ys(e,t){function n(s){const p=s.value,m=[];return m.push({FilterField:s.fieldCode,Compare:s.compareType||s.compareType===0?s.compareType:ze.Like,Value:p.value,Relation:s.relation||s.relation===0?s.relation:Ae.And,Expresstype:at.Value,Lbracket:s.Lbracket||null,Rbracket:s.Rbracket||null}),m}function r(s){const p=s.value.getValue();return[{FilterField:s.fieldCode,Compare:s.compareType||s.compareType===0?s.compareType:ze.Equal,Value:p,Relation:s.relation||s.relation===0?s.relation:Ae.And,Expresstype:at.Value,Lbracket:s.Lbracket||null,Rbracket:s.Rbracket||null}]}function i(s){const p=[],m=s.value.getValue();return m.begin!=null&&p.push({FilterField:s.fieldCode,Compare:ze.GreaterOrEqual,Value:m.begin,Relation:Ae.And,Expresstype:at.Value}),m.end!=null&&p.push({FilterField:s.fieldCode,Compare:ze.LessOrEqual,Value:m.end,Relation:Ae.And,Expresstype:at.Value}),p}function a(s){const p=[],m=s.value.getValue();return m===""?[]:(m.split(",").forEach(g=>{g&&p.push({FilterField:s.fieldCode,Compare:s.compareType||s.compareType===0?s.compareType:ze.Equal,Value:g,Relation:s.compareType===ze.NotEqual?Ae.And:Ae.Or,Expresstype:at.Value})}),p.length>0?(p[0].Lbracket=s.Lbracket?s.Lbracket+"(":"(",p[p.length-1].Rbracket=s.Rbracket?s.Rbracket+")":")",p[p.length-1].Relation=s.relation||s.relation===0?s.relation:Ae.And,p):[])}function l(s){const p=[],m=s.value.getValue();return p.push({FilterField:s.fieldCode,Compare:s.compareType||s.compareType===0?s.compareType:ze.Equal,Value:m,Relation:s.relation||s.relation===0?s.relation:Ae.And,Expresstype:at.Value,Lbracket:s.Lbracket||null,Rbracket:s.Rbracket||null}),p}function c(s,p){const m=[],g=s.value.getValue();return p.editor.enumValueType==="string"?(g.split(",").forEach(b=>{m.push({FilterField:s.fieldCode,Compare:s.compareType||s.compareType===0?s.compareType:ze.Equal,Value:b,Relation:s.compareType===ze.NotEqual?Ae.And:Ae.Or,Expresstype:at.Value})}),m[0].Lbracket=s.Lbracket?s.Lbracket+"(":"(",m[m.length-1].Rbracket=s.Rbracket?s.Rbracket+")":")",m[m.length-1].Relation=s.relation||s.relation===0?s.relation:Ae.And):(p.editor.enumValueType==="int"||p.editor.enumValueType==="boolean")&&m.push({FilterField:s.fieldCode,Compare:s.compareType||s.compareType===0?s.compareType:ze.Equal,Value:g,Relation:s.compareType===ze.NotEqual?Ae.And:Ae.Or,Expresstype:at.Value}),m}function u(s){const p=s.value.getValue();return[{FilterField:s.fieldCode,Compare:s.compareType||s.compareType===0?s.compareType:ze.Equal,Value:p,Relation:s.relation||s.relation===0?s.relation:Ae.And,Expresstype:at.Value,Lbracket:s.Lbracket||null,Rbracket:s.Rbracket||null}]}function d(s,p){let m=[];switch(s.value.editorType){case"input-group":m=n(s);break;case"number-spinner":m=r(s);break;case"number-range":m=i(s);break;case"lookup":m=a(s);break;case"date-picker":m=l(s);break;case"combo-list":m=c(s,p);break;case"radio-group":m=u(s);break;default:m=[]}return m}function f(s,p){const m=[];return s.forEach(g=>{if(!g.value.isEmpty()){const b=p.find(y=>y.id===g.id),v=d(g,b);m.push(...v)}}),m}return{getFilterConditions:f}}function Js(e,t,n,r,i,a){const{createConditionValue:l}=Xr.useConditionValue(),{getFilterConditions:c}=Ys(),{loadSolution:u}=n;function d(){return((1+Math.random())*65536|0).toString(16).substring(1)}function f(){return d()+d()+"-"+d()+"-"+d()+"-"+d()+"-"+d()+d()+d()}function s(b){const v={id:b.id,fieldCode:b.labelCode,fieldName:b.name,required:b.editor.required,value:l(b.controlType)};return b.controlType==="lookup"&&(v.value.valueField=b.editor.valueField),v}function p(){return{id:f(),code:"Default",name:e.presetQuerySolutionName||"默认筛选条件",belongId:e.formId,mode:"1",type:"preset",isDefault:!1,isSystem:!0,conditions:e.presetFields.map(v=>s(v))}}function m(){var y;const b=(y=i.value)==null?void 0:y.conditions.filter(C=>{var F;return!((F=C.value)!=null&&F.isEmpty())}),v=c(b,a.value);t.emit("conditionChange",v)}function g(){u().then(b=>{if(b&&b.data){const v=b.data.map(y=>{const C=JSON.parse(y.queryConditionString);return y.conditions=C.filter(F=>a.value.find(w=>w.labelCode===F.fieldCode)).map(F=>{var w;return F.value=l((w=F.value)==null?void 0:w.editorType,F.value),F}),y});if(!v.length){const y=p();v.push(y)}if(r.value=v,i.value){const y=r.value.find(C=>{var F;return C.id===((F=i.value)==null?void 0:F.id)});y?i.value=be.cloneDeep(y):i.value=be.cloneDeep(r.value[0])}else i.value=be.cloneDeep(r.value[0]);m()}}).catch(()=>{const b=p();r.value=[b],i.value=be.cloneDeep(b)})}return{getDefaultSolution:p,loadAllSolution:g,getGuid:f,handleQuery:m,fieldToCondition:s}}const Qs={solutions:{type:Array,default:[]}},Ks=o.defineComponent({name:"FSolutionManager",props:Qs,emits:["changeDelete"],setup(e,t){const n=[{field:"code",title:"名称",width:80,resizable:!0,dataType:"string"},{field:"type",title:"类型",width:200,dataType:"string",editor:{type:"combo-list",data:[{id:"private",name:"用户个人方案"}]}}],r={private:"用户个人方案",public:"系统公共方案",org:"组织公共方案"},i=o.ref([]),a=o.ref([]),l=o.ref();function c(){const f=e.solutions.filter(s=>!i.value.includes(s.id)&&!s.isSystem).map(s=>({id:s.id,code:s.code,type:r[s.type]}));a.value=f,l.value.updateDataSource(f)}o.onMounted(()=>{c()});function u(f){const s=f.raw.id;i.value.includes(s)||(i.value=[...i.value,s],t.emit("changeDelete",i.value),c())}function d(){const f={enable:!0,commands:[{text:"删除",type:"danger",command:"remove",onClick(s,p,m){u(m)}}]};return o.createVNode(oo.FDataGrid,{ref:l,columns:n,data:a.value,commandOption:f,columnOption:{fitColumns:!0}},null)}return()=>o.createVNode("div",{class:"ml-3 mr-3 w-100 h-100"},[d()])}});function Zs(e,t,n,r,i,a,l){const c=[{id:"private",text:"用户个人方案"}],u=new Di.FNotifyService,d=o.ref(""),f=o.ref("private"),s=o.ref([]),p=o.ref([]),m=o.ref(e.expanded),{createSolution:g,updateSolution:b,getAuth:v,batchUpdate:y}=n,{getGuid:C,loadAllSolution:F,handleQuery:w,fieldToCondition:S}=r,N=o.inject(Ur.F_MODAL_SERVICE_TOKEN,null),h=o.computed(()=>a.value?a.value.name:""),_=o.computed(()=>!a.value||a.value.mode!=="2"),x=o.ref(!1),k=o.computed(()=>({"dropdown-menu":!0,show:x.value})),T=o.computed(()=>({"z-index":99}));function V(me){a.value=me,w()}function I(){var me;try{(me=a.value)==null||me.conditions.map(G=>{if(G.required&&(!G.value||G.value.isEmpty()))throw"查询前请填写必填项:"+G.fieldName}),t.emit("query")}catch(G){u.warning({message:G,position:"top-center"})}}const E=o.computed(()=>({transform:m.value?"rotate(0deg)":"rotate(180deg)"}));function M(){if(!a.value){console.warn("no querysolution");return}a.value.conditions.forEach(me=>{me.value&&me.value.clear()}),w()}function B(){a.value&&v().then(me=>{const{data:G}=me,Q=be.cloneDeep(a.value);if(!G.success&&(Q.type==="public"||Q.type==="org")){u.warning({message:"您暂无权限修改公共类型方案。",position:"top-center"});return}else Q.queryConditionString=JSON.stringify(Q.conditions),b(Q).then(ee=>F()),t.emit("save",a.value)})}function O(){return o.createVNode("div",{class:"m-3"},[o.createVNode("div",{class:"farris-group-wrap"},[o.createVNode("div",{class:"form-group farris-form-group"},[o.createVNode("div",{class:"farris-input-wrap"},[o.createVNode(ro.FInputGroup,{modelValue:d.value,"onUpdate:modelValue":me=>d.value=me},null)])])]),o.createVNode(io,{data:c,name:"",textField:"text",valueField:"id",modelValue:f.value,"onUpdate:modelValue":me=>f.value=me},null)])}function R(){if(a.value){if(!d.value){u.warning({message:"请填写方案名称",position:"top-center"});return}}else return;v().then(me=>{const{data:G}=me;if(!G.success&&(f.value==="public"||f.value==="org")){u.warning({message:"您暂无权限修改公共类型方案。",position:"top-center"});return}else{const Q=be.cloneDeep(a.value);Q.id=C(),Q.isSystem=!1,Q.code=d.value,Q.name=d.value,Q.type=f.value,Q.queryConditionString=JSON.stringify(Q.conditions),g(Q).then(ee=>F()),f.value="private",d.value=""}})}function q(){f.value="private",d.value=""}function L(){const me=e.formId,G=s.value;y({belongId:me,deletedIds:G}).then(Q=>{F()}),s.value=[]}function X(){s.value=[]}function te(me){s.value=me}function ie(){N==null||N.open({width:600,height:600,title:"新增方案",acceptCallback:R,rejectCallback:q,render:()=>O()}),t.emit("saveAs",a.value)}function ue(){N==null||N.open({width:600,height:550,fitContent:!1,title:"方案管理",acceptCallback:L,rejectCallback:X,render:()=>o.createVNode(Ks,{solutions:i.value,onChangeDelete:te},null)})}function D(){var G;const me=i.value.map(Q=>o.createVNode("li",{class:"dropdown-item",onClick:()=>V(Q)},[Q.name]));return me.push(o.createVNode("li",{class:"solution-header-title-btns"},[!((G=a.value)!=null&&G.isSystem)&&o.createVNode("span",{class:"dropdown-item-btn f-cursor-pointer",onClick:B},[o.createTextVNode("保存")]),o.createVNode("span",{class:"dropdown-item-btn f-cursor-pointer ml-2 mr-2",onClick:ie},[o.createTextVNode("另存为")]),o.createVNode("span",{class:"dropdown-item-btn f-cursor-pointer ml-2 mr-2",onClick:ue},[o.createTextVNode("管理")])])),o.createVNode("ul",{class:k.value},[me])}function ne(me){me.stopPropagation(),x.value=!x.value}function pe(){return o.createVNode("div",null,null)}function oe(){if(a.value){const me=a.value.conditions||[],G=[];p.value.forEach(Q=>{const ee=me.find(re=>re.id===Q.id);if(ee)G.push(ee);else{const re=l.value.find(U=>U.id===Q.id);re&&G.push(S(re))}}),a.value.conditions=G}p.value=[],w()}function A(){p.value=[]}function Y(me){p.value=me}function we(){var Q;p.value=[];const me=((Q=a.value)==null?void 0:Q.conditions.map(ee=>({id:ee.id||"",name:ee.fieldName||""})))||[],G=l.value.map(ee=>({id:ee.id,name:ee.name}))||[];p.value=me,N==null||N.open({width:900,height:600,title:"筛选条件配置",acceptCallback:oe,rejectCallback:A,render:()=>o.createVNode(fn.FTransfer,{selections:me,"data-source":G,class:"query-solution-config-transfer ml-3",onChange:Y},null)})}function Ce(){m.value=!m.value}function je(){return o.createVNode("div",{class:"solution-action"},[o.createVNode("div",{class:"btn-group"},[o.createVNode("button",{type:"button",class:"btn btn-primary ",onClick:I},[e.filterText])]),_.value&&o.createVNode("div",{class:"icon-group ml-2",onClick:M},[o.createVNode("span",{class:"f-icon f-icon-remove f-cursor-pointer"},null)]),E.value&&o.createVNode("div",{class:"icon-group ml-2",onClick:we},[o.createVNode("span",{class:"f-icon f-icon-home-setup f-cursor-pointer"},null)]),o.createVNode("div",{class:"icon-group ml-2",onClick:Ce},[o.createVNode("span",{class:"f-icon f-icon-packup f-cursor-pointer",style:E.value},null)])])}function De(){return o.createVNode("div",{class:"solution-header"},[o.createVNode("div",{class:"btn-group mr-3",onClick:ne},[o.createVNode("div",{class:"solution-header-title"},[h.value,o.createVNode("span",{class:"f-icon f-accordion-expand"},null)]),D(),x.value&&o.createVNode("div",{class:"position-fixed w-100 h-100",style:T.value,onClick:ne},null)]),pe(),je()])}function Be(){l.value=e.fields.map(me=>{const G=be.cloneDeep(me);return G.editor.type||(G.editor.type=me.controlType),(G.editor.type==="number-spinner"||G.editor.type==="number-range")&&(G.editor.showZero=!0,G.editor.nullable=!0),G.editor.type==="combo-list"&&(G.editor.enableClear=!0),G})}return{expanded:m,renderHeader:De,loadFields:Be}}function Ko(e,t){return function(){return e.apply(t,arguments)}}const{toString:ec}=Object.prototype,{getPrototypeOf:On}=Object,Zt=(e=>t=>{const n=ec.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),nt=e=>(e=e.toLowerCase(),t=>Zt(t)===e),en=e=>t=>typeof t===e,{isArray:_t}=Array,Ot=en("undefined");function tc(e){return e!==null&&!Ot(e)&&e.constructor!==null&&!Ot(e.constructor)&&Ge(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Zo=nt("ArrayBuffer");function nc(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Zo(e.buffer),t}const oc=en("string"),Ge=en("function"),er=en("number"),tn=e=>e!==null&&typeof e=="object",rc=e=>e===!0||e===!1,nn=e=>{if(Zt(e)!=="object")return!1;const t=On(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ic=nt("Date"),ac=nt("File"),lc=nt("Blob"),sc=nt("FileList"),cc=e=>tn(e)&&Ge(e.pipe),uc=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ge(e.append)&&((t=Zt(e))==="formdata"||t==="object"&&Ge(e.toString)&&e.toString()==="[object FormData]"))},dc=nt("URLSearchParams"),[fc,pc,mc,hc]=["ReadableStream","Request","Response","Headers"].map(nt),gc=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Bt(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),_t(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),l=a.length;let c;for(r=0;r<l;r++)c=a[r],t.call(null,e[c],c,e)}}function tr(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const St=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,nr=e=>!Ot(e)&&e!==St;function Bn(){const{caseless:e}=nr(this)&&this||{},t={},n=(r,i)=>{const a=e&&tr(t,i)||i;nn(t[a])&&nn(r)?t[a]=Bn(t[a],r):nn(r)?t[a]=Bn({},r):_t(r)?t[a]=r.slice():t[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Bt(arguments[r],n);return t}const yc=(e,t,n,{allOwnKeys:r}={})=>(Bt(t,(i,a)=>{n&&Ge(i)?e[a]=Ko(i,n):e[a]=i},{allOwnKeys:r}),e),vc=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bc=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Cc=(e,t,n,r)=>{let i,a,l;const c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)l=i[a],(!r||r(l,e,t))&&!c[l]&&(t[l]=e[l],c[l]=!0);e=n!==!1&&On(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},wc=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Sc=e=>{if(!e)return null;if(_t(e))return e;let t=e.length;if(!er(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},xc=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&On(Uint8Array)),Fc=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},Tc=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},_c=nt("HTMLFormElement"),Nc=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),or=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Vc=nt("RegExp"),rr=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Bt(n,(i,a)=>{let l;(l=t(i,a,e))!==!1&&(r[a]=l||i)}),Object.defineProperties(e,r)},kc=e=>{rr(e,(t,n)=>{if(Ge(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ge(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ec=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return _t(e)?r(e):r(String(e).split(t)),n},Ic=()=>{},Mc=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Pn="abcdefghijklmnopqrstuvwxyz",ir="0123456789",ar={DIGIT:ir,ALPHA:Pn,ALPHA_DIGIT:Pn+Pn.toUpperCase()+ir},Oc=(e=16,t=ar.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Bc(e){return!!(e&&Ge(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Pc=e=>{const t=new Array(10),n=(r,i)=>{if(tn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const a=_t(r)?[]:{};return Bt(r,(l,c)=>{const u=n(l,i+1);!Ot(u)&&(a[c]=u)}),t[i]=void 0,a}}return r};return n(e,0)},Rc=nt("AsyncFunction"),jc=e=>e&&(tn(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),lr=((e,t)=>e?setImmediate:t?((n,r)=>(St.addEventListener("message",({source:i,data:a})=>{i===St&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),St.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ge(St.postMessage)),Dc=typeof queueMicrotask<"u"?queueMicrotask.bind(St):typeof process<"u"&&process.nextTick||lr,j={isArray:_t,isArrayBuffer:Zo,isBuffer:tc,isFormData:uc,isArrayBufferView:nc,isString:oc,isNumber:er,isBoolean:rc,isObject:tn,isPlainObject:nn,isReadableStream:fc,isRequest:pc,isResponse:mc,isHeaders:hc,isUndefined:Ot,isDate:ic,isFile:ac,isBlob:lc,isRegExp:Vc,isFunction:Ge,isStream:cc,isURLSearchParams:dc,isTypedArray:xc,isFileList:sc,forEach:Bt,merge:Bn,extend:yc,trim:gc,stripBOM:vc,inherits:bc,toFlatObject:Cc,kindOf:Zt,kindOfTest:nt,endsWith:wc,toArray:Sc,forEachEntry:Fc,matchAll:Tc,isHTMLForm:_c,hasOwnProperty:or,hasOwnProp:or,reduceDescriptors:rr,freezeMethods:kc,toObjectSet:Ec,toCamelCase:Nc,noop:Ic,toFiniteNumber:Mc,findKey:tr,global:St,isContextDefined:nr,ALPHABET:ar,generateString:Oc,isSpecCompliantForm:Bc,toJSONObject:Pc,isAsyncFn:Rc,isThenable:jc,setImmediate:lr,asap:Dc};function ye(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}j.inherits(ye,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:j.toJSONObject(this.config),code:this.code,status:this.status}}});const sr=ye.prototype,cr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{cr[e]={value:e}}),Object.defineProperties(ye,cr),Object.defineProperty(sr,"isAxiosError",{value:!0}),ye.from=(e,t,n,r,i,a)=>{const l=Object.create(sr);return j.toFlatObject(e,l,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),ye.call(l,e.message,t,n,r,i),l.cause=e,l.name=e.name,a&&Object.assign(l,a),l};const $c=null;function Rn(e){return j.isPlainObject(e)||j.isArray(e)}function ur(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function dr(e,t,n){return e?e.concat(t).map(function(i,a){return i=ur(i),!n&&a?"["+i+"]":i}).join(n?".":""):t}function Ac(e){return j.isArray(e)&&!e.some(Rn)}const Lc=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function on(e,t,n){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=j.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,v){return!j.isUndefined(v[b])});const r=n.metaTokens,i=n.visitor||f,a=n.dots,l=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(i))throw new TypeError("visitor must be a function");function d(g){if(g===null)return"";if(j.isDate(g))return g.toISOString();if(!u&&j.isBlob(g))throw new ye("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(g)||j.isTypedArray(g)?u&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function f(g,b,v){let y=g;if(g&&!v&&typeof g=="object"){if(j.endsWith(b,"{}"))b=r?b:b.slice(0,-2),g=JSON.stringify(g);else if(j.isArray(g)&&Ac(g)||(j.isFileList(g)||j.endsWith(b,"[]"))&&(y=j.toArray(g)))return b=ur(b),y.forEach(function(F,w){!(j.isUndefined(F)||F===null)&&t.append(l===!0?dr([b],w,a):l===null?b:b+"[]",d(F))}),!1}return Rn(g)?!0:(t.append(dr(v,b,a),d(g)),!1)}const s=[],p=Object.assign(Lc,{defaultVisitor:f,convertValue:d,isVisitable:Rn});function m(g,b){if(!j.isUndefined(g)){if(s.indexOf(g)!==-1)throw Error("Circular reference detected in "+b.join("."));s.push(g),j.forEach(g,function(y,C){(!(j.isUndefined(y)||y===null)&&i.call(t,y,j.isString(C)?C.trim():C,b,p))===!0&&m(y,b?b.concat(C):[C])}),s.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return m(e),t}function fr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function jn(e,t){this._pairs=[],e&&on(e,this,t)}const pr=jn.prototype;pr.append=function(t,n){this._pairs.push([t,n])},pr.toString=function(t){const n=t?function(r){return t.call(this,r,fr)}:fr;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function qc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function mr(e,t,n){if(!t)return e;const r=n&&n.encode||qc,i=n&&n.serialize;let a;if(i?a=i(t,n):a=j.isURLSearchParams(t)?t.toString():new jn(t,n).toString(r),a){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class hr{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){j.forEach(this.handlers,function(r){r!==null&&t(r)})}}const gr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Wc={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:jn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Dn=typeof window<"u"&&typeof document<"u",$n=typeof navigator=="object"&&navigator||void 0,Hc=Dn&&(!$n||["ReactNative","NativeScript","NS"].indexOf($n.product)<0),Uc=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",zc=Dn&&window.location.href||"http://localhost",qe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Dn,hasStandardBrowserEnv:Hc,hasStandardBrowserWebWorkerEnv:Uc,navigator:$n,origin:zc},Symbol.toStringTag,{value:"Module"})),...Wc};function Gc(e,t){return on(e,new qe.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return qe.isNode&&j.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function Xc(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Yc(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function yr(e){function t(n,r,i,a){let l=n[a++];if(l==="__proto__")return!0;const c=Number.isFinite(+l),u=a>=n.length;return l=!l&&j.isArray(i)?i.length:l,u?(j.hasOwnProp(i,l)?i[l]=[i[l],r]:i[l]=r,!c):((!i[l]||!j.isObject(i[l]))&&(i[l]=[]),t(n,r,i[l],a)&&j.isArray(i[l])&&(i[l]=Yc(i[l])),!c)}if(j.isFormData(e)&&j.isFunction(e.entries)){const n={};return j.forEachEntry(e,(r,i)=>{t(Xc(r),i,n,0)}),n}return null}function Jc(e,t,n){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Pt={transitional:gr,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=j.isObject(t);if(a&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return i?JSON.stringify(yr(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gc(t,this.formSerializer).toString();if((c=j.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return on(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),Jc(t)):t}],transformResponse:[function(t){const n=this.transitional||Pt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(r&&!this.responseType||i)){const l=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(c){if(l)throw c.name==="SyntaxError"?ye.from(c,ye.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qe.classes.FormData,Blob:qe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],e=>{Pt.headers[e]={}});const Qc=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Kc=e=>{const t={};let n,r,i;return e&&e.split(`
7
+ `).forEach(function(l){i=l.indexOf(":"),n=l.substring(0,i).trim().toLowerCase(),r=l.substring(i+1).trim(),!(!n||t[n]&&Qc[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},vr=Symbol("internals");function Rt(e){return e&&String(e).trim().toLowerCase()}function rn(e){return e===!1||e==null?e:j.isArray(e)?e.map(rn):String(e)}function Zc(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const eu=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function An(e,t,n,r,i){if(j.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!j.isString(t)){if(j.isString(r))return t.indexOf(r)!==-1;if(j.isRegExp(r))return r.test(t)}}function tu(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function nu(e,t){const n=j.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,a,l){return this[r].call(this,t,i,a,l)},configurable:!0})})}class We{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function a(c,u,d){const f=Rt(u);if(!f)throw new Error("header name must be a non-empty string");const s=j.findKey(i,f);(!s||i[s]===void 0||d===!0||d===void 0&&i[s]!==!1)&&(i[s||u]=rn(c))}const l=(c,u)=>j.forEach(c,(d,f)=>a(d,f,u));if(j.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(j.isString(t)&&(t=t.trim())&&!eu(t))l(Kc(t),n);else if(j.isHeaders(t))for(const[c,u]of t.entries())a(u,c,r);else t!=null&&a(n,t,r);return this}get(t,n){if(t=Rt(t),t){const r=j.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Zc(i);if(j.isFunction(n))return n.call(this,i,r);if(j.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Rt(t),t){const r=j.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||An(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function a(l){if(l=Rt(l),l){const c=j.findKey(r,l);c&&(!n||An(r,r[c],c,n))&&(delete r[c],i=!0)}}return j.isArray(t)?t.forEach(a):a(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const a=n[r];(!t||An(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const n=this,r={};return j.forEach(this,(i,a)=>{const l=j.findKey(r,a);if(l){n[l]=rn(i),delete n[a];return}const c=t?tu(a):String(a).trim();c!==a&&delete n[a],n[c]=rn(i),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return j.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&j.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
8
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[vr]=this[vr]={accessors:{}}).accessors,i=this.prototype;function a(l){const c=Rt(l);r[c]||(nu(i,l),r[c]=!0)}return j.isArray(t)?t.forEach(a):a(t),this}}We.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),j.reduceDescriptors(We.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),j.freezeMethods(We);function Ln(e,t){const n=this||Pt,r=t||n,i=We.from(r.headers);let a=r.data;return j.forEach(e,function(c){a=c.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function br(e){return!!(e&&e.__CANCEL__)}function Nt(e,t,n){ye.call(this,e??"canceled",ye.ERR_CANCELED,t,n),this.name="CanceledError"}j.inherits(Nt,ye,{__CANCEL__:!0});function Cr(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ye("Request failed with status code "+n.status,[ye.ERR_BAD_REQUEST,ye.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ou(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ru(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,a=0,l;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),f=r[a];l||(l=d),n[i]=u,r[i]=d;let s=a,p=0;for(;s!==i;)p+=n[s++],s=s%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),d-l<t)return;const m=f&&d-f;return m?Math.round(p*1e3/m):void 0}}function iu(e,t){let n=0,r=1e3/t,i,a;const l=(d,f=Date.now())=>{n=f,i=null,a&&(clearTimeout(a),a=null),e.apply(null,d)};return[(...d)=>{const f=Date.now(),s=f-n;s>=r?l(d,f):(i=d,a||(a=setTimeout(()=>{a=null,l(i)},r-s)))},()=>i&&l(i)]}const an=(e,t,n=3)=>{let r=0;const i=ru(50,250);return iu(a=>{const l=a.loaded,c=a.lengthComputable?a.total:void 0,u=l-r,d=i(u),f=l<=c;r=l;const s={loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:d||void 0,estimated:d&&c&&f?(c-l)/d:void 0,event:a,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(s)},n)},wr=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Sr=e=>(...t)=>j.asap(()=>e(...t)),au=qe.hasStandardBrowserEnv?function(){const t=qe.navigator&&/(msie|trident)/i.test(qe.navigator.userAgent),n=document.createElement("a");let r;function i(a){let l=a;return t&&(n.setAttribute("href",l),l=n.href),n.setAttribute("href",l),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(l){const c=j.isString(l)?i(l):l;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),lu=qe.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const l=[e+"="+encodeURIComponent(t)];j.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),j.isString(r)&&l.push("path="+r),j.isString(i)&&l.push("domain="+i),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function su(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function cu(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xr(e,t){return e&&!su(t)?cu(e,t):t}const Fr=e=>e instanceof We?{...e}:e;function xt(e,t){t=t||{};const n={};function r(d,f,s){return j.isPlainObject(d)&&j.isPlainObject(f)?j.merge.call({caseless:s},d,f):j.isPlainObject(f)?j.merge({},f):j.isArray(f)?f.slice():f}function i(d,f,s){if(j.isUndefined(f)){if(!j.isUndefined(d))return r(void 0,d,s)}else return r(d,f,s)}function a(d,f){if(!j.isUndefined(f))return r(void 0,f)}function l(d,f){if(j.isUndefined(f)){if(!j.isUndefined(d))return r(void 0,d)}else return r(void 0,f)}function c(d,f,s){if(s in t)return r(d,f);if(s in e)return r(void 0,d)}const u={url:a,method:a,data:a,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:c,headers:(d,f)=>i(Fr(d),Fr(f),!0)};return j.forEach(Object.keys(Object.assign({},e,t)),function(f){const s=u[f]||i,p=s(e[f],t[f],f);j.isUndefined(p)&&s!==c||(n[f]=p)}),n}const Tr=e=>{const t=xt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:l,auth:c}=t;t.headers=l=We.from(l),t.url=mr(xr(t.baseURL,t.url),e.params,e.paramsSerializer),c&&l.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let u;if(j.isFormData(n)){if(qe.hasStandardBrowserEnv||qe.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((u=l.getContentType())!==!1){const[d,...f]=u?u.split(";").map(s=>s.trim()).filter(Boolean):[];l.setContentType([d||"multipart/form-data",...f].join("; "))}}if(qe.hasStandardBrowserEnv&&(r&&j.isFunction(r)&&(r=r(t)),r||r!==!1&&au(t.url))){const d=i&&a&&lu.read(a);d&&l.set(i,d)}return t},uu=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=Tr(e);let a=i.data;const l=We.from(i.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:d}=i,f,s,p,m,g;function b(){m&&m(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function y(){if(!v)return;const F=We.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),S={data:!c||c==="text"||c==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:F,config:e,request:v};Cr(function(h){n(h),b()},function(h){r(h),b()},S),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(y)},v.onabort=function(){v&&(r(new ye("Request aborted",ye.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new ye("Network Error",ye.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let w=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const S=i.transitional||gr;i.timeoutErrorMessage&&(w=i.timeoutErrorMessage),r(new ye(w,S.clarifyTimeoutError?ye.ETIMEDOUT:ye.ECONNABORTED,e,v)),v=null},a===void 0&&l.setContentType(null),"setRequestHeader"in v&&j.forEach(l.toJSON(),function(w,S){v.setRequestHeader(S,w)}),j.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),c&&c!=="json"&&(v.responseType=i.responseType),d&&([p,g]=an(d,!0),v.addEventListener("progress",p)),u&&v.upload&&([s,m]=an(u),v.upload.addEventListener("progress",s),v.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(f=F=>{v&&(r(!F||F.type?new Nt(null,e,v):F),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const C=ou(i.url);if(C&&qe.protocols.indexOf(C)===-1){r(new ye("Unsupported protocol "+C+":",ye.ERR_BAD_REQUEST,e));return}v.send(a||null)})},du=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const a=function(d){if(!i){i=!0,c();const f=d instanceof Error?d:this.reason;r.abort(f instanceof ye?f:new Nt(f instanceof Error?f.message:f))}};let l=t&&setTimeout(()=>{l=null,a(new ye(`timeout ${t} of ms exceeded`,ye.ETIMEDOUT))},t);const c=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(a):d.removeEventListener("abort",a)}),e=null)};e.forEach(d=>d.addEventListener("abort",a));const{signal:u}=r;return u.unsubscribe=()=>j.asap(c),u}},fu=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},pu=async function*(e,t){for await(const n of mu(e))yield*fu(n,t)},mu=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},_r=(e,t,n,r)=>{const i=pu(e,t);let a=0,l,c=u=>{l||(l=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:d,value:f}=await i.next();if(d){c(),u.close();return}let s=f.byteLength;if(n){let p=a+=s;n(p)}u.enqueue(new Uint8Array(f))}catch(d){throw c(d),d}},cancel(u){return c(u),i.return()}},{highWaterMark:2})},ln=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Nr=ln&&typeof ReadableStream=="function",hu=ln&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Vr=(e,...t)=>{try{return!!e(...t)}catch{return!1}},gu=Nr&&Vr(()=>{let e=!1;const t=new Request(qe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),kr=64*1024,qn=Nr&&Vr(()=>j.isReadableStream(new Response("").body)),sn={stream:qn&&(e=>e.body)};ln&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!sn[t]&&(sn[t]=j.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ye(`Response type '${t}' is not supported`,ye.ERR_NOT_SUPPORT,r)})})})(new Response);const yu=async e=>{if(e==null)return 0;if(j.isBlob(e))return e.size;if(j.isSpecCompliantForm(e))return(await new Request(qe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(j.isArrayBufferView(e)||j.isArrayBuffer(e))return e.byteLength;if(j.isURLSearchParams(e)&&(e=e+""),j.isString(e))return(await hu(e)).byteLength},vu=async(e,t)=>{const n=j.toFiniteNumber(e.getContentLength());return n??yu(t)},Wn={http:$c,xhr:uu,fetch:ln&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:l,onDownloadProgress:c,onUploadProgress:u,responseType:d,headers:f,withCredentials:s="same-origin",fetchOptions:p}=Tr(e);d=d?(d+"").toLowerCase():"text";let m=du([i,a&&a.toAbortSignal()],l),g;const b=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let v;try{if(u&&gu&&n!=="get"&&n!=="head"&&(v=await vu(f,r))!==0){let S=new Request(t,{method:"POST",body:r,duplex:"half"}),N;if(j.isFormData(r)&&(N=S.headers.get("content-type"))&&f.setContentType(N),S.body){const[h,_]=wr(v,an(Sr(u)));r=_r(S.body,kr,h,_)}}j.isString(s)||(s=s?"include":"omit");const y="credentials"in Request.prototype;g=new Request(t,{...p,signal:m,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:y?s:void 0});let C=await fetch(g);const F=qn&&(d==="stream"||d==="response");if(qn&&(c||F&&b)){const S={};["status","statusText","headers"].forEach(x=>{S[x]=C[x]});const N=j.toFiniteNumber(C.headers.get("content-length")),[h,_]=c&&wr(N,an(Sr(c),!0))||[];C=new Response(_r(C.body,kr,h,()=>{_&&_(),b&&b()}),S)}d=d||"text";let w=await sn[j.findKey(sn,d)||"text"](C,e);return!F&&b&&b(),await new Promise((S,N)=>{Cr(S,N,{data:w,headers:We.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:g})})}catch(y){throw b&&b(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new ye("Network Error",ye.ERR_NETWORK,e,g),{cause:y.cause||y}):ye.from(y,y&&y.code,e,g)}})};j.forEach(Wn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Er=e=>`- ${e}`,bu=e=>j.isFunction(e)||e===null||e===!1,Ir={getAdapter:e=>{e=j.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){n=e[a];let l;if(r=n,!bu(n)&&(r=Wn[(l=String(n)).toLowerCase()],r===void 0))throw new ye(`Unknown adapter '${l}'`);if(r)break;i[l||"#"+a]=r}if(!r){const a=Object.entries(i).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=t?a.length>1?`since :
9
+ `+a.map(Er).join(`
10
+ `):" "+Er(a[0]):"as no adapter specified";throw new ye("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:Wn};function Hn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function Mr(e){return Hn(e),e.headers=We.from(e.headers),e.data=Ln.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ir.getAdapter(e.adapter||Pt.adapter)(e).then(function(r){return Hn(e),r.data=Ln.call(e,e.transformResponse,r),r.headers=We.from(r.headers),r},function(r){return br(r)||(Hn(e),r&&r.response&&(r.response.data=Ln.call(e,e.transformResponse,r.response),r.response.headers=We.from(r.response.headers))),Promise.reject(r)})}const Or="1.7.7",Un={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Un[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Br={};Un.transitional=function(t,n,r){function i(a,l){return"[Axios v"+Or+"] Transitional option '"+a+"'"+l+(r?". "+r:"")}return(a,l,c)=>{if(t===!1)throw new ye(i(l," has been removed"+(n?" in "+n:"")),ye.ERR_DEPRECATED);return n&&!Br[l]&&(Br[l]=!0,console.warn(i(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,l,c):!0}};function Cu(e,t,n){if(typeof e!="object")throw new ye("options must be an object",ye.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],l=t[a];if(l){const c=e[a],u=c===void 0||l(c,a,e);if(u!==!0)throw new ye("option "+a+" must be "+u,ye.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ye("Unknown option "+a,ye.ERR_BAD_OPTION)}}const zn={assertOptions:Cu,validators:Un},vt=zn.validators;class Ft{constructor(t){this.defaults=t,this.interceptors={request:new hr,response:new hr}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
11
+ `+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=xt(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&zn.assertOptions(r,{silentJSONParsing:vt.transitional(vt.boolean),forcedJSONParsing:vt.transitional(vt.boolean),clarifyTimeoutError:vt.transitional(vt.boolean)},!1),i!=null&&(j.isFunction(i)?n.paramsSerializer={serialize:i}:zn.assertOptions(i,{encode:vt.function,serialize:vt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=a&&j.merge(a.common,a[n.method]);a&&j.forEach(["delete","get","head","post","put","patch","common"],g=>{delete a[g]}),n.headers=We.concat(l,a);const c=[];let u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(u=u&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let f,s=0,p;if(!u){const g=[Mr.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,d),p=g.length,f=Promise.resolve(n);s<p;)f=f.then(g[s++],g[s++]);return f}p=c.length;let m=n;for(s=0;s<p;){const g=c[s++],b=c[s++];try{m=g(m)}catch(v){b.call(this,v);break}}try{f=Mr.call(this,m)}catch(g){return Promise.reject(g)}for(s=0,p=d.length;s<p;)f=f.then(d[s++],d[s++]);return f}getUri(t){t=xt(this.defaults,t);const n=xr(t.baseURL,t.url);return mr(n,t.params,t.paramsSerializer)}}j.forEach(["delete","get","head","options"],function(t){Ft.prototype[t]=function(n,r){return this.request(xt(r||{},{method:t,url:n,data:(r||{}).data}))}}),j.forEach(["post","put","patch"],function(t){function n(r){return function(a,l,c){return this.request(xt(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:l}))}}Ft.prototype[t]=n(),Ft.prototype[t+"Form"]=n(!0)});class Gn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const l=new Promise(c=>{r.subscribe(c),a=c}).then(i);return l.cancel=function(){r.unsubscribe(a)},l},t(function(a,l,c){r.reason||(r.reason=new Nt(a,l,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Gn(function(i){t=i}),cancel:t}}}function wu(e){return function(n){return e.apply(null,n)}}function Su(e){return j.isObject(e)&&e.isAxiosError===!0}const Xn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xn).forEach(([e,t])=>{Xn[t]=e});function Pr(e){const t=new Ft(e),n=Ko(Ft.prototype.request,t);return j.extend(n,Ft.prototype,t,{allOwnKeys:!0}),j.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Pr(xt(e,i))},n}const Ne=Pr(Pt);Ne.Axios=Ft,Ne.CanceledError=Nt,Ne.CancelToken=Gn,Ne.isCancel=br,Ne.VERSION=Or,Ne.toFormData=on,Ne.AxiosError=ye,Ne.Cancel=Ne.CanceledError,Ne.all=function(t){return Promise.all(t)},Ne.spread=wu,Ne.isAxiosError=Su,Ne.mergeConfig=xt,Ne.AxiosHeaders=We,Ne.formToJSON=e=>yr(j.isHTMLForm(e)?new FormData(e):e),Ne.getAdapter=Ir.getAdapter,Ne.HttpStatusCode=Xn,Ne.default=Ne;function xu(e,t){const n="/api/runtime/sys/v1.0/querysolution",r="default";function i(d){const s={headers:{"Content-Type":"application/json",sessionid:r},sessionid:r};return Ne.post(n,d,s)}function a(){const d={headers:{"Content-Type":"application/json",sessionid:r},sessionid:r};return Ne.get(`/api/runtime/sys/v1.0/querysolution/belongId/${e.formId}`,d)}function l(d){const s={headers:{"Content-Type":"application/json",sessionid:r}};return Ne.put(n,d,s)}function c(d){const s={headers:{"Content-Type":"application/json",sessionid:r}},p=`${n}/batch`;return Ne.put(p,d,s)}function u(){const f={headers:{"Content-Type":"application/json",sessionid:r}},s=`${n}/componentType/QuerySolution`;return Ne.get(s,f)}return{createSolution:i,loadSolution:a,updateSolution:l,getAuth:u,batchUpdate:c}}const cn=o.defineComponent({name:"FQuerySolution",props:Kt,emits:["save","saveAs","delete","change","conditionChange","query"],setup(e,t){const n=o.ref(),r=o.ref(e.isControlInline),i=o.ref([]),a=o.ref(null),l=xu(e),c=Js(e,t,l,i,a,n),u=Zs(e,t,l,c,i,a,n),{loadAllSolution:d,handleQuery:f}=c,{renderHeader:s,loadFields:p,expanded:m}=u;o.onMounted(()=>{p(),d()});const g=o.computed(()=>a.value?a.value.mode:"1"),b={1:Wt,2:Qt},v=o.computed(()=>({"farris-panel":!0,"position-relative":!0,"query-solution":!0})),y=o.computed(()=>({border:"none"}));function C(N,h){t.emit("change",N,h),f()}function F(N){var h;t.emit("change",N),t.emit("conditionChange",be.cloneDeep((h=a.value)==null?void 0:h.conditions))}function w(N,h){var _;t.emit("change",N,h),t.emit("conditionChange",be.cloneDeep((_=a.value)==null?void 0:_.conditions))}function S(){const N=b[g.value]||Wt;return a.value&&o.createVNode(N,{key:a.value.id,fields:n.value,conditions:a.value.conditions,isControlInline:r.value,onValueChange:(h,_)=>C(h,_),onLabelCodeChange:h=>F(h),onCompareTypeChange:(h,_)=>w(h,_)},null)}return()=>o.createVNode("div",{class:v.value,tabindex:"1",style:y.value},[s(),m.value&&S()])}}),Fu=o.defineComponent({name:"FConditionFieldsDesign",directives:{"area-response":es},props:bn,emits:["valueChange","blur","focus","click","input"],setup(e,t){const n=o.ref(),r=o.ref(e.key);o.ref(e.isControlInline);const i=o.ref(e.conditions),a=Cn(e),{initialConditionValue:l,fieldMap:c,loadFieldConfigs:u}=a,d=xo(e,t,n),{conditionClass:f,resizeObserver:s}=d;u(!0),o.onBeforeUnmount(()=>{var b;(b=s.value)==null||b.unobserve(n.value)}),o.watch(()=>e.conditions,()=>{i.value=e.conditions});const p=o.computed(()=>({"f-utils-flex-row-wrap":!0,"farris-form":!0,"farris-form-controls-inline":e.isControlInline})),m=o.computed(()=>"col-12 col-md-6 col-xl-3 col-el-2 ");function g(){return i.value.map(b=>{var y,C;const v=(y=c.get(b.fieldCode))==null?void 0:y.editor;return v&&(v.disabled=!0),o.createVNode(xs,{customClass:((C=v==null?void 0:v.appearance)==null?void 0:C.class)||m.value,label:b.fieldName,required:v==null?void 0:v.required,editor:v,type:"form-group"},null)})}return()=>o.withDirectives(o.createVNode("div",{class:p.value,key:r.value,ref:n},[g()]),[[o.resolveDirective("area-response")]])}}),Tu={convertFrom:(e,t)=>e[t],convertTo:(e,t,n)=>{const r=e.presetFields,i=[];r.forEach(a=>{const l=n.find(c=>c.id===a.id);l&&i.push(l)}),e[t]=n,e.presetFields=i}},_u={convertFrom:(e,t)=>e[t].map(n=>({id:n.id,name:n.name+"("+n.code+")"})),convertTo:(e,t,n)=>{const r=[],{fields:i}=e;n.forEach(a=>{const l=i.find(c=>c.id===a.id);l&&r.push(l)}),e[t]=r}};class Nu extends Yo{getPropertyConfig(t,n){return this.propertyConfig.categories.basic=this.getBasicPropConfig(t),this.getAppearanceConfig(),this.getBehaviorConfig(t),this.getQuerySolutionConfig(t),this.getEventPropConfig(t),this.propertyConfig}getBehaviorConfig(t){this.propertyConfig.categories.apperance={description:"Basic Infomation",title:"行为",properties:{isControlInline:{description:"控件标签同行展示",type:"boolean",title:"控件标签同行展示"},presetQuerySolutionName:{description:"系统预置筛选方案名称",type:"string",title:"系统预置筛选方案名称"},filterText:{description:"筛选按钮文本",type:"string",title:"筛选按钮文本"},expanded:{description:"展开",type:"boolean",title:"展开"}}}}getQuerySolutionConfig(t){const n=this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);let r=[];n.forEach(i=>{i.children.length>0?i.children.forEach(a=>{r.push(a.data)}):r.push(i.data)}),r=r.filter(i=>i.$type==="SimpleField"),this.propertyConfig.categories.control={description:"Basic Infomation",title:"编辑器",properties:{fields:{description:"筛选方案字段设置",title:"筛选方案字段",type:"",refreshPanelAfterChanged:!0,editor:{type:"query-solution-config",fieldsConfig:r,formSchemaUtils:this.formSchemaUtils,metadataService:this.metadataService,viewModelId:this.viewModelId,designViewModelUtils:this.designViewModelUtils,eventsEditorUtils:this.eventsEditorUtils},$converter:Tu},presetFields:{description:"系统预置字段",title:"系统预置字段",type:"",editor:{type:"solution-preset",dataSource:t.fields},$converter:_u}}}}getEventPropConfig(t){const n=[{label:"onQuery",name:"查询事件"}],r=this,i=r.eventsEditorUtils.formProperties(t,r.viewModelId,n),a={};a[r.viewModelId]={type:"events-editor",editor:{initialData:i}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(l,c){const u=l.propertyValue;delete t[r.viewModelId],u&&(u.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(t,r.viewModelId,u.events,u)),t.remoteSort=!!t.columnSorted}}}}function Vu(e,t){function n(c,u){const d=e.schema;return new Nu(c,t).getPropertyConfig(d,u)}function r(){return!1}function i(){return!1}function a(){return!1}function l(){var s,p,m,g,b,v;if((p=(s=e==null?void 0:e.parent)==null?void 0:s.parent)!=null&&p.schema){const y=(m=e==null?void 0:e.parent)==null?void 0:m.parent.schema;(g=y.appearance)!=null&&g.class&&((b=y.appearance)!=null&&b.class.includes("f-page-has-scheme"))&&(y.appearance.class=(v=y.appearance)==null?void 0:v.class.replace("f-page-has-scheme","").replace(" ",""))}const{formSchemaUtils:c}=t,u=e.componentInstance.value.belongedComponentId,d=c.getViewModelIdByComponentId(u),f=c.getViewModelById(d);if(f&&f.states){const y=f.states.findIndex(C=>C.code==="originalFilterConditionList");y>-1&&f.states.splice(y,1)}}return{getPropsConfig:n,canAccepts:r,checkCanDeleteComponent:i,checkCanMoveComponent:a,onRemoveComponent:l}}const ku=o.defineComponent({name:"FQuerySolutionDesign",props:Kt,emits:["save","saveAs"],setup(e,t){const n=o.ref(e.fields),r=o.ref([]),i=o.ref(),a=o.ref(1),l=o.inject("design-item-context"),c=o.inject("designer-host-service"),u=Vu(l,c),d=xn(i,l,u);o.onMounted(()=>{i.value.componentInstance=d}),t.expose(d.value);const f=o.computed(()=>e.presetQuerySolutionName||""),s=o.computed(()=>e.filterText||"");o.watch(()=>e.presetFields,C=>{const F=be.cloneDeep(C);F.forEach(w=>{w.editor.type=w.controlType}),n.value=F,r.value=n.value.map(w=>({id:w.id,fieldCode:w.labelCode,fieldName:w.name,value:null})),a.value=a.value+1},{immediate:!0});const p=o.ref(!0),m=o.computed(()=>({"farris-panel":!0,"position-relative":!0,"query-solution":!0})),g=o.computed(()=>({border:"none"}));function b(){return o.createVNode("div",{class:"solution-action"},[o.createVNode("div",{class:"btn-group"},[o.createVNode("button",{type:"button",class:"btn btn-primary "},[s.value])]),p.value&&o.createVNode("div",{class:"icon-group ml-2"},[o.createVNode("span",{class:"icon-group-remove",title:"清空"},[o.createVNode("span",{class:"f-icon f-icon-remove"},null)])])])}function v(){return o.createVNode("div",{class:"solution-header"},[o.createVNode("div",{class:"btn-group mr-3"},[o.createVNode("div",{class:"solution-header-title"},[f.value,o.createVNode("span",{class:"f-icon f-accordion-expand"},null)])]),b()])}function y(){const C=Fu;return o.createVNode(C,{fields:n.value,conditions:r.value,key:a.value,isControlInline:e.isControlInline},null)}return()=>o.createVNode("div",{ref:i,class:m.value,tabindex:"1",style:g.value},[v(),y()])}}),Eu={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/query-solution-config.schema.json",title:"query-solution-config",description:"A Farris Container Component",properties:{fieldsConfig:{description:"筛选配置项",type:"array"},designViewModelUtils:{description:"",type:"object"},formSchemaUtils:{description:"",type:"object"},metadataService:{description:"",type:"object"},viewModelId:{description:"",type:"array"},eventsEditorUtils:{description:"",type:"object"}}},Iu=new Map([["appearance",ht]]);function Mu(e,t,n){return t}const Rr={fieldsConfig:{type:Array,default:[]},modelValue:{type:Array,default:[]},source:{type:String,default:"query-solution"},onFieldsChanged:{type:Function,default:null},formSchemaUtils:{type:Object,default:{}},metadataService:{type:Object,default:{}},designViewModelUtils:{type:Object,default:{}},eventsEditorUtils:{type:Object,default:{}},viewModelId:{type:String,default:""}},Ou=Ue(Rr,Eu,Iu,Mu),Bu={"input-group":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"}},"number-spinner":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},precision:{description:"精度",title:"精度",type:"number"},max:{description:"最大值",title:"最大值",type:"number",editor:{type:"number-spinner",nullable:!0}},min:{description:"最小值",title:"最小值",type:"number",editor:{type:"number-spinner",nullable:!0}}},"number-range":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},precision:{description:"精度",title:"精度",type:"number"},max:{description:"最大值",title:"最大值",type:"number",editor:{type:"number-spinner",nullable:!0}},min:{description:"最小值",title:"最小值",type:"number",editor:{type:"number-spinner",nullable:!0}}},"combo-list":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},enumValueType:{description:"值类型",title:"值类型",type:"select",editor:{type:"combo-list",data:[{value:"int",name:"整型"},{value:"string",name:"字符串"},{value:"boolean",name:"布尔"}],valueField:"value",textField:"name",idField:"value"}}},lookup:{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},helpId:{description:"帮助元数据ID",title:"帮助元数据ID",type:"string"},displayName:{description:"帮助元数据名称",title:"帮助元数据名称",type:"string",readonly:!0},uri:{description:"uri",title:"uri",type:"string",readonly:!0},textField:{description:"文本字段",title:"文本字段",type:"string"},valueField:{description:"值字段",title:"值字段",type:"string"},idField:{description:"标识字段",title:"标识字段",type:"string",readonly:!0},displayType:{description:"类型: 树列表、列表、双列表、左树右列表",title:"展示类型",type:"string",editor:{type:"combo-list",editable:!1,disabled:!0,data:[{text:"列表",value:"List"},{text:"树列表",value:"TreeList"},{text:"双列表",value:"NavList"},{text:"左树右列表",value:"NavTreeList"}],textField:"text",idField:"value",valueField:"value"}},mapFields:{description:"映射",title:"映射",type:"string"},multiSelect:{description:"是否多选",title:"是否多选",type:"boolean"}},"combo-lookup":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},helpId:{description:"帮助元数据",title:"帮助元数据",type:"string"},uri:{description:"uri",title:"uri",type:"string"},textField:{description:"文本字段",title:"文本字段",type:"string"},valueField:{description:"值字段",title:"值字段",type:"string"},idField:{description:"标识字段",title:"标识字段",type:"string"},mapFields:{description:"映射",title:"映射",type:"string"},multiSelect:{description:"是否多选",title:"是否多选",type:"boolean"},editable:{description:"允许编辑",title:"允许编辑",type:"boolean"},nosearch:{description:"任意输入",title:"任意输入",type:"boolean"},displayFields:{description:"展示字段",title:"展示字段",type:"string"},clearFields:{description:"值变化时清空字段",title:"值变化时清空字段",type:"string"},dialogTitle:{description:"面板标题",title:"面板标题",type:"string"},enableMultiFieldSearch:{description:"多字段查询",title:"多字段查询",type:"boolean"}},"date-range":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},"date-picker":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},valueFormat:{description:"查询格式",title:"查询格式",type:"enum",editor:{data:[{name:"yyyy-MM-dd",id:"yyyy-MM-dd"},{name:"yyyy/MM/dd",id:"yyyy/MM/dd"},{name:"yyyyMMdd",id:"yyyyMMdd"},{name:"MM/dd/yyyy",id:"MM/dd/yyyy"}]}},displayFormat:{description:"显示格式",title:"显示格式",type:"enum",editor:{data:[{name:"yyyy-MM-dd",id:"yyyy-MM-dd"},{name:"yyyy/MM/dd",id:"yyyy/MM/dd"},{name:"yyyyMMdd",id:"yyyyMMdd"},{name:"MM/dd/yyyy",id:"MM/dd/yyyy"},{name:"yyyy年MM月dd日",id:"yyyy年MM月dd日"}]}}},"date-time":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},"single-date-time":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},month:{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},"single-year":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},returnFormat:{description:"查询格式",title:"查询格式",type:"string"},format:{description:"显示格式",title:"显示格式",type:"string"}},"radio-group":{class:{description:"样式",title:"样式",type:"string"},required:{description:"必填",title:"是否必填",type:"boolean"},direction:{description:"布局方向",title:"布局方向",type:"select",editor:{type:"combo-list",data:[{text:"水平",value:"horizontal"},{text:"垂直",value:"vertical"}],textField:"text",idField:"value",valueField:"value"}},showLabel:{description:"是否显示标签",title:"是否显示标签",type:"boolean"}}},Pu=new Map([["appearance",jt.resolveAppearance]]);function Ru(e,t,n){return t}const ju={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/button-edit.schema.json",title:"button-edit",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"button-edit"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},forcePlaceholder:{description:"",type:"boolean",default:!1},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""},autoComplete:{description:"",type:"boolean",default:!1},buttonContent:{description:"",type:"string",default:""},enableClear:{description:"",type:"boolean",default:!0},inputType:{description:"",type:"string",enum:["text","tag"],default:"text"},multiSelect:{description:"",type:"boolean",default:!1},popup:{description:"",type:"object",properties:{footerButtons:{type:"array",default:[]},height:{type:"number",default:600},dataMapping:{type:"object"},contents:{type:"array",default:[]},showMaxButton:{type:"boolean",default:!0},showCloseButton:{type:"boolean",default:!0},showFooter:{type:"boolean",default:!0},title:{type:"string",default:""},width:{type:"number",default:800}}},separator:{type:"string",default:","},showButtonWhenDisabled:{description:"",type:"boolean",default:!1},wrapText:{type:"boolean",default:!1},onClear:{description:"",type:"string",default:""}},required:["id","type"]},Du={title:"buttonEdit",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{editable:{description:"",title:"允许编辑",type:"boolean"},readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"},textAlign:{description:"",title:"对齐方式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中"},{value:"right",name:"右对齐"}]}}}}}},jr={id:String,buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},buttonBehavior:{type:String,default:"Popup"},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},showButtonWhenDisabled:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:Number,tabIndex:Number,popupHost:{type:Object},popupRightBoundary:{type:Object},popupOffsetX:{type:Object},popupOnInput:{type:Boolean,default:!1},popupOnFocus:{type:Boolean,default:!1},popupOnClick:{type:Boolean,default:!1},popupMinWidth:{type:Number,default:160},modalOptions:{type:Object,default:{}},wrapText:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","},textAlign:{type:String,default:"left"},beforeClickButton:{type:Function,default:null},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},beforeOpen:{type:Function,default:null},updateOn:{type:String,default:"change"},keepWidthWithReference:{type:Boolean,default:!0},placement:{type:String,default:"bottom-left"}};Ue(jr,ju,Pu,Ru,Du);const $u={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object},backgroundColor:{type:String,default:""}},Au=o.defineComponent({name:"FOverlay",props:$u,emits:["click"],setup(e,t){const n=o.ref(e.popupContentPosition),r=o.ref(e.host),i=o.computed(()=>({backgroundColor:e.backgroundColor||"",pointerEvents:"auto"}));function a(c){t.emit("click"),c.preventDefault(),c.stopPropagation()}o.computed(()=>{const c=r.value;if(c){const u=c.getBoundingClientRect(),{left:d,top:f,height:s}=u;return{left:d,top:f+s}}return n.value});const l=o.computed(()=>({}));return()=>o.createVNode(o.Teleport,{to:"body"},{default:()=>{var c,u;return[o.createVNode("div",{class:"overlay-container",onClick:d=>a(d),style:i.value},[o.createVNode("div",{style:l.value},[(u=(c=t.slots).default)==null?void 0:u.call(c)])])]}})}});function Lu(e){if(e.content&&e.content.render)return e.content.render;if(e.render&&typeof e.render=="function")return e.render}function qu(e){const t=document.createElement("div");t.style.display="contents";let n;const r=e.onClickCallback||(()=>{}),i=()=>{r(),n&&n.unmount()};return n=o.createApp({setup(){o.onUnmounted(()=>{document.body.removeChild(t)});const a=Lu(e);return()=>o.createVNode(Au,{"popup-content-position":e.popupPosition,host:e.host,onClick:i,backgroundColor:e.backgroundColor},{default:()=>[a&&a()]})}}),document.body.appendChild(t),n.mount(t),n}class Wu{static show(t){return qu(t)}}function Dr(e,t){function n(){const r=e.beforeOpen||e.beforeClickButton||null;let i=Promise.resolve(!0);if(r){const a=r(t.value);if(typeof a>"u")return i;typeof a=="boolean"?i=Promise.resolve(a):i=a}return i}return{judgeCanOpen:n}}function Hu(e,t,n,r,i){const a=o.ref(e.buttonBehavior),l=o.ref(e.popupOnInput),c=o.computed(()=>({"input-group-append":!0,"append-force-show":e.showButtonWhenDisabled&&(e.readonly||e.disable)})),{judgeCanOpen:u}=Dr(e,i),d=o.computed(()=>e.showButtonWhenDisabled||(!e.editable||!e.readonly)&&!e.disable),f=o.inject(Do,null),s=o.ref();async function p(b){if(await u()&&d.value){const v=!!t.slots.default;if(a.value==="Modal"){const y=e.modalOptions,C=f==null?void 0:f.open({...y,render:()=>t.slots.default&&t.slots.default()});s.value=C==null?void 0:C.modalRef}a.value==="Overlay"&&Wu.show({host:document.body,backgroundColor:"rgba(0,0,0,.15)",render:()=>t.slots.default&&t.slots.default()}),v&&a.value==="Popup"&&r.togglePopup(!0),v&&l.value&&r.hidePopup(),t.emit("clickButton",{origin:b,value:e.modelValue})}}function m(b){t.emit("mouseEnterIcon",b)}function g(b){t.emit("mouseLeaveIcon",b)}return{buttonGroupClass:c,onClickButton:p,onMouseEnterButton:m,onMouseLeaveButton:g,modalRef:s}}function Uu(e,t,n,r,i,a){const l=o.ref(!1),c=o.computed(()=>e.enableClear&&!e.readonly&&!e.disable),{changeTextBoxValue:u}=a;function d(m){l.value=m}o.watch(i,()=>{d(!!i.value)});function f(m){const g=!e.readonly&&!e.disable&&e.editable,b=!e.editable;m.stopPropagation(),(g||b)&&(u(""),d(!l.value),t.emit("clear"))}function s(m){if(c.value){if(!n.value){d(!1);return}!e.disable&&!e.readonly&&d(!0)}}function p(m){c.value&&d(!1)}return{enableClearButton:c,showClearButton:l,onClearValue:f,onMouseEnterTextBox:s,onMouseLeaveTextBox:p}}function zu(e,t,n,r,i){const a=o.computed(()=>e.popupOnInput),l=o.computed(()=>e.popupOnFocus),{shouldPopupContent:c}=i,u=o.computed(()=>e.enableTitle?n.value:""),d=o.computed(()=>(e.disable||e.readonly)&&!e.forcePlaceholder?"":e.placeholder),f=o.computed(()=>e.readonly||!e.editable),s=o.ref(!1),p=o.computed(()=>!e.disable&&s.value),m=o.computed(()=>({"text-left":e.textAlign==="left","text-center":e.textAlign==="center","text-right":e.textAlign==="right","form-control":!0,"f-utils-fill":!0})),g=o.computed(()=>({"input-group":!0,"f-state-disabled":e.disable,"f-state-editable":e.editable&&!e.disable&&!e.readonly,"f-state-readonly":e.readonly&&!e.disable,"f-state-focus":p.value}));function b(x,k=!0){n.value=x,k&&(t.emit("change",x),t.emit("update:modelValue",x))}function v(x){c.value=!1,b(x,!0)}o.watch(()=>e.modelValue,x=>{n.value=x});function y(x){s.value=!1,t.emit("blur",x),x.stopPropagation()}function C(x){t.emit("click",x),!e.disable&&!e.readonly&&e.popupOnClick&&i.togglePopup()}function F(x){e.disable||(s.value=!0,f.value||(t.emit("focus",x),l.value&&!c.value&&i.popup()))}function w(x){t.emit("input",x.target.value);const k=x.target.value;r.value=k,n.value!==k&&b(k,e.updateOn==="change"),a.value&&!c.value&&i.popup()}function S(x){x.target.tagName!=="INPUT"&&x.preventDefault(),x.stopPropagation()}function N(x){t.emit("keydown",x)}function h(x){x.key==="Enter"&&(a.value||l.value)&&i.hidePopup(),t.emit("keyup",x)}function _(x){const k=x.target.value;x.stopPropagation(),b(k)}return{hasFocusedTextBox:p,isTextBoxReadonly:f,textBoxClass:m,textBoxPlaceholder:d,textBoxTitle:u,inputGroupClass:g,changeTextBoxValue:b,commitValue:v,onBlurTextBox:y,onClickTextBox:C,onFocusTextBox:F,onInput:w,onKeyDownTextBox:N,onKeyUpTextBox:h,onMouseDownTextBox:S,onTextBoxValueChange:_}}function Gu(e,t,n,r){const i=o.ref(),a=o.ref(!1),{judgeCanOpen:l}=Dr(e,r);function c(){const s=i.value;s&&s.show(n.value)}async function u(s=!1){if(!!t.slots.default){if(!s&&!a.value&&!await l())return;a.value=!a.value,await o.nextTick(),c()}}async function d(s=!1){if(!!t.slots.default){if(!s&&!await l())return;a.value=!0,await o.nextTick(),c()}}function f(){a.value=!1}return{hidePopup:f,popup:d,shouldPopupContent:a,togglePopup:u,popoverRef:i}}function Xu(e,t,n){const r=o.ref(),{isTextBoxReadonly:i,textBoxClass:a,textBoxPlaceholder:l,textBoxTitle:c,onBlurTextBox:u,onClickTextBox:d,onFocusTextBox:f,onInput:s,onKeyDownTextBox:p,onKeyUpTextBox:m,onMouseDownTextBox:g,onTextBoxValueChange:b}=n;return o.onMounted(()=>{var v,y;e.selectOnCreated&&((v=r.value)==null||v.select()),e.focusOnCreated&&((y=r.value)==null||y.focus())}),()=>o.createVNode("input",{ref:r,name:"input-group-value",autocomplete:e.autoComplete?"on":"off",class:a.value,disabled:e.disable,maxlength:e.maxLength,minlength:e.minLength,placeholder:l.value,readonly:i.value,tabindex:e.tabIndex,title:c.value,type:e.inputType,value:t.value,onBlur:u,onChange:b,onClick:d,onFocus:f,onInput:s,onKeydown:p,onKeyup:m,onMousedown:g},null)}function Yu(e,t,n){const r=o.ref(e.separator),{changeTextBoxValue:i}=n,a=o.computed(()=>t.value?t.value.split(r.value).map(c=>({name:c,selectable:!0})):[]);function l(c){i(c.map(u=>u.name).join(r.value),!0)}return()=>o.createVNode(to,{id:`${e.id}-tag-editor`,class:"form-control",data:a.value,showClose:!0,showInput:!0,onChange:l},null)}function Ju(e,t,n,r){const{buttonGroupClass:i,onClickButton:a,onMouseEnterButton:l,onMouseLeaveButton:c}=n,{enableClearButton:u,showClearButton:d,onClearValue:f}=r,s=o.ref();return{renderButtonGroup:()=>o.createVNode("div",{id:`${e.id}-button-group`,class:i.value},[u.value&&o.withDirectives(o.createVNode("span",{class:"input-group-text input-group-clear",onClick:f},[o.createVNode("i",{class:"f-icon modal_close"},null)]),[[o.vShow,d.value]]),t.slots.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",onClick:a,onMouseenter:l,onMouseleave:c},[t.slots.buttonContent()]):e.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",innerHTML:e.buttonContent,ref:s,onClick:a,onMouseenter:l,onMouseleave:c},null):null]),buttonHandleElement:s}}function Qu(e,t,n){const r=o.ref(e.popupMinWidth),{hidePopup:i,popoverRef:a}=n;return()=>o.createVNode(Hi,{id:`${e.id}-popover`,ref:a,visible:!0,placement:e.placement,host:e.popupHost,"keep-width-with-reference":e.keepWidthWithReference,fitContent:!0,"right-boundary":e.popupRightBoundary,minWidth:r.value,offsetX:e.popupOffsetX,onHidden:i},{default:()=>{var l,c;return[(c=(l=t.slots).default)==null?void 0:c.call(l)]}})}const Ku=o.defineComponent({name:"FButtonEdit",props:jr,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue"],setup(e,t){const n=o.ref(),r=o.ref(e.customClass),i=o.ref(e.modelValue),a=Gu(e,t,n,i),{shouldPopupContent:l,hidePopup:c,togglePopup:u}=a,d=Hu(e,t,n,a,i),f=o.ref(""),s=zu(e,t,i,f,a),{hasFocusedTextBox:p,commitValue:m,inputGroupClass:g}=s,b=Uu(e,t,i,p,f,s),{onMouseEnterTextBox:v,onMouseLeaveTextBox:y}=b,C=o.computed(()=>{const x={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!e.wrapText};return r.value&&r.value.split(" ").reduce((k,T)=>(k[T]=!0,k),x),x});function F(){return e.multiSelect&&e.inputType==="tag"?Yu(e,i,s):Xu(e,i,s)}let w=F();o.watch([()=>e.multiSelect,()=>e.inputType],()=>{w=F()});const{renderButtonGroup:S,buttonHandleElement:N}=Ju(e,t,d,b),h=Qu(e,t,a),_={commitValue:m,elementRef:n,hidePopup:c,shouldPopupContent:l,togglePopup:u,openDialog:()=>{N.value&&e.buttonBehavior==="Modal"&&N.value.click()},getModal:()=>{var x;return e.buttonBehavior==="Modal"?(x=d.modalRef.value)==null?void 0:x.value:null}};return o.onMounted(()=>{n.value.componentInstance=_,window.onresize=()=>{document.body.click()}}),t.expose(_),()=>o.createVNode(o.Fragment,null,[o.createVNode("div",o.mergeProps(t.attrs,{ref:n,class:C.value,id:e.id}),[o.createVNode("div",{id:`${e.id}-input-group`,class:g.value,onMouseenter:v,onMouseleave:y},[w(),S()])]),l.value&&h()])}}),Zu={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/field-selector.schema.json",title:"field-selector",description:"A Farris Input Component",type:"object",properties:{disabled:{description:"",type:"boolean",default:"false"},readonly:{description:"",type:"boolean",default:"false"},modelValue:{description:"",type:"object",default:null},data:{description:"",type:"array",default:[]},idField:{description:"",type:"string",default:"id"},columns:{description:"",type:"array",default:[]},title:{description:"",type:"string",default:"字段选择器"},modalWidth:{description:"",type:"number",default:800},modalHeight:{description:"",type:"number",default:600},multiSelect:{description:"",type:"boolean",default:!1},separator:{description:"",type:"string",default:","},bindingData:{description:"",type:"array",default:[]},textField:{description:"",type:"string",default:"code"},beforeOpenDialog:{description:"",type:"object",default:null},editorParams:{description:"",type:"object",default:null},onSubmitModal:{description:"",type:"object",default:null},onFieldSelected:{description:"",type:"object",default:null},repositoryToken:{description:"",type:"object",default:null}}},ed=[{field:"code",title:"绑定字段"},{field:"name",title:"名称"},{field:"fieldType",title:"字段类型"}],Yn=Symbol("Field_Selector Component Repository Service Token");Ue({disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},modelValue:{type:[String,Array],default:null},data:{type:Array,default:[]},idField:{type:String,default:"id"},columns:{type:Array,default:ed},title:{type:String,default:"字段选择器"},modalWidth:{type:Number,default:800},modalHeight:{type:Number,default:600},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","},bindingData:{type:Array,default:[]},textField:{type:String,default:"code"},beforeOpenDialog:{type:Function,default:null},editorParams:{type:Object,default:null},onSubmitModal:{type:Function,default:null},onFieldSelected:{type:Function,default:null},repositoryToken:{type:Symbol,default:null}},Zu);const td=Symbol("schema_repository_token"),nd={convertFrom:(e,t)=>e[t],convertTo:(e,t,n)=>{e[t]=n.value}};function od(e,t){const n={"input-group":{key:"input-group",value:"文本"},"number-spinner":{key:"number-spinner",value:"数值"},"number-range":{key:"number-range",value:"数值区间"},lookup:{key:"lookup",value:"弹出帮助"},"combo-lookup":{key:"combo-lookup",value:"下拉帮助"},"date-picker":{key:"date-picker",value:"日期"},"combo-list":{key:"combo-list",value:"下拉面板"},"radio-group":{key:"radio-group",value:"单选"}};function r(p){const m=e.fieldsConfig.find(b=>b.id===p.id);let g=[];if(m){switch(m.type.name){case"Enum":case"Boolean":g=[n["radio-group"],n["combo-list"]];break;case"Number":case"Integer":case"Decimal":case"BigNumber":g=[n["number-spinner"],n["number-range"]];break;case"String":g=[n["input-group"],n.lookup,n["date-picker"],n["radio-group"],n["combo-list"]];break;case"Date":case"DateTime":g=[n["date-picker"]];break}return g}else return[{key:"input-group",value:"文本"}]}function i(p){return{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"标识",title:"标识",type:"string",readonly:!0},code:{description:"编号",title:"控件编号",type:"string",readonly:!0},labelCode:{description:"标签",title:"标签",type:"string",readonly:!0},name:{description:"控件名称",title:"控件名称",type:"string"},controlType:{description:"控件类型",title:"控件类型",type:"string",editor:{type:"combo-list",data:r(p),valueField:"key",textField:"value",idField:"id",editable:!1,multiSelect:!1}}}}}function a(p){let m="form_group_"+Date.now();return p&&(m=p.replaceAll("-","_").replaceAll(".","_")),"lookup."+m}function l(p){const m={description:"帮助元数据",title:"帮助元数据",type:"string",refreshPanelAfterChanged:!0,editor:{type:"schema-selector",title:"选择数据源",editorParams:{propertyData:p,formBasicInfo:e.formSchemaUtils.getFormMetadataBasicInfo()},viewOptions:[{id:"recommend",title:"推荐",type:"List",dataSource:"Recommand",enableGroup:!0,groupField:"category",groupFormatter:(y,C)=>`${y==="local"?"本地元数据":"最近使用"}`},{id:"total",title:"全部",type:"List",dataSource:"Total"}],repositoryToken:td,onSubmitModal:y=>{if(y){const C=e.formSchemaUtils.getFormMetadataBasicInfo();return e.metadataService.getPickMetadata(C.relativePath,y[0].data).then(F=>{const w=JSON.parse(F==null?void 0:F.metadata.content);return p.helpId=w.id,p.displayName=w.name,p.displayType=w.displayType,p.textField=w.textField,p.valueField=w.valueField,p.idField=w.idField,p.uri=a(w.id),p.dataSource={displayName:w.name,idField:w.idField,uri:p.uri},null})}}}},g={description:"显示文本字段",title:"文本字段",type:"string",editor:{type:"field-selector",bindingType:{enable:!1},textField:"bindingPath",editorParams:{propertyData:p,formBasicInfo:e.formSchemaUtils.getFormMetadataBasicInfo()},columns:[{field:"name",title:"名称"},{field:"code",title:"编号"},{field:"bindingPath",title:"绑定字段"}],repositoryToken:Yn,onSubmitModal:y=>(p.textField=y[0].bindingPath,null)}},b={description:"显示值字段",title:"值字段",type:"string",editor:{type:"field-selector",bindingType:{enable:!1},textField:"bindingPath",editorParams:{propertyData:p,formBasicInfo:e.formSchemaUtils.getFormMetadataBasicInfo()},columns:[{field:"name",title:"名称"},{field:"code",title:"编号"},{field:"bindingPath",title:"绑定字段"}],repositoryToken:Yn,onSubmitModal:y=>(p.valueField=y[0].bindingPath,null)}},v={description:"字段映射",title:"字段映射",type:"string",editor:{type:"mapping-editor",modalWidth:800,modalHeight:600,editable:!1,editorParams:{propertyData:p,formBasicInfo:e.formSchemaUtils.getFormMetadataBasicInfo()},fromData:{editable:!1,formatter:(y,C)=>`${C.raw[y.field]} [${C.raw.bindingPath}]`,idField:"id",textField:"bindingPath",valueField:"bindingPath",repositoryToken:Yn},toData:{idField:"id",textField:"bindingPath",valueField:"bindingPath",dataSource:e.designViewModelUtils.getAllFields2TreeByVMId(e.viewModelId),formatter:(y,C)=>`${C.raw[y.field]} [${C.raw.bindingPath}]`}}};return{helpId:m,textField:g,valueField:b,mappingFields:v}}function c(p){return{enumValues:{description:"枚举值",title:"枚举值",type:"string",editor:{columns:[{field:"value",title:"值",dataType:"string"},{field:"name",title:"名称",dataType:"string"},{field:"disabled",title:"禁用",visible:!1,dataType:"boolean",editor:{type:"switch"}}],type:"item-collection-editor",valueField:"value",nameField:"name",requiredFields:["value","name"],uniqueFields:["value","name"]},$converter:nd}}}function u(p){const{controlType:m}=p,g={description:"",title:"控件",properties:Bu[m]};if(m==="lookup"||m==="combo-lookup"){const{helpId:b,textField:v,valueField:y,mappingFields:C}=l(p);g.properties.helpId=b,g.properties.textField=v,g.properties.valueField=y,g.properties.mapFields=C}else if(m==="radio-group"||m==="combo-list"){const{enumValues:b}=c();g.properties.data=b}else if(m==="date-picker"){const b=e.fieldsConfig.find(v=>v.id===p.id);if(b&&(b.type.name==="Date"||b.type.name==="DateTime")){const{valueFormat:v,...y}=g.properties;g.properties=y}}return g}function d(p){const m=[{label:"valueChangedCmd",name:"值变化事件"}];switch(p){case"combo-lookup":case"lookup":m.push({label:"preEventCmd",name:"帮助前事件"},{label:"preEventCmd",name:"帮助前事件"});break;case"combo-list":m.push({label:"beforeShow",name:"面板展开前事件"},{label:"afterShow",name:"面板关闭后事件"});break}return m}function f(p){const m=d(p.controlType),g=e.eventsEditorUtils.formProperties(p,e.viewModelId,m),b={};return b[e.viewModelId]={type:"events-editor",editor:{initialData:g}},{title:"事件",hideTitle:!0,properties:b,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(y,C){const F=y.propertyValue;delete p[e.viewModelId],F&&(F.setPropertyRelates=this.setPropertyRelates,e.eventsEditorUtils.saveRelatedParameters(p,e.viewModelId,F.events,F)),p.remoteSort=!!p.columnSorted}}}function s(p){const m=i(p),g=u(p);return f(p),{title:"query-solution-config",description:"A Farris Component",type:"object",categories:{basic:m,control:g}}}return{getPropertyConfig:s}}function rd(e,t,n,r){const i=o.ref(),a=o.ref("query-solution-config"),l=o.ref({}),c=o.ref(),u=o.ref(null),{getPropertyConfig:d}=od(e);o.watch(()=>{var b;return(b=n.value)==null?void 0:b.id},(b,v)=>{if(!b)u.value=null;else if(b!==v){const y=r.get(b);u.value=y}});function f(b){return{id:b.id,code:b.code||b.id,labelCode:b.labelCode,name:b.name,controlType:b.controlType}}function s(b,v){const y={class:"",required:!1};let C={};switch(b){case"input-group":break;case"number-range":case"number-spinner":C={precision:2,max:null,min:null};break;case"combo-list":C={uri:"",multiSelect:!1,data:(v==null?void 0:v.data)||[],valueField:"value",textField:"name",idField:"value",enumValueType:(v==null?void 0:v.enumValueType)||"string"};break;case"lookup":C={helpId:"",uri:"",textField:"",valueField:"",idField:"",mapFields:"",multiSelect:!1,panelHeight:null};break;case"combo-lookup":C={helpId:"",uri:"",textField:"",valueField:"",idField:"",mapFields:"",multiSelect:!1,editable:!1,nosearch:!1,clearFields:"",dialogTitle:"",enableMultiFieldSearch:!1};break;case"date-range":case"date-picker":C={valueFormat:"yyyy-MM-dd",displayFormat:"yyyy-MM-dd"};break;case"radio-group":C={direction:"horizontal",showLabel:!1,data:(v==null?void 0:v.data)||[]};break}return{...y,...C}}function p(b){const v={class:"",required:!1,isExtend:!1};let y={};switch(b){case"input-group":break;case"number-range":case"number-spinner":y={precision:2,max:null,min:null};break;case"combo-list":y={uri:"",enumValue:[],multiSelect:!1};break;case"lookup":y={helpId:"",uri:"",textField:"",valueField:"",idField:"",mapFields:"",multiSelect:!1,panelHeight:null};break;case"combo-lookup":y={helpId:"",uri:"",textField:"",valueField:"",idField:"",mapFields:"",multiSelect:!1,editable:!1,nosearch:!1,clearFields:"",dialogTitle:"",enableMultiFieldSearch:!1};break;case"date-range":case"date-picker":y={valueFormat:"yyyy-MM-dd",displayFormat:"yyyy-MM-dd"};break;case"radio-group":y={direction:"horizontal",showLabel:!1};break}return{...v,...y}}function m(b,v){return e.source==="query-solution"?s(b,v):p(b)}o.watch(()=>{var b,v;return[(b=u.value)==null?void 0:b.id,(v=u.value)==null?void 0:v.controlType]},([b,v],[y,C])=>{if(!b)i.value.updatePropertyConfig({},{});else if(b!==y){const F=d(u.value);i.value.updatePropertyConfig(F,u.value)}else if(v!==C){const F=r.get(b),w=f(F);w.controlType=v;const S={...w,...m(v,F)};r.set(b,S),u.value=r.get(b);const N=d(u.value);i.value.updatePropertyConfig(N,u.value)}});function g(){return o.createVNode(bs,{propertyConfig:c.value,ref:i,propertyName:a.value,schema:l.value},{default:()=>[o.createTextVNode(" ")]})}return{renderPanel:g,getExtendSchemaProerty:m}}const id=new Map([["appearance",ht]]);function ad(e,t,n){return t}const ld={title:"transfer",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},sd={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/transfer.schema.json",title:"transfer",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for transfer",type:"string"},type:{description:"The type string of transfer",type:"string",default:"transfer"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},$r={dataSource:{type:Array,default:[]},displayType:{type:String,default:"List"},enableSearch:{type:Boolean,default:!0},identifyField:{type:String,default:"id"},textField:{type:String,default:"name"},placeholder:{type:String,default:""},selections:{type:Array,default:[]},selectionValues:{type:Array,default:[]},rowOption:{type:Object}};Ue($r,sd,id,ad,ld);const cd=new Map([["appearance",ht]]);function ud(e,t,n){return t}const dd={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/list-view.schema.json",title:"list-view",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for list-view",type:"string"},type:{description:"The type string of list-view",type:"string",default:"list-view"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},fd={title:"list-view",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},Ar={columns:{type:Array,default:[{field:"name",title:"",dataType:"string"}]},data:{type:Array,default:[]},draggable:{type:Boolean,default:!1},multiSelect:{Type:Boolean,default:!1},multiSelectMode:{Type:String,default:"OnCheck"},idField:{Type:String,default:"id"},valueField:{Type:String,default:"id"},textField:{Type:String,default:"name"},titleField:{Type:String,default:"name"},view:{Type:String,default:"ContentView"},size:{Type:String,default:"default"},placeholder:{type:String,default:""},header:{Type:String,default:"ContentHeader"},headerClass:{Type:String,default:""},itemClass:{Type:String,default:""},selectionValues:{type:Array,default:[]},group:{type:Object},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},keepOrder:{type:Boolean,default:!1},disableField:{type:String,default:"disabled"},enableHighlightSearch:{type:Boolean,default:!0},virtualized:{type:Boolean,default:!0}};Ue(Ar,dd,cd,ud,fd);function pd(e,t){function n(a){const l=[];let c=a.nextNode();for(;c;)l.push(c),c=a.nextNode();return l}function r(a,l){const c=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);return n(c).map(s=>({textNode:s,text:(s.textContent||"").toLocaleLowerCase()})).map(({textNode:s,text:p})=>{const m=[];let g=0;for(;g<p.length;){const b=p.indexOf(l,g);if(b===-1)break;m.push(b),g=b+l.length}return m.map(b=>{const v=new Range;return v.setStart(s,b),v.setEnd(s,b+l.length),v})}).flat()}function i(a){if(!CSS.highlights||(CSS.highlights.clear(),!a||!t))return;const l=r(t.value,a.toLocaleLowerCase()),c=new Highlight(...l);CSS.highlights.set("search-result",c)}return{search:i}}function Lr(e,t,n,r,i,a,l,c,u,d){const f=o.ref(e.size),s=o.ref(e.textField),p=o.ref(e.titleField),m=o.ref(e.disableField),g=o.computed(()=>{var _,x;return((_=e.selection)==null?void 0:_.multiSelect)&&((x=e.selection)==null?void 0:x.showCheckbox)}),{onMouseenterItem:b,onMouseoverItem:v,onMouseoutItem:y}=a,{getKey:C,listViewItemClass:F,onCheckItem:w,onClickItem:S}=l,N=o.computed(()=>e.itemClass?{}:{margin:f.value==="small"?"0.25rem 0":"8px 0"});function h(_,x,k){return _.checked=c.findIndexInSelectedItems(_)>-1,o.createVNode("li",{class:F(_,x),id:C(_,x),key:C(_,x),onClick:T=>S(T,_,x),onMouseenter:T=>b(T,_,x),onMouseover:T=>v(T,_,x),onMouseout:T=>y(T,_,x)},[g.value&&o.createVNode("div",{class:"f-list-select",onClick:T=>T.stopPropagation()},[o.createVNode(Et.FCheckbox,{id:"list-"+C(_,x),customClass:"listview-checkbox",disabled:_[m.value],checked:_.checked,"onUpdate:checked":T=>_.checked=T,onChange:T=>{w(_,x,!T.checked)}},null)]),o.createVNode("div",{class:"f-list-content"},[o.createVNode("div",{style:N.value,title:_.raw[p.value]||_.raw[s.value]},[_.raw[s.value]])])])}return{renderItem:h}}function md(e,t,n,r,i,a,l,c,u,d){const f=o.ref(e.multiSelect),s=o.ref(e.disableField),{onMouseenterItem:p,onMouseoverItem:m,onMouseoutItem:g}=a,{getKey:b,listViewItemClass:v,onCheckItem:y,onClickItem:C}=l;function F(S,N,h){return t.slots.content?o.createVNode(o.Fragment,null,[t.slots.content&&t.slots.content({item:S.raw,index:N,selectedItem:h})]):o.createVNode("div",{style:"margin: 10px 0;"},[S.raw.name])}function w(S,N,h){return o.createVNode("li",{class:v(S,N),id:b(S,N),key:b(S,N),onClick:_=>C(_,S,N),onMouseenter:_=>p(_,S,N),onMouseover:_=>m(_,S,N),onMouseout:_=>g(_,S,N)},[f.value&&o.createVNode("div",{class:"f-list-select",onClick:_=>_.stopPropagation()},[o.createVNode(Et.FCheckbox,{id:"list-"+b(S,N),customClass:"listview-checkbox",disabled:S[s.value]||!S.checked,checked:S.checked,"onUpdate:checked":_=>S.checked=_,onChange:_=>y(S,N,!_.checked)},null)]),o.createVNode("div",{class:"f-list-content"},[F(S,N,h)])])}return{renderItem:w}}function hd(e,t,n,r,i,a,l,c,u,d){const f=o.ref(e.multiSelect),s=o.ref(e.disableField),{onMouseenterItem:p,onMouseoverItem:m,onMouseoutItem:g}=a,{getKey:b,listViewItemClass:v,onCheckItem:y,onClickItem:C}=l,{dragstart:F,dragenter:w,dragover:S,dragend:N}=r,{removeItem:h}=u,_=o.computed(()=>({margin:f.value?"10px 0":"10px 0px 10px 14px"}));function x(I){return o.createVNode("div",{style:_.value},[I.raw.name])}function k(){return t.slots.itemContent?t.slots.itemContent:x}const T=k();function V(I,E,M){return o.createVNode("li",{class:v(I,E),id:b(I,E),key:b(I,E),onClick:B=>C(B,I,E),onMouseenter:B=>p(B,I,E),onMouseover:B=>m(B,I,E),onMouseout:B=>g(B,I,E),draggable:"true",onDragstart:B=>F(B,I,E),onDragenter:B=>w(B,E),onDragend:B=>N(B,I),onDragover:B=>S(B,E)},[f.value&&o.createVNode("div",{class:"f-list-select",onClick:B=>B.stopPropagation()},[o.createVNode(Et.FCheckbox,{id:"list-"+b(I,E),customClass:"listview-checkbox",disabled:I[s.value]||!I.checked,checked:I.checked,"onUpdate:checked":B=>I.checked=B,onChange:B=>y(I,E,!B.checked)},null)]),o.createVNode("div",{class:"f-list-content"},[T(I)]),o.createVNode("div",{class:"f-list-remove",onClick:B=>h(E)},[o.createVNode("div",{class:"f-list-remove-icon"},[o.createVNode("i",{class:"f-icon f-icon-remove_face"},null)])]),o.createVNode("div",{class:"f-list-handle"},[o.createVNode("div",null,[o.createVNode("i",{class:"f-icon f-icon-drag-vertical"},null)])])])}return{renderItem:V}}function gd(e,t,n,r,i,a,l,c,u,d){var b;const f=o.ref(((b=e.group)==null?void 0:b.groupFields)||[]),{collpaseGroupIconClass:s}=i,{toggleGroupRow:p}=d;function m(v,y){y.collapse=!y.collapse,n.value=p(y.collapse?"collapse":"expand",y,n.value)}function g(v,y,C){return v.layer>-1&&o.createVNode("div",{class:"f-navlookup-recentHeader",onClick:F=>m(F,v)},[o.createVNode("div",{class:"fv-grid-group-row-icon"},[o.createVNode("span",{class:s(v)},null)]),o.createVNode("div",{class:"f-navlookup-recommandLabel"},[v.raw[f.value[v.layer]]])])}return{renderItem:g}}function yd(e,t,n,r){const i=o.ref(e.idField),{dataView:a}=n,l=o.ref(-1),c=o.ref(!1),{activeIndex:u,focusedItemId:d,hoverIndex:f,resumeHover:s,suspendHover:p}=r;function m(y,C,F){y.stopPropagation(),p(),C&&setTimeout(()=>{l.value=F,c.value=!0,C.moving=!0})}function g(y,C){if(y.preventDefault(),l.value!==C){const F=a.value[l.value],w=a.value;w.splice(l.value,1),w.splice(C,0,F),l.value=C}}function b(y,C){y.preventDefault(),y.dataTransfer&&(y.dataTransfer.dropEffect="move")}function v(y,C){C&&(C.moving=!1),a.value.forEach((F,w)=>{F.__fv_index__=w}),c.value=!1,s(),f.value=C.raw.__fv_index__,u.value=C.raw.__fv_index__,d.value=C.raw[i.value],t.emit("change",a.value),t.emit("activeChange",C)}return{dragstart:m,dragenter:g,dragover:b,dragend:v,isDragging:c}}function vd(e,t,n){const{dataView:r}=n;function i(a){if(a>-1&&a<r.value.length){const l=r.value.splice(a,1);t.emit("removeItem",l[0])}}return{removeItem:i}}function bd(e,t,n,r,i,a){const l=o.ref(e.idField),c=o.ref(e.disableField),u=o.ref(e.draggable),d=o.ref(e.itemClass),f=o.ref(e.selection.multiSelect??!1),s=o.ref(e.selection.multiSelectMode),{isDragging:p}=r,{activeIndex:m,focusedItemId:g,hoverIndex:b}=i,{clearSelection:v,getSelectedItems:y,toggleSelectItem:C}=a,F=o.ref(y());function w(T,V){const I={"f-list-view-group-item":!0,"f-list-view-draggable-item":u.value,"f-un-click":!T.checked,"f-un-select":!!T.raw[c.value],"f-listview-active":T.raw.__fv_index__===m.value,"f-listview-hover":!p.value&&V===b.value,moving:!!T.moving};return d.value.split(" ").reduce((M,B)=>(M[B]=!0,M),I),I}function S(T,V){return T.raw[l.value]||""}const N=o.computed(()=>!f.value);function h(T,V,I){T.checked=I,!T.raw[c.value]&&(N.value&&(g.value=T.raw[l.value]),C(T))}const _=o.computed(()=>f.value&&s.value==="OnCheckClearByClick"),x=o.computed(()=>!f.value||f.value&&(s.value==="OnCheckAndClick"||s.value==="OnClick"));function k(T,V,I){if(V.raw[c.value]){T.preventDefault(),T.stopPropagation();return}g.value=V.raw[l.value],m.value=I,_.value&&v(),x.value&&(C(V),F.value=y()),t.emit("clickItem",{data:F.value,index:I}),t.emit("activeChange",F.value)}return{getKey:S,listViewItemClass:w,onCheckItem:h,onClickItem:k}}function Cd(e,t,n,r,i,a,l,c){const u=o.ref(e.view),d=o.ref(e.view==="CardView"),f=o.ref({}),s=o.ref("暂无数据"),p=yd(e,t,r,a),m=vd(e,t,r),g=bd(e,t,n,p,a,l),b=o.computed(()=>({"f-list-view-group":!0,"f-list-view-group-multiselect":e.multiSelect,"d-flex":d.value,"flex-wrap":d.value})),v=o.computed(()=>!!n.value&&n.value.length>0),y=o.computed(()=>n.value.length===0);o.computed(()=>y.value&&!t.slots.empty);function C(){return u.value==="SingleView"?Lr:u.value==="DraggableView"?hd:(u.value==="ContentView"||u.value==="CardView")&&t.slots.content?md:Lr}const F=C(),{renderItem:w}=F(e,t,n,p,i,a,g,l,m,c),{renderItem:S}=gd(e,t,n,p,i,a,g,l,m,c),N=[w,S];function h(){return n.value.filter(k=>k.visible!==!1).map((k,T)=>N[k.type](k,T,f))}function _(){return o.createVNode("div",{class:"f-list-view-emptydata"},[o.createVNode("p",{class:"f-empty-title"},[t.slots.empty?t.slots.empty():s.value])])}function x(){return o.createVNode("ul",{class:b.value,style:"list-style: none;"},[v.value&&h(),y.value&&_()])}return{renderListArea:x}}function wd(e,t,n){function r(){return t.slots.header&&o.createVNode("div",{class:"f-list-view-header"},[t.slots.header()])}return{renderHeader:r}}function qr(e,t,n){const r=o.ref(e.headerClass),i=o.ref(e.placeholder),a=o.ref(""),l=o.computed(()=>!a.value),c=o.computed(()=>!!a.value);function u(p){a.value=""}o.watch(a,p=>{e.enableHighlightSearch&&n.search(p),t.emit("afterSearch",p)});const d=o.computed(()=>{const p={"form-group":!0,"farris-form-group":!0};return r.value&&r.value.split(" ").reduce((g,b)=>(g[b]=!0,g),p),p});function f(p){}function s(){return o.createVNode("div",{class:"f-list-view-header",onClick:o.withModifiers(()=>f,["prevent","stop"])},[o.createVNode("div",{class:d.value},[o.createVNode("div",{class:"farris-input-wrap"},[o.createVNode("div",{class:"f-cmp-inputgroup"},[o.createVNode("div",{class:"input-group f-state-editable"},[o.withDirectives(o.createVNode("input",{class:"form-control f-utils-fill text-left","onUpdate:modelValue":p=>a.value=p,name:"input-group-value",type:"text",placeholder:i.value,autocomplete:"off"},null),[[o.vModelText,a.value]]),o.createVNode("div",{class:"input-group-append"},[c.value&&o.createVNode("span",{class:"input-group-text input-group-clear",onClick:p=>u()},[o.createVNode("i",{class:"f-icon f-icon-close-circle"},null)]),l.value&&o.createVNode("span",{class:"input-group-text"},[o.createVNode("span",{class:"f-icon f-icon-search"},null)])])])])])])])}return{renderHeader:s}}function Sd(){const e=o.ref(""),t=o.ref(-1),n=o.ref(""),r=o.ref(-1),i=o.ref(!1);function a(s,p,m){r.value=m}function l(s,p,m){i.value||(r.value=m)}function c(s,p,m){r.value=-1}function u(){i.value=!0}function d(){i.value=!1}function f(){t.value=-1,e.value=""}return{activeIndex:t,focusedItemId:n,hoverIndex:r,clearActiveItem:f,onMouseenterItem:a,onMouseoverItem:l,onMouseoutItem:c,resumeHover:d,suspendHover:u}}const Wr=o.defineComponent({name:"FListView",props:Ar,emits:["afterSearch","checkValuesChange","clickItem","selectionChange","removeItem","change","activeChange"],setup(e,t){const n=o.ref(),r=o.ref(!0),i=o.ref(!1),a=o.ref([]),l=0,c=o.ref(e.columns),u=he.useFilter(),d=he.useIdentify(e),f=he.useHierarchy(e),s=he.useGroupData(e,d),p=he.useDataView(e,new Map,u,f,d),m=he.useSelection(e,p,d,a,t),g=pd(e,n),b=o.computed(()=>p.dataView.value.length),v=he.useRow(e,t,m,d),y=he.useEdit(e,t,d,v),C=he.useVisualDataBound(e),F=he.useVisualDataCell(e,{},C),w=he.useVisualDataRow(e,y,f,d,C,F),S=he.useVisualGroupRow(e,d,F,w),N=he.useVisualSummaryRow(e,d,F,w),h=he.useVisualData(e,c,p,b,l,w,S,N),{getVisualData:_}=h;a.value=_(0,b.value+l-1);const x=o.computed(()=>{const L={"f-list-view":!0,"f-list-view-multiple":e.multiSelect};return e.size!=="default"&&(L[`${e.size}-item`]=!0),L}),k=o.computed(()=>!!t.slots.footer||r.value);function T(){return e.header==="SearchBar"?qr:e.header==="ContentHeader"?wd:qr}const V=T(),{renderHeader:I}=V(e,t,g),E=Sd(),{renderListArea:M}=Cd(e,t,a,p,s,E,m,h);function B(L){g.search(L)}function O(L){L&&(p.load(L),a.value=_(0,b.value+l-1))}function R(){m.clearSelection(),E.clearActiveItem()}t.expose({search:B,updateDataSource:O,clearSelection:R});function q(L){e.multiSelect&&(L.preventDefault(),L.stopPropagation())}return()=>o.createVNode("div",{class:x.value,onClick:q},[I(),o.createVNode("div",{ref:n,class:"f-list-view-content",onMouseover:()=>{i.value=!0},onMouseleave:()=>{i.value=!1}},[M()]),k.value&&o.createVNode("div",{class:"f-list-view-footer"},[t.slots.footer&&t.slots.footer()])])}}),xd=o.defineComponent({name:"FTransfer",props:$r,emits:["change","activeChange"],setup(e,t){const n=o.ref(e.identifyField),r=o.ref("已选:"),i=o.ref("项数据"),a=o.ref(e.displayType),l=o.ref(!1),c=o.ref(e.dataSource),u=o.ref(e.selections||[]),d=o.computed(()=>u.value.map(x=>x[n.value])),f=new Map,s=o.ref();function p(){const x=new Map,k=e.selectionValues||[];k.length&&k.reduce((V,I)=>(V.set(I,!0),V),x);const T=e.selections||[];T.length&&(x.clear(),T.reduce((V,I)=>(V.set(I[n.value],!0),V),x)),u.value.length||(u.value=c.value.filter(V=>x.has(V[n.value])).map(V=>Object.assign({},V))),c.value.forEach(V=>{const I=V[n.value],E=x.has(I);V.checked=E,E&&f.set(I,V)})}p();const m=o.computed(()=>a.value==="List"),g=o.computed(()=>a.value==="Tree");function b(x){u.value=x.map(k=>Object.assign({},k)),t.emit("change",u.value)}function v(){return o.createVNode(Wr,{class:"f-utils-fill",data:c.value,multiSelect:!0,itemClass:"f-transfer-list-item",selection:{enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!1,showSelection:!0},draggable:!1,header:"Search",headerClass:"transfer-search-box",selectionValues:d.value,onSelectionChange:b},{default:()=>[o.createTextVNode(" ")]})}function y(){return o.createVNode(ao,{data:c.value,rowOption:e.rowOption,selection:{enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!1,showSelection:!0},selectionValues:d.value,onSelectionChange:b},null)}function C(){return o.createVNode("div",{class:"f-utils-fill option-pane d-flex flex-column"},[o.createVNode("div",{class:"f-utils-flex-column option-pane-content f-utils-fill"},[o.createVNode("div",{class:"container columns-box d-flex f-utils-fill"},[m.value&&v(),g.value&&y()])])])}function F(x){const k=x[n.value];if(k!==null||k!==void 0){u.value=u.value.filter(V=>V[n.value]!==k);const T=f.get(k);T&&(T.checked=!1,f.delete(k)),t.emit("change",u.value)}}o.watch(u,x=>{s.value.updateDataSource(x)});function w(x){const k=new Map;u.value.reduce((T,V)=>(T.set(V[n.value],V),T),k),u.value=x.map(T=>k.get(T[n.value])),t.emit("change",u.value)}function S(x){t.emit("activeChange",x)}function N(){return o.createVNode(Wr,{ref:s,style:"flex:1",data:u.value,draggable:!0,view:"DraggableView","keep-order":!0,onChange:w,onRemoveItem:F,onActiveChange:S},null)}function h(){return o.createVNode("div",{class:"f-utils-fill selection-pane d-flex flex-column"},[o.createVNode("div",{class:"f-utils-flex-column selection-pane-content f-utils-fill"},[o.createVNode("div",{class:"selection-pane-title"},[o.createVNode("span",{class:"selection-title"},[r.value]),o.createVNode("span",{class:"selection-count"},[u.value&&u.value.length]),o.createVNode("span",{class:"selection-item-title"},[i.value])]),o.createVNode("div",{class:"container columns-box f-utils-fill d-flex"},[N()])])])}const _=o.computed(()=>({"f-transfer":!0,row:!0,"f-utils-fill":l.value}));return()=>o.createVNode("div",{class:_.value,style:"height:480px"},[C(),h()])}});function Fd(e,t,n,r,i){const a=o.ref(!1),l=o.ref(),c=o.ref([]),u=o.ref([]),d=o.ref([]),{getExtendSchemaProerty:f}=i;function s(S){n.value=S.length?S[0]:null}function p(S){u.value=S}function m(S,N){return f(S,N)}function g(S){if(S.$type!=="SimpleField")return;let N="",h={};switch(S.type.name){case"String":{N="input-group",h=m("input-group");break}case"Number":case"Integer":case"Decimal":case"BigNumber":{N="number-range",h=m("number-spinner");break}case"Date":case"DateTime":{N="date-picker",h=m("date-picker");break}case"Enum":{N="combo-list";const x={data:S.type.enumValues,enumValueType:"string"};h=m("combo-list",x);break}case"Boolean":{N="combo-list";const x={data:S.type.enumValues||[{name:"true",value:!0},{name:"false",value:!1}],enumValueType:"boolean"};h=m("combo-list",x);break}default:N="input-group",h=m("input-group")}if(!h)return;const _={id:S.id,labelCode:S.path,code:S.code,name:S.name,placeHolder:"",controlType:N,...h};return r.set(_.id,be.cloneDeep(_)),_}function b(){return be.cloneDeep(e.fieldsConfig).map(h=>g(h))}function v(){return b()}function y(){d.value=v();const S={},N=be.cloneDeep(e.modelValue)||[];u.value=[],N.forEach(h=>{const _=d.value.find(x=>x.id===h.id);_&&(S[h.id]={...h.editor,id:_.id,code:_.code,labelCode:_.labelCode,name:h.name,controlType:h.controlType},delete S[h.id].type,u.value.push(S[h.id]),r.set(h.id,be.cloneDeep(S[h.id])))}),a.value=!0,l.value=be.cloneDeep(S),c.value=be.cloneDeep(u.value)}function C(){const S=[];u.value.forEach(N=>{const h=r.get(N.id);if(h){const{id:_,code:x,labelCode:k,name:T,controlType:V,...I}=h,E={id:_,code:x,labelCode:k,name:T,controlType:V,editor:I};E.editor.type=V,S.push(E)}}),t.emit("update:modelValue",S),e.onFieldsChanged&&typeof e.onFieldsChanged=="function"&&e.onFieldsChanged(S),a.value=!1,n.value=null}function F(){u.value=be.cloneDeep(c.value),a.value=!1,n.value=null}function w(){return a.value?o.createVNode(xd,{selections:u.value,"data-source":d.value,class:"query-solution-config-transfer",onActiveChange:s,onChange:p},null):null}return{renderTransfer:w,initData:y,selectPanels:u,confirm:C,cancel:F}}const Jn=o.defineComponent({name:"FQuerySolutionConfig",props:Rr,emits:["update:modelValue"],setup(e,t){const n=o.ref(null),r=o.computed(()=>"共"+e.modelValue.length+"项"),i=new Map,a=rd(e,t,n,i),{renderPanel:l}=a,{renderTransfer:c,initData:u,confirm:d,cancel:f}=Fd(e,t,n,i,a);function s(){d()}function p(){f()}const m={fitContent:!1,width:900,height:600,draggable:!0,title:"筛选方案配置",acceptCallback:s,rejectCallback:p};function g(){return o.createVNode(o.Fragment,null,[c(),l()])}return()=>o.createVNode(Ku,{id:e.id,"button-behavior":"Modal","modal-options":m,modelValue:r.value,"onUpdate:modelValue":b=>r.value=b,onClickButton:()=>u()},{default:()=>[o.createVNode("div",{class:"query-solution-config d-flex f-utils-absolute-all"},[g()])]})}}),Td=new Map([["appearance",jt.resolveAppearance]]);function _d(e,t,n){return t}const Nd={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/query-solution-config.schema.json",title:"solution-preset",description:"A Farris Container Component",properties:{dataSource:{description:"筛选配置项",type:"array"}}},Hr={dataSource:{type:Array,default:[]},modelValue:{type:Array,default:[]},onFieldsChanged:{type:Function,default:null}},Vd=jt.createPropsResolver(Hr,Nd,Td,_d),kd=o.defineComponent({name:"FSolutionPreset",props:Hr,emits:["change"],setup(e,t){const n=o.ref(be.cloneDeep(e.modelValue)),r=o.ref(be.cloneDeep(e.dataSource)),i=o.computed(()=>"共"+e.modelValue.length+"项");o.watch(()=>e.modelValue,d=>{n.value=be.cloneDeep(d)}),o.watch(()=>e.dataSource,d=>{r.value=be.cloneDeep(d)});function a(d){n.value=be.cloneDeep(d)}function l(){e.onFieldsChanged&&typeof e.onFieldsChanged=="function"&&e.onFieldsChanged(n.value)}function c(){}const u={fitContent:!1,width:900,height:600,draggable:!0,title:"筛选方案配置",acceptCallback:l,rejectCallback:c};return()=>o.createVNode(no.FButtonEdit,{"button-behavior":"Modal","modal-options":u,modelValue:i.value,"onUpdate:modelValue":d=>i.value=d,editable:!1},{default:()=>[o.createVNode("div",{class:"f-utils-absolute-all"},[o.createVNode(fn.FTransfer,{selections:n.value,"data-source":r.value,class:"mx-2",onChange:a},null)])]})}}),Ed={install(e){e.component(cn.name,cn),e.component(Jn.name,Jn)},register(e,t,n,r){e["query-solution"]=cn,e["query-solution-config"]=Jn,e["solution-preset"]=kd,t["query-solution"]=Mn,t["query-solution-config"]=Ou,t["solution-preset"]=Vd},registerDesigner(e,t,n){e["query-solution"]=ku,t["query-solution"]=Mn}};J.FQuerySolution=cn,J.default=Ed,J.propsResolver=Mn,J.querySolutionProps=Kt,Object.defineProperties(J,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});