@nocobase/client 2.1.0-beta.26 → 2.1.0-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js
CHANGED
|
@@ -635,7 +635,7 @@ ${JSON.stringify(s,null,2)}`)},[A,P,M,C,S,H,t,F,k,Y,o,B,O,U,V,$,R]),K=(0,r.useCa
|
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
`},m=(0,r.observer)(e=>{let t=(0,d.H)(),{isInSubTable:o}=(0,i._)()||{},{designable:n}=(0,c.F)(),{token:r}=(0,u.rd)(),{name:m}=(null===a.MX||void 0===a.MX?void 0:(0,a.MX)())||{};return!n||t.isNullComponent?e.children:(0,l.jsx)(s.Uq,{className:p({margin:`-${r.margin}px -${r.marginXS}px`,padding:`${r.margin}px ${r.marginXS}px`}),children:(0,l.jsxs)(a.zL.Provider,{value:{name:o?m:"taleColumn"},children:[(0,l.jsx)(t,{}),e.children]})})},{displayName:"TableColumnActionBar"})},32221(e,t,o){o.d(t,{BC:()=>c,WZ:()=>p,nS:()=>u});var l=o(71178),n=o(56920),r=o(51649),a=o(44374),i=o(54969),s=o(58763),d=o(45543);let c=()=>{let{getField:e}=(0,a.useCollection_deprecated)(),t=(0,a.useCompile)(),o=(0,n.useFieldSchema)(),{getCollectionJoinField:l}=(0,a.useCollectionManager_deprecated)(),r=null==o?void 0:o.reduceProperties((e,t)=>(0,d.E2)(t)?t:e,null);if(!r)return{};let i=e(r.name)||l(null==r?void 0:r["x-collection-field"]);return{columnSchema:o,fieldSchema:r,collectionField:i,uiSchema:t(null==i?void 0:i.uiSchema)}},u=()=>{let e=(0,n.useField)(),{fieldSchema:t}=c(),o=(0,r.useMemo)(()=>{var o,l;if(!t||!e)return[];let n=null==(l=e.path)?void 0:l.splice((null==(o=e.path)?void 0:o.length)-1,1);return e.form.query(`${n.concat("*."+t.name)}`).map()},[e,t]);return t?o:[]},p=e=>{let t=(0,a.useDesigner)(),o=(0,n.useField)(),{fieldSchema:d,uiSchema:u,collectionField:p}=c(),{designable:m}=(0,a.useSchemaComponentContext)(),h=(0,a.useCompile)(),{isInSubTable:x}=(0,a.useFlag)()||{},{token:v}=(0,i.rd)(),{name:g}=(null===a.useBlockContext||void 0===a.useBlockContext?void 0:(0,a.useBlockContext)())||{},f=null==d?void 0:d.required;if(x){var y,b;let e=null==(b=o.path)?void 0:b.splice((null==(y=o.path)?void 0:y.length)-1,1),t=o.form.query(`${e.concat("*."+d.name)}`).take();f="boolean"==typeof(null==t?void 0:t.required)?t.required:null==d?void 0:d.required}return((0,r.useEffect)(()=>{o.title||d&&(null==u?void 0:u.title)&&(o.title=null==u?void 0:u.title)},[null==u?void 0:u.title]),!m||t.isNullComponent)?(0,l.jsxs)(a.CollectionFieldContext.Provider,{value:p,children:[(0,l.jsx)(t,{fieldSchema:d,uiSchema:u,collectionField:p}),(0,l.jsxs)("span",{role:"button",children:[f&&(0,l.jsx)("span",{className:"ant-formily-item-asterisk",children:"*"}),(0,l.jsx)("span",{children:(null==o?void 0:o.title)||h(null==u?void 0:u.title)})]})]}):(0,l.jsx)(a.SortableItem,{className:(0,s.t)({margin:`-${v.margin}px -${v.marginXS}px`,padding:`${v.margin}px ${v.marginXS}px`}),children:(0,l.jsx)(a.CollectionFieldContext.Provider,{value:p,children:(0,l.jsxs)(a.BlockContext.Provider,{value:{name:x?g:"taleColumn"},children:[(0,l.jsx)(t,{fieldSchema:d,uiSchema:u,collectionField:p}),(0,l.jsxs)("span",{role:"button",children:[f&&(0,l.jsx)("span",{className:"ant-formily-item-asterisk",children:"*"}),(0,l.jsx)("span",{children:(null==o?void 0:o.title)||h(null==u?void 0:u.title)})]})]})})})}},40103(e,t,o){o.d(t,{S8:()=>F,W5:()=>k});var l=o(71178),n=o(56920),r=o(77583);o(51649);var a=o(77843),i=o(69412),s=o(43288),d=o(28227),c=o(20629),u=o(23620),p=o(77490),m=o(79056),h=o(76875),x=o(33204),v=o(6206),g=o(83508),f=o(37208),y=o(31475),b=o(72548),S=o(61013),C=o(95951),_=o(81547);let k=e=>{var t,o,l;let n=(0,S.l)(),{getCollectionFields:r}=(0,s.nj)();if(!e)return[];let a=r(e);return null==a||null==(l=a.filter)||null==(o=l.call(a,e=>(null==e?void 0:e.interface)==="color"))||null==(t=o.map)?void 0:t.call(o,e=>{var t;return{value:e.name,label:n((null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name)}})},F=e=>{var t,o,F,M,P,I,A,T,w,j,D;let{uiSchema:L,fieldSchema:R,collectionField:Y}=e,{form:B}=(0,i.Es)(),{getInterface:N,getCollection:E}=(0,s.nj)(),z=(0,n.useField)(),{t:O}=(0,a.useTranslation)(),V=(0,n.useFieldSchema)(),{dn:$}=(0,C.er)(),q=(null==R||null==(t=R["x-component-props"])?void 0:t.fieldNames)||(null==L||null==(o=L["x-component-props"])?void 0:o.fieldNames),H=(e=>{var t,o,l;let n=(0,S.l)(),{getCollectionFields:r}=(0,s.nj)();if(!e)return[];let a=r(e);return null==a||null==(l=a.filter)||null==(o=l.call(a,e=>(null==e?void 0:e.interface)&&!(null==e?void 0:e.target)&&"boolean"!==e.type))||null==(t=o.map)?void 0:t.call(o,e=>{var t;return{value:e.name,label:n((null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name)}})})((null==Y?void 0:Y.target)??(null==Y?void 0:Y.targetCollection)),U=k((null==Y?void 0:Y.target)??(null==Y?void 0:Y.targetCollection)),G=N(null==Y?void 0:Y.interface),K=(null==(D=E(null==Y?void 0:Y.target))?void 0:D.template)==="file",W=["QuickEdit","FormItem"].includes(R["x-decorator"]),{currentMode:J}=(0,y.G2)(),{isAllowToSetDefaultValue:X}=(0,g.eT)({collectionField:Y,fieldSchema:R}),Z=["datetime","createdAt","updatedAt"].includes(null==Y?void 0:Y.interface),Q=["obo","oho","o2o","o2m","m2m","m2o","snapshot"].includes(null==Y?void 0:Y.interface),ee=(0,_.j)({fieldSchema:R}),et=(null==R||null==(F=R["x-component-props"])?void 0:F.mode)||"Select",eo="editable";!0===R["x-disabled"]&&(eo="readonly"),!0===R["x-read-pretty"]&&(eo="read-pretty");let el=Q&&"Select"===et;return(0,l.jsxs)(u.xK,{disableInitializer:!0,children:[(0,l.jsx)(p.fY,{title:O("Custom column title"),schema:{type:"object",title:O("Custom column title"),properties:{title:{title:O("Column title"),default:null==V?void 0:V.title,description:`${O("Original field title: ")}${(null==Y||null==(M=Y.uiSchema)?void 0:M.title)||(null==R?void 0:R.title)}`,"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit:e=>{let{title:t}=e;t&&(z.title=t,V.title=t,$.emit("patch",{schema:{"x-uid":V["x-uid"],title:V.title}})),$.refresh()}}),el&&!z.readPretty&&!(null==L?void 0:L["x-read-pretty"])&&W&&(0,l.jsx)(m.Z,{collectionName:null==Y?void 0:Y.target,defaultFilter:(null==R||null==(A=R["x-component-props"])||null==(I=A.service)||null==(P=I.params)?void 0:P.filter)||{},form:B,onSubmit:e=>{var t,o;let{filter:l}=e;l=(0,b.pA)(l),(0,r.set)(z.componentProps,"service.params.filter",l),R["x-component-props"]=z.componentProps;let n=null==(o=z.path)?void 0:o.splice((null==(t=z.path)?void 0:t.length)-1,1);z.form.query(`${n.concat("*."+R.name)}`).forEach(e=>{e.componentProps.service=e.componentProps.service||{params:{}},e.componentProps.service.params.filter=l}),$.emit("patch",{schema:{"x-uid":R["x-uid"],"x-component-props":z.componentProps}})}}),(0,l.jsx)(p.fY,{title:O("Column width"),schema:{type:"object",title:O("Column width"),properties:{width:{default:(null==V||null==(T=V["x-component-props"])?void 0:T.width)||100,"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{}}}},onSubmit:e=>{let{width:t}=e,o=V["x-component-props"]||{};o.width=t;let l={"x-uid":V["x-uid"]};l["x-component-props"]=o,V["x-component-props"]=o,z.componentProps.width=t,$.emit("patch",{schema:l}),$.refresh()}}),(0,l.jsx)(()=>{let{name:e}=(0,d.Ge)(),{linkageRulesProps:t}=(0,c.C5)();return(0,l.jsx)(p.f9,{category:"style",...t,collectionName:e})},{}),G&&!0===G.sortable&&!J&&(0,l.jsx)(p.Qd,{title:O("Sortable"),checked:z.componentProps.sorter,onChange:e=>{let t={"x-uid":V["x-uid"]};V["x-component-props"]={...V["x-component-props"],sorter:e},t["x-component-props"]=V["x-component-props"],z.componentProps.sorter=e,$.emit("patch",{schema:t}),$.refresh()}}),["linkTo","m2m","m2o","o2m","obo","oho","snapshot","createdBy","updatedBy"].includes(null==Y?void 0:Y.interface)&&!K&&("read-pretty"===eo||z.readPretty||z.readOnly)&&(0,l.jsx)(p.Qd,{title:O("Enable link"),checked:(null==(w=R["x-component-props"])?void 0:w.enableLink)!==!1,onChange:e=>{R["x-component-props"]={...null==R?void 0:R["x-component-props"],enableLink:e},z.componentProps={...null==R?void 0:R["x-component-props"],enableLink:e},$.emit("patch",{schema:{"x-uid":R["x-uid"],"x-component-props":{...null==R?void 0:R["x-component-props"]}}}),$.refresh()}}),["linkTo","m2m","m2o","o2m","obo","oho","snapshot"].includes(null==Y?void 0:Y.interface)&&(0,l.jsx)(p.Al,{title:O("Title field"),options:H,value:null==q?void 0:q.label,onChange:e=>{var t,o,l,n,a;let i={...null==Y||null==(o=Y.uiSchema)||null==(t=o["x-component-props"])?void 0:t.fieldNames,...null==R||null==(l=R["x-component-props"])?void 0:l.fieldNames,label:e};r.default.set(R,"x-component-props.fieldNames",i);let s=null==(a=z.path)?void 0:a.splice((null==(n=z.path)?void 0:n.length)-1,1);z.form.query(`${s.concat("*."+R.name)}`).forEach(e=>{e.componentProps.fieldNames=i}),$.emit("patch",{schema:{"x-uid":R["x-uid"],"x-component-props":{...R["x-component-props"]}}}),$.refresh()}}),Q&&(0,l.jsx)(p.Al,{title:O("Field component"),options:"read-pretty"===eo?[{label:O("Title"),value:"Select"},K&&{label:O("File manager"),value:"FileManager"},{label:O("Tag"),value:"Tag"}].filter(Boolean):ee,value:et,onChange:e=>{let t={"x-uid":R["x-uid"]};R["x-component-props"]=R["x-component-props"]||{},R["x-component-props"].mode=e,t["x-component-props"]=R["x-component-props"],z.componentProps=z.componentProps||{},z.componentProps.mode=e,$.emit("patch",{schema:t}),$.refresh()}},"field-mode"),["Tag"].includes(et)&&(0,l.jsx)(p.Al,{title:O("Tag color field"),options:U,value:null==R||null==(j=R["x-component-props"])?void 0:j.tagColorField,onChange:e=>{let t={"x-uid":R["x-uid"]};R["x-component-props"]=R["x-component-props"]||{},R["x-component-props"].tagColorField=e,t["x-component-props"]=R["x-component-props"],z.componentProps.tagColorField=e,$.emit("patch",{schema:t}),$.refresh()}},"title-field"),W&&!z.readPretty&&!(null==L?void 0:L["x-read-pretty"])&&(0,l.jsx)(p.Qd,{title:O("Required"),checked:R.required,onChange:e=>{var t,o;let l={"x-uid":R["x-uid"]};R.required=e,l.required=e;let n=null==(o=z.path)?void 0:o.splice((null==(t=z.path)?void 0:t.length)-1,1);z.form.query(`${n.concat("*."+R.name)}`).forEach(t=>{t.required=e}),$.emit("patch",{schema:l}),$.refresh()}},"required"),W&&!(null==z?void 0:z.readPretty)&&(null==Y?void 0:Y.interface)!=="o2m"&&!(0,f.h)(R)&&(0,l.jsx)(p.Al,{title:O("Pattern"),options:[{label:O("Editable"),value:"editable"},{label:O("Readonly"),value:"readonly"},{label:O("Easy-reading"),value:"read-pretty"}],value:eo,onChange:e=>{var t,o;let l={"x-uid":R["x-uid"]},n=null==(o=z.path)?void 0:o.splice((null==(t=z.path)?void 0:t.length)-1,1);switch(e){case"readonly":R["x-read-pretty"]=!1,R["x-disabled"]=!0,l["x-read-pretty"]=!1,l["x-disabled"]=!0,z.form.query(`${n.concat("*."+R.name)}`).forEach(e=>{e.readonly=!0,e.disabled=!0});break;case"read-pretty":R["x-read-pretty"]=!0,R["x-disabled"]=!1,l["x-read-pretty"]=!0,l["x-disabled"]=!1,z.form.query(`${n.concat("*."+R.name)}`).forEach(e=>{e.readPretty=!0});break;default:R["x-read-pretty"]=!1,R["x-disabled"]=!1,l["x-read-pretty"]=!1,l["x-disabled"]=!1,z.form.query(`${n.concat("*."+R.name)}`).forEach(e=>{e.readPretty=!1,e.disabled})}$.emit("patch",{schema:l}),$.refresh()}},"pattern"),Z&&(0,l.jsx)(h.A,{fieldSchema:R}),W&&!(null==z?void 0:z.readPretty)&&["obo","oho","o2o","o2m","m2m","m2o"].includes(null==Y?void 0:Y.interface)&&(0,l.jsx)(v.b,{fieldSchema:R,onSubmitCallBack:e=>{var t,o;let l=null==(o=z.path)?void 0:o.splice((null==(t=z.path)?void 0:t.length)-1,1);z.form.query(`${l.concat("*."+R.name)}`).forEach(t=>{t.componentProps.service=t.componentProps.service||{params:{}},t.componentProps.service.params.sort=e})}}),X(W)&&(0,l.jsx)(x.J,{fieldSchema:R}),(0,l.jsx)(p.kT,{}),(0,l.jsx)(p.d$,{removeParentsIfNoChildren:!W,breakRemoveOn:{"x-component":"Grid"},confirm:{title:O("Delete table column")}})]})}},70808(e,t,o){o.d(t,{XI:()=>e_,BY:()=>eS,p2:()=>eb});var l=o(71178),n=o(82113),r=o(72741),a=o(8198),i=o(10691),s=o(52975),d=o(56920),c=o(2314),u=o(27404),p=o(63526),m=o(71883),h=o(52793),x=o(94046),v=o(77583),g=o(51649),f=o(77843),y=o(42536),b=o(73761),S=o(55102),C=o(70892),_=o(35123),k=o(14469),F=o(49621),M=o(35432),P=o(32444),I=o(14187),A=o(30644),T=o(69575),w=o(80461),j=o(99847),D=o(7775),L=o(839),R=o(73907),Y=o(41944),B=o(17961),N=o(86577);let E={opacity:.5},z={position:"relative"},O={display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:0,right:0,height:"100%",maxHeight:400,zIndex:1e3},V={display:"none"},$=g.default.memo(e=>(0,l.jsxs)("div",{style:z,children:[(0,l.jsx)(h.Spin,{...v.default.omit(e,"children"),style:e.spinning?O:V}),(0,l.jsx)("div",{style:e.spinning?E:null,children:e.children})]}));$.displayName="HighPerformanceSpin";var q=o(70715),H=o(54969),U=o(31475),G=o(41428),K=o(89449),W=o(8724),J=o(95951),X=o(62152),Z=o(45543);let Q=e=>{let t=(0,d.useField)();return e.field||t},ee=e=>{let{record:t,columnSchema:o,uiSchema:n,filterProperties:r,schemaToolbarBigger:a,field:i,index:s}=e,d=i.address.concat(t.__index||s);return(0,l.jsx)("span",{role:"button",className:a,children:(0,l.jsx)(A.dw,{values:t,basePath:d,schema:o,uiSchema:n,onlyRenderProperties:!0,propsRecursion:!0,filterProperties:r,isUseFormilyField:!1})})},et=e=>{var t,o;let{token:n}=(0,H.rd)(),s=null==(t=e["data-row-key"])?void 0:t.toString(),{setNodeRef:d,active:c,over:u}=(0,a.useSortable)({id:s}),{rowIndex:p,...m}=e,h=(null==u?void 0:u.id)==s,v=(0,g.useMemo)(()=>{let e=new r.TinyColor(n.colorSettings).setAlpha(.6).toHex8String();return{topActiveClass:(0,i.css)`
|
|
638
|
+
`},m=(0,r.observer)(e=>{let t=(0,d.H)(),{isInSubTable:o}=(0,i._)()||{},{designable:n}=(0,c.F)(),{token:r}=(0,u.rd)(),{name:m}=(null===a.MX||void 0===a.MX?void 0:(0,a.MX)())||{};return!n||t.isNullComponent?e.children:(0,l.jsx)(s.Uq,{className:p({margin:`-${r.margin}px -${r.marginXS}px`,padding:`${r.margin}px ${r.marginXS}px`}),children:(0,l.jsxs)(a.zL.Provider,{value:{name:o?m:"taleColumn"},children:[(0,l.jsx)(t,{}),e.children]})})},{displayName:"TableColumnActionBar"})},32221(e,t,o){o.d(t,{BC:()=>f,WZ:()=>b,nS:()=>y});var l=o(71178),n=o(56920),r=o(51649),a=o(11340),i=o(51281),s=o(61500),d=o(46724),c=o(92619),u=o(87382),p=o(61013),m=o(87463),h=o(39247),x=o(54969),v=o(58763),g=o(45543);let f=()=>{let{getField:e}=(0,i.k)(),t=(0,p.l)(),o=(0,n.useFieldSchema)(),{getCollectionJoinField:l}=(0,s.n)(),r=null==o?void 0:o.reduceProperties((e,t)=>(0,g.E2)(t)?t:e,null);if(!r)return{};let a=e(r.name)||l(null==r?void 0:r["x-collection-field"]);return{columnSchema:o,fieldSchema:r,collectionField:a,uiSchema:t(null==a?void 0:a.uiSchema)}},y=()=>{let e=(0,n.useField)(),{fieldSchema:t}=f(),o=(0,r.useMemo)(()=>{var o,l;if(!t||!e)return[];let n=null==(l=e.path)?void 0:l.splice((null==(o=e.path)?void 0:o.length)-1,1);return e.form.query(`${n.concat("*."+t.name)}`).map()},[e,t]);return t?o:[]},b=e=>{let t=(0,m.H)(),o=(0,n.useField)(),{fieldSchema:i,uiSchema:s,collectionField:g}=f(),{designable:y}=(0,h.F)(),b=(0,p.l)(),{isInSubTable:S}=(0,c._)()||{},{token:C}=(0,x.rd)(),{name:_}=(null===a.MX||void 0===a.MX?void 0:(0,a.MX)())||{},k=null==i?void 0:i.required;if(S){var F,M,P;let e=null==(M=o.path)?void 0:M.splice((null==(F=o.path)?void 0:F.length)-1,1),t=o.form.query(`${e.concat("*."+i.name)}`).take();k="boolean"==typeof(null==t||null==(P=t.schema)?void 0:P.required)?t.schema.required:null==i?void 0:i.required}return((0,r.useEffect)(()=>{o.title||i&&(null==s?void 0:s.title)&&(o.title=null==s?void 0:s.title)},[null==s?void 0:s.title]),!y||t.isNullComponent)?(0,l.jsxs)(d.yn.Provider,{value:g,children:[(0,l.jsx)(t,{fieldSchema:i,uiSchema:s,collectionField:g}),(0,l.jsxs)("span",{role:"button",children:[k&&(0,l.jsx)("span",{className:"ant-formily-item-asterisk",children:"*"}),(0,l.jsx)("span",{children:(null==o?void 0:o.title)||b(null==s?void 0:s.title)})]})]}):(0,l.jsx)(u.Uq,{className:(0,v.t)({margin:`-${C.margin}px -${C.marginXS}px`,padding:`${C.margin}px ${C.marginXS}px`}),children:(0,l.jsx)(d.yn.Provider,{value:g,children:(0,l.jsxs)(a.zL.Provider,{value:{name:S?_:"taleColumn"},children:[(0,l.jsx)(t,{fieldSchema:i,uiSchema:s,collectionField:g}),(0,l.jsxs)("span",{role:"button",children:[k&&(0,l.jsx)("span",{className:"ant-formily-item-asterisk",children:"*"}),(0,l.jsx)("span",{children:(null==o?void 0:o.title)||b(null==s?void 0:s.title)})]})]})})})}},40103(e,t,o){o.d(t,{S8:()=>F,W5:()=>k});var l=o(71178),n=o(56920),r=o(77583);o(51649);var a=o(77843),i=o(69412),s=o(43288),d=o(28227),c=o(20629),u=o(23620),p=o(77490),m=o(79056),h=o(76875),x=o(33204),v=o(6206),g=o(83508),f=o(37208),y=o(31475),b=o(72548),S=o(61013),C=o(95951),_=o(81547);let k=e=>{var t,o,l;let n=(0,S.l)(),{getCollectionFields:r}=(0,s.nj)();if(!e)return[];let a=r(e);return null==a||null==(l=a.filter)||null==(o=l.call(a,e=>(null==e?void 0:e.interface)==="color"))||null==(t=o.map)?void 0:t.call(o,e=>{var t;return{value:e.name,label:n((null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name)}})},F=e=>{var t,o,F,M,P,I,A,T,w,j,D;let{uiSchema:L,fieldSchema:R,collectionField:Y}=e,{form:B}=(0,i.Es)(),{getInterface:N,getCollection:E}=(0,s.nj)(),z=(0,n.useField)(),{t:O}=(0,a.useTranslation)(),V=(0,n.useFieldSchema)(),{dn:$}=(0,C.er)(),q=(null==R||null==(t=R["x-component-props"])?void 0:t.fieldNames)||(null==L||null==(o=L["x-component-props"])?void 0:o.fieldNames),H=(e=>{var t,o,l;let n=(0,S.l)(),{getCollectionFields:r}=(0,s.nj)();if(!e)return[];let a=r(e);return null==a||null==(l=a.filter)||null==(o=l.call(a,e=>(null==e?void 0:e.interface)&&!(null==e?void 0:e.target)&&"boolean"!==e.type))||null==(t=o.map)?void 0:t.call(o,e=>{var t;return{value:e.name,label:n((null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name)}})})((null==Y?void 0:Y.target)??(null==Y?void 0:Y.targetCollection)),U=k((null==Y?void 0:Y.target)??(null==Y?void 0:Y.targetCollection)),G=N(null==Y?void 0:Y.interface),K=(null==(D=E(null==Y?void 0:Y.target))?void 0:D.template)==="file",W=["QuickEdit","FormItem"].includes(R["x-decorator"]),{currentMode:J}=(0,y.G2)(),{isAllowToSetDefaultValue:X}=(0,g.eT)({collectionField:Y,fieldSchema:R}),Z=["datetime","createdAt","updatedAt"].includes(null==Y?void 0:Y.interface),Q=["obo","oho","o2o","o2m","m2m","m2o","snapshot"].includes(null==Y?void 0:Y.interface),ee=(0,_.j)({fieldSchema:R}),et=(null==R||null==(F=R["x-component-props"])?void 0:F.mode)||"Select",eo="editable";!0===R["x-disabled"]&&(eo="readonly"),!0===R["x-read-pretty"]&&(eo="read-pretty");let el=Q&&"Select"===et;return(0,l.jsxs)(u.xK,{disableInitializer:!0,children:[(0,l.jsx)(p.fY,{title:O("Custom column title"),schema:{type:"object",title:O("Custom column title"),properties:{title:{title:O("Column title"),default:null==V?void 0:V.title,description:`${O("Original field title: ")}${(null==Y||null==(M=Y.uiSchema)?void 0:M.title)||(null==R?void 0:R.title)}`,"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit:e=>{let{title:t}=e;t&&(z.title=t,V.title=t,$.emit("patch",{schema:{"x-uid":V["x-uid"],title:V.title}})),$.refresh()}}),el&&!z.readPretty&&!(null==L?void 0:L["x-read-pretty"])&&W&&(0,l.jsx)(m.Z,{collectionName:null==Y?void 0:Y.target,defaultFilter:(null==R||null==(A=R["x-component-props"])||null==(I=A.service)||null==(P=I.params)?void 0:P.filter)||{},form:B,onSubmit:e=>{var t,o;let{filter:l}=e;l=(0,b.pA)(l),(0,r.set)(z.componentProps,"service.params.filter",l),R["x-component-props"]=z.componentProps;let n=null==(o=z.path)?void 0:o.splice((null==(t=z.path)?void 0:t.length)-1,1);z.form.query(`${n.concat("*."+R.name)}`).forEach(e=>{e.componentProps.service=e.componentProps.service||{params:{}},e.componentProps.service.params.filter=l}),$.emit("patch",{schema:{"x-uid":R["x-uid"],"x-component-props":z.componentProps}})}}),(0,l.jsx)(p.fY,{title:O("Column width"),schema:{type:"object",title:O("Column width"),properties:{width:{default:(null==V||null==(T=V["x-component-props"])?void 0:T.width)||100,"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{}}}},onSubmit:e=>{let{width:t}=e,o=V["x-component-props"]||{};o.width=t;let l={"x-uid":V["x-uid"]};l["x-component-props"]=o,V["x-component-props"]=o,z.componentProps.width=t,$.emit("patch",{schema:l}),$.refresh()}}),(0,l.jsx)(()=>{let{name:e}=(0,d.Ge)(),{linkageRulesProps:t}=(0,c.C5)();return(0,l.jsx)(p.f9,{category:"style",...t,collectionName:e})},{}),G&&!0===G.sortable&&!J&&(0,l.jsx)(p.Qd,{title:O("Sortable"),checked:z.componentProps.sorter,onChange:e=>{let t={"x-uid":V["x-uid"]};V["x-component-props"]={...V["x-component-props"],sorter:e},t["x-component-props"]=V["x-component-props"],z.componentProps.sorter=e,$.emit("patch",{schema:t}),$.refresh()}}),["linkTo","m2m","m2o","o2m","obo","oho","snapshot","createdBy","updatedBy"].includes(null==Y?void 0:Y.interface)&&!K&&("read-pretty"===eo||z.readPretty||z.readOnly)&&(0,l.jsx)(p.Qd,{title:O("Enable link"),checked:(null==(w=R["x-component-props"])?void 0:w.enableLink)!==!1,onChange:e=>{R["x-component-props"]={...null==R?void 0:R["x-component-props"],enableLink:e},z.componentProps={...null==R?void 0:R["x-component-props"],enableLink:e},$.emit("patch",{schema:{"x-uid":R["x-uid"],"x-component-props":{...null==R?void 0:R["x-component-props"]}}}),$.refresh()}}),["linkTo","m2m","m2o","o2m","obo","oho","snapshot"].includes(null==Y?void 0:Y.interface)&&(0,l.jsx)(p.Al,{title:O("Title field"),options:H,value:null==q?void 0:q.label,onChange:e=>{var t,o,l,n,a;let i={...null==Y||null==(o=Y.uiSchema)||null==(t=o["x-component-props"])?void 0:t.fieldNames,...null==R||null==(l=R["x-component-props"])?void 0:l.fieldNames,label:e};r.default.set(R,"x-component-props.fieldNames",i);let s=null==(a=z.path)?void 0:a.splice((null==(n=z.path)?void 0:n.length)-1,1);z.form.query(`${s.concat("*."+R.name)}`).forEach(e=>{e.componentProps.fieldNames=i}),$.emit("patch",{schema:{"x-uid":R["x-uid"],"x-component-props":{...R["x-component-props"]}}}),$.refresh()}}),Q&&(0,l.jsx)(p.Al,{title:O("Field component"),options:"read-pretty"===eo?[{label:O("Title"),value:"Select"},K&&{label:O("File manager"),value:"FileManager"},{label:O("Tag"),value:"Tag"}].filter(Boolean):ee,value:et,onChange:e=>{let t={"x-uid":R["x-uid"]};R["x-component-props"]=R["x-component-props"]||{},R["x-component-props"].mode=e,t["x-component-props"]=R["x-component-props"],z.componentProps=z.componentProps||{},z.componentProps.mode=e,$.emit("patch",{schema:t}),$.refresh()}},"field-mode"),["Tag"].includes(et)&&(0,l.jsx)(p.Al,{title:O("Tag color field"),options:U,value:null==R||null==(j=R["x-component-props"])?void 0:j.tagColorField,onChange:e=>{let t={"x-uid":R["x-uid"]};R["x-component-props"]=R["x-component-props"]||{},R["x-component-props"].tagColorField=e,t["x-component-props"]=R["x-component-props"],z.componentProps.tagColorField=e,$.emit("patch",{schema:t}),$.refresh()}},"title-field"),W&&!z.readPretty&&!(null==L?void 0:L["x-read-pretty"])&&(0,l.jsx)(p.Qd,{title:O("Required"),checked:R.required,onChange:e=>{var t,o;let l={"x-uid":R["x-uid"]};R.required=e,l.required=e;let n=null==(o=z.path)?void 0:o.splice((null==(t=z.path)?void 0:t.length)-1,1);z.form.query(`${n.concat("*."+R.name)}`).forEach(t=>{t.required=e}),$.emit("patch",{schema:l}),$.refresh()}},"required"),W&&!(null==z?void 0:z.readPretty)&&(null==Y?void 0:Y.interface)!=="o2m"&&!(0,f.h)(R)&&(0,l.jsx)(p.Al,{title:O("Pattern"),options:[{label:O("Editable"),value:"editable"},{label:O("Readonly"),value:"readonly"},{label:O("Easy-reading"),value:"read-pretty"}],value:eo,onChange:e=>{var t,o;let l={"x-uid":R["x-uid"]},n=null==(o=z.path)?void 0:o.splice((null==(t=z.path)?void 0:t.length)-1,1);switch(e){case"readonly":R["x-read-pretty"]=!1,R["x-disabled"]=!0,l["x-read-pretty"]=!1,l["x-disabled"]=!0,z.form.query(`${n.concat("*."+R.name)}`).forEach(e=>{e.readonly=!0,e.disabled=!0});break;case"read-pretty":R["x-read-pretty"]=!0,R["x-disabled"]=!1,l["x-read-pretty"]=!0,l["x-disabled"]=!1,z.form.query(`${n.concat("*."+R.name)}`).forEach(e=>{e.readPretty=!0});break;default:R["x-read-pretty"]=!1,R["x-disabled"]=!1,l["x-read-pretty"]=!1,l["x-disabled"]=!1,z.form.query(`${n.concat("*."+R.name)}`).forEach(e=>{e.readPretty=!1,e.disabled})}$.emit("patch",{schema:l}),$.refresh()}},"pattern"),Z&&(0,l.jsx)(h.A,{fieldSchema:R}),W&&!(null==z?void 0:z.readPretty)&&["obo","oho","o2o","o2m","m2m","m2o"].includes(null==Y?void 0:Y.interface)&&(0,l.jsx)(v.b,{fieldSchema:R,onSubmitCallBack:e=>{var t,o;let l=null==(o=z.path)?void 0:o.splice((null==(t=z.path)?void 0:t.length)-1,1);z.form.query(`${l.concat("*."+R.name)}`).forEach(t=>{t.componentProps.service=t.componentProps.service||{params:{}},t.componentProps.service.params.sort=e})}}),X(W)&&(0,l.jsx)(x.J,{fieldSchema:R}),(0,l.jsx)(p.kT,{}),(0,l.jsx)(p.d$,{removeParentsIfNoChildren:!W,breakRemoveOn:{"x-component":"Grid"},confirm:{title:O("Delete table column")}})]})}},70808(e,t,o){o.d(t,{XI:()=>e_,BY:()=>eS,p2:()=>eb});var l=o(71178),n=o(82113),r=o(72741),a=o(8198),i=o(10691),s=o(52975),d=o(56920),c=o(2314),u=o(27404),p=o(63526),m=o(71883),h=o(52793),x=o(94046),v=o(77583),g=o(51649),f=o(77843),y=o(42536),b=o(73761),S=o(55102),C=o(70892),_=o(35123),k=o(14469),F=o(49621),M=o(35432),P=o(32444),I=o(14187),A=o(30644),T=o(69575),w=o(80461),j=o(99847),D=o(7775),L=o(839),R=o(73907),Y=o(41944),B=o(17961),N=o(86577);let E={opacity:.5},z={position:"relative"},O={display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:0,right:0,height:"100%",maxHeight:400,zIndex:1e3},V={display:"none"},$=g.default.memo(e=>(0,l.jsxs)("div",{style:z,children:[(0,l.jsx)(h.Spin,{...v.default.omit(e,"children"),style:e.spinning?O:V}),(0,l.jsx)("div",{style:e.spinning?E:null,children:e.children})]}));$.displayName="HighPerformanceSpin";var q=o(70715),H=o(54969),U=o(31475),G=o(41428),K=o(89449),W=o(8724),J=o(95951),X=o(62152),Z=o(45543);let Q=e=>{let t=(0,d.useField)();return e.field||t},ee=e=>{let{record:t,columnSchema:o,uiSchema:n,filterProperties:r,schemaToolbarBigger:a,field:i,index:s}=e,d=i.address.concat(t.__index||s);return(0,l.jsx)("span",{role:"button",className:a,children:(0,l.jsx)(A.dw,{values:t,basePath:d,schema:o,uiSchema:n,onlyRenderProperties:!0,propsRecursion:!0,filterProperties:r,isUseFormilyField:!1})})},et=e=>{var t,o;let{token:n}=(0,H.rd)(),s=null==(t=e["data-row-key"])?void 0:t.toString(),{setNodeRef:d,active:c,over:u}=(0,a.useSortable)({id:s}),{rowIndex:p,...m}=e,h=(null==u?void 0:u.id)==s,v=(0,g.useMemo)(()=>{let e=new r.TinyColor(n.colorSettings).setAlpha(.6).toHex8String();return{topActiveClass:(0,i.css)`
|
|
639
639
|
& > td {
|
|
640
640
|
border-top: 2px solid ${e} !important;
|
|
641
641
|
}
|
|
@@ -849,12 +849,12 @@ ${JSON.stringify(s,null,2)}`)},[A,P,M,C,S,H,t,F,k,Y,o,B,O,U,V,$,R]),K=(0,r.useCa
|
|
|
849
849
|
.ReactModal__Overlay.ReactModal__Overlay--after-open {
|
|
850
850
|
z-index: 3000 !important; // 避免预览图片时被遮挡
|
|
851
851
|
}
|
|
852
|
-
`;g.lN.add({match:e=>(0,g._b)(e,"image/*"),getThumbnailURL:e=>e.preview?e.preview:e.url?e.url:e.originFileObj?URL.createObjectURL(e.originFileObj):null,Previewer(e){var t,o,r,a;let{index:i,list:s,onSwitchIndex:d}=e,[p,m]=(0,u.useState)(0),h=(0,u.useRef)(!1),x=(0,u.useCallback)((e,t)=>{if(!e)return;let o=e.style.transform||"",l=o.replace(/rotate\([^)]*\)/g,"").trim(),n=`${l} rotate(${(t%360+360)%360}deg)`.trim();o!==n&&(h.current=!0,e.style.transform=n,e.style.transformOrigin="center center",setTimeout(()=>{h.current=!1},0))},[]),v=(0,u.useCallback)(e=>{e.preventDefault();let t=s[i];(0,c.saveAs)(t.url
|
|
852
|
+
`;g.lN.add({match:e=>(0,g._b)(e,"image/*"),getThumbnailURL:e=>e.preview?e.preview:e.url?e.url:e.originFileObj?URL.createObjectURL(e.originFileObj):null,Previewer(e){var t,o,r,a;let{index:i,list:s,onSwitchIndex:d}=e,[p,m]=(0,u.useState)(0),h=(0,u.useRef)(!1),x=(0,u.useCallback)((e,t)=>{if(!e)return;let o=e.style.transform||"",l=o.replace(/rotate\([^)]*\)/g,"").trim(),n=`${l} rotate(${(t%360+360)%360}deg)`.trim();o!==n&&(h.current=!0,e.style.transform=n,e.style.transformOrigin="center center",setTimeout(()=>{h.current=!1},0))},[]),v=(0,u.useCallback)(e=>{e.preventDefault();let t=s[i];(0,c.saveAs)(t.url,(0,g.AK)(t))},[i,s]),f=(0,u.useCallback)(()=>{m(e=>(e-90)%360)},[]),b=(0,u.useCallback)(()=>{m(e=>(e+90)%360)},[]);return(0,u.useEffect)(()=>{x(document.querySelector(".ril-image-current"),p)},[p,x]),(0,u.useEffect)(()=>{let e=document.querySelector(".ril-image-current");if(!e)return;x(e,p);let t=new MutationObserver(t=>{!h.current&&t.some(e=>"style"===e.attributeName)&&x(e,p)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[x,p,i]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y,{}),(0,l.jsx)(eq(),{mainSrc:null==(t=s[i])?void 0:t.url,nextSrc:null==(o=s[(i+1)%s.length])?void 0:o.url,prevSrc:null==(r=s[(i+s.length-1)%s.length])?void 0:r.url,onCloseRequest:()=>d(null),onMovePrevRequest:()=>{m(0),d((i+s.length-1)%s.length)},onMoveNextRequest:()=>{m(0),d((i+1)%s.length)},onAfterOpen:()=>{x(document.querySelector(".ril-image-current"),p)},imageTitle:null==(a=s[i])?void 0:a.title,toolbarButtons:[(0,l.jsx)("button",{type:"button","aria-label":"Download",title:"Download",className:"ril-zoom-in ril__toolbarItemChild ril__builtinButton",style:{fontSize:22,background:"none",lineHeight:1},onClick:v,children:(0,l.jsx)(n.DownloadOutlined,{})},"preview-img"),(0,l.jsx)("button",{type:"button",className:"ril-zoom-in ril__toolbarItemChild ril__builtinButton",style:{fontSize:22,background:"none",lineHeight:1},onClick:f,children:(0,l.jsx)(n.UndoOutlined,{})},"rotate-left"),(0,l.jsx)("button",{type:"button",className:"ril-zoom-in ril__toolbarItemChild ril__builtinButton",style:{fontSize:22,background:"none",lineHeight:1},onClick:b,children:(0,l.jsx)(n.RedoOutlined,{})},"rotate-right")]})]})}});let b=["application/pdf","audio/*","image/*","video/*","text/plain"];function S(e){let{index:t,list:o,onSwitchIndex:n}=e,{t:r}=(0,p.useTranslation)(),a=o[t],s=a.url,d=(0,u.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),window.open(s)},[s]),m=(0,u.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),(0,c.saveAs)(s,(0,g.AK)(a))},[a,s]),h=(0,u.useCallback)(()=>{n(null)},[n]);return(0,l.jsx)(i.Modal,{open:null!=t,title:a.title,onCancel:h,footer:[(0,l.jsx)(i.Button,{onClick:d,children:r("Open in new window")},"open"),(0,l.jsx)(i.Button,{onClick:m,children:r("Download")},"download"),(0,l.jsx)(i.Button,{onClick:h,children:r("Close")},"close")],width:"85vw",centered:!0,children:(0,l.jsx)("div",{style:{maxWidth:"100%",maxHeight:"calc(100vh - 256px)",height:"90vh",width:"100%",background:"white",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",overflowY:"auto"},children:b.some(e=>(0,g._b)(a,e))?(0,l.jsx)("iframe",{src:s,style:{width:"100%",maxHeight:"90vh",flex:"1 1 auto",border:"none"}}):(0,l.jsx)(i.Alert,{type:"warning",description:r("File type is not supported for previewing, please download it to preview."),showIcon:!0})})})}function C(e){let{value:t,onChange:o,disabled:n,multiple:a,size:i,...s}=e,{wrapSSR:c,hashId:p,componentCls:h}=(0,f.I)();(ez().default?ez().default:ez())(h);let{isInTableCell:x}=(0,m._P)(),v=(0,u.useMemo)(()=>x?{display:"inline-block"}:{},[x]);return c((0,l.jsx)("div",{className:(0,d.default)(`${h}-wrapper`,`${h}-picture-card-wrapper`,"nb-upload",i?`nb-upload-${i}`:null,p,(0,r.css)`
|
|
853
853
|
.ant-upload-list-picture-card-container {
|
|
854
854
|
width: ${i}px !important;
|
|
855
855
|
height: ${i}px !important;
|
|
856
856
|
}
|
|
857
|
-
`),style:v,children:(0,l.jsx)("div",{className:(0,d.default)(`${h}-list`,`${h}-list-picture-card`),style:v,children:(0,l.jsx)(I,{disabled:n,readPretty:!0,multiple:a,value:t,onChange:o,...s})})}))}let _=(0,a.connect)(function(e){let{onChange:t,...o}=e,n=(0,u.useCallback)(e=>{null==t||t((0,g.eb)(e.fileList))},[t]);return(0,l.jsx)(i.Upload,{...(0,g.Zy)(o),onChange:n})},(0,a.mapProps)({value:"fileList"}),(0,a.mapReadPretty)(C));function k(e){let t=e??g.ZH,{t:o,i18n:l}=(0,p.useTranslation)(),n=eV()(t,{base:2,standard:"jedec",locale:l.language});return 0!==t?o("File size should not exceed {{size}}.",{size:n}):""}function F(e){let{file:t}=e,{componentCls:o}=(0,f.I)(),{getThumbnailURL:n=g.n2}=g.lN.getTypeByFile(t)??{},r=n(t);return(0,l.jsx)("img",{src:r,alt:t.title,className:`${o}-list-item-image`})}function M(e){let{file:t,disabled:o,onPreview:r,onDelete:a,readPretty:s,showFileName:m}=e,{componentCls:h}=(0,f.I)(),{t:x}=(0,p.useTranslation)(),v=(0,u.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r(t)},[t,r]),y=(0,u.useCallback)(()=>{null==a||a(t)},[t,a]),b=(0,u.useCallback)(()=>{(0,c.saveAs)(t.url,`${t.title}${t.extname}`)},[t]),{ThumbnailPreviewer:S=F}=g.lN.getTypeByFile(t)??{},C=[(0,l.jsx)("span",{className:`${h}-list-item-thumbnail`,children:(0,l.jsx)(S,{file:t})},"thumbnail"),!1!==m&&t.title?(0,l.jsx)("span",{className:`${h}-list-item-name`,title:t.title,children:"uploading"===t.status?x("Uploading"):t.title},"title"):null],_=t.url?(0,l.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:t.url,onClick:v,children:C}):(0,l.jsx)("span",{className:`${h}-span`,children:C}),k=(0,l.jsxs)("div",{className:(0,d.default)(`${h}-list-item`,`${h}-list-item-${t.status??"done"}`,`${h}-list-item-list-type-picture-card`),children:[(0,l.jsx)("div",{className:`${h}-list-item-info`,children:_}),(0,l.jsx)("span",{className:`${h}-list-item-actions`,children:(0,l.jsxs)(i.Space,{size:3,children:[!s&&t.url&&(0,l.jsx)(i.Button,{size:"small",type:"text",icon:(0,l.jsx)(n.DownloadOutlined,{}),onClick:b}),!s&&!o&&"uploading"!==t.status&&(0,l.jsx)(i.Button,{size:"small",type:"text",icon:(0,l.jsx)(n.DeleteOutlined,{}),onClick:y})]})}),"uploading"===t.status&&(0,l.jsx)("div",{className:`${h}-list-item-progress`,children:(0,l.jsx)(i.Progress,{strokeWidth:4,type:"line",showInfo:!1,percent:Number(t.percent)})})]});return(0,l.jsx)("div",{style:{marginBottom:!1!==m&&t.title?"28px":"0px"},className:`${h}-list-picture-card-container ${h}-list-item-container`,children:"error"===t.status?(0,l.jsx)(i.Tooltip,{title:t.response,getPopupContainer:e=>e.parentNode,children:k}):k})}function P(e){let{index:t,onSwitchIndex:o,list:n}=e;if(null==t)return null;let r=n[t],{Previewer:a=S}=g.lN.getTypeByFile(r)??{};return(0,l.jsx)(a,{index:t,list:n,onSwitchIndex:o})}function I(e){let{disabled:t,multiple:o,value:n,onChange:r,readPretty:a,showFileName:i}=e,[s,d]=(0,u.useState)([]),[c,p]=(0,u.useState)(null);(0,u.useEffect)(()=>{d((0,g.eb)(n))},[n]);let m=(0,u.useCallback)(e=>{p(s.findIndex(t=>t.id===e.id))},[s]),h=(0,u.useCallback)(e=>{if(o){let t=n.filter(t=>t.id!==e.id);0===t.length?r(null):r(t)}else r(null)},[o,r,n]);return(0,l.jsxs)(l.Fragment,{children:[s.map((e,o)=>(0,l.jsx)(M,{file:e,index:o,disabled:t,onPreview:m,onDelete:h,readPretty:a,showFileName:i},e.id||e.url)),(0,l.jsx)(P,{index:c,onSwitchIndex:p,list:s})]})}function A(e){let{rules:t,...o}=e,{disabled:r,multiple:s,value:c,onChange:m,toValueItem:h=g.ej}=o,[v,y]=(0,u.useState)([]),[b,S]=(0,u.useState)([]),{t:C}=(0,p.useTranslation)(),{componentCls:_}=(0,f.I)(),F=(0,a.useField)(),P=(0,g.Zy)(o),I=(0,g.yL)(t);(0,u.useEffect)(()=>{if(b.length){let e=b.filter(e=>"error"===e.status);F.setFeedback({type:"error",code:"ValidateError",messages:[e.length?C("Some files are not uploaded correctly, please check."):" "]})}else F.setFeedback({})},[F,b,C]);let A=(0,u.useCallback)(e=>{let t=e.fileList.filter(e=>"done"!==e.status).map(g.qv);if(S(t),s){let o=e.fileList.filter(e=>"done"===e.status);if(o.length){let e=[...v,...o.map(e=>{var t;return h(null==(t=e.response)?void 0:t.data)})];t.length?y(e):(null==m||m([...c||[],...e]),y([]))}}else{let t=e.fileList.find(t=>t.uid===e.file.uid);if("done"===t.status){var o;null==m||m(h(null==(o=t.response)?void 0:o.data)),S([])}}},[s,c,v,h,m]),T=(0,u.useCallback)(e=>{S(t=>{let o=t.indexOf(e);return t.splice(o,1),[...t]})},[]),w=(0,u.useCallback)(e=>{y(t=>{let o=t.indexOf(e);return t.splice(o,1),[...t]})},[]),j=(0,x.xZ)("QRCodeUploader"),{mimetype:D,size:L}=t??{},R=k(L),Y=!r&&(s||(!c||Array.isArray(c)&&!c.length)&&!b.length);return(0,l.jsxs)(l.Fragment,{children:[v.map((e,t)=>(0,l.jsx)(M,{file:e,index:t,disabled:r,onDelete:w},e.id)),b.map((e,t)=>(0,l.jsx)(M,{file:e,index:t,disabled:r,onDelete:T},e.uid)),(0,l.jsx)("div",{className:(0,d.default)(`${_}-list-picture-card-container`,`${_}-list-item-container`),style:Y?{}:{display:"none"},children:(0,l.jsx)(i.Tooltip,{title:R,children:(0,l.jsx)(i.Upload,{accept:D,...P,disabled:r,multiple:s,listType:"picture-card",fileList:b,beforeUpload:I,onChange:A,showUploadList:!1,children:Y?(0,l.jsxs)("span",{children:[(0,l.jsx)(n.PlusOutlined,{}),(0,l.jsx)("br",{})," ",C("Upload")]}):null})})}),Y&&j&&(0,l.jsx)(j,{disabled:r,multiple:s,value:c,onChange:m})]})}function T(e){let{wrapSSR:t,hashId:o,componentCls:n}=(0,f.I)();return t((0,l.jsx)("div",{className:(0,d.default)(`${n}-wrapper`,`${n}-picture-card-wrapper`,"nb-upload",o),children:(0,l.jsxs)("div",{className:(0,d.default)(`${n}-list`,`${n}-list-picture-card`),children:[(0,l.jsx)(I,{...e}),(0,l.jsx)(A,{...e})]})}))}_.ReadPretty=C,T.ReadPretty=C,_.Attachment=(0,h.T)((0,a.connect)(T,(0,a.mapReadPretty)(T.ReadPretty)),{displayName:"Upload.Attachment"}),_.Dragger=(0,a.connect)(e=>{let{tipContent:t,onChange:o,...n}=e,{wrapSSR:r,hashId:a,componentCls:s}=(0,f.I)(),c=(0,u.useCallback)(e=>{null==o||o((0,g.eb)(e.fileList))},[o]);return r((0,l.jsx)("div",{className:(0,d.default)(`${s}-dragger`,a),children:(0,l.jsxs)(i.Upload.Dragger,{...(0,g.Zy)(n),onChange:c,children:[t,e.children]})}))},(0,a.mapProps)({value:"fileList"})),_.DraggerV2=(0,h.T)((0,a.connect)(e=>{let{rules:t,...o}=e,{t:r}=(0,p.useTranslation)(),a=r("Click or drag file to this area to upload"),{title:s=a,...c}=(0,v.Y)(o),[m,h]=(0,u.useState)(!1),{wrapSSR:x,hashId:y,componentCls:b}=(0,f.I)(),S=(0,g.yL)(t),{size:C,mimetype:_}=t??{},F=k(C),M=(0,u.useCallback)(e=>{let{fileList:t}=e,{onChange:o}=c;null==o||o(t),t.some(e=>"uploading"===e.status)?h(!0):h(!1)},[c]);return x((0,l.jsx)("div",{className:(0,d.default)(`${b}-dragger`,y),children:(0,l.jsxs)(i.Upload.Dragger,{...(0,g.Zy)({...o,...c,accept:_,onChange:M,beforeUpload:S}),children:[(0,l.jsx)("p",{className:`${b}-drag-icon`,children:m?(0,l.jsx)(n.LoadingOutlined,{style:{fontSize:36},spin:!0}):(0,l.jsx)(n.InboxOutlined,{})}),(0,l.jsx)("p",{className:`${b}-text`,children:s}),(0,l.jsxs)("ul",{children:[(0,l.jsx)("li",{className:`${b}-hint`,children:r("Support for a single or bulk upload.")}),(0,l.jsx)("li",{className:`${b}-hint`,children:F})]})]})}))},(0,a.mapProps)({value:"fileList"})),{displayName:"Upload.DraggerV2"})},13704(e,t,o){o.d(t,{_O:()=>r._O,_b:()=>l._b,_s:()=>r._s,d9:()=>r.d9,dF:()=>n.d,lN:()=>l.lN});var l=o(61808),n=o(48989),r=o(57949)},61808(e,t,o){o.d(t,{ZH:()=>c,qv:()=>x,_b:()=>p,ej:()=>g,yL:()=>S,lN:()=>u,Zy:()=>v,eb:()=>y,n2:()=>h});var l=o(27404),n=o(51649),r=o(77843),a=o(16211);let i=window.__nocobase_dev_public_path__||window.__nocobase_public_path__||"/",s=[{ext:/\.docx?$/i,icon:"/file-placeholder/docx-200-200.png"},{ext:/\.pptx?$/i,icon:"/file-placeholder/pptx-200-200.png"},{ext:/\.jpe?g$/i,icon:"/file-placeholder/jpeg-200-200.png"},{ext:/\.pdf$/i,icon:"/file-placeholder/pdf-200-200.png"},{ext:/\.png$/i,icon:"/file-placeholder/png-200-200.png"},{ext:/\.eps$/i,icon:"/file-placeholder/eps-200-200.png"},{ext:/\.ai$/i,icon:"/file-placeholder/ai-200-200.png"},{ext:/\.gif$/i,icon:"/file-placeholder/gif-200-200.png"},{ext:/\.svg$/i,icon:"/file-placeholder/svg-200-200.png"},{ext:/\.xlsx?$/i,icon:"/file-placeholder/xlsx-200-200.png"},{ext:/\.psd?$/i,icon:"/file-placeholder/psd-200-200.png"},{ext:/\.(wav|aif|aiff|au|mp1|mp2|mp3|ra|rm|ram|mid|rmi)$/i,icon:"/file-placeholder/audio-200-200.png"},{ext:/\.(avi|wmv|mpg|mpeg|vob|dat|3gp|mp4|mkv|rm|rmvb|mov|flv)$/i,icon:"/file-placeholder/video-200-200.png"},{ext:/\.(zip|rar|arj|z|gz|iso|jar|ace|tar|uue|dmg|pkg|lzh|cab)$/i,icon:"/file-placeholder/zip-200-200.png"}].map(e=>({ext:e.ext,icon:i+e.icon.slice(1)})),d=i+"file-placeholder/unknown-200-200.png",c=0x1400000,u=new class{add(e){this.types.unshift(e)}getTypeByFile(e){return this.types.find(t=>t.match(e))}constructor(){this.types=[]}};function p(e,t){if(!e)return!1;if(e.originFileObj)return eN()(e.type,t);if(e.mimetype)return eN()(e.mimetype,t);if(e.url){let[o]=e.url.split("?");return eN()(eY().getType(o)||"",t)}return!1}let m=(e,t)=>t&&(0,l.isArr)(t.include)?t.include.some(t=>e.test(t)):!(t&&(0,l.isArr)(t.exclude))||!t.exclude.some(t=>e.test(t));function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(let o=0;o<s.length;o++){let l=e.url?new URL(e.url.startsWith("http://")||e.url.startsWith("https://")?e.url:`${location.origin}/${e.url.replace(/^\//,"")}`):{pathname:e.filename};if(s[o].ext.test(e.extname||e.filename||l.pathname||e.name))if(m(s[o].ext,t))return s[o].icon||d;else return e.name}return d}function x(e){let t=function(e){let{error:t,response:o}=e;if(t instanceof Error&&"isAxiosError"in t)if(!t.response)return t.message;else{var l,n,r;return null==(r=t.response.data)||null==(n=r.errors)||null==(l=n.map)?void 0:l.call(n,e=>null==e?void 0:e.message).join(", ")}if(!o)return"";if("string"==typeof o)return o;let{errors:a}=o.data??{};return(null==a?void 0:a.length)?a.map(e=>null==e?void 0:e.message).join(", "):""}(e);return{...e,title:e.name,response:t}}function v(e){let t=(0,a.VB)();return{customRequest(e){let{action:o,data:l,file:n,filename:r,headers:a,onError:i,onProgress:s,onSuccess:d,withCredentials:c}=e,u=new FormData;return l&&Object.keys(l).forEach(e=>{u.append(e,l[e])}),u.append(r,n),t.axios.post(o,u,{withCredentials:c,headers:a,onUploadProgress:e=>{let{total:t,loaded:o}=e;s({percent:Math.round(o/t*100).toFixed(2)},n)}}).then(e=>{let{data:t}=e;d(t,n)}).catch(i).finally(()=>{}),{abort(){console.log("upload progress is aborted.")}}},...e}}function g(e){return e}let f=e=>{var t;if("string"==typeof e)return{url:e};(null==e||null==(t=e.response)?void 0:t.data)&&(e={uid:e.uid,...e.response.data});let o={...e,id:e.id||e.uid,title:e.title||e.name};return e.url&&(o.url=e.url.startsWith("https://")||e.url.startsWith("http://")?e.url:`${location.origin}/${e.url.replace(/^\//,"")}`),o},y=e=>(!(0,l.isValid)(e)||0===Object.keys(e).length?[]:(0,l.toArr)(e)).filter(Boolean).map(f),b={size(e,t){let o=t??c;return 0===o||e.size<=o?null:"File size exceeds the limit"},mimetype(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*",o=t.toString().trim();return o&&"*"!==o?o.split(",").filter(Boolean).some(eN()(e.type))?null:"File type is not allowed":null}};function S(e){let{t}=(0,r.useTranslation)();return(0,n.useCallback)((o,l)=>{let n=o;if(!o.type){var r,a;let e=null==(a=o.name)||null==(r=a.match(/\.[^.]+$/))?void 0:r[0];e&&(n=new File([o],o.name,{type:eY().getType(e)||"application/octet-stream",lastModified:o.lastModified}))}let i=function(e,t){if(!t)return null;let o=Object.keys(t);if(!o.length)return null;for(let l of o){let o=b[l](e,t[l]);if(o)return o}return null}(n,e);return i?(o.status="error",o.response=t(i)):"error"===o.status&&(delete n.status,delete n.response),!i&&Promise.resolve(n)},[e])}},48989(e,t,o){o.d(t,{I:()=>l,d:()=>n});let l=(0,o(54969).fD)("upload",e=>{let{componentCls:t,antCls:o}=e;return{[`${t}-wrapper`]:{"&.nb-upload.nb-upload-small":{[`${t}-list-picture-card-container`]:{margin:"0 3px 3px 0 !important",height:"32px !important",width:"32px !important",marginBlock:"0 !important"},[`${t}-list-picture-card ${t}-list-item-name${t}-list-item-name`]:{display:"none !important"},[`${t}-list-picture ${t}-list-item, ${t}-list-picture-card ${t}-list-item`]:{borderRadius:"4px",padding:"1px !important",[`${t}-list-item-image`]:{borderRadius:"2px"}}},"&.nb-upload-large":{[`${t}-list-picture-card-container`]:{margin:"0 3px 3px 0 !important",height:"160px !important",width:"160px !important",marginBlock:"0 28px !important"}},"&.nb-upload":{[`${t}-list-item, ${t}-list-item-list-type-picture-card`]:{padding:"3px !important"},[`${t}-list-item-thumbnail`]:{img:{objectFit:"cover !important"}},[`${t}-list-item-actions`]:{left:"auto !important",right:"2px !important",top:"2px !important",transform:"none !important",width:"fit-content !important",[`${o}-btn-text:hover, ${o}-btn-text:focus`]:{background:"rgba(0, 0, 0, 0.4)"}},[`${t}-list-picture-card ${t}-list-item-info`]:{overflow:"inherit",width:"100%",height:"100%"},[`${t}-list-picture-card ${t}-list-item-name`]:{display:"block !important",marginTop:"5px",fontSize:"13px",color:"#636363"},[`${t}-list-picture-card ${t}-list-item::before`]:{display:"none !important"},[`${t}-list-picture-card ${t}-list-item-progress`]:{bottom:"calc(50% - 11px)",left:`${e.margin/2}px`,pointerEvents:"none"},[`${o}-btn`]:{background:"rgba(0, 0, 0, 0.5)"},[`${t}-list-picture-card-container`]:{}},[`${t}-list-item-error`]:{[`${t}-list-item-info img`]:{opacity:.6}},[`${t}-drag`]:{[`${t}-drag-container`]:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%",ul:{color:e.colorTextSecondary,[`${t}-hint`]:{textAlign:"left"}}}}}}}),n=l},73047(e,t,o){o.d(t,{B:()=>s});var l=o(71178),n=o(10691),r=o(52793),a=o(51649),i=o(96758);function s(e){let t=(0,a.useRef)(null),{changeOnSelect:o,component:s=r.Input.TextArea,fieldNames:d,scope:c,buttonClass:u,delimiters:p=["{{","}}"],...m}=e,h="function"==typeof c?c():c,[x,v]=(0,a.useState)(h||[]);return(0,l.jsxs)("div",{className:(0,n.css)`
|
|
857
|
+
`),style:v,children:(0,l.jsx)("div",{className:(0,d.default)(`${h}-list`,`${h}-list-picture-card`),style:v,children:(0,l.jsx)(I,{disabled:n,readPretty:!0,multiple:a,value:t,onChange:o,...s})})}))}let _=(0,a.connect)(function(e){let{onChange:t,...o}=e,n=(0,u.useCallback)(e=>{null==t||t((0,g.eb)(e.fileList))},[t]);return(0,l.jsx)(i.Upload,{...(0,g.Zy)(o),onChange:n})},(0,a.mapProps)({value:"fileList"}),(0,a.mapReadPretty)(C));function k(e){let t=e??g.ZH,{t:o,i18n:l}=(0,p.useTranslation)(),n=eV()(t,{base:2,standard:"jedec",locale:l.language});return 0!==t?o("File size should not exceed {{size}}.",{size:n}):""}function F(e){let{file:t}=e,{componentCls:o}=(0,f.I)(),{getThumbnailURL:n=g.n2}=g.lN.getTypeByFile(t)??{},r=n(t);return(0,l.jsx)("img",{src:r,alt:t.title,className:`${o}-list-item-image`})}function M(e){let{file:t,disabled:o,onPreview:r,onDelete:a,readPretty:s,showFileName:m}=e,{componentCls:h}=(0,f.I)(),{t:x}=(0,p.useTranslation)(),v=(0,u.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r(t)},[t,r]),y=(0,u.useCallback)(()=>{null==a||a(t)},[t,a]),b=(0,u.useCallback)(()=>{(0,c.saveAs)(t.url,(0,g.AK)(t))},[t]),{ThumbnailPreviewer:S=F}=g.lN.getTypeByFile(t)??{},C=[(0,l.jsx)("span",{className:`${h}-list-item-thumbnail`,children:(0,l.jsx)(S,{file:t})},"thumbnail"),!1!==m&&t.title?(0,l.jsx)("span",{className:`${h}-list-item-name`,title:t.title,children:"uploading"===t.status?x("Uploading"):t.title},"title"):null],_=t.url?(0,l.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:t.url,onClick:v,children:C}):(0,l.jsx)("span",{className:`${h}-span`,children:C}),k=(0,l.jsxs)("div",{className:(0,d.default)(`${h}-list-item`,`${h}-list-item-${t.status??"done"}`,`${h}-list-item-list-type-picture-card`),children:[(0,l.jsx)("div",{className:`${h}-list-item-info`,children:_}),(0,l.jsx)("span",{className:`${h}-list-item-actions`,children:(0,l.jsxs)(i.Space,{size:3,children:[!s&&t.url&&(0,l.jsx)(i.Button,{size:"small",type:"text",icon:(0,l.jsx)(n.DownloadOutlined,{}),onClick:b}),!s&&!o&&"uploading"!==t.status&&(0,l.jsx)(i.Button,{size:"small",type:"text",icon:(0,l.jsx)(n.DeleteOutlined,{}),onClick:y})]})}),"uploading"===t.status&&(0,l.jsx)("div",{className:`${h}-list-item-progress`,children:(0,l.jsx)(i.Progress,{strokeWidth:4,type:"line",showInfo:!1,percent:Number(t.percent)})})]});return(0,l.jsx)("div",{style:{marginBottom:!1!==m&&t.title?"28px":"0px"},className:`${h}-list-picture-card-container ${h}-list-item-container`,children:"error"===t.status?(0,l.jsx)(i.Tooltip,{title:t.response,getPopupContainer:e=>e.parentNode,children:k}):k})}function P(e){let{index:t,onSwitchIndex:o,list:n}=e;if(null==t)return null;let r=n[t],{Previewer:a=S}=g.lN.getTypeByFile(r)??{};return(0,l.jsx)(a,{index:t,list:n,onSwitchIndex:o})}function I(e){let{disabled:t,multiple:o,value:n,onChange:r,readPretty:a,showFileName:i}=e,[s,d]=(0,u.useState)([]),[c,p]=(0,u.useState)(null);(0,u.useEffect)(()=>{d((0,g.eb)(n))},[n]);let m=(0,u.useCallback)(e=>{p(s.findIndex(t=>t.id===e.id))},[s]),h=(0,u.useCallback)(e=>{if(o){let t=n.filter(t=>t.id!==e.id);0===t.length?r(null):r(t)}else r(null)},[o,r,n]);return(0,l.jsxs)(l.Fragment,{children:[s.map((e,o)=>(0,l.jsx)(M,{file:e,index:o,disabled:t,onPreview:m,onDelete:h,readPretty:a,showFileName:i},e.id||e.url)),(0,l.jsx)(P,{index:c,onSwitchIndex:p,list:s})]})}function A(e){let{rules:t,...o}=e,{disabled:r,multiple:s,value:c,onChange:m,toValueItem:h=g.ej}=o,[v,y]=(0,u.useState)([]),[b,S]=(0,u.useState)([]),{t:C}=(0,p.useTranslation)(),{componentCls:_}=(0,f.I)(),F=(0,a.useField)(),P=(0,g.Zy)(o),I=(0,g.yL)(t);(0,u.useEffect)(()=>{if(b.length){let e=b.filter(e=>"error"===e.status);F.setFeedback({type:"error",code:"ValidateError",messages:[e.length?C("Some files are not uploaded correctly, please check."):" "]})}else F.setFeedback({})},[F,b,C]);let A=(0,u.useCallback)(e=>{let t=e.fileList.filter(e=>"done"!==e.status).map(g.qv);if(S(t),s){let o=e.fileList.filter(e=>"done"===e.status);if(o.length){let e=[...v,...o.map(e=>{var t;return h(null==(t=e.response)?void 0:t.data)})];t.length?y(e):(null==m||m([...c||[],...e]),y([]))}}else{let t=e.fileList.find(t=>t.uid===e.file.uid);if("done"===t.status){var o;null==m||m(h(null==(o=t.response)?void 0:o.data)),S([])}}},[s,c,v,h,m]),T=(0,u.useCallback)(e=>{S(t=>{let o=t.indexOf(e);return t.splice(o,1),[...t]})},[]),w=(0,u.useCallback)(e=>{y(t=>{let o=t.indexOf(e);return t.splice(o,1),[...t]})},[]),j=(0,x.xZ)("QRCodeUploader"),{mimetype:D,size:L}=t??{},R=k(L),Y=!r&&(s||(!c||Array.isArray(c)&&!c.length)&&!b.length);return(0,l.jsxs)(l.Fragment,{children:[v.map((e,t)=>(0,l.jsx)(M,{file:e,index:t,disabled:r,onDelete:w},e.id)),b.map((e,t)=>(0,l.jsx)(M,{file:e,index:t,disabled:r,onDelete:T},e.uid)),(0,l.jsx)("div",{className:(0,d.default)(`${_}-list-picture-card-container`,`${_}-list-item-container`),style:Y?{}:{display:"none"},children:(0,l.jsx)(i.Tooltip,{title:R,children:(0,l.jsx)(i.Upload,{accept:D,...P,disabled:r,multiple:s,listType:"picture-card",fileList:b,beforeUpload:I,onChange:A,showUploadList:!1,children:Y?(0,l.jsxs)("span",{children:[(0,l.jsx)(n.PlusOutlined,{}),(0,l.jsx)("br",{})," ",C("Upload")]}):null})})}),Y&&j&&(0,l.jsx)(j,{disabled:r,multiple:s,value:c,onChange:m})]})}function T(e){let{wrapSSR:t,hashId:o,componentCls:n}=(0,f.I)();return t((0,l.jsx)("div",{className:(0,d.default)(`${n}-wrapper`,`${n}-picture-card-wrapper`,"nb-upload",o),children:(0,l.jsxs)("div",{className:(0,d.default)(`${n}-list`,`${n}-list-picture-card`),children:[(0,l.jsx)(I,{...e}),(0,l.jsx)(A,{...e})]})}))}_.ReadPretty=C,T.ReadPretty=C,_.Attachment=(0,h.T)((0,a.connect)(T,(0,a.mapReadPretty)(T.ReadPretty)),{displayName:"Upload.Attachment"}),_.Dragger=(0,a.connect)(e=>{let{tipContent:t,onChange:o,...n}=e,{wrapSSR:r,hashId:a,componentCls:s}=(0,f.I)(),c=(0,u.useCallback)(e=>{null==o||o((0,g.eb)(e.fileList))},[o]);return r((0,l.jsx)("div",{className:(0,d.default)(`${s}-dragger`,a),children:(0,l.jsxs)(i.Upload.Dragger,{...(0,g.Zy)(n),onChange:c,children:[t,e.children]})}))},(0,a.mapProps)({value:"fileList"})),_.DraggerV2=(0,h.T)((0,a.connect)(e=>{let{rules:t,...o}=e,{t:r}=(0,p.useTranslation)(),a=r("Click or drag file to this area to upload"),{title:s=a,...c}=(0,v.Y)(o),[m,h]=(0,u.useState)(!1),{wrapSSR:x,hashId:y,componentCls:b}=(0,f.I)(),S=(0,g.yL)(t),{size:C,mimetype:_}=t??{},F=k(C),M=(0,u.useCallback)(e=>{let{fileList:t}=e,{onChange:o}=c;null==o||o(t),t.some(e=>"uploading"===e.status)?h(!0):h(!1)},[c]);return x((0,l.jsx)("div",{className:(0,d.default)(`${b}-dragger`,y),children:(0,l.jsxs)(i.Upload.Dragger,{...(0,g.Zy)({...o,...c,accept:_,onChange:M,beforeUpload:S}),children:[(0,l.jsx)("p",{className:`${b}-drag-icon`,children:m?(0,l.jsx)(n.LoadingOutlined,{style:{fontSize:36},spin:!0}):(0,l.jsx)(n.InboxOutlined,{})}),(0,l.jsx)("p",{className:`${b}-text`,children:s}),(0,l.jsxs)("ul",{children:[(0,l.jsx)("li",{className:`${b}-hint`,children:r("Support for a single or bulk upload.")}),(0,l.jsx)("li",{className:`${b}-hint`,children:F})]})]})}))},(0,a.mapProps)({value:"fileList"})),{displayName:"Upload.DraggerV2"})},13704(e,t,o){o.d(t,{_O:()=>r._O,_b:()=>l._b,_s:()=>r._s,d9:()=>r.d9,dF:()=>n.d,lN:()=>l.lN});var l=o(61808),n=o(48989),r=o(57949)},61808(e,t,o){o.d(t,{ZH:()=>c,qv:()=>b,AK:()=>x,_b:()=>g,ej:()=>C,yL:()=>M,lN:()=>v,Zy:()=>S,eb:()=>k,n2:()=>y});var l=o(27404),n=o(51649),r=o(77843),a=o(16211);let i=window.__nocobase_dev_public_path__||window.__nocobase_public_path__||"/",s=[{ext:/\.docx?$/i,icon:"/file-placeholder/docx-200-200.png"},{ext:/\.pptx?$/i,icon:"/file-placeholder/pptx-200-200.png"},{ext:/\.jpe?g$/i,icon:"/file-placeholder/jpeg-200-200.png"},{ext:/\.pdf$/i,icon:"/file-placeholder/pdf-200-200.png"},{ext:/\.png$/i,icon:"/file-placeholder/png-200-200.png"},{ext:/\.eps$/i,icon:"/file-placeholder/eps-200-200.png"},{ext:/\.ai$/i,icon:"/file-placeholder/ai-200-200.png"},{ext:/\.gif$/i,icon:"/file-placeholder/gif-200-200.png"},{ext:/\.svg$/i,icon:"/file-placeholder/svg-200-200.png"},{ext:/\.xlsx?$/i,icon:"/file-placeholder/xlsx-200-200.png"},{ext:/\.psd?$/i,icon:"/file-placeholder/psd-200-200.png"},{ext:/\.(wav|aif|aiff|au|mp1|mp2|mp3|ra|rm|ram|mid|rmi)$/i,icon:"/file-placeholder/audio-200-200.png"},{ext:/\.(avi|wmv|mpg|mpeg|vob|dat|3gp|mp4|mkv|rm|rmvb|mov|flv)$/i,icon:"/file-placeholder/video-200-200.png"},{ext:/\.(zip|rar|arj|z|gz|iso|jar|ace|tar|uue|dmg|pkg|lzh|cab)$/i,icon:"/file-placeholder/zip-200-200.png"}].map(e=>({ext:e.ext,icon:i+e.icon.slice(1)})),d=i+"file-placeholder/unknown-200-200.png",c=0x1400000,u=e=>(null==e?void 0:e.split("?")[0].split("#")[0])||"",p=e=>{if(!e)return"";let t=u(e),o=t.lastIndexOf("/");var l=-1===o?t:t.slice(o+1);try{return decodeURIComponent(l)}catch(e){return l}},m=e=>{if(!e)return"";let t=u(e),o=t.lastIndexOf(".");return -1===o?"":t.slice(o)},h=e=>{if(!e)return"";let t=m(e);return t?e.slice(0,-t.length):e},x=e=>{let t=(null==e?void 0:e.filename)||p(null==e?void 0:e.url),o=(null==e?void 0:e.extname)||m(t||(null==e?void 0:e.name)),l=(null==e?void 0:e.title)||h(t||(null==e?void 0:e.name));return t||`${l||"file"}${o}`},v=new class{add(e){this.types.unshift(e)}getTypeByFile(e){return this.types.find(t=>t.match(e))}constructor(){this.types=[]}};function g(e,t){if(!e)return!1;if(e.originFileObj)return eN()(e.type,t);if(e.mimetype)return eN()(e.mimetype,t);if(e.url){let[o]=e.url.split("?");return eN()(eY().getType(o)||"",t)}return!1}let f=(e,t)=>t&&(0,l.isArr)(t.include)?t.include.some(t=>e.test(t)):!(t&&(0,l.isArr)(t.exclude))||!t.exclude.some(t=>e.test(t));function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(let o=0;o<s.length;o++){let l=e.url?new URL(e.url.startsWith("http://")||e.url.startsWith("https://")?e.url:`${location.origin}/${e.url.replace(/^\//,"")}`):{pathname:e.filename};if(s[o].ext.test(e.extname||e.filename||l.pathname||e.name))if(f(s[o].ext,t))return s[o].icon||d;else return e.name}return d}function b(e){let t=function(e){let{error:t,response:o}=e;if(t instanceof Error&&"isAxiosError"in t)if(!t.response)return t.message;else{var l,n,r;return null==(r=t.response.data)||null==(n=r.errors)||null==(l=n.map)?void 0:l.call(n,e=>null==e?void 0:e.message).join(", ")}if(!o)return"";if("string"==typeof o)return o;let{errors:a}=o.data??{};return(null==a?void 0:a.length)?a.map(e=>null==e?void 0:e.message).join(", "):""}(e);return{...e,title:e.name,response:t}}function S(e){let t=(0,a.VB)();return{customRequest(e){let{action:o,data:l,file:n,filename:r,headers:a,onError:i,onProgress:s,onSuccess:d,withCredentials:c}=e,u=new FormData;return l&&Object.keys(l).forEach(e=>{u.append(e,l[e])}),u.append(r,n),t.axios.post(o,u,{withCredentials:c,headers:a,onUploadProgress:e=>{let{total:t,loaded:o}=e;s({percent:Math.round(o/t*100).toFixed(2)},n)}}).then(e=>{let{data:t}=e;d(t,n)}).catch(i).finally(()=>{}),{abort(){console.log("upload progress is aborted.")}}},...e}}function C(e){return e}let _=e=>{var t;"string"==typeof e&&(e={url:e}),(null==e||null==(t=e.response)?void 0:t.data)&&(e={uid:e.uid,...e.response.data});let o={...e,id:e.id||e.uid,title:e.title||h(e.filename||e.name||p(e.url)),filename:e.filename||e.name||p(e.url),extname:e.extname||m(e.filename||e.name||p(e.url))};return e.url&&(o.url=e.url.startsWith("https://")||e.url.startsWith("http://")?e.url:`${location.origin}/${e.url.replace(/^\//,"")}`),o},k=e=>(!(0,l.isValid)(e)||0===Object.keys(e).length?[]:(0,l.toArr)(e)).filter(Boolean).map(_),F={size(e,t){let o=t??c;return 0===o||e.size<=o?null:"File size exceeds the limit"},mimetype(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*",o=t.toString().trim();return o&&"*"!==o?o.split(",").filter(Boolean).some(eN()(e.type))?null:"File type is not allowed":null}};function M(e){let{t}=(0,r.useTranslation)();return(0,n.useCallback)((o,l)=>{let n=o;if(!o.type){var r,a;let e=null==(a=o.name)||null==(r=a.match(/\.[^.]+$/))?void 0:r[0];e&&(n=new File([o],o.name,{type:eY().getType(e)||"application/octet-stream",lastModified:o.lastModified}))}let i=function(e,t){if(!t)return null;let o=Object.keys(t);if(!o.length)return null;for(let l of o){let o=F[l](e,t[l]);if(o)return o}return null}(n,e);return i?(o.status="error",o.response=t(i)):"error"===o.status&&(delete n.status,delete n.response),!i&&Promise.resolve(n)},[e])}},48989(e,t,o){o.d(t,{I:()=>l,d:()=>n});let l=(0,o(54969).fD)("upload",e=>{let{componentCls:t,antCls:o}=e;return{[`${t}-wrapper`]:{"&.nb-upload.nb-upload-small":{[`${t}-list-picture-card-container`]:{margin:"0 3px 3px 0 !important",height:"32px !important",width:"32px !important",marginBlock:"0 !important"},[`${t}-list-picture-card ${t}-list-item-name${t}-list-item-name`]:{display:"none !important"},[`${t}-list-picture ${t}-list-item, ${t}-list-picture-card ${t}-list-item`]:{borderRadius:"4px",padding:"1px !important",[`${t}-list-item-image`]:{borderRadius:"2px"}}},"&.nb-upload-large":{[`${t}-list-picture-card-container`]:{margin:"0 3px 3px 0 !important",height:"160px !important",width:"160px !important",marginBlock:"0 28px !important"}},"&.nb-upload":{[`${t}-list-item, ${t}-list-item-list-type-picture-card`]:{padding:"3px !important"},[`${t}-list-item-thumbnail`]:{img:{objectFit:"cover !important"}},[`${t}-list-item-actions`]:{left:"auto !important",right:"2px !important",top:"2px !important",transform:"none !important",width:"fit-content !important",[`${o}-btn-text:hover, ${o}-btn-text:focus`]:{background:"rgba(0, 0, 0, 0.4)"}},[`${t}-list-picture-card ${t}-list-item-info`]:{overflow:"inherit",width:"100%",height:"100%"},[`${t}-list-picture-card ${t}-list-item-name`]:{display:"block !important",marginTop:"5px",fontSize:"13px",color:"#636363"},[`${t}-list-picture-card ${t}-list-item::before`]:{display:"none !important"},[`${t}-list-picture-card ${t}-list-item-progress`]:{bottom:"calc(50% - 11px)",left:`${e.margin/2}px`,pointerEvents:"none"},[`${o}-btn`]:{background:"rgba(0, 0, 0, 0.5)"},[`${t}-list-picture-card-container`]:{}},[`${t}-list-item-error`]:{[`${t}-list-item-info img`]:{opacity:.6}},[`${t}-drag`]:{[`${t}-drag-container`]:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%",ul:{color:e.colorTextSecondary,[`${t}-hint`]:{textAlign:"left"}}}}}}}),n=l},73047(e,t,o){o.d(t,{B:()=>s});var l=o(71178),n=o(10691),r=o(52793),a=o(51649),i=o(96758);function s(e){let t=(0,a.useRef)(null),{changeOnSelect:o,component:s=r.Input.TextArea,fieldNames:d,scope:c,buttonClass:u,delimiters:p=["{{","}}"],...m}=e,h="function"==typeof c?c():c,[x,v]=(0,a.useState)(h||[]);return(0,l.jsxs)("div",{className:(0,n.css)`
|
|
858
858
|
position: relative;
|
|
859
859
|
.ant-input {
|
|
860
860
|
width: 100%;
|
|
@@ -964,7 +964,7 @@ ${JSON.stringify(s,null,2)}`)},[A,P,M,C,S,H,t,F,k,Y,o,B,O,U,V,$,R]),K=(0,r.useCa
|
|
|
964
964
|
&:hover {
|
|
965
965
|
background-color: ${i.colorFillSecondary};
|
|
966
966
|
}
|
|
967
|
-
`;return(0,r.jsxs)("div",{style:{maxHeight:300,overflowY:"auto"},children:[e.map(e=>(0,r.jsx)("div",{role:"option",onClick:()=>v(e.value),className:o,children:l(e.label)},e.value)),(0,r.jsx)(c.Divider,{style:{margin:"4px 0"}}),t.map(e=>(0,r.jsx)("div",{role:"option",className:o,onClick:()=>v(e.value),title:l(e.label),children:l(e.label)},e.value))]})}}),["past","next"].includes(null==t?void 0:t.type)&&[(0,r.jsx)(c.InputNumber,{value:null==t?void 0:t.number,onChange:e=>{o({...t,number:e})}},"number"),(0,r.jsx)(c.Select,{value:null==t?void 0:t.unit,style:{minWidth:130,maxWidth:140},onChange:e=>{o({...t,unit:e})},options:[{value:"day",label:n("Day")},{value:"week",label:n("Calendar week")},{value:"month",label:n("Calendar Month")},{value:"year",label:n("Calendar Year")}],popupMatchSelectWidth:!0},"unit")],((null==t?void 0:t.type)==="exact"||!(null==t?void 0:t.type))&&(0,r.jsx)(x,{...e})]})}},87382(e,t,o){o.d(t,{L1:()=>x,L3:()=>f,Pd:()=>h,Uq:()=>g,X_:()=>p,gB:()=>m});var l=o(71178),n=o(72741),r=o(38533),a=o(10691),i=o(56920),s=o(77583),d=o(51649),c=o(54969),u=o(95951);let p=(0,d.createContext)(null);p.displayName="DraggableContext";let m=(0,d.createContext)(null);m.displayName="SortableContext";let h=e=>{let{id:t,data:o,children:n}=e,a=(0,r.useDraggable)({id:t,data:o}),i=(0,r.useDroppable)({id:t,data:o}),s=(0,d.useMemo)(()=>({draggable:a,droppable:i}),[a,i]);return(0,l.jsx)(m.Provider,{value:s,children:n})},x=e=>{var t,o;let{component:l,overStyle:r,style:s,children:u,openMode:p,...h}=e,{token:x}=(0,c.rd)(),{draggable:v,droppable:g}=(0,d.useContext)(m),{isOver:f,setNodeRef:y}=g,b={...s},S=(0,i.useFieldSchema)(),C=(null==S?void 0:S["x-component"])==="Action.Link"||"a"===l;if(f&&(null==v||null==(t=v.active)?void 0:t.id)!==(null==g||null==(o=g.over)?void 0:o.id)){let e;b[C?"color":"background"]=(e=x.colorSettings,new n.TinyColor(e).setAlpha(.15).toHex8String()),Object.assign(b,r)}return d.default.createElement(l||"div",{role:"none",...h,className:(0,a.cx)("nb-sortable-designer",e.className),ref:y,style:b},u)},v=(0,i.observer)(e=>{var t;let o,n,r,{schema:a,id:s,eid:c,removeParentsIfNoChildren:u,...p}=(o=(0,i.useField)(),n=e.id?e.id:null==o||null==(t=o.address)?void 0:t.toString(),r=(0,i.useFieldSchema)(),e.schema?{...e,id:n}:{...e,id:n,schema:r}),m=(0,d.useMemo)(()=>{var e,t,o;return{insertAdjacent:"afterEnd",schema:(null==(t=a.parent)||null==(e=t.parent)?void 0:e["x-component"])==="BlockTemplate"?null==(o=a.parent)?void 0:o.parent:a,removeParentsIfNoChildren:u??!0}},[a,u]);return(0,l.jsx)(h,{id:s,data:m,children:(0,l.jsx)(x,{id:c,...p,children:e.children})})},{displayName:"InternalSortableItem"}),g=d.default.memo(e=>{let{component:t,...o}=e,{designable:n}=(0,u.er)();return n?(0,l.jsx)(v,{...e}):d.default.createElement(t||"div",s.default.omit(o,["children","schema","overStyle","openMode","id","eid","removeParentsIfNoChildren"]),e.children)});g.displayName="SortableItem";let f=e=>{let{draggable:t}=(0,d.useContext)(m)||{};if(!t)return null;let{attributes:o,listeners:n,setNodeRef:r}=t;return(0,l.jsx)("div",{style:{display:"inline-block",width:14,height:14,lineHeight:"14px",textAlign:"left"},children:(0,l.jsx)("div",{ref:r,style:{position:"relative",zIndex:1,lineHeight:0,fontSize:0,display:"inline-block"},...n,...o,role:"none",children:(0,l.jsx)("span",{style:{cursor:"move",fontSize:14},children:e.children})})})}},37845(e,t,o){o.d(t,{L1:()=>l.L1,L3:()=>l.L3,Pd:()=>l.Pd,Uq:()=>l.Uq,X_:()=>l.X_,gB:()=>l.gB});var l=o(87382)},59529(e,t,o){o.d(t,{KX:()=>p,_c:()=>h,a2:()=>f,bc:()=>u,rf:()=>c});var l=o(63526),n=o(77583),r=o(73761),a=o(839),i=o(59896),s=o(32665),d=o(64004);let c=(e,t)=>{var o;let l=null==e||null==(o=e.match)?void 0:o.call(e,/{{(.*?)}}/);if(!l)return e;{let e=n.default.get(t,l[1]);return n.default.isFunction(e)?e():e}};function u(e){if("object"!=typeof e||null===e)return null;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))if("[object Object]"===Object.prototype.toString.call(e[t])&&null!==e[t])return u(e[t]);else return{key:t,value:e[t]};return null}let p=e=>{let t,o=(t=[],!function e(o){Object.keys(o).sort().forEach(function(l){t.push(l),o[l]&&"object"==typeof o[l]&&e(o[l])})}(e),t),l=(0,n.findIndex)(o,(e,t,o)=>{if(e.includes("$")&&t>0)return!0});return o.slice(0,l)},m=async(e,t,o)=>{let l=(0,i.DZ)(e)?[t.parseVariable(e,o).then(e=>{let{value:t}=e;return t})]:[e];try{let[e]=await Promise.all(l);return e}catch(e){throw console.error("Error in parseVariableValue:",e),e}},h=async(e,t)=>{let{ruleGroup:o,variables:l,localVariables:r,variableNameOfLeftCondition:a,conditionType:i}=e,s=Object.keys(o)[0]||"$and",d=o[s]||[],c=await Promise.all(d.filter(Boolean).map(e=>x(e,l,r,a,i,t)));return"$and"===s?(0,n.every)(c,e=>e):!c.length||(0,n.some)(c,e=>e)},x=async(e,t,o,l,n,r)=>"$and"in e||"$or"in e?await h({ruleGroup:e,variables:t,localVariables:o,conditionType:n},r):"advanced"===n?v(e,t,o,r):g(e,t,o,l,r),v=async(e,t,o,l)=>{let n=e.op,r=await m(e.rightVar,t,o),a=await m(e.leftVar,t,o);return!n||l.apply({[n]:[a,r]})},g=async(e,t,o,n,r)=>{let a=u(e),c=null==a?void 0:a.key;if(!c)return!0;let m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$nForm";return`{{ ${t}.${e.join(".")} }}`}(p(e),n),h=t.parseVariable(m,o,{doNotRequest:!0}).then(e=>{let{value:t}=e;return t}),x=(0,i.DZ)(null==a?void 0:a.value)?[t.parseVariable(null==a?void 0:a.value,o).then(e=>{let{value:t}=e;return t}),h]:[null==a?void 0:a.value,h];try{let[e,n]=await Promise.all(x),a=await t.getCollectionField(m,o),i=(0,s.A)(n,{targetCollectionField:a}),u=(0,s.A)(e,{targetCollectionField:a});if((null==a?void 0:a.type)&&["datetime","date","datetimeNoTz","dateOnly","unixTimestamp"].includes(a.type)&&i){let e=(0,d.Pn)(u),t=(0,l.getPickerFormat)(e);i=(0,l.dayjs)(i).format(t)}return r.apply({[c]:[i,u]})}catch(e){throw e}};async function f(e,t,o,n,i,s){if(t&&"handlebars"===e){l.Handlebars.registerHelper("t",function(e){if("string"==typeof e)return s(e,{ns:a.z})});try{var d,c;let e,r=t.replace(/{{\s*}}/g,'{{"{{}}"}}'),a=l.Handlebars.compile(r),s=(e={},n.map(t=>{e[t.name]=t.ctx}),e),{$nDate:u}=(null==o||null==(d=o.ctxRef)?void 0:d.current)||{},p={};Object.keys(u||{}).map(e=>{p[e]=u[e]()});let m=a({...null==o||null==(c=o.ctxRef)?void 0:c.current,...s,$nDate:p});return console.log(m),await i(m)}catch(e){return/VariablesProvider: .* is not found/.test(e.message)||console.log(e),console.log(t),t}}try{let e=await (0,r.replaceVariableValue)(t,o,n);return await i(e)}catch(e){return/VariablesProvider: .* is not found/.test(e.message)||console.log(e),t}}},84951(e,t,o){o.d(t,{A:()=>y});var l=o(71178),n=o(56920),r=o(77583),a=o(51649),i=o(44388),s=o(51275),d=o(22204),c=o(3012),u=o(52570),p=o(95951);let m={type:"void","x-component":"Action.Container","x-action":"view",title:'{{ t("View record") }}',"x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock",properties:{}}}}}}}};var h=o(49621),x=o(30644),v=o(39888);let g=e=>"Action.Container"===e["x-component"],f=e=>{let{WrappedComponent:t,...o}=e,i=(0,n.useFieldSchema)(),{openPopup:s}=(0,c.Hy)(),d=(0,a.useRef)(!1),u=(()=>{let e=(0,n.useFieldSchema)(),{insertAfterBegin:t}=(0,p.er)();return(0,a.useCallback)(o=>{e.reduceProperties((e,t)=>"Action.Container"===t["x-component"]?t:e,null)||t((0,r.cloneDeep)(o))},[e,t])})(),h=(0,a.useRef)(i);h.current=i;let x=(0,a.useRef)(u);x.current=u;let v=(0,a.useRef)(s);v.current=s;let g=(0,a.useCallback)(()=>h.current,[]),f=(0,a.useCallback)(()=>{h.current.properties||(x.current(m),d.current=!0),d.current?(setTimeout(()=>{v.current({customActionSchema:g()})}),d.current=!1):h.current.properties&&v.current()},[g]),y=(0,a.useMemo)(()=>(0,r.debounce)(f,600,{leading:!0,trailing:!1}),[f]);return(0,a.useEffect)(()=>()=>{y.cancel()},[y]),(0,l.jsx)("a",{onClick:y,children:(0,l.jsx)(t,{...o})})};function y(e){return t=>{let[o,r]=(0,a.useState)(!1),[p,m]=(0,a.useState)(!1),y=(0,h.Ge)(),b=(0,s.D5)(),S=(0,n.useField)(),C=(0,n.useFieldSchema)(),{enableLink:_,openMode:k,openSize:F}=(null==C?void 0:C["x-component-props"])||{},{visibleWithURL:M,setVisibleWithURL:P}=(0,c.Hy)(),I=(0,a.useCallback)(e=>{null==r||r(e),null==P||P(e)},[P]);(0,a.useRef)(C).current=C;let{setSubmitted:A}=b;return _?(0,l.jsx)(i.OC,{visible:!1,children:(0,l.jsxs)(d.z4,{button:(0,l.jsx)(e,{...t}),visible:o||M,setVisible:I,formValueChanged:p,setFormValueChanged:m,openMode:k,openSize:F,containerRefKey:"field-popup",fieldSchema:C,setSubmitted:A,children:[(0,l.jsx)(h.Yz,{name:y.name,children:(0,l.jsx)(u.t,{children:(0,l.jsx)(v.P3,{children:(0,l.jsx)(x.dw,{onlyRenderProperties:!0,basePath:null==S?void 0:S.address,schema:C,filterProperties:g})})})}),(0,l.jsx)(f,{...t,WrappedComponent:e})]})}):(0,l.jsx)(e,{...t})}}},63557(e,t,o){o.d(t,{u:()=>l});let l=(0,o(51649).createContext)({});l.displayName="SchemaComponentContext.Provider"},71915(e,t,o){o.d(t,{O:()=>c});var l=o(71178),n=o(44814),r=o(56920),a=o(51649),i=o(52570);let s=e=>{let{children:t,form:o,...n}=e,s=(0,a.useContext)(r.SchemaOptionsContext),d=(0,a.useContext)(r.SchemaExpressionScopeContext),c={...null==s?void 0:s.scope,...d},u={...null==s?void 0:s.components};return(0,l.jsx)(r.FormProvider,{...n,form:o,children:(0,l.jsx)(i.t,{components:u,scope:c,children:t})})},d=e=>{let{children:t,...o}=e,s=(0,a.useContext)(r.SchemaOptionsContext),d=(0,a.useContext)(r.SchemaExpressionScopeContext),c={...null==s?void 0:s.scope,...d},u={...null==s?void 0:s.components},p=(0,a.useMemo)(()=>(0,n.createForm)(),[]);return(0,l.jsx)(r.FormProvider,{...o,form:p,children:(0,l.jsx)(i.t,{components:u,scope:c,children:t})})},c=e=>e.form?(0,l.jsx)(s,{...e}):(0,l.jsx)(d,{...e})},86073(e,t,o){o.d(t,{D:()=>x});var l=o(71178),n=o(44814),r=o(56920),a=o(52793),i=o(51649),s=o(43353);o(67285);var d=o(16319),c=o(71915),u=o(93726),p=o(16211);let m=e=>e,h=e=>{let{noForm:t,onlyRenderProperties:o,hidden:h,scope:x,uid:v,components:g,onSuccess:f,NotFoundPage:y,schemaTransform:b=m,onPageNotFind:S}=e,C=(0,i.useMemo)(()=>(0,n.createForm)(),[v]),{schema:_,loading:k}=(e=>{let{uid:t,type:o="getJsonSchema",onSuccess:l}=e,n={url:`/uiSchemas:${o}/${t}`},{data:r,loading:a}=(0,p.bP)(n,{refreshDeps:[t],onSuccess(e){l&&l(e)}});return{schema:null==r?void 0:r.data,loading:a}})({uid:v,type:o?"getProperties":"getJsonSchema",onSuccess:e=>{f&&f(e)}}),F=(0,d.xZ)(y),M=(0,s.RH)(),P=(0,r.useFieldSchema)(),I=(0,i.useMemo)(()=>b(_||{}),[_,b]),A=!_||0===Object.keys(_).length;return((0,i.useEffect)(()=>{M||k||h||!A||!S||S()},[M,h,k,S,A]),M||k||h)?(0,l.jsx)(a.Spin,{style:{width:"100%",marginTop:20},delay:void 0}):A?F?(0,l.jsx)(F,{}):null:t?(0,l.jsx)(u.H,{components:g,scope:x,schema:I,parentSchema:P}):(0,l.jsx)(c.O,{form:C,children:(0,l.jsx)(u.H,{components:g,scope:x,schema:I,parentSchema:P})})},x=(0,i.memo)(e=>e.uid?(0,l.jsx)(h,{...e}):null);x.displayName="RemoteSchemaComponent"},93726(e,t,o){o.d(t,{D:()=>u,H:()=>h});var l=o(71178),n=o(56920),r=o(77583),a=o(51649),i=o(30644),s=o(63557),d=o(52570);function c(e){return n.Schema.isSchemaInstance(e)?e:new n.Schema((null==e?void 0:e.name)?{type:"object",properties:{[e.name]:e},name:`p_${e.name}`}:e)}let u=(0,a.createContext)({onChange:r.default.noop}),p=(0,a.memo)(e=>{let{components:t,scope:o,schema:n,distributed:p,onChange:m,parentSchema:h,...x}=e,v=(0,a.useContext)(s.u),g=(0,a.useMemo)(()=>c(n),[n]),f=(0,a.useMemo)(()=>({...v,distributed:!1!=v.distributed&&p,refresh:v.refresh||r.default.noop}),[v,p]),{onChange:y}=(0,a.useContext)(u),b=(0,a.useMemo)(()=>({onChange:()=>{null==m||m(g),null==y||y()}}),[m,y,g]);return(0,l.jsx)(u.Provider,{value:b,children:(0,l.jsx)(s.u.Provider,{value:f,children:(0,l.jsx)(d.t,{inherit:!0,components:t,scope:o,children:(0,l.jsx)(i.dw,{...x,schema:g,isUseFormilyField:!0,parentSchema:h})})})})});p.displayName="RecursionSchemaComponent";let m=(0,a.memo)(e=>{let{schema:t,parentSchema:o,...n}=e,r=(0,a.useMemo)(()=>c(t),[]);return(0,l.jsx)(p,{...n,schema:r,parentSchema:o})});m.displayName="MemoizedSchemaComponent";let h=(0,a.memo)(e=>{let{memoized:t,...o}=e;return t?(0,l.jsx)(m,{...o}):(0,l.jsx)(p,{...o})});h.displayName="SchemaComponent"},52570(e,t,o){o.d(t,{M:()=>a,t:()=>i});var l=o(71178),n=o(56920),r=o(51649);let a=()=>(0,r.useContext)(n.SchemaOptionsContext)||{},i=(0,r.memo)(e=>{let{children:t}=e,o=a(),i=(0,r.useMemo)(()=>({...o.components,...e.components}),[o.components,e.components]),s=(0,r.useMemo)(()=>({...o.scope,...e.scope}),[o.scope,e.scope]),d=(0,r.useMemo)(()=>({scope:s,components:i}),[s,i]);return(0,l.jsx)(n.SchemaOptionsContext.Provider,{value:d,children:(0,l.jsx)(n.SchemaComponentsContext.Provider,{value:i,children:(0,l.jsx)(n.ExpressionScope,{value:s,children:t})})})});i.displayName="SchemaComponentOptions"},90995(e,t,o){o.d(t,{OA:()=>I,DY:()=>v.D,GD:()=>T,Do:()=>g.D,Mq:()=>f.M,t6:()=>f.t,Hv:()=>g.H,Op:()=>x.O,N3:()=>h});var l=o(71178),n=o(82113),r=o(52793),a=o(51649),i=o(77843),s=o(82924),d=o(49948),c=o(90236),u=o(504);let p={backgroundColor:"var(--colorSettings) !important"},m={backgroundColor:"transparent"},h=e=>{let{designable:t,setDesignable:o}=(0,s.erX)(),{t:a}=(0,i.useTranslation)(),{token:h}=(0,d.K)(),{isMobileLayout:x}=(0,c.mY)(),v=(0,u.useFlowEngine)();return((0,ef.useHotkeys)("Ctrl+Shift+U",()=>o(!t),[t]),x)?null:(0,l.jsx)(r.Tooltip,{title:a("UI Editor"),children:(0,l.jsx)(r.Button,{"data-testid":"ui-editor-button",icon:(0,l.jsx)(n.HighlightOutlined,{style:{color:h.colorTextHeaderMenu}}),title:a("UI Editor"),style:{...t?p:m,...e.style},onClick:async()=>{let e=!t;o(e),x||!e?await v.flowSettings.disable():await v.flowSettings.enable()}})})};var x=o(71915),v=o(86073),g=o(93726),f=o(52570),y=o(44814),b=o(56920),S=o(27404),C=o(77583),_=o(63557),k=o(20629);let F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`${e}${(0,S.uid)()}`};b.Schema.silent(!0);let M={},P={silent:!0,compile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=()=>{if(!P.silent)return Function("$root",`with($root) { return (${e}); }`)(t);try{return Function("$root",`with($root) { return (${e}); }`)(t)}catch{return`{{${e}}}`}};return M[e]?M[e]:e.trim().startsWith("t(")?(M[e]=o(),M[e]):o()}};b.Schema.registerCompiler(P.compile);let I=e=>{let{designable:t,onDesignableChange:o,components:n,children:r}=e,s=(0,a.useContext)(_.u),d=(0,f.M)(),[c,u]=(0,a.useState)(()=>(0,S.uid)()),p=(0,a.useMemo)(()=>e.form||(0,y.createForm)(),[c]),{t:m}=(0,i.useTranslation)(),h=(0,k.nm)(),x=(0,a.useMemo)(()=>({...e.scope,t:m,randomString:F}),[e.scope,m,null==d?void 0:d.scope]),[v,g]=(0,a.useState)(t),M=(0,a.useMemo)(()=>"boolean"==typeof t?t:v,[t,v,s.designable]),P=(0,a.useMemo)(()=>e=>{"boolean"!=typeof M&&g(e),null==o||o(e)},[M,o]);(0,a.useEffect)(()=>{let e=!1;return(async()=>{var t,o,l,n;if(!M)return await (null==(o=h.flowEngine)||null==(t=o.flowSettings)?void 0:t.disable());e||await (null==(n=h.flowEngine)||null==(l=n.flowSettings)?void 0:l.enable())})(),()=>{e=!0}},[h,M]);let I=(0,a.useCallback)(()=>{u((0,S.uid)())},[]),A=(0,a.useMemo)(()=>({scope:x,components:n,reset:I,refresh:C.default.noop,designable:M,setDesignable:P}),[n,M,I,x,P]);return(0,l.jsx)(_.u.Provider,{value:A,children:(0,l.jsx)(b.FormProvider,{form:p,children:(0,l.jsx)(f.t,{inherit:!0,scope:x,components:n,children:r})})})};I.displayName="SchemaComponentProvider";var A=o(83468);class T extends A.k{async load(){this.addComponents()}addComponents(){this.app.addComponents({DesignableSwitch:h})}}},16319(e,t,o){o.d(t,{Us:()=>g,TD:()=>n,F:()=>u.F,px:()=>i.px,QI:()=>i.QI,d1:()=>i.d1,xB:()=>h,YY:()=>f.Y,Lj:()=>y.Lj,er:()=>i.er,xZ:()=>a.x,OJ:()=>c,mh:()=>y.mh,lu:()=>r.l,kB:()=>i.kB,Hb:()=>s.H,a9:()=>y.a9,jE:()=>b.j});var l=o(51649);let n=e=>{let t=(0,l.useRef)(null);return(0,l.useEffect)(()=>(t.current&&e!==t.current&&t.current.onUnmount(),t.current=e,e.onMount(),()=>{e.onUnmount()}),[e]),e};var r=o(61013),a=o(57619),i=o(95951),s=o(87463),d=o(56920);let c=e=>{let t=(0,l.useContext)(d.SchemaOptionsContext),o=(0,l.useContext)(d.SchemaExpressionScopeContext),n=(0,l.useRef)();return n.current=o,e.toFieldProps({...t,get scope(){return{...t.scope,...n.current}}})};var u=o(39247),p=o(77843),m=o(43288);let h=()=>{var e;let{getCollectionJoinField:t,getCollection:o}=(0,m.nj)(),n=(0,d.useFieldSchema)(),{getField:r}=(0,m.k7)(),a=r(n.name)||t(n["x-collection-field"]),{t:i}=(0,p.useTranslation)(),{label:s}=(null==(e=n["x-component-props"])?void 0:e.fieldNames)||{};return(0,l.useMemo)(()=>{if(!a||!(null==a?void 0:a.interface)||!["o2o","oho","obo","o2m","linkTo","m2o","m2m"].includes(a.interface))return;let e=o(a.target);if((null==e?void 0:e.template)==="file")return[{label:i("Record picker"),value:"CollectionField"},{label:i("Select"),value:"AssociationSelect"}];switch(a.interface){case"o2m":return[{label:i("Record picker"),value:"CollectionField"},{label:i("Subtable"),value:"TableField"},{label:i("Select"),value:"AssociationSelect"}];case"m2o":case"m2m":case"linkTo":return[{label:i("Record picker"),value:"CollectionField"},{label:i("Select"),value:"AssociationSelect"}];default:return[{label:i("Record picker"),value:"CollectionField"},{label:i("Subform"),value:"FormField"},{label:i("Select"),value:"AssociationSelect"}]}},[i,null==a?void 0:a.interface,s])};var x=o(26174),v=o(49621);let g=()=>{var e;let t=(0,d.useField)(),o=(0,d.useFieldSchema)(),n=(0,v.Ge)(),a=(0,x.r2)(),i=(null==n?void 0:n.getField(o.name))||(null==a?void 0:a.getCollectionField(o["x-collection-field"])),s=(0,r.l)();(0,l.useEffect)(()=>{if(!(null==t?void 0:t.title)){var e;t.title=s(null==i||null==(e=i.uiSchema)?void 0:e.title)}},[null==i||null==(e=i.uiSchema)?void 0:e.title])};var f=o(4922),y=o(62152),b=o(81547)},62152(e,t,o){o.d(t,{Lj:()=>f,a9:()=>g,mh:()=>v});var l=o(56920),n=o(71883),r=o(52793),a=o(77583),i=o(51649),s=o(38356),d=o(95951),c=o(44374),u=o(73761),p=o(70892),m=o(38131);let h=e=>{let t=y((0,l.useFieldSchema)()),o=(e=>{let{token:t}=r.theme.useToken(),{designable:o}=(0,d.er)(),{heightProps:l}=(0,u.useBlockHeightProps)(),n=(0,s.useLocation)(),{disablePageHeader:a,enablePageTabs:i,hidePageTitle:c}=e||l||{},p=t.sizeXXL-2,m=o?t.controlHeight+2*t.paddingContentHorizontalLG:+t.paddingContentHorizontalLG;return p+(n.pathname.includes("/popups/")?2*t.paddingContentVertical+22+t.paddingPageVertical:a?t.paddingContentHorizontalLG:c?i?t.controlPaddingHorizontal+3*t.controlPaddingHorizontalSM+22+t.paddingContentHorizontalLG:t.paddingContentHorizontalLG+12:i?t.paddingSM+t.controlHeight+t.marginXS+2*t.controlPaddingHorizontalSM+22+t.paddingContentHorizontalLG:t.controlHeight+t.marginXS+(t.paddingContentVertical+2)*2+t.paddingContentHorizontalLG)+m})(e),n=(()=>{let{token:e}=r.theme.useToken(),{designable:t}=(0,d.er)();return e.paddingContentVerticalLG+e.margin+2*e.paddingContentVertical+24+(t?e.controlHeight+2*e.paddingContentHorizontalLG:+e.paddingContentHorizontalLG)})();return t?n:o},x=["workflowManualTasks","approvals","approvalRecords"],v=e=>{let{heightProps:t}=(0,u.useBlockHeightProps)(),o=h(),{heightMode:l,height:n,title:r,titleHeight:a}=t||{};if((null==t?void 0:t.heightMode)&&l!==m.D.DEFAULT){if(l===m.D.FULL_HEIGHT){let t=window.innerHeight-o;return(null==e?void 0:e.removeBlockHeaderHeight)&&(t-=r?a:0),(null==e?void 0:e.innerExtraHeight)&&(t-=e.innerExtraHeight),t}return n}},g=()=>{let e=(0,l.useFieldSchema)(),t=(0,i.useMemo)(()=>(0,u.getPageSchema)(e),[]),{disablePageHeader:o,enablePageTabs:n,hidePageTitle:r}=(null==t?void 0:t["x-component-props"])||{},a={...null==e?void 0:e["x-component-props"],disablePageHeader:o,enablePageTabs:n,hidePageTitle:r},s=h(a),{heightMode:d,height:c}=a||{};if((null==a?void 0:a.heightMode)&&d!==m.D.DEFAULT)return d===m.D.FULL_HEIGHT?window.innerHeight-s:c},f=()=>{let[e,t]=(0,i.useState)(),o=(0,i.useRef)(null),s=(()=>{var e;let{token:t}=r.theme.useToken(),{heightProps:o}=(0,u.useBlockHeightProps)(),{heightProps:n}=(0,p.El)(),{designable:a}=(0,d.er)(),i=(0,l.useFieldSchema)(),s=n||o,{titleHeight:v}=o,g=h(s),{name:f}=(0,c.useCollection)(),{heightMode:y,height:b,title:S}=s;if(!(null==s?void 0:s.heightMode)||y===m.D.DEFAULT)return;let C=Object.keys((null==(e=i.parent.properties.actions)?void 0:e.properties)||{}).length>0,_=t.controlHeight+t.padding+t.marginLG,k=C||a?t.controlHeight+2*t.marginLG:t.marginLG,F=(a&&!x.includes(f)?t.controlHeight:22)+2*t.padding+1,M=S?v:0;return y===m.D.FULL_HEIGHT?window.innerHeight-g-M-F-k-_:b-M-k-F-_})(),v=(0,i.useCallback)((0,a.debounce)(()=>{var e;if(!o.current)return;let l=o.current.getBoundingClientRect();(null==(e=o.current.querySelector(".ant-table"))?void 0:e.getBoundingClientRect())&&t(l.width)},100),[s]),g=(0,i.useCallback)(e=>{o.current=e&&e.children?e.children[0]:null,v()},[v]);return(0,n.useEventListener)("resize",v),{height:s,width:e,tableSizeRefCallback:g}},y=e=>{if(!e)return null;if("Action.Container"===e["x-component"]){var t,o;return(null==e||null==(o=e.parent)||null==(t=o["x-component-props"])?void 0:t.openMode)!=="page"}return y(e.parent)}},61013(e,t,o){o.d(t,{l:()=>a});var l=o(56920),n=o(51649);let r={},a=function(){let{noCache:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{noCache:!1},t=(0,n.useContext)(l.SchemaOptionsContext),o=(0,n.useContext)(l.SchemaExpressionScopeContext);return(a,i)=>{var s,d;let c,u=!1;if("string"==typeof a&&a.startsWith("{{")&&(u=!0,c=a),a&&"object"==typeof a&&!(0,n.isValidElement)(a)){try{c=JSON.stringify(a)}catch(e){return console.warn("Failed to stringify:",e),a}if(r[c])return r[c];s=c,u=/{{.*?}}/g.test(s)}if(Array.isArray(a)){try{c=JSON.stringify(a)}catch(e){return console.warn("Failed to stringify:",e),a}if(r[c])return r[c];d=c,u=/{{.*?}}/g.test(d)}if(u){let n={...null==t?void 0:t.scope,...o,...i};if(!c)return l.Schema.compile(a,n);try{if(e)return l.Schema.compile(a,n);return r[c]=r[c]||l.Schema.compile(a,n),r[c]}catch(e){return console.log("useCompile error",a,e),l.Schema.compile(a,n)}}return a}}},57619(e,t,o){o.d(t,{x:()=>a});var l=o(56920),n=o(77583),r=o(51649);let a=(e,t)=>{let{components:o}=(0,r.useContext)(l.SchemaOptionsContext);return e?"string"!=typeof e?e:(0,n.get)(o,e)||t:t}},95951(e,t,o){o.d(t,{er:()=>P,px:()=>y,QI:()=>M,d1:()=>F,kB:()=>_});var l=o(71178),n=o(56920),r=o(27404),a=o(71883),i=o(52793),s=o(13791),d=o(93656),c=o(20148),u=o(51649),p=o(77843),m=o(16211),h=o(30644),x=o(88448),v=o(63557),g=JSON.parse('{"rE":"2.1.0-beta.26"}'),f=o(13975);function y(e){return new F(e)}let b=e=>{e&&(e["x-uid"]||(e["x-uid"]=(0,r.uid)()),Object.keys(e.properties||{}).forEach(t=>{b(e.properties[t])}))},S=e=>e,C=(e,t)=>{if(e&&t){for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&t[o]!==(null==e?void 0:e[o]))return!1;return!0}},_=(e,t)=>{if(e["x-uid"]&&e["x-uid"]===t["x-uid"])return[null,e.toJSON()];let o=e.toJSON(),l={...o,properties:{}},n=null,r=(e,o)=>{Object.keys(e||{}).forEach(l=>{let a=e[l];if(a["x-uid"]===t["x-uid"]){n=e[l];return}o.properties[l]={...a,properties:{}},r(null==a?void 0:a.properties,o.properties[l])})};return r(o.properties,l),[l,n]},k=e=>e;class F{get model(){return this.options.model}get query(){return this.options.query}loadAPIClientEvents(){let{api:e,t=k}=this.options;if(!e)return;let o=e=>{if(!e)return[];let t=Object.values(e.properties).length,o=[];return(e.mapProperties(e=>{e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].width=100/t,e["x-uid"]&&o.push({"x-uid":e["x-uid"],"x-component-props":e["x-component-props"]})}),e["x-uid"]&&o.length)?o:[]};this.on("insertAdjacent",async l=>{var n;let{onSuccess:r,current:a,position:s,schema:d,wrap:c,wrapped:u,removed:p}=l,m=[];if((null==u?void 0:u["x-component"])==="Grid.Col"&&(m=m.concat(o(u.parent))),(null==p?void 0:p["x-component"])==="Grid.Col"&&(m=m.concat(o(p.parent))),this.refresh(),!a["x-uid"])return;let h=await e.request({url:`/uiSchemas:insertAdjacent/${a["x-uid"]}?position=${s}`,method:"post",data:{schema:function e(t,o){if(t)return t["x-app-version"]||(t["x-app-version"]=o),Object.keys(t.properties||{}).forEach(l=>{var n;e(null==(n=t.properties)?void 0:n[l],o)}),t}(d,this.appVersion),wrap:c}});m.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:m}),(null==p?void 0:p["x-uid"])&&await e.request({url:`/uiSchemas:remove/${p["x-uid"]}`,method:"post"}),null==r||r(null==h||null==(n=h.data)?void 0:n.data),i.message.success(t("Saved successfully"),.2)}),this.on("patch",async o=>{let{schema:l}=o;this.refresh(),(null==l?void 0:l["x-uid"])&&(await e.request({url:"/uiSchemas:patch",method:"post",data:{...l}}),i.message.success(t("Saved successfully"),.2))}),this.on("initializeActionContext",async t=>{let{schema:o}=t;(null==o?void 0:o["x-uid"])&&await e.request({url:"/uiSchemas:initializeActionContext",method:"post",data:{...o}})}),this.on("batchPatch",async o=>{let{schemas:l}=o;this.refresh(),await e.request({url:"/uiSchemas:batchPatch",method:"post",data:l}),i.message.success(t("Saved successfully"),.2)}),this.on("remove",async l=>{let{removed:n}=l,r=[];(null==n?void 0:n["x-component"])==="Grid.Col"&&(r=o(n.parent)),this.refresh(),(null==n?void 0:n["x-uid"])&&(await e.request({url:`/uiSchemas:remove/${n["x-uid"]}`,method:"post"}),r.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:r}),i.message.success(t("Saved successfully"),.2))})}prepareProperty(e){e.type||(e.type="void"),e.name||(e.name=(0,r.uid)()),this.current["x-uid"]&&b(e)}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}async emit(e){for(var t=arguments.length,o=Array(t>1?t-1:0),l=1;l<t;l++)o[l-1]=arguments[l];if(!this.events[e])return;let[n,...r]=o;return Promise.all(this.events[e].map(e=>e.bind(this)({current:this.current,...n},...r)))}parentsIn(e){if(!e||!n.Schema.isSchemaInstance(e))return!1;let t=this.current;for(;null==t?void 0:t.parent;){if(t.parent===e)return!0;t=t.parent}return!1}refresh(e){let{refresh:t}=this.options;return null==t?void 0:t(e)}deepMerge(e){let t={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly"},o={"x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(l=>{t[l]?(this.current[l]=e[l],this.updateModel(t[l],e[l])):o[l]?Object.keys(e[l]).forEach(t=>{(0,c.default)(this.current,[l,t],e[l][t]),this.updateModel([o[l],t],e[l][t])}):this.current[l]=e[l]}),this.emit("patch",{schema:e})}getSchemaAttribute(e,t){return(0,d.default)(this.current,e,t)}shallowMerge(e){let t={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly","x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(o=>{this.current[o]=e[o],t[o]&&this.updateModel(t[o],e[o])}),this.emit("patch",{schema:e})}updateModel(e,t){let o=o=>{(0,c.default)(o,e,t)};this.model&&o(this.model),this.query&&this.query.take(o)}insertAdjacent(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};switch(e){case"beforeBegin":return this.insertBeforeBegin(t,o);case"afterBegin":return this.insertAfterBegin(t,o);case"beforeEnd":return this.insertBeforeEnd(t,o);case"afterEnd":return this.insertAfterEnd(t,o)}}recursiveRemoveIfNoChildren(e,t){let o;if(!e)return;let l=e,n=null==t?void 0:t.breakRemoveOn;for(;l;){if("function"==typeof n){if(n(l))break}else if(C(l,n))break;if(Object.keys(l.properties||{}).length>0)break;l.parent&&(o=l.parent.removeProperty(l.name)),l=l.parent}return o}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:o,removeParentsIfNoChildren:l}=t,n=e||this.current,r=n.parent.removeProperty(n.name);if(l){let e=this.recursiveRemoveIfNoChildren(n.parent,{breakRemoveOn:o});e&&(r=e)}return this.emit("remove",{removed:r})}removeWithoutEmit(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:o,removeParentsIfNoChildren:l}=t,n=e||this.current,r=n.parent.removeProperty(n.name);if(l){let e=this.recursiveRemoveIfNoChildren(n.parent,{breakRemoveOn:o});e&&(r=e)}return r}insertBeforeBeginOrAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current)||!n.Schema.isSchemaInstance(e)||this.current.parent!==e.parent)return;let o=0,l=0;return this.current.parent.mapProperties((t,n,r)=>{this.current.name===n&&(l=r),e.name===n&&(o=r)}),o>l?this.insertBeforeBegin(e,t):this.insertAfterEnd(e,t)}insertBeforeBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current))return;let o={onSuccess:t.onSuccess},{wrap:l=S,breakRemoveOn:a,removeParentsIfNoChildren:i}=t;if(n.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),i&&(o.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:a}))}else e&&(e=(0,s.default)(e));let d={},c=!1,u=0,p=0;this.current.parent.mapProperties((e,t)=>{t===this.current.name&&(p=u,c=!0,++u),e["x-index"]=u,++u,c&&(d[t]=e,this.current.parent.removeProperty(t))}),this.prepareProperty(e);let m=l(e),h=this.current.parent.addProperty(m.name||(0,r.uid)(),m);h["x-index"]=p,h.parent=this.current.parent,this.current.parent.setProperties(d);let[x,v]=_(h,e);this.emit("insertAdjacent",{position:"beforeBegin",schema:v,wrapped:m,wrap:x,...o})}insertAfterBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current))return;let o={onSuccess:t.onSuccess},{wrap:l=S,breakRemoveOn:a,removeParentsIfNoChildren:i}=t;if(n.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),i&&(o.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:a}))}else e&&(e=(0,s.default)(e));let d={},c=1;this.current.mapProperties((e,t)=>{e["x-index"]=c,++c,d[t]=e}),this.current.properties={},this.prepareProperty(e);let u=l(e),p=this.current.addProperty(u.name||(0,r.uid)(),u);p["x-index"]=0,p.parent=this.current,this.current.setProperties(d);let[m,h]=_(p,e);this.emit("insertAdjacent",{position:"afterBegin",schema:h,wrap:m,wrapped:u,...o})}insertBeforeEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current))return;delete e["x-index"];let o={onSuccess:t.onSuccess},{wrap:l=S,breakRemoveOn:a,removeParentsIfNoChildren:i}=t;if(n.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),i&&(o.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:a}))}else e&&(e=(0,s.default)(e));this.prepareProperty(e);let d=l(e),c=this.current.addProperty(d.name||(0,r.uid)(),d);c.parent=this.current;let[u,p]=_(c,e);return this.emit("insertAdjacent",{position:"beforeEnd",schema:p,wrap:u,wrapped:d,...o})}insertAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current))return;let o={onSuccess:null==t?void 0:t.onSuccess},{wrap:l=S,breakRemoveOn:a,removeParentsIfNoChildren:i}=t,d=0,c=0,u=!1,p={};if(this.current.parent.mapProperties((e,t)=>{e["x-index"]=d,t===this.current.name&&(c=++d,u=!0),++d,u&&t!==this.current.name&&(p[t]=e,this.current.parent.removeProperty(t))}),n.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),i&&(o.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:a})),e.parent=null}else e&&(e=(0,s.default)(e));this.prepareProperty(e);let m=l(e),h=this.current.parent.addProperty(m.name||(0,r.uid)(),m);h.parent=this.current.parent,h["x-index"]=c,this.current.parent.setProperties(p);let[x,v]=_(h,e);this.emit("insertAdjacent",{position:"afterEnd",schema:v,wrap:x,wrapped:m,...o})}constructor(e){this.events={},this.options=e,this.current=e.current,this.appVersion=e.appVersion}}function M(){let e=(0,u.useContext)(n.SchemaOptionsContext),t=(0,u.useMemo)(()=>(null==e?void 0:e.components)||{},[e]);return e=>{if(!e)return null;if("string"!=typeof e)return e;let o=(0,d.default)(t,e);return o||console.error(`[nocobase]: Component "${e}" not found`),o}}function P(){let{designable:e,setDesignable:t,refresh:o,reset:r}=(0,u.useContext)(v.u),i=(0,u.useContext)(n.SchemaOptionsContext),s=(0,u.useMemo)(()=>(null==i?void 0:i.components)||{},[i]),b=(0,u.useMemo)(()=>()=>(0,l.jsx)(l.Fragment,{}),[]),S=(0,a.useUpdate)(),C=(0,h.o8)(),_=(0,h.cQ)(),k=(0,u.useCallback)(e=>{null==o||o(),S(),null==C||C(e),null==_||_()},[o,S,C,_]),F=(0,n.useField)(),M=(0,n.useFieldSchema)(),P=(0,m.VB)(),{t:I}=(0,p.useTranslation)(),A=(0,u.useMemo)(()=>y({t:I,api:P,refresh:k,current:M,model:F,appVersion:g.rE}),[I,P,k,M,F]);(0,u.useEffect)(()=>{A.loadAPIClientEvents()},[A]);let{isMobileLayout:T}=(0,f.useMobileLayout)();return{dn:A,designable:!T&&e,reset:r,refresh:k,setDesignable:t,DesignableBar:b,findComponent:(0,u.useCallback)(e=>{if(!e)return null;if("string"!=typeof e)return e;let t=(0,d.default)(s,e);return(null==t?void 0:t[x.PE])??t},[d.default]),on:A.on.bind(A),patch:(0,u.useCallback)((e,t)=>{let o=e=>{Object.keys(e).forEach(t=>{let o=e[t];"title"===t&&(F.title=o,M.title=o),"x-decorator-props"===t&&(F.decoratorProps||(F.decoratorProps={}),M["x-decorator-props"]||(M["x-decorator-props"]={}),Object.keys(o).forEach(e=>{F.decoratorProps[e]=o[e],M["x-decorator-props"][e]=o[e]})),"x-component-props"===t&&(F.componentProps||(F.componentProps={}),M["x-component-props"]||(M["x-component-props"]={}),Object.keys(o).forEach(e=>{F.componentProps[e]=o[e],M["x-component-props"][e]=o[e]}))})};if("string"==typeof e){let l={};return(0,c.default)(l,e,t),o(l)}o(e),k()},[A]),shallowMerge:(0,u.useCallback)(e=>{A.shallowMerge(e)},[A]),deepMerge:(0,u.useCallback)(e=>{A.deepMerge(e)},[A]),remove:(0,u.useCallback)((e,t)=>{A.remove(e,t)},[A]),insertAdjacent:(0,u.useCallback)((e,t,o)=>{A.insertAdjacent(e,t,o)},[A]),insertBeforeBegin:(0,u.useCallback)(e=>{A.insertBeforeBegin(e)},[A]),insertAfterBegin:(0,u.useCallback)(e=>{A.insertAfterBegin(e)},[A]),insertBeforeEnd:(0,u.useCallback)(e=>{A.insertBeforeEnd(e)},[A]),insertAfterEnd:(0,u.useCallback)(e=>{A.insertAfterEnd(e)},[A])}}},87463(e,t,o){o.d(t,{H:()=>d});var l=o(56920),n=o(51649),r=o(99300),a=o(57619),i=o(95951);let s=()=>null;s.isNullComponent=!0;let d=()=>{let{designable:e}=(0,i.er)(),t=(0,l.useFieldSchema)(),o=(0,n.useMemo)(()=>t["x-designer"]||t["x-toolbar"]?t["x-designer"]||t["x-toolbar"]:t["x-settings"]?r.Bw:s,[t]),d=(0,a.x)(o);return e&&d||s}},81547(e,t,o){o.d(t,{j:()=>i});var l=o(56920),n=o(51649),r=o(77843),a=o(43288);let i=e=>{var t;let{t:o}=(0,r.useTranslation)(),{getCollectionJoinField:i,getCollection:s}=(0,a.nj)(),d=(0,l.useFieldSchema)(),c=(null==e?void 0:e.fieldSchema)||d,u=(0,l.useField)(),p=(0,l.useForm)(),m=(null==c?void 0:c["x-read-pretty"])||u.readPretty||p.readPretty,h=null==e?void 0:e.fieldSchema,{getField:x}=(0,a.k7)(),v=(null==e?void 0:e.collectionField)||x(c.name)||i(c["x-collection-field"]),{label:g}=(null==(t=c["x-component-props"])?void 0:t.fieldNames)||{};return((0,n.useMemo)(()=>{if(!v||!(null==v?void 0:v.interface)||!["hasOne","hasMany","belongsTo","belongsToMany","belongsToArray"].includes(v.type))return;let e=s(v.target);if((null==e?void 0:e.template)==="file")return m?[{label:o("Title"),value:"Select"},{label:o("File manager"),value:"FileManager"},{label:o("Tag"),value:"Tag"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},{label:o("File manager"),value:"FileManager"}];if((null==e?void 0:e.template)==="tree"&&["m2m","o2m","m2o"].includes(v.interface))return m?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!h&&{label:o("Sub-details"),value:"Nester"},!h&&{label:o("Sub-table"),value:"SubTable"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!h&&["m2m","o2m"].includes(v.interface)&&{label:o("Sub-table"),value:"SubTable"},!h&&{label:o("Cascader Select"),value:"CascadeSelect"},!h&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];switch(v.interface){case"o2m":return m?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!h&&{label:o("Sub-table"),value:"SubTable"},!h&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!h&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"},!h&&{label:o("Sub-table"),value:"SubTable"}];case"m2m":case"mbm":return m?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!h&&{label:o("Sub-details"),value:"Nester"},!h&&{label:o("Sub-table"),value:"SubTable"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!h&&{label:o("Sub-table"),value:"SubTable"},!h&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];default:return m?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!h&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!h&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}]}},[o,null==v?void 0:v.interface,g,m,h])||[]).filter(Boolean)}},4922(e,t,o){o.d(t,{Y:()=>n});let l=()=>({}),n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{useProps:t=l,...o}=e,n=t;"function"!=typeof t&&(n=l);let r=n();return{...o,...r}}},39247(e,t,o){o.d(t,{F:()=>r});var l=o(51649),n=o(63557);function r(){return(0,l.useContext)(n.u)}},82924(e,t,o){o.d(t,{iI7:()=>D.iI,a1G:()=>c.ShowFormData,yt2:()=>tm.yt,flR:()=>a.fl,FVw:()=>nW.FV,FrL:()=>nh.Fr,CqQ:()=>L,$Eq:()=>j,ZB7:()=>nW.ZB,TrS:()=>tm.Tr,sIN:()=>aS.sI,a2g:()=>c.getRenderContent,t6u:()=>u.t6,qIn:()=>lX.qI,HPy:()=>a.HP,R_2:()=>lW.R_,doK:()=>D.do,bZ4:()=>a.bZ,pxY:()=>ec.px,pde:()=>lW.pd,CEt:()=>nh.CE,lum:()=>ec.lu,OpO:()=>u.Op,tO8:()=>a.tO,nxV:()=>nh.nx,TDj:()=>tU,xA9:()=>nW.xA,lNE:()=>rB.l,ud$:()=>e5,l46:()=>np,X_:()=>c.DraggableContext,QD_:()=>nh.QD,ud1:()=>a.ud,Dgp:()=>D.Dg,tvd:()=>D.tv,QEB:()=>rY,X6x:()=>rF.X6,jZb:()=>tY,tn0:()=>lX.tn,dF1:()=>ot.dF,kBD:()=>ec.kB,Gjn:()=>a.Gj,VFg:()=>rF.VF,Pnr:()=>nh.Pn,zN:()=>a.zN,dKS:()=>rP,LMh:()=>lW.LM,lTd:()=>eF,rlt:()=>eI,dWC:()=>th.dW,cWk:()=>a.cW,Zy6:()=>tm.Zy,PB5:()=>rz.PB,UTu:()=>nh.UT,jeY:()=>D.je,TB2:()=>a.TB,D6h:()=>nG,d9b:()=>ot.d9,fM:()=>tz,X43:()=>tH.X,uc_:()=>nT,pEl:()=>rz.pE,T$Q:()=>tH.T,GD6:()=>u.GD,mJi:()=>lW.mJ,C5g:()=>tV.C5,OJX:()=>ec.OJ,Bmi:()=>aa,u4V:()=>aE.u,lrV:()=>nh.lr,fDF:()=>r.fD,N$k:()=>e1.N$,_sT:()=>ot._s,rNg:()=>tO.rN,RhU:()=>a.Rh,Bnf:()=>oV,UyB:()=>e2,xq$:()=>D.xq,RB3:()=>rz.RB,I5x:()=>eP,hqJ:()=>lW.hq,XIK:()=>r7,m2w:()=>lz,ccy:()=>aN,NVg:()=>tV.NV,kDr:()=>D.kD,J3t:()=>th.J3,d09:()=>a.d0,AG:()=>ag,Xjr:()=>oU,uwA:()=>e1.uw,KDQ:()=>em,$mi:()=>oT.$,L1H:()=>c.Sortable,QoO:()=>nh.Qo,q7s:()=>D.q7,Mp5:()=>c.DndContext,xB5:()=>ec.xB,B4G:()=>D.B4,YIz:()=>rc,$xS:()=>rq,o8F:()=>oH,qKt:()=>rz.qK,_OO:()=>ot._O,qy$:()=>no,W1t:()=>tm.W1,Z0V:()=>lX.Z0,cGx:()=>nv,Q2z:()=>nh.Q2,YW0:()=>tM,HvB:()=>u.Hv,ic7:()=>nU,QpY:()=>D.Qp,tUM:()=>am,oAT:()=>D.oA,zBI:()=>e6,gBz:()=>c.SortableProvider,eIh:()=>D.eI,i_r:()=>nY.i,DVX:()=>D.DV,b7u:()=>e1.b7,Mwt:()=>rz.Mw,Kql:()=>a.Kq,XOn:()=>D.XO,ozN:()=>rk.o,nu1:()=>tp.n,rTt:()=>aS.rT,eBw:()=>nK,xZI:()=>ec.xZ,MIq:()=>a.MI,JaO:()=>nz,htN:()=>eN,Eaz:()=>a.E,qy5:()=>nd,IX0:()=>tO.IX,lSn:()=>tV.lS,BsJ:()=>e1.Bs,_22:()=>rL,sxL:()=>oC,xPi:()=>tp.x,b2W:()=>nO.b,sDQ:()=>r$,Xzy:()=>D.Xz,gt0:()=>rE,QIX:()=>e4,i_F:()=>lK,Ypd:()=>a.Yp,SOm:()=>e1.SO,VXI:()=>a.VX,nKd:()=>tR,N3p:()=>u.N3,dJT:()=>e1.dJ,vPC:()=>D.vP,a97:()=>ec.a9,TNL:()=>D.TN,xAQ:()=>tF,Qgm:()=>rF.Qg,RLS:()=>rn,OqW:()=>e1.Oq,j0_:()=>n_,zVE:()=>ab,yVm:()=>a.yV,B_g:()=>nx,Hbp:()=>ec.Hb,lhV:()=>D.lh,yGk:()=>e1.yG,QIi:()=>ec.QI,Q00:()=>rM,OAH:()=>u.OA,JQe:()=>D.JQ,xqq:()=>a.xq,zEg:()=>e7.z,wN6:()=>rk.w,fDM:()=>nh.fD,uUT:()=>tq,BCL:()=>r3.BC,D50:()=>a.D5,Fag:()=>ec.F,MoU:()=>a.Mo,wnJ:()=>e1.wn,ISS:()=>rF.IS,m$h:()=>t1,c_d:()=>e1.c_,Hi5:()=>ad,x1p:()=>nh.x1,DYS:()=>u.DY,U6o:()=>a.U6,LjE:()=>ec.Lj,l2i:()=>a.l2,Um:()=>e1.Um,Y2j:()=>tP,O$4:()=>rz.O$,G2C:()=>t7.G2,wA7:()=>aI,$t1:()=>D.$t,_bM:()=>ot._b,b6K:()=>oT.b,vzL:()=>nt,lNX:()=>ot.lN,rcl:()=>a.rc,gZ:()=>rz.gZ,msY:()=>nh.ms,U8O:()=>a.U8,Sh8:()=>a.Sh,mhY:()=>ec.mh,tXY:()=>tV.tX,Sc0:()=>oF,p9h:()=>as,gBZ:()=>c.SortableContext,JDj:()=>av,hbv:()=>nm,RD4:()=>n$.R,bee:()=>rz.be,PSc:()=>a.PS,hsK:()=>e7.h,oVU:()=>l5,IJ7:()=>D.IJ,f2z:()=>oQ.f,OZ6:()=>rF.OZ,pA3:()=>e1.pA,$5j:()=>a.$5,J1:()=>D.J1,dVP:()=>c.DateFilterDynamicComponent,E76:()=>a.E7,j9R:()=>lJ,vjx:()=>nj,mz8:()=>nW.mz,Doh:()=>u.Do,vxQ:()=>l9,Us6:()=>ec.Us,UqM:()=>c.SortableItem,lVW:()=>T,f7I:()=>ay,ARu:()=>t0,TDH:()=>ec.TD,l6P:()=>eC,g9w:()=>e1.g9,s23:()=>tL,GjU:()=>a.nY,GmQ:()=>rz.Gm,skP:()=>na,C4D:()=>nn,arW:()=>ra,v93:()=>ar,Wis:()=>a.Wi,jE9:()=>ec.jE,dbD:()=>nR.d,Ff5:()=>D.Ff,gM2:()=>e1.gM,FZR:()=>lW.FZ,PnP:()=>aC.P,nlx:()=>eM,AQf:()=>lX.AQ,FoY:()=>rN,w2W:()=>rz.w2,z45:()=>a.z4,bkX:()=>tG,jgC:()=>an,Ur4:()=>aM,lE3:()=>D.lE,U5u:()=>D.U5,LtX:()=>a.Lt,cl6:()=>rx,d1R:()=>ec.d1,rrz:()=>th.rr,B8B:()=>r_,hY7:()=>oQ.h,Ob5:()=>tm.Ob,erX:()=>ec.er,MqW:()=>u.Mq,S5r:()=>nO.S,YYe:()=>ec.YY,ami:()=>aS.am,LBS:()=>nV,L3t:()=>c.DragHandler,oMF:()=>eh});var l,n={};o.r(n),o.d(n,{Action:()=>a.rc,ActionBar:()=>a.E7,ActionBarProvider:()=>a.xq,ActionContext:()=>a.yV,ActionContextNoRerender:()=>a.Wi,ActionContextProvider:()=>a.z4,ActionDesigner:()=>a.U6,AfterSuccess:()=>a.Kq,AllDataBlocksContext:()=>th.rr,AllDataBlocksProvider:()=>th.J3,AntdSchemaComponentPlugin:()=>tG,AntdSchemaComponentProvider:()=>tU,AppendsTreeSelect:()=>t1,AssignedFieldValues:()=>a.TB,AssociationField:()=>lz,AssociationFieldMode:()=>oV,AssociationFieldModeProvider:()=>oH,AssociationSelect:()=>lK,AttachmentList:()=>ot._s,AutoComplete:()=>lJ,BackButtonUsedInSubPage:()=>e7.h,Block:()=>nK,BlockItem:()=>lX.Z0,BlockItemCard:()=>lX.tn,BlockItemCardContext:()=>lX.AQ,BlocksSelector:()=>a.Gj,ButtonEditor:()=>a.Yp,CardItem:()=>l5,Cascader:()=>l9,Checkbox:()=>oF,CollectionSelect:()=>nt,ColorPicker:()=>na,ColorSelect:()=>nd,Cron:()=>np,CronSet:()=>nm,DataSourceCollectionCascader:()=>nn,DataSourceSelect:()=>no,DateFormatCom:()=>nO.b,DatePicker:()=>nh.lr,DatePickerProvider:()=>nh.Qo,Details:()=>nx,DetailsDesigner:()=>L,Divider:()=>nv,EditComponent:()=>D.iI,EditDefaultValue:()=>D.tv,EditDescription:()=>D.JQ,EditOperator:()=>D.B4,EditPattern:()=>D.$t,EditRequired:()=>D.Qp,EditSortField:()=>an,EditTable:()=>n_,EditTableAction:()=>nj,EditTableActionContext:()=>nT,EditTitle:()=>D.Xz,EditTitleField:()=>D.Ff,EditTooltip:()=>D.IJ,EditValidationRules:()=>D.vP,Editable:()=>rN,EllipsisWithTooltip:()=>lW.R_,ErrorFallback:()=>tp.x,Expand:()=>nz,ExpiresRadio:()=>nO.S,FieldsTreeSelect:()=>t0,Fieldset:()=>nV,Filter:()=>e1.dJ,FilterAction:()=>e1.Bs,FilterActionContext:()=>e1.SO,FilterContext:()=>e1.gM,FilterDynamicComponent:()=>e1.N$,FilterLogicContext:()=>e1.c_,Form:()=>T,FormDialog:()=>n$.R,FormDrawer:()=>aI,FormField:()=>e6,FormItem:()=>D.eI,FormV2:()=>eN,G2Plot:()=>nG,G2PlotRenderer:()=>nU,Grid:()=>nW.xA,GridCard:()=>rn,GridRowContext:()=>nW.mz,HTMLEncode:()=>lW.mJ,ICON_POPUP_Z_INDEX:()=>oT.b,IconPicker:()=>ra,Input:()=>lW.pd,InputNumber:()=>rc,InputReadPretty:()=>lW.FZ,InputRecordPicker:()=>rz.qK,Json:()=>lW.LM,LinkageFilter:()=>aN,List:()=>r_,Markdown:()=>rk.o,MarkdownReadPretty:()=>rk.w,Menu:()=>tm.W1,NanoIDInput:()=>rM,Page:()=>tM,PagePopups:()=>tO.rN,PageTabs:()=>tP,Pagination:()=>rP,ParentRouteContext:()=>tm.Zy,Password:()=>rL,Percent:()=>rY,PopupSettingsProvider:()=>tH.T,Preview:()=>rB.l,QuickEdit:()=>rE,Radio:()=>oC,ReadPretty:()=>lW.hq,ReadPrettyRecordPicker:()=>rz.w2,RecordPicker:()=>rz.O$,RecordPickerContext:()=>rz.pE,RecordPickerProvider:()=>rz.be,RefreshDataBlockRequest:()=>a.ud,RemoteSelect:()=>eF,RemoveButton:()=>a.d0,RemoveConditionContext:()=>e1.b7,RequestSettings:()=>a.Rh,RichText:()=>r$,SecondConFirm:()=>a.VX,Select:()=>eC,SkipValidation:()=>a.zN,Space:()=>rq,StablePopover:()=>oT.$,Table:()=>r7,TableBlockDesigner:()=>ar,TableField:()=>aa,TableSelectorDesigner:()=>as,TableV2:()=>ad,Tabs:()=>am,TabsContextProvider:()=>oQ.h,Templates:()=>eP,TestDesigner:()=>lX.qI,TextAreaWithGlobalScope:()=>aM,TimePicker:()=>ag,TreeSelect:()=>ay,UnixTimestamp:()=>ab,Upload:()=>ot._O,Uploader:()=>ot.d9,Variable:()=>aS.rT,VariableScopeProvider:()=>aS.sI,VariableSelect:()=>aC.P,actionSettings:()=>a.Sh,actionSettingsItems:()=>a.Mo,allowAddNew:()=>D.lE,attachmentFileTypes:()=>ot.lN,defaultFieldNames:()=>em,fetchTemplateData:()=>eI,filterFormItemSettings:()=>D.Dg,findByUid:()=>rF.X6,findKeysByUid:()=>rF.VF,findMenuItem:()=>rF.OZ,formDetailsSettings:()=>e4,formItemSettings:()=>D.DV,formSettings:()=>e2,formV1Settings:()=>j,genStyleHook:()=>r.fD,getCurrentOptions:()=>eh,getDateExact:()=>nh.Q2,getDatePickerLabels:()=>rz.Mw,getDateRanges:()=>nh.fD,getLabelFormatValue:()=>rz.PB,getPopupPathFromParams:()=>tV.C5,getStoredPopupContext:()=>tV.lS,getTabSchema:()=>tY,getZIndex:()=>a.fl,handleDateChangeOnForm:()=>nh.QD,inferPickerType:()=>nh.Pn,isBulkEditAction:()=>a.PS,isFileCollection:()=>D.XO,isMobile:()=>nh.Fr,isShowFilePicker:()=>rz.Gm,isTabPage:()=>tR,isWriteEmailAction:()=>a.cW,mapDatePicker:()=>nh.x1,mapRangePicker:()=>nh.UT,mapTimeFormat:()=>av,matchMimetype:()=>ot._b,moment2str:()=>nh.ms,navigateToTab:()=>tL,pageSettings:()=>tz,pageTabSettings:()=>tq,readPrettyFormSettings:()=>e5,removeNullCondition:()=>e1.pA,resolveFilterPickerFormat:()=>nh.CE,storePopupContext:()=>tV.NV,useActionBarContext:()=>a.MI,useActionContext:()=>a.D5,useAfterSuccessOptions:()=>a.bZ,useAllDataBlocks:()=>th.dW,useAssociationFieldContext:()=>t7.G2,useAssociationFieldModeContext:()=>oU,useBackButton:()=>e7.z,useCloseAction:()=>a.nY,useColumnSchema:()=>r3.BC,useColumnSettings:()=>nR.d,useCurrentPopupContext:()=>tO.IX,useDatePickerContext:()=>nh.nx,useDownloadLogs:()=>tp.n,useEnsureOperatorsValid:()=>D.lh,useFieldMode:()=>D.J1,useFieldNames:()=>rz.gZ,useFilterActionProps:()=>e1.Um,useFilterFieldOptions:()=>e1.g9,useFilterFieldProps:()=>e1.yG,useFilterOptions:()=>e1.uw,useFormDataTemplates:()=>eM,useGetAriaLabelOfAction:()=>a.U8,useGetAriaLabelOfDrawer:()=>a.HP,useGetAriaLabelOfModal:()=>a.tO,useGetAriaLabelOfPopover:()=>a.l2,useGetFilterFieldOptions:()=>e1.Oq,useGetFilterOptions:()=>e1.wn,useGridContext:()=>nW.ZB,useGridRowContext:()=>nW.FV,useIsAddNewForm:()=>D.TN,useIsAssociationField:()=>D.xq,useIsFieldReadPretty:()=>D.U5,useIsFileField:()=>D.oA,useIsFormReadPretty:()=>D.q7,useIsSelectFieldMode:()=>D.je,useKeepAliveLocationSearch:()=>tF,useLabelUiSchema:()=>rz.RB,useLinkageAction:()=>a.Lt,useListBlockContext:()=>rx,useMenuDragEnd:()=>tm.yt,useMenuTranslation:()=>rF.Qg,useNocoBaseRoutes:()=>tm.Ob,useParentRoute:()=>tm.Tr,usePopupSettings:()=>tH.X,useStyles:()=>rF.IS,useTableColumnIntegration:()=>nY.i,useTabsContext:()=>oQ.f,useTitleFieldOptions:()=>D.kD,useUploadStyles:()=>ot.dF,useValidateSchema:()=>D.do,useVariableScope:()=>aS.am,useZIndexContext:()=>a.$5,withSearchParams:()=>tV.tX,zIndexContext:()=>a.E});var r=o(54969),a=o(78562),i=o(71178),s=o(51649),d=o(83468),c=o(91032),u=o(90995),p=o(72548);let m=e=>async function(){try{var t;let o=await this.api.request(e);return null==o||null==(t=o.data)?void 0:t.data}catch(e){return[]}};var h=o(56220),x=o(44814),v=o(56920),g=o(52793),f=o(16211),y=o(43288),b=o(30644),S=o(99300),C=o(25952),_=o(96932),k=o(24768);let F=e=>{let{form:t,children:o,...l}=e,n=(0,v.useField)(),r=(0,v.useFieldSchema)(),a=(0,ec.TD)(t.createVoidField({...n.props,basePath:""}));return(0,i.jsx)(v.FieldContext.Provider,{value:void 0,children:(0,i.jsx)(v.FormContext.Provider,{value:t,children:(0,i.jsx)(h.FormLayout,{layout:"vertical",...l,children:(0,i.jsx)(b.dw,{basePath:a.address,schema:r,onlyRenderProperties:!0})})})})},M=e=>e.children,P=e=>{let{form:t,children:o,disabled:l,...n}=e,r=(0,v.useField)(),a=(0,v.useFieldSchema)(),d=(0,ec.TD)(t.createVoidField({...r.props,basePath:""})),c=(0,ec.xZ)(a["x-component"],M);return(0,s.useEffect)(()=>{t.disabled=l||r.disabled},[l,r.disabled]),(0,i.jsx)(g.ConfigProvider,{componentDisabled:l,children:(0,i.jsx)(v.FieldContext.Provider,{value:void 0,children:(0,i.jsx)(v.FormContext.Provider,{value:t,children:(0,i.jsx)(h.FormLayout,{layout:"vertical",...n,children:(0,i.jsx)(v.FieldContext.Provider,{value:d,children:(0,i.jsx)(c,{...r.componentProps,children:(0,i.jsx)(b.dw,{basePath:d.address,schema:a,onlyRenderProperties:!0})})})})})})})},I=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,f.bP)((e=>{let{request:t,initialValue:o}=e;return t||(()=>Promise.resolve({data:o}))})(t),e)},A=(0,s.createContext)(null);A.displayName="FormBlockContext";let T=(0,v.observer)(e=>{let{request:t,effects:o,initialValue:l,useValues:n=I,...r}=e,a=(0,v.useFieldSchema)(),d=(0,v.useField)(),c=(0,s.useMemo)(()=>(0,x.createForm)({effects:o}),[]),u=n({uid:a["x-uid"],async onSuccess(e){await c.reset(),c.setValues(null==e?void 0:e.data),c.setInitialValues(null==e?void 0:e.data)}},e),p=(0,s.useContext)(A);return(0,i.jsx)(A.Provider,{value:{parent:p,form:c,result:u,field:d,fieldSchema:a},children:(0,i.jsx)(g.Spin,{spinning:(null==u?void 0:u.loading)||!1,children:"Form"===a["x-decorator"]?(0,i.jsx)(P,{form:c,...r}):(0,i.jsx)(F,{form:c,...r})})})},{displayName:"Form"});T.Designer=function(){let{name:e,title:t}=(0,y.k7)(),o=(0,_.D$)(),{componentNamePrefix:l}=(0,k.kU)();return(0,i.jsxs)(S.xK,{template:o,title:t||e,children:[(0,i.jsx)(C.l,{componentName:`${l}Form`,collectionName:e}),(0,i.jsx)(S.kT,{}),(0,i.jsx)(S.d$,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})};var w=o(31675);let j=new w.RT({name:"FormV1Settings",items:[{name:"template",Component:C.l,useComponentProps(){let{name:e}=(0,y.k7)(),{componentNamePrefix:t}=(0,k.kU)();return{componentName:`${t}Form`,collectionName:e}}},{name:"divider",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]});var D=o(60929);let L=()=>{let{name:e,title:t}=(0,y.k7)(),o=(0,_.D$)();return(0,i.jsx)(S.xK,{schemaSettings:"FormDetailsSettings",template:o,title:t||e})};var R=o(69412),Y=o(80461),B=o(99847),N=o(49948),E=o(10691),z=o(27404),O=o(77583),V=o(20629),$=o(18111),q=o(70136),H=o(28227),U=o(14187),G=o(92619),K=o(4627),W=o(83006),J=o(43923),X=o(4922),Z=o(95951),Q=o(95210),ee=o(62152),et=o(63526),eo=o(77843),el=o(69575),en=o(65457),er=o(82113),ea=o(91815),ei=o(23460),es=o(29558),ed=o(58980),ec=o(16319),eu=o(46724),ep=o(81607);let em={label:"label",value:"value",color:"color",options:"children"};function eh(e,t,o){let l=function e(t,o){let l=[];if(!Array.isArray(t))return l;for(let n=0;n<t.length;n++){let r=t[n][o.options];Array.isArray(r)&&l.push(...e(r,o)),l.push({...t[n]})}return l}(t,o),n=(0,O.castArray)(e).map(e=>(0,et.isPlainObject)(e)?e[o.value]:e);if(!l)return[];let r=[];for(let e of n){let t=l.find(t=>t[o.value]==e)||{value:e,label:e?e.toString():e};r.push(t)}return r}var ex=o(84951),ev=o(60430);let eg=(0,v.observer)(e=>{let[t,o]=(0,s.useState)(!0),[l,n]=(0,s.useState)([]),r=(0,v.useField)(),a=(0,eu.E1)();return((0,s.useEffect)(()=>{var t;let l={...em,...e.fieldNames},s=r.dataSource||e.options||(null==a?void 0:a.uiSchema.enum)||[],d=eh(r.value,s,l);!(0,z.isValid)(e.value)&&!d.length||(0,x.isArrayField)(r)&&(null==r||null==(t=r.value)?void 0:t.length)===0||(n(null!==r.value&&d.map((e,t)=>(0,i.jsx)(g.Tag,{color:e[l.color],icon:"string"==typeof e.icon?(0,i.jsx)(ev.In,{type:e.icon}):e.icon,children:e[l.label]},t))),o(!1))},[null==a?void 0:a.uiSchema.enum,r,r.dataSource,r.value,e.fieldNames,e.options,e.value]),t)?null:(0,i.jsx)(ep.R,{ellipsis:e.ellipsis,children:l})},{displayName:"SelectReadPretty"}),ef=(0,ex.A)(eg),ey=e=>{let{value:t,options:o,onChange:l,fieldNames:n,mode:r,loading:a,rawOptions:s,defaultValue:d,...c}=e,u=eL.isDesktop?"":eS,p=eL.isDesktop?void 0:"topLeft",m=t=>{var l;if(!(0,z.isValid)(t)||"object"==typeof t&&0===Object.keys(t).length)return;let a=null==(l=eh((0,z.toArr)(t).filter(e=>e).map(e=>(0,et.isPlainObject)(e)?e[n.value]:e),o,n))?void 0:l.map(e=>({label:e[n.label],value:e[n.value]}));return["tags","multiple"].includes(r)||e.multiple?a:a.shift()};return(0,i.jsx)(g.Select,{rootClassName:u,placement:p,role:"button","data-testid":`select-object-${r||"single"}`,value:m(t),defaultValue:m(d),allowClear:{clearIcon:(0,i.jsx)(er.CloseCircleFilled,{role:"button","aria-label":"icon-close-select"})},labelInValue:!0,notFoundContent:a?(0,i.jsx)(g.Spin,{}):(0,i.jsx)(g.Empty,{image:g.Empty.PRESENTED_IMAGE_SIMPLE}),options:o,fieldNames:n,showSearch:!0,popupMatchSelectWidth:!1,filterOption:(e,t)=>((null==t?void 0:t[n.label||"label"])??"").includes(e),filterSort:(e,t)=>((null==e?void 0:e[n.label||"label"])??"").toLowerCase().localeCompare(((null==t?void 0:t[n.label||"label"])??"").toLowerCase()),onChange:t=>{let a=eh((0,z.toArr)(t).map(e=>e.value),s||o,n);["tags","multiple"].includes(r)||e.multiple?null==l||l(a):null==l||l(a.shift()||null)},mode:r,tagRender:e=>(0,i.jsx)(g.Tag,{role:"button","aria-label":e.label,closeIcon:(0,i.jsx)(er.CloseOutlined,{role:"button","aria-label":"icon-close-tag"}),...e,children:e.label}),maxTagCount:"responsive",maxTagPlaceholder:e=>(0,i.jsxs)(g.Tooltip,{title:(0,i.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,maxWidth:"100%"},children:e.map(e=>(0,i.jsx)(g.Tag,{style:{margin:0,background:"#fafafa",border:"1px solid #d9d9d9",whiteSpace:"normal",wordBreak:"break-word",maxWidth:"100%"},children:e.label},e.value))}),overlayInnerStyle:{background:"#fff",color:"#000",padding:8,maxWidth:"100%"},color:"#fff",overlayStyle:{pointerEvents:"auto",maxWidth:300},children:["+",e.length,"..."]}),...c})},eb=(e,t)=>((null==t?void 0:t.label)??"").toLowerCase().includes((e||"").toLowerCase()),eS=(0,E.css)`
|
|
967
|
+
`;return(0,r.jsxs)("div",{style:{maxHeight:300,overflowY:"auto"},children:[e.map(e=>(0,r.jsx)("div",{role:"option",onClick:()=>v(e.value),className:o,children:l(e.label)},e.value)),(0,r.jsx)(c.Divider,{style:{margin:"4px 0"}}),t.map(e=>(0,r.jsx)("div",{role:"option",className:o,onClick:()=>v(e.value),title:l(e.label),children:l(e.label)},e.value))]})}}),["past","next"].includes(null==t?void 0:t.type)&&[(0,r.jsx)(c.InputNumber,{value:null==t?void 0:t.number,onChange:e=>{o({...t,number:e})}},"number"),(0,r.jsx)(c.Select,{value:null==t?void 0:t.unit,style:{minWidth:130,maxWidth:140},onChange:e=>{o({...t,unit:e})},options:[{value:"day",label:n("Day")},{value:"week",label:n("Calendar week")},{value:"month",label:n("Calendar Month")},{value:"year",label:n("Calendar Year")}],popupMatchSelectWidth:!0},"unit")],((null==t?void 0:t.type)==="exact"||!(null==t?void 0:t.type))&&(0,r.jsx)(x,{...e})]})}},87382(e,t,o){o.d(t,{L1:()=>x,L3:()=>f,Pd:()=>h,Uq:()=>g,X_:()=>p,gB:()=>m});var l=o(71178),n=o(72741),r=o(38533),a=o(10691),i=o(56920),s=o(77583),d=o(51649),c=o(54969),u=o(95951);let p=(0,d.createContext)(null);p.displayName="DraggableContext";let m=(0,d.createContext)(null);m.displayName="SortableContext";let h=e=>{let{id:t,data:o,children:n}=e,a=(0,r.useDraggable)({id:t,data:o}),i=(0,r.useDroppable)({id:t,data:o}),s=(0,d.useMemo)(()=>({draggable:a,droppable:i}),[a,i]);return(0,l.jsx)(m.Provider,{value:s,children:n})},x=e=>{var t,o;let{component:l,overStyle:r,style:s,children:u,openMode:p,...h}=e,{token:x}=(0,c.rd)(),{draggable:v,droppable:g}=(0,d.useContext)(m),{isOver:f,setNodeRef:y}=g,b={...s},S=(0,i.useFieldSchema)(),C=(null==S?void 0:S["x-component"])==="Action.Link"||"a"===l;if(f&&(null==v||null==(t=v.active)?void 0:t.id)!==(null==g||null==(o=g.over)?void 0:o.id)){let e;b[C?"color":"background"]=(e=x.colorSettings,new n.TinyColor(e).setAlpha(.15).toHex8String()),Object.assign(b,r)}return d.default.createElement(l||"div",{role:"none",...h,className:(0,a.cx)("nb-sortable-designer",e.className),ref:y,style:b},u)},v=(0,i.observer)(e=>{var t;let o,n,r,{schema:a,id:s,eid:c,removeParentsIfNoChildren:u,...p}=(o=(0,i.useField)(),n=e.id?e.id:null==o||null==(t=o.address)?void 0:t.toString(),r=(0,i.useFieldSchema)(),e.schema?{...e,id:n}:{...e,id:n,schema:r}),m=(0,d.useMemo)(()=>{var e,t,o;return{insertAdjacent:"afterEnd",schema:(null==(t=a.parent)||null==(e=t.parent)?void 0:e["x-component"])==="BlockTemplate"?null==(o=a.parent)?void 0:o.parent:a,removeParentsIfNoChildren:u??!0}},[a,u]);return(0,l.jsx)(h,{id:s,data:m,children:(0,l.jsx)(x,{id:c,...p,children:e.children})})},{displayName:"InternalSortableItem"}),g=d.default.memo(e=>{let{component:t,...o}=e,{designable:n}=(0,u.er)();return n?(0,l.jsx)(v,{...e}):d.default.createElement(t||"div",s.default.omit(o,["children","schema","overStyle","openMode","id","eid","removeParentsIfNoChildren"]),e.children)});g.displayName="SortableItem";let f=e=>{let{draggable:t}=(0,d.useContext)(m)||{};if(!t)return null;let{attributes:o,listeners:n,setNodeRef:r}=t;return(0,l.jsx)("div",{style:{display:"inline-block",width:14,height:14,lineHeight:"14px",textAlign:"left"},children:(0,l.jsx)("div",{ref:r,style:{position:"relative",zIndex:1,lineHeight:0,fontSize:0,display:"inline-block"},...n,...o,role:"none",children:(0,l.jsx)("span",{style:{cursor:"move",fontSize:14},children:e.children})})})}},37845(e,t,o){o.d(t,{L1:()=>l.L1,L3:()=>l.L3,Pd:()=>l.Pd,Uq:()=>l.Uq,X_:()=>l.X_,gB:()=>l.gB});var l=o(87382)},59529(e,t,o){o.d(t,{KX:()=>p,_c:()=>h,a2:()=>f,bc:()=>u,rf:()=>c});var l=o(63526),n=o(77583),r=o(73761),a=o(839),i=o(59896),s=o(32665),d=o(64004);let c=(e,t)=>{var o;let l=null==e||null==(o=e.match)?void 0:o.call(e,/{{(.*?)}}/);if(!l)return e;{let e=n.default.get(t,l[1]);return n.default.isFunction(e)?e():e}};function u(e){if("object"!=typeof e||null===e)return null;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))if("[object Object]"===Object.prototype.toString.call(e[t])&&null!==e[t])return u(e[t]);else return{key:t,value:e[t]};return null}let p=e=>{let t,o=(t=[],!function e(o){Object.keys(o).sort().forEach(function(l){t.push(l),o[l]&&"object"==typeof o[l]&&e(o[l])})}(e),t),l=(0,n.findIndex)(o,(e,t,o)=>{if(e.includes("$")&&t>0)return!0});return o.slice(0,l)},m=async(e,t,o)=>{let l=(0,i.DZ)(e)?[t.parseVariable(e,o).then(e=>{let{value:t}=e;return t})]:[e];try{let[e]=await Promise.all(l);return e}catch(e){throw console.error("Error in parseVariableValue:",e),e}},h=async(e,t)=>{let{ruleGroup:o,variables:l,localVariables:r,variableNameOfLeftCondition:a,conditionType:i}=e,s=Object.keys(o)[0]||"$and",d=o[s]||[],c=await Promise.all(d.filter(Boolean).map(e=>x(e,l,r,a,i,t)));return"$and"===s?(0,n.every)(c,e=>e):!c.length||(0,n.some)(c,e=>e)},x=async(e,t,o,l,n,r)=>"$and"in e||"$or"in e?await h({ruleGroup:e,variables:t,localVariables:o,conditionType:n},r):"advanced"===n?v(e,t,o,r):g(e,t,o,l,r),v=async(e,t,o,l)=>{let n=e.op,r=await m(e.rightVar,t,o),a=await m(e.leftVar,t,o);return!n||l.apply({[n]:[a,r]})},g=async(e,t,o,n,r)=>{let a=u(e),c=null==a?void 0:a.key;if(!c)return!0;let m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$nForm";return`{{ ${t}.${e.join(".")} }}`}(p(e),n),h=t.parseVariable(m,o,{doNotRequest:!0}).then(e=>{let{value:t}=e;return t}),x=(0,i.DZ)(null==a?void 0:a.value)?[t.parseVariable(null==a?void 0:a.value,o).then(e=>{let{value:t}=e;return t}),h]:[null==a?void 0:a.value,h];try{let[e,n]=await Promise.all(x),a=await t.getCollectionField(m,o),i=(0,s.A)(n,{targetCollectionField:a}),u=(0,s.A)(e,{targetCollectionField:a});if((null==a?void 0:a.type)&&["datetime","date","datetimeNoTz","dateOnly","unixTimestamp"].includes(a.type)&&i){let e=(0,d.Pn)(u),t=(0,l.getPickerFormat)(e);i=(0,l.dayjs)(i).format(t)}return r.apply({[c]:[i,u]})}catch(e){throw e}};async function f(e,t,o,n,i,s){if(t&&"handlebars"===e){l.Handlebars.registerHelper("t",function(e){if("string"==typeof e)return s(e,{ns:a.z})});try{var d,c;let e,r=t.replace(/{{\s*}}/g,'{{"{{}}"}}'),a=l.Handlebars.compile(r),s=(e={},n.map(t=>{e[t.name]=t.ctx}),e),{$nDate:u}=(null==o||null==(d=o.ctxRef)?void 0:d.current)||{},p={};Object.keys(u||{}).map(e=>{p[e]=u[e]()});let m=a({...null==o||null==(c=o.ctxRef)?void 0:c.current,...s,$nDate:p});return console.log(m),await i(m)}catch(e){return/VariablesProvider: .* is not found/.test(e.message)||console.log(e),console.log(t),t}}try{let e=await (0,r.replaceVariableValue)(t,o,n);return await i(e)}catch(e){return/VariablesProvider: .* is not found/.test(e.message)||console.log(e),t}}},84951(e,t,o){o.d(t,{A:()=>y});var l=o(71178),n=o(56920),r=o(77583),a=o(51649),i=o(44388),s=o(51275),d=o(22204),c=o(3012),u=o(52570),p=o(95951);let m={type:"void","x-component":"Action.Container","x-action":"view",title:'{{ t("View record") }}',"x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock",properties:{}}}}}}}};var h=o(49621),x=o(30644),v=o(39888);let g=e=>"Action.Container"===e["x-component"],f=e=>{let{WrappedComponent:t,...o}=e,i=(0,n.useFieldSchema)(),{openPopup:s}=(0,c.Hy)(),d=(0,a.useRef)(!1),u=(()=>{let e=(0,n.useFieldSchema)(),{insertAfterBegin:t}=(0,p.er)();return(0,a.useCallback)(o=>{e.reduceProperties((e,t)=>"Action.Container"===t["x-component"]?t:e,null)||t((0,r.cloneDeep)(o))},[e,t])})(),h=(0,a.useRef)(i);h.current=i;let x=(0,a.useRef)(u);x.current=u;let v=(0,a.useRef)(s);v.current=s;let g=(0,a.useCallback)(()=>h.current,[]),f=(0,a.useCallback)(()=>{h.current.properties||(x.current(m),d.current=!0),d.current?(setTimeout(()=>{v.current({customActionSchema:g()})}),d.current=!1):h.current.properties&&v.current()},[g]),y=(0,a.useMemo)(()=>(0,r.debounce)(f,600,{leading:!0,trailing:!1}),[f]);return(0,a.useEffect)(()=>()=>{y.cancel()},[y]),(0,l.jsx)("a",{onClick:y,children:(0,l.jsx)(t,{...o})})};function y(e){return t=>{let[o,r]=(0,a.useState)(!1),[p,m]=(0,a.useState)(!1),y=(0,h.Ge)(),b=(0,s.D5)(),S=(0,n.useField)(),C=(0,n.useFieldSchema)(),{enableLink:_,openMode:k,openSize:F}=(null==C?void 0:C["x-component-props"])||{},{visibleWithURL:M,setVisibleWithURL:P}=(0,c.Hy)(),I=(0,a.useCallback)(e=>{null==r||r(e),null==P||P(e)},[P]);(0,a.useRef)(C).current=C;let{setSubmitted:A}=b;return _?(0,l.jsx)(i.OC,{visible:!1,children:(0,l.jsxs)(d.z4,{button:(0,l.jsx)(e,{...t}),visible:o||M,setVisible:I,formValueChanged:p,setFormValueChanged:m,openMode:k,openSize:F,containerRefKey:"field-popup",fieldSchema:C,setSubmitted:A,children:[(0,l.jsx)(h.Yz,{name:y.name,children:(0,l.jsx)(u.t,{children:(0,l.jsx)(v.P3,{children:(0,l.jsx)(x.dw,{onlyRenderProperties:!0,basePath:null==S?void 0:S.address,schema:C,filterProperties:g})})})}),(0,l.jsx)(f,{...t,WrappedComponent:e})]})}):(0,l.jsx)(e,{...t})}}},63557(e,t,o){o.d(t,{u:()=>l});let l=(0,o(51649).createContext)({});l.displayName="SchemaComponentContext.Provider"},71915(e,t,o){o.d(t,{O:()=>c});var l=o(71178),n=o(44814),r=o(56920),a=o(51649),i=o(52570);let s=e=>{let{children:t,form:o,...n}=e,s=(0,a.useContext)(r.SchemaOptionsContext),d=(0,a.useContext)(r.SchemaExpressionScopeContext),c={...null==s?void 0:s.scope,...d},u={...null==s?void 0:s.components};return(0,l.jsx)(r.FormProvider,{...n,form:o,children:(0,l.jsx)(i.t,{components:u,scope:c,children:t})})},d=e=>{let{children:t,...o}=e,s=(0,a.useContext)(r.SchemaOptionsContext),d=(0,a.useContext)(r.SchemaExpressionScopeContext),c={...null==s?void 0:s.scope,...d},u={...null==s?void 0:s.components},p=(0,a.useMemo)(()=>(0,n.createForm)(),[]);return(0,l.jsx)(r.FormProvider,{...o,form:p,children:(0,l.jsx)(i.t,{components:u,scope:c,children:t})})},c=e=>e.form?(0,l.jsx)(s,{...e}):(0,l.jsx)(d,{...e})},86073(e,t,o){o.d(t,{D:()=>x});var l=o(71178),n=o(44814),r=o(56920),a=o(52793),i=o(51649),s=o(43353);o(67285);var d=o(16319),c=o(71915),u=o(93726),p=o(16211);let m=e=>e,h=e=>{let{noForm:t,onlyRenderProperties:o,hidden:h,scope:x,uid:v,components:g,onSuccess:f,NotFoundPage:y,schemaTransform:b=m,onPageNotFind:S}=e,C=(0,i.useMemo)(()=>(0,n.createForm)(),[v]),{schema:_,loading:k}=(e=>{let{uid:t,type:o="getJsonSchema",onSuccess:l}=e,n={url:`/uiSchemas:${o}/${t}`},{data:r,loading:a}=(0,p.bP)(n,{refreshDeps:[t],onSuccess(e){l&&l(e)}});return{schema:null==r?void 0:r.data,loading:a}})({uid:v,type:o?"getProperties":"getJsonSchema",onSuccess:e=>{f&&f(e)}}),F=(0,d.xZ)(y),M=(0,s.RH)(),P=(0,r.useFieldSchema)(),I=(0,i.useMemo)(()=>b(_||{}),[_,b]),A=!_||0===Object.keys(_).length;return((0,i.useEffect)(()=>{M||k||h||!A||!S||S()},[M,h,k,S,A]),M||k||h)?(0,l.jsx)(a.Spin,{style:{width:"100%",marginTop:20},delay:void 0}):A?F?(0,l.jsx)(F,{}):null:t?(0,l.jsx)(u.H,{components:g,scope:x,schema:I,parentSchema:P}):(0,l.jsx)(c.O,{form:C,children:(0,l.jsx)(u.H,{components:g,scope:x,schema:I,parentSchema:P})})},x=(0,i.memo)(e=>e.uid?(0,l.jsx)(h,{...e}):null);x.displayName="RemoteSchemaComponent"},93726(e,t,o){o.d(t,{D:()=>u,H:()=>h});var l=o(71178),n=o(56920),r=o(77583),a=o(51649),i=o(30644),s=o(63557),d=o(52570);function c(e){return n.Schema.isSchemaInstance(e)?e:new n.Schema((null==e?void 0:e.name)?{type:"object",properties:{[e.name]:e},name:`p_${e.name}`}:e)}let u=(0,a.createContext)({onChange:r.default.noop}),p=(0,a.memo)(e=>{let{components:t,scope:o,schema:n,distributed:p,onChange:m,parentSchema:h,...x}=e,v=(0,a.useContext)(s.u),g=(0,a.useMemo)(()=>c(n),[n]),f=(0,a.useMemo)(()=>({...v,distributed:!1!=v.distributed&&p,refresh:v.refresh||r.default.noop}),[v,p]),{onChange:y}=(0,a.useContext)(u),b=(0,a.useMemo)(()=>({onChange:()=>{null==m||m(g),null==y||y()}}),[m,y,g]);return(0,l.jsx)(u.Provider,{value:b,children:(0,l.jsx)(s.u.Provider,{value:f,children:(0,l.jsx)(d.t,{inherit:!0,components:t,scope:o,children:(0,l.jsx)(i.dw,{...x,schema:g,isUseFormilyField:!0,parentSchema:h})})})})});p.displayName="RecursionSchemaComponent";let m=(0,a.memo)(e=>{let{schema:t,parentSchema:o,...n}=e,r=(0,a.useMemo)(()=>c(t),[]);return(0,l.jsx)(p,{...n,schema:r,parentSchema:o})});m.displayName="MemoizedSchemaComponent";let h=(0,a.memo)(e=>{let{memoized:t,...o}=e;return t?(0,l.jsx)(m,{...o}):(0,l.jsx)(p,{...o})});h.displayName="SchemaComponent"},52570(e,t,o){o.d(t,{M:()=>a,t:()=>i});var l=o(71178),n=o(56920),r=o(51649);let a=()=>(0,r.useContext)(n.SchemaOptionsContext)||{},i=(0,r.memo)(e=>{let{children:t}=e,o=a(),i=(0,r.useMemo)(()=>({...o.components,...e.components}),[o.components,e.components]),s=(0,r.useMemo)(()=>({...o.scope,...e.scope}),[o.scope,e.scope]),d=(0,r.useMemo)(()=>({scope:s,components:i}),[s,i]);return(0,l.jsx)(n.SchemaOptionsContext.Provider,{value:d,children:(0,l.jsx)(n.SchemaComponentsContext.Provider,{value:i,children:(0,l.jsx)(n.ExpressionScope,{value:s,children:t})})})});i.displayName="SchemaComponentOptions"},90995(e,t,o){o.d(t,{OA:()=>I,DY:()=>v.D,GD:()=>T,Do:()=>g.D,Mq:()=>f.M,t6:()=>f.t,Hv:()=>g.H,Op:()=>x.O,N3:()=>h});var l=o(71178),n=o(82113),r=o(52793),a=o(51649),i=o(77843),s=o(82924),d=o(49948),c=o(90236),u=o(504);let p={backgroundColor:"var(--colorSettings) !important"},m={backgroundColor:"transparent"},h=e=>{let{designable:t,setDesignable:o}=(0,s.erX)(),{t:a}=(0,i.useTranslation)(),{token:h}=(0,d.K)(),{isMobileLayout:x}=(0,c.mY)(),v=(0,u.useFlowEngine)();return((0,ef.useHotkeys)("Ctrl+Shift+U",()=>o(!t),[t]),x)?null:(0,l.jsx)(r.Tooltip,{title:a("UI Editor"),children:(0,l.jsx)(r.Button,{"data-testid":"ui-editor-button",icon:(0,l.jsx)(n.HighlightOutlined,{style:{color:h.colorTextHeaderMenu}}),title:a("UI Editor"),style:{...t?p:m,...e.style},onClick:async()=>{let e=!t;o(e),x||!e?await v.flowSettings.disable():await v.flowSettings.enable()}})})};var x=o(71915),v=o(86073),g=o(93726),f=o(52570),y=o(44814),b=o(56920),S=o(27404),C=o(77583),_=o(63557),k=o(20629);let F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`${e}${(0,S.uid)()}`};b.Schema.silent(!0);let M={},P={silent:!0,compile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=()=>{if(!P.silent)return Function("$root",`with($root) { return (${e}); }`)(t);try{return Function("$root",`with($root) { return (${e}); }`)(t)}catch{return`{{${e}}}`}};return M[e]?M[e]:e.trim().startsWith("t(")?(M[e]=o(),M[e]):o()}};b.Schema.registerCompiler(P.compile);let I=e=>{let{designable:t,onDesignableChange:o,components:n,children:r}=e,s=(0,a.useContext)(_.u),d=(0,f.M)(),[c,u]=(0,a.useState)(()=>(0,S.uid)()),p=(0,a.useMemo)(()=>e.form||(0,y.createForm)(),[c]),{t:m}=(0,i.useTranslation)(),h=(0,k.nm)(),x=(0,a.useMemo)(()=>({...e.scope,t:m,randomString:F}),[e.scope,m,null==d?void 0:d.scope]),[v,g]=(0,a.useState)(t),M=(0,a.useMemo)(()=>"boolean"==typeof t?t:v,[t,v,s.designable]),P=(0,a.useMemo)(()=>e=>{"boolean"!=typeof M&&g(e),null==o||o(e)},[M,o]);(0,a.useEffect)(()=>{let e=!1;return(async()=>{var t,o,l,n;if(!M)return await (null==(o=h.flowEngine)||null==(t=o.flowSettings)?void 0:t.disable());e||await (null==(n=h.flowEngine)||null==(l=n.flowSettings)?void 0:l.enable())})(),()=>{e=!0}},[h,M]);let I=(0,a.useCallback)(()=>{u((0,S.uid)())},[]),A=(0,a.useMemo)(()=>({scope:x,components:n,reset:I,refresh:C.default.noop,designable:M,setDesignable:P}),[n,M,I,x,P]);return(0,l.jsx)(_.u.Provider,{value:A,children:(0,l.jsx)(b.FormProvider,{form:p,children:(0,l.jsx)(f.t,{inherit:!0,scope:x,components:n,children:r})})})};I.displayName="SchemaComponentProvider";var A=o(83468);class T extends A.k{async load(){this.addComponents()}addComponents(){this.app.addComponents({DesignableSwitch:h})}}},16319(e,t,o){o.d(t,{Us:()=>g,TD:()=>n,F:()=>u.F,px:()=>i.px,QI:()=>i.QI,d1:()=>i.d1,xB:()=>h,YY:()=>f.Y,Lj:()=>y.Lj,er:()=>i.er,xZ:()=>a.x,OJ:()=>c,mh:()=>y.mh,lu:()=>r.l,kB:()=>i.kB,Hb:()=>s.H,a9:()=>y.a9,jE:()=>b.j});var l=o(51649);let n=e=>{let t=(0,l.useRef)(null);return(0,l.useEffect)(()=>(t.current&&e!==t.current&&t.current.onUnmount(),t.current=e,e.onMount(),()=>{e.onUnmount()}),[e]),e};var r=o(61013),a=o(57619),i=o(95951),s=o(87463),d=o(56920);let c=e=>{let t=(0,l.useContext)(d.SchemaOptionsContext),o=(0,l.useContext)(d.SchemaExpressionScopeContext),n=(0,l.useRef)();return n.current=o,e.toFieldProps({...t,get scope(){return{...t.scope,...n.current}}})};var u=o(39247),p=o(77843),m=o(43288);let h=()=>{var e;let{getCollectionJoinField:t,getCollection:o}=(0,m.nj)(),n=(0,d.useFieldSchema)(),{getField:r}=(0,m.k7)(),a=r(n.name)||t(n["x-collection-field"]),{t:i}=(0,p.useTranslation)(),{label:s}=(null==(e=n["x-component-props"])?void 0:e.fieldNames)||{};return(0,l.useMemo)(()=>{if(!a||!(null==a?void 0:a.interface)||!["o2o","oho","obo","o2m","linkTo","m2o","m2m"].includes(a.interface))return;let e=o(a.target);if((null==e?void 0:e.template)==="file")return[{label:i("Record picker"),value:"CollectionField"},{label:i("Select"),value:"AssociationSelect"}];switch(a.interface){case"o2m":return[{label:i("Record picker"),value:"CollectionField"},{label:i("Subtable"),value:"TableField"},{label:i("Select"),value:"AssociationSelect"}];case"m2o":case"m2m":case"linkTo":return[{label:i("Record picker"),value:"CollectionField"},{label:i("Select"),value:"AssociationSelect"}];default:return[{label:i("Record picker"),value:"CollectionField"},{label:i("Subform"),value:"FormField"},{label:i("Select"),value:"AssociationSelect"}]}},[i,null==a?void 0:a.interface,s])};var x=o(26174),v=o(49621);let g=()=>{var e;let t=(0,d.useField)(),o=(0,d.useFieldSchema)(),n=(0,v.Ge)(),a=(0,x.r2)(),i=(null==n?void 0:n.getField(o.name))||(null==a?void 0:a.getCollectionField(o["x-collection-field"])),s=(0,r.l)();(0,l.useEffect)(()=>{if(!(null==t?void 0:t.title)){var e;t.title=s(null==i||null==(e=i.uiSchema)?void 0:e.title)}},[null==i||null==(e=i.uiSchema)?void 0:e.title])};var f=o(4922),y=o(62152),b=o(81547)},62152(e,t,o){o.d(t,{Lj:()=>f,a9:()=>g,mh:()=>v});var l=o(56920),n=o(71883),r=o(52793),a=o(77583),i=o(51649),s=o(38356),d=o(95951),c=o(44374),u=o(73761),p=o(70892),m=o(38131);let h=e=>{let t=y((0,l.useFieldSchema)()),o=(e=>{let{token:t}=r.theme.useToken(),{designable:o}=(0,d.er)(),{heightProps:l}=(0,u.useBlockHeightProps)(),n=(0,s.useLocation)(),{disablePageHeader:a,enablePageTabs:i,hidePageTitle:c}=e||l||{},p=t.sizeXXL-2,m=o?t.controlHeight+2*t.paddingContentHorizontalLG:+t.paddingContentHorizontalLG;return p+(n.pathname.includes("/popups/")?2*t.paddingContentVertical+22+t.paddingPageVertical:a?t.paddingContentHorizontalLG:c?i?t.controlPaddingHorizontal+3*t.controlPaddingHorizontalSM+22+t.paddingContentHorizontalLG:t.paddingContentHorizontalLG+12:i?t.paddingSM+t.controlHeight+t.marginXS+2*t.controlPaddingHorizontalSM+22+t.paddingContentHorizontalLG:t.controlHeight+t.marginXS+(t.paddingContentVertical+2)*2+t.paddingContentHorizontalLG)+m})(e),n=(()=>{let{token:e}=r.theme.useToken(),{designable:t}=(0,d.er)();return e.paddingContentVerticalLG+e.margin+2*e.paddingContentVertical+24+(t?e.controlHeight+2*e.paddingContentHorizontalLG:+e.paddingContentHorizontalLG)})();return t?n:o},x=["workflowManualTasks","approvals","approvalRecords"],v=e=>{let{heightProps:t}=(0,u.useBlockHeightProps)(),o=h(),{heightMode:l,height:n,title:r,titleHeight:a}=t||{};if((null==t?void 0:t.heightMode)&&l!==m.D.DEFAULT){if(l===m.D.FULL_HEIGHT){let t=window.innerHeight-o;return(null==e?void 0:e.removeBlockHeaderHeight)&&(t-=r?a:0),(null==e?void 0:e.innerExtraHeight)&&(t-=e.innerExtraHeight),t}return n}},g=()=>{let e=(0,l.useFieldSchema)(),t=(0,i.useMemo)(()=>(0,u.getPageSchema)(e),[]),{disablePageHeader:o,enablePageTabs:n,hidePageTitle:r}=(null==t?void 0:t["x-component-props"])||{},a={...null==e?void 0:e["x-component-props"],disablePageHeader:o,enablePageTabs:n,hidePageTitle:r},s=h(a),{heightMode:d,height:c}=a||{};if((null==a?void 0:a.heightMode)&&d!==m.D.DEFAULT)return d===m.D.FULL_HEIGHT?window.innerHeight-s:c},f=()=>{let[e,t]=(0,i.useState)(),o=(0,i.useRef)(null),s=(()=>{var e;let{token:t}=r.theme.useToken(),{heightProps:o}=(0,u.useBlockHeightProps)(),{heightProps:n}=(0,p.El)(),{designable:a}=(0,d.er)(),i=(0,l.useFieldSchema)(),s=n||o,{titleHeight:v}=o,g=h(s),{name:f}=(0,c.useCollection)(),{heightMode:y,height:b,title:S}=s;if(!(null==s?void 0:s.heightMode)||y===m.D.DEFAULT)return;let C=Object.keys((null==(e=i.parent.properties.actions)?void 0:e.properties)||{}).length>0,_=t.controlHeight+t.padding+t.marginLG,k=C||a?t.controlHeight+2*t.marginLG:t.marginLG,F=(a&&!x.includes(f)?t.controlHeight:22)+2*t.padding+1,M=S?v:0;return y===m.D.FULL_HEIGHT?window.innerHeight-g-M-F-k-_:b-M-k-F-_})(),v=(0,i.useCallback)((0,a.debounce)(()=>{var e;if(!o.current)return;let l=o.current.getBoundingClientRect();(null==(e=o.current.querySelector(".ant-table"))?void 0:e.getBoundingClientRect())&&t(l.width)},100),[s]),g=(0,i.useCallback)(e=>{o.current=e&&e.children?e.children[0]:null,v()},[v]);return(0,n.useEventListener)("resize",v),{height:s,width:e,tableSizeRefCallback:g}},y=e=>{if(!e)return null;if("Action.Container"===e["x-component"]){var t,o;return(null==e||null==(o=e.parent)||null==(t=o["x-component-props"])?void 0:t.openMode)!=="page"}return y(e.parent)}},61013(e,t,o){o.d(t,{l:()=>a});var l=o(56920),n=o(51649);let r={},a=function(){let{noCache:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{noCache:!1},t=(0,n.useContext)(l.SchemaOptionsContext),o=(0,n.useContext)(l.SchemaExpressionScopeContext);return(a,i)=>{var s,d;let c,u=!1;if("string"==typeof a&&a.startsWith("{{")&&(u=!0,c=a),a&&"object"==typeof a&&!(0,n.isValidElement)(a)){try{c=JSON.stringify(a)}catch(e){return console.warn("Failed to stringify:",e),a}if(r[c])return r[c];s=c,u=/{{.*?}}/g.test(s)}if(Array.isArray(a)){try{c=JSON.stringify(a)}catch(e){return console.warn("Failed to stringify:",e),a}if(r[c])return r[c];d=c,u=/{{.*?}}/g.test(d)}if(u){let n={...null==t?void 0:t.scope,...o,...i};if(!c)return l.Schema.compile(a,n);try{if(e)return l.Schema.compile(a,n);return r[c]=r[c]||l.Schema.compile(a,n),r[c]}catch(e){return console.log("useCompile error",a,e),l.Schema.compile(a,n)}}return a}}},57619(e,t,o){o.d(t,{x:()=>a});var l=o(56920),n=o(77583),r=o(51649);let a=(e,t)=>{let{components:o}=(0,r.useContext)(l.SchemaOptionsContext);return e?"string"!=typeof e?e:(0,n.get)(o,e)||t:t}},95951(e,t,o){o.d(t,{er:()=>P,px:()=>y,QI:()=>M,d1:()=>F,kB:()=>_});var l=o(71178),n=o(56920),r=o(27404),a=o(71883),i=o(52793),s=o(13791),d=o(93656),c=o(20148),u=o(51649),p=o(77843),m=o(16211),h=o(30644),x=o(88448),v=o(63557),g=JSON.parse('{"rE":"2.1.0-beta.29"}'),f=o(13975);function y(e){return new F(e)}let b=e=>{e&&(e["x-uid"]||(e["x-uid"]=(0,r.uid)()),Object.keys(e.properties||{}).forEach(t=>{b(e.properties[t])}))},S=e=>e,C=(e,t)=>{if(e&&t){for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&t[o]!==(null==e?void 0:e[o]))return!1;return!0}},_=(e,t)=>{if(e["x-uid"]&&e["x-uid"]===t["x-uid"])return[null,e.toJSON()];let o=e.toJSON(),l={...o,properties:{}},n=null,r=(e,o)=>{Object.keys(e||{}).forEach(l=>{let a=e[l];if(a["x-uid"]===t["x-uid"]){n=e[l];return}o.properties[l]={...a,properties:{}},r(null==a?void 0:a.properties,o.properties[l])})};return r(o.properties,l),[l,n]},k=e=>e;class F{get model(){return this.options.model}get query(){return this.options.query}loadAPIClientEvents(){let{api:e,t=k}=this.options;if(!e)return;let o=e=>{if(!e)return[];let t=Object.values(e.properties).length,o=[];return(e.mapProperties(e=>{e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].width=100/t,e["x-uid"]&&o.push({"x-uid":e["x-uid"],"x-component-props":e["x-component-props"]})}),e["x-uid"]&&o.length)?o:[]};this.on("insertAdjacent",async l=>{var n;let{onSuccess:r,current:a,position:s,schema:d,wrap:c,wrapped:u,removed:p}=l,m=[];if((null==u?void 0:u["x-component"])==="Grid.Col"&&(m=m.concat(o(u.parent))),(null==p?void 0:p["x-component"])==="Grid.Col"&&(m=m.concat(o(p.parent))),this.refresh(),!a["x-uid"])return;let h=await e.request({url:`/uiSchemas:insertAdjacent/${a["x-uid"]}?position=${s}`,method:"post",data:{schema:function e(t,o){if(t)return t["x-app-version"]||(t["x-app-version"]=o),Object.keys(t.properties||{}).forEach(l=>{var n;e(null==(n=t.properties)?void 0:n[l],o)}),t}(d,this.appVersion),wrap:c}});m.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:m}),(null==p?void 0:p["x-uid"])&&await e.request({url:`/uiSchemas:remove/${p["x-uid"]}`,method:"post"}),null==r||r(null==h||null==(n=h.data)?void 0:n.data),i.message.success(t("Saved successfully"),.2)}),this.on("patch",async o=>{let{schema:l}=o;this.refresh(),(null==l?void 0:l["x-uid"])&&(await e.request({url:"/uiSchemas:patch",method:"post",data:{...l}}),i.message.success(t("Saved successfully"),.2))}),this.on("initializeActionContext",async t=>{let{schema:o}=t;(null==o?void 0:o["x-uid"])&&await e.request({url:"/uiSchemas:initializeActionContext",method:"post",data:{...o}})}),this.on("batchPatch",async o=>{let{schemas:l}=o;this.refresh(),await e.request({url:"/uiSchemas:batchPatch",method:"post",data:l}),i.message.success(t("Saved successfully"),.2)}),this.on("remove",async l=>{let{removed:n}=l,r=[];(null==n?void 0:n["x-component"])==="Grid.Col"&&(r=o(n.parent)),this.refresh(),(null==n?void 0:n["x-uid"])&&(await e.request({url:`/uiSchemas:remove/${n["x-uid"]}`,method:"post"}),r.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:r}),i.message.success(t("Saved successfully"),.2))})}prepareProperty(e){e.type||(e.type="void"),e.name||(e.name=(0,r.uid)()),this.current["x-uid"]&&b(e)}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}async emit(e){for(var t=arguments.length,o=Array(t>1?t-1:0),l=1;l<t;l++)o[l-1]=arguments[l];if(!this.events[e])return;let[n,...r]=o;return Promise.all(this.events[e].map(e=>e.bind(this)({current:this.current,...n},...r)))}parentsIn(e){if(!e||!n.Schema.isSchemaInstance(e))return!1;let t=this.current;for(;null==t?void 0:t.parent;){if(t.parent===e)return!0;t=t.parent}return!1}refresh(e){let{refresh:t}=this.options;return null==t?void 0:t(e)}deepMerge(e){let t={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly"},o={"x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(l=>{t[l]?(this.current[l]=e[l],this.updateModel(t[l],e[l])):o[l]?Object.keys(e[l]).forEach(t=>{(0,c.default)(this.current,[l,t],e[l][t]),this.updateModel([o[l],t],e[l][t])}):this.current[l]=e[l]}),this.emit("patch",{schema:e})}getSchemaAttribute(e,t){return(0,d.default)(this.current,e,t)}shallowMerge(e){let t={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly","x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(o=>{this.current[o]=e[o],t[o]&&this.updateModel(t[o],e[o])}),this.emit("patch",{schema:e})}updateModel(e,t){let o=o=>{(0,c.default)(o,e,t)};this.model&&o(this.model),this.query&&this.query.take(o)}insertAdjacent(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};switch(e){case"beforeBegin":return this.insertBeforeBegin(t,o);case"afterBegin":return this.insertAfterBegin(t,o);case"beforeEnd":return this.insertBeforeEnd(t,o);case"afterEnd":return this.insertAfterEnd(t,o)}}recursiveRemoveIfNoChildren(e,t){let o;if(!e)return;let l=e,n=null==t?void 0:t.breakRemoveOn;for(;l;){if("function"==typeof n){if(n(l))break}else if(C(l,n))break;if(Object.keys(l.properties||{}).length>0)break;l.parent&&(o=l.parent.removeProperty(l.name)),l=l.parent}return o}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:o,removeParentsIfNoChildren:l}=t,n=e||this.current,r=n.parent.removeProperty(n.name);if(l){let e=this.recursiveRemoveIfNoChildren(n.parent,{breakRemoveOn:o});e&&(r=e)}return this.emit("remove",{removed:r})}removeWithoutEmit(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:o,removeParentsIfNoChildren:l}=t,n=e||this.current,r=n.parent.removeProperty(n.name);if(l){let e=this.recursiveRemoveIfNoChildren(n.parent,{breakRemoveOn:o});e&&(r=e)}return r}insertBeforeBeginOrAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current)||!n.Schema.isSchemaInstance(e)||this.current.parent!==e.parent)return;let o=0,l=0;return this.current.parent.mapProperties((t,n,r)=>{this.current.name===n&&(l=r),e.name===n&&(o=r)}),o>l?this.insertBeforeBegin(e,t):this.insertAfterEnd(e,t)}insertBeforeBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current))return;let o={onSuccess:t.onSuccess},{wrap:l=S,breakRemoveOn:a,removeParentsIfNoChildren:i}=t;if(n.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),i&&(o.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:a}))}else e&&(e=(0,s.default)(e));let d={},c=!1,u=0,p=0;this.current.parent.mapProperties((e,t)=>{t===this.current.name&&(p=u,c=!0,++u),e["x-index"]=u,++u,c&&(d[t]=e,this.current.parent.removeProperty(t))}),this.prepareProperty(e);let m=l(e),h=this.current.parent.addProperty(m.name||(0,r.uid)(),m);h["x-index"]=p,h.parent=this.current.parent,this.current.parent.setProperties(d);let[x,v]=_(h,e);this.emit("insertAdjacent",{position:"beforeBegin",schema:v,wrapped:m,wrap:x,...o})}insertAfterBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current))return;let o={onSuccess:t.onSuccess},{wrap:l=S,breakRemoveOn:a,removeParentsIfNoChildren:i}=t;if(n.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),i&&(o.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:a}))}else e&&(e=(0,s.default)(e));let d={},c=1;this.current.mapProperties((e,t)=>{e["x-index"]=c,++c,d[t]=e}),this.current.properties={},this.prepareProperty(e);let u=l(e),p=this.current.addProperty(u.name||(0,r.uid)(),u);p["x-index"]=0,p.parent=this.current,this.current.setProperties(d);let[m,h]=_(p,e);this.emit("insertAdjacent",{position:"afterBegin",schema:h,wrap:m,wrapped:u,...o})}insertBeforeEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current))return;delete e["x-index"];let o={onSuccess:t.onSuccess},{wrap:l=S,breakRemoveOn:a,removeParentsIfNoChildren:i}=t;if(n.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),i&&(o.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:a}))}else e&&(e=(0,s.default)(e));this.prepareProperty(e);let d=l(e),c=this.current.addProperty(d.name||(0,r.uid)(),d);c.parent=this.current;let[u,p]=_(c,e);return this.emit("insertAdjacent",{position:"beforeEnd",schema:p,wrap:u,wrapped:d,...o})}insertAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.Schema.isSchemaInstance(this.current))return;let o={onSuccess:null==t?void 0:t.onSuccess},{wrap:l=S,breakRemoveOn:a,removeParentsIfNoChildren:i}=t,d=0,c=0,u=!1,p={};if(this.current.parent.mapProperties((e,t)=>{e["x-index"]=d,t===this.current.name&&(c=++d,u=!0),++d,u&&t!==this.current.name&&(p[t]=e,this.current.parent.removeProperty(t))}),n.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),i&&(o.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:a})),e.parent=null}else e&&(e=(0,s.default)(e));this.prepareProperty(e);let m=l(e),h=this.current.parent.addProperty(m.name||(0,r.uid)(),m);h.parent=this.current.parent,h["x-index"]=c,this.current.parent.setProperties(p);let[x,v]=_(h,e);this.emit("insertAdjacent",{position:"afterEnd",schema:v,wrap:x,wrapped:m,...o})}constructor(e){this.events={},this.options=e,this.current=e.current,this.appVersion=e.appVersion}}function M(){let e=(0,u.useContext)(n.SchemaOptionsContext),t=(0,u.useMemo)(()=>(null==e?void 0:e.components)||{},[e]);return e=>{if(!e)return null;if("string"!=typeof e)return e;let o=(0,d.default)(t,e);return o||console.error(`[nocobase]: Component "${e}" not found`),o}}function P(){let{designable:e,setDesignable:t,refresh:o,reset:r}=(0,u.useContext)(v.u),i=(0,u.useContext)(n.SchemaOptionsContext),s=(0,u.useMemo)(()=>(null==i?void 0:i.components)||{},[i]),b=(0,u.useMemo)(()=>()=>(0,l.jsx)(l.Fragment,{}),[]),S=(0,a.useUpdate)(),C=(0,h.o8)(),_=(0,h.cQ)(),k=(0,u.useCallback)(e=>{null==o||o(),S(),null==C||C(e),null==_||_()},[o,S,C,_]),F=(0,n.useField)(),M=(0,n.useFieldSchema)(),P=(0,m.VB)(),{t:I}=(0,p.useTranslation)(),A=(0,u.useMemo)(()=>y({t:I,api:P,refresh:k,current:M,model:F,appVersion:g.rE}),[I,P,k,M,F]);(0,u.useEffect)(()=>{A.loadAPIClientEvents()},[A]);let{isMobileLayout:T}=(0,f.useMobileLayout)();return{dn:A,designable:!T&&e,reset:r,refresh:k,setDesignable:t,DesignableBar:b,findComponent:(0,u.useCallback)(e=>{if(!e)return null;if("string"!=typeof e)return e;let t=(0,d.default)(s,e);return(null==t?void 0:t[x.PE])??t},[d.default]),on:A.on.bind(A),patch:(0,u.useCallback)((e,t)=>{let o=e=>{Object.keys(e).forEach(t=>{let o=e[t];"title"===t&&(F.title=o,M.title=o),"x-decorator-props"===t&&(F.decoratorProps||(F.decoratorProps={}),M["x-decorator-props"]||(M["x-decorator-props"]={}),Object.keys(o).forEach(e=>{F.decoratorProps[e]=o[e],M["x-decorator-props"][e]=o[e]})),"x-component-props"===t&&(F.componentProps||(F.componentProps={}),M["x-component-props"]||(M["x-component-props"]={}),Object.keys(o).forEach(e=>{F.componentProps[e]=o[e],M["x-component-props"][e]=o[e]}))})};if("string"==typeof e){let l={};return(0,c.default)(l,e,t),o(l)}o(e),k()},[A]),shallowMerge:(0,u.useCallback)(e=>{A.shallowMerge(e)},[A]),deepMerge:(0,u.useCallback)(e=>{A.deepMerge(e)},[A]),remove:(0,u.useCallback)((e,t)=>{A.remove(e,t)},[A]),insertAdjacent:(0,u.useCallback)((e,t,o)=>{A.insertAdjacent(e,t,o)},[A]),insertBeforeBegin:(0,u.useCallback)(e=>{A.insertBeforeBegin(e)},[A]),insertAfterBegin:(0,u.useCallback)(e=>{A.insertAfterBegin(e)},[A]),insertBeforeEnd:(0,u.useCallback)(e=>{A.insertBeforeEnd(e)},[A]),insertAfterEnd:(0,u.useCallback)(e=>{A.insertAfterEnd(e)},[A])}}},87463(e,t,o){o.d(t,{H:()=>d});var l=o(56920),n=o(51649),r=o(99300),a=o(57619),i=o(95951);let s=()=>null;s.isNullComponent=!0;let d=()=>{let{designable:e}=(0,i.er)(),t=(0,l.useFieldSchema)(),o=(0,n.useMemo)(()=>t["x-designer"]||t["x-toolbar"]?t["x-designer"]||t["x-toolbar"]:t["x-settings"]?r.Bw:s,[t]),d=(0,a.x)(o);return e&&d||s}},81547(e,t,o){o.d(t,{j:()=>i});var l=o(56920),n=o(51649),r=o(77843),a=o(43288);let i=e=>{var t;let{t:o}=(0,r.useTranslation)(),{getCollectionJoinField:i,getCollection:s}=(0,a.nj)(),d=(0,l.useFieldSchema)(),c=(null==e?void 0:e.fieldSchema)||d,u=(0,l.useField)(),p=(0,l.useForm)(),m=(null==c?void 0:c["x-read-pretty"])||u.readPretty||p.readPretty,h=null==e?void 0:e.fieldSchema,{getField:x}=(0,a.k7)(),v=(null==e?void 0:e.collectionField)||x(c.name)||i(c["x-collection-field"]),{label:g}=(null==(t=c["x-component-props"])?void 0:t.fieldNames)||{};return((0,n.useMemo)(()=>{if(!v||!(null==v?void 0:v.interface)||!["hasOne","hasMany","belongsTo","belongsToMany","belongsToArray"].includes(v.type))return;let e=s(v.target);if((null==e?void 0:e.template)==="file")return m?[{label:o("Title"),value:"Select"},{label:o("File manager"),value:"FileManager"},{label:o("Tag"),value:"Tag"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},{label:o("File manager"),value:"FileManager"}];if((null==e?void 0:e.template)==="tree"&&["m2m","o2m","m2o"].includes(v.interface))return m?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!h&&{label:o("Sub-details"),value:"Nester"},!h&&{label:o("Sub-table"),value:"SubTable"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!h&&["m2m","o2m"].includes(v.interface)&&{label:o("Sub-table"),value:"SubTable"},!h&&{label:o("Cascader Select"),value:"CascadeSelect"},!h&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];switch(v.interface){case"o2m":return m?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!h&&{label:o("Sub-table"),value:"SubTable"},!h&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!h&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"},!h&&{label:o("Sub-table"),value:"SubTable"}];case"m2m":case"mbm":return m?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!h&&{label:o("Sub-details"),value:"Nester"},!h&&{label:o("Sub-table"),value:"SubTable"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!h&&{label:o("Sub-table"),value:"SubTable"},!h&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];default:return m?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!h&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!h&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}]}},[o,null==v?void 0:v.interface,g,m,h])||[]).filter(Boolean)}},4922(e,t,o){o.d(t,{Y:()=>n});let l=()=>({}),n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{useProps:t=l,...o}=e,n=t;"function"!=typeof t&&(n=l);let r=n();return{...o,...r}}},39247(e,t,o){o.d(t,{F:()=>r});var l=o(51649),n=o(63557);function r(){return(0,l.useContext)(n.u)}},82924(e,t,o){o.d(t,{iI7:()=>D.iI,a1G:()=>c.ShowFormData,yt2:()=>tm.yt,flR:()=>a.fl,FVw:()=>nW.FV,FrL:()=>nh.Fr,CqQ:()=>L,$Eq:()=>j,ZB7:()=>nW.ZB,TrS:()=>tm.Tr,sIN:()=>aS.sI,a2g:()=>c.getRenderContent,t6u:()=>u.t6,qIn:()=>lX.qI,HPy:()=>a.HP,R_2:()=>lW.R_,doK:()=>D.do,bZ4:()=>a.bZ,pxY:()=>ec.px,pde:()=>lW.pd,CEt:()=>nh.CE,lum:()=>ec.lu,OpO:()=>u.Op,tO8:()=>a.tO,nxV:()=>nh.nx,TDj:()=>tU,xA9:()=>nW.xA,lNE:()=>rB.l,ud$:()=>e5,l46:()=>np,X_:()=>c.DraggableContext,QD_:()=>nh.QD,ud1:()=>a.ud,Dgp:()=>D.Dg,tvd:()=>D.tv,QEB:()=>rY,X6x:()=>rF.X6,jZb:()=>tY,tn0:()=>lX.tn,dF1:()=>ot.dF,kBD:()=>ec.kB,Gjn:()=>a.Gj,VFg:()=>rF.VF,Pnr:()=>nh.Pn,zN:()=>a.zN,dKS:()=>rP,LMh:()=>lW.LM,lTd:()=>eF,rlt:()=>eI,dWC:()=>th.dW,cWk:()=>a.cW,Zy6:()=>tm.Zy,PB5:()=>rz.PB,UTu:()=>nh.UT,jeY:()=>D.je,TB2:()=>a.TB,D6h:()=>nG,d9b:()=>ot.d9,fM:()=>tz,X43:()=>tH.X,uc_:()=>nT,pEl:()=>rz.pE,T$Q:()=>tH.T,GD6:()=>u.GD,mJi:()=>lW.mJ,C5g:()=>tV.C5,OJX:()=>ec.OJ,Bmi:()=>aa,u4V:()=>aE.u,lrV:()=>nh.lr,fDF:()=>r.fD,N$k:()=>e1.N$,_sT:()=>ot._s,rNg:()=>tO.rN,RhU:()=>a.Rh,Bnf:()=>oV,UyB:()=>e2,xq$:()=>D.xq,RB3:()=>rz.RB,I5x:()=>eP,hqJ:()=>lW.hq,XIK:()=>r7,m2w:()=>lz,ccy:()=>aN,NVg:()=>tV.NV,kDr:()=>D.kD,J3t:()=>th.J3,d09:()=>a.d0,AG:()=>ag,Xjr:()=>oU,uwA:()=>e1.uw,KDQ:()=>em,$mi:()=>oT.$,L1H:()=>c.Sortable,QoO:()=>nh.Qo,q7s:()=>D.q7,Mp5:()=>c.DndContext,xB5:()=>ec.xB,B4G:()=>D.B4,YIz:()=>rc,$xS:()=>rq,o8F:()=>oH,qKt:()=>rz.qK,_OO:()=>ot._O,qy$:()=>no,W1t:()=>tm.W1,Z0V:()=>lX.Z0,cGx:()=>nv,Q2z:()=>nh.Q2,YW0:()=>tM,HvB:()=>u.Hv,ic7:()=>nU,QpY:()=>D.Qp,tUM:()=>am,oAT:()=>D.oA,zBI:()=>e6,gBz:()=>c.SortableProvider,eIh:()=>D.eI,i_r:()=>nY.i,DVX:()=>D.DV,b7u:()=>e1.b7,Mwt:()=>rz.Mw,Kql:()=>a.Kq,XOn:()=>D.XO,ozN:()=>rk.o,nu1:()=>tp.n,rTt:()=>aS.rT,eBw:()=>nK,xZI:()=>ec.xZ,MIq:()=>a.MI,JaO:()=>nz,htN:()=>eN,Eaz:()=>a.E,qy5:()=>nd,IX0:()=>tO.IX,lSn:()=>tV.lS,BsJ:()=>e1.Bs,_22:()=>rL,sxL:()=>oC,xPi:()=>tp.x,b2W:()=>nO.b,sDQ:()=>r$,Xzy:()=>D.Xz,gt0:()=>rE,QIX:()=>e4,i_F:()=>lK,Ypd:()=>a.Yp,SOm:()=>e1.SO,VXI:()=>a.VX,nKd:()=>tR,N3p:()=>u.N3,dJT:()=>e1.dJ,vPC:()=>D.vP,a97:()=>ec.a9,TNL:()=>D.TN,xAQ:()=>tF,Qgm:()=>rF.Qg,RLS:()=>rn,OqW:()=>e1.Oq,j0_:()=>n_,zVE:()=>ab,yVm:()=>a.yV,B_g:()=>nx,Hbp:()=>ec.Hb,lhV:()=>D.lh,yGk:()=>e1.yG,QIi:()=>ec.QI,Q00:()=>rM,OAH:()=>u.OA,JQe:()=>D.JQ,xqq:()=>a.xq,zEg:()=>e7.z,wN6:()=>rk.w,fDM:()=>nh.fD,uUT:()=>tq,BCL:()=>r3.BC,D50:()=>a.D5,Fag:()=>ec.F,MoU:()=>a.Mo,wnJ:()=>e1.wn,ISS:()=>rF.IS,m$h:()=>t1,c_d:()=>e1.c_,Hi5:()=>ad,x1p:()=>nh.x1,DYS:()=>u.DY,U6o:()=>a.U6,LjE:()=>ec.Lj,l2i:()=>a.l2,Um:()=>e1.Um,Y2j:()=>tP,O$4:()=>rz.O$,G2C:()=>t7.G2,wA7:()=>aI,$t1:()=>D.$t,_bM:()=>ot._b,b6K:()=>oT.b,vzL:()=>nt,lNX:()=>ot.lN,rcl:()=>a.rc,gZ:()=>rz.gZ,msY:()=>nh.ms,U8O:()=>a.U8,Sh8:()=>a.Sh,mhY:()=>ec.mh,tXY:()=>tV.tX,Sc0:()=>oF,p9h:()=>as,gBZ:()=>c.SortableContext,JDj:()=>av,hbv:()=>nm,RD4:()=>n$.R,bee:()=>rz.be,PSc:()=>a.PS,hsK:()=>e7.h,oVU:()=>l5,IJ7:()=>D.IJ,f2z:()=>oQ.f,OZ6:()=>rF.OZ,pA3:()=>e1.pA,$5j:()=>a.$5,J1:()=>D.J1,dVP:()=>c.DateFilterDynamicComponent,E76:()=>a.E7,j9R:()=>lJ,vjx:()=>nj,mz8:()=>nW.mz,Doh:()=>u.Do,vxQ:()=>l9,Us6:()=>ec.Us,UqM:()=>c.SortableItem,lVW:()=>T,f7I:()=>ay,ARu:()=>t0,TDH:()=>ec.TD,l6P:()=>eC,g9w:()=>e1.g9,s23:()=>tL,GjU:()=>a.nY,GmQ:()=>rz.Gm,skP:()=>na,C4D:()=>nn,arW:()=>ra,v93:()=>ar,Wis:()=>a.Wi,jE9:()=>ec.jE,dbD:()=>nR.d,Ff5:()=>D.Ff,gM2:()=>e1.gM,FZR:()=>lW.FZ,PnP:()=>aC.P,nlx:()=>eM,AQf:()=>lX.AQ,FoY:()=>rN,w2W:()=>rz.w2,z45:()=>a.z4,bkX:()=>tG,jgC:()=>an,Ur4:()=>aM,lE3:()=>D.lE,U5u:()=>D.U5,LtX:()=>a.Lt,cl6:()=>rx,d1R:()=>ec.d1,rrz:()=>th.rr,B8B:()=>r_,hY7:()=>oQ.h,Ob5:()=>tm.Ob,erX:()=>ec.er,MqW:()=>u.Mq,S5r:()=>nO.S,YYe:()=>ec.YY,ami:()=>aS.am,LBS:()=>nV,L3t:()=>c.DragHandler,oMF:()=>eh});var l,n={};o.r(n),o.d(n,{Action:()=>a.rc,ActionBar:()=>a.E7,ActionBarProvider:()=>a.xq,ActionContext:()=>a.yV,ActionContextNoRerender:()=>a.Wi,ActionContextProvider:()=>a.z4,ActionDesigner:()=>a.U6,AfterSuccess:()=>a.Kq,AllDataBlocksContext:()=>th.rr,AllDataBlocksProvider:()=>th.J3,AntdSchemaComponentPlugin:()=>tG,AntdSchemaComponentProvider:()=>tU,AppendsTreeSelect:()=>t1,AssignedFieldValues:()=>a.TB,AssociationField:()=>lz,AssociationFieldMode:()=>oV,AssociationFieldModeProvider:()=>oH,AssociationSelect:()=>lK,AttachmentList:()=>ot._s,AutoComplete:()=>lJ,BackButtonUsedInSubPage:()=>e7.h,Block:()=>nK,BlockItem:()=>lX.Z0,BlockItemCard:()=>lX.tn,BlockItemCardContext:()=>lX.AQ,BlocksSelector:()=>a.Gj,ButtonEditor:()=>a.Yp,CardItem:()=>l5,Cascader:()=>l9,Checkbox:()=>oF,CollectionSelect:()=>nt,ColorPicker:()=>na,ColorSelect:()=>nd,Cron:()=>np,CronSet:()=>nm,DataSourceCollectionCascader:()=>nn,DataSourceSelect:()=>no,DateFormatCom:()=>nO.b,DatePicker:()=>nh.lr,DatePickerProvider:()=>nh.Qo,Details:()=>nx,DetailsDesigner:()=>L,Divider:()=>nv,EditComponent:()=>D.iI,EditDefaultValue:()=>D.tv,EditDescription:()=>D.JQ,EditOperator:()=>D.B4,EditPattern:()=>D.$t,EditRequired:()=>D.Qp,EditSortField:()=>an,EditTable:()=>n_,EditTableAction:()=>nj,EditTableActionContext:()=>nT,EditTitle:()=>D.Xz,EditTitleField:()=>D.Ff,EditTooltip:()=>D.IJ,EditValidationRules:()=>D.vP,Editable:()=>rN,EllipsisWithTooltip:()=>lW.R_,ErrorFallback:()=>tp.x,Expand:()=>nz,ExpiresRadio:()=>nO.S,FieldsTreeSelect:()=>t0,Fieldset:()=>nV,Filter:()=>e1.dJ,FilterAction:()=>e1.Bs,FilterActionContext:()=>e1.SO,FilterContext:()=>e1.gM,FilterDynamicComponent:()=>e1.N$,FilterLogicContext:()=>e1.c_,Form:()=>T,FormDialog:()=>n$.R,FormDrawer:()=>aI,FormField:()=>e6,FormItem:()=>D.eI,FormV2:()=>eN,G2Plot:()=>nG,G2PlotRenderer:()=>nU,Grid:()=>nW.xA,GridCard:()=>rn,GridRowContext:()=>nW.mz,HTMLEncode:()=>lW.mJ,ICON_POPUP_Z_INDEX:()=>oT.b,IconPicker:()=>ra,Input:()=>lW.pd,InputNumber:()=>rc,InputReadPretty:()=>lW.FZ,InputRecordPicker:()=>rz.qK,Json:()=>lW.LM,LinkageFilter:()=>aN,List:()=>r_,Markdown:()=>rk.o,MarkdownReadPretty:()=>rk.w,Menu:()=>tm.W1,NanoIDInput:()=>rM,Page:()=>tM,PagePopups:()=>tO.rN,PageTabs:()=>tP,Pagination:()=>rP,ParentRouteContext:()=>tm.Zy,Password:()=>rL,Percent:()=>rY,PopupSettingsProvider:()=>tH.T,Preview:()=>rB.l,QuickEdit:()=>rE,Radio:()=>oC,ReadPretty:()=>lW.hq,ReadPrettyRecordPicker:()=>rz.w2,RecordPicker:()=>rz.O$,RecordPickerContext:()=>rz.pE,RecordPickerProvider:()=>rz.be,RefreshDataBlockRequest:()=>a.ud,RemoteSelect:()=>eF,RemoveButton:()=>a.d0,RemoveConditionContext:()=>e1.b7,RequestSettings:()=>a.Rh,RichText:()=>r$,SecondConFirm:()=>a.VX,Select:()=>eC,SkipValidation:()=>a.zN,Space:()=>rq,StablePopover:()=>oT.$,Table:()=>r7,TableBlockDesigner:()=>ar,TableField:()=>aa,TableSelectorDesigner:()=>as,TableV2:()=>ad,Tabs:()=>am,TabsContextProvider:()=>oQ.h,Templates:()=>eP,TestDesigner:()=>lX.qI,TextAreaWithGlobalScope:()=>aM,TimePicker:()=>ag,TreeSelect:()=>ay,UnixTimestamp:()=>ab,Upload:()=>ot._O,Uploader:()=>ot.d9,Variable:()=>aS.rT,VariableScopeProvider:()=>aS.sI,VariableSelect:()=>aC.P,actionSettings:()=>a.Sh,actionSettingsItems:()=>a.Mo,allowAddNew:()=>D.lE,attachmentFileTypes:()=>ot.lN,defaultFieldNames:()=>em,fetchTemplateData:()=>eI,filterFormItemSettings:()=>D.Dg,findByUid:()=>rF.X6,findKeysByUid:()=>rF.VF,findMenuItem:()=>rF.OZ,formDetailsSettings:()=>e4,formItemSettings:()=>D.DV,formSettings:()=>e2,formV1Settings:()=>j,genStyleHook:()=>r.fD,getCurrentOptions:()=>eh,getDateExact:()=>nh.Q2,getDatePickerLabels:()=>rz.Mw,getDateRanges:()=>nh.fD,getLabelFormatValue:()=>rz.PB,getPopupPathFromParams:()=>tV.C5,getStoredPopupContext:()=>tV.lS,getTabSchema:()=>tY,getZIndex:()=>a.fl,handleDateChangeOnForm:()=>nh.QD,inferPickerType:()=>nh.Pn,isBulkEditAction:()=>a.PS,isFileCollection:()=>D.XO,isMobile:()=>nh.Fr,isShowFilePicker:()=>rz.Gm,isTabPage:()=>tR,isWriteEmailAction:()=>a.cW,mapDatePicker:()=>nh.x1,mapRangePicker:()=>nh.UT,mapTimeFormat:()=>av,matchMimetype:()=>ot._b,moment2str:()=>nh.ms,navigateToTab:()=>tL,pageSettings:()=>tz,pageTabSettings:()=>tq,readPrettyFormSettings:()=>e5,removeNullCondition:()=>e1.pA,resolveFilterPickerFormat:()=>nh.CE,storePopupContext:()=>tV.NV,useActionBarContext:()=>a.MI,useActionContext:()=>a.D5,useAfterSuccessOptions:()=>a.bZ,useAllDataBlocks:()=>th.dW,useAssociationFieldContext:()=>t7.G2,useAssociationFieldModeContext:()=>oU,useBackButton:()=>e7.z,useCloseAction:()=>a.nY,useColumnSchema:()=>r3.BC,useColumnSettings:()=>nR.d,useCurrentPopupContext:()=>tO.IX,useDatePickerContext:()=>nh.nx,useDownloadLogs:()=>tp.n,useEnsureOperatorsValid:()=>D.lh,useFieldMode:()=>D.J1,useFieldNames:()=>rz.gZ,useFilterActionProps:()=>e1.Um,useFilterFieldOptions:()=>e1.g9,useFilterFieldProps:()=>e1.yG,useFilterOptions:()=>e1.uw,useFormDataTemplates:()=>eM,useGetAriaLabelOfAction:()=>a.U8,useGetAriaLabelOfDrawer:()=>a.HP,useGetAriaLabelOfModal:()=>a.tO,useGetAriaLabelOfPopover:()=>a.l2,useGetFilterFieldOptions:()=>e1.Oq,useGetFilterOptions:()=>e1.wn,useGridContext:()=>nW.ZB,useGridRowContext:()=>nW.FV,useIsAddNewForm:()=>D.TN,useIsAssociationField:()=>D.xq,useIsFieldReadPretty:()=>D.U5,useIsFileField:()=>D.oA,useIsFormReadPretty:()=>D.q7,useIsSelectFieldMode:()=>D.je,useKeepAliveLocationSearch:()=>tF,useLabelUiSchema:()=>rz.RB,useLinkageAction:()=>a.Lt,useListBlockContext:()=>rx,useMenuDragEnd:()=>tm.yt,useMenuTranslation:()=>rF.Qg,useNocoBaseRoutes:()=>tm.Ob,useParentRoute:()=>tm.Tr,usePopupSettings:()=>tH.X,useStyles:()=>rF.IS,useTableColumnIntegration:()=>nY.i,useTabsContext:()=>oQ.f,useTitleFieldOptions:()=>D.kD,useUploadStyles:()=>ot.dF,useValidateSchema:()=>D.do,useVariableScope:()=>aS.am,useZIndexContext:()=>a.$5,withSearchParams:()=>tV.tX,zIndexContext:()=>a.E});var r=o(54969),a=o(78562),i=o(71178),s=o(51649),d=o(83468),c=o(91032),u=o(90995),p=o(72548);let m=e=>async function(){try{var t;let o=await this.api.request(e);return null==o||null==(t=o.data)?void 0:t.data}catch(e){return[]}};var h=o(56220),x=o(44814),v=o(56920),g=o(52793),f=o(16211),y=o(43288),b=o(30644),S=o(99300),C=o(25952),_=o(96932),k=o(24768);let F=e=>{let{form:t,children:o,...l}=e,n=(0,v.useField)(),r=(0,v.useFieldSchema)(),a=(0,ec.TD)(t.createVoidField({...n.props,basePath:""}));return(0,i.jsx)(v.FieldContext.Provider,{value:void 0,children:(0,i.jsx)(v.FormContext.Provider,{value:t,children:(0,i.jsx)(h.FormLayout,{layout:"vertical",...l,children:(0,i.jsx)(b.dw,{basePath:a.address,schema:r,onlyRenderProperties:!0})})})})},M=e=>e.children,P=e=>{let{form:t,children:o,disabled:l,...n}=e,r=(0,v.useField)(),a=(0,v.useFieldSchema)(),d=(0,ec.TD)(t.createVoidField({...r.props,basePath:""})),c=(0,ec.xZ)(a["x-component"],M);return(0,s.useEffect)(()=>{t.disabled=l||r.disabled},[l,r.disabled]),(0,i.jsx)(g.ConfigProvider,{componentDisabled:l,children:(0,i.jsx)(v.FieldContext.Provider,{value:void 0,children:(0,i.jsx)(v.FormContext.Provider,{value:t,children:(0,i.jsx)(h.FormLayout,{layout:"vertical",...n,children:(0,i.jsx)(v.FieldContext.Provider,{value:d,children:(0,i.jsx)(c,{...r.componentProps,children:(0,i.jsx)(b.dw,{basePath:d.address,schema:a,onlyRenderProperties:!0})})})})})})})},I=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,f.bP)((e=>{let{request:t,initialValue:o}=e;return t||(()=>Promise.resolve({data:o}))})(t),e)},A=(0,s.createContext)(null);A.displayName="FormBlockContext";let T=(0,v.observer)(e=>{let{request:t,effects:o,initialValue:l,useValues:n=I,...r}=e,a=(0,v.useFieldSchema)(),d=(0,v.useField)(),c=(0,s.useMemo)(()=>(0,x.createForm)({effects:o}),[]),u=n({uid:a["x-uid"],async onSuccess(e){await c.reset(),c.setValues(null==e?void 0:e.data),c.setInitialValues(null==e?void 0:e.data)}},e),p=(0,s.useContext)(A);return(0,i.jsx)(A.Provider,{value:{parent:p,form:c,result:u,field:d,fieldSchema:a},children:(0,i.jsx)(g.Spin,{spinning:(null==u?void 0:u.loading)||!1,children:"Form"===a["x-decorator"]?(0,i.jsx)(P,{form:c,...r}):(0,i.jsx)(F,{form:c,...r})})})},{displayName:"Form"});T.Designer=function(){let{name:e,title:t}=(0,y.k7)(),o=(0,_.D$)(),{componentNamePrefix:l}=(0,k.kU)();return(0,i.jsxs)(S.xK,{template:o,title:t||e,children:[(0,i.jsx)(C.l,{componentName:`${l}Form`,collectionName:e}),(0,i.jsx)(S.kT,{}),(0,i.jsx)(S.d$,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})};var w=o(31675);let j=new w.RT({name:"FormV1Settings",items:[{name:"template",Component:C.l,useComponentProps(){let{name:e}=(0,y.k7)(),{componentNamePrefix:t}=(0,k.kU)();return{componentName:`${t}Form`,collectionName:e}}},{name:"divider",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]});var D=o(60929);let L=()=>{let{name:e,title:t}=(0,y.k7)(),o=(0,_.D$)();return(0,i.jsx)(S.xK,{schemaSettings:"FormDetailsSettings",template:o,title:t||e})};var R=o(69412),Y=o(80461),B=o(99847),N=o(49948),E=o(10691),z=o(27404),O=o(77583),V=o(20629),$=o(18111),q=o(70136),H=o(28227),U=o(14187),G=o(92619),K=o(4627),W=o(83006),J=o(43923),X=o(4922),Z=o(95951),Q=o(95210),ee=o(62152),et=o(63526),eo=o(77843),el=o(69575),en=o(65457),er=o(82113),ea=o(91815),ei=o(23460),es=o(29558),ed=o(58980),ec=o(16319),eu=o(46724),ep=o(81607);let em={label:"label",value:"value",color:"color",options:"children"};function eh(e,t,o){let l=function e(t,o){let l=[];if(!Array.isArray(t))return l;for(let n=0;n<t.length;n++){let r=t[n][o.options];Array.isArray(r)&&l.push(...e(r,o)),l.push({...t[n]})}return l}(t,o),n=(0,O.castArray)(e).map(e=>(0,et.isPlainObject)(e)?e[o.value]:e);if(!l)return[];let r=[];for(let e of n){let t=l.find(t=>t[o.value]==e)||{value:e,label:e?e.toString():e};r.push(t)}return r}var ex=o(84951),ev=o(60430);let eg=(0,v.observer)(e=>{let[t,o]=(0,s.useState)(!0),[l,n]=(0,s.useState)([]),r=(0,v.useField)(),a=(0,eu.E1)();return((0,s.useEffect)(()=>{var t;let l={...em,...e.fieldNames},s=r.dataSource||e.options||(null==a?void 0:a.uiSchema.enum)||[],d=eh(r.value,s,l);!(0,z.isValid)(e.value)&&!d.length||(0,x.isArrayField)(r)&&(null==r||null==(t=r.value)?void 0:t.length)===0||(n(null!==r.value&&d.map((e,t)=>(0,i.jsx)(g.Tag,{color:e[l.color],icon:"string"==typeof e.icon?(0,i.jsx)(ev.In,{type:e.icon}):e.icon,children:e[l.label]},t))),o(!1))},[null==a?void 0:a.uiSchema.enum,r,r.dataSource,r.value,e.fieldNames,e.options,e.value]),t)?null:(0,i.jsx)(ep.R,{ellipsis:e.ellipsis,children:l})},{displayName:"SelectReadPretty"}),ef=(0,ex.A)(eg),ey=e=>{let{value:t,options:o,onChange:l,fieldNames:n,mode:r,loading:a,rawOptions:s,defaultValue:d,...c}=e,u=eL.isDesktop?"":eS,p=eL.isDesktop?void 0:"topLeft",m=t=>{var l;if(!(0,z.isValid)(t)||"object"==typeof t&&0===Object.keys(t).length)return;let a=null==(l=eh((0,z.toArr)(t).filter(e=>e).map(e=>(0,et.isPlainObject)(e)?e[n.value]:e),o,n))?void 0:l.map(e=>({label:e[n.label],value:e[n.value]}));return["tags","multiple"].includes(r)||e.multiple?a:a.shift()};return(0,i.jsx)(g.Select,{rootClassName:u,placement:p,role:"button","data-testid":`select-object-${r||"single"}`,value:m(t),defaultValue:m(d),allowClear:{clearIcon:(0,i.jsx)(er.CloseCircleFilled,{role:"button","aria-label":"icon-close-select"})},labelInValue:!0,notFoundContent:a?(0,i.jsx)(g.Spin,{}):(0,i.jsx)(g.Empty,{image:g.Empty.PRESENTED_IMAGE_SIMPLE}),options:o,fieldNames:n,showSearch:!0,popupMatchSelectWidth:!1,filterOption:(e,t)=>((null==t?void 0:t[n.label||"label"])??"").includes(e),filterSort:(e,t)=>((null==e?void 0:e[n.label||"label"])??"").toLowerCase().localeCompare(((null==t?void 0:t[n.label||"label"])??"").toLowerCase()),onChange:t=>{let a=eh((0,z.toArr)(t).map(e=>e.value),s||o,n);["tags","multiple"].includes(r)||e.multiple?null==l||l(a):null==l||l(a.shift()||null)},mode:r,tagRender:e=>(0,i.jsx)(g.Tag,{role:"button","aria-label":e.label,closeIcon:(0,i.jsx)(er.CloseOutlined,{role:"button","aria-label":"icon-close-tag"}),...e,children:e.label}),maxTagCount:"responsive",maxTagPlaceholder:e=>(0,i.jsxs)(g.Tooltip,{title:(0,i.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,maxWidth:"100%"},children:e.map(e=>(0,i.jsx)(g.Tag,{style:{margin:0,background:"#fafafa",border:"1px solid #d9d9d9",whiteSpace:"normal",wordBreak:"break-word",maxWidth:"100%"},children:e.label},e.value))}),overlayInnerStyle:{background:"#fff",color:"#000",padding:8,maxWidth:"100%"},color:"#fff",overlayStyle:{pointerEvents:"auto",maxWidth:300},children:["+",e.length,"..."]}),...c})},eb=(e,t)=>((null==t?void 0:t.label)??"").toLowerCase().includes((e||"").toLowerCase()),eS=(0,E.css)`
|
|
968
968
|
& .ant-select-selection-search-input {
|
|
969
969
|
opacity: 0.1 !important;
|
|
970
970
|
}
|
|
@@ -1694,7 +1694,7 @@ ${JSON.stringify(s,null,2)}`)},[A,P,M,C,S,H,t,F,k,Y,o,B,O,U,V,$,R]),K=(0,r.useCa
|
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
1696
|
}
|
|
1697
|
-
`),children:[(0,r.jsx)(o,{}),e.children,a()]})})};ey.Provider=eg.to,ey.Item=em,ey.Item.Designer=e=>{var t,o,l,n,a;let i=(0,L.useFieldSchema)(),{form:s}=(0,ex.Es)(),d=(0,L.useField)(),{t:c}=(0,x.useTranslation)(),{getCollectionJoinField:u}=(0,F.nj)(),{getField:p}=(0,F.k7)(),m=p(i.name)||u(i["x-collection-field"]),{getCollectionFields:h}=(0,F.nj)(),v=(0,X.lu)(),{dn:g}=(0,X.er)(),f=(null==m?void 0:m.target)?h(null==m?void 0:m.target):[],y=d.componentProps.defaultCollapse,b=f.filter(e=>!(null==e?void 0:e.target)&&"boolean"!==e.type).map(e=>{var t;return{value:null==e?void 0:e.name,label:v(null==e||null==(t=e.uiSchema)?void 0:t.title)||(null==e?void 0:e.name)}});return(0,r.jsxs)(Q.xK,{...e,disableInitializer:!0,children:[(0,r.jsx)(Q.fY,{title:c("Custom title"),schema:{type:"object",title:c("Custom title"),properties:{title:{default:null==i?void 0:i.title,description:`${c("Original title: ")}${(null==m||null==(t=m.uiSchema)?void 0:t.title)||(null==i?void 0:i.title)}`,"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit:e=>{let{title:t}=e;t&&(i.title=t,g.emit("patch",{schema:{"x-uid":i["x-uid"],title:i.title}})),g.refresh()}}),(0,r.jsx)(Q.Qd,{title:c("Default expanded"),checked:y,onChange:e=>{d.componentProps.defaultCollapse=e,eh.default.set(i,"x-component-props.defaultCollapse",e),g.emit("patch",{schema:{"x-uid":i["x-uid"],"x-component-props":i["x-component-props"]}}),g.refresh()}}),(0,r.jsx)(ev.Z,{collectionName:null==m?void 0:m.target,defaultFilter:(null==i||null==(l=i["x-component-props"])||null==(o=l.params)?void 0:o.filter)||{},form:s,onSubmit:e=>{var t;let{filter:o}=e;eh.default.set(d.componentProps,"params",{...null==(t=d.componentProps)?void 0:t.params,filter:o}),i["x-component-props"].params=d.componentProps.params,g.emit("patch",{schema:{"x-uid":i["x-uid"],"x-component-props":i["x-component-props"]}})}}),(0,r.jsx)(Q.lZ,{name:null==m?void 0:m.target}),(0,r.jsx)(Q.Al,{title:c("Title field"),options:b,value:null==(a=i["x-component-props"])||null==(n=a.fieldNames)?void 0:n.label,onChange:e=>{var t,o,l;let n={"x-uid":i["x-uid"]},r={...null==m||null==(o=m.uiSchema)||null==(t=o["x-component-props"])?void 0:t.fieldNames,...null==(l=i["x-component-props"])?void 0:l.fieldNames,label:e};i["x-component-props"]=i["x-component-props"]||{},i["x-component-props"].fieldNames=r,n["x-component-props"]=i["x-component-props"],g.emit("patch",{schema:n}),g.refresh()}},"title-field"),(0,r.jsx)(Q.d$,{breakRemoveOn:{"x-component":"Grid"}})]})},ey.BlockDesigner=()=>{var e,t;let{name:o,title:l}=(0,F.k7)(),n=(0,el.D$)(),a=(0,L.useFieldSchema)(),{t:i}=(0,x.useTranslation)(),{componentNamePrefix:s}=(0,en.kU)(),d=(null==a||null==(e=a["x-decorator-props"])?void 0:e.resource)||(null==a||null==(t=a["x-decorator-props"])?void 0:t.association);return(0,r.jsxs)(Q.xK,{template:n,title:l||o,children:[(0,r.jsx)(ee.P,{}),(0,r.jsx)(eo.l,{componentName:`${s}FilterCollapse`,collectionName:o,resourceName:d}),(0,r.jsx)(et.$,{type:N.I1.COLLAPSE,emptyDescription:i("No blocks to connect")}),(0,r.jsx)(Q.kT,{}),(0,r.jsx)(Q.d$,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})},ey.useAssociationField=()=>{let e=(0,L.useFieldSchema)(),t=(0,g.Ge)();return a.default.useMemo(()=>null==t?void 0:t.getField(null==e?void 0:e.name),[null==e?void 0:e.name])};class eb extends n.k{async load(){this.app.schemaInitializerManager.add(G),this.app.schemaInitializerManager.add(K),this.app.schemaInitializerManager.add(W),this.app.schemaInitializerManager.add(er)}}let eS=()=>{let e=(0,c.eL)(),{refresh:t}=(0,a.useContext)(R.u4V),o=(0,L.useFieldSchema)(),l=(0,Y.VB)(),{t:n}=(0,x.useTranslation)(),i=(0,R.pxY)({t:n,api:l,refresh:t,current:o});return i.loadAPIClientEvents(),(0,r.jsx)(c.rR,{onClick:()=>{i.remove(o)},children:(0,r.jsx)("div",{children:e.title})})},eC=()=>{let e=(0,c.eL)(),{schema:t}=e,{exists:o,remove:l}=(0,f.oK)(t.name,"name",e.find,e.remove),{insert:n}=(0,c.fx)();return(0,r.jsx)(c.qX,{checked:o,title:e.title,onClick:()=>{var r;if(o)return l();let a=(0,d.merge)(t||{},e.schema||{});null==e||null==(r=e.schemaInitialize)||r.call(e,a),n(a)}})},e_=e=>{let{item:t,schema:o,...l}=e,{insert:n}=(0,c.fx)();return(0,r.jsx)(c.rR,{...l,onClick:()=>{var l,r;let a=(0,d.merge)(o||{},t.schema||{});null==t||null==(l=t.schemaInitialize)||l.call(t,a),n(a),null==(r=e.onClick)||r.call(e,a)}})},ek=()=>{let e=(0,c.eL)(),{schema:t,...o}=e;return(0,r.jsx)(e_,{...o,item:e})},eF=e=>(0,r.jsx)(I,{...e,schema:{title:'{{ t("Filter") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useFilterBlockActionProps","x-designer":"Action.Designer","x-component-props":{type:"primary",htmlType:"submit"}}}),eM=e=>(0,r.jsx)(I,{...e,schema:{title:'{{ t("Reset") }}',"x-component":"Action","x-use-component-props":"useResetBlockActionProps","x-designer":"Action.Designer"}}),eP=()=>{let e=(0,c.eL)();return(0,r.jsx)(e_,{...e,item:e})};var eI=o(3403);let eA=()=>{let e=(0,c.eL)(),{insert:t}=(0,c.fx)();return(0,r.jsx)(c.rR,{...e,onClick:()=>{t({...e.schema})}})};var eT=o(27304);let ew=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getTemplateSchemaByMode:i}=(0,el.ov)(),{getCollection:s}=(0,F.nj)(),d=e.field,u=s(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.TableOutlined,{}),...n,onClick:async e=>{let{item:t}=e;t.template?a(await i(t)):a((0,eT.D)({dataSource:u.dataSource,association:p}))},items:(0,f.aU)("Table",e,d.target,p)})};function ej(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createAssociationTableBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e((0,eT.D)({dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e])}}function eD(e){let{collectionName:t,dataSource:o,association:l,templateSchema:n,hideActionInitializer:r,rowKey:a}=e;if(!o||!a)throw Error("dataSource and rowKey are required");return{type:"void","x-acl-action":`${l||t}:view`,"x-decorator":"DetailsBlockProvider","x-use-decorator-props":"useDetailsWithPaginationDecoratorProps","x-decorator-props":{dataSource:o,collection:t,association:l,readPretty:!0,action:"list",params:{pageSize:1}},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:detailsWithPagination","x-component":"CardItem",properties:{[(0,d.uid)()]:{type:"void","x-component":"Details","x-read-pretty":!0,"x-use-component-props":"useDetailsWithPaginationProps",properties:{[(0,d.uid)()]:{type:"void","x-initializer":r?void 0:"details:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{}},grid:n||{type:"void","x-component":"Grid","x-initializer":"details:configureFields",properties:{}},pagination:{type:"void","x-component":"Pagination","x-use-component-props":"useDetailsPaginationProps"}}}}}}let eL=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getTemplateSchemaByMode:i}=(0,el.ov)(),{getCollection:s}=(0,F.nj)(),d=e.field,u=s(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.FormOutlined,{}),...n,onClick:async e=>{let{item:t}=e;t.template?a(await i(t)):a(eD({dataSource:u.dataSource,association:p,rowKey:u.filterTargetKey||"id"}))},items:(0,f.aU)("Details",e,d.target,p)})};function eR(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createAssociationDetailsBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e(eD({dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`,rowKey:r.filterTargetKey||"id"}))},[t,e])}}var eY=o(59682);let eB=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:i}=(0,c.fx)(),{getCollection:s}=(0,F.nj)(),{getTemplateSchemaByMode:d}=(0,el.ov)(),u=e.field,p=u.target,m=(0,a.useMemo)(()=>s(p),[p]);return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.FormOutlined,{}),...n,onClick:async e=>{let{item:t}=e;if(t.template){let e=await d(t);if("FormItem"===t.template.componentName){let o=(0,eY.B)({dataSource:m.dataSource,association:`${u.collectionName}.${u.name}`,templateSchema:e});"reference"===t.mode&&(o["x-template-key"]=t.template.key),i(o)}else i(e)}else i((0,eY.B)({dataSource:m.dataSource,association:`${u.collectionName}.${u.name}`}))},items:(0,f.aU)("FormItem",e,m,`${u.collectionName}.${u.name}`)})};function eN(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)(),{componentNamePrefix:o}=(0,el.kU)();return{createAssociationFormBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e((0,eY.B)({dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e]),templateWrap:(0,a.useCallback)((e,l)=>{let{item:n}=l;if(n.template.componentName!==`${o}FormItem`||!n.associationField)return e;{let o=n.associationField,l=t(o.target),r=(0,eY.B)({dataSource:l.dataSource,association:`${o.collectionName}.${o.name}`,templateSchema:e});return"reference"===n.mode&&(r["x-template-key"]=n.template.key),r}},[t,o])}}let eE=e=>{let{collectionName:t,association:o,templateSchema:l,dataSource:n,rowKey:r}=e;if(!n)throw Error("dataSource are required");return{type:"void","x-acl-action":`${o||t}:view`,"x-decorator":"GridCard.Decorator","x-use-decorator-props":"useGridCardBlockDecoratorProps","x-decorator-props":{collection:t,association:o,dataSource:n,readPretty:!0,action:"list",params:{pageSize:12},runWhenParamsChanged:!0,rowKey:r},"x-component":"BlockItem","x-use-component-props":"useGridCardBlockItemProps","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:gridCard",properties:{actionBar:{type:"void","x-initializer":"gridCard:configureActions","x-component":"ActionBar","x-use-component-props":"useGridCardActionBarProps"},list:{type:"array","x-component":"GridCard","x-use-component-props":"useGridCardBlockProps",properties:{item:{type:"object","x-component":"GridCard.Item","x-read-pretty":!0,"x-use-component-props":"useGridCardItemProps",properties:{grid:l||{type:"void","x-component":"Grid","x-initializer":"details:configureFields"},actionBar:{type:"void","x-align":"left","x-initializer":"gridCard:configureItemActions","x-component":"ActionBar","x-use-component-props":"useGridCardActionBarProps","x-component-props":{layout:"one-column"}}}}}}}}},ez=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getTemplateSchemaByMode:i}=(0,el.ov)(),{getCollection:s}=(0,F.nj)(),d=e.field,u=s(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.TableOutlined,{}),...n,onClick:async e=>{let{item:t}=e;t.template?a(await i(t)):a(eE({rowKey:u.filterTargetKey,dataSource:u.dataSource,association:p}))},items:(0,f.aU)("GridCard",e,d.target,p)})};function eO(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createAssociationGridCardBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e(eE({rowKey:r.filterTargetKey,dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e])}}let eV=e=>{let{collectionName:t,dataSource:o,association:l,templateSchema:n,rowKey:r}=e;return{type:"void","x-acl-action":`${l||t}:view`,"x-decorator":"List.Decorator","x-use-decorator-props":"useListBlockDecoratorProps","x-decorator-props":{collection:t,dataSource:o,association:l,readPretty:!0,action:"list",params:{pageSize:10},runWhenParamsChanged:!0,rowKey:r},"x-component":"CardItem","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:list",properties:{actionBar:{type:"void","x-initializer":"list:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--nb-spacing)"}}},list:{type:"array","x-component":"List","x-use-component-props":"useListBlockProps",properties:{item:{type:"object","x-component":"List.Item","x-read-pretty":!0,"x-use-component-props":"useListItemProps",properties:{grid:n||{type:"void","x-component":"Grid","x-initializer":"details:configureFields"},actionBar:{type:"void","x-align":"left","x-initializer":"list:configureItemActions","x-component":"ActionBar","x-use-component-props":"useListActionBarProps","x-component-props":{layout:"one-column"}}}}}}}}},e$=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getTemplateSchemaByMode:i}=(0,el.ov)(),{getCollection:s}=(0,F.nj)(),d=e.field,u=s(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.TableOutlined,{}),...n,onClick:async e=>{let{item:t}=e;t.template?a(await i(t)):a(eV({rowKey:u.filterTargetKey,dataSource:u.dataSource,association:p}))},items:(0,f.aU)("List",e,d.target,p)})};function eq(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createAssociationListBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e(eV({rowKey:r.filterTargetKey,dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e])}}function eH(e){let{collectionName:t,dataSource:o,association:l,templateSchema:n}=e,r=e.isCurrent?{"x-is-current":!0}:{};if(!o)throw Error("dataSource are required");return{type:"void","x-acl-action":`${l||t}:get`,"x-decorator":"DetailsBlockProvider","x-use-decorator-props":"useDetailsDecoratorProps","x-decorator-props":{dataSource:o,collection:t,association:l,readPretty:!0,action:"get"},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:details","x-component":"CardItem",...r,properties:{[(0,d.uid)()]:{type:"void","x-component":"Details","x-read-pretty":!0,"x-use-component-props":"useDetailsProps",properties:{[(0,d.uid)()]:{type:"void","x-initializer":"details:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{}},grid:n||{type:"void","x-component":"Grid","x-initializer":"details:configureFields",properties:{}}}}}}}let eU=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getCollection:i}=(0,F.nj)(),{getTemplateSchemaByMode:s}=(0,el.ov)(),d=e.field,u=i(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.FormOutlined,{}),...n,onClick:async e=>{let{item:t}=e;if(t.template){let e=await s(t);if("ReadPrettyFormItem"===t.template.componentName){let o=eH({dataSource:u.dataSource,association:p,templateSchema:e});"reference"===t.mode&&(o["x-template-key"]=t.template.key),a(o)}else a(e)}else a(eH({association:p,dataSource:u.dataSource}))},items:(0,f.aU)("ReadPrettyFormItem",e,u,p)})};function eG(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)(),{componentNamePrefix:o}=(0,el.kU)();return{createAssociationDetailsWithoutPagination:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField;e(eH({dataSource:t(n.target).dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e]),templateWrap:(0,a.useCallback)((e,l)=>{let{item:n}=l,r=n.associationField,a=t(r.target);if(n.template.componentName!==`${o}ReadPrettyFormItem`)return e;{let t=eH({dataSource:a.dataSource,association:`${r.collectionName}.${r.name}`,templateSchema:e});return"reference"===n.mode&&(t["x-template-key"]=n.template.key),t}},[t,o])}}let eK=e=>{let t={type:"void",title:'{{ t("Select") }}',"x-action":"update","x-designer":"Action.Designer","x-component":"Action","x-component-props":{openMode:"drawer"},properties:{drawer:{type:"void","x-component":"AssociationField.Selector",title:'{{ t("Select record") }}',"x-component-props":{className:"nb-record-picker-selector"},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:tableSelector:addBlock",properties:{}},footer:{"x-component":"Action.Container.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{submit:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"usePickActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:submit","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}};return(0,r.jsx)(u,{...e,schema:t})},eW=e=>(0,r.jsx)(u,{...e,schema:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:submit","x-component-props":{type:"primary",htmlType:"submit"}}}),eJ=()=>{let e={type:"void",title:'{{ t("Actions") }}',"x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-toolbar":"TableColumnSchemaToolbar","x-initializer":"table:configureItemActions","x-settings":"fieldSettings:TableColumn","x-toolbar-props":{initializer:"table:configureItemActions"},"x-action-column":"actions",properties:{[(0,d.uid)()]:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{}}}},t=(0,c.eL)();return(0,r.jsx)(P,{...t,schema:e,item:t,type:"x-action-column"})};var eX=o(78316),eZ=o(63526);function eQ(e){let{modalSchema:t={},components:o={},...l}=e,{properties:n,...i}=t,[s,d]=(0,a.useState)(!1),{setVisible:c}=(0,eX.useSchemaInitializer)(),u=(0,a.useMemo)(()=>({name:(0,eZ.uid)(),"x-component":"Action.Modal","x-component-props":{width:"520px"},type:"void","x-decorator":"FormV2","x-decorator-props":{},...i,properties:{...n,footer1:{"x-component":"Action.Modal.Footer",type:"void",properties:{close:{title:"Cancel","x-component":"Action","x-component-props":{type:"default"},"x-use-component-props":()=>({onClick(){var t;d(!1),null==e||null==(t=e.onCancel)||t.call(e)}})},submit:{title:"OK","x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":()=>{let t=(0,L.useForm)();return{async onClick(){var o;await t.submit(),d(!1),null==e||null==(o=e.onSubmit)||o.call(e,t.values)}}}}}}}}),[s]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eX.SchemaInitializerItem,{...l,onClick:t=>{var o;c(!1),d(!0),null==e||null==(o=e.onClick)||o.call(e,t)}}),(0,r.jsx)(eX.ActionContextProvider,{value:{visible:s,setVisible:d},children:(0,r.jsx)(eX.SchemaComponent,{components:{Action:eX.Action,...o},schema:u})})]})}let e0=e=>{let t={type:"void",title:'{{ t("Link") }}',"x-action":"customize:link","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:link","x-component":(null==e?void 0:e["x-component"])||"Action.Link","x-use-component-props":"useLinkActionProps","x-decorator":"ACLActionProvider"},o=(0,c.eL)();return(0,r.jsx)(e_,{...o,schema:t,item:o})},e1=e=>(0,r.jsx)(I,{...e,schema:{title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-use-component-props":"useRefreshActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:refresh","x-component-props":{icon:"ReloadOutlined"}}}),e2=e=>(0,r.jsx)(I,{...e,schema:{type:"void",title:'{{ t("Column Settings") }}',"x-action":"edit-table","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:editTable","x-component":"EditTable.Action","x-use-component-props":"useEditTableActionProps","x-component-props":{icon:"SettingOutlined"}}}),e5=e=>(0,r.jsx)(u,{...e,schema:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:createSubmit","x-component-props":{type:"primary",htmlType:"submit"}}}),e4=e=>(0,r.jsx)(u,{...e,schema:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useUpdateActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:updateSubmit","x-component-props":{type:"primary",htmlType:"submit"}}}),e7=e=>{let t={title:'{{ t("Update record") }}',"x-component":(null==e?void 0:e["x-component"])||"Action.Link","x-use-component-props":"useCustomizeUpdateActionProps","x-action":"customize:update","x-decorator":"ACLActionProvider","x-acl-action":"update","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:updateRecord","x-action-settings":{assignedValues:{},onSuccess:{manualClose:!1,redirecting:!1,successMessage:'{{t("Updated successfully")}}'},triggerWorkflows:[]}},o=(0,c.eL)();return(0,r.jsx)(e_,{...o,schema:t,item:o})};var e9=o(42536),e8=o(46724);let e3=e=>(0,r.jsx)(e8.bJ,{children:(0,r.jsx)(e9.aK,{children:e.children})}),te=e=>{let{defaultOpenMode:t}=(0,p.k)(),{getPopupContext:o}=(0,i.Hy)(),l={type:"void",title:'{{ t("Popup") }}',"x-action":"customize:popup","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:popup","x-component":(null==e?void 0:e["x-component"])||"Action.Link","x-component-props":{openMode:t,refreshDataBlockRequest:!0},"x-decorator":"PopupActionDecorator",properties:{drawer:{type:"void",title:'{{ t("Popup") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":(null==e?void 0:e["x-initializer"])||"popup:common:addBlock",properties:{}}}}}}}}},[s.AC]:o()},n=(0,c.eL)();return(0,r.jsx)(e_,{...n,schema:l,item:n})},tt=e=>{let{defaultOpenMode:t}=(0,p.k)(),{getPopupContext:o}=(0,i.Hy)(),l={type:"void",title:'{{ t("Associate") }}',"x-action":"associate","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:popup","x-component":"Action","x-component-props":{openMode:t,refreshDataBlockRequest:!0},properties:{drawer:{type:"void","x-component":"Action.Container",title:'{{ t("Select record") }}',"x-component-props":{className:"nb-record-picker-selector"},"x-decorator":"AssociateActionProvider",properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:tableSelector:addBlock",properties:{}},footer:{"x-component":"Action.Container.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{submit:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"usePickActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:submit","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}},[s.AC]:o()},n=(0,c.eL)();return(0,r.jsx)(e_,{...n,schema:l,item:n})};var to=o(44374),tl=o(55102);let tn=()=>{let{setSelectedRows:e}=(0,a.useContext)(ec.pE),{onRowSelectionChange:t,rowKey:o="id",...l}=(0,tl.fX)();return{...l,rowKey:o,rowSelection:{type:"checkbox"},onRowSelectionChange(o,l){null==e||e(o),null==t||t(o,l)}}},tr=e=>{let[t,o]=(0,a.useState)([]),l=(0,to.useCollection)(),{resource:n,block:i,__parent:s,service:d}=(0,to.useBlockRequestContext)(),c=(0,to.useActionContext)(),{isMobile:u}=(0,to.useOpenModeContext)()||{},[p,m]=(0,a.useState)([]),{data:h}=d||{};(0,a.useEffect)(()=>{var e;null==n||null==(e=n.list)||e.call(n,{paginate:!1}).then(e=>{var t;m((null==(t=e.data)?void 0:t.data)||[])})},[n,null==h?void 0:h.meta.count]);let x={size:"small",onChange:null==e?void 0:e.onChange,selectedRows:t,setSelectedRows:o};return(0,r.jsx)(to.ActionContextProvider,{value:{...c,openMode:u?"drawer":c.openMode},children:(0,r.jsx)(ec.be,{...x,children:(0,r.jsx)(to.SchemaComponentOptions,{scope:{useTableSelectorProps:tn,usePickActionProps:()=>{let{selectedRows:e}=(0,a.useContext)(ec.pE),{setVisible:t,setSubmitted:o,setFormValueChanged:l}=(0,to.useActionContext)();return{async onClick(r,a){if(await n.add({values:e}),a&&(null==a||a()),null==t||t(!1),null==o||o(!0),i&&"TableField"!==i){var d,c;null==s||null==(c=s.service)||null==(d=c.refresh)||d.call(c),null==t||t(!1),null==l||l(!1)}}}}},children:(0,r.jsx)(tl.bp,{params:{filter:(()=>{let e=(null==l?void 0:l.filterTargetKey)||"id";if(p){let t=p.map(t=>t[e]).filter(Boolean);return t.length?{$and:[{[`${e}.$ne`]:t}]}:{}}return{}})()},children:e.children})})})})},ta=new q.I({name:"RecordFormBlockInitializers",title:'{{ t("Add block") }}',icon:"PlusOutlined",wrap:f.xH,items:[{type:"itemGroup",title:'{{ t("Data blocks") }}',name:"dataBlocks",children:[{name:"form",title:'{{ t("Form") }}',Component:"RecordFormBlockInitializer"}]},{type:"itemGroup",title:'{{t("Other blocks")}}',name:"otherBlocks",children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]}),ti=e=>{let{defaultOpenMode:t}=(0,p.k)(),{getPopupContext:o}=(0,i.Hy)(),l={type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-acl-action":"update","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:edit","x-component":"Action","x-component-props":{openMode:t,icon:"EditOutlined"},properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Edit")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock",properties:{}}}}}}}}},[s.AC]:o()};return(0,r.jsx)(u,{...e,schema:l})},ts=e=>{let{defaultOpenMode:t}=(0,p.k)(),{getPopupContext:o}=(0,i.Hy)(),l={type:"void",title:'{{ t("View") }}',"x-action":"view","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:view","x-component":"Action","x-component-props":{openMode:t},properties:{drawer:{type:"void",title:'{{ t("View record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock",properties:{}}}}}}}}},[s.AC]:o()};return(0,r.jsx)(u,{...e,schema:l})};var td=o(58555);let tc={title:'{{t("Configure actions")}}',icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"itemGroup",title:'{{t("Enable actions")}}',name:"enableActions",children:[{name:"edit",title:'{{t("Edit")}}',Component:"UpdateActionInitializer",schema:{"x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{type:"primary"}},useVisible:()=>(0,td.$)("update")},{name:"delete",title:'{{t("Delete")}}',Component:"DestroyActionInitializer",schema:{"x-component":"Action","x-decorator":"ACLActionProvider"},useVisible:()=>(0,td.$)("destroy")}]}]},tu=new v._({name:"DetailsActionInitializers",...tc}),tp=new v._({name:"detailsWithPaging:configureActions",...tc},tu),tm=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideSearch:l,componentType:n="Details",createBlockSchema:a,templateWrap:i,showAssociationFields:s,hideChildrenIfSingleCollection:d}=e,u=(0,c.eL)(),{createDetailsBlock:p}=th();return(0,r.jsx)(eI.kq,{...u,icon:(0,r.jsx)(ea.ProfileOutlined,{}),componentType:n,onCreateBlockSchema:async e=>{if(a)return a(e);p(e)},onlyCurrentDataSource:!!o,hideSearch:l,filter:t,templateWrap:i,showAssociationFields:s,hideChildrenIfSingleCollection:d})},th=()=>{let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createDetailsBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=t(l.name,l.dataSource);e(eD({collectionName:l.name,dataSource:l.dataSource,rowKey:n.filterTargetKey||"id",hideActionInitializer:!(("view"!==n.template||(null==n?void 0:n.writableView))&&"sql"!==n.template)}))},[t,e])}};var tx=o(28227);let tv={title:'{{t("Configure actions")}}',icon:"SettingOutlined",style:{marginLeft:8},items:[{title:'{{t("Edit")}}',name:"edit",Component:"UpdateActionInitializer",schema:{"x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{type:"primary"}},useVisible:()=>(0,td.$)("update")},{title:'{{t("Delete")}}',name:"delete",Component:"DestroyActionInitializer",schema:{"x-component":"Action","x-decorator":"ACLActionProvider"},useVisible:()=>(0,td.$)("destroy")},{type:"item",title:'{{t("Disassociate")}}',name:"disassociate",Component:"DisassociateActionInitializer",schema:{"x-component":"Action","x-action":"disassociate","x-acl-action":"update","x-decorator":"ACLActionProvider"},useVisible(){var e,t;let o=(0,tx.h6)(),l=(0,tx.Ge)()||{},{unavailableActions:n,availableActions:r}=(null==l?void 0:l.options)||{};return r?!!(null==o?void 0:o.association)&&(null==(e=r.includes)?void 0:e.call(r,"update")):!n||!!(null==o?void 0:o.association)&&!(null==n||null==(t=n.includes)?void 0:t.call(n,"update"))}},{name:"popup",title:'{{t("Popup")}}',Component:"PopupActionInitializer",useComponentProps:()=>({"x-component":"Action"})},{name:"updateRecord",title:'{{t("Update record")}}',Component:"UpdateRecordActionInitializer",useComponentProps:()=>({"x-component":"Action"}),useVisible:()=>(0,td.$)("update")},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer"},{name:"link",title:'{{t("Link")}}',Component:"LinkActionInitializer",useComponentProps:()=>({"x-component":"Action"})}]},tg=new v._({name:"ReadPrettyFormActionInitializers",...tv}),tf=new v._({name:"details:configureActions",...tv},tg);var ty=o(94003);let tb={wrap:f.xH,icon:"SettingOutlined",title:'{{t("Configure fields")}}',items:[{type:"itemGroup",name:"displayFields",title:'{{t("Display fields")}}',useChildren:f.g_},{name:"parentCollectionFields",Component:()=>{let e=(0,f.G3)(),{t}=(0,x.useTranslation)(),o=(0,R.lum)();if(!(null==e?void 0:e.length))return null;let l=[];return e.forEach(e=>{Object.values(e)[0].length&&l.push({type:"itemGroup",divider:!0,title:t("Parent collection fields")+"("+o(`${Object.keys(e)[0]}`)+")",children:Object.values(e)[0]})}),(0,r.jsx)(ty.Z,{children:l})}},{name:"associationFields",Component:()=>{let e=(0,f.aY)({readPretty:!0,block:"Form"}),{t}=(0,x.useTranslation)();if(0===e.length)return null;let o=[{type:"itemGroup",title:t("Display association fields"),children:e}];return(0,r.jsx)(ty.Z,{children:o})}},{name:"divider",type:"divider"},{name:"addText",title:'{{t("Add Markdown")}}',Component:"BlockItemInitializer",schema:{type:"void","x-editable":!1,"x-decorator":"FormItem","x-decorator-props":{engine:"handlebars"},"x-toolbar":"FormItemSchemaToolbar","x-settings":"blockSettings:markdown","x-component":"Markdown.Void","x-component-props":{content:'{{t("This is a demo text, **supports Markdown syntax**.")}}'}}},{name:"addDivider",title:'{{t("Add group")}}',Component:"BlockItemInitializer",schema:{type:"void","x-decorator":"FormItem","x-toolbar":"FormItemSchemaToolbar","x-settings":"blockSettings:divider","x-component":"Divider","x-component-props":{children:'{{t("Group")}}'}}}]},tS=new v._({name:"ReadPrettyFormItemInitializers",...tb}),tC=new v._({name:"details:configureFields",...tb},tS),t_=()=>{let{icon:e=!0,targetCollection:t,...o}=(0,c.eL)(),l=(0,F.k7)(),n=t||l,{createSingleDetailsSchema:a}=tk();return(0,r.jsx)(c.rR,{icon:e&&(0,r.jsx)(ea.FormOutlined,{}),...o,onClick:e=>a(e),items:(0,f.aU)("ReadPrettyFormItem",null,null==n?void 0:n.name)})};function tk(){let{insert:e}=(0,c.fx)(),{getTemplateSchemaByMode:t}=(0,el.ov)(),o=(0,tx.UJ)(),l=(0,tx.r2)(),{componentNamePrefix:n}=(0,el.kU)(),r=(0,a.useCallback)((e,t)=>{let{item:r}=t;if(r.template.componentName!==`${n}ReadPrettyFormItem`)return e;{let t=r.collectionName||r.name,n=l.getCollection(t),a=eH(o?{association:o,collectionName:n.isInherited()?t:void 0,dataSource:r.dataSource,templateSchema:e,isCurrent:!0}:{collectionName:t,dataSource:r.dataSource,templateSchema:e});return"reference"===r.mode&&(a["x-template-key"]=r.template.key),a}},[o,l,n]);return{createSingleDetailsSchema:(0,a.useCallback)(async n=>{let{item:a}=n;if(a.template)e(r(await t(a),{item:a}));else{let t=a.collectionName||a.name,n=l.getCollection(t);e(eH(o?{association:o,collectionName:n.isInherited()?t:void 0,dataSource:a.dataSource,isCurrent:!0}:{collectionName:t,dataSource:a.dataSource}))}},[o,l,t,e,r]),templateWrap:r}}var tF=o(54513),tM=o(83232),tP=o(56181),tI=o(75909),tA=o(57482),tT=o(72606);let tw={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{name:"addNew",title:"{{t('Add new')}}",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>(0,td.$)("create")},{name:"refresh",title:"{{t('Refresh')}}",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"import",title:"{{t('Import')}}",Component:"ImportActionInitializer",schema:{"x-align":"right","x-acl-action":"importXlsx","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>(0,td.$)("import")},{name:"export",title:"{{t('Export')}}",Component:"ExportActionInitializer",useVisible:()=>(0,td.$)("export"),schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}}},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},tj=new v._({name:"GridCardActionInitializers",...tw}),tD=new v._({name:"gridCard:configureActions",...tw},tj),tL=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideSearch:l,createBlockSchema:n,componentType:a="FormItem",templateWrap:i,showAssociationFields:s}=e,d=(0,c.eL)(),{createGridCardBlock:u}=tR();return(0,r.jsx)(eI.kq,{...d,icon:(0,r.jsx)(ea.AppstoreOutlined,{}),componentType:"GridCard",onCreateBlockSchema:async e=>{if(n)return n(e);u(e)},onlyCurrentDataSource:o,hideSearch:l,filter:t,showAssociationFields:s})},tR=()=>{let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createGridCardBlock:o=>{let{item:l}=o,n=t(l.name,l.dataSource);e(eE({collectionName:l.name,dataSource:l.dataSource,rowKey:n.filterTargetKey||"id"}))}}},tY={title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"view",title:'{{t("View")}}',Component:"ViewActionInitializer",schema:{"x-component":"Action.Link","x-action":"view","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("get")},{name:"edit",title:'{{t("Edit")}}',Component:"UpdateActionInitializer",schema:{"x-component":"Action.Link","x-action":"update","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("update")},{name:"delete",title:'{{t("Delete")}}',Component:"DestroyActionInitializer",schema:{"x-component":"Action.Link","x-action":"destroy","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("destroy")},{name:"popup",title:'{{t("Popup")}}',Component:"PopupActionInitializer",useComponentProps:()=>({"x-component":"Action.Link"})},{name:"update-record",title:'{{t("Update record")}}',Component:"UpdateRecordActionInitializer",useVisible:()=>(0,td.$)("update")},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request"}},{name:"link",title:'{{t("Link")}}',Component:"LinkActionInitializer",useComponentProps:()=>({"x-component":"Action.Link"})}]},tB=new v._({name:"GridCardItemActionInitializers",...tY}),tN=new v._({name:"gridCard:configureItemActions",...tY},tB),tE={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{name:"addNew",title:"{{t('Add new')}}",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>(0,td.$)("create")},{name:"refresh",title:"{{t('Refresh')}}",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"import",title:"{{t('Import')}}",Component:"ImportActionInitializer",schema:{"x-align":"right","x-acl-action":"importXlsx","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>(0,td.$)("import")},{name:"export",title:"{{t('Export')}}",Component:"ExportActionInitializer",useVisible:()=>(0,td.$)("export"),schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}}},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},tz=new v._({name:"ListActionInitializers",...tE}),tO=new v._({name:"list:configureActions",...tE},tz),tV=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideSearch:l,createBlockSchema:n,componentType:a="FormItem",templateWrap:i,showAssociationFields:s}=e,d=(0,c.eL)(),{createListBlock:u}=t$();return(0,r.jsx)(eI.kq,{...d,icon:(0,r.jsx)(ea.OrderedListOutlined,{}),componentType:"List",onCreateBlockSchema:async e=>{if(n)return n(e);u(e)},onlyCurrentDataSource:o,hideSearch:l,filter:t,showAssociationFields:s})},t$=()=>{let{getCollection:e}=(0,F.nj)(),{insert:t}=(0,c.fx)();return{createListBlock:o=>{let{item:l}=o,n=e(l.name,l.dataSource);t(eV({collectionName:l.name,dataSource:l.dataSource,rowKey:n.filterTargetKey||"id"}))}}},tq={title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"view",title:'{{t("View")}}',Component:"ViewActionInitializer",schema:{"x-component":"Action.Link","x-action":"view","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("get")},{name:"edit",title:'{{t("Edit")}}',Component:"UpdateActionInitializer",schema:{"x-component":"Action.Link","x-action":"update","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("update")},{name:"delete",title:'{{t("Delete")}}',Component:"DestroyActionInitializer",schema:{"x-component":"Action.Link","x-action":"destroy","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("destroy")},{name:"popup",title:'{{t("Popup")}}',Component:"PopupActionInitializer",useComponentProps:()=>({"x-component":"Action.Link"})},{name:"updateRecord",title:'{{t("Update record")}}',Component:"UpdateRecordActionInitializer",useVisible:()=>(0,td.$)("update")},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request"}},{name:"link",title:'{{t("Link")}}',Component:"LinkActionInitializer",useComponentProps:()=>({"x-component":"Action.Link"})}]},tH=new v._({name:"ListItemActionInitializers",...tq}),tU=new v._({name:"list:configureItemActions",...tq},tH);var tG=o(58206),tK=o(94109),tW=o(42983),tJ=o(72235),tX=o(62431);let tZ=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideChildrenIfSingleCollection:l}=e,n=(0,c.eL)(),{insert:a}=(0,c.fx)();return(0,r.jsx)(eI.kq,{...n,onlyCurrentDataSource:o,icon:(0,r.jsx)(ea.RightSquareOutlined,{}),componentType:"FilterCollapse",onCreateBlockSchema:async e=>{let{item:t}=e;a((e=>{let{collectionName:t,dataSource:o,blockType:l}=e;return{type:"void","x-decorator":"AssociationFilter.Provider","x-use-decorator-props":"useCollapseBlockDecoratorProps","x-decorator-props":{collection:t,dataSource:o,blockType:l,associationFilterStyle:{width:"100%"},name:"filter-collapse"},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:filterCollapse","x-component":"CardItem","x-filter-targets":[],properties:{[(0,d.uid)()]:{type:"void","x-action":"associateFilter","x-initializer":"filterCollapse:configureFields","x-component":"AssociationFilter"}}}})({dataSource:t.dataSource,collectionName:t.collectionName||t.name,blockType:"filter"}))},filter:t,hideChildrenIfSingleCollection:l})},tQ={title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"filter",title:'{{t("Filter")}}',Component:"CreateFilterActionInitializer",schema:{"x-action-settings":{}}},{name:"reset",title:'{{t("Reset")}}',Component:"CreateResetActionInitializer",schema:{"x-action-settings":{}}}]},t0=new v._({name:"FilterFormActionInitializers",...tQ}),t1=new v._({name:"filterForm:configureActions",...tQ},t0),t2=eI.kq,t5=e=>{let{collectionName:t,dataSource:o,templateSchema:l}=e;if(!t||!o)throw Error("collectionName and dataSource are required");return{type:"void","x-decorator":"FilterFormBlockProvider","x-use-decorator-props":"useFilterFormBlockDecoratorProps","x-decorator-props":{dataSource:o,collection:t},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:filterForm","x-component":"CardItem","x-filter-targets":[],properties:{[(0,d.uid)()]:{type:"void","x-component":"FormV2","x-use-component-props":"useFilterFormBlockProps",properties:{grid:l||{type:"void","x-component":"Grid","x-initializer":"filterForm:configureFields"},[(0,d.uid)()]:{type:"void","x-initializer":"filterForm:configureActions","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{float:"right",overflow:"hidden"}}}}}}}},t4=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideChildrenIfSingleCollection:l}=e,n=(0,c.eL)(),{insert:a}=(0,c.fx)(),{componentNamePrefix:i}=(0,en.kU)();return(0,r.jsx)(t2,{...n,icon:(0,r.jsx)(ea.FormOutlined,{}),onlyCurrentDataSource:o,componentType:`${i}FilterFormItem`,templateWrap:(e,t)=>{let{item:o}=t,l=t5({templateSchema:e,dataSource:o.dataSource,collectionName:o.name||o.collectionName});return o.template&&"reference"===o.mode&&(l["x-template-key"]=o.template.key),l},onCreateBlockSchema:e=>{let{item:t}=e;return a(t5({collectionName:t.collectionName||t.name,dataSource:t.dataSource}))},filter:t,hideChildrenIfSingleCollection:l})};var t6=o(44517);let t7={wrap:f.xH,icon:"SettingOutlined",title:'{{t("Configure fields")}}',items:[{type:"itemGroup",name:"displayFields",title:'{{t("Display fields")}}',useChildren:f.gL},{name:"parentCollectionFields",Component:t6.gE},{name:"associationFields",Component:t6.Q3},{name:"divider",type:"divider"},{title:'{{t("Add Markdown")}}',Component:"MarkdownFormItemInitializer",name:"addText"}]},t9=new v._({name:"FilterFormItemInitializers",...t7}),t8=new v._({name:"filterForm:configureFields",...t7},t9),t3=()=>{let{insert:e}=(0,c.fx)(),t=(0,c.eL)();return(0,r.jsx)(c.rR,{...t,icon:(0,r.jsx)(ea.LineOutlined,{}),onClick:()=>{e({type:"void","x-decorator":"FormItem","x-toolbar":"FormItemSchemaToolbar","x-settings":"blockSettings:divider","x-component":"Divider","x-component-props":{children:'{{t("Group")}}'}})}})},oe=()=>{let{insert:e}=(0,c.fx)(),{t}=(0,x.useTranslation)(),o=(0,c.eL)();return(0,r.jsx)(c.rR,{...o,icon:(0,r.jsx)(ea.FormOutlined,{}),onClick:()=>{e({type:"void","x-settings":"blockSettings:markdown","x-decorator":"CardItem","x-decorator-props":{name:"markdown",engine:"handlebars"},"x-component":"Markdown.Void","x-editable":!1,"x-component-props":{content:t("This is a demo text, **supports Markdown syntax**.")}})}})},ot=()=>{let{insert:e}=(0,c.fx)(),t=(0,c.eL)();return(0,r.jsx)(c.rR,{...t,icon:(0,r.jsx)(ea.FormOutlined,{}),onClick:()=>{e({type:"void","x-editable":!1,"x-decorator":"FormItem","x-decorator-props":{engine:"handlebars"},"x-toolbar":"FormItemSchemaToolbar","x-settings":"blockSettings:markdown","x-component":"Markdown.Void","x-component-props":{content:'{{t("This is a demo text, **supports Markdown syntax**.")}}'}})}})},oo={wrap:f.xH,title:'{{t("Add block")}}',icon:"PlusOutlined",items:[{type:"itemGroup",title:'{{t("Selector")}}',name:"selector",children:[{name:"title",title:"Table",Component:"TableSelectorInitializer"}]},{type:"itemGroup",title:'{{t("Filter blocks")}}',name:"filterBlocks",useChildren(){let{name:e,dataSource:t}=(0,to.useCollection_deprecated)();return[{name:"filterFormBlockInTableSelector",title:'{{t("Form")}}',Component:"FilterFormBlockInitializer",componentProps:{filterCollections:()=>!1,onlyCurrentDataSource:!0},collectionName:e,dataSource:t},{name:"filterCollapseBlockInTableSelector",title:'{{t("Collapse")}}',Component:"FilterCollapseBlockInitializer",componentProps:{filterCollections:()=>!1,onlyCurrentDataSource:!0},collectionName:e,dataSource:t}]}},{type:"itemGroup",title:'{{t("Other blocks")}}',name:"otherBlocks",children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]},ol=new v._({name:"TableSelectorInitializers",...oo}),on=new v._({name:"popup:tableSelector:addBlock",...oo},ol),or=()=>{let e=(0,c.eL)();return(0,r.jsx)(P,{...e,item:e,schema:{},type:"x-collection-field"})},oa=()=>{let e=(0,c.eL)();return(0,r.jsx)(P,{...e,schema:{},item:e,type:"x-collection-field"})};var oi=o(38957),os=o(56220),od=o(13975),oc=o(79246),ou=o(93160);let op=()=>{let{t:e}=(0,x.useTranslation)(),t=(0,a.useContext)(L.SchemaOptionsContext),{theme:o}=(0,od.useGlobalTheme)(),{componentCls:l,hashId:n}=(0,oc.I)(),i=(0,R.TrS)(),{createRoute:s}=(0,R.Ob5)(),u=(0,a.useCallback)(async()=>{let{title:l,icon:n}=await (0,R.RD4)(e("Add group"),()=>(0,r.jsx)(R.t6u,{scope:t.scope,components:{...t.components},children:(0,r.jsx)(os.FormLayout,{layout:"vertical",children:(0,r.jsx)(R.Eaz.Provider,{value:R.b6K,children:(0,r.jsx)(R.HvB,{schema:{properties:{title:{title:e("Menu item title"),"x-component":"Input","x-decorator":"FormItem",required:!0},icon:{title:e("Icon"),"x-component":"IconPicker","x-decorator":"FormItem"}}}})})})}),o).open({initialValues:{}}),a=(0,d.uid)();await s({type:ou.q2.group,title:l,icon:n,parentId:null==i?void 0:i.id,schemaUid:a})},[t.components,t.scope,e,o]);return(0,r.jsx)(c.rR,{title:e("Group"),onClick:u,className:`${l} ${n}`})};var om=o(38356),oh=o(26174),ox=o(14669),ov=o(1590);let og=()=>{let{t:e}=(0,x.useTranslation)(),t=(0,a.useContext)(L.SchemaOptionsContext),{theme:o}=(0,od.useGlobalTheme)(),{componentCls:l,hashId:n}=(0,oc.I)(),{urlSchema:i,paramsSchema:s,openInNewWindowSchema:d}=(0,ov.my)(),u=(0,R.TrS)(),{createRoute:p}=(0,R.Ob5)(),m=(0,ox.m6)(),h=(0,oh.r2)(),v=(0,a.useCallback)(async()=>{let{title:l,href:n,params:a,icon:c,openInNewWindow:x}=await (0,R.RD4)(e("Add link"),()=>{var o;let l=(0,e6.createMemoryHistory)();return(0,r.jsx)(ox.e1,{dataSourceManager:m,children:(0,r.jsx)(oh.Pf,{instance:h,dataSource:null==h||null==(o=h.dataSource)?void 0:o.key,children:(0,r.jsx)(om.Router,{location:l.location,navigator:l,children:(0,r.jsx)(R.t6u,{scope:t.scope,components:{...t.components},children:(0,r.jsx)(os.FormLayout,{layout:"vertical",children:(0,r.jsx)(R.Eaz.Provider,{value:R.b6K,children:(0,r.jsx)(R.HvB,{schema:{properties:{title:{title:e("Menu item title"),required:!0,"x-component":"Input","x-decorator":"FormItem"},icon:{title:e("Icon"),"x-component":"IconPicker","x-decorator":"FormItem"},href:i,params:s,openInNewWindow:d}}})})})})})})})},o).open({initialValues:{openInNewWindow:!0}});await p({type:ou.q2.link,title:l,icon:c,parentId:null==u?void 0:u.id,options:{href:n,params:a,openInNewWindow:x}})},[t.components,t.scope,e,o]);return(0,r.jsx)(c.rR,{title:e("Link"),onClick:v,className:`${l} ${n}`})};var of=o(52973);let oy=new q.I({name:"MenuItemInitializers",insertPosition:"beforeEnd",icon:"PlusOutlined",title:'{{t("Add menu item")}}',style:{width:"100%"},items:[{name:"group",Component:op},{name:"page1",Component:of.yD},{name:"page2",Component:of.yD},{name:"link",Component:og}]}),ob=new q.I({name:"menuInitializers:menuItem",insertPosition:"beforeEnd",icon:"PlusOutlined",title:'{{t("Add menu item")}}',items:[{name:"group",Component:op},{name:"page1",Component:of.yD},{name:"page2",Component:oi.k},{name:"link",Component:og}]}),oS={title:'{{t("Add block")}}',icon:"PlusOutlined",wrap:f.xH,items:[{name:"dataBlocks",title:'{{t("Data blocks")}}',type:"itemGroup",children:[{name:"table",title:'{{t("Table")}}',Component:"TableBlockInitializer"},{name:"form",title:'{{t("Form")}}',Component:"FormBlockInitializer",useComponentProps:()=>({filterCollections:e=>{var t,o;let{collection:l}=e,{unavailableActions:n,availableActions:r}=(null==l?void 0:l.options)||{};return r?null==(t=r.includes)?void 0:t.call(r,"create"):!n||!(null==n||null==(o=n.includes)?void 0:o.call(n,"create"))}})},{name:"details",title:'{{t("Details")}}',Component:"DetailsBlockInitializer"},{name:"list",title:'{{t("List")}}',Component:"ListBlockInitializer"},{name:"gridCard",title:'{{t("Grid Card")}}',Component:"GridCardBlockInitializer"}]},{name:"filterBlocks",title:'{{t("Filter blocks")}}',type:"itemGroup",children:[{name:"filterForm",title:'{{t("Form")}}',Component:"FilterFormBlockInitializer"},{name:"filterCollapse",title:'{{t("Collapse")}}',Component:"FilterCollapseBlockInitializer"}]},{name:"otherBlocks",type:"itemGroup",title:'{{t("Other blocks")}}',children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]},oC=new v._({name:"BlockInitializers",...oS}),o_=new v._({name:"page:addBlock",...oS},oC),ok={wrap:f.xH,icon:"SettingOutlined",title:'{{t("Configure fields")}}',items:[{type:"itemGroup",title:'{{t("Configure fields")}}',name:"configureFields",useChildren:f.H2},{name:"parentCollectionFields",Component:()=>{let e=(0,f.G3)({component:"AssignedField"}),{t}=(0,x.useTranslation)(),o=(0,R.lum)();if(!(null==e?void 0:e.length))return null;let l=[];return e.forEach(e=>{Object.values(e)[0].length&&l.push({type:"itemGroup",divider:!0,title:t("Parent collection fields")+"("+o(`${Object.keys(e)[0]}`)+")",children:Object.values(e)[0]})}),(0,r.jsx)(ty.Z,{children:l})}}]},oF=new v._({name:"CustomFormItemInitializers",...ok}),oM=new v._({name:"assignFieldValuesForm:configureFields",...ok},oF),oP=e=>["linkTo","subTable","o2m","m2m","obo","oho","o2o","m2o"].includes(e.interface),oI={wrap:f.xH,title:'{{t("Add block")}}',icon:"PlusOutlined",items:[{type:"itemGroup",name:"dataBlocks",title:'{{t("Data blocks")}}',useChildren:function(){let e=(0,to.useCollection)(),{getChildrenCollections:t}=(0,to.useCollectionManager_deprecated)(),o=t(null==e?void 0:e.name,!0,null==e?void 0:e.dataSource).filter(e=>null==e?void 0:e.filterTargetKey);return[{name:"details",title:'{{t("Details")}}',Component:"DetailsBlockInitializer",collectionName:null==e?void 0:e.name,dataSource:null==e?void 0:e.dataSource,useComponentProps(){let e=(0,to.useCollection)(),{createSingleDetailsSchema:t,templateWrap:l}=tk(),{createAssociationDetailsBlock:n}=(0,to.useCreateAssociationDetailsBlock)(),{createAssociationDetailsWithoutPagination:r,templateWrap:i}=(0,to.useCreateAssociationDetailsWithoutPagination)(),{createDetailsBlock:s}=th(),d=[e,...o];return{filterCollections(e){let{collection:t,associationField:o}=e;return t?d.some(e=>e.name===t.name):!!o},onlyCurrentDataSource:!0,hideSearch:!0,componentType:"ReadPrettyFormItem",createBlockSchema:(0,a.useCallback)(e=>{let{item:o,fromOthersInPopup:l}=e;return l?s({item:o}):o.associationField?["hasOne","belongsTo"].includes(o.associationField.type)?r({item:o}):n({item:o}):t({item:o})},[n,r,s,t]),templateWrap:(0,a.useCallback)((e,t)=>{let{item:o}=t;return o.associationField?["hasOne","belongsTo"].includes(o.associationField.type)?i(e,{item:o}):e:l(e,{item:o})},[l,i]),showAssociationFields:!0}}},{name:"editForm",title:'{{t("Form (Edit)")}}',Component:"FormBlockInitializer",collectionName:null==e?void 0:e.name,dataSource:null==e?void 0:e.dataSource,useComponentProps(){let e=(0,to.useCollection)(),{createEditFormBlock:t,templateWrap:l}=(0,to.useCreateEditFormBlock)(),n=[e,...o];return{filterCollections(e){let{collection:t}=e;return!!t&&n.some(e=>e.name===t.name)},onlyCurrentDataSource:!0,hideSearch:!0,hideOtherRecordsInPopup:!0,componentType:"FormItem",createBlockSchema:t,templateWrap:l,showAssociationFields:!0}},useVisible:()=>(0,to.useActionAvailable)("update")},{name:"createForm",title:'{{t("Form (Add new)")}}',Component:"FormBlockInitializer",collectionName:null==e?void 0:e.name,dataSource:null==e?void 0:e.dataSource,useComponentProps(){let{createAssociationFormBlock:e,templateWrap:t}=(0,to.useCreateAssociationFormBlock)(),{createFormBlock:o,templateWrap:l}=(0,to.useCreateFormBlock)();return{filterCollections(e){let{collection:t,associationField:o}=e;return!!o&&["hasMany","belongsToMany"].includes(o.type)},onlyCurrentDataSource:!0,hideSearch:!0,componentType:"FormItem",createBlockSchema:t=>{let{item:l,fromOthersInPopup:n}=t;if(n)return o({item:l,fromOthersInPopup:n});e({item:l})},templateWrap:(e,o)=>{let{item:n,fromOthersInPopup:r}=o;return r?l(e,{item:n,fromOthersInPopup:r}):t(e,{item:n})},showAssociationFields:!0}}},{name:"table",title:'{{t("Table")}}',Component:"TableBlockInitializer",useComponentProps(){let{createAssociationTableBlock:e}=(0,to.useCreateAssociationTableBlock)(),{createTableBlock:t}=(0,to.useCreateTableBlock)();return{hideSearch:!0,onlyCurrentDataSource:!0,filterCollections(e){let{associationField:t}=e;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:o=>{let{item:l,fromOthersInPopup:n}=o;if(n)return t({item:l});e({item:l})},showAssociationFields:!0}}},{name:"list",title:'{{t("List")}}',Component:"ListBlockInitializer",useComponentProps(){let{createAssociationListBlock:e}=(0,to.useCreateAssociationListBlock)(),{createListBlock:t}=t$();return{hideSearch:!0,onlyCurrentDataSource:!0,filterCollections(e){let{associationField:t}=e;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:o=>{let{item:l,fromOthersInPopup:n}=o;if(n)return t({item:l});e({item:l})},showAssociationFields:!0}}},{name:"gridCard",title:'{{t("Grid Card")}}',Component:"GridCardBlockInitializer",useComponentProps(){let{createAssociationGridCardBlock:e}=(0,to.useCreateAssociationGridCardBlock)(),{createGridCardBlock:t}=tR();return{hideSearch:!0,onlyCurrentDataSource:!0,filterCollections(e){let{associationField:t}=e;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:o=>{let{item:l,fromOthersInPopup:n}=o;if(n)return t({item:l});e({item:l})},showAssociationFields:!0}}}]}},{name:"filterBlocks",title:'{{t("Filter blocks")}}',type:"itemGroup",children:[{name:"filterForm",title:'{{t("Form")}}',Component:"FilterFormBlockInitializer",useComponentProps:()=>({filterCollections(e){let{collection:t}=e;return!0}})},{name:"filterCollapse",title:'{{t("Collapse")}}',Component:"FilterCollapseBlockInitializer",useComponentProps:()=>({filterCollections(e){let{collection:t}=e;return!0}})}]},{type:"itemGroup",name:"otherBlocks",title:'{{t("Other blocks")}}',children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]},oA=new v._({name:"RecordBlockInitializers",...oI}),oT=new v._({name:"popup:common:addBlock",...oI},oA),ow={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"itemGroup",title:"{{t('Enable actions')}}",name:"enableActions",children:[{name:"addNew",title:"{{t('Add new')}}",Component:"CreateActionInitializer",schema:{"x-align":"right"}},{name:"delete",title:"{{t('Delete')}}",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right"}}]}]},oj=new v._({name:"SubTableActionInitializers",...ow}),oD=new v._({name:"subTable:configureActions",...ow},oj);var oL=o(41752);let oR=e=>{let{designable:t,insertBeforeEnd:o}=(0,to.useDesignable)(),{isCreate:l,isBulkEdit:n,options:i}=e,{gridInitializer:s}=i,{getAriaLabel:d}=(0,oL.n)(),{isMobile:c}=(0,p.k)()||{},u=(0,to.useRecord)(),m=(0,tx.Ge)(),h=()=>{let e=(0,L.useForm)(),t=(0,to.useActionContext)(),r=s;return!m&&(r="page:addBlock",c&&(r="mobile:addBlock")),!r&&(r="popup:common:addBlock",l||!u?r="popup:addNew:addBlock":n&&(r="popup:bulkEdit:addBlock")),{async run(){await e.submit();let{title:l,icon:n}=e.values;o({type:"void",title:l,"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{icon:n},properties:{grid:{type:"void","x-component":"Grid","x-initializer":r,properties:{}}}}),await e.reset(),t.setVisible(!1)}}},x=(0,a.useMemo)(()=>({type:"void",properties:{action1:{type:"void","x-component":"Action","x-component-props":{icon:"PlusOutlined",style:{borderColor:"var(--colorSettings)",color:"var(--colorSettings)"},type:"dashed","aria-label":d()},title:'{{t("Add tab")}}',properties:{drawer1:{"x-decorator":"Form","x-component":"Action.Modal","x-component-props":{width:520,zIndex:2e3},type:"void",title:'{{t("Add tab")}}',properties:{title:{title:'{{t("Tab name")}}',required:!0,"x-component":"Input","x-decorator":"FormItem"},icon:{title:'{{t("Icon")}}',"x-component":"IconPicker","x-decorator":"FormItem"},footer:{"x-component":"Action.Modal.Footer",type:"void",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:()=>{let e=(0,to.useActionContext)();return{async run(){e.setVisible(!1)}}}}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:h}}}}}}}}}}),[]);return t?(0,r.jsx)(to.SchemaComponent,{schema:x}):null},oY={Component:oR,popover:!1},oB=new q.I({name:"TabPaneInitializers",...oY}),oN=new q.I({name:"popup:addTab",...oY}),oE=new q.I({name:"TabPaneInitializersForCreateFormBlock",Component:e=>(0,r.jsx)(oR,{...e,isCreate:!0}),popover:!1}),oz=new q.I({name:"TabPaneInitializersForBulkEditFormBlock",Component:e=>(0,r.jsx)(oR,{...e,isBulkEdit:!0}),popover:!1});var oO=o(21052);class oV extends n.k{async load(){this.app.addComponents({...oO,...l,DestroyActionInitializer:T,FormBlockInitializer:tF.y,RecordFormBlockInitializer:tM.B,TableBlockInitializer:tJ.I,TableSelectorInitializer:tG.w,RecordReadPrettyFormBlockInitializer:t_,DetailsBlockInitializer:tm,ListBlockInitializer:tV,GridCardBlockInitializer:tL,FilterFormBlockInitializer:t4,FilterCollapseBlockInitializer:tZ,MarkdownBlockInitializer:oe,MarkdownFormItemInitializer:ot,TableCollectionFieldInitializer:oa,CollectionFieldInitializer:or,CreateActionInitializer:h,CreateChildInitializer:m,ViewActionInitializer:ts,UpdateActionInitializer:ti,PopupActionInitializer:te,LinkActionInitializer:e0,UpdateRecordActionInitializer:e7,CreateSubmitActionInitializer:e5,UpdateSubmitActionInitializer:e4,BulkDestroyActionInitializer:A,ExpandableActionInitializer:j,DisassociateActionInitializer:w,FilterActionInitializer:D,RefreshActionInitializer:e1,EditTableActionInitializer:e2,DividerFormItemInitializer:t3,AssociateActionInitializer:tt,AssociateActionProvider:tr,PopupActionDecorator:e3}),this.app.schemaInitializerManager.add(oC),this.app.schemaInitializerManager.add(o_),this.app.schemaInitializerManager.add(tW.W),this.app.schemaInitializerManager.add(tW.k),this.app.schemaInitializerManager.add(tX.U),this.app.schemaInitializerManager.add(tX.C),this.app.schemaInitializerManager.add(tK.Wd),this.app.schemaInitializerManager.add(tK.Wf),this.app.schemaInitializerManager.add(tA.L),this.app.schemaInitializerManager.add(tA.r),this.app.schemaInitializerManager.add(tI.e),this.app.schemaInitializerManager.add(tu),this.app.schemaInitializerManager.add(tp),this.app.schemaInitializerManager.add(tS),this.app.schemaInitializerManager.add(tC),this.app.schemaInitializerManager.add(tg),this.app.schemaInitializerManager.add(tf),this.app.schemaInitializerManager.add(b),this.app.schemaInitializerManager.add(S),this.app.schemaInitializerManager.add(_),this.app.schemaInitializerManager.add(k),this.app.schemaInitializerManager.add(oF),this.app.schemaInitializerManager.add(oM),this.app.schemaInitializerManager.add(t0),this.app.schemaInitializerManager.add(t1),this.app.schemaInitializerManager.add(tP.E),this.app.schemaInitializerManager.add(tP.C),this.app.schemaInitializerManager.add(tT.T),this.app.schemaInitializerManager.add(tT.Z),this.app.schemaInitializerManager.add(t9),this.app.schemaInitializerManager.add(t8),this.app.schemaInitializerManager.add(tj),this.app.schemaInitializerManager.add(tD),this.app.schemaInitializerManager.add(tB),this.app.schemaInitializerManager.add(tN),this.app.schemaInitializerManager.add(tz),this.app.schemaInitializerManager.add(tO),this.app.schemaInitializerManager.add(tH),this.app.schemaInitializerManager.add(tU),this.app.schemaInitializerManager.add(oA),this.app.schemaInitializerManager.add(oT),this.app.schemaInitializerManager.add(ta),this.app.schemaInitializerManager.add(oj),this.app.schemaInitializerManager.add(oD),this.app.schemaInitializerManager.add(ol),this.app.schemaInitializerManager.add(on),this.app.schemaInitializerManager.add(oB),this.app.schemaInitializerManager.add(oN),this.app.schemaInitializerManager.add(oE),this.app.schemaInitializerManager.add(oz),this.app.schemaInitializerManager.add(oy),this.app.schemaInitializerManager.add(ob)}}},3403(e,t,o){o.d(t,{kq:()=>v,Fh:()=>x,Cl:()=>m});var l=o(71178),n=o(82113),r=o(52793),a=o(51649),i=o(77843),s=o(20629),d=o(82924),c=o(96932),u=o(81936),p=o(56920);let m=e=>{let{value:t,onChange:o}=e,{t:n}=(0,i.useTranslation)(),[s,d]=(0,a.useState)(t),c=a.default.useRef(null);return(0,a.useEffect)(()=>{d(t)},[t]),(0,a.useEffect)(()=>{c.current.input.focus();let e=new IntersectionObserver(e=>{e[0].isIntersecting&&c.current.input.focus()});return e.observe(c.current.input),()=>{e.disconnect()}},[]),(0,l.jsxs)("div",{style:{width:210},onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(r.Input,{ref:c,allowClear:!0,style:{padding:"0 4px 6px",boxShadow:"none"},bordered:!1,placeholder:n("Search and select collection"),value:s,onClick:e=>{e.stopPropagation()},onChange:e=>{o(e.target.value),d(e.target.value)}}),(0,l.jsx)(r.Divider,{style:{margin:0}})]})},h=e=>{let{loadMore:t,maxHeight:o}=e,n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=n.current;if(!e)return;let l=e.parentElement;for(;l&&"UL"!==l.tagName;)l=l.parentElement;let r=function(){l&&32>=Math.abs(l.scrollHeight-l.scrollTop-l.clientHeight)&&t()};return l&&(l.style.height=`${o-32}px`,l.style.maxHeight="inherit",l.style.overflowY="scroll",l.addEventListener("scroll",r)),()=>{l&&(l.removeEventListener("scroll",r),delete l.style.height)}},[t,o]),(0,l.jsx)("div",{ref:n,onClick:e=>e.stopPropagation(),children:(0,l.jsx)(r.Spin,{size:"small",style:{width:"100%"}})})};function x(e){let{data:t,openKeys:o,showType:n,hideSearch:i}=e,[s,d]=(0,a.useState)(""),[c,u]=(0,a.useState)(15),p=(0,a.useMemo)(()=>t.length>1,[t]),x=(0,a.useMemo)(()=>p?null==o?void 0:o[1]:(null==o?void 0:o.length)>0,[o]);(0,a.useEffect)(()=>{x||d("")},[x]);let v=(0,a.useMemo)(()=>{var e,o;return p?x&&(null==(o=t.find(e=>(e.key||e.name)===x))?void 0:o.children)||[]:(null==(e=t[0])?void 0:e.children)||[]},[t,p,x]),g=(0,a.useMemo)(()=>{if(!s)return v;let e=s.toLocaleLowerCase();return v.filter(t=>(t.label||t.title)&&String(t.label||t.title).toLocaleLowerCase().includes(e))},[s,v]),f=(0,a.useMemo)(()=>g.length>c,[c,g]),y=(0,a.useMemo)(()=>g.slice(0,c),[g,c]),b=(0,a.useMemo)(()=>{let e=[];return i||e.push(Object.assign({key:"search",label:(0,l.jsx)(m,{value:s,onChange:e=>{u(15),d(e)}}),onClick(e){let{domEvent:t}=e;t.stopPropagation()}},n?{isMenuType:!0}:{})),y.length>0?(e.push(...y),f&&e.push(Object.assign({key:"load-more",label:(0,l.jsx)(h,{maxHeight:480,loadMore:()=>{u(e=>e+15)}})},n?{isMenuType:!0}:{}))):e.push(Object.assign({key:"empty",style:{height:150},label:(0,l.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,l.jsx)(r.Empty,{image:r.Empty.PRESENTED_IMAGE_SIMPLE})})},n?{isMenuType:!0}:{})),e},[i,y,s,f,n]);return(0,a.useMemo)(()=>p?t.map(e=>x&&e.key===x?{...e,children:b}:{...e,children:[]}):b,[t,p,x,b])}let v=e=>{var t,o;let r,i,m,{templateWrap:h,onCreateBlockSchema:v,componentType:g,icon:f=n.TableOutlined,name:y,title:b,filter:S,onlyCurrentDataSource:C,hideSearch:_,showAssociationFields:k,hideChildrenIfSingleCollection:F,filterDataSource:M,items:P,hideOtherRecordsInPopup:I,onClick:A,filterOtherRecordsCollection:T,currentText:w,otherText:j,alwaysRenderMenu:D}=e,{insert:L,setVisible:R}=(0,s.fx)(),Y=(0,d.lum)(),{getTemplateSchemaByMode:B}=(0,c.ov)(),N=(r=(0,p.useForm)(),i=(0,p.useFieldSchema)(),m=(0,a.useMemo)(()=>{let e=i;for(;e;){if("TemplateGridDecorator"===e["x-decorator"])return!0;e=e.parent}return!1},[i]),e=>{m&&r.notify("blockAdded",e)}),E=(0,a.useCallback)(async e=>{N({collection:e.item.name,dataSource:e.item.dataSource,componentType:g,menuName:y});let{item:t,fromOthersInPopup:o}=e;if(A)return A(e);if(t.template){let e=await B(t);h?L(h(e,{item:t,fromOthersInPopup:o})):L(e)}else t.schemaInsertor?await t.schemaInsertor(L,{item:t,name:y,fromOthersInPopup:o}):v&&v({item:t,fromOthersInPopup:o});R(!1)},[B,L,R,v,A,h,N,y,g]),z=P||(0,u.nG)({name:y,componentName:g,filter:S,filterDataSource:M,filterOtherRecordsCollection:T,onlyCurrentDataSource:C,showAssociationFields:k,dataBlockInitializerProps:e,hideOtherRecordsInPopup:I,onClick:E,currentText:w,otherText:j}),O=(0,s.q9)(E),V=(0,a.useMemo)(()=>O(z,y),[O,z,y]),[$,q]=(0,a.useState)([]),H=x({data:V,openKeys:$,hideSearch:_}),U=(0,a.useMemo)(()=>{let t=H.filter(e=>"search"!==e.key&&"empty"!==e.key);return t=F&&1===t.length?t[0].children:H,[{key:y,label:Y(b),icon:"string"==typeof f?(0,l.jsx)(n.default,{type:f}):f,onClick:t=>{t.key===y&&E({...t,item:e})},children:t}]},[H,F,y,Y,b,f,E,e]);return V.length>1||1===V.length&&(null==(o=V[0])||null==(t=o.children)?void 0:t.length)>0||D?(0,l.jsx)(s.$l,{onOpenChange:e=>{q(e)},items:U}):(0,l.jsx)(s.rR,{...e,onClick:E})}},81936(e,t,o){o.d(t,{AZ:()=>b,DJ:()=>O,FJ:()=>M,G3:()=>j,H2:()=>L,HG:()=>k,IP:()=>D,JP:()=>q,LR:()=>K,Oo:()=>C,Rg:()=>R,TA:()=>$,_V:()=>w,aU:()=>E,aY:()=>A,gL:()=>I,g_:()=>P,je:()=>V,jz:()=>g,l:()=>S,nG:()=>z,nt:()=>y,oK:()=>N,vP:()=>F,xH:()=>f});var l=o(56920),n=o(27404),r=o(77583),a=o(51649),i=o(77843),s=o(44374),d=o(69412),c=o(29333),u=o(43288),p=o(14669),m=o(58980),h=o(82924),x=o(96932),v=o(24768);let g=e=>e,f=e=>({type:"void","x-component":"Grid.Row",properties:{[(0,n.uid)()]:{type:"void","x-component":"Grid.Col",properties:{[(null==e?void 0:e.name)||(0,n.uid)()]:e}}}}),y=(e,t)=>{t(e.parent)},b=(e,t)=>{t(e,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})},S=()=>{let e=(0,l.useForm)();return(t,o)=>{var l;o(t,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}),null==(l=e.values)||delete l[t.name]}},C=(e,t,o,l)=>e.reduceProperties((e,n)=>n[t]!==o||l&&n.name!==l?n.reduceProperties((e,n)=>n[t]!==o||l&&n.name!==l?e:n)||e:n),_=["attachment","textarea","markdown","json","richText","polygon","circle","point","lineString","vditor"];function k(){let{name:e,currentFields:t=[]}=(0,u.k7)(),{getInterface:o,getCollection:n}=(0,u.nj)(),r="AssociationField.SubTable"===(0,l.useFieldSchema)()["x-component"],a=(0,l.useForm)(),i=!r||a.readPretty;return t.filter(t=>!t.collectionName||t.collectionName===e).filter(e=>(null==e?void 0:e.interface)&&(null==e?void 0:e.interface)!=="subTable"&&!(null==e?void 0:e.treeChildren)).map(t=>{var l,a,s,d;let c=o(t.interface),u=(null==t?void 0:t.target)&&(null==(l=n(null==t?void 0:t.target))?void 0:l.template)==="file",p=(null==t||null==(a=t.uiSchema)?void 0:a["x-component"])==="Preview",m={name:t.name,"x-collection-field":`${e}.${t.name}`,"x-component":"CollectionField","x-component-props":u?{fieldNames:{label:"preview",value:"id"}}:p?{size:"small"}:{},"x-read-pretty":i||(null==(s=t.uiSchema)?void 0:s["x-read-pretty"]),"x-decorator":r?_.includes(t.interface)||u?"QuickEdit":"FormItem":null,"x-decorator-props":{labelStyle:{display:"none"}}};return{type:"item",name:t.name,title:(null==t||null==(d=t.uiSchema)?void 0:d.title)||t.name,Component:"TableCollectionFieldInitializer",find:C,remove:y,schemaInitialize:e=>{var o;null==c||null==(o=c.schemaInitialize)||o.call(c,e,{field:t,readPretty:i,block:"Table",targetCollection:n(t.target)})},field:t,schema:m}})}function F(){var e;let{fields:t}=(0,u.k7)(),{t:o}=(0,i.useTranslation)(),{getInterface:l,getCollectionFields:n,getCollection:r}=(0,u.nj)();return null==t||null==(e=t.filter(e=>["o2o","oho","obo","m2o"].includes(e.interface)))?void 0:e.map(e=>(function e(t){var o,l;let{getCollectionFields:n,field:r,getInterface:a,getCollection:i,schemaName:s,maxDepth:d,depth:c,t:u}=t,p=n(r.target),m=null==p||null==(o=p.filter(e=>(null==e?void 0:e.interface)&&!["subTable"].includes(null==e?void 0:e.interface)&&!(null==e?void 0:e.treeChildren)))?void 0:o.map(e=>{var t;let o=a(e.interface),l=`${s}.${e.name}`,n={name:l,"x-component":"CollectionField","x-read-pretty":!0,"x-collection-field":`${r.target}.${e.name}`,"x-component-props":{}};return{type:"item",key:`${r.target}_${e.name}_${l}`,name:l,title:(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name,Component:"TableCollectionFieldInitializer",find:C,remove:y,schemaInitialize:t=>{var l;null==o||null==(l=o.schemaInitialize)||l.call(o,t,{field:e,readPretty:!0,block:"Table",targetCollection:i(r.target)})},field:e,schema:n}}),h=[{type:"itemGroup",key:`${r.target}_${s}_displayFields`,name:`${s}-displayCollectionFields`,title:u("Display fields"),children:m}];if(c<d){let t=null==p?void 0:p.filter(e=>["o2o","oho","obo","m2o"].includes(e.interface)).map(t=>e({getCollectionFields:n,field:t,getInterface:a,getCollection:i,schemaName:`${s}.${t.name}`,maxDepth:d,depth:c+1,t:u}));if(t.length){let e={type:"itemGroup",key:`${r.target}_${s}_associationFields`,name:`${s}-associationFields`,title:u("Display association fields"),children:t};h.push(e)}}return{type:"subMenu",key:`${r.target}_${s}_submenu`,name:s,title:null==(l=r.uiSchema)?void 0:l.title,children:h}})({getCollectionFields:n,field:e,getInterface:l,getCollection:r,schemaName:e.name,maxDepth:2,depth:1,t:o}))}function M(){let{name:e}=(0,u.k7)(),{getInterface:t,getInheritCollections:o,getCollection:n,getParentCollectionFields:r}=(0,u.nj)(),a="AssociationField.SubTable"===(0,l.useFieldSchema)()["x-component"],i=(0,l.useForm)(),s=!a||i.readPretty,d=o(e);return null==d?void 0:d.map(o=>{let l=r(o,e),i=n(o);return{[null==i?void 0:i.title]:null==l?void 0:l.filter(e=>null==e?void 0:e.interface).map(o=>{var l,r,i,d;let c=t(o.interface),u=(null==o?void 0:o.target)&&(null==(l=n(null==o?void 0:o.target))?void 0:l.template)==="file",p={name:`${o.name}`,"x-component":"CollectionField","x-read-pretty":s||(null==(r=o.uiSchema)?void 0:r["x-read-pretty"]),"x-collection-field":`${e}.${o.name}`,"x-component-props":u?{fieldNames:{label:"preview",value:"id"}}:{},"x-decorator":a?_.includes(o.interface)||u?"QuickEdit":"FormItem":null,"x-decorator-props":{labelStyle:{display:"none"}}};return{name:(null==o||null==(i=o.uiSchema)?void 0:i.title)||o.name,type:"item",title:(null==o||null==(d=o.uiSchema)?void 0:d.title)||o.name,Component:"TableCollectionFieldInitializer",find:C,remove:y,schemaInitialize:e=>{var t;null==c||null==(t=c.schemaInitialize)||t.call(c,e,{field:o,readPretty:!0,block:"Table",targetCollection:n(null==o?void 0:o.target)})},field:o,schema:p}})}})}let P=e=>{var t,o;let{name:n,currentFields:r}=(0,u.k7)(),{getInterface:a,getCollection:i}=(0,u.nj)(),s=(0,l.useForm)(),{readPretty:d=s.readPretty,block:c="Form"}=e||{},{fieldSchema:p}=(0,h.D50)(),m=null==p?void 0:p["x-action"];return null==(o=r.filter(e=>!e.collectionName||e.collectionName===n))||null==(t=o.filter(e=>(null==e?void 0:e.interface)&&!(null==e?void 0:e.treeChildren)))?void 0:t.map(e=>{var t,o,l,r,s;let u=a(e.interface),p=i(e.target),h=(null==e?void 0:e.target)&&(null==(t=i(null==e?void 0:e.target))?void 0:t.template)==="file",x=null==e||null==(l=e.uiSchema)||null==(o=l["x-component-props"])?void 0:o.fieldNames,v={type:"string",name:e.name,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem","x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":`${n}.${e.name}`,"x-component-props":h?{fieldNames:{label:"preview",value:"id"}}:p&&x?{fieldNames:{...x,label:(null==p?void 0:p.titleField)||x.label}}:{},"x-read-pretty":null==e||null==(r=e.uiSchema)?void 0:r["x-read-pretty"]},g={type:"item",name:e.name,title:(null==e||null==(s=e.uiSchema)?void 0:s.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==u||null==(o=u.schemaInitialize)||o.call(u,t,{field:e,block:c,readPretty:d,action:m,targetCollection:p})},schema:v};return"Kanban"==c&&(g.find=(e,t,o)=>{let l=R(e,"x-component",c);return R(l,t,o)}),g})},I=e=>{var t,o;let{name:n,currentFields:r}=(0,u.k7)(),{getInterface:a,getCollection:i}=(0,u.nj)(),s=(0,l.useForm)(),{readPretty:d=s.readPretty,block:c="FilterForm"}=e||{},{snapshot:p,fieldSchema:x}=(0,h.D50)(),v=null==x?void 0:x["x-action"];return null==(o=r.filter(e=>!e.collectionName||e.collectionName===n))||null==(t=o.filter(e=>{var t;return(null==e?void 0:e.interface)&&(null==(t=a(e.interface))?void 0:t.filterable)}))?void 0:t.map(e=>{var t,o,l;let r=a(e.interface),s=i(e.target),u={type:"string",name:e.name,required:!1,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FilterFormItem","x-component":"CollectionField","x-decorator":"FormItem","x-use-decorator-props":"useFormItemProps","x-collection-field":`${n}.${e.name}`,"x-component-props":{utc:!1}};return(0,m.W0)(e)&&(u={type:"string",name:`${e.name}`,required:!1,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FilterFormItem","x-component":"CollectionField","x-decorator":"FormItem","x-use-decorator-props":"useFormItemProps","x-collection-field":`${n}.${e.name}`,"x-component-props":{...null==(l=e.uiSchema)?void 0:l["x-component-props"],utc:!1}}),{name:(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name,type:"item",title:(null==e||null==(o=e.uiSchema)?void 0:o.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==r||null==(o=r.schemaInitialize)||o.call(r,t,{field:e,block:c,readPretty:d,action:v,targetCollection:s})},schema:u}})},A=e=>{var t;let{name:o,fields:n}=(0,u.k7)(),{getInterface:r,getCollectionFields:a,getCollection:s}=(0,u.nj)(),d=(0,l.useForm)(),{t:c}=(0,i.useTranslation)(),{readPretty:p=d.readPretty,block:m="Form"}=e||{},h="Form"===m?["m2o","obo","oho"]:["o2o","oho","obo","m2o"];return null==n||null==(t=n.filter(e=>h.includes(e.interface)))?void 0:t.map(e=>(function e(t){var o,l;let{getCollectionFields:n,field:r,getInterface:a,getCollection:i,readPretty:s,block:d,maxDepth:c,depth:u,schemaName:p,t:m}=t,h=n(r.target),x=null==h||null==(o=h.filter(e=>(null==e?void 0:e.interface)&&!["subTable"].includes(null==e?void 0:e.interface)&&!e.treeChildren))?void 0:o.map(e=>{var t,o;let l=a(e.interface),n=(null==r?void 0:r.target)&&(null==(t=i(null==r?void 0:r.target))?void 0:t.template)==="file",c=`${p}.${e.name}`,u={type:"string",name:c,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem","x-component":"CollectionField","x-read-pretty":s,"x-component-props":{"pattern-disable":"Form"===d&&s,fieldNames:n?{label:"preview",value:"id"}:void 0},"x-decorator":"FormItem","x-collection-field":`${r.target}.${e.name}`};return{name:c,type:"item",title:(null==e||null==(o=e.uiSchema)?void 0:o.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==l||null==(o=l.schemaInitialize)||o.call(l,t,{field:e,block:d,readPretty:s,targetCollection:i(r.target)})},schema:u}}),v=[{type:"itemGroup",name:`${p}-displayCollectionFields`,title:m("Display fields"),children:x}];if(u<c){let t=null==h?void 0:h.filter(e=>["o2o","oho","obo","m2o"].includes(e.interface)).map(t=>e({getCollectionFields:n,field:t,getInterface:a,getCollection:i,schemaName:`${p}.${t.name}`,readPretty:s,block:d,maxDepth:c,depth:u+1,t:m}));if(t.length){let e={type:"itemGroup",name:`${p}-associationFields`,title:m("Display association fields"),children:t};v.push(e)}}return{type:"subMenu",name:`${p}.${r.name}`,title:null==(l=r.uiSchema)?void 0:l.title,children:v}})({getCollectionFields:a,field:e,getInterface:r,getCollection:s,readPretty:p,block:m,schemaName:e.name,maxDepth:2,depth:1,t:c}))},T=(e,t,o,l,n)=>{var r,a,i;if(e.target&&e.uiSchema){if(n.includes(e.target)||n.length>=1)return;let r=l(e.target);if(!(null==r?void 0:r.length))return;return{type:"subMenu",name:t,title:null==(i=e.uiSchema)?void 0:i.title,children:r.map(r=>T(r,`${t}.${r.name}`,o,l,[...n,e.target])).filter(Boolean)}}if(!e.uiSchema)return;let s={type:"string",name:t,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FilterFormItem","x-designer-props":{interface:e.interface},"x-component":"CollectionField","x-component-props":{utc:!1},"x-read-pretty":!1,"x-decorator":"FormItem","x-collection-field":`${o}.${t}`};return{name:(null==(r=e.uiSchema)?void 0:r.title)||e.name,type:"item",title:(null==(a=e.uiSchema)?void 0:a.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schema:s}},w=()=>{let{name:e,fields:t}=(0,u.k7)(),{getCollectionFields:o}=(0,u.nj)(),l=["attachmentURL"];return null==t?void 0:t.filter(e=>e.target&&e.uiSchema&&!l.includes(e.interface)).map(t=>T(t,t.name,e,o,[])).filter(Boolean)},j=e=>{let{name:t}=(0,u.k7)(),{getInterface:o,getInheritCollections:n,getCollection:r,getParentCollectionFields:a}=(0,u.nj)(),i=n(t),{snapshot:s}=(0,h.D50)(),d=(0,l.useForm)();return null==i?void 0:i.map(l=>{var n;let i=a(l,t),{readPretty:s=d.readPretty,block:c="Form",component:u="CollectionField"}=e||{},p=r(l);return{[null==p?void 0:p.title]:null==i||null==(n=i.filter(e=>null==e?void 0:e.interface))?void 0:n.map(e=>{var l,n,a,i;let d=o(e.interface),p=r(e.target),m={type:"string",name:e.name,title:(null==e||null==(l=e.uiSchema)?void 0:l.title)||e.name,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem","x-component":u,"x-decorator":"FormItem","x-collection-field":`${t}.${e.name}`,"x-component-props":{},"x-read-pretty":null==e||null==(n=e.uiSchema)?void 0:n["x-read-pretty"]};return{name:(null==e||null==(a=e.uiSchema)?void 0:a.title)||e.name,type:"item",title:(null==e||null==(i=e.uiSchema)?void 0:i.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==d||null==(o=d.schemaInitialize)||o.call(d,t,{field:e,block:c,readPretty:s,targetCollection:p})},schema:m}})}})},D=e=>{let{name:t}=(0,u.k7)(),{getInterface:o,getInheritCollections:n,getCollection:r,getParentCollectionFields:a}=(0,u.nj)(),i=n(t),{snapshot:s}=(0,h.D50)(),d=(0,l.useForm)();return null==i?void 0:i.map(l=>{var n;let i=a(l,t),{readPretty:s=d.readPretty,block:c="Form"}=e||{};return{[r(l).title]:null==i||null==(n=i.filter(e=>{var t;return(null==e?void 0:e.interface)&&(null==(t=o(e.interface))?void 0:t.filterable)}))?void 0:n.map(e=>{var l,n,a,i;let d=o(e.interface),u=r(e.target),p={type:"string",name:e.name,title:(null==e||null==(l=e.uiSchema)?void 0:l.title)||e.name,required:!1,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FilterFormItem","x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":`${t}.${e.name}`,"x-component-props":{utc:!1},"x-read-pretty":null==e||null==(n=e.uiSchema)?void 0:n["x-read-pretty"]};return{name:(null==e||null==(a=e.uiSchema)?void 0:a.title)||e.name,type:"item",title:(null==e||null==(i=e.uiSchema)?void 0:i.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==d||null==(o=d.schemaInitialize)||o.call(d,t,{field:e,block:c,readPretty:s,targetCollection:u})},schema:p}})}})},L=e=>{var t;let{name:o,currentFields:n}=(0,u.k7)(),{getInterface:r,getCollection:a}=(0,u.nj)(),i=(0,l.useForm)(),{readPretty:s=i.readPretty,block:d="Form"}=e||{},c=S();return null==n||null==(t=n.filter(e=>!e.inherit&&(null==e?void 0:e.interface)&&"snapshot"!==e.interface&&"sequence"!==e.type))?void 0:t.map(e=>{var t,l;let n=r(e.interface),i={type:"string",name:e.name,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem","x-component":"AssignedField","x-decorator":"FormItem","x-collection-field":`${o}.${e.name}`};return{name:(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name,type:"item",title:(null==e||null==(l=e.uiSchema)?void 0:l.title)||e.name,Component:"CollectionFieldInitializer",remove:c,schemaInitialize:t=>{var o;null==n||null==(o=n.schemaInitialize)||o.call(n,t,{field:e,block:d,readPretty:s,targetCollection:a(e.target)})},schema:i}})},R=(e,t,o,n)=>l.Schema.isSchemaInstance(e)?e.reduceProperties((e,l)=>{if(l[t]===o&&(!n||l.name===n))return l;if(l["x-component"]&&"Action.Container"!==l["x-component"]&&!l["x-component"].includes("AssociationField")){let e=R(l,t,o,n);if(e)return e}return e}):null,Y=(e,t)=>t(e),B=e=>e.parent?e.parent["x-initializer"]?e.parent:B(e.parent):null,N=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:R,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Y,r=arguments.length>4?arguments[4]:void 0,{removeActiveFieldName:a}=(0,c.d)()||{},{form:i}=(0,d.Es)(),s=(0,l.useFieldSchema)();if(!(null==s?void 0:s["x-initializer"])&&(null==s?void 0:s["x-decorator"])==="FormItem"){let e=B(s);e&&(s=e)}let{remove:u}=(0,h.erX)(),p=o(s,t,e,r);return{schema:p,exists:!!p,remove(){null==a||a(p.name),null==i||i.query(RegExp(`${p.parent.name}.${p.name}$`)).forEach(e=>{var t,o;null==(t=e.setValue)||t.call(e,void 0),null==(o=e.setInitialValue)||o.call(e,void 0)}),p&&n(p,u)}}},E=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,{t:n}=(0,i.useTranslation)(),r=(0,u.k7)(),{getTemplatesByCollection:a}=(0,x.ov)(),s=a(r.dataSource,o||r.name).filter(t=>e&&t.componentName===e).filter(t=>["FormItem","ReadPrettyFormItem"].includes(e)||t.resourceName===l),d=Array.from(G.values()).map(t=>t({collection:r,componentName:e})).filter(Boolean).flat();if(!s.length&&!d.length||U())return[];let c=[{type:"divider",name:"divider"}];return s.length&&c.push({key:`${o||e}_table_subMenu_0_copy`,type:"subMenu",name:"copy",title:n("Duplicate template"),children:s.map(e=>{let o=["FormItem","ReadPrettyFormItem"].includes(null==e?void 0:e.componentName)?`${null==e?void 0:e.name} ${n("(Fields only)")}`:null==e?void 0:e.name;return{type:"item",mode:"copy",name:r.name,template:e,item:t,title:o||n("Untitled")}})},{key:`${o||e}_table_subMenu_0_ref`,type:"subMenu",name:"ref",title:n("Reference template"),children:s.map(e=>{let o=["FormItem","ReadPrettyFormItem"].includes(null==e?void 0:e.componentName)?`${null==e?void 0:e.name} ${n("(Fields only)")}`:null==e?void 0:e.name;return{type:"item",mode:"reference",name:r.name,template:e,item:t,title:o||n("Untitled")}})}),d.length&&c.push({type:"subMenu",name:"inherited_templates",key:`associationFiled_${e}_table_subMenu_0_inherited`,title:n("Inherited template"),children:d}),[{key:`${o||e}_table_blank`,type:"item",name:r.name,title:n("Blank block"),item:t},...c]},z=e=>{let{name:t,componentName:o,filter:n=()=>!0,onlyCurrentDataSource:d=!1,showAssociationFields:c,filterDataSource:m,dataBlockInitializerProps:g,hideOtherRecordsInPopup:f,onClick:y,filterOtherRecordsCollection:b,currentText:S,otherText:C}=e,{componentNamePrefix:_}=(0,v.kU)(),{t:k}=(0,i.useTranslation)(),F=(0,p.m6)(),M=(0,s.useDataSourceKey)(),P=(0,s.useCollection)(),I=function(e){let{componentName:t,filterCollections:o,showAssociationFields:n,componentNamePrefix:r,name:d}=e,c=(0,l.useFieldSchema)(),{getCollectionFields:p}=(0,u.nj)(),m=(0,u.k7)();(0,s.useCollectionManager)();let v=(0,s.useDataSourceKey)(),{getTemplatesByCollection:g}=(0,x.ov)(),{t:f}=(0,i.useTranslation)(),y=(0,h.lum)();return(0,a.useMemo)(()=>{if(!n)return[];let e=[];if(c["x-initializer"])e=m.fields;else{let t=B(c.parent);t&&(e=p(t))}return e.filter(e=>["linkTo","subTable","o2m","m2m","obo","oho","o2o","m2o"].includes(e.interface)).filter(e=>o({associationField:e})).map((e,o)=>{let l=y(e.uiSchema.title||e.name),n=g(v,e.target).filter(o=>{if(o.resourceName!==`${e.collectionName}.${e.name}`)return!1;if(t===r+"ReadPrettyFormItem")if(["hasOne","belongsTo"].includes(e.type))return o.componentName===r+"ReadPrettyFormItem";else return o.componentName===r+"Details";return o.componentName===t}),a=Array.from(G.values()).map(l=>l({collection:m,index:o,field:e,componentName:t,keyPrefix:"associationFiled_table_subMenu",name:d})).filter(Boolean).flat();if(!n.length&&!a.length||U())return{type:"item",name:`${e.collectionName}.${e.name}`,collectionName:e.target,title:l,dataSource:v,associationField:e};let i=[{type:"divider",name:"divider"}];return n.length&&i.push({key:`associationFiled_${t}_table_subMenu_${o}_copy`,type:"subMenu",name:"copy",dataSource:v,title:f("Duplicate template"),children:n.map(t=>{let o=[r+"FormItem",r+"ReadPrettyFormItem"].includes(null==t?void 0:t.componentName)?`${null==t?void 0:t.name} ${f("(Fields only)")}`:null==t?void 0:t.name;return{type:"item",mode:"copy",name:`${e.collectionName}.${e.name}`,collectionName:e.target,template:t,dataSource:v,title:o||f("Untitled"),associationField:e}})},{key:`associationFiled_${t}_table_subMenu_${o}_ref`,type:"subMenu",name:"ref",dataSource:v,title:f("Reference template"),children:n.map(t=>{let o=[r+"FormItem",r+"ReadPrettyFormItem"].includes(null==t?void 0:t.componentName)?`${null==t?void 0:t.name} ${f("(Fields only)")}`:null==t?void 0:t.name;return{type:"item",mode:"reference",name:`${e.collectionName}.${e.name}`,collectionName:e.target,template:t,dataSource:v,title:o||f("Untitled"),associationField:e}})}),a.length&&i.push({type:"subMenu",name:"inherited_templates",key:`associationFiled_${t}_table_subMenu_${o}_inherited`,dataSource:v,title:f("Inherited template"),children:a}),{key:`associationFiled_${t}_table_subMenu_${o}`,type:"subMenu",name:`${e.target}_${o}`,title:l,dataSource:v,children:[{type:"item",name:`${e.collectionName}.${e.name}`,collectionName:e.target,dataSource:v,title:f("Blank block"),associationField:e},...i]}})},[m.fields,y,t,v,c,o,p,g,n,f,r])}({componentName:_+o,filterCollections:n,showAssociationFields:c,componentNamePrefix:_,name:t}),A=(0,s.useAssociationName)(),T=F.getAllCollections({filterCollection:e=>(!d||e.dataSource===M)&&n({collection:e}),filterDataSource:m});d&&(T=T.filter(e=>e.key===M));let{getTemplatesByCollection:w}=(0,x.ov)(),j=(0,a.useMemo)(()=>T.map(e=>{let{key:l,displayName:n,collections:a}=e;return{name:l,label:n,type:"subMenu",children:[...H({name:t,association:A,collections:a,componentName:_+o,searchValue:"",dataSource:l,getTemplatesByCollection:w,t:k,componentNamePrefix:_}).sort(e=>{let t=r.default.toArray((null==P?void 0:P.inherits)||[]);if(e.name===(null==P?void 0:P.name)||t.some(t=>t===e.name))return -1})]}}),[T,null==P?void 0:P.inherits,null==P?void 0:P.name,o,w,k]);return c?(0,a.useMemo)(()=>{let e,t={name:"currentRecord",collectionName:P.name,dataSource:P.dataSource,Component:s.DataBlockInitializer,onClick(){},componentProps:{...g,icon:null,title:S||k("Current record"),name:"currentRecord",hideSearch:!1,hideChildrenIfSingleCollection:!0,items:j}},l={name:"associationRecords",Component:s.DataBlockInitializer,onClick(){},componentProps:{...g,icon:null,title:k("Associated records"),name:"associationRecords",hideSearch:!1,items:[{name:"associationFields",label:k("Association fields"),type:"subMenu",children:I}]}},n={name:"otherRecords",Component:s.DataBlockInitializer,onClick(){},componentProps:{...g,hideSearch:!1,icon:null,title:C||k("Other records"),name:"otherRecords",showAssociationFields:!1,onlyCurrentDataSource:!1,hideChildrenIfSingleCollection:!1,fromOthersInPopup:!0,componentType:{ReadPrettyFormItem:"Details"}[o]||o,filter(e){let{collection:t,associationField:o}=e;return!b||b(t)},onClick(e){y({...e,fromOthersInPopup:!0})}}},r=I.length?l:null;if(j[0].children.length&&I.length)e=f?[t,r]:[t,r,n];else if(j[0].children.length)if(f){if(j[0].children.length<=1){var a;return j[0].children=(null==(a=j[0].children[0])?void 0:a.children)||[],j}e=[t]}else e=[t,n];else e=f?[r]:[r,n];return[{name:"records",label:k("Records"),type:"subMenu",children:e.filter(Boolean)}]},[I,P.dataSource,P.name,o,g,b,f,j,y,k]):j},O=e=>{let{formItemInitializers:t="details:configureFields",actionInitializers:o="detailsWithPaging:configureActions",collection:l,dataSource:r,association:a,template:i,settings:s,action:d="list",...c}=e,u=a||l;return{type:"void","x-acl-action":"get"===d?`${u}:get`:`${u}:view`,"x-decorator":"DetailsBlockProvider","x-decorator-props":{dataSource:r,collection:l,association:a,readPretty:!0,action:d,..."list"===d?{params:{pageSize:1}}:{},...c},"x-toolbar":"BlockSchemaToolbar","x-settings":s,"x-component":"CardItem",properties:{[(0,n.uid)()]:{type:"void","x-component":"Details","x-use-component-props":"useDetailsBlockProps","x-read-pretty":!0,properties:{[(0,n.uid)()]:{type:"void","x-initializer":o,"x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{}},grid:i||{type:"void","x-component":"Grid","x-initializer":t,properties:{}},..."list"===d?{pagination:{type:"void","x-component":"Pagination","x-use-component-props":"useDetailsPaginationProps"}}:{}}}}}},V=e=>{let{formItemInitializers:t="form:configureFields",actionInitializers:o="createForm:configureActions",collection:l,resource:r,dataSource:a,association:i,action:s,actions:d={},"x-designer":c="FormV2.Designer",template:u,title:p,settings:m,...h}=e,x=r||i||l;return{type:"void","x-acl-action-props":{skipScopeCheck:!s},"x-acl-action":s?`${x}:update`:`${x}:create`,"x-decorator":"FormBlockProvider","x-decorator-props":{...h,action:s,dataSource:a,resource:x,collection:l,association:i},"x-toolbar":"BlockSchemaToolbar",...m?{"x-settings":m}:{"x-designer":c},"x-component":"CardItem","x-component-props":{title:p},properties:{[(0,n.uid)()]:{type:"void","x-component":"FormV2","x-use-component-props":"useFormBlockProps",properties:{grid:u||{type:"void","x-component":"Grid","x-initializer":t,properties:{}},[(0,n.uid)()]:{type:"void","x-initializer":o,"x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:d}}}}}},$=e=>{let{formItemInitializers:t="details:configureFields",actionInitializers:o="details:configureActions",collection:l,association:r,dataSource:a,resource:i,template:s,settings:d,...c}=e,u=i||r||l;return{type:"void","x-acl-action":`${u}:get`,"x-decorator":"FormBlockProvider","x-decorator-props":{resource:u,collection:l,association:r,dataSource:a,readPretty:!0,action:"get",useParams:"{{ useParamsFromRecord }}",...c},"x-toolbar":"BlockSchemaToolbar","x-settings":d,"x-component":"CardItem",properties:{[(0,n.uid)()]:{type:"void","x-component":"FormV2","x-use-component-props":"useFormBlockProps","x-read-pretty":!0,properties:{[(0,n.uid)()]:{type:"void","x-initializer":o,"x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{}},grid:s||{type:"void","x-component":"Grid","x-initializer":t,properties:{}}}}}}},q=e=>{let{collection:t,rowKey:o,tableActionInitializers:l,tableColumnInitializers:r,tableActionColumnInitializers:a,tableBlockProvider:i,disableTemplate:s,dataSource:d,blockType:c,pageSize:u=20,...p}=e;return{type:"void","x-decorator":i??"TableBlockProvider","x-acl-action":`${t}:list`,"x-decorator-props":{collection:t,dataSource:d,action:"list",params:{pageSize:u},rowKey:o,showIndex:!0,dragSort:!1,disableTemplate:s??!1,blockType:c,...p},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table","x-component":"CardItem","x-filter-targets":[],properties:{actions:{type:"void","x-initializer":l??"table:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--nb-spacing)"}},properties:{}},[(0,n.uid)()]:{type:"array","x-initializer":r??"table:configureColumns","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-designer":"TableV2.ActionColumnDesigner","x-initializer":a??"table:configureItemActions",properties:{[(0,n.uid)()]:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{},properties:{}}}}}}}}},H=e=>{var t;let{name:o,association:l,collections:n,dataSource:r,componentName:a,searchValue:i,getTemplatesByCollection:s,t:d,componentNamePrefix:c}=e;return null==n||null==(t=n.filter(e=>{if(e.inherit||!e.filterTargetKey)return!1;{if([c+"Kanban",c+"FormItem"].includes(a)&&("view"===e.template&&!e.writableView||"sql"===e.template)||"file"===e.template&&[c+"Kanban",c+"FormItem",c+"Calendar"].includes(a))return!1;let t=e.title||e.tableName;return!!t&&t.toUpperCase().includes(i.toUpperCase())&&!((null==e?void 0:e.isThrough)&&(null==e?void 0:e.autoCreate))}}))?void 0:t.map((e,t)=>{let n=e.title||e.tableName||e.label,i=s(r,e.name).filter(e=>{var t;let n="otherRecords"!==o&&l;return n?e.resourceName===l&&a&&e.componentName===a:!(!n&&(null==e||null==(t=e.resourceName)?void 0:t.includes(".")))&&a&&e.componentName===a}),u=Array.from(G.values()).map(o=>o({item:e,index:t,componentName:a,association:l})).filter(Boolean).flat();if(!i.length&&!u.length||U())return{type:"item",name:e.name,title:n,dataSource:r};let p=[{type:"divider",name:"divider"}];return i.length&&p.push({key:`${a}_table_subMenu_${t}_copy`,type:"subMenu",name:"copy",dataSource:r,title:d("Duplicate template"),children:i.map(t=>{let o=[c+"FormItem",c+"ReadPrettyFormItem"].includes(null==t?void 0:t.componentName)?`${null==t?void 0:t.name} ${d("(Fields only)")}`:null==t?void 0:t.name;return{type:"item",mode:"copy",name:e.name,template:t,dataSource:r,title:o||d("Untitled")}})},{key:`${a}_table_subMenu_${t}_ref`,type:"subMenu",name:"ref",dataSource:r,title:d("Reference template"),children:i.map(t=>{let o=[c+"FormItem",c+"ReadPrettyFormItem"].includes(null==t?void 0:t.componentName)?`${null==t?void 0:t.name} ${d("(Fields only)")}`:null==t?void 0:t.name;return{type:"item",mode:"reference",name:e.name,template:t,dataSource:r,title:o||d("Untitled")}})}),u.length&&p.push({type:"subMenu",name:"inherited_templates",key:`associationFiled_${a}_table_subMenu_${t}_inherited`,dataSource:r,title:d("Inherited template"),children:u}),{key:`${a}_table_subMenu_${t}`,type:"subMenu",name:`${e.name}_${t}`,title:n,dataSource:r,children:[{type:"item",name:e.name,dataSource:r,title:d("Blank block")},...p]}})},U=()=>window.location.pathname.includes("/ui-templates/inherited-v1"),G=new Map;function K(e,t){G.set(e,t)}},18272(e,t,o){o.d(t,{yF:()=>p,sm:()=>m,g$:()=>f});var l=o(71178),n=o(56920),r=o(52793),a=o(51649),i=o(77843),s=o(20629),d=o(95951),c=o(8724),u=o(99300);let p=e=>{var t,o,u;let{openMode:p=!0,openSize:m=!0}=e,h=(0,n.useFieldSchema)(),x=(0,n.useField)(),{t:v}=(0,i.useTranslation)(),{dn:g}=(0,d.er)(),{isPopupVisibleControlledByURL:f}=(0,c.X)(),y=(null==h||null==(t=h["x-component-props"])?void 0:t.openMode)||"drawer",b=(0,a.useMemo)(()=>f()?[{label:v("Drawer"),value:"drawer"},{label:v("Dialog"),value:"modal"},{label:v("Page"),value:"page"}]:[{label:v("Drawer"),value:"drawer"},{label:v("Dialog"),value:"modal"}],[v,f()]);return(0,l.jsxs)(l.Fragment,{children:[p?(0,l.jsx)(s.S3,{closeInitializerMenuWhenClick:!1,title:v("Open mode"),options:b,value:y,onChange:e=>{x.componentProps.openMode=e;let t={"x-uid":h["x-uid"]};t["x-component-props"]=h["x-component-props"]||{},t["x-component-props"].openMode=e,h["x-component-props"].openMode=e,Reflect.deleteProperty(h["x-component-props"],"openSize"),g.emit("patch",{schema:t}),g.refresh()}}):null,m&&["modal","drawer"].includes(y)?(0,l.jsx)(s.rR,{closeInitializerMenuWhenClick:!1,children:(0,l.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},children:[v("Popup size"),(0,l.jsx)(r.Select,{"data-testid":"antd-select",bordered:!1,options:[{label:v("Small"),value:"small"},{label:v("Middle"),value:"middle"},{label:v("Large"),value:"large"}],value:(null==h||null==(o=h["x-component-props"])?void 0:o.openSize)??((null==h||null==(u=h["x-component-props"])?void 0:u.openMode)=="modal"?"large":"middle"),onChange:e=>{x.componentProps.openSize=e;let t={"x-uid":h["x-uid"]};t["x-component-props"]=h["x-component-props"]||{},t["x-component-props"].openSize=e,h["x-component-props"].openSize=e,g.emit("patch",{schema:t}),g.refresh()},style:{textAlign:"right",minWidth:100}})]})}):null]})},m=e=>{var t,o,r;let{openMode:s=!0,openSize:c=!0,modeOptions:p,targetSchema:m}=e,h=(0,n.useFieldSchema)(),x=m||h,v=(0,n.useField)(),{t:g}=(0,i.useTranslation)(),{dn:f}=(0,d.er)(),y=(null==x||null==(t=x["x-component-props"])?void 0:t.openMode)||"drawer",b=(0,a.useMemo)(()=>p||[{label:g("Drawer"),value:"drawer"},{label:g("Dialog"),value:"modal"},{label:g("Page"),value:"page"}],[p,g]);return(0,l.jsxs)(l.Fragment,{children:[s?(0,l.jsx)(u.Al,{title:g("Open mode"),options:b,value:y,onChange:e=>{v.componentProps.openMode=e;let t={"x-uid":x["x-uid"]};t["x-component-props"]=x["x-component-props"]||{},t["x-component-props"].openMode=e,x["x-component-props"].openMode=e,Reflect.deleteProperty(x["x-component-props"],"openSize"),f.emit("patch",{schema:t}),f.refresh()}}):null,c&&["modal","drawer"].includes(y)?(0,l.jsx)(u.Al,{title:g("Popup size"),options:[{label:g("Small"),value:"small"},{label:g("Middle"),value:"middle"},{label:g("Large"),value:"large"}],value:(null==x||null==(o=x["x-component-props"])?void 0:o.openSize)??((null==x||null==(r=x["x-component-props"])?void 0:r.openMode)=="modal"?"large":"middle"),onChange:e=>{v.componentProps.openSize=e;let t={"x-uid":x["x-uid"]};t["x-component-props"]=x["x-component-props"]||{},t["x-component-props"].openSize=e,x["x-component-props"].openSize=e,f.emit("patch",{schema:t}),f.refresh()}}):null]})};var h=o(77583),x=o(43288),v=o(82924),g=o(4627);let f=(0,n.observer)(e=>{var t,o,r;let{required:a=!0}=e,{getCollectionJoinField:s}=(0,x.nj)(),{getField:d}=(0,x.k7)(),c=(0,n.useField)(),p=(0,n.useFieldSchema)(),{t:m}=(0,i.useTranslation)(),{dn:f,refresh:y}=(0,v.erX)(),b=(0,v.lum)(),S=d(p.name)||s(p["x-collection-field"]);return(0,l.jsxs)(l.Fragment,{children:[S&&(0,l.jsx)(u.fY,{title:m("Edit field title"),schema:{type:"object",title:m("Edit field title"),properties:{title:{title:m("Field title"),default:null==c?void 0:c.title,description:`${m("Original field title: ")}${null==S||null==(t=S.uiSchema)?void 0:t.title}`,"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit:e=>{var t;let{title:o}=e;c.title=b(""===o.trim()?null==S||null==(t=S.uiSchema)?void 0:t.title:o),p.title=o,f.emit("patch",{schema:{"x-uid":p["x-uid"],title:p.title}}),f.refresh()}},"edit-field-title"),(0,l.jsx)(u.Qd,{checked:(null==(o=p["x-decorator-props"])?void 0:o.showTitle)??!0,title:m("Display title"),onChange:e=>{p["x-decorator-props"]=p["x-decorator-props"]||{},p["x-decorator-props"].showTitle=e,c.decoratorProps.showTitle=e,f.emit("patch",{schema:{"x-uid":p["x-uid"],"x-decorator-props":{...p["x-decorator-props"],showTitle:e}}}),f.refresh()}}),!c.readPretty&&(0,l.jsx)(u.fY,{title:m("Edit description"),schema:{type:"object",title:m("Edit description"),properties:{description:{default:null==c?void 0:c.description,"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{}}}},onSubmit:e=>{let{description:t}=e;c.description=t,p.description=t,f.emit("patch",{schema:{"x-uid":p["x-uid"],description:p.description}}),f.refresh()}},"edit-description"),c.readPretty&&(0,l.jsx)(u.fY,{title:m("Edit tooltip"),schema:{type:"object",title:m("Edit description"),properties:{tooltip:{default:null==p||null==(r=p["x-decorator-props"])?void 0:r.tooltip,"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{}}}},onSubmit:e=>{let{tooltip:t}=e;c.decoratorProps.tooltip=t,p["x-decorator-props"]=p["x-decorator-props"]||{},p["x-decorator-props"].tooltip=t,f.emit("patch",{schema:{"x-uid":p["x-uid"],"x-decorator-props":p["x-decorator-props"]}}),f.refresh()}},"edit-tooltip"),!c.readPretty&&"FormField"!==p["x-component"]&&a&&(0,l.jsx)(u.Qd,{title:m("Required"),checked:p.required,onChange:e=>{let t={"x-uid":p["x-uid"]};c.required=e,h.default.set(c,"initStateOfLinkageRules.required",(0,g.qE)(!0,e)),p.required=e,t.required=e,f.emit("patch",{schema:t}),y()}},"required")]})},{displayName:"GeneralSchemaItems"})},65457(e,t,o){o.d(t,{gc:()=>N,OH:()=>E});var l=o(71178),n=o(56920),r=o(2314),a=o(52793),i=o(77583),s=o(51649),d=o(77843),c=o(43288),u=o(58980),p=o(80461),m=o(82924),h=o(58329),x=o(56220);let v=s.default.forwardRef((e,t)=>{var o;let n=x.ArrayBase.useArray(),r=x.ArrayBase.useIndex(e.index),{t:i}=(0,d.useTranslation)();return(0,l.jsx)(a.Switch,{...e,checkedChildren:i("Default"),unCheckedChildren:i("Default"),checked:null==n||null==(o=n.field)?void 0:o.value[r].default,style:{transition:"all 0.25s ease-in-out",color:"rgba(0, 0, 0, 0.8)",fontSize:16,marginLeft:6,marginBottom:3},onChange:(e,t)=>{var o;t.stopPropagation(),n.field.value.splice(r,1,{...null==n||null==(o=n.field)?void 0:o.value[r],default:e}),n.field.value.forEach((e,t)=>{if(t!==r){var o;n.field.value.splice(t,1,{...null==n||null==(o=n.field)?void 0:o.value[t],default:!1})}})},onClick:(e,t)=>{t.stopPropagation()}})});v.displayName="AsDefaultTemplate";var g=o(82113),f=o(27404),y=o(94046);let b=(0,o(54944).f)("nb-array-collapse",e=>{let{componentCls:t}=e;return{[t]:{marginBottom:"10px"}}}),S=(0,n.observer)(e=>{var t;let o=x.ArrayBase.useArray(),n=x.ArrayBase.useIndex(e.index),{t:r}=(0,d.useTranslation)(),i=null==o||null==(t=o.field)?void 0:t.value[n];return(0,s.useEffect)(()=>{if(i.key||(i.key=(0,f.uid)()),!i.title){var e,t;i.title=`${r("Template name")} ${null==o||null==(t=o.field)||null==(e=t.value)?void 0:e.length}`}},[]),(0,l.jsx)(a.Input.TextArea,{value:i.title,placeholder:r("Template name"),onChange:e=>{e.stopPropagation(),i.title=e.target.value},onBlur:e=>{e.stopPropagation(),i.title=e.target.value},autoSize:!0,style:{width:"70%",border:"none"},onClick:e=>{e.stopPropagation()}})}),C=e=>{var t,o;return(null==(o=e["x-component"])||null==(t=o.indexOf)?void 0:t.call(o,"Addition"))>-1},_=e=>{var t,o;return(null==(o=e["x-component"])||null==(t=o.indexOf)?void 0:t.call(o,"Index"))>-1},k=e=>{var t,o,l,n,r,a,i,s;return C(e)||(null==(o=e["x-component"])||null==(t=o.indexOf)?void 0:t.call(o,"Remove"))>-1||(null==(n=e["x-component"])||null==(l=n.indexOf)?void 0:l.call(n,"MoveDown"))>-1||(null==(a=e["x-component"])||null==(r=a.indexOf)?void 0:r.call(a,"MoveUp"))>-1||(null==(s=e["x-component"])||null==(i=s.indexOf)?void 0:i.call(s,"Copy"))>-1},F=e=>Array.from({length:e}).map((e,t)=>t),M=(e,t)=>e<t?F(e):F(t),P=(0,n.observer)(e=>{let{componentCls:t,hashId:o}=b(),r=(0,n.useField)(),i=Array.isArray(r.value)?r.value:[],[d,c]=(0,s.useState)(M(i.length,e.defaultOpenPanelCount)),u=(0,n.useFieldSchema)();if((0,s.useEffect)(()=>{!r.modified&&i.length&&c(M(i.length,e.defaultOpenPanelCount))},[i.length,r]),!u)throw Error("can not found schema object");return(0,l.jsxs)(x.ArrayBase,{onAdd:e=>{c(d.length<=e?d.concat(e):d.reduce((t,o)=>o<e?t.concat(o):o===e?t.concat([o,o+1]):t.concat(o+1),[]))},onRemove:()=>{r.initialValue=r.value},children:[(()=>{if(!i.length)return(0,l.jsx)(a.Card,{className:(0,y.default)(t,o,e.className),children:(0,l.jsx)(a.Empty,{})})})(),(0,l.jsx)(a.Collapse,{...e,activeKey:d,onChange:e=>c((0,f.toArr)(e).map(Number)),className:(0,y.default)(t,o,e.className),children:i.map((e,t)=>{let o,i,d,c=Array.isArray(u.items)?u.items[t]||u.items[0]:u.items,p=r.query(`${r.address}.${t}`).get("componentProps"),m=c["x-component-props"],h=(0,l.jsxs)(x.ArrayBase.Item,{index:t,record:e,children:[(0,l.jsx)(n.RecursionField,{schema:c,name:t,filterProperties:e=>!!k(e),onlyRenderProperties:!0}),null==p?void 0:p.extra]}),v=(0,l.jsx)(n.RecursionField,{schema:c,name:t,filterProperties:e=>!(_(e)||k(e))});return(0,s.createElement)(a.Collapse.Panel,{...m,...p,forceRender:!0,key:t,header:(o=`${(null==p?void 0:p.header)||m.header||r.title}`,i=r.address.concat(t),d=r.form.queryFeedbacks({type:"error",address:`${i}.**`}),(0,l.jsxs)(x.ArrayBase.Item,{index:t,record:()=>{var e;return null==(e=r.value)?void 0:e[t]},children:[(0,l.jsx)(n.RecursionField,{schema:c,name:t,filterProperties:e=>!!_(e),onlyRenderProperties:!0}),d.length?(0,l.jsx)(a.Badge,{size:"small",className:"errors-badge",count:d.length,children:o}):(0,l.jsx)(S,{item:e.initialValue||e,index:t})]})),extra:h},(0,l.jsx)(x.ArrayBase.Item,{index:t,record:e,children:v},t))})}),u.reduceProperties((e,t,o)=>C(t)?(0,l.jsx)(n.RecursionField,{schema:t,name:o}):e,null)]})},{displayName:"ArrayCollapse"}),I=e=>{let{children:t}=e;return(0,l.jsx)(s.Fragment,{children:t})};I.displayName="CollapsePanel",P.defaultProps={defaultOpenPanelCount:5},P.displayName="ArrayCollapse",P.CollapsePanel=I,x.ArrayBase.mixin(P),P.Copy=s.default.forwardRef((e,t)=>{var o;let r=(0,n.useField)(),a=x.ArrayBase.useArray(),s=x.ArrayBase.useIndex(e.index);return a&&(null==(o=a.field)?void 0:o.pattern)==="editable"?(0,l.jsx)(g.CopyOutlined,{...e,style:{transition:"all 0.25s ease-in-out",color:"rgba(0, 0, 0, 0.8)",fontSize:"16px",marginLeft:6},ref:t,onClick:t=>{var o,l;if((null==r?void 0:r.disabled)||(t.stopPropagation(),null==(o=a.props)?void 0:o.disabled))return;let n=(0,i.clone)(null==a||null==(l=a.field)?void 0:l.value[s]);a.field.push(n),e.onClick&&e.onClick(t)}}):null}),P.Copy.displayName="ArrayCollapse.Copy";var A=o(63526),T=o(99300),w=o(69412),j=o(79056);function D(e){return e?{id:{$eq:e}}:null}function L(e){let{title:t,options:o,value:n,onChange:r,...i}=e;return(0,l.jsx)(T.iU,{title:t,...i,children:(0,l.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},children:[t,(0,l.jsx)(a.Select,{popupMatchSelectWidth:!1,bordered:!1,value:n,onChange:r,options:o,style:{textAlign:"right",minWidth:100},...i})]})})}(0,n.observer)(()=>{var e,t,o,r;let{getCollectionFields:a,getCollectionField:s,getCollection:p,isTitleField:h}=(0,c.nj)(),x=(0,n.useField)(),v=(0,n.useFieldSchema)(),{t:g}=(0,d.useTranslation)(),{dn:f}=(0,m.erX)(),y=(0,m.lum)(),{formSchema:b,data:S}=v["x-designer-props"],{form:C}=(0,w.Es)(),_=x.componentProps.service.resource,k=p(_),F=a(_);if(!S)return(0,A.error)("data is required"),null;let M=F.filter(e=>h(e)).map(e=>{var t;return{value:null==e?void 0:e.name,label:y(null==e||null==(t=e.uiSchema)?void 0:t.title)||(null==e?void 0:e.name)}});return(0,l.jsxs)(T.xK,{draggable:!1,children:[(0,l.jsx)(j.Z,{collectionName:_,defaultFilter:(null==(t=S.config)||null==(e=t[_])?void 0:e.filter)||{},form:C,onSubmit:e=>{let{filter:t}=e;try{i.default.set(S,`config.${_}.filter`,(0,m.pA3)(t))}catch(e){(0,A.error)(e)}try{x.query("fieldReaction.items.*.layout.dataId").forEach(e=>{e.componentProps.service.resource===_&&(e.componentProps.service.params={filter:i.default.isEmpty(t)?{}:(0,m.pA3)((0,u.Dj)([t,D(x.value)],"$or"))})})}catch(e){(0,A.error)(e)}b["x-data-templates"]=S,f.emit("patch",{schema:{"x-uid":b["x-uid"],"x-data-templates":S}}),f.refresh()}}),(0,l.jsx)(L,{title:g("Title field"),options:M,value:(null==(r=S.config)||null==(o=r[_])?void 0:o.titleField)||(null==k?void 0:k.titleField)||"id",onChange:e=>{try{i.default.set(S,`config.${_}.titleField`,e)}catch(e){(0,A.error)(e)}try{x.query("fieldReaction.items.*.layout.dataId").forEach(t=>{t.componentProps.service.resource===_&&(t.componentProps.fieldNames.label=e,t.componentProps.targetField=s(`${_}.${e||(null==k?void 0:k.titleField)||"id"}`))})}catch(e){console.error(e)}b["x-data-templates"]=S;let t={"x-uid":b["x-uid"],"x-data-templates":S};f.emit("patch",{schema:t}),f.refresh()}},"title-field")]})},{displayName:"Designer"});var R=o(57593),Y=o(45239);let B=(0,n.connect)(a.Tree,(0,n.mapProps)({value:"checkedKeys",dataSource:"treeData"}));B.displayName="Tree";let N=(e,t)=>null==e?void 0:e.map(e=>{let{dataId:o,...l}=e,n={...l};if(o){var r;n.dataScope={$and:[{id:{$eq:o}}]},n.titleField=(null==n?void 0:n.titleField)||(null==t||null==(r=t[e.collection])?void 0:r.titleField)||"id"}return n}),E=(0,p.T)((0,n.observer)(e=>{let{formSchema:t,designerCtx:o,defaultValues:n,collectionName:a}=(0,m.YYe)(e),{collectionList:p,getEnableFieldTree:x,getOnLoadData:g,getOnCheck:f,getScopeDataSource:y,useTitleFieldDataSource:b}=(0,R.l)(a),{getCollection:S,getCollectionField:C}=(0,c.nj)(),{t:_}=(0,d.useTranslation)(),k=(0,s.useMemo)(()=>(0,r.observable)({...n,items:N((null==n?void 0:n.items)||[],null==n?void 0:n.config)}),[]),F=e=>{var t;let o=S(e);return C(`${e}.${(null==k||null==(t=k.config[e])?void 0:t.titleField)||(null==o?void 0:o.titleField)||"id"}`)},M=e=>{var t,o;let l=S(e);return{label:(null==(o=k.config)||null==(t=o[e])?void 0:t.titleField)||(null==l?void 0:l.titleField)||"id",value:"id"}},I=(e,t)=>{var o,l;let n=null==(l=k.config)||null==(o=l[e])?void 0:o.filter;return i.default.isEmpty(n)?{}:(0,m.pA3)((0,u.Dj)([n,D(t)],"$or"))},A=(0,s.useMemo)(()=>({ArrayCollapse:P}),[]),T=(0,s.useMemo)(()=>({getEnableFieldTree:x,getTargetField:F,getFieldNames:M,getFilter:I,getResource:z,getOnLoadData:g,getOnCheck:f,collectionName:a,getScopeDataSource:y,useTitleFieldDataSource:b}),[]),w=(0,s.useMemo)(()=>({type:"object",properties:{items:{type:"array",default:null==k?void 0:k.items,"x-component":"ArrayCollapse","x-decorator":"FormItem","x-component-props":{accordion:!0},items:{type:"object","x-component":"ArrayCollapse.CollapsePanel","x-component-props":{extra:[(0,l.jsx)(v,{},"0")]},properties:{layout:{type:"void","x-component":"FormLayout","x-component-props":{layout:"vertical"},properties:{collection:{type:"string",title:'{{ t("Collection") }}',required:!0,description:_("If collection inherits, choose inherited collections as templates"),default:"{{ collectionName }}","x-display":p.length>1?"visible":"hidden","x-decorator":"FormItem","x-component":"Select","x-component-props":{options:p}},dataScope:{type:"object",title:'{{ t("Filter out a single piece or a group of records as a template") }}',"x-decorator":"FormItem","x-component":"Filter","x-component-props":{dynamicComponent:h.P8},"x-decorator-props":{style:{marginBottom:"0px"}},required:!0,"x-reactions":[{dependencies:[".collection"],fulfill:{state:{disabled:"{{ !$deps[0] }}"},schema:{enum:"{{ getScopeDataSource($deps[0]) }}"}}}]},titleField:{type:"string","x-decorator":"FormItem",title:'{{ t("Title field") }}',"x-decorator-props":{tooltip:'{{t("The title field is used to identify the template record")}}'},"x-component":"Select",required:!0,"x-reactions":"{{useTitleFieldDataSource}}"},syncFromForm:{type:"void",title:'{{ t("Sync from form fields") }}',"x-component":"Action.Link","x-component-props":{type:"primary",style:{float:"right",position:"relative",zIndex:1200},useAction:()=>(0,Y.r)(t)}},fields:{type:"array",title:'{{ t("Template fields") }}',"x-decorator-props":{tooltip:'{{t("The selected fields will automatically populate the form")}}'},required:!0,description:_("Only the selected fields will be used as the initialization data for the form"),"x-decorator":"FormItem","x-component":B,"x-component-props":{treeData:[],checkable:!0,checkStrictly:!0,selectable:!1,loadData:"{{ getOnLoadData($self) }}",onCheck:"{{ getOnCheck($self) }}",rootStyle:{padding:"8px 0",border:"1px solid #d9d9d9",borderRadius:"2px",maxHeight:"30vh",overflow:"auto",margin:"2px 0"}},"x-reactions":[{dependencies:[".collection"],fulfill:{state:{disabled:"{{ !$deps[0] }}",componentProps:{treeData:"{{ getEnableFieldTree($deps[0], $self) }}"}}}}]}}},remove:{type:"void","x-component":"ArrayCollapse.Remove"},moveUp:{type:"void","x-component":"ArrayCollapse.MoveUp"},moveDown:{type:"void","x-component":"ArrayCollapse.MoveDown"}}},properties:{add:{type:"void",title:'{{ t("Add template") }}',"x-component":"ArrayCollapse.Addition"}}},display:{type:"boolean","x-content":'{{ t("Enable form data template") }}',default:(null==k?void 0:k.display)!==!1,"x-decorator":"FormItem","x-component":"Checkbox"}}}),[]);return(0,l.jsx)(m.u4V.Provider,{value:{...o,designable:!0},children:(0,l.jsx)(m.HvB,{components:A,scope:T,schema:w})})}),{displayName:"FormDataTemplates"});function z(e,t){return e!==t.componentProps.service.resource&&(t.value=void 0),e}},98548(e,t,o){o.d(t,{n:()=>r});var l=o(71178),n=o(52793);o(51649);let r=e=>{let{tag:t,type:o,displayType:r=!0}=e;return(0,l.jsx)("div",{children:(0,l.jsxs)(n.Tag,{color:{reference:"blue",duplicate:"green",preloading:"cyan"}[o],children:[(0,l.jsx)("span",{children:t})," ",r?`(${({reference:"Reference",duplicate:"Duplicate",preloading:"Preloading"})[o]})`:""]})})}},57593(e,t,o){o.d(t,{K:()=>s,l:()=>d});var l=o(56920),n=o(51649),r=o(43288),a=o(82924),i=o(98548);let s=["sort","createdById","createdBy","createdAt","updatedById","updatedBy","updatedAt","password","sequence"],d=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],o=arguments.length>2?arguments[2]:void 0,{getCollectionFields:d,getAllCollectionsInheritChain:u,getCollection:p,getInterface:m}=(0,r.nj)(),[h]=(0,n.useState)(function(){return(u(e)||[]).map(e=>{var t;return{label:null==(t=p(e))?void 0:t.title,value:e}})}),x=(0,a.lum)(),v=(0,l.useField)(),g=(e,l)=>{let{exclude:r=[],depth:a=0,maxDepth:c,prefix:u=""}=l;return a>c?[]:d(e).map(e=>{var l;if(r.includes(e.name)||!e.interface||0===a&&["sort","password","sequence"].includes(e.type)||o&&o(e))return;let d={type:"duplicate",tag:x(null==(l=e.uiSchema)?void 0:l.title)||e.name},p={...d,role:"button",title:n.default.createElement(i.n,{...d,displayType:t}),key:u?`${u}.${e.name}`:e.name,isLeaf:!0,field:e};return["belongsTo","belongsToMany"].includes(e.type)?(d.type="reference",p.type="reference",p.title=n.default.createElement(i.n,{...d,type:"reference",displayType:t}),p.isLeaf=!1,p.children=f(e.target,{depth:a+1,maxDepth:c,prefix:p.key,exclude:s})):["hasOne","hasMany"].includes(e.type)&&(p.isLeaf=!1,p.children=g(e.target,{depth:a+1,maxDepth:c,prefix:p.key,exclude:["id",...s.filter(e=>"sort"!==e)]})),p}).filter(Boolean)},f=(e,o)=>{let{prefix:l,maxDepth:r,depth:a=0,exclude:s=[]}=o;return a>r?[]:d(e).map(e=>{var o;if(!e.target||!e.interface||s.includes(e.name))return;let d={type:"preloading",tag:x(null==(o=e.uiSchema)?void 0:o.title)||e.name},c=l?`${l}.${e.name}`:e.name;return{role:"button",title:n.default.createElement(i.n,{...d,displayType:t}),key:c,isLeaf:!1,field:e,children:f(e.target,{prefix:c,depth:a+1,maxDepth:r,exclude:s})}}).filter(Boolean)},y=e=>e.map(e=>({...e,role:"button",title:n.default.createElement(i.n,{...e,type:e.type,displayType:t}),children:e.children?y(e.children):null}));return{collectionList:h,getEnableFieldTree:(0,n.useCallback)((e,t,o)=>{var l,n;let r=t.index,a=null==(n=v.initialValue)||null==(l=n.items)?void 0:l[r];if(!e)return[];if((null==a?void 0:a.treeData)||o)return y(o||a.treeData);try{return g(e,{exclude:["id",...s],maxDepth:1})}catch(e){return console.error(e),[]}},[]),getOnLoadData:(0,n.useCallback)(e=>t=>new Promise(o=>{if(t.children.length)return t.children.forEach(t=>{c({node:t,traverseAssociations:f,traverseFields:g,systemKeys:s,fields:e})}),o(void 0);c({node:t,traverseAssociations:f,traverseFields:g,systemKeys:s,fields:e}),o(void 0)}),[]),getOnCheck:(0,n.useCallback)(e=>t=>{e.value=t},[]),getScopeDataSource:e=>{let t=d(e),o=(e,t)=>{let l=[];return e.forEach(e=>{let n=((e,t)=>{var l,n;if(!e.interface)return;let r=m(e.interface);if(!(null==r?void 0:r.filterable))return;let{nested:a,children:i,operators:s}=r.filterable,c={name:e.name,title:(null==e||null==(l=e.uiSchema)?void 0:l.title)||e.name,schema:null==e?void 0:e.uiSchema,operators:(null==s||null==(n=s.filter)?void 0:n.call(s,t=>!(null==t?void 0:t.visible)||t.visible(e)))||[],interface:e.interface};if(!e.target||!(t>2)){if(t>2)return c;if((null==i?void 0:i.length)&&(c.children=i),a){let l=o(d(e.target),t+1).filter(Boolean);c.children=c.children||[],c.children.push(...l)}return c}})(e,t);n&&l.push(n)}),l};return o(t,1)},useTitleFieldDataSource:e=>{let t=e.path.entire.replace("titleField","collection"),o=d(e.query(t).get("value")).filter(e=>{var t;return null==(t=m(e.interface))?void 0:t.titleUsable}).map(e=>{var t;return{value:null==e?void 0:e.name,label:x(null==e||null==(t=e.uiSchema)?void 0:t.title)||(null==e?void 0:e.name)}});e.dataSource=o}}};function c(e){let{node:t,traverseAssociations:o,traverseFields:l,systemKeys:n,fields:r}=e,a=function(e,t){let o=[...e];for(;o.length;){let e=o.shift();if(e.key===t.key)return e;e.children&&o.push(...e.children)}}(r.dataSource||r.componentProps.treeData,t),i=[];return["belongsTo","belongsToMany"].includes(t.field.type)&&(null==t?void 0:t.type)==="reference"?i=o(t.field.target,{exclude:n,prefix:t.key,maxDepth:1}):(["hasOne","hasMany"].includes(t.field.type)||(null==t?void 0:t.type)==="duplicate")&&(i=l(t.field.target,{exclude:["id",...n.filter(e=>"sort"!==e)],prefix:t.key,maxDepth:1})),i.length?a.children=i:a.isLeaf=!0,i}},45239(e,t,o){o.d(t,{r:()=>m});var l=o(56220),n=o(56920),r=o(52793),a=o(51649),i=o(77843),s=o(73761),d=o(43288),c=o(82924),u=o(98548),p=o(57593);let m=(e,t,o)=>{let m,h,{getCollectionJoinField:x,getCollectionFields:v}=(0,d.nj)(),g=l.ArrayBase.useArray(),f=l.ArrayBase.useIndex(),y=l.ArrayBase.useRecord(),b=(0,c.lum)(),{t:S}=(0,i.useTranslation)(),C=(0,n.useForm)(),_=(m=new ew.LRUCache({max:100}),(e,t,o)=>{let{exclude:l=[],depth:n=0,maxDepth:r,prefix:i="",disabled:s=!1}=t,d=`${e}-${l.join(",")}-${n}-${r}-${i}`,c=m.get(d);if(c)return c;if(n>r)return[];let h=v(e).map(e=>{var t;if(l.includes(e.name)||!e.interface||["sort","password","sequence"].includes(e.type))return;let d={type:"duplicate",tag:b(null==(t=e.uiSchema)?void 0:t.title)||e.name},c={...d,title:a.default.createElement(u.n,d),key:i?`${i}.${e.name}`:e.name,isLeaf:!0,field:e,disabled:s},m=o.find(e=>e.name===c.key);if(["belongsTo","belongsToMany"].includes(e.type)&&(!m||["Select","Picker"].includes(null==m?void 0:m.fieldMode)))d.type="reference",c.type="reference",c.title=a.default.createElement(u.n,{...d,type:"reference"}),c.isLeaf=!1,c.children=k(e.target,{depth:n+1,maxDepth:r,prefix:c.key,exclude:p.K});else if(["hasOne","hasMany"].includes(e.type)||["Nester","SubTable"].includes(null==m?void 0:m.fieldMode)){let t=!1;["hasOne","hasMany"].includes(e.type)&&["Select","Picker"].includes(null==m?void 0:m.fieldMode)&&(t=!0),c.disabled=!0,c.isLeaf=!1,c.children=_(e.target,{depth:n+1,maxDepth:r,prefix:c.key,exclude:["id",...p.K],disabled:t},o)}return c}).filter(Boolean);return m.set(d,h),h}),k=(h=new ew.LRUCache({max:100}),(e,t)=>{let{prefix:o,maxDepth:l,depth:n=0,exclude:r=[]}=t,i=`${e}-${r.join(",")}-${n}-${l}-${o}`,s=h.get(i);if(s)return s;if(n>l)return[];let d=v(e).map(e=>{var t,i;if(!e.target||!e.interface||r.includes(e.name))return;let s={type:"preloading",tag:b(null==(t=e.uiSchema)?void 0:t.title)||e.name},d=o?`${o}.${e.name}`:e.name;return{type:"preloading",tag:b(null==(i=e.uiSchema)?void 0:i.title)||e.name,title:a.default.createElement(u.n,s),key:d,isLeaf:!1,field:e,children:k(e.target,{prefix:d,depth:n+1,maxDepth:l,exclude:r})}}).filter(Boolean);return h.set(i,d),d}),F=(0,a.useCallback)((e,t)=>{if(!e)return[];try{return _(e,{exclude:["id",...p.K],maxDepth:1,disabled:!1},t)}catch(e){return console.error(e),[]}},[]);return{async run(){let l=new Set([]),n=new Set([]),a=(e,t)=>{var o;null==e||null==(o=e.reduceProperties)||o.call(e,(e,o)=>{var r,i,d;let c=e||t,u=o["x-collection-field"]&&x(o["x-collection-field"]),p=o.name.includes("."),m=u&&["hasOne","hasMany","belongsTo","belongsToMany"].includes(u.type),h=!m&&p?(0,s.getAssociationPath)(o.name):o.name,v=""!==c&&c?c+"."+h:h;if(u&&!(["hasOne","hasMany"].includes(u.type)||["SubForm","Nester"].includes(null==(r=o["x-component-props"])?void 0:r.mode))&&n.add(v),u&&(m||p)&&"TableField"!==o["x-component"]){if(l.add({name:v,fieldMode:(null==(i=o["x-component-props"])?void 0:i.mode)||"Select"}),["Nester","SubTable"].includes(null==(d=o["x-component-props"])?void 0:d.mode)){let e=c&&""!==c?c+"."+o.name:o.name;a(o,e)}}else["ActionBar","Action","Action.Link","Action.Modal","Selector","Viewer","AddNewer","AssociationField.Selector","AssociationField.AddNewer","TableField"].includes(o["x-component"])||a(o,t)},t)};a(e,"");let i=F((null==y?void 0:y.collection)||t,[...l]);if(o)o(i,[...n],C);else{var d;null==g||g.field.form.query(`fieldReaction.items.${f}.layout.fields`).take(e=>{e.componentProps.treeData=[],setTimeout(()=>e.componentProps.treeData=i)}),null==g||g.field.value.splice(f,1,{...null==g||null==(d=g.field)?void 0:d.value[f],fields:[...n],treeData:i})}r.message.success(S("Sync successfully"))}}}},23620(e,t,o){o.d(t,{Bw:()=>w,Oy:()=>T,xK:()=>I});var l=o(71178),n=o(82113),r=o(10691),a=o(56920),i=o(52793),s=o(94046),d=o(51649),c=o(77843),u=o(73907),p=o(69127),m=o(7195),h=o(14669),x=o(23460),v=o(30644),g=o(87382),f=o(63557),y=o(61013),b=o(95951),S=o(29358),C=o(81936),_=o(77490),k=o(77235);let F=(0,o(54944).f)("nb-schema-toolbar",e=>{let{componentCls:t}=e;return{[t]:{position:"absolute",zIndex:999,top:0,left:0,right:0,bottom:0,border:"2px solid var(--colorBorderSettingsHover)",background:"var(--colorBgSettingsHover)",pointerEvents:"none",transitionDelay:"0.1s","&.nb-in-template":{background:"var(--colorTemplateBgSettingsHover)"},"&.hidden":{transform:"scale(0)",pointerEvents:"none"},"&.hidden-e2e":{display:"none"},".ant-space-item .anticon":{margin:0},".toolbar-title":{pointerEvents:"none",position:"absolute",fontSize:12,padding:0,lineHeight:"16px",height:"16px",borderBottomRightRadius:2,borderRadius:2,top:2,left:2},".toolbar-title-tag":{padding:"0 3px",borderRadius:2,background:"var(--colorSettings)",color:"#fff",display:"block"},".toolbar-icons":{position:"absolute",right:"2px",top:"2px",lineHeight:"16px",pointerEvents:"all",".ant-space-item":{backgroundColor:"var(--colorSettings)",color:"#fff",lineHeight:"16px",width:"16px",paddingLeft:"1px",alignSelf:"stretch"}}}}}),M=(0,r.css)`
|
|
1697
|
+
`),children:[(0,r.jsx)(o,{}),e.children,a()]})})};ey.Provider=eg.to,ey.Item=em,ey.Item.Designer=e=>{var t,o,l,n,a;let i=(0,L.useFieldSchema)(),{form:s}=(0,ex.Es)(),d=(0,L.useField)(),{t:c}=(0,x.useTranslation)(),{getCollectionJoinField:u}=(0,F.nj)(),{getField:p}=(0,F.k7)(),m=p(i.name)||u(i["x-collection-field"]),{getCollectionFields:h}=(0,F.nj)(),v=(0,X.lu)(),{dn:g}=(0,X.er)(),f=(null==m?void 0:m.target)?h(null==m?void 0:m.target):[],y=d.componentProps.defaultCollapse,b=f.filter(e=>!(null==e?void 0:e.target)&&"boolean"!==e.type).map(e=>{var t;return{value:null==e?void 0:e.name,label:v(null==e||null==(t=e.uiSchema)?void 0:t.title)||(null==e?void 0:e.name)}});return(0,r.jsxs)(Q.xK,{...e,disableInitializer:!0,children:[(0,r.jsx)(Q.fY,{title:c("Custom title"),schema:{type:"object",title:c("Custom title"),properties:{title:{default:null==i?void 0:i.title,description:`${c("Original title: ")}${(null==m||null==(t=m.uiSchema)?void 0:t.title)||(null==i?void 0:i.title)}`,"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit:e=>{let{title:t}=e;t&&(i.title=t,g.emit("patch",{schema:{"x-uid":i["x-uid"],title:i.title}})),g.refresh()}}),(0,r.jsx)(Q.Qd,{title:c("Default expanded"),checked:y,onChange:e=>{d.componentProps.defaultCollapse=e,eh.default.set(i,"x-component-props.defaultCollapse",e),g.emit("patch",{schema:{"x-uid":i["x-uid"],"x-component-props":i["x-component-props"]}}),g.refresh()}}),(0,r.jsx)(ev.Z,{collectionName:null==m?void 0:m.target,defaultFilter:(null==i||null==(l=i["x-component-props"])||null==(o=l.params)?void 0:o.filter)||{},form:s,onSubmit:e=>{var t;let{filter:o}=e;eh.default.set(d.componentProps,"params",{...null==(t=d.componentProps)?void 0:t.params,filter:o}),i["x-component-props"].params=d.componentProps.params,g.emit("patch",{schema:{"x-uid":i["x-uid"],"x-component-props":i["x-component-props"]}})}}),(0,r.jsx)(Q.lZ,{name:null==m?void 0:m.target}),(0,r.jsx)(Q.Al,{title:c("Title field"),options:b,value:null==(a=i["x-component-props"])||null==(n=a.fieldNames)?void 0:n.label,onChange:e=>{var t,o,l;let n={"x-uid":i["x-uid"]},r={...null==m||null==(o=m.uiSchema)||null==(t=o["x-component-props"])?void 0:t.fieldNames,...null==(l=i["x-component-props"])?void 0:l.fieldNames,label:e};i["x-component-props"]=i["x-component-props"]||{},i["x-component-props"].fieldNames=r,n["x-component-props"]=i["x-component-props"],g.emit("patch",{schema:n}),g.refresh()}},"title-field"),(0,r.jsx)(Q.d$,{breakRemoveOn:{"x-component":"Grid"}})]})},ey.BlockDesigner=()=>{var e,t;let{name:o,title:l}=(0,F.k7)(),n=(0,el.D$)(),a=(0,L.useFieldSchema)(),{t:i}=(0,x.useTranslation)(),{componentNamePrefix:s}=(0,en.kU)(),d=(null==a||null==(e=a["x-decorator-props"])?void 0:e.resource)||(null==a||null==(t=a["x-decorator-props"])?void 0:t.association);return(0,r.jsxs)(Q.xK,{template:n,title:l||o,children:[(0,r.jsx)(ee.P,{}),(0,r.jsx)(eo.l,{componentName:`${s}FilterCollapse`,collectionName:o,resourceName:d}),(0,r.jsx)(et.$,{type:N.I1.COLLAPSE,emptyDescription:i("No blocks to connect")}),(0,r.jsx)(Q.kT,{}),(0,r.jsx)(Q.d$,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})},ey.useAssociationField=()=>{let e=(0,L.useFieldSchema)(),t=(0,g.Ge)();return a.default.useMemo(()=>null==t?void 0:t.getField(null==e?void 0:e.name),[null==e?void 0:e.name])};class eb extends n.k{async load(){this.app.schemaInitializerManager.add(G),this.app.schemaInitializerManager.add(K),this.app.schemaInitializerManager.add(W),this.app.schemaInitializerManager.add(er)}}let eS=()=>{let e=(0,c.eL)(),{refresh:t}=(0,a.useContext)(R.u4V),o=(0,L.useFieldSchema)(),l=(0,Y.VB)(),{t:n}=(0,x.useTranslation)(),i=(0,R.pxY)({t:n,api:l,refresh:t,current:o});return i.loadAPIClientEvents(),(0,r.jsx)(c.rR,{onClick:()=>{i.remove(o)},children:(0,r.jsx)("div",{children:e.title})})},eC=()=>{let e=(0,c.eL)(),{schema:t}=e,{exists:o,remove:l}=(0,f.oK)(t.name,"name",e.find,e.remove),{insert:n}=(0,c.fx)();return(0,r.jsx)(c.qX,{checked:o,title:e.title,onClick:()=>{var r;if(o)return l();let a=(0,d.merge)(t||{},e.schema||{});null==e||null==(r=e.schemaInitialize)||r.call(e,a),n(a)}})},e_=e=>{let{item:t,schema:o,...l}=e,{insert:n}=(0,c.fx)();return(0,r.jsx)(c.rR,{...l,onClick:()=>{var l,r;let a=(0,d.merge)(o||{},t.schema||{});null==t||null==(l=t.schemaInitialize)||l.call(t,a),n(a),null==(r=e.onClick)||r.call(e,a)}})},ek=()=>{let e=(0,c.eL)(),{schema:t,...o}=e;return(0,r.jsx)(e_,{...o,item:e})},eF=e=>(0,r.jsx)(I,{...e,schema:{title:'{{ t("Filter") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useFilterBlockActionProps","x-designer":"Action.Designer","x-component-props":{type:"primary",htmlType:"submit"}}}),eM=e=>(0,r.jsx)(I,{...e,schema:{title:'{{ t("Reset") }}',"x-component":"Action","x-use-component-props":"useResetBlockActionProps","x-designer":"Action.Designer"}}),eP=()=>{let e=(0,c.eL)();return(0,r.jsx)(e_,{...e,item:e})};var eI=o(3403);let eA=()=>{let e=(0,c.eL)(),{insert:t}=(0,c.fx)();return(0,r.jsx)(c.rR,{...e,onClick:()=>{t({...e.schema})}})};var eT=o(27304);let ew=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getTemplateSchemaByMode:i}=(0,el.ov)(),{getCollection:s}=(0,F.nj)(),d=e.field,u=s(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.TableOutlined,{}),...n,onClick:async e=>{let{item:t}=e;t.template?a(await i(t)):a((0,eT.D)({dataSource:u.dataSource,association:p}))},items:(0,f.aU)("Table",e,d.target,p)})};function ej(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createAssociationTableBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e((0,eT.D)({dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e])}}function eD(e){let{collectionName:t,dataSource:o,association:l,templateSchema:n,hideActionInitializer:r,rowKey:a}=e;if(!o||!a)throw Error("dataSource and rowKey are required");return{type:"void","x-acl-action":`${l||t}:view`,"x-decorator":"DetailsBlockProvider","x-use-decorator-props":"useDetailsWithPaginationDecoratorProps","x-decorator-props":{dataSource:o,collection:t,association:l,readPretty:!0,action:"list",params:{pageSize:1}},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:detailsWithPagination","x-component":"CardItem",properties:{[(0,d.uid)()]:{type:"void","x-component":"Details","x-read-pretty":!0,"x-use-component-props":"useDetailsWithPaginationProps",properties:{[(0,d.uid)()]:{type:"void","x-initializer":r?void 0:"details:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{}},grid:n||{type:"void","x-component":"Grid","x-initializer":"details:configureFields",properties:{}},pagination:{type:"void","x-component":"Pagination","x-use-component-props":"useDetailsPaginationProps"}}}}}}let eL=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getTemplateSchemaByMode:i}=(0,el.ov)(),{getCollection:s}=(0,F.nj)(),d=e.field,u=s(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.FormOutlined,{}),...n,onClick:async e=>{let{item:t}=e;t.template?a(await i(t)):a(eD({dataSource:u.dataSource,association:p,rowKey:u.filterTargetKey||"id"}))},items:(0,f.aU)("Details",e,d.target,p)})};function eR(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createAssociationDetailsBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e(eD({dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`,rowKey:r.filterTargetKey||"id"}))},[t,e])}}var eY=o(59682);let eB=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:i}=(0,c.fx)(),{getCollection:s}=(0,F.nj)(),{getTemplateSchemaByMode:d}=(0,el.ov)(),u=e.field,p=u.target,m=(0,a.useMemo)(()=>s(p),[p]);return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.FormOutlined,{}),...n,onClick:async e=>{let{item:t}=e;if(t.template){let e=await d(t);if("FormItem"===t.template.componentName){let o=(0,eY.B)({dataSource:m.dataSource,association:`${u.collectionName}.${u.name}`,templateSchema:e});"reference"===t.mode&&(o["x-template-key"]=t.template.key),i(o)}else i(e)}else i((0,eY.B)({dataSource:m.dataSource,association:`${u.collectionName}.${u.name}`}))},items:(0,f.aU)("FormItem",e,m,`${u.collectionName}.${u.name}`)})};function eN(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)(),{componentNamePrefix:o}=(0,el.kU)();return{createAssociationFormBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e((0,eY.B)({dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e]),templateWrap:(0,a.useCallback)((e,l)=>{let{item:n}=l;if(n.template.componentName!==`${o}FormItem`||!n.associationField)return e;{let o=n.associationField,l=t(o.target),r=(0,eY.B)({dataSource:l.dataSource,association:`${o.collectionName}.${o.name}`,templateSchema:e});return"reference"===n.mode&&(r["x-template-key"]=n.template.key),r}},[t,o])}}let eE=e=>{let{collectionName:t,association:o,templateSchema:l,dataSource:n,rowKey:r}=e;if(!n)throw Error("dataSource are required");return{type:"void","x-acl-action":`${o||t}:view`,"x-decorator":"GridCard.Decorator","x-use-decorator-props":"useGridCardBlockDecoratorProps","x-decorator-props":{collection:t,association:o,dataSource:n,readPretty:!0,action:"list",params:{pageSize:12},runWhenParamsChanged:!0,rowKey:r},"x-component":"BlockItem","x-use-component-props":"useGridCardBlockItemProps","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:gridCard",properties:{actionBar:{type:"void","x-initializer":"gridCard:configureActions","x-component":"ActionBar","x-use-component-props":"useGridCardActionBarProps"},list:{type:"array","x-component":"GridCard","x-use-component-props":"useGridCardBlockProps",properties:{item:{type:"object","x-component":"GridCard.Item","x-read-pretty":!0,"x-use-component-props":"useGridCardItemProps",properties:{grid:l||{type:"void","x-component":"Grid","x-initializer":"details:configureFields"},actionBar:{type:"void","x-align":"left","x-initializer":"gridCard:configureItemActions","x-component":"ActionBar","x-use-component-props":"useGridCardActionBarProps","x-component-props":{layout:"one-column"}}}}}}}}},ez=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getTemplateSchemaByMode:i}=(0,el.ov)(),{getCollection:s}=(0,F.nj)(),d=e.field,u=s(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.TableOutlined,{}),...n,onClick:async e=>{let{item:t}=e;t.template?a(await i(t)):a(eE({rowKey:u.filterTargetKey,dataSource:u.dataSource,association:p}))},items:(0,f.aU)("GridCard",e,d.target,p)})};function eO(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createAssociationGridCardBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e(eE({rowKey:r.filterTargetKey,dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e])}}let eV=e=>{let{collectionName:t,dataSource:o,association:l,templateSchema:n,rowKey:r}=e;return{type:"void","x-acl-action":`${l||t}:view`,"x-decorator":"List.Decorator","x-use-decorator-props":"useListBlockDecoratorProps","x-decorator-props":{collection:t,dataSource:o,association:l,readPretty:!0,action:"list",params:{pageSize:10},runWhenParamsChanged:!0,rowKey:r},"x-component":"CardItem","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:list",properties:{actionBar:{type:"void","x-initializer":"list:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--nb-spacing)"}}},list:{type:"array","x-component":"List","x-use-component-props":"useListBlockProps",properties:{item:{type:"object","x-component":"List.Item","x-read-pretty":!0,"x-use-component-props":"useListItemProps",properties:{grid:n||{type:"void","x-component":"Grid","x-initializer":"details:configureFields"},actionBar:{type:"void","x-align":"left","x-initializer":"list:configureItemActions","x-component":"ActionBar","x-use-component-props":"useListActionBarProps","x-component-props":{layout:"one-column"}}}}}}}}},e$=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getTemplateSchemaByMode:i}=(0,el.ov)(),{getCollection:s}=(0,F.nj)(),d=e.field,u=s(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.TableOutlined,{}),...n,onClick:async e=>{let{item:t}=e;t.template?a(await i(t)):a(eV({rowKey:u.filterTargetKey,dataSource:u.dataSource,association:p}))},items:(0,f.aU)("List",e,d.target,p)})};function eq(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createAssociationListBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField,r=t(n.target);e(eV({rowKey:r.filterTargetKey,dataSource:r.dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e])}}function eH(e){let{collectionName:t,dataSource:o,association:l,templateSchema:n}=e,r=e.isCurrent?{"x-is-current":!0}:{};if(!o)throw Error("dataSource are required");return{type:"void","x-acl-action":`${l||t}:get`,"x-decorator":"DetailsBlockProvider","x-use-decorator-props":"useDetailsDecoratorProps","x-decorator-props":{dataSource:o,collection:t,association:l,readPretty:!0,action:"get"},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:details","x-component":"CardItem",...r,properties:{[(0,d.uid)()]:{type:"void","x-component":"Details","x-read-pretty":!0,"x-use-component-props":"useDetailsProps",properties:{[(0,d.uid)()]:{type:"void","x-initializer":"details:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{}},grid:n||{type:"void","x-component":"Grid","x-initializer":"details:configureFields",properties:{}}}}}}}let eU=()=>{let e=(0,c.eL)(),{onCreateBlockSchema:t,componentType:o,createBlockSchema:l,...n}=e,{insert:a}=(0,c.fx)(),{getCollection:i}=(0,F.nj)(),{getTemplateSchemaByMode:s}=(0,el.ov)(),d=e.field,u=i(d.target),p=`${d.collectionName}.${d.name}`;return(0,r.jsx)(c.rR,{icon:(0,r.jsx)(ea.FormOutlined,{}),...n,onClick:async e=>{let{item:t}=e;if(t.template){let e=await s(t);if("ReadPrettyFormItem"===t.template.componentName){let o=eH({dataSource:u.dataSource,association:p,templateSchema:e});"reference"===t.mode&&(o["x-template-key"]=t.template.key),a(o)}else a(e)}else a(eH({association:p,dataSource:u.dataSource}))},items:(0,f.aU)("ReadPrettyFormItem",e,u,p)})};function eG(){let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)(),{componentNamePrefix:o}=(0,el.kU)();return{createAssociationDetailsWithoutPagination:(0,a.useCallback)(o=>{let{item:l}=o,n=l.associationField;e(eH({dataSource:t(n.target).dataSource,association:`${n.collectionName}.${n.name}`}))},[t,e]),templateWrap:(0,a.useCallback)((e,l)=>{let{item:n}=l,r=n.associationField,a=t(r.target);if(n.template.componentName!==`${o}ReadPrettyFormItem`)return e;{let t=eH({dataSource:a.dataSource,association:`${r.collectionName}.${r.name}`,templateSchema:e});return"reference"===n.mode&&(t["x-template-key"]=n.template.key),t}},[t,o])}}let eK=e=>{let t={type:"void",title:'{{ t("Select") }}',"x-action":"update","x-designer":"Action.Designer","x-component":"Action","x-component-props":{openMode:"drawer"},properties:{drawer:{type:"void","x-component":"AssociationField.Selector",title:'{{ t("Select record") }}',"x-component-props":{className:"nb-record-picker-selector"},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:tableSelector:addBlock",properties:{}},footer:{"x-component":"Action.Container.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{submit:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"usePickActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:submit","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}};return(0,r.jsx)(u,{...e,schema:t})},eW=e=>(0,r.jsx)(u,{...e,schema:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:submit","x-component-props":{type:"primary",htmlType:"submit"}}}),eJ=()=>{let e={type:"void",title:'{{ t("Actions") }}',"x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-toolbar":"TableColumnSchemaToolbar","x-initializer":"table:configureItemActions","x-settings":"fieldSettings:TableColumn","x-toolbar-props":{initializer:"table:configureItemActions"},"x-action-column":"actions",properties:{[(0,d.uid)()]:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{}}}},t=(0,c.eL)();return(0,r.jsx)(P,{...t,schema:e,item:t,type:"x-action-column"})};var eX=o(78316),eZ=o(63526);function eQ(e){let{modalSchema:t={},components:o={},...l}=e,{properties:n,...i}=t,[s,d]=(0,a.useState)(!1),{setVisible:c}=(0,eX.useSchemaInitializer)(),u=(0,a.useMemo)(()=>({name:(0,eZ.uid)(),"x-component":"Action.Modal","x-component-props":{width:"520px"},type:"void","x-decorator":"FormV2","x-decorator-props":{},...i,properties:{...n,footer1:{"x-component":"Action.Modal.Footer",type:"void",properties:{close:{title:"Cancel","x-component":"Action","x-component-props":{type:"default"},"x-use-component-props":()=>({onClick(){var t;d(!1),null==e||null==(t=e.onCancel)||t.call(e)}})},submit:{title:"OK","x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":()=>{let t=(0,L.useForm)();return{async onClick(){var o;await t.submit(),d(!1),null==e||null==(o=e.onSubmit)||o.call(e,t.values)}}}}}}}}),[s]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eX.SchemaInitializerItem,{...l,onClick:t=>{var o;c(!1),d(!0),null==e||null==(o=e.onClick)||o.call(e,t)}}),(0,r.jsx)(eX.ActionContextProvider,{value:{visible:s,setVisible:d},children:(0,r.jsx)(eX.SchemaComponent,{components:{Action:eX.Action,...o},schema:u})})]})}let e0=e=>{let t={type:"void",title:'{{ t("Link") }}',"x-action":"customize:link","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:link","x-component":(null==e?void 0:e["x-component"])||"Action.Link","x-use-component-props":"useLinkActionProps","x-decorator":"ACLActionProvider"},o=(0,c.eL)();return(0,r.jsx)(e_,{...o,schema:t,item:o})},e1=e=>(0,r.jsx)(I,{...e,schema:{title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-use-component-props":"useRefreshActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:refresh","x-component-props":{icon:"ReloadOutlined"}}}),e2=e=>(0,r.jsx)(I,{...e,schema:{type:"void",title:'{{ t("Column Settings") }}',"x-action":"edit-table","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:editTable","x-component":"EditTable.Action","x-use-component-props":"useEditTableActionProps","x-component-props":{icon:"SettingOutlined"}}}),e5=e=>(0,r.jsx)(u,{...e,schema:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:createSubmit","x-component-props":{type:"primary",htmlType:"submit"}}}),e4=e=>(0,r.jsx)(u,{...e,schema:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useUpdateActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:updateSubmit","x-component-props":{type:"primary",htmlType:"submit"}}}),e7=e=>{let t={title:'{{ t("Update record") }}',"x-component":(null==e?void 0:e["x-component"])||"Action.Link","x-use-component-props":"useCustomizeUpdateActionProps","x-action":"customize:update","x-decorator":"ACLActionProvider","x-acl-action":"update","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:updateRecord","x-action-settings":{assignedValues:{},onSuccess:{manualClose:!1,redirecting:!1,successMessage:'{{t("Updated successfully")}}'},triggerWorkflows:[]}},o=(0,c.eL)();return(0,r.jsx)(e_,{...o,schema:t,item:o})};var e9=o(42536),e8=o(46724);let e3=e=>(0,r.jsx)(e8.bJ,{children:(0,r.jsx)(e9.aK,{children:e.children})}),te=e=>{let{defaultOpenMode:t}=(0,p.k)(),{getPopupContext:o}=(0,i.Hy)(),l={type:"void",title:'{{ t("Popup") }}',"x-action":"customize:popup","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:popup","x-component":(null==e?void 0:e["x-component"])||"Action.Link","x-component-props":{openMode:t,refreshDataBlockRequest:!0},"x-decorator":"PopupActionDecorator",properties:{drawer:{type:"void",title:'{{ t("Popup") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":(null==e?void 0:e["x-initializer"])||"popup:common:addBlock",properties:{}}}}}}}}},[s.AC]:o()},n=(0,c.eL)();return(0,r.jsx)(e_,{...n,schema:l,item:n})},tt=e=>{let{defaultOpenMode:t}=(0,p.k)(),{getPopupContext:o}=(0,i.Hy)(),l={type:"void",title:'{{ t("Associate") }}',"x-action":"associate","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:popup","x-component":"Action","x-component-props":{openMode:t,refreshDataBlockRequest:!0},properties:{drawer:{type:"void","x-component":"Action.Container",title:'{{ t("Select record") }}',"x-component-props":{className:"nb-record-picker-selector"},"x-decorator":"AssociateActionProvider",properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:tableSelector:addBlock",properties:{}},footer:{"x-component":"Action.Container.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{submit:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"usePickActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:submit","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}},[s.AC]:o()},n=(0,c.eL)();return(0,r.jsx)(e_,{...n,schema:l,item:n})};var to=o(44374),tl=o(55102);let tn=()=>{let{setSelectedRows:e}=(0,a.useContext)(ec.pE),{onRowSelectionChange:t,rowKey:o="id",...l}=(0,tl.fX)();return{...l,rowKey:o,rowSelection:{type:"checkbox"},onRowSelectionChange(o,l){null==e||e(o),null==t||t(o,l)}}},tr=e=>{let[t,o]=(0,a.useState)([]),l=(0,to.useCollection)(),{resource:n,block:i,__parent:s,service:d}=(0,to.useBlockRequestContext)(),c=(0,to.useActionContext)(),{isMobile:u}=(0,to.useOpenModeContext)()||{},[p,m]=(0,a.useState)([]),{data:h}=d||{};(0,a.useEffect)(()=>{var e;null==n||null==(e=n.list)||e.call(n,{paginate:!1}).then(e=>{var t;m((null==(t=e.data)?void 0:t.data)||[])})},[n,null==h?void 0:h.meta.count]);let x={size:"small",onChange:null==e?void 0:e.onChange,selectedRows:t,setSelectedRows:o};return(0,r.jsx)(to.ActionContextProvider,{value:{...c,openMode:u?"drawer":c.openMode},children:(0,r.jsx)(ec.be,{...x,children:(0,r.jsx)(to.SchemaComponentOptions,{scope:{useTableSelectorProps:tn,usePickActionProps:()=>{let{selectedRows:e}=(0,a.useContext)(ec.pE),{setVisible:t,setSubmitted:o,setFormValueChanged:l}=(0,to.useActionContext)();return{async onClick(r,a){if(await n.add({values:e}),a&&(null==a||a()),null==t||t(!1),null==o||o(!0),i&&"TableField"!==i){var d,c;null==s||null==(c=s.service)||null==(d=c.refresh)||d.call(c),null==t||t(!1),null==l||l(!1)}}}}},children:(0,r.jsx)(tl.bp,{params:{filter:(()=>{let e=(null==l?void 0:l.filterTargetKey)||"id";if(p){let t=p.map(t=>t[e]).filter(Boolean);return t.length?{$and:[{[`${e}.$ne`]:t}]}:{}}return{}})()},children:e.children})})})})},ta=new q.I({name:"RecordFormBlockInitializers",title:'{{ t("Add block") }}',icon:"PlusOutlined",wrap:f.xH,items:[{type:"itemGroup",title:'{{ t("Data blocks") }}',name:"dataBlocks",children:[{name:"form",title:'{{ t("Form") }}',Component:"RecordFormBlockInitializer"}]},{type:"itemGroup",title:'{{t("Other blocks")}}',name:"otherBlocks",children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]}),ti=e=>{let{defaultOpenMode:t}=(0,p.k)(),{getPopupContext:o}=(0,i.Hy)(),l={type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-acl-action":"update","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:edit","x-component":"Action","x-component-props":{openMode:t,icon:"EditOutlined"},properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Edit")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock",properties:{}}}}}}}}},[s.AC]:o()};return(0,r.jsx)(u,{...e,schema:l})},ts=e=>{let{defaultOpenMode:t}=(0,p.k)(),{getPopupContext:o}=(0,i.Hy)(),l={type:"void",title:'{{ t("View") }}',"x-action":"view","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:view","x-component":"Action","x-component-props":{openMode:t},properties:{drawer:{type:"void",title:'{{ t("View record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock",properties:{}}}}}}}}},[s.AC]:o()};return(0,r.jsx)(u,{...e,schema:l})};var td=o(58555);let tc={title:'{{t("Configure actions")}}',icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"itemGroup",title:'{{t("Enable actions")}}',name:"enableActions",children:[{name:"edit",title:'{{t("Edit")}}',Component:"UpdateActionInitializer",schema:{"x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{type:"primary"}},useVisible:()=>(0,td.$)("update")},{name:"delete",title:'{{t("Delete")}}',Component:"DestroyActionInitializer",schema:{"x-component":"Action","x-decorator":"ACLActionProvider"},useVisible:()=>(0,td.$)("destroy")}]}]},tu=new v._({name:"DetailsActionInitializers",...tc}),tp=new v._({name:"detailsWithPaging:configureActions",...tc},tu),tm=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideSearch:l,componentType:n="Details",createBlockSchema:a,templateWrap:i,showAssociationFields:s,hideChildrenIfSingleCollection:d}=e,u=(0,c.eL)(),{createDetailsBlock:p}=th();return(0,r.jsx)(eI.kq,{...u,icon:(0,r.jsx)(ea.ProfileOutlined,{}),componentType:n,onCreateBlockSchema:async e=>{if(a)return a(e);p(e)},onlyCurrentDataSource:!!o,hideSearch:l,filter:t,templateWrap:i,showAssociationFields:s,hideChildrenIfSingleCollection:d})},th=()=>{let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createDetailsBlock:(0,a.useCallback)(o=>{let{item:l}=o,n=t(l.name,l.dataSource);e(eD({collectionName:l.name,dataSource:l.dataSource,rowKey:n.filterTargetKey||"id",hideActionInitializer:!(("view"!==n.template||(null==n?void 0:n.writableView))&&"sql"!==n.template)}))},[t,e])}};var tx=o(28227);let tv={title:'{{t("Configure actions")}}',icon:"SettingOutlined",style:{marginLeft:8},items:[{title:'{{t("Edit")}}',name:"edit",Component:"UpdateActionInitializer",schema:{"x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{type:"primary"}},useVisible:()=>(0,td.$)("update")},{title:'{{t("Delete")}}',name:"delete",Component:"DestroyActionInitializer",schema:{"x-component":"Action","x-decorator":"ACLActionProvider"},useVisible:()=>(0,td.$)("destroy")},{type:"item",title:'{{t("Disassociate")}}',name:"disassociate",Component:"DisassociateActionInitializer",schema:{"x-component":"Action","x-action":"disassociate","x-acl-action":"update","x-decorator":"ACLActionProvider"},useVisible(){var e,t;let o=(0,tx.h6)(),l=(0,tx.Ge)()||{},{unavailableActions:n,availableActions:r}=(null==l?void 0:l.options)||{};return r?!!(null==o?void 0:o.association)&&(null==(e=r.includes)?void 0:e.call(r,"update")):!n||!!(null==o?void 0:o.association)&&!(null==n||null==(t=n.includes)?void 0:t.call(n,"update"))}},{name:"popup",title:'{{t("Popup")}}',Component:"PopupActionInitializer",useComponentProps:()=>({"x-component":"Action"})},{name:"updateRecord",title:'{{t("Update record")}}',Component:"UpdateRecordActionInitializer",useComponentProps:()=>({"x-component":"Action"}),useVisible:()=>(0,td.$)("update")},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer"},{name:"link",title:'{{t("Link")}}',Component:"LinkActionInitializer",useComponentProps:()=>({"x-component":"Action"})}]},tg=new v._({name:"ReadPrettyFormActionInitializers",...tv}),tf=new v._({name:"details:configureActions",...tv},tg);var ty=o(94003);let tb={wrap:f.xH,icon:"SettingOutlined",title:'{{t("Configure fields")}}',items:[{type:"itemGroup",name:"displayFields",title:'{{t("Display fields")}}',useChildren:f.g_},{name:"parentCollectionFields",Component:()=>{let e=(0,f.G3)(),{t}=(0,x.useTranslation)(),o=(0,R.lum)();if(!(null==e?void 0:e.length))return null;let l=[];return e.forEach(e=>{Object.values(e)[0].length&&l.push({type:"itemGroup",divider:!0,title:t("Parent collection fields")+"("+o(`${Object.keys(e)[0]}`)+")",children:Object.values(e)[0]})}),(0,r.jsx)(ty.Z,{children:l})}},{name:"associationFields",Component:()=>{let e=(0,f.aY)({readPretty:!0,block:"Form"}),{t}=(0,x.useTranslation)();if(0===e.length)return null;let o=[{type:"itemGroup",title:t("Display association fields"),children:e}];return(0,r.jsx)(ty.Z,{children:o})}},{name:"divider",type:"divider"},{name:"addText",title:'{{t("Add Markdown")}}',Component:"BlockItemInitializer",schema:{type:"void","x-editable":!1,"x-decorator":"FormItem","x-decorator-props":{engine:"handlebars"},"x-toolbar":"FormItemSchemaToolbar","x-settings":"blockSettings:markdown","x-component":"Markdown.Void","x-component-props":{content:'{{t("This is a demo text, **supports Markdown syntax**.")}}'}}},{name:"addDivider",title:'{{t("Add group")}}',Component:"BlockItemInitializer",schema:{type:"void","x-decorator":"FormItem","x-toolbar":"FormItemSchemaToolbar","x-settings":"blockSettings:divider","x-component":"Divider","x-component-props":{children:'{{t("Group")}}'}}}]},tS=new v._({name:"ReadPrettyFormItemInitializers",...tb}),tC=new v._({name:"details:configureFields",...tb},tS),t_=()=>{let{icon:e=!0,targetCollection:t,...o}=(0,c.eL)(),l=(0,F.k7)(),n=t||l,{createSingleDetailsSchema:a}=tk();return(0,r.jsx)(c.rR,{icon:e&&(0,r.jsx)(ea.FormOutlined,{}),...o,onClick:e=>a(e),items:(0,f.aU)("ReadPrettyFormItem",null,null==n?void 0:n.name)})};function tk(){let{insert:e}=(0,c.fx)(),{getTemplateSchemaByMode:t}=(0,el.ov)(),o=(0,tx.UJ)(),l=(0,tx.r2)(),{componentNamePrefix:n}=(0,el.kU)(),r=(0,a.useCallback)((e,t)=>{let{item:r}=t;if(r.template.componentName!==`${n}ReadPrettyFormItem`)return e;{let t=r.collectionName||r.name,n=l.getCollection(t),a=eH(o?{association:o,collectionName:n.isInherited()?t:void 0,dataSource:r.dataSource,templateSchema:e,isCurrent:!0}:{collectionName:t,dataSource:r.dataSource,templateSchema:e});return"reference"===r.mode&&(a["x-template-key"]=r.template.key),a}},[o,l,n]);return{createSingleDetailsSchema:(0,a.useCallback)(async n=>{let{item:a}=n;if(a.template)e(r(await t(a),{item:a}));else{let t=a.collectionName||a.name,n=l.getCollection(t);e(eH(o?{association:o,collectionName:n.isInherited()?t:void 0,dataSource:a.dataSource,isCurrent:!0}:{collectionName:t,dataSource:a.dataSource}))}},[o,l,t,e,r]),templateWrap:r}}var tF=o(54513),tM=o(83232),tP=o(56181),tI=o(75909),tA=o(57482),tT=o(72606);let tw={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{name:"addNew",title:"{{t('Add new')}}",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>(0,td.$)("create")},{name:"refresh",title:"{{t('Refresh')}}",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"import",title:"{{t('Import')}}",Component:"ImportActionInitializer",schema:{"x-align":"right","x-acl-action":"importXlsx","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>(0,td.$)("import")},{name:"export",title:"{{t('Export')}}",Component:"ExportActionInitializer",useVisible:()=>(0,td.$)("export"),schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}}},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},tj=new v._({name:"GridCardActionInitializers",...tw}),tD=new v._({name:"gridCard:configureActions",...tw},tj),tL=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideSearch:l,createBlockSchema:n,componentType:a="FormItem",templateWrap:i,showAssociationFields:s}=e,d=(0,c.eL)(),{createGridCardBlock:u}=tR();return(0,r.jsx)(eI.kq,{...d,icon:(0,r.jsx)(ea.AppstoreOutlined,{}),componentType:"GridCard",onCreateBlockSchema:async e=>{if(n)return n(e);u(e)},onlyCurrentDataSource:o,hideSearch:l,filter:t,showAssociationFields:s})},tR=()=>{let{insert:e}=(0,c.fx)(),{getCollection:t}=(0,F.nj)();return{createGridCardBlock:o=>{let{item:l}=o,n=t(l.name,l.dataSource);e(eE({collectionName:l.name,dataSource:l.dataSource,rowKey:n.filterTargetKey||"id"}))}}},tY={title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"view",title:'{{t("View")}}',Component:"ViewActionInitializer",schema:{"x-component":"Action.Link","x-action":"view","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("get")},{name:"edit",title:'{{t("Edit")}}',Component:"UpdateActionInitializer",schema:{"x-component":"Action.Link","x-action":"update","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("update")},{name:"delete",title:'{{t("Delete")}}',Component:"DestroyActionInitializer",schema:{"x-component":"Action.Link","x-action":"destroy","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("destroy")},{name:"popup",title:'{{t("Popup")}}',Component:"PopupActionInitializer",useComponentProps:()=>({"x-component":"Action.Link"})},{name:"update-record",title:'{{t("Update record")}}',Component:"UpdateRecordActionInitializer",useVisible:()=>(0,td.$)("update")},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request"}},{name:"link",title:'{{t("Link")}}',Component:"LinkActionInitializer",useComponentProps:()=>({"x-component":"Action.Link"})}]},tB=new v._({name:"GridCardItemActionInitializers",...tY}),tN=new v._({name:"gridCard:configureItemActions",...tY},tB),tE={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{name:"addNew",title:"{{t('Add new')}}",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>(0,td.$)("create")},{name:"refresh",title:"{{t('Refresh')}}",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"import",title:"{{t('Import')}}",Component:"ImportActionInitializer",schema:{"x-align":"right","x-acl-action":"importXlsx","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>(0,td.$)("import")},{name:"export",title:"{{t('Export')}}",Component:"ExportActionInitializer",useVisible:()=>(0,td.$)("export"),schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}}},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},tz=new v._({name:"ListActionInitializers",...tE}),tO=new v._({name:"list:configureActions",...tE},tz),tV=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideSearch:l,createBlockSchema:n,componentType:a="FormItem",templateWrap:i,showAssociationFields:s}=e,d=(0,c.eL)(),{createListBlock:u}=t$();return(0,r.jsx)(eI.kq,{...d,icon:(0,r.jsx)(ea.OrderedListOutlined,{}),componentType:"List",onCreateBlockSchema:async e=>{if(n)return n(e);u(e)},onlyCurrentDataSource:o,hideSearch:l,filter:t,showAssociationFields:s})},t$=()=>{let{getCollection:e}=(0,F.nj)(),{insert:t}=(0,c.fx)();return{createListBlock:o=>{let{item:l}=o,n=e(l.name,l.dataSource);t(eV({collectionName:l.name,dataSource:l.dataSource,rowKey:n.filterTargetKey||"id"}))}}},tq={title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"view",title:'{{t("View")}}',Component:"ViewActionInitializer",schema:{"x-component":"Action.Link","x-action":"view","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("get")},{name:"edit",title:'{{t("Edit")}}',Component:"UpdateActionInitializer",schema:{"x-component":"Action.Link","x-action":"update","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("update")},{name:"delete",title:'{{t("Delete")}}',Component:"DestroyActionInitializer",schema:{"x-component":"Action.Link","x-action":"destroy","x-decorator":"ACLActionProvider","x-align":"left"},useVisible:()=>(0,td.$)("destroy")},{name:"popup",title:'{{t("Popup")}}',Component:"PopupActionInitializer",useComponentProps:()=>({"x-component":"Action.Link"})},{name:"updateRecord",title:'{{t("Update record")}}',Component:"UpdateRecordActionInitializer",useVisible:()=>(0,td.$)("update")},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request"}},{name:"link",title:'{{t("Link")}}',Component:"LinkActionInitializer",useComponentProps:()=>({"x-component":"Action.Link"})}]},tH=new v._({name:"ListItemActionInitializers",...tq}),tU=new v._({name:"list:configureItemActions",...tq},tH);var tG=o(58206),tK=o(94109),tW=o(42983),tJ=o(72235),tX=o(62431);let tZ=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideChildrenIfSingleCollection:l}=e,n=(0,c.eL)(),{insert:a}=(0,c.fx)();return(0,r.jsx)(eI.kq,{...n,onlyCurrentDataSource:o,icon:(0,r.jsx)(ea.RightSquareOutlined,{}),componentType:"FilterCollapse",onCreateBlockSchema:async e=>{let{item:t}=e;a((e=>{let{collectionName:t,dataSource:o,blockType:l}=e;return{type:"void","x-decorator":"AssociationFilter.Provider","x-use-decorator-props":"useCollapseBlockDecoratorProps","x-decorator-props":{collection:t,dataSource:o,blockType:l,associationFilterStyle:{width:"100%"},name:"filter-collapse"},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:filterCollapse","x-component":"CardItem","x-filter-targets":[],properties:{[(0,d.uid)()]:{type:"void","x-action":"associateFilter","x-initializer":"filterCollapse:configureFields","x-component":"AssociationFilter"}}}})({dataSource:t.dataSource,collectionName:t.collectionName||t.name,blockType:"filter"}))},filter:t,hideChildrenIfSingleCollection:l})},tQ={title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"filter",title:'{{t("Filter")}}',Component:"CreateFilterActionInitializer",schema:{"x-action-settings":{}}},{name:"reset",title:'{{t("Reset")}}',Component:"CreateResetActionInitializer",schema:{"x-action-settings":{}}}]},t0=new v._({name:"FilterFormActionInitializers",...tQ}),t1=new v._({name:"filterForm:configureActions",...tQ},t0),t2=eI.kq,t5=e=>{let{collectionName:t,dataSource:o,templateSchema:l}=e;if(!t||!o)throw Error("collectionName and dataSource are required");return{type:"void","x-decorator":"FilterFormBlockProvider","x-use-decorator-props":"useFilterFormBlockDecoratorProps","x-decorator-props":{dataSource:o,collection:t},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:filterForm","x-component":"CardItem","x-filter-targets":[],properties:{[(0,d.uid)()]:{type:"void","x-component":"FormV2","x-use-component-props":"useFilterFormBlockProps",properties:{grid:l||{type:"void","x-component":"Grid","x-initializer":"filterForm:configureFields"},[(0,d.uid)()]:{type:"void","x-initializer":"filterForm:configureActions","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{float:"right",overflow:"hidden"}}}}}}}},t4=e=>{let{filterCollections:t,onlyCurrentDataSource:o,hideChildrenIfSingleCollection:l}=e,n=(0,c.eL)(),{insert:a}=(0,c.fx)(),{componentNamePrefix:i}=(0,en.kU)();return(0,r.jsx)(t2,{...n,icon:(0,r.jsx)(ea.FormOutlined,{}),onlyCurrentDataSource:o,componentType:`${i}FilterFormItem`,templateWrap:(e,t)=>{let{item:o}=t,l=t5({templateSchema:e,dataSource:o.dataSource,collectionName:o.name||o.collectionName});return o.template&&"reference"===o.mode&&(l["x-template-key"]=o.template.key),l},onCreateBlockSchema:e=>{let{item:t}=e;return a(t5({collectionName:t.collectionName||t.name,dataSource:t.dataSource}))},filter:t,hideChildrenIfSingleCollection:l})};var t6=o(44517);let t7={wrap:f.xH,icon:"SettingOutlined",title:'{{t("Configure fields")}}',items:[{type:"itemGroup",name:"displayFields",title:'{{t("Display fields")}}',useChildren:f.gL},{name:"parentCollectionFields",Component:t6.gE},{name:"associationFields",Component:t6.Q3},{name:"divider",type:"divider"},{title:'{{t("Add Markdown")}}',Component:"MarkdownFormItemInitializer",name:"addText"}]},t9=new v._({name:"FilterFormItemInitializers",...t7}),t8=new v._({name:"filterForm:configureFields",...t7},t9),t3=()=>{let{insert:e}=(0,c.fx)(),t=(0,c.eL)();return(0,r.jsx)(c.rR,{...t,icon:(0,r.jsx)(ea.LineOutlined,{}),onClick:()=>{e({type:"void","x-decorator":"FormItem","x-toolbar":"FormItemSchemaToolbar","x-settings":"blockSettings:divider","x-component":"Divider","x-component-props":{children:'{{t("Group")}}'}})}})},oe=()=>{let{insert:e}=(0,c.fx)(),{t}=(0,x.useTranslation)(),o=(0,c.eL)();return(0,r.jsx)(c.rR,{...o,icon:(0,r.jsx)(ea.FormOutlined,{}),onClick:()=>{e({type:"void","x-settings":"blockSettings:markdown","x-decorator":"CardItem","x-decorator-props":{name:"markdown",engine:"handlebars"},"x-component":"Markdown.Void","x-editable":!1,"x-component-props":{content:t("This is a demo text, **supports Markdown syntax**.")}})}})},ot=()=>{let{insert:e}=(0,c.fx)(),t=(0,c.eL)();return(0,r.jsx)(c.rR,{...t,icon:(0,r.jsx)(ea.FormOutlined,{}),onClick:()=>{e({type:"void","x-editable":!1,"x-decorator":"FormItem","x-decorator-props":{engine:"handlebars"},"x-toolbar":"FormItemSchemaToolbar","x-settings":"blockSettings:markdown","x-component":"Markdown.Void","x-component-props":{content:'{{t("This is a demo text, **supports Markdown syntax**.")}}'}})}})},oo={wrap:f.xH,title:'{{t("Add block")}}',icon:"PlusOutlined",items:[{type:"itemGroup",title:'{{t("Selector")}}',name:"selector",children:[{name:"title",title:"Table",Component:"TableSelectorInitializer"}]},{type:"itemGroup",title:'{{t("Filter blocks")}}',name:"filterBlocks",useChildren(){let{name:e,dataSource:t}=(0,to.useCollection_deprecated)();return[{name:"filterFormBlockInTableSelector",title:'{{t("Form")}}',Component:"FilterFormBlockInitializer",componentProps:{filterCollections:()=>!1,onlyCurrentDataSource:!0},collectionName:e,dataSource:t},{name:"filterCollapseBlockInTableSelector",title:'{{t("Collapse")}}',Component:"FilterCollapseBlockInitializer",componentProps:{filterCollections:()=>!1,onlyCurrentDataSource:!0},collectionName:e,dataSource:t}]}},{type:"itemGroup",title:'{{t("Other blocks")}}',name:"otherBlocks",children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]},ol=new v._({name:"TableSelectorInitializers",...oo}),on=new v._({name:"popup:tableSelector:addBlock",...oo},ol),or=()=>{let e=(0,c.eL)();return(0,r.jsx)(P,{...e,item:e,schema:{},type:"x-collection-field"})},oa=()=>{let e=(0,c.eL)();return(0,r.jsx)(P,{...e,schema:{},item:e,type:"x-collection-field"})};var oi=o(38957),os=o(56220),od=o(13975),oc=o(79246),ou=o(93160);let op=()=>{let{t:e}=(0,x.useTranslation)(),t=(0,a.useContext)(L.SchemaOptionsContext),{theme:o}=(0,od.useGlobalTheme)(),{componentCls:l,hashId:n}=(0,oc.I)(),i=(0,R.TrS)(),{createRoute:s}=(0,R.Ob5)(),u=(0,a.useCallback)(async()=>{let{title:l,icon:n}=await (0,R.RD4)(e("Add group"),()=>(0,r.jsx)(R.t6u,{scope:t.scope,components:{...t.components},children:(0,r.jsx)(os.FormLayout,{layout:"vertical",children:(0,r.jsx)(R.Eaz.Provider,{value:R.b6K,children:(0,r.jsx)(R.HvB,{schema:{properties:{title:{title:e("Menu item title"),"x-component":"Input","x-decorator":"FormItem",required:!0},icon:{title:e("Icon"),"x-component":"IconPicker","x-decorator":"FormItem"}}}})})})}),o).open({initialValues:{}}),a=(0,d.uid)();await s({type:ou.q2.group,title:l,icon:n,parentId:null==i?void 0:i.id,schemaUid:a})},[t.components,t.scope,e,o]);return(0,r.jsx)(c.rR,{title:e("Group"),onClick:u,className:`${l} ${n}`})};var om=o(38356),oh=o(26174),ox=o(14669),ov=o(1590);let og=()=>{let{t:e}=(0,x.useTranslation)(),t=(0,a.useContext)(L.SchemaOptionsContext),{theme:o}=(0,od.useGlobalTheme)(),{componentCls:l,hashId:n}=(0,oc.I)(),{urlSchema:i,paramsSchema:s,openInNewWindowSchema:d}=(0,ov.my)(),u=(0,R.TrS)(),{createRoute:p}=(0,R.Ob5)(),m=(0,ox.m6)(),h=(0,oh.r2)(),v=(0,a.useCallback)(async()=>{let{title:l,href:n,params:a,icon:c,openInNewWindow:x}=await (0,R.RD4)(e("Add link"),()=>{var o;let l=(0,e6.createMemoryHistory)();return(0,r.jsx)(ox.e1,{dataSourceManager:m,children:(0,r.jsx)(oh.Pf,{instance:h,dataSource:null==h||null==(o=h.dataSource)?void 0:o.key,children:(0,r.jsx)(om.Router,{location:l.location,navigator:l,children:(0,r.jsx)(R.t6u,{scope:t.scope,components:{...t.components},children:(0,r.jsx)(os.FormLayout,{layout:"vertical",children:(0,r.jsx)(R.Eaz.Provider,{value:R.b6K,children:(0,r.jsx)(R.HvB,{schema:{properties:{title:{title:e("Menu item title"),required:!0,"x-component":"Input","x-decorator":"FormItem"},icon:{title:e("Icon"),"x-component":"IconPicker","x-decorator":"FormItem"},href:i,params:s,openInNewWindow:d}}})})})})})})})},o).open({initialValues:{openInNewWindow:!0}});await p({type:ou.q2.link,title:l,icon:c,parentId:null==u?void 0:u.id,options:{href:n,params:a,openInNewWindow:x}})},[t.components,t.scope,e,o]);return(0,r.jsx)(c.rR,{title:e("Link"),onClick:v,className:`${l} ${n}`})};var of=o(52973);let oy=new q.I({name:"MenuItemInitializers",insertPosition:"beforeEnd",icon:"PlusOutlined",title:'{{t("Add menu item")}}',style:{width:"100%"},items:[{name:"group",Component:op},{name:"page1",Component:of.yD},{name:"page2",Component:of.yD},{name:"link",Component:og}]}),ob=new q.I({name:"menuInitializers:menuItem",insertPosition:"beforeEnd",icon:"PlusOutlined",title:'{{t("Add menu item")}}',items:[{name:"group",Component:op},{name:"page1",Component:of.yD},{name:"page2",Component:oi.k},{name:"link",Component:og}]}),oS={title:'{{t("Add block")}}',icon:"PlusOutlined",wrap:f.xH,items:[{name:"dataBlocks",title:'{{t("Data blocks")}}',type:"itemGroup",children:[{name:"table",title:'{{t("Table")}}',Component:"TableBlockInitializer"},{name:"form",title:'{{t("Form")}}',Component:"FormBlockInitializer",useComponentProps:()=>({filterCollections:e=>{var t,o;let{collection:l}=e,{unavailableActions:n,availableActions:r}=(null==l?void 0:l.options)||{};return r?null==(t=r.includes)?void 0:t.call(r,"create"):!n||!(null==n||null==(o=n.includes)?void 0:o.call(n,"create"))}})},{name:"details",title:'{{t("Details")}}',Component:"DetailsBlockInitializer"},{name:"list",title:'{{t("List")}}',Component:"ListBlockInitializer"},{name:"gridCard",title:'{{t("Grid Card")}}',Component:"GridCardBlockInitializer"}]},{name:"filterBlocks",title:'{{t("Filter blocks")}}',type:"itemGroup",children:[{name:"filterForm",title:'{{t("Form")}}',Component:"FilterFormBlockInitializer"},{name:"filterCollapse",title:'{{t("Collapse")}}',Component:"FilterCollapseBlockInitializer"}]},{name:"otherBlocks",type:"itemGroup",title:'{{t("Other blocks")}}',children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]},oC=new v._({name:"BlockInitializers",...oS}),o_=new v._({name:"page:addBlock",...oS},oC),ok={wrap:f.xH,icon:"SettingOutlined",title:'{{t("Configure fields")}}',items:[{type:"itemGroup",title:'{{t("Configure fields")}}',name:"configureFields",useChildren:f.H2},{name:"parentCollectionFields",Component:()=>{let e=(0,f.G3)({component:"AssignedField"}),{t}=(0,x.useTranslation)(),o=(0,R.lum)();if(!(null==e?void 0:e.length))return null;let l=[];return e.forEach(e=>{Object.values(e)[0].length&&l.push({type:"itemGroup",divider:!0,title:t("Parent collection fields")+"("+o(`${Object.keys(e)[0]}`)+")",children:Object.values(e)[0]})}),(0,r.jsx)(ty.Z,{children:l})}}]},oF=new v._({name:"CustomFormItemInitializers",...ok}),oM=new v._({name:"assignFieldValuesForm:configureFields",...ok},oF),oP=e=>["linkTo","subTable","o2m","m2m","obo","oho","o2o","m2o"].includes(e.interface),oI={wrap:f.xH,title:'{{t("Add block")}}',icon:"PlusOutlined",items:[{type:"itemGroup",name:"dataBlocks",title:'{{t("Data blocks")}}',useChildren:function(){let e=(0,to.useCollection)(),{getChildrenCollections:t}=(0,to.useCollectionManager_deprecated)(),o=t(null==e?void 0:e.name,!0,null==e?void 0:e.dataSource).filter(e=>null==e?void 0:e.filterTargetKey);return[{name:"details",title:'{{t("Details")}}',Component:"DetailsBlockInitializer",collectionName:null==e?void 0:e.name,dataSource:null==e?void 0:e.dataSource,useComponentProps(){let e=(0,to.useCollection)(),{createSingleDetailsSchema:t,templateWrap:l}=tk(),{createAssociationDetailsBlock:n}=(0,to.useCreateAssociationDetailsBlock)(),{createAssociationDetailsWithoutPagination:r,templateWrap:i}=(0,to.useCreateAssociationDetailsWithoutPagination)(),{createDetailsBlock:s}=th(),d=[e,...o];return{filterCollections(e){let{collection:t,associationField:o}=e;return t?d.some(e=>e.name===t.name):!!o},onlyCurrentDataSource:!0,hideSearch:!0,componentType:"ReadPrettyFormItem",createBlockSchema:(0,a.useCallback)(e=>{let{item:o,fromOthersInPopup:l}=e;return l?s({item:o}):o.associationField?["hasOne","belongsTo"].includes(o.associationField.type)?r({item:o}):n({item:o}):t({item:o})},[n,r,s,t]),templateWrap:(0,a.useCallback)((e,t)=>{let{item:o}=t;return o.associationField?["hasOne","belongsTo"].includes(o.associationField.type)?i(e,{item:o}):e:l(e,{item:o})},[l,i]),showAssociationFields:!0}}},{name:"editForm",title:'{{t("Form (Edit)")}}',Component:"FormBlockInitializer",collectionName:null==e?void 0:e.name,dataSource:null==e?void 0:e.dataSource,useComponentProps(){let e=(0,to.useCollection)(),{createEditFormBlock:t,templateWrap:l}=(0,to.useCreateEditFormBlock)(),n=[e,...o];return{filterCollections(e){let{collection:t}=e;return!!t&&n.some(e=>e.name===t.name)},onlyCurrentDataSource:!0,hideSearch:!0,hideOtherRecordsInPopup:!0,componentType:"FormItem",createBlockSchema:t,templateWrap:l,showAssociationFields:!0}},useVisible:()=>(0,to.useActionAvailable)("update")},{name:"createForm",title:'{{t("Form (Add new)")}}',Component:"FormBlockInitializer",collectionName:null==e?void 0:e.name,dataSource:null==e?void 0:e.dataSource,useComponentProps(){let{createAssociationFormBlock:e,templateWrap:t}=(0,to.useCreateAssociationFormBlock)(),{createFormBlock:o,templateWrap:l}=(0,to.useCreateFormBlock)();return{filterCollections(e){let{collection:t,associationField:o}=e;return!!o&&["hasMany","belongsToMany"].includes(o.type)},onlyCurrentDataSource:!0,hideSearch:!0,componentType:"FormItem",createBlockSchema:t=>{let{item:l,fromOthersInPopup:n}=t;if(n)return o({item:l,fromOthersInPopup:n});e({item:l})},templateWrap:(e,o)=>{let{item:n,fromOthersInPopup:r}=o;return r?l(e,{item:n,fromOthersInPopup:r}):t(e,{item:n})},showAssociationFields:!0}}},{name:"table",title:'{{t("Table")}}',Component:"TableBlockInitializer",useComponentProps(){let{createAssociationTableBlock:e}=(0,to.useCreateAssociationTableBlock)(),{createTableBlock:t}=(0,to.useCreateTableBlock)();return{hideSearch:!0,onlyCurrentDataSource:!0,filterCollections(e){let{associationField:t}=e;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:o=>{let{item:l,fromOthersInPopup:n}=o;if(n)return t({item:l});e({item:l})},showAssociationFields:!0}}},{name:"list",title:'{{t("List")}}',Component:"ListBlockInitializer",useComponentProps(){let{createAssociationListBlock:e}=(0,to.useCreateAssociationListBlock)(),{createListBlock:t}=t$();return{hideSearch:!0,onlyCurrentDataSource:!0,filterCollections(e){let{associationField:t}=e;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:o=>{let{item:l,fromOthersInPopup:n}=o;if(n)return t({item:l});e({item:l})},showAssociationFields:!0}}},{name:"gridCard",title:'{{t("Grid Card")}}',Component:"GridCardBlockInitializer",useComponentProps(){let{createAssociationGridCardBlock:e}=(0,to.useCreateAssociationGridCardBlock)(),{createGridCardBlock:t}=tR();return{hideSearch:!0,onlyCurrentDataSource:!0,filterCollections(e){let{associationField:t}=e;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:o=>{let{item:l,fromOthersInPopup:n}=o;if(n)return t({item:l});e({item:l})},showAssociationFields:!0}}}]}},{name:"filterBlocks",title:'{{t("Filter blocks")}}',type:"itemGroup",children:[{name:"filterForm",title:'{{t("Form")}}',Component:"FilterFormBlockInitializer",useComponentProps:()=>({filterCollections(e){let{collection:t}=e;return!0}})},{name:"filterCollapse",title:'{{t("Collapse")}}',Component:"FilterCollapseBlockInitializer",useComponentProps:()=>({filterCollections(e){let{collection:t}=e;return!0}})}]},{type:"itemGroup",name:"otherBlocks",title:'{{t("Other blocks")}}',children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]},oA=new v._({name:"RecordBlockInitializers",...oI}),oT=new v._({name:"popup:common:addBlock",...oI},oA),ow={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"itemGroup",title:"{{t('Enable actions')}}",name:"enableActions",children:[{name:"addNew",title:"{{t('Add new')}}",Component:"CreateActionInitializer",schema:{"x-align":"right"}},{name:"delete",title:"{{t('Delete')}}",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right"}}]}]},oj=new v._({name:"SubTableActionInitializers",...ow}),oD=new v._({name:"subTable:configureActions",...ow},oj);var oL=o(41752);let oR=e=>{let{designable:t,insertBeforeEnd:o}=(0,to.useDesignable)(),{isCreate:l,isBulkEdit:n,options:i}=e,{gridInitializer:s}=i,{getAriaLabel:d}=(0,oL.n)(),{isMobile:c}=(0,p.k)()||{},u=(0,to.useRecord)(),m=(0,tx.Ge)(),h=()=>{let e=(0,L.useForm)(),t=(0,to.useActionContext)(),r=s;return!m&&(r="page:addBlock",c&&(r="mobile:addBlock")),!r&&(r="popup:common:addBlock",l||!u?r="popup:addNew:addBlock":n&&(r="popup:bulkEdit:addBlock")),{async run(){await e.submit();let{title:l,icon:n}=e.values;o({type:"void",title:l,"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{icon:n},properties:{grid:{type:"void","x-component":"Grid","x-initializer":r,properties:{}}}}),await e.reset(),t.setVisible(!1)}}},x=(0,a.useMemo)(()=>({type:"void",properties:{action1:{type:"void","x-component":"Action","x-component-props":{icon:"PlusOutlined",style:{borderColor:"var(--colorSettings)",color:"var(--colorSettings)"},type:"dashed","aria-label":d()},title:'{{t("Add tab")}}',properties:{drawer1:{"x-decorator":"Form","x-component":"Action.Modal","x-component-props":{width:520,zIndex:2e3},type:"void",title:'{{t("Add tab")}}',properties:{title:{title:'{{t("Tab name")}}',required:!0,"x-component":"Input","x-decorator":"FormItem"},icon:{title:'{{t("Icon")}}',"x-component":"IconPicker","x-decorator":"FormItem"},footer:{"x-component":"Action.Modal.Footer",type:"void",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:()=>{let e=(0,to.useActionContext)();return{async run(){e.setVisible(!1)}}}}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:h}}}}}}}}}}),[]);return t?(0,r.jsx)(to.SchemaComponent,{schema:x}):null},oY={Component:oR,popover:!1},oB=new q.I({name:"TabPaneInitializers",...oY}),oN=new q.I({name:"popup:addTab",...oY}),oE=new q.I({name:"TabPaneInitializersForCreateFormBlock",Component:e=>(0,r.jsx)(oR,{...e,isCreate:!0}),popover:!1}),oz=new q.I({name:"TabPaneInitializersForBulkEditFormBlock",Component:e=>(0,r.jsx)(oR,{...e,isBulkEdit:!0}),popover:!1});var oO=o(21052);class oV extends n.k{async load(){this.app.addComponents({...oO,...l,DestroyActionInitializer:T,FormBlockInitializer:tF.y,RecordFormBlockInitializer:tM.B,TableBlockInitializer:tJ.I,TableSelectorInitializer:tG.w,RecordReadPrettyFormBlockInitializer:t_,DetailsBlockInitializer:tm,ListBlockInitializer:tV,GridCardBlockInitializer:tL,FilterFormBlockInitializer:t4,FilterCollapseBlockInitializer:tZ,MarkdownBlockInitializer:oe,MarkdownFormItemInitializer:ot,TableCollectionFieldInitializer:oa,CollectionFieldInitializer:or,CreateActionInitializer:h,CreateChildInitializer:m,ViewActionInitializer:ts,UpdateActionInitializer:ti,PopupActionInitializer:te,LinkActionInitializer:e0,UpdateRecordActionInitializer:e7,CreateSubmitActionInitializer:e5,UpdateSubmitActionInitializer:e4,BulkDestroyActionInitializer:A,ExpandableActionInitializer:j,DisassociateActionInitializer:w,FilterActionInitializer:D,RefreshActionInitializer:e1,EditTableActionInitializer:e2,DividerFormItemInitializer:t3,AssociateActionInitializer:tt,AssociateActionProvider:tr,PopupActionDecorator:e3}),this.app.schemaInitializerManager.add(oC),this.app.schemaInitializerManager.add(o_),this.app.schemaInitializerManager.add(tW.W),this.app.schemaInitializerManager.add(tW.k),this.app.schemaInitializerManager.add(tX.U),this.app.schemaInitializerManager.add(tX.C),this.app.schemaInitializerManager.add(tK.Wd),this.app.schemaInitializerManager.add(tK.Wf),this.app.schemaInitializerManager.add(tA.L),this.app.schemaInitializerManager.add(tA.r),this.app.schemaInitializerManager.add(tI.e),this.app.schemaInitializerManager.add(tu),this.app.schemaInitializerManager.add(tp),this.app.schemaInitializerManager.add(tS),this.app.schemaInitializerManager.add(tC),this.app.schemaInitializerManager.add(tg),this.app.schemaInitializerManager.add(tf),this.app.schemaInitializerManager.add(b),this.app.schemaInitializerManager.add(S),this.app.schemaInitializerManager.add(_),this.app.schemaInitializerManager.add(k),this.app.schemaInitializerManager.add(oF),this.app.schemaInitializerManager.add(oM),this.app.schemaInitializerManager.add(t0),this.app.schemaInitializerManager.add(t1),this.app.schemaInitializerManager.add(tP.E),this.app.schemaInitializerManager.add(tP.C),this.app.schemaInitializerManager.add(tT.T),this.app.schemaInitializerManager.add(tT.Z),this.app.schemaInitializerManager.add(t9),this.app.schemaInitializerManager.add(t8),this.app.schemaInitializerManager.add(tj),this.app.schemaInitializerManager.add(tD),this.app.schemaInitializerManager.add(tB),this.app.schemaInitializerManager.add(tN),this.app.schemaInitializerManager.add(tz),this.app.schemaInitializerManager.add(tO),this.app.schemaInitializerManager.add(tH),this.app.schemaInitializerManager.add(tU),this.app.schemaInitializerManager.add(oA),this.app.schemaInitializerManager.add(oT),this.app.schemaInitializerManager.add(ta),this.app.schemaInitializerManager.add(oj),this.app.schemaInitializerManager.add(oD),this.app.schemaInitializerManager.add(ol),this.app.schemaInitializerManager.add(on),this.app.schemaInitializerManager.add(oB),this.app.schemaInitializerManager.add(oN),this.app.schemaInitializerManager.add(oE),this.app.schemaInitializerManager.add(oz),this.app.schemaInitializerManager.add(oy),this.app.schemaInitializerManager.add(ob)}}},3403(e,t,o){o.d(t,{kq:()=>v,Fh:()=>x,Cl:()=>m});var l=o(71178),n=o(82113),r=o(52793),a=o(51649),i=o(77843),s=o(20629),d=o(82924),c=o(96932),u=o(81936),p=o(56920);let m=e=>{let{value:t,onChange:o}=e,{t:n}=(0,i.useTranslation)(),[s,d]=(0,a.useState)(t),c=a.default.useRef(null);return(0,a.useEffect)(()=>{d(t)},[t]),(0,a.useEffect)(()=>{c.current.input.focus();let e=new IntersectionObserver(e=>{e[0].isIntersecting&&c.current.input.focus()});return e.observe(c.current.input),()=>{e.disconnect()}},[]),(0,l.jsxs)("div",{style:{width:210},onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(r.Input,{ref:c,allowClear:!0,style:{padding:"0 4px 6px",boxShadow:"none"},bordered:!1,placeholder:n("Search and select collection"),value:s,onClick:e=>{e.stopPropagation()},onChange:e=>{o(e.target.value),d(e.target.value)}}),(0,l.jsx)(r.Divider,{style:{margin:0}})]})},h=e=>{let{loadMore:t,maxHeight:o}=e,n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=n.current;if(!e)return;let l=e.parentElement;for(;l&&"UL"!==l.tagName;)l=l.parentElement;let r=function(){l&&32>=Math.abs(l.scrollHeight-l.scrollTop-l.clientHeight)&&t()};return l&&(l.style.height=`${o-32}px`,l.style.maxHeight="inherit",l.style.overflowY="scroll",l.addEventListener("scroll",r)),()=>{l&&(l.removeEventListener("scroll",r),delete l.style.height)}},[t,o]),(0,l.jsx)("div",{ref:n,onClick:e=>e.stopPropagation(),children:(0,l.jsx)(r.Spin,{size:"small",style:{width:"100%"}})})};function x(e){let{data:t,openKeys:o,showType:n,hideSearch:i}=e,[s,d]=(0,a.useState)(""),[c,u]=(0,a.useState)(15),p=(0,a.useMemo)(()=>t.length>1,[t]),x=(0,a.useMemo)(()=>p?null==o?void 0:o[1]:(null==o?void 0:o.length)>0,[o]);(0,a.useEffect)(()=>{x||d("")},[x]);let v=(0,a.useMemo)(()=>{var e,o;return p?x&&(null==(o=t.find(e=>(e.key||e.name)===x))?void 0:o.children)||[]:(null==(e=t[0])?void 0:e.children)||[]},[t,p,x]),g=(0,a.useMemo)(()=>{if(!s)return v;let e=s.toLocaleLowerCase();return v.filter(t=>(t.label||t.title)&&String(t.label||t.title).toLocaleLowerCase().includes(e))},[s,v]),f=(0,a.useMemo)(()=>g.length>c,[c,g]),y=(0,a.useMemo)(()=>g.slice(0,c),[g,c]),b=(0,a.useMemo)(()=>{let e=[];return i||e.push(Object.assign({key:"search",label:(0,l.jsx)(m,{value:s,onChange:e=>{u(15),d(e)}}),onClick(e){let{domEvent:t}=e;t.stopPropagation()}},n?{isMenuType:!0}:{})),y.length>0?(e.push(...y),f&&e.push(Object.assign({key:"load-more",label:(0,l.jsx)(h,{maxHeight:480,loadMore:()=>{u(e=>e+15)}})},n?{isMenuType:!0}:{}))):e.push(Object.assign({key:"empty",style:{height:150},label:(0,l.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,l.jsx)(r.Empty,{image:r.Empty.PRESENTED_IMAGE_SIMPLE})})},n?{isMenuType:!0}:{})),e},[i,y,s,f,n]);return(0,a.useMemo)(()=>p?t.map(e=>x&&e.key===x?{...e,children:b}:{...e,children:[]}):b,[t,p,x,b])}let v=e=>{var t,o;let r,i,m,{templateWrap:h,onCreateBlockSchema:v,componentType:g,icon:f=n.TableOutlined,name:y,title:b,filter:S,onlyCurrentDataSource:C,hideSearch:_,showAssociationFields:k,hideChildrenIfSingleCollection:F,filterDataSource:M,items:P,hideOtherRecordsInPopup:I,onClick:A,filterOtherRecordsCollection:T,currentText:w,otherText:j,alwaysRenderMenu:D}=e,{insert:L,setVisible:R}=(0,s.fx)(),Y=(0,d.lum)(),{getTemplateSchemaByMode:B}=(0,c.ov)(),N=(r=(0,p.useForm)(),i=(0,p.useFieldSchema)(),m=(0,a.useMemo)(()=>{let e=i;for(;e;){if("TemplateGridDecorator"===e["x-decorator"])return!0;e=e.parent}return!1},[i]),e=>{m&&r.notify("blockAdded",e)}),E=(0,a.useCallback)(async e=>{N({collection:e.item.name,dataSource:e.item.dataSource,componentType:g,menuName:y});let{item:t,fromOthersInPopup:o}=e;if(A)return A(e);if(t.template){let e=await B(t);h?L(h(e,{item:t,fromOthersInPopup:o})):L(e)}else t.schemaInsertor?await t.schemaInsertor(L,{item:t,name:y,fromOthersInPopup:o}):v&&v({item:t,fromOthersInPopup:o});R(!1)},[B,L,R,v,A,h,N,y,g]),z=P||(0,u.nG)({name:y,componentName:g,filter:S,filterDataSource:M,filterOtherRecordsCollection:T,onlyCurrentDataSource:C,showAssociationFields:k,dataBlockInitializerProps:e,hideOtherRecordsInPopup:I,onClick:E,currentText:w,otherText:j}),O=(0,s.q9)(E),V=(0,a.useMemo)(()=>O(z,y),[O,z,y]),[$,q]=(0,a.useState)([]),H=x({data:V,openKeys:$,hideSearch:_}),U=(0,a.useMemo)(()=>{let t=H.filter(e=>"search"!==e.key&&"empty"!==e.key);return t=F&&1===t.length?t[0].children:H,[{key:y,label:Y(b),icon:"string"==typeof f?(0,l.jsx)(n.default,{type:f}):f,onClick:t=>{t.key===y&&E({...t,item:e})},children:t}]},[H,F,y,Y,b,f,E,e]);return V.length>1||1===V.length&&(null==(o=V[0])||null==(t=o.children)?void 0:t.length)>0||D?(0,l.jsx)(s.$l,{onOpenChange:e=>{q(e)},items:U}):(0,l.jsx)(s.rR,{...e,onClick:E})}},81936(e,t,o){o.d(t,{AZ:()=>b,DJ:()=>O,FJ:()=>M,G3:()=>j,H2:()=>L,HG:()=>k,IP:()=>D,JP:()=>q,LR:()=>K,Oo:()=>C,Rg:()=>R,TA:()=>$,_V:()=>w,aU:()=>E,aY:()=>A,gL:()=>I,g_:()=>P,je:()=>V,jz:()=>g,l:()=>S,nG:()=>z,nt:()=>y,oK:()=>N,vP:()=>F,xH:()=>f});var l=o(56920),n=o(27404),r=o(77583),a=o(51649),i=o(77843),s=o(44374),d=o(69412),c=o(29333),u=o(43288),p=o(14669),m=o(58980),h=o(82924),x=o(96932),v=o(24768);let g=e=>e,f=e=>({type:"void","x-component":"Grid.Row",properties:{[(0,n.uid)()]:{type:"void","x-component":"Grid.Col",properties:{[(null==e?void 0:e.name)||(0,n.uid)()]:e}}}}),y=(e,t)=>{t(e.parent)},b=(e,t)=>{t(e,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})},S=()=>{let e=(0,l.useForm)();return(t,o)=>{var l;o(t,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}),null==(l=e.values)||delete l[t.name]}},C=(e,t,o,l)=>e.reduceProperties((e,n)=>n[t]!==o||l&&n.name!==l?n.reduceProperties((e,n)=>n[t]!==o||l&&n.name!==l?e:n)||e:n),_=["attachment","textarea","markdown","json","richText","polygon","circle","point","lineString","vditor"];function k(){let{name:e,currentFields:t=[]}=(0,u.k7)(),{getInterface:o,getCollection:n}=(0,u.nj)(),r="AssociationField.SubTable"===(0,l.useFieldSchema)()["x-component"],a=(0,l.useForm)(),i=!r||a.readPretty;return t.filter(t=>!t.collectionName||t.collectionName===e).filter(e=>(null==e?void 0:e.interface)&&(null==e?void 0:e.interface)!=="subTable"&&!(null==e?void 0:e.treeChildren)).map(t=>{var l,a,s,d;let c=o(t.interface),u=(null==t?void 0:t.target)&&(null==(l=n(null==t?void 0:t.target))?void 0:l.template)==="file",p=(null==t||null==(a=t.uiSchema)?void 0:a["x-component"])==="Preview",m={name:t.name,"x-collection-field":`${e}.${t.name}`,"x-component":"CollectionField","x-component-props":u?{fieldNames:{label:"preview",value:"id"}}:p?{size:"small"}:{},"x-read-pretty":i||(null==(s=t.uiSchema)?void 0:s["x-read-pretty"]),"x-decorator":r?_.includes(t.interface)||u?"QuickEdit":"FormItem":null,"x-decorator-props":{labelStyle:{display:"none"}}};return{type:"item",name:t.name,title:(null==t||null==(d=t.uiSchema)?void 0:d.title)||t.name,Component:"TableCollectionFieldInitializer",find:C,remove:y,schemaInitialize:e=>{var o;null==c||null==(o=c.schemaInitialize)||o.call(c,e,{field:t,readPretty:i,block:"Table",targetCollection:n(t.target)})},field:t,schema:m}})}function F(){var e;let{fields:t}=(0,u.k7)(),{t:o}=(0,i.useTranslation)(),{getInterface:l,getCollectionFields:n,getCollection:r}=(0,u.nj)();return null==t||null==(e=t.filter(e=>["o2o","oho","obo","m2o"].includes(e.interface)))?void 0:e.map(e=>(function e(t){var o,l;let{getCollectionFields:n,field:r,getInterface:a,getCollection:i,schemaName:s,maxDepth:d,depth:c,t:u}=t,p=n(r.target),m=null==p||null==(o=p.filter(e=>(null==e?void 0:e.interface)&&!["subTable"].includes(null==e?void 0:e.interface)&&!(null==e?void 0:e.treeChildren)))?void 0:o.map(e=>{var t;let o=a(e.interface),l=`${s}.${e.name}`,n={name:l,"x-component":"CollectionField","x-read-pretty":!0,"x-collection-field":`${r.target}.${e.name}`,"x-component-props":{}};return{type:"item",key:`${r.target}_${e.name}_${l}`,name:l,title:(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name,Component:"TableCollectionFieldInitializer",find:C,remove:y,schemaInitialize:t=>{var l;null==o||null==(l=o.schemaInitialize)||l.call(o,t,{field:e,readPretty:!0,block:"Table",targetCollection:i(r.target)})},field:e,schema:n}}),h=[{type:"itemGroup",key:`${r.target}_${s}_displayFields`,name:`${s}-displayCollectionFields`,title:u("Display fields"),children:m}];if(c<d){let t=null==p?void 0:p.filter(e=>["o2o","oho","obo","m2o"].includes(e.interface)).map(t=>e({getCollectionFields:n,field:t,getInterface:a,getCollection:i,schemaName:`${s}.${t.name}`,maxDepth:d,depth:c+1,t:u}));if(t.length){let e={type:"itemGroup",key:`${r.target}_${s}_associationFields`,name:`${s}-associationFields`,title:u("Display association fields"),children:t};h.push(e)}}return{type:"subMenu",key:`${r.target}_${s}_submenu`,name:s,title:null==(l=r.uiSchema)?void 0:l.title,children:h}})({getCollectionFields:n,field:e,getInterface:l,getCollection:r,schemaName:e.name,maxDepth:2,depth:1,t:o}))}function M(){let{name:e}=(0,u.k7)(),{getInterface:t,getInheritCollections:o,getCollection:n,getParentCollectionFields:r}=(0,u.nj)(),a="AssociationField.SubTable"===(0,l.useFieldSchema)()["x-component"],i=(0,l.useForm)(),s=!a||i.readPretty,d=o(e);return null==d?void 0:d.map(o=>{let l=r(o,e),i=n(o);return{[null==i?void 0:i.title]:null==l?void 0:l.filter(e=>null==e?void 0:e.interface).map(o=>{var l,r,i,d;let c=t(o.interface),u=(null==o?void 0:o.target)&&(null==(l=n(null==o?void 0:o.target))?void 0:l.template)==="file",p={name:`${o.name}`,"x-component":"CollectionField","x-read-pretty":s||(null==(r=o.uiSchema)?void 0:r["x-read-pretty"]),"x-collection-field":`${e}.${o.name}`,"x-component-props":u?{fieldNames:{label:"preview",value:"id"}}:{},"x-decorator":a?_.includes(o.interface)||u?"QuickEdit":"FormItem":null,"x-decorator-props":{labelStyle:{display:"none"}}};return{name:(null==o||null==(i=o.uiSchema)?void 0:i.title)||o.name,type:"item",title:(null==o||null==(d=o.uiSchema)?void 0:d.title)||o.name,Component:"TableCollectionFieldInitializer",find:C,remove:y,schemaInitialize:e=>{var t;null==c||null==(t=c.schemaInitialize)||t.call(c,e,{field:o,readPretty:!0,block:"Table",targetCollection:n(null==o?void 0:o.target)})},field:o,schema:p}})}})}let P=e=>{var t,o;let{name:n,currentFields:r}=(0,u.k7)(),{getInterface:a,getCollection:i}=(0,u.nj)(),s=(0,l.useForm)(),{readPretty:d=s.readPretty,block:c="Form"}=e||{},{fieldSchema:p}=(0,h.D50)(),m=null==p?void 0:p["x-action"];return null==(o=r.filter(e=>!e.collectionName||e.collectionName===n))||null==(t=o.filter(e=>(null==e?void 0:e.interface)&&!(null==e?void 0:e.treeChildren)))?void 0:t.map(e=>{var t,o,l,r,s;let u=a(e.interface),p=i(e.target),h=(null==e?void 0:e.target)&&(null==(t=i(null==e?void 0:e.target))?void 0:t.template)==="file",x=null==e||null==(l=e.uiSchema)||null==(o=l["x-component-props"])?void 0:o.fieldNames,v={type:"string",name:e.name,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem","x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":`${n}.${e.name}`,"x-component-props":h?{fieldNames:{label:"preview",value:"id"}}:p&&x?{fieldNames:{...x,label:(null==p?void 0:p.titleField)||x.label}}:{},"x-read-pretty":null==e||null==(r=e.uiSchema)?void 0:r["x-read-pretty"]},g={type:"item",name:e.name,title:(null==e||null==(s=e.uiSchema)?void 0:s.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==u||null==(o=u.schemaInitialize)||o.call(u,t,{field:e,block:c,readPretty:d,action:m,targetCollection:p})},schema:v};return"Kanban"==c&&(g.find=(e,t,o)=>{let l=R(e,"x-component",c);return R(l,t,o)}),g})},I=e=>{var t,o;let{name:n,currentFields:r}=(0,u.k7)(),{getInterface:a,getCollection:i}=(0,u.nj)(),s=(0,l.useForm)(),{readPretty:d=s.readPretty,block:c="FilterForm"}=e||{},{snapshot:p,fieldSchema:x}=(0,h.D50)(),v=null==x?void 0:x["x-action"];return null==(o=r.filter(e=>!e.collectionName||e.collectionName===n))||null==(t=o.filter(e=>{var t;return(null==e?void 0:e.interface)&&(null==(t=a(e.interface))?void 0:t.filterable)}))?void 0:t.map(e=>{var t,o,l;let r=a(e.interface),s=i(e.target),u={type:"string",name:e.name,required:!1,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FilterFormItem","x-component":"CollectionField","x-decorator":"FormItem","x-use-decorator-props":"useFormItemProps","x-collection-field":`${n}.${e.name}`,"x-component-props":{utc:!1}};return(0,m.W0)(e)&&(u={type:"string",name:`${e.name}`,required:!1,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FilterFormItem","x-component":"CollectionField","x-decorator":"FormItem","x-use-decorator-props":"useFormItemProps","x-collection-field":`${n}.${e.name}`,"x-component-props":{...null==(l=e.uiSchema)?void 0:l["x-component-props"],utc:!1}}),{name:(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name,type:"item",title:(null==e||null==(o=e.uiSchema)?void 0:o.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==r||null==(o=r.schemaInitialize)||o.call(r,t,{field:e,block:c,readPretty:d,action:v,targetCollection:s})},schema:u}})},A=e=>{var t;let{name:o,fields:n}=(0,u.k7)(),{getInterface:r,getCollectionFields:a,getCollection:s}=(0,u.nj)(),d=(0,l.useForm)(),{t:c}=(0,i.useTranslation)(),{readPretty:p=d.readPretty,block:m="Form"}=e||{},h="Form"===m?["m2o","obo","oho"]:["o2o","oho","obo","m2o"];return null==n||null==(t=n.filter(e=>h.includes(e.interface)))?void 0:t.map(e=>(function e(t){var o,l;let{getCollectionFields:n,field:r,getInterface:a,getCollection:i,readPretty:s,block:d,maxDepth:c,depth:u,schemaName:p,t:m}=t,h=n(r.target),x=null==h||null==(o=h.filter(e=>(null==e?void 0:e.interface)&&!["subTable"].includes(null==e?void 0:e.interface)&&!e.treeChildren))?void 0:o.map(e=>{var t,o;let l=a(e.interface),n=(null==r?void 0:r.target)&&(null==(t=i(null==r?void 0:r.target))?void 0:t.template)==="file",c=`${p}.${e.name}`,u={type:"string",name:c,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem","x-component":"CollectionField","x-read-pretty":s,"x-component-props":{"pattern-disable":"Form"===d&&s,fieldNames:n?{label:"preview",value:"id"}:void 0},"x-decorator":"FormItem","x-collection-field":`${r.target}.${e.name}`};return{name:c,type:"item",title:(null==e||null==(o=e.uiSchema)?void 0:o.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==l||null==(o=l.schemaInitialize)||o.call(l,t,{field:e,block:d,readPretty:s,targetCollection:i(r.target)})},schema:u}}),v=[{type:"itemGroup",name:`${p}-displayCollectionFields`,title:m("Display fields"),children:x}];if(u<c){let t=null==h?void 0:h.filter(e=>["o2o","oho","obo","m2o"].includes(e.interface)).map(t=>e({getCollectionFields:n,field:t,getInterface:a,getCollection:i,schemaName:`${p}.${t.name}`,readPretty:s,block:d,maxDepth:c,depth:u+1,t:m}));if(t.length){let e={type:"itemGroup",name:`${p}-associationFields`,title:m("Display association fields"),children:t};v.push(e)}}return{type:"subMenu",name:`${p}.${r.name}`,title:null==(l=r.uiSchema)?void 0:l.title,children:v}})({getCollectionFields:a,field:e,getInterface:r,getCollection:s,readPretty:p,block:m,schemaName:e.name,maxDepth:2,depth:1,t:c}))},T=(e,t,o,l,n)=>{var r,a,i;if(e.target&&e.uiSchema){if(n.includes(e.target)||n.length>=1)return;let r=l(e.target);if(!(null==r?void 0:r.length))return;return{type:"subMenu",name:t,title:null==(i=e.uiSchema)?void 0:i.title,children:r.map(r=>T(r,`${t}.${r.name}`,o,l,[...n,e.target])).filter(Boolean)}}if(!e.uiSchema)return;let s={type:"string",name:t,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FilterFormItem","x-designer-props":{interface:e.interface},"x-component":"CollectionField","x-component-props":{utc:!1},"x-read-pretty":!1,"x-decorator":"FormItem","x-collection-field":`${o}.${t}`};return{name:(null==(r=e.uiSchema)?void 0:r.title)||e.name,type:"item",title:(null==(a=e.uiSchema)?void 0:a.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schema:s}},w=()=>{let{name:e,fields:t}=(0,u.k7)(),{getCollectionFields:o}=(0,u.nj)(),l=["attachmentURL"];return null==t?void 0:t.filter(e=>e.target&&e.uiSchema&&!l.includes(e.interface)).map(t=>T(t,t.name,e,o,[])).filter(Boolean)},j=e=>{let{name:t}=(0,u.k7)(),{getInterface:o,getInheritCollections:n,getCollection:r,getParentCollectionFields:a}=(0,u.nj)(),i=n(t),{snapshot:s}=(0,h.D50)(),d=(0,l.useForm)();return null==i?void 0:i.map(l=>{var n;let i=a(l,t),{readPretty:s=d.readPretty,block:c="Form",component:u="CollectionField"}=e||{},p=r(l);return{[null==p?void 0:p.title]:null==i||null==(n=i.filter(e=>null==e?void 0:e.interface))?void 0:n.map(e=>{var l,n,a,i;let d=o(e.interface),p=r(e.target),m={type:"string",name:e.name,title:(null==e||null==(l=e.uiSchema)?void 0:l.title)||e.name,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem","x-component":u,"x-decorator":"FormItem","x-collection-field":`${t}.${e.name}`,"x-component-props":{},"x-read-pretty":null==e||null==(n=e.uiSchema)?void 0:n["x-read-pretty"]};return{name:(null==e||null==(a=e.uiSchema)?void 0:a.title)||e.name,type:"item",title:(null==e||null==(i=e.uiSchema)?void 0:i.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==d||null==(o=d.schemaInitialize)||o.call(d,t,{field:e,block:c,readPretty:s,targetCollection:p})},schema:m}})}})},D=e=>{let{name:t}=(0,u.k7)(),{getInterface:o,getInheritCollections:n,getCollection:r,getParentCollectionFields:a}=(0,u.nj)(),i=n(t),{snapshot:s}=(0,h.D50)(),d=(0,l.useForm)();return null==i?void 0:i.map(l=>{var n;let i=a(l,t),{readPretty:s=d.readPretty,block:c="Form"}=e||{};return{[r(l).title]:null==i||null==(n=i.filter(e=>{var t;return(null==e?void 0:e.interface)&&(null==(t=o(e.interface))?void 0:t.filterable)}))?void 0:n.map(e=>{var l,n,a,i;let d=o(e.interface),u=r(e.target),p={type:"string",name:e.name,title:(null==e||null==(l=e.uiSchema)?void 0:l.title)||e.name,required:!1,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FilterFormItem","x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":`${t}.${e.name}`,"x-component-props":{utc:!1},"x-read-pretty":null==e||null==(n=e.uiSchema)?void 0:n["x-read-pretty"]};return{name:(null==e||null==(a=e.uiSchema)?void 0:a.title)||e.name,type:"item",title:(null==e||null==(i=e.uiSchema)?void 0:i.title)||e.name,Component:"CollectionFieldInitializer",remove:b,schemaInitialize:t=>{var o;null==d||null==(o=d.schemaInitialize)||o.call(d,t,{field:e,block:c,readPretty:s,targetCollection:u})},schema:p}})}})},L=e=>{var t;let{name:o,currentFields:n}=(0,u.k7)(),{getInterface:r,getCollection:a}=(0,u.nj)(),i=(0,l.useForm)(),{readPretty:s=i.readPretty,block:d="Form"}=e||{},c=S();return null==n||null==(t=n.filter(e=>!e.inherit&&(null==e?void 0:e.interface)&&"snapshot"!==e.interface))?void 0:t.map(e=>{var t,l;let n=r(e.interface),i={type:"string",name:e.name,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem","x-component":"AssignedField","x-decorator":"FormItem","x-collection-field":`${o}.${e.name}`};return{name:(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name,type:"item",title:(null==e||null==(l=e.uiSchema)?void 0:l.title)||e.name,Component:"CollectionFieldInitializer",remove:c,schemaInitialize:t=>{var o;null==n||null==(o=n.schemaInitialize)||o.call(n,t,{field:e,block:d,readPretty:s,targetCollection:a(e.target)})},schema:i}})},R=(e,t,o,n)=>l.Schema.isSchemaInstance(e)?e.reduceProperties((e,l)=>{if(l[t]===o&&(!n||l.name===n))return l;if(l["x-component"]&&"Action.Container"!==l["x-component"]&&!l["x-component"].includes("AssociationField")){let e=R(l,t,o,n);if(e)return e}return e}):null,Y=(e,t)=>t(e),B=e=>e.parent?e.parent["x-initializer"]?e.parent:B(e.parent):null,N=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:R,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Y,r=arguments.length>4?arguments[4]:void 0,{removeActiveFieldName:a}=(0,c.d)()||{},{form:i}=(0,d.Es)(),s=(0,l.useFieldSchema)();if(!(null==s?void 0:s["x-initializer"])&&(null==s?void 0:s["x-decorator"])==="FormItem"){let e=B(s);e&&(s=e)}let{remove:u}=(0,h.erX)(),p=o(s,t,e,r);return{schema:p,exists:!!p,remove(){null==a||a(p.name),null==i||i.query(RegExp(`${p.parent.name}.${p.name}$`)).forEach(e=>{var t,o;null==(t=e.setValue)||t.call(e,void 0),null==(o=e.setInitialValue)||o.call(e,void 0)}),p&&n(p,u)}}},E=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,{t:n}=(0,i.useTranslation)(),r=(0,u.k7)(),{getTemplatesByCollection:a}=(0,x.ov)(),s=a(r.dataSource,o||r.name).filter(t=>e&&t.componentName===e).filter(t=>["FormItem","ReadPrettyFormItem"].includes(e)||t.resourceName===l),d=Array.from(G.values()).map(t=>t({collection:r,componentName:e})).filter(Boolean).flat();if(!s.length&&!d.length||U())return[];let c=[{type:"divider",name:"divider"}];return s.length&&c.push({key:`${o||e}_table_subMenu_0_copy`,type:"subMenu",name:"copy",title:n("Duplicate template"),children:s.map(e=>{let o=["FormItem","ReadPrettyFormItem"].includes(null==e?void 0:e.componentName)?`${null==e?void 0:e.name} ${n("(Fields only)")}`:null==e?void 0:e.name;return{type:"item",mode:"copy",name:r.name,template:e,item:t,title:o||n("Untitled")}})},{key:`${o||e}_table_subMenu_0_ref`,type:"subMenu",name:"ref",title:n("Reference template"),children:s.map(e=>{let o=["FormItem","ReadPrettyFormItem"].includes(null==e?void 0:e.componentName)?`${null==e?void 0:e.name} ${n("(Fields only)")}`:null==e?void 0:e.name;return{type:"item",mode:"reference",name:r.name,template:e,item:t,title:o||n("Untitled")}})}),d.length&&c.push({type:"subMenu",name:"inherited_templates",key:`associationFiled_${e}_table_subMenu_0_inherited`,title:n("Inherited template"),children:d}),[{key:`${o||e}_table_blank`,type:"item",name:r.name,title:n("Blank block"),item:t},...c]},z=e=>{let{name:t,componentName:o,filter:n=()=>!0,onlyCurrentDataSource:d=!1,showAssociationFields:c,filterDataSource:m,dataBlockInitializerProps:g,hideOtherRecordsInPopup:f,onClick:y,filterOtherRecordsCollection:b,currentText:S,otherText:C}=e,{componentNamePrefix:_}=(0,v.kU)(),{t:k}=(0,i.useTranslation)(),F=(0,p.m6)(),M=(0,s.useDataSourceKey)(),P=(0,s.useCollection)(),I=function(e){let{componentName:t,filterCollections:o,showAssociationFields:n,componentNamePrefix:r,name:d}=e,c=(0,l.useFieldSchema)(),{getCollectionFields:p}=(0,u.nj)(),m=(0,u.k7)();(0,s.useCollectionManager)();let v=(0,s.useDataSourceKey)(),{getTemplatesByCollection:g}=(0,x.ov)(),{t:f}=(0,i.useTranslation)(),y=(0,h.lum)();return(0,a.useMemo)(()=>{if(!n)return[];let e=[];if(c["x-initializer"])e=m.fields;else{let t=B(c.parent);t&&(e=p(t))}return e.filter(e=>["linkTo","subTable","o2m","m2m","obo","oho","o2o","m2o"].includes(e.interface)).filter(e=>o({associationField:e})).map((e,o)=>{let l=y(e.uiSchema.title||e.name),n=g(v,e.target).filter(o=>{if(o.resourceName!==`${e.collectionName}.${e.name}`)return!1;if(t===r+"ReadPrettyFormItem")if(["hasOne","belongsTo"].includes(e.type))return o.componentName===r+"ReadPrettyFormItem";else return o.componentName===r+"Details";return o.componentName===t}),a=Array.from(G.values()).map(l=>l({collection:m,index:o,field:e,componentName:t,keyPrefix:"associationFiled_table_subMenu",name:d})).filter(Boolean).flat();if(!n.length&&!a.length||U())return{type:"item",name:`${e.collectionName}.${e.name}`,collectionName:e.target,title:l,dataSource:v,associationField:e};let i=[{type:"divider",name:"divider"}];return n.length&&i.push({key:`associationFiled_${t}_table_subMenu_${o}_copy`,type:"subMenu",name:"copy",dataSource:v,title:f("Duplicate template"),children:n.map(t=>{let o=[r+"FormItem",r+"ReadPrettyFormItem"].includes(null==t?void 0:t.componentName)?`${null==t?void 0:t.name} ${f("(Fields only)")}`:null==t?void 0:t.name;return{type:"item",mode:"copy",name:`${e.collectionName}.${e.name}`,collectionName:e.target,template:t,dataSource:v,title:o||f("Untitled"),associationField:e}})},{key:`associationFiled_${t}_table_subMenu_${o}_ref`,type:"subMenu",name:"ref",dataSource:v,title:f("Reference template"),children:n.map(t=>{let o=[r+"FormItem",r+"ReadPrettyFormItem"].includes(null==t?void 0:t.componentName)?`${null==t?void 0:t.name} ${f("(Fields only)")}`:null==t?void 0:t.name;return{type:"item",mode:"reference",name:`${e.collectionName}.${e.name}`,collectionName:e.target,template:t,dataSource:v,title:o||f("Untitled"),associationField:e}})}),a.length&&i.push({type:"subMenu",name:"inherited_templates",key:`associationFiled_${t}_table_subMenu_${o}_inherited`,dataSource:v,title:f("Inherited template"),children:a}),{key:`associationFiled_${t}_table_subMenu_${o}`,type:"subMenu",name:`${e.target}_${o}`,title:l,dataSource:v,children:[{type:"item",name:`${e.collectionName}.${e.name}`,collectionName:e.target,dataSource:v,title:f("Blank block"),associationField:e},...i]}})},[m.fields,y,t,v,c,o,p,g,n,f,r])}({componentName:_+o,filterCollections:n,showAssociationFields:c,componentNamePrefix:_,name:t}),A=(0,s.useAssociationName)(),T=F.getAllCollections({filterCollection:e=>(!d||e.dataSource===M)&&n({collection:e}),filterDataSource:m});d&&(T=T.filter(e=>e.key===M));let{getTemplatesByCollection:w}=(0,x.ov)(),j=(0,a.useMemo)(()=>T.map(e=>{let{key:l,displayName:n,collections:a}=e;return{name:l,label:n,type:"subMenu",children:[...H({name:t,association:A,collections:a,componentName:_+o,searchValue:"",dataSource:l,getTemplatesByCollection:w,t:k,componentNamePrefix:_}).sort(e=>{let t=r.default.toArray((null==P?void 0:P.inherits)||[]);if(e.name===(null==P?void 0:P.name)||t.some(t=>t===e.name))return -1})]}}),[T,null==P?void 0:P.inherits,null==P?void 0:P.name,o,w,k]);return c?(0,a.useMemo)(()=>{let e,t={name:"currentRecord",collectionName:P.name,dataSource:P.dataSource,Component:s.DataBlockInitializer,onClick(){},componentProps:{...g,icon:null,title:S||k("Current record"),name:"currentRecord",hideSearch:!1,hideChildrenIfSingleCollection:!0,items:j}},l={name:"associationRecords",Component:s.DataBlockInitializer,onClick(){},componentProps:{...g,icon:null,title:k("Associated records"),name:"associationRecords",hideSearch:!1,items:[{name:"associationFields",label:k("Association fields"),type:"subMenu",children:I}]}},n={name:"otherRecords",Component:s.DataBlockInitializer,onClick(){},componentProps:{...g,hideSearch:!1,icon:null,title:C||k("Other records"),name:"otherRecords",showAssociationFields:!1,onlyCurrentDataSource:!1,hideChildrenIfSingleCollection:!1,fromOthersInPopup:!0,componentType:{ReadPrettyFormItem:"Details"}[o]||o,filter(e){let{collection:t,associationField:o}=e;return!b||b(t)},onClick(e){y({...e,fromOthersInPopup:!0})}}},r=I.length?l:null;if(j[0].children.length&&I.length)e=f?[t,r]:[t,r,n];else if(j[0].children.length)if(f){if(j[0].children.length<=1){var a;return j[0].children=(null==(a=j[0].children[0])?void 0:a.children)||[],j}e=[t]}else e=[t,n];else e=f?[r]:[r,n];return[{name:"records",label:k("Records"),type:"subMenu",children:e.filter(Boolean)}]},[I,P.dataSource,P.name,o,g,b,f,j,y,k]):j},O=e=>{let{formItemInitializers:t="details:configureFields",actionInitializers:o="detailsWithPaging:configureActions",collection:l,dataSource:r,association:a,template:i,settings:s,action:d="list",...c}=e,u=a||l;return{type:"void","x-acl-action":"get"===d?`${u}:get`:`${u}:view`,"x-decorator":"DetailsBlockProvider","x-decorator-props":{dataSource:r,collection:l,association:a,readPretty:!0,action:d,..."list"===d?{params:{pageSize:1}}:{},...c},"x-toolbar":"BlockSchemaToolbar","x-settings":s,"x-component":"CardItem",properties:{[(0,n.uid)()]:{type:"void","x-component":"Details","x-use-component-props":"useDetailsBlockProps","x-read-pretty":!0,properties:{[(0,n.uid)()]:{type:"void","x-initializer":o,"x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{}},grid:i||{type:"void","x-component":"Grid","x-initializer":t,properties:{}},..."list"===d?{pagination:{type:"void","x-component":"Pagination","x-use-component-props":"useDetailsPaginationProps"}}:{}}}}}},V=e=>{let{formItemInitializers:t="form:configureFields",actionInitializers:o="createForm:configureActions",collection:l,resource:r,dataSource:a,association:i,action:s,actions:d={},"x-designer":c="FormV2.Designer",template:u,title:p,settings:m,...h}=e,x=r||i||l;return{type:"void","x-acl-action-props":{skipScopeCheck:!s},"x-acl-action":s?`${x}:update`:`${x}:create`,"x-decorator":"FormBlockProvider","x-decorator-props":{...h,action:s,dataSource:a,resource:x,collection:l,association:i},"x-toolbar":"BlockSchemaToolbar",...m?{"x-settings":m}:{"x-designer":c},"x-component":"CardItem","x-component-props":{title:p},properties:{[(0,n.uid)()]:{type:"void","x-component":"FormV2","x-use-component-props":"useFormBlockProps",properties:{grid:u||{type:"void","x-component":"Grid","x-initializer":t,properties:{}},[(0,n.uid)()]:{type:"void","x-initializer":o,"x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:d}}}}}},$=e=>{let{formItemInitializers:t="details:configureFields",actionInitializers:o="details:configureActions",collection:l,association:r,dataSource:a,resource:i,template:s,settings:d,...c}=e,u=i||r||l;return{type:"void","x-acl-action":`${u}:get`,"x-decorator":"FormBlockProvider","x-decorator-props":{resource:u,collection:l,association:r,dataSource:a,readPretty:!0,action:"get",useParams:"{{ useParamsFromRecord }}",...c},"x-toolbar":"BlockSchemaToolbar","x-settings":d,"x-component":"CardItem",properties:{[(0,n.uid)()]:{type:"void","x-component":"FormV2","x-use-component-props":"useFormBlockProps","x-read-pretty":!0,properties:{[(0,n.uid)()]:{type:"void","x-initializer":o,"x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{}},grid:s||{type:"void","x-component":"Grid","x-initializer":t,properties:{}}}}}}},q=e=>{let{collection:t,rowKey:o,tableActionInitializers:l,tableColumnInitializers:r,tableActionColumnInitializers:a,tableBlockProvider:i,disableTemplate:s,dataSource:d,blockType:c,pageSize:u=20,...p}=e;return{type:"void","x-decorator":i??"TableBlockProvider","x-acl-action":`${t}:list`,"x-decorator-props":{collection:t,dataSource:d,action:"list",params:{pageSize:u},rowKey:o,showIndex:!0,dragSort:!1,disableTemplate:s??!1,blockType:c,...p},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table","x-component":"CardItem","x-filter-targets":[],properties:{actions:{type:"void","x-initializer":l??"table:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--nb-spacing)"}},properties:{}},[(0,n.uid)()]:{type:"array","x-initializer":r??"table:configureColumns","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-designer":"TableV2.ActionColumnDesigner","x-initializer":a??"table:configureItemActions",properties:{[(0,n.uid)()]:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{},properties:{}}}}}}}}},H=e=>{var t;let{name:o,association:l,collections:n,dataSource:r,componentName:a,searchValue:i,getTemplatesByCollection:s,t:d,componentNamePrefix:c}=e;return null==n||null==(t=n.filter(e=>{if(e.inherit||!e.filterTargetKey)return!1;{if([c+"Kanban",c+"FormItem"].includes(a)&&("view"===e.template&&!e.writableView||"sql"===e.template)||"file"===e.template&&[c+"Kanban",c+"FormItem",c+"Calendar"].includes(a))return!1;let t=e.title||e.tableName;return!!t&&t.toUpperCase().includes(i.toUpperCase())&&!((null==e?void 0:e.isThrough)&&(null==e?void 0:e.autoCreate))}}))?void 0:t.map((e,t)=>{let n=e.title||e.tableName||e.label,i=s(r,e.name).filter(e=>{var t;let n="otherRecords"!==o&&l;return n?e.resourceName===l&&a&&e.componentName===a:!(!n&&(null==e||null==(t=e.resourceName)?void 0:t.includes(".")))&&a&&e.componentName===a}),u=Array.from(G.values()).map(o=>o({item:e,index:t,componentName:a,association:l})).filter(Boolean).flat();if(!i.length&&!u.length||U())return{type:"item",name:e.name,title:n,dataSource:r};let p=[{type:"divider",name:"divider"}];return i.length&&p.push({key:`${a}_table_subMenu_${t}_copy`,type:"subMenu",name:"copy",dataSource:r,title:d("Duplicate template"),children:i.map(t=>{let o=[c+"FormItem",c+"ReadPrettyFormItem"].includes(null==t?void 0:t.componentName)?`${null==t?void 0:t.name} ${d("(Fields only)")}`:null==t?void 0:t.name;return{type:"item",mode:"copy",name:e.name,template:t,dataSource:r,title:o||d("Untitled")}})},{key:`${a}_table_subMenu_${t}_ref`,type:"subMenu",name:"ref",dataSource:r,title:d("Reference template"),children:i.map(t=>{let o=[c+"FormItem",c+"ReadPrettyFormItem"].includes(null==t?void 0:t.componentName)?`${null==t?void 0:t.name} ${d("(Fields only)")}`:null==t?void 0:t.name;return{type:"item",mode:"reference",name:e.name,template:t,dataSource:r,title:o||d("Untitled")}})}),u.length&&p.push({type:"subMenu",name:"inherited_templates",key:`associationFiled_${a}_table_subMenu_${t}_inherited`,dataSource:r,title:d("Inherited template"),children:u}),{key:`${a}_table_subMenu_${t}`,type:"subMenu",name:`${e.name}_${t}`,title:n,dataSource:r,children:[{type:"item",name:e.name,dataSource:r,title:d("Blank block")},...p]}})},U=()=>window.location.pathname.includes("/ui-templates/inherited-v1"),G=new Map;function K(e,t){G.set(e,t)}},18272(e,t,o){o.d(t,{yF:()=>p,sm:()=>m,g$:()=>f});var l=o(71178),n=o(56920),r=o(52793),a=o(51649),i=o(77843),s=o(20629),d=o(95951),c=o(8724),u=o(99300);let p=e=>{var t,o,u;let{openMode:p=!0,openSize:m=!0}=e,h=(0,n.useFieldSchema)(),x=(0,n.useField)(),{t:v}=(0,i.useTranslation)(),{dn:g}=(0,d.er)(),{isPopupVisibleControlledByURL:f}=(0,c.X)(),y=(null==h||null==(t=h["x-component-props"])?void 0:t.openMode)||"drawer",b=(0,a.useMemo)(()=>f()?[{label:v("Drawer"),value:"drawer"},{label:v("Dialog"),value:"modal"},{label:v("Page"),value:"page"}]:[{label:v("Drawer"),value:"drawer"},{label:v("Dialog"),value:"modal"}],[v,f()]);return(0,l.jsxs)(l.Fragment,{children:[p?(0,l.jsx)(s.S3,{closeInitializerMenuWhenClick:!1,title:v("Open mode"),options:b,value:y,onChange:e=>{x.componentProps.openMode=e;let t={"x-uid":h["x-uid"]};t["x-component-props"]=h["x-component-props"]||{},t["x-component-props"].openMode=e,h["x-component-props"].openMode=e,Reflect.deleteProperty(h["x-component-props"],"openSize"),g.emit("patch",{schema:t}),g.refresh()}}):null,m&&["modal","drawer"].includes(y)?(0,l.jsx)(s.rR,{closeInitializerMenuWhenClick:!1,children:(0,l.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},children:[v("Popup size"),(0,l.jsx)(r.Select,{"data-testid":"antd-select",bordered:!1,options:[{label:v("Small"),value:"small"},{label:v("Middle"),value:"middle"},{label:v("Large"),value:"large"}],value:(null==h||null==(o=h["x-component-props"])?void 0:o.openSize)??((null==h||null==(u=h["x-component-props"])?void 0:u.openMode)=="modal"?"large":"middle"),onChange:e=>{x.componentProps.openSize=e;let t={"x-uid":h["x-uid"]};t["x-component-props"]=h["x-component-props"]||{},t["x-component-props"].openSize=e,h["x-component-props"].openSize=e,g.emit("patch",{schema:t}),g.refresh()},style:{textAlign:"right",minWidth:100}})]})}):null]})},m=e=>{var t,o,r;let{openMode:s=!0,openSize:c=!0,modeOptions:p,targetSchema:m}=e,h=(0,n.useFieldSchema)(),x=m||h,v=(0,n.useField)(),{t:g}=(0,i.useTranslation)(),{dn:f}=(0,d.er)(),y=(null==x||null==(t=x["x-component-props"])?void 0:t.openMode)||"drawer",b=(0,a.useMemo)(()=>p||[{label:g("Drawer"),value:"drawer"},{label:g("Dialog"),value:"modal"},{label:g("Page"),value:"page"}],[p,g]);return(0,l.jsxs)(l.Fragment,{children:[s?(0,l.jsx)(u.Al,{title:g("Open mode"),options:b,value:y,onChange:e=>{v.componentProps.openMode=e;let t={"x-uid":x["x-uid"]};t["x-component-props"]=x["x-component-props"]||{},t["x-component-props"].openMode=e,x["x-component-props"].openMode=e,Reflect.deleteProperty(x["x-component-props"],"openSize"),f.emit("patch",{schema:t}),f.refresh()}}):null,c&&["modal","drawer"].includes(y)?(0,l.jsx)(u.Al,{title:g("Popup size"),options:[{label:g("Small"),value:"small"},{label:g("Middle"),value:"middle"},{label:g("Large"),value:"large"}],value:(null==x||null==(o=x["x-component-props"])?void 0:o.openSize)??((null==x||null==(r=x["x-component-props"])?void 0:r.openMode)=="modal"?"large":"middle"),onChange:e=>{v.componentProps.openSize=e;let t={"x-uid":x["x-uid"]};t["x-component-props"]=x["x-component-props"]||{},t["x-component-props"].openSize=e,x["x-component-props"].openSize=e,f.emit("patch",{schema:t}),f.refresh()}}):null]})};var h=o(77583),x=o(43288),v=o(82924),g=o(4627);let f=(0,n.observer)(e=>{var t,o,r;let{required:a=!0}=e,{getCollectionJoinField:s}=(0,x.nj)(),{getField:d}=(0,x.k7)(),c=(0,n.useField)(),p=(0,n.useFieldSchema)(),{t:m}=(0,i.useTranslation)(),{dn:f,refresh:y}=(0,v.erX)(),b=(0,v.lum)(),S=d(p.name)||s(p["x-collection-field"]);return(0,l.jsxs)(l.Fragment,{children:[S&&(0,l.jsx)(u.fY,{title:m("Edit field title"),schema:{type:"object",title:m("Edit field title"),properties:{title:{title:m("Field title"),default:null==c?void 0:c.title,description:`${m("Original field title: ")}${null==S||null==(t=S.uiSchema)?void 0:t.title}`,"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit:e=>{var t;let{title:o}=e;c.title=b(""===o.trim()?null==S||null==(t=S.uiSchema)?void 0:t.title:o),p.title=o,f.emit("patch",{schema:{"x-uid":p["x-uid"],title:p.title}}),f.refresh()}},"edit-field-title"),(0,l.jsx)(u.Qd,{checked:(null==(o=p["x-decorator-props"])?void 0:o.showTitle)??!0,title:m("Display title"),onChange:e=>{p["x-decorator-props"]=p["x-decorator-props"]||{},p["x-decorator-props"].showTitle=e,c.decoratorProps.showTitle=e,f.emit("patch",{schema:{"x-uid":p["x-uid"],"x-decorator-props":{...p["x-decorator-props"],showTitle:e}}}),f.refresh()}}),!c.readPretty&&(0,l.jsx)(u.fY,{title:m("Edit description"),schema:{type:"object",title:m("Edit description"),properties:{description:{default:null==c?void 0:c.description,"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{}}}},onSubmit:e=>{let{description:t}=e;c.description=t,p.description=t,f.emit("patch",{schema:{"x-uid":p["x-uid"],description:p.description}}),f.refresh()}},"edit-description"),c.readPretty&&(0,l.jsx)(u.fY,{title:m("Edit tooltip"),schema:{type:"object",title:m("Edit description"),properties:{tooltip:{default:null==p||null==(r=p["x-decorator-props"])?void 0:r.tooltip,"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{}}}},onSubmit:e=>{let{tooltip:t}=e;c.decoratorProps.tooltip=t,p["x-decorator-props"]=p["x-decorator-props"]||{},p["x-decorator-props"].tooltip=t,f.emit("patch",{schema:{"x-uid":p["x-uid"],"x-decorator-props":p["x-decorator-props"]}}),f.refresh()}},"edit-tooltip"),!c.readPretty&&"FormField"!==p["x-component"]&&a&&(0,l.jsx)(u.Qd,{title:m("Required"),checked:p.required,onChange:e=>{let t={"x-uid":p["x-uid"]};c.required=e,h.default.set(c,"initStateOfLinkageRules.required",(0,g.qE)(!0,e)),p.required=e,t.required=e,f.emit("patch",{schema:t}),y()}},"required")]})},{displayName:"GeneralSchemaItems"})},65457(e,t,o){o.d(t,{gc:()=>N,OH:()=>E});var l=o(71178),n=o(56920),r=o(2314),a=o(52793),i=o(77583),s=o(51649),d=o(77843),c=o(43288),u=o(58980),p=o(80461),m=o(82924),h=o(58329),x=o(56220);let v=s.default.forwardRef((e,t)=>{var o;let n=x.ArrayBase.useArray(),r=x.ArrayBase.useIndex(e.index),{t:i}=(0,d.useTranslation)();return(0,l.jsx)(a.Switch,{...e,checkedChildren:i("Default"),unCheckedChildren:i("Default"),checked:null==n||null==(o=n.field)?void 0:o.value[r].default,style:{transition:"all 0.25s ease-in-out",color:"rgba(0, 0, 0, 0.8)",fontSize:16,marginLeft:6,marginBottom:3},onChange:(e,t)=>{var o;t.stopPropagation(),n.field.value.splice(r,1,{...null==n||null==(o=n.field)?void 0:o.value[r],default:e}),n.field.value.forEach((e,t)=>{if(t!==r){var o;n.field.value.splice(t,1,{...null==n||null==(o=n.field)?void 0:o.value[t],default:!1})}})},onClick:(e,t)=>{t.stopPropagation()}})});v.displayName="AsDefaultTemplate";var g=o(82113),f=o(27404),y=o(94046);let b=(0,o(54944).f)("nb-array-collapse",e=>{let{componentCls:t}=e;return{[t]:{marginBottom:"10px"}}}),S=(0,n.observer)(e=>{var t;let o=x.ArrayBase.useArray(),n=x.ArrayBase.useIndex(e.index),{t:r}=(0,d.useTranslation)(),i=null==o||null==(t=o.field)?void 0:t.value[n];return(0,s.useEffect)(()=>{if(i.key||(i.key=(0,f.uid)()),!i.title){var e,t;i.title=`${r("Template name")} ${null==o||null==(t=o.field)||null==(e=t.value)?void 0:e.length}`}},[]),(0,l.jsx)(a.Input.TextArea,{value:i.title,placeholder:r("Template name"),onChange:e=>{e.stopPropagation(),i.title=e.target.value},onBlur:e=>{e.stopPropagation(),i.title=e.target.value},autoSize:!0,style:{width:"70%",border:"none"},onClick:e=>{e.stopPropagation()}})}),C=e=>{var t,o;return(null==(o=e["x-component"])||null==(t=o.indexOf)?void 0:t.call(o,"Addition"))>-1},_=e=>{var t,o;return(null==(o=e["x-component"])||null==(t=o.indexOf)?void 0:t.call(o,"Index"))>-1},k=e=>{var t,o,l,n,r,a,i,s;return C(e)||(null==(o=e["x-component"])||null==(t=o.indexOf)?void 0:t.call(o,"Remove"))>-1||(null==(n=e["x-component"])||null==(l=n.indexOf)?void 0:l.call(n,"MoveDown"))>-1||(null==(a=e["x-component"])||null==(r=a.indexOf)?void 0:r.call(a,"MoveUp"))>-1||(null==(s=e["x-component"])||null==(i=s.indexOf)?void 0:i.call(s,"Copy"))>-1},F=e=>Array.from({length:e}).map((e,t)=>t),M=(e,t)=>e<t?F(e):F(t),P=(0,n.observer)(e=>{let{componentCls:t,hashId:o}=b(),r=(0,n.useField)(),i=Array.isArray(r.value)?r.value:[],[d,c]=(0,s.useState)(M(i.length,e.defaultOpenPanelCount)),u=(0,n.useFieldSchema)();if((0,s.useEffect)(()=>{!r.modified&&i.length&&c(M(i.length,e.defaultOpenPanelCount))},[i.length,r]),!u)throw Error("can not found schema object");return(0,l.jsxs)(x.ArrayBase,{onAdd:e=>{c(d.length<=e?d.concat(e):d.reduce((t,o)=>o<e?t.concat(o):o===e?t.concat([o,o+1]):t.concat(o+1),[]))},onRemove:()=>{r.initialValue=r.value},children:[(()=>{if(!i.length)return(0,l.jsx)(a.Card,{className:(0,y.default)(t,o,e.className),children:(0,l.jsx)(a.Empty,{})})})(),(0,l.jsx)(a.Collapse,{...e,activeKey:d,onChange:e=>c((0,f.toArr)(e).map(Number)),className:(0,y.default)(t,o,e.className),children:i.map((e,t)=>{let o,i,d,c=Array.isArray(u.items)?u.items[t]||u.items[0]:u.items,p=r.query(`${r.address}.${t}`).get("componentProps"),m=c["x-component-props"],h=(0,l.jsxs)(x.ArrayBase.Item,{index:t,record:e,children:[(0,l.jsx)(n.RecursionField,{schema:c,name:t,filterProperties:e=>!!k(e),onlyRenderProperties:!0}),null==p?void 0:p.extra]}),v=(0,l.jsx)(n.RecursionField,{schema:c,name:t,filterProperties:e=>!(_(e)||k(e))});return(0,s.createElement)(a.Collapse.Panel,{...m,...p,forceRender:!0,key:t,header:(o=`${(null==p?void 0:p.header)||m.header||r.title}`,i=r.address.concat(t),d=r.form.queryFeedbacks({type:"error",address:`${i}.**`}),(0,l.jsxs)(x.ArrayBase.Item,{index:t,record:()=>{var e;return null==(e=r.value)?void 0:e[t]},children:[(0,l.jsx)(n.RecursionField,{schema:c,name:t,filterProperties:e=>!!_(e),onlyRenderProperties:!0}),d.length?(0,l.jsx)(a.Badge,{size:"small",className:"errors-badge",count:d.length,children:o}):(0,l.jsx)(S,{item:e.initialValue||e,index:t})]})),extra:h},(0,l.jsx)(x.ArrayBase.Item,{index:t,record:e,children:v},t))})}),u.reduceProperties((e,t,o)=>C(t)?(0,l.jsx)(n.RecursionField,{schema:t,name:o}):e,null)]})},{displayName:"ArrayCollapse"}),I=e=>{let{children:t}=e;return(0,l.jsx)(s.Fragment,{children:t})};I.displayName="CollapsePanel",P.defaultProps={defaultOpenPanelCount:5},P.displayName="ArrayCollapse",P.CollapsePanel=I,x.ArrayBase.mixin(P),P.Copy=s.default.forwardRef((e,t)=>{var o;let r=(0,n.useField)(),a=x.ArrayBase.useArray(),s=x.ArrayBase.useIndex(e.index);return a&&(null==(o=a.field)?void 0:o.pattern)==="editable"?(0,l.jsx)(g.CopyOutlined,{...e,style:{transition:"all 0.25s ease-in-out",color:"rgba(0, 0, 0, 0.8)",fontSize:"16px",marginLeft:6},ref:t,onClick:t=>{var o,l;if((null==r?void 0:r.disabled)||(t.stopPropagation(),null==(o=a.props)?void 0:o.disabled))return;let n=(0,i.clone)(null==a||null==(l=a.field)?void 0:l.value[s]);a.field.push(n),e.onClick&&e.onClick(t)}}):null}),P.Copy.displayName="ArrayCollapse.Copy";var A=o(63526),T=o(99300),w=o(69412),j=o(79056);function D(e){return e?{id:{$eq:e}}:null}function L(e){let{title:t,options:o,value:n,onChange:r,...i}=e;return(0,l.jsx)(T.iU,{title:t,...i,children:(0,l.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},children:[t,(0,l.jsx)(a.Select,{popupMatchSelectWidth:!1,bordered:!1,value:n,onChange:r,options:o,style:{textAlign:"right",minWidth:100},...i})]})})}(0,n.observer)(()=>{var e,t,o,r;let{getCollectionFields:a,getCollectionField:s,getCollection:p,isTitleField:h}=(0,c.nj)(),x=(0,n.useField)(),v=(0,n.useFieldSchema)(),{t:g}=(0,d.useTranslation)(),{dn:f}=(0,m.erX)(),y=(0,m.lum)(),{formSchema:b,data:S}=v["x-designer-props"],{form:C}=(0,w.Es)(),_=x.componentProps.service.resource,k=p(_),F=a(_);if(!S)return(0,A.error)("data is required"),null;let M=F.filter(e=>h(e)).map(e=>{var t;return{value:null==e?void 0:e.name,label:y(null==e||null==(t=e.uiSchema)?void 0:t.title)||(null==e?void 0:e.name)}});return(0,l.jsxs)(T.xK,{draggable:!1,children:[(0,l.jsx)(j.Z,{collectionName:_,defaultFilter:(null==(t=S.config)||null==(e=t[_])?void 0:e.filter)||{},form:C,onSubmit:e=>{let{filter:t}=e;try{i.default.set(S,`config.${_}.filter`,(0,m.pA3)(t))}catch(e){(0,A.error)(e)}try{x.query("fieldReaction.items.*.layout.dataId").forEach(e=>{e.componentProps.service.resource===_&&(e.componentProps.service.params={filter:i.default.isEmpty(t)?{}:(0,m.pA3)((0,u.Dj)([t,D(x.value)],"$or"))})})}catch(e){(0,A.error)(e)}b["x-data-templates"]=S,f.emit("patch",{schema:{"x-uid":b["x-uid"],"x-data-templates":S}}),f.refresh()}}),(0,l.jsx)(L,{title:g("Title field"),options:M,value:(null==(r=S.config)||null==(o=r[_])?void 0:o.titleField)||(null==k?void 0:k.titleField)||"id",onChange:e=>{try{i.default.set(S,`config.${_}.titleField`,e)}catch(e){(0,A.error)(e)}try{x.query("fieldReaction.items.*.layout.dataId").forEach(t=>{t.componentProps.service.resource===_&&(t.componentProps.fieldNames.label=e,t.componentProps.targetField=s(`${_}.${e||(null==k?void 0:k.titleField)||"id"}`))})}catch(e){console.error(e)}b["x-data-templates"]=S;let t={"x-uid":b["x-uid"],"x-data-templates":S};f.emit("patch",{schema:t}),f.refresh()}},"title-field")]})},{displayName:"Designer"});var R=o(57593),Y=o(45239);let B=(0,n.connect)(a.Tree,(0,n.mapProps)({value:"checkedKeys",dataSource:"treeData"}));B.displayName="Tree";let N=(e,t)=>null==e?void 0:e.map(e=>{let{dataId:o,...l}=e,n={...l};if(o){var r;n.dataScope={$and:[{id:{$eq:o}}]},n.titleField=(null==n?void 0:n.titleField)||(null==t||null==(r=t[e.collection])?void 0:r.titleField)||"id"}return n}),E=(0,p.T)((0,n.observer)(e=>{let{formSchema:t,designerCtx:o,defaultValues:n,collectionName:a}=(0,m.YYe)(e),{collectionList:p,getEnableFieldTree:x,getOnLoadData:g,getOnCheck:f,getScopeDataSource:y,useTitleFieldDataSource:b}=(0,R.l)(a),{getCollection:S,getCollectionField:C}=(0,c.nj)(),{t:_}=(0,d.useTranslation)(),k=(0,s.useMemo)(()=>(0,r.observable)({...n,items:N((null==n?void 0:n.items)||[],null==n?void 0:n.config)}),[]),F=e=>{var t;let o=S(e);return C(`${e}.${(null==k||null==(t=k.config[e])?void 0:t.titleField)||(null==o?void 0:o.titleField)||"id"}`)},M=e=>{var t,o;let l=S(e);return{label:(null==(o=k.config)||null==(t=o[e])?void 0:t.titleField)||(null==l?void 0:l.titleField)||"id",value:"id"}},I=(e,t)=>{var o,l;let n=null==(l=k.config)||null==(o=l[e])?void 0:o.filter;return i.default.isEmpty(n)?{}:(0,m.pA3)((0,u.Dj)([n,D(t)],"$or"))},A=(0,s.useMemo)(()=>({ArrayCollapse:P}),[]),T=(0,s.useMemo)(()=>({getEnableFieldTree:x,getTargetField:F,getFieldNames:M,getFilter:I,getResource:z,getOnLoadData:g,getOnCheck:f,collectionName:a,getScopeDataSource:y,useTitleFieldDataSource:b}),[]),w=(0,s.useMemo)(()=>({type:"object",properties:{items:{type:"array",default:null==k?void 0:k.items,"x-component":"ArrayCollapse","x-decorator":"FormItem","x-component-props":{accordion:!0},items:{type:"object","x-component":"ArrayCollapse.CollapsePanel","x-component-props":{extra:[(0,l.jsx)(v,{},"0")]},properties:{layout:{type:"void","x-component":"FormLayout","x-component-props":{layout:"vertical"},properties:{collection:{type:"string",title:'{{ t("Collection") }}',required:!0,description:_("If collection inherits, choose inherited collections as templates"),default:"{{ collectionName }}","x-display":p.length>1?"visible":"hidden","x-decorator":"FormItem","x-component":"Select","x-component-props":{options:p}},dataScope:{type:"object",title:'{{ t("Filter out a single piece or a group of records as a template") }}',"x-decorator":"FormItem","x-component":"Filter","x-component-props":{dynamicComponent:h.P8},"x-decorator-props":{style:{marginBottom:"0px"}},required:!0,"x-reactions":[{dependencies:[".collection"],fulfill:{state:{disabled:"{{ !$deps[0] }}"},schema:{enum:"{{ getScopeDataSource($deps[0]) }}"}}}]},titleField:{type:"string","x-decorator":"FormItem",title:'{{ t("Title field") }}',"x-decorator-props":{tooltip:'{{t("The title field is used to identify the template record")}}'},"x-component":"Select",required:!0,"x-reactions":"{{useTitleFieldDataSource}}"},syncFromForm:{type:"void",title:'{{ t("Sync from form fields") }}',"x-component":"Action.Link","x-component-props":{type:"primary",style:{float:"right",position:"relative",zIndex:1200},useAction:()=>(0,Y.r)(t)}},fields:{type:"array",title:'{{ t("Template fields") }}',"x-decorator-props":{tooltip:'{{t("The selected fields will automatically populate the form")}}'},required:!0,description:_("Only the selected fields will be used as the initialization data for the form"),"x-decorator":"FormItem","x-component":B,"x-component-props":{treeData:[],checkable:!0,checkStrictly:!0,selectable:!1,loadData:"{{ getOnLoadData($self) }}",onCheck:"{{ getOnCheck($self) }}",rootStyle:{padding:"8px 0",border:"1px solid #d9d9d9",borderRadius:"2px",maxHeight:"30vh",overflow:"auto",margin:"2px 0"}},"x-reactions":[{dependencies:[".collection"],fulfill:{state:{disabled:"{{ !$deps[0] }}",componentProps:{treeData:"{{ getEnableFieldTree($deps[0], $self) }}"}}}}]}}},remove:{type:"void","x-component":"ArrayCollapse.Remove"},moveUp:{type:"void","x-component":"ArrayCollapse.MoveUp"},moveDown:{type:"void","x-component":"ArrayCollapse.MoveDown"}}},properties:{add:{type:"void",title:'{{ t("Add template") }}',"x-component":"ArrayCollapse.Addition"}}},display:{type:"boolean","x-content":'{{ t("Enable form data template") }}',default:(null==k?void 0:k.display)!==!1,"x-decorator":"FormItem","x-component":"Checkbox"}}}),[]);return(0,l.jsx)(m.u4V.Provider,{value:{...o,designable:!0},children:(0,l.jsx)(m.HvB,{components:A,scope:T,schema:w})})}),{displayName:"FormDataTemplates"});function z(e,t){return e!==t.componentProps.service.resource&&(t.value=void 0),e}},98548(e,t,o){o.d(t,{n:()=>r});var l=o(71178),n=o(52793);o(51649);let r=e=>{let{tag:t,type:o,displayType:r=!0}=e;return(0,l.jsx)("div",{children:(0,l.jsxs)(n.Tag,{color:{reference:"blue",duplicate:"green",preloading:"cyan"}[o],children:[(0,l.jsx)("span",{children:t})," ",r?`(${({reference:"Reference",duplicate:"Duplicate",preloading:"Preloading"})[o]})`:""]})})}},57593(e,t,o){o.d(t,{K:()=>s,l:()=>d});var l=o(56920),n=o(51649),r=o(43288),a=o(82924),i=o(98548);let s=["sort","createdById","createdBy","createdAt","updatedById","updatedBy","updatedAt","password","sequence"],d=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],o=arguments.length>2?arguments[2]:void 0,{getCollectionFields:d,getAllCollectionsInheritChain:u,getCollection:p,getInterface:m}=(0,r.nj)(),[h]=(0,n.useState)(function(){return(u(e)||[]).map(e=>{var t;return{label:null==(t=p(e))?void 0:t.title,value:e}})}),x=(0,a.lum)(),v=(0,l.useField)(),g=(e,l)=>{let{exclude:r=[],depth:a=0,maxDepth:c,prefix:u=""}=l;return a>c?[]:d(e).map(e=>{var l;if(r.includes(e.name)||!e.interface||0===a&&["sort","password","sequence"].includes(e.type)||o&&o(e))return;let d={type:"duplicate",tag:x(null==(l=e.uiSchema)?void 0:l.title)||e.name},p={...d,role:"button",title:n.default.createElement(i.n,{...d,displayType:t}),key:u?`${u}.${e.name}`:e.name,isLeaf:!0,field:e};return["belongsTo","belongsToMany"].includes(e.type)?(d.type="reference",p.type="reference",p.title=n.default.createElement(i.n,{...d,type:"reference",displayType:t}),p.isLeaf=!1,p.children=f(e.target,{depth:a+1,maxDepth:c,prefix:p.key,exclude:s})):["hasOne","hasMany"].includes(e.type)&&(p.isLeaf=!1,p.children=g(e.target,{depth:a+1,maxDepth:c,prefix:p.key,exclude:["id",...s.filter(e=>"sort"!==e)]})),p}).filter(Boolean)},f=(e,o)=>{let{prefix:l,maxDepth:r,depth:a=0,exclude:s=[]}=o;return a>r?[]:d(e).map(e=>{var o;if(!e.target||!e.interface||s.includes(e.name))return;let d={type:"preloading",tag:x(null==(o=e.uiSchema)?void 0:o.title)||e.name},c=l?`${l}.${e.name}`:e.name;return{role:"button",title:n.default.createElement(i.n,{...d,displayType:t}),key:c,isLeaf:!1,field:e,children:f(e.target,{prefix:c,depth:a+1,maxDepth:r,exclude:s})}}).filter(Boolean)},y=e=>e.map(e=>({...e,role:"button",title:n.default.createElement(i.n,{...e,type:e.type,displayType:t}),children:e.children?y(e.children):null}));return{collectionList:h,getEnableFieldTree:(0,n.useCallback)((e,t,o)=>{var l,n;let r=t.index,a=null==(n=v.initialValue)||null==(l=n.items)?void 0:l[r];if(!e)return[];if((null==a?void 0:a.treeData)||o)return y(o||a.treeData);try{return g(e,{exclude:["id",...s],maxDepth:1})}catch(e){return console.error(e),[]}},[]),getOnLoadData:(0,n.useCallback)(e=>t=>new Promise(o=>{if(t.children.length)return t.children.forEach(t=>{c({node:t,traverseAssociations:f,traverseFields:g,systemKeys:s,fields:e})}),o(void 0);c({node:t,traverseAssociations:f,traverseFields:g,systemKeys:s,fields:e}),o(void 0)}),[]),getOnCheck:(0,n.useCallback)(e=>t=>{e.value=t},[]),getScopeDataSource:e=>{let t=d(e),o=(e,t)=>{let l=[];return e.forEach(e=>{let n=((e,t)=>{var l,n;if(!e.interface)return;let r=m(e.interface);if(!(null==r?void 0:r.filterable))return;let{nested:a,children:i,operators:s}=r.filterable,c={name:e.name,title:(null==e||null==(l=e.uiSchema)?void 0:l.title)||e.name,schema:null==e?void 0:e.uiSchema,operators:(null==s||null==(n=s.filter)?void 0:n.call(s,t=>!(null==t?void 0:t.visible)||t.visible(e)))||[],interface:e.interface};if(!e.target||!(t>2)){if(t>2)return c;if((null==i?void 0:i.length)&&(c.children=i),a){let l=o(d(e.target),t+1).filter(Boolean);c.children=c.children||[],c.children.push(...l)}return c}})(e,t);n&&l.push(n)}),l};return o(t,1)},useTitleFieldDataSource:e=>{let t=e.path.entire.replace("titleField","collection"),o=d(e.query(t).get("value")).filter(e=>{var t;return null==(t=m(e.interface))?void 0:t.titleUsable}).map(e=>{var t;return{value:null==e?void 0:e.name,label:x(null==e||null==(t=e.uiSchema)?void 0:t.title)||(null==e?void 0:e.name)}});e.dataSource=o}}};function c(e){let{node:t,traverseAssociations:o,traverseFields:l,systemKeys:n,fields:r}=e,a=function(e,t){let o=[...e];for(;o.length;){let e=o.shift();if(e.key===t.key)return e;e.children&&o.push(...e.children)}}(r.dataSource||r.componentProps.treeData,t),i=[];return["belongsTo","belongsToMany"].includes(t.field.type)&&(null==t?void 0:t.type)==="reference"?i=o(t.field.target,{exclude:n,prefix:t.key,maxDepth:1}):(["hasOne","hasMany"].includes(t.field.type)||(null==t?void 0:t.type)==="duplicate")&&(i=l(t.field.target,{exclude:["id",...n.filter(e=>"sort"!==e)],prefix:t.key,maxDepth:1})),i.length?a.children=i:a.isLeaf=!0,i}},45239(e,t,o){o.d(t,{r:()=>m});var l=o(56220),n=o(56920),r=o(52793),a=o(51649),i=o(77843),s=o(73761),d=o(43288),c=o(82924),u=o(98548),p=o(57593);let m=(e,t,o)=>{let m,h,{getCollectionJoinField:x,getCollectionFields:v}=(0,d.nj)(),g=l.ArrayBase.useArray(),f=l.ArrayBase.useIndex(),y=l.ArrayBase.useRecord(),b=(0,c.lum)(),{t:S}=(0,i.useTranslation)(),C=(0,n.useForm)(),_=(m=new ew.LRUCache({max:100}),(e,t,o)=>{let{exclude:l=[],depth:n=0,maxDepth:r,prefix:i="",disabled:s=!1}=t,d=`${e}-${l.join(",")}-${n}-${r}-${i}`,c=m.get(d);if(c)return c;if(n>r)return[];let h=v(e).map(e=>{var t;if(l.includes(e.name)||!e.interface||["sort","password","sequence"].includes(e.type))return;let d={type:"duplicate",tag:b(null==(t=e.uiSchema)?void 0:t.title)||e.name},c={...d,title:a.default.createElement(u.n,d),key:i?`${i}.${e.name}`:e.name,isLeaf:!0,field:e,disabled:s},m=o.find(e=>e.name===c.key);if(["belongsTo","belongsToMany"].includes(e.type)&&(!m||["Select","Picker"].includes(null==m?void 0:m.fieldMode)))d.type="reference",c.type="reference",c.title=a.default.createElement(u.n,{...d,type:"reference"}),c.isLeaf=!1,c.children=k(e.target,{depth:n+1,maxDepth:r,prefix:c.key,exclude:p.K});else if(["hasOne","hasMany"].includes(e.type)||["Nester","SubTable"].includes(null==m?void 0:m.fieldMode)){let t=!1;["hasOne","hasMany"].includes(e.type)&&["Select","Picker"].includes(null==m?void 0:m.fieldMode)&&(t=!0),c.disabled=!0,c.isLeaf=!1,c.children=_(e.target,{depth:n+1,maxDepth:r,prefix:c.key,exclude:["id",...p.K],disabled:t},o)}return c}).filter(Boolean);return m.set(d,h),h}),k=(h=new ew.LRUCache({max:100}),(e,t)=>{let{prefix:o,maxDepth:l,depth:n=0,exclude:r=[]}=t,i=`${e}-${r.join(",")}-${n}-${l}-${o}`,s=h.get(i);if(s)return s;if(n>l)return[];let d=v(e).map(e=>{var t,i;if(!e.target||!e.interface||r.includes(e.name))return;let s={type:"preloading",tag:b(null==(t=e.uiSchema)?void 0:t.title)||e.name},d=o?`${o}.${e.name}`:e.name;return{type:"preloading",tag:b(null==(i=e.uiSchema)?void 0:i.title)||e.name,title:a.default.createElement(u.n,s),key:d,isLeaf:!1,field:e,children:k(e.target,{prefix:d,depth:n+1,maxDepth:l,exclude:r})}}).filter(Boolean);return h.set(i,d),d}),F=(0,a.useCallback)((e,t)=>{if(!e)return[];try{return _(e,{exclude:["id",...p.K],maxDepth:1,disabled:!1},t)}catch(e){return console.error(e),[]}},[]);return{async run(){let l=new Set([]),n=new Set([]),a=(e,t)=>{var o;null==e||null==(o=e.reduceProperties)||o.call(e,(e,o)=>{var r,i,d;let c=e||t,u=o["x-collection-field"]&&x(o["x-collection-field"]),p=o.name.includes("."),m=u&&["hasOne","hasMany","belongsTo","belongsToMany"].includes(u.type),h=!m&&p?(0,s.getAssociationPath)(o.name):o.name,v=""!==c&&c?c+"."+h:h;if(u&&!(["hasOne","hasMany"].includes(u.type)||["SubForm","Nester"].includes(null==(r=o["x-component-props"])?void 0:r.mode))&&n.add(v),u&&(m||p)&&"TableField"!==o["x-component"]){if(l.add({name:v,fieldMode:(null==(i=o["x-component-props"])?void 0:i.mode)||"Select"}),["Nester","SubTable"].includes(null==(d=o["x-component-props"])?void 0:d.mode)){let e=c&&""!==c?c+"."+o.name:o.name;a(o,e)}}else["ActionBar","Action","Action.Link","Action.Modal","Selector","Viewer","AddNewer","AssociationField.Selector","AssociationField.AddNewer","TableField"].includes(o["x-component"])||a(o,t)},t)};a(e,"");let i=F((null==y?void 0:y.collection)||t,[...l]);if(o)o(i,[...n],C);else{var d;null==g||g.field.form.query(`fieldReaction.items.${f}.layout.fields`).take(e=>{e.componentProps.treeData=[],setTimeout(()=>e.componentProps.treeData=i)}),null==g||g.field.value.splice(f,1,{...null==g||null==(d=g.field)?void 0:d.value[f],fields:[...n],treeData:i})}r.message.success(S("Sync successfully"))}}}},23620(e,t,o){o.d(t,{Bw:()=>w,Oy:()=>T,xK:()=>I});var l=o(71178),n=o(82113),r=o(10691),a=o(56920),i=o(52793),s=o(94046),d=o(51649),c=o(77843),u=o(73907),p=o(69127),m=o(7195),h=o(14669),x=o(23460),v=o(30644),g=o(87382),f=o(63557),y=o(61013),b=o(95951),S=o(29358),C=o(81936),_=o(77490),k=o(77235);let F=(0,o(54944).f)("nb-schema-toolbar",e=>{let{componentCls:t}=e;return{[t]:{position:"absolute",zIndex:999,top:0,left:0,right:0,bottom:0,border:"2px solid var(--colorBorderSettingsHover)",background:"var(--colorBgSettingsHover)",pointerEvents:"none",transitionDelay:"0.1s","&.nb-in-template":{background:"var(--colorTemplateBgSettingsHover)"},"&.hidden":{transform:"scale(0)",pointerEvents:"none"},"&.hidden-e2e":{display:"none"},".ant-space-item .anticon":{margin:0},".toolbar-title":{pointerEvents:"none",position:"absolute",fontSize:12,padding:0,lineHeight:"16px",height:"16px",borderBottomRightRadius:2,borderRadius:2,top:2,left:2},".toolbar-title-tag":{padding:"0 3px",borderRadius:2,background:"var(--colorSettings)",color:"#fff",display:"block"},".toolbar-icons":{position:"absolute",right:"2px",top:"2px",lineHeight:"16px",pointerEvents:"all",".ant-space-item":{backgroundColor:"var(--colorSettings)",color:"#fff",lineHeight:"16px",width:"16px",paddingLeft:"1px",alignSelf:"stretch"}}}}}),M=(0,r.css)`
|
|
1698
1698
|
pointer-events: none;
|
|
1699
1699
|
position: absolute;
|
|
1700
1700
|
font-size: 12px;
|