@nocobase/app 2.1.15 → 2.1.17

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.
@@ -1,4 +1,4 @@
1
- /*! For license information please see index-ce3b8966.js.LICENSE.txt */
1
+ /*! For license information please see index-1ae58419.js.LICENSE.txt */
2
2
  (globalThis.webpackChunknocobase=globalThis.webpackChunknocobase||[]).push([["8410"],{65359(e,t,l){var n={"./en-nz":["35571","8878"],"./bi.js":["95944","8878"],"./id.js":["87420","8878"],"./km":["36101","8878"],"./he.js":["92010","8878"],"./me":["80623","8878"],"./tk":["62544","8878"],"./ko.js":["88003","8878"],"./tet.js":["18928","8878"],"./es-do":["61219","8878"],"./ku":["16605","8878"],"./hr":["15811","8878"],"./zh-tw.js":["31349","8878"],"./hy-am":["94309","8878"],"./am.js":["4736","8878"],"./en-in":["60912","8878"],"./de-at":["32878","8878"],"./pt-br":["92218","8878"],"./ar-iq.js":["13309","8878"],"./en-sg":["12673","8878"],"./zh":["56007","8878"],"./en-il.js":["97690","8878"],"./lo":["73860","8878"],"./tlh":["60321","8878"],"./mi.js":["32739","8878"],"./el":["54072","8878"],"./ur.js":["51750","8878"],"./sq":["95977","8878"],"./pa-in.js":["39252","8878"],"./ar-kw.js":["79865","8878"],"./fr-ca.js":["86290","8878"],"./de-ch.js":["13672","8878"],"./ru":["62796","8878"],"./eo.js":["33713","8878"],"./nb":["7205","8878"],"./br":["72745","8878"],"./fo":["17674","8878"],"./zh.js":["56007","8878"],"./vi":["96098","8878"],"./fr-ch.js":["73433","8878"],"./ms-my":["26400","8878"],"./es-pr":["3532","8878"],"./bo.js":["59294","8878"],"./ht.js":["8809","8878"],"./lo.js":["73860","8878"],"./my.js":["46803","8878"],"./et":["4288","8878"],"./br.js":["72745","8878"],"./gu":["57409","8878"],"./it-ch":["19286","8878"],"./sv-fi":["9160","8878"],"./ne.js":["40880","8878"],"./zh-cn.js":["16033"],"./gom-latn.js":["78660","8878"],"./bg.js":["39990","8878"],"./mr.js":["46462","8878"],"./cv.js":["4780","8878"],"./lt.js":["34485","8878"],"./pt":["72369","8878"],"./th.js":["47081","8878"],"./cs.js":["9751","8878"],"./es.js":["47317","8878"],"./bn.js":["92509","8878"],"./ar-tn":["54405","8878"],"./mi":["32739","8878"],"./sr.js":["45616","8878"],"./tr":["4895","8878"],"./bn-bd":["64608","8878"],"./fa.js":["90292","8878"],"./it":["33900","8878"],"./nl":["69423","8878"],"./zh-hk":["87741","8878"],"./fo.js":["17674","8878"],"./bs.js":["25530","8878"],"./ja.js":["50952","8878"],"./my":["46803","8878"],"./es-do.js":["61219","8878"],"./gl":["33562","8878"],"./nl-be.js":["60465","8878"],"./en-ca.js":["21995","8878"],"./tzm-latn.js":["58804","8878"],"./types.d.ts":["69224","8878"],"./ru.js":["62796","8878"],"./sq.js":["95977","8878"],"./cv":["4780","8878"],"./km.js":["36101","8878"],"./fa":["90292","8878"],"./cs":["9751","8878"],"./ms":["79677","8878"],"./types.d":["69224","8878"],"./ca":["25993","8878"],"./tr.js":["4895","8878"],"./x-pseudo":["5760","8878"],"./tzm-latn":["58804","8878"],"./kn":["6364","8878"],"./jv":["77741","8878"],"./ms-my.js":["26400","8878"],"./ht":["8809","8878"],"./be":["51532","8878"],"./gd":["68418","8878"],"./en-au":["59881","8878"],"./ka":["46481","8878"],"./ka.js":["46481","8878"],"./ur":["51750","8878"],"./sv.js":["21340","8878"],"./zh-cn":["16033"],"./pl.js":["63225","8878"],"./hi":["52830","8878"],"./ug-cn":["79911","8878"],"./ar-kw":["79865","8878"],"./dv.js":["82187","8878"],"./id":["87420","8878"],"./dv":["82187","8878"],"./vi.js":["96098","8878"],"./de-ch":["13672","8878"],"./en-in.js":["60912","8878"],"./es-pr.js":["3532","8878"],"./es-us.js":["32498","8878"],"./ar-iq":["13309","8878"],"./fi.js":["89964","8878"],"./ca.js":["25993","8878"],"./ms.js":["79677","8878"],"./zh-tw":["31349","8878"],"./bs":["25530","8878"],"./rw.js":["35414","8878"],"./fy":["59836","8878"],"./uz-latn":["80950","8878"],"./mt.js":["99464","8878"],"./fr.js":["813","8878"],"./hu":["38298","8878"],"./lv.js":["76467","8878"],"./sr-cyrl.js":["27439","8878"],"./tzl":["3187","8878"],"./mn":["12698","8878"],"./pa-in":["39252","8878"],"./nl-be":["60465","8878"],"./kk":["11335","8878"],"./en-tt":["2619","8878"],"./ar-ly.js":["85592","8878"],"./hr.js":["15811","8878"],"./kk.js":["11335","8878"],"./ar":["2338","8878"],"./ar-dz.js":["48361","8878"],"./ar-sa":["40539","8878"],"./nl.js":["69423","8878"],"./cy":["95681","8878"],"./en-ie":["17329","8878"],"./lb.js":["88615","8878"],"./ar-ly":["85592","8878"],"./de.js":["50494","8878"],"./am":["4736","8878"],"./lv":["76467","8878"],"./tg":["15012","8878"],"./de-at.js":["32878","8878"],"./sl":["39998","8878"],"./tg.js":["15012","8878"],"./ky.js":["34457","8878"],"./kn.js":["6364","8878"],"./bo":["59294","8878"],"./da":["42706","8878"],"./ss.js":["52487","8878"],"./uz":["54734","8878"],"./fr-ch":["73433","8878"],"./sk":["46847","8878"],"./hu.js":["38298","8878"],"./sr":["45616","8878"],"./he":["92010","8878"],"./uk.js":["34173","8878"],"./es-mx":["64719","8878"],"./se.js":["55285","8878"],"./oc-lnc":["70225","8878"],"./pt-br.js":["92218","8878"],"./rw":["35414","8878"],"./ar-sa.js":["40539","8878"],"./nb.js":["7205","8878"],"./fr-ca":["86290","8878"],"./hi.js":["52830","8878"],"./gl.js":["33562","8878"],"./en-ie.js":["17329","8878"],"./me.js":["80623","8878"],"./fy.js":["59836","8878"],"./ar.js":["2338","8878"],"./az":["51130","8878"],"./lt":["34485","8878"],"./en":["65826","8878"],"./ro.js":["24334","8878"],"./sw":["2979","8878"],"./te.js":["87406","8878"],"./tl-ph.js":["78142","8878"],"./es-mx.js":["64719","8878"],"./ky":["34457","8878"],"./it.js":["33900","8878"],"./zh-hk.js":["87741","8878"],"./da.js":["42706","8878"],"./te":["87406","8878"],"./mt":["99464","8878"],"./lb":["88615","8878"],"./uz-latn.js":["80950","8878"],"./ml.js":["75376","8878"],"./en-sg.js":["12673","8878"],"./uz.js":["54734","8878"],"./tzm.js":["95084","8878"],"./tet":["18928","8878"],"./oc-lnc.js":["70225","8878"],"./az.js":["51130","8878"],"./en-au.js":["59881","8878"],"./fr":["813","8878"],"./gd.js":["68418","8878"],"./yo.js":["87933","8878"],"./nn":["23473","8878"],"./bm":["71092","8878"],"./index.d.ts":["41213","8878"],"./sw.js":["2979","8878"],"./af":["65662","8878"],"./en-il":["97690","8878"],"./eu":["94007","8878"],"./et.js":["4288","8878"],"./rn":["34509","8878"],"./se":["55285","8878"],"./sv-fi.js":["9160","8878"],"./gu.js":["57409","8878"],"./gom-latn":["78660","8878"],"./pl":["63225","8878"],"./ar-dz":["48361","8878"],"./ar-ma":["81289","8878"],"./eu.js":["94007","8878"],"./ss":["52487","8878"],"./tk.js":["62544","8878"],"./es-us":["32498","8878"],"./bi":["95944","8878"],"./ug-cn.js":["79911","8878"],"./mn.js":["12698","8878"],"./pt.js":["72369","8878"],"./cy.js":["95681","8878"],"./mr":["46462","8878"],"./ga.js":["54061","8878"],"./ko":["88003","8878"],"./ku.js":["16605","8878"],"./af.js":["65662","8878"],"./hy-am.js":["94309","8878"],"./es":["47317","8878"],"./ml":["75376","8878"],"./en-ca":["21995","8878"],"./bn":["92509","8878"],"./ga":["54061","8878"],"./is.js":["15513","8878"],"./sd.js":["63222","8878"],"./sl.js":["39998","8878"],"./tlh.js":["60321","8878"],"./tl-ph":["78142","8878"],"./uk":["34173","8878"],"./x-pseudo.js":["5760","8878"],"./is":["15513","8878"],"./jv.js":["77741","8878"],"./el.js":["54072","8878"],"./fi":["89964","8878"],"./bn-bd.js":["64608","8878"],"./en-gb":["72026","8878"],"./en-gb.js":["72026","8878"],"./mk":["75877","8878"],"./ne":["40880","8878"],"./ro":["24334","8878"],"./mk.js":["75877","8878"],"./si":["65665","8878"],"./tzm":["95084","8878"],"./be.js":["51532","8878"],"./de":["50494","8878"],"./rn.js":["34509","8878"],"./si.js":["65665","8878"],"./yo":["87933","8878"],"./bg":["39990","8878"],"./en.js":["65826","8878"],"./sv":["21340","8878"],"./th":["47081","8878"],"./bm.js":["71092","8878"],"./nn.js":["23473","8878"],"./ar-ma.js":["81289","8878"],"./index.d":["41213","8878"],"./ja":["50952","8878"],"./ta.js":["77250","8878"],"./ar-tn.js":["54405","8878"],"./sd":["63222","8878"],"./sk.js":["46847","8878"],"./tzl.js":["3187","8878"],"./en-nz.js":["35571","8878"],"./eo":["33713","8878"],"./ta":["77250","8878"],"./en-tt.js":["2619","8878"],"./it-ch.js":["19286","8878"],"./sr-cyrl":["27439","8878"]};function o(e){if(!l.o(n,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],o=t[0];return Promise.all(t.slice(1).map(l.e)).then(function(){return l.t(o,23)})}o.keys=()=>Object.keys(n),o.id=65359,e.exports=o},35358(e,t,l){var n={"./af":"25177","./af.js":"25177","./ar":"61509","./ar-dz":"41488","./ar-dz.js":"41488","./ar-kw":"58676","./ar-kw.js":"58676","./ar-ly":"42353","./ar-ly.js":"42353","./ar-ma":"24496","./ar-ma.js":"24496","./ar-sa":"82682","./ar-sa.js":"82682","./ar-tn":"89756","./ar-tn.js":"89756","./ar.js":"61509","./az":"95533","./az.js":"95533","./be":"28959","./be.js":"28959","./bg":"47777","./bg.js":"47777","./bm":"54903","./bm.js":"54903","./bn":"61290","./bn-bd":"17357","./bn-bd.js":"17357","./bn.js":"61290","./bo":"31545","./bo.js":"31545","./br":"11470","./br.js":"11470","./bs":"44429","./bs.js":"44429","./ca":"7306","./ca.js":"7306","./cs":"56464","./cs.js":"56464","./cv":"73635","./cv.js":"73635","./cy":"64226","./cy.js":"64226","./da":"93601","./da.js":"93601","./de":"77853","./de-at":"26111","./de-at.js":"26111","./de-ch":"54697","./de-ch.js":"54697","./de.js":"77853","./dv":"60708","./dv.js":"60708","./el":"54691","./el.js":"54691","./en-au":"53872","./en-au.js":"53872","./en-ca":"28298","./en-ca.js":"28298","./en-gb":"56195","./en-gb.js":"56195","./en-ie":"66584","./en-ie.js":"66584","./en-il":"65543","./en-il.js":"65543","./en-in":"9033","./en-in.js":"9033","./en-nz":"79402","./en-nz.js":"79402","./en-sg":"43004","./en-sg.js":"43004","./eo":"32934","./eo.js":"32934","./es":"97650","./es-do":"20838","./es-do.js":"20838","./es-mx":"17730","./es-mx.js":"17730","./es-us":"56575","./es-us.js":"56575","./es.js":"97650","./et":"3035","./et.js":"3035","./eu":"3508","./eu.js":"3508","./fa":"119","./fa.js":"119","./fi":"90527","./fi.js":"90527","./fil":"95995","./fil.js":"95995","./fo":"52477","./fo.js":"52477","./fr":"85498","./fr-ca":"26435","./fr-ca.js":"26435","./fr-ch":"37892","./fr-ch.js":"37892","./fr.js":"85498","./fy":"37071","./fy.js":"37071","./ga":"41734","./ga.js":"41734","./gd":"70217","./gd.js":"70217","./gl":"77329","./gl.js":"77329","./gom-deva":"32124","./gom-deva.js":"32124","./gom-latn":"93383","./gom-latn.js":"93383","./gu":"95050","./gu.js":"95050","./he":"11713","./he.js":"11713","./hi":"43861","./hi.js":"43861","./hr":"26308","./hr.js":"26308","./hu":"90609","./hu.js":"90609","./hy-am":"17160","./hy-am.js":"17160","./id":"74063","./id.js":"74063","./is":"89374","./is.js":"89374","./it":"88383","./it-ch":"21827","./it-ch.js":"21827","./it.js":"88383","./ja":"23827","./ja.js":"23827","./jv":"89722","./jv.js":"89722","./ka":"41794","./ka.js":"41794","./kk":"27088","./kk.js":"27088","./km":"96870","./km.js":"96870","./kn":"84451","./kn.js":"84451","./ko":"63164","./ko.js":"63164","./ku":"98174","./ku.js":"98174","./ky":"78474","./ky.js":"78474","./lb":"79680","./lb.js":"79680","./lo":"15867","./lo.js":"15867","./lt":"45766","./lt.js":"45766","./lv":"69532","./lv.js":"69532","./me":"58076","./me.js":"58076","./mi":"41848","./mi.js":"41848","./mk":"30306","./mk.js":"30306","./ml":"73739","./ml.js":"73739","./mn":"99053","./mn.js":"99053","./mr":"86169","./mr.js":"86169","./ms":"73386","./ms-my":"92297","./ms-my.js":"92297","./ms.js":"73386","./mt":"77075","./mt.js":"77075","./my":"72264","./my.js":"72264","./nb":"22274","./nb.js":"22274","./ne":"8235","./ne.js":"8235","./nl":"92572","./nl-be":"43784","./nl-be.js":"43784","./nl.js":"92572","./nn":"54566","./nn.js":"54566","./oc-lnc":"69330","./oc-lnc.js":"69330","./pa-in":"29849","./pa-in.js":"29849","./pl":"94418","./pl.js":"94418","./pt":"79834","./pt-br":"48303","./pt-br.js":"48303","./pt.js":"79834","./ro":"24457","./ro.js":"24457","./ru":"82271","./ru.js":"82271","./sd":"1221","./sd.js":"1221","./se":"33478","./se.js":"33478","./si":"17538","./si.js":"17538","./sk":"5784","./sk.js":"5784","./sl":"46637","./sl.js":"46637","./sq":"86794","./sq.js":"86794","./sr":"45719","./sr-cyrl":"3322","./sr-cyrl.js":"3322","./sr.js":"45719","./ss":"56000","./ss.js":"56000","./sv":"41011","./sv.js":"41011","./sw":"40748","./sw.js":"40748","./ta":"11025","./ta.js":"11025","./te":"11885","./te.js":"11885","./tet":"28861","./tet.js":"28861","./tg":"86571","./tg.js":"86571","./th":"55802","./th.js":"55802","./tk":"59527","./tk.js":"59527","./tl-ph":"29231","./tl-ph.js":"29231","./tlh":"31052","./tlh.js":"31052","./tr":"85096","./tr.js":"85096","./tzl":"79846","./tzl.js":"79846","./tzm":"81765","./tzm-latn":"97711","./tzm-latn.js":"97711","./tzm.js":"81765","./ug-cn":"48414","./ug-cn.js":"48414","./uk":"16618","./uk.js":"16618","./ur":"57777","./ur.js":"57777","./uz":"57609","./uz-latn":"72475","./uz-latn.js":"72475","./uz.js":"57609","./vi":"21135","./vi.js":"21135","./x-pseudo":"64051","./x-pseudo.js":"64051","./yo":"82218","./yo.js":"82218","./zh-cn":"52648","./zh-cn.js":"52648","./zh-hk":"1632","./zh-hk.js":"1632","./zh-mo":"31541","./zh-mo.js":"31541","./zh-tw":"50304","./zh-tw.js":"50304"};function o(e){return l(r(e))}function r(e){if(!l.o(n,e)){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}o.keys=function(){return Object.keys(n)},o.resolve=r,e.exports=o,o.id=35358},81515(e,t,l){"use strict";let n,o;var r={};l.r(r),l.d(r,{APIClient:()=>$,Auth:()=>R,BaseStorage:()=>E,LocalStorage:()=>D,MemoryStorage:()=>N,SessionStorage:()=>B,getSubAppName:()=>O,hasHeaderValue:()=>T});var i={};l.r(i),l.d(i,{default:()=>rU,evaluators:()=>rz,getOptions:()=>rK});var a={};l.r(a),l.d(a,{array:()=>il,bigField:()=>im,boolean:()=>iu,collection:()=>ip,datetime:()=>ir,enumType:()=>is,id:()=>ia,number:()=>ii,object:()=>io,string:()=>it,tableoid:()=>ic,time:()=>id});var s={};l.r(s),l.d(s,{connectFields:()=>mj,customizeFilterRender:()=>mO,defaultOperator:()=>mN,operatorComponentProps:()=>m_});var d={};l.r(d),l.d(d,{ASSIGN_FIELD_VALUES_STEP_KEY:()=>us.zL,ActionGroupModel:()=>s_,ActionModel:()=>sz.S0,ActionSceneEnum:()=>sz.s5,ActionWithoutPermission:()=>sz._T,AddChildActionModel:()=>u$,AddNewActionModel:()=>dG,AssignFormGridModel:()=>uz,AssignFormItemModel:()=>cl,AssignFormModel:()=>u_,AssociateActionModel:()=>d5,AssociationFieldGroupModel:()=>sK,AssociationFieldModel:()=>cy,BasePageTabModel:()=>d_,BlockGridModel:()=>dw,BlockModel:()=>dS.z,BlockSceneEnum:()=>dS.P,BulkDeleteActionModel:()=>d4,CascadeSelectFieldModel:()=>gz,CascadeSelectInnerFieldModel:()=>gL,CascadeSelectListFieldModel:()=>gK,CheckboxFieldModel:()=>vs,CheckboxGroupFieldModel:()=>vd,ChildPageModel:()=>dN,ChildPageTabModel:()=>dV,ClickableFieldModel:()=>gj,CollectionActionGroupModel:()=>sL,CollectionActionModel:()=>dC.U,CollectionBlockModel:()=>dF.t,CollectionSelectorFieldModel:()=>vp,ColorFieldModel:()=>vf,CommonItemModel:()=>dk,CreateContent:()=>cL,CreateFormModel:()=>mV,CustomWidth:()=>hT,DataBlockModel:()=>dA.R,DateOnlyFieldModel:()=>vk,DateOnlyFilterFieldModel:()=>c2,DateOnlyPicker:()=>vF,DateTimeFilterFieldModel:()=>c0,DateTimeNoTzFieldModel:()=>vP,DateTimeNoTzFilterFieldModel:()=>c5,DateTimeNoTzPicker:()=>vA,DateTimeTzFieldModel:()=>vT,DateTimeTzFilterFieldModel:()=>c3,DateTimeTzPicker:()=>vI,DeleteActionModel:()=>d3,DetailsAssociationFieldGroupModel:()=>cn,DetailsBlockModel:()=>ca,DetailsCustomItemModel:()=>cd,DetailsGridModel:()=>cu,DetailsItemModel:()=>uQ,DetailsJSFieldItemModel:()=>cf,DisassociateActionModel:()=>d6,DisplayCheckboxFieldModel:()=>xh,DisplayColorFieldModel:()=>yH,DisplayDateTimeFieldModel:()=>yJ,DisplayEnumFieldModel:()=>y0,DisplayHtmlFieldModel:()=>y2,DisplayIconFieldModel:()=>y8,DisplayJSONFieldModel:()=>y3,DisplayNumberFieldModel:()=>xi,DisplayPasswordFieldModel:()=>xs,DisplayPercentFieldModel:()=>xd,DisplaySubItemFieldModel:()=>yV,DisplaySubListFieldModel:()=>yW,DisplaySubTableFieldModel:()=>yL,DisplayTextFieldModel:()=>xu,DisplayTimeFieldModel:()=>xp,DisplayTitleFieldModel:()=>yB,DisplayURLFieldModel:()=>xc,DividerItemModel:()=>yj,EditActionModel:()=>d9,EditFormContent:()=>g1,EditFormModel:()=>uZ.EditFormModel,ExpandCollapseActionModel:()=>uN,FieldDeletePlaceholder:()=>hP,FieldModel:()=>aR.o,FieldModelSelect:()=>pd,FieldOperatorSelect:()=>pP,FilterActionModel:()=>ut,FilterBlockModel:()=>dP,FilterFormActionGroupModel:()=>pz,FilterFormActionModel:()=>pV,FilterFormBlockModel:()=>ml,FilterFormCollapseActionModel:()=>ma,FilterFormCustomFieldModel:()=>pE,FilterFormCustomItemModel:()=>pj,FilterFormCustomRecordSelectFieldModel:()=>pL,FilterFormFieldModel:()=>cg,FilterFormGridModel:()=>mw,FilterFormItemModel:()=>mb,FilterFormJSActionModel:()=>mS,FilterFormRecordSelectFieldModel:()=>cQ,FilterFormResetActionModel:()=>mC,FilterFormSubmitActionModel:()=>mF,FilterManager:()=>s7,FormActionGroupModel:()=>up,FormActionModel:()=>uu,FormAssociationFieldGroupModel:()=>mX,FormAssociationItemModel:()=>m8,FormBlockContent:()=>uq.JU,FormBlockModel:()=>uq.F4,FormComponent:()=>uq.s2,FormCustomItemModel:()=>mz,FormGridModel:()=>uL,FormItemModel:()=>u4,FormJSFieldItemModel:()=>mK,FormModel:()=>uq.mO,FormSubmitActionModel:()=>uc,GRID_FLOW_KEY:()=>dp,GRID_STEP:()=>dm,GridModel:()=>df,IconFieldModel:()=>vB,InputFieldModel:()=>v$.m,InputNumberField:()=>vW,JSActionModel:()=>ui,JSBlockModel:()=>ho,JSCollectionActionModel:()=>ua,JSColumnModel:()=>fm,JSEditableFieldModel:()=>yF,JSFieldModel:()=>yp,JSFormActionModel:()=>mU,JSItemActionModel:()=>uv,JSItemModel:()=>yN,JSRecordActionModel:()=>uy,JsonFieldModel:()=>vz,JsonInput:()=>vV,LinkActionModel:()=>uE,MainPageModel:()=>d$,MarkdownItemModel:()=>yE,NBColorPicker:()=>vh,NumberFieldModel:()=>vH,ObjectNester:()=>gc,PageModel:()=>dR,PageTabModel:()=>dz,PasswordFieldModel:()=>vG,PercentFieldModel:()=>vQ,PercentInput:()=>vX,PluginSettingsTopbarActionModel:()=>nH,PopupActionModel:()=>dW,PopupCollectionActionModel:()=>ux,PopupSubTableActionGroupModel:()=>vt,PopupSubTableActionsColumnModel:()=>vo,PopupSubTableEditActionModel:()=>g8,PopupSubTableFieldModel:()=>g7,PopupSubTableFormActionGroupModel:()=>uf,PopupSubTableFormModel:()=>vr,PopupSubTableFormSubmitActionModel:()=>uh,PopupSubTableRemoveActionModel:()=>ve,QUICK_EDIT_FORM_MAX_HEIGHT:()=>mH,QUICK_EDIT_MARKDOWN_HEIGHT:()=>mG,QUICK_EDIT_POPOVER_MAX_HEIGHT:()=>mW,QuickEditFormModel:()=>mJ,RadioGroupFieldModel:()=>vZ,RecordActionGroupModel:()=>sV,RecordActionModel:()=>dH.L,RecordPickerContent:()=>f_,RecordPickerFieldModel:()=>fV,RecordSelectFieldModel:()=>cW,RefreshActionModel:()=>ub,RichTextField:()=>v9,RichTextFieldModel:()=>v7,RootPageModel:()=>dK,RootPageTabModel:()=>dL,RouteModel:()=>ej,SelectFieldModel:()=>yl,SourceCascader:()=>pI,SubFormFieldModel:()=>gp,SubFormListFieldModel:()=>gh,SubPageModel:()=>dU,SubTableColumnModel:()=>f7,SubTableFieldModel:()=>gs,SubTableRecordAction:()=>g2,TABLE_COLUMN_MIN_WIDTH:()=>hM,TableActionsColumnModel:()=>h_,TableAssociationFieldGroupModel:()=>hL,TableBlockModel:()=>fn,TableColumnModel:()=>hE,TableCustomColumnModel:()=>hN,TableJSFieldItemModel:()=>fc,TableSelectModel:()=>fu,TextareaFieldModel:()=>yo,TimeFieldModel:()=>yd,TopbarActionModel:()=>nL,UIEditorTopbarActionModel:()=>nW,USER_CENTER_ACTION_ID:()=>nG,UnitConversion:()=>xa,UpdateRecordActionModel:()=>uA,UserCenterActionItemModel:()=>n8,UserCenterItemModel:()=>n1,UserCenterSelectItemModel:()=>n5,UserCenterTextItemModel:()=>n2,UserCenterTopbarActionModel:()=>oe,VariableFieldFormModel:()=>yu,ViewActionModel:()=>uP,applyAssociateAction:()=>d1,applyClickToOpenProps:()=>gk,applyClickToOpenSetting:()=>gP,applyDisassociateAction:()=>d0,buildDisplayPathFromValue:()=>gD,buildRecordPickerParentItemContext:()=>fB,buildRecordPickerPopupContextInputArgs:()=>fO,canRecordPickerSelectMultiple:()=>fM,collectAssociationHydrationCandidates:()=>cB,collectCascadeHydrationCandidate:()=>gE,connectFields:()=>mj,createAssignFieldValuesStep:()=>us.KW,createAssignFormSubModelOptions:()=>us.nF,customizeFilterRender:()=>mO,defaultOperator:()=>mN,findOptionPathByTk:()=>gB,formatNumber:()=>xo,getAllDataModels:()=>s8,getAssignFieldValuesDefaultParams:()=>us.Z1,getAssociationBlockResourceSettings:()=>dY,getAssociationHydrationNamePath:()=>c$,getAssociationHydrationSetterContext:()=>cO,getAssociationSelectAssociatedRecordsFilter:()=>fd,getAssociationSelectForeignKeyFilter:()=>fs,getAssociationSelectorContextInputArgs:()=>dQ,getAssociationTargetResourceSettings:()=>dX,getDefaultOperator:()=>s1,getDetailsItemValue:()=>uJ,getDisplayNumber:()=>xr,getFilterFormOperatorList:()=>sZ,getFilterFormOperatorMeta:()=>s0,getQuickEditFieldProps:()=>mY,getRecordPickerClearedValue:()=>fE,getRecordPickerEmptyValue:()=>fR,getTopbarPluginSettingsItems:()=>n_,getValueWithIndex:()=>uY,injectRecordPickerPopupContext:()=>f$,isAssociationBlockContext:()=>dJ,isFilterValueEmpty:()=>s2,joinUrlSearch:()=>uM,markCascadeHydrationDone:()=>gN,mergeAssignFieldValues:()=>us.GO,normalizeRecordPickerSelectedRows:()=>fT,normalizeRecordPickerValue:()=>fN,normalizeTableColumnWidth:()=>hI,operatorComponentProps:()=>m_,recalculateGridSizes:()=>dv,refreshClickToOpenRuntime:()=>gA,resolveAssignFieldValues:()=>us.eu,resolveCustomFieldOperatorList:()=>pF,resolveDefaultCustomFieldOperator:()=>pk,shouldClearRecordPickerValueOnMultipleChange:()=>fI,tableRowActionsClassName:()=>h$,toOperatorSelectOptions:()=>pA,transformNestedData:()=>gw,transformRowsToSingleColumn:()=>dg});var u={};l.r(u),l.d(u,{aclCheck:()=>bt,aclCheckRefresh:()=>bi,actionLinkageRules:()=>w3,afterSuccess:()=>aM,blockHeight:()=>b4,blockLinkageRules:()=>w4,confirm:()=>aI,customVariable:()=>xE,dataLoadingMode:()=>x8,dataScope:()=>s$,dateRangeLimit:()=>x0,dateTimeFormat:()=>xX,detailsFieldLinkageRules:()=>Se,displayFieldComponent:()=>x9,fieldComponent:()=>x7,fieldLinkageRules:()=>w9,filterFormDefaultValues:()=>b0,fixed:()=>bm,formAssignRules:()=>bQ,layout:()=>x4,linkageAssignField:()=>wQ,linkageRulesRefresh:()=>b1,linkageRunjs:()=>w0,linkageSetActionProps:()=>wq,linkageSetBlockProps:()=>wO,linkageSetDetailsFieldProps:()=>wz,linkageSetFieldProps:()=>wL,linkageSetMenuItemProps:()=>w_,menuLinkageRules:()=>w6,navigateToURL:()=>xT,numberFormat:()=>So,openView:()=>xC,overflowMode:()=>Sl,pattern:()=>bu,refreshTargetBlocks:()=>xO,renderMode:()=>x5,required:()=>x3,runjs:()=>xF,setTargetDataScope:()=>xK,showMessage:()=>xP,showNotification:()=>xI,sortingRule:()=>x2,subFormFieldLinkageRules:()=>w7,subFormLinkageAssignField:()=>wZ,subFormLinkageSetFieldProps:()=>wV,titleField:()=>xG,validation:()=>bp});var c={};l.r(c),l.d(c,{ACLContext:()=>nu.w0,ACLRolesCheckProvider:()=>nu.rR,ADMIN_LAYOUT_MODEL_UID:()=>tT,ADMIN_SETTINGS_KEY:()=>al.w$,ADMIN_SETTINGS_LAYOUT_MODEL_UID:()=>nE.O,ADMIN_SETTINGS_PATH:()=>al.wq,AIManager:()=>ex,APIClient:()=>L,ASSIGN_FIELD_VALUES_STEP_KEY:()=>us.zL,ActionGroupModel:()=>s_,ActionModel:()=>sz.S0,ActionSceneEnum:()=>sz.s5,ActionWithoutPermission:()=>sz._T,AddChildActionModel:()=>u$,AddNewActionModel:()=>dG,AdminLayoutComponent:()=>oB,AdminLayoutContent:()=>no,AdminLayoutMenuItemModel:()=>lX,AdminLayoutMenuItemRenderer:()=>lx,AdminLayoutMenuModelRenderer:()=>lS,AdminLayoutModel:()=>oG,AdminLayoutRouteCoordinator:()=>tI,AdminSettingsLayout:()=>S0.AdminSettingsLayout,AdminSettingsLayoutModel:()=>S1.C,AntdAppProvider:()=>ea,AppError:()=>ew.uV,AppMaintaining:()=>ew.be,AppMaintainingDialog:()=>ew.tp,AppNotFound:()=>ew.bM,AppSpin:()=>ew.gv,Application:()=>ap,ApplicationContext:()=>am,ApplicationModel:()=>r7,AssignFormGridModel:()=>uz,AssignFormItemModel:()=>cl,AssignFormModel:()=>u_,AssociateActionModel:()=>d5,AssociationFieldGroupModel:()=>sK,AssociationFieldModel:()=>cy,BaseApplication:()=>r3,BaseLayoutModel:()=>eJ,BaseLayoutRouteCoordinator:()=>eD,BasePageTabModel:()=>d_,BlankComponent:()=>ew.ct,BlockGridModel:()=>dw,BlockModel:()=>dS.z,BlockSceneEnum:()=>dS.P,BulkDeleteActionModel:()=>d4,CascadeSelectFieldModel:()=>gz,CascadeSelectInnerFieldModel:()=>gL,CascadeSelectListFieldModel:()=>gK,CheckboxFieldInterface:()=>CI,CheckboxFieldModel:()=>vs,CheckboxGroupFieldInterface:()=>CT,CheckboxGroupFieldModel:()=>vd,ChildPageModel:()=>dN,ChildPageTabModel:()=>dV,ClickableFieldModel:()=>gj,CodeEditor:()=>uo.BY,CodeEditorExtension:()=>uo.o8,CodeScanner:()=>ew.O5,CollectionActionGroupModel:()=>sL,CollectionActionModel:()=>dC.U,CollectionBlockModel:()=>dF.t,CollectionFieldInterface:()=>CM,CollectionFieldInterfaceManager:()=>iQ,CollectionFilter:()=>ew.px,CollectionFilterPanel:()=>ew.XO,CollectionSelect:()=>iF,CollectionSelectFieldInterface:()=>CR,CollectionSelectorFieldModel:()=>vp,ColorFieldInterface:()=>CE,ColorFieldModel:()=>vf,CommonItemModel:()=>dk,CreateContent:()=>cL,CreateFormModel:()=>mV,CreatedAtFieldInterface:()=>CN,CreatedByFieldInterface:()=>CD,CurrentUserContext:()=>Cd,CustomWidth:()=>hT,DEFAULT_DATA_SOURCE_KEY:()=>eZ.Ze,DEFAULT_PAGE_SIZE:()=>ew.yQ,DataBlockModel:()=>dA.R,DateFieldInterface:()=>Fr,DateOnlyFieldModel:()=>vk,DateOnlyFilterFieldModel:()=>c2,DateOnlyPicker:()=>vF,DateTimeFilterFieldModel:()=>c0,DateTimeNoTzFieldModel:()=>vP,DateTimeNoTzFilterFieldModel:()=>c5,DateTimeNoTzPicker:()=>vA,DateTimeTzFieldModel:()=>vT,DateTimeTzFilterFieldModel:()=>c3,DateTimeTzPicker:()=>vI,DatetimeFieldInterface:()=>CB,DatetimeNoTzFieldInterface:()=>Fi,DefaultToolsManager:()=>ey,DeleteActionModel:()=>d3,DetailsAssociationFieldGroupModel:()=>cn,DetailsBlockModel:()=>ca,DetailsCustomItemModel:()=>cd,DetailsGridModel:()=>cu,DetailsItemModel:()=>uQ,DetailsJSFieldItemModel:()=>cf,DialogFormLayout:()=>ew.xg,DisassociateActionModel:()=>d6,DisplayCheckboxFieldModel:()=>xh,DisplayColorFieldModel:()=>yH,DisplayDateTimeFieldModel:()=>yJ,DisplayEnumFieldModel:()=>y0,DisplayHtmlFieldModel:()=>y2,DisplayIconFieldModel:()=>y8,DisplayJSONFieldModel:()=>y3,DisplayNumberFieldModel:()=>xi,DisplayPasswordFieldModel:()=>xs,DisplayPercentFieldModel:()=>xd,DisplaySubItemFieldModel:()=>yV,DisplaySubListFieldModel:()=>yW,DisplaySubTableFieldModel:()=>yL,DisplayTextFieldModel:()=>xu,DisplayTimeFieldModel:()=>xp,DisplayTitleFieldModel:()=>yB,DisplayURLFieldModel:()=>xc,DividerItemModel:()=>yj,DragSortRowContext:()=>ew.c5,DrawerFormLayout:()=>ew.gh,EditActionModel:()=>d9,EditFormContent:()=>g1,EditFormModel:()=>uZ.EditFormModel,EmailFieldInterface:()=>C$,EnvVariableInput:()=>ew.s9,ExpandCollapseActionModel:()=>uN,ExtendCollectionsProvider:()=>Fu,FieldDeletePlaceholder:()=>hP,FieldFilterOperatorRegistry:()=>ih,FieldModel:()=>aR.o,FieldModelSelect:()=>pd,FieldOperatorSelect:()=>pP,FieldValidationConfigureRegistry:()=>iH,FileSizeInput:()=>ew.c,FilterActionModel:()=>ut,FilterBlockModel:()=>dP,FilterContent:()=>aT.oJ,FilterFormActionGroupModel:()=>pz,FilterFormActionModel:()=>pV,FilterFormBlockModel:()=>ml,FilterFormCollapseActionModel:()=>ma,FilterFormCustomFieldModel:()=>pE,FilterFormCustomItemModel:()=>pj,FilterFormCustomRecordSelectFieldModel:()=>pL,FilterFormFieldModel:()=>cg,FilterFormGridModel:()=>mw,FilterFormItemModel:()=>mb,FilterFormJSActionModel:()=>mS,FilterFormRecordSelectFieldModel:()=>cQ,FilterFormResetActionModel:()=>mC,FilterFormSubmitActionModel:()=>mF,FilterGroup:()=>aT.I8,FilterItem:()=>aT.qi,FilterManager:()=>s7,FlowModelRepository:()=>Sd,FlowPage:()=>xv,FlowRoute:()=>o8,FormActionGroupModel:()=>up,FormActionModel:()=>uu,FormAssociationFieldGroupModel:()=>mX,FormAssociationItemModel:()=>m8,FormBlockContent:()=>uq.JU,FormBlockModel:()=>uq.F4,FormComponent:()=>uq.s2,FormCustomItemModel:()=>mz,FormGridModel:()=>uL,FormItemModel:()=>u4,FormJSFieldItemModel:()=>mK,FormModel:()=>uq.mO,FormSubmitActionModel:()=>uc,GRID_FLOW_KEY:()=>dp,GRID_STEP:()=>dm,GlobalThemeProvider:()=>eg,GridModel:()=>df,HeaderContext:()=>ld,Icon:()=>ew.In,IconFieldInterface:()=>CO,IconFieldModel:()=>vB,IdFieldInterface:()=>Cq,InputFieldInterface:()=>CV,InputFieldModel:()=>v$.m,InputNumberField:()=>vW,IntegerFieldInterface:()=>Cz,InternalAdminSettingsLayout:()=>S0.InternalAdminSettingsLayout,JSActionModel:()=>ui,JSBlockModel:()=>ho,JSCollectionActionModel:()=>ua,JSColumnModel:()=>fm,JSEditableFieldModel:()=>yF,JSFieldModel:()=>yp,JSFormActionModel:()=>mU,JSItemActionModel:()=>uv,JSItemModel:()=>yN,JSRecordActionModel:()=>uy,JsonFieldInterface:()=>CK,JsonFieldModel:()=>vz,JsonInput:()=>vV,JsonTextArea:()=>ew.V4,LayoutContent:()=>nr,LayoutContentRoute:()=>o4,LayoutManager:()=>rm,LayoutRoute:()=>rn,LinkActionModel:()=>uE,LinkageFilterItem:()=>aT.Ru,M2MFieldInterface:()=>CU,M2OFieldInterface:()=>CW,MAX_MESSAGE_CHARS:()=>uo.hP,MENU_TYPE_OPTIONS:()=>l$,MainPageModel:()=>d$,MarkdownFieldInterface:()=>CH,MarkdownItemModel:()=>yE,MobileMenuControlContext:()=>ls,MockFlowModelRepository:()=>Ss,MultipleSelectFieldInterface:()=>CG,NBColorPicker:()=>vh,NanoidFieldInterface:()=>Fn,NocoBaseBuildInPlugin:()=>Cf,NocoBaseBuildInPluginV2:()=>Cf,NumberFieldInterface:()=>CY,NumberFieldModel:()=>vH,O2MFieldInterface:()=>CX,OBOFieldInterface:()=>CJ,OHOFieldInterface:()=>CQ,ObjectNester:()=>gc,OptionsEditor:()=>iK,PAGE_SIZE_OPTIONS:()=>ew.xp,PLUGIN_MANAGER_SETTING_NAME:()=>nE.Bm,PageModel:()=>dR,PageTabModel:()=>dz,PasswordFieldInterface:()=>CZ,PasswordFieldModel:()=>vG,PasswordInput:()=>ew.yA,PercentFieldInterface:()=>C0,PercentFieldModel:()=>vQ,PercentInput:()=>vX,PhoneFieldInterface:()=>C1,PinnedPluginListContext:()=>np,PinnedPluginListLite:()=>on,Plugin:()=>ax,PluginFlowEngine:()=>S5,PluginManager:()=>at,PluginManagerPage:()=>S2.PluginManagerPage,PluginSettingsManager:()=>al.mz,PluginSettingsTopbarActionModel:()=>nH,PopupActionModel:()=>dW,PopupCollectionActionModel:()=>ux,PopupSubTableActionGroupModel:()=>vt,PopupSubTableActionsColumnModel:()=>vo,PopupSubTableEditActionModel:()=>g8,PopupSubTableFieldModel:()=>g7,PopupSubTableFormActionGroupModel:()=>uf,PopupSubTableFormModel:()=>vr,PopupSubTableFormSubmitActionModel:()=>uh,PopupSubTableRemoveActionModel:()=>ve,PoweredBy:()=>ew.G5,QUICK_EDIT_FORM_MAX_HEIGHT:()=>mH,QUICK_EDIT_MARKDOWN_HEIGHT:()=>mG,QUICK_EDIT_POPOVER_MAX_HEIGHT:()=>mW,QuickEditFormModel:()=>mJ,RadioGroupFieldInterface:()=>C2,RadioGroupFieldModel:()=>vZ,RangeValidationItems:()=>iW,RecordActionGroupModel:()=>sV,RecordActionModel:()=>dH.L,RecordPickerContent:()=>f_,RecordPickerFieldModel:()=>fV,RecordSelectFieldModel:()=>cW,RefreshActionModel:()=>ub,RemoteFlowModelRenderer:()=>xy,RemoteSelect:()=>ew.lT,ResetThemeTokenAndKeepAlgorithm:()=>t$,RichTextField:()=>v9,RichTextFieldInterface:()=>C8,RichTextFieldModel:()=>v7,RootPageModel:()=>dK,RootPageTabModel:()=>dL,RouteModel:()=>ej,RouteRepository:()=>rh,RouterContextCleaner:()=>ew.PK,RouterManager:()=>as,SNIPPET_PREFIX:()=>al.tJ,SYSTEM_SETTINGS_SETTING_NAME:()=>nE.jm,ScanInput:()=>ew.E5,SelectFieldInterface:()=>C5,SelectFieldModel:()=>yl,SkeletonFallback:()=>o9,SnowflakeIdFieldInterface:()=>C4,SortHandle:()=>ew.vm,SortableRow:()=>ew.B7,SourceCascader:()=>pI,SubFormFieldModel:()=>gp,SubFormListFieldModel:()=>gh,SubPageModel:()=>dU,SubTableColumnModel:()=>f7,SubTableFieldModel:()=>gs,SubTableRecordAction:()=>g2,SwitchLanguage:()=>ew.rw,SystemSettingsPage:()=>S8.SystemSettingsPage,SystemSettingsSource:()=>eS.o,TABLE_COLUMN_MIN_WIDTH:()=>hM,Table:()=>ew.XI,TableActionsColumnModel:()=>h_,TableAssociationFieldGroupModel:()=>hL,TableBlockModel:()=>fn,TableColumnModel:()=>hE,TableCustomColumnModel:()=>hN,TableJSFieldItemModel:()=>fc,TableSelectModel:()=>fu,TableoidFieldInterface:()=>C3,TextAreaWithContextSelector:()=>aw.n,TextareaFieldInterface:()=>C6,TextareaFieldModel:()=>yo,TimeFieldInterface:()=>C9,TimeFieldModel:()=>yd,TopbarActionModel:()=>nL,TypedVariableInput:()=>ew.Pb,UIEditorTopbarActionModel:()=>nW,USER_CENTER_ACTION_ID:()=>nG,UUIDFieldInterface:()=>Fl,UnitConversion:()=>xa,UnixTimestampFieldInterface:()=>Fo,UpdateRecordActionModel:()=>uA,UpdatedAtFieldInterface:()=>C7,UpdatedByFieldInterface:()=>Fe,UrlFieldInterface:()=>Ft,UserCenterActionItemModel:()=>n8,UserCenterItemModel:()=>n1,UserCenterSelectItemModel:()=>n5,UserCenterTextItemModel:()=>n2,UserCenterTopbarActionModel:()=>oe,VariableFieldFormModel:()=>yu,VariableFilterItem:()=>aT.Et,VariableInput:()=>ew.P8,VariableJSON:()=>ew.hJ,VariableJsonTextArea:()=>ew.jr,VariableTextArea:()=>ew.hp,ViewActionModel:()=>uP,WebSocketClient:()=>rf,aclCheck:()=>bt,aclCheckRefresh:()=>bi,actionLinkageRules:()=>w3,addCustomAlgorithmToTheme:()=>em,addFieldValidationConfiguresToGroup:()=>iX,afterSuccess:()=>aM,applyAssociateAction:()=>d1,applyClickToOpenProps:()=>gk,applyClickToOpenSetting:()=>gP,applyDisassociateAction:()=>d0,applyMobilePaginationProps:()=>uw.hO,array:()=>il,bigField:()=>im,blockHeight:()=>b4,blockLinkageRules:()=>w4,boolean:()=>iu,buildDisplayPathFromValue:()=>gD,buildInsertRouteSchema:()=>lG,buildLinkSettingSchema:()=>lN,buildMenuBasicSchema:()=>lO,buildMenuTitleWithIcon:()=>lF,buildRecordPickerParentItemContext:()=>fB,buildRecordPickerPopupContextInputArgs:()=>fO,buildV2SigninHref:()=>tc,canRecordPickerSelectMultiple:()=>fM,collectAssociationHydrationCandidates:()=>cB,collectCascadeHydrationCandidate:()=>gE,collection:()=>ip,compatOldTheme:()=>ec,configurePropertiesToItems:()=>iE,confirm:()=>aI,connectFields:()=>mj,createAclSnippetAllow:()=>nu.rN,createAssignFieldValuesStep:()=>us.KW,createAssignFormSubModelOptions:()=>us.nF,createCompactSimpleItemRender:()=>uw.hH,createDefaultCollectionBlockTitle:()=>uw.lr,createFilterable:()=>iS,createFormRegistry:()=>ew.oV,createInsertMenuStep:()=>lz,createMockClient:()=>ay,createSettingsPathMap:()=>nE.nC,createTypedFilterable:()=>iC,customAlgorithm:()=>ep,customVariable:()=>xE,customizeFilterRender:()=>mO,dataLoadingMode:()=>x8,dataScope:()=>s$,dateRangeLimit:()=>x0,dateTimeFormat:()=>xX,dateTimeFormatConfigureItems:()=>iL,datetime:()=>ir,defaultOperator:()=>mN,defaultTheme:()=>eu,detailsFieldLinkageRules:()=>Se,diagnoseRunJS:()=>uo.fL,dispatchEventDeep:()=>uw.Xi,displayFieldComponent:()=>x9,editMarkdownFlow:()=>yT,enumType:()=>is,escapeHTML:()=>ny.Z,evaluateFieldConfigureExpression:()=>ij,fieldComponent:()=>x7,fieldFilterOperatorPresets:()=>iy,fieldFilterOperators:()=>iv,fieldLinkageRules:()=>w9,fieldValidationConfigureRegistry:()=>iG,filterFormDefaultValues:()=>b0,filterOperatorRegistry:()=>ig,filterRenderableSettings:()=>nE.Ui,filterVisibleSettings:()=>nE.eD,findFirstAccessiblePageRoute:()=>tP,findFirstInternalSettingsPage:()=>nE.X2,findFirstV2LandingRoute:()=>tA,findNextSiblingRoute:()=>lW,findOptionPathByTk:()=>gB,findPrevSiblingRoute:()=>lU,findSettingsByName:()=>nE.R0,fixed:()=>bm,formAssignRules:()=>bQ,formatEnvPath:()=>ew.EM,formatNumber:()=>xo,formatRunJSPreviewMessage:()=>uo.by,formatVariablePath:()=>ew.X5,getAdminLayoutMenuInitializerButton:()=>lC,getAdminLayoutMenuMovePositionOptions:()=>lu,getAdminLayoutMenuVirtualPath:()=>t8,getAdminLayoutModel:()=>oY,getAllDataModels:()=>s8,getAppVersionHTML:()=>ny.p,getAssignFieldValuesDefaultParams:()=>us.Z1,getAssociationBlockResourceSettings:()=>dY,getAssociationHydrationNamePath:()=>c$,getAssociationHydrationSetterContext:()=>cO,getAssociationSelectAssociatedRecordsFilter:()=>fd,getAssociationSelectForeignKeyFilter:()=>fs,getAssociationSelectorContextInputArgs:()=>dQ,getAssociationTargetResourceSettings:()=>dX,getCoreFieldConfigureState:()=>iO,getCurrentV2RedirectPath:()=>tu,getDefaultOperator:()=>s1,getDefaultSettingsPath:()=>nE.C9,getDefaultV2AdminRedirectPath:()=>td,getDetailsItemValue:()=>uJ,getDisplayNumber:()=>xr,getFilterFormOperatorList:()=>sZ,getFilterFormOperatorMeta:()=>s0,getLayoutContentRouteNames:()=>eL,getLayoutModel:()=>eX,getLayoutPageRouteName:()=>e$,getLayoutPageTabRouteName:()=>eO,getLayoutPageTabViewRouteName:()=>e_,getLayoutPageViewRouteName:()=>eq,getMenuCreationDefaultParams:()=>lB,getMenuCreationUiSchema:()=>lL,getMenuEditDefaultParams:()=>l_,getMenuItems:()=>nE.gL,getMobileCompactPaginationClassName:()=>uw.NY,getModernClientPrefix:()=>tn,getPinnedPluginListKeys:()=>nc,getQuickEditFieldProps:()=>mY,getRecordPickerClearedValue:()=>fE,getRecordPickerEmptyValue:()=>fR,getSimpleModePaginationClassName:()=>uw.HZ,getTopbarPluginSettingsItems:()=>n_,getUniqueKeyFromCollection:()=>Fa,getUnknownCountPaginationTotal:()=>uw.SM,getV2EffectiveBasePath:()=>tr,getValueWithIndex:()=>uY,hasIcon:()=>ew.cE,hasOwnSettingsPage:()=>nE.lv,icons:()=>ew.Pt,id:()=>ia,indexConfigureItems:()=>i_,injectRecordPickerPopupContext:()=>f$,insertRouteSchema:()=>lD,isAssociationBlockContext:()=>dJ,isFilterValueEmpty:()=>s2,isLayoutContentRouteName:()=>eV,isTitleField:()=>eZ.ji,isTitleFieldInterface:()=>eZ.w,isV2AdminRuntime:()=>ty,isV2MenuRoute:()=>tk,joinUrlSearch:()=>uM,languageCodes:()=>ab.A,layout:()=>x4,linkageAssignField:()=>wQ,linkageRulesRefresh:()=>b1,linkageRunjs:()=>w0,linkageSetActionProps:()=>wq,linkageSetBlockProps:()=>wO,linkageSetDetailsFieldProps:()=>wz,linkageSetFieldProps:()=>wL,linkageSetMenuItemProps:()=>w_,makeFormatVariablePath:()=>ew.nW,makeParseVariablePath:()=>ew.Dx,makeVariableRegExp:()=>ew.at,markCascadeHydrationDone:()=>gN,matchSettingsRoute:()=>nE.CM,matchesRoutePath:()=>lH,menuLinkageRules:()=>w6,mergeAssignFieldValues:()=>us.GO,mergePaginationClassName:()=>uw.M6,navigateToURL:()=>xT,normalizeAdminLayoutMenuLegacyVariables:()=>t6,normalizeCollectionTemplateField:()=>Fs,normalizeCollectionTemplateFields:()=>Fd,normalizeFilterableOperators:()=>ib,normalizeLayoutRoutePath:()=>rc,normalizeRecordPickerSelectedRows:()=>fT,normalizeRecordPickerValue:()=>fN,normalizeTableColumnWidth:()=>hI,number:()=>ii,numberFormat:()=>So,object:()=>io,openAdminLayoutMenuLink:()=>t7,openView:()=>xC,openViewFlow:()=>eA,operatorComponentProps:()=>m_,overflowMode:()=>Sl,parseEnvPath:()=>ew.uO,parseVariablePath:()=>ew.h7,pattern:()=>bu,previewRunJS:()=>uo.zA,recalculateGridSizes:()=>dv,reconcileAdminLayoutMenuItems:()=>lp,redirectToV2Signin:()=>tp,refreshClickToOpenRuntime:()=>gA,refreshTargetBlocks:()=>xO,registerFieldValidationConfigure:()=>iY,registerFieldValidationConfigureGroup:()=>iJ,registerIcon:()=>ew.pU,registerIcons:()=>ew.K1,renderMode:()=>x5,replaceRouteParams:()=>nE.uT,required:()=>x3,resolveAdminLayoutMenuDragMoveOptions:()=>lm,resolveAdminLayoutMenuDragMoveOptionsFromEvent:()=>lh,resolveAdminLayoutMenuLink:()=>t9,resolveAdminRouteRuntimeTarget:()=>tM,resolveAssignFieldValues:()=>us.eu,resolveCustomFieldOperatorList:()=>pF,resolveDefaultCustomFieldOperator:()=>pk,resolveDynamicNamePath:()=>aL.IJ,resolveFilterOperators:()=>ix,resolveV2SigninRedirect:()=>tm,reverseFieldConfigureItem:()=>iz,reverseFieldConfigureItems:()=>iV,runCoreFieldConfigureEffects:()=>iq,runjs:()=>xF,setTargetDataScope:()=>xK,shouldClearRecordPickerValueOnMultipleChange:()=>fI,shouldRenderIconInTitle:()=>lb,showMessage:()=>xP,showNotification:()=>xI,sortTopLevelSettings:()=>nE.p$,sortingRule:()=>x2,string:()=>it,stripModernClientPrefix:()=>to,subFormFieldLinkageRules:()=>w7,subFormLinkageAssignField:()=>wZ,subFormLinkageSetFieldProps:()=>wV,tableRowActionsClassName:()=>h$,tableoid:()=>ic,time:()=>id,titleField:()=>xG,toOperatorSelectOptions:()=>pA,toRouterNavigationPath:()=>tx,toToolsMap:()=>eb,toTreeSelectItems:()=>lK,toViewStack:()=>eB,transformNestedData:()=>gw,transformRowsToSingleColumn:()=>dg,useACLContext:()=>nu.bq,useACLRoleContext:()=>nu.v6,useAclSnippets:()=>nu.K3,useAdminLayoutRoutePage:()=>SZ,useApp:()=>en.n,useAppListRender:()=>os,useApplications:()=>oo,useCurrentAppInfo:()=>nf.g,useCurrentRoleMode:()=>nu.GL,useCurrentRoles:()=>Cc,useCurrentUserContext:()=>Cu,useFilterOptions:()=>aT.uw,useFilteredMetaTree:()=>ew.a7,useGlobalTheme:()=>ef,useLayoutRoutePage:()=>oJ,useMobileLayout:()=>SQ,usePlugin:()=>ng.n,useRoleRecheck:()=>nu.N5,useRouter:()=>nv,useSystemSettings:()=>eS.e,useUIConfigurationPermissions:()=>nu.uM,validation:()=>bp});var p={};l.r(p),l.d(p,{array:()=>AY,bigField:()=>A4,boolean:()=>A2,collection:()=>A5,datetime:()=>AX,enumType:()=>A0,id:()=>AZ,number:()=>AQ,object:()=>AJ,string:()=>AG,tableoid:()=>A8,time:()=>A1});var m={};l.r(m),l.d(m,{autoFill:()=>Pe,autoIncrement:()=>A7,collectionDataSource:()=>Pd,constraintsProps:()=>Pl,dataSource:()=>Pi,dateTimeProps:()=>Po,defaultProps:()=>Pa,operators:()=>p,primaryKey:()=>A9,recordPickerViewer:()=>Ps,relationshipType:()=>Pt,reverseFieldProperties:()=>Pn,timeProps:()=>Pr,type:()=>A3,unique:()=>A6});var h={};l.r(h),l.d(h,{FormActiveFieldsProvider:()=>OM,appendQueryStringToUrl:()=>Hp,completeURL:()=>Hy,fillParentFields:()=>Hb,findFilterTargets:()=>WG,getAppends:()=>Hs,getAssociationPath:()=>Ha,getCardItemSchema:()=>Wq,getFormValues:()=>WK,getPageSchema:()=>WO,navigateWithinSelf:()=>Hx,parseVariablesAndChangeParamsToQueryString:()=>Hg,reduceValueSize:()=>Hv,replaceVariableValue:()=>Hf,updateFilterTargets:()=>WY,useAssociationCreateActionProps:()=>WH,useAssociationFilterBlockProps:()=>Hr,useAssociationFilterProps:()=>Hl,useAssociationNames:()=>Hd,useBlockHeightProps:()=>W$,useBulkDestroyActionProps:()=>W6,useCollectValuesToSubmit:()=>WU,useCreateActionProps:()=>WW,useCustomizeBulkUpdateActionProps:()=>W1,useCustomizeRequestActionProps:()=>W2,useCustomizeUpdateActionProps:()=>W0,useDataBlockParentRecord:()=>W_,useDestroyActionProps:()=>W5,useDetailsPaginationProps:()=>Ht,useDisassociateActionProps:()=>W3,useEditTableActionProps:()=>He,useFilterBlockActionProps:()=>WX,useFormActiveFields:()=>OI,useLinkActionProps:()=>Hh,useOptionalFieldList:()=>Hn,useParseURLAndParams:()=>Hm,useParsedFilter:()=>IW,usePickActionProps:()=>WL,useRefreshActionProps:()=>W9,useRemoveActionProps:()=>W4,useResetBlockActionProps:()=>WZ,useTableColumns:()=>W7,useUpdateActionProps:()=>W8});var f={};l.r(f),l.d(f,{DateFilterDynamicComponent:()=>HT,DndContext:()=>TU,DragHandler:()=>R6,DraggableContext:()=>RQ,ShowFormData:()=>Hj,Sortable:()=>R2,SortableContext:()=>RZ,SortableItem:()=>R3,SortableProvider:()=>R0,getRenderContent:()=>j3});var g={};l.r(g),l.d(g,{AssignedField:()=>ee7,AssignedFieldInner:()=>ee9,AssignedFieldValueType:()=>ee6,CreateAction:()=>etr,CreateRecordAction:()=>eta,useAclCheck:()=>ett});var v={};l.r(v),l.d(v,{Action:()=>XL,ActionBar:()=>XZ,ActionBarProvider:()=>XY,ActionContext:()=>UB,ActionContextNoRerender:()=>Uq,ActionContextProvider:()=>U$,ActionDesigner:()=>GV,AfterSuccess:()=>GB,AllDataBlocksContext:()=>jf,AllDataBlocksProvider:()=>jg,AntdSchemaComponentPlugin:()=>Zc,AntdSchemaComponentProvider:()=>Zu,AppendsTreeSelect:()=>Zx,AssignedFieldValues:()=>Gj,AssociationField:()=>etG,AssociationFieldMode:()=>eeZ,AssociationFieldModeProvider:()=>ee2,AssociationSelect:()=>etZ,AttachmentList:()=>eec,AutoComplete:()=>et1,BackButtonUsedInSubPage:()=>BO,Block:()=>eno,BlockItem:()=>HN,BlockItemCard:()=>WB,BlockItemCardContext:()=>WD,BlocksSelector:()=>GD,ButtonEditor:()=>GP,CardItem:()=>et3,Cascader:()=>elt,Checkbox:()=>eeB,CollectionSelect:()=>elr,ColorPicker:()=>elu,ColorSelect:()=>elp,Cron:()=>elg,CronSet:()=>elb,DataSourceCollectionCascader:()=>eld,DataSourceSelect:()=>ela,DateFormatCom:()=>AK,DatePicker:()=>LO,DatePickerProvider:()=>LD,Details:()=>elw,DetailsDesigner:()=>Ql,Divider:()=>elS,EditComponent:()=>HK,EditDefaultValue:()=>Hz,EditDescription:()=>Hq,EditOperator:()=>HH,EditPattern:()=>HU,EditRequired:()=>HL,EditSortField:()=>eoX,EditTable:()=>elz,EditTableAction:()=>elY,EditTableActionContext:()=>elH,EditTitle:()=>HO,EditTitleField:()=>HG,EditTooltip:()=>H_,EditValidationRules:()=>HV,Editable:()=>en7,EllipsisWithTooltip:()=>U8,ErrorFallback:()=>MP,Expand:()=>el3,ExpiresRadio:()=>AH,FieldsTreeSelect:()=>Zy,Fieldset:()=>el6,Filter:()=>VD,FilterAction:()=>Vw,FilterActionContext:()=>Vx,FilterContext:()=>Ll,FilterDynamicComponent:()=>VM,FilterLogicContext:()=>Ln,Form:()=>X9,FormDialog:()=>zU,FormDrawer:()=>eru,FormField:()=>QB,FormItem:()=>H7,FormV2:()=>QR,G2Plot:()=>enn,G2PlotRenderer:()=>enl,Grid:()=>OP,GridCard:()=>enw,GridRowContext:()=>Op,HTMLEncode:()=>U5,ICON_POPUP_Z_INDEX:()=>Vg,IconPicker:()=>enk,Input:()=>Wg,InputNumber:()=>enD,InputReadPretty:()=>U4,InputRecordPicker:()=>eou,Json:()=>UQ,LinkageFilter:()=>erC,List:()=>enG,Markdown:()=>WE,MarkdownReadPretty:()=>WN,Menu:()=>EF,NanoIDInput:()=>enY,Page:()=>Q4,PagePopups:()=>IF,PageTabs:()=>Q3,Pagination:()=>enJ,ParentRouteContext:()=>Ef,Password:()=>en5,Percent:()=>en6,PopupSettingsProvider:()=>Mz,Preview:()=>en9,QuickEdit:()=>eoe,Radio:()=>eeE,ReadPretty:()=>U4,ReadPrettyRecordPicker:()=>eof,RecordPicker:()=>eog,RecordPickerContext:()=>eor,RecordPickerProvider:()=>eoc,RefreshDataBlockRequest:()=>Gz,RemoteSelect:()=>Qy,RemoveButton:()=>G$,RemoveConditionContext:()=>Lt,RequestSettings:()=>GM,RichText:()=>eox,SecondConFirm:()=>G_,Select:()=>Qm,SkipValidation:()=>GI,Space:()=>eob,StablePopover:()=>Vv,Table:()=>eoW,TableBlockDesigner:()=>eoQ,TableField:()=>eoZ,TableSelectorDesigner:()=>eo0,TableV2:()=>eo1,Tabs:()=>eo4,TabsContextProvider:()=>M_,Templates:()=>Qb,TestDesigner:()=>HD,TextAreaWithGlobalScope:()=>era,TimePicker:()=>eo7,TreeSelect:()=>ert,UnixTimestamp:()=>ero,Upload:()=>eei,Uploader:()=>eep,Variable:()=>Yx,VariableScopeProvider:()=>Yv,VariableSelect:()=>Wx,actionSettings:()=>GL,actionSettingsItems:()=>GO,allowAddNew:()=>VJ,attachmentFileTypes:()=>Z_,defaultFieldNames:()=>Qo,fetchTemplateData:()=>QS,filterFormItemSettings:()=>JK,findByUid:()=>R7,findKeysByUid:()=>El,findMenuItem:()=>Ee,formDetailsSettings:()=>QD,formItemSettings:()=>VX,formSettings:()=>QE,formV1Settings:()=>X7,genStyleHook:()=>F9,getCurrentOptions:()=>Qa,getDateExact:()=>jU,getDatePickerLabels:()=>eon,getDateRanges:()=>jK,getLabelFormatValue:()=>eoo,getPopupPathFromParams:()=>Ia,getStoredPopupContext:()=>Ie,getTabSchema:()=>Zr,getZIndex:()=>Bb,handleDateChangeOnForm:()=>jB,inferPickerType:()=>jH,isBulkEditAction:()=>XK,isFileCollection:()=>Ge,isMobile:()=>jO,isShowFilePicker:()=>eom,isTabPage:()=>Zo,isWriteEmailAction:()=>XU,mapDatePicker:()=>j$,mapRangePicker:()=>jq,mapTimeFormat:()=>eo9,matchMimetype:()=>ZL,moment2str:()=>jN,navigateToTab:()=>Zn,pageSettings:()=>Za,pageTabSettings:()=>Zd,readPrettyFormSettings:()=>QN,removeNullCondition:()=>Vz,resolveFilterPickerFormat:()=>LR,storePopupContext:()=>It,useActionBarContext:()=>XJ,useActionContext:()=>U_,useAfterSuccessOptions:()=>GS,useAllDataBlocks:()=>jv,useAssociationFieldContext:()=>Db,useAssociationFieldModeContext:()=>ee8,useBackButton:()=>B$,useCloseAction:()=>UL,useColumnSchema:()=>On,useColumnSettings:()=>DP,useCurrentPopupContext:()=>Ij,useDatePickerContext:()=>LN,useDownloadLogs:()=>MA,useEnsureOperatorsValid:()=>HW,useFieldMode:()=>V4,useFieldNames:()=>eot,useFilterActionProps:()=>VK,useFilterFieldOptions:()=>VL,useFilterFieldProps:()=>VU,useFilterOptions:()=>V$,useFormDataTemplates:()=>Qx,useGetAriaLabelOfAction:()=>XO,useGetAriaLabelOfDrawer:()=>Bv,useGetAriaLabelOfModal:()=>BM,useGetAriaLabelOfPopover:()=>X0,useGetFilterFieldOptions:()=>VO,useGetFilterOptions:()=>VB,useGridContext:()=>OF,useGridRowContext:()=>Ok,useIsAddNewForm:()=>VQ,useIsAssociationField:()=>V8,useIsFieldReadPretty:()=>V1,useIsFileField:()=>V5,useIsFormReadPretty:()=>V0,useIsSelectFieldMode:()=>V3,useKeepAliveLocationSearch:()=>Q5,useLabelUiSchema:()=>eol,useLinkageAction:()=>UV,useListBlockContext:()=>enq,useMenuDragEnd:()=>EC,useMenuTranslation:()=>R9,useNocoBaseRoutes:()=>Ev,useParentRoute:()=>Eg,usePopupSettings:()=>MK,useStyles:()=>RB,useTableColumnIntegration:()=>Dj,useTabsContext:()=>ML,useTitleFieldOptions:()=>V7,useUploadStyles:()=>Z1,useValidateSchema:()=>V6,useVariableScope:()=>Yy,useZIndexContext:()=>Bx,withSearchParams:()=>Iu,zIndexContext:()=>By});var y={};l.r(y),l.d(y,{isDeleteButtonDisabled:()=>eib,useBulkDestroyAction:()=>eih,useBulkDestroyActionAndRefreshCM:()=>eiw,useCancelAction:()=>er4,useChildrenCollections:()=>eie,useCollectionFieldsOptions:()=>eir,useCollectionFilterOptions:()=>eil,useCollectionFilterOptionsV2:()=>ein,useCreateAction:()=>eis,useCreateActionAndRefreshCM:()=>eig,useCreateActionWithoutRefresh:()=>eid,useDeleteButtonDisabled:()=>eix,useDestroyAction:()=>eim,useDestroyActionAndRefreshCM:()=>eiy,useFilterAction:()=>eia,useFilterActionProps:()=>eiS,useFilterDataSource:()=>eii,useKanbanEvents:()=>er9,useLinkageCollectionFilterOptions:()=>eio,useMoveAction:()=>eic,useResetFilterAction:()=>er6,useSelfAndChildrenCollections:()=>eit,useSortFields:()=>er7,useUpdateAction:()=>eip,useUpdateActionAndRefreshCM:()=>eiv,useUpdateViewAction:()=>eiu,useValuesFromRA:()=>eif,useValuesFromRecord:()=>er3});var x={};l.r(x),l.d(x,{FieldValidation:()=>eij,ForeignKey:()=>eiB,SourceCollection:()=>eiE,SourceForeignKey:()=>eiI,SourceKey:()=>eiN,TargetForeignKey:()=>eiR,TargetKey:()=>eiD,ThroughCollection:()=>ei$,ThroughForeignKey:()=>eiT});var b={};l.r(b),l.d(b,{MenuConfigure:()=>edP,PermissionContext:()=>edM,PermissionProvider:()=>edI,RoleConfigure:()=>edR,RoleResourceCollectionContext:()=>edG,RoleTable:()=>ed_,RolesResourcesActions:()=>edY,ScopeSelect:()=>edW,SettingCenterPermissionProvider:()=>edj,SettingCenterProvider:()=>euS,SettingsCenterConfigure:()=>euC,StrategyActions:()=>edQ,useRolesResourcesScopesSelectedRowKeys:()=>edU});var w={};l.r(w),l.d(w,{ActionBarAssociationFilterAction:()=>euQ,ActionInitializer:()=>euW,ActionInitializerItem:()=>euB,AssociationFilter:()=>ect,AssociationFilterDesignerDelete:()=>ecn,AssociationFilterDesignerDisplayField:()=>eco,AssociationFilterPlugin:()=>ecl,BlockInitializer:()=>ecr,BlockItemInitializer:()=>eci,CreateFilterActionInitializer:()=>eca,CreateResetActionInitializer:()=>ecs,CustomizeActionInitializer:()=>ecd,DataBlockInitializer:()=>ecv,G2PlotInitializer:()=>ecy,InitializerWithSwitch:()=>euU,ModalActionSchemaInitializerItem:()=>ecL,RecordAssociationBlockInitializer:()=>ecb,RecordAssociationDetailsBlockInitializer:()=>ecF,RecordAssociationFormBlockInitializer:()=>ecP,RecordAssociationGridCardBlockInitializer:()=>ecI,RecordAssociationListBlockInitializer:()=>ecE,RecordReadPrettyAssociationFormBlockInitializer:()=>ecB,SearchCollections:()=>ech,SelectActionInitializer:()=>ecO,SubmitActionInitializer:()=>ecq,TableActionColumnInitializer:()=>ec_,useCreateAssociationDetailsBlock:()=>eck,useCreateAssociationDetailsWithoutPagination:()=>ec$,useCreateAssociationFormBlock:()=>ecj,useCreateAssociationGridCardBlock:()=>ecT,useCreateAssociationListBlock:()=>ecN,useCreateAssociationTableBlock:()=>ecw,useMenuSearch:()=>ecg});var S={};function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",l=(null==e?void 0:e.trim())||t;return l.endsWith("/")||(l=`${l}/`),l}function F(e,t){return C(e,C(t,"/"))}l.r(S),l.d(S,{ACLActionParamsContext:()=>edt,ACLActionProvider:()=>edm,ACLCollectionFieldProvider:()=>edf,ACLCollectionProvider:()=>edu,ACLContext:()=>es4,ACLCustomContext:()=>edl,ACLMenuItemProvider:()=>edg,ACLPane:()=>euk,ACLPlugin:()=>euA,ACLProvider:()=>es3,ACLRolesCheckProvider:()=>es6,ADMIN_SETTINGS_KEY:()=>$b,ADMIN_SETTINGS_PATH:()=>$w,AIManager:()=>ex,APIClient:()=>FO,APIClientContext:()=>Fv,APIClientProvider:()=>Fq,AccessControl:()=>Ga,Action:()=>XL,ActionBar:()=>XZ,ActionBarAssociationFilterAction:()=>euQ,ActionBarProvider:()=>XY,ActionContext:()=>UB,ActionContextNoRerender:()=>Uq,ActionContextProvider:()=>U$,ActionDesigner:()=>GV,ActionGroupModel:()=>s_,ActionInitializer:()=>euW,ActionInitializerItem:()=>euB,ActionModel:()=>sz.S0,ActionSceneEnum:()=>sz.s5,ActionType:()=>TM,AddChildActionModel:()=>u$,AddCollection:()=>ei6,AddCollectionAction:()=>ei9,AddCollectionField:()=>eiK,AddFieldAction:()=>eiU,AddNewActionModel:()=>dG,AddSubFieldAction:()=>eaB,AdminDynamicPage:()=>RP,AdminLayout:()=>Dg,AdminLayoutMenuItemModel:()=>Nh,AdminLayoutPlugin:()=>Dv,AdminProvider:()=>NM,AdminSettingsLayout:()=>euy,AdminSettingsLayoutModel:()=>euu,AfterSuccess:()=>GB,AllDataBlocksContext:()=>jf,AllDataBlocksProvider:()=>jg,AntdAppProvider:()=>ea,AntdConfigPlugin:()=>euR,AntdConfigProvider:()=>euT,AntdSchemaComponentPlugin:()=>Zc,AntdSchemaComponentProvider:()=>Zu,AppLangContext:()=>euM,AppNotFound:()=>Mj,AppendsTreeSelect:()=>Zx,Application:()=>zf,ApplicationContext:()=>Fy,AssignFormModel:()=>u_,AssignedFieldValues:()=>Gj,AssociatedFields:()=>epb,AssociationField:()=>etG,AssociationFieldMode:()=>eeZ,AssociationFieldModeProvider:()=>ee2,AssociationFilter:()=>ect,AssociationFilterDesignerDelete:()=>ecn,AssociationFilterDesignerDisplayField:()=>eco,AssociationFilterPlugin:()=>ecl,AssociationOrCollectionProvider:()=>zO,AssociationProvider:()=>MZ,AssociationSelect:()=>etZ,AsyncDataContext:()=>eaf,AsyncDataProvider:()=>eag,AttachmentList:()=>eec,AutoComplete:()=>et1,BackButtonUsedInSubPage:()=>BO,BaseVariableProvider:()=>O2,BlankComponent:()=>$F,Block:()=>eno,BlockAssociationContext:()=>esL,BlockConfigsContext:()=>euE,BlockConfigsProvider:()=>euD,BlockContext:()=>esG,BlockGridModel:()=>dw,BlockInitializer:()=>ecr,BlockItem:()=>HN,BlockItemCard:()=>WB,BlockItemCardContext:()=>WD,BlockItemInitializer:()=>eci,BlockModel:()=>dS.z,BlockProvider:()=>esX,BlockRequestContextProvider:()=>UT,BlockRequestContext_deprecated:()=>esV,BlockRequestLoadingContext:()=>UP,BlockRequestProvider:()=>UR,BlockRequestProvider_deprecated:()=>esU,BlockResourceContext:()=>es_,BlockSceneEnum:()=>dS.P,BlockSchemaComponentPlugin:()=>q2,BlockSchemaComponentProvider:()=>q1,BlockSchemaToolbar:()=>OD,BlockTemplateContext:()=>_n,BlockTemplateDetails:()=>OR,BlockTemplatePage:()=>_t,BlockTemplateProvider:()=>_o,BlockTemplatesPane:()=>_l,BlocksSelector:()=>GD,ButtonEditor:()=>GP,CSSVariableProvider:()=>Me,CardItem:()=>et3,Cascader:()=>elt,Checkbox:()=>eeB,CheckboxFieldInterface:()=>eaJ,CheckboxGroupFieldInterface:()=>eaX,ChildPageModel:()=>dN,ChildPageTabModel:()=>dV,ClearCollectionFieldContext:()=>erI,ClickableFieldModel:()=>gj,CodeEditor:()=>uo.BY,CodeEditorExtension:()=>uo.o8,Collection:()=>F_,CollectionActionGroupModel:()=>sL,CollectionActionModel:()=>dC.U,CollectionBlockModel:()=>dF.t,CollectionCategoriesContext:()=>Rn,CollectionCategoriesProvider:()=>Rs,CollectionCategory:()=>eaV,CollectionContext:()=>erR,CollectionDeletedPlaceholder:()=>erk,CollectionField:()=>Mc,CollectionFieldContext:()=>erj,CollectionFieldInterface:()=>Pu,CollectionFieldInterfaceManager:()=>Pc,CollectionFieldInterfaceTag:()=>eaL,CollectionFieldProvider:()=>erM,CollectionFieldUISchemaProvider:()=>kH,CollectionFieldsToFormInitializerItems:()=>erG,CollectionFieldsToInitializerItems:()=>erW,CollectionFieldsToTableInitializerItems:()=>erJ,CollectionHistoryProvider:()=>TG,CollectionManager:()=>erq,CollectionManagerContext:()=>km,CollectionManagerProvider:()=>kf,CollectionManagerProvider_deprecated:()=>Ro,CollectionManagerSchemaComponentProvider:()=>Rl,CollectionNotAllowViewPlaceholder:()=>erP,CollectionPlugin:()=>esB,CollectionProvider:()=>erE,CollectionProvider_deprecated:()=>TX,CollectionRecord:()=>AA,CollectionRecordContext:()=>AP,CollectionRecordProvider:()=>Aj,CollectionSelect:()=>elr,CollectionSelectFieldInterface:()=>eaQ,CollectionTemplate:()=>er_,CollectionTemplateManager:()=>A_,CollectionTemplateTag:()=>eaz,ColorFieldInterface:()=>eaZ,ColorPicker:()=>elu,ColorSelect:()=>elp,CommonItemModel:()=>dk,CompatibleSchemaInitializer:()=>$4,CreateFilterActionInitializer:()=>eca,CreateFormModel:()=>mV,CreateResetActionInitializer:()=>ecs,CreatedAtFieldInterface:()=>ea0,CreatedByFieldInterface:()=>ea1,Cron:()=>elg,CronSet:()=>elb,CurrentAppInfoContext:()=>Nf,CurrentAppInfoProvider:()=>Nv,CurrentPageUidContext:()=>Pj,CurrentPageUidProvider:()=>Pq,CurrentRouteProvider:()=>Rg,CurrentTabUidContext:()=>PI,CurrentTabUidProvider:()=>P_,CurrentUserContext:()=>Lm,CurrentUserProvider:()=>Lv,CurrentUserSettingsMenuProvider:()=>Lb,CustomRouterContextProvider:()=>P0,CustomizeActionInitializer:()=>ecd,DEBOUNCE_WAIT:()=>100,DEFAULT_DATA_SOURCE_KEY:()=>Pp,DEFAULT_DATA_SOURCE_TITLE:()=>Pm,DataBlockCollector:()=>jb,DataBlockContext:()=>zD,DataBlockInitializer:()=>ecv,DataBlockModel:()=>dA.R,DataBlockProvider:()=>zq,DataBlockResourceContext:()=>jS,DataBlockResourceProvider:()=>jC,DataSource:()=>AO,DataSourceApplicationProvider:()=>jl,DataSourceCollectionCascader:()=>eld,DataSourceContext:()=>ki,DataSourceContext_deprecated:()=>T6,DataSourceManager:()=>Ph,DataSourceManagerContext:()=>kt,DataSourceManagerProvider:()=>kl,DataSourceProvider:()=>ka,DataSourceProvider_deprecated:()=>Re,DataSourceSelect:()=>ela,DateFieldInterface:()=>esj,DateFilterDynamicComponent:()=>HT,DateFormatCom:()=>AK,DatePicker:()=>LO,DatePickerProvider:()=>LD,DatetimeFieldInterface:()=>ea2,DatetimeNoTzFieldInterface:()=>esM,DefaultToolsManager:()=>ey,DefaultValueProvider:()=>Mn,DeleteCollection:()=>eaj,DeleteCollectionAction:()=>eaE,Designable:()=>As,DesignableSwitch:()=>B0,Details:()=>elw,DetailsAssociationFieldGroupModel:()=>cn,DetailsBlockContext:()=>ql,DetailsBlockModel:()=>ca,DetailsBlockProvider:()=>qr,DetailsCustomItemModel:()=>cd,DetailsDesigner:()=>Ql,DetailsGridModel:()=>cu,DetailsItemModel:()=>uQ,DisplaySubTableFieldModel:()=>yL,DisplayTextFieldModel:()=>xu,DisplayTitleFieldModel:()=>yB,Divider:()=>elS,DndContext:()=>TU,DocumentTitleContext:()=>QW,DocumentTitleProvider:()=>QH,DragHandler:()=>R6,DraggableContext:()=>RQ,DropdownVisibleContext:()=>Lp,EMPTY_OBJECT:()=>kP,EditCollection:()=>eal,EditCollectionAction:()=>ean,EditCollectionField:()=>eiG,EditComponent:()=>HK,EditDefaultValue:()=>Hz,EditDescription:()=>Hq,EditFieldAction:()=>eiY,EditFormModel:()=>uZ.EditFormModel,EditOperator:()=>HH,EditPattern:()=>HU,EditRequired:()=>HL,EditSortField:()=>eoX,EditSubFieldAction:()=>eaq,EditTable:()=>elz,EditTableAction:()=>elY,EditTableActionContext:()=>elH,EditTitle:()=>HO,EditTitleField:()=>HG,EditTooltip:()=>H_,EditValidationRules:()=>HV,Editable:()=>en7,EllipsisWithTooltip:()=>U8,EmailFieldInterface:()=>ea8,ErrorFallback:()=>MP,Expand:()=>el3,ExpiresRadio:()=>AH,ExtendCollectionsContext:()=>ku,ExtendCollectionsProvider:()=>kc,FieldModel:()=>aR.o,FieldModelRenderer:()=>H.FieldModelRenderer,FieldSummary:()=>ea_,FieldValidation:()=>eij,FieldsTreeSelect:()=>Zy,Fieldset:()=>el6,Filter:()=>VD,FilterAction:()=>Vw,FilterActionContext:()=>Vx,FilterActionModel:()=>ut,FilterAssociatedFields:()=>epS,FilterBlockModel:()=>dP,FilterBlockProvider:()=>jx,FilterBlockType:()=>jn,FilterContext:()=>Ll,FilterDynamicComponent:()=>VM,FilterFormActionGroupModel:()=>pz,FilterFormBlockModel:()=>ml,FilterFormBlockProvider:()=>qL,FilterFormItemModel:()=>mb,FilterGroup:()=>aT.I8,FilterLogicContext:()=>Ln,FilterParentCollectionFields:()=>epw,FlagContext:()=>Tn,FlagProvider:()=>To,ForeignKey:()=>eiB,Form:()=>X9,FormActionGroupModel:()=>up,FormActionModel:()=>uu,FormActiveFieldsProvider:()=>OM,FormAssociationFieldGroupModel:()=>mX,FormBlockContext:()=>Uz,FormBlockInitializer:()=>epu,FormBlockModel:()=>uq.F4,FormBlockProvider:()=>UH,FormComponent:()=>uq.s2,FormDialog:()=>zU,FormDrawer:()=>eru,FormField:()=>QB,FormFieldContext:()=>qV,FormFieldProvider:()=>qU,FormGridModel:()=>uL,FormItem:()=>H7,FormItemModel:()=>u4,FormItemSchemaToolbar:()=>qp,FormProvider:()=>B8,FormSubmitActionModel:()=>uc,FormV2:()=>QR,G2Plot:()=>enn,G2PlotInitializer:()=>ecy,G2PlotRenderer:()=>enl,GeneralSchemaDesigner:()=>_U,GeneralSchemaItems:()=>Gw,GlobalThemeProvider:()=>eg,Grid:()=>OP,GridCard:()=>enw,GridModel:()=>df,GridRowContext:()=>Op,HTMLEncode:()=>U5,HeightMode:()=>Bo,ICON_POPUP_Z_INDEX:()=>Vg,Icon:()=>AS,IconFieldInterface:()=>ea5,IconPicker:()=>enk,IdFieldInterface:()=>ea4,InheritanceCollectionMixin:()=>esI,InitializerWithSwitch:()=>euU,Input:()=>Wg,InputFieldInterface:()=>ea6,InputFieldModel:()=>v$.m,InputNumber:()=>enD,InputReadPretty:()=>U4,InputRecordPicker:()=>eou,IntegerFieldInterface:()=>ea9,InternalAdminSettingsLayout:()=>euv,IsInNocoBaseRecursionFieldContext:()=>kZ,IsSubPageClosedByPageMenuContext:()=>PE,IsSubPageClosedByPageMenuProvider:()=>PN,JSActionModel:()=>ui,Json:()=>UQ,JsonFieldInterface:()=>ea7,KeepAlive:()=>MO,LAZY_COMPONENT_KEY:()=>k3,LOADING_DELAY:()=>void 0,Layout:()=>Gr,LayoutContent:()=>nr,LinkActionModel:()=>uE,LinkToFieldInterface:()=>ese,LinkageFilter:()=>erC,LinkageRuleCategory:()=>TI,LinkageRuleDataKeyMap:()=>TT,List:()=>enG,LocalDataSource:()=>Aq,LocationSearchContext:()=>PA,M2MFieldInterface:()=>esl,M2OFieldInterface:()=>esn,Markdown:()=>WE,MarkdownFieldInterface:()=>eso,MarkdownReadPretty:()=>WN,MaybeCollectionProvider:()=>esK,Menu:()=>EF,MenuConfigure:()=>edP,MockFlowModelRepository:()=>Ss,ModalActionSchemaInitializerItem:()=>ecL,MultipleSelectFieldInterface:()=>esr,NAMESPACE_UI_SCHEMA:()=>jk,NanoIDInput:()=>enY,NanoidFieldInterface:()=>esA,NocoBaseBuildInPlugin:()=>emW,NocoBaseDesktopRouteType:()=>Rd,NocoBaseRecursionField:()=>k1,NocoBaseRouteContext:()=>Rf,NumberFieldInterface:()=>esi,O2MFieldInterface:()=>esa,O2OFieldInterface:()=>ess,OBOFieldInterface:()=>esu,OHOFieldInterface:()=>esd,OpenModeProvider:()=>BU,OverridingCollectionField:()=>eiX,OverridingFieldAction:()=>eiZ,PMPlugin:()=>eux,Page:()=>Q4,PagePopups:()=>IF,PageTabs:()=>Q3,Pagination:()=>enJ,ParentCollectionFields:()=>epx,ParentRouteContext:()=>Ef,Password:()=>en5,PasswordFieldInterface:()=>esc,Percent:()=>en6,PercentFieldInterface:()=>esp,PermissionContext:()=>edM,PermissionProvider:()=>edI,PhoneFieldInterface:()=>esm,PinnedListPlugin:()=>N_,PinnedPluginList:()=>Nq,PinnedPluginListContext:()=>np,PinnedPluginListProvider:()=>NB,Plugin:()=>Rj,PluginManager:()=>eud,PluginManagerLink:()=>edZ,PluginSettingsManager:()=>$C,PopupActionModel:()=>dW,PopupContextProvider:()=>emQ,PopupSettingsProvider:()=>Mz,PopupSubTableFormActionGroupModel:()=>uf,PoweredBy:()=>emH,Preview:()=>en9,QuickEdit:()=>eoe,REGEX_OF_VARIABLE:()=>jA,REGEX_OF_VARIABLE_IN_EXPRESSION:()=>jP,Radio:()=>eeE,RadioGroupFieldInterface:()=>esh,ReadPretty:()=>U4,ReadPrettyRecordPicker:()=>eof,RecordActionGroupModel:()=>sV,RecordAssociationBlockInitializer:()=>ecb,RecordAssociationDetailsBlockInitializer:()=>ecF,RecordAssociationFormBlockInitializer:()=>ecP,RecordAssociationGridCardBlockInitializer:()=>ecI,RecordAssociationListBlockInitializer:()=>ecE,RecordContext_deprecated:()=>erX,RecordFormBlockInitializer:()=>epm,RecordIndexContext:()=>erQ,RecordIndexProvider:()=>er1,RecordLink:()=>es5,RecordPicker:()=>eog,RecordPickerContent:()=>f_,RecordPickerContext:()=>eor,RecordPickerProvider:()=>eoc,RecordProvider:()=>erZ,RecordReadPrettyAssociationFormBlockInitializer:()=>ecB,RecordSelectFieldModel:()=>cW,RecordSimpleProvider:()=>er0,RefreshActionModel:()=>ub,RefreshComponentProvider:()=>kz,RefreshDataBlockRequest:()=>Gz,RemoteCollectionManagerProvider:()=>Ra,RemoteDocumentTitlePlugin:()=>QX,RemoteDocumentTitleProvider:()=>QG,RemoteSchemaComponent:()=>B6,RemoteSchemaTemplateManagerPlugin:()=>Nk,RemoteSchemaTemplateManagerProvider:()=>NF,RemoteSelect:()=>Qy,RemoveButton:()=>G$,RemoveConditionContext:()=>Lt,RenderChildrenWithAssociationFilter:()=>esH,RequestSettings:()=>GM,RerenderDataBlockProvider:()=>z$,Resizable:()=>epY,ResourceActionContext:()=>TQ,ResourceActionProvider:()=>T2,RichText:()=>eox,RichTextFieldInterface:()=>esf,RoleConfigure:()=>edR,RoleResourceCollectionContext:()=>edG,RoleTable:()=>ed_,RolesResourcesActions:()=>edY,RouteSchemaComponent:()=>R$,RouterContextCleaner:()=>$k,RouterManager:()=>$j,SNIPPET_PREFIX:()=>$S,SanitizedCollectionProvider:()=>erN,SchemaComponent:()=>kA,SchemaComponentContext:()=>ky,SchemaComponentOnChangeContext:()=>kC,SchemaComponentOptions:()=>kb,SchemaComponentPlugin:()=>$l,SchemaComponentProvider:()=>$t,SchemaInitializer:()=>$5,SchemaInitializerActionModal:()=>$0,SchemaInitializerActionModalInternal:()=>$1,SchemaInitializerChild:()=>Tx,SchemaInitializerChildren:()=>Th,SchemaInitializerContext:()=>Tu,SchemaInitializerDivider:()=>$W,SchemaInitializerItem:()=>$_,SchemaInitializerItemContext:()=>Tp,SchemaInitializerItemGroup:()=>$X,SchemaInitializerItemGroupInternal:()=>$Q,SchemaInitializerItemInternal:()=>$L,SchemaInitializerItems:()=>Tb,SchemaInitializerManager:()=>$9,SchemaInitializerMenu:()=>$B,SchemaInitializerMenuProvider:()=>$N,SchemaInitializerOpenModeSchemaItems:()=>Gx,SchemaInitializerPlugin:()=>emK,SchemaInitializerSelect:()=>$2,SchemaInitializerSelectInternal:()=>$8,SchemaInitializerSubMenu:()=>$$,SchemaInitializerSubMenuInternal:()=>$O,SchemaInitializerSwitch:()=>$K,SchemaInitializerSwitchInternal:()=>$U,SchemaSettingAccessControl:()=>Gs,SchemaSettingItemContext:()=>zt,SchemaSettingOpenModeSchemaItems:()=>Gb,SchemaSettings:()=>Dm,SchemaSettingsActionLinkItem:()=>YC,SchemaSettingsActionModalItem:()=>Uu,SchemaSettingsBlockHeightItem:()=>Br,SchemaSettingsBlockTitleItem:()=>HC,SchemaSettingsCascaderItem:()=>Ur,SchemaSettingsChild:()=>zd,SchemaSettingsChildren:()=>zr,SchemaSettingsConnectDataBlocks:()=>Hk,SchemaSettingsDataScope:()=>Vo,SchemaSettingsDataTemplates:()=>Uf,SchemaSettingsDateFormat:()=>Vi,SchemaSettingsDefaultSortingRules:()=>Up,SchemaSettingsDefaultValue:()=>Vu,SchemaSettingsDivider:()=>Ue,SchemaSettingsDropdown:()=>K8,SchemaSettingsEnableChildCollections:()=>Ug,SchemaSettingsFixed:()=>epJ,SchemaSettingsFormItemTemplate:()=>K3,SchemaSettingsItem:()=>K6,SchemaSettingsItemGroup:()=>K9,SchemaSettingsLayoutItem:()=>Gi,SchemaSettingsLinkageRules:()=>Um,SchemaSettingsManager:()=>$7,SchemaSettingsModalItem:()=>Uc,SchemaSettingsNumberFormat:()=>HP,SchemaSettingsPlugin:()=>Xu,SchemaSettingsPopupItem:()=>Ud,SchemaSettingsProvider:()=>K0,SchemaSettingsRemove:()=>Un,SchemaSettingsRenderEngine:()=>Go,SchemaSettingsSelectItem:()=>Uo,SchemaSettingsSortingRule:()=>Vc,SchemaSettingsSubMenu:()=>K7,SchemaSettingsSwitchItem:()=>Us,SchemaSettingsTemplate:()=>Gt,SchemaSettingsWrapper:()=>zc,SchemaTemplateManagerContext:()=>Nx,SchemaToolbar:()=>_G,SchemaToolbarContext:()=>Oi,SchemaToolbarProvider:()=>Oa,SchemaToolbarVisibleContext:()=>_H,ScopeSelect:()=>edW,SearchCollections:()=>ech,SearchParamsContext:()=>PT,SecondConFirm:()=>G_,Select:()=>Qm,SelectActionInitializer:()=>ecO,SelectFieldInterface:()=>esg,SelectWithTitle:()=>je,SetDataLoadingMode:()=>UF,SettingCenterPermissionProvider:()=>edj,SettingCenterProvider:()=>euS,SettingsCenterConfigure:()=>euC,SettingsCenterContext:()=>eup,SettingsCenterDropdown:()=>ed0,SettingsMenuProvider:()=>Lc,ShowFormData:()=>Hj,SkeletonFallback:()=>o9,SkipValidation:()=>GI,SnowflakeIdFieldInterface:()=>esv,Sortable:()=>R2,SortableContext:()=>RZ,SortableItem:()=>R3,SortableProvider:()=>R0,SourceCollection:()=>eiE,SourceForeignKey:()=>eiI,SourceKey:()=>eiN,Space:()=>eob,StablePopover:()=>Vv,StrategyActions:()=>edQ,SubFieldDataSourceProvider_deprecated:()=>T7,SubTableColumnModel:()=>f7,SubTableFieldInterface:()=>esy,SubTableFieldModel:()=>gs,SubmitActionInitializer:()=>ecq,SwitchLanguage:()=>emX,SyncFieldsAction:()=>eam,SyncFieldsActionCom:()=>eah,SyncSQLFieldsAction:()=>eaP,SystemSettingsPane:()=>QK,SystemSettingsPlugin:()=>QU,SystemSettingsSource:()=>eS.o,Table:()=>eoW,TableActionColumnInitializer:()=>ec_,TableAssociationFieldGroupModel:()=>hL,TableBlockContext:()=>D9,TableBlockDesigner:()=>eoQ,TableBlockInitializer:()=>ep8,TableBlockModel:()=>fn,TableBlockProvider:()=>Bl,TableColumnModel:()=>hE,TableColumnSchemaToolbar:()=>qj,TableField:()=>eoZ,TableFieldContext:()=>qG,TableFieldProvider:()=>qQ,TableFieldResource:()=>qJ,TableSelectorContext:()=>I0,TableSelectorDesigner:()=>eo0,TableSelectorInitializer:()=>epG,TableSelectorParamsProvider:()=>I8,TableSelectorProvider:()=>I6,TableV2:()=>eo1,TableoidFieldInterface:()=>esx,Tabs:()=>eo4,TabsContextProvider:()=>M_,TargetForeignKey:()=>eiR,TargetKey:()=>eiD,TemplateBlockProvider:()=>P5,TemplateSummary:()=>ei5,Templates:()=>Qb,TestDesigner:()=>HD,TextAreaWithContextSelector:()=>aw.n,TextAreaWithGlobalScope:()=>era,TextareaFieldInterface:()=>esb,ThroughCollection:()=>ei$,ThroughForeignKey:()=>eiT,TimeFieldInterface:()=>esw,TimePicker:()=>eo7,TreeSelect:()=>ert,UUIDFieldInterface:()=>esk,UnSupportFields:()=>eao,UnixTimestamp:()=>ero,UnixTimestampFieldInterface:()=>esP,UpdateRecordActionModel:()=>uA,UpdatedAtFieldInterface:()=>esS,UpdatedByFieldInterface:()=>esC,Upload:()=>eei,Uploader:()=>eep,UrlFieldInterface:()=>esF,Variable:()=>Yx,VariableFilterItem:()=>aT.Et,VariableInput:()=>Vt,VariablePopupRecordProvider:()=>AD,VariableScope:()=>RU,VariableScopeProvider:()=>Yv,VariableSelect:()=>Wx,VariablesContext:()=>Xw,VariablesProvider:()=>XP,ViewCollectionField:()=>ei1,ViewFieldAction:()=>ei2,WithoutFormFieldResource:()=>qK,WithoutTableFieldResource:()=>qX,actionSettings:()=>GL,actionSettingsItems:()=>GO,addCustomAlgorithmToTheme:()=>em,allowAddNew:()=>VJ,appendQueryStringToUrl:()=>Hp,applyCollectionFieldUiSchemaToDefaultValueSchema:()=>Vd,applyMobilePaginationProps:()=>uw.hO,attachmentFileTypes:()=>Z_,autoFill:()=>Pe,autoIncrement:()=>A7,cache:()=>A.cache,canMakeAssociationBlock:()=>emM,collectionDataSource:()=>Pd,compatOldTheme:()=>ec,completeURL:()=>Hy,compose:()=>zM,constraintsProps:()=>Pl,createCompactSimpleItemRender:()=>uw.hH,createCreateFormBlockUISchema:()=>ecA,createDesignable:()=>Al,createDetailsBlockSchema:()=>_T,createFormActionInitializers:()=>epv,createFormActionInitializers_deprecated:()=>epg,createFormBlockSchema:()=>_R,createFormBlockSettings:()=>Y_,createModalSettingsItem:()=>zF,createReadPrettyFormBlockSchema:()=>_E,createRouterManager:()=>$M,createSelectSchemaSettingsItem:()=>zk,createStyles:()=>lI.rU,createSwitchSettingsItem:()=>zA,createTableBlockSchema:()=>_N,createTableBlockUISchema:()=>ecx,createTextSettingsItem:()=>zP,css:()=>A.css,customAlgorithm:()=>ep,customFormItemInitializers:()=>emj,customFormItemInitializers_deprecated:()=>emP,cx:()=>A.cx,dataSource:()=>Pi,dateTimeProps:()=>Po,defaultFieldNames:()=>Qo,defaultInputStyle:()=>Uv,defaultProps:()=>Pa,defaultTheme:()=>eu,dispatchEventDeep:()=>uw.Xi,ds:()=>T9,editFormBlockSettings:()=>YL,editMarkdownFlow:()=>yT,fetchTemplateData:()=>QS,fieldComponentSettingsItem:()=>YV,fieldSettingsFormItem:()=>Yz,fileSizeSetting:()=>JF,fillParentFields:()=>Hb,filterFormItemSettings:()=>JK,findByUid:()=>R7,findFilterTargets:()=>WG,findFirstPageRoute:()=>Rp,findFormBlock:()=>UJ,findKanbanFormItem:()=>erH,findKeysByUid:()=>El,findMenuItem:()=>Ee,findParentFieldSchema:()=>Uy,findRouteBySchemaUid:()=>Ru,flush:()=>A.flush,formActionInitializers:()=>epy,formDetailsSettings:()=>QD,formItemInitializers:()=>epk,formItemInitializers_deprecated:()=>epF,formItemSettings:()=>VX,formSettings:()=>QE,formV1Settings:()=>X7,genStyleHook:()=>F9,getAppends:()=>Hs,getAssociationPath:()=>Ha,getCardItemSchema:()=>Wq,getCollectionTitle:()=>OB,getConfigurableProperties:()=>eaY,getCurrentOptions:()=>Qa,getDataSourceHeaders:()=>Py,getDateExact:()=>jU,getDatePickerLabels:()=>eon,getDateRanges:()=>jK,getFieldDefaultValue:()=>Uw,getFilterByTkByCollection:()=>esZ,getFlowPageMenuSchema:()=>R_,getFormValues:()=>WK,getIdsWithChildren:()=>D7,getLabelFormatValue:()=>eoo,getLabelWithTooltip:()=>O5,getPageMenuSchema:()=>Rz,getPageSchema:()=>WO,getPinnedPluginListKeys:()=>nc,getPopupPathFromParams:()=>Ia,getRegisteredStyles:()=>A.getRegisteredStyles,getRenderContent:()=>j3,getSchemaSettingsConfirmZIndex:()=>Ul,getSchemaSettingsDialogZIndex:()=>Ut,getShouldChange:()=>Vl,getSimpleModePaginationClassName:()=>uw.HZ,getStoredPopupContext:()=>Ie,getSupportFieldsByAssociation:()=>jr,getSupportFieldsByForeignKey:()=>ji,getSystemSettingsMutationData:()=>QL,getTabSchema:()=>Zr,getURLSearchParams:()=>L3,getURLSearchParamsChildren:()=>L6,getUniqueKeyFromCollection:()=>est,getUnknownCountPaginationTotal:()=>uw.SM,getVariableComponentWithScope:()=>Yb,getVariableValue:()=>Lu,getVariablesFromExpression:()=>jM,getZIndex:()=>Bb,gridRowColWrap:()=>_a,handleDateChangeOnForm:()=>jB,hasIcon:()=>Ab,hydrate:()=>A.hydrate,i18n:()=>Mg,icons:()=>Ay,inferPickerType:()=>jH,injectGlobal:()=>A.injectGlobal,interfacesOfUnsupportedDefaultValue:()=>Mr,interfacesProperties:()=>m,isAssocField:()=>ju,isBulkEditAction:()=>XK,isDeleteButtonDisabled:()=>eib,isFileCollection:()=>Ge,isInFilterFormBlock:()=>jm,isInitializersSame:()=>$6,isMobile:()=>jO,isPatternDisabled:()=>Mt,isSameCollection:()=>jc,isShowFilePicker:()=>eom,isSystemField:()=>Ub,isTabPage:()=>Zo,isTitleField:()=>Pg,isVariable:()=>jj,isWriteEmailAction:()=>XU,itemsMerge:()=>_i,joinCollectionName:()=>esO,joinUrlSearch:()=>uM,keyframes:()=>A.keyframes,languageCodes:()=>Mm,lazy:()=>k9,locale:()=>Mh,mapDatePicker:()=>j$,mapRangePicker:()=>jq,mapTimeFormat:()=>eo9,matchMimetype:()=>ZL,merge:()=>A.merge,mergeFilter:()=>jo,mergePaginationClassName:()=>uw.M6,mockAPIClient:()=>emY,moment2str:()=>jN,navigateToTab:()=>Zn,navigateWithinSelf:()=>Hx,normalizeContainer:()=>zj,openViewFlow:()=>eA,operators:()=>p,pageSettings:()=>Za,pageTabSettings:()=>Zd,parseCollectionName:()=>es$,parseVariablesAndChangeParamsToQueryString:()=>Hg,primaryKey:()=>A9,readPrettyFormSettings:()=>QN,recordBlockInitializers:()=>emR,recordBlockInitializers_deprecated:()=>emT,recordPickerViewer:()=>Ps,recursiveParent:()=>I4,reduceValueSize:()=>Hv,registerIcon:()=>Ax,registerIcons:()=>Aw,registerInitializerMenusGenerator:()=>__,relationshipType:()=>Pt,removeNullCondition:()=>Vz,replaceVariableValue:()=>Hf,replaceVariables:()=>_9,requestParentRecordData:()=>UI,resolveFilterPickerFormat:()=>LR,reverseFieldProperties:()=>Pn,schemaSettingsLabelLayout:()=>Ux,setDataLoadingModeSettingsItem:()=>US,setDefaultSortingRulesSchemaSettingsItem:()=>Gl,setTheDataScopeSchemaSettingsItem:()=>Gn,sheet:()=>A.sheet,shouldRenderIconInTitle:()=>E2,showFileName:()=>Jk,splitWrapSchema:()=>Ai,storePopupContext:()=>It,subTableActionInitializers:()=>emD,subTableActionInitializers_deprecated:()=>emN,systemKeys:()=>Pb,tabPaneInitializers:()=>emL,tabPaneInitializersForBulkEditFormBlock:()=>emz,tabPaneInitializersForRecordBlock:()=>emV,tabPaneInitializers_deprecated:()=>em_,tableActionColumnInitializers:()=>epZ,tableActionColumnInitializers_deprecated:()=>epQ,tableActionInitializers:()=>ep2,tableActionInitializers_deprecated:()=>ep1,tableBlockSettings:()=>Y8,tableColumnInitializers:()=>ep6,tableColumnInitializers_deprecated:()=>ep3,tableColumnSettings:()=>Y4,tableSelectorBlockSettings:()=>Y0,timeProps:()=>Pr,titleField:()=>xG,toToolsMap:()=>eb,transformFilter:()=>ev.transformFilter,transformToFilter:()=>js,transformVariableValue:()=>jI,tval:()=>Mf,type:()=>A3,unique:()=>A6,updateFilterTargets:()=>WY,updateFormActionInitializers:()=>epj,updateFormActionInitializers_deprecated:()=>epP,useACLActionParamsContext:()=>edc,useACLContext:()=>ede,useACLFieldWhitelist:()=>edh,useACLRoleContext:()=>eds,useACLRolesCheck:()=>edo,useAPIClient:()=>Fb,useAPITokenVariable:()=>LC,useAclSnippets:()=>zh,useActionAvailable:()=>ec4,useActionBarContext:()=>XJ,useActionContext:()=>U_,useAdminSchemaUid:()=>edv,useAfterSuccessOptions:()=>GS,useAllAccessDesktopRoutes:()=>Rx,useAllCollectionsInheritChainGetter:()=>ko,useAllDataBlocks:()=>jv,useApp:()=>Fx,useAppLangContext:()=>euI,useAppSpin:()=>zg,useAriaAttributeOfMenuItem:()=>$q,useAssociatedFields:()=>jd,useAssociatedFormItemInitializerFields:()=>_x,useAssociatedTableColumnInitializerFields:()=>_h,useAssociationCreateActionProps:()=>WH,useAssociationFieldContext:()=>Db,useAssociationFieldModeContext:()=>ee8,useAssociationFilterBlockProps:()=>Hr,useAssociationFilterProps:()=>Hl,useAssociationName:()=>M0,useAssociationNames:()=>Hd,useAsyncData:()=>eav,useAttach:()=>IE,useBackButton:()=>B$,useBaseVariable:()=>O4,useBlockAssociationContext:()=>esQ,useBlockConfigs:()=>euN,useBlockContext:()=>esY,useBlockHeight:()=>Bm,useBlockHeightProps:()=>W$,useBlockRequestContext:()=>esW,useBlockResource:()=>esz,useBlockTemplateContext:()=>_r,useBuiltinVariables:()=>Xc,useBulkDestroyAction:()=>eaR,useBulkDestroyActionAndRefreshCM:()=>eaI,useBulkDestroyActionProps:()=>W6,useCancelAction:()=>er4,useCloseAction:()=>UL,useCollectValuesToSubmit:()=>WU,useCollection:()=>erD,useCollectionDataSource:()=>eln,useCollectionDataSourceItems:()=>_I,useCollectionField:()=>erT,useCollectionFieldFormValues:()=>eiV,useCollectionField_deprecated:()=>ell,useCollectionFields:()=>erB,useCollectionFieldsOptions:()=>eir,useCollectionFilterOptions:()=>eil,useCollectionHistory:()=>TJ,useCollectionManager:()=>kg,useCollectionManager_deprecated:()=>P7,useCollectionParentRecord:()=>AT,useCollectionParentRecordData:()=>AR,useCollectionRecord:()=>AM,useCollectionRecordData:()=>AI,useCollectionState:()=>Pw,useCollection_deprecated:()=>Oe,useCollections:()=>kv,useColumnSchema:()=>On,useColumnSettings:()=>DP,useCompatOldVariables:()=>Vn,useCompile:()=>kI,useComponent:()=>IN,useContextAssociationFields:()=>Ld,useContextVariable:()=>HZ,useCreateActionProps:()=>WW,useCreateAssociationDetailsBlock:()=>eck,useCreateAssociationDetailsWithoutPagination:()=>ec$,useCreateAssociationFormBlock:()=>ecj,useCreateAssociationGridCardBlock:()=>ecT,useCreateAssociationListBlock:()=>ecN,useCreateAssociationTableBlock:()=>ecw,useCreateEditFormBlock:()=>eph,useCreateFormBlock:()=>epc,useCreateTableBlock:()=>ep5,useCurrentAppInfo:()=>Ng,useCurrentDocumentTitle:()=>QJ,useCurrentPageUid:()=>PG,useCurrentPopupContext:()=>Ij,useCurrentPopupRecord:()=>AB,useCurrentRoleMode:()=>es7,useCurrentRoleVariable:()=>L4,useCurrentRoles:()=>Lg,useCurrentRoute:()=>Rv,useCurrentSchema:()=>_j,useCurrentSearchParams:()=>PX,useCurrentTabUid:()=>PJ,useCurrentUserContext:()=>Lh,useCurrentUserSettingsMenu:()=>Lx,useCurrentUserVariable:()=>LS,useCustomizeBulkUpdateActionProps:()=>W1,useCustomizeRequestActionProps:()=>W2,useCustomizeUpdateActionProps:()=>W0,useDataBlock:()=>z_,useDataBlockHeight:()=>Bp,useDataBlockParentRecord:()=>W_,useDataBlockProps:()=>zL,useDataBlockRequest:()=>UE,useDataBlockRequestData:()=>UD,useDataBlockRequestGetter:()=>UN,useDataBlockResource:()=>jF,useDataLoadingMode:()=>UC,useDataSource:()=>ks,useDataSourceFromRAC:()=>T5,useDataSourceHeaders:()=>Pv,useDataSourceKey:()=>kd,useDataSourceManager:()=>kn,useDataTemplates:()=>Uh,useDatePickerContext:()=>LN,useDateVariable:()=>L_,useDatetimeVariable:()=>LV,useDatetimeVariableContext:()=>LL,useDeleteRouteSchema:()=>Df,useDesignable:()=>Au,useDesigner:()=>IB,useDestroyAction:()=>eaT,useDestroyActionAndRefreshCM:()=>eaM,useDestroyActionProps:()=>W5,useDetailsBlockContext:()=>qi,useDetailsBlockProps:()=>qa,useDetailsDecoratorProps:()=>qd,useDetailsPaginationProps:()=>Ht,useDetailsParentRecord:()=>qu,useDetailsProps:()=>qc,useDetailsWithPaginationBlockParams:()=>O$,useDetailsWithPaginationDecoratorProps:()=>OO,useDetailsWithPaginationProps:()=>qs,useDisassociateActionProps:()=>W3,useDocumentTitle:()=>QY,useDownloadLogs:()=>MA,useEditTableActionProps:()=>He,useEnsureOperatorsValid:()=>HW,useExactDateVariable:()=>LK,useExactDateVariableContext:()=>Lz,useExtendCollections:()=>kp,useFieldComponentName:()=>ze,useFieldComponentOptions:()=>Iq,useFieldInterfaceOptions:()=>eiq,useFieldMode:()=>V4,useFieldModeOptions:()=>Bg,useFieldNames:()=>eot,useFieldProps:()=>I$,useFieldTitle:()=>I_,useFilterAPI:()=>jp,useFilterActionProps:()=>VK,useFilterBlock:()=>jw,useFilterBlockActionProps:()=>WX,useFilterByTk:()=>es0,useFilterFieldOptions:()=>VL,useFilterFieldProps:()=>VU,useFilterOptions:()=>V$,useFindComponent:()=>Ad,useFlag:()=>Tr,useFormActiveFields:()=>OI,useFormBlockContext:()=>UG,useFormBlockProps:()=>UY,useFormBlockType:()=>UU,useFormDataTemplates:()=>Qx,useFormFieldContext:()=>qW,useFormFieldProps:()=>qH,useFormItemInitializerFields:()=>_v,useGetAriaLabelOfAction:()=>XO,useGetAriaLabelOfDesigner:()=>_L,useGetAriaLabelOfDrawer:()=>Bv,useGetAriaLabelOfModal:()=>BM,useGetAriaLabelOfPopover:()=>X0,useGetFilterFieldOptions:()=>VO,useGetFilterOptions:()=>VB,useGetSchemaInitializerMenuItems:()=>$R,useGlobalTheme:()=>ef,useGlobalVariable:()=>zx,useGlobalVariableCtx:()=>zb,useGridContext:()=>OF,useGridRowContext:()=>Ok,useHistoryCollectionsByNames:()=>TY,useInheritsTableColumnInitializerFields:()=>_g,useInsertPageSchema:()=>RL,useIsAddNewForm:()=>VQ,useIsAdminPage:()=>PH,useIsAllowToSetDefaultValue:()=>Mo,useIsAssociationField:()=>V8,useIsDetailBlock:()=>UW,useIsFieldReadPretty:()=>V1,useIsFileField:()=>V5,useIsFormReadPretty:()=>V0,useIsInSettingsPage:()=>PY,useIsLoggedIn:()=>Lf,useIsSameOrChildCollection:()=>La,useIsSelectFieldMode:()=>V3,useIsSubPageClosedByPageMenu:()=>PZ,useKeepAlive:()=>MN,useKeepAliveLocationSearch:()=>Q5,useLabelUiSchema:()=>eol,useLazy:()=>k7,useLinkActionProps:()=>Hh,useLinkageAction:()=>UV,useLinkageCollectionFilterOptions:()=>eio,useListBlockContext:()=>enq,useLocalVariables:()=>H0,useLocalVariablesWithoutCustomVariable:()=>XR,useLocationNoUpdate:()=>PU,useLocationSearch:()=>PW,useMenuDragEnd:()=>EC,useMenuSearch:()=>ecg,useMenuTranslation:()=>R9,useMobileLayout:()=>SQ,useNavigateNoUpdate:()=>PK,useNocoBaseRoutes:()=>Ev,useOpenModeContext:()=>BW,useOptionalFieldList:()=>Hn,useParamsFromRecord:()=>es8,useParentCollection:()=>MQ,useParentRecordCommon:()=>IH,useParentRoute:()=>Eg,useParseDataScopeFilter:()=>Gu,useParseURLAndParams:()=>Hm,useParsedFilter:()=>IW,usePickActionProps:()=>WL,usePlugin:()=>zv,usePopupSettings:()=>MK,usePopupUtils:()=>Is,usePopupVariable:()=>L8,usePopupVariableContext:()=>L2,useProps:()=>IV,useRecord:()=>er2,useRecordCollectionDataSourceItems:()=>_M,useRecordIndex:()=>er8,useRecordIsOwn:()=>er5,useRecordPkValue:()=>edp,useRefreshActionProps:()=>W9,useRefreshFieldSchema:()=>kU,useRemoteCollectionManagerLoading:()=>Ri,useRemoveActionProps:()=>W4,useRemoveGridFormItem:()=>_u,useRequest:()=>FI,useRerenderDataBlock:()=>zV,useResetBlockActionProps:()=>WZ,useResource:()=>FT,useResourceActionContext:()=>T8,useResourceContext:()=>T4,useRoleRecheck:()=>es9,useRoleVariable:()=>L5,useRolesResourcesScopesSelectedRowKeys:()=>edU,useRouter:()=>zy,useRouterBasename:()=>PQ,useSchemaComponentContext:()=>IO,useSchemaInitializer:()=>Tc,useSchemaInitializerItem:()=>Tm,useSchemaInitializerMenuItems:()=>$T,useSchemaInitializerRender:()=>Tj,useSchemaInitializerStyles:()=>TC,useSchemaInitializerSubMenuContext:()=>$D,useSchemaOptionsContext:()=>kx,useSchemaSettings:()=>KZ,useSchemaSettingsItem:()=>zl,useSchemaSettingsRender:()=>Ou,useSchemaTemplate:()=>Nw,useSchemaTemplateManager:()=>NS,useSchemaToolbar:()=>Os,useSchemaToolbarRender:()=>_J,useSortFields:()=>er7,useSourceId:()=>esq,useSourceIdFromParentRecord:()=>es2,useSourceIdFromRecord:()=>es1,useStyles:()=>RB,useSupportedBlocks:()=>ja,useSyncFromForm:()=>HS,useSystemSettings:()=>eS.e,useSystemSettingsVariable:()=>zH,useTableBlockContext:()=>Bn,useTableBlockContextBasicValue:()=>MY,useTableBlockDecoratorProps:()=>IG,useTableBlockParams:()=>IY,useTableBlockProps:()=>qM,useTableColumnInitializerFields:()=>_m,useTableColumnIntegration:()=>Dj,useTableColumns:()=>W7,useTableFieldContext:()=>qZ,useTableFieldProps:()=>q0,useTableSelectorContext:()=>I9,useTableSelectorProps:()=>I7,useTableSize:()=>Bh,useTabsContext:()=>ML,useTemplateBlockContext:()=>P2,useTitleFieldOptions:()=>V7,useToken:()=>Bj,useUIConfigurationPermissions:()=>edd,useURLAndHTMLSchema:()=>YS,useURLSearchParamsCtx:()=>L9,useURLSearchParamsVariable:()=>L7,useUpdateActionProps:()=>W8,useUpdateCollectionActionAndRefreshCM:()=>eat,useUploadStyles:()=>Z1,useUserVariable:()=>Lw,useValidateSchema:()=>V6,useValuesFromRecord:()=>eae,useVariableOptions:()=>Ve,useVariableScope:()=>Yy,useVariableScopeInfo:()=>RW,useVariables:()=>H1,useViewport:()=>edx,useZIndexContext:()=>Bx,withDynamicSchemaProps:()=>Af,withInitializer:()=>TA,withSearchParams:()=>Iu,withSkeletonComponent:()=>Ta,zIndexContext:()=>By});let k=l.p;"u">typeof window&&void 0!==l.p&&(l.p=F(window.__webpack_public_path__,k)),l(37872),l(98867),l(8906),l(68313),l(21840),l(41816),l(83826),l(46986),l(70571);var A=l(22803),P=l(88909),j=l(55373),M=l.n(j);let I=(e,t)=>{if(!e)return;let l="function"==typeof e.toJSON?e.toJSON():e,n=Object.keys(l||{}).find(e=>e.toLowerCase()===t.toLowerCase());return n?l[n]:void 0},T=(e,t)=>{let l=I(e,t);return null!=l&&""!==l};class R{get storagePrefix(){return this.api.storagePrefix}get locale(){return this.getLocale()}set locale(e){this.setLocale(e)}get role(){return this.getRole()}set role(e){this.setRole(e)}get token(){return this.getToken()}set token(e){this.setToken(e)}get authenticator(){return this.getAuthenticator()}set authenticator(e){this.setAuthenticator(e)}getOption(e){return this.api.storage.getItem(e)}setOption(e,t){return this.options[e]=t,this.api.storage.setItem(e,t||"")}getLocale(){return this.getOption("locale")}setLocale(e){this.setOption("locale",e)}getRole(){return this.getOption("role")}setRole(e){this.setOption("role",e)}getToken(){return this.getOption("token")}setToken(e){this.setOption("token",e),this.api.app&&this.api.app.eventBus.dispatchEvent(new CustomEvent("auth:tokenChanged",{detail:{token:e,authenticator:this.authenticator}}))}getAuthenticator(){return this.getOption("auth")}setAuthenticator(e){this.setOption("auth",e)}middleware(e){return this.locale&&e.headers&&(e.headers["X-Locale"]=this.locale),this.role&&e.headers&&(e.headers["X-Role"]=this.role),this.authenticator&&!T(e.headers,"X-Authenticator")&&e.headers&&(e.headers["X-Authenticator"]=this.authenticator),this.token&&!T(e.headers,"Authorization")&&e.headers&&(e.headers.Authorization=`Bearer ${this.token}`),e}async signIn(e,t){var l;let n=await this.api.request({method:"post",url:"auth:signIn",data:e,headers:{"X-Authenticator":t}}),o=null==n||null==(l=n.data)?void 0:l.data;return this.setAuthenticator(t),this.setToken(null==o?void 0:o.token),n}async signUp(e,t){return await this.api.request({method:"post",url:"auth:signUp",data:e,headers:{"X-Authenticator":t}})}async signOut(){let e=await this.api.request({method:"post",url:"auth:signOut"});return this.setToken(null),this.setRole(null),this.setAuthenticator(null),e}async lostPassword(e){let t=Object.fromEntries(new URLSearchParams(window.location.search).entries());return await this.api.request({method:"post",url:"auth:lostPassword",data:{...e,baseURL:window.location.href.split("/forgot-password")[0]},headers:{"X-Authenticator":t.name}})}async resetPassword(e){return await this.api.request({method:"post",url:"auth:resetPassword",data:e})}async checkResetToken(e){return await this.api.request({method:"post",url:"auth:checkResetToken",data:e})}constructor(e){this.options={locale:null,role:null,authenticator:null,token:null},this.api=e,this.api.axios.interceptors.request.use(this.middleware.bind(this))}}class E{toUpperCase(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];return e.toUpperCase()+l.map(e=>e.toUpperCase()).join("_")}}class N extends E{clear(){this.items.clear()}getItem(e){return this.items.get(e)}setItem(e,t){return this.items.set(e,t)}removeItem(e){return this.items.delete(e)}constructor(...e){super(...e),this.items=new Map}}class D extends E{clear(){return this.items.clear()}getItem(e){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.getItem(this.toUpperCase(this.baseStoragePrefix,e)):this.items.getItem(this.toUpperCase(this.storagePrefix,e))}setItem(e,t){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.setItem(this.toUpperCase(this.baseStoragePrefix,e),t):this.items.setItem(this.toUpperCase(this.storagePrefix,e),t)}removeItem(e){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.removeItem(this.toUpperCase(this.baseStoragePrefix,e)):this.items.removeItem(this.toUpperCase(this.storagePrefix,e))}constructor(e,t="",l=!1){super(),this.storagePrefix=e,this.baseStoragePrefix=t,this.shareToken=l,this.items=window.localStorage}}class B extends D{constructor(e,t="",l=!1){super(e,t,l),this.storagePrefix=e,this.baseStoragePrefix=t,this.shareToken=l,this.items=window.sessionStorage}}class ${toErrMessages(e){var t,l,n,o,r,i,a,s,d,u,c;if("u">typeof document&&"string"==typeof(null==e||null==(t=e.response)?void 0:t.data)){let t=document.createElement("div");t.innerHTML=null==e||null==(d=e.response)?void 0:d.data;let l=t.textContent||t.innerText;return l.includes("Error occurred while trying")||l.includes("502 Bad Gateway")?[{code:"APP_WARNING",message:l="The application may be starting up. Please try again later."}]:[{message:l}]}return(null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.error)?[null==e||null==(c=e.response)||null==(u=c.data)?void 0:u.error]:(null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.errors)||(null==e||null==(a=e.response)||null==(i=a.data)?void 0:i.messages)||(null==e||null==(s=e.response)?void 0:s.error)||[{message:e.message||"Server error"}]}getHeaders(){let e={};return this.auth.locale&&(e["X-Locale"]=this.auth.locale),this.auth.role&&(e["X-Role"]=this.auth.role),this.auth.authenticator&&(e["X-Authenticator"]=this.auth.authenticator),this.auth.token&&(e.Authorization=`Bearer ${this.auth.token}`),e}createStorage(e){return"localStorage"===e&&"u">typeof localStorage?new D(this.storagePrefix,this.baseStoragePrefix,this.shareToken):"sessionStorage"===e&&"u">typeof sessionStorage?new B(this.storagePrefix,this.baseStoragePrefix,this.shareToken):new N}initStorage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"localStorage";if(e){this.storage=new e(this);return}this.storage=this.createStorage(t)}interceptors(){this.axios.interceptors.request.use(e=>(e.paramsSerializer=e=>M().stringify(e,{strictNullHandling:!0,arrayFormat:"brackets"}),e))}request(e){let{resource:t,resourceOf:l,action:n,params:o,headers:r}=e;return t?this.resource(t,l,r)[n](o):this.axios.request(e)}resource(e,t,l,n){return new Proxy({},{get:(o,r)=>{if(n)return;let i=e.split(".").join(`/${encodeURIComponent(t)||"_"}/`),a={url:i+=`:${r.toString()}`};return["get","list"].includes(r)?a.method="get":a.method="post",async(e,t)=>{let{values:n,filter:o,...r}=e||{};return a.params=r,o&&("string"==typeof o?a.params.filter=o:(o["*"]&&delete o["*"],a.params.filter=JSON.stringify(o))),"get"!==a.method&&(a.data=n||{}),await this.request({...a,...t,headers:l})}}})}constructor(e){if(this.storagePrefix="NOCOBASE_",this.baseStoragePrefix="NOCOBASE_",this.shareToken=!1,this.options=e,"function"==typeof e)this.axios=e;else{const{appName:t,authClass:l,storageType:n,storageClass:o,storagePrefix:r="NOCOBASE_",shareToken:i=!1,...a}=e||{};this.shareToken=i,this.baseStoragePrefix=r,this.storagePrefix=t?`${r}${t.toUpperCase()}_`:r,this.axios=P.A.create(a),this.initStorage(o,n),l&&(this.auth=new l(this))}this.storage||this.initStorage(),this.auth||(this.auth=new R(this)),this.interceptors()}}let O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";if("u"<typeof window||!window.location.pathname)return;let t=`${e}apps/`;if(window.location.pathname.startsWith(t))return window.location.pathname.substring(t.length).split("/",1)[0]||""};function q(e){let t=Math.floor(Math.abs(e)),l=Math.abs(e%1*60),n=String(t).padStart(2,"0"),o=String(l).padStart(2,"0"),r=e>=0?"+":"-";return`${r}${n}:${o}`}function _(){return q(-(new Date().getTimezoneOffset()/60))}class L extends ${getHostname(){var e,t;try{return new URL("/api/").hostname}catch{}return null==(t=window)||null==(e=t.location)?void 0:e.hostname}getHeaders(){let e=super.getHeaders();return this.appName&&(e["X-App"]=this.appName),e["X-Timezone"]=_(),e["X-Hostname"]=this.getHostname(),e}interceptors(){this.axios.interceptors.request.use(e=>{let t=this.getHeaders();return Object.keys(t).forEach(l=>{T(e.headers,l)||(e.headers[l]=t[l])}),e}),super.interceptors()}constructor(e){super(e),e&&"function"!=typeof e&&(this.appName=e.appName)}}var V=l(58587),z=l(18150),K=l(68238),U=l(74848),W=l(95243),H=l(11869),G=l(40098),Y=l.n(G),J=l(96540),X=l(5338),Q=l(52230),Z=l(47665),ee=l(84976),et=l(47767),el=l(44363),en=l(36098),eo=l(88040);let er=(0,J.memo)(e=>{let{children:t}=e,l=(0,en.n)(),{notification:n}=eo.A.useApp();return(0,J.useLayoutEffect)(()=>{l.context.defineProperty("notification",{value:n})},[l,n]),(0,U.jsx)(U.Fragment,{children:t})});er.displayName="AppInner";let ei=e=>{let{children:t,className:l,style:n}=e;return(0,U.jsx)(eo.A,{className:l,style:{height:"100%",...n},children:(0,U.jsx)(er,{children:t})})};ei.displayName="AntdAppProvider";let ea=ei;var es=l(35710),ed=l(4888);let eu={name:"",token:{colorPrimaryHeader:"#001529",colorBgHeader:"#001529",colorBgHeaderMenuHover:"#ffffff1a",colorBgHeaderMenuActive:"#ffffff1a",colorTextHeaderMenu:"#ffffffa6",colorTextHeaderMenuHover:"#ffffff",colorTextHeaderMenuActive:"#ffffff",colorSettings:"#F18B62",colorBgSettingsHover:"rgba(241, 139, 98, 0.06)",colorTemplateBgSettingsHover:"rgba(98, 200, 241, 0.06)",colorBorderSettingsHover:"rgba(241, 139, 98, 0.3)",motionUnit:.03}},ec=function(e){var t;return(null==(t=e.token)?void 0:t.colorSettings)||(e.token={...e.token,...eu.token}),e},ep=(e,t)=>{var l,n,o,r,i,a,s,d,u,c,p,m;let h=t||es.A.defaultAlgorithm(e);return(l=h).paddingPageHorizontal??(l.paddingPageHorizontal=h.sizeLG),(n=h).paddingPageVertical??(n.paddingPageVertical=h.sizeLG),(o=h).paddingPopupHorizontal??(o.paddingPopupHorizontal=h.sizeLG),(r=h).paddingPopupVertical??(r.paddingPopupVertical=h.size),(i=h).marginBlock??(i.marginBlock=h.sizeLG),(a=h).borderRadiusBlock??(a.borderRadiusBlock=h.borderRadiusLG),(s=h).colorBgSider??(s.colorBgSider=h.colorBgElevated),(d=h).colorBgSiderMenuHover??(d.colorBgSiderMenuHover=h.colorBgTextHover||h.colorFillSecondary),(u=h).colorBgSiderMenuActive??(u.colorBgSiderMenuActive=h.colorPrimaryBg),(c=h).colorTextSiderMenu??(c.colorTextSiderMenu=h.colorText),(p=h).colorTextSiderMenuHover??(p.colorTextSiderMenuHover=h.colorText),(m=h).colorTextSiderMenuActive??(m.colorTextSiderMenuActive=h.colorPrimary),h},em=e=>(Array.isArray(e.algorithm)?e.algorithm.includes(ep)||e.algorithm.push(ep):e.algorithm=[e.algorithm,ep].filter(Boolean),e.algorithm=e.algorithm.filter(Boolean),e);(0,A.injectGlobal)`
3
3
  .ant-form-item-label > label {
4
4
  font-weight: 600;
@@ -1024,7 +1024,7 @@ ctx.render(<JsItem />);
1024
1024
  display: flex;
1025
1025
  margin: 5px 0px;
1026
1026
  }
1027
- `,defaultValue:"h:mm a",formats:["hh:mm:ss a","HH:mm:ss"],timeFormat:!0},default:"HH:mm:ss",enum:[{label:(0,Cg.b)({format:"hh:mm:ss a"}),value:"hh:mm:ss a"},{label:(0,Cg.b)({format:"HH:mm:ss"}),value:"HH:mm:ss"},{label:"custom",value:"custom"}]}},CA={type:"array",title:'{{t("Options")}}',"x-decorator":"FormItem","x-component":"ArrayTable","x-component-props":{pagination:{pageSize:1e3}},items:{type:"object",properties:{column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:50,title:"",align:"center"},properties:{sort:{type:"void","x-component":"ArrayTable.SortHandle"}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Option value")}}'},properties:{value:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"Input"}}},column3:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Option label")}}'},properties:{label:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"Input"}}},column4:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Color")}}'},properties:{color:{type:"string","x-decorator":"FormItem","x-component":"ColorSelect"}}},column5:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:"",dataIndex:"operations",fixed:"right"},properties:{item:{type:"void","x-component":"FormItem",properties:{remove:{type:"void","x-component":"ArrayTable.Remove"}}}}}}},properties:{add:{type:"void","x-component":"ArrayTable.Addition","x-component-props":{randomValue:!0},title:"{{t('Add option')}}"}}},CP={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input","x-validator":"uid",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"}},Cj={type:"string",title:'{{t("Options")}}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{multiple:!0},enum:"{{collections}}"};class CM{addComponentOption(e){if(!this.componentOptions){var t,l,n,o,r,i;this.componentOptions=[];let e=null==(l=this.default)||null==(t=l.uiSchema)?void 0:t["x-component"],a=null==(o=this.default)||null==(n=o.uiSchema)?void 0:n["x-component-props"];if(e){let t=(null==(i=this.default)||null==(r=i.uiSchema)?void 0:r.type)||"string",l=(0,ev.tval)(e.startsWith("Input")?(0,G.capitalize)(t):e.split(".").pop());this.componentOptions=[{label:l,value:e,useProps:()=>a||{}}]}}this.componentOptions.push(e)}getConfigureFormProperties(e){var t,l,n,o;let r=(null==(l=this.configure)||null==(t=l.getConfigureFormProperties)?void 0:t.call(l,e))||(null==(n=this.configure)?void 0:n.properties)||{},i=this.hasDefaultValue?this.getDefaultValueProperty():{},a=null==e?void 0:e.view,s=(null==e?void 0:e.template)==="sql"||(null==e?void 0:e.sql),d=[...new Set([...this.availableValidationOptions,"required"])],u=a||s||!this.validationType?{}:{validation:{title:'{{ t("Validation") }}',required:!1,"x-decorator":"FormItem","x-component":"FieldValidation","x-component-props":{type:this.validationType,availableValidationOptions:d,excludeValidationOptions:[...new Set(this.excludeValidationOptions)],isAssociation:this.isAssociation}}};return{...(0,G.cloneDeep)({...CP,...null==(o=this)?void 0:o.properties,...r}),...i,...u}}getDefaultValueProperty(){var e,t,l,n;return{defaultValue:{...(0,G.cloneDeep)(null==(t=this)||null==(e=t.default)?void 0:e.uiSchema),...null==(n=this)||null==(l=n.properties)?void 0:l.uiSchema,required:!1,title:'{{ t("Default value") }}',"x-decorator":"FormItem"}}}addOperator(e){this.filterable||(0,G.set)(this,"filterable",{});let t=Array.isArray(this.filterable.operatorOverrides)?[...this.filterable.operatorOverrides]:[],l=t.findIndex(t=>t.value===e.value);-1!==l?t[l]=e:t.push(e),(0,G.set)(this,"filterable.operatorOverrides",t),ib(this.filterable)}constructor(e){this.collectionFieldInterfaceManager=e,this.availableValidationOptions=[]}}class CI extends CM{constructor(...e){super(...e),this.name="checkbox",this.type="object",this.group="choices",this.order=1,this.title='{{t("Checkbox")}}',this.default={type:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},this.availableTypes=["boolean","integer","bigInt","bit"],this.hasDefaultValue=!0,this.properties={...CP},this.filterable={operators:"boolean"}}}class CT extends CM{constructor(...e){super(...e),this.name="checkboxGroup",this.type="object",this.group="choices",this.order=5,this.title='{{t("Checkbox group")}}',this.default={interface:"checkboxGroup",type:"array",defaultValue:[],uiSchema:{type:"string","x-component":"Checkbox.Group"}},this.availableTypes=["array","json"],this.hasDefaultValue=!0,this.properties={...CP,"uiSchema.enum":CA},this.filterable={operators:"array"}}}class CR extends CM{constructor(...e){super(...e),this.name="collection",this.type="string",this.group="advanced",this.order=5,this.title='{{t("Collection selector")}}',this.description='{{t("Providing certain collections as options for users, typically used in polymorphic or inheritance scenarios")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"CollectionSelect"}},this.availableTypes=["string"],this.hasDefaultValue=!1,this.properties={...CP,"uiSchema.enum":Cj},this.filterable={operators:"collection"}}}class CE extends CM{constructor(...e){super(...e),this.name="color",this.type="object",this.group="basic",this.order=10,this.title='{{t("Color")}}',this.default={type:"string",uiSchema:{type:"string","x-component":"ColorPicker"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.properties={...CP},this.filterable={operators:"string"}}}class CN extends CM{constructor(...e){super(...e),this.name="createdAt",this.type="object",this.group="systemInfo",this.order=1,this.title='{{t("Created at")}}',this.sortable=!0,this.default={type:"date",field:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},this.description='{{t("Store the creation time of each record")}}',this.availableTypes=[],this.properties={...CP,...CF},this.filterable={operators:"datetime"},this.titleUsable=!0}}class CD extends CM{constructor(...e){super(...e),this.name="createdBy",this.type="object",this.group="systemInfo",this.order=3,this.title='{{t("Created by")}}',this.isAssociation=!0,this.default={type:"belongsTo",target:"users",foreignKey:"createdById",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},this.availableTypes=["belongsTo"],this.properties={...CP},this.filterable={nested:!0,children:[]},this.description='{{t("Store the creation user of each record")}}'}}class CB extends CM{constructor(...e){super(...e),this.name="datetime",this.type="object",this.group="datetime",this.order=1,this.title='{{t("Datetime (with time zone)")}}',this.sortable=!0,this.default={type:"date",defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,timezone:!0,uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{showTime:!1,utc:!0}}},this.availableTypes=["date","string","datetime","datetimeTz"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...CP,...CF,defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp on update")}}'},"uiSchema.x-component-props.gmt":{type:"boolean",title:'{{t("GMT")}}',"x-hidden":!0,"x-component":"Checkbox","x-content":'{{t("Use the same time zone (GMT) for all users")}}',"x-decorator":"FormItem",default:!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class C$ extends CM{constructor(...e){super(...e),this.name="email",this.type="object",this.group="basic",this.order=4,this.title='{{t("Email")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Input","x-validator":"email"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","email","pattern"],this.properties={...CP,unique:Cv},this.filterable={operators:"string"},this.titleUsable=!0}}class CO extends CM{constructor(...e){super(...e),this.name="icon",this.type="object",this.group="basic",this.order=10,this.title='{{t("Icon")}}',this.default={type:"string",uiSchema:{type:"string","x-component":"IconPicker"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.properties={...CP}}}class Cq extends CM{constructor(...e){super(...e),this.name="id",this.type="object",this.group="systemInfo",this.order=0,this.title='{{t("ID")}}',this.hidden=!0,this.sortable=!0,this.default={name:"id",type:"bigInt",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0}},this.availableTypes=["bigInt","integer"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,default:"ID","x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"}},this.filterable={operators:"id"},this.description='{{t("Primary key, unique identifier, self growth") }}',this.titleUsable=!0}}let C_=e=>e,CL=e=>{if((0,rj.isArr)(e)){for(let t=0;t<e.length;t++)if((0,rj.isValid)(e[t]))return!1;return!0}if(null==e?void 0:e.getCurrentContent){var t;return!(null==(t=e.getCurrentContent())?void 0:t.hasText())}return(0,rj.isEmpty)(e)};(0,S4.registerValidateRules)({username:e=>/^[^@<>"'/]{1,50}$/.test(e)||C_("Must be 1-50 characters in length (excluding @<>\"'/)"),required:(e,t)=>!1===t.required?"":("string"==typeof e&&(e=e.trim()),CL(e)?t.message:"")});class CV extends CM{constructor(...e){super(...e),this.name="input",this.type="object",this.group="basic",this.order=1,this.title='{{t("Single line text")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.sortable=!0,this.default={interface:"input",type:"string",uiSchema:{type:"string","x-component":"Input"}},this.availableTypes=["string","uid"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.properties={...CP,trim:{type:"boolean","x-content":'{{t("Automatically remove heading and tailing spaces")}}',"x-decorator":"FormItem","x-component":"Checkbox"},layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}}},this.filterable={operators:"string"},this.titleUsable=!0}}(0,rP.registerValidateFormats)({odd:/^-?\d*[13579]$/,even:/^-?\d*[02468]$/});class Cz extends CM{constructor(...e){super(...e),this.name="integer",this.type="object",this.group="basic",this.order=6,this.title='{{t("Integer")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier, self growth")}}',this.sortable=!0,this.default={type:"bigInt",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"},"x-validator":"integer"}},this.availableTypes=["bigInt","integer","sort","snowflakeId"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["precision"],this.properties={...CP,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}},autoIncrement:Cx},this.filterable={operators:"number"},this.titleUsable=!0}}(0,rP.registerValidateRules)({json(e){try{return JSON.parse(e),!0}catch(e){return{type:"error",message:e.message}}}});class CK extends CM{constructor(...e){super(...e),this.name="json",this.type="object",this.group="advanced",this.order=4,this.title='{{t("JSON")}}',this.sortable=!1,this.default={type:"json",uiSchema:{type:"object","x-component":"Input.JSON","x-component-props":{autoSize:{minRows:5}},default:null}},this.availableTypes=["json","array","set","jsonb","text","circle","lineString","point","polygon"],this.hasDefaultValue=!0,this.properties={...CP,jsonb:{title:"JSONB","x-component":"Checkbox"}},this.configure={items:[{name:"jsonb",title:"JSONB",component:"Checkbox",schema:{"x-content":" "},hidden:e=>{let{context:t}=e,l=t.isDialect;return"function"!=typeof l||!l("postgres")},disabled:e=>{let{context:t}=e;return!!t.disabledJSONB}}]}}}class CU extends CM{initialize(e){"belongsToMany"===e.type&&(e.through||(e.through=`t_${(0,rj.uid)()}`),e.foreignKey||(e.foreignKey=`f_${(0,rj.uid)()}`),e.otherKey||(e.otherKey=`f_${(0,rj.uid)()}`),e.sourceKey||(e.sourceKey="id"),e.targetKey||(e.targetKey="id"))}constructor(...e){super(...e),this.name="m2m",this.type="object",this.group="relation",this.order=6,this.title='{{t("Many to many")}}',this.description='{{t("Many to many description")}}',this.isAssociation=!0,this.default={type:"belongsToMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}},reverseField:{interface:"m2m",type:"belongsToMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}}}},this.availableTypes=["belongsToMany"],this.validationType="object",this.properties={...CP,type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"string",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{through:{type:"string",title:'{{t("Through collection")}}',description:'{{ t("Generated automatically if left blank") }}',"x-decorator":"FormItem","x-disabled":"{{ !createOnly }}","x-component":"ThroughCollection","x-component-props":{allowClear:!0}}}},col13:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key 1")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly||override }}"}}},col23:{type:"void","x-component":"Grid.Col",properties:{}}}},row3:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{}},col22:{type:"void","x-component":"Grid.Col",properties:{otherKey:{type:"string",title:'{{t("Foreign key 2")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly||override }}"}}},col23:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',"x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}",description:"{{t('Field values must be unique.')}}"}}}}}}},...CC},this.filterable={nested:!0,children:[]}}}class CW extends CM{constructor(...e){super(...e),this.name="m2o",this.type="object",this.group="relation",this.order=5,this.title='{{t("Many to one")}}',this.description='{{t("Many to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"o2m",type:"hasMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}}}},this.availableTypes=["belongsTo"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}"}}}}}}},...CS,...CC},this.filterable={nested:!0,children:[]}}}class CH extends CM{constructor(...e){super(...e),this.name="markdown",this.type="object",this.title='{{t("Markdown")}}',this.group="media",this.default={type:"text",uiSchema:{type:"string","x-component":"Markdown"}},this.availableTypes=["text","json","string"],this.hasDefaultValue=!0,this.properties={...CP},this.filterable={operators:"bigField"}}}class CG extends CM{constructor(...e){super(...e),this.name="multipleSelect",this.type="object",this.group="choices",this.order=3,this.title='{{t("Multiple select")}}',this.default={type:"array",defaultValue:[],uiSchema:{type:"array","x-component":"Select","x-component-props":{mode:"multiple"},enum:[]}},this.availableTypes=["array","json"],this.hasDefaultValue=!0,this.properties={...CP,"uiSchema.enum":CA},this.filterable={operators:"array"}}}class CY extends CM{constructor(...e){super(...e),this.name="number",this.type="object",this.group="basic",this.order=7,this.title='{{t("Number")}}',this.sortable=!0,this.default={type:"double",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"}}},this.availableTypes=["double","float","decimal"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["integer"],this.properties={type:{type:"string",title:'{{t("Data type")}}',"x-component":"Select","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:"double",enum:[{label:'{{t("Double")}}',value:"double"},{label:'{{t("Float")}}',value:"float"},{label:'{{t("Decimal")}}',value:"decimal"}]},...CP,unique:Cv,"uiSchema.x-component-props.step":{type:"string",title:'{{t("Precision(UI)")}}',"x-component":"Select","x-decorator":"FormItem",default:"1",enum:[{value:"1",label:"1"},{value:"0.1",label:"1.0"},{value:"0.01",label:"1.00"},{value:"0.001",label:"1.000"},{value:"0.0001",label:"1.0000"},{value:"0.00001",label:"1.00000"},{value:"0.000001",label:"1.000000"},{value:"0.0000001",label:"1.0000000"},{value:"0.00000001",label:"1.00000000"}]},precision:{type:"string",title:'{{t("Precision")}}',"x-component":"InputNumber","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:10},scale:{type:"string",title:'{{t("Scale")}}',"x-component":"InputNumber","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:2}},this.filterable={operators:"number"},this.titleUsable=!0}}class CJ extends CM{constructor(...e){super(...e),this.name="obo",this.type="object",this.group="relation",this.order=3.1,this.title='{{t("One to one (belongs to)")}}',this.description='{{t("One to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"oho",type:"hasOne",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["belongsTo"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}"}}}}}}},...CS,...CC},this.filterable={nested:!0,children:[]}}}class CX extends CM{constructor(...e){super(...e),this.name="o2m",this.type="object",this.group="relation",this.order=4,this.title='{{t("One to many")}}',this.description='{{t("One to many description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"hasMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}},reverseField:{interface:"m2o",type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["hasMany"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection"}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}}}},row3:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',"x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}",description:"{{t('Field values must be unique.')}}"}}}}}}},...CS,...CC},this.filterable={nested:!0,children:[]}}}class CQ extends CM{constructor(...e){super(...e),this.name="oho",this.type="object",this.group="relation",this.order=3,this.title='{{t("One to one (has one)")}}',this.description='{{t("One to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"hasOne",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"obo",type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["hasOne"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}}}}}},...CS,...CC},this.filterable={nested:!0,children:[]}}}class CZ extends CM{constructor(...e){super(...e),this.name="password",this.type="object",this.group="basic",this.order=9,this.title='{{t("Password")}}',this.default={type:"password",hidden:!0,uiSchema:{type:"string","x-component":"Password"}},this.availableTypes=["password","string"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.properties={...CP,unique:Cv},this.filterable={operators:"string"}}}(0,rP.registerValidateRules)({percentMode(e,t){let{maxValue:l,minValue:n}=t;return l&&e>l?{type:"error",message:`${C_("The field value cannot be greater than ")}${100*l}%`}:!n||!(e<n)||{type:"error",message:`${C_("The field value cannot be less than ")}${100*n}%`}},percentFormats(e,t){let{percentFormat:l}=t;return!e||"Integer"!==l||!1!==/^-?[1-9]\d*$/.test((100*e).toString())||{type:"error",message:`${C_("The field value is not an integer number")}`}}});class C0 extends CM{constructor(...e){super(...e),this.name="percent",this.type="object",this.group="basic",this.order=8,this.title='{{t("Percent")}}',this.sortable=!0,this.default={type:"float",uiSchema:{type:"string","x-component":"Percent","x-component-props":{stringMode:!0,step:"1",addonAfter:"%"}}},this.availableTypes=["float","double","decimal"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["integer"],this.properties={...CP,unique:Cv,"uiSchema.x-component-props.step":{type:"string",title:'{{t("Precision")}}',"x-component":"Select","x-decorator":"FormItem",default:"1",enum:[{value:"1",label:"1%"},{value:"0.1",label:"1.0%"},{value:"0.01",label:"1.00%"},{value:"0.001",label:"1.000%"},{value:"0.0001",label:"1.0000%"},{value:"0.00001",label:"1.00000%"}]}},this.filterable={operators:"number"},this.titleUsable=!0}}class C1 extends CM{constructor(...e){super(...e),this.name="phone",this.type="object",this.group="basic",this.order=3,this.title='{{t("Phone")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Input","x-component-props":{type:"tel"}}},this.availableTypes=["string"],this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.hasDefaultValue=!0,this.properties={...CP,unique:Cv},this.filterable={operators:"string"},this.titleUsable=!0}}class C2 extends CM{constructor(...e){super(...e),this.name="radioGroup",this.type="object",this.group="choices",this.order=4,this.title='{{t("Radio group")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Radio.Group"}},this.availableTypes=["string","integer","boolean","integer"],this.hasDefaultValue=!0,this.properties={...CP,"uiSchema.enum":CA},this.filterable={operators:"enumType"},this.titleUsable=!0}}class C8 extends CM{constructor(...e){super(...e),this.name="richText",this.type="object",this.group="media",this.order=2,this.title='{{t("Rich Text")}}',this.default={interface:"richText",type:"text",uiSchema:{type:"string","x-component":"RichText"}},this.availableTypes=["text","json","string"],this.hasDefaultValue=!0,this.properties={...CP},this.filterable={operators:"bigField"}}}class C5 extends CM{constructor(...e){super(...e),this.name="select",this.type="object",this.group="choices",this.order=2,this.title='{{t("Single select")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Select",enum:[]}},this.availableTypes=["string","bigInt","boolean"],this.hasDefaultValue=!0,this.properties={...CP,"uiSchema.enum":CA},this.filterable={operators:"enumType"},this.titleUsable=!0}}class C4 extends CM{constructor(...e){super(...e),this.name="snowflakeId",this.type="object",this.group="advanced",this.order=0,this.title='{{t("Snowflake ID (53-bit)")}}',this.primaryKeyDescription='{{t("Primary key, distributed uniqueness, time-ordering")}}',this.hidden=!1,this.sortable=!0,this.default={type:"snowflakeId",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,separator:"0.00",step:"1"},"x-validator":"integer"}},this.availableTypes=["snowflakeId"],this.properties={...CP,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}}},this.filterable={operators:"number"},this.description='{{t("A 53-bit Snowflake ID designed to be compatible with JavaScript’s safe integer range, providing both time-ordering and uniqueness.") }}',this.titleUsable=!0}}class C3 extends CM{constructor(...e){super(...e),this.name="tableoid",this.type="object",this.group="systemInfo",this.order=0,this.title='{{t("Table OID")}}',this.sortable=!0,this.default={name:"__collection",type:"virtual",uiSchema:{type:"string",title:'{{t("Table OID")}}',"x-component":"CollectionSelect","x-component-props":{isTableOid:!0},"x-read-pretty":!0}},this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Input"}},this.filterable={operators:"tableoid"}}}class C6 extends CM{constructor(...e){super(...e),this.name="textarea",this.type="object",this.group="basic",this.order=2,this.title='{{t("Long text")}}',this.default={interface:"textarea",type:"text",uiSchema:{type:"string","x-component":"Input.TextArea"}},this.availableTypes=["text","json","string"],this.validationType="string",this.availableValidationOptions=["min","max","length","case","pattern"],this.hasDefaultValue=!0,this.titleUsable=!0,this.properties={...CP,trim:{type:"boolean","x-content":'{{t("Automatically remove heading and tailing spaces")}}',"x-decorator":"FormItem","x-component":"Checkbox"}},this.filterable={operators:"string"}}}class C9 extends CM{constructor(...e){super(...e),this.name="time",this.type="object",this.group="datetime",this.order=4,this.title='{{t("Time")}}',this.sortable=!0,this.default={type:"time",uiSchema:{type:"string","x-component":"TimePicker"}},this.availableTypes=["time"],this.hasDefaultValue=!0,this.properties={...CP,...Ck},this.filterable={operators:"time"},this.titleUsable=!0}}class C7 extends CM{constructor(...e){super(...e),this.name="updatedAt",this.type="object",this.group="systemInfo",this.order=2,this.title='{{t("Last updated at")}}',this.sortable=!0,this.default={type:"date",field:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},this.description='{{t("Store the last update time of each record")}}',this.availableTypes=[],this.properties={...CP,...CF},this.filterable={operators:"datetime"},this.titleUsable=!0}}class Fe extends CM{constructor(...e){super(...e),this.name="updatedBy",this.type="object",this.group="systemInfo",this.order=4,this.title='{{t("Last updated by")}}',this.isAssociation=!0,this.default={type:"belongsTo",target:"users",foreignKey:"updatedById",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},this.availableTypes=["belongsTo"],this.properties={...CP},this.filterable={nested:!0,children:[]},this.description='{{t("Store the last update user of each record")}}'}}class Ft extends CM{constructor(...e){super(...e),this.name="url",this.type="string",this.group="basic",this.order=5,this.title='{{t("URL")}}',this.default={type:"text",uiSchema:{type:"string","x-component":"Input.URL"}},this.componentOptions=[{label:"URL",value:"Input.URL"},{label:"Preview",value:"Input.Preview"}],this.availableTypes=["string","text"],this.validationType="string",this.availableValidationOptions=["uri","pattern"],this.properties={...CP},this.titleUsable=!0,this.filterable={operators:"string"}}}class Fl extends CM{constructor(...e){super(...e),this.name="uuid",this.type="object",this.group="advanced",this.order=0,this.title='{{t("UUID")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.hidden=!1,this.sortable=!0,this.default={type:"uuid",uiSchema:{type:"string","x-component":"Input","x-validator":"uuid"}},this.availableTypes=["uid","uuid"],this.validationType="string",this.availableValidationOptions=["uuid","pattern"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},autoFill:Cb,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}}},this.filterable={operators:"string"},this.titleUsable=!0}}class Fn extends CM{constructor(...e){super(...e),this.name="nanoid",this.type="object",this.group="advanced",this.order=0,this.title='{{t("Nano ID")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.hidden=!1,this.sortable=!0,this.default={type:"nanoid",uiSchema:{type:"string","x-component":"NanoIDInput"}},this.availableTypes=["nanoid"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},customAlphabet:{type:"string",title:'{{t("Alphabet")}}',default:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz","x-decorator":"FormItem","x-component":"Input"},size:{type:"number",title:'{{t("Length")}}',default:21,"x-decorator":"FormItem","x-component":"InputNumber"},autoFill:Cb,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}}},this.filterable={operators:"string"},this.titleUsable=!0}}class Fo extends CM{constructor(...e){super(...e),this.name="unixTimestamp",this.type="object",this.group="datetime",this.order=4,this.title='{{t("Unix Timestamp")}}',this.sortable=!0,this.default={type:"unixTimestamp",accuracy:"second",timezone:!0,defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,uiSchema:{type:"number","x-component":"UnixTimestamp","x-component-props":{showTime:!0}}},this.availableTypes=["unixTimestamp"],this.hasDefaultValue=!1,this.validationType="date",this.availableValidationOptions=["timestamp"],this.properties={...CP,...CF,accuracy:{type:"string",title:'{{t("Accuracy")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"second",enum:[{value:"millisecond",label:'{{t("Millisecond")}}'},{value:"second",label:'{{t("Second")}}'}]},defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp on update")}}'}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class Fr extends CM{constructor(...e){super(...e),this.name="date",this.type="object",this.group="datetime",this.order=3,this.title='{{t("DateOnly")}}',this.sortable=!0,this.default={type:"dateOnly",uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{dateOnly:!0,showTime:!1}}},this.availableTypes=["dateOnly"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...CP,...CF,"uiSchema.x-component-props.showTime":{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-visible":!1},"uiSchema.x-component-props.timeFormat":{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-visible":!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class Fi extends CM{constructor(...e){super(...e),this.name="datetimeNoTz",this.type="object",this.group="datetime",this.order=2,this.title='{{t("Datetime (without time zone)")}}',this.sortable=!0,this.default={type:"datetimeNoTz",defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,timezone:!1,uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{showTime:!1,utc:!1}}},this.availableTypes=["string","datetimeNoTz"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...CP,...CF,defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current server time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp to the current server time on update")}}'},"uiSchema.x-component-props.gmt":{type:"boolean",title:'{{t("GMT")}}',"x-hidden":!0,"x-component":"Checkbox","x-content":'{{t("Use the same time zone (GMT) for all users")}}',"x-decorator":"FormItem",default:!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}function Fa(e){if(null==e?void 0:e.filterTargetKey){if(Array.isArray(e.filterTargetKey)){var t;return null==e||null==(t=e.filterTargetKey)?void 0:t[0]}return null==e?void 0:e.filterTargetKey}return(null==e?void 0:e.getPrimaryKey())||"id"}function Fs(e,t){var l,n,o,r,i;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=e.interface,d=s?(null==t||null==(n=t.getFieldInterfaceConfigure)||null==(l=n.call(t,s,a.collectionInfo))?void 0:l.default)||(null==t||null==(r=t.getFieldInterface)||null==(o=r.call(t,s))?void 0:o.default):void 0,u=(0,G.merge)({},(0,G.cloneDeep)(d||{}),(0,G.cloneDeep)(e)),c=(0,G.merge)({},(0,G.cloneDeep)((null==d?void 0:d.uiSchema)||{}),(0,G.cloneDeep)(e.uiSchema||{}));return void 0!==e.title&&(c.title=e.title),void 0!==e.options&&(c.enum=(0,G.cloneDeep)(e.options)),void 0!==e.component&&(c["x-component"]=e.component),void 0!==e.componentProps&&(c["x-component-props"]=(0,G.merge)({},(0,G.cloneDeep)((null==d||null==(i=d.uiSchema)?void 0:i["x-component-props"])||{}),(0,G.cloneDeep)(e.componentProps))),delete u.title,delete u.options,delete u.component,delete u.componentProps,Object.keys(c).length&&(u.uiSchema=c),u}function Fd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,l=arguments.length>2?arguments[2]:void 0;return e.map(e=>Fs(e,t,l))}let Fu=e=>{var t,l,n,o,r,i,a,s,d;let{dataSource:u="main",collections:c,syncOnChange:p=!1,children:m}=e,h=(0,en.n)(),f=(0,J.useRef)(null),g=(0,J.useRef)(null);if(null===f.current){let e=null==(l=h.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,u),r=[];if(e)for(let t of c)null!=(n=e.getCollection)&&n.call(e,t.name)||(null==(o=e.addCollection)||o.call(e,t),r.push(t));f.current=r,g.current=c}else if(p&&g.current!==c){let e=null==(i=h.dataSourceManager)||null==(r=i.getDataSource)?void 0:r.call(i,u);if(e){let t=new Set(c.map(e=>e.name)),l=new Map(f.current.map(e=>[e.name,e]));for(let n of l.keys())t.has(n)||null==(a=e.removeCollection)||a.call(e,n);let n=[];for(let t of c){let o=l.get(t.name);if(o){n.push(o);continue}null!=(s=e.getCollection)&&s.call(e,t.name)||(null==(d=e.addCollection)||d.call(e,t),n.push(t))}f.current=n}g.current=c}return(0,J.useEffect)(()=>{var e;let t=e=>{var t,l,n,o,r;let i=null==(t=e.detail)?void 0:t.dataSourceKey;if(i!==u&&"*"!==i)return;let a=null==(n=h.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);if(a&&f.current)for(let e of f.current)null!=(o=a.getCollection)&&o.call(a,e.name)||null==(r=a.addCollection)||r.call(a,e)};return null==(e=h.eventBus)||e.addEventListener("dataSource:loaded",t),()=>{var e,l,n,o;null==(e=h.eventBus)||e.removeEventListener("dataSource:loaded",t);let r=null==(n=h.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u),i=f.current??[];if(f.current=null,g.current=null,r)for(let e of i)null==(o=r.removeCollection)||o.call(r,e.name)}},[h,u]),(0,U.jsx)(U.Fragment,{children:m})};var Fc=l(30872),Fp=l.n(Fc),Fm=l(88055),Fh=l.n(Fm),Ff=l(90179),Fg=l.n(Ff);let Fv=(0,J.createContext)(null);Fv.displayName="APIClientContext";let Fy=(0,J.createContext)(null);Fy.displayName="ApplicationContext";let Fx=()=>{var e;let t=(0,J.useContext)(Fy),l=(0,H.useFlowEngine)({throwError:!1});return(null==l||null==(e=l.context)?void 0:e.app)||t||{}};function Fb(){let e=Fx();return(0,J.useContext)(Fv)||e.apiClient}var Fw=l(89412),FS=l(14744),FC=l.n(FS),FF=l(63375),Fk=l.n(FF);function FA(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(t=>e.propertyIsEnumerable(t)):[]}function FP(e){return Object.keys(e).concat(FA(e))}let Fj=new Map;function FM(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return FP(t).forEach(n=>{let o=l[n],r=Fj.get("deepMerge");"function"==typeof o?r=o:"string"==typeof o&&Fj.has(o)&&(r=Fj.get(o)),e[n]=r(e[n],t[n])}),e}function FI(e){let t,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[n,o]=(0,Fw.A)({}),r=Fb();t="function"==typeof e?e:e?async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{resource:l,url:n}=e,o=Fh()(e);l||n?(o.params=o.params||{},FM(o.params,t)):o=(0,rj.merge)(o,t);let i=await r.request(o);return null==i?void 0:i.data}:async()=>{};let i={...l,onSuccess(){for(var e,t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];null==(e=l.onSuccess)||e.call(l,...n),l.uid&&(r.services[l.uid]=a)}},a=(0,o3.A)(t,i);return(0,J.useMemo)(()=>({...a,state:n,setState:o}),[a,o,n])}function FT(e,t){return Fb().resource(e,t)}Fj.set("overwrite",(e,t)=>t),Fj.set("andMerge",(e,t)=>{if(e||t)return e?t?{$and:[e,t]}:e:t}),Fj.set("orMerge",(e,t)=>{if(e||t)return e?t?{$or:[e,t]}:e:t}),Fj.set("deepMerge",(e,t)=>(0,ev.isPlainObject)(e)&&(0,ev.isPlainObject)(t)?FC()(e,t,{arrayMerge:(e,t)=>t}):t),Fj.set("merge",(e,t)=>(0,ev.isPlainObject)(e)&&(0,ev.isPlainObject)(t)?Object.assign(e,t):t),Fj.set("union",(e,t)=>("string"==typeof e&&(e=e.split(",")),"string"==typeof t&&(t=t.split(",")),Fk()((e||[]).concat(t||[])))),Fj.set("intersect",(e,t)=>("string"==typeof e&&(e=e.split(",")),"string"==typeof t&&(t=t.split(",")),Array.isArray(e)&&0!==e.length)?Array.isArray(t)&&0!==t.length?e.filter(e=>t.includes(e)):e||[]:t||[]);var FR=l(98892);function FE(e,t,l){var n;(null==t?void 0:t.length)&&l[e]({message:null==(n=t.map)?void 0:n.call(t,(e,t)=>J.createElement("div",{key:`${t}_${e.message}`},"string"==typeof e?e:e.message))})}let FN=(e,t)=>{var l;let n=new FileReader;n.readAsText(null==e||null==(l=e.response)?void 0:l.data,"utf-8"),n.onload=function(){FE("error",JSON.parse(n.result).errors,t)}};function FD(e){let t=Math.floor(Math.abs(e)),l=Math.abs(e%1*60);return(e>=0?"+":"-")+(t<10?"0":"")+t+":"+(l<10?"0":"")+l}let FB=()=>FD(-(new Date().getTimezoneOffset()/60)),F$=new Map;class FO extends ${get notification(){var e,t;return(null==(t=this.app)||null==(e=t.context)?void 0:e.notification)||FR.Ay}cloneInstance(){let e=new FO(this.options);e.options=this.options,e.services=this.services,e.storage=this.storage,e.app=this.app,e.auth=this.auth,e.storagePrefix=this.storagePrefix;let t=[];for(let n of this.axios.interceptors.response.handlers){var l;(null==n||null==(l=n.rejected)?void 0:l._name)==="handleNotificationError"?t.push({...n,rejected:e.handleNotificationError.bind(e)}):t.push(n)}return e.axios.interceptors.response.handlers=t,e}getHostname(){var e,t;try{return new URL("/api/").hostname}catch(e){}return null==(t=window)||null==(e=t.location)?void 0:e.hostname}getHeaders(){var e;let t=super.getHeaders(),l=null==(e=this.app)?void 0:e.getName();return l&&(t["X-App"]=l),t["X-Timezone"]=FB(),t["X-Hostname"]=this.getHostname(),t}service(e){return this.services[e]}interceptors(){this.axios.interceptors.request.use(e=>{e.headers["X-With-ACL-Meta"]=!0;let t=this.getHeaders();return Object.keys(t).forEach(l=>{T(e.headers,l)||(e.headers[l]=t[l])}),e}),super.interceptors(),this.useNotificationMiddleware(),this.axios.interceptors.response.use(e=>e,e=>{let t=this.toErrMessages(e);throw t.find(e=>"ROLE_NOT_FOUND_ERR"===e.code)&&(this.auth.setRole(null),window.location.reload()),t.find(e=>"TOKEN_INVALID"===e.code||"USER_LOCKED"===e.code)&&this.auth.setToken(null),t.find(e=>"ROLE_NOT_FOUND_FOR_USER"===e.code)&&(this.auth.setRole(null),window.location.reload()),e})}toErrMessages(e){var t,l,n,o,r,i,a,s,d,u,c;if("string"==typeof(null==e||null==(t=e.response)?void 0:t.data)){let t=document.createElement("div");t.innerHTML=null==e||null==(d=e.response)?void 0:d.data;let l=t.textContent||t.innerText;return l.includes("Error occurred while trying")||l.includes("502 Bad Gateway")?[{code:"APP_WARNING",message:l="The application may be starting up. Please try again later."}]:[{message:l}]}return(null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.error)?[null==e||null==(c=e.response)||null==(u=c.data)?void 0:u.error]:(null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.errors)||(null==e||null==(a=e.response)||null==(i=a.data)?void 0:i.messages)||(null==e||null==(s=e.response)?void 0:s.error)||[{message:e.message||"Server error"}]}async handleNotificationError(e){var t,l,n,o,r,i,a,s,d,u;if(this.silence)throw e;let c=null==(t=e.config)?void 0:t.skipNotify;if(c&&("function"==typeof c&&c(e)||!0===c))throw e;let p=null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.redirectTo;if(p)return window.location.href=p;if((null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.type)==="application/json")FN(e,this.notification);else{F$.size>10&&F$.clear();let t=!!(null==e||null==(s=e.response)||null==(a=s.data)||null==(i=a.error)?void 0:i.maintaining);if(this.app.maintaining!==t&&(this.app.maintaining=t),this.app.maintaining)throw this.app.error=null==e||null==(u=e.response)||null==(d=u.data)?void 0:d.error,e;this.app.error&&(this.app.error=null);let l=this.toErrMessages(e);if(0===(l=l.filter(e=>{let t=F$.get(e.message);return!(t&&new Date().getTime()-t<500)&&(F$.set(e.message,new Date().getTime()),!0)})).length)throw e;FE("error",l,this.notification)}throw e}useNotificationMiddleware(){let e=this.handleNotificationError.bind(this);e._name="handleNotificationError",this.axios.interceptors.response.use(e=>{var t,l;return(null==(l=e.data)||null==(t=l.messages)?void 0:t.length)&&FE("success",e.data.messages.filter(e=>{let t=F$.get("string"==typeof e?e:e.message);return!(t&&new Date().getTime()-t<500)&&(F$.set(e.message,new Date().getTime()),!0)}),this.notification),e},e)}silent(){let e=this.cloneInstance();return e.silence=!0,e}constructor(...e){super(...e),this.services={},this.silence=!1}}let Fq=e=>{let{apiClient:t,children:l}=e;return(0,U.jsx)(Fv.Provider,{value:t,children:l})};class F_{get fields(){return this.options.fields||[]}get app(){return this.collectionManager.app}get dataSource(){return this.options.dataSource}get sourceKey(){return this.options.sourceKey}get name(){return this.options.name}get key(){return this.options.key}get title(){return this.options.title}get inherit(){return this.options.inherit}get hidden(){return this.options.hidden}get description(){return this.options.description}get duplicator(){return this.options.duplicator}get category(){return this.options.category}get targetKey(){return this.options.targetKey}get model(){return this.options.model}get createdBy(){return this.options.createdBy}get updatedBy(){return this.options.updatedBy}get logging(){return this.options.logging}get from(){return this.options.from}get rawTitle(){return this.options.rawTitle}getPrimaryKey(){if(this.primaryKey)return this.primaryKey;if(this.options.targetKey)return this.options.targetKey;let e=this.getFields({primaryKey:!0})[0];return this.primaryKey=null==e?void 0:e.name,this.primaryKey}getFilterTargetKey(){return this.filterTargetKey||this.getPrimaryKey()||"id"}get inherits(){return this.options.inherits||[]}get titleField(){return this.hasField(this.options.titleField)?this.options.titleField:this.getPrimaryKey()}get sources(){return this.options.sources||[]}get template(){return this.options.template}get tableName(){return this.options.tableName}get viewName(){return this.options.viewName}get writableView(){return this.options.writableView}get filterTargetKey(){return this.options.filterTargetKey}get sortable(){return this.options.sortable}get autoGenId(){return this.options.autoGenId}get magicAttribute(){return this.options.magicAttribute}get tree(){return this.options.tree}get isThrough(){return this.options.isThrough}get autoCreate(){return this.options.autoCreate}get resource(){return this.options.resource}setOption(e,t){return this.options[e]=t,this}getOptions(){return this.options}getOption(e){return this.options[e]}getFields(e){return e?(0,rT.filter)(this.fields,e):this.fields}getAllFields(e){return this.getFields(e)}getFieldsMap(){return this.fieldsMap||(this.fieldsMap=this.getFields().reduce((e,t)=>(e[t.name]=t,e),{})),this.fieldsMap}getFieldByAssociationName(e){let t=this.getFieldsMap(),[l,...n]=String(e).split("."),o=t[l];if(!o)return;let r=null==o?void 0:o.target;if(!r)return;let i=this.collectionManager.getCollection(r);if(i)return i.getField(n.join("."))}getField(e){if(!e)return;let t=this.getFieldsMap();if(String(e).split(".").length>1){let t=this.getFieldByAssociationName(e);return t||("string"==typeof e&&e.startsWith(`${this.name}.`)?(e=e.replace(`${this.name}.`,""),this.getField(e)):void 0)}return t[e]}hasField(e){return!!this.getField(e)}isTitleField(e){var t;return null==(t=this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterface(e.interface))?void 0:t.titleUsable}isInherited(){return this.inherits.length>0}constructor(e,t){this.options=e,this.collectionManager=t}}let{ConfigContext:FL}=ed.Ay,FV=()=>(0,J.useContext)(FL),Fz=(e,t)=>{let{getPrefixCls:l}=(0,J.useContext)(ed.Ay.ConfigContext)||{};if("ConfigContext"in ed.Ay)return(null==l?void 0:l(e,null==t?void 0:t.prefixCls))||"";{let l=(null==t?void 0:t.prefixCls)??"ant-";return`${l}${e??""}`}},FK=()=>es.A.useToken(),FU=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Loading...",t=arguments.length>1?arguments[1]:void 0,l=null,n=setTimeout(()=>{l=bz.Ay.loading(e)},100);try{return await t()}finally{null==l||l(),clearTimeout(n)}},FW={...lR},{version:FH,render:FG,unmountComponentAtNode:FY}=FW;try{Number((FH||"").split(".")[0])>=18&&FW.createRoot&&(n=FW.createRoot)}catch(e){}function FJ(e){let{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:t}=FW;t&&"object"==typeof t&&(t.usingClientEntryPoint=e)}let FX="__antd_mobile_root__";function FQ(e,t){FG(e,t)}function FZ(e,t){FJ(!0);let l=t[FX]||n(t);FJ(!1),l.render(e),t[FX]=l}function F0(e,t){n?FZ(e,t):FQ(e,t)}function F1(e){return FY(e)}async function F2(e){return Promise.resolve().then(()=>{var t;null==(t=e[FX])||t.unmount(),delete e[FX]})}function F8(e){return n?F2(e):F1(e)}let F5=(0,W.observable)(new Map),F4=e=>{let t=e=>(e.id&&!F5.has(e.id)&&F5.set(e.id,null),(0,U.jsxs)(J.Fragment,{children:[e.children,(0,U.jsx)(ni.Observer,{children:()=>{if(!e.id)return(0,U.jsx)(U.Fragment,{});let t=F5.get(e.id);return t?(0,lT.createPortal)(t,document.body):(0,U.jsx)(U.Fragment,{})}})]}));return t.defaultProps={id:e},t};function F3(e,t){return{render:function(l){F5.has(t)?F5.set(t,null==l?void 0:l()):e&&F0((0,U.jsx)(J.Fragment,{children:null==l?void 0:l()}),e)},unmount:function(){if(F5.has(t)&&F5.set(t,null),e&&F8(e)&&e.parentNode){var l;null==(l=e.parentNode)||l.removeChild(e)}}}}let F6=(e,t)=>{let{fontFamily:l,fontSize:n}=e,o=`[class^="${t}"], [class*=" ${t}"]`;return{[o]:{fontFamily:l,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},F9=(e,t)=>l=>{let{theme:n,token:o,hashId:r}=FK(),{getPrefixCls:i,iconPrefixCls:a}=FV(),s=Fz(e),d=i(),u=(0,rS.useStyleRegister)({theme:n,token:o,hashId:r,path:["formily-antd",e,s,a]},()=>{let e=`.${s}`,n=t((0,rj.merge)(o,{componentCls:e,prefixCls:s,iconCls:`.${a}`,antCls:`.${d}`}),l,{hashId:r,prefixCls:s,rootPrefixCls:d,iconPrefixCls:a});return[F6(o,s),n]});return{wrapSSR:(0,J.useMemo)(()=>u,[n,o,r,s,a,d,l]),hashId:r,componentCls:s,rootPrefixCls:d}};var F7=l(38221),ke=l.n(F7);let kt=(0,J.createContext)(null);kt.displayName="DataSourceManagerContext";let kl=e=>{let{children:t,dataSourceManager:l}=e;return(0,U.jsx)(kt.Provider,{value:l,children:t})};function kn(){return(0,J.useContext)(kt)}function ko(){let e=kn();return{getAllCollectionsInheritChain:(0,J.useCallback)((t,l)=>{var n,o,r;return null==e||null==(r=e.getDataSource(l))||null==(o=r.collectionManager)||null==(n=o.getCollection(t))?void 0:n.getInheritChain()},[e])}}var kr=l(68870);let ki=(0,J.createContext)(null);ki.displayName="DataSourceContext";let ka=e=>{let{children:t,dataSource:l}=e,n=kn(),{t:o}=(0,lE.B)(),{refresh:r}=IO(),[i,a]=J.useState(0),s=null==n?void 0:n.getDataSource(l);return s?"loading-failed"===s.status?(0,U.jsx)(erk,{type:"Data Source",name:s.displayName||l,message:s.errorMessage||"loading failed"}):"loading"===s.status||"reloading"===s.status?(0,U.jsx)(et3,{children:(0,U.jsx)(lZ.Ay,{icon:(0,U.jsx)(kr.A,{}),title:`${s.displayName||l} ${o("data source")} ${o("loading")}...`,extra:(0,U.jsx)(nT.Ay,{type:"primary",onClick:()=>s.reload().then(()=>{r(),a(Math.random())}),children:o("Refresh")})})}):(0,U.jsx)(ki.Provider,{value:s,children:t}):(0,U.jsx)(erk,{type:"Data Source",name:l})};function ks(){return(0,J.useContext)(ki)}function kd(){let e=(0,J.useContext)(ki);return null==e?void 0:e.key}let ku=(0,J.createContext)(null);ku.displayName="ExtendCollectionsContext";let kc=e=>{let{children:t,collections:l}=e,n=kp(),o=(0,J.useMemo)(()=>n?[...n,...l]:l,[n,l]),r=kd();return(0,U.jsx)(ku.Provider,{value:o,children:(0,U.jsx)(kf,{dataSource:r,children:t})})};function kp(){return(0,J.useContext)(ku)}let km=(0,J.createContext)(null);km.displayName="CollectionManagerContext";let kh=e=>{let{instance:t,children:l}=e,n=ks(),o=kp(),r=(0,J.useMemo)(()=>t||(null==n?void 0:n.collectionManager),[t,n]),[i,a]=J.useState(Math.random());(0,J.useEffect)(()=>{r.dataSource.addReloadCallback(()=>{a(Math.random())})},[r]);let s=(0,J.useMemo)(()=>{let e=r;return(null==o?void 0:o.length)?e.clone(o):e},[r,o,i]);return(0,U.jsx)(km.Provider,{value:s,children:l})},kf=e=>{let{instance:t,dataSource:l,children:n}=e;return(0,U.jsx)(ka,{dataSource:l,children:(0,U.jsx)(kh,{instance:t,children:n})})};function kg(){return(0,J.useContext)(km)}let kv=e=>{let t=kg();return(0,J.useMemo)(()=>t.getCollections(e),[t,e])},ky=(0,J.createContext)({});ky.displayName="SchemaComponentContext.Provider";let kx=()=>(0,J.useContext)(ni.SchemaOptionsContext)||{},kb=(0,J.memo)(e=>{let{children:t}=e,l=kx(),n=(0,J.useMemo)(()=>({...l.components,...e.components}),[l.components,e.components]),o=(0,J.useMemo)(()=>({...l.scope,...e.scope}),[l.scope,e.scope]),r=(0,J.useMemo)(()=>({scope:o,components:n}),[o,n]);return(0,U.jsx)(ni.SchemaOptionsContext.Provider,{value:r,children:(0,U.jsx)(ni.SchemaComponentsContext.Provider,{value:n,children:(0,U.jsx)(ni.ExpressionScope,{value:o,children:t})})})});function kw(e){return ni.Schema.isSchemaInstance(e)?e:new ni.Schema((null==e?void 0:e.name)?{type:"object",properties:{[e.name]:e},name:`p_${e.name}`}:e)}kb.displayName="SchemaComponentOptions";let kS=e=>(0,J.useMemo)(()=>kw(e),[]),kC=(0,J.createContext)({onChange:rR().noop}),kF=(0,J.memo)(e=>{let{components:t,scope:l,schema:n,distributed:o,onChange:r,parentSchema:i,...a}=e,s=(0,J.useContext)(ky),d=(0,J.useMemo)(()=>kw(n),[n]),u=(0,J.useMemo)(()=>({...s,distributed:!1!=s.distributed&&o,refresh:s.refresh||rR().noop}),[s,o]),{onChange:c}=(0,J.useContext)(kC),p=(0,J.useMemo)(()=>({onChange:()=>{null==r||r(d),null==c||c()}}),[r,c,d]);return(0,U.jsx)(kC.Provider,{value:p,children:(0,U.jsx)(ky.Provider,{value:u,children:(0,U.jsx)(kb,{inherit:!0,components:t,scope:l,children:(0,U.jsx)(k1,{...a,schema:d,isUseFormilyField:!0,parentSchema:i})})})})});kF.displayName="RecursionSchemaComponent";let kk=(0,J.memo)(e=>{let{schema:t,parentSchema:l,...n}=e,o=kS(t);return(0,U.jsx)(kF,{...n,schema:o,parentSchema:l})});kk.displayName="MemoizedSchemaComponent";let kA=(0,J.memo)(e=>{let{memoized:t,...l}=e;return t?(0,U.jsx)(kk,{...l}):(0,U.jsx)(kF,{...l})});kA.displayName="SchemaComponent";let kP=Object.freeze({}),kj={},kM=e=>/{{.*?}}/g.test(e),kI=function(){let{noCache:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{noCache:!1},t=(0,J.useContext)(ni.SchemaOptionsContext),l=(0,J.useContext)(ni.SchemaExpressionScopeContext);return(n,o)=>{let r,i=!1;if("string"==typeof n&&n.startsWith("{{")&&(i=!0,r=n),n&&"object"==typeof n&&!(0,J.isValidElement)(n)){try{r=JSON.stringify(n)}catch(e){return console.warn("Failed to stringify:",e),n}if(kj[r])return kj[r];i=kM(r)}if(Array.isArray(n)){try{r=JSON.stringify(n)}catch(e){return console.warn("Failed to stringify:",e),n}if(kj[r])return kj[r];i=kM(r)}if(i){let i={...null==t?void 0:t.scope,...l,...o};if(!r)return ni.Schema.compile(n,i);try{if(e)return ni.Schema.compile(n,i);return kj[r]=kj[r]||ni.Schema.compile(n,i),kj[r]}catch(e){return console.log("useCompile error",n,e),ni.Schema.compile(n,i)}}return n}},kT=(e,t)=>{if((e||t)&&!(0,rj.isFn)(e))return(0,U.jsxs)(J.Fragment,{children:[e,t]})},kR=e=>e&&("object"==typeof e||"function"==typeof e),kE=(e,t,l)=>(0,rj.isFn)(e)?e(t,l):e,kN=e=>{let t,l=(0,J.useContext)(ni.SchemaComponentsContext),n=e.field,o=kT(kE(e.children,n,n.form),n.content??n.componentProps.children);if("visible"!==n.display)return null;let r=e=>kR(e)?e:rj.FormPath.getIn(l,e)??e;return t=n.componentType?J.createElement(r(n.componentType),{...n.componentProps,value:n.value},o):o,n.decoratorType?J.createElement(r(n.decoratorType),n.decoratorProps,t):(0,U.jsx)(J.Fragment,{children:t})};kN.displayName="NocoBaseReactiveInternal";let kD=kN;function kB(e){return new k$(e)}kD.displayName="NocoBaseReactiveField";class k${initialize(){var e,t,l,n,o,r,i,a,s,d,u,c,p,m,h,f,g,v,y,x;let b=this.props.compile;this.pattern="readPretty",this.readPretty=!0,this.initialized=!0,this.loading=!1,this.validating=!1,this.submitting=!1,this.selfModified=!1,this.active=!1,this.visited=!0,this.mounted=!0,this.unmounted=!1,this.inputValues=[],this.inputValue=null,this.feedbacks=[],this.title=b(this.props.title||(null==(e=this.props.schema)?void 0:e.title)),this.description=b(this.props.description||(null==(t=this.props.schema)?void 0:t.description)),this.display="visible",this.editable=this.props.editable||(null==(l=this.props.schema)?void 0:l["x-editable"]),this.disabled=this.props.disabled||(null==(n=this.props.schema)?void 0:n["x-disabled"]),this.readOnly=this.props.readOnly||(null==(o=this.props.schema)?void 0:o["x-read-only"]),this.visible=this.props.visible||(null==(r=this.props.schema)?void 0:r["x-visible"]),this.hidden=this.props.hidden||(null==(i=this.props.schema)?void 0:i["x-hidden"]),this.dataSource=b(this.props.dataSource||(null==(a=this.props.schema)?void 0:a.enum)),this.validator=this.props.validator,this.required=this.props.required||!!(null==(s=this.props.schema)?void 0:s.required),this.content=b(this.props.content||(null==(d=this.props.schema)?void 0:d["x-content"])),this.initialValue=b(this.props.initialValue||(null==(u=this.props.schema)?void 0:u.default)),this.value=b(this.props.value),this.data=this.props.data||(null==(c=this.props.schema)?void 0:c["x-data"]),this.decorator=this.props.decorator?(0,rj.toArr)(this.props.decorator):[null==(p=this.props.schema)?void 0:p["x-decorator"],null==(m=this.props.schema)?void 0:m["x-decorator-props"]],this.component=this.props.component?(0,rj.toArr)(this.props.component):[null==(h=this.props.schema)?void 0:h["x-component"],null==(f=this.props.schema)?void 0:f["x-component-props"]],this.decoratorProps=(null==(g=this.props.schema)?void 0:g["x-decorator-props"])||{},this.componentProps=(null==(v=this.props.schema)?void 0:v["x-component-props"])||{},this.decoratorType=null==(y=this.props.schema)?void 0:y["x-decorator"],this.componentType=null==(x=this.props.schema)?void 0:x["x-component"],this.path={},this.form={},this.address={concat:rR().noop}}constructor(e){this.props=e,this.initialize()}}let kO=e=>{let t=kI(),l=(0,ni.useFieldSchema)(),n=(0,J.useMemo)(()=>kB({...e,compile:t}),[]);return Object.assign(n.componentProps,l["x-component-props"]),n.value=e.value,(0,U.jsx)(ni.FieldContext.Provider,{value:n,children:(0,U.jsx)(kD,{field:n,children:e.children})})},kq=J.createContext({}),k_=J.createContext(rR().noop),kL=e=>{let{children:t,refresh:l}=e,n=kU(),o=(0,J.useCallback)(e=>{l(),(null==e?void 0:e.refreshParentSchema)&&(null==n||n())},[n,l]);return(0,U.jsx)(k_.Provider,{value:o,children:t})},kV=J.createContext(rR().noop),kz=e=>{let{children:t,refresh:l}=e;return(0,U.jsx)(kV.Provider,{value:l,children:t})},kK=()=>J.useContext(kV),kU=()=>J.useContext(k_),kW=()=>J.useContext(kq)||{},kH=e=>{let{children:t,fieldSchema:l}=e,n=erD(),o=kg(),r=null==l?void 0:l.name,i=(0,J.useMemo)(()=>{var e;if(!n)return null;let t=null==l||null==(e=l["x-component-props"])?void 0:e.field;return o.getCollectionField(null==l?void 0:l["x-collection-field"])||t||n.getField((null==t?void 0:t.name)||r)},[n,o,l,r]);return(0,U.jsx)(kq.Provider,{value:i,children:t})},kG=rR().memoize((e,t)=>e.toFieldProps({scope:t})),kY=e=>kG(e,(0,ni.useExpressionScope)()),kJ=e=>{let t=(0,ni.useField)();if(e.onlyRenderProperties){var l;return e.basePath||(null==t||null==(l=t.address)?void 0:l.concat(e.name))}return e.basePath||(null==t?void 0:t.address)},kX=(e,t,l)=>{let n=e.toJSON();if(l){if(!n.properties)return e;let l=Object.keys(n.properties)[0],o=Object.values(n.properties)[0];return n.properties[l]=(0,rj.merge)(rR().omit(t,"type","x-read-pretty"),o),new ni.Schema(n)}return new ni.Schema((0,rj.merge)(rR().omit(t,"type","x-read-pretty"),n))},kQ=e=>{let{schema:t,field:l,basePath:n,mapProperties:o,filterProperties:r,propsRecursion:i,values:a,isUseFormilyField:s}=e,d=ni.Schema.getOrderProperties(t);return d.length?(0,U.jsx)(J.Fragment,{children:d.map((e,t)=>{let{schema:d,key:u}=e,c=(null==l?void 0:l.address)||n,p=d;if((0,rj.isFn)(o)){let e=o(d,u);e&&(p=e)}if((0,rj.isFn)(r)&&!1===r(p,u))return null;let m=(0,rj.isBool)(i)&&i?(0,U.jsx)(k1,{propsRecursion:!0,filterProperties:r,mapProperties:o,schema:p,name:u,basePath:c,values:rR().get(a,u),isUseFormilyField:s}):(0,U.jsx)(k1,{schema:p,name:u,basePath:c,values:rR().get(a,u),isUseFormilyField:s});return"CollectionField"===p["x-component"]?(0,U.jsx)(kZ.Provider,{value:!0,children:(0,U.jsx)(kH,{fieldSchema:p,children:m})},`${t}-${u}`):(0,U.jsx)(kZ.Provider,{value:!1,children:(0,U.jsx)(kq.Provider,{value:kP,children:m})},`${t}-${u}`)})}):null},kZ=J.createContext(!1),k0=()=>J.useContext(kZ),k1=J.memo(e=>{let{schema:t,name:l,onlyRenderProperties:n,onlyRenderSelf:o,mapProperties:r,filterProperties:i,propsRecursion:a,values:s,isUseFormilyField:d=!0,uiSchema:u,parentSchema:c}=e,p=kJ(e),m=(0,J.useRef)(null),h=(0,J.useMemo)(()=>(m.current=null,new ni.Schema(t)),[t]),{uiSchema:f,defaultValue:g}=kW(),v=(0,Sc.A)(),{onChange:y}=(0,J.useContext)(kC),x=m.current||h;if(!x.parent&&c){var b,w;x.parent=c,(null==(w=x.parent)||null==(b=w.properties)?void 0:b[x.name])||!x.name||rR().set(x.parent,`properties.${x.name}`,x)}let S=(0,J.useCallback)(()=>{let e=x.parent;m.current=new ni.Schema(x.toJSON(),e),(null==e?void 0:e.properties)&&Object.keys(e.properties).forEach(t=>{t===x.name&&(e.properties[t]=m.current)}),v(),null==y||y()},[x,y,v]),C=(0,J.useMemo)(()=>u?kX(x,u,n):f?(f.default=g,kX(x,f,n)):x,[f,g,x,n,u]),F=kY(C),k=e=>{if(!o)return kQ({schema:x,field:e,basePath:p,mapProperties:r,filterProperties:i,propsRecursion:a,values:s,isUseFormilyField:d})},A=()=>(0,rj.isValid)(l)?"object"===C.type?n?k():(0,U.jsx)(ni.ObjectField,{...F,name:l,basePath:p,children:k}):"array"===C.type?(0,U.jsx)(ni.ArrayField,{...F,name:l,basePath:p}):"void"===C.type?n?k():(0,U.jsx)(ni.VoidField,{...F,name:l,basePath:p,children:k}):d?(0,U.jsx)(ni.Field,{...F,name:l,basePath:p}):(0,U.jsx)(kO,{name:l,value:s,initialValue:s,basePath:p,schema:C}):k();return x?(0,U.jsx)(ni.SchemaContext.Provider,{value:x,children:(0,U.jsx)(kL,{refresh:S,children:A()})}):(0,U.jsx)(J.Fragment,{})});k1.displayName="NocoBaseRecursionField";var k2=l(58156),k8=l.n(k2),k5=l(63560),k4=l.n(k5);let k3=Symbol("LAZY_COMPONENT_KEY"),k6=new Map;function k9(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(0===l.length){let t=(0,J.lazy)(()=>e().then(e=>{let t=e.default;return l[k3]=t,{default:t}})),l=e=>(0,U.jsx)(J.Suspense,{fallback:(0,U.jsx)(nk.A,{}),children:(0,U.jsx)(t,{...e})});return l}return l.reduce((t,l)=>{let n=(0,J.lazy)(()=>e().then(e=>{let n=(0,rT.get)(e,l);return t[l][k3]=n,{default:n}}));return t[l]=e=>(0,U.jsx)(J.Suspense,{fallback:(0,U.jsx)(nk.A,{}),children:(0,U.jsx)(n,{...e})}),t},{})}function k7(e,t){let l="function"==typeof t?t:e=>e[t],n=e.toString(),o=k6.get(n);if(null==o?void 0:o.error)throw o.error;if(null==o?void 0:o.module)return l(o.module);if(!(null==o?void 0:o.promise)){let t=o||{};throw t.promise=e().then(e=>(t.module=e,e)).catch(e=>{throw t.error=e,e}),k6.set(n,t),t.promise}throw o.promise}function Ae(e,t){if(e)return e["x-app-version"]||(e["x-app-version"]=t),Object.keys(e.properties||{}).forEach(l=>{var n;Ae(null==(n=e.properties)?void 0:n[l],t)}),e}var At="2.1.15";function Al(e){return new As(e)}let An=e=>{e&&(e["x-uid"]||(e["x-uid"]=(0,rj.uid)()),Object.keys(e.properties||{}).forEach(t=>{An(e.properties[t])}))},Ao=e=>e,Ar=(e,t)=>{if(e&&t){for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)&&t[l]!==(null==e?void 0:e[l]))return!1;return!0}},Ai=(e,t)=>{if(e["x-uid"]&&e["x-uid"]===t["x-uid"])return[null,e.toJSON()];let l=e.toJSON(),n={...l,properties:{}},o=null,r=(e,l)=>{Object.keys(e||{}).forEach(n=>{let i=e[n];if(i["x-uid"]===t["x-uid"]){o=e[n];return}l.properties[n]={...i,properties:{}},r(null==i?void 0:i.properties,l.properties[n])})};return r(l.properties,n),[n,o]},Aa=e=>e;class As{get model(){return this.options.model}get query(){return this.options.query}loadAPIClientEvents(){let{api:e,t=Aa}=this.options;if(!e)return;let l=e=>{if(!e)return[];let t=Object.values(e.properties).length,l=[];return(e.mapProperties(e=>{e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].width=100/t,e["x-uid"]&&l.push({"x-uid":e["x-uid"],"x-component-props":e["x-component-props"]})}),e["x-uid"]&&l.length)?l:[]};this.on("insertAdjacent",async n=>{var o;let{onSuccess:r,current:i,position:a,schema:s,wrap:d,wrapped:u,removed:c}=n,p=[];if((null==u?void 0:u["x-component"])==="Grid.Col"&&(p=p.concat(l(u.parent))),(null==c?void 0:c["x-component"])==="Grid.Col"&&(p=p.concat(l(c.parent))),this.refresh(),!i["x-uid"])return;let m=await e.request({url:`/uiSchemas:insertAdjacent/${i["x-uid"]}?position=${a}`,method:"post",data:{schema:Ae(s,this.appVersion),wrap:d}});p.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:p}),(null==c?void 0:c["x-uid"])&&await e.request({url:`/uiSchemas:remove/${c["x-uid"]}`,method:"post"}),null==r||r(null==m||null==(o=m.data)?void 0:o.data),bz.Ay.success(t("Saved successfully"),.2)}),this.on("patch",async l=>{let{schema:n}=l;this.refresh(),(null==n?void 0:n["x-uid"])&&(await e.request({url:"/uiSchemas:patch",method:"post",data:{...n}}),bz.Ay.success(t("Saved successfully"),.2))}),this.on("initializeActionContext",async t=>{let{schema:l}=t;(null==l?void 0:l["x-uid"])&&await e.request({url:"/uiSchemas:initializeActionContext",method:"post",data:{...l}})}),this.on("batchPatch",async l=>{let{schemas:n}=l;this.refresh(),await e.request({url:"/uiSchemas:batchPatch",method:"post",data:n}),bz.Ay.success(t("Saved successfully"),.2)}),this.on("remove",async n=>{let{removed:o}=n,r=[];(null==o?void 0:o["x-component"])==="Grid.Col"&&(r=l(o.parent)),this.refresh(),(null==o?void 0:o["x-uid"])&&(await e.request({url:`/uiSchemas:remove/${o["x-uid"]}`,method:"post"}),r.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:r}),bz.Ay.success(t("Saved successfully"),.2))})}prepareProperty(e){e.type||(e.type="void"),e.name||(e.name=(0,rj.uid)()),this.current["x-uid"]&&An(e)}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}async emit(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(!this.events[e])return;let[o,...r]=l;return Promise.all(this.events[e].map(e=>e.bind(this)({current:this.current,...o},...r)))}parentsIn(e){if(!e||!ni.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"},l={"x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(n=>{t[n]?(this.current[n]=e[n],this.updateModel(t[n],e[n])):l[n]?Object.keys(e[n]).forEach(t=>{k4()(this.current,[n,t],e[n][t]),this.updateModel([l[n],t],e[n][t])}):this.current[n]=e[n]}),this.emit("patch",{schema:e})}getSchemaAttribute(e,t){return k8()(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(l=>{this.current[l]=e[l],t[l]&&this.updateModel(t[l],e[l])}),this.emit("patch",{schema:e})}updateModel(e,t){let l=l=>{k4()(l,e,t)};this.model&&l(this.model),this.query&&this.query.take(l)}insertAdjacent(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};switch(e){case"beforeBegin":return this.insertBeforeBegin(t,l);case"afterBegin":return this.insertAfterBegin(t,l);case"beforeEnd":return this.insertBeforeEnd(t,l);case"afterEnd":return this.insertAfterEnd(t,l)}}recursiveRemoveIfNoChildren(e,t){let l;if(!e)return;let n=e,o=null==t?void 0:t.breakRemoveOn;for(;n;){if("function"==typeof o){if(o(n))break}else if(Ar(n,o))break;if(Object.keys(n.properties||{}).length>0)break;n.parent&&(l=n.parent.removeProperty(n.name)),n=n.parent}return l}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:l,removeParentsIfNoChildren:n}=t,o=e||this.current,r=o.parent.removeProperty(o.name);if(n){let e=this.recursiveRemoveIfNoChildren(o.parent,{breakRemoveOn:l});e&&(r=e)}return this.emit("remove",{removed:r})}removeWithoutEmit(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:l,removeParentsIfNoChildren:n}=t,o=e||this.current,r=o.parent.removeProperty(o.name);if(n){let e=this.recursiveRemoveIfNoChildren(o.parent,{breakRemoveOn:l});e&&(r=e)}return r}insertBeforeBeginOrAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current)||!ni.Schema.isSchemaInstance(e)||this.current.parent!==e.parent)return;let l=0,n=0;return this.current.parent.mapProperties((t,o,r)=>{this.current.name===o&&(n=r),e.name===o&&(l=r)}),l>n?this.insertBeforeBegin(e,t):this.insertAfterEnd(e,t)}insertBeforeBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current))return;let l={onSuccess:t.onSuccess},{wrap:n=Ao,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ni.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=Fh()(e));let i={},a=!1,s=0,d=0;this.current.parent.mapProperties((e,t)=>{t===this.current.name&&(d=s,a=!0,++s),e["x-index"]=s,++s,a&&(i[t]=e,this.current.parent.removeProperty(t))}),this.prepareProperty(e);let u=n(e),c=this.current.parent.addProperty(u.name||(0,rj.uid)(),u);c["x-index"]=d,c.parent=this.current.parent,this.current.parent.setProperties(i);let[p,m]=Ai(c,e);this.emit("insertAdjacent",{position:"beforeBegin",schema:m,wrapped:u,wrap:p,...l})}insertAfterBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current))return;let l={onSuccess:t.onSuccess},{wrap:n=Ao,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ni.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=Fh()(e));let i={},a=1;this.current.mapProperties((e,t)=>{e["x-index"]=a,++a,i[t]=e}),this.current.properties={},this.prepareProperty(e);let s=n(e),d=this.current.addProperty(s.name||(0,rj.uid)(),s);d["x-index"]=0,d.parent=this.current,this.current.setProperties(i);let[u,c]=Ai(d,e);this.emit("insertAdjacent",{position:"afterBegin",schema:c,wrap:u,wrapped:s,...l})}insertBeforeEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current))return;delete e["x-index"];let l={onSuccess:t.onSuccess},{wrap:n=Ao,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ni.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=Fh()(e));this.prepareProperty(e);let i=n(e),a=this.current.addProperty(i.name||(0,rj.uid)(),i);a.parent=this.current;let[s,d]=Ai(a,e);return this.emit("insertAdjacent",{position:"beforeEnd",schema:d,wrap:s,wrapped:i,...l})}insertAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current))return;let l={onSuccess:null==t?void 0:t.onSuccess},{wrap:n=Ao,breakRemoveOn:o,removeParentsIfNoChildren:r}=t,i=0,a=0,s=!1,d={};if(this.current.parent.mapProperties((e,t)=>{e["x-index"]=i,t===this.current.name&&(a=++i,s=!0),++i,s&&t!==this.current.name&&(d[t]=e,this.current.parent.removeProperty(t))}),ni.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o})),e.parent=null}else e&&(e=Fh()(e));this.prepareProperty(e);let u=n(e),c=this.current.parent.addProperty(u.name||(0,rj.uid)(),u);c.parent=this.current.parent,c["x-index"]=a,this.current.parent.setProperties(d);let[p,m]=Ai(c,e);this.emit("insertAdjacent",{position:"afterEnd",schema:m,wrap:p,wrapped:u,...l})}constructor(e){this.events={},this.options=e,this.current=e.current,this.appVersion=e.appVersion}}function Ad(){let e=(0,J.useContext)(ni.SchemaOptionsContext),t=(0,J.useMemo)(()=>(null==e?void 0:e.components)||{},[e]);return e=>{if(!e)return null;if("string"!=typeof e)return e;let l=k8()(t,e);return l||console.error(`[nocobase]: Component "${e}" not found`),l}}function Au(){let{designable:e,setDesignable:t,refresh:l,reset:n}=(0,J.useContext)(ky),o=(0,J.useContext)(ni.SchemaOptionsContext),r=(0,J.useMemo)(()=>(null==o?void 0:o.components)||{},[o]),i=(0,J.useMemo)(()=>()=>(0,U.jsx)(U.Fragment,{}),[]),a=(0,Sc.A)(),s=kU(),d=kK(),u=(0,J.useCallback)(e=>{null==l||l(),a(),null==s||s(e),null==d||d()},[l,a,s,d]),c=(0,ni.useField)(),p=(0,ni.useFieldSchema)(),m=Fb(),{t:h}=(0,lE.B)(),f=(0,J.useMemo)(()=>Al({t:h,api:m,refresh:u,current:p,model:c,appVersion:At}),[h,m,u,p,c]);(0,J.useEffect)(()=>{f.loadAPIClientEvents()},[f]);let{isMobileLayout:g}=SQ();return{dn:f,designable:!g&&e,reset:n,refresh:u,setDesignable:t,DesignableBar:i,findComponent:(0,J.useCallback)(e=>{if(!e)return null;if("string"!=typeof e)return e;let t=k8()(r,e);return(null==t?void 0:t[k3])??t},[k8()]),on:f.on.bind(f),patch:(0,J.useCallback)((e,t)=>{let l=e=>{Object.keys(e).forEach(t=>{let l=e[t];"title"===t&&(c.title=l,p.title=l),"x-decorator-props"===t&&(c.decoratorProps||(c.decoratorProps={}),p["x-decorator-props"]||(p["x-decorator-props"]={}),Object.keys(l).forEach(e=>{c.decoratorProps[e]=l[e],p["x-decorator-props"][e]=l[e]})),"x-component-props"===t&&(c.componentProps||(c.componentProps={}),p["x-component-props"]||(p["x-component-props"]={}),Object.keys(l).forEach(e=>{c.componentProps[e]=l[e],p["x-component-props"][e]=l[e]}))})};if("string"==typeof e){let n={};return k4()(n,e,t),l(n)}l(e),u()},[f]),shallowMerge:(0,J.useCallback)(e=>{f.shallowMerge(e)},[f]),deepMerge:(0,J.useCallback)(e=>{f.deepMerge(e)},[f]),remove:(0,J.useCallback)((e,t)=>{f.remove(e,t)},[f]),insertAdjacent:(0,J.useCallback)((e,t,l)=>{f.insertAdjacent(e,t,l)},[f]),insertBeforeBegin:(0,J.useCallback)(e=>{f.insertBeforeBegin(e)},[f]),insertAfterBegin:(0,J.useCallback)(e=>{f.insertAfterBegin(e)},[f]),insertBeforeEnd:(0,J.useCallback)(e=>{f.insertBeforeEnd(e)},[f]),insertAfterEnd:(0,J.useCallback)(e=>{f.insertAfterEnd(e)},[f])}}let Ac=()=>void 0,Ap=(e,t,l)=>{let n;return rR().isFunction(e)?n=e:(n=t[e])||console.error(`${l} is not registered`),n||Ac},Am=(e,t)=>{let l;if(!e)return Ac;if(rR().isFunction(e))return e;for(let n of e.split("."))l=Ap(n,l||t,e);return l};function Ah(e,t){return Am(e,(0,ni.useExpressionScope)())(t)}function Af(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=t.displayName||e.displayName||e.name,n=t=>{let{dn:l,findComponent:o}=Au(),r=Ah((0,J.useMemo)(()=>{let e=l.getSchemaAttribute("x-component"),t=l.getSchemaAttribute("x-decorator"),r=l.getSchemaAttribute("x-use-component-props"),i=l.getSchemaAttribute("x-use-decorator-props");return e&&r&&o(e)===n?r:t&&i&&o(t)===n?i:void 0},[l]),t),i=(0,J.useMemo)(()=>({...t,...r}),[r,t]);return(0,U.jsx)(J.Suspense,{fallback:(0,U.jsx)(nk.A,{}),children:(0,U.jsx)(e,{...i,children:t.children})})};return e.displayName=l,n.displayName=`withSchemaProps(${l})`,n}var Ag=l(16933),Av=l(60152);let Ay=new Map;function Ax(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;Ay.set(e.toLowerCase(),t)}function Ab(e){return!!e&&Ay.has(e.toLowerCase())}function Aw(e){Object.keys(e).forEach(t=>{Ax(t,e[t])})}Object.keys(rC).forEach(e=>{Ax(e,rC[e])});let AS=e=>{let{type:t="",component:l,...n}=e;if(l)return(0,U.jsx)(Ag.A,{component:l,...n});if(t&&Ay.has(t.toLowerCase())){let e=Ay.get(t.toLowerCase());return(0,U.jsx)(e,{...n})}return t&&o?(0,U.jsx)(o,{type:t}):null};AS.createFromIconfontCN=e=>{o=(0,Av.A)(e)},AS.register=e=>{Aw(e)};let AC=(0,J.createContext)(null),AF=e=>{let{children:t,parent:l}=e;return(0,U.jsx)(AC.Provider,{value:{parent:l},children:t})},Ak=()=>{let e=J.useContext(AC);return null==e?void 0:e.parent};class AA{setData(e){this.data=e}setParentRecord(e){this.parentRecord=e}constructor(e){const{data:t,parentRecord:l,isNew:n}=e;this.isNew=n,this.data=t,this.parentRecord=l}}let AP=(0,J.createContext)(null);AP.displayName="CollectionRecordContext";let Aj=J.memo(e=>{let{isNew:t,record:l,parentRecord:n,children:o}=e,r=(0,J.useMemo)(()=>n?n instanceof AA?n:new AA({data:n}):l instanceof AA?l.parentRecord:void 0,[n,l]),i=(0,J.useMemo)(()=>{let e;return l?l instanceof AA?(e=l).isNew=l.isNew||t:e=new AA({data:l,isNew:t}):e=new AA({isNew:t}),e.setParentRecord(r),e},[l,r,t]);return(0,U.jsx)(AP.Provider,{value:i,children:o})});function AM(){return(0,J.useContext)(AP)}function AI(){let e=AM();return null==e?void 0:e.data}function AT(){let e=AM();return null==e?void 0:e.parentRecord}function AR(){var e;let t=AM();return null==t||null==(e=t.parentRecord)?void 0:e.data}Aj.displayName="CollectionRecordProvider";let AE=J.createContext(null),AN=J.createContext(null),AD=J.memo(e=>{var t,l;let{t:n}=(0,lE.B)(),o=AI(),r=erD(),i=AB();return(0,U.jsx)(AN.Provider,{value:{name:"$nParentPopupRecord",title:n("Parent popup record"),value:(null==(t=e.parent)?void 0:t.recordData)||(null==i?void 0:i.value),collection:(null==(l=e.parent)?void 0:l.collection)||(null==i?void 0:i.collection)},children:(0,U.jsx)(AE.Provider,{value:{name:"$nPopupRecord",title:n("Current popup record"),value:e.recordData||o,collection:e.collection||r},children:e.children})})});AD.displayName="VariablePopupRecordProvider";let AB=()=>J.useContext(AE),A$=()=>J.useContext(AN);class AO{get app(){return this.dataSourceManager.app}get key(){return this.options.key}get displayName(){return this.options.displayName}get status(){return this.options.status}get errorMessage(){return this.options.errorMessage}get collections(){return this.collectionManager.getCollections()||[]}getOptions(){return this.options}setOptions(e){Object.assign(this.options,e)}getOption(e){return this.options[e]}addReloadCallback(e){this.reloadCallbacks.includes(e)||this.reloadCallbacks.push(e)}removeReloadCallback(e){this.reloadCallbacks=this.reloadCallbacks.filter(t=>t!==e)}get flowEngineDataSourceManager(){var e;return null==(e=this.app.flowEngine)?void 0:e.context.dataSourceManager}async reload(){let e=await this.getDataSource(),t=this.flowEngineDataSourceManager;return t&&(t.upsertDataSource(this.options),t.getDataSource(this.key).upsertCollections(e.collections||[],{clearFields:!0})),this.setOptions(e),this.collectionManager.setCollections(e.collections||[]),this.reloadCallbacks.forEach(t=>t(e.collections)),this.options}constructor(e,t){this.options=e,this.dataSourceManager=t,this.reloadCallbacks=[],this.collectionManager=new erq(e.collections,this)}}class Aq extends AO{getDataSource(){return{collections:this.collections}}}class A_{addCollectionTemplates(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.reduce((e,t)=>{let l=new t(this);return e[l.name]=l,e},{});return Object.assign(this.collectionTemplateInstances,t),this.dataSourceManager.getDataSources().forEach(e=>{let l=e.collectionManager.getCollections(e=>t[e.template]);e.collectionManager.reAddCollections(l)}),t}getCollectionTemplate(e){return this.collectionTemplateInstances[e]}getCollectionTemplates(e){return Object.values(this.collectionTemplateInstances).filter(t=>{var l,n;return!e||!t.supportDataSourceType&&!t.notSupportDataSourceType||(t.supportDataSourceType?null==(l=t.supportDataSourceType)?void 0:l.includes(e):t.notSupportDataSourceType?!(null==(n=t.notSupportDataSourceType)?void 0:n.includes(e)):void 0)}).sort((e,t)=>(e.order||0)-(t.order||0))}constructor(e,t){this.dataSourceManager=t,this.collectionTemplateInstances={},this.addCollectionTemplates(e)}}var AL=l(84795);let AV=vy()(),Az=(0,A.css)`
1027
+ `,defaultValue:"h:mm a",formats:["hh:mm:ss a","HH:mm:ss"],timeFormat:!0},default:"HH:mm:ss",enum:[{label:(0,Cg.b)({format:"hh:mm:ss a"}),value:"hh:mm:ss a"},{label:(0,Cg.b)({format:"HH:mm:ss"}),value:"HH:mm:ss"},{label:"custom",value:"custom"}]}},CA={type:"array",title:'{{t("Options")}}',"x-decorator":"FormItem","x-component":"ArrayTable","x-component-props":{pagination:{pageSize:1e3}},items:{type:"object",properties:{column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:50,title:"",align:"center"},properties:{sort:{type:"void","x-component":"ArrayTable.SortHandle"}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Option value")}}'},properties:{value:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"Input"}}},column3:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Option label")}}'},properties:{label:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"Input"}}},column4:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Color")}}'},properties:{color:{type:"string","x-decorator":"FormItem","x-component":"ColorSelect"}}},column5:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:"",dataIndex:"operations",fixed:"right"},properties:{item:{type:"void","x-component":"FormItem",properties:{remove:{type:"void","x-component":"ArrayTable.Remove"}}}}}}},properties:{add:{type:"void","x-component":"ArrayTable.Addition","x-component-props":{randomValue:!0},title:"{{t('Add option')}}"}}},CP={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input","x-validator":"uid",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"}},Cj={type:"string",title:'{{t("Options")}}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{multiple:!0},enum:"{{collections}}"};class CM{addComponentOption(e){if(!this.componentOptions){var t,l,n,o,r,i;this.componentOptions=[];let e=null==(l=this.default)||null==(t=l.uiSchema)?void 0:t["x-component"],a=null==(o=this.default)||null==(n=o.uiSchema)?void 0:n["x-component-props"];if(e){let t=(null==(i=this.default)||null==(r=i.uiSchema)?void 0:r.type)||"string",l=(0,ev.tval)(e.startsWith("Input")?(0,G.capitalize)(t):e.split(".").pop());this.componentOptions=[{label:l,value:e,useProps:()=>a||{}}]}}this.componentOptions.push(e)}getConfigureFormProperties(e){var t,l,n,o;let r=(null==(l=this.configure)||null==(t=l.getConfigureFormProperties)?void 0:t.call(l,e))||(null==(n=this.configure)?void 0:n.properties)||{},i=this.hasDefaultValue?this.getDefaultValueProperty():{},a=null==e?void 0:e.view,s=(null==e?void 0:e.template)==="sql"||(null==e?void 0:e.sql),d=[...new Set([...this.availableValidationOptions,"required"])],u=a||s||!this.validationType?{}:{validation:{title:'{{ t("Validation") }}',required:!1,"x-decorator":"FormItem","x-component":"FieldValidation","x-component-props":{type:this.validationType,availableValidationOptions:d,excludeValidationOptions:[...new Set(this.excludeValidationOptions)],isAssociation:this.isAssociation}}};return{...(0,G.cloneDeep)({...CP,...null==(o=this)?void 0:o.properties,...r}),...i,...u}}getDefaultValueProperty(){var e,t,l,n;return{defaultValue:{...(0,G.cloneDeep)(null==(t=this)||null==(e=t.default)?void 0:e.uiSchema),...null==(n=this)||null==(l=n.properties)?void 0:l.uiSchema,required:!1,title:'{{ t("Default value") }}',"x-decorator":"FormItem"}}}addOperator(e){this.filterable||(0,G.set)(this,"filterable",{});let t=Array.isArray(this.filterable.operatorOverrides)?[...this.filterable.operatorOverrides]:[],l=t.findIndex(t=>t.value===e.value);-1!==l?t[l]=e:t.push(e),(0,G.set)(this,"filterable.operatorOverrides",t),ib(this.filterable)}constructor(e){this.collectionFieldInterfaceManager=e,this.availableValidationOptions=[]}}class CI extends CM{constructor(...e){super(...e),this.name="checkbox",this.type="object",this.group="choices",this.order=1,this.title='{{t("Checkbox")}}',this.default={type:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},this.availableTypes=["boolean","integer","bigInt","bit"],this.hasDefaultValue=!0,this.properties={...CP},this.filterable={operators:"boolean"}}}class CT extends CM{constructor(...e){super(...e),this.name="checkboxGroup",this.type="object",this.group="choices",this.order=5,this.title='{{t("Checkbox group")}}',this.default={interface:"checkboxGroup",type:"array",defaultValue:[],uiSchema:{type:"string","x-component":"Checkbox.Group"}},this.availableTypes=["array","json"],this.hasDefaultValue=!0,this.properties={...CP,"uiSchema.enum":CA},this.filterable={operators:"array"}}}class CR extends CM{constructor(...e){super(...e),this.name="collection",this.type="string",this.group="advanced",this.order=5,this.title='{{t("Collection selector")}}',this.description='{{t("Providing certain collections as options for users, typically used in polymorphic or inheritance scenarios")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"CollectionSelect"}},this.availableTypes=["string"],this.hasDefaultValue=!1,this.properties={...CP,"uiSchema.enum":Cj},this.filterable={operators:"collection"}}}class CE extends CM{constructor(...e){super(...e),this.name="color",this.type="object",this.group="basic",this.order=10,this.title='{{t("Color")}}',this.default={type:"string",uiSchema:{type:"string","x-component":"ColorPicker"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.properties={...CP},this.filterable={operators:"string"}}}class CN extends CM{constructor(...e){super(...e),this.name="createdAt",this.type="object",this.group="systemInfo",this.order=1,this.title='{{t("Created at")}}',this.sortable=!0,this.default={type:"date",field:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},this.description='{{t("Store the creation time of each record")}}',this.availableTypes=[],this.properties={...CP,...CF},this.filterable={operators:"datetime"},this.titleUsable=!0}}class CD extends CM{constructor(...e){super(...e),this.name="createdBy",this.type="object",this.group="systemInfo",this.order=3,this.title='{{t("Created by")}}',this.isAssociation=!0,this.default={type:"belongsTo",target:"users",foreignKey:"createdById",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},this.availableTypes=["belongsTo"],this.properties={...CP},this.filterable={nested:!0,children:[]},this.description='{{t("Store the creation user of each record")}}'}}class CB extends CM{constructor(...e){super(...e),this.name="datetime",this.type="object",this.group="datetime",this.order=1,this.title='{{t("Datetime (with time zone)")}}',this.sortable=!0,this.default={type:"date",defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,timezone:!0,uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{showTime:!1,utc:!0}}},this.availableTypes=["date","string","datetime","datetimeTz"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...CP,...CF,defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp on update")}}'},"uiSchema.x-component-props.gmt":{type:"boolean",title:'{{t("GMT")}}',"x-hidden":!0,"x-component":"Checkbox","x-content":'{{t("Use the same time zone (GMT) for all users")}}',"x-decorator":"FormItem",default:!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class C$ extends CM{constructor(...e){super(...e),this.name="email",this.type="object",this.group="basic",this.order=4,this.title='{{t("Email")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Input","x-validator":"email"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","email","pattern"],this.properties={...CP,unique:Cv},this.filterable={operators:"string"},this.titleUsable=!0}}class CO extends CM{constructor(...e){super(...e),this.name="icon",this.type="object",this.group="basic",this.order=10,this.title='{{t("Icon")}}',this.default={type:"string",uiSchema:{type:"string","x-component":"IconPicker"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.properties={...CP}}}class Cq extends CM{constructor(...e){super(...e),this.name="id",this.type="object",this.group="systemInfo",this.order=0,this.title='{{t("ID")}}',this.hidden=!0,this.sortable=!0,this.default={name:"id",type:"bigInt",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0}},this.availableTypes=["bigInt","integer"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,default:"ID","x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"}},this.filterable={operators:"id"},this.description='{{t("Primary key, unique identifier, self growth") }}',this.titleUsable=!0}}let C_=e=>e,CL=e=>{if((0,rj.isArr)(e)){for(let t=0;t<e.length;t++)if((0,rj.isValid)(e[t]))return!1;return!0}if(null==e?void 0:e.getCurrentContent){var t;return!(null==(t=e.getCurrentContent())?void 0:t.hasText())}return(0,rj.isEmpty)(e)};(0,S4.registerValidateRules)({username:e=>/^[^@<>"'/]{1,50}$/.test(e)||C_("Must be 1-50 characters in length (excluding @<>\"'/)"),required:(e,t)=>!1===t.required?"":("string"==typeof e&&(e=e.trim()),CL(e)?t.message:"")});class CV extends CM{constructor(...e){super(...e),this.name="input",this.type="object",this.group="basic",this.order=1,this.title='{{t("Single line text")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.sortable=!0,this.default={interface:"input",type:"string",uiSchema:{type:"string","x-component":"Input"}},this.availableTypes=["string","uid"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.properties={...CP,trim:{type:"boolean","x-content":'{{t("Automatically remove heading and tailing spaces")}}',"x-decorator":"FormItem","x-component":"Checkbox"},layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}}},this.filterable={operators:"string"},this.titleUsable=!0}}(0,rP.registerValidateFormats)({odd:/^-?\d*[13579]$/,even:/^-?\d*[02468]$/});class Cz extends CM{constructor(...e){super(...e),this.name="integer",this.type="object",this.group="basic",this.order=6,this.title='{{t("Integer")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier, self growth")}}',this.sortable=!0,this.default={type:"bigInt",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"},"x-validator":"integer"}},this.availableTypes=["bigInt","integer","sort","snowflakeId"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["precision"],this.properties={...CP,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}},autoIncrement:Cx},this.filterable={operators:"number"},this.titleUsable=!0}}(0,rP.registerValidateRules)({json(e){try{return JSON.parse(e),!0}catch(e){return{type:"error",message:e.message}}}});class CK extends CM{constructor(...e){super(...e),this.name="json",this.type="object",this.group="advanced",this.order=4,this.title='{{t("JSON")}}',this.sortable=!1,this.default={type:"json",uiSchema:{type:"object","x-component":"Input.JSON","x-component-props":{autoSize:{minRows:5}},default:null}},this.availableTypes=["json","array","set","jsonb","text","circle","lineString","point","polygon"],this.hasDefaultValue=!0,this.properties={...CP,jsonb:{title:"JSONB","x-component":"Checkbox"}},this.configure={items:[{name:"jsonb",title:"JSONB",component:"Checkbox",schema:{"x-content":" "},hidden:e=>{let{context:t}=e,l=t.isDialect;return"function"!=typeof l||!l("postgres")},disabled:e=>{let{context:t}=e;return!!t.disabledJSONB}}]}}}class CU extends CM{initialize(e){"belongsToMany"===e.type&&(e.through||(e.through=`t_${(0,rj.uid)()}`),e.foreignKey||(e.foreignKey=`f_${(0,rj.uid)()}`),e.otherKey||(e.otherKey=`f_${(0,rj.uid)()}`),e.sourceKey||(e.sourceKey="id"),e.targetKey||(e.targetKey="id"))}constructor(...e){super(...e),this.name="m2m",this.type="object",this.group="relation",this.order=6,this.title='{{t("Many to many")}}',this.description='{{t("Many to many description")}}',this.isAssociation=!0,this.default={type:"belongsToMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}},reverseField:{interface:"m2m",type:"belongsToMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}}}},this.availableTypes=["belongsToMany"],this.validationType="object",this.properties={...CP,type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"string",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{through:{type:"string",title:'{{t("Through collection")}}',description:'{{ t("Generated automatically if left blank") }}',"x-decorator":"FormItem","x-disabled":"{{ !createOnly }}","x-component":"ThroughCollection","x-component-props":{allowClear:!0}}}},col13:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key 1")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly||override }}"}}},col23:{type:"void","x-component":"Grid.Col",properties:{}}}},row3:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{}},col22:{type:"void","x-component":"Grid.Col",properties:{otherKey:{type:"string",title:'{{t("Foreign key 2")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly||override }}"}}},col23:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',"x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}",description:"{{t('Field values must be unique.')}}"}}}}}}},...CC},this.filterable={nested:!0,children:[]}}}class CW extends CM{constructor(...e){super(...e),this.name="m2o",this.type="object",this.group="relation",this.order=5,this.title='{{t("Many to one")}}',this.description='{{t("Many to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"o2m",type:"hasMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}}}},this.availableTypes=["belongsTo"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}"}}}}}}},...CS,...CC},this.filterable={nested:!0,children:[]}}}class CH extends CM{constructor(...e){super(...e),this.name="markdown",this.type="object",this.title='{{t("Markdown")}}',this.group="media",this.default={type:"text",uiSchema:{type:"string","x-component":"Markdown"}},this.availableTypes=["text","json","string"],this.hasDefaultValue=!0,this.properties={...CP},this.filterable={operators:"bigField"}}}class CG extends CM{constructor(...e){super(...e),this.name="multipleSelect",this.type="object",this.group="choices",this.order=3,this.title='{{t("Multiple select")}}',this.default={type:"array",defaultValue:[],uiSchema:{type:"array","x-component":"Select","x-component-props":{mode:"multiple"},enum:[]}},this.availableTypes=["array","json"],this.hasDefaultValue=!0,this.properties={...CP,"uiSchema.enum":CA},this.filterable={operators:"array"}}}class CY extends CM{constructor(...e){super(...e),this.name="number",this.type="object",this.group="basic",this.order=7,this.title='{{t("Number")}}',this.sortable=!0,this.default={type:"double",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"}}},this.availableTypes=["double","float","decimal"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["integer"],this.properties={type:{type:"string",title:'{{t("Data type")}}',"x-component":"Select","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:"double",enum:[{label:'{{t("Double")}}',value:"double"},{label:'{{t("Float")}}',value:"float"},{label:'{{t("Decimal")}}',value:"decimal"}]},...CP,unique:Cv,"uiSchema.x-component-props.step":{type:"string",title:'{{t("Precision(UI)")}}',"x-component":"Select","x-decorator":"FormItem",default:"1",enum:[{value:"1",label:"1"},{value:"0.1",label:"1.0"},{value:"0.01",label:"1.00"},{value:"0.001",label:"1.000"},{value:"0.0001",label:"1.0000"},{value:"0.00001",label:"1.00000"},{value:"0.000001",label:"1.000000"},{value:"0.0000001",label:"1.0000000"},{value:"0.00000001",label:"1.00000000"}]},precision:{type:"string",title:'{{t("Precision")}}',"x-component":"InputNumber","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:10},scale:{type:"string",title:'{{t("Scale")}}',"x-component":"InputNumber","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:2}},this.filterable={operators:"number"},this.titleUsable=!0}}class CJ extends CM{constructor(...e){super(...e),this.name="obo",this.type="object",this.group="relation",this.order=3.1,this.title='{{t("One to one (belongs to)")}}',this.description='{{t("One to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"oho",type:"hasOne",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["belongsTo"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}"}}}}}}},...CS,...CC},this.filterable={nested:!0,children:[]}}}class CX extends CM{constructor(...e){super(...e),this.name="o2m",this.type="object",this.group="relation",this.order=4,this.title='{{t("One to many")}}',this.description='{{t("One to many description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"hasMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}},reverseField:{interface:"m2o",type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["hasMany"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection"}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}}}},row3:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',"x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}",description:"{{t('Field values must be unique.')}}"}}}}}}},...CS,...CC},this.filterable={nested:!0,children:[]}}}class CQ extends CM{constructor(...e){super(...e),this.name="oho",this.type="object",this.group="relation",this.order=3,this.title='{{t("One to one (has one)")}}',this.description='{{t("One to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"hasOne",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"obo",type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["hasOne"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},type:Cw,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}}}}}},...CS,...CC},this.filterable={nested:!0,children:[]}}}class CZ extends CM{constructor(...e){super(...e),this.name="password",this.type="object",this.group="basic",this.order=9,this.title='{{t("Password")}}',this.default={type:"password",hidden:!0,uiSchema:{type:"string","x-component":"Password"}},this.availableTypes=["password","string"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.properties={...CP,unique:Cv},this.filterable={operators:"string"}}}(0,rP.registerValidateRules)({percentMode(e,t){let{maxValue:l,minValue:n}=t;return l&&e>l?{type:"error",message:`${C_("The field value cannot be greater than ")}${100*l}%`}:!n||!(e<n)||{type:"error",message:`${C_("The field value cannot be less than ")}${100*n}%`}},percentFormats(e,t){let{percentFormat:l}=t;return!e||"Integer"!==l||!1!==/^-?[1-9]\d*$/.test((100*e).toString())||{type:"error",message:`${C_("The field value is not an integer number")}`}}});class C0 extends CM{constructor(...e){super(...e),this.name="percent",this.type="object",this.group="basic",this.order=8,this.title='{{t("Percent")}}',this.sortable=!0,this.default={type:"float",uiSchema:{type:"string","x-component":"Percent","x-component-props":{stringMode:!0,step:"1",addonAfter:"%"}}},this.availableTypes=["float","double","decimal"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["integer"],this.properties={...CP,unique:Cv,"uiSchema.x-component-props.step":{type:"string",title:'{{t("Precision")}}',"x-component":"Select","x-decorator":"FormItem",default:"1",enum:[{value:"1",label:"1%"},{value:"0.1",label:"1.0%"},{value:"0.01",label:"1.00%"},{value:"0.001",label:"1.000%"},{value:"0.0001",label:"1.0000%"},{value:"0.00001",label:"1.00000%"}]}},this.filterable={operators:"number"},this.titleUsable=!0}}class C1 extends CM{constructor(...e){super(...e),this.name="phone",this.type="object",this.group="basic",this.order=3,this.title='{{t("Phone")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Input","x-component-props":{type:"tel"}}},this.availableTypes=["string"],this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.hasDefaultValue=!0,this.properties={...CP,unique:Cv},this.filterable={operators:"string"},this.titleUsable=!0}}class C2 extends CM{constructor(...e){super(...e),this.name="radioGroup",this.type="object",this.group="choices",this.order=4,this.title='{{t("Radio group")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Radio.Group"}},this.availableTypes=["string","integer","boolean","integer"],this.hasDefaultValue=!0,this.properties={...CP,"uiSchema.enum":CA},this.filterable={operators:"enumType"},this.titleUsable=!0}}class C8 extends CM{constructor(...e){super(...e),this.name="richText",this.type="object",this.group="media",this.order=2,this.title='{{t("Rich Text")}}',this.default={interface:"richText",type:"text",uiSchema:{type:"string","x-component":"RichText"}},this.availableTypes=["text","json","string"],this.hasDefaultValue=!0,this.properties={...CP},this.filterable={operators:"bigField"}}}class C5 extends CM{constructor(...e){super(...e),this.name="select",this.type="object",this.group="choices",this.order=2,this.title='{{t("Single select")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Select",enum:[]}},this.availableTypes=["string","bigInt","boolean"],this.hasDefaultValue=!0,this.properties={...CP,"uiSchema.enum":CA},this.filterable={operators:"enumType"},this.titleUsable=!0}}class C4 extends CM{constructor(...e){super(...e),this.name="snowflakeId",this.type="object",this.group="advanced",this.order=0,this.title='{{t("Snowflake ID (53-bit)")}}',this.primaryKeyDescription='{{t("Primary key, distributed uniqueness, time-ordering")}}',this.hidden=!1,this.sortable=!0,this.default={type:"snowflakeId",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,separator:"0.00",step:"1"},"x-validator":"integer"}},this.availableTypes=["snowflakeId"],this.properties={...CP,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}}},this.filterable={operators:"number"},this.description='{{t("A 53-bit Snowflake ID designed to be compatible with JavaScript’s safe integer range, providing both time-ordering and uniqueness.") }}',this.titleUsable=!0}}class C3 extends CM{constructor(...e){super(...e),this.name="tableoid",this.type="object",this.group="systemInfo",this.order=0,this.title='{{t("Table OID")}}',this.sortable=!0,this.default={name:"__collection",type:"virtual",uiSchema:{type:"string",title:'{{t("Table OID")}}',"x-component":"CollectionSelect","x-component-props":{isTableOid:!0},"x-read-pretty":!0}},this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Input"}},this.filterable={operators:"tableoid"}}}class C6 extends CM{constructor(...e){super(...e),this.name="textarea",this.type="object",this.group="basic",this.order=2,this.title='{{t("Long text")}}',this.default={interface:"textarea",type:"text",uiSchema:{type:"string","x-component":"Input.TextArea"}},this.availableTypes=["text","json","string"],this.validationType="string",this.availableValidationOptions=["min","max","length","case","pattern"],this.hasDefaultValue=!0,this.titleUsable=!0,this.properties={...CP,trim:{type:"boolean","x-content":'{{t("Automatically remove heading and tailing spaces")}}',"x-decorator":"FormItem","x-component":"Checkbox"}},this.filterable={operators:"string"}}}class C9 extends CM{constructor(...e){super(...e),this.name="time",this.type="object",this.group="datetime",this.order=4,this.title='{{t("Time")}}',this.sortable=!0,this.default={type:"time",uiSchema:{type:"string","x-component":"TimePicker"}},this.availableTypes=["time"],this.hasDefaultValue=!0,this.properties={...CP,...Ck},this.filterable={operators:"time"},this.titleUsable=!0}}class C7 extends CM{constructor(...e){super(...e),this.name="updatedAt",this.type="object",this.group="systemInfo",this.order=2,this.title='{{t("Last updated at")}}',this.sortable=!0,this.default={type:"date",field:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},this.description='{{t("Store the last update time of each record")}}',this.availableTypes=[],this.properties={...CP,...CF},this.filterable={operators:"datetime"},this.titleUsable=!0}}class Fe extends CM{constructor(...e){super(...e),this.name="updatedBy",this.type="object",this.group="systemInfo",this.order=4,this.title='{{t("Last updated by")}}',this.isAssociation=!0,this.default={type:"belongsTo",target:"users",foreignKey:"updatedById",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},this.availableTypes=["belongsTo"],this.properties={...CP},this.filterable={nested:!0,children:[]},this.description='{{t("Store the last update user of each record")}}'}}class Ft extends CM{constructor(...e){super(...e),this.name="url",this.type="string",this.group="basic",this.order=5,this.title='{{t("URL")}}',this.default={type:"text",uiSchema:{type:"string","x-component":"Input.URL"}},this.componentOptions=[{label:"URL",value:"Input.URL"},{label:"Preview",value:"Input.Preview"}],this.availableTypes=["string","text"],this.validationType="string",this.availableValidationOptions=["uri","pattern"],this.properties={...CP},this.titleUsable=!0,this.filterable={operators:"string"}}}class Fl extends CM{constructor(...e){super(...e),this.name="uuid",this.type="object",this.group="advanced",this.order=0,this.title='{{t("UUID")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.hidden=!1,this.sortable=!0,this.default={type:"uuid",uiSchema:{type:"string","x-component":"Input","x-validator":"uuid"}},this.availableTypes=["uid","uuid"],this.validationType="string",this.availableValidationOptions=["uuid","pattern"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},autoFill:Cb,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}}},this.filterable={operators:"string"},this.titleUsable=!0}}class Fn extends CM{constructor(...e){super(...e),this.name="nanoid",this.type="object",this.group="advanced",this.order=0,this.title='{{t("Nano ID")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.hidden=!1,this.sortable=!0,this.default={type:"nanoid",uiSchema:{type:"string","x-component":"NanoIDInput"}},this.availableTypes=["nanoid"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with a letter.')}}"},customAlphabet:{type:"string",title:'{{t("Alphabet")}}',default:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz","x-decorator":"FormItem","x-component":"Input"},size:{type:"number",title:'{{t("Length")}}',default:21,"x-decorator":"FormItem","x-component":"InputNumber"},autoFill:Cb,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Cy,unique:Cv}}},this.filterable={operators:"string"},this.titleUsable=!0}}class Fo extends CM{constructor(...e){super(...e),this.name="unixTimestamp",this.type="object",this.group="datetime",this.order=4,this.title='{{t("Unix Timestamp")}}',this.sortable=!0,this.default={type:"unixTimestamp",accuracy:"second",timezone:!0,defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,uiSchema:{type:"number","x-component":"UnixTimestamp","x-component-props":{showTime:!0}}},this.availableTypes=["unixTimestamp"],this.hasDefaultValue=!1,this.validationType="date",this.availableValidationOptions=["timestamp"],this.properties={...CP,...CF,accuracy:{type:"string",title:'{{t("Accuracy")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"second",enum:[{value:"millisecond",label:'{{t("Millisecond")}}'},{value:"second",label:'{{t("Second")}}'}]},defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp on update")}}'}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class Fr extends CM{constructor(...e){super(...e),this.name="date",this.type="object",this.group="datetime",this.order=3,this.title='{{t("DateOnly")}}',this.sortable=!0,this.default={type:"dateOnly",uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{dateOnly:!0,showTime:!1}}},this.availableTypes=["dateOnly"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...CP,...CF,"uiSchema.x-component-props.showTime":{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-visible":!1},"uiSchema.x-component-props.timeFormat":{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-visible":!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class Fi extends CM{constructor(...e){super(...e),this.name="datetimeNoTz",this.type="object",this.group="datetime",this.order=2,this.title='{{t("Datetime (without time zone)")}}',this.sortable=!0,this.default={type:"datetimeNoTz",defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,timezone:!1,uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{showTime:!1,utc:!1}}},this.availableTypes=["string","datetimeNoTz"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...CP,...CF,defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current server time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp to the current server time on update")}}'},"uiSchema.x-component-props.gmt":{type:"boolean",title:'{{t("GMT")}}',"x-hidden":!0,"x-component":"Checkbox","x-content":'{{t("Use the same time zone (GMT) for all users")}}',"x-decorator":"FormItem",default:!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}function Fa(e){if(null==e?void 0:e.filterTargetKey){if(Array.isArray(e.filterTargetKey)){var t;return null==e||null==(t=e.filterTargetKey)?void 0:t[0]}return null==e?void 0:e.filterTargetKey}return(null==e?void 0:e.getPrimaryKey())||"id"}function Fs(e,t){var l,n,o,r,i;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=e.interface,d=s?(null==t||null==(n=t.getFieldInterfaceConfigure)||null==(l=n.call(t,s,a.collectionInfo))?void 0:l.default)||(null==t||null==(r=t.getFieldInterface)||null==(o=r.call(t,s))?void 0:o.default):void 0,u=(0,G.merge)({},(0,G.cloneDeep)(d||{}),(0,G.cloneDeep)(e)),c=(0,G.merge)({},(0,G.cloneDeep)((null==d?void 0:d.uiSchema)||{}),(0,G.cloneDeep)(e.uiSchema||{}));return void 0!==e.title&&(c.title=e.title),void 0!==e.options&&(c.enum=(0,G.cloneDeep)(e.options)),void 0!==e.component&&(c["x-component"]=e.component),void 0!==e.componentProps&&(c["x-component-props"]=(0,G.merge)({},(0,G.cloneDeep)((null==d||null==(i=d.uiSchema)?void 0:i["x-component-props"])||{}),(0,G.cloneDeep)(e.componentProps))),delete u.title,delete u.options,delete u.component,delete u.componentProps,Object.keys(c).length&&(u.uiSchema=c),u}function Fd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,l=arguments.length>2?arguments[2]:void 0;return e.map(e=>Fs(e,t,l))}let Fu=e=>{var t,l,n,o,r,i,a,s,d;let{dataSource:u="main",collections:c,syncOnChange:p=!1,children:m}=e,h=(0,en.n)(),f=(0,J.useRef)(null),g=(0,J.useRef)(null);if(null===f.current){let e=null==(l=h.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,u),r=[];if(e)for(let t of c)null!=(n=e.getCollection)&&n.call(e,t.name)||(null==(o=e.addCollection)||o.call(e,t),r.push(t));f.current=r,g.current=c}else if(p&&g.current!==c){let e=null==(i=h.dataSourceManager)||null==(r=i.getDataSource)?void 0:r.call(i,u);if(e){let t=new Set(c.map(e=>e.name)),l=new Map(f.current.map(e=>[e.name,e]));for(let n of l.keys())t.has(n)||null==(a=e.removeCollection)||a.call(e,n);let n=[];for(let t of c){let o=l.get(t.name);if(o){n.push(o);continue}null!=(s=e.getCollection)&&s.call(e,t.name)||(null==(d=e.addCollection)||d.call(e,t),n.push(t))}f.current=n}g.current=c}return(0,J.useEffect)(()=>{var e;let t=e=>{var t,l,n,o,r;let i=null==(t=e.detail)?void 0:t.dataSourceKey;if(i!==u&&"*"!==i)return;let a=null==(n=h.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);if(a&&f.current)for(let e of f.current)null!=(o=a.getCollection)&&o.call(a,e.name)||null==(r=a.addCollection)||r.call(a,e)};return null==(e=h.eventBus)||e.addEventListener("dataSource:loaded",t),()=>{var e,l,n,o;null==(e=h.eventBus)||e.removeEventListener("dataSource:loaded",t);let r=null==(n=h.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u),i=f.current??[];if(f.current=null,g.current=null,r)for(let e of i)null==(o=r.removeCollection)||o.call(r,e.name)}},[h,u]),(0,U.jsx)(U.Fragment,{children:m})};var Fc=l(30872),Fp=l.n(Fc),Fm=l(88055),Fh=l.n(Fm),Ff=l(90179),Fg=l.n(Ff);let Fv=(0,J.createContext)(null);Fv.displayName="APIClientContext";let Fy=(0,J.createContext)(null);Fy.displayName="ApplicationContext";let Fx=()=>{var e;let t=(0,J.useContext)(Fy),l=(0,H.useFlowEngine)({throwError:!1});return(null==l||null==(e=l.context)?void 0:e.app)||t||{}};function Fb(){let e=Fx();return(0,J.useContext)(Fv)||e.apiClient}var Fw=l(89412),FS=l(14744),FC=l.n(FS),FF=l(63375),Fk=l.n(FF);function FA(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(t=>e.propertyIsEnumerable(t)):[]}function FP(e){return Object.keys(e).concat(FA(e))}let Fj=new Map;function FM(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return FP(t).forEach(n=>{let o=l[n],r=Fj.get("deepMerge");"function"==typeof o?r=o:"string"==typeof o&&Fj.has(o)&&(r=Fj.get(o)),e[n]=r(e[n],t[n])}),e}function FI(e){let t,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[n,o]=(0,Fw.A)({}),r=Fb();t="function"==typeof e?e:e?async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{resource:l,url:n}=e,o=Fh()(e);l||n?(o.params=o.params||{},FM(o.params,t)):o=(0,rj.merge)(o,t);let i=await r.request(o);return null==i?void 0:i.data}:async()=>{};let i={...l,onSuccess(){for(var e,t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];null==(e=l.onSuccess)||e.call(l,...n),l.uid&&(r.services[l.uid]=a)}},a=(0,o3.A)(t,i);return(0,J.useMemo)(()=>({...a,state:n,setState:o}),[a,o,n])}function FT(e,t){return Fb().resource(e,t)}Fj.set("overwrite",(e,t)=>t),Fj.set("andMerge",(e,t)=>{if(e||t)return e?t?{$and:[e,t]}:e:t}),Fj.set("orMerge",(e,t)=>{if(e||t)return e?t?{$or:[e,t]}:e:t}),Fj.set("deepMerge",(e,t)=>(0,ev.isPlainObject)(e)&&(0,ev.isPlainObject)(t)?FC()(e,t,{arrayMerge:(e,t)=>t}):t),Fj.set("merge",(e,t)=>(0,ev.isPlainObject)(e)&&(0,ev.isPlainObject)(t)?Object.assign(e,t):t),Fj.set("union",(e,t)=>("string"==typeof e&&(e=e.split(",")),"string"==typeof t&&(t=t.split(",")),Fk()((e||[]).concat(t||[])))),Fj.set("intersect",(e,t)=>("string"==typeof e&&(e=e.split(",")),"string"==typeof t&&(t=t.split(",")),Array.isArray(e)&&0!==e.length)?Array.isArray(t)&&0!==t.length?e.filter(e=>t.includes(e)):e||[]:t||[]);var FR=l(98892);function FE(e,t,l){var n;(null==t?void 0:t.length)&&l[e]({message:null==(n=t.map)?void 0:n.call(t,(e,t)=>J.createElement("div",{key:`${t}_${e.message}`},"string"==typeof e?e:e.message))})}let FN=(e,t)=>{var l;let n=new FileReader;n.readAsText(null==e||null==(l=e.response)?void 0:l.data,"utf-8"),n.onload=function(){FE("error",JSON.parse(n.result).errors,t)}};function FD(e){let t=Math.floor(Math.abs(e)),l=Math.abs(e%1*60);return(e>=0?"+":"-")+(t<10?"0":"")+t+":"+(l<10?"0":"")+l}let FB=()=>FD(-(new Date().getTimezoneOffset()/60)),F$=new Map;class FO extends ${get notification(){var e,t;return(null==(t=this.app)||null==(e=t.context)?void 0:e.notification)||FR.Ay}cloneInstance(){let e=new FO(this.options);e.options=this.options,e.services=this.services,e.storage=this.storage,e.app=this.app,e.auth=this.auth,e.storagePrefix=this.storagePrefix;let t=[];for(let n of this.axios.interceptors.response.handlers){var l;(null==n||null==(l=n.rejected)?void 0:l._name)==="handleNotificationError"?t.push({...n,rejected:e.handleNotificationError.bind(e)}):t.push(n)}return e.axios.interceptors.response.handlers=t,e}getHostname(){var e,t;try{return new URL("/api/").hostname}catch(e){}return null==(t=window)||null==(e=t.location)?void 0:e.hostname}getHeaders(){var e;let t=super.getHeaders(),l=null==(e=this.app)?void 0:e.getName();return l&&(t["X-App"]=l),t["X-Timezone"]=FB(),t["X-Hostname"]=this.getHostname(),t}service(e){return this.services[e]}interceptors(){this.axios.interceptors.request.use(e=>{e.headers["X-With-ACL-Meta"]=!0;let t=this.getHeaders();return Object.keys(t).forEach(l=>{T(e.headers,l)||(e.headers[l]=t[l])}),e}),super.interceptors(),this.useNotificationMiddleware(),this.axios.interceptors.response.use(e=>e,e=>{let t=this.toErrMessages(e);throw t.find(e=>"ROLE_NOT_FOUND_ERR"===e.code)&&(this.auth.setRole(null),window.location.reload()),t.find(e=>"TOKEN_INVALID"===e.code||"USER_LOCKED"===e.code)&&this.auth.setToken(null),t.find(e=>"ROLE_NOT_FOUND_FOR_USER"===e.code)&&(this.auth.setRole(null),window.location.reload()),e})}toErrMessages(e){var t,l,n,o,r,i,a,s,d,u,c;if("string"==typeof(null==e||null==(t=e.response)?void 0:t.data)){let t=document.createElement("div");t.innerHTML=null==e||null==(d=e.response)?void 0:d.data;let l=t.textContent||t.innerText;return l.includes("Error occurred while trying")||l.includes("502 Bad Gateway")?[{code:"APP_WARNING",message:l="The application may be starting up. Please try again later."}]:[{message:l}]}return(null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.error)?[null==e||null==(c=e.response)||null==(u=c.data)?void 0:u.error]:(null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.errors)||(null==e||null==(a=e.response)||null==(i=a.data)?void 0:i.messages)||(null==e||null==(s=e.response)?void 0:s.error)||[{message:e.message||"Server error"}]}async handleNotificationError(e){var t,l,n,o,r,i,a,s,d,u;if(this.silence)throw e;let c=null==(t=e.config)?void 0:t.skipNotify;if(c&&("function"==typeof c&&c(e)||!0===c))throw e;let p=null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.redirectTo;if(p)return window.location.href=p;if((null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.type)==="application/json")FN(e,this.notification);else{F$.size>10&&F$.clear();let t=!!(null==e||null==(s=e.response)||null==(a=s.data)||null==(i=a.error)?void 0:i.maintaining);if(this.app.maintaining!==t&&(this.app.maintaining=t),this.app.maintaining)throw this.app.error=null==e||null==(u=e.response)||null==(d=u.data)?void 0:d.error,e;this.app.error&&(this.app.error=null);let l=this.toErrMessages(e);if(0===(l=l.filter(e=>{let t=F$.get(e.message);return!(t&&new Date().getTime()-t<500)&&(F$.set(e.message,new Date().getTime()),!0)})).length)throw e;FE("error",l,this.notification)}throw e}useNotificationMiddleware(){let e=this.handleNotificationError.bind(this);e._name="handleNotificationError",this.axios.interceptors.response.use(e=>{var t,l;return(null==(l=e.data)||null==(t=l.messages)?void 0:t.length)&&FE("success",e.data.messages.filter(e=>{let t=F$.get("string"==typeof e?e:e.message);return!(t&&new Date().getTime()-t<500)&&(F$.set(e.message,new Date().getTime()),!0)}),this.notification),e},e)}silent(){let e=this.cloneInstance();return e.silence=!0,e}constructor(...e){super(...e),this.services={},this.silence=!1}}let Fq=e=>{let{apiClient:t,children:l}=e;return(0,U.jsx)(Fv.Provider,{value:t,children:l})};class F_{get fields(){return this.options.fields||[]}get app(){return this.collectionManager.app}get dataSource(){return this.options.dataSource}get sourceKey(){return this.options.sourceKey}get name(){return this.options.name}get key(){return this.options.key}get title(){return this.options.title}get inherit(){return this.options.inherit}get hidden(){return this.options.hidden}get description(){return this.options.description}get duplicator(){return this.options.duplicator}get category(){return this.options.category}get targetKey(){return this.options.targetKey}get model(){return this.options.model}get createdBy(){return this.options.createdBy}get updatedBy(){return this.options.updatedBy}get logging(){return this.options.logging}get from(){return this.options.from}get rawTitle(){return this.options.rawTitle}getPrimaryKey(){if(this.primaryKey)return this.primaryKey;if(this.options.targetKey)return this.options.targetKey;let e=this.getFields({primaryKey:!0})[0];return this.primaryKey=null==e?void 0:e.name,this.primaryKey}getFilterTargetKey(){return this.filterTargetKey||this.getPrimaryKey()||"id"}get inherits(){return this.options.inherits||[]}get titleField(){return this.hasField(this.options.titleField)?this.options.titleField:this.getPrimaryKey()}get sources(){return this.options.sources||[]}get template(){return this.options.template}get tableName(){return this.options.tableName}get viewName(){return this.options.viewName}get writableView(){return this.options.writableView}get filterTargetKey(){return this.options.filterTargetKey}get sortable(){return this.options.sortable}get autoGenId(){return this.options.autoGenId}get magicAttribute(){return this.options.magicAttribute}get tree(){return this.options.tree}get isThrough(){return this.options.isThrough}get autoCreate(){return this.options.autoCreate}get resource(){return this.options.resource}setOption(e,t){return this.options[e]=t,this}getOptions(){return this.options}getOption(e){return this.options[e]}getFields(e){return e?(0,rT.filter)(this.fields,e):this.fields}getAllFields(e){return this.getFields(e)}getFieldsMap(){return this.fieldsMap||(this.fieldsMap=this.getFields().reduce((e,t)=>(e[t.name]=t,e),{})),this.fieldsMap}getFieldByAssociationName(e){let t=this.getFieldsMap(),[l,...n]=String(e).split("."),o=t[l];if(!o)return;let r=null==o?void 0:o.target;if(!r)return;let i=this.collectionManager.getCollection(r);if(i)return i.getField(n.join("."))}getField(e){if(!e)return;let t=this.getFieldsMap();if(String(e).split(".").length>1){let t=this.getFieldByAssociationName(e);return t||("string"==typeof e&&e.startsWith(`${this.name}.`)?(e=e.replace(`${this.name}.`,""),this.getField(e)):void 0)}return t[e]}hasField(e){return!!this.getField(e)}isTitleField(e){var t;return null==(t=this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterface(e.interface))?void 0:t.titleUsable}isInherited(){return this.inherits.length>0}constructor(e,t){this.options=e,this.collectionManager=t}}let{ConfigContext:FL}=ed.Ay,FV=()=>(0,J.useContext)(FL),Fz=(e,t)=>{let{getPrefixCls:l}=(0,J.useContext)(ed.Ay.ConfigContext)||{};if("ConfigContext"in ed.Ay)return(null==l?void 0:l(e,null==t?void 0:t.prefixCls))||"";{let l=(null==t?void 0:t.prefixCls)??"ant-";return`${l}${e??""}`}},FK=()=>es.A.useToken(),FU=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Loading...",t=arguments.length>1?arguments[1]:void 0,l=null,n=setTimeout(()=>{l=bz.Ay.loading(e)},100);try{return await t()}finally{null==l||l(),clearTimeout(n)}},FW={...lR},{version:FH,render:FG,unmountComponentAtNode:FY}=FW;try{Number((FH||"").split(".")[0])>=18&&FW.createRoot&&(n=FW.createRoot)}catch(e){}function FJ(e){let{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:t}=FW;t&&"object"==typeof t&&(t.usingClientEntryPoint=e)}let FX="__antd_mobile_root__";function FQ(e,t){FG(e,t)}function FZ(e,t){FJ(!0);let l=t[FX]||n(t);FJ(!1),l.render(e),t[FX]=l}function F0(e,t){n?FZ(e,t):FQ(e,t)}function F1(e){return FY(e)}async function F2(e){return Promise.resolve().then(()=>{var t;null==(t=e[FX])||t.unmount(),delete e[FX]})}function F8(e){return n?F2(e):F1(e)}let F5=(0,W.observable)(new Map),F4=e=>{let t=e=>(e.id&&!F5.has(e.id)&&F5.set(e.id,null),(0,U.jsxs)(J.Fragment,{children:[e.children,(0,U.jsx)(ni.Observer,{children:()=>{if(!e.id)return(0,U.jsx)(U.Fragment,{});let t=F5.get(e.id);return t?(0,lT.createPortal)(t,document.body):(0,U.jsx)(U.Fragment,{})}})]}));return t.defaultProps={id:e},t};function F3(e,t){return{render:function(l){F5.has(t)?F5.set(t,null==l?void 0:l()):e&&F0((0,U.jsx)(J.Fragment,{children:null==l?void 0:l()}),e)},unmount:function(){if(F5.has(t)&&F5.set(t,null),e&&F8(e)&&e.parentNode){var l;null==(l=e.parentNode)||l.removeChild(e)}}}}let F6=(e,t)=>{let{fontFamily:l,fontSize:n}=e,o=`[class^="${t}"], [class*=" ${t}"]`;return{[o]:{fontFamily:l,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},F9=(e,t)=>l=>{let{theme:n,token:o,hashId:r}=FK(),{getPrefixCls:i,iconPrefixCls:a}=FV(),s=Fz(e),d=i(),u=(0,rS.useStyleRegister)({theme:n,token:o,hashId:r,path:["formily-antd",e,s,a]},()=>{let e=`.${s}`,n=t((0,rj.merge)(o,{componentCls:e,prefixCls:s,iconCls:`.${a}`,antCls:`.${d}`}),l,{hashId:r,prefixCls:s,rootPrefixCls:d,iconPrefixCls:a});return[F6(o,s),n]});return{wrapSSR:(0,J.useMemo)(()=>u,[n,o,r,s,a,d,l]),hashId:r,componentCls:s,rootPrefixCls:d}};var F7=l(38221),ke=l.n(F7);let kt=(0,J.createContext)(null);kt.displayName="DataSourceManagerContext";let kl=e=>{let{children:t,dataSourceManager:l}=e;return(0,U.jsx)(kt.Provider,{value:l,children:t})};function kn(){return(0,J.useContext)(kt)}function ko(){let e=kn();return{getAllCollectionsInheritChain:(0,J.useCallback)((t,l)=>{var n,o,r;return null==e||null==(r=e.getDataSource(l))||null==(o=r.collectionManager)||null==(n=o.getCollection(t))?void 0:n.getInheritChain()},[e])}}var kr=l(68870);let ki=(0,J.createContext)(null);ki.displayName="DataSourceContext";let ka=e=>{let{children:t,dataSource:l}=e,n=kn(),{t:o}=(0,lE.B)(),{refresh:r}=IO(),[i,a]=J.useState(0),s=null==n?void 0:n.getDataSource(l);return s?"loading-failed"===s.status?(0,U.jsx)(erk,{type:"Data Source",name:s.displayName||l,message:s.errorMessage||"loading failed"}):"loading"===s.status||"reloading"===s.status?(0,U.jsx)(et3,{children:(0,U.jsx)(lZ.Ay,{icon:(0,U.jsx)(kr.A,{}),title:`${s.displayName||l} ${o("data source")} ${o("loading")}...`,extra:(0,U.jsx)(nT.Ay,{type:"primary",onClick:()=>s.reload().then(()=>{r(),a(Math.random())}),children:o("Refresh")})})}):(0,U.jsx)(ki.Provider,{value:s,children:t}):(0,U.jsx)(erk,{type:"Data Source",name:l})};function ks(){return(0,J.useContext)(ki)}function kd(){let e=(0,J.useContext)(ki);return null==e?void 0:e.key}let ku=(0,J.createContext)(null);ku.displayName="ExtendCollectionsContext";let kc=e=>{let{children:t,collections:l}=e,n=kp(),o=(0,J.useMemo)(()=>n?[...n,...l]:l,[n,l]),r=kd();return(0,U.jsx)(ku.Provider,{value:o,children:(0,U.jsx)(kf,{dataSource:r,children:t})})};function kp(){return(0,J.useContext)(ku)}let km=(0,J.createContext)(null);km.displayName="CollectionManagerContext";let kh=e=>{let{instance:t,children:l}=e,n=ks(),o=kp(),r=(0,J.useMemo)(()=>t||(null==n?void 0:n.collectionManager),[t,n]),[i,a]=J.useState(Math.random());(0,J.useEffect)(()=>{r.dataSource.addReloadCallback(()=>{a(Math.random())})},[r]);let s=(0,J.useMemo)(()=>{let e=r;return(null==o?void 0:o.length)?e.clone(o):e},[r,o,i]);return(0,U.jsx)(km.Provider,{value:s,children:l})},kf=e=>{let{instance:t,dataSource:l,children:n}=e;return(0,U.jsx)(ka,{dataSource:l,children:(0,U.jsx)(kh,{instance:t,children:n})})};function kg(){return(0,J.useContext)(km)}let kv=e=>{let t=kg();return(0,J.useMemo)(()=>t.getCollections(e),[t,e])},ky=(0,J.createContext)({});ky.displayName="SchemaComponentContext.Provider";let kx=()=>(0,J.useContext)(ni.SchemaOptionsContext)||{},kb=(0,J.memo)(e=>{let{children:t}=e,l=kx(),n=(0,J.useMemo)(()=>({...l.components,...e.components}),[l.components,e.components]),o=(0,J.useMemo)(()=>({...l.scope,...e.scope}),[l.scope,e.scope]),r=(0,J.useMemo)(()=>({scope:o,components:n}),[o,n]);return(0,U.jsx)(ni.SchemaOptionsContext.Provider,{value:r,children:(0,U.jsx)(ni.SchemaComponentsContext.Provider,{value:n,children:(0,U.jsx)(ni.ExpressionScope,{value:o,children:t})})})});function kw(e){return ni.Schema.isSchemaInstance(e)?e:new ni.Schema((null==e?void 0:e.name)?{type:"object",properties:{[e.name]:e},name:`p_${e.name}`}:e)}kb.displayName="SchemaComponentOptions";let kS=e=>(0,J.useMemo)(()=>kw(e),[]),kC=(0,J.createContext)({onChange:rR().noop}),kF=(0,J.memo)(e=>{let{components:t,scope:l,schema:n,distributed:o,onChange:r,parentSchema:i,...a}=e,s=(0,J.useContext)(ky),d=(0,J.useMemo)(()=>kw(n),[n]),u=(0,J.useMemo)(()=>({...s,distributed:!1!=s.distributed&&o,refresh:s.refresh||rR().noop}),[s,o]),{onChange:c}=(0,J.useContext)(kC),p=(0,J.useMemo)(()=>({onChange:()=>{null==r||r(d),null==c||c()}}),[r,c,d]);return(0,U.jsx)(kC.Provider,{value:p,children:(0,U.jsx)(ky.Provider,{value:u,children:(0,U.jsx)(kb,{inherit:!0,components:t,scope:l,children:(0,U.jsx)(k1,{...a,schema:d,isUseFormilyField:!0,parentSchema:i})})})})});kF.displayName="RecursionSchemaComponent";let kk=(0,J.memo)(e=>{let{schema:t,parentSchema:l,...n}=e,o=kS(t);return(0,U.jsx)(kF,{...n,schema:o,parentSchema:l})});kk.displayName="MemoizedSchemaComponent";let kA=(0,J.memo)(e=>{let{memoized:t,...l}=e;return t?(0,U.jsx)(kk,{...l}):(0,U.jsx)(kF,{...l})});kA.displayName="SchemaComponent";let kP=Object.freeze({}),kj={},kM=e=>/{{.*?}}/g.test(e),kI=function(){let{noCache:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{noCache:!1},t=(0,J.useContext)(ni.SchemaOptionsContext),l=(0,J.useContext)(ni.SchemaExpressionScopeContext);return(n,o)=>{let r,i=!1;if("string"==typeof n&&n.startsWith("{{")&&(i=!0,r=n),n&&"object"==typeof n&&!(0,J.isValidElement)(n)){try{r=JSON.stringify(n)}catch(e){return console.warn("Failed to stringify:",e),n}if(kj[r])return kj[r];i=kM(r)}if(Array.isArray(n)){try{r=JSON.stringify(n)}catch(e){return console.warn("Failed to stringify:",e),n}if(kj[r])return kj[r];i=kM(r)}if(i){let i={...null==t?void 0:t.scope,...l,...o};if(!r)return ni.Schema.compile(n,i);try{if(e)return ni.Schema.compile(n,i);return kj[r]=kj[r]||ni.Schema.compile(n,i),kj[r]}catch(e){return console.log("useCompile error",n,e),ni.Schema.compile(n,i)}}return n}},kT=(e,t)=>{if((e||t)&&!(0,rj.isFn)(e))return(0,U.jsxs)(J.Fragment,{children:[e,t]})},kR=e=>e&&("object"==typeof e||"function"==typeof e),kE=(e,t,l)=>(0,rj.isFn)(e)?e(t,l):e,kN=e=>{let t,l=(0,J.useContext)(ni.SchemaComponentsContext),n=e.field,o=kT(kE(e.children,n,n.form),n.content??n.componentProps.children);if("visible"!==n.display)return null;let r=e=>kR(e)?e:rj.FormPath.getIn(l,e)??e;return t=n.componentType?J.createElement(r(n.componentType),{...n.componentProps,value:n.value},o):o,n.decoratorType?J.createElement(r(n.decoratorType),n.decoratorProps,t):(0,U.jsx)(J.Fragment,{children:t})};kN.displayName="NocoBaseReactiveInternal";let kD=kN;function kB(e){return new k$(e)}kD.displayName="NocoBaseReactiveField";class k${initialize(){var e,t,l,n,o,r,i,a,s,d,u,c,p,m,h,f,g,v,y,x;let b=this.props.compile;this.pattern="readPretty",this.readPretty=!0,this.initialized=!0,this.loading=!1,this.validating=!1,this.submitting=!1,this.selfModified=!1,this.active=!1,this.visited=!0,this.mounted=!0,this.unmounted=!1,this.inputValues=[],this.inputValue=null,this.feedbacks=[],this.title=b(this.props.title||(null==(e=this.props.schema)?void 0:e.title)),this.description=b(this.props.description||(null==(t=this.props.schema)?void 0:t.description)),this.display="visible",this.editable=this.props.editable||(null==(l=this.props.schema)?void 0:l["x-editable"]),this.disabled=this.props.disabled||(null==(n=this.props.schema)?void 0:n["x-disabled"]),this.readOnly=this.props.readOnly||(null==(o=this.props.schema)?void 0:o["x-read-only"]),this.visible=this.props.visible||(null==(r=this.props.schema)?void 0:r["x-visible"]),this.hidden=this.props.hidden||(null==(i=this.props.schema)?void 0:i["x-hidden"]),this.dataSource=b(this.props.dataSource||(null==(a=this.props.schema)?void 0:a.enum)),this.validator=this.props.validator,this.required=this.props.required||!!(null==(s=this.props.schema)?void 0:s.required),this.content=b(this.props.content||(null==(d=this.props.schema)?void 0:d["x-content"])),this.initialValue=b(this.props.initialValue||(null==(u=this.props.schema)?void 0:u.default)),this.value=b(this.props.value),this.data=this.props.data||(null==(c=this.props.schema)?void 0:c["x-data"]),this.decorator=this.props.decorator?(0,rj.toArr)(this.props.decorator):[null==(p=this.props.schema)?void 0:p["x-decorator"],null==(m=this.props.schema)?void 0:m["x-decorator-props"]],this.component=this.props.component?(0,rj.toArr)(this.props.component):[null==(h=this.props.schema)?void 0:h["x-component"],null==(f=this.props.schema)?void 0:f["x-component-props"]],this.decoratorProps=(null==(g=this.props.schema)?void 0:g["x-decorator-props"])||{},this.componentProps=(null==(v=this.props.schema)?void 0:v["x-component-props"])||{},this.decoratorType=null==(y=this.props.schema)?void 0:y["x-decorator"],this.componentType=null==(x=this.props.schema)?void 0:x["x-component"],this.path={},this.form={},this.address={concat:rR().noop}}constructor(e){this.props=e,this.initialize()}}let kO=e=>{let t=kI(),l=(0,ni.useFieldSchema)(),n=(0,J.useMemo)(()=>kB({...e,compile:t}),[]);return Object.assign(n.componentProps,l["x-component-props"]),n.value=e.value,(0,U.jsx)(ni.FieldContext.Provider,{value:n,children:(0,U.jsx)(kD,{field:n,children:e.children})})},kq=J.createContext({}),k_=J.createContext(rR().noop),kL=e=>{let{children:t,refresh:l}=e,n=kU(),o=(0,J.useCallback)(e=>{l(),(null==e?void 0:e.refreshParentSchema)&&(null==n||n())},[n,l]);return(0,U.jsx)(k_.Provider,{value:o,children:t})},kV=J.createContext(rR().noop),kz=e=>{let{children:t,refresh:l}=e;return(0,U.jsx)(kV.Provider,{value:l,children:t})},kK=()=>J.useContext(kV),kU=()=>J.useContext(k_),kW=()=>J.useContext(kq)||{},kH=e=>{let{children:t,fieldSchema:l}=e,n=erD(),o=kg(),r=null==l?void 0:l.name,i=(0,J.useMemo)(()=>{var e;if(!n)return null;let t=null==l||null==(e=l["x-component-props"])?void 0:e.field;return o.getCollectionField(null==l?void 0:l["x-collection-field"])||t||n.getField((null==t?void 0:t.name)||r)},[n,o,l,r]);return(0,U.jsx)(kq.Provider,{value:i,children:t})},kG=rR().memoize((e,t)=>e.toFieldProps({scope:t})),kY=e=>kG(e,(0,ni.useExpressionScope)()),kJ=e=>{let t=(0,ni.useField)();if(e.onlyRenderProperties){var l;return e.basePath||(null==t||null==(l=t.address)?void 0:l.concat(e.name))}return e.basePath||(null==t?void 0:t.address)},kX=(e,t,l)=>{let n=e.toJSON();if(l){if(!n.properties)return e;let l=Object.keys(n.properties)[0],o=Object.values(n.properties)[0];return n.properties[l]=(0,rj.merge)(rR().omit(t,"type","x-read-pretty"),o),new ni.Schema(n)}return new ni.Schema((0,rj.merge)(rR().omit(t,"type","x-read-pretty"),n))},kQ=e=>{let{schema:t,field:l,basePath:n,mapProperties:o,filterProperties:r,propsRecursion:i,values:a,isUseFormilyField:s}=e,d=ni.Schema.getOrderProperties(t);return d.length?(0,U.jsx)(J.Fragment,{children:d.map((e,t)=>{let{schema:d,key:u}=e,c=(null==l?void 0:l.address)||n,p=d;if((0,rj.isFn)(o)){let e=o(d,u);e&&(p=e)}if((0,rj.isFn)(r)&&!1===r(p,u))return null;let m=(0,rj.isBool)(i)&&i?(0,U.jsx)(k1,{propsRecursion:!0,filterProperties:r,mapProperties:o,schema:p,name:u,basePath:c,values:rR().get(a,u),isUseFormilyField:s}):(0,U.jsx)(k1,{schema:p,name:u,basePath:c,values:rR().get(a,u),isUseFormilyField:s});return"CollectionField"===p["x-component"]?(0,U.jsx)(kZ.Provider,{value:!0,children:(0,U.jsx)(kH,{fieldSchema:p,children:m})},`${t}-${u}`):(0,U.jsx)(kZ.Provider,{value:!1,children:(0,U.jsx)(kq.Provider,{value:kP,children:m})},`${t}-${u}`)})}):null},kZ=J.createContext(!1),k0=()=>J.useContext(kZ),k1=J.memo(e=>{let{schema:t,name:l,onlyRenderProperties:n,onlyRenderSelf:o,mapProperties:r,filterProperties:i,propsRecursion:a,values:s,isUseFormilyField:d=!0,uiSchema:u,parentSchema:c}=e,p=kJ(e),m=(0,J.useRef)(null),h=(0,J.useMemo)(()=>(m.current=null,new ni.Schema(t)),[t]),{uiSchema:f,defaultValue:g}=kW(),v=(0,Sc.A)(),{onChange:y}=(0,J.useContext)(kC),x=m.current||h;if(!x.parent&&c){var b,w;x.parent=c,(null==(w=x.parent)||null==(b=w.properties)?void 0:b[x.name])||!x.name||rR().set(x.parent,`properties.${x.name}`,x)}let S=(0,J.useCallback)(()=>{let e=x.parent;m.current=new ni.Schema(x.toJSON(),e),(null==e?void 0:e.properties)&&Object.keys(e.properties).forEach(t=>{t===x.name&&(e.properties[t]=m.current)}),v(),null==y||y()},[x,y,v]),C=(0,J.useMemo)(()=>u?kX(x,u,n):f?(f.default=g,kX(x,f,n)):x,[f,g,x,n,u]),F=kY(C),k=e=>{if(!o)return kQ({schema:x,field:e,basePath:p,mapProperties:r,filterProperties:i,propsRecursion:a,values:s,isUseFormilyField:d})},A=()=>(0,rj.isValid)(l)?"object"===C.type?n?k():(0,U.jsx)(ni.ObjectField,{...F,name:l,basePath:p,children:k}):"array"===C.type?(0,U.jsx)(ni.ArrayField,{...F,name:l,basePath:p}):"void"===C.type?n?k():(0,U.jsx)(ni.VoidField,{...F,name:l,basePath:p,children:k}):d?(0,U.jsx)(ni.Field,{...F,name:l,basePath:p}):(0,U.jsx)(kO,{name:l,value:s,initialValue:s,basePath:p,schema:C}):k();return x?(0,U.jsx)(ni.SchemaContext.Provider,{value:x,children:(0,U.jsx)(kL,{refresh:S,children:A()})}):(0,U.jsx)(J.Fragment,{})});k1.displayName="NocoBaseRecursionField";var k2=l(58156),k8=l.n(k2),k5=l(63560),k4=l.n(k5);let k3=Symbol("LAZY_COMPONENT_KEY"),k6=new Map;function k9(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(0===l.length){let t=(0,J.lazy)(()=>e().then(e=>{let t=e.default;return l[k3]=t,{default:t}})),l=e=>(0,U.jsx)(J.Suspense,{fallback:(0,U.jsx)(nk.A,{}),children:(0,U.jsx)(t,{...e})});return l}return l.reduce((t,l)=>{let n=(0,J.lazy)(()=>e().then(e=>{let n=(0,rT.get)(e,l);return t[l][k3]=n,{default:n}}));return t[l]=e=>(0,U.jsx)(J.Suspense,{fallback:(0,U.jsx)(nk.A,{}),children:(0,U.jsx)(n,{...e})}),t},{})}function k7(e,t){let l="function"==typeof t?t:e=>e[t],n=e.toString(),o=k6.get(n);if(null==o?void 0:o.error)throw o.error;if(null==o?void 0:o.module)return l(o.module);if(!(null==o?void 0:o.promise)){let t=o||{};throw t.promise=e().then(e=>(t.module=e,e)).catch(e=>{throw t.error=e,e}),k6.set(n,t),t.promise}throw o.promise}function Ae(e,t){if(e)return e["x-app-version"]||(e["x-app-version"]=t),Object.keys(e.properties||{}).forEach(l=>{var n;Ae(null==(n=e.properties)?void 0:n[l],t)}),e}var At="2.1.17";function Al(e){return new As(e)}let An=e=>{e&&(e["x-uid"]||(e["x-uid"]=(0,rj.uid)()),Object.keys(e.properties||{}).forEach(t=>{An(e.properties[t])}))},Ao=e=>e,Ar=(e,t)=>{if(e&&t){for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)&&t[l]!==(null==e?void 0:e[l]))return!1;return!0}},Ai=(e,t)=>{if(e["x-uid"]&&e["x-uid"]===t["x-uid"])return[null,e.toJSON()];let l=e.toJSON(),n={...l,properties:{}},o=null,r=(e,l)=>{Object.keys(e||{}).forEach(n=>{let i=e[n];if(i["x-uid"]===t["x-uid"]){o=e[n];return}l.properties[n]={...i,properties:{}},r(null==i?void 0:i.properties,l.properties[n])})};return r(l.properties,n),[n,o]},Aa=e=>e;class As{get model(){return this.options.model}get query(){return this.options.query}loadAPIClientEvents(){let{api:e,t=Aa}=this.options;if(!e)return;let l=e=>{if(!e)return[];let t=Object.values(e.properties).length,l=[];return(e.mapProperties(e=>{e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].width=100/t,e["x-uid"]&&l.push({"x-uid":e["x-uid"],"x-component-props":e["x-component-props"]})}),e["x-uid"]&&l.length)?l:[]};this.on("insertAdjacent",async n=>{var o;let{onSuccess:r,current:i,position:a,schema:s,wrap:d,wrapped:u,removed:c}=n,p=[];if((null==u?void 0:u["x-component"])==="Grid.Col"&&(p=p.concat(l(u.parent))),(null==c?void 0:c["x-component"])==="Grid.Col"&&(p=p.concat(l(c.parent))),this.refresh(),!i["x-uid"])return;let m=await e.request({url:`/uiSchemas:insertAdjacent/${i["x-uid"]}?position=${a}`,method:"post",data:{schema:Ae(s,this.appVersion),wrap:d}});p.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:p}),(null==c?void 0:c["x-uid"])&&await e.request({url:`/uiSchemas:remove/${c["x-uid"]}`,method:"post"}),null==r||r(null==m||null==(o=m.data)?void 0:o.data),bz.Ay.success(t("Saved successfully"),.2)}),this.on("patch",async l=>{let{schema:n}=l;this.refresh(),(null==n?void 0:n["x-uid"])&&(await e.request({url:"/uiSchemas:patch",method:"post",data:{...n}}),bz.Ay.success(t("Saved successfully"),.2))}),this.on("initializeActionContext",async t=>{let{schema:l}=t;(null==l?void 0:l["x-uid"])&&await e.request({url:"/uiSchemas:initializeActionContext",method:"post",data:{...l}})}),this.on("batchPatch",async l=>{let{schemas:n}=l;this.refresh(),await e.request({url:"/uiSchemas:batchPatch",method:"post",data:n}),bz.Ay.success(t("Saved successfully"),.2)}),this.on("remove",async n=>{let{removed:o}=n,r=[];(null==o?void 0:o["x-component"])==="Grid.Col"&&(r=l(o.parent)),this.refresh(),(null==o?void 0:o["x-uid"])&&(await e.request({url:`/uiSchemas:remove/${o["x-uid"]}`,method:"post"}),r.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:r}),bz.Ay.success(t("Saved successfully"),.2))})}prepareProperty(e){e.type||(e.type="void"),e.name||(e.name=(0,rj.uid)()),this.current["x-uid"]&&An(e)}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}async emit(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(!this.events[e])return;let[o,...r]=l;return Promise.all(this.events[e].map(e=>e.bind(this)({current:this.current,...o},...r)))}parentsIn(e){if(!e||!ni.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"},l={"x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(n=>{t[n]?(this.current[n]=e[n],this.updateModel(t[n],e[n])):l[n]?Object.keys(e[n]).forEach(t=>{k4()(this.current,[n,t],e[n][t]),this.updateModel([l[n],t],e[n][t])}):this.current[n]=e[n]}),this.emit("patch",{schema:e})}getSchemaAttribute(e,t){return k8()(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(l=>{this.current[l]=e[l],t[l]&&this.updateModel(t[l],e[l])}),this.emit("patch",{schema:e})}updateModel(e,t){let l=l=>{k4()(l,e,t)};this.model&&l(this.model),this.query&&this.query.take(l)}insertAdjacent(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};switch(e){case"beforeBegin":return this.insertBeforeBegin(t,l);case"afterBegin":return this.insertAfterBegin(t,l);case"beforeEnd":return this.insertBeforeEnd(t,l);case"afterEnd":return this.insertAfterEnd(t,l)}}recursiveRemoveIfNoChildren(e,t){let l;if(!e)return;let n=e,o=null==t?void 0:t.breakRemoveOn;for(;n;){if("function"==typeof o){if(o(n))break}else if(Ar(n,o))break;if(Object.keys(n.properties||{}).length>0)break;n.parent&&(l=n.parent.removeProperty(n.name)),n=n.parent}return l}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:l,removeParentsIfNoChildren:n}=t,o=e||this.current,r=o.parent.removeProperty(o.name);if(n){let e=this.recursiveRemoveIfNoChildren(o.parent,{breakRemoveOn:l});e&&(r=e)}return this.emit("remove",{removed:r})}removeWithoutEmit(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:l,removeParentsIfNoChildren:n}=t,o=e||this.current,r=o.parent.removeProperty(o.name);if(n){let e=this.recursiveRemoveIfNoChildren(o.parent,{breakRemoveOn:l});e&&(r=e)}return r}insertBeforeBeginOrAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current)||!ni.Schema.isSchemaInstance(e)||this.current.parent!==e.parent)return;let l=0,n=0;return this.current.parent.mapProperties((t,o,r)=>{this.current.name===o&&(n=r),e.name===o&&(l=r)}),l>n?this.insertBeforeBegin(e,t):this.insertAfterEnd(e,t)}insertBeforeBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current))return;let l={onSuccess:t.onSuccess},{wrap:n=Ao,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ni.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=Fh()(e));let i={},a=!1,s=0,d=0;this.current.parent.mapProperties((e,t)=>{t===this.current.name&&(d=s,a=!0,++s),e["x-index"]=s,++s,a&&(i[t]=e,this.current.parent.removeProperty(t))}),this.prepareProperty(e);let u=n(e),c=this.current.parent.addProperty(u.name||(0,rj.uid)(),u);c["x-index"]=d,c.parent=this.current.parent,this.current.parent.setProperties(i);let[p,m]=Ai(c,e);this.emit("insertAdjacent",{position:"beforeBegin",schema:m,wrapped:u,wrap:p,...l})}insertAfterBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current))return;let l={onSuccess:t.onSuccess},{wrap:n=Ao,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ni.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=Fh()(e));let i={},a=1;this.current.mapProperties((e,t)=>{e["x-index"]=a,++a,i[t]=e}),this.current.properties={},this.prepareProperty(e);let s=n(e),d=this.current.addProperty(s.name||(0,rj.uid)(),s);d["x-index"]=0,d.parent=this.current,this.current.setProperties(i);let[u,c]=Ai(d,e);this.emit("insertAdjacent",{position:"afterBegin",schema:c,wrap:u,wrapped:s,...l})}insertBeforeEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current))return;delete e["x-index"];let l={onSuccess:t.onSuccess},{wrap:n=Ao,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ni.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=Fh()(e));this.prepareProperty(e);let i=n(e),a=this.current.addProperty(i.name||(0,rj.uid)(),i);a.parent=this.current;let[s,d]=Ai(a,e);return this.emit("insertAdjacent",{position:"beforeEnd",schema:d,wrap:s,wrapped:i,...l})}insertAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ni.Schema.isSchemaInstance(this.current))return;let l={onSuccess:null==t?void 0:t.onSuccess},{wrap:n=Ao,breakRemoveOn:o,removeParentsIfNoChildren:r}=t,i=0,a=0,s=!1,d={};if(this.current.parent.mapProperties((e,t)=>{e["x-index"]=i,t===this.current.name&&(a=++i,s=!0),++i,s&&t!==this.current.name&&(d[t]=e,this.current.parent.removeProperty(t))}),ni.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o})),e.parent=null}else e&&(e=Fh()(e));this.prepareProperty(e);let u=n(e),c=this.current.parent.addProperty(u.name||(0,rj.uid)(),u);c.parent=this.current.parent,c["x-index"]=a,this.current.parent.setProperties(d);let[p,m]=Ai(c,e);this.emit("insertAdjacent",{position:"afterEnd",schema:m,wrap:p,wrapped:u,...l})}constructor(e){this.events={},this.options=e,this.current=e.current,this.appVersion=e.appVersion}}function Ad(){let e=(0,J.useContext)(ni.SchemaOptionsContext),t=(0,J.useMemo)(()=>(null==e?void 0:e.components)||{},[e]);return e=>{if(!e)return null;if("string"!=typeof e)return e;let l=k8()(t,e);return l||console.error(`[nocobase]: Component "${e}" not found`),l}}function Au(){let{designable:e,setDesignable:t,refresh:l,reset:n}=(0,J.useContext)(ky),o=(0,J.useContext)(ni.SchemaOptionsContext),r=(0,J.useMemo)(()=>(null==o?void 0:o.components)||{},[o]),i=(0,J.useMemo)(()=>()=>(0,U.jsx)(U.Fragment,{}),[]),a=(0,Sc.A)(),s=kU(),d=kK(),u=(0,J.useCallback)(e=>{null==l||l(),a(),null==s||s(e),null==d||d()},[l,a,s,d]),c=(0,ni.useField)(),p=(0,ni.useFieldSchema)(),m=Fb(),{t:h}=(0,lE.B)(),f=(0,J.useMemo)(()=>Al({t:h,api:m,refresh:u,current:p,model:c,appVersion:At}),[h,m,u,p,c]);(0,J.useEffect)(()=>{f.loadAPIClientEvents()},[f]);let{isMobileLayout:g}=SQ();return{dn:f,designable:!g&&e,reset:n,refresh:u,setDesignable:t,DesignableBar:i,findComponent:(0,J.useCallback)(e=>{if(!e)return null;if("string"!=typeof e)return e;let t=k8()(r,e);return(null==t?void 0:t[k3])??t},[k8()]),on:f.on.bind(f),patch:(0,J.useCallback)((e,t)=>{let l=e=>{Object.keys(e).forEach(t=>{let l=e[t];"title"===t&&(c.title=l,p.title=l),"x-decorator-props"===t&&(c.decoratorProps||(c.decoratorProps={}),p["x-decorator-props"]||(p["x-decorator-props"]={}),Object.keys(l).forEach(e=>{c.decoratorProps[e]=l[e],p["x-decorator-props"][e]=l[e]})),"x-component-props"===t&&(c.componentProps||(c.componentProps={}),p["x-component-props"]||(p["x-component-props"]={}),Object.keys(l).forEach(e=>{c.componentProps[e]=l[e],p["x-component-props"][e]=l[e]}))})};if("string"==typeof e){let n={};return k4()(n,e,t),l(n)}l(e),u()},[f]),shallowMerge:(0,J.useCallback)(e=>{f.shallowMerge(e)},[f]),deepMerge:(0,J.useCallback)(e=>{f.deepMerge(e)},[f]),remove:(0,J.useCallback)((e,t)=>{f.remove(e,t)},[f]),insertAdjacent:(0,J.useCallback)((e,t,l)=>{f.insertAdjacent(e,t,l)},[f]),insertBeforeBegin:(0,J.useCallback)(e=>{f.insertBeforeBegin(e)},[f]),insertAfterBegin:(0,J.useCallback)(e=>{f.insertAfterBegin(e)},[f]),insertBeforeEnd:(0,J.useCallback)(e=>{f.insertBeforeEnd(e)},[f]),insertAfterEnd:(0,J.useCallback)(e=>{f.insertAfterEnd(e)},[f])}}let Ac=()=>void 0,Ap=(e,t,l)=>{let n;return rR().isFunction(e)?n=e:(n=t[e])||console.error(`${l} is not registered`),n||Ac},Am=(e,t)=>{let l;if(!e)return Ac;if(rR().isFunction(e))return e;for(let n of e.split("."))l=Ap(n,l||t,e);return l};function Ah(e,t){return Am(e,(0,ni.useExpressionScope)())(t)}function Af(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=t.displayName||e.displayName||e.name,n=t=>{let{dn:l,findComponent:o}=Au(),r=Ah((0,J.useMemo)(()=>{let e=l.getSchemaAttribute("x-component"),t=l.getSchemaAttribute("x-decorator"),r=l.getSchemaAttribute("x-use-component-props"),i=l.getSchemaAttribute("x-use-decorator-props");return e&&r&&o(e)===n?r:t&&i&&o(t)===n?i:void 0},[l]),t),i=(0,J.useMemo)(()=>({...t,...r}),[r,t]);return(0,U.jsx)(J.Suspense,{fallback:(0,U.jsx)(nk.A,{}),children:(0,U.jsx)(e,{...i,children:t.children})})};return e.displayName=l,n.displayName=`withSchemaProps(${l})`,n}var Ag=l(16933),Av=l(60152);let Ay=new Map;function Ax(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;Ay.set(e.toLowerCase(),t)}function Ab(e){return!!e&&Ay.has(e.toLowerCase())}function Aw(e){Object.keys(e).forEach(t=>{Ax(t,e[t])})}Object.keys(rC).forEach(e=>{Ax(e,rC[e])});let AS=e=>{let{type:t="",component:l,...n}=e;if(l)return(0,U.jsx)(Ag.A,{component:l,...n});if(t&&Ay.has(t.toLowerCase())){let e=Ay.get(t.toLowerCase());return(0,U.jsx)(e,{...n})}return t&&o?(0,U.jsx)(o,{type:t}):null};AS.createFromIconfontCN=e=>{o=(0,Av.A)(e)},AS.register=e=>{Aw(e)};let AC=(0,J.createContext)(null),AF=e=>{let{children:t,parent:l}=e;return(0,U.jsx)(AC.Provider,{value:{parent:l},children:t})},Ak=()=>{let e=J.useContext(AC);return null==e?void 0:e.parent};class AA{setData(e){this.data=e}setParentRecord(e){this.parentRecord=e}constructor(e){const{data:t,parentRecord:l,isNew:n}=e;this.isNew=n,this.data=t,this.parentRecord=l}}let AP=(0,J.createContext)(null);AP.displayName="CollectionRecordContext";let Aj=J.memo(e=>{let{isNew:t,record:l,parentRecord:n,children:o}=e,r=(0,J.useMemo)(()=>n?n instanceof AA?n:new AA({data:n}):l instanceof AA?l.parentRecord:void 0,[n,l]),i=(0,J.useMemo)(()=>{let e;return l?l instanceof AA?(e=l).isNew=l.isNew||t:e=new AA({data:l,isNew:t}):e=new AA({isNew:t}),e.setParentRecord(r),e},[l,r,t]);return(0,U.jsx)(AP.Provider,{value:i,children:o})});function AM(){return(0,J.useContext)(AP)}function AI(){let e=AM();return null==e?void 0:e.data}function AT(){let e=AM();return null==e?void 0:e.parentRecord}function AR(){var e;let t=AM();return null==t||null==(e=t.parentRecord)?void 0:e.data}Aj.displayName="CollectionRecordProvider";let AE=J.createContext(null),AN=J.createContext(null),AD=J.memo(e=>{var t,l;let{t:n}=(0,lE.B)(),o=AI(),r=erD(),i=AB();return(0,U.jsx)(AN.Provider,{value:{name:"$nParentPopupRecord",title:n("Parent popup record"),value:(null==(t=e.parent)?void 0:t.recordData)||(null==i?void 0:i.value),collection:(null==(l=e.parent)?void 0:l.collection)||(null==i?void 0:i.collection)},children:(0,U.jsx)(AE.Provider,{value:{name:"$nPopupRecord",title:n("Current popup record"),value:e.recordData||o,collection:e.collection||r},children:e.children})})});AD.displayName="VariablePopupRecordProvider";let AB=()=>J.useContext(AE),A$=()=>J.useContext(AN);class AO{get app(){return this.dataSourceManager.app}get key(){return this.options.key}get displayName(){return this.options.displayName}get status(){return this.options.status}get errorMessage(){return this.options.errorMessage}get collections(){return this.collectionManager.getCollections()||[]}getOptions(){return this.options}setOptions(e){Object.assign(this.options,e)}getOption(e){return this.options[e]}addReloadCallback(e){this.reloadCallbacks.includes(e)||this.reloadCallbacks.push(e)}removeReloadCallback(e){this.reloadCallbacks=this.reloadCallbacks.filter(t=>t!==e)}get flowEngineDataSourceManager(){var e;return null==(e=this.app.flowEngine)?void 0:e.context.dataSourceManager}async reload(){let e=await this.getDataSource(),t=this.flowEngineDataSourceManager;return t&&(t.upsertDataSource(this.options),t.getDataSource(this.key).upsertCollections(e.collections||[],{clearFields:!0})),this.setOptions(e),this.collectionManager.setCollections(e.collections||[]),this.reloadCallbacks.forEach(t=>t(e.collections)),this.options}constructor(e,t){this.options=e,this.dataSourceManager=t,this.reloadCallbacks=[],this.collectionManager=new erq(e.collections,this)}}class Aq extends AO{getDataSource(){return{collections:this.collections}}}class A_{addCollectionTemplates(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.reduce((e,t)=>{let l=new t(this);return e[l.name]=l,e},{});return Object.assign(this.collectionTemplateInstances,t),this.dataSourceManager.getDataSources().forEach(e=>{let l=e.collectionManager.getCollections(e=>t[e.template]);e.collectionManager.reAddCollections(l)}),t}getCollectionTemplate(e){return this.collectionTemplateInstances[e]}getCollectionTemplates(e){return Object.values(this.collectionTemplateInstances).filter(t=>{var l,n;return!e||!t.supportDataSourceType&&!t.notSupportDataSourceType||(t.supportDataSourceType?null==(l=t.supportDataSourceType)?void 0:l.includes(e):t.notSupportDataSourceType?!(null==(n=t.notSupportDataSourceType)?void 0:n.includes(e)):void 0)}).sort((e,t)=>(e.order||0)-(t.order||0))}constructor(e,t){this.dataSourceManager=t,this.collectionTemplateInstances={},this.addCollectionTemplates(e)}}var AL=l(84795);let AV=vy()(),Az=(0,A.css)`
1028
1028
  width: 100%;
1029
1029
  & > .ant-space-item {
1030
1030
  flex: 1;
@@ -3216,7 +3216,7 @@ ${o}`,c)}}let n=T(e.issues.filter(e=>"runtime"===e.type)),o=n?`Key runtime issue
3216
3216
  throw e;
3217
3217
  }
3218
3218
  })()`,o=new Compartment(this.globals);try{let e=o.evaluate(l),t=new Promise((e,t)=>setTimeout(()=>t(Error("Execution timed out")),this.timeoutMs)),n=await Promise.race([e,t]);return{success:!0,value:n}}catch(o){if(o instanceof n.sy||o instanceof n.zz)throw o;let t=i(e),l=a(o,t)&&t?s(o,t):o;return console.error(l),{success:!1,error:l,timeout:(null==l?void 0:l.message)==="Execution timed out"}}}constructor(e={}){var t,l;const n=e=>{if("u">typeof window&&"function"==typeof window[e])return window[e].bind(window);let t=globalThis[e];return"function"==typeof t?t.bind(globalThis):t},o=e.globals||{},r={};if(!Object.prototype.hasOwnProperty.call(o,"Blob"))try{const e=null==(t=o.window)?void 0:t.Blob;void 0!==e&&(r.Blob=e)}catch{}if(!Object.prototype.hasOwnProperty.call(o,"URL"))try{const e=null==(l=o.window)?void 0:l.URL;void 0!==e&&(r.URL=e)}catch{}this.globals={console,setTimeout:n("setTimeout"),clearTimeout:n("clearTimeout"),setInterval:n("setInterval"),clearInterval:n("clearInterval"),...r,...o},this.timeoutMs=e.timeoutMs??5e3}}},47451(e,t,l){"use strict";l.d(t,{_:()=>r});var n=l(48910),o=l(16639);function r(e){let t=new n.$;Object.defineProperty(t,o.i6,{value:"view",configurable:!0}),e.modelRepository&&t.setModelRepository(e.modelRepository),t.context.addDelegate(e.context);let l=t.unlinkFromStack.bind(t);t.unlinkFromStack=function(){var e;return null==(e=t.disposeScheduler)||e.call(t),l()};let r=new Set(["_modelInstances","_applyFlowCache","executor","context",o.i6,"previousEngine","nextEngine","emitter","_modelOperationScheduler","getScheduler","scheduleModelOperation","disposeScheduler","unlinkFromStack","linkAfter","_previousEngine","_nextEngine","getModel","_destroyView","setDestroyView","destroyView"]),i={get(t,l,n){if(r.has(l))return Reflect.get(t,l,n);let o=Reflect.get(e,l,n);return"registerModels"===l&&"function"==typeof o?o.bind(e):o},set:(t,l,n)=>r.has(l)?Reflect.set(t,l,n):Reflect.set(e,l,n),has:(t,l)=>l in t||l in e};return t.linkAfter(e),new Proxy(t,i)}},64171(e,t,l){"use strict";l.d(t,{Z:()=>n});class n{onActionRegistered(){}registerActions(e){for(let[,t]of Object.entries(e||{}))this.registerAction(t)}registerAction(e){if(!(null==e?void 0:e.name))throw Error("Action must have a name.");this.actions.has(e.name)&&console.warn(`Action '${e.name}' is already registered. It will be overwritten.`),this.actions.set(e.name,e),this.onActionRegistered()}constructor(){this.actions=new Map}}},31102(e,t,l){"use strict";l.d(t,{FC:()=>a,eI:()=>u,jP:()=>s});var n=l(74848),o=l(96540),r=l(42443),i=l(89013);let a={paddingBottom:0},s={marginBottom:12},d=["colon","dependencies","extra","getValueFromEvent","getValueProps","hasFeedback","help","htmlFor","initialValue","label","labelAlign","labelCol","messageVariables","name","normalize","noStyle","preserve","rules","tooltip","trigger","validateStatus","validateTrigger","valuePropName","wrapperCol","labelWidth","labelWrap","layout","required","showLabel"],u=e=>{let{children:t,showLabel:l=!0,labelWidth:u,...c}=e,p=Object.fromEntries(Object.entries(c).filter(e=>{let[t]=e;return!d.includes(t)})),m="function"==typeof t?t:o.Children.map(t,e=>o.isValidElement(e)?o.cloneElement(e,{...p}):e),{label:h,labelWrap:f,colon:g=!0,layout:v}=c,y=!v||"vertical"===v||f,x="vertical"===v?{width:u,...a}:{width:u},b=()=>l?y?(0,n.jsxs)("div",{style:{width:"100%",whiteSpace:"normal",wordBreak:"break-word",display:"flex",alignItems:"center",justifyContent:"flex-start",fontWeight:600},children:[(0,n.jsx)("span",{style:{flex:1},children:h}),g&&(0,n.jsx)("span",{style:{marginLeft:4,flexShrink:0},children:":"})]}):(0,n.jsx)(r.A,{title:h,children:(0,n.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",maxWidth:("number"==typeof u?u:120)-20,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"middle",fontWeight:600},children:[(0,n.jsx)("span",{style:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis"},children:h}),g&&(0,n.jsx)("span",{style:{marginLeft:4,flexShrink:0},children:":"})]})}):null;return(0,n.jsx)(i.A.Item,{...c,style:{...s,...c.style},labelCol:{style:x},layout:v,label:b(),colon:!1,extra:c.extra&&(0,n.jsx)("span",{style:{whiteSpace:"pre-wrap"},children:c.extra}),tooltip:c.tooltip&&{title:c.tooltip,overlayInnerStyle:{whiteSpace:"pre-line"}},children:m})}},61793(e,t,l){"use strict";let n,o;l.d(t,{D:()=>w});var r=l(74848),i=l(4888),a=l(96540),s=l(42524),d=l(41893),u=l(35710);let c=(e,t)=>{let{getPrefixCls:l}=(0,a.useContext)(i.Ay.ConfigContext)||{};if("ConfigContext"in i.Ay)return(null==l?void 0:l(e,null==t?void 0:t.prefixCls))||"";{let l=(null==t?void 0:t.prefixCls)??"ant-";return`${l}${e??""}`}},{ConfigContext:p}=i.Ay,m=()=>(0,a.useContext)(p),h=u.A.useToken,f=(e,t)=>{let{fontFamily:l,fontSize:n}=e,o=`[class^="${t}"], [class*=" ${t}"]`;return{[o]:{fontFamily:l,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},g=(n="nb-mobile-action-drawer",o=e=>{let{componentCls:t}=e;return{[t]:{".nb-mobile-action-drawer-header":{height:"var(--nb-mobile-page-header-height)",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:`1px solid ${e.colorSplit}`,position:"sticky",top:0,backgroundColor:"white",zIndex:1e3,"& + .nb-grid-container > .nb-grid > .nb-grid-warp > .ant-btn":{margin:12}},".nb-mobile-action-drawer-placeholder":{display:"inline-block",padding:12,visibility:"hidden"},".nb-mobile-action-drawer-close-icon":{display:"inline-block",padding:12,cursor:"pointer"},".nb-mobile-action-drawer-body":{borderTopLeftRadius:8,borderTopRightRadius:8,maxHeight:"calc(100% - var(--nb-mobile-page-header-height))",overflowY:"auto",overflowX:"hidden",backgroundColor:e.colorBgLayout,"& > .nb-grid-container":{padding:`${e.paddingPageVertical}px ${e.paddingPageHorizontal}px`},".ant-tabs-nav":{marginBottom:"0px !important",padding:`0 ${e.paddingPageHorizontal+e.borderRadiusBlock/2}px`,backgroundColor:e.colorBgContainer},"& > .nb-grid-container > .nb-grid > .nb-grid-warp > .nb-grid-row:nth-last-child(2) .noco-card-item":{marginBottom:0,"& > .ant-card":{marginBottom:"0 !important"}}},".nb-mobile-action-drawer-footer":{padding:"8px var(--nb-mobile-page-tabs-content-padding)",display:"flex",alignItems:"center",justifyContent:"flex-end",position:"sticky",bottom:0,left:0,right:0,zIndex:1e3,borderTop:`1px solid ${e.colorSplit}`,backgroundColor:e.colorBgLayout,".ant-btn":{marginLeft:8}}}}},e=>{let{theme:t,token:l,hashId:r}=h(),{getPrefixCls:i,iconPrefixCls:u}=m(),p=c(n),g=i(),v=(0,s.useStyleRegister)({theme:t,token:l,hashId:r,path:["formily-antd",n,p,u]},()=>{let t=`.${p}`,n=o((0,d.merge)(l,{componentCls:t,prefixCls:p,iconCls:`.${u}`,antCls:`.${g}`}),e,{hashId:r,prefixCls:p,rootPrefixCls:g,iconPrefixCls:u});return[f(l,p),n]});return{wrapSSR:(0,a.useMemo)(()=>v,[t,l,r,p,u,g,e]),hashId:r,componentCls:p,rootPrefixCls:g}});var v=l(18492),y=l(22505);let{Popup:x}=(0,y.R)(()=>Promise.resolve().then(l.bind(l,33022)),"Popup"),{CloseOutline:b}=(0,y.R)(()=>l.e("9200").then(l.bind(l,38370)),"CloseOutline"),w=e=>{let{title:t,visible:l,onClose:n,children:o,minHeight:s,className:d,footer:u}=e,{t:c}=(0,v.B)(),{componentCls:p,hashId:m}=g(),h=(0,a.useMemo)(()=>({minHeight:s}),[s]),f=(0,a.useMemo)(()=>({token:{paddingPageHorizontal:8,paddingPageVertical:8,marginBlock:12,borderRadiusBlock:8,fontSize:14}}),[]);return(0,r.jsx)(i.Ay,{theme:f,children:(0,r.jsxs)(x,{className:`${p} ${m} ${d||""}`,visible:l,onClose:n,onMaskClick:n,bodyClassName:"nb-mobile-action-drawer-body",bodyStyle:{padding:0},maskStyle:h,style:h,destroyOnClose:!0,children:[(0,r.jsxs)("div",{className:"nb-mobile-action-drawer-header",children:[(0,r.jsx)("span",{className:"nb-mobile-action-drawer-placeholder",children:(0,r.jsx)(b,{})}),(0,r.jsx)("span",{children:t}),(0,r.jsx)("span",{className:"nb-mobile-action-drawer-close-icon",onClick:n,role:"button",tabIndex:0,"aria-label":c("Close"),children:(0,r.jsx)(b,{})})]}),o,u&&(0,r.jsx)("div",{className:"nb-mobile-action-drawer-footer",children:u})]})})}},96332(e,t,l){"use strict";l.d(t,{openRequiredParamsStepFormDialog:()=>h});var n=l(74848),o=l(18220),r=l(95243),i=l(87959),a=l(71021),s=l(96540),d=l(29007),u=l(16296),c=l(60182);let p=(0,o.createSchemaField)(),m=e=>{let{model:t,requiredSteps:l,formStep:o,children:r}=e,i=l[(null==o?void 0:o.current)??0],a=s.useMemo(()=>{let{flowKey:e,step:l}=i,n=t.getFlow(e),o=new d.W5(t,e,"settings");return(0,c.wx)(o,(null==n?void 0:n.steps)||{},t,e),o.defineProperty("currentStep",{value:l}),o},[t,i]);return(0,n.jsx)(u.u,{value:a,children:r})},h=async e=>{let{model:t,dialogWidth:s=800,dialogTitle:h}=e,f=(0,c.lW)(t);if(h||f("Step parameter configuration"),!t)throw i.Ay.error(f("Invalid model provided")),Error(f("Invalid model provided"));return new Promise((e,i)=>{(async()=>{try{var g,v,y;let i=t.getFlows(),x=[];for(let[e,l]of i)for(let n in l.steps){let o=l.steps[n];if(o.paramsRequired||o.preset){let r=await (0,c.o7)(t,l,o);if(r){t.getStepParams(e,n);let i=!1;console.log(`Flow: ${e}, Step: ${n}, hasAllRequiredParams:`,i),i||x.push({flowKey:e,stepKey:n,step:o,uiSchema:r,title:o.title||n,flowTitle:l.title||e})}}}if(console.log("Required steps:",x),0===x.length)return void e({});let b={};for(let{flowKey:e,stepKey:l,step:n}of x){let o=t.getStepParams(e,l)||{},i={};n.use&&(i=(null==(y=t.flowEngine)||null==(v=y.getAction)?void 0:v.call(y,n.use)).defaultParams||{});let a=new d.W5(t,e,"settings"),s=t.getFlow(e);s&&(0,c.wx)(a,s.steps,t,e),a.defineProperty("currentStep",{value:n});let u=await (0,c.gG)(i,a),p=await (0,c.gG)(n.defaultParams,a),m={...(0,r.toJS)(u),...(0,r.toJS)(p),...(0,r.toJS)(o)};Object.keys(m).length>0&&(b[e]||(b[e]={}),b[e][l]=m)}let w={};x.forEach(e=>{let{flowKey:t,stepKey:l,uiSchema:n,title:o,flowTitle:r}=e;w[`${t}_${l}`]={type:"void","x-component":"FormStep.StepPane","x-component-props":{title:`${o}`,description:`Flow: ${r}`},properties:{layout:{type:"void","x-component":"FormLayout","x-component-props":{layout:"vertical"},properties:{[t]:{type:"object",properties:{[l]:{type:"object",properties:n}}}}}}}});let S=1===x.length?{type:"object",properties:{...Object.values(w)[0].properties}}:{type:"object",properties:{step:{type:"void","x-component":"FormStep","x-component-props":{formStep:"{{formStep}}"},properties:w}}},{FormDialog:C,FormStep:F}=await Promise.resolve().then(l.bind(l,20419)),k=x.length>1?F.createFormStep(0):null,A=t.flowEngine,P={formStep:k,totalSteps:x.length,requiredSteps:x,useFlowSettingsContext:u.s,...null==(g=A.flowSettings)?void 0:g.scopes},j=C({title:h||f("Step parameter configuration"),width:s,footer:null,destroyOnClose:!0},l=>{var r;let i=async()=>{try{await l.submit();let n=l.values;x.forEach(e=>{var l;let{flowKey:o,stepKey:r}=e,i=null==(l=n[o])?void 0:l[r];i&&t.setStepParams(o,r,i)}),await t.saveStepParams(),e(n),j.close()}catch(e){console.error(f("Error submitting form"),":",e)}},s=()=>{j.close(),e({})},d={...P,closeDialog:s,handleNext:()=>{l.validate().then(()=>{k&&k.next()}).catch(e=>{console.log(f("Form validation failed"),":",e)})}},u=(0,c.ln)(d,S);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m,{model:t,requiredSteps:x,formStep:k,children:(0,n.jsx)(p,{schema:u,components:{FormStep:F,...null==(r=A.flowSettings)?void 0:r.components},scope:d})}),(0,n.jsx)(o.FormConsumer,{children:()=>(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:24,paddingTop:16,borderTop:"1px solid #f0f0f0"},children:1===x.length?(0,n.jsx)(a.Ay,{type:"primary",onClick:i,children:f("Complete configuration")}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.Ay,{disabled:!(null==k?void 0:k.allowBack),onClick:()=>{k&&k.back()},children:f("Previous step")}),(0,n.jsx)(a.Ay,{disabled:!(null==k?void 0:k.allowNext),type:"primary",onClick:()=>{l.validate().then(()=>{k&&k.next()}).catch(e=>{console.log(f("Form validation failed"),":",e)})},style:{display:((null==k?void 0:k.current)??0)<x.length-1?"inline-block":"none"},children:f("Next step")}),(0,n.jsx)(a.Ay,{disabled:null==k?void 0:k.allowNext,type:"primary",onClick:i,style:{display:((null==k?void 0:k.current)??0)>=x.length-1?"inline-block":"none"},children:f("Complete configuration")})]})})})]})});j.open({initialValues:(0,c.ln)(P,b)})}catch(e){i(Error(`${f("Failed to import FormDialog or FormStep")}: ${e.message}`))}})()}).catch(e=>{console.error(e)})}},23183(e,t,l){"use strict";l.d(t,{openStepSettingsDialog:()=>f});var n=l(74848),o=l(67838),r=l(18220),i=l(95243),a=l(84626),s=l(71021),d=l(96540),u=l(16296),c=l(60182),p=l(31108),m=l(52847);let h=(0,r.createSchemaField)(),f=async e=>{var t,l,f,g,v,y,x,b;let{model:w,flowKey:S,stepKey:C,dialogWidth:F=600,dialogTitle:k,mode:A="dialog",ctx:P,uiModeProps:j,cleanup:M}=e,I=(0,c.lW)(w),T=w.context.message;if(!w)throw T.error(I("Invalid model provided")),Error(I("Invalid model provided"));let R=w.getFlow(S),E=null==R||null==(t=R.steps)?void 0:t[C];if(!R)throw T.error(I("Flow with key {{flowKey}} not found",{flowKey:S})),Error(I("Flow with key {{flowKey}} not found",{flowKey:S}));if(!E)throw T.error(I("Step with key {{stepKey}} not found",{stepKey:C})),Error(I("Step with key {{stepKey}} not found",{stepKey:C}));let N=E.title,D=E.beforeParamsSave,B=E.afterParamsSave,$={};if(E.use){let e=null==(b=w.flowEngine)||null==(x=b.getAction)?void 0:x.call(b,E.use);e&&($=e.defaultParams||{},N=N||e.title,D=D||e.beforeParamsSave,B=B||e.afterParamsSave)}let O=w.getFlow(S),q=await (0,c.o7)(w,O,E);if(!q)return T.info(I("This step has no configurable parameters")),{};let _=P;_.currentStep&&_.currentStep===E||_.defineProperty("currentStep",{value:E});let L=w.flowEngine,V={useFlowSettingsContext:u.s,...null==(l=L.flowSettings)?void 0:l.scopes},z=w.getStepParams(S,C)||{},K=await (0,c.gG)(E.defaultParams,_),U=await (0,c.gG)($,_),W={...(0,i.toJS)(U),...(0,i.toJS)(K),...(0,i.toJS)(z)},H={...(0,i.toJS)(z)},G={type:"object",properties:{layout:{type:"void","x-component":"FormLayout","x-component-props":{layout:"vertical"},properties:q}}},Y=w.context.viewer[A].bind(w.context.viewer),{zIndex:J,...X}=(0,i.toJS)(j)||{},Q=e=>{var t,l;return Math.max("function"==typeof(null==(t=w.context.viewer)?void 0:t.getNextZIndex)?w.context.viewer.getNextZIndex():((null==(l=w.context.themeToken)?void 0:l.zIndexPopupBase)||1e3)+1,Number(e)||0)},Z=Q(J),ee=(0,o.createForm)({initialValues:(0,c.ln)(V,W)}),et=(null==(f=w.context.view)?void 0:f.inputArgs)||{},el=(null==P||null==(g=P.view)?void 0:g.navigation)??(null==(v=w.context.view)?void 0:v.navigation),en={...et,...el?{navigation:el}:{},...(null==(y=(0,i.toJS)(j))?void 0:y.inputArgs)||{},__isSettingsPopup:!0};Y({title:k||I(N),width:F,destroyOnClose:!0,...X,zIndex:Z,inputArgs:en,onClose:()=>{M&&M()},content:e=>{let t=(0,m.PA)(()=>{var t;(0,d.useEffect)(()=>(0,i.autorun)(()=>{let{zIndex:t,...l}=(0,i.toJS)(j)||{};e.update({...l,zIndex:Q(t)})}),[]);let l=(0,c.ln)(V,G);return(0,n.jsx)(r.FormProvider,{form:ee,children:(0,n.jsxs)(u.u,{value:_,children:[(0,n.jsx)(h,{schema:l,components:{...null==(t=L.flowSettings)?void 0:t.components},scope:V}),(0,n.jsx)(e.Footer,{children:(0,n.jsxs)(a.A,{align:"end",children:[(0,n.jsx)(s.Ay,{type:"default",onClick:()=>{e.close()},children:I("Cancel")}),(0,n.jsx)(s.Ay,{type:"primary",onClick:async()=>{try{await ee.submit();let t=ee.values;w.setStepParams(S,C,t),D&&await D(_,t,H),e.close(),await w.saveStepParams(),T.success(I("Configuration saved")),B&&await B(_,t,H)}catch(t){if(t instanceof c.VD)return;if(t instanceof c.sy||t instanceof p.zz)return void e.close();console.error(I("Error saving configuration"),":",t),T.error(I("Error saving configuration, please check console"))}},children:I("OK")})]})})]})})});return(0,n.jsx)(t,{})}})}},41594(e,t,l){"use strict";l.d(t,{Ls:()=>a,Qp:()=>c,jx:()=>p,yG:()=>u,z5:()=>d});var n=l(2543),o=l.n(n),r=l(60182);async function i(e,t){return"function"==typeof e?await e(t):e}async function a(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.meta??{};if(await i(n.hide,t)&&!l)return;let o={key:e.name,label:n.label||e.name,searchable:!!n.searchable,searchPlaceholder:n.searchPlaceholder,toggleable:n.toggleable,useModel:e.name,sort:n.sort||1e3,children:s(e,t)};return o.createModelOptions=n.createModelOptions||{use:e.name},o}function s(e,t){let l,n=e.meta??{};if(!1===n.children)return!1;if(n.children&&(l=n.children),e.defineChildren&&(l=e.defineChildren.bind(e)),"function"==typeof l){let e=l;l=async()=>{let l=await e(t),i=e=>null==e?void 0:e.map(e=>{let l={...e};if(l.children)l.children=Array.isArray(l.children)?i(l.children):l.children;else if(l.createModelOptions){let e=l.createModelOptions;l.createModelOptions=async function(){for(var l=arguments.length,i=Array(l),a=0;a<l;a++)i[a]=arguments[a];let s=i&&i.length>0?i[i.length-1]:void 0,d=await (0,r.mv)(null==n?void 0:n.createModelOptions,t,s),u=await (0,r.mv)(e,t,s);return o().merge({},o().cloneDeep(d),u)}}return l});return i(l)}}return l}function d(e){return async t=>{let l=await c([e])(t);if(0===l.length)return[];let n=l.shift().children;return"function"==typeof n?n(t):n}}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return async l=>{var n,o;let s=l.engine.getSubclassesOf(e),d=[];for(let e of Array.from(s.values()))await i(null==(n=e.meta)?void 0:n.hide,l)||d.push(e);if(0===(d=d.filter(e=>{for(let l of t)if("string"==typeof l){if(e.name===l)return!1}else if(e===l||(0,r.FA)(e,l))return!1;return!0}).sort((e,t)=>{var l,n;return((null==(l=e.meta)?void 0:l.sort)??1e3)-((null==(n=t.meta)?void 0:n.sort)??1e3)})).length){let t="string"==typeof e?l.engine.getModelClass(e):e;t&&!await i(null==(o=t.meta)?void 0:o.hide,l)&&(d=[t])}let u=[];for(let e of d){let t=await a(e,l);t&&u.push(t)}return u}}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return async t=>{let l=[],n=[];for(let c of e){var o,r,i,a,d;let e="string"==typeof c?t.engine.getModelClass(c):c;if(!e)continue;let p=s(e,t);p||(p=await u(c,n)(t)),n.push(e);let m=!1;if("function"==typeof p)try{let e=await p(t);m=Array.isArray(e)?e.length>0:!!e}catch(e){m=!1}else m=Array.isArray(p)?p.length>0:!!p;if(!m)continue;let h=(null==e||null==(o=e.meta)?void 0:o.label)||("string"==typeof c?c:e.name),f="string"==typeof c?c:e.name,g=(null==e||null==(r=e.meta)?void 0:r.menuType)||"group",v=(null==e||null==(i=e.meta)?void 0:i.sort)??1e3,y=!!(null==e||null==(a=e.meta)?void 0:a.searchable),x=null==e||null==(d=e.meta)?void 0:d.searchPlaceholder;"submenu"===g?l.push({key:f,label:h,sort:v,searchable:y,searchPlaceholder:x,children:p}):l.push({key:f,type:"group",label:h,sort:v,searchable:y,searchPlaceholder:x,children:p})}return l.sort((e,t)=>((null==e?void 0:e.sort)??1e3)-((null==t?void 0:t.sort)??1e3))}}function p(e,t){let{useModel:l,fieldUseModel:n,associationPathName:o,refreshTargets:r,maxAssociationFieldDepth:i=2}=t,a=t.collection||e.model.collection||e.collection,s=a.getFields(),d=[],u=o?o.split(".").filter(Boolean).length:0;for(let e of s){var c,p;if(!(null==e||null==(c=e.options)?void 0:c.interface)||u>=i&&((null==(p=e.isAssociationField)?void 0:p.call(e))||e.target||e.targetCollection))continue;let t=o?`${o}.${e.name}`:e.name,s="function"==typeof n?n(e):n??"FieldModel";if(s){let n={dataSourceKey:a.dataSourceKey,collectionName:a.name,fieldPath:e.name,associationPathName:o};d.push({key:t,label:e.title,toggleable:e=>{let{associationPathName:l,fieldPath:n}=e.getStepParams("fieldSettings","init")||{};return(l?`${l}.${n}`:n)===t},useModel:l,refreshTargets:r,createModelOptions:()=>({use:l,stepParams:{fieldSettings:{init:n}},subModels:{field:{use:s,stepParams:{fieldSettings:{init:n}}}}})})}}return[{key:`addField_${a.name}`,label:"",type:"group",searchable:!0,searchPlaceholder:e.t("Search fields"),children:d.filter(Boolean)}]}},76546(e,t,l){"use strict";l.d(t,{pM:()=>g,qG:()=>f,qS:()=>h,Ns:()=>s,zA:()=>u,U1:()=>c,JL:()=>v,Xk:()=>y});var n=l(95243),o=l(2543),r=l.n(o),i=l(16075),a=l.n(i);function s(e){var t;let l;switch(e.type){case"string":l=a().string();break;case"number":l=a().number();break;case"array":l=a().array();break;case"boolean":l=a().boolean();break;default:l=a().any()}let n=(e,t)=>{if(!t||0===Object.keys(t).length)return[];if(Array.isArray(t))return t;if("email"===e){var l;let e={...t};return(null==(l=e.tlds)?void 0:l.allow)===!0?e.tlds.allow=!1:e.tlds||(e.tlds={allow:!1}),[e]}if(["length","min","max"].includes(e))return[t.limit];if("pattern"===e){let e=null==t?void 0:t.regex;return e instanceof RegExp?[e]:[new RegExp(e)]}let n=Object.values(t);return n.length?n:[]},o=!1;return null==(t=e.rules)||t.forEach(e=>{let{name:t,args:r}=e;if("required"===t&&(o=!0),"function"==typeof l[t])try{l=l[t](...n(t,r))}catch(e){console.warn(`调用 Joi 方法 ${t} 失败:`,e)}else console.warn(`Joi schema 上不存在方法: ${t}`)}),o||(l=(l=l.optional().allow("")).optional().allow(null)),l}function d(e){let t=[],l=new Set,n=new Set,o=new Map;e.forEach(e=>{o.set(e.name,e)});let r=e=>{if(n.has(e.name))throw Error(`Circular dependency detected: ${e.name} inherits from itself through a chain`);if(!l.has(e.name)){for(let t of(n.add(e.name),e.inherits||[])){let l=o.get(t);if(!l){console.warn(`Warning: Collection ${t}, inherited by ${e.name}, not found.`);continue}r(l)}n.delete(e.name),l.add(e.name),t.push(e)}};for(let t of e)r(t);return t}class u{setFlowEngine(e){this.flowEngine=e}setRequester(e){this.requester=e}setCollectionFieldInterfaceManager(e){this.collectionFieldInterfaceManager=e}addFieldInterfaces(){var e,t;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];null==(t=this.collectionFieldInterfaceManager)||null==(e=t.addFieldInterfaces)||e.call(t,l)}addFieldInterfaceGroups(e){var t,l;null==(l=this.collectionFieldInterfaceManager)||null==(t=l.addFieldInterfaceGroups)||t.call(l,e)}addFieldInterfaceComponentOption(e,t){var l,n;null==(n=this.collectionFieldInterfaceManager)||null==(l=n.addFieldInterfaceComponentOption)||l.call(n,e,t)}addFieldInterfaceOperator(e,t){var l,n;null==(n=this.collectionFieldInterfaceManager)||null==(l=n.addFieldInterfaceOperator)||l.call(n,e,t)}registerFieldFilterOperator(e){var t,l;null==(l=this.collectionFieldInterfaceManager)||null==(t=l.registerFieldFilterOperator)||t.call(l,e)}registerFieldFilterOperatorGroup(e){var t,l;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];null==(l=this.collectionFieldInterfaceManager)||null==(t=l.registerFieldFilterOperatorGroup)||t.call(l,e,n)}addFieldFilterOperatorsToGroup(e){var t,l;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];null==(l=this.collectionFieldInterfaceManager)||null==(t=l.addFieldFilterOperatorsToGroup)||t.call(l,e,n)}registerLoader(e,t){this.loaders.set(e,t)}removeLoader(e){this.loaders.delete(e)}addDataSource(e){if(this.dataSources.has(e.key))throw Error(`DataSource with name ${e.key} already exists`);e instanceof h||(e=new(e.use||h)(e)),this.dataSources.set(e.key,e),e.setDataSourceManager(this)}upsertDataSource(e){if(this.dataSources.has(e.key)){var t;null==(t=this.dataSources.get(e.key))||t.patchOptions(e)}else this.addDataSource(e)}removeDataSource(e){this.dataSources.delete(e)}clearDataSources(){this.dataSources.clear()}getDataSources(){return Array.from(this.dataSources.values())}getDataSource(e){return this.dataSources.get(e)}getCollection(e,t){let l=this.getDataSource(e);if(l)return l.collectionManager.getCollection(t)}getCollectionField(e){let[t,...l]=e.split("."),n=this.getDataSource(t);if(n)return n.getCollectionField(l.join("."))}async ensureLoaded(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{force:t=!1}=e,l=this.resolveLoadKeys(e.keys),n=t?l:l.filter(e=>!this.loadedKeys.has(e));if(n.length)return this.loadingPromise||(this.loadingPromise=(async()=>{try{for(let e of n)await this.loadKey(e,{initial:!this.loadedKeys.has(e),force:t})}finally{this.loadingPromise=null}})()),this.loadingPromise}async reload(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.resolveLoadKeys(e.keys);if(t.length)return this.loadingPromise||(this.loadingPromise=(async()=>{try{for(let e of t)await this.loadKey(e,{initial:!1,force:!0})}finally{this.loadingPromise=null}})()),this.loadingPromise}async reloadDataSource(e){return this.loadingKeys.has(e)&&this.loadingPromise?this.loadingPromise:!this.loaders.has(e)&&this.loaders.has("*")?this.reload({keys:["*"]}):this.reload({keys:[e]})}resolveLoadKeys(e){let t=(null==e?void 0:e.length)?e:["main"],l=t.filter(e=>this.loaders.has(e));return this.loaders.has("*")?r().uniq(["*",...l]):l.length?l:t}getApp(){var e,t;return null==(t=this.flowEngine)||null==(e=t.context)?void 0:e.app}dispatchDataSourceEvent(e,t){var l,n;null==(n=this.getApp())||null==(l=n.eventBus)||l.dispatchEvent(new CustomEvent(e,{detail:t}))}setDataSourceState(e,t){let l=this.getDataSource(e);l&&l.patchOptions(t)}applyDataSourceLoadResult(e,t){if("*"===e)return void((null==t?void 0:t.dataSources)||[]).forEach(e=>{let{collections:t,...l}=e;if(this.upsertDataSource(l),t){var n;null==(n=this.getDataSource(l.key))||n.setCollections(t,{clearFields:!0})}});let l=this.getDataSource(e);l&&l.setCollections((null==t?void 0:t.collections)||[],{clearFields:!0})}async loadKey(e,t){let l=this.loaders.get(e);if(!l)return;this.getDataSource(e)||"*"===e||this.addDataSource({key:e});let{initial:n}=t;this.loadingKeys.add(e),"*"!==e&&this.setDataSourceState(e,{status:n?"loading":"reloading",errorMessage:void 0}),this.loadErrors.set(e,null);try{let t=await l({key:e,manager:this})||{};this.applyDataSourceLoadResult(e,t),this.loadedKeys.add(e),"*"!==e&&this.setDataSourceState(e,{status:"loaded",errorMessage:void 0}),this.dispatchDataSourceEvent("dataSource:loaded",{dataSourceKey:e,initial:n})}catch(l){let t=l instanceof Error?l:Error(String(l));throw this.loadErrors.set(e,t),"*"!==e&&this.setDataSourceState(e,{status:n?"loading-failed":"reloading-failed",errorMessage:t.message}),this.dispatchDataSourceEvent("dataSource:loadFailed",{dataSourceKey:e,initial:n,error:t}),t}finally{this.loadingKeys.delete(e)}}constructor(){this.loaders=new Map,this.loadedKeys=new Set,this.loadingKeys=new Set,this.loadErrors=new Map,this.loadingPromise=null,this.dataSources=n.observable.shallow(new Map)}}function c(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(e)for(let t of l){let l=null==t?void 0:t.collectionFieldInterfaceManager,n=null==l?void 0:l.getFieldInterface;if("function"==typeof n)return n.call(l,e)}}function p(e){return"string"==typeof e&&/\{\{\s*t\s*\(/.test(e)}function m(e,t,l){return p(t)?e.translate(t,l):t}class h{get flowEngine(){return this.dataSourceManager.flowEngine}get displayName(){return this.flowEngine.translate(this.options.displayName,{ns:"lm-collections"})||this.key}get key(){return this.options.key}get name(){return this.options.key}get status(){return this.options.status}get errorMessage(){return this.options.errorMessage}setDataSourceManager(e){this.dataSourceManager=e}getCollections(){return this.collectionManager.getCollections()}getCollection(e){return this.collectionManager.getCollection(e)}getAssocation(e){return this.getAssociation(e)}getAssociation(e){return this.collectionManager.getAssociation(e)}addCollection(e){return this.collectionManager.addCollection(e)}updateCollection(e){return this.collectionManager.updateCollection(e)}upsertCollection(e){return this.collectionManager.upsertCollection(e)}upsertCollections(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.collectionManager.upsertCollections(e,t)}setCollections(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.collectionManager.setCollections(e,t)}removeCollection(e){return this.collectionManager.removeCollection(e)}clearCollections(){this.collectionManager.clearCollections()}setOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(this.options).forEach(e=>delete this.options[e]),Object.assign(this.options,e)}patchOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this.options,e)}reload(){return this.dataSourceManager.reloadDataSource(this.key)}getCollectionField(e){let[t,...l]=e.split("."),n=l.join("."),o=this.getCollection(t);if(!o)return;let r=o.getFieldByPath(n);if(r)return r}constructor(e={}){this.options=(0,n.observable)({...e}),this.collectionManager=new f(this)}}class f{resetCaches(){this.childrenCollectionsName={},this.allCollectionsInheritChain=void 0}get flowEngine(){return this.dataSource.flowEngine}addCollection(e){let t;(t=e instanceof g?e:new g(e)).setDataSource(this.dataSource),t.initInherits(),this.collections.set(t.name,t),this.resetCaches()}removeCollection(e){this.collections.delete(e),this.resetCaches()}updateCollection(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=this.getCollection(e.name);if(!l)throw Error(`Collection ${e.name} not found`);l.setOptions(e,t),this.resetCaches()}upsertCollection(e){return this.collections.has(e.name)?this.updateCollection(e):this.addCollection(e),this.getCollection(e.name)}upsertCollections(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(let l of d(e))this.collections.has(l.name)?this.updateCollection(l,t):this.addCollection(l);this.resetCaches()}setCollections(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.clearCollections(),this.upsertCollections(e,t)}sortCollectionsByInherits(e){let t=new Map;for(let l of e)t.set(l.name,l);let l={},n={};for(let t of e)l[t.name]=new Set,n[t.name]=0;for(let t of e)for(let e of t.inherits||[])l[e]||(l[e]=new Set),l[e].add(t.name),n[t.name]=(n[t.name]||0)+1;let o=[];for(let e in n)0===n[e]&&o.push(e);let r=[];for(;o.length;){let e=o.shift();for(let i of(t.has(e)&&r.push(t.get(e)),l[e]||[]))n[i]--,0===n[i]&&o.push(i)}if(r.length!==e.length)throw Error("Collection inherits has circular dependency!");return r}getCollection(e){if(e.includes(".")){let[t,l]=e.split("."),n=this.getCollection(t);if(!n)throw Error(`Collection ${t} not found in data source ${this.dataSource.key}`);let o=n.getField(l);if(!o)throw Error(`Field ${l} not found in collection ${t}`);return o.targetCollection}return this.collections.get(e)}getCollections(){return r().sortBy(Array.from(this.collections.values()).filter(e=>!e.hidden),"sort")}clearCollections(){this.collections.clear(),this.resetCaches()}getAssociation(e){let[t,l]=e.split("."),n=this.getCollection(t);if(!n)throw Error(`Collection ${t} not found in data source ${this.dataSource.key}`);return n.getField(l)}getChildrenCollections(e){let t=[],l=Array.from(this.collections.values()),n=e=>(l.filter(t=>{var l;return null==(l=t.options.inherits)?void 0:l.includes(e)}).forEach(e=>{let l=e.name;return t.push(e),n(l)}),t);return n(e)}getChildrenCollectionsName(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=t?"supportView":"notSupportView";if(this.childrenCollectionsName[l])return this.childrenCollectionsName[l].slice();let n=[],o=[...this.getCollections()],i=e=>(o.filter(t=>{var l;return l=[...t.inherits],l.includes(e)}).forEach(e=>{let t=e.name;return n.push(t),i(t)}),t&&o.filter(t=>{var l;return l=[...t.sources],l.length===1&&(null==t?void 0:t.sources[0])===e}).forEach(e=>{let t=e.name;return n.push(e.name),i(t)}),r().uniq(n));return this.childrenCollectionsName[l]=i(e),this.childrenCollectionsName[l]}getAllCollectionsInheritChain(e){if(this.allCollectionsInheritChain)return this.allCollectionsInheritChain.slice();let t=[e],l=e=>{let n=this.getCollection(e);if(n){let{inherits:o}=n,r=this.getChildrenCollectionsName(e);if(o)for(let e=0;e<o.length;e++){let n=o[e];t.includes(n)||(t.push(n),l(n))}if(r)for(let e=0;e<r.length;e++){let n=this.getCollection(r[e]).name;t.includes(n)||(t.push(n),l(n))}}return t};return this.allCollectionsInheritChain=l(e),this.allCollectionsInheritChain||[]}constructor(e){this.dataSource=e,this.childrenCollectionsName={},this.collections=n.observable.shallow(new Map)}}class g{clone(){let e=new g(r().cloneDeep(this.options));return e.setDataSource(this.dataSource),e}getFilterByTK(e){if(!e)throw Error("Record is required to get filterByTk");if(Array.isArray(e))return e.map(e=>this.getFilterByTK(e));if(!this.filterTargetKey)throw Error(`filterTargetKey is not defined for collection ${this.name}`);return"string"==typeof this.filterTargetKey?e[this.filterTargetKey]:Array.isArray(this.filterTargetKey)&&1===this.filterTargetKey.length?e[this.filterTargetKey[0]]:r().pick(e,this.filterTargetKey)}get titleableFields(){return this.getFields().filter(e=>e.titleable)}get hidden(){return this.options.hidden||!1}get flowEngine(){return this.dataSource.flowEngine}get collectionManager(){return this.dataSource.collectionManager}get sort(){return this.options.sort||0}get filterTargetKey(){return this.options.filterTargetKey}get dataSourceKey(){return this.dataSource.key}get name(){return this.options.name}get template(){return this.options.template}get storage(){return this.options.storage||"local"}get title(){return this.flowEngine.translate(this.options.title,{ns:"lm-collections"})||this.name}get titleCollectionField(){let e=this.options.titleField||this.filterTargetKey;if(Array.isArray(e)){if(1!==e.length)return;return this.getField(e[0])}return this.getField(e)}initInherits(){for(let e of(this.inherits.clear(),this.options.inherits||[])){let t=this.collectionManager.getCollection(e);if(!t){console.warn(`Warning: Collection ${e} not found for collection ${this.name}`);continue}this.inherits.set(e,t)}}setDataSource(e){this.dataSource=e}setOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(this.options).forEach(e=>delete this.options[e]),Object.assign(this.options,e),this.initInherits(),t.clearFields&&this.clearFields(),this.upsertFields(this.options.fields||[])}setOption(e,t){this.options[e]=t}getFields(){let e=new Map;for(let t of this.inherits.values())if(t&&"function"==typeof t.getFields)for(let l of t.getFields())e.set(l.name,l);for(let[t,l]of this.fields.entries())e.set(t,l);return Array.from(e.values())}getToOneAssociationFields(){return this.getAssociationFields(["one"])}getAssociationFields(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.includes("new")?this.getFields().filter(e=>["hasMany","belongsToMany","belongsToArray"].includes(e.type)):e.includes("many")&&e.includes("one")?this.getFields().filter(e=>e.isAssociationField()):e.includes("many")?this.getFields().filter(e=>["hasMany","belongsToMany","belongsToArray"].includes(e.type)):e.includes("one")?this.getFields().filter(e=>["hasOne","belongsTo"].includes(e.type)):this.getFields().filter(e=>e.isAssociationField())}mapFields(e){return this.getFields().map(e)}setFields(e){for(let t of(this.fields.clear(),e))this.addField(t)}upsertFields(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(let t of e)this.fields.has(t.name)?this.fields.get(t.name).setOptions(t):this.addField(t)}getFieldByPath(e){let[t,...l]=e.split("."),n=this.getField(t);return 0===l.length?n:(null==n?void 0:n.targetCollection)?n.targetCollection.getFieldByPath(l.join(".")):null}getField(e){return this.fields.get(e)}getFullFieldPath(e){return this.dataSource.key+"."+this.name+"."+e}addField(e){if(e.name&&this.fields.has(e.name))throw Error(`Field with name ${e.name} already exists in collection ${this.name}`);if(e instanceof v)e.setCollection(this),this.fields.set(e.name,e);else{let t=new v(e);t.setCollection(this),this.fields.set(t.name,t)}}removeField(e){return this.fields.delete(e)}clearFields(){return this.fields.clear()}refresh(){}getRelationshipFields(){let e=["o2o","oho","obo","m2o","createdBy","updatedBy","o2m","m2m","linkTo","chinaRegion","mbm"];return this.getFields().filter(t=>e.includes(t.interface))}getRelatedCollections(){let e=this.getRelationshipFields(),t=[],l=new Set;for(let n of e)if(n.target&&!l.has(n.target)){let e=this.collectionManager.getCollection(n.target);e&&e.name!==this.name&&(t.push(e),l.add(n.target))}return t}hasRelationshipFields(){return this.getRelationshipFields().length>0}constructor(e={}){this.options=(0,n.observable)({...e}),this.fields=n.observable.shallow(new Map),this.inherits=n.observable.shallow(new Map),this.setFields(e.fields||[])}}class v{setOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(this.options).forEach(e=>delete this.options[e]),Object.assign(this.options,e)}setCollection(e){this.collection=e}get targetCollectionTitleFieldName(){var e,t;return null==(t=this.targetCollection)||null==(e=t.titleCollectionField)?void 0:e.name}get targetCollectionTitleField(){var e;return null==(e=this.targetCollection)?void 0:e.titleCollectionField}get flowEngine(){return this.collection.flowEngine}get dataSourceKey(){var e;return null==(e=this.collection)?void 0:e.dataSourceKey}get resourceName(){return`${this.collection.name}.${this.name}`}get collectionName(){var e;return(null==(e=this.collection)?void 0:e.name)||this.options.collectionName}get readonly(){var e;return this.options.readonly||(null==(e=this.options.uiSchema)?void 0:e["x-read-pretty"])||!1}get titleable(){return!!(this.options.titleable??this.options.titleUsable)}get fullpath(){return this.collection.dataSource.key+"."+this.collection.name+"."+this.name}get name(){return this.options.name}get type(){return this.options.type}get dataType(){return this.options.dataType}get foreignKey(){return this.options.foreignKey}get targetKey(){return this.options.targetKey||this.targetCollection.filterTargetKey}get sourceKey(){return this.options.sourceKey}get target(){return this.options.target}get title(){var e,t,l;let n=(null==(t=this.options)||null==(e=t.uiSchema)?void 0:e.title)||(null==(l=this.options)?void 0:l.title);return this.flowEngine.translate(n,{ns:"lm-collections"})||this.options.name}set title(e){this.options.title=e}get enum(){var e;let t=(null==(e=this.options.uiSchema)?void 0:e.enum)||[];return"integer"===this.type?t.map(e=>"object"!=typeof e||null===e.value||void 0===e.value?e:{...e,label:m(this.flowEngine,e.label,{ns:"lm-collections"}),value:Number(e.value)}):t.map(e=>({...e,label:m(this.flowEngine,e.label,{ns:"lm-collections"})}))}get defaultValue(){return null==this.options.defaultValue?void 0:this.options.defaultValue}get interface(){return this.options.interface}get filterable(){var e;return this.options.filterable||(null==(e=this.getInterfaceOptions())?void 0:e.filterable)}get inputable(){return this.options.inputable}get uiSchema(){return this.options.uiSchema||{}}get targetCollection(){var e;return this.options.target&&(null==(e=this.collection)?void 0:e.collectionManager.getCollection(this.options.target))}get validation(){return this.options.validation}getComponentProps(){var e,t;let{type:l,target:n}=this.options,o=r().omitBy({...r().omit((null==(e=this.options.uiSchema)?void 0:e["x-component-props"])||{},"fieldNames"),options:this.enum.length?this.enum:void 0,mode:"multipleSelect"===this.interface?"multiple":void 0,multiple:n?["belongsToMany","hasMany","belongsToArray"].includes(l):void 0,maxCount:n&&!["belongsToMany","hasMany","belongsToArray"].includes(l)?1:void 0,target:n,template:null==(t=this.targetCollection)?void 0:t.template},r().isUndefined);if(this.validation){let e=[],t=s(this.validation),l=this.title;e.push({validator:(e,n)=>{let{error:o}=t.validate(n,{context:{label:l},abortEarly:!1});return o?Promise.reject(o.details.map(e=>{let t=this.flowEngine.translate(e.type,{...e.context,ns:"data-source-main",label:l});return t&&t!==e.type?t:e.message.replace(/"value"/g,`"${l}"`)}).join(", ")):Promise.resolve()}}),o.rules=e}return o}getFields(){if(!this.options.target)return[];if(!this.targetCollection)throw Error(`Target collection ${this.options.target} not found for field ${this.name}`);return this.targetCollection.getFields()}getInterfaceOptions(){var e,t,l;let n=this.flowEngine.context;return c(this.interface,null==(t=this.collection)||null==(e=t.dataSource)?void 0:e.dataSourceManager,n.dataSourceManager,null==(l=n.app)?void 0:l.dataSourceManager)}getFilterOperators(){var e;let t=this.getInterfaceOptions();return(null==t||null==(e=t.filterable)?void 0:e.operators)||[]}getSubclassesOf(e){return this.flowEngine.getSubclassesOf(e,(e,t)=>y(e.supportedFieldInterfaces,this.interface))}getFirstSubclassNameOf(e){for(let[t,l]of this.getSubclassesOf(e))if("*"!==l.supportedFieldInterfaces)return t}isAssociationField(){return["belongsToMany","belongsTo","hasMany","hasOne","belongsToArray"].includes(this.type)}isRelationshipField(){return["o2o","oho","obo","m2o","createdBy","updatedBy","o2m","m2m","linkTo","chinaRegion","mbm"].includes(this.interface)}constructor(e){this.options=(0,n.observable)({...e})}}function y(e,t){return!!e&&("*"===e||("string"==typeof e?e===t:!!Array.isArray(e)&&(e.includes("*")||e.includes(t))))}},48036(e,t,l){"use strict";l.d(t,{v:()=>n});class n{setPaused(e){this.paused=e}on(e,t){var l,n;((l=this.events)[n=e]||(l[n]=[])).push(t)}off(e,t){this.events[e]=(this.events[e]||[]).filter(e=>e!==t)}emit(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];this.paused||(this.events[e]||[]).forEach(e=>e(...l))}async emitAsync(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(!this.paused)for(let t of(this.events[e]||[]).slice())await t(...l)}constructor(){this.events={},this.paused=!1}}},26955(e,t,l){"use strict";l.d(t,{L:()=>n});class n{onEventRegistered(){}registerEvents(e){for(let[,t]of Object.entries(e||{}))this.registerEvent(t)}registerEvent(e){if(!(null==e?void 0:e.name))throw Error("Event must have a name.");this.events.has(e.name)&&console.warn(`Event '${e.name}' is already registered. It will be overwritten.`),this.events.set(e.name,e),this.onEventRegistered()}constructor(){this.events=new Map}}},84471(e,t,l){"use strict";l.d(t,{j:()=>r});var n=l(68161),o=l(95243);class r{addFlows(e){for(let[t,l]of Object.entries(e||{}))this.addFlow(t,l)}addFlow(e,t){let l=new n.G({...t,key:e},this);return this.flows.set(e,l),l}hasFlow(e){return!!this.flows.get(e)}getFlow(e){return this.flows.get(e)}getFlows(){return this.flows}removeFlow(e){this.flows.delete(e)}mapFlows(e){return[...this.getFlows().values()].map(t=>e(t))}moveStep(e,t,l){let n=this.getFlow(e);if(!n)throw Error(`Flow '${e}' not found`);n.moveStep(t,l)}constructor(){this.flows=o.observable.shallow(new Map)}}},98837(e,t,l){"use strict";l.d(t,{r:()=>r});var n=l(33954),o=l(84471);class r extends o.j{removeFlow(e){console.warn(`GlobalFlowRegistry.removeFlow: removing static flow '${e}' is not supported.`)}getFlow(e){if(this.flows.has(e))return this.flows.get(e);let t=Object.getPrototypeOf(this.target);if(t!==Function.prototype&&t!==Object.prototype&&(null==t?void 0:t.globalFlowRegistry))return t.globalFlowRegistry.getFlow(e)}getFlows(){let e=new Map(this.flows),t=Object.getPrototypeOf(this.target);if(t!==Function.prototype&&t!==Object.prototype&&(null==t?void 0:t.globalFlowRegistry))for(let[l,n]of t.globalFlowRegistry.getFlows().entries())e.has(l)||e.set(l,n);let l=e=>{let t=0,l=e;for(;l&&l!==n.WD&&l!==Function.prototype&&l!==Object.prototype;)l=Object.getPrototypeOf(l),t+=1;return t};return new Map(Array.from(e.entries()).sort((e,t)=>{let[,n]=e,[,o]=t,r=n.sort??0,i=o.sort??0;if(r!==i)return r-i;let a=n.flowRegistry,s=o.flowRegistry,d=l(a.target),u=l(s.target);return d!==u?d-u:0}))}saveFlow(e){}destroyFlow(e){}constructor(e){super(),this.target=e}}r._type="global"},96321(e,t,l){"use strict";l.d(t,{R:()=>o});var n=l(84471);class o extends n.j{async save(){await this.model.saveStepParams()}async saveFlow(e){await this.model.saveStepParams()}async destroyFlow(e){this.removeFlow(e),await this.model.saveStepParams()}async moveStep(e,t,l){super.moveStep(e,t,l),await this.model.saveStepParams()}constructor(e){super(),this.model=e}}o._type="instance"},29007(e,t,l){"use strict";l.d(t,{W5:()=>eR,uk:()=>eY,Hl:()=>eT,o0:()=>eM,d6:()=>eI,cB:()=>ef,Bt:()=>eK});var n=l(58587),o=l(18150),r=l(68238),i=l(88243),a=l(16213),s=l(95243),d=l(88909),u=l(25782),c=l(2543),p=l.n(c),m=l(55373),h=l.n(m),f=l(96540),g=l(5338),v=l.t(g,2),y=l(63128);class x{setData(e){this.data=p().cloneDeep(e)}setMeta(e){this.meta=p().cloneDeep(e)}async load(){var e,t,l,n;let o=(null==(n=this.flowEngine)||null==(l=n.context)||null==(t=l.api)||null==(e=t.auth)?void 0:e.token)||"";this.loaded&&this.lastToken!==o&&(this.loaded=!1,this.loadingPromise=null,this.data={},this.meta={});let{data:r}=await this.flowEngine.context.api.request({url:"roles:check"});this.data=(null==r?void 0:r.data)||{},this.meta=(null==r?void 0:r.meta)||{},this.loaded=!0,this.lastToken=o,await this.loadingPromise}getActionAlias(e){var t;return(null==(t=this.data.actionAlias)?void 0:t[e])||e}inResources(e,t){var l,n,o;let{dataSources:r}=(null==(l=this)?void 0:l.meta)||{};return null==(o=({...this.data,...(0,c.omit)(null==r?void 0:r[t],"snippets")}).resources)||null==(n=o.includes)?void 0:n.call(o,e)}getResourceActionParams(e,t,l){var n,o,r;let i=this.getActionAlias(t),{dataSources:a}=(null==(n=this)?void 0:n.meta)||{},s={...this.data,...(0,c.omit)(null==a?void 0:a[l],"snippets")};return(null==(o=s.actions)?void 0:o[`${e}:${i}`])||(null==(r=s.actions)?void 0:r[t])}getStrategyActionParams(e,t){var l,n,o;let r=this.getActionAlias(e),{dataSources:i}=(null==(l=this)?void 0:l.meta)||{},a={...this.data,...(0,c.omit)(null==i?void 0:i[t],"snippets")};return(null==a||null==(o=a.strategy)||null==(n=o.actions)?void 0:n.find(e=>{let[t]=e.split(":");return t===r}))?{}:null}parseAction(e){var t;let{resourceName:l,actionName:n,dataSourceKey:o="main",recordPkValue:r,allowedActions:i}=e,a=(null==l?void 0:l.includes("."))&&(null==(t=this.flowEngine.context.dataSourceManager.getDataSource(o).collectionManager.getAssociation(l))?void 0:t.target);return this.getIgnoreScope(e)||this.verifyScope(n,r,i)?this.inResources(a,o)?this.getResourceActionParams(a,n,o):this.inResources(l,o)?this.getResourceActionParams(l,n,o):this.getStrategyActionParams(n,o):null}parseField(e){let{fields:t}=e,l=this.parseAction(e),n=[].concat((null==l?void 0:l.whitelist)||[]).concat((null==l?void 0:l.fields)||[]).concat((null==l?void 0:l.appends)||[]);return!!l&&!Object.keys(l).length||n.includes(t[0])}async aclCheck(e){let{allowAll:t}=this.data;return!!t||(e.fields?this.parseField(e):this.parseAction(e))}constructor(e){this.flowEngine=e,this.data={},this.meta={},this.loaded=!1,this.loadingPromise=null,this.lastToken=null,this.getIgnoreScope=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{recordPkValue:t,allowedActions:l,actionName:n}=e,o=!1;return e.ignoreScope&&(o=!0),"create"===n&&(o=!0),t&&l||(o=!0),o},this.verifyScope=(e,t,l)=>{let n=this.getActionAlias(e),o=null==l?void 0:l[n];return Array.isArray(o)?o.map(e=>String(e)).includes(String(t)):null}}}class b{toString(){return`{{${this.path.join(".")}}}`}valueOf(){return this.toString()}[Symbol.toPrimitive](){return this.toString()}static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["ctx"];return new Proxy(new b(e),{get(t,l,n){if("symbol"==typeof l)return;if(l in t){let e=t[l];return"function"==typeof e?e.bind(t):e}let o=[...e,l.toString()];return b.create(o)}})}constructor(e){this.path=e}}var w=l(76546),S=l(48910);class C{translate(e,t){return!e||"string"!=typeof e||(null==t?void 0:t.compareWith)&&e===t.compareWith?e:this.isTemplate(e)?this.compileTemplate(e):this.translateKey(e,t)}translateKey(e,t){var l,n;if(null==(n=this.context)||null==(l=n.i18n)?void 0:l.t){let l=this.context.i18n.t(e,t);return null==l||""===l?e:l}return e}isTemplate(e){return/\{\{\s*t\s*\(\s*["'`].*?["'`]\s*(?:,\s*.*?)?\s*\)\s*\}\}/g.test(e)}compileTemplate(e){return e.replace(/\{\{\s*t\s*\(\s*["'`](.*?)["'`]\s*(?:,\s*((?:[^{}]|\{[^}]*\})*?))?\s*\)\s*\}\}/g,(e,t,l)=>{try{let n={};if(l&&(l=l.trim()).startsWith("{")&&l.endsWith("}"))try{n=Function("$root",`with($root) { return (${l}); }`)({})}catch(t){return e}return this.translateKey(t,n)}catch(t){return console.warn(`FlowEngine: Failed to compile template "${e}":`,t),e}})}constructor(e){this.context=e}}var F=l(91013),k=l(27667),A=l(60182),P=l(31108),j=l(81982),M=l(22928),I=l(9297),T=l(73398),R=l(37966),E=l(62572),N=l(74353),D=l.n(N),B=l(98192),$=l(47684),O=l(51143);function q(e){try{if(!e||"object"!=typeof e&&"function"!=typeof e)return[];return Object.getOwnPropertyNames(e)}catch(e){return[]}}function _(e,t){if(!e.length)return[];if(!t.length)return[...e];let l=new Set(t),n=[];for(let t of e)l.has(t)||n.push(t);return n}async function L(e){let t,l=globalThis;l.__nocobaseRunjsModuleLoadLock=(l.__nocobaseRunjsModuleLoadLock||Promise.resolve()).catch(()=>{});let n=l.__nocobaseRunjsModuleLoadLock,o=new Promise(e=>{t=e});l.__nocobaseRunjsModuleLoadLock=n.then(()=>o),await n;try{return await e()}finally{null==t||t()}}function V(){let e=globalThis,t=null==e?void 0:e.define,l=null==t?void 0:t.amd;if(!t||!l)return()=>{};let n=Object.getOwnPropertyDescriptor(t,"amd"),o=!!n,r=l;try{(null==n?void 0:n.writable)?t.amd=void 0:(null==n?void 0:n.configurable)?delete t.amd:t.amd=void 0}catch(e){}return()=>{try{if(o&&n)return void Object.defineProperty(t,"amd",n);t.amd=r}catch(e){}}}function z(){var e,t;let l=globalThis,n=null==l||null==(e=l.requirejs)?void 0:e.requirejs,o=null==n||null==(t=n.s)?void 0:t.contexts;if(!o||"object"!=typeof o)return!1;for(let e of Object.keys(o)){let t=o[e],l=null==t?void 0:t.registry;if(l&&"object"==typeof l)for(let e of Object.keys(l)){let t=l[e];if(!t||"object"!=typeof t||!t.enabled||t.error)continue;let n=t.map;if(n&&"object"==typeof n&&!t.inited&&t.fetched&&n.isDefine)return!0}}return!1}async function K(e){let t=Math.max(0,(null==e?void 0:e.timeoutMs)??1500),l=Math.max(10,(null==e?void 0:e.pollMs)??30);if(0===t)return;let n=Date.now();for(;z();){if(Date.now()-n>=t)return;await new Promise(e=>setTimeout(e,l))}}async function U(e,t){let l="string"==typeof e?e.trim():"";if(!l)return;let n=globalThis;n.__nocobaseImportAsyncPrefetchCache=n.__nocobaseImportAsyncPrefetchCache||new Map;let o=n.__nocobaseImportAsyncPrefetchCache;if(o.has(l))return await o.get(l);let r=Math.max(0,(null==t?void 0:t.timeoutMs)??5e3),i=(async()=>{try{var e,t,n;if("u">typeof document&&(null==(e=document)?void 0:e.createElement)){let e=new URL(l,(null==(n=globalThis)||null==(t=n.location)?void 0:t.href)||void 0).toString(),o=document.head||document.getElementsByTagName("head")[0];if(o){let t=`link[rel="modulepreload"][href="${e}"]`;if(!document.querySelector(t)){let t=document.createElement("link");return t.rel="modulepreload",t.href=e,t.crossOrigin="anonymous",await new Promise(e=>{let l=!1,n=()=>{l||(l=!0,t.onload=null,t.onerror=null,e())},i=r>0?setTimeout(()=>{n()},r):void 0;t.onload=()=>{i&&clearTimeout(i),n()},t.onerror=()=>{i&&clearTimeout(i),n()},o.appendChild(t)})}}}}catch(e){}try{if("function"!=typeof fetch)return;let e="function"==typeof AbortController?new AbortController:void 0,t=e&&r>0?setTimeout(()=>{try{e.abort()}catch(e){}},r):void 0,n=await fetch(l,{method:"GET",mode:"cors",credentials:"omit",cache:"force-cache",signal:null==e?void 0:e.signal});if(t&&clearTimeout(t),n&&n.ok&&"function"==typeof n.arrayBuffer)try{await n.arrayBuffer()}catch(e){}}catch(e){}})().catch(()=>{});return o.set(l,i),await i}async function W(e,t){return await L(async()=>{let l,n,o="u">typeof window?q(window):[],r="u">typeof document?q(document):[];try{l=await new Promise((l,n)=>{e?e([t],function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];l(t[0])},n):n(Error("requirejs is not available"))})}catch(e){n=e}finally{let e="u">typeof window?q(window):[],t="u">typeof document?q(document):[],l=_(e,o),n=_(t,r);(0,O.Vm)(l),(0,O.yz)(n)}if(n)throw n;return l})}async function H(e){var t,l;if(!e||"string"!=typeof e)throw Error("invalid url");let n=e.trim(),o=!!(null==(l=globalThis)||null==(t=l.define)?void 0:t.amd);return o&&await U(n),await L(async()=>{await K();let e=o?V():()=>{};try{let e=()=>import(n),t=()=>(0,eval)("u => import(u)")(n);try{return await e()}catch(e){try{return await t()}catch(t){throw t||e}}}finally{e()}})}function G(e){let t=e.indexOf("?"),l=e.indexOf("#"),n=t>=0&&l>=0?Math.min(t,l):t>=0?t:l;return n>=0?e.slice(0,n):e}function Y(e){if(!e||"string"!=typeof e)return null;let t=G(e).trim();if(!t||t.startsWith("http://")||t.startsWith("https://"))return null;let l=t.replace(/^\//,"");if(!l)return null;if(l.startsWith("@")){let e=l.match(/^(@[^/]+\/[^/]+?)(?:@([^/]+))?(?:\/(.*))?$/);return e?{name:e[1],version:e[2],subpath:e[3]}:null}let n=l.match(/^([^/]+?)(?:@([^/]+))?(?:\/(.*))?$/);return n?{name:n[1],version:n[2],subpath:n[3]}:null}function J(e,t){if(!e||"string"!=typeof e)return e;let l=e.trim(),n=l.indexOf("#"),o=n>=0?l.slice(0,n):l,r=n>=0?l.slice(n):"",i=o.indexOf("?"),a=i>=0?o.slice(0,i):o,s=new URLSearchParams(i>=0?o.slice(i+1):"");for(let[e,l]of Object.entries(t))e&&(s.has(e)||s.set(e,l));let d=s.toString();return d?`${a}?${d}${r}`:`${a}${r}`}function X(){let e=globalThis;if("string"==typeof(null==e?void 0:e.__esm_cdn_base_url__))return e.__esm_cdn_base_url__;let t="u">typeof window?window:null==e?void 0:e.window;return"string"==typeof(null==t?void 0:t.__esm_cdn_base_url__)?t.__esm_cdn_base_url__:"https://esm.sh"}function Q(e){if(e&&"object"==typeof e&&"default"in e){let t=Object.keys(e);if(1===t.length&&"default"===t[0])return e.default}return e}async function Z(e,t,l){if(!t||"string"!=typeof t)throw Error("invalid url");let n=t,o=Y(t);if((null==o?void 0:o.name)==="antd"&&!o.subpath&&"string"==typeof X()){let t={bundle:"1"},l=null==e?void 0:e.__runjsExternalReact,o=null==l?void 0:l.version;o&&"string"==typeof o&&(t.deps=`react@${o},react-dom@${o}`),n=J(n,t)}let r=(0,$.i)(n,{addSuffix:(null==l?void 0:l.addSuffix)??!0}),i=(null==l?void 0:l.importer)||H,a=globalThis;a.__nocobaseImportAsyncCache=a.__nocobaseImportAsyncCache||new Map;let s=a.__nocobaseImportAsyncCache,d=s.get(r)||(async()=>Q(await i(r)))();s.set(r,d);let u=await d,c=null==e?void 0:e.libs;if(!c||"object"!=typeof c)return u;let p=Y(n);if(!p)return u;let m=p.subpath||"";if("react"!==p.name||m)"react-dom"===p.name&&("client"===m||m.startsWith("client/"))?((0,B.qf)(e,"ReactDOM",u),e.__runjsExternalReactDOM={specifier:t,version:p.version,url:r}):"antd"!==p.name||m?"@ant-design/icons"!==p.name||m||((0,B.qf)(e,"antdIcons",u,{topLevelKey:!1}),e.__runjsExternalAntdIcons={specifier:t,version:p.version,url:r}):((0,B.qf)(e,"antd",u),e.__runjsExternalAntd={specifier:t,version:p.version,url:r});else{(0,B.qf)(e,"React",u),e.__runjsExternalReact={specifier:t,version:p.version,url:r};let l=p.version?`react-dom@${p.version}/client`:"react-dom/client";try{await e.importAsync(l)}catch(n){let e=Error(`External React has been loaded via ctx.importAsync("${t}"), but auto-loading "${l}" failed.
3219
- Please run: await ctx.importAsync("${l}") to ensure ctx.render uses a matching ReactDOM.`);throw e.cause=n,e}}return u}function ee(e){return e.endsWith("/")?e:`${e}/`}function et(e,t){try{let l=new URL(e);if(!["http:","https:"].includes(l.protocol))return!1;if(!(null==t?void 0:t.getApiUrl))return!0;let n=new URL(t.getApiUrl()),o=ee(n.pathname),r=ee(l.pathname);return l.origin!==n.origin||!r.startsWith(o)}catch{return!1}}function el(e){return!!(e&&"object"==typeof e&&"collection"in e&&"filterByTk"in e)}function en(e,t){if(t&&0!==t.length){if(el(e))return e;if(e&&"object"==typeof e&&!Array.isArray(e)){let l={};for(let[n,o]of Object.entries(e))t.some(e=>e===n||e.startsWith(`${n}.`)||e.startsWith(`${n}[`))&&(l[n]=o);return l}}}function eo(e){if(!e)return;let t=String(e).match(/^([^.[]+)/);return null==t?void 0:t[1]}function er(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(e)||0===e.length)return{generatedAppends:void 0,generatedFields:void 0};let t=new Set,l=new Set,n=e=>{if(!e)return"";let t=String(e);return(t=(t=(t=t.replace(/\[(?:\d+)\]/g,"")).replace(/\[(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)')\]/g,(e,t,l)=>`.${t||l}`)).replace(/\.\.+/g,".")).replace(/^\./,"").replace(/\.$/,"")};for(let o of e){if(!o)continue;for(;/^\[(\d+)\](\.|$)/.test(o);)o=o.replace(/^\[(\d+)\]\.?/,"");let e=n(o);if(!e)continue;let r=e.split(".").filter(Boolean);if(0!==r.length){if(1===r.length){l.add(r[0]);continue}for(let e=0;e<r.length-1;e++)t.add(r.slice(0,e+1).join("."));l.add(r.join("."))}}return{generatedAppends:t.size?Array.from(t):void 0,generatedFields:l.size?Array.from(l):void 0}}var ei=new WeakMap,ea=new WeakSet,es=new WeakSet,ed=new WeakSet,eu=new WeakSet,ec=new WeakSet,ep=new WeakSet,em=new WeakSet,eh=new WeakSet;class ef{createProxy(){return(0,n._)(this,ei)||(0,r._)(this,ei,new Proxy(this,{get:(e,t,l)=>{if("string"==typeof t){if(Reflect.has(e,t)){let n=Reflect.get(e,t,l);return"function"==typeof n?n.bind(e):n}if(Object.prototype.hasOwnProperty.call(e._props,t))return e._getOwnProperty(t,this.createProxy());if(Object.prototype.hasOwnProperty.call(e._methods,t))return e._getOwnMethod(t,this.createProxy());let n=this._findInDelegates(e._delegates,t);return void 0!==n?n.result:void 0}return Reflect.get(e,t,l)},has:(e,t)=>!!("string"==typeof t&&(Reflect.has(e,t)||Object.prototype.hasOwnProperty.call(e._props,t)||Object.prototype.hasOwnProperty.call(e._methods,t)||this._hasInDelegates(e._delegates,t)))||Reflect.has(e,t)})),(0,n._)(this,ei)}defineProperty(e,t){var l;if(this._props[e]&&(null==(l=this._props[e])?void 0:l.once))return;let n=this._props[e];(null==n?void 0:n.meta)&&this._clearMetaNodeCacheFor(n.meta),this._props[e]=t,delete this._observableCache[e],delete this._cache[e],Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:()=>this._getOwnProperty(e,this.createProxy())})}defineMethod(e,t,l){this._methods[e]=t,"string"==typeof l?this._methodInfos[e]={description:l}:l&&"object"==typeof l?this._methodInfos[e]=l:delete this._methodInfos[e],Object.defineProperty(this,e,{configurable:!0,enumerable:!1,writable:!1,value:t.bind(this.createProxy())})}removeCache(e){if(e in this._observableCache)return delete this._observableCache[e],!0;if(e in this._cache)return delete this._cache[e],!0;if(e in this._pending)return delete this._pending[e],!0;for(let t of this._delegates)if(t.removeCache(e))return!0}delegate(e){if(!(e instanceof ef))throw Error("Delegate must be an instance of FlowContext");this._delegates.includes(e)?console.warn(`[FlowContext] delegate - skip duplicate delegate: ${this._delegates.length}`):this._delegates.unshift(e)}addDelegate(e){if(!(e instanceof ef))throw Error("Delegate must be an instance of FlowContext");this._delegates.includes(e)||this._delegates.unshift(e)}clearDelegates(){this._delegates=[],this._metaNodeCache=new WeakMap}removeDelegate(e){if(!(e instanceof ef))throw Error("Delegate must be an instance of FlowContext");let t=this._delegates.indexOf(e);-1!==t&&this._delegates.splice(t,1)}_clearMetaNodeCacheFor(e){this._metaNodeCache.delete(e)}has(e){return!!this._props[e]}getPropertyMetaTree(e,t){let l=this._getPropertiesMeta();if(e){let l=(0,A.YB)(e);if(l&&l.length>0){let e=async(e,t,l)=>{try{let l="function"==typeof e?await e():e;if(!(null==l?void 0:l.properties))return[];let n=l.properties;if("function"==typeof n){let e=await n();l.properties=e,n=e}let o=(0,i._)(this,ea,eg).call(this,n,t,[],l);return Array.isArray(o)?o:await o()}catch(e){return console.warn(`Failed to load meta for ${l}:`,e),[]}},n=(0,i._)(this,es,ev).call(this,l);if(n){let[o,r,a]=n;if(1===l.length){if("function"==typeof r)return()=>e(r,a,o);if(r.properties){if("function"==typeof r.properties)return()=>e(r,a,o);let t=(0,i._)(this,ea,eg).call(this,r.properties,a,[],r);return Array.isArray(t)?t:[]}return[]}if("function"==typeof r){if(null==t?void 0:t.flatten)return()=>e(r,a,o);let l=(0,i._)(this,em,ew).call(this,a);return[(0,i._)(this,eh,eS).call(this,o,r,a,l)]}if(r.properties){let e=[...(0,i._)(this,em,ew).call(this,a),r.title],t=(0,i._)(this,ea,eg).call(this,r.properties,a,e,r);return Array.isArray(t)?t:[]}}return[]}if(null===l)return console.warn(`[FlowContext] getPropertyMetaTree - unsupported value format: "${e}". Only "{{ ctx.propertyName }}" format is supported. Returning empty meta tree.`),[]}return Object.entries(l).sort((e,t)=>{let[,l]=e,[,n]=t,o=("function"==typeof l?l.sort:null==l?void 0:l.sort)??0;return(("function"==typeof n?n.sort:null==n?void 0:n.sort)??0)-o}).map(e=>{let[t,l]=e;return(0,i._)(this,eh,eS).call(this,t,l,[t],[])})}async getApiInfos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version||"v1",l=!!e.includeCompletion,n=this.createProxy(),o=e=>"string"==typeof e&&e.startsWith("_"),r=e=>"record"===e||"formValues"===e||"popup"===e,i=e=>!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then,a=(()=>{var e,l,n,o,r,i,a,s;let d=(0,R.B)(this),u=R.F.resolve(t,d)||R.F.resolve(t,"*");if(!u)return{};let c=(null==(n=this)||null==(l=n.api)||null==(e=l.auth)?void 0:e.locale)||(null==(r=this)||null==(o=r.i18n)?void 0:o.language)||(null==(i=this)?void 0:i.locale);try{if(null==u||null==(a=u.getDoc)?void 0:a.length)return u.getDoc(c)||{};return(null==u||null==(s=u.getDoc)?void 0:s.call(u))||{}}catch(e){return{}}})(),s=e$(null==a?void 0:a.methods)?a.methods:{},d=e$(null==a?void 0:a.properties)?a.properties:{},u=e=>"string"==typeof e?{description:e}:e$(e)?e:void 0,c=(e,t)=>{let l="string"==typeof t?t:e$(t)&&"string"==typeof t.description?String(t.description):void 0;return l&&l.includes(`ctx.libs.${e}`)?`libs.${e}`:e},p=e=>{let t=u(e);if(!t)return{};let n={};for(let e of["description","examples",...l?["completion"]:[],"ref","params","returns"]){let l=t[e];void 0!==l&&(n[e]=l)}return Array.isArray(n.examples)&&(n.examples=n.examples.filter(e=>"string"==typeof e&&e.trim())),n},m=e=>{let t=u(e);if(!t)return{};let n={};for(let e of["title","type","interface","description","examples",...l?["completion"]:[],"ref","params","returns"]){let l=t[e];void 0!==l&&(n[e]=l)}return Array.isArray(n.examples)&&(n.examples=n.examples.filter(e=>"string"==typeof e&&e.trim())),n},h=e=>{let t=new WeakSet,l=n=>{if(!n||"object"!=typeof n||t.has(n))return;if(t.add(n),Object.prototype.hasOwnProperty.call(n._methodInfos||{},e)){var o;return null==(o=n._methodInfos)?void 0:o[e]}let r=n._delegates;if(Array.isArray(r))for(let e of r){let t=l(e);if(t)return t}};return l(this)},f=async e=>{let t=this.getPropertyOptions(e);if(null==t?void 0:t.info)try{let e="function"==typeof t.info?t.info.call(n,n):t.info;return(i(e)?await e:e)??void 0}catch(e){return}},g=new Set,v=new Set;for(let e of Object.keys(d))g.add(e);for(let e of Object.keys(s))v.add(e);let y=(e,t)=>{if(e&&"object"==typeof e&&!t.has(e)){t.add(e);try{let t=e._props;if(t&&"object"==typeof t)for(let[e,l]of Object.entries(t))(null==l?void 0:l.info)&&g.add(e)}catch(e){}try{let t=e._methodInfos;if(t&&"object"==typeof t)for(let e of Object.keys(t))v.add(e)}catch(e){}try{let l=e._delegates;if(Array.isArray(l))for(let e of l)y(e,t)}catch(e){}}};y(this,new WeakSet);let x={};for(let e of g){if(o(e)||r(e))continue;let t=d[e],n=await f(e);if(void 0===t&&void 0===n)continue;let i=u(t),a=u(n),s={};if(s={...s={...s,...m(i)},...m(a)},delete s.properties,l||delete s.completion,!Object.keys(s).length)continue;let p=c(e,t);x[p]=x[p]?{...x[p]||{},...s||{}}:s}for(let e of v){if(o(e))continue;let t=s[e],n=h(e);if(void 0===t&&void 0===n)continue;let r=u(t),i={};i={...i={...i,...p(r)},...p(n)},delete i.properties,l||delete i.completion,Object.keys(i).length&&(i.type="function",x[e]?x[e]={...x[e]||{},...i||{}}:x[e]=i)}let b=u(d.libs),w=e$(null==b?void 0:b.properties)?b.properties:void 0;if(w)for(let[e,t]of Object.entries(w)){if(o(e))continue;let n=`libs.${e}`;if(x[n])continue;let r=u(t),i={};i={...i,...m(r)},delete i.properties,l||delete i.completion,i.description&&String(i.description).trim()&&(x[n]=i)}return x}async getEnvInfos(){var e,t,l;let n=this.createProxy(),o=e=>!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then,r={},i=e=>{try{return e()}catch(e){return}},a=e=>null!=e&&("string"==typeof e?e.trim().length>0:!Array.isArray(e)||e.length>0),s=e=>{var t,l,n,o,r;let i={};if(!e)return i;let s=e;for(let e of["dataSourceKey","collectionName","associationName","filterByTk","sourceId"]){let t=null==s?void 0:s[e];a(t)&&(i[e]=t)}if(!("dataSourceKey"in i)){let e=null==(t=s.getDataSourceKey)?void 0:t.call(s);a(e)&&(i.dataSourceKey=e)}if(!("filterByTk"in i)){let e=null==(l=s.getFilterByTk)?void 0:l.call(s);a(e)&&(i.filterByTk=e)}if(!("filterByTk"in i)){let e=null==(n=s.getMeta)?void 0:n.call(s,"currentFilterByTk");a(e)&&(i.filterByTk=e)}if(!("sourceId"in i)){let e=null==(o=s.getSourceId)?void 0:o.call(s);a(e)&&(i.sourceId=e)}if(!("collectionName"in i)||!("associationName"in i)){let e=null==(r=s.getResourceName)?void 0:r.call(s),t="string"==typeof e?e.trim():"";if(t){let e=t.split(".").map(e=>e.trim()).filter(Boolean);1===e.length?"collectionName"in i||(i.collectionName=e[0]):e.length>=2&&("collectionName"in i||(i.collectionName=e[0]),"associationName"in i||(i.associationName=e.slice(1).join(".")))}}return i},d=await (async()=>{try{let e=n.popup;return o(e)?await e:e}catch(e){return}})(),u=i(()=>n.model),c=i(()=>n.blockModel),p=i(()=>{var e;return null==(e=n.view)?void 0:e.inputArgs}),m=i(()=>n.resource),h=s(null==d?void 0:d.resource),f=c,g=c?"ctx.blockModel":void 0,v=g?`${g}.resource`:void 0,y=s(null==f?void 0:f.resource),x=s(p),b=s(m),w=e=>{for(let t of e)if(a(t.value))return{value:t.value,getVar:t.getVar}},S=e=>a(e.collectionName)||a(e.dataSourceKey)||a(e.associationName),C=S(h)?"ctx.popup.resource":S(y)?v:S(x)?"ctx.view.inputArgs":S(b)?"ctx.resource":void 0,F=w([{value:null==h?void 0:h.collectionName,getVar:"ctx.popup.resource.collectionName"},{value:null==y?void 0:y.collectionName,getVar:`${v}.collectionName`},{value:null==x?void 0:x.collectionName,getVar:"ctx.view.inputArgs.collectionName"},{value:null==b?void 0:b.collectionName,getVar:"ctx.resource.collectionName"}]),k=w([{value:null==h?void 0:h.dataSourceKey,getVar:"ctx.popup.resource.dataSourceKey"},{value:null==y?void 0:y.dataSourceKey,getVar:`${v}.dataSourceKey`},{value:null==x?void 0:x.dataSourceKey,getVar:"ctx.view.inputArgs.dataSourceKey"},{value:null==b?void 0:b.dataSourceKey,getVar:"ctx.resource.dataSourceKey"}]),A=w([{value:null==h?void 0:h.associationName,getVar:"ctx.popup.resource.associationName"},{value:null==y?void 0:y.associationName,getVar:`${v}.associationName`},{value:null==x?void 0:x.associationName,getVar:"ctx.view.inputArgs.associationName"},{value:null==b?void 0:b.associationName,getVar:"ctx.resource.associationName"}]),P=w([{value:null==h?void 0:h.filterByTk,getVar:"ctx.popup.resource.filterByTk"},{value:null==y?void 0:y.filterByTk,getVar:`${v}.filterByTk`},{value:null==x?void 0:x.filterByTk,getVar:"ctx.view.inputArgs.filterByTk"},{value:null==b?void 0:b.filterByTk,getVar:"ctx.resource.filterByTk"}]),j=w([{value:null==h?void 0:h.sourceId,getVar:"ctx.popup.resource.sourceId"},{value:null==y?void 0:y.sourceId,getVar:`${v}.sourceId`},{value:null==x?void 0:x.sourceId,getVar:"ctx.view.inputArgs.sourceId"},{value:null==b?void 0:b.sourceId,getVar:"ctx.resource.sourceId"}]),M={},I=!1,T=null==F?void 0:F.value;a(T)&&(M.collectionName={description:"Collection name",getVar:(null==F?void 0:F.getVar)||(C?`${C}.collectionName`:void 0),value:T},I=!0);let R=null==k?void 0:k.value;a(R)&&(M.dataSourceKey={description:"Data source key",getVar:(null==k?void 0:k.getVar)||(C?`${C}.dataSourceKey`:void 0),value:R},I=!0);let E=null==A?void 0:A.value;a(E)&&(M.associationName={description:"Association name",getVar:(null==A?void 0:A.getVar)||(C?`${C}.associationName`:void 0),value:E},I=!0),I&&(a(null==P?void 0:P.value)&&(M.filterByTk={description:"Record filterByTk",getVar:(null==P?void 0:P.getVar)||(C?`${C}.filterByTk`:void 0)}),a(null==j?void 0:j.value)&&(M.sourceId={description:"Source record ID (sourceId)",getVar:(null==j?void 0:j.getVar)||(C?`${C}.sourceId`:void 0)}),r.resource={description:"Resource information",getVar:C,properties:M}),a(null==P?void 0:P.value)&&(r.record={description:"Current record",getVar:"ctx.record"});let N=e=>{try{let t=null==e?void 0:e.title;if("string"==typeof t&&t.trim())return t}catch(e){}try{var t,l;let n=null==e||null==(l=e.constructor)||null==(t=l.meta)?void 0:t.label;if("string"==typeof n&&n.trim())return n}catch(e){}};if(u){let t=N(u),l=u.uid,n=null==(e=u.constructor)?void 0:e.name,o=s(u.resource),i={},d=!1,c=o.collectionName;a(c)&&(i.collectionName={description:"Collection name",getVar:"ctx.model.resource.collectionName",value:c},d=!0);let p=o.dataSourceKey;a(p)&&(i.dataSourceKey={description:"Data source key",getVar:"ctx.model.resource.dataSourceKey",value:p},d=!0);let m=o.associationName;a(m)&&(i.associationName={description:"Association name",getVar:"ctx.model.resource.associationName",value:m},d=!0),r.flowModel={description:"Current FlowModel information",getVar:"ctx.model",properties:{...a(t)?{label:{description:"Flow model label",value:t}}:{},...a(n)?{modelClass:{description:"Flow model class name",value:n}}:{},...a(l)?{uid:{description:"Flow model uid",getVar:"ctx.model.uid",value:l}}:{},...d?{resource:{description:"Flow model resource",getVar:"ctx.model.resource",properties:i}}:{}}}}if((null==d?void 0:d.uid)&&(r.popup={description:"Current popup information",getVar:"ctx.popup",properties:{uid:{description:"Popup uid",getVar:"ctx.popup.uid",value:d.uid},...(null==d?void 0:d.record)?{record:{description:"Popup record",getVar:"ctx.popup.record"}}:{},...(null==d?void 0:d.sourceRecord)?{sourceRecord:{description:"Popup source record",getVar:"ctx.popup.sourceRecord"}}:{}}}),f){let e=N(f),l=f.uid,n=null==(t=f.constructor)?void 0:t.name,o={},i=!1,s=y.collectionName;a(s)&&(o.collectionName={description:"Collection name",getVar:`${v}.collectionName`,value:s},i=!0);let d=y.dataSourceKey;a(d)&&(o.dataSourceKey={description:"Data source key",getVar:`${v}.dataSourceKey`,value:d},i=!0);let u=y.associationName;a(u)&&(o.associationName={description:"Association name",getVar:`${v}.associationName`,value:u},i=!0),r.block={description:"Current block information",getVar:g,properties:{...a(e)?{label:{description:"Block label",value:e}}:{},...a(n)?{modelClass:{description:"Block model class name",value:n}}:{},...a(l)?{uid:{description:"Block uid",getVar:`${g}.uid`,value:l}}:{},...i?{resource:{description:"Block resource",getVar:v,properties:o}}:{}}}}let D=(()=>{let e=null==d?void 0:d.uid;if(a(e))return String(e).trim();let t=null==p?void 0:p.viewUid;if(a(t))return String(t).trim()})(),B=i(()=>n.engine),$=D?null==B?void 0:B.getModel(D,!0):void 0,O=e=>{var t;return(null==(t=e.context)?void 0:t.blockModel)===e};if($){let e=[$],t=[];for(let n=0;n<e.length;n++){let o=e[n];if(O(o)){let e=(null==(l=o.constructor)?void 0:l.name)||o.uid,n=N(o)||e||o.uid,r=s(o.resource),i={};a(r.dataSourceKey)&&(i.dataSourceKey=r.dataSourceKey),a(r.collectionName)&&(i.collectionName=r.collectionName),a(r.associationName)&&(i.associationName=r.associationName);let d={uid:o.uid,label:n,modelClass:e,...Object.keys(i).length>0?{resource:i}:{}};t.push(d)}let r=o.subModels;if(r&&"object"==typeof r)for(let t of Object.values(r))t&&(Array.isArray(t)?e.push(...t):e.push(t))}t.length&&(r.currentViewBlocks={description:"Current view blocks",value:t})}return r}async getVarInfos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxDepth??3,l=Number.isFinite(t)?Math.max(1,Math.floor(t)):3,n="v1",o=this.createProxy(),r=e=>"string"==typeof e&&e.startsWith("_"),i=e=>!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then,a=new WeakMap,s=async e=>{if(!e)return;if("function"!=typeof e)return e;let t=a.get(e);return t||(t=(async()=>{let t=e.call(o,o);return(i(t)?await t:t)||null})(),a.set(e,t)),await t||void 0},d=e=>{if("string"!=typeof e)return;let t=e.trim();if(!t)return;let l=(0,A.YB)(t);return Array.isArray(l)&&l.length>0?l.join("."):"ctx"===t?"":t.startsWith("ctx.")?t.slice(4).trim():t},u=(()=>{let t=e.path;return("string"==typeof t?[t]:Array.isArray(t)?t:[]).map(e=>d(String(e))).filter(e=>"string"==typeof e&&e.length>0)})(),c=(()=>{let t=e.path;return"string"==typeof t?""===d(t):!!Array.isArray(t)&&t.some(e=>""===d(String(e)))})(),p=(()=>{var e,t,l,o,r,i,a,s;let d=(0,R.B)(this),u=R.F.resolve(n,d)||R.F.resolve(n,"*");if(!u)return{};let c=(null==(l=this)||null==(t=l.api)||null==(e=t.auth)?void 0:e.locale)||(null==(r=this)||null==(o=r.i18n)?void 0:o.language)||(null==(i=this)?void 0:i.locale);try{if(null==u||null==(a=u.getDoc)?void 0:a.length)return u.getDoc(c)||{};return(null==u||null==(s=u.getDoc)?void 0:s.call(u))||{}}catch(e){return{}}})();e$(null==p?void 0:p.methods)&&p.methods,e$(null==p?void 0:p.properties)&&p.properties;let m=e=>"string"==typeof e?{description:e}:e$(e)?e:void 0,h=async(e,t)=>{if(void 0!==e){if("boolean"==typeof e)return e;if("function"==typeof e)try{let l=t(e);return i(l)?!!await l:!!l}catch(e){return!1}return!!e}},f=async(e,t)=>{if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)try{let l=t(e),n=i(l)?await l:l;if("string"==typeof n)return n;return null==n?void 0:String(n)}catch(e){return}return String(e)}},g=async e=>{let t=!1,l=[];try{if("boolean"==typeof e)t=e;else if(Array.isArray(e))l=e;else if("function"==typeof e){let n=e(o),r=i(n)?await n:n;"boolean"==typeof r?t=r:Array.isArray(r)&&(l=r)}}catch(e){t=!1,l=[]}let n=[];if(Array.isArray(l))for(let e of l){if("string"!=typeof e)continue;let t=e.trim();!(!t||"ctx"===t||t.startsWith("ctx."))&&(/\s/.test(t)||n.push(t))}return{hideSelf:!!t,hideSubpaths:n}},v=(e,t)=>{if(!e)return!1;let l=e.split(".").filter(Boolean);for(;l.length;){if(t.has(l.join(".")))return!0;l.pop()}return!1},y=e=>{let t=m(e);if(!t)return{};let l={};for(let e of["title","type","interface","description","examples","completion","ref","params","returns"]){let n=t[e];void 0!==n&&(l[e]=n)}return Array.isArray(l.examples)&&(l.examples=l.examples.filter(e=>"string"==typeof e&&e.trim())),l},x=async e=>{let t,n,{docNode:i,metaNode:a,infoNode:d,depth:u,pathFromRoot:c,hiddenPrefixes:p}=e,b=c.join(".");if(v(b,p))return;let w=m(i),S=m(d),C=await g(null==w?void 0:w.hidden);if(C.hideSelf)return;let F=await g(null==S?void 0:S.hidden);if(F.hideSelf)return;let k=await s(a);if(await h(null==k?void 0:k.hidden,e=>e.call(k,o)))return;let A=new Set(p);for(let e of[...C.hideSubpaths,...F.hideSubpaths]){let t=e.trim();if(!t)continue;let l="ctx"===t?"":t.startsWith("ctx.")?t.slice(4):t;if(!l)continue;let n=b?`${b}.${l}`:l;A.add(n)}let P=await h(null==w?void 0:w.disabled,e=>e(o)),j=await f(null==w?void 0:w.disabledReason,e=>e(o)),M=await h(null==k?void 0:k.disabled,e=>e.call(k,o)),I=await f(null==k?void 0:k.disabledReason,e=>e.call(k,o)),T=await h(null==S?void 0:S.disabled,e=>e(o)),R=await f(null==S?void 0:S.disabledReason,e=>e(o)),E=void 0!==T?T:void 0!==M?M:P,N=void 0!==R?R:void 0!==I?I:j,D={};if(D={...D={...D={...D,...y(w)},...y(k)},...y(S)},void 0!==E&&(D.disabled=!!E),void 0!==N&&(D.disabledReason=N),u>=l)return Object.keys(D).length?D:void 0;let B=e$(null==w?void 0:w.properties)?w.properties:void 0;if(null==k?void 0:k.properties)try{let e=k.properties;if("function"==typeof e){let l=await e.call(k,o);k.properties=l,t=l}else e$(e)&&(t=e)}catch(e){t=void 0}if(e$(S)&&(null==S?void 0:S.properties))try{let e=S.properties;if("function"==typeof e){let t=await e.call(S,o);S.properties=t,n=t}else e$(e)&&(n=e)}catch(e){n=void 0}let $=new Set;if(B)for(let e of Object.keys(B))$.add(e);if(t)for(let e of Object.keys(t))$.add(e);if(n)for(let e of Object.keys(n))$.add(e);if(!$.size)return Object.keys(D).length?D:void 0;let O={};for(let e of $){if(r(e))continue;let l=await x({docNode:null==B?void 0:B[e],metaNode:null==t?void 0:t[e],infoNode:null==n?void 0:n[e],depth:u+1,pathFromRoot:[...c,e],hiddenPrefixes:A});l&&(O[e]=l)}if(Object.keys(O).length&&(D.properties=O),Object.keys(D).length)return D},b=async e=>{if(!e.length)return;let[t,...l]=e,n=this.getPropertyOptions(t);if(null==n?void 0:n.meta)try{if(!l.length)return n.meta;let e=await s(n.meta);if(!e)return;for(let t=0;t<l.length;t++){let n=l[t],r=null==e?void 0:e.properties;if(!r)break;if("function"==typeof r){let t=await r.call(e,o);e.properties=t,r=t}if(!r||"object"!=typeof r)break;let i=null==r?void 0:r[n];if(!i)break;if(t===l.length-1)return i;let a=await s(i);if(!a)break;e=a}return}catch(e){return}};if(!c&&u.length){let e={};for(let t of u){let l=t.split(".").map(e=>e.trim()).filter(Boolean);if(l.some(e=>r(e))||!l.length)continue;let n=await b(l),o=await x({docNode:void 0,metaNode:n,infoNode:void 0,depth:1,pathFromRoot:[],hiddenPrefixes:new Set});o&&(e[t]=o)}return e}let w=this._getPropertiesMeta(),S={};for(let[e,t]of Object.entries(w)){if(r(e))continue;let l=await x({docNode:void 0,metaNode:t,infoNode:void 0,depth:1,pathFromRoot:[e],hiddenPrefixes:new Set});l&&(S[e]=l)}return S}_getPropertiesMeta(){let e={};for(let t of this._delegates)Object.assign(e,t._getPropertiesMeta());for(let[t,l]of Object.entries(this._props))l.meta&&(e[t]=(l.meta,l.meta));return e}_getOwnProperty(e,t){let l=this._props[e];if(l){if("value"in l)return"api"===e?(0,I.k)(l.value,t):l.value;if(l.get){if(!1===l.cache){let n=l.get(t);return"api"===e?(0,I.k)(n,t):n}let n=l.observable?"_observableCache":"_cache";if(e in this[n])return"api"===e?(0,I.k)(this[n][e],t):this[n][e];if(this._pending[e])return this._pending[e];let o=l.get(this.createProxy());return"object"==typeof o&&null!==o&&"function"==typeof o.then||"function"==typeof o&&"function"==typeof o.then?(this._pending[e]=o.then(l=>(this[n][e]=l,delete this._pending[e],"api"===e?(0,I.k)(l,t):l),t=>{throw delete this._pending[e],t}),this._pending[e]):(this[n][e]=o,"api"===e?(0,I.k)(o,t):o)}}}_getOwnMethod(e,t){let l=this._methods[e];return"function"==typeof l?l.bind(t):l}_findPropertyInDelegates(e,t){for(let l of e){if(Object.prototype.hasOwnProperty.call(l._props,t))return l._props[t];let e=this._findPropertyInDelegates(l._delegates,t);if(void 0!==e)return e}}_findInDelegates(e,t){for(let l of e){if(Object.prototype.hasOwnProperty.call(l._props,t))return{result:l._getOwnProperty(t,this.createProxy())};if(Object.prototype.hasOwnProperty.call(l._methods,t))return{result:l._getOwnMethod(t,this.createProxy())};let e=this._findInDelegates(l._delegates,t);if(void 0!==e)return e}}_hasInDelegates(e,t){for(let l of e)if(Object.prototype.hasOwnProperty.call(l._props,t)||Object.prototype.hasOwnProperty.call(l._methods,t)||this._hasInDelegates(l._delegates,t))return!0;return!1}getPropertyOptions(e){return Object.prototype.hasOwnProperty.call(this._props,e)?this._props[e]:this._findPropertyInDelegates(this._delegates,e)}constructor(){return(0,a._)(this,ea),(0,a._)(this,es),(0,a._)(this,ed),(0,a._)(this,eu),(0,a._)(this,ec),(0,a._)(this,ep),(0,a._)(this,em),(0,a._)(this,eh),(0,o._)(this,ei,{writable:!0,value:void 0}),this._props={},this._methods={},this._methodInfos={},this._cache={},this._observableCache=s.observable.shallow({}),this._delegates=[],this._pending={},(0,r._)(this,ei,null),this._metaNodeCache=new WeakMap,this.createProxy()}}function eg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0;return"function"==typeof e?async()=>{let o=await e();n&&(n.properties=o);let r=Object.entries(o);return r.sort((e,t)=>{let[,l]=e,[,n]=t;return((null==n?void 0:n.sort)??0)-((null==l?void 0:l.sort)??0)}),r.map(e=>{let[n,o]=e;return(0,i._)(this,eh,eS).call(this,n,o,[...t,n],l)})}:Object.entries(e).sort((e,t)=>{let[,l]=e,[,n]=t;return((null==n?void 0:n.sort)??0)-((null==l?void 0:l.sort)??0)}).map(e=>{let[n,o]=e;return(0,i._)(this,eh,eS).call(this,n,o,[...t,n],l)})}function ev(e){if(0===e.length)return null;let[t,...l]=e,n=this._props[t];if(null==n?void 0:n.meta)return(0,i._)(this,eu,ex).call(this,t,n.meta,l,[t]);let o=(0,i._)(this,ed,ey).call(this,this._delegates,t);return o?(0,i._)(this,eu,ex).call(this,t,o,l,[t]):null}function ey(e,t){for(let l of e){let e=l._props[t];if(null==e?void 0:e.meta)return e.meta;let n=(0,i._)(this,ed,ey).call(this,l._delegates,t);if(n)return n}return null}function ex(e,t,l,n){if(0===l.length)return[e,t,n];if("function"==typeof t)return[l[l.length-1],async()=>{let e=await t();return await (0,i._)(this,ep,eb).call(this,e,l)},[...n,...l]];if(t.properties){let[e,...o]=l,r=[...n,e];if("function"==typeof t.properties)return[l[l.length-1],async()=>{let l=t.properties,n=await l();t.properties=n;let r=n[e];if(!r)throw Error(`Property ${e} not found in resolved properties`);return await (0,i._)(this,ep,eb).call(this,r,o)},[...n,...l]];let a=t.properties[e];if(a)return(0,i._)(this,eu,ex).call(this,e,a,o,r)}return null}async function eb(e,t){if(0===t.length)return e;let l=e;for(let e of t){let n=p().get(l,"properties");if(!n)throw Error(`Property path not found: ${t.join(".")}`);if("function"==typeof n){let e=await n();l.properties=e,n=e}let o=n[e];if(!o)throw Error(`Property ${e} not found while resolving path: ${t.join(".")}`);l=o}return l}function ew(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(0===e.length)return[];let l=t?e.slice(0,-1):e;if(0===l.length)return[];let n=[],o=this._getPropertiesMeta();for(let e=0;e<l.length;e++){let t=l[e],r=o[t];if(!r||"function"==typeof r){n.push(t);break}if(n.push(r.title||t),e<l.length-1&&r.properties&&"function"!=typeof r.properties)o=r.properties;else if(e<l.length-1){for(let t=e+1;t<l.length;t++)n.push(l[t]);break}}return n}function eS(e,t){let l,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[e],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=this._metaNodeCache.get(t);if(r)return r.paths=n,r.parentTitles=o.length>0?o:void 0,r;let a=e=>{if(!e)return{disabled:!1,hidden:!1};let t="function"==typeof e.disabled?e.disabled():e.disabled,l="function"==typeof e.disabledReason?e.disabledReason():e.disabledReason,n="function"==typeof e.hidden?e.hidden():e.hidden;return{disabled:!(t&&"function"==typeof t.then)&&!!t,reason:l&&"function"==typeof l.then?void 0:l,hidden:!(n&&"function"==typeof n.then)&&!!n}};if("function"==typeof t){let r=e,s=t.hasChildren;l={name:e,title:t.title||r,type:"object",interface:void 0,options:void 0,uiSchema:void 0,paths:n,parentTitles:o.length>0?o:void 0,disabled:()=>{let e=t();return(!e||"function"!=typeof e.then)&&a(e).disabled},disabledReason:()=>{let e=t();if(!e||"function"!=typeof e.then)return a(e).reason},hidden:()=>{let e=t();return(!e||"function"!=typeof e.then)&&a(e).hidden},children:!1===s?void 0:async()=>{try{let r=await t(),a=(null==r?void 0:r.title)||e;if(l.title=a,l.type=null==r?void 0:r.type,l.interface=null==r?void 0:r.interface,l.options=null==r?void 0:r.options,l.uiSchema=null==r?void 0:r.uiSchema,!(null==r?void 0:r.properties))return[];let s=(0,i._)(this,ea,eg).call(this,r.properties,n,[...o,a],r),d=Array.isArray(s)?s:await s();return l.children=d,d}catch(t){return console.warn(`Failed to load meta for ${e}:`,t),[]}}}}else{let r=t.title,{disabled:s,reason:d,hidden:u}=a(t);l={name:e,title:r,type:t.type,interface:t.interface,options:t.options,uiSchema:t.uiSchema,paths:n,parentTitles:o.length>0?o:void 0,disabled:s,disabledReason:d,hidden:u,children:t.properties?(0,i._)(this,ea,eg).call(this,t.properties,n,[...o,r],t):void 0}}return this._metaNodeCache.set(t,l),l}class eC extends ef{constructor(){super(),this.defineMethod("getModel",(e,t)=>this.engine.getModel(e,t)),this.defineMethod("request",function(e){let t=this.app;return"string"==typeof(null==e?void 0:e.url)&&et(e.url,t)?d.A.request(e):this.api.request(e)}),this.defineMethod("runjs",async function(e,t,l){let{preprocessTemplates:n,...o}=l||{},r={...(null==o?void 0:o.globals)||{},...t||{}},i=await this.createJSRunner({...o||{},globals:r}),a=(0,F.R)({version:null==o?void 0:o.version,preprocessTemplates:n}),s=await (0,A.ji)(String(e??""),{preprocessTemplates:a});return i.run(s)},{description:"Execute a RunJS code string in the current Flow context.",detail:"(code: string, variables?: Record<string, any>, options?: JSRunnerOptions) => Promise<RunJSResult>",params:[{name:"code",type:"string",description:"RunJS code to execute."},{name:"variables",type:"Record<string, any>",optional:!0,description:"Additional globals."},{name:"options",type:"JSRunnerOptions",optional:!0,description:"Runner options."}],returns:{type:"Promise<{ success: boolean; value?: any; error?: any; timeout?: boolean }>"},completion:{insertText:"await ctx.runjs('return 1')"}})}}class eF extends eC{}let ek=["dataSourceKey","collectionName","associationName","filterByTk","sourceId","tabUid"];function eA(e,t){let l={};for(let n of t)void 0!==(null==e?void 0:e[n])&&(l[n]=e[n]);return l}function eP(e){return eA(e,ek)}function ej(e,t){for(let[l,n]of Object.entries(t))void 0===e[l]&&(e[l]=n)}class eM extends eC{constructor(e){if(!(e instanceof S.$))throw Error("Invalid FlowEngine instance");super(),this.engine=e,this.engine=e;const t=new w.zA;t.setFlowEngine(this.engine);const n=new w.qS({key:"main",displayName:"Main"});t.addDataSource(n),this.defineProperty("engine",{value:this.engine,info:{description:"FlowEngine instance.",detail:"FlowEngine"}}),this.defineProperty("sql",{get:e=>new k.tP(e),cache:!1,info:{description:"SQL helper (FlowSQLRepository).",detail:"FlowSQLRepository"}}),this.defineProperty("dataSourceManager",{value:t,info:{description:"DataSourceManager instance.",detail:"DataSourceManager"}});const o=new C(this);this.defineMethod("t",(e,t)=>o.translate(e,t)),this.defineProperty("locale",{get:()=>{var e,t,l;return(null==(t=this.api)||null==(e=t.auth)?void 0:e.locale)||(null==(l=this.i18n)?void 0:l.language)},cache:!1,meta:Object.assign(()=>({type:"string",title:this.t("Current language"),sort:970}),{title:(0,A.MI)("Current language"),sort:970,hasChildren:!1})}),this.defineMethod("renderJson",function(e){return this.resolveJsonTemplate(e)}),this.defineMethod("resolveJsonTemplate",async function(e){let t=(0,A.nN)(e),l=Object.keys(t||{});if(!l.length)return(0,A.M)(e,this);let n={};for(let e of l){let l=t[e]||[],o=this.getPropertyOptions(e),r=null==o?void 0:o.resolveOnServer;if(!0===r)n[e]=l;else if("function"==typeof r){let t=l.filter(e=>{try{return!!r(e)}catch(e){return!1}});t.length&&(n[e]=t)}}let o=Object.keys(n).length>0,r=e;if(o){let t=e=>{let t=(0,T.XU)(e);if(t)return t;try{var l,n,o,r,i,a,s,d,u,c,p,m,h;let t=null==e||null==(n=e.resource)||null==(l=n.getMeta)?void 0:l.call(n,"currentFilterByTk");if(null==t)return;let f=(null==e||null==(o=e.collection)?void 0:o.name)||(null==e||null==(c=e.resource)||null==(u=c.getResourceName)||null==(d=u.call(c))||null==(s=d.split)||null==(a=s.call(d,"."))||null==(i=a.slice)||null==(r=i.call(a,-1))?void 0:r[0]);if(!f)return;let g=(null==e||null==(p=e.collection)?void 0:p.dataSourceKey)||(null==e||null==(h=e.resource)||null==(m=h.getDataSourceKey)?void 0:m.call(h));return{collection:f,dataSourceKey:g,filterByTk:t}}catch(e){return}},l=async()=>{let e={};try{var t,l;let o=null==(t=(l=this)._getPropertiesMeta)?void 0:t.call(l);if(!o||"object"!=typeof o)return e;for(let[t,l]of Object.entries(o))if(n[t])try{let o;if("function"==typeof l){let e=l;o=await e()}else o=l;if(!o||"object"!=typeof o)continue;let r=o.buildVariablesParams;if("function"!=typeof r)continue;let i=await r(this);if(!i)continue;let a=n[t]||[],s=en(i,a);s&&("object"!=typeof s||Object.keys(s).length)&&(e[t]=s)}catch(e){}}catch(e){}return e},o=await l(),s={...o};try{let e="formValues",l=n[e]||[];if(l.length){let n=new Set;for(let e of l){let t=eo(e);t&&n.add(t)}let r=null==o?void 0:o[e],i=new Set;if(!r||"object"!=typeof r||Array.isArray(r)||el(r)||Object.keys(r).forEach(e=>i.add(e)),[...n].filter(e=>!i.has(e)).length){let n=t(this);if(n){let{generatedFields:t,generatedAppends:o}=er(l),r={...n,fields:t,appends:o},i=s[e];if(i&&"object"==typeof i&&!Array.isArray(i)&&!el(i)){for(let[t,l]of Object.entries(i))s[`${e}.${t}`]=l;delete s[e]}s[e]=r}}}}catch(e){}let d=Object.keys(s).length?(0,M.d)(this,s):void 0;if(!d){let t=Object.keys(n);if(t.length>0&&t.every(e=>{var t;return null==(t=this.getPropertyOptions(e))?void 0:t.serverOnlyWhenContextParams}))return(0,A.M)(e,this)}if(this.api)try{r=await (0,j.o4)(this,{template:e,contextParams:d||{}})}catch(t){var i,a;null==(a=this.logger)||null==(i=a.warn)||i.call(a,{err:t},"variables:resolve failed, fallback to client-only"),r=e}}return(0,A.M)(r,this)}),this.defineMethod("getVar",async function(e){let t=("string"==typeof e?e:String(e??"")).trim();if(t){if("ctx"!==t&&!t.startsWith("ctx."))throw Error(`ctx.getVar(path) expects an expression starting with "ctx.", got: "${t}"`);return this.resolveJsonTemplate(`{{ ${t} }}`)}},'Resolve a ctx expression value by path (expression starts with "ctx.").'),this.defineProperty("requirejs",{get:()=>{var e,t;return null==(t=this.app)||null==(e=t.requirejs)?void 0:e.requirejs}}),this.defineProperty("token",{get:()=>{var e,t;return null==(t=this.api)||null==(e=t.auth)?void 0:e.token},cache:!1,meta:Object.assign(()=>({type:"string",title:this.t("API Token"),sort:980}),{title:"API Token",sort:980,hasChildren:!1})}),this.defineProperty("role",{get:()=>{var e,t,l;let n=null==(t=this.api)||null==(e=t.auth)?void 0:e.role;if("__union__"!==n)return n;let o=null==(l=this.user)?void 0:l.roles;return Array.isArray(o)?o.map(e=>null==e?void 0:e.name).filter(e=>!!e):[]},cache:!1,meta:Object.assign(()=>({type:"string",title:this.t("Current role"),sort:990}),{title:(0,A.MI)("Current role"),sort:990,hasChildren:!1})}),this.defineProperty("urlSearchParams",{cache:!1,get:()=>{var e;let t=(null==(e=this.location)?void 0:e.search)||"",l=t.startsWith("?")?t.slice(1):t;return h().parse(l)||{}},meta:Object.assign(()=>({type:"object",title:this.t("URL search params"),sort:970,disabled:()=>{var e;let t=(null==(e=this.location)?void 0:e.search)||"",l=t.startsWith("?")?t.slice(1):t;return 0===Object.keys(h().parse(l)||{}).length},disabledReason:()=>this.t("The value of this variable is derived from the query string of the page URL. This variable can only be used normally when the page has a query string."),properties:async()=>{var e;let t=(null==(e=this.location)?void 0:e.search)||"",l=t.startsWith("?")?t.slice(1):t,n=h().parse(l)||{},o={};for(let e of Object.keys(n))o[e]={type:"string",title:e};return o}}),{title:(0,A.MI)("URL search params"),sort:970,hasChildren:!0})}),this.defineProperty("logger",{get:()=>this.engine.logger.child({module:"flow-engine"})}),this.defineProperty("auth",{get:()=>({roleName:this.api.auth.role,locale:this.api.auth.locale,token:this.api.auth.token,user:this.user})}),this.defineProperty("date",{get:()=>{let e=t=>new Proxy({},{get:(l,n)=>{if("string"!=typeof n)return;let o=[...t,n];if(!(0,A.JE)(o))return;let r=(0,A.Vv)(o);return void 0!==r?r:e(o)}});return e(["date"])},cache:!1}),this.defineMethod("loadCSS",async e=>{let t=(0,A.i)(e);return new Promise((e,l)=>{if(document.querySelector(`link[href="${t}"]`))return void e(null);let n=document.createElement("link");n.rel="stylesheet",n.href=t,n.onload=()=>e(null),n.onerror=()=>l(Error(`Failed to load CSS: ${t}`)),document.head.appendChild(n)})},{description:"Load a CSS file by URL (browser only).",params:[{name:"href",type:"string",description:"CSS URL."}],returns:{type:"Promise<void>"},completion:{insertText:"await ctx.loadCSS('https://example.com/style.css')"},examples:["await ctx.loadCSS('https://example.com/style.css');"]}),this.defineMethod("requireAsync",async e=>{if((0,A.yp)(e))return this.loadCSS(e);let t=(0,A.i)(e,{raw:!0});return await W(this.requirejs,t)}),this.defineMethod("importAsync",async function(e){return(0,A.yp)(e)?this.loadCSS(e):await Z(this,e,{importer:H})}),this.defineMethod("createJSRunner",async function(e){try{let e=await Promise.resolve().then(l.bind(l,88828));"function"==typeof(null==e?void 0:e.setupRunJSContexts)&&await e.setupRunJSContexts()}catch(e){}let t=(null==e?void 0:e.version)||"v1",n=(0,R.B)(this),o=R.F.resolve(t,n)||eY,r=new o(this);r.defineMethod("t",(e,t)=>this.t(e,{ns:"runjs",...t}));let i={};try{var a,s,d,u,c,p,m,h;let e=(null==(d=this)||null==(s=d.api)||null==(a=s.auth)?void 0:a.locale)||(null==(c=this)||null==(u=c.i18n)?void 0:u.language)||(null==(p=this)?void 0:p.locale);i=(null==o||null==(m=o.getDoc)?void 0:m.length)?o.getDoc(e)||{}:(null==o||null==(h=o.getDoc)?void 0:h.call(o))||{}}catch(e){i={}}let f={ctx:eK(r,{doc:i}),...(null==e?void 0:e.globals)||{}},{timeoutMs:g}=e||{};return new F.I({globals:f,timeoutMs:g})}),this.defineMethod("buildServerContextParams",function(e){return(0,M.d)(this,e)}),this.defineMethod("getAction",function(e){return this.engine.getAction(e)}),this.defineMethod("getActions",function(){return this.engine.getActions()}),this.defineMethod("getEvents",function(){return this.engine.getEvents()}),this.defineMethod("runAction",async function(e,t){let l=this.engine.getAction(e),n=await (0,E.v)(this,l);if(!l)throw Error(`Action '${e}' not found.`);let o={...await (0,A.gG)(l.defaultParams,n)||{},...t||{}},r=l.useRawParams;if("function"==typeof r&&(r=await r(n)),r||(o=await n.resolveJsonTemplate(o)),!l.handler)throw Error(`Action '${e}' has no handler.`);return l.handler(n,o)}),this.defineProperty("acl",{get:()=>new x(this.engine)}),this.defineMethod("aclCheck",function(e){return!!this.skipAclCheck||this.acl.aclCheck(e)}),this.defineMethod("createResource",function(e){return this.engine.createResource(e,{context:this.createProxy()})}),this.defineMethod("makeResource",function(e){return this.engine.createResource(e,{context:this.createProxy()})}),this.defineMethod("initResource",function(e){return this.has("resource")||this.defineProperty("resource",{get:()=>this.createResource(e)}),this.resource}),this.defineMethod("useResource",function(e){return this.initResource(e)})}}class eI extends eF{constructor(e){if(!e||"object"!=typeof e)throw Error("Invalid FlowModel instance");super(),this.addDelegate(e.flowEngine.context),this.defineMethod("onRefReady",(e,t,l)=>{this.engine.reactView.onRefReady(e,t,l)}),this.defineProperty("model",{value:e,info:{description:"Current FlowModel instance.",detail:"FlowModel"}});const t=(0,f.createRef)();this.defineProperty("ref",{get:()=>(this.model._refCreated=!0,t),info:{description:"Stable React ref for the view container.",detail:"React.RefObject<HTMLDivElement>"}}),this.defineMethod("openView",async function(e,t){var l,n,o,r;let i={..."function"==typeof(null==(l=this.model)?void 0:l.getInputArgs)?eP(this.model.getInputArgs()):{},...eP(this.inputArgs)},a={...t||{}};ej(a,i),(a.defineProperties||a.defineMethods)&&(a.navigation=!1);let s=null;(s=await this.engine.loadModel({uid:e}))||(s=this.engine.createModel({uid:e,use:"PopupActionModel",parentId:this.model.uid,subType:"object",subKey:e,stepParams:{popupSettings:{openView:{...eA(a,["dataSourceKey","collectionName","associationName","mode","size"])}}}}),await s.save()),s.setParent(this.model);let d=(null==a?void 0:a.routeViewUid)??(null==a?void 0:a.viewUid)??((null==(o=s.stepParams)||null==(n=o.popupSettings)?void 0:n.openView)?s.uid:this.model.uid),u=this.view,c={type:(null==a?void 0:a.isMobileLayout)?"embed":(null==a?void 0:a.mode)||"drawer",inputArgs:{...a,viewUid:d,navigation:a.navigation},navigation:null==u?void 0:u.navigation,preventClose:!!(null==a?void 0:a.preventClose),engineCtx:this.engine.context};s.context.defineProperty("view",{value:c});let p=null==(r=s.getFlow)?void 0:r.call(s,"popupSettings"),m=null==p?void 0:p.on,h="click";"string"==typeof m&&m?h=m:m&&"object"==typeof m&&"string"==typeof m.eventName&&m.eventName&&(h=m.eventName),await s.dispatchEvent(h,{...a})}),this.defineMethod("getEvents",function(){return this.model.getEvents()}),this.defineMethod("getAction",function(e){return this.model.getAction(e)}),this.defineMethod("getActions",function(){return this.model.getActions()}),this.defineMethod("runAction",async function(e,t){let l=this.model.getAction(e),n=await (0,E.v)(this,l);if(!l)throw Error(`Action '${e}' not found.`);let o={...await (0,A.gG)(l.defaultParams,n)||{},...t||{}},r=l.useRawParams;if("function"==typeof r&&(r=await r(n)),r||(o=await n.resolveJsonTemplate(o)),!l.handler)throw Error(`Action '${e}' has no handler.`);return l.handler(n,o)})}}class eT extends eF{constructor(e,t){if(!e||"object"!=typeof e)throw Error("Invalid FlowModel instance");super(),this.master=e,this.fork=t,this.addDelegate(this.master.context),this.defineMethod("onRefReady",(e,t,l)=>{this.engine.reactView.onRefReady(e,t,l)}),this.defineProperty("model",{get:()=>this.fork,info:{description:"Current ForkFlowModel instance (as model).",detail:"ForkFlowModel"}});const l=(0,f.createRef)();this.defineProperty("ref",{get:()=>(this.fork._refCreated=!0,l),info:{description:"Stable React ref for the view container.",detail:"React.RefObject<HTMLDivElement>"}})}}class eR extends eF{_getOwnProperty(e){if("runtime"===this.mode)return super._getOwnProperty(e,this.createProxy());let t=this._props[e];if(t){if("value"in t)return b.create()[e];if(t.get){if(!1===t.cache)return b.create()[e];let l=t.observable?"_observableCache":"_cache";return e in this[l]||(this[l][e]=b.create()[e]),this[l][e]}}}exit(){throw new P.zz(this.flowKey,this.model.uid)}exitAll(){throw new P.zz(this.flowKey,this.model.uid)}get mode(){return this._mode}constructor(e,t,l="runtime"){super(),this.model=e,this.flowKey=t,this._mode=l,this.stepResults={},this.addDelegate(this.model.context),this.defineMethod("getStepParams",l=>e.getStepParams(t,l)||{}),this.defineMethod("setStepParams",(l,n)=>e.setStepParams(t,l,n)),this.defineMethod("getStepResults",e=>p().get(this.steps,[e,"result"])),this.defineMethod("initResource",t=>{e.context.has("resource")?console.log(`[FlowRuntimeContext] useResource - resource already defined in context: ${t}`):(e.context.defineProperty("resource",{get:()=>this.makeResource(t)}),e.resource||(e.resource=e.context.resource))}),this.defineMethod("useResource",e=>this.initResource(e)),this.defineProperty("resource",{get:()=>e.resource||e.context.resource,cache:!1}),this.defineMethod("onRefReady",(e,t,l)=>{this.engine.reactView.onRefReady(e,t,l)})}}let eE=new WeakMap,eN=new WeakMap,eD=new WeakMap;function eB(e,t){if(null===t)return;if(Array.isArray(e)||Array.isArray(t)||"object"!=typeof e||"object"!=typeof t)return t??e;let l={...e};for(let n of Object.keys(t)){let o=eB(null==e?void 0:e[n],t[n]);void 0===o?delete l[n]:l[n]=o}return l}function e$(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function eO(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}function eq(e){return!0===e||(e&&e$(e)?e:void 0)}function e_(e,t,l){if(!Array.isArray(t)||!t.length)return;let n=e;for(let e of t){if(!e)return;n.children=n.children||{},n.children[e]=n.children[e]||{},n=n.children[e]}n.deprecated=l}function eL(e,t){void 0!==t.deprecated&&(e.deprecated=t.deprecated);let l=t.children||{},n=Object.keys(l);if(n.length)for(let t of(e.children=e.children||{},n))e.children[t]=e.children[t]||{},eL(e.children[t],l[t])}function eV(e){let t={};if(!e)return t;let l=(e,n)=>{if(e$(e))for(let[o,r]of Object.entries(e)){if(!o||!r||"object"!=typeof r||Array.isArray(r))continue;let e=r,i=eq(e.deprecated);i&&e_(t,[...n,o],i),e$(e.properties)&&l(e.properties,[...n,o])}},n=e=>{if(e$(e))for(let[l,n]of Object.entries(e)){if(!l||!n||"object"!=typeof n||Array.isArray(n))continue;let e=eq(n.deprecated);e&&e_(t,[l],e)}};return l(e.properties,[]),n(e.methods),t}function ez(e){let t={},l=new WeakSet,n=(e,l)=>{if(e$(l))for(let[o,r]of Object.entries(l)){if(!o||"string"==typeof r||!r||"object"!=typeof r||Array.isArray(r))continue;let l=r,i=eq(l.deprecated);i&&e_(t,[...e,o],i),e$(l.properties)&&n([...e,o],l.properties)}},o=e=>{if(!e||"object"!=typeof e&&"function"!=typeof e||l.has(e))return;l.add(e);let r=e._methodInfos;if(e$(r))for(let[e,l]of Object.entries(r)){if(!e||!l||"object"!=typeof l||Array.isArray(l))continue;let n=eq(l.deprecated);n&&e_(t,[e],n)}let i=e._props;if(e$(i))for(let[e,l]of Object.entries(i)){if(!e)continue;let o=null==l?void 0:l.info;if(!o||"object"!=typeof o||Array.isArray(o))continue;let r=eq(o.deprecated);r&&e_(t,[e],r),e$(o.properties)&&n([e],o.properties)}let a=e._delegates;if(Array.isArray(a))for(let e of a)o(e)};return o(e),t}function eK(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=eV(t.doc);eL(l,ez(e));let n=new Set,o=new WeakMap,r=new WeakMap,i=new WeakMap,a=e=>{if(!e||"string"!=typeof e)return{};let t=2;for(let l of e.split("\n")){if(!l)continue;let e=l.match(/<anonymous>:(\d+):(\d+)/);if(!e)continue;let n=Number(e[1]),o=Number(e[2]);return{line:Number.isFinite(n)&&n>t?n-t:n,column:Number.isFinite(o)?o:void 0,rawLine:n,rawColumn:o}}return{}},s=(e,t)=>{if(e$(t))for(let[n,o]of Object.entries(t)){if(!n||"string"==typeof o||!o||"object"!=typeof o||Array.isArray(o))continue;let t=o,r=eq(t.deprecated);r&&e_(l,[...e,n],r),e$(t.properties)&&s([...e,n],t.properties)}},d=(e,t)=>{if(!e)return;let n=null==t?void 0:t.info;if(!n||"object"!=typeof n||Array.isArray(n))return;let o=eq(n.deprecated);o&&e_(l,[e],o),e$(n.properties)&&s([e],n.properties)},u=(e,t)=>{if(!e||!t||"object"!=typeof t||Array.isArray(t))return;let n=eq(t.deprecated);n&&e_(l,[e],n)},c=e=>{let t=e;for(;t&&("object"==typeof t||"function"==typeof t);){let e=o.get(t);if(!e)break;t=e}return t},p=e=>{if(e){if("string"==typeof e)return e.trim()||void 0;if(Array.isArray(e)){let t=e.map(e=>"string"==typeof e?e.trim():"").filter(Boolean);return t.length?t.join(", "):void 0}}},m=(t,l,o)=>{if(!t||n.has(t))return;n.add(t);let r=null==e?void 0:e.logger,i="function"==typeof(null==e?void 0:e.t)?(t,l)=>e.t(t,{ns:[A.u4,"client"],nsMode:"fallback",...l}):(e,t)=>{let l=(null==t?void 0:t.defaultValue)??e;return"string"==typeof l&&t?l.replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g,(e,l)=>{let n=null==t?void 0:t[l];return"string"==typeof n||"number"==typeof n?String(n):""}):l},s="object"==typeof l&&l?l:{},d=p(s.replacedBy),u="string"==typeof s.since?String(s.since):void 0,c="string"==typeof s.removedIn?String(s.removedIn):void 0,m="string"==typeof s.message?String(s.message):"",h=a(o),f=h.line?`(line ${h.line}${h.column?`:${h.column}`:""})`:"",g=m.trim(),v=g?i("RunJS deprecated warning with message",{defaultValue:"[RunJS][Deprecated] {{api}} {{message}}{{location}}",api:t,message:g,location:f}):i("RunJS deprecated warning",{defaultValue:"[RunJS][Deprecated] {{api}} is deprecated{{location}}",api:t,location:f}),y=i("RunJS deprecated separator",{defaultValue:"; "}),x=[v];d&&x.push(i("RunJS deprecated replacedBy",{defaultValue:"Use {{replacedBy}} instead",replacedBy:d})),u&&x.push(i("RunJS deprecated since",{defaultValue:"since {{since}}",since:u})),c&&x.push(i("RunJS deprecated removedIn",{defaultValue:"will be removed in {{removedIn}}",removedIn:c}));let b=x.filter(Boolean).join(y);try{r&&"function"==typeof r.warn?r.warn(b):console.warn(b)}catch(e){}},h=(e,t,l)=>{let o=t.deprecated;if(!o)return e;let r=i.get(e)||new Map;if(i.set(e,r),r.has(l))return r.get(l);let a=new Proxy(e,{apply(e,t,r){let i=n.has(l)?void 0:Error().stack;return m(l,o,i),Reflect.apply(e,c(t),r)},get:(e,t,l)=>Reflect.get(e,t,l)});return r.set(l,a),a},f=(e,t,l)=>{if(!e||"object"!=typeof e&&"function"!=typeof e||eO(e)||!(t.children&&Object.keys(t.children).length>0)&&"ctx"!==l)return e;let i=r.get(e)||new Map;if(r.set(e,i),i.has(l))return i.get(l);let a=new Proxy(e,{get(e,o,r){var i;if("symbol"==typeof o)return Reflect.get(e,o,c(r));let a=String(o),s=Reflect.get(e,o,c(r));if("ctx"===l&&"defineProperty"===a&&"function"==typeof s)return function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];let n=s(...t);try{d(String((null==t?void 0:t[0])??""),null==t?void 0:t[1])}catch(e){}return n};if("ctx"===l&&"defineMethod"===a&&"function"==typeof s)return function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];let n=s(...t);try{u(String((null==t?void 0:t[0])??""),null==t?void 0:t[2])}catch(e){}return n};let p=null==(i=t.children)?void 0:i[a];if(!p)return s;let g=`${l}.${a}`;if("function"==typeof s&&p.deprecated)return h(s,p,g);if(p.deprecated){let e=n.has(g)?void 0:Error().stack;m(g,p.deprecated,e)}return s&&("object"==typeof s||"function"==typeof s)&&p.children?f(s,p,g):s},has:(e,t)=>Reflect.has(e,t)});return o.set(a,e),i.set(l,a),a};return f(e,l,"ctx")}function eU(e,t,l){if(!e$(t))return e;if(!e$(e))return t;let n={...e};for(let o of Object.keys(t)){let r=t[o];if(null===r){delete n[o];continue}let i=l(e$(e)?e[o]:void 0,r);void 0===i?delete n[o]:n[o]=i}return n}function eW(e,t){if(null===t)return;let l=e$(e),n=e$(t),o="string"==typeof e;if("string"==typeof t)return l?eW(e,{description:t}):t;if(n){let n=l?e:o?{description:e}:void 0,r={...n||{}};for(let e of Object.keys(t)){if("properties"===e){let e=t.properties;if(null===e){delete r.properties;continue}let l=eU(null==n?void 0:n.properties,e,eW);void 0===l?delete r.properties:r.properties=l;continue}let l=eB(null==n?void 0:n[e],t[e]);void 0===l?delete r[e]:r[e]=l}return r}return t??e}function eH(e,t){if(null===t)return;let l=e$(e),n=e$(t),o="string"==typeof e;if("string"==typeof t)return l?eH(e,{description:t}):t;if(n){let n=l?e:o?{description:e}:void 0,r={...n||{}};for(let e of Object.keys(t)){let l=eB(null==n?void 0:n[e],t[e]);void 0===l?delete r[e]:r[e]=l}return r}return t??e}function eG(e,t){let l=e$(e)?e:{},n=e$(t)?t:{},o={...l};for(let e of Object.keys(n)){if("properties"===e){let e=eU(l.properties,n.properties,eW);void 0===e?delete o.properties:o.properties=e;continue}if("methods"===e){let e=eU(l.methods,n.methods,eH);void 0===e?delete o.methods:o.methods=e;continue}let t=eB(l[e],n[e]);void 0===t?delete o[e]:o[e]=t}return o}class eY extends ef{exit(){var e;throw new P.zz(this.flowKey,(null==(e=this.model)?void 0:e.uid)||"runjs")}exitAll(){var e;throw new P.zz(this.flowKey,(null==(e=this.model)?void 0:e.uid)||"runjs")}static define(e,t){let l=null==t?void 0:t.locale;if(l){let t=eN.get(this)||new Map,n=t.get(l)||{};t.set(l,eG(n,e)),eN.set(this,t)}else{let t=eE.get(this)||{};eE.set(this,eG(t,e))}eD.delete(this)}static getDoc(e){let t=this,l=eD.get(t),n=String(e||"default");if(l&&l.has(n))return l.get(n);let o=[],r=t;for(;r&&r.prototype;)o.unshift(r),r=Object.getPrototypeOf(r);let i={};for(let e of o)i=eG(i,eE.get(e)||{});if(e)for(let t of o){let l=eN.get(t);l&&l.has(e)&&(i=eG(i,l.get(e)))}return l||(l=new Map,eD.set(t,l)),l.set(n,i),i}constructor(e){super(),this.addDelegate(e),this.defineProperty("React",{value:f}),this.defineProperty("antd",{value:u}),this.defineProperty("dayjs",{value:D()});const t={...v,createRoot:(e,t)=>{let l=(null==e?void 0:e.__el)||e;return this.engine.reactView.createRoot(l,t)}};t.__nbRunjsInternalShim=!0,this.defineProperty("ReactDOM",{value:t}),(0,B.oJ)(this),this.defineMethod("openView",async function(t,l){let n=e.openView;if("function"!=typeof n)throw Error("ctx.openView is not available in current context.");let o=(0,A.cg)(l);return n(t,o?{...l||{},[A.sU]:o}:l)}),this.defineMethod("render",function(e,t){let l=t||this.element;if(!l)throw Error("ctx.render: container not provided and ctx.element is not available");let n=(null==l?void 0:l.__el)||l,o=globalThis;o.__nbRunjsRoots=o.__nbRunjsRoots||new WeakMap;let r=o.__nbRunjsRoots,i=e=>{if(!e)return;if(e.disposeTheme&&"function"==typeof e.disposeTheme){try{e.disposeTheme()}catch(e){}e.disposeTheme=void 0}let t=e.root||e;if(t&&"function"==typeof t.unmount)try{t.unmount()}catch(e){}},a=()=>{let e=r.get(n);e&&(i(e),r.delete(n))};if("string"==typeof e)return a(),new y.x(n).innerHTML=String(e??""),null;if(e&&e.nodeType&&(1===e.nodeType||3===e.nodeType||11===e.nodeType)){for(a();n.firstChild;)n.removeChild(n.firstChild);return n.appendChild(e),null}let s=this.ReactDOM,d=this,c=r.get(n);return c&&c.rendererKey===s&&c.ownerKey===d||(c&&(i(c),r.delete(n)),c={rendererKey:s,ownerKey:d,root:this.ReactDOM.createRoot(n),disposeTheme:void 0,lastVnode:void 0},r.set(n,c)),(0,B.$B)({ctx:this,entry:c,vnode:e,containerEl:n,rootMap:r,unmountContainerRoot:a,internalReact:f,internalAntd:u})})}}},48910(e,t,l){"use strict";l.d(t,{$:()=>eN});var n=l(88243),o=l(16213),r=l(95243),i=l(2543),a=l.n(i),s=l(81318),d=l.n(s),u=l(64171);class c extends u.Z{getAction(e){return this.actions.get(e)}getActions(){return new Map(this.actions)}}var p=l(26955);class m extends p.L{getEvent(e){return this.events.get(e)}getEvents(){return new Map(this.events)}}var h=l(29007),f=l(60182),g=l(31108),v=l(88439),y=l(62572);class x{async emitModelEventIf(e,t,l){e&&await this.engine.emitter.emitAsync(`model:event:${e}:${t}`,l)}async withApplyFlowCache(e,t){if(!e||!this.engine)return await t();let l=this.engine.applyFlowCache.get(e);if(l){if("resolved"===l.status)return l.data;if("rejected"===l.status)throw l.error;if("pending"===l.status)return await l.promise}let n=t().then(t=>(this.engine.applyFlowCache.set(e,{status:"resolved",data:t,promise:Promise.resolve(t)}),t)).catch(t=>{throw this.engine.applyFlowCache.set(e,{status:"rejected",error:t,promise:Promise.reject(t)}),t});return this.engine.applyFlowCache.set(e,{status:"pending",promise:n}),await n}async runFlow(e,t,l,n,o){var r;let i,s=e.getFlow(t);if(!s)return e.context.logger.error(`BaseModel.applyFlow: Flow with key '${t}' not found.`),Promise.reject(Error(`Flow '${t}' not found.`));let d=new h.W5(e,t);d.defineProperty("reactView",{value:e.reactView}),d.defineProperty("inputArgs",{value:{...l}}),d.defineProperty("runId",{value:n||`run-${Date.now()}`});let u=d.stepResults,c=e.getEvent("string"==typeof s.on?s.on:null==(r=s.on)?void 0:r.eventName);c&&((c={...c}).defaultParams={...a().get(s,"on.defaultParams",{}),...c.defaultParams});let p=c?{eventStep:c,...s.steps}:s.steps;(0,v.w)(d,p,e,t);let m=d.steps,x={uid:e.uid,model:e,runId:d.runId,inputArgs:l,flowKey:t};for(let[l,n]of(await this.emitModelEventIf(o,`flow:${t}:start`,x),Object.entries(p))){let r,a,s={},c=n.useRawParams;if(n.use){let o=e.getAction(n.use);if(!o){d.logger.error(`BaseModel.applyFlow: Action '${n.use}' not found for step '${l}' in flow '${t}'. Skipping.`);continue}a=await (0,y.v)(d,{...o,...n}),r=n.handler||o.handler,c=c??o.useRawParams;let i=await (0,f.gG)(o.defaultParams,a),u=await (0,f.gG)(n.defaultParams,a);s={...i,...u}}else{if(!n.handler)continue;a=await (0,y.v)(d,n),r=n.handler,s={...await (0,f.gG)(n.defaultParams,a)}}let p=e.getStepParams(t,l);void 0!==p&&(s={...s,...p}),"function"==typeof c&&(c=await c(a)),c||(s=await a.resolveJsonTemplate(s));try{if(!r){d.logger.error(`BaseModel.applyFlow: No handler available for step '${l}' in flow '${t}'. Skipping.`);continue}await this.emitModelEventIf(o,`flow:${t}:step:${l}:start`,{...x,stepKey:l});let e=r(a,s);i=!1!==n.isAwait?await e:e,u[l]=i,m[l].result=u[l],await this.emitModelEventIf(o,`flow:${t}:step:${l}:end`,{...x,result:i,stepKey:l})}catch(e){if(e instanceof f.sy||e instanceof g.zz||await this.emitModelEventIf(o,`flow:${t}:step:${l}:error`,{...x,error:e,stepKey:l}),e instanceof f.sy)return d.logger.info(`[FlowEngine] ${e.message}`),await this.emitModelEventIf(o,`flow:${t}:step:${l}:end`,{...x,stepKey:l}),await this.emitModelEventIf(o,`flow:${t}:end`,{...x,result:u}),Promise.resolve(u);if(e instanceof g.zz)return d.logger.info(`[FlowEngine] ${e.message}`),await this.emitModelEventIf(o,`flow:${t}:step:${l}:end`,{...x,stepKey:l,aborted:!0}),await this.emitModelEventIf(o,`flow:${t}:end`,{...x,result:e,aborted:!0}),Promise.resolve(e);return await this.emitModelEventIf(o,`flow:${t}:error`,{...x,error:e}),d.logger.error({err:e},`BaseModel.applyFlow: Error executing step '${l}' in flow '${t}':`),Promise.reject(e)}}return await this.emitModelEventIf(o,`flow:${t}:end`,{...x,result:u}),Promise.resolve(u)}async dispatchEvent(e,t,l,n){var o,r,i,a;let s="beforeRender"===t,d=!!(null==n?void 0:n.sequential),u=!!(null==n?void 0:n.useCache),c=s,p=`${e.uid}-${t}-${Date.now()}`,m=e.context.logger,h={uid:e.uid,model:e,runId:p,inputArgs:l};try{await this.emitModelEventIf(t,"start",h),await (null==(o=e.onDispatchEventStart)?void 0:o.call(e,t,n,l))}catch(o){if(s&&o instanceof f.sy)return m.debug(`[FlowModel.dispatchEvent] ${o.message}`),[];try{await (null==(r=e.onDispatchEventError)?void 0:r.call(e,t,n,l,o))}finally{m.error({err:o},`BaseModel.dispatchEvent: Start hook error for event '${t}'`)}if(c)throw o;return}let v=s?e.getEventFlows("beforeRender"):Array.from(e.getFlows().values()).filter(e=>{let l=e.on;return!!l&&("string"==typeof l?l===t:"object"==typeof l&&l.eventName===t)}),y="click"===t&&(null==l?void 0:l.triggerByRouter)===!0?v.filter(e=>{var t;let l=e.flowRegistry;return"instance"!==(null==l||null==(t=l.constructor)?void 0:t._type)}):v,x=[],b=async()=>{let n=!1;if(d){let o=y.map((e,t)=>({f:e,i:t})).slice().sort((e,t)=>{var l,n;let o=e.f.flowRegistry,r=t.f.flowRegistry,i=null==o||null==(l=o.constructor)?void 0:l._type,a=null==r||null==(n=r.constructor)?void 0:n._type,s=+("instance"!==i),d=+("instance"!==a);if(s!==d)return s-d;let u=e.f.sort??0,c=t.f.sort??0;return u!==c?u-c:e.i-t.i}).map(e=>e.f),r=[],i=new Map(o.filter(e=>{var t;let l=e.flowRegistry;return"instance"!==(null==l||null==(t=l.constructor)?void 0:t._type)}).map(e=>[e.key,e])),a=new Set,s=new Map;for(let[n,d]of(o.forEach((e,l)=>{let n=e.on,o="object"==typeof n?n:void 0;if(!o)return;let r=o.phase,d=o.flowKey,u=o.stepKey;if(!r||"beforeAllFlows"===r)return;let c=null;if("afterAllFlows"===r)c=`event:${t}:end`;else if("beforeFlow"===r||"afterFlow"===r)if(d)if(i.get(String(d))){let e="beforeFlow"===r?"start":"end";c=`event:${t}:flow:${String(d)}:${e}`}else c=`event:${t}:end`;else c=`event:${t}:end`;else if("beforeStep"!==r&&"afterStep"!==r)return;else if(d&&u){var p;let e=i.get(String(d)),l=!!(null==e||null==(p=e.hasStep)?void 0:p.call(e,String(u)));if(e&&l){let e="beforeStep"===r?"start":"end";c=`event:${t}:flow:${String(d)}:step:${String(u)}:${e}`}else c=`event:${t}:end`}else c=`event:${t}:end`;if(!c)return;let m=c===`event:${t}:end`||"afterFlow"===r||"afterStep"===r;a.add(e.key);let h=s.get(c)||[];h.push({flow:e,order:l,shouldSkipOnAborted:m}),s.set(c,h)}),s.entries()))for(let o of d.slice().sort((e,t)=>{let l=e.flow.sort??0,n=t.flow.sort??0;return l!==n?l-n:e.order-t.order})){let i=o.shouldSkipOnAborted?Object.assign(e=>e.type===n&&!0!==e.aborted,{__eventType:n}):n,a=e.scheduleModelOperation(e.uid,async e=>{let n=await this.runFlow(e,o.flow.key,l,p,t);if(n instanceof g.zz)throw n;r.push(n)},{when:i});x.push(a)}for(let i of o)if(!a.has(i.key))try{m.debug(`BaseModel '${e.uid}' dispatching event '${t}' to flow '${i.key}' (sequential).`);let o=await this.runFlow(e,i.key,l,p,t);if(o instanceof g.zz){m.debug(`[FlowEngine.dispatchEvent] ${o.message}`),n=!0;break}r.push(o)}catch(e){if(e instanceof g.zz){m.debug(`[FlowEngine.dispatchEvent] ${e.message}`),n=!0;break}throw m.error({err:e},`BaseModel.dispatchEvent: Error executing event-triggered flow '${i.key}' for event '${t}' (sequential):`),e}return{result:r,abortedByExitAll:n}}let o=(await Promise.all(y.map(async n=>{m.debug(`BaseModel '${e.uid}' dispatching event '${t}' to flow '${n.key}'.`);try{return await this.runFlow(e,n.key,l,p,t)}catch(e){if(m.error({err:e},`BaseModel.dispatchEvent: Error executing event-triggered flow '${n.key}' for event '${t}':`),c)throw e;return}}))).filter(e=>void 0!==e);return o.some(e=>e instanceof g.zz)&&(n=!0),{result:o,abortedByExitAll:n}},w=u?JSON.stringify(l??{}):"",S=u?eN.generateApplyFlowCacheKey(`event:${e.getFlowCacheScope(t)}:${w}`,t,e.uid):null;try{let{result:o,abortedByExitAll:r}=await this.withApplyFlowCache(S,b);try{await (null==(i=e.onDispatchEventEnd)?void 0:i.call(e,t,n,l,o))}catch(e){m.error({err:e},`BaseModel.dispatchEvent: End hook error for event '${t}'`)}return await this.emitModelEventIf(t,"end",{...h,result:o,...r?{aborted:!0}:{}}),o&&"object"==typeof o&&Object.defineProperty(o,"__abortedByExitAll",{value:r,configurable:!0}),o}catch(o){try{await (null==(a=e.onDispatchEventError)?void 0:a.call(e,t,n,l,o))}catch(e){}if(e.context.logger.error({err:o},`BaseModel.dispatchEvent: Error executing event '${t}' for model '${e.uid}':`),await this.emitModelEventIf(t,"error",{...h,error:o}),c)throw o}finally{for(let e of x)e()}}constructor(e){this.engine=e}}var b=l(58587),w=l(18150),S=l(68238),C=l(67838),F=l(18220),k=l(47674),A=l(21637),P=l(71021),j=l(84626),M=l(96540),I=l(74848),T=l(53619),R=l(92034),E=l(98393),N=l(22803),D=l(42443),B=l(88040),$=l(35710),O=l(18182),q=l(76511),_=l(33954),L=l(57084),V=l(94313),z=l(20616),K=l(52847);let U={marginLeft:32},W=(0,K.PA)(e=>{let{title:t,onChange:l,getDefaultValue:n,disabled:o,itemKey:r,...i}=e,[a,s]=(0,M.useState)(!1),d=(0,z.Db)();(0,M.useEffect)(()=>{let e=!1;return(async()=>{if(n)try{let t=await n();if(e||!t)return;let l=Object.entries(t);if(!l.length)return;let[o,r]=l[0];s(!!r)}catch(e){console.error(e)}})(),()=>{e=!0}},[n]);let u=e=>{s(e),null==l||l({[r]:e})},c=e=>{e.stopPropagation(),o||u(!a)};return(0,I.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between",cursor:o?"not-allowed":"pointer"},onClick:c,children:[t,(0,I.jsx)(V.A,{size:"small",...i,checkedChildren:i.checkedChildren?d.t(i.checkedChildren):void 0,unCheckedChildren:i.unCheckedChildren?d.t(i.unCheckedChildren):void 0,checked:a,style:U,disabled:o})]})});var H=l(36492);let G=(e,t)=>{for(let n of e){var l;if(String((null==n?void 0:n.key)??"")===t)return n;if(null==(l=n.children)?void 0:l.length){let e=G(n.children,t);if(e)return e}}},Y=(e,t,l)=>{let n=t.maxDepth,o="number"==typeof t.arrayLimit?t.arrayLimit:1/0,r=t.mode??"stack",i=new Set,a=new Set,s=(e,t,d)=>{if(!e||t>n)return;let u=()=>{l(e,{depth:t,modelKey:d}),t>=n||Object.entries(e.subModels||{}).forEach(e=>{let[l,n]=e;if(Array.isArray(n)){let e=Number.isFinite(o)?Math.min(n.length,o):n.length;for(let o=0;o<e;o++){let e=n[o];e instanceof _.WD&&s(e,t+1,`${l}[${o}]`)}return}n instanceof _.WD&&s(n,t+1,l)})};if("visited"===r){if(i.has(e))return;i.add(e),u();return}let c=e.uid||`temp-${Date.now()}`;if(!a.has(c)){a.add(c);try{u()}finally{a.delete(c)}}};s(e,1)},J=(e,t)=>{var l;if(!e||!t||"string"!=typeof t)return console.warn("Invalid input parameters"),null;let n=t.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\[(\d+)\])?$/);if(!n)return console.warn(`Invalid subModelKey format: ${t}`),null;let[,o,r]=n,i=null==(l=e.subModels)?void 0:l[o];if(!i)return console.warn(`SubModel '${o}' not found`),null;if(void 0!==r){let e=parseInt(r,10);return Array.isArray(i)?e<0||e>=i.length?(console.warn(`Array index ${e} out of bounds for '${o}'`),null):i[e]instanceof _.WD?i[e]:null:(console.warn(`Expected array for '${o}', got ${typeof i}`),null)}return Array.isArray(i)?(console.warn(`Expected object for '${o}', got array`),null):i instanceof _.WD?i:null},X={switch:W,select:function(e){let{title:t,getDefaultValue:l,onChange:n,options:o,fieldNames:r,itemKey:i,tooltip:a,...s}=e,[d,u]=(0,M.useState)(!1),[c,p]=(0,M.useState)(""),m=(0,z.Db)();(0,M.useEffect)(()=>{let e=!1;return(async()=>{if(l)try{let t=await l();if(e||!t)return;let n=Object.entries(t);if(!n.length)return;let[o,r]=n[0];p(r)}catch(e){console.error(e)}})(),()=>{e=!0}},[l]);let h=(0,M.useRef)(null),f=e=>{p(e),null==n||n({[i]:e})},g=(0,I.jsx)("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:t});return(0,I.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},onClick:e=>{e.stopPropagation(),u(e=>!e)},onMouseLeave:()=>{h.current=setTimeout(()=>{u(!1)},200)},children:[a?(0,I.jsx)(D.A,{title:a,placement:"top",destroyTooltipOnHide:!0,children:g}):g,(0,I.jsx)(H.A,{...s,open:d,popupMatchSelectWidth:!1,bordered:!1,value:c,onChange:f,popupClassName:`select-popup-${t.replaceAll(" ","-")}`,fieldNames:r,options:o,labelRender:e=>m.t(e.label),optionRender:e=>m.t(e.label),style:{textAlign:"right",minWidth:100},onMouseEnter:()=>{clearTimeout(h.current)},dropdownRender:e=>s.dropdownRender?s.dropdownRender(e,u,f):e})]})}},Q=e=>{let{title:t,uiMode:l,itemProps:n}=e,o=(null==l?void 0:l.type)||l,r=o?X[o]:null,i=!!(null==n?void 0:n.disabled),a=null==n?void 0:n.disabledReason,s=null==n?void 0:n.disabledIconColor,d=r?(0,I.jsx)(r,{title:t,...n}):(0,I.jsx)(I.Fragment,{children:t});return i?(0,I.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[d,(0,I.jsx)(D.A,{title:a,placement:"right",destroyTooltipOnHide:!0,children:(0,I.jsx)(T.A,{style:{color:s}})})]}):d},Z=".nb-toolbar-container-icons",ee=".nb-toolbar-container",et=(0,N.css)`
3219
+ Please run: await ctx.importAsync("${l}") to ensure ctx.render uses a matching ReactDOM.`);throw e.cause=n,e}}return u}function ee(e){return e.endsWith("/")?e:`${e}/`}function et(e,t){try{let l=new URL(e);if(!["http:","https:"].includes(l.protocol))return!1;if(!(null==t?void 0:t.getApiUrl))return!0;let n=new URL(t.getApiUrl()),o=ee(n.pathname),r=ee(l.pathname);return l.origin!==n.origin||!r.startsWith(o)}catch{return!1}}function el(e){return!!(e&&"object"==typeof e&&"collection"in e&&"filterByTk"in e)}function en(e,t){if(t&&0!==t.length){if(el(e))return e;if(e&&"object"==typeof e&&!Array.isArray(e)){let l={};for(let[n,o]of Object.entries(e))t.some(e=>e===n||e.startsWith(`${n}.`)||e.startsWith(`${n}[`))&&(l[n]=o);return l}}}function eo(e){if(!e)return;let t=String(e).match(/^([^.[]+)/);return null==t?void 0:t[1]}function er(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(e)||0===e.length)return{generatedAppends:void 0,generatedFields:void 0};let t=new Set,l=new Set,n=e=>{if(!e)return"";let t=String(e);return(t=(t=(t=t.replace(/\[(?:\d+)\]/g,"")).replace(/\[(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)')\]/g,(e,t,l)=>`.${t||l}`)).replace(/\.\.+/g,".")).replace(/^\./,"").replace(/\.$/,"")};for(let o of e){if(!o)continue;for(;/^\[(\d+)\](\.|$)/.test(o);)o=o.replace(/^\[(\d+)\]\.?/,"");let e=n(o);if(!e)continue;let r=e.split(".").filter(Boolean);if(0!==r.length){if(1===r.length){l.add(r[0]);continue}for(let e=0;e<r.length-1;e++)t.add(r.slice(0,e+1).join("."));l.add(r.join("."))}}return{generatedAppends:t.size?Array.from(t):void 0,generatedFields:l.size?Array.from(l):void 0}}var ei=new WeakMap,ea=new WeakSet,es=new WeakSet,ed=new WeakSet,eu=new WeakSet,ec=new WeakSet,ep=new WeakSet,em=new WeakSet,eh=new WeakSet;class ef{createProxy(){return(0,n._)(this,ei)||(0,r._)(this,ei,new Proxy(this,{get:(e,t,l)=>{if("string"==typeof t){if(Reflect.has(e,t)){let n=Reflect.get(e,t,l);return"function"==typeof n?n.bind(e):n}if(Object.prototype.hasOwnProperty.call(e._props,t))return e._getOwnProperty(t,this.createProxy());if(Object.prototype.hasOwnProperty.call(e._methods,t))return e._getOwnMethod(t,this.createProxy());let n=this._findInDelegates(e._delegates,t);return void 0!==n?n.result:void 0}return Reflect.get(e,t,l)},has:(e,t)=>!!("string"==typeof t&&(Reflect.has(e,t)||Object.prototype.hasOwnProperty.call(e._props,t)||Object.prototype.hasOwnProperty.call(e._methods,t)||this._hasInDelegates(e._delegates,t)))||Reflect.has(e,t)})),(0,n._)(this,ei)}defineProperty(e,t){var l;if(this._props[e]&&(null==(l=this._props[e])?void 0:l.once))return;let n=this._props[e];(null==n?void 0:n.meta)&&this._clearMetaNodeCacheFor(n.meta),this._props[e]=t,delete this._observableCache[e],delete this._cache[e],Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:()=>this._getOwnProperty(e,this.createProxy())})}defineMethod(e,t,l){this._methods[e]=t,"string"==typeof l?this._methodInfos[e]={description:l}:l&&"object"==typeof l?this._methodInfos[e]=l:delete this._methodInfos[e],Object.defineProperty(this,e,{configurable:!0,enumerable:!1,writable:!1,value:t.bind(this.createProxy())})}removeCache(e){if(e in this._observableCache)return delete this._observableCache[e],!0;if(e in this._cache)return delete this._cache[e],!0;if(e in this._pending)return delete this._pending[e],!0;for(let t of this._delegates)if(t.removeCache(e))return!0}delegate(e){if(!(e instanceof ef))throw Error("Delegate must be an instance of FlowContext");this._delegates.includes(e)?console.warn(`[FlowContext] delegate - skip duplicate delegate: ${this._delegates.length}`):this._delegates.unshift(e)}addDelegate(e){if(!(e instanceof ef))throw Error("Delegate must be an instance of FlowContext");this._delegates.includes(e)||this._delegates.unshift(e)}clearDelegates(){this._delegates=[],this._metaNodeCache=new WeakMap}removeDelegate(e){if(!(e instanceof ef))throw Error("Delegate must be an instance of FlowContext");let t=this._delegates.indexOf(e);-1!==t&&this._delegates.splice(t,1)}_clearMetaNodeCacheFor(e){this._metaNodeCache.delete(e)}has(e){return!!this._props[e]}getPropertyMetaTree(e,t){let l=this._getPropertiesMeta();if(e){let l=(0,A.YB)(e);if(l&&l.length>0){let e=async(e,t,l)=>{try{let l="function"==typeof e?await e():e;if(!(null==l?void 0:l.properties))return[];let n=l.properties;if("function"==typeof n){let e=await n();l.properties=e,n=e}let o=(0,i._)(this,ea,eg).call(this,n,t,[],l);return Array.isArray(o)?o:await o()}catch(e){return console.warn(`Failed to load meta for ${l}:`,e),[]}},n=(0,i._)(this,es,ev).call(this,l);if(n){let[o,r,a]=n;if(1===l.length){if("function"==typeof r)return()=>e(r,a,o);if(r.properties){if("function"==typeof r.properties)return()=>e(r,a,o);let t=(0,i._)(this,ea,eg).call(this,r.properties,a,[],r);return Array.isArray(t)?t:[]}return[]}if("function"==typeof r){if(null==t?void 0:t.flatten)return()=>e(r,a,o);let l=(0,i._)(this,em,ew).call(this,a);return[(0,i._)(this,eh,eS).call(this,o,r,a,l)]}if(r.properties){let e=[...(0,i._)(this,em,ew).call(this,a),r.title],t=(0,i._)(this,ea,eg).call(this,r.properties,a,e,r);return Array.isArray(t)?t:[]}}return[]}if(null===l)return console.warn(`[FlowContext] getPropertyMetaTree - unsupported value format: "${e}". Only "{{ ctx.propertyName }}" format is supported. Returning empty meta tree.`),[]}return Object.entries(l).sort((e,t)=>{let[,l]=e,[,n]=t,o=("function"==typeof l?l.sort:null==l?void 0:l.sort)??0;return(("function"==typeof n?n.sort:null==n?void 0:n.sort)??0)-o}).map(e=>{let[t,l]=e;return(0,i._)(this,eh,eS).call(this,t,l,[t],[])})}async getApiInfos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version||"v1",l=!!e.includeCompletion,n=this.createProxy(),o=e=>"string"==typeof e&&e.startsWith("_"),r=e=>"record"===e||"formValues"===e||"popup"===e,i=e=>!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then,a=(()=>{var e,l,n,o,r,i,a,s;let d=(0,R.B)(this),u=R.F.resolve(t,d)||R.F.resolve(t,"*");if(!u)return{};let c=(null==(n=this)||null==(l=n.api)||null==(e=l.auth)?void 0:e.locale)||(null==(r=this)||null==(o=r.i18n)?void 0:o.language)||(null==(i=this)?void 0:i.locale);try{if(null==u||null==(a=u.getDoc)?void 0:a.length)return u.getDoc(c)||{};return(null==u||null==(s=u.getDoc)?void 0:s.call(u))||{}}catch(e){return{}}})(),s=e$(null==a?void 0:a.methods)?a.methods:{},d=e$(null==a?void 0:a.properties)?a.properties:{},u=e=>"string"==typeof e?{description:e}:e$(e)?e:void 0,c=(e,t)=>{let l="string"==typeof t?t:e$(t)&&"string"==typeof t.description?String(t.description):void 0;return l&&l.includes(`ctx.libs.${e}`)?`libs.${e}`:e},p=e=>{let t=u(e);if(!t)return{};let n={};for(let e of["description","examples",...l?["completion"]:[],"ref","params","returns"]){let l=t[e];void 0!==l&&(n[e]=l)}return Array.isArray(n.examples)&&(n.examples=n.examples.filter(e=>"string"==typeof e&&e.trim())),n},m=e=>{let t=u(e);if(!t)return{};let n={};for(let e of["title","type","interface","description","examples",...l?["completion"]:[],"ref","params","returns"]){let l=t[e];void 0!==l&&(n[e]=l)}return Array.isArray(n.examples)&&(n.examples=n.examples.filter(e=>"string"==typeof e&&e.trim())),n},h=e=>{let t=new WeakSet,l=n=>{if(!n||"object"!=typeof n||t.has(n))return;if(t.add(n),Object.prototype.hasOwnProperty.call(n._methodInfos||{},e)){var o;return null==(o=n._methodInfos)?void 0:o[e]}let r=n._delegates;if(Array.isArray(r))for(let e of r){let t=l(e);if(t)return t}};return l(this)},f=async e=>{let t=this.getPropertyOptions(e);if(null==t?void 0:t.info)try{let e="function"==typeof t.info?t.info.call(n,n):t.info;return(i(e)?await e:e)??void 0}catch(e){return}},g=new Set,v=new Set;for(let e of Object.keys(d))g.add(e);for(let e of Object.keys(s))v.add(e);let y=(e,t)=>{if(e&&"object"==typeof e&&!t.has(e)){t.add(e);try{let t=e._props;if(t&&"object"==typeof t)for(let[e,l]of Object.entries(t))(null==l?void 0:l.info)&&g.add(e)}catch(e){}try{let t=e._methodInfos;if(t&&"object"==typeof t)for(let e of Object.keys(t))v.add(e)}catch(e){}try{let l=e._delegates;if(Array.isArray(l))for(let e of l)y(e,t)}catch(e){}}};y(this,new WeakSet);let x={};for(let e of g){if(o(e)||r(e))continue;let t=d[e],n=await f(e);if(void 0===t&&void 0===n)continue;let i=u(t),a=u(n),s={};if(s={...s={...s,...m(i)},...m(a)},delete s.properties,l||delete s.completion,!Object.keys(s).length)continue;let p=c(e,t);x[p]=x[p]?{...x[p]||{},...s||{}}:s}for(let e of v){if(o(e))continue;let t=s[e],n=h(e);if(void 0===t&&void 0===n)continue;let r=u(t),i={};i={...i={...i,...p(r)},...p(n)},delete i.properties,l||delete i.completion,Object.keys(i).length&&(i.type="function",x[e]?x[e]={...x[e]||{},...i||{}}:x[e]=i)}let b=u(d.libs),w=e$(null==b?void 0:b.properties)?b.properties:void 0;if(w)for(let[e,t]of Object.entries(w)){if(o(e))continue;let n=`libs.${e}`;if(x[n])continue;let r=u(t),i={};i={...i,...m(r)},delete i.properties,l||delete i.completion,i.description&&String(i.description).trim()&&(x[n]=i)}return x}async getEnvInfos(){var e,t,l;let n=this.createProxy(),o=e=>!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then,r={},i=e=>{try{return e()}catch(e){return}},a=e=>null!=e&&("string"==typeof e?e.trim().length>0:!Array.isArray(e)||e.length>0),s=e=>{var t,l,n,o,r;let i={};if(!e)return i;let s=e;for(let e of["dataSourceKey","collectionName","associationName","filterByTk","sourceId"]){let t=null==s?void 0:s[e];a(t)&&(i[e]=t)}if(!("dataSourceKey"in i)){let e=null==(t=s.getDataSourceKey)?void 0:t.call(s);a(e)&&(i.dataSourceKey=e)}if(!("filterByTk"in i)){let e=null==(l=s.getFilterByTk)?void 0:l.call(s);a(e)&&(i.filterByTk=e)}if(!("filterByTk"in i)){let e=null==(n=s.getMeta)?void 0:n.call(s,"currentFilterByTk");a(e)&&(i.filterByTk=e)}if(!("sourceId"in i)){let e=null==(o=s.getSourceId)?void 0:o.call(s);a(e)&&(i.sourceId=e)}if(!("collectionName"in i)||!("associationName"in i)){let e=null==(r=s.getResourceName)?void 0:r.call(s),t="string"==typeof e?e.trim():"";if(t){let e=t.split(".").map(e=>e.trim()).filter(Boolean);1===e.length?"collectionName"in i||(i.collectionName=e[0]):e.length>=2&&("collectionName"in i||(i.collectionName=e[0]),"associationName"in i||(i.associationName=e.slice(1).join(".")))}}return i},d=await (async()=>{try{let e=n.popup;return o(e)?await e:e}catch(e){return}})(),u=i(()=>n.model),c=i(()=>n.blockModel),p=i(()=>{var e;return null==(e=n.view)?void 0:e.inputArgs}),m=i(()=>n.resource),h=s(null==d?void 0:d.resource),f=c,g=c?"ctx.blockModel":void 0,v=g?`${g}.resource`:void 0,y=s(null==f?void 0:f.resource),x=s(p),b=s(m),w=e=>{for(let t of e)if(a(t.value))return{value:t.value,getVar:t.getVar}},S=e=>a(e.collectionName)||a(e.dataSourceKey)||a(e.associationName),C=S(h)?"ctx.popup.resource":S(y)?v:S(x)?"ctx.view.inputArgs":S(b)?"ctx.resource":void 0,F=w([{value:null==h?void 0:h.collectionName,getVar:"ctx.popup.resource.collectionName"},{value:null==y?void 0:y.collectionName,getVar:`${v}.collectionName`},{value:null==x?void 0:x.collectionName,getVar:"ctx.view.inputArgs.collectionName"},{value:null==b?void 0:b.collectionName,getVar:"ctx.resource.collectionName"}]),k=w([{value:null==h?void 0:h.dataSourceKey,getVar:"ctx.popup.resource.dataSourceKey"},{value:null==y?void 0:y.dataSourceKey,getVar:`${v}.dataSourceKey`},{value:null==x?void 0:x.dataSourceKey,getVar:"ctx.view.inputArgs.dataSourceKey"},{value:null==b?void 0:b.dataSourceKey,getVar:"ctx.resource.dataSourceKey"}]),A=w([{value:null==h?void 0:h.associationName,getVar:"ctx.popup.resource.associationName"},{value:null==y?void 0:y.associationName,getVar:`${v}.associationName`},{value:null==x?void 0:x.associationName,getVar:"ctx.view.inputArgs.associationName"},{value:null==b?void 0:b.associationName,getVar:"ctx.resource.associationName"}]),P=w([{value:null==h?void 0:h.filterByTk,getVar:"ctx.popup.resource.filterByTk"},{value:null==y?void 0:y.filterByTk,getVar:`${v}.filterByTk`},{value:null==x?void 0:x.filterByTk,getVar:"ctx.view.inputArgs.filterByTk"},{value:null==b?void 0:b.filterByTk,getVar:"ctx.resource.filterByTk"}]),j=w([{value:null==h?void 0:h.sourceId,getVar:"ctx.popup.resource.sourceId"},{value:null==y?void 0:y.sourceId,getVar:`${v}.sourceId`},{value:null==x?void 0:x.sourceId,getVar:"ctx.view.inputArgs.sourceId"},{value:null==b?void 0:b.sourceId,getVar:"ctx.resource.sourceId"}]),M={},I=!1,T=null==F?void 0:F.value;a(T)&&(M.collectionName={description:"Collection name",getVar:(null==F?void 0:F.getVar)||(C?`${C}.collectionName`:void 0),value:T},I=!0);let R=null==k?void 0:k.value;a(R)&&(M.dataSourceKey={description:"Data source key",getVar:(null==k?void 0:k.getVar)||(C?`${C}.dataSourceKey`:void 0),value:R},I=!0);let E=null==A?void 0:A.value;a(E)&&(M.associationName={description:"Association name",getVar:(null==A?void 0:A.getVar)||(C?`${C}.associationName`:void 0),value:E},I=!0),I&&(a(null==P?void 0:P.value)&&(M.filterByTk={description:"Record filterByTk",getVar:(null==P?void 0:P.getVar)||(C?`${C}.filterByTk`:void 0)}),a(null==j?void 0:j.value)&&(M.sourceId={description:"Source record ID (sourceId)",getVar:(null==j?void 0:j.getVar)||(C?`${C}.sourceId`:void 0)}),r.resource={description:"Resource information",getVar:C,properties:M}),a(null==P?void 0:P.value)&&(r.record={description:"Current record",getVar:"ctx.record"});let N=e=>{try{let t=null==e?void 0:e.title;if("string"==typeof t&&t.trim())return t}catch(e){}try{var t,l;let n=null==e||null==(l=e.constructor)||null==(t=l.meta)?void 0:t.label;if("string"==typeof n&&n.trim())return n}catch(e){}};if(u){let t=N(u),l=u.uid,n=null==(e=u.constructor)?void 0:e.name,o=s(u.resource),i={},d=!1,c=o.collectionName;a(c)&&(i.collectionName={description:"Collection name",getVar:"ctx.model.resource.collectionName",value:c},d=!0);let p=o.dataSourceKey;a(p)&&(i.dataSourceKey={description:"Data source key",getVar:"ctx.model.resource.dataSourceKey",value:p},d=!0);let m=o.associationName;a(m)&&(i.associationName={description:"Association name",getVar:"ctx.model.resource.associationName",value:m},d=!0),r.flowModel={description:"Current FlowModel information",getVar:"ctx.model",properties:{...a(t)?{label:{description:"Flow model label",value:t}}:{},...a(n)?{modelClass:{description:"Flow model class name",value:n}}:{},...a(l)?{uid:{description:"Flow model uid",getVar:"ctx.model.uid",value:l}}:{},...d?{resource:{description:"Flow model resource",getVar:"ctx.model.resource",properties:i}}:{}}}}if((null==d?void 0:d.uid)&&(r.popup={description:"Current popup information",getVar:"ctx.popup",properties:{uid:{description:"Popup uid",getVar:"ctx.popup.uid",value:d.uid},...(null==d?void 0:d.record)?{record:{description:"Popup record",getVar:"ctx.popup.record"}}:{},...(null==d?void 0:d.sourceRecord)?{sourceRecord:{description:"Popup source record",getVar:"ctx.popup.sourceRecord"}}:{}}}),f){let e=N(f),l=f.uid,n=null==(t=f.constructor)?void 0:t.name,o={},i=!1,s=y.collectionName;a(s)&&(o.collectionName={description:"Collection name",getVar:`${v}.collectionName`,value:s},i=!0);let d=y.dataSourceKey;a(d)&&(o.dataSourceKey={description:"Data source key",getVar:`${v}.dataSourceKey`,value:d},i=!0);let u=y.associationName;a(u)&&(o.associationName={description:"Association name",getVar:`${v}.associationName`,value:u},i=!0),r.block={description:"Current block information",getVar:g,properties:{...a(e)?{label:{description:"Block label",value:e}}:{},...a(n)?{modelClass:{description:"Block model class name",value:n}}:{},...a(l)?{uid:{description:"Block uid",getVar:`${g}.uid`,value:l}}:{},...i?{resource:{description:"Block resource",getVar:v,properties:o}}:{}}}}let D=(()=>{let e=null==d?void 0:d.uid;if(a(e))return String(e).trim();let t=null==p?void 0:p.viewUid;if(a(t))return String(t).trim()})(),B=i(()=>n.engine),$=D?null==B?void 0:B.getModel(D,!0):void 0,O=e=>{var t;return(null==(t=e.context)?void 0:t.blockModel)===e};if($){let e=[$],t=[];for(let n=0;n<e.length;n++){let o=e[n];if(O(o)){let e=(null==(l=o.constructor)?void 0:l.name)||o.uid,n=N(o)||e||o.uid,r=s(o.resource),i={};a(r.dataSourceKey)&&(i.dataSourceKey=r.dataSourceKey),a(r.collectionName)&&(i.collectionName=r.collectionName),a(r.associationName)&&(i.associationName=r.associationName);let d={uid:o.uid,label:n,modelClass:e,...Object.keys(i).length>0?{resource:i}:{}};t.push(d)}let r=o.subModels;if(r&&"object"==typeof r)for(let t of Object.values(r))t&&(Array.isArray(t)?e.push(...t):e.push(t))}t.length&&(r.currentViewBlocks={description:"Current view blocks",value:t})}return r}async getVarInfos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxDepth??3,l=Number.isFinite(t)?Math.max(1,Math.floor(t)):3,n="v1",o=this.createProxy(),r=e=>"string"==typeof e&&e.startsWith("_"),i=e=>!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then,a=new WeakMap,s=async e=>{if(!e)return;if("function"!=typeof e)return e;let t=a.get(e);return t||(t=(async()=>{let t=e.call(o,o);return(i(t)?await t:t)||null})(),a.set(e,t)),await t||void 0},d=e=>{if("string"!=typeof e)return;let t=e.trim();if(!t)return;let l=(0,A.YB)(t);return Array.isArray(l)&&l.length>0?l.join("."):"ctx"===t?"":t.startsWith("ctx.")?t.slice(4).trim():t},u=(()=>{let t=e.path;return("string"==typeof t?[t]:Array.isArray(t)?t:[]).map(e=>d(String(e))).filter(e=>"string"==typeof e&&e.length>0)})(),c=(()=>{let t=e.path;return"string"==typeof t?""===d(t):!!Array.isArray(t)&&t.some(e=>""===d(String(e)))})(),p=(()=>{var e,t,l,o,r,i,a,s;let d=(0,R.B)(this),u=R.F.resolve(n,d)||R.F.resolve(n,"*");if(!u)return{};let c=(null==(l=this)||null==(t=l.api)||null==(e=t.auth)?void 0:e.locale)||(null==(r=this)||null==(o=r.i18n)?void 0:o.language)||(null==(i=this)?void 0:i.locale);try{if(null==u||null==(a=u.getDoc)?void 0:a.length)return u.getDoc(c)||{};return(null==u||null==(s=u.getDoc)?void 0:s.call(u))||{}}catch(e){return{}}})();e$(null==p?void 0:p.methods)&&p.methods,e$(null==p?void 0:p.properties)&&p.properties;let m=e=>"string"==typeof e?{description:e}:e$(e)?e:void 0,h=async(e,t)=>{if(void 0!==e){if("boolean"==typeof e)return e;if("function"==typeof e)try{let l=t(e);return i(l)?!!await l:!!l}catch(e){return!1}return!!e}},f=async(e,t)=>{if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)try{let l=t(e),n=i(l)?await l:l;if("string"==typeof n)return n;return null==n?void 0:String(n)}catch(e){return}return String(e)}},g=async e=>{let t=!1,l=[];try{if("boolean"==typeof e)t=e;else if(Array.isArray(e))l=e;else if("function"==typeof e){let n=e(o),r=i(n)?await n:n;"boolean"==typeof r?t=r:Array.isArray(r)&&(l=r)}}catch(e){t=!1,l=[]}let n=[];if(Array.isArray(l))for(let e of l){if("string"!=typeof e)continue;let t=e.trim();!(!t||"ctx"===t||t.startsWith("ctx."))&&(/\s/.test(t)||n.push(t))}return{hideSelf:!!t,hideSubpaths:n}},v=(e,t)=>{if(!e)return!1;let l=e.split(".").filter(Boolean);for(;l.length;){if(t.has(l.join(".")))return!0;l.pop()}return!1},y=e=>{let t=m(e);if(!t)return{};let l={};for(let e of["title","type","interface","description","examples","completion","ref","params","returns"]){let n=t[e];void 0!==n&&(l[e]=n)}return Array.isArray(l.examples)&&(l.examples=l.examples.filter(e=>"string"==typeof e&&e.trim())),l},x=async e=>{let t,n,{docNode:i,metaNode:a,infoNode:d,depth:u,pathFromRoot:c,hiddenPrefixes:p}=e,b=c.join(".");if(v(b,p))return;let w=m(i),S=m(d),C=await g(null==w?void 0:w.hidden);if(C.hideSelf)return;let F=await g(null==S?void 0:S.hidden);if(F.hideSelf)return;let k=await s(a);if(await h(null==k?void 0:k.hidden,e=>e.call(k,o)))return;let A=new Set(p);for(let e of[...C.hideSubpaths,...F.hideSubpaths]){let t=e.trim();if(!t)continue;let l="ctx"===t?"":t.startsWith("ctx.")?t.slice(4):t;if(!l)continue;let n=b?`${b}.${l}`:l;A.add(n)}let P=await h(null==w?void 0:w.disabled,e=>e(o)),j=await f(null==w?void 0:w.disabledReason,e=>e(o)),M=await h(null==k?void 0:k.disabled,e=>e.call(k,o)),I=await f(null==k?void 0:k.disabledReason,e=>e.call(k,o)),T=await h(null==S?void 0:S.disabled,e=>e(o)),R=await f(null==S?void 0:S.disabledReason,e=>e(o)),E=void 0!==T?T:void 0!==M?M:P,N=void 0!==R?R:void 0!==I?I:j,D={};if(D={...D={...D={...D,...y(w)},...y(k)},...y(S)},void 0!==E&&(D.disabled=!!E),void 0!==N&&(D.disabledReason=N),u>=l)return Object.keys(D).length?D:void 0;let B=e$(null==w?void 0:w.properties)?w.properties:void 0;if(null==k?void 0:k.properties)try{let e=k.properties;if("function"==typeof e){let l=await e.call(k,o);k.properties=l,t=l}else e$(e)&&(t=e)}catch(e){t=void 0}if(e$(S)&&(null==S?void 0:S.properties))try{let e=S.properties;if("function"==typeof e){let t=await e.call(S,o);S.properties=t,n=t}else e$(e)&&(n=e)}catch(e){n=void 0}let $=new Set;if(B)for(let e of Object.keys(B))$.add(e);if(t)for(let e of Object.keys(t))$.add(e);if(n)for(let e of Object.keys(n))$.add(e);if(!$.size)return Object.keys(D).length?D:void 0;let O={};for(let e of $){if(r(e))continue;let l=await x({docNode:null==B?void 0:B[e],metaNode:null==t?void 0:t[e],infoNode:null==n?void 0:n[e],depth:u+1,pathFromRoot:[...c,e],hiddenPrefixes:A});l&&(O[e]=l)}if(Object.keys(O).length&&(D.properties=O),Object.keys(D).length)return D},b=async e=>{if(!e.length)return;let[t,...l]=e,n=this.getPropertyOptions(t);if(null==n?void 0:n.meta)try{if(!l.length)return n.meta;let e=await s(n.meta);if(!e)return;for(let t=0;t<l.length;t++){let n=l[t],r=null==e?void 0:e.properties;if(!r)break;if("function"==typeof r){let t=await r.call(e,o);e.properties=t,r=t}if(!r||"object"!=typeof r)break;let i=null==r?void 0:r[n];if(!i)break;if(t===l.length-1)return i;let a=await s(i);if(!a)break;e=a}return}catch(e){return}};if(!c&&u.length){let e={};for(let t of u){let l=t.split(".").map(e=>e.trim()).filter(Boolean);if(l.some(e=>r(e))||!l.length)continue;let n=await b(l),o=await x({docNode:void 0,metaNode:n,infoNode:void 0,depth:1,pathFromRoot:[],hiddenPrefixes:new Set});o&&(e[t]=o)}return e}let w=this._getPropertiesMeta(),S={};for(let[e,t]of Object.entries(w)){if(r(e))continue;let l=await x({docNode:void 0,metaNode:t,infoNode:void 0,depth:1,pathFromRoot:[e],hiddenPrefixes:new Set});l&&(S[e]=l)}return S}_getPropertiesMeta(){let e={};for(let t of this._delegates)Object.assign(e,t._getPropertiesMeta());for(let[t,l]of Object.entries(this._props))l.meta&&(e[t]=(l.meta,l.meta));return e}_getOwnProperty(e,t){let l=this._props[e];if(l){if("value"in l)return"api"===e?(0,I.k)(l.value,t):l.value;if(l.get){if(!1===l.cache){let n=l.get(t);return"api"===e?(0,I.k)(n,t):n}let n=l.observable?"_observableCache":"_cache";if(e in this[n])return"api"===e?(0,I.k)(this[n][e],t):this[n][e];if(this._pending[e])return this._pending[e];let o=l.get(this.createProxy());return"object"==typeof o&&null!==o&&"function"==typeof o.then||"function"==typeof o&&"function"==typeof o.then?(this._pending[e]=o.then(l=>(this[n][e]=l,delete this._pending[e],"api"===e?(0,I.k)(l,t):l),t=>{throw delete this._pending[e],t}),this._pending[e]):(this[n][e]=o,"api"===e?(0,I.k)(o,t):o)}}}_getOwnMethod(e,t){let l=this._methods[e];return"function"==typeof l?l.bind(t):l}_findPropertyInDelegates(e,t){for(let l of e){if(Object.prototype.hasOwnProperty.call(l._props,t))return l._props[t];let e=this._findPropertyInDelegates(l._delegates,t);if(void 0!==e)return e}}_findInDelegates(e,t){for(let l of e){if(Object.prototype.hasOwnProperty.call(l._props,t))return{result:l._getOwnProperty(t,this.createProxy())};if(Object.prototype.hasOwnProperty.call(l._methods,t))return{result:l._getOwnMethod(t,this.createProxy())};let e=this._findInDelegates(l._delegates,t);if(void 0!==e)return e}}_hasInDelegates(e,t){for(let l of e)if(Object.prototype.hasOwnProperty.call(l._props,t)||Object.prototype.hasOwnProperty.call(l._methods,t)||this._hasInDelegates(l._delegates,t))return!0;return!1}getPropertyOptions(e){return Object.prototype.hasOwnProperty.call(this._props,e)?this._props[e]:this._findPropertyInDelegates(this._delegates,e)}constructor(){return(0,a._)(this,ea),(0,a._)(this,es),(0,a._)(this,ed),(0,a._)(this,eu),(0,a._)(this,ec),(0,a._)(this,ep),(0,a._)(this,em),(0,a._)(this,eh),(0,o._)(this,ei,{writable:!0,value:void 0}),this._props={},this._methods={},this._methodInfos={},this._cache={},this._observableCache=s.observable.shallow({}),this._delegates=[],this._pending={},(0,r._)(this,ei,null),this._metaNodeCache=new WeakMap,this.createProxy()}}function eg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0;return"function"==typeof e?async()=>{let o=await e();n&&(n.properties=o);let r=Object.entries(o);return r.sort((e,t)=>{let[,l]=e,[,n]=t;return((null==n?void 0:n.sort)??0)-((null==l?void 0:l.sort)??0)}),r.map(e=>{let[n,o]=e;return(0,i._)(this,eh,eS).call(this,n,o,[...t,n],l)})}:Object.entries(e).sort((e,t)=>{let[,l]=e,[,n]=t;return((null==n?void 0:n.sort)??0)-((null==l?void 0:l.sort)??0)}).map(e=>{let[n,o]=e;return(0,i._)(this,eh,eS).call(this,n,o,[...t,n],l)})}function ev(e){if(0===e.length)return null;let[t,...l]=e,n=this._props[t];if(null==n?void 0:n.meta)return(0,i._)(this,eu,ex).call(this,t,n.meta,l,[t]);let o=(0,i._)(this,ed,ey).call(this,this._delegates,t);return o?(0,i._)(this,eu,ex).call(this,t,o,l,[t]):null}function ey(e,t){for(let l of e){let e=l._props[t];if(null==e?void 0:e.meta)return e.meta;let n=(0,i._)(this,ed,ey).call(this,l._delegates,t);if(n)return n}return null}function ex(e,t,l,n){if(0===l.length)return[e,t,n];if("function"==typeof t)return[l[l.length-1],async()=>{let e=await t();return await (0,i._)(this,ep,eb).call(this,e,l)},[...n,...l]];if(t.properties){let[e,...o]=l,r=[...n,e];if("function"==typeof t.properties)return[l[l.length-1],async()=>{let l=t.properties,n=await l();t.properties=n;let r=n[e];if(!r)throw Error(`Property ${e} not found in resolved properties`);return await (0,i._)(this,ep,eb).call(this,r,o)},[...n,...l]];let a=t.properties[e];if(a)return(0,i._)(this,eu,ex).call(this,e,a,o,r)}return null}async function eb(e,t){if(0===t.length)return e;let l=e;for(let e of t){let n=p().get(l,"properties");if(!n)throw Error(`Property path not found: ${t.join(".")}`);if("function"==typeof n){let e=await n();l.properties=e,n=e}let o=n[e];if(!o)throw Error(`Property ${e} not found while resolving path: ${t.join(".")}`);l=o}return l}function ew(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(0===e.length)return[];let l=t?e.slice(0,-1):e;if(0===l.length)return[];let n=[],o=this._getPropertiesMeta();for(let e=0;e<l.length;e++){let t=l[e],r=o[t];if(!r||"function"==typeof r){n.push(t);break}if(n.push(r.title||t),e<l.length-1&&r.properties&&"function"!=typeof r.properties)o=r.properties;else if(e<l.length-1){for(let t=e+1;t<l.length;t++)n.push(l[t]);break}}return n}function eS(e,t){let l,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[e],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=this._metaNodeCache.get(t);if(r)return r.paths=n,r.parentTitles=o.length>0?o:void 0,r;let a=e=>{if(!e)return{disabled:!1,hidden:!1};let t="function"==typeof e.disabled?e.disabled():e.disabled,l="function"==typeof e.disabledReason?e.disabledReason():e.disabledReason,n="function"==typeof e.hidden?e.hidden():e.hidden;return{disabled:!(t&&"function"==typeof t.then)&&!!t,reason:l&&"function"==typeof l.then?void 0:l,hidden:!(n&&"function"==typeof n.then)&&!!n}};if("function"==typeof t){let r=e,s=t.hasChildren;l={name:e,title:t.title||r,type:"object",interface:void 0,options:void 0,uiSchema:void 0,paths:n,parentTitles:o.length>0?o:void 0,disabled:()=>{let e=t();return(!e||"function"!=typeof e.then)&&a(e).disabled},disabledReason:()=>{let e=t();if(!e||"function"!=typeof e.then)return a(e).reason},hidden:()=>{let e=t();return(!e||"function"!=typeof e.then)&&a(e).hidden},children:!1===s?void 0:async()=>{try{let r=await t(),a=(null==r?void 0:r.title)||e;if(l.title=a,l.type=null==r?void 0:r.type,l.interface=null==r?void 0:r.interface,l.options=null==r?void 0:r.options,l.uiSchema=null==r?void 0:r.uiSchema,!(null==r?void 0:r.properties))return[];let s=(0,i._)(this,ea,eg).call(this,r.properties,n,[...o,a],r),d=Array.isArray(s)?s:await s();return l.children=d,d}catch(t){return console.warn(`Failed to load meta for ${e}:`,t),[]}}}}else{let r=t.title,{disabled:s,reason:d,hidden:u}=a(t);l={name:e,title:r,type:t.type,interface:t.interface,options:t.options,uiSchema:t.uiSchema,paths:n,parentTitles:o.length>0?o:void 0,disabled:s,disabledReason:d,hidden:u,children:t.properties?(0,i._)(this,ea,eg).call(this,t.properties,n,[...o,r],t):void 0}}return this._metaNodeCache.set(t,l),l}class eC extends ef{constructor(){super(),this.defineMethod("getModel",(e,t)=>this.engine.getModel(e,t)),this.defineMethod("request",function(e){let t=this.app;return"string"==typeof(null==e?void 0:e.url)&&et(e.url,t)?d.A.request(e):this.api.request(e)}),this.defineMethod("runjs",async function(e,t,l){let{preprocessTemplates:n,...o}=l||{},r={...(null==o?void 0:o.globals)||{},...t||{}},i=await this.createJSRunner({...o||{},globals:r}),a=(0,F.R)({version:null==o?void 0:o.version,preprocessTemplates:n}),s=await (0,A.ji)(String(e??""),{preprocessTemplates:a});return i.run(s)},{description:"Execute a RunJS code string in the current Flow context.",detail:"(code: string, variables?: Record<string, any>, options?: JSRunnerOptions) => Promise<RunJSResult>",params:[{name:"code",type:"string",description:"RunJS code to execute."},{name:"variables",type:"Record<string, any>",optional:!0,description:"Additional globals."},{name:"options",type:"JSRunnerOptions",optional:!0,description:"Runner options."}],returns:{type:"Promise<{ success: boolean; value?: any; error?: any; timeout?: boolean }>"},completion:{insertText:"await ctx.runjs('return 1')"}})}}class eF extends eC{}let ek=["dataSourceKey","collectionName","associationName","filterByTk","sourceId","tabUid"];function eA(e,t){let l={};for(let n of t)void 0!==(null==e?void 0:e[n])&&(l[n]=e[n]);return l}function eP(e){return eA(e,ek)}function ej(e,t){for(let[l,n]of Object.entries(t))void 0===e[l]&&(e[l]=n)}class eM extends eC{constructor(e){if(!(e instanceof S.$))throw Error("Invalid FlowEngine instance");super(),this.engine=e,this.engine=e;const t=new w.zA;t.setFlowEngine(this.engine);const n=new w.qS({key:"main",displayName:"Main"});t.addDataSource(n),this.defineProperty("engine",{value:this.engine,info:{description:"FlowEngine instance.",detail:"FlowEngine"}}),this.defineProperty("sql",{get:e=>new k.tP(e),cache:!1,info:{description:"SQL helper (FlowSQLRepository).",detail:"FlowSQLRepository"}}),this.defineProperty("dataSourceManager",{value:t,info:{description:"DataSourceManager instance.",detail:"DataSourceManager"}});const o=new C(this);this.defineMethod("t",(e,t)=>o.translate(e,t)),this.defineProperty("locale",{get:()=>{var e,t,l;return(null==(t=this.api)||null==(e=t.auth)?void 0:e.locale)||(null==(l=this.i18n)?void 0:l.language)},cache:!1,meta:Object.assign(()=>({type:"string",title:this.t("Current language"),sort:970}),{title:(0,A.MI)("Current language"),sort:970,hasChildren:!1})}),this.defineMethod("renderJson",function(e){return this.resolveJsonTemplate(e)}),this.defineMethod("resolveJsonTemplate",async function(e){let t=(0,A.nN)(e),l=Object.keys(t||{});if(!l.length)return(0,A.M)(e,this);let n={};for(let e of l){let l=t[e]||[],o=this.getPropertyOptions(e),r=null==o?void 0:o.resolveOnServer;if(!0===r)n[e]=l;else if("function"==typeof r){let t=l.filter(e=>{try{return!!r(e)}catch(e){return!1}});t.length&&(n[e]=t)}}let o=Object.keys(n).length>0,r=e;if(o){let t=e=>{let t=(0,T.XU)(e);if(t)return t;try{var l,n,o,r,i,a,s,d,u,c,p,m,h;let t=null==e||null==(n=e.resource)||null==(l=n.getMeta)?void 0:l.call(n,"currentFilterByTk");if(null==t)return;let f=(null==e||null==(o=e.collection)?void 0:o.name)||(null==e||null==(c=e.resource)||null==(u=c.getResourceName)||null==(d=u.call(c))||null==(s=d.split)||null==(a=s.call(d,"."))||null==(i=a.slice)||null==(r=i.call(a,-1))?void 0:r[0]);if(!f)return;let g=(null==e||null==(p=e.collection)?void 0:p.dataSourceKey)||(null==e||null==(h=e.resource)||null==(m=h.getDataSourceKey)?void 0:m.call(h));return{collection:f,dataSourceKey:g,filterByTk:t}}catch(e){return}},l=async()=>{let e={};try{var t,l;let o=null==(t=(l=this)._getPropertiesMeta)?void 0:t.call(l);if(!o||"object"!=typeof o)return e;for(let[t,l]of Object.entries(o))if(n[t])try{let o;if("function"==typeof l){let e=l;o=await e()}else o=l;if(!o||"object"!=typeof o)continue;let r=o.buildVariablesParams;if("function"!=typeof r)continue;let i=await r(this);if(!i)continue;let a=n[t]||[],s=en(i,a);s&&("object"!=typeof s||Object.keys(s).length)&&(e[t]=s)}catch(e){}}catch(e){}return e},o=await l(),s={...o};try{let e="formValues",l=n[e]||[];if(l.length){let n=new Set;for(let e of l){let t=eo(e);t&&n.add(t)}let r=null==o?void 0:o[e],i=new Set;if(!r||"object"!=typeof r||Array.isArray(r)||el(r)||Object.keys(r).forEach(e=>i.add(e)),[...n].filter(e=>!i.has(e)).length){let n=t(this);if(n){let{generatedFields:t,generatedAppends:o}=er(l),r={...n,fields:t,appends:o},i=s[e];if(i&&"object"==typeof i&&!Array.isArray(i)&&!el(i)){for(let[t,l]of Object.entries(i))s[`${e}.${t}`]=l;delete s[e]}s[e]=r}}}}catch(e){}let d=Object.keys(s).length?(0,M.d)(this,s):void 0;if(!d){let t=Object.keys(n);if(t.length>0&&t.every(e=>{var t;return null==(t=this.getPropertyOptions(e))?void 0:t.serverOnlyWhenContextParams}))return(0,A.M)(e,this)}if(this.api)try{r=await (0,j.o4)(this,{template:e,contextParams:d||{}})}catch(t){var i,a;null==(a=this.logger)||null==(i=a.warn)||i.call(a,{err:t},"variables:resolve failed, fallback to client-only"),r=e}}return(0,A.M)(r,this)}),this.defineMethod("getVar",async function(e){let t=("string"==typeof e?e:String(e??"")).trim();if(t){if("ctx"!==t&&!t.startsWith("ctx."))throw Error(`ctx.getVar(path) expects an expression starting with "ctx.", got: "${t}"`);return this.resolveJsonTemplate(`{{ ${t} }}`)}},'Resolve a ctx expression value by path (expression starts with "ctx.").'),this.defineProperty("requirejs",{get:()=>{var e,t;return null==(t=this.app)||null==(e=t.requirejs)?void 0:e.requirejs}}),this.defineProperty("token",{get:()=>{var e,t;return null==(t=this.api)||null==(e=t.auth)?void 0:e.token},cache:!1,meta:Object.assign(()=>({type:"string",title:this.t("API Token"),sort:980}),{title:"API Token",sort:980,hasChildren:!1})}),this.defineProperty("role",{get:()=>{var e,t,l;let n=null==(t=this.api)||null==(e=t.auth)?void 0:e.role;if("__union__"!==n)return n;let o=null==(l=this.user)?void 0:l.roles;return Array.isArray(o)?o.map(e=>null==e?void 0:e.name).filter(e=>!!e):[]},cache:!1,meta:Object.assign(()=>({type:"string",title:this.t("Current role"),sort:990}),{title:(0,A.MI)("Current role"),sort:990,hasChildren:!1})}),this.defineProperty("urlSearchParams",{cache:!1,get:()=>{var e;let t=(null==(e=this.location)?void 0:e.search)||"",l=t.startsWith("?")?t.slice(1):t;return h().parse(l)||{}},meta:Object.assign(()=>({type:"object",title:this.t("URL search params"),sort:970,disabled:()=>{var e;let t=(null==(e=this.location)?void 0:e.search)||"",l=t.startsWith("?")?t.slice(1):t;return 0===Object.keys(h().parse(l)||{}).length},disabledReason:()=>this.t("The value of this variable is derived from the query string of the page URL. This variable can only be used normally when the page has a query string."),properties:async()=>{var e;let t=(null==(e=this.location)?void 0:e.search)||"",l=t.startsWith("?")?t.slice(1):t,n=h().parse(l)||{},o={};for(let e of Object.keys(n))o[e]={type:"string",title:e};return o}}),{title:(0,A.MI)("URL search params"),sort:970,hasChildren:!0})}),this.defineProperty("logger",{get:()=>this.engine.logger.child({module:"flow-engine"})}),this.defineProperty("auth",{get:()=>{var e,t,l,n,o,r;return{roleName:null==(t=this.api)||null==(e=t.auth)?void 0:e.role,locale:null==(n=this.api)||null==(l=n.auth)?void 0:l.locale,token:null==(r=this.api)||null==(o=r.auth)?void 0:o.token,user:this.user}},cache:!1}),this.defineProperty("date",{get:()=>{let e=t=>new Proxy({},{get:(l,n)=>{if("string"!=typeof n)return;let o=[...t,n];if(!(0,A.JE)(o))return;let r=(0,A.Vv)(o);return void 0!==r?r:e(o)}});return e(["date"])},cache:!1}),this.defineMethod("loadCSS",async e=>{let t=(0,A.i)(e);return new Promise((e,l)=>{if(document.querySelector(`link[href="${t}"]`))return void e(null);let n=document.createElement("link");n.rel="stylesheet",n.href=t,n.onload=()=>e(null),n.onerror=()=>l(Error(`Failed to load CSS: ${t}`)),document.head.appendChild(n)})},{description:"Load a CSS file by URL (browser only).",params:[{name:"href",type:"string",description:"CSS URL."}],returns:{type:"Promise<void>"},completion:{insertText:"await ctx.loadCSS('https://example.com/style.css')"},examples:["await ctx.loadCSS('https://example.com/style.css');"]}),this.defineMethod("requireAsync",async e=>{if((0,A.yp)(e))return this.loadCSS(e);let t=(0,A.i)(e,{raw:!0});return await W(this.requirejs,t)}),this.defineMethod("importAsync",async function(e){return(0,A.yp)(e)?this.loadCSS(e):await Z(this,e,{importer:H})}),this.defineMethod("createJSRunner",async function(e){try{let e=await Promise.resolve().then(l.bind(l,88828));"function"==typeof(null==e?void 0:e.setupRunJSContexts)&&await e.setupRunJSContexts()}catch(e){}let t=(null==e?void 0:e.version)||"v1",n=(0,R.B)(this),o=R.F.resolve(t,n)||eY,r=new o(this);r.defineMethod("t",(e,t)=>this.t(e,{ns:"runjs",...t}));let i={};try{var a,s,d,u,c,p,m,h;let e=(null==(d=this)||null==(s=d.api)||null==(a=s.auth)?void 0:a.locale)||(null==(c=this)||null==(u=c.i18n)?void 0:u.language)||(null==(p=this)?void 0:p.locale);i=(null==o||null==(m=o.getDoc)?void 0:m.length)?o.getDoc(e)||{}:(null==o||null==(h=o.getDoc)?void 0:h.call(o))||{}}catch(e){i={}}let f={ctx:eK(r,{doc:i}),...(null==e?void 0:e.globals)||{}},{timeoutMs:g}=e||{};return new F.I({globals:f,timeoutMs:g})}),this.defineMethod("buildServerContextParams",function(e){return(0,M.d)(this,e)}),this.defineMethod("getAction",function(e){return this.engine.getAction(e)}),this.defineMethod("getActions",function(){return this.engine.getActions()}),this.defineMethod("getEvents",function(){return this.engine.getEvents()}),this.defineMethod("runAction",async function(e,t){let l=this.engine.getAction(e),n=await (0,E.v)(this,l);if(!l)throw Error(`Action '${e}' not found.`);let o={...await (0,A.gG)(l.defaultParams,n)||{},...t||{}},r=l.useRawParams;if("function"==typeof r&&(r=await r(n)),r||(o=await n.resolveJsonTemplate(o)),!l.handler)throw Error(`Action '${e}' has no handler.`);return l.handler(n,o)}),this.defineProperty("acl",{get:()=>new x(this.engine)}),this.defineMethod("aclCheck",function(e){return!!this.skipAclCheck||this.acl.aclCheck(e)}),this.defineMethod("createResource",function(e){return this.engine.createResource(e,{context:this.createProxy()})}),this.defineMethod("makeResource",function(e){return this.engine.createResource(e,{context:this.createProxy()})}),this.defineMethod("initResource",function(e){return this.has("resource")||this.defineProperty("resource",{get:()=>this.createResource(e)}),this.resource}),this.defineMethod("useResource",function(e){return this.initResource(e)})}}class eI extends eF{constructor(e){if(!e||"object"!=typeof e)throw Error("Invalid FlowModel instance");super(),this.addDelegate(e.flowEngine.context),this.defineMethod("onRefReady",(e,t,l)=>{this.engine.reactView.onRefReady(e,t,l)}),this.defineProperty("model",{value:e,info:{description:"Current FlowModel instance.",detail:"FlowModel"}});const t=(0,f.createRef)();this.defineProperty("ref",{get:()=>(this.model._refCreated=!0,t),info:{description:"Stable React ref for the view container.",detail:"React.RefObject<HTMLDivElement>"}}),this.defineMethod("openView",async function(e,t){var l,n,o,r;let i={..."function"==typeof(null==(l=this.model)?void 0:l.getInputArgs)?eP(this.model.getInputArgs()):{},...eP(this.inputArgs)},a={...t||{}};ej(a,i),(a.defineProperties||a.defineMethods)&&(a.navigation=!1);let s=null;(s=await this.engine.loadModel({uid:e}))||(s=this.engine.createModel({uid:e,use:"PopupActionModel",parentId:this.model.uid,subType:"object",subKey:e,stepParams:{popupSettings:{openView:{...eA(a,["dataSourceKey","collectionName","associationName","mode","size"])}}}}),await s.save()),s.setParent(this.model);let d=(null==a?void 0:a.routeViewUid)??(null==a?void 0:a.viewUid)??((null==(o=s.stepParams)||null==(n=o.popupSettings)?void 0:n.openView)?s.uid:this.model.uid),u=this.view,c={type:(null==a?void 0:a.isMobileLayout)?"embed":(null==a?void 0:a.mode)||"drawer",inputArgs:{...a,viewUid:d,navigation:a.navigation},navigation:null==u?void 0:u.navigation,preventClose:!!(null==a?void 0:a.preventClose),engineCtx:this.engine.context};s.context.defineProperty("view",{value:c});let p=null==(r=s.getFlow)?void 0:r.call(s,"popupSettings"),m=null==p?void 0:p.on,h="click";"string"==typeof m&&m?h=m:m&&"object"==typeof m&&"string"==typeof m.eventName&&m.eventName&&(h=m.eventName),await s.dispatchEvent(h,{...a})}),this.defineMethod("getEvents",function(){return this.model.getEvents()}),this.defineMethod("getAction",function(e){return this.model.getAction(e)}),this.defineMethod("getActions",function(){return this.model.getActions()}),this.defineMethod("runAction",async function(e,t){let l=this.model.getAction(e),n=await (0,E.v)(this,l);if(!l)throw Error(`Action '${e}' not found.`);let o={...await (0,A.gG)(l.defaultParams,n)||{},...t||{}},r=l.useRawParams;if("function"==typeof r&&(r=await r(n)),r||(o=await n.resolveJsonTemplate(o)),!l.handler)throw Error(`Action '${e}' has no handler.`);return l.handler(n,o)})}}class eT extends eF{constructor(e,t){if(!e||"object"!=typeof e)throw Error("Invalid FlowModel instance");super(),this.master=e,this.fork=t,this.addDelegate(this.master.context),this.defineMethod("onRefReady",(e,t,l)=>{this.engine.reactView.onRefReady(e,t,l)}),this.defineProperty("model",{get:()=>this.fork,info:{description:"Current ForkFlowModel instance (as model).",detail:"ForkFlowModel"}});const l=(0,f.createRef)();this.defineProperty("ref",{get:()=>(this.fork._refCreated=!0,l),info:{description:"Stable React ref for the view container.",detail:"React.RefObject<HTMLDivElement>"}})}}class eR extends eF{_getOwnProperty(e){if("runtime"===this.mode)return super._getOwnProperty(e,this.createProxy());let t=this._props[e];if(t){if("value"in t)return b.create()[e];if(t.get){if(!1===t.cache)return b.create()[e];let l=t.observable?"_observableCache":"_cache";return e in this[l]||(this[l][e]=b.create()[e]),this[l][e]}}}exit(){throw new P.zz(this.flowKey,this.model.uid)}exitAll(){throw new P.zz(this.flowKey,this.model.uid)}get mode(){return this._mode}constructor(e,t,l="runtime"){super(),this.model=e,this.flowKey=t,this._mode=l,this.stepResults={},this.addDelegate(this.model.context),this.defineMethod("getStepParams",l=>e.getStepParams(t,l)||{}),this.defineMethod("setStepParams",(l,n)=>e.setStepParams(t,l,n)),this.defineMethod("getStepResults",e=>p().get(this.steps,[e,"result"])),this.defineMethod("initResource",t=>{e.context.has("resource")?console.log(`[FlowRuntimeContext] useResource - resource already defined in context: ${t}`):(e.context.defineProperty("resource",{get:()=>this.makeResource(t)}),e.resource||(e.resource=e.context.resource))}),this.defineMethod("useResource",e=>this.initResource(e)),this.defineProperty("resource",{get:()=>e.resource||e.context.resource,cache:!1}),this.defineMethod("onRefReady",(e,t,l)=>{this.engine.reactView.onRefReady(e,t,l)})}}let eE=new WeakMap,eN=new WeakMap,eD=new WeakMap;function eB(e,t){if(null===t)return;if(Array.isArray(e)||Array.isArray(t)||"object"!=typeof e||"object"!=typeof t)return t??e;let l={...e};for(let n of Object.keys(t)){let o=eB(null==e?void 0:e[n],t[n]);void 0===o?delete l[n]:l[n]=o}return l}function e$(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function eO(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}function eq(e){return!0===e||(e&&e$(e)?e:void 0)}function e_(e,t,l){if(!Array.isArray(t)||!t.length)return;let n=e;for(let e of t){if(!e)return;n.children=n.children||{},n.children[e]=n.children[e]||{},n=n.children[e]}n.deprecated=l}function eL(e,t){void 0!==t.deprecated&&(e.deprecated=t.deprecated);let l=t.children||{},n=Object.keys(l);if(n.length)for(let t of(e.children=e.children||{},n))e.children[t]=e.children[t]||{},eL(e.children[t],l[t])}function eV(e){let t={};if(!e)return t;let l=(e,n)=>{if(e$(e))for(let[o,r]of Object.entries(e)){if(!o||!r||"object"!=typeof r||Array.isArray(r))continue;let e=r,i=eq(e.deprecated);i&&e_(t,[...n,o],i),e$(e.properties)&&l(e.properties,[...n,o])}},n=e=>{if(e$(e))for(let[l,n]of Object.entries(e)){if(!l||!n||"object"!=typeof n||Array.isArray(n))continue;let e=eq(n.deprecated);e&&e_(t,[l],e)}};return l(e.properties,[]),n(e.methods),t}function ez(e){let t={},l=new WeakSet,n=(e,l)=>{if(e$(l))for(let[o,r]of Object.entries(l)){if(!o||"string"==typeof r||!r||"object"!=typeof r||Array.isArray(r))continue;let l=r,i=eq(l.deprecated);i&&e_(t,[...e,o],i),e$(l.properties)&&n([...e,o],l.properties)}},o=e=>{if(!e||"object"!=typeof e&&"function"!=typeof e||l.has(e))return;l.add(e);let r=e._methodInfos;if(e$(r))for(let[e,l]of Object.entries(r)){if(!e||!l||"object"!=typeof l||Array.isArray(l))continue;let n=eq(l.deprecated);n&&e_(t,[e],n)}let i=e._props;if(e$(i))for(let[e,l]of Object.entries(i)){if(!e)continue;let o=null==l?void 0:l.info;if(!o||"object"!=typeof o||Array.isArray(o))continue;let r=eq(o.deprecated);r&&e_(t,[e],r),e$(o.properties)&&n([e],o.properties)}let a=e._delegates;if(Array.isArray(a))for(let e of a)o(e)};return o(e),t}function eK(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=eV(t.doc);eL(l,ez(e));let n=new Set,o=new WeakMap,r=new WeakMap,i=new WeakMap,a=e=>{if(!e||"string"!=typeof e)return{};let t=2;for(let l of e.split("\n")){if(!l)continue;let e=l.match(/<anonymous>:(\d+):(\d+)/);if(!e)continue;let n=Number(e[1]),o=Number(e[2]);return{line:Number.isFinite(n)&&n>t?n-t:n,column:Number.isFinite(o)?o:void 0,rawLine:n,rawColumn:o}}return{}},s=(e,t)=>{if(e$(t))for(let[n,o]of Object.entries(t)){if(!n||"string"==typeof o||!o||"object"!=typeof o||Array.isArray(o))continue;let t=o,r=eq(t.deprecated);r&&e_(l,[...e,n],r),e$(t.properties)&&s([...e,n],t.properties)}},d=(e,t)=>{if(!e)return;let n=null==t?void 0:t.info;if(!n||"object"!=typeof n||Array.isArray(n))return;let o=eq(n.deprecated);o&&e_(l,[e],o),e$(n.properties)&&s([e],n.properties)},u=(e,t)=>{if(!e||!t||"object"!=typeof t||Array.isArray(t))return;let n=eq(t.deprecated);n&&e_(l,[e],n)},c=e=>{let t=e;for(;t&&("object"==typeof t||"function"==typeof t);){let e=o.get(t);if(!e)break;t=e}return t},p=e=>{if(e){if("string"==typeof e)return e.trim()||void 0;if(Array.isArray(e)){let t=e.map(e=>"string"==typeof e?e.trim():"").filter(Boolean);return t.length?t.join(", "):void 0}}},m=(t,l,o)=>{if(!t||n.has(t))return;n.add(t);let r=null==e?void 0:e.logger,i="function"==typeof(null==e?void 0:e.t)?(t,l)=>e.t(t,{ns:[A.u4,"client"],nsMode:"fallback",...l}):(e,t)=>{let l=(null==t?void 0:t.defaultValue)??e;return"string"==typeof l&&t?l.replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g,(e,l)=>{let n=null==t?void 0:t[l];return"string"==typeof n||"number"==typeof n?String(n):""}):l},s="object"==typeof l&&l?l:{},d=p(s.replacedBy),u="string"==typeof s.since?String(s.since):void 0,c="string"==typeof s.removedIn?String(s.removedIn):void 0,m="string"==typeof s.message?String(s.message):"",h=a(o),f=h.line?`(line ${h.line}${h.column?`:${h.column}`:""})`:"",g=m.trim(),v=g?i("RunJS deprecated warning with message",{defaultValue:"[RunJS][Deprecated] {{api}} {{message}}{{location}}",api:t,message:g,location:f}):i("RunJS deprecated warning",{defaultValue:"[RunJS][Deprecated] {{api}} is deprecated{{location}}",api:t,location:f}),y=i("RunJS deprecated separator",{defaultValue:"; "}),x=[v];d&&x.push(i("RunJS deprecated replacedBy",{defaultValue:"Use {{replacedBy}} instead",replacedBy:d})),u&&x.push(i("RunJS deprecated since",{defaultValue:"since {{since}}",since:u})),c&&x.push(i("RunJS deprecated removedIn",{defaultValue:"will be removed in {{removedIn}}",removedIn:c}));let b=x.filter(Boolean).join(y);try{r&&"function"==typeof r.warn?r.warn(b):console.warn(b)}catch(e){}},h=(e,t,l)=>{let o=t.deprecated;if(!o)return e;let r=i.get(e)||new Map;if(i.set(e,r),r.has(l))return r.get(l);let a=new Proxy(e,{apply(e,t,r){let i=n.has(l)?void 0:Error().stack;return m(l,o,i),Reflect.apply(e,c(t),r)},get:(e,t,l)=>Reflect.get(e,t,l)});return r.set(l,a),a},f=(e,t,l)=>{if(!e||"object"!=typeof e&&"function"!=typeof e||eO(e)||!(t.children&&Object.keys(t.children).length>0)&&"ctx"!==l)return e;let i=r.get(e)||new Map;if(r.set(e,i),i.has(l))return i.get(l);let a=new Proxy(e,{get(e,o,r){var i;if("symbol"==typeof o)return Reflect.get(e,o,c(r));let a=String(o),s=Reflect.get(e,o,c(r));if("ctx"===l&&"defineProperty"===a&&"function"==typeof s)return function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];let n=s(...t);try{d(String((null==t?void 0:t[0])??""),null==t?void 0:t[1])}catch(e){}return n};if("ctx"===l&&"defineMethod"===a&&"function"==typeof s)return function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];let n=s(...t);try{u(String((null==t?void 0:t[0])??""),null==t?void 0:t[2])}catch(e){}return n};let p=null==(i=t.children)?void 0:i[a];if(!p)return s;let g=`${l}.${a}`;if("function"==typeof s&&p.deprecated)return h(s,p,g);if(p.deprecated){let e=n.has(g)?void 0:Error().stack;m(g,p.deprecated,e)}return s&&("object"==typeof s||"function"==typeof s)&&p.children?f(s,p,g):s},has:(e,t)=>Reflect.has(e,t)});return o.set(a,e),i.set(l,a),a};return f(e,l,"ctx")}function eU(e,t,l){if(!e$(t))return e;if(!e$(e))return t;let n={...e};for(let o of Object.keys(t)){let r=t[o];if(null===r){delete n[o];continue}let i=l(e$(e)?e[o]:void 0,r);void 0===i?delete n[o]:n[o]=i}return n}function eW(e,t){if(null===t)return;let l=e$(e),n=e$(t),o="string"==typeof e;if("string"==typeof t)return l?eW(e,{description:t}):t;if(n){let n=l?e:o?{description:e}:void 0,r={...n||{}};for(let e of Object.keys(t)){if("properties"===e){let e=t.properties;if(null===e){delete r.properties;continue}let l=eU(null==n?void 0:n.properties,e,eW);void 0===l?delete r.properties:r.properties=l;continue}let l=eB(null==n?void 0:n[e],t[e]);void 0===l?delete r[e]:r[e]=l}return r}return t??e}function eH(e,t){if(null===t)return;let l=e$(e),n=e$(t),o="string"==typeof e;if("string"==typeof t)return l?eH(e,{description:t}):t;if(n){let n=l?e:o?{description:e}:void 0,r={...n||{}};for(let e of Object.keys(t)){let l=eB(null==n?void 0:n[e],t[e]);void 0===l?delete r[e]:r[e]=l}return r}return t??e}function eG(e,t){let l=e$(e)?e:{},n=e$(t)?t:{},o={...l};for(let e of Object.keys(n)){if("properties"===e){let e=eU(l.properties,n.properties,eW);void 0===e?delete o.properties:o.properties=e;continue}if("methods"===e){let e=eU(l.methods,n.methods,eH);void 0===e?delete o.methods:o.methods=e;continue}let t=eB(l[e],n[e]);void 0===t?delete o[e]:o[e]=t}return o}class eY extends ef{exit(){var e;throw new P.zz(this.flowKey,(null==(e=this.model)?void 0:e.uid)||"runjs")}exitAll(){var e;throw new P.zz(this.flowKey,(null==(e=this.model)?void 0:e.uid)||"runjs")}static define(e,t){let l=null==t?void 0:t.locale;if(l){let t=eN.get(this)||new Map,n=t.get(l)||{};t.set(l,eG(n,e)),eN.set(this,t)}else{let t=eE.get(this)||{};eE.set(this,eG(t,e))}eD.delete(this)}static getDoc(e){let t=this,l=eD.get(t),n=String(e||"default");if(l&&l.has(n))return l.get(n);let o=[],r=t;for(;r&&r.prototype;)o.unshift(r),r=Object.getPrototypeOf(r);let i={};for(let e of o)i=eG(i,eE.get(e)||{});if(e)for(let t of o){let l=eN.get(t);l&&l.has(e)&&(i=eG(i,l.get(e)))}return l||(l=new Map,eD.set(t,l)),l.set(n,i),i}constructor(e){super(),this.addDelegate(e),this.defineProperty("React",{value:f}),this.defineProperty("antd",{value:u}),this.defineProperty("dayjs",{value:D()});const t={...v,createRoot:(e,t)=>{let l=(null==e?void 0:e.__el)||e;return this.engine.reactView.createRoot(l,t)}};t.__nbRunjsInternalShim=!0,this.defineProperty("ReactDOM",{value:t}),(0,B.oJ)(this),this.defineMethod("openView",async function(t,l){let n=e.openView;if("function"!=typeof n)throw Error("ctx.openView is not available in current context.");let o=(0,A.cg)(l);return n(t,o?{...l||{},[A.sU]:o}:l)}),this.defineMethod("render",function(e,t){let l=t||this.element;if(!l)throw Error("ctx.render: container not provided and ctx.element is not available");let n=(null==l?void 0:l.__el)||l,o=globalThis;o.__nbRunjsRoots=o.__nbRunjsRoots||new WeakMap;let r=o.__nbRunjsRoots,i=e=>{if(!e)return;if(e.disposeTheme&&"function"==typeof e.disposeTheme){try{e.disposeTheme()}catch(e){}e.disposeTheme=void 0}let t=e.root||e;if(t&&"function"==typeof t.unmount)try{t.unmount()}catch(e){}},a=()=>{let e=r.get(n);e&&(i(e),r.delete(n))};if("string"==typeof e)return a(),new y.x(n).innerHTML=String(e??""),null;if(e&&e.nodeType&&(1===e.nodeType||3===e.nodeType||11===e.nodeType)){for(a();n.firstChild;)n.removeChild(n.firstChild);return n.appendChild(e),null}let s=this.ReactDOM,d=this,c=r.get(n);return c&&c.rendererKey===s&&c.ownerKey===d||(c&&(i(c),r.delete(n)),c={rendererKey:s,ownerKey:d,root:this.ReactDOM.createRoot(n),disposeTheme:void 0,lastVnode:void 0},r.set(n,c)),(0,B.$B)({ctx:this,entry:c,vnode:e,containerEl:n,rootMap:r,unmountContainerRoot:a,internalReact:f,internalAntd:u})})}}},48910(e,t,l){"use strict";l.d(t,{$:()=>eN});var n=l(88243),o=l(16213),r=l(95243),i=l(2543),a=l.n(i),s=l(81318),d=l.n(s),u=l(64171);class c extends u.Z{getAction(e){return this.actions.get(e)}getActions(){return new Map(this.actions)}}var p=l(26955);class m extends p.L{getEvent(e){return this.events.get(e)}getEvents(){return new Map(this.events)}}var h=l(29007),f=l(60182),g=l(31108),v=l(88439),y=l(62572);class x{async emitModelEventIf(e,t,l){e&&await this.engine.emitter.emitAsync(`model:event:${e}:${t}`,l)}async withApplyFlowCache(e,t){if(!e||!this.engine)return await t();let l=this.engine.applyFlowCache.get(e);if(l){if("resolved"===l.status)return l.data;if("rejected"===l.status)throw l.error;if("pending"===l.status)return await l.promise}let n=t().then(t=>(this.engine.applyFlowCache.set(e,{status:"resolved",data:t,promise:Promise.resolve(t)}),t)).catch(t=>{throw this.engine.applyFlowCache.set(e,{status:"rejected",error:t,promise:Promise.reject(t)}),t});return this.engine.applyFlowCache.set(e,{status:"pending",promise:n}),await n}async runFlow(e,t,l,n,o){var r;let i,s=e.getFlow(t);if(!s)return e.context.logger.error(`BaseModel.applyFlow: Flow with key '${t}' not found.`),Promise.reject(Error(`Flow '${t}' not found.`));let d=new h.W5(e,t);d.defineProperty("reactView",{value:e.reactView}),d.defineProperty("inputArgs",{value:{...l}}),d.defineProperty("runId",{value:n||`run-${Date.now()}`});let u=d.stepResults,c=e.getEvent("string"==typeof s.on?s.on:null==(r=s.on)?void 0:r.eventName);c&&((c={...c}).defaultParams={...a().get(s,"on.defaultParams",{}),...c.defaultParams});let p=c?{eventStep:c,...s.steps}:s.steps;(0,v.w)(d,p,e,t);let m=d.steps,x={uid:e.uid,model:e,runId:d.runId,inputArgs:l,flowKey:t};for(let[l,n]of(await this.emitModelEventIf(o,`flow:${t}:start`,x),Object.entries(p))){let r,a,s={},c=n.useRawParams;if(n.use){let o=e.getAction(n.use);if(!o){d.logger.error(`BaseModel.applyFlow: Action '${n.use}' not found for step '${l}' in flow '${t}'. Skipping.`);continue}a=await (0,y.v)(d,{...o,...n}),r=n.handler||o.handler,c=c??o.useRawParams;let i=await (0,f.gG)(o.defaultParams,a),u=await (0,f.gG)(n.defaultParams,a);s={...i,...u}}else{if(!n.handler)continue;a=await (0,y.v)(d,n),r=n.handler,s={...await (0,f.gG)(n.defaultParams,a)}}let p=e.getStepParams(t,l);void 0!==p&&(s={...s,...p}),"function"==typeof c&&(c=await c(a)),c||(s=await a.resolveJsonTemplate(s));try{if(!r){d.logger.error(`BaseModel.applyFlow: No handler available for step '${l}' in flow '${t}'. Skipping.`);continue}await this.emitModelEventIf(o,`flow:${t}:step:${l}:start`,{...x,stepKey:l});let e=r(a,s);i=!1!==n.isAwait?await e:e,u[l]=i,m[l].result=u[l],await this.emitModelEventIf(o,`flow:${t}:step:${l}:end`,{...x,result:i,stepKey:l})}catch(e){if(e instanceof f.sy||e instanceof g.zz||await this.emitModelEventIf(o,`flow:${t}:step:${l}:error`,{...x,error:e,stepKey:l}),e instanceof f.sy)return d.logger.info(`[FlowEngine] ${e.message}`),await this.emitModelEventIf(o,`flow:${t}:step:${l}:end`,{...x,stepKey:l}),await this.emitModelEventIf(o,`flow:${t}:end`,{...x,result:u}),Promise.resolve(u);if(e instanceof g.zz)return d.logger.info(`[FlowEngine] ${e.message}`),await this.emitModelEventIf(o,`flow:${t}:step:${l}:end`,{...x,stepKey:l,aborted:!0}),await this.emitModelEventIf(o,`flow:${t}:end`,{...x,result:e,aborted:!0}),Promise.resolve(e);return await this.emitModelEventIf(o,`flow:${t}:error`,{...x,error:e}),d.logger.error({err:e},`BaseModel.applyFlow: Error executing step '${l}' in flow '${t}':`),Promise.reject(e)}}return await this.emitModelEventIf(o,`flow:${t}:end`,{...x,result:u}),Promise.resolve(u)}async dispatchEvent(e,t,l,n){var o,r,i,a;let s="beforeRender"===t,d=!!(null==n?void 0:n.sequential),u=!!(null==n?void 0:n.useCache),c=s,p=`${e.uid}-${t}-${Date.now()}`,m=e.context.logger,h={uid:e.uid,model:e,runId:p,inputArgs:l};try{await this.emitModelEventIf(t,"start",h),await (null==(o=e.onDispatchEventStart)?void 0:o.call(e,t,n,l))}catch(o){if(s&&o instanceof f.sy)return m.debug(`[FlowModel.dispatchEvent] ${o.message}`),[];try{await (null==(r=e.onDispatchEventError)?void 0:r.call(e,t,n,l,o))}finally{m.error({err:o},`BaseModel.dispatchEvent: Start hook error for event '${t}'`)}if(c)throw o;return}let v=s?e.getEventFlows("beforeRender"):Array.from(e.getFlows().values()).filter(e=>{let l=e.on;return!!l&&("string"==typeof l?l===t:"object"==typeof l&&l.eventName===t)}),y="click"===t&&(null==l?void 0:l.triggerByRouter)===!0?v.filter(e=>{var t;let l=e.flowRegistry;return"instance"!==(null==l||null==(t=l.constructor)?void 0:t._type)}):v,x=[],b=async()=>{let n=!1;if(d){let o=y.map((e,t)=>({f:e,i:t})).slice().sort((e,t)=>{var l,n;let o=e.f.flowRegistry,r=t.f.flowRegistry,i=null==o||null==(l=o.constructor)?void 0:l._type,a=null==r||null==(n=r.constructor)?void 0:n._type,s=+("instance"!==i),d=+("instance"!==a);if(s!==d)return s-d;let u=e.f.sort??0,c=t.f.sort??0;return u!==c?u-c:e.i-t.i}).map(e=>e.f),r=[],i=new Map(o.filter(e=>{var t;let l=e.flowRegistry;return"instance"!==(null==l||null==(t=l.constructor)?void 0:t._type)}).map(e=>[e.key,e])),a=new Set,s=new Map;for(let[n,d]of(o.forEach((e,l)=>{let n=e.on,o="object"==typeof n?n:void 0;if(!o)return;let r=o.phase,d=o.flowKey,u=o.stepKey;if(!r||"beforeAllFlows"===r)return;let c=null;if("afterAllFlows"===r)c=`event:${t}:end`;else if("beforeFlow"===r||"afterFlow"===r)if(d)if(i.get(String(d))){let e="beforeFlow"===r?"start":"end";c=`event:${t}:flow:${String(d)}:${e}`}else c=`event:${t}:end`;else c=`event:${t}:end`;else if("beforeStep"!==r&&"afterStep"!==r)return;else if(d&&u){var p;let e=i.get(String(d)),l=!!(null==e||null==(p=e.hasStep)?void 0:p.call(e,String(u)));if(e&&l){let e="beforeStep"===r?"start":"end";c=`event:${t}:flow:${String(d)}:step:${String(u)}:${e}`}else c=`event:${t}:end`}else c=`event:${t}:end`;if(!c)return;let m=c===`event:${t}:end`||"afterFlow"===r||"afterStep"===r;a.add(e.key);let h=s.get(c)||[];h.push({flow:e,order:l,shouldSkipOnAborted:m}),s.set(c,h)}),s.entries()))for(let o of d.slice().sort((e,t)=>{let l=e.flow.sort??0,n=t.flow.sort??0;return l!==n?l-n:e.order-t.order})){let i=o.shouldSkipOnAborted?Object.assign(e=>e.type===n&&!0!==e.aborted,{__eventType:n}):n,a=e.scheduleModelOperation(e.uid,async e=>{let n=await this.runFlow(e,o.flow.key,l,p,t);if(n instanceof g.zz)throw n;r.push(n)},{when:i});x.push(a)}for(let i of o)if(!a.has(i.key))try{m.debug(`BaseModel '${e.uid}' dispatching event '${t}' to flow '${i.key}' (sequential).`);let o=await this.runFlow(e,i.key,l,p,t);if(o instanceof g.zz){m.debug(`[FlowEngine.dispatchEvent] ${o.message}`),n=!0;break}r.push(o)}catch(e){if(e instanceof g.zz){m.debug(`[FlowEngine.dispatchEvent] ${e.message}`),n=!0;break}throw m.error({err:e},`BaseModel.dispatchEvent: Error executing event-triggered flow '${i.key}' for event '${t}' (sequential):`),e}return{result:r,abortedByExitAll:n}}let o=(await Promise.all(y.map(async n=>{m.debug(`BaseModel '${e.uid}' dispatching event '${t}' to flow '${n.key}'.`);try{return await this.runFlow(e,n.key,l,p,t)}catch(e){if(m.error({err:e},`BaseModel.dispatchEvent: Error executing event-triggered flow '${n.key}' for event '${t}':`),c)throw e;return}}))).filter(e=>void 0!==e);return o.some(e=>e instanceof g.zz)&&(n=!0),{result:o,abortedByExitAll:n}},w=u?JSON.stringify(l??{}):"",S=u?eN.generateApplyFlowCacheKey(`event:${e.getFlowCacheScope(t)}:${w}`,t,e.uid):null;try{let{result:o,abortedByExitAll:r}=await this.withApplyFlowCache(S,b);try{await (null==(i=e.onDispatchEventEnd)?void 0:i.call(e,t,n,l,o))}catch(e){m.error({err:e},`BaseModel.dispatchEvent: End hook error for event '${t}'`)}return await this.emitModelEventIf(t,"end",{...h,result:o,...r?{aborted:!0}:{}}),o&&"object"==typeof o&&Object.defineProperty(o,"__abortedByExitAll",{value:r,configurable:!0}),o}catch(o){try{await (null==(a=e.onDispatchEventError)?void 0:a.call(e,t,n,l,o))}catch(e){}if(e.context.logger.error({err:o},`BaseModel.dispatchEvent: Error executing event '${t}' for model '${e.uid}':`),await this.emitModelEventIf(t,"error",{...h,error:o}),c)throw o}finally{for(let e of x)e()}}constructor(e){this.engine=e}}var b=l(58587),w=l(18150),S=l(68238),C=l(67838),F=l(18220),k=l(47674),A=l(21637),P=l(71021),j=l(84626),M=l(96540),I=l(74848),T=l(53619),R=l(92034),E=l(98393),N=l(22803),D=l(42443),B=l(88040),$=l(35710),O=l(18182),q=l(76511),_=l(33954),L=l(57084),V=l(94313),z=l(20616),K=l(52847);let U={marginLeft:32},W=(0,K.PA)(e=>{let{title:t,onChange:l,getDefaultValue:n,disabled:o,itemKey:r,...i}=e,[a,s]=(0,M.useState)(!1),d=(0,z.Db)();(0,M.useEffect)(()=>{let e=!1;return(async()=>{if(n)try{let t=await n();if(e||!t)return;let l=Object.entries(t);if(!l.length)return;let[o,r]=l[0];s(!!r)}catch(e){console.error(e)}})(),()=>{e=!0}},[n]);let u=e=>{s(e),null==l||l({[r]:e})},c=e=>{e.stopPropagation(),o||u(!a)};return(0,I.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between",cursor:o?"not-allowed":"pointer"},onClick:c,children:[t,(0,I.jsx)(V.A,{size:"small",...i,checkedChildren:i.checkedChildren?d.t(i.checkedChildren):void 0,unCheckedChildren:i.unCheckedChildren?d.t(i.unCheckedChildren):void 0,checked:a,style:U,disabled:o})]})});var H=l(36492);let G=(e,t)=>{for(let n of e){var l;if(String((null==n?void 0:n.key)??"")===t)return n;if(null==(l=n.children)?void 0:l.length){let e=G(n.children,t);if(e)return e}}},Y=(e,t,l)=>{let n=t.maxDepth,o="number"==typeof t.arrayLimit?t.arrayLimit:1/0,r=t.mode??"stack",i=new Set,a=new Set,s=(e,t,d)=>{if(!e||t>n)return;let u=()=>{l(e,{depth:t,modelKey:d}),t>=n||Object.entries(e.subModels||{}).forEach(e=>{let[l,n]=e;if(Array.isArray(n)){let e=Number.isFinite(o)?Math.min(n.length,o):n.length;for(let o=0;o<e;o++){let e=n[o];e instanceof _.WD&&s(e,t+1,`${l}[${o}]`)}return}n instanceof _.WD&&s(n,t+1,l)})};if("visited"===r){if(i.has(e))return;i.add(e),u();return}let c=e.uid||`temp-${Date.now()}`;if(!a.has(c)){a.add(c);try{u()}finally{a.delete(c)}}};s(e,1)},J=(e,t)=>{var l;if(!e||!t||"string"!=typeof t)return console.warn("Invalid input parameters"),null;let n=t.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\[(\d+)\])?$/);if(!n)return console.warn(`Invalid subModelKey format: ${t}`),null;let[,o,r]=n,i=null==(l=e.subModels)?void 0:l[o];if(!i)return console.warn(`SubModel '${o}' not found`),null;if(void 0!==r){let e=parseInt(r,10);return Array.isArray(i)?e<0||e>=i.length?(console.warn(`Array index ${e} out of bounds for '${o}'`),null):i[e]instanceof _.WD?i[e]:null:(console.warn(`Expected array for '${o}', got ${typeof i}`),null)}return Array.isArray(i)?(console.warn(`Expected object for '${o}', got array`),null):i instanceof _.WD?i:null},X={switch:W,select:function(e){let{title:t,getDefaultValue:l,onChange:n,options:o,fieldNames:r,itemKey:i,tooltip:a,...s}=e,[d,u]=(0,M.useState)(!1),[c,p]=(0,M.useState)(""),m=(0,z.Db)();(0,M.useEffect)(()=>{let e=!1;return(async()=>{if(l)try{let t=await l();if(e||!t)return;let n=Object.entries(t);if(!n.length)return;let[o,r]=n[0];p(r)}catch(e){console.error(e)}})(),()=>{e=!0}},[l]);let h=(0,M.useRef)(null),f=e=>{p(e),null==n||n({[i]:e})},g=(0,I.jsx)("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:t});return(0,I.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},onClick:e=>{e.stopPropagation(),u(e=>!e)},onMouseLeave:()=>{h.current=setTimeout(()=>{u(!1)},200)},children:[a?(0,I.jsx)(D.A,{title:a,placement:"top",destroyTooltipOnHide:!0,children:g}):g,(0,I.jsx)(H.A,{...s,open:d,popupMatchSelectWidth:!1,bordered:!1,value:c,onChange:f,popupClassName:`select-popup-${t.replaceAll(" ","-")}`,fieldNames:r,options:o,labelRender:e=>m.t(e.label),optionRender:e=>m.t(e.label),style:{textAlign:"right",minWidth:100},onMouseEnter:()=>{clearTimeout(h.current)},dropdownRender:e=>s.dropdownRender?s.dropdownRender(e,u,f):e})]})}},Q=e=>{let{title:t,uiMode:l,itemProps:n}=e,o=(null==l?void 0:l.type)||l,r=o?X[o]:null,i=!!(null==n?void 0:n.disabled),a=null==n?void 0:n.disabledReason,s=null==n?void 0:n.disabledIconColor,d=r?(0,I.jsx)(r,{title:t,...n}):(0,I.jsx)(I.Fragment,{children:t});return i?(0,I.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[d,(0,I.jsx)(D.A,{title:a,placement:"right",destroyTooltipOnHide:!0,children:(0,I.jsx)(T.A,{style:{color:s}})})]}):d},Z=".nb-toolbar-container-icons",ee=".nb-toolbar-container",et=(0,N.css)`
3220
3220
  width: max-content;
3221
3221
  min-width: max-content;
3222
3222
 
@@ -3571,4 +3571,4 @@ ${r.join("\n")}`:""}function k(e){let t=String((null==e?void 0:e.message)||"");i
3571
3571
  ${i.join("\n")}`:""}function j(e,t){let l=Error(t);l.cause=e;try{let t="string"==typeof(null==e?void 0:e.name)?e.name:"";t&&(l.name=t)}catch(e){}try{let n="string"==typeof(null==e?void 0:e.stack)?e.stack:"";if(n){let e=String(n).split("\n");e.length&&(e[0]=`${l.name}: ${t}`,l.stack=e.join("\n"))}}catch(e){}return l}function M(e){if(!e)return null;let t=d.get(e);if(t)return t;if("function"!=typeof e.createElement)return null;let l=e.Component;if("function"!=typeof l)return null;class n extends l{static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){try{var t,l,n;let o=null==(t=this.props)?void 0:t.enhanceReactError,r="function"==typeof o?o(e):e,i=String((null==r?void 0:r.message)||"");if(i&&/\[RunJS Hint\]/.test(i)){console.error(i);let e=null==(n=this.props)||null==(l=n.ctx)?void 0:l.logger;e&&"function"==typeof e.error&&e.error(i)}}catch(e){}}componentDidUpdate(e){var t,l;(null==e?void 0:e.resetKey)!==(null==(t=this.props)?void 0:t.resetKey)&&(null==(l=this.state)?void 0:l.error)&&this.setState({error:void 0})}render(){var t,l;let n=null==(t=this.state)?void 0:t.error;if(!n)return this.props.children;let o="";try{let e=null==(l=this.props)?void 0:l.enhanceReactError,t="function"==typeof e?e(n):n;o=String((null==t?void 0:t.message)||t||(null==n?void 0:n.message)||n||"")}catch(e){o=String((null==n?void 0:n.message)||n||"")}let r={boxSizing:"border-box",padding:12,borderRadius:6,border:"1px solid #ffccc7",background:"#fff2f0",color:"#a8071a",fontSize:12,lineHeight:1.5,maxWidth:"100%",overflow:"auto"},i={margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},a={fontWeight:600,marginBottom:8};return e.createElement("div",{style:r},e.createElement("div",{style:a},"RunJS render error"),e.createElement("pre",{style:i},o))}constructor(...e){super(...e),this.state={}}}return d.set(e,n),n}function I(e){let{ctx:t,vnode:l,enhanceReactError:n,resetKey:o}=e,r=null==t?void 0:t.React,i=M(r);return i?r.createElement(i,{ctx:t,enhanceReactError:n,resetKey:o},l):l}function T(e){var t;let{ctx:l,entry:n,containerEl:r,rootMap:i,unmountContainerRoot:a,enhanceReactError:s,internalReact:d,internalAntd:u}=e;if(!(!(null==(t=l.ReactDOM)?void 0:t.__nbRunjsInternalShim)&&l.React&&l.React!==d&&l.antd&&l.antd!==u&&void 0!==l.antd.ConfigProvider)){if(n.disposeTheme){try{n.disposeTheme()}catch(e){}n.disposeTheme=void 0}return!1}let c=()=>{var e,t,o,r,i,a,s;null==l||null==(t=l.engine)||null==(e=t.context)||e.themeToken;let d=null==l||null==(r=l.engine)||null==(o=r.context)?void 0:o.antdConfig,u=(null==l||null==(s=l.engine)||null==(a=s.context)||null==(i=a.locales)?void 0:i.antd)||(null==d?void 0:d.locale),c=l.antd.ConfigProvider,p=l.antd.App,m={popupMatchSelectWidth:!1,locale:u||{}};d&&"object"==typeof d&&(void 0!==d.direction&&(m.direction=d.direction),"string"==typeof d.prefixCls&&(m.prefixCls=d.prefixCls),"string"==typeof d.iconPrefixCls&&(m.iconPrefixCls=d.iconPrefixCls),"function"==typeof d.getPopupContainer&&(m.getPopupContainer=d.getPopupContainer),d.theme&&"object"==typeof d.theme&&(m.theme=d.theme));let h=n.lastVnode,f=p?l.React.createElement(c,m,l.React.createElement(p,null,h)):l.React.createElement(c,m,h);n.root.render(f)};return n.disposeTheme?c():n.disposeTheme=(0,o.autorun)(()=>{try{if(r&&1===r.nodeType&&"boolean"==typeof r.isConnected&&!r.isConnected&&n.wasConnected)return void queueMicrotask(()=>{i.get(r)===n&&a()});r&&1===r.nodeType&&"boolean"==typeof r.isConnected&&r.isConnected&&(n.wasConnected=!0),c()}catch(e){throw s(e)}}),!0}function R(e){let{ctx:t,entry:l,vnode:n,containerEl:o,rootMap:r,unmountContainerRoot:i,internalReact:a,internalAntd:s}=e,d=e=>{let l=String((null==e?void 0:e.message)||e||"");if(!l||/\[RunJS Hint\]/.test(l))return e;let n=/invalid hook call/i.test(l),o=k(e);if(!n&&!o)return e;let r=F({ctx:t,internalReact:a,internalAntd:s})||P({ctx:t,internalReact:a,internalAntd:s,err:e});return r?j(e,`${l}${r}`):e};try{return l.__nbRunjsRenderSeq=(l.__nbRunjsRenderSeq||0)+1,l.lastVnode=I({ctx:t,vnode:n,enhanceReactError:d,resetKey:l.__nbRunjsRenderSeq}),T({ctx:t,entry:l,containerEl:o,rootMap:r,unmountContainerRoot:i,enhanceReactError:d,internalReact:a,internalAntd:s})||l.root.render(l.lastVnode),l.root}catch(e){throw d(e)}}},44476(e,t,l){"use strict";l.d(t,{H:()=>d,a:()=>u});var n=l(2543),o=l.n(n),r=l(35846);function i(e){if(!e)return;let t=e.match(/^([^.[]+)/);return null==t?void 0:t[1]}function a(e,t){var l;if(!e||!t)return;let n=e.getField(t);return n||((null==(l=e.getFields)?void 0:l.call(e))||[]).find(e=>e.name===t)}function s(e,t){if(null!=e){if(Array.isArray(t)){if("object"!=typeof e||!e)return;let l={};for(let n of t){let t=e[n];if(null==t)return;l[n]=t}return l}if("string"==typeof e||"number"==typeof e)return e;if("object"==typeof e)return e[t]}}function d(e,t){return l=>{if(!l||!l.includes("."))return!1;let n=i(l);if(!n)return!1;let r=a(e(),n);if(!(null==r?void 0:r.isAssociationField()))return!1;if("function"==typeof t){let e=t();if(e&&"object"==typeof e&&void 0!==o().get(e,l))return!1}return!0}}function u(e,t,l){let n=(0,r.H)(e,t,!0),o=async()=>{let t=await n();return t?{...t,buildVariablesParams:t=>{var n;let o=e(),r=l(t);if(!o||!r||"object"!=typeof r)return{};let i={};for(let e of(null==(n=o.getFields)?void 0:n.call(o))||[]){let t=e.name;if(!t||!e.isAssociationField())continue;let l=e.target,n=e.targetCollection;if(!l||!n)continue;let o=n.filterTargetKey,a=r[t];if(null!=a)if(Array.isArray(a)){let e=a.map(e=>s(e,o)).filter(e=>null!=e);e.length&&(i[t]={collection:l,dataSourceKey:n.dataSourceKey,filterByTk:e})}else{let e=s(a,o);null!=e&&(i[t]={collection:l,dataSourceKey:n.dataSourceKey,filterByTk:e})}}return i}}:null};return o.title=t,o}},35846(e,t,l){"use strict";l.d(t,{H:()=>d});let n=["belongsTo","hasOne","hasMany","belongsToMany","belongsToArray"],o=["integer","float","double","decimal"];function r(e,t){return!!(e.interface&&(t||e.filterable))}function i(e,t){let l=s(e);if(e.isAssociationField()){let n=e.targetCollection;return n?{type:"object",...l,properties:async()=>{let e={};return n.fields.forEach(l=>{r(l,t)&&(e[l.name]=i(l,t))}),e}}:{type:"object",...l}}return{type:a(e),...l}}function a(e){let t=e.type;if(n.includes(t))return"object";if(o.includes(t))return"number";switch(t){case"boolean":return"boolean";case"json":return"object";case"array":return"array";default:return"string"}}function s(e){return{title:e.title||e.name,interface:e.interface,options:e.options,uiSchema:e.uiSchema||{}}}function d(e,t,l){let n=async()=>{let n="function"==typeof e?e():e;return n?{type:"object",title:t||n.title||n.name,properties:async()=>{let e={};return n.fields.forEach(t=>{r(t,l)&&(e[t.name]=i(t,l))}),e}}:null};return n.title=t,n}},62572(e,t,l){"use strict";l.d(t,{v:()=>o});var n=l(29007);async function o(e,t){if(null==t||!t.defineProperties&&!t.defineMethods)return e;let l=new n.cB;l.addDelegate(e);let o=l.createProxy(),r=o,i=e,a=t=>{let l=Reflect.get(i,t,i);return"function"==typeof l?l.bind(e):l},s=e=>"defineProperty"===e||"defineMethod"===e||Reflect.has(r,e)||Reflect.has(i,e),d=new Proxy(o,{get:(e,t,n)=>"string"==typeof t?"defineProperty"===t?(e,t)=>l.defineProperty(e,t):"defineMethod"===t?(e,t,n)=>l.defineMethod(e,t,n):Reflect.has(r,t)?Reflect.get(r,t,n):a(t):Reflect.get(r,t,n),set:(e,t,l)=>Reflect.set(i,t,l),has:(e,t)=>s(t),getOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(r,t)||Object.getOwnPropertyDescriptor(i,t)});if(t)for(let e of Array.isArray(t)?t:[t]){if(!e)continue;let t=e.defineProperties;if(t){let e="function"==typeof t?await t(d):t;if(!e||"object"!=typeof e)throw TypeError("defineProperties must return an object of PropertyOptions");for(let[t,n]of Object.entries(e)){if(!n||"object"!=typeof n)throw TypeError(`defineProperties['${t}'] must be a PropertyOptions object`);l.defineProperty(t,n)}}let n=e.defineMethods;if(n){let e="function"==typeof n?await n(d):n;if(!e||"object"!=typeof e)throw TypeError("defineMethods must return an object of functions");for(let[t,n]of Object.entries(e)){if("function"!=typeof n)throw TypeError(`defineMethods['${t}'] must be a function`);l.defineMethod(t,n)}}}return new Proxy(o,{get:(t,l,n)=>"string"==typeof l?"defineProperty"===l?(t,l)=>e.defineProperty(t,l):"defineMethod"===l?(t,l,n)=>e.defineMethod(t,l,n):Reflect.has(r,l)?Reflect.get(r,l,n):a(l):Reflect.get(r,l,n),set:(e,t,l)=>Reflect.set(i,t,l),has:(e,t)=>s(t),getOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(r,t)||Object.getOwnPropertyDescriptor(i,t)})}},44951(e,t,l){"use strict";l.d(t,{BL:()=>s,T$:()=>r});var n=l(16639);function o(e,t){if(!e||"object"!=typeof e)return;let l=e;if("function"==typeof l.get){let e=l.get(t);if(null!=e&&""!==e)return e}let n=t.toLowerCase();for(let[t,l]of Object.entries(e))if(t.toLowerCase()===n)return l}function r(e){let t=o(e,"x-data-source");return Array.isArray(t)?String(t[0]||"main"):null==t||""===t?"main":String(t)}function i(e){let t=String(e||"").trim();if(!t)return[];let l=new Set([t]);return t.includes(".")&&l.add(t.split(".")[0]),Array.from(l)}function a(e,t){if(!t)return[e];let l=[],n=new Set,o=e,r=0;for(;o&&r++<50;)n.has(o)||(l.push(o),n.add(o)),o=o.previousEngine;return l}function s(e){var t,l,o,r;let{engine:s,resourceName:d,includePreviousEngines:u}=e;if(!(null==s?void 0:s.markDataSourceDirty))return[];let c=i(d);if(!c.length)return[];let p=String(e.dataSourceKey||"main"),m=a(s,u),h=new Map;for(let e of m){let t=new Map;for(let l of(h.set(e,t),c))t.set(l,(null==(o=e.getDataSourceDirtyVersion)?void 0:o.call(e,p,l))||0)}for(let e of m){let t=h.get(e);for(let l of c){let n=(null==t?void 0:t.get(l))||0;((null==(r=e.getDataSourceDirtyVersion)?void 0:r.call(e,p,l))||0)===n&&e.markDataSourceDirty(p,l)}}return null==(l=s.emitter)||null==(t=l.emit)||t.call(l,n.HK,{dataSourceKey:p,resourceNames:c}),c}},9297(e,t,l){"use strict";l.d(t,{k:()=>j,q:()=>o});var n=l(44951);let o="__nocobaseSkipDataSourceDirty",r=new WeakMap,i=new WeakSet,a=["add","bulkdestroy","bulkupdate","create","delete","destroy","execute","firstorcreate","import","move","remove","save","saveastemplate","set","setfields","submit","update","updateorcreate","upsert"];function s(e){if(!e||"object"!=typeof e)return!1;let t=e;return"function"==typeof t.resource&&"function"==typeof t.request}function d(e){let t=String(e||"").trim();if(!t)return!1;let l=t.split("/")[0],n=l.toLowerCase();return a.some(e=>{if(n===e)return!0;if(!n.startsWith(e)||l.length<=e.length)return!1;let t=l[e.length];return"-"===t||"_"===t||t>="A"&&t<="Z"})}function u(){var e;return"u"<typeof window||null==(e=window.location)?void 0:e.origin}function c(e,t){try{return new URL(e,t)}catch{return}}function p(e){let t=e.search(/[?#]/);return -1===t?e:e.slice(0,t)}function m(e){let t=p(e).trim();if(!t)return;let l=t.replace(/^\/+/,"");if(l&&"api"!==l)return l.startsWith("api/")?l.slice(4):l}function h(e){return e.endsWith("/")?e:`${e}/`}function f(e){if(null==e?void 0:e.getApiUrl)try{return c(e.getApiUrl(),u())}catch{return}}function g(e,t){let l=p(e).trim();if(!l.startsWith("/"))return;let n=h(t);if(!h(l).startsWith(n))return;let o=n.replace(/\/$/,"");return l.slice(o.length).replace(/^\/+/,"")||void 0}function v(e,t){if(!["http:","https:"].includes(e.protocol))return;if(null==t?void 0:t.getApiUrl){let l=f(t);if(!l||e.origin!==l.origin)return;return g(e.pathname,l.pathname)}let l=u();if(l&&e.origin===l)return m(e.pathname)}function y(e,t){if("string"!=typeof e)return;let l=e.trim();if(!l||l.startsWith("//"))return;if(/^https?:\/\//i.test(l)){let e=c(l);if(!e)return;return v(e,t.app)}let n=f(t.app),o=n?g(l,n.pathname):void 0;return o||m(l)}function x(e){try{return decodeURIComponent(e)}catch{return e}}function b(e){return String(e??"").trim()||void 0}function w(e){let t,l=[],n=-1;for(let o=0;o<e.length;o+=2){let r=e[o],i=r.lastIndexOf(":"),a=-1===i?r:r.slice(0,i);if(!a)return;if(l.push(x(a)),-1!==i){t=x(r.slice(i+1)).trim(),n=o;break}}if(t&&l.length&&!(e.length>n+2))return{resourceName:l.join("."),actionName:t}}function S(e,t){let l=y(e,t);if(!l)return;let n=p(l).split("/").filter(Boolean);if("dataSources"===x(n[0]||"")&&n.length>=3){let e=b(x(n[1])),t=w(n.slice(2));if(e&&t)return{...t,dataSourceKey:e}}return w(n)}function C(e,t,l,n){let o=e.trim(),r=l.trim();if(!o||!r)return;if(o.includes("/")){let e=S(`${o}:${r}`,n);if(e)return e}let i="dataSources.";if(o.startsWith(i)){let e=b(t),l=o.slice(i.length).trim();if(e&&l)return{dataSourceKey:e,resourceName:l,actionName:r}}return{resourceName:o,actionName:r}}function F(e,t){let l="string"==typeof(null==e?void 0:e.resource)?e.resource:void 0,n="string"==typeof(null==e?void 0:e.action)?e.action:void 0;return l&&n?C(l,e.resourceOf,n,t):S(null==e?void 0:e.url,t)}function k(e,t,l){(0,n.BL)({engine:e.engine,dataSourceKey:t.dataSourceKey||(0,n.T$)(l),resourceName:t.resourceName,includePreviousEngines:!0})}function A(e,t,l,n,o){return new Proxy(t,{get(t,r,i){let a=Reflect.get(t,r,i);if("string"!=typeof r||"function"!=typeof a||!d(r))return a;let s=a;return async function(){for(var t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];let d=await s(...i),u=C(l,n,r,e);return u&&k(e,u,o),d}}})}function P(e,t){let l=(l,n,o,r)=>A(t,e.resource(l,n,o,r),l,n,o),n=l=>{let n=l,r=(null==n?void 0:n[o])?void 0:F(n,t),{[o]:i,...a}=n;return e.request(a).then(e=>(r&&d(r.actionName)&&k(t,r,n.headers),e))},r=new Proxy(e,{get:(e,t,o)=>"resource"===t?l:"request"===t?n:Reflect.get(e,t,o)});return i.add(r),r}function j(e,t){if(!s(e)||i.has(e))return e;let l=e,n=r.get(l);n||(n=new WeakMap,r.set(l,n));let o=n.get(t);if(o)return o;let a=P(e,t);return n.set(t,a),a}},31108(e,t,l){"use strict";l.d(t,{VD:()=>r,sy:()=>n,zz:()=>o});class n extends Error{constructor(e,t,l){super(l||`Flow '${e}' on model '${t}' exited via ctx.exit().`),this.name="FlowExitException",this.flowKey=e,this.modelUid=t}}class o extends Error{constructor(e,t,l){super(l||`Flow '${e}' on model '${t}' exited via ctx.exitAll().`),this.name="FlowExitAllException",this.flowKey=e,this.modelUid=t}}class r extends Error{constructor(e="Flow settings save cancelled."){super(e),this.name="FlowCancelSaveException"}}},60182(e,t,l){"use strict";l.d(t,{pM:()=>ta,Fv:()=>i,ju:()=>j.ju,MI:()=>d,vq:()=>ti.v,yz:()=>N,M5:()=>eb,X4:()=>ew,Vv:()=>eC,E2:()=>eA,lW:()=>a,n2:()=>T,FA:()=>p,J3:()=>eP,vP:()=>j.vP,ME:()=>y,H9:()=>A.H,ey:()=>eF.ey,KB:()=>ee,JE:()=>es,kl:()=>o,u4:()=>n,UX:()=>j.UX,XM:()=>k,AP:()=>I,mP:()=>eE,zz:()=>u.zz,D1:()=>eF.D1,gG:()=>m.gG,I2:()=>eF.I2,af:()=>P.a,mv:()=>m.mv,QP:()=>c,Xh:()=>eF.Xh,$S:()=>j.$S,EI:()=>ts,_:()=>eF._,qI:()=>C,sU:()=>_,ln:()=>w,Z8:()=>D,cg:()=>z,zE:()=>tc,wx:()=>g.w,yp:()=>td.y,y4:()=>ex,dN:()=>G,ye:()=>J,$n:()=>eR,VD:()=>u.VD,ji:()=>tr,WJ:()=>r,i:()=>td.i,hz:()=>eS,MZ:()=>s,sy:()=>u.sy,YB:()=>M,xI:()=>j.xI,$X:()=>ey,o7:()=>S,mH:()=>to,M:()=>m.M,nN:()=>j.nN,GZ:()=>E,Hi:()=>P.H,pc:()=>j.pc,_3:()=>F,Gu:()=>Y,DX:()=>ev,XU:()=>j.XU});let n="flow-engine",o={DATA:"dataBlocks",FILTER:"filterBlocks",OTHER:"otherBlocks"},r={data:{key:o.DATA,label:"Data blocks",type:"group",hasCurrentFlowContext:!0},filter:{key:o.FILTER,label:"Filter blocks",type:"group",hasCurrentFlowContext:!1},other:{key:o.OTHER,label:"Other blocks",type:"group",hasCurrentFlowContext:!1}},i={CURRENT_RECORD:"currentRecord",ASSOCIATION_RECORDS:"associationRecords",OTHER_RECORDS:"otherRecords",OTHER_COLLECTIONS:"otherCollections",CURRENT_COLLECTIONS:"currentCollections"};function a(e){var t;return(null==(t=e.flowEngine)?void 0:t.translate)?(t,l)=>e.flowEngine.translate(t,{ns:[n,"client"],nsMode:"fallback",...l}):e=>e}function s(e,t){return t?`{{t(${JSON.stringify(e)}, ${JSON.stringify(t)})}}`:`{{t(${JSON.stringify(e)})}}`}function d(e,t){return s(e,t)}var u=l(31108);function c(e){return e}function p(e,t){if(e===t)return!1;if(e.prototype instanceof t)return!0;let l=Object.getPrototypeOf(e.prototype);for(;l&&l!==Object.prototype;){if(l.constructor===t)return!0;l=Object.getPrototypeOf(l)}return!1}var m=l(81982),h=l(27153),f=l(29007),g=l(88439);async function v(e,t){if(!e)return{};if("function"==typeof e)try{return await e(t)||{}}catch(e){return console.error("Error resolving uiSchema function:",e),{}}return e}async function y(e,t){if(!e)return"dialog";if("function"==typeof e)try{return await e(t)||"dialog"}catch(e){return console.error("Error resolving uiMode function:",e),"dialog"}return e}let x={},b=e=>{if("function"==typeof e)return!0;if(!e||"object"!=typeof e)return!1;let t=new WeakSet,l=e=>{if("function"==typeof e)return!0;if(!e||"object"!=typeof e||t.has(e))return!1;if(t.add(e),Array.isArray(e)){for(let t of e)if(l(t))return!0;return!1}for(let t of Object.keys(e))if(l(e[t]))return!0;return!1};return l(e)};function w(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{noCache:n=!1}=l,o=e=>/\{\{.*?\}\}/g.test(e);return(t=>{let l,r=!1;if("string"==typeof t&&t.startsWith("{{")&&(r=!0,l=t),t&&"object"==typeof t&&!Array.isArray(t)){try{l=JSON.stringify(t)}catch(e){return console.warn("Failed to stringify:",e),t}let i=!!(r=o(l))&&!n&&b(t);if(x[l]&&!n&&!i)return x[l];if(i)try{return h.Schema.compile(t,e)}catch(e){return console.warn("Failed to compile with Formily Schema.compile:",e),t}}if(Array.isArray(t)){try{l=JSON.stringify(t)}catch(e){return console.warn("Failed to stringify:",e),t}let i=!!(r=o(l))&&!n&&b(t);if(x[l]&&!n&&!i)return x[l];if(i)try{return h.Schema.compile(t,e)}catch(e){return console.warn("Failed to compile with Formily Schema.compile:",e),t}}if(r){if(!l)try{return h.Schema.compile(t,e)}catch(e){return console.warn("Failed to compile with Formily Schema.compile:",e),t}try{if(n)return h.Schema.compile(t,e);return x[l]=x[l]||h.Schema.compile(t,e),x[l]}catch(l){console.log("compileUiSchema error",t,l);try{return h.Schema.compile(t,e)}catch(e){}}}return t})(t)}async function S(e,t,l){let n=new f.W5(e,t.key,"settings");(0,g.w)(n,t.steps,e,t.key),n.defineProperty("currentStep",{value:l});let o=l.uiSchema;if(l.use)try{var r;let t=null==(r=e.getAction)?void 0:r.call(e,l.use);t&&t.uiSchema&&(o=o||t.uiSchema)}catch(e){console.warn(`Failed to get action ${l.use}:`,e)}let i=await v(o||{},n);return 0===Object.keys(i).length?null:i}async function C(e,t,l){if(!l)return!0;let{hideInSettings:n}=l;if("function"==typeof n)try{let l=new f.W5(e,t.key,"settings");return(0,g.w)(l,t.steps||{},e,t.key),!!await n(l)}catch(e){return console.warn(`Error evaluating hideInSettings for event '${l.name||""}' in flow '${t.key}':`,e),!1}return!!n}async function F(e,t,l){if(!l)return!0;let n=l.hideInSettings;if(void 0===n&&l.use){var o;let t=null==(o=e.getAction)?void 0:o.call(e,l.use);n=null==t?void 0:t.hideInSettings}if("function"==typeof n)try{let o=new f.W5(e,t.key,"settings");return(0,g.w)(o,t.steps,e,t.key),o.defineProperty("currentStep",{value:l}),!!await n(o)}catch(e){return console.warn(`Error evaluating hideInSettings for step '${l.key||""}' in flow '${t.key}':`,e),!1}return!!n}async function k(e,t,l){let n;if(!l)return{disabled:!1};let o=l.disabledInSettings,r=l.disabledReasonInSettings;if((void 0===o||void 0===r)&&l.use)try{var i;let t=null==(i=e.getAction)?void 0:i.call(e,l.use);void 0===o&&(o=null==t?void 0:t.disabledInSettings),void 0===r&&(r=null==t?void 0:t.disabledReasonInSettings)}catch(e){console.warn(`Failed to get action ${l.use}:`,e)}let a=null,s=()=>(a||(a=new f.W5(e,t.key,"settings"),(0,g.w)(a,t.steps,e,t.key),a.defineProperty("currentStep",{value:l})),a),d=!1;if("function"==typeof o)try{d=!!await o(s())}catch(e){return console.warn(`Error evaluating disabledInSettings for step '${l.key||""}' in flow '${t.key}':`,e),{disabled:!1}}else d=!!o;if(!d)return{disabled:!1};if("function"==typeof r)try{let e=await r(s());null!=e&&""!==e&&(n=String(e))}catch(e){console.warn(`Error evaluating disabledReasonInSettings for step '${l.key||""}' in flow '${t.key}':`,e)}else null!=r&&""!==r&&(n=String(r));return{disabled:!0,reason:n}}var A=l(35846),P=l(44476),j=l(73398);function M(e){if("string"!=typeof e)return null;let t=e.trim(),l=/^\{\{\s*ctx(?:\.(.+?))?\s*\}\}$/,n=t.match(l);if(!n)return null;let o=n[1];return o?o.split(".").map(e=>e.trim()).filter(e=>e.length>0):[]}function I(e){return 0===e.length?"{{ ctx }}":`{{ ctx.${e.join(".")} }}`}function T(e){if("string"!=typeof e)return!1;let t=e.trim();return/^\{\{\s*ctx(?:\..+?)?\s*\}\}$/.test(t)}let R=new WeakMap;function E(e,t){R.set(e,t??null)}function N(e){return R.get(e)??null}function D(e){R.delete(e)}let B=["drawer","dialog","embed"],$=["small","medium","large"],O="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",q=8,_=Symbol.for("nocobase.runjs.openViewRouteState");function L(e){return"string"==typeof e&&B.includes(e)}function V(e){return"string"==typeof e&&$.includes(e)}function z(e){let t={};return L(null==e?void 0:e.mode)&&(t.mode=e.mode),V(null==e?void 0:e.size)&&(t.size=e.size),t.mode||t.size?t:void 0}function K(e){let t=0x811c9dc5;for(let l=0;l<e.length;l++)t^=e.charCodeAt(l),t=Math.imul(t,0x1000193);return t>>>0}function U(e){let t=4*(e.mode?B.indexOf(e.mode)+1:0)+(e.size?$.indexOf(e.size)+1:0);return t>0?t:void 0}function W(e){let t=Math.floor(e/4),l=e%4;return z({mode:t?B[t-1]:void 0,size:l?$[l-1]:void 0})}function H(e,t){let l=K(`${e}:${t}`),n="";for(let e=0;e<q;e++)n+=O[(l=Math.imul(l^t+17*e,0x1000193)>>>0)%O.length];return n}function G(e){return"string"==typeof e&&e.length===q&&[...e].every(e=>O.includes(e))}function Y(e,t){let l=z(t),n=l?U(l):void 0;return n?H(e,n):void 0}function J(e,t){if(G(t)){for(let l=1;l<16;l++)if(H(e,l)===t)return W(l)}}let X=e=>e&&"/"!==e?`/${e.replace(/^\/+/,"").replace(/\/+$/,"")}`:"/",Q=e=>`/${e.replace(/^\/+/,"").replace(/\/+$/,"")}`,Z=(e,t)=>{let l=X(e),n=Q(t);return l===n?"":l.startsWith(`${n}/`)?l.slice(n.length+1):""},ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"/"===e)return[];let l=t.rootPrefix||"admin",n=t.basePath?Z(e,t.basePath):"",o=(t.basePath?n:e).replace(/^\/+/,"").split("/").filter(Boolean);if(o.length<(t.basePath?1:2))return[];let r=[],i=null,a=0;for(t.basePath&&(i={viewUid:o[0]},a=1);a<o.length;){let e=o[a];if(e===l||"view"===e)if(i&&r.push(i),a+1<o.length)i={viewUid:o[a+1]},a+=2;else break;else if(i){if("opts"===e){if(a+1<o.length){let e=J(i.viewUid,o[a+1]);e&&(i.openViewRouteState=e),a+=2}else a++;continue}if(a+1>=o.length){a++;continue}let t=o[a+1],l=t;try{l=decodeURIComponent(t)}catch(e){}switch(e){case"tab":i.tabUid=l;break;case"filterbytk":{let e=e=>{let t={};return e.split("&").forEach(e=>{let[l,n=""]=e.split("=");if(l)try{let e=decodeURIComponent(l),o=decodeURIComponent(n);t[e]=o}catch(e){t[l]=n}}),t},t=l;if(l&&(l.startsWith("{")||l.startsWith("[")))try{let e=JSON.parse(l);t=e&&"object"==typeof e&&!Array.isArray(e)?e:l}catch(e){t=l}else l&&/^[^=&]+=[^=&]*(?:&[^=&]+=[^=&]*)*$/.test(l)&&(t=e(l));i.filterByTk=t;break}case"sourceid":i.sourceId=l}a+=2}else a++}return i&&r.push(i),r};var et=l(74353),el=l.n(et);let en=/^\{\{\s*ctx\.date(?:\.(.+?))?\s*\}\}$/,eo=new Set(["today","now","yesterday","tomorrow","thisWeek","lastWeek","nextWeek","thisMonth","lastMonth","nextMonth","thisQuarter","lastQuarter","nextQuarter","thisYear","lastYear","nextYear"]),er=new Set(["next","past"]),ei=new Set(["day","week","month","year"]);function ea(e){if("string"!=typeof e)return null;let t=e.trim().match(en);if(!t)return null;let l=String(t[1]||"");return l?l.split(".").map(e=>e.trim()).filter(Boolean):[]}function es(e){let t=ed((e||[]).map(e=>String(e)));if("date"!==t[0])return!1;if(1===t.length)return!0;if("preset"===t[1])return 2===t.length||3===t.length&&eo.has(t[2]);if("relative"===t[1])return 2===t.length||(3===t.length?er.has(t[2]):4===t.length?er.has(t[2])&&ei.has(t[3]):5===t.length&&er.has(t[2])&&ei.has(t[3])&&"number"==typeof eh(t[4]));if("exact"===t[1]){if(2===t.length)return!0;if("single"===t[2])return 3===t.length||(4===t.length?"date"===t[3]:5===t.length&&"date"===t[3]&&/^v.+/.test(t[4]));if("range"===t[2]){if(3===t.length)return!0;if(4===t.length)return"date"===t[3];if(5===t.length)return"date"===t[3]&&/^v.+/.test(t[4]);if(6===t.length)return"date"===t[3]&&/^v.+/.test(t[4])&&/^v.+/.test(t[5])}}return!1}function ed(e){return"date"===e[0]?e:["date",...e]}function eu(e){let t=ed(e);return`{{ ctx.${t.join(".")} }}`}function ec(e){var t;let l=null==(t=globalThis)?void 0:t.Buffer;if(l&&"function"==typeof l.from)return l.from(e,"utf8").toString("base64");if("function"==typeof btoa)return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16))));throw Error("No base64 encoder available")}function ep(e){var t;let l=null==(t=globalThis)?void 0:t.Buffer;if(l&&"function"==typeof l.from)return l.from(e,"base64").toString("utf8");if("function"==typeof atob)return decodeURIComponent(Array.from(atob(e)).map(e=>`%${e.charCodeAt(0).toString(16).padStart(2,"0")}`).join(""));throw Error("No base64 decoder available")}function em(e){if(null!=e){if("string"==typeof e){let t=e.trim();return t.length?t:void 0}if(el().isDayjs(e))return e.toISOString();if(e instanceof Date)return el()(e).toISOString();if("number"==typeof e||"boolean"==typeof e)return String(e)}}function eh(e){let t=String(e||"").match(/^n(\d+)$/);if(!t)return;let l=Number(t[1]);if(Number.isFinite(l)&&!(l<=0))return l}function ef(e){let t=e.day(),l=0===t?-6:1-t;return e.add(l,"day").startOf("day")}function eg(e){let t=3*Math.floor(e.month()/3);return e.month(t).startOf("month")}function ev(e){return ec(String(e||"")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function ey(e){try{let t=String(e||"").replace(/=+$/g,"");if(!t||!/^[A-Za-z0-9_-]+$/.test(t))return;let l=t.replace(/-/g,"+").replace(/_/g,"/"),n=l.length%4==0?0:4-l.length%4,o=`${l}${"=".repeat(n)}`,r=ep(o);if(ev(r)!==t)return;return r}catch(e){return}}function ex(e){return"string"==typeof e&&en.test(e.trim())}function eb(e){if(!es(e))return!1;let t=ed((e||[]).map(e=>String(e)));return"date"===t[0]&&("preset"===t[1]?3===t.length&&eo.has(t[2]):"relative"===t[1]?5===t.length&&er.has(t[2])&&ei.has(t[3])&&"number"==typeof eh(t[4]):"exact"===t[1]&&"single"===t[2]&&"date"===t[3]?5===t.length&&/^v.+/.test(t[4]):"exact"===t[1]&&"range"===t[2]&&"date"===t[3]&&6===t.length&&/^v.+/.test(t[4])&&/^v.+/.test(t[5]))}function ew(e){if(!ex(e))return;let t=ed(ea(e)||[]);if("preset"===t[1]&&3===t.length&&eo.has(t[2]))return{type:t[2]};if("relative"===t[1]&&5===t.length&&er.has(t[2])&&ei.has(t[3])){let e=eh(t[4]);return"number"==typeof e?{type:t[2],unit:t[3],number:e}:void 0}if("exact"===t[1]&&"single"===t[2]&&"date"===t[3]&&5===t.length){let e=String(t[4]||"");if(!e.startsWith("v"))return;return ey(e.slice(1))}if("exact"===t[1]&&"range"===t[2]&&"date"===t[3]&&6===t.length){let e=String(t[4]||""),l=String(t[5]||"");if(!e.startsWith("v")||!l.startsWith("v"))return;let n=ey(e.slice(1)),o=ey(l.slice(1));if(void 0===n||void 0===o)return;return[n,o]}}function eS(e){if(ex(e))return String(e).trim();if(null==e||""===e)return;if(Array.isArray(e)){let t=em(e[0]),l=em(e[1]);return t&&l?eu(["date","exact","range","date",`v${ev(t)}`,`v${ev(l)}`]):t?eu(["date","exact","single","date",`v${ev(t)}`]):void 0}if("object"==typeof e&&e){let t=e,l="string"==typeof t.type?t.type:"";if("past"===l||"next"===l){let e="string"==typeof t.unit&&ei.has(t.unit)?t.unit:"day",n=Number(t.number),o=Number.isFinite(n)&&n>0?Math.floor(n):1;return eu(["date","relative",l,e,`n${o}`])}if(eo.has(l))return eu(["date","preset",l])}let t=em(e);if(t)return eu(["date","exact","single","date",`v${ev(t)}`])}function eC(e){let t=ed((e||[]).map(e=>String(e)));if("date"===t[0]){if("preset"===t[1]&&3===t.length){let e=t[2];if("now"===e)return el()().toISOString();let l=el()();return"today"===e?l.format("YYYY-MM-DD"):"yesterday"===e?l.add(-1,"day").format("YYYY-MM-DD"):"tomorrow"===e?l.add(1,"day").format("YYYY-MM-DD"):"thisWeek"===e?ef(l).format("YYYY-MM-DD"):"lastWeek"===e?ef(l.add(-1,"week")).format("YYYY-MM-DD"):"nextWeek"===e?ef(l.add(1,"week")).format("YYYY-MM-DD"):"thisMonth"===e?l.startOf("month").format("YYYY-MM-DD"):"lastMonth"===e?l.add(-1,"month").startOf("month").format("YYYY-MM-DD"):"nextMonth"===e?l.add(1,"month").startOf("month").format("YYYY-MM-DD"):"thisQuarter"===e?eg(l).format("YYYY-MM-DD"):"lastQuarter"===e?eg(l.add(-3,"month")).format("YYYY-MM-DD"):"nextQuarter"===e?eg(l.add(3,"month")).format("YYYY-MM-DD"):"thisYear"===e?l.startOf("year").format("YYYY-MM-DD"):"lastYear"===e?l.add(-1,"year").startOf("year").format("YYYY-MM-DD"):"nextYear"===e?l.add(1,"year").startOf("year").format("YYYY-MM-DD"):void 0}if("relative"===t[1]&&5===t.length&&er.has(t[2])&&ei.has(t[3])){let e=eh(t[4]);if("number"!=typeof e)return;let l="past"===t[2]?-1:1,n=t[3];return el()().add(l*e,n).format("YYYY-MM-DD")}if("exact"===t[1]&&"single"===t[2]&&"date"===t[3]&&5===t.length){let e=String(t[4]||"");if(!e.startsWith("v"))return;return ey(e.slice(1))}if("exact"===t[1]&&"range"===t[2]&&"date"===t[3]&&6===t.length){let e=String(t[4]||""),l=String(t[5]||"");if(!e.startsWith("v")||!l.startsWith("v"))return;let n=ey(e.slice(1)),o=ey(l.slice(1));if(void 0===n||void 0===o)return;return[n,o]}}}var eF=l(51143);let ek=new Set(["code","version"]);function eA(e){if(!e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.keys(e);if(!t.includes("code")||"string"!=typeof e.code||"version"in e&&null!=e.version&&"string"!=typeof e.version)return!1;for(let e of t)if(!ek.has(e))return!1;return!0}function eP(e){return{code:String((null==e?void 0:e.code)??""),version:String((null==e?void 0:e.version)??"v1")}}function ej(e){let t="",l="code";for(let n=0;n<e.length;n++){let o=e[n],r=n+1<e.length?e[n+1]:"";if("code"===l){if("/"===o&&"/"===r){t+=" ",n++,l="line";continue}if("/"===o&&"*"===r){t+=" ",n++,l="block";continue}if("'"===o){t+=" ",l="single";continue}if('"'===o){t+=" ",l="double";continue}t+=o;continue}if("line"===l){"\n"===o?(t+="\n",l="code"):t+=" ";continue}if("block"===l){"*"===o&&"/"===r?(t+=" ",n++,l="code"):t+="\n"===o?"\n":" ";continue}if("single"===l){if("\\"===o){t+=" ",n++;continue}"'"===o?(t+=" ",l="code"):t+="\n"===o?"\n":" ";continue}if("\\"===o){t+=" ",n++;continue}'"'===o?(t+=" ",l="code"):t+="\n"===o?"\n":" "}return t}function eM(e){let t="",l="code";for(let n=0;n<e.length;n++){let o=e[n],r=n+1<e.length?e[n+1]:"";if("code"===l){if("/"===o&&"/"===r){t+=" ",n++,l="line";continue}if("/"===o&&"*"===r){t+=" ",n++,l="block";continue}if("'"===o){t+=o,l="single";continue}if('"'===o){t+=o,l="double";continue}t+=o;continue}if("line"===l){"\n"===o?(t+="\n",l="code"):t+=" ";continue}if("block"===l){"*"===o&&"/"===r?(t+=" ",n++,l="code"):t+="\n"===o?"\n":" ";continue}if("single"===l){if(t+=o,"\\"===o){let l=n+1<e.length?e[n+1]:"";l&&(t+=l,n++);continue}"'"===o&&(l="code");continue}if(t+=o,"\\"===o){let l=n+1<e.length?e[n+1]:"";l&&(t+=l,n++);continue}'"'===o&&(l="code")}return t}function eI(e){let t;if(!e)return{subPath:"",wildcard:!1};let l=e;l=l.replace(/\[['"]([a-zA-Z_$][a-zA-Z0-9_$]*)['"]\]/g,".$1");let n=/\[([^\]]+)\]/g;for(;t=n.exec(l);){let e=String(t[1]??"").trim();if(!(/^\d+$/.test(e)||/^['"][a-zA-Z_$][a-zA-Z0-9_$]*['"]$/.test(e)))return{subPath:l.startsWith(".")?l.slice(1):l,wildcard:!0}}return l.startsWith(".")&&(l=l.slice(1)),{subPath:l,wildcard:!1}}function eT(e){let t=String(e||"").trim();if(!t||"ctx"===t)return null;let l=t.match(/^ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([\s\S]*)$/);if(l){let e=l[1]||"",t=eI(l[2]||"");return{varName:e,subPath:t.subPath,wildcard:t.wildcard}}let n=t.match(/^ctx\s*\[\s*(['"])([a-zA-Z_$][a-zA-Z0-9_$]*)\1\s*\]([\s\S]*)$/);if(n){let e=n[2]||"",t=eI(n[3]||"");return{varName:e,subPath:t.subPath,wildcard:t.wildcard}}return null}function eR(e){let t;if("string"!=typeof e||!e.trim())return{};let l=ej(e),n=eM(e),o=new Map,r=(e,t)=>{if(!e)return;let l=o.get(e)||new Set;l.add(t||""),o.set(e,l)},i=e=>{let t=eT(e);(null==t?void 0:t.varName)&&r(t.varName,t.wildcard?"":t.subPath)},a=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g;for(;t=a.exec(l);)i(`ctx.${t[1]||""}`);let s=/ctx\s*\[\s*(['"])([a-zA-Z_$][a-zA-Z0-9_$]*)\1\s*\]((?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g;for(;t=s.exec(n);)i(`ctx['${t[2]||""}']${t[3]||""}`);let d=/ctx\.getVar\s*\(\s*(['"])((?:\\.|(?!\1)[\s\S])*)\1\s*\)/g;for(;t=d.exec(n);){let e=String(t[2]||"").replace(/\\'/g,"'").replace(/\\"/g,'"').trim();e.startsWith("ctx")&&i(e)}let u={};for(let[e,t]of o.entries())u[e]=Array.from(t);return u}async function eE(e,t){let l={};if(!t||"object"!=typeof t||Array.isArray(t))return l;for(let[n,o]of Object.entries(t))if(void 0!==o){if(eA(o)){let{code:t,version:r}=eP(o);if(!t.trim())continue;let i=await (0,eF._)(e,t,{version:r});if(!(null==i?void 0:i.success))throw Error(`RunJS execution failed for "${n}"`);void 0!==i.value&&(l[n]=i.value);continue}l[n]=o}return l}var eN=l(49773);let eD="ctx.resolveJsonTemplate",eB=/\{\{\s*ctx(?:\.|\[|\?\.)/,e$=/\bctx(?:\?\.|\.)libs\b/,eO="__runjs_templateValueToString",eq=/\b__runjs_ctx_tpl_\d+\b/,e_=/\b__runjs_templateValueToString(?:_\d+)?\b/,eL=/\b__runjs_ctx_tpl_\d+\b|\b__runjs_templateValueToString(?:_\d+)?\b/,eV=/\b__runjs_ensure_libs\b/,ez=256,eK={withTemplates:new Map,withoutTemplates:new Map};function eU(e,t){let l=e.get(t);if(void 0!==l)return e.delete(t),e.set(t,l),l}function eW(e,t,l,n){if(e.has(t)&&e.delete(t),e.set(t,l),e.size<=n)return;let o=e.keys().next().value;void 0!==o&&e.delete(o)}function eH(e){return!!e&&/[A-Za-z0-9_$]/.test(e)}function eG(e){if(!e.startsWith("{{")||!e.endsWith("}}"))return!1;let t=e.slice(2,-2).trim();return t.startsWith("ctx.")||t.startsWith("ctx[")||t.startsWith("ctx?.")}function eY(e,t){if(!e.startsWith(eD,t))return!1;let l=t>0?e[t-1]:"",n=e[t+eD.length]||"";return!(eH(l)||eH(n))}function eJ(e,t){let l=t+2;for(;l<e.length;){let t=e[l];if(l+=1,"\n"===t)break}return l}function eX(e,t){let l=t+2;for(;l<e.length;){let t=e[l],n=e[l+1];if("*"===t&&"/"===n)return l+2;l+=1}return l}function eQ(e,t,l){let n=t+1;for(;n<e.length;){let t=e[n];if("\\"===t){n+=2;continue}if(n+=1,t===l)break}return n}function eZ(e,t){let l=t+1;for(;l<e.length;){let t=e[l];if("\\"===t){l+=2;continue}if("`"===t)return l+1;if("$"===t&&"{"===e[l+1]){l+=2;let t=1;for(;l<e.length&&t>0;){let n=e[l],o=e[l+1];if("'"===n||'"'===n){l=eQ(e,l,n);continue}if("`"===n){l=eZ(e,l);continue}if("/"===n&&"/"===o){l=eJ(e,l);continue}if("/"===n&&"*"===o){l=eX(e,l);continue}"{"===n?t+=1:"}"===n&&(t-=1),l+=1}continue}l+=1}return l}function e0(e){if(!eB.test(e))return[];let t=[],l=0;for(;l<e.length;){let n=e.indexOf("{{",l);if(-1===n)break;let o=e.indexOf("}}",n+2);if(-1===o)break;let r=e.slice(n,o+2);eG(r)&&t.push(r),l=o+2}return t}function e1(e,t){let l=t;for(;l<e.length&&/\s/.test(e[l]);)l+=1;return l}function e2(e,t){let l=t;for(;l>=0&&/\s/.test(e[l]);)l-=1;return l}function e8(e,t){let l=t;for(;;){l=e1(e,l);let t=e[l],n=e[l+1];if("/"===t&&"/"===n){l=eJ(e,l);continue}if("/"===t&&"*"===n){l=eX(e,l);continue}return l}}function e5(e){return!!e&&/[A-Za-z_$]/.test(e)}function e4(e,t){if(!e5(e[t]))return null;let l=t+1;for(;l<e.length&&eH(e[l]);)l+=1;return{name:e.slice(t,l),end:l}}function e3(e,t,l){if(e[t]!==l)return null;let n=t+1,o="";for(;n<e.length;){let t=e[n];if("\\"===t){let t=e[n+1];if(void 0===t)break;o+=t,n+=2;continue}if(t===l)return{value:o,end:n+1};o+=t,n+=1}return null}function e6(e,t){if(!e.startsWith("ctx",t))return null;let l=t>0?e[t-1]:"",n=e[t+3]||"";if(eH(l)||eH(n))return null;let o=e.slice(t+3);return o.startsWith(".libs")?t+3+5:o.startsWith("?.libs")?t+3+6:null}function e9(e,t){let l=e6(e,t);if(null===l)return null;let n=e8(e,l),o=e[n],r=e[n+1],i=e[n+2];if("?"===o&&"."===r&&"["===i){n=e8(e,n+3);let t=e[n];if("'"===t||'"'===t){let l=e3(e,n,t);if(!l)return{end:n+1};let o=e8(e,l.end);return"]"===e[o]&&(o+=1),{end:o,key:l.value}}return{end:n}}if("["===o){n=e8(e,n+1);let t=e[n];if("'"===t||'"'===t){let l=e3(e,n,t);if(!l)return{end:n+1};let o=e8(e,l.end);return"]"===e[o]&&(o+=1),{end:o,key:l.value}}return{end:n}}if("?"===o&&"."===r){n=e8(e,n+2);let t=e4(e,n);return t?{end:t.end,key:t.name}:{end:n}}if("."===o){n=e8(e,n+1);let t=e4(e,n);return t?{end:t.end,key:t.name}:{end:n}}return{end:l}}function e7(e){let t=[],l=String(e??""),n=0,o=0,r=0,i=0,a=e=>{let l=String(e??"").trim();if(!l||l.startsWith("..."))return;let n=l,o=0,r=0,i=0,a=0;for(;o<l.length;){let e=l[o],t=l[o+1];if("/"===e&&"/"===t)break;if("/"===e&&"*"===t){let e=l.indexOf("*/",o+2);o=-1===e?l.length:e+2;continue}if("'"===e||'"'===e){let t=o+1;for(;t<l.length;){let n=l[t];if("\\"===n){t+=2;continue}if(t+=1,n===e)break}o=t;continue}if("`"===e){let e=o+1;for(;e<l.length;){let t=l[e];if("\\"===t){e+=2;continue}if(e+=1,"`"===t)break}o=e;continue}if("{"===e?r+=1:"}"===e?r-=1:"["===e?i+=1:"]"===e?i-=1:"("===e?a+=1:")"===e&&(a-=1),0===r&&0===i&&0===a&&(":"===e||"="===e)){n=l.slice(0,o).trim();break}o+=1}if(!n)return;if(n.startsWith("'")||n.startsWith('"')){let e=n[0],l=e3(n,0,e);l&&t.push(l.value);return}let s=n.match(/^[A-Za-z_$][A-Za-z0-9_$]*/);s&&t.push(s[0])},s=0;for(;s<l.length;){let e=l[s],t=l[s+1];if("/"===e&&"/"===t)break;if("/"===e&&"*"===t){let e=l.indexOf("*/",s+2);s=-1===e?l.length:e+2;continue}if("'"===e||'"'===e){s=eQ(l,s,e);continue}if("`"===e){s=eZ(l,s);continue}"{"===e?o+=1:"}"===e?o-=1:"["===e?r+=1:"]"===e?r-=1:"("===e?i+=1:")"===e&&(i-=1),0===o&&0===r&&0===i&&","===e&&(a(l.slice(n,s)),n=s+1),s+=1}return a(l.slice(n)),t}function te(e){if(!e$.test(e))return[];let t=new Set,l=l=>{let o=l,r=1;for(;o<e.length&&r>0;){let l=e[o],i=e[o+1];if("/"===l&&"/"===i){o=eJ(e,o);continue}if("/"===l&&"*"===i){o=eX(e,o);continue}if("'"===l||'"'===l){o=eQ(e,o,l);continue}if("`"===l){o=n(o+1);continue}let a=e9(e,o);if(a){a.key&&t.add(a.key),o=a.end;continue}"{"===l?r+=1:"}"===l&&(r-=1),o+=1}return o},n=t=>{let n=t;for(;n<e.length;){let t=e[n],o=e[n+1];if("\\"===t){n+=2;continue}if("`"===t)return n+1;if("$"===t&&"{"===o){n=l(n+2);continue}n+=1}return n},o=0;for(;o<e.length;){let l=e[o],r=e[o+1];if("/"===l&&"/"===r){o=eJ(e,o);continue}if("/"===l&&"*"===r){o=eX(e,o);continue}if("'"===l||'"'===l){o=eQ(e,o,l);continue}if("`"===l){o=n(o+1);continue}let i=e9(e,o);if(i){i.key&&t.add(i.key),o=i.end;continue}if("="===l&&"="!==r&&">"!==r&&"<"!==r){let l=e8(e,o+1);if(null!==e6(e,l)){let l=e2(e,o-1);if("}"===e[l]){let n=0,o=l;for(;o>=0;){let t=e[o];if("}"===t)n+=1;else if("{"===t&&0==(n-=1))break;o-=1}if(o>=0&&"{"===e[o])for(let n of e7(e.slice(o+1,l)))t.add(n)}}}o+=1}return Array.from(t)}function tt(e){if(eV.test(e)||!e$.test(e))return e;let t=te(e);return t.length?`/* __runjs_ensure_libs */
3572
3572
  await ctx.__ensureLibs(${JSON.stringify(t)});
3573
3573
  ${e}`:e}function tl(e,t,l){let n=e1(e,l);if(":"!==e[n])return!1;let o=e2(e,t-1),r=o>=0?e[o]:"";return"{"===r||","===r}function tn(e,t,l,n){let o=Array.from(new Set(t));if(!o.length)return e;let r=e;for(let e of o){let t=l(e);r=`(${r}).split(${JSON.stringify(e)}).join(${n}(${t}, ${JSON.stringify(e)}))`}return r}function to(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!eB.test(e))return e;let l=!1!==t.processBarePlaceholders,n=!1!==t.processStringLiterals;if(l&&n&&eL.test(e)||l&&!n&&eq.test(e)||!l&&n&&e_.test(e))return e;let o=new Map,r=[],i=!1,a=new Set,s=(t=>{if(!e.includes(t)&&!a.has(t))return a.add(t),t;let l=1;for(;e.includes(`${t}_${l}`)||a.has(`${t}_${l}`);)l+=1;let n=`${t}_${l}`;return a.add(n),n})(eO),d=0,u=()=>{for(;;){let t=`__runjs_ctx_tpl_${d}`;if(d+=1,!(e.includes(t)||a.has(t)))return a.add(t),t}},c=e=>{let t=o.get(e);if(t)return t;let l=u();return o.set(e,l),r.push(`const ${l} = await ctx.resolveJsonTemplate(${JSON.stringify(e)});`),l},p="",m=0,h=!1,f=0;for(;m<e.length;){let t=e[m],o=e[m+1];if("/"===t&&"/"===o){let t=eJ(e,m);p+=e.slice(m,t),m=t;continue}if("/"===t&&"*"===o){let t=eX(e,m);p+=e.slice(m,t),m=t;continue}if("'"===t||'"'===t){let l=eQ(e,m,t),o=e.slice(m,l);if(n&&0===f){let t=e0(o);if(t.length){i=!0;let n=tn(o,t,c,s);p+=tl(e,m,l)?`[${n}]`:n}else p+=o}else p+=o;m=l;continue}if("`"===t){let t=eZ(e,m),l=e.slice(m,t);if(n&&0===f){let n=e0(l);if(n.length){i=!0;let o=tn(l,n,c,s);p+=tl(e,m,t)?`[${o}]`:o}else p+=l}else p+=l;m=t;continue}if(0===f&&!h&&eY(e,m)){p+=eD,m+=eD.length,h=!0;continue}if(h){if(/\s/.test(t)){p+=t,m+=1;continue}if("("===t){p+=t,m+=1,h=!1,f=1;continue}h=!1;continue}if(f>0){"("===t?f+=1:")"===t&&(f-=1),p+=t,m+=1;continue}if(l&&"{"===t&&"{"===o){let t=e.indexOf("}}",m+2);if(-1!==t){let l=e.slice(m,t+2);if(eG(l)){p+=c(l),m=t+2;continue}}}p+=t,m+=1}if(!r.length)return p;let g=[];return i&&g.push(`const ${s} = (value, placeholder) => {`," if (typeof value === 'undefined') return placeholder;"," if (typeof value === 'object' && value !== null) {"," try {"," return JSON.stringify(value);"," } catch (e) {"," return String(value);"," }"," }"," return String(value);","};"),g.push(...r),`${g.join("\n")}
3574
- ${p}`}async function tr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l="string"==typeof e?e:String(e??""),n=!!t.preprocessTemplates,o=n?eK.withTemplates:eK.withoutTemplates,r=eU(o,l);if(r)return await r;let i=(async()=>{if(!n)return tt(await (0,eN.W)(l));let e=to(l,{processStringLiterals:!1});return tt(to(await (0,eN.W)(e),{processBarePlaceholders:!1}))})();eW(o,l,i,ez);try{return await i}catch(e){throw o.delete(l),e}}var ti=l(62572);function ta(e){if(Array.isArray(e)){let t=e.map(e=>ta(e)).filter(e=>void 0!==e);return t.length?t:void 0}if(e&&"object"==typeof e){let t={};return Object.keys(e).forEach(l=>{let n=ta(e[l]);void 0!==n&&(t[l]=n)}),Object.keys(t).length?t:void 0}return null==e||"string"==typeof e&&""===e?void 0:e}let ts=e=>"string"==typeof e.on?"beforeRender"===e.on:"object"==typeof e.on?"beforeRender"===e.on.eventName:!e.on&&!0!==e.manual;var td=l(47684);let tu="0123456789abcdefghijklmnopqrstuvwxyz";function tc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11,l="";for(let e=0;e<t;e++)l+=tu[Math.random()*tu.length|0];return`${e}${l}`}},49773(e,t,l){"use strict";async function n(e){if(!/<[A-Za-z]|<\//.test(e))return e;try{var t;let n=await l.e("1339").then(l.bind(l,1608)),o=(null==n?void 0:n.transform)||(null==n||null==(t=n.default)?void 0:t.transform);if("function"!=typeof o)return e;let r=o(e,{transforms:["jsx"],jsxPragma:"ctx.React.createElement",jsxFragmentPragma:"ctx.React.Fragment",disableESTransforms:!0,production:!0});return(r&&(r.code||(null==r?void 0:r.output)))??e}catch(t){return e}}l.d(t,{W:()=>n})},81982(e,t,l){"use strict";l.d(t,{M:()=>m,gG:()=>i,mv:()=>a,o4:()=>p});var n=l(40542),o=l(2543),r=l.n(o);async function i(e,t){if(!e)return{};if("function"==typeof e)try{return await e(t)||{}}catch(e){return console.error("Error resolving defaultParams function:",e),{}}return e}async function a(e,t,l){if(!e)return{};if("function"==typeof e)try{return await e(t,l)||{}}catch(e){return console.error("Error resolving createModelOptions function:",e),{}}return e}let s={queue:[],timer:null,inflightByRun:new Map},d=10;function u(e){if(Array.isArray(e))return e.map(u);if(r().isPlainObject(e)){let t=Object.entries(e).map(e=>{let[t,l]=e;return[t,u(l)]});return Object.fromEntries(r().sortBy(t,e=>{let[t]=e;return t}))}return e}function c(e){try{return JSON.stringify(u(e))}catch{try{return JSON.stringify(e)}catch{return String(e)}}}function p(e,t){let l,n,o=s,r=e.runId||"GLOBAL",i=c(t),a=o.inflightByRun.get(r);a||(a=new Map,o.inflightByRun.set(r,a));let u=a.get(i);if(u)return u;let p=new Promise((e,t)=>{l=e,n=t});a.set(i,p);let m={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,ctx:e,payload:t,resolve:l,reject:n,runId:r,dedupKey:i};o.queue.push(m);let h=async()=>{var t,l,n,r,i,a;let s=o.queue.splice(0,o.queue.length);if(o.timer=null,!s.length)return;let d=null==(t=s[0].ctx)?void 0:t.api;if(!d){for(let e of s)try{e.resolve(e.payload.template)}catch(t){e.reject(t)}finally{null==(l=o.inflightByRun.get(e.runId))||l.delete(e.dedupKey)}return}try{let e=s.map(e=>({id:e.id,template:e.payload.template,contextParams:e.payload.contextParams||{}})),t=await d.request({method:"POST",url:"variables:resolve",data:{values:{batch:e}}}),l=t.data??t,r=l.data??l,i=null==r?void 0:r.results,a=Array.isArray(i)?i:Array.isArray(r)?r:[],u=new Map;for(let e of a){let t=(null==e?void 0:e.id)!=null?String(e.id):"";t&&u.set(t,null==e?void 0:e.data)}for(let e of s)try{let t=String(e.id),l=u.has(t)?u.get(t):e.payload.template;e.resolve(l)}catch(t){e.reject(t)}finally{null==(n=o.inflightByRun.get(e.runId))||n.delete(e.dedupKey)}}catch(t){for(let l of s)try{null==e||null==(i=e.logger)||null==(r=i.warn)||r.call(i,{err:t},"variables:resolve(batch) failed, fallback"),l.resolve(l.payload.template)}catch(e){l.reject(e)}finally{null==(a=o.inflightByRun.get(l.runId))||a.delete(l.dedupKey)}}};return o.timer||(o.timer=setTimeout(h,d)),p}async function m(e,t){let l=async e=>{if("string"==typeof e&&/\{\{.*?\}\}/.test(e))return await g(e,t);if(Array.isArray(e))return Promise.all(e.map(l));if(e&&"object"==typeof e){let t={};for(let[n,o]of Object.entries(e))t[n]=await l(o);return t}return e};return l(e)}async function h(e,t){let l=await f(e.trim(),t),n=await t.runjs(`return ${l}`,{t:t.t});return(null==n?void 0:n.success)?n.value:void 0}async function f(e,t){let l,n=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g,o=[],r=new Set;for(;null!==(l=n.exec(e));){let e=l[0],t=l[1],n=t.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)/);if(n){let l=n[1],i=t.substring(l.length);o.push({fullPath:e,firstKey:l,restPath:i}),r.add(l)}}if(0===o.length)return e;let i=new Map;for(let e of r)try{let l=await t[e],n=l&&!0===l.__isRecordProxy__;i.set(e,n)}catch(t){i.set(e,!1)}o.sort((e,t)=>t.fullPath.length-e.fullPath.length);let a=e;for(let{fullPath:e,firstKey:t,restPath:l}of o){let n,o=i.get(t)||!1;n=""===l?`await ctx.${t}`:o?`await (await ctx.${t})${l}`:`(await ctx.${t})${l}`;let r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=RegExp(`\\b${r}\\b`,"g");a=a.replace(s,n)}return a}async function g(e,t){let l=e=>{let t=e.trim().match(/^ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\.([a-zA-Z_$][a-zA-Z0-9_$-]*(?:\.[a-zA-Z_$][a-zA-Z0-9_$-]*)*))?$/);return t?t[2]?`${t[1]}.${t[2]}`:t[1]:null},o=async e=>{let l=e.split("."),o=l.shift();if(!o)return;let r=await t[o];return 0===l.length?r:(0,n.D)(r,l.join("."))},r=async e=>{let n=l(e);if(n){let l=await o(n);return void 0===l&&n.includes("-")?await h(e,t):l}return await h(e,t)},i=e.match(/^\s*\{\{\s*([^{}]+?)\s*\}\}\s*$/);if(i){let e=i[1];return await r(e)}let a=[...e.matchAll(/\{\{\s*(.+?)\s*\}\}/g)],s=e;for(let[e,t]of a){let l=await r(t);if(void 0!==l){let t="object"==typeof l&&null!==l?JSON.stringify(l):String(l);s=s.replace(e,t)}}return s}},47684(e,t,l){"use strict";function n(e,t){if(!e||"string"!=typeof e)throw Error("invalid url");let l=e.trim();if(l.startsWith("http://")||l.startsWith("https://"))return l;let n=window.__esm_cdn_base_url__||"https://esm.sh",o=(null==t?void 0:t.addSuffix)&&window.__esm_cdn_suffix__||"",r=n.replace(/\/$/,""),i=l.replace(/^\//,"");if(null==t?void 0:t.raw){let e=i.includes("?")?"&":"?";return`${r}/${i}${e}raw`}return`${r}/${i}${o}`}function o(e){return!!e&&"string"==typeof e&&e.split("?")[0].split("#")[0].endsWith(".css")}l.d(t,{i:()=>n,y:()=>o})},51143(e,t,l){"use strict";function n(){var e,t;let l=globalThis;if((null==(e=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:e.windowAllow)&&(null==(t=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:t.documentAllow))return l.__nocobaseRunJSSafeGlobalsRegistry;let n={windowAllow:new Set,documentAllow:new Set};return l.__nocobaseRunJSSafeGlobalsRegistry=n,n}function o(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.windowAllow.add(e)}}function r(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.documentAllow.add(e)}}function i(e){return n().windowAllow.has(e)}function a(e){return n().documentAllow.has(e)}function s(e){let t=()=>`${window.location.origin}${window.location.pathname}`,l=(e,l,n)=>{if(!(e=>{try{let l=new URL(e,t()),n=l.protocol.toLowerCase();if("about:"===n)return"about:blank"===l.href;return"http:"===n||"https:"===n}catch{return!1}})(e))throw Error("Unsafe URL: window.open only allows http/https/about:blank.");let o="_blank",r=(e=>{let t=new Set;return e&&e.split(",").map(e=>e.trim()).filter(Boolean).forEach(e=>{let l=e.split("=")[0].trim().toLowerCase();"noopener"!==l&&"noreferrer"!==l&&t.add(e)}),t.add("noopener"),t.add("noreferrer"),Array.from(t).join(",")})(n),i=window.open.call(window,e,o,r);if(i&&"opener"in i)try{i.opener=null}catch{}return i},n=(e,n)=>{let o=new URL(e,t()),r=o.protocol.toLowerCase(),i="about:"===r&&"about:blank"===o.href;if("http:"!==r&&"https:"!==r&&!i)throw Error("Unsafe URL: only http/https/about:blank are allowed.");if(i)return(null==n?void 0:n.replace)?window.location.replace("about:blank"):window.location.assign("about:blank");if(o.protocol===window.location.protocol&&o.hostname===window.location.hostname&&o.port===window.location.port)return(null==n?void 0:n.replace)?window.location.replace(o.href):window.location.assign(o.href);if(!l(o.href))throw Error("Popup blocked: cross-origin navigation is opened in a new tab.")},o=new Proxy({},{get(e,t){switch(t){case"origin":return window.location.origin;case"protocol":return window.location.protocol;case"host":return window.location.host;case"hostname":return window.location.hostname;case"port":return window.location.port;case"pathname":return window.location.pathname;case"assign":return e=>n(e,{replace:!1});case"replace":return e=>n(e,{replace:!0});case"reload":return window.location.reload.bind(window.location);case"href":throw Error("Reading location.href is not allowed.");default:throw Error(`Access to location property "${t}" is not allowed.`)}},set(e,t,l){if("href"===t)return n(String(l),{replace:!1}),!0;throw Error("Mutation on location is not allowed.")}}),r={setTimeout:window.setTimeout.bind(window),clearTimeout:window.clearTimeout.bind(window),setInterval:window.setInterval.bind(window),clearInterval:window.clearInterval.bind(window),console,Math,Date,FormData,..."u">typeof Blob?{Blob}:{},..."u">typeof URL?{URL}:{},addEventListener:addEventListener.bind(window),open:l,location:o,...e||{}};return new Proxy(Object.create(null),{get(e,t){if("string"!=typeof t)return Reflect.get(e,t);if(t in r)return r[t];if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(i(t)){let e=window[t];return"function"==typeof e?e.bind(window):e}throw Error(`Access to global property "${t}" is not allowed.`)},set(e,t,l){if("string"!=typeof t)return Reflect.set(e,t,l),!0;if(t in r)throw Error(`Mutation of global property "${t}" is not allowed.`);return e[t]=l,!0},has:(e,t)=>"string"!=typeof t?Reflect.has(e,t):!!(t in r||Object.prototype.hasOwnProperty.call(e,t)||i(t))})}function d(e){let t={createElement:document.createElement.bind(document),querySelector:document.querySelector.bind(document),querySelectorAll:document.querySelectorAll.bind(document),...e||{}};return new Proxy(Object.create(null),{get(e,l){if("string"!=typeof l)return Reflect.get(e,l);if(l in t)return t[l];if(Object.prototype.hasOwnProperty.call(e,l))return e[l];if(a(l)){let e=document[l];return"function"==typeof e?e.bind(document):e}throw Error(`Access to document property "${l}" is not allowed.`)},set(e,l,n){if("string"!=typeof l)return Reflect.set(e,l,n),!0;if(l in t)throw Error(`Mutation of document property "${l}" is not allowed.`);return e[l]=n,!0},has:(e,l)=>"string"!=typeof l?Reflect.has(e,l):!!(l in t||Object.prototype.hasOwnProperty.call(e,l)||a(l))})}function u(e){var t;let l="u">typeof window&&window.navigator||void 0,n={},o=null==l||null==(t=l.clipboard)?void 0:t.writeText;"function"==typeof o&&(n.writeText=o.bind(l.clipboard));let r={clipboard:n};return Object.defineProperty(r,"onLine",{get:()=>!!(null==l?void 0:l.onLine),enumerable:!0,configurable:!1}),Object.defineProperty(r,"language",{get:()=>null==l?void 0:l.language,enumerable:!0,configurable:!1}),Object.defineProperty(r,"languages",{get:()=>(null==l?void 0:l.languages)?[...l.languages]:void 0,enumerable:!0,configurable:!1}),Object.assign(r,e||{}),new Proxy({},{get(e,t){if(t in r)return r[t];throw Error(`Access to navigator property "${String(t)}" is not allowed.`)}})}function c(e){let t={};try{let e=u();t.navigator=e;try{t.window=s({navigator:e})}catch{}}catch{}try{t.document=d()}catch{}return e?{...t,...e}:t}async function p(e,t,l,n){if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.runjs)return e.runjs(t,c(n),l)}l.d(t,{D1:()=>u,I2:()=>c,Vm:()=>o,Xh:()=>d,_:()=>p,ey:()=>s,yz:()=>r})},22928(e,t,l){"use strict";function n(e){let t={};return Object.entries(e||{}).forEach(e=>{let[l,n]=e;null!=n&&(t[l]=n)}),t}function o(e,t,l){try{var n,o,r,i,a;let s=null==(o=e.dataSourceManager)||null==(n=o.getDataSource)?void 0:n.call(o,t||"main"),d=null==s||null==(i=s.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,l);return(null==d||null==(a=d.getPrimaryKey)?void 0:a.call(d))||"id"}catch(e){return"id"}}function r(e,t){var l,r;if(!t)return;let i=t.dataSourceKey||"main",a=t.collection||(null==(l=t.record)?void 0:l.__collectionName);if(!a)return;let s=o(e,i,a)||"id",d=void 0!==t.filterByTk?t.filterByTk:void 0!==t.id?t.id:null==(r=t.record)?void 0:r[s];if(void 0!==d)return n({collection:a,filterByTk:d,dataSourceKey:i,associationName:t.associationName,sourceId:t.sourceId,fields:t.fields,appends:t.appends})}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=e=>!!e&&"object"==typeof e&&"string"==typeof e.collection&&(void 0!==e.filterByTk||void 0!==e.id||e.record),n={},o=(t,i)=>{if(l(t)){let l=r(e,t);l&&(n[i.join(".")]=l);return}if(Array.isArray(t)){for(let e=0;e<t.length;e++)o(t[e],[...i,String(e)]);return}if(t&&"object"==typeof t){for(let[e,l]of Object.entries(t))o(l,[...i,e]);return}};return o(t,[]),Object.keys(n).length?n:void 0}l.d(t,{d:()=>i})},88439(e,t,l){"use strict";function n(e,t,l,n){let o={},r={};for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a)){let s=t[a],d={};if(s.uiSchema&&"object"==typeof s.uiSchema){for(let[e,t]of Object.entries(s.uiSchema))if(t&&"object"==typeof t){var i;let l=t;d[e]={type:l.type||"any",title:l.title||(null==(i=l["x-decorator-props"])?void 0:i.label)||e,interface:l["x-component"],uiSchema:l}}}let u=Object.keys(d).length>0;r[a]={type:"object",title:e.t(s.title)||a,display:u?"default":"none",properties:u?{params:{type:"object",title:"Parameters",display:"flatten",properties:d}}:void 0},o[a]={get params(){return l.getStepParams(n,a)||{}},get uiSchema(){return s.uiSchema},result:void 0}}e.defineProperty("steps",{get:()=>o})}l.d(t,{w:()=>n})},73398(e,t,l){"use strict";function n(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=r.exec(o));)t.add(e[1]);let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=i.exec(o));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function o(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=r.exec(o));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],o=e[3]||"";t[l].push(`${n}${o}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],o=e[2]||"";t[l].push(`[${n}]${o}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=i.exec(o));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],o=n[3]||"";t[e].push(`${l}${o}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],o=n[2]||"";t[e].push(`[${l}]${o}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}l.d(t,{xI:()=>h,vP:()=>y,$S:()=>f,pc:()=>g,Cg:()=>c,nN:()=>x,ju:()=>b,Xx:()=>m,vE:()=>p,XU:()=>u,UX:()=>v});var r=l(22928),i=l(35846),a=l(44476),s=l(2543),d=l.n(s);function u(e){var t,l,n,o;let r=e.resource,i=e.collection,a=e.record,s=(null==i?void 0:i.name)||(null==r||null==(t=r.getResourceName)?void 0:t.call(r)),d=(null==i?void 0:i.dataSourceKey)||(null==r||null==(l=r.getDataSourceKey)?void 0:l.call(r)),u=(null==r||null==(n=r.getFilterByTk)?void 0:n.call(r))??(null==i||null==(o=i.getFilterByTK)?void 0:o.call(i,a));if(!s||null==u)return;let c=String(s).split(".");return{collection:c[c.length-1],dataSourceKey:d,filterByTk:u}}function c(e){var t,l,n;let o=e.view;if(!o)return;let r=(null==o?void 0:o.inputArgs)||{},i=(null==r?void 0:r.collectionName)||(null==o||null==(t=o.record)?void 0:t.collection),a=(null==r?void 0:r.dataSourceKey)||(null==o||null==(l=o.record)?void 0:l.dataSourceKey)||"main",s=(null==r?void 0:r.filterByTk)||(null==o||null==(n=o.record)?void 0:n.filterByTk),d=null==r?void 0:r.associationName,u=null==r?void 0:r.sourceId;if(i&&null!=s)return{collection:i,dataSourceKey:a,filterByTk:s,sourceId:u,associationName:d}}function p(e,t){var l,n,o;let r=null==(l=e.inputArgs)?void 0:l.record,i=null==(n=e.collection)?void 0:n.filterTargetKey;if(!r||!i)return;let a=t.view,s=null==a||null==(o=a.inputArgs)?void 0:o.filterByTk,u=r[i];if(null!=s&&null!=u&&s===u)return d().cloneDeep(r)}function m(e,t){return l=>{var n,o,r,i;if(!("record"===l||l.startsWith("record.")))return!1;let s=t();if(!s)return!0;if("record"===l)return!1;let d=c(e),u=null==d?void 0:d.collection,p=(null==d?void 0:d.dataSourceKey)||"main";if(!u)return!0;let m=null==(o=e.dataSourceManager)||null==(n=o.getDataSource)?void 0:n.call(o,p),h=null==m||null==(i=m.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,u);if(!h)return!0;let f=(0,a.H)(()=>h,()=>s),g=l.startsWith("record.")?l.slice(7):"";return!!g&&f(g)}}function h(e,t){let l=(0,a.H)(e,()=>t());return n=>{let o=t();if(!o)return!0;if(!n)return!1;let r=e();if(!n.includes(".")){var i;let e,t=n;return r&&("function"==typeof r.getField&&(e=r.getField(t)),e||"function"!=typeof r.getFields||(e=(r.getFields()||[]).find(e=>(null==e?void 0:e.name)===t))),!!(null==e||null==(i=e.isAssociationField)?void 0:i.call(e))&&null==(null==o?void 0:o[t])}return l(n)}}async function f(e,t,l){let n=await (0,i.H)(e,t,!0)();return n?{...n,buildVariablesParams:e=>l?l(e):u(e)}:null}function g(e,t,l){let n=async()=>f(e,t,l);return n.title=t,n}function v(e,t,l){var n,o;return g(t,(null==l?void 0:l.title)?(null==(n=e.t)?void 0:n.call(e,l.title))||l.title:(null==(o=e.t)?void 0:o.call(e,"Current record"))||"Current record",e=>u(e))}let y=n,x=o;async function b(e,t){let l=Object.keys(o(t)||{});if(!l.length)return;let n={};for(let t of l){var i;let l,o=null==(i=e.getPropertyOptions)?void 0:i.call(e,t),r=null==o?void 0:o.meta;if(r){try{let t="function"==typeof r?await r():r,n=null==t?void 0:t.buildVariablesParams;"function"==typeof n&&(l=await n(e))}catch(e){continue}l&&(n[t]=l)}}return(0,r.d)(e,n)}},67778(e,t,l){"use strict";l.d(t,{sp:()=>j,bt:()=>R,U:()=>et,N5:()=>K,xB:()=>q,mW:()=>O,fP:()=>G});var n=l(74848),o=l(96540),r=l(99418),i=l(11869),a=l(29007),s=l(52568),d=l(73398);function u(e){return null!=e}function c(e,t){if(e===t)return!0;if(!u(e)||!u(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch(l){return String(e)===String(t)}}function p(e){var t;let l=null==e||null==(t=e.navigation)?void 0:t.viewStack;return Array.isArray(l)?l:[]}function m(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p(e);if(!l.length)return -1;let n=(null==e?void 0:e.inputArgs)||{},o=(null==e||null==(t=e.navigation)?void 0:t.viewParams)||{},r=n.viewUid??o.viewUid;if(!r)return l.length-1;let i=l.map((e,t)=>({item:e,index:t})).filter(e=>{let{item:t}=e;return(null==t?void 0:t.viewUid)===r});if(!i.length)return l.length-1;let a=["filterByTk","sourceId","tabUid"],s=i[i.length-1].index,d=-1;for(let{item:e,index:t}of i){let l=0,o=!0;for(let t of a)if(u(n[t])){if(!c(null==e?void 0:e[t],n[t])){o=!1;break}l+=1}o&&l>=d&&(s=t,d=l)}return s}function h(e,t){return t??e.view}function f(e){var t;if(!e)return!1;let l=p(e),n=null==e||null==(t=e.inputArgs)?void 0:t.openerUids,o=Array.isArray(n)&&n.length>0;return m(e,l)>=1||o}function g(e,t){let l=t=>e.t(t),n=function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;return f(h(l,t))},o=async e=>{let l=h(e,t);if(!l||!f(l))return;let n=await v(e,l),o=null==n?void 0:n.resource;return(null==o?void 0:o.collectionName)&&null!=o.filterByTk?{collection:o.collectionName,dataSourceKey:o.dataSourceKey||"main",filterByTk:o.filterByTk,associationName:o.associationName,sourceId:o.sourceId}:(0,d.Cg)(e)},r=async()=>{var t,l,n,r;let i=await o(e);if(!(null==i?void 0:i.collection))return null;let a=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,i.dataSourceKey||"main");return(null==a||null==(r=a.collectionManager)||null==(n=r.getCollection)?void 0:n.call(r,i.collection))||null},i=async(l,n)=>{var o,r,i,a,s,d;try{let s=n||e,d=h(s,t),u=p(d),c=m(d,u);if(c<1||l<1)return;let f=c-l;if(f<1)return;let g=u[f];if(!(null==g?void 0:g.viewUid))return;let v=null==(o=s.engine)?void 0:o.getModel(g.viewUid,!0);if(!v)try{v=await s.engine.loadModel({uid:g.viewUid})}catch(t){null==(a=s.logger||e.logger)||null==(i=a.warn)||i.call(a,{err:t},"[FlowEngine] popup.getParentRecordRef loadModel failed")}let y=(null==v||null==(r=v.getStepParams)?void 0:r.call(v,"popupSettings","openView"))||{},x=null==y?void 0:y.collectionName,b=(null==y?void 0:y.dataSourceKey)||"main",w=(null==g?void 0:g.filterByTk)??(null==g?void 0:g.sourceId);if(!x||null==w)return;return{collection:x,dataSourceKey:b,filterByTk:w,sourceId:null==g?void 0:g.sourceId,associationName:null==y?void 0:y.associationName}}catch(t){null==(d=(null==n?void 0:n.logger)||e.logger)||null==(s=d.warn)||s.call(d,{err:t},"[FlowEngine] popup.getParentRecordRef failed");return}},a=l=>{try{let n=h(e,t),o=p(n);return m(n,o)-l>=1}catch(e){return!1}},s=t=>{let n=()=>({type:"object",title:l("Parent popup"),disabled:()=>!a(t),disabledReason:()=>a(t)?void 0:l("No parent popup"),hidden:()=>!a(t),properties:async()=>{let n=await i(t),o={};if(o.uid={type:"string",title:l("Popup uid")},n){let t=(()=>{try{var t,l,o,r;let i=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,n.dataSourceKey||"main");return(null==i||null==(r=i.collectionManager)||null==(o=r.getCollection)?void 0:o.call(r,n.collection||""))||null}catch(e){return null}})();o.record=await (0,d.$S)(()=>t,l("Popup record"),()=>n)||{type:"object",title:l("Popup record")}}else o.record={type:"object",title:l("Popup record")};return o.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},o}});return n.title=l("Parent popup"),n},u=()=>({type:"object",title:l("Current popup"),disabled:()=>!n(),hidden:()=>!n(),buildVariablesParams:async e=>{var l,r,a,s;if(!n(e))return;let d=await o(e),u=h(e,t),c=null==u?void 0:u.inputArgs,f={};if(d){let e={...d};!e.associationName&&(null==c?void 0:c.associationName)&&(e.associationName=c.associationName),void 0===e.sourceId&&void 0!==(null==c?void 0:c.sourceId)&&(e.sourceId=null==c?void 0:c.sourceId),f.record=e}try{let t=p(u);if(m(u,t)>=2){let t=f,l=1,n=await i(l,e);for(;n;)t.parent||(t.parent={}),t.parent.record=n,t=t.parent,l+=1,n=await i(l,e)}}catch(t){null==(r=e.logger)||null==(l=r.debug)||l.call(r,{err:t},"[FlowEngine] buildVariablesParams: build parent-chain failed")}try{let e=null==c?void 0:c.sourceId,t=null==c?void 0:c.associationName,l=(null==c?void 0:c.dataSourceKey)||"main";if(null!=e&&""!==e&&t&&"string"==typeof t){let n=String(t).split(".")[0];n&&(f.sourceRecord={collection:n,dataSourceKey:l,filterByTk:e})}}catch(t){null==(s=e.logger)||null==(a=s.debug)||a.call(s,{err:t},"[FlowEngine] buildVariablesParams: infer sourceRecord failed")}return f},properties:async()=>{var n,a,u,c;let f={};if(f.uid={type:"string",title:l("Popup uid")},await o(e)){let e=async()=>{let e=await r();return e?await (0,d.$S)(()=>e,l("Current popup record"),e=>o(e)):null};e.title=l("Current popup record"),e.hasChildren=!0,f.record=e}try{let o=h(e,t),r=null==o?void 0:o.inputArgs,i=null==r?void 0:r.sourceId,s=null==r?void 0:r.associationName,u=(null==r?void 0:r.dataSourceKey)||"main";if(!s||"string"!=typeof s||!s.includes(".")){let t=p(o),l=m(o,t),r=l>=0?null==t?void 0:t[l]:void 0;if(null==r?void 0:r.viewUid){let t=null==e||null==(n=e.engine)?void 0:n.getModel(r.viewUid,!0);t||(t=await e.engine.loadModel({uid:r.viewUid}));let l=(null==t||null==(a=t.getStepParams)?void 0:a.call(t,"popupSettings","openView"))||{};s=(null==l?void 0:l.associationName)||s,u=(null==l?void 0:l.dataSourceKey)||u}}if(null!=i&&""!==i&&s&&"string"==typeof s){let t=String(s).includes(".")?String(s).split(".")[0]:void 0;if(t){let n=()=>{try{var l,n,o,r;let i=null==(n=e.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);return(null==i||null==(r=i.collectionManager)||null==(o=r.getCollection)?void 0:o.call(r,t))||null}catch(e){return null}},o=await (0,d.$S)(n,l("Current popup parent record"),()=>({collection:t,dataSourceKey:u,filterByTk:i}));o&&(f.sourceRecord=o)}}}catch(t){null==(c=e.logger)||null==(u=c.debug)||u.call(c,{err:t},"[FlowEngine] popup.properties: build sourceRecord failed")}return f.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},await i(1)&&(f.parent=s(1)),f}});return u.title=l("Current popup"),u.sort=975,u}async function v(e,t){var l;let n=p(t),o=m(t,n),r=null==t||null==(l=t.inputArgs)?void 0:l.openerUids,i=Array.isArray(r)&&r.length>0;if(!(o>=1||i))return;if(!n.length){let e=(null==t?void 0:t.inputArgs)||{};if(!(e.collectionName||null!=e.filterByTk||null!=e.sourceId||e.associationName||e.viewUid))return;return{uid:e.viewUid,resource:{dataSourceKey:e.dataSourceKey||"main",collectionName:e.collectionName,associationName:e.associationName,filterByTk:e.filterByTk,sourceId:e.sourceId}}}let a=async t=>{var l,o,r,i,s,d;if(t<0||!(null==(l=n[t])?void 0:l.viewUid))return;let u=n[t].viewUid,c=null==(o=e.engine)?void 0:o.getModel(u,!0);c||(c=await (null==(d=e.engine)?void 0:d.loadModel({uid:u})));let p=(null==c||null==(r=c.getStepParams)?void 0:r.call(c,"popupSettings","openView"))||{},m=null==p?void 0:p.collectionName,h={uid:u,resource:{dataSourceKey:(null==p?void 0:p.dataSourceKey)||"main",collectionName:m,associationName:null==p?void 0:p.associationName,filterByTk:null==(i=n[t])?void 0:i.filterByTk,sourceId:null==(s=n[t])?void 0:s.sourceId}},f=await a(t-1);return f&&(h.parent=f),h};return await a(o)}function y(e,t){let l=/^(?:record|sourceRecord)(?:\.|$)|^parent(?:\.parent)*(?:\.(?:record|sourceRecord))(?:\.|$)/;e.defineProperty("popup",{get:async()=>v(e,t),meta:g(e,t),resolveOnServer:e=>{try{return!!e&&l.test(e)}catch(e){return!1}}})}var x=l(18182);let b=(0,o.forwardRef)((e,t)=>{let{afterClose:l,footer:r,header:i,hidden:a,...s}=e,[d,u]=(0,o.useState)(!0),[c,p]=(0,o.useState)(s),[m,h]=(0,o.useState)(()=>r),[f,g]=(0,o.useState)(i);(0,o.useImperativeHandle)(t,()=>({destroy:()=>{u(!1),null==l||l()},update:e=>p(t=>({...t,...e})),setFooter:e=>{h(e)},setHeader:e=>{0===Object.values(e||{}).length?g(null):g(e)}}));let v={...c,title:(null==f?void 0:f.title)||c.title,extra:null==f?void 0:f.extra,footer:void 0!==m?m:c.footer??null},y=o.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return(0,n.jsx)(x.A,{closable:!1,rootClassName:a?"nb-hidden":"",getContainer:y,...v,open:d,onCancel:c.onCancel,afterClose:()=>{null==l||l()},children:c.children})});function w(){let[e,t]=o.useState([]);return[e,o.useCallback(e=>(t(t=>[...t,e]),()=>{t(t=>t.filter(t=>t!==e))}),[])]}var S=l(16639),C=l(20616),F=l(47451);async function k(e,t){var l;return!!t.force||!1!==await (null==(l=e.beforeClose)?void 0:l.call(e,t))}function A(e,t){var l;let n=null==t?void 0:t.layoutContext,o=null==t||null==(l=t.engine)?void 0:l.context;n instanceof a.cB&&n!==t&&n!==o&&e.addDelegate(n)}let P=0;function j(){let e=o.useRef(null),t=(t,l)=>{var u,c,p;let m,h,f=null==l?void 0:l.engine;P+=1;let g=o.createRef(),v=new Promise(e=>{h=e}),x=null,w=null,j=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return x=t,null==(e=g.current)||e.setFooter(t),()=>{var e;x=null,null==(e=g.current)||e.setFooter(null)}},[t]),null},M=e=>(o.useEffect(()=>{var t;return w=e,null==(t=g.current)||t.setHeader(e),()=>{var e;w=null,null==(e=g.current)||e.setHeader(null)}},[e]),null),I=new a.cB,T=(0,F._)(l.engine),R=(0,S.eX)(f,T);I.defineProperty("engine",{value:T}),I.addDelegate(T.context),!1!==t.inheritContext?I.addDelegate(l):(I.addDelegate(l.engine.context),A(I,l));let E=!1,N={type:"dialog",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,r;if(E)return;E=!0,null==(l=t.onClose)||l.call(t),null==(n=g.current)||n.destroy(),null==m||m(),null==h||h(e);let i=null==R?void 0:R.emitter;(0,S.Z8)(i),null==i||null==(r=i.emit)||r.call(i,S.B9,{type:"dialog",viewUid:null==N||null==(o=N.inputArgs)?void 0:o.viewUid}),T.unlinkFromStack()},update:e=>{var t;return null==(t=g.current)?void 0:t.update(e)},close:async(e,l)=>{var n,o;return(!t.preventClose||!!l)&&!!await k(N,{result:e,force:l})&&(t.triggerByRouter&&(null==(o=t.inputArgs)||null==(n=o.navigation)?void 0:n.back)?t.inputArgs.navigation.back():N.destroy(e),!0)},Footer:j,Header:M,setFooter:e=>{var t;x=e,null==(t=g.current)||t.setFooter(e)},setHeader:e=>{var t;w=e,null==(t=g.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,I)}};I.defineProperty("view",{get:()=>N,resolveOnServer:(0,d.Xx)(I,()=>(0,d.vE)(l,I))}),T.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),N.destroy()}),y(I,N);let D=(0,i.observer)(()=>{var e,l,i,a;let s=o.useRef(!1),d="function"==typeof t.content?t.content(N,I):t.content,u="string"==typeof d?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(d)}}):d;return(o.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,N,I)},[]),(null==(l=t.inputArgs)||null==(e=l.hidden)?void 0:e.value)&&!s.current)?null:(s.current=!0,(0,n.jsx)(b,{className:"nb-dialog-overflow-hidden",ref:g,hidden:null==(a=t.inputArgs)||null==(i=a.hidden)?void 0:i.value,footer:x,header:w,...t,onCancel:()=>{N.close(t.result)},children:u}))},{displayName:"DialogWithContext"}),B=(null==t||null==(c=t.inputArgs)?void 0:c.viewUid)||`page-${P}`,$=(0,n.jsx)(C.I6,{engine:T,children:(0,n.jsx)(s.YQ,{context:I,children:(0,n.jsx)(D,{})})},B);return m=null==(p=e.current)?void 0:p.patchElement($),Object.assign(v,N)},l=o.useMemo(()=>({open:t}),[]),u=o.memo(o.forwardRef((e,t)=>{let[l,r]=w();return o.useImperativeHandle(t,()=>({patchElement:r}),[r]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(u,{ref:e},"dialog-holder")]}var M=l(97134),I=l(61793);let T=o.forwardRef((e,t)=>{var l;let{children:r,footer:i,title:a,extra:s,hidden:d,isMobile:u,...c}=e,[p,m]=o.useState(!0),[h,f]=o.useState(()=>i),[g,v]=o.useState({title:a,extra:s,...c.header});o.useImperativeHandle(t,()=>({destroy:()=>{m(!1)},update:e=>{Object.assign(c,e)},setFooter:e=>{f(e)},setHeader:e=>{0===Object.values(e||{}).length?v(null):v(e)}}),[]);let y=o.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return u?(0,n.jsx)(I.D,{className:d?"nb-hidden":"",visible:p,...c,footer:h,...g,onClose:c.onClose,children:r}):(0,n.jsx)(M.A,{rootClassName:d?"nb-hidden":"",closable:!1,getContainer:y,...c,open:p,footer:h,styles:{...c.styles,footer:{display:"flex",justifyContent:"flex-end",...null==(l=c.styles)?void 0:l.footer}},...g,onClose:c.onClose,children:r})});function R(){let e=o.useRef(null),t=o.useMemo(()=>i.observable.shallow({value:[]}),[]),l=o.memo(e=>{let{index:r}=e,[a,s]=o.useState(null);return(o.useEffect(()=>{(0,i.autorun)(()=>{let e=t.value;e[r]&&a!==e[r]&&s(e[r]),e[r]||s(null)})},[a,r]),a)?(0,n.jsx)(a,{children:(0,n.jsx)(l,{index:r+1})}):null});l.displayName="RenderNestedDrawer";let u=(t,l)=>{var u,c;let p,m,h=l.engine,f=o.createRef(),g=new Promise(e=>{m=e}),v=null,x=null,b=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return v=t,null==(e=f.current)||e.setFooter(t),()=>{var e;v=null,null==(e=f.current)||e.setFooter(null)}},[t]),null},w=e=>(o.useEffect(()=>{var t;return x=e,null==(t=f.current)||t.setHeader(e),()=>{var e;x=null,null==(e=f.current)||e.setHeader(null)}},[e]),null),P=new a.cB,j=(0,F._)(l.engine),M=(0,S.eX)(h,j);P.defineProperty("engine",{value:j}),P.addDelegate(j.context),!1!==t.inheritContext?P.addDelegate(l):(P.addDelegate(l.engine.context),A(P,l));let I=!1,R={type:"drawer",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,r;if(I)return;I=!0,null==(l=t.onClose)||l.call(t),null==(n=f.current)||n.destroy(),null==p||p(),null==m||m(e);let i=null==M?void 0:M.emitter;(0,S.Z8)(i),null==i||null==(r=i.emit)||r.call(i,S.B9,{type:"drawer",viewUid:null==R||null==(o=R.inputArgs)?void 0:o.viewUid}),j.unlinkFromStack()},update:e=>{var t;return null==(t=f.current)?void 0:t.update(e)},close:async(e,l)=>{var n,o;return(!t.preventClose||!!l)&&!!await k(R,{result:e,force:l})&&(t.triggerByRouter&&(null==(o=t.inputArgs)||null==(n=o.navigation)?void 0:n.back)?t.inputArgs.navigation.back():R.destroy(e),!0)},Footer:b,Header:w,setFooter:e=>{var t;v=e,null==(t=f.current)||t.setFooter(e)},setHeader:e=>{var t;x=e,null==(t=f.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,P)}};P.defineProperty("view",{get:()=>R,resolveOnServer:(0,d.Xx)(P,()=>(0,d.vE)(l,P))}),j.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),R.destroy()}),y(P,R);let E=o.memo((0,i.observer)(e=>{var l,i,a,s;let d=o.useRef(!1),u="function"==typeof t.content?t.content(R,P):t.content,c="string"==typeof u?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(u)}}):u;return(o.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,R,P)},[]),(null==(i=t.inputArgs)||null==(l=i.hidden)?void 0:l.value)&&!d.current)?(0,n.jsx)(n.Fragment,{children:e.children}):(d.current=!0,(0,n.jsxs)(T,{ref:f,...t,footer:v,header:t.header||x,hidden:null==(s=t.inputArgs)||null==(a=s.hidden)?void 0:a.value,onClose:()=>{R.close(t.result)},isMobile:P.isMobileLayout,children:[c,e.children]}))}));E.displayName="DrawerWithContext";let N=o.memo(e=>{let{children:t}=e;return(0,n.jsx)(C.I6,{engine:j,children:(0,n.jsx)(s.YQ,{context:P,children:(0,n.jsx)(E,{children:t})})})});return N.displayName="RenderDrawer",p=null==(c=e.current)?void 0:c.patchElement(N),Object.assign(g,R)},c=o.useMemo(()=>({open:u}),[]),p=o.memo(o.forwardRef((e,r)=>{let[i,a]=w();return o.useImperativeHandle(r,()=>({patchElement:a}),[a]),o.useEffect(()=>{t.value=i},[i]),(0,n.jsx)(l,{index:0})}));return[c,(0,n.jsx)(p,{ref:e},"drawer-holder")]}var E=l(40961),N=l(31333),D=l(71021);let B=(0,o.forwardRef)((e,t)=>{let[l,r]=o.useState({}),{visible:i=!0,footer:a=null,header:s=null,children:d,hidden:u,title:c,styles:p={},zIndex:m=4,onClose:h}={...e,...l},f=(0,o.useRef)(!1),g=(0,C.uf)(),[v,y]=(0,o.useState)(()=>a),[x,b]=(0,o.useState)(s);(0,o.useImperativeHandle)(t,()=>({destroy:()=>{f.current||(f.current=!0)},update:e=>{r(e)},setFooter:e=>{y(e)},setHeader:e=>{0===Object.values(e||{}).length?b(null):b(e)}}));let w=(0,o.useMemo)(()=>({display:u?"none":"flex",flexDirection:"column",height:"100%",zIndex:m}),[u,m]),S=(0,o.useMemo)(()=>{if(!x&&!c)return null;let{title:e=c,extra:t}=x||{},l=g.context.themeToken;return(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${l.paddingSM}px ${l.padding}px`,borderBottom:`1px solid ${l.colorSplit}`,backgroundColor:l.colorBgContainer,...p.header},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:l.marginXS},children:[(0,n.jsx)(D.Ay,{type:"text",size:"small",icon:(0,n.jsx)(N.A,{}),onClick:async()=>{f.current||!1!==await (null==h?void 0:h())&&(f.current=!0)},style:{color:l.colorTextTertiary}}),e&&(0,n.jsx)("div",{style:{fontSize:l.fontSizeLG,fontWeight:l.fontWeightStrong,color:l.colorText},children:e})]}),t&&(0,n.jsx)("div",{children:t})]})},[x,c,g.context.themeToken,p.header,h]),F=(0,o.useMemo)(()=>{if(!v)return null;let e=g.context.themeToken;return(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:`${e.paddingXS}px ${e.padding}px`,borderTop:`1px solid ${e.colorSplit}`,backgroundColor:e.colorBgContainer,...p.footer},children:v})},[v,g.context.themeToken,p.footer]);return i?(0,n.jsxs)("div",{style:{...w,...p.content},children:[S,(0,n.jsx)("div",{style:{flex:1,overflowY:"auto",...p.body},children:d}),F]}):null}),$=0,O="nocobase-embed-container",q="nocobaseEmbedReplacing";function _(e){return!!e&&"function"==typeof e.then}function L(e,t){e.dataset[q]="1";try{let l=t.close();if(_(l))return Promise.resolve(l).finally(()=>{delete e.dataset[q]});return delete e.dataset[q],l}catch(t){throw delete e.dataset[q],t}}function V(e,t,l){let n,o={},r=e.then(e=>{let{page:t}=e;return(n=t)&&("beforeClose"in o&&(n.beforeClose=o.beforeClose),"update"in o&&n.update(o.update),"footer"in o&&n.setFooter(o.footer),"header"in o&&n.setHeader(o.header),o.destroyed&&n.destroy(o.destroyed.result)),{page:t}});return Object.assign(r.then(e=>{let{page:t}=e;return!!t&&t}),{type:"embed",inputArgs:t,preventClose:l,Header:null,Footer:null,get beforeClose(){return(null==n?void 0:n.beforeClose)??o.beforeClose},set beforeClose(value){n?n.beforeClose=value:o.beforeClose=value},close:(e,t)=>r.then(l=>{let{page:n}=l;return!!n&&n.close(e,t)}),destroy:e=>{n?n.destroy(e):o.destroyed={result:e}},update:e=>{n?n.update(e):o.update={...o.update,...e}},setFooter:e=>{n?n.setFooter(e):o.footer=e},setHeader:e=>{n?n.setHeader(e):o.header=e}})}let z=o.memo(o.forwardRef((e,t)=>{let[l,r]=w();return o.useImperativeHandle(t,()=>({patchElement:r}),[r]),(0,n.jsx)(n.Fragment,{children:l})}));function K(){let e=o.useRef(null),t=o.useRef(null),l=o.useRef(0),r=(r,u)=>{let{target:c,content:p,preventClose:m,inheritContext:h=!0,inputArgs:f={},onOpenCancelled:g,...v}=r,x=c instanceof HTMLElement&&c.id===O,b=()=>{var l,g,b;let w,P,j,M=null==u?void 0:u.engine;$+=1;let I=o.createRef(),T=new Promise(e=>{P=e}),R=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return null==(e=I.current)||e.setFooter(t),()=>{var e;null==(e=I.current)||e.setFooter(null)}},[t]),null},N=e=>(o.useEffect(()=>{var t;return null==(t=I.current)||t.setHeader(e),()=>{var e;null==(e=I.current)||e.setHeader(null)}},[e]),null),D=new a.cB,O=(0,F._)(u.engine),_=(0,S.eX)(M,O);D.defineProperty("engine",{value:O}),D.addDelegate(O.context),h?D.addDelegate(u):(D.addDelegate(u.engine.context),A(D,u));let L=!1,V={type:"embed",inputArgs:f,preventClose:!!r.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,i,a;if(!L){if(L=!0,null==(l=r.onClose)||l.call(r),null==P||P(e),null==(n=I.current)||n.destroy(),null==w||w(),x&&t.current===V&&(t.current=null),!(x&&c instanceof HTMLElement&&(null==(o=c.dataset)?void 0:o[q])==="1")){let e=null==_?void 0:_.emitter;(0,S.Z8)(e),null==e||null==(a=e.emit)||a.call(e,S.B9,{type:"embed",viewUid:null==V||null==(i=V.inputArgs)?void 0:i.viewUid})}O.unlinkFromStack()}},update:e=>{var t;return null==(t=I.current)?void 0:t.update(e)},close:(e,t)=>L?Promise.resolve(!0):j||(j=(async()=>{try{var l,n;if(m&&!t)return j=void 0,!1;let o=await k(V,{result:e,force:t});if(L)return!0;if(!o)return j=void 0,!1;if(r.triggerByRouter&&(null==(n=r.inputArgs)||null==(l=n.navigation)?void 0:l.back))return r.inputArgs.navigation.back(),!0;return V.destroy(e),!0}catch(e){throw L||(j=void 0),e}})()),Header:N,Footer:R,setFooter:e=>{var t;null==(t=I.current)||t.setFooter(e)},setHeader:e=>{var t;null==(t=I.current)||t.setHeader(e)},navigation:null==(l=r.inputArgs)?void 0:l.navigation,get record(){return(0,d.vE)(u,D)}};D.defineProperty("view",{get:()=>V,resolveOnServer:(0,d.Xx)(D,()=>(0,d.vE)(u,D))}),y(D,V);let z=(0,i.observer)(()=>{var e,t,l,i;let a=o.useRef(!1),s=o.useMemo(()=>"function"==typeof p?p(V,D):p,[]);return(D.themeToken,o.useEffect(()=>{var e;null==(e=r.onOpen)||e.call(r,V,D)},[]),(null==(t=r.inputArgs)||null==(e=t.hidden)?void 0:e.value)&&!a.current)?null:(a.current=!0,(0,n.jsx)(B,{ref:I,hidden:null==(i=r.inputArgs)||null==(l=i.hidden)?void 0:l.value,...v,onClose:()=>V.close(r.result),children:s}))},{displayName:"PageWithContext"}),K=(null==f?void 0:f.viewUid)||`page-${$}`,U=(0,n.jsx)(C.I6,{engine:O,children:(0,n.jsx)(s.YQ,{context:D,children:(0,n.jsx)(z,{})})},K);return w=c&&c instanceof HTMLElement?null==(g=e.current)?void 0:g.patchElement(E.createPortal(U,c,K)):null==(b=e.current)?void 0:b.patchElement(U),x&&(t.current=V),Object.assign(T,V)};if(x&&t.current){let e,n=l.current+=1,o=()=>null==g?void 0:g();try{e=L(c,t.current)}catch(e){throw o(),e}if(_(e))return V(Promise.resolve(e).then(e=>!1===e||n!==l.current?(o(),{page:null}):{page:b()},e=>{throw o(),e}),f,!!r.preventClose);if(!1===e)return o(),V(Promise.resolve({page:null}),f,!!r.preventClose)}return b()};return[o.useMemo(()=>({open:r}),[]),(0,n.jsx)(z,{ref:e},"page-holder")]}var U=l(28073);let W=0,H=o.forwardRef((e,t)=>{var l,r;let{afterClose:i,content:a,placement:s,rect:d,...u}=e,[c,p]=o.useState(!0),[m,h]=o.useState({content:a,placement:s,rect:d,...u});return o.useImperativeHandle(t,()=>({destroy:()=>p(!1),update:e=>h(t=>({...t,...e})),close:(e,t)=>p(!1)})),o.useEffect(()=>{c||null==i||i()},[c,i]),(0,n.jsx)(U.A,{arrow:!1,open:c,trigger:["click"],destroyTooltipOnHide:!0,content:m.content,placement:m.placement,getPopupContainer:()=>document.querySelector("#nocobase-app-container")||document.body,onOpenChange:e=>{(e||!m.preventClose)&&(p(e),e||null==i||i())},...m,children:(0,n.jsx)("span",{style:{position:"absolute",top:((null==(l=m.rect)?void 0:l.top)??0)+window.scrollY,left:((null==(r=m.rect)?void 0:r.left)??0)+window.scrollX,width:0,height:0}})})});function G(){let e=o.useRef(null),t=t=>{var l,i;let a,s;W+=1;let{target:d,placement:u="rightTop",content:c,...p}=t,m=o.createRef(),h=(null==d||null==(l=d.getBoundingClientRect)?void 0:l.call(d))??{top:0,left:0},f=new Promise(e=>{s=e}),g={type:"popover",destroy:()=>{var e;return null==(e=m.current)?void 0:e.destroy()},update:e=>{var t;return null==(t=m.current)?void 0:t.update(e)},close:e=>{var t;null==s||s(e),null==(t=m.current)||t.close(e)}},v="function"==typeof c?c(g):c,y="string"==typeof v?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(v)}}):v,x=(0,n.jsx)(H,{ref:m,content:y,placement:u,rect:h,afterClose:()=>{var e;null==a||a(),null==(e=t.onClose)||e.call(t),null==s||s(t.result)},...p},`popover-${W}`);return a=null==(i=e.current)?void 0:i.patchElement(x),Object.assign(f,g)},l=o.useMemo(()=>({open:t}),[]),i=o.memo(o.forwardRef((e,t)=>{let[l,r]=w();return o.useImperativeHandle(t,()=>({patchElement:r}),[]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(i,{ref:e},"popover-holder")]}var Y=l(52847),J=l(60182);function X(e){return null==e?"":e&&"object"==typeof e&&!Array.isArray(e)?encodeURIComponent(Object.entries(e).map(e=>{let[t,l]=e;return`${encodeURIComponent(String(t))}=${encodeURIComponent(String(l))}`}).join("&")):encodeURIComponent(String(e))}function Q(e){return null!=e&&""!==String(e)}function Z(e){let t=e||"/admin";return`/${t.replace(/^\/+/,"").replace(/\/+$/,"")}`}function ee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=Z(t.basePath||t.prefix);if(!e||0===e.length)return l;let n=l.replace(/^\/+/,"").split("/").filter(Boolean);return e.forEach((e,t)=>{t>0&&n.push("view"),n.push(e.viewUid);let l=(0,J.Gu)(e.viewUid,e.openViewRouteState);if(l&&n.push("opts",l),e.tabUid&&n.push("tab",e.tabUid),null!=e.filterByTk){let t=X(e.filterByTk);t&&n.push("filterbytk",t)}Q(e.sourceId)&&n.push("sourceid",String(e.sourceId))}),"/"+n.join("/")}class et{setViewStack(e){this.viewStack=Object.freeze([...e]),this.viewParams=this.viewStack[this.viewStack.length-1]||{}}changeTo(e){let t=ee(this.viewStack.map((t,l)=>l===this.viewStack.length-1?{...t,...e}:{...t}),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(t,{replace:!0})}navigateTo(e,t){let l=ee([...this.viewStack,e],{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(l,t)}back(){let e=ee(this.viewStack.slice(0,-1),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(e,{replace:!0})}getLayoutBasePath(){var e,t;let l=null==(e=this.ctx.layout)?void 0:e.routePath;return this.basePath||(null==(t=this.ctx.layoutRoute)?void 0:t.basePathname)||((null==l?void 0:l.startsWith("/"))?l:"/admin")}constructor(e,t,l={}){this.setViewStack(t),this.ctx=e,this.basePath=l.basePath||l.layoutBasePath,(0,Y.E8)(this,{viewParams:Y.sH})}}},16639(e,t,l){"use strict";l.d(t,{B9:()=>o,FH:()=>s,HK:()=>r,Z8:()=>d,eX:()=>p,i6:()=>i,tb:()=>n});let n=Symbol.for("__NOCOBASE_VIEW_ACTIVATED_VERSION__"),o="view:activated",r="dataSource:dirty",i="__NOCOBASE_ENGINE_SCOPE__",a="view";function s(e){let t=Reflect.get(e,n),l="number"==typeof t?t:Number(t);return Number.isFinite(l)&&l>0?l:0}function d(e){let t=s(e);if(!Object.isExtensible(e))return t;let l=t+1;return Reflect.set(e,n,l),l}function u(e){return Reflect.get(e,i)===a}function c(e){let t=e,l=0;for(;t&&l++<50;){if(u(t))return t;t=t.previousEngine}}function p(e,t){if(!e)return;let l=c(e);return l||c(null==t?void 0:t.previousEngine)||e}},40542(e,t,l){"use strict";l.d(t,{D:()=>n});let n=(e,t,l)=>{if(!e)return l;let o=t.split("."),r=[],i=e,a=!1;for(let e=0;e<o.length;e++){let t=o[e];if(Array.isArray(i)){for(let t of(a=!0,i)){let i=n(t,o.slice(e).join("."),l);r=r.concat(i)}break}if((null==i?void 0:i[t])===void 0)break;i=i[t],e===o.length-1&&r.push(i)}return 0===(r=r.filter(e=>void 0!==e)).length?l:a?r.filter(e=>null!==e):r[0]}},96436(e,t,l){"use strict";l.r(t),l.d(t,{getDayRange:()=>tl,isEmptyFilter:()=>ed,sleep:()=>es,getDateVars:()=>ta,isString:()=>ee,unflatten:()=>e4,sortTree:()=>ea,forEach:()=>eA,utc2unit:()=>to,extractUsedVariablePaths:()=>tM,getValuesByPath:()=>eP,isArray:()=>et,moment2str:()=>ex,transformLiquidContext:()=>tT,isURL:()=>tC,isPortalInBody:()=>ty,extractUsedVariableNames:()=>tj,parseHTML:()=>tx,toGmt:()=>ep,isPlainObject:()=>en,lockdownSes:()=>tf,splitPathToTwoParts:()=>ts,transformFilter:()=>Y,parseSQLBindParams:()=>tN,getPickerFormat:()=>eC,nextTick:()=>er,removeNullCondition:()=>eu,CollectionsGraph:()=>V,isValidFilter:()=>eE,evaluateConditions:()=>Z,toUnit:()=>tr,BASE_BLOCKED_IDENTIFIERS:()=>tp,getFormatFromDateStr:()=>ek,removeInvalidFilterItems:()=>J,toLocal:()=>em,getDayRangeByParams:()=>_,getDefaultFormat:()=>ec,transformMultiColumnToSingleColumn:()=>tA,treeFind:()=>ei,transformSQL:()=>tD,parseFilter:()=>tt,flatten:()=>e5,getOffsetRangeByParams:()=>B,isEmpty:()=>el,offsetFromString:()=>eb,tval:()=>tg,error:()=>eL,Registry:()=>td,lodash:()=>o(),parse:()=>e$,hasEmptyValue:()=>eo,toFixedByStep:()=>eJ,getDateTimeFormat:()=>eF,showToast:()=>eH,Handlebars:()=>eI(),getLiquidContext:()=>tR,merge:()=>eU,dayjs:()=>i(),parseLiquidContext:()=>tE,uid:()=>tS,str2moment:()=>eg});var n=l(2543),o=l.n(n),r=l(74353),i=l.n(r),a=l(97375),s=l.n(a),d=l(90445),u=l.n(d),c=l(43522),p=l.n(c),m=l(37872),h=l.n(m),f=l(98867),g=l.n(f),v=l(8906),y=l.n(v),x=l(68313),b=l.n(x),w=l(21840),S=l.n(w),C=l(41816),F=l.n(C),k=l(88569),A=l.n(k),P=l(83826),j=l.n(P),M=l(8134),I=l.n(M),T=l(28623),R=l.n(T),E=l(46986),N=l.n(E);i().extend(N()),i().extend(S()),i().extend(A()),i().extend(j()),i().extend(F()),i().extend(b()),i().extend(h()),i().extend(g()),i().extend(y()),i().extend(I()),i().extend(R()),i().extend(u()),i().extend(s()),i().extend(p());let D=e=>{if(!e)return i()();if(/^[+-]\d{2}:\d{2}$/.test(e)){let[t,l,n]=e.match(/([+-])(\d{2}):(\d{2})/).slice(1),o=(60*parseInt(l)+parseInt(n))*("+"===t?1:-1);return i()().utcOffset(o)}return i()().tz(e)},B=e=>{let t,l,{type:n,unit:o="day",number:r=1,timezone:i}=e,a=D(i),s="week"===o?"isoWeek":o;if("past"===n){let e=a.startOf(s);t=e.subtract(r,o).startOf(s),l=e.subtract(1,o).endOf(s)}else if("next"===n)l=(t=a.startOf(s).add(1,o).startOf(s)).add(r-1,o).endOf(s);else throw Error(`Unsupported type: ${n}`);return[t.format("YYYY-MM-DD HH:mm:ss"),l.format("YYYY-MM-DD HH:mm:ss")]},$=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).startOf(t)},O=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).endOf(t)},q={today:e=>[$(0,"day",null==e?void 0:e.timezone),O(0,"day",null==e?void 0:e.timezone)],yesterday:e=>[$(-1,"day",null==e?void 0:e.timezone),O(-1,"day",null==e?void 0:e.timezone)],tomorrow:e=>[$(1,"day",null==e?void 0:e.timezone),O(1,"day",null==e?void 0:e.timezone)],thisWeek:e=>[$(0,"isoWeek",null==e?void 0:e.timezone),O(0,"isoWeek",null==e?void 0:e.timezone)],lastWeek:e=>[$(-1,"isoWeek",null==e?void 0:e.timezone),O(-1,"isoWeek",null==e?void 0:e.timezone)],nextWeek:e=>[$(1,"isoWeek",null==e?void 0:e.timezone),O(1,"isoWeek",null==e?void 0:e.timezone)],thisMonth:e=>[$(0,"month",null==e?void 0:e.timezone),O(0,"month",null==e?void 0:e.timezone)],lastMonth:e=>[$(-1,"month",null==e?void 0:e.timezone),O(-1,"month",null==e?void 0:e.timezone)],nextMonth:e=>[$(1,"month",null==e?void 0:e.timezone),O(1,"month",null==e?void 0:e.timezone)],thisQuarter:e=>[$(0,"quarter",null==e?void 0:e.timezone),O(0,"quarter",null==e?void 0:e.timezone)],lastQuarter:e=>[$(-1,"quarter",null==e?void 0:e.timezone),O(-1,"quarter",null==e?void 0:e.timezone)],nextQuarter:e=>[$(1,"quarter",null==e?void 0:e.timezone),O(1,"quarter",null==e?void 0:e.timezone)],thisYear:e=>[$(0,"year",null==e?void 0:e.timezone),O(0,"year",null==e?void 0:e.timezone)],lastYear:e=>[$(-1,"year",null==e?void 0:e.timezone),O(-1,"year",null==e?void 0:e.timezone)],nextYear:e=>[$(1,"year",null==e?void 0:e.timezone),O(1,"year",null==e?void 0:e.timezone)]},_=e=>{if("past"===e.type||"next"===e.type)return B(e);let t=q[e.type];if(!t)throw Error(`Unsupported type: ${e.type}`);let[l,n]=t(e);return[l.format("YYYY-MM-DD HH:mm:ss"),n.format("YYYY-MM-DD HH:mm:ss")]};var L=l(38362);class V{static graphlib(){return L}static connectedNodes(e){let t=(0,n.castArray)(e.nodes),l=(0,n.castArray)(e.excludes||[]),o=V.build(e),r=new Set;for(let e of t)for(let t of L.alg.preorder(o,e))l.includes(t)||r.add(t);return Array.from(r)}static preOrder(e){return V.graphlib().alg.preorder(V.build(e),e.node)}static build(e){let t=e.collections,l="forward"===((null==e?void 0:e.direction)||"forward"),n=new L.Graph;for(let e of t)n.setNode(e.name);for(let e of t){for(let t of e.inherits||[])l?n.setEdge(e.name,t):n.setEdge(t,e.name);for(let t of e.fields||[])if(("hasMany"===t.type||"belongsTo"===t.type||"hasOne"===t.type)&&(l?n.setEdge(e.name,t.target):n.setEdge(t.target,e.name)),"belongsToMany"===t.type){let o=t.through;l?(n.setEdge(e.name,o),n.setEdge(o,t.target)):(n.setEdge(t.target,o),n.setEdge(o,e.name))}}return n}}var z=l(81814),K=l.n(z);function U(e){return"path"in e&&"operator"in e}function W(e){return"logic"in e&&"items"in e}function H(e){let{path:t,operator:l,value:n}=e;return{[t]:{[l]:n}}}function G(e){let{logic:t,items:l}=e;return{[t]:l.map(e=>{if(U(e))return H(e);if(W(e))return G(e);throw Error("Invalid filter item type")})}}function Y(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return eu(G(e))}function J(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return e.items=e.items.filter(e=>U(e)?!!e.operator:!!W(e)&&J(e)),{...e}}function X(e,t){let{path:l,operator:n,value:o}=e;return t(l,n,o)}function Q(e,t){let{logic:l,items:n}=e;if(!n||0===n.length)return!0;let o=n.map(e=>{if(U(e))return X(e,t);if(W(e))return Q(e,t);throw Error("Invalid filter item type")});if("$and"===l)return o.every(e=>!0===e);if("$or"===l)return o.some(e=>!0===e);throw Error(`Unsupported logic operator: ${l}`)}function Z(e,t){if(!e||"object"!=typeof e)throw Error("Invalid conditions: conditions must be an object");if(!W(e))throw Error("Invalid conditions: conditions must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid conditions: items must be an array");if("function"!=typeof t)throw Error("Invalid evaluator: evaluator must be a function");return Q(e,t)}let ee=e=>"string"==typeof e,et=e=>Array.isArray(e),el=e=>en(e)?0===Object.keys(e).length:!!Array.isArray(e)&&0===e.length,en=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},eo=e=>{let t=!0;for(let l in e){if(t=!1,et(e[l])&&0===e[l].length||!e[l])return!0;if(en(e[l])||et(e[l]))return eo(e[l])}return t},er=e=>{setTimeout(e)};function ei(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return;let{childrenKey:n="children"}=l;for(let o of Array.isArray(e)?[...e]:[e]){if(t(o))return o;let e="function"==typeof n?n(o):o[n];if(Array.isArray(e)&&e.length>0){let n=ei(e,t,l);if(void 0!==n)return n}}}function ea(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children",n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return e&&Array.isArray(e)&&0!==e.length?o().orderBy(e,t,n?"asc":"desc").map(e=>e[l]&&e[l].length>0?{...e,[l]:ea(e[l],t,l,n)}:e):e}function es(e){return new Promise(t=>{setTimeout(t,e)})}function ed(e){return!!(!e||"$and"in e&&o().isEmpty(e.$and)||"$or"in e&&o().isEmpty(e.$or))}let eu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K(),l=t(e||{}),n={};for(let e in l){let t=l[e];null==t||el(t)||""===t||(n[e]=t)}let r=t.unflatten(n);for(let e in r)Array.isArray(r[e])&&(r[e]=r[e].filter(e=>null!=e));return o().isEmpty(r)?void 0:r},ec=e=>e.format?e.format:e.dateFormat?e.showTime?`${e.dateFormat} ${e.timeFormat||"HH:mm:ss"}`:e.dateFormat:"month"===e.picker?"YYYY-MM":"quarter"===e.picker?"YYYY-\\QQ":"year"===e.picker?"YYYY":"week"===e.picker?"YYYY[W]W":e.showTime?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD",ep=e=>e&&i().isDayjs(e)?`${e.format("YYYY-MM-DD")}T${e.format("HH:mm:ss.SSS")}Z`:e,em=e=>e?Array.isArray(e)?e.map(e=>e.startOf("second").toISOString()):i().isDayjs(e)?e.startOf("second").toISOString():void 0:e,eh=e=>{try{let t=parseInt(e.slice(0,4)),l=parseInt(e.slice(-1));return i()().quarter(l).year(t)}catch(e){return null}},ef=(e,t)=>{if(!e)return;let l=t.utcOffset,{gmt:n,picker:o,utc:r=!0,dateOnly:a}=t;if(!i()(e).isValid())return eh(e);if(a){let t=i()(e);if(!t.isValid())return e;let l=t.format("YYYY-MM-DD");return i().utc(l,"YYYY-MM-DD")}return r?i().isDayjs(e)?l?e.utcOffset(eb(l)):e:n?i()(e).utcOffset(0):l?i()(e).utcOffset(eb(l)):i()(e):i()(e)},eg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?e.map(e=>ef(e,t)):e?ef(e,t):e},ev=(e,t)=>"year"===t?e.format("YYYY")+"-01-01T00:00:00.000Z":"month"===t||"quarter"===t?e.format("YYYY-MM")+"-01T00:00:00.000Z":e.format("YYYY-MM-DD")+"T00:00:00.000Z",ey=(e,t)=>e?Array.isArray(e)?e.map(e=>ev(e,t)):i().isDayjs(e)?ev(e,t):void 0:e,ex=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{showTime:l,gmt:n,picker:o}=t;return e?l?n?ep(e):em(e):ey(e,o):e};function eb(e){if(!o().isString(e))return e;let t=/([+-]|\d\d)/gi,l=/Z|[+-]\d\d(?::?\d\d)?/gi,n=/[+-]?\d+(\.\d{1,3})?/,r=(e||"").match(l);if(null===r&&(r=(e||"").match(n)),null===r)return null;let i=((r[r.length-1]||[])+"").match(t)||["-",0,0],a=+(60*Number(i[1]))+ew(i[2]);return 0===a?0:"+"===i[0]?a:-a}function ew(e){let t=+e,l=0;return 0!==t&&isFinite(t)&&(l=eS(t)),l}function eS(e){return e<0?Math.ceil(e)||0:Math.floor(e)}let eC=e=>{switch(e){case"week":return"YYYY[W]W";case"month":return"YYYY-MM";case"quarter":return"YYYY[Q]Q";case"year":return"YYYY";default:return"YYYY-MM-DD"}},eF=(e,t,l,n)=>"date"===e&&l?`${t} ${n||"HH:mm:ss"}`:t;function ek(e){return/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?"YYYY-MM-DD HH:mm:ss":/^\d{4}-\d{2}-\d{2}$/.test(e)?"YYYY-MM-DD":/^\d{4}-\d{2}$/.test(e)?"YYYY-MM":/^\d{4}$/.test(e)?"YYYY":/^\d{4}Q[1-4]$/.test(e)?"YYYY[Q]Q":/^\d{4}-\d{2}-\d{2}T/.test(e)?"YYYY-MM-DDTHH:mm:ss.SSSZ":null}let eA=(e,t)=>{Array.isArray(e)?e.forEach(t):Object.keys(e).forEach(l=>{t(e[l],l)})},eP=(e,t,l)=>{if(!e)return l;let n=t.split("."),o=[],r=e,i=!1;for(let e=0;e<n.length;e++){let t=n[e];if(Array.isArray(r)){for(let t of(i=!0,r)){let r=eP(t,n.slice(e).join("."),l);o=o.concat(r)}break}if((null==r?void 0:r[t])===void 0)break;r=r[t],e===n.length-1&&o.push(r)}return 0===(o=o.filter(e=>void 0!==e)).length?l:i?o.filter(e=>null!==e):o[0]};var ej=l(88835),eM=l(60639),eI=l.n(eM),eT=l(79441);let eR=l.n(eT)()();function eE(e){if(!e)return!1;let t=[e.$and,e.$or].filter(Boolean);return 0==t.length?Object.keys(e).length>0:t.some(e=>{if(Array.isArray(e))return e.some(eE);if(e.$and||e.$or)return eE(e);let[t]=Object.keys(e);if(!t||!e[t])return!1;let[l]=Object.keys(e[t]);return!!l&&void 0!==e[t][l]})}function eN(e){let t=typeof e;return Array.isArray(e)?t="array":e instanceof Date?t="date":null===e&&(t="null"),t}function eD(e){let t=e.substr(2,e.length-4).trim(),l=t.indexOf(":");return -1!==l?{key:t.substr(0,l),defaultValue:t.substr(l+1)}:{key:t}}function eB(e,t){return e.parameters=Array.from(new Map(t.map(e=>[e.key,e])).values()),e}function e$(e){switch(eN(e)){case"string":return eO(e);case"object":return eq(e);case"array":return e_(e);default:return eB(function(){return e},[])}}Object.keys(eR).forEach(function(e){eI().registerHelper(e,eR[e])}),eI().registerHelper("json",function(e){return JSON.stringify(e)}),eI().registerHelper("urlParse",function(e){try{return JSON.stringify(ej.parse(e))}catch(t){return`Invalid URL: ${e}`}}),eI().registerHelper("dateFormat",(e,t,l)=>"string"==typeof l?i()(e).tz(l).format(t):i()(e).format(t)),eI().registerHelper("isNull",e=>o().isNull(e));let eO=(()=>{let e=/{{(\w|:|[\s-+.,@/()?=*_$])+}}/g;return t=>{let l=[],o=e=>t,r=t.match(e);return r&&(l=r.map(eD),o=e=>(e=e||{},r.reduce((o,i,a)=>{let s=l[a],d=(0,n.get)(e,s.key);return(void 0===d&&(d=s.defaultValue),"function"==typeof d&&(d=d()),1===r.length&&t.startsWith("{{")&&t.endsWith("}}"))?d:(d instanceof Date&&(d=d.toISOString()),o.replace(i,null==d?"":d))},t))),eB(o,l)}})();function eq(e){let t=Object.keys(e).map(t=>({keyTemplate:eO(t),valueTemplate:e$(e[t])}));return eB(e=>t.reduce((t,l)=>(t[l.keyTemplate(e)]=l.valueTemplate(e),t),{}),t.reduce((e,t)=>e.concat(t.valueTemplate.parameters,t.keyTemplate.parameters),[]))}function e_(e){let t=e.map(e$);return eB(e=>t.map(t=>t(e)),t.reduce((e,t)=>e.concat(t.parameters),[]))}let eL=function(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];console.error(e,...l)};var eV=l(14744),ez=l.n(eV);let eK=(e,t,l)=>t;function eU(e,t,l){return ez()(e,t,{arrayMerge:eK,...l})}var eW=l(98892);let eH=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;eW.Ay[t]({message:e,duration:l})};var eG=l(5062),eY=l(85738);function eJ(e,t){if(null==e||""===e)return"";let l=(0,eG.i5)(t);return(0,eY.Mg)(String(e),".",l)}var eX=l(63560),eQ=l.n(eX),eZ=l(95093),e0=l.n(eZ);let e1=/^\s*\{\{([\s\S]*)\}\}\s*$/;function e2(e){return e&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function e8(e){return e}function e5(e,t){let l=(t=t||{}).delimiter||".",n=t.maxDepth,r=t.transformKey||e8,i=t.transformValue||e8,a={};function s(e,d,u){u=u||1,o().isObjectLike(e)&&Object.keys(e).forEach(function(o){var c;let p=e[o],m=t.safe&&Array.isArray(p),h=Object.prototype.toString.call(p),f=e2(p),g="[object Object]"===h||"[object Array]"===h,v=d?d+l+r(o):r(o);if(null==(c=t.breakOn)?void 0:c.call(t,{key:o,value:p,path:v})){a[v]=i(p,v);return}if(!m&&!f&&g&&Object.keys(p).length&&(!t.maxDepth||u<n))return s(p,v,u+1);a[v]=i(p,v)})}return s(e),a}function e4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l={},n=t.transformValue||e8;for(let t of Object.keys(e))eQ()(l,t,n(e[t],t));return l}let e3=e=>{let t=e.split(".").pop()||"";return t.startsWith("$")||(t=""),{operator:t}},e6=e=>["$dateOn","$dateNotOn","$dateBefore","$dateAfter","$dateNotBefore","$dateNotAfter","$dateBetween"].includes(e);function e9(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function e7(e){return(null==e?void 0:e.type)==="dateOnly"||(null==e?void 0:e.type)==="datetimeNoTz"||(null==e?void 0:e.constructor.name)==="DateOnlyField"||(null==e?void 0:e.constructor.name)==="DatetimeNoTzField"}let te=(e,t)=>e?(e.type&&(e=_({...e,timezone:t})),Array.isArray(e))?(2===e.length?e.push("[]",t):3===e.length&&e.push(t),e):"string"==typeof e?!t||/(\+|-)\d\d:\d\d$/.test(e)?e:e+t:e9(e)?e.toISOString():void 0:null,tt=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=new Set,n=t.vars||{},o=t.timezone,r=t.now,i=t.getField,a=e5(e,{breakOn(e){let{key:t}=e;return t.startsWith("$")&&"$and"!==t&&"$or"!==t},transformValue(e){if("string"!=typeof e)return e;let t=e1.exec(e);if(t){let e=t[1].trim();e.startsWith("$user")&&l.add(e.substring(6))}return e}});if(l.size>0){let e=await n.$user({fields:[...l.values()]});Object.assign(n,{$user:e})}return e4(a,{transformValue(e,t){let{operator:l}=e3(t);if("string"==typeof e){let a=e1.exec(e);if(a){let s=eP(n,a[1].trim(),null),d=null==i?void 0:i(t);e="function"==typeof s?null==s?void 0:s({field:d,operator:l,timezone:o,now:r}):s}}if(e6(l)){let l=null==i?void 0:i(t);return e7(l)?e.type?_({...e,timezone:(null==l?void 0:l.timezone)||o}):e:te(e,(null==l?void 0:l.timezone)||o)}return e}})};function tl(e){let{now:t,timezone:l="+00:00",offset:n}=e,o=tn(t).utcOffset(eb(l));return n>0?[(o=o.add(1,"day").startOf("day")).format("YYYY-MM-DD"),o.clone().add(n,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]:[o.clone().subtract(-1*n-1,"day").startOf("day").format("YYYY-MM-DD"),o.clone().add(1,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]}function tn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?i().isDayjs(e)?e:t?e0()(e):i()(e):t?e0()():i()()}function to(e){var t;let{now:l,unit:n,timezone:o="+00:00",offset:r}=e,i=tn(l,"isoWeek"===n);i=(i=i.utcOffset(eb(o))).startOf(n),r>0?i=i.add(r,n):r<0&&(i=i.subtract(-1*r,n));let a={year:()=>i.format("YYYY"),quarter:()=>i.format("YYYY[Q]Q"),month:()=>i.format("YYYY-MM"),week:()=>i.format("gggg[w]ww"),isoWeek:()=>i.format("GGGG[W]WW"),day:()=>i.format("YYYY-MM-DD")},s=null==(t=a[n])?void 0:t.call(a);return o?s+o:s}let tr=(e,t)=>l=>{let{now:n,timezone:o,field:r}=l;return(null==r?void 0:r.timezone)&&(o=null==r?void 0:r.timezone),to({now:n,timezone:o,unit:e,offset:t})},ti=e=>t=>{let{now:l,timezone:n,field:o}=t;return(null==o?void 0:o.timezone)&&(n=null==o?void 0:o.timezone),tl({now:l,timezone:n,offset:e})};function ta(){return{now:new Date().toISOString(),today:tr("day"),yesterday:tr("day",-1),tomorrow:tr("day",1),thisWeek:tr("week"),lastWeek:tr("week",-1),nextWeek:tr("week",1),thisIsoWeek:tr("isoWeek"),lastIsoWeek:tr("isoWeek",-1),nextIsoWeek:tr("isoWeek",1),thisMonth:tr("month"),lastMonth:tr("month",-1),nextMonth:tr("month",1),thisQuarter:tr("quarter"),lastQuarter:tr("quarter",-1),nextQuarter:tr("quarter",1),thisYear:tr("year"),lastYear:tr("year",-1),nextYear:tr("year",1),last7Days:ti(-7),next7Days:ti(7),last30Days:ti(-30),next30Days:ti(30),last90Days:ti(-90),next90Days:ti(90)}}function ts(e){let t=e.split(".");return[t.shift(),t.join(".")]}class td{register(e,t){if(!this.options.override&&this.map.has(e))throw Error(`this registry does not allow to override existing keys: "${e}"`);this.map.set(e,t)}get(e){return this.map.get(e)}getKeys(){return this.map.keys()}getValues(){return this.map.values()}getEntities(){return this.map.entries()}constructor(e={override:!1}){this.map=new Map,this.options=e}}l(67980);let tu=Symbol.for("nocobase.utils.sesLockdown"),tc=Symbol.for("nocobase.utils.bufferOverrides"),tp=["globalThis","global","self","Function","AsyncFunction","GeneratorFunction","eval","Compartment","lockdown","harden","assert"];function tm(e){return!!e&&"object"==typeof e&&(e.message||"").includes("(SES_ALREADY_LOCKED_DOWN)")}function th(){let e=globalThis;if(e[tc])return;let t=e.Buffer;if(!t||!t.prototype)return;let l=t.prototype;for(let e of Reflect.ownKeys(l)){let t=Object.getOwnPropertyDescriptor(l,e);if(!t||"function"!=typeof t.value||!t.configurable)continue;let n=t.value,o=function(){return n},r=function(t){if(this===l)throw TypeError(`Cannot assign to read only property '${String(e)}' of object 'Buffer.prototype'`);Object.defineProperty(this,e,{configurable:!0,enumerable:!0,writable:!0,value:t})};Object.defineProperty(o,"originalValue",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(l,e,{configurable:t.configurable,enumerable:t.enumerable,get:o,set:r})}e[tc]=!0}function tf(e){th();let t=globalThis;if(!t[tu]){if("function"!=typeof lockdown)throw Error("SES lockdown is unavailable in the current runtime environment.");try{lockdown(e)}catch(e){if(!tm(e))throw e}t[tu]=!0}}function tg(e,t){return t?`{{t(${JSON.stringify(e)}, ${JSON.stringify(t)})}}`:`{{t(${JSON.stringify(e)})}}`}var tv=l(65606);let ty=e=>{for(;e;){var t;if("root"===e.id||(null==(t=e.classList)?void 0:t.contains("nb-action")))return!1;e=e.parentNode}return!tv.env.__TEST__};function tx(e,t){return e.replace(/\{\{(\w+)\}\}/g,function(e,l){return void 0!==t[l]?t[l]:e})}let tb=36,tw="";for(;tb--;)tw+=tb.toString(36);function tS(e){let t="",l=e||11;for(;l--;)t+=tw[36*Math.random()|0];return t}function tC(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}var tF=l(27153),tk="2.1.15";let tA=(e,t)=>{if(!e)return e;if("Grid"!==e["x-component"])return Object.keys(e.properties||{}).forEach(l=>{e.properties[l]=tA(e.properties[l],t)}),e;let l=e.parent;e=e.toJSON?e.toJSON():o().cloneDeep(e);let n={},{properties:r={}}=e,i=0;if(Object.keys(r).forEach((e,l)=>{let a=r[e];if("Grid.Row"!==a["x-component"]){a["x-index"]=++i,n[e]=a;return}if(a.properties){if(1===Object.keys(a.properties).length){a["x-index"]=++i,n[e]=a;return}Object.keys(a.properties).forEach((l,r)=>{let s=a.properties[l];if(o().set(s,"x-component-props.width",100),0===r){a["x-index"]=++i,n[e]=a;return}null!=t&&t(s)||(delete a.properties[l],n[`${tS()}_${l}`]=tP(s,l,++i))})}}),e.properties=n,l){let t=new tF.Schema(e,l);return l.properties&&Object.keys(l.properties).forEach(n=>{n===e.name&&(l.properties[n]=t)}),t}return e};function tP(e,t,l){return{type:"void",version:"2.0","x-component":"Grid.Row","x-app-version":tk,"x-uid":tS(),"x-async":!1,"x-index":l,_isJSONSchemaObject:!0,properties:{[t]:e}}}function tj(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=r.exec(o));)t.add(e[1]);let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=i.exec(o));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function tM(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=r.exec(o));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],o=e[3]||"";t[l].push(`${n}${o}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],o=e[2]||"";t[l].push(`[${n}]${o}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=i.exec(o));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],o=n[3]||"";t[e].push(`${l}${o}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],o=n[2]||"";t[e].push(`[${l}]${o}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}let tI=new(l(23155)).HX;function tT(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};for(let l of e){let e=l.replace(/^ctx\./,"").split("."),n=t;for(let t=0;t<e.length;t++){let o=e[t];t===e.length-1?n[o]=`{{${l}}}`:(n[o]=n[o]||{},n=n[o])}}return t}async function tR(e){return tT(await tI.fullVariables(e))}async function tE(e,t){return await tI.parseAndRender(e,{ctx:t})}function tN(e){let t=1,l={};return{sql:e.replace(/{{\s*([^}]+)\s*}}/g,(e,n)=>{let o=`__var${t}`;return l[o]=`{{${n.trim()}}}`,t++,`$${o}`}),bind:l}}async function tD(e){let{sql:t,bind:l}=tN(e),n=await tR(t);return{sql:t,bind:l,liquidContext:n}}},59598(){},23005(){},14892(){},2813(){},61511(){},92489(){},52453(){},72522(){},66883(){},9845(){}},function(e){var t=function(t){return e(e.s=t)};e.O(0,["1339","2174","268","3210","3338","3658","3782","404","8159","8732","8878","9200","9223","957","9817","9967"],function(){return t(81515)}),e.O()}]);
3574
+ ${p}`}async function tr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l="string"==typeof e?e:String(e??""),n=!!t.preprocessTemplates,o=n?eK.withTemplates:eK.withoutTemplates,r=eU(o,l);if(r)return await r;let i=(async()=>{if(!n)return tt(await (0,eN.W)(l));let e=to(l,{processStringLiterals:!1});return tt(to(await (0,eN.W)(e),{processBarePlaceholders:!1}))})();eW(o,l,i,ez);try{return await i}catch(e){throw o.delete(l),e}}var ti=l(62572);function ta(e){if(Array.isArray(e)){let t=e.map(e=>ta(e)).filter(e=>void 0!==e);return t.length?t:void 0}if(e&&"object"==typeof e){let t={};return Object.keys(e).forEach(l=>{let n=ta(e[l]);void 0!==n&&(t[l]=n)}),Object.keys(t).length?t:void 0}return null==e||"string"==typeof e&&""===e?void 0:e}let ts=e=>"string"==typeof e.on?"beforeRender"===e.on:"object"==typeof e.on?"beforeRender"===e.on.eventName:!e.on&&!0!==e.manual;var td=l(47684);let tu="0123456789abcdefghijklmnopqrstuvwxyz";function tc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11,l="";for(let e=0;e<t;e++)l+=tu[Math.random()*tu.length|0];return`${e}${l}`}},49773(e,t,l){"use strict";async function n(e){if(!/<[A-Za-z]|<\//.test(e))return e;try{var t;let n=await l.e("1339").then(l.bind(l,1608)),o=(null==n?void 0:n.transform)||(null==n||null==(t=n.default)?void 0:t.transform);if("function"!=typeof o)return e;let r=o(e,{transforms:["jsx"],jsxPragma:"ctx.React.createElement",jsxFragmentPragma:"ctx.React.Fragment",disableESTransforms:!0,production:!0});return(r&&(r.code||(null==r?void 0:r.output)))??e}catch(t){return e}}l.d(t,{W:()=>n})},81982(e,t,l){"use strict";l.d(t,{M:()=>m,gG:()=>i,mv:()=>a,o4:()=>p});var n=l(40542),o=l(2543),r=l.n(o);async function i(e,t){if(!e)return{};if("function"==typeof e)try{return await e(t)||{}}catch(e){return console.error("Error resolving defaultParams function:",e),{}}return e}async function a(e,t,l){if(!e)return{};if("function"==typeof e)try{return await e(t,l)||{}}catch(e){return console.error("Error resolving createModelOptions function:",e),{}}return e}let s={queue:[],timer:null,inflightByRun:new Map},d=10;function u(e){if(Array.isArray(e))return e.map(u);if(r().isPlainObject(e)){let t=Object.entries(e).map(e=>{let[t,l]=e;return[t,u(l)]});return Object.fromEntries(r().sortBy(t,e=>{let[t]=e;return t}))}return e}function c(e){try{return JSON.stringify(u(e))}catch{try{return JSON.stringify(e)}catch{return String(e)}}}function p(e,t){let l,n,o=s,r=e.runId||"GLOBAL",i=c(t),a=o.inflightByRun.get(r);a||(a=new Map,o.inflightByRun.set(r,a));let u=a.get(i);if(u)return u;let p=new Promise((e,t)=>{l=e,n=t});a.set(i,p);let m={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,ctx:e,payload:t,resolve:l,reject:n,runId:r,dedupKey:i};o.queue.push(m);let h=async()=>{var t,l,n,r,i,a;let s=o.queue.splice(0,o.queue.length);if(o.timer=null,!s.length)return;let d=null==(t=s[0].ctx)?void 0:t.api;if(!d){for(let e of s)try{e.resolve(e.payload.template)}catch(t){e.reject(t)}finally{null==(l=o.inflightByRun.get(e.runId))||l.delete(e.dedupKey)}return}try{let e=s.map(e=>({id:e.id,template:e.payload.template,contextParams:e.payload.contextParams||{}})),t=await d.request({method:"POST",url:"variables:resolve",data:{values:{batch:e}}}),l=t.data??t,r=l.data??l,i=null==r?void 0:r.results,a=Array.isArray(i)?i:Array.isArray(r)?r:[],u=new Map;for(let e of a){let t=(null==e?void 0:e.id)!=null?String(e.id):"";t&&u.set(t,null==e?void 0:e.data)}for(let e of s)try{let t=String(e.id),l=u.has(t)?u.get(t):e.payload.template;e.resolve(l)}catch(t){e.reject(t)}finally{null==(n=o.inflightByRun.get(e.runId))||n.delete(e.dedupKey)}}catch(t){for(let l of s)try{null==e||null==(i=e.logger)||null==(r=i.warn)||r.call(i,{err:t},"variables:resolve(batch) failed, fallback"),l.resolve(l.payload.template)}catch(e){l.reject(e)}finally{null==(a=o.inflightByRun.get(l.runId))||a.delete(l.dedupKey)}}};return o.timer||(o.timer=setTimeout(h,d)),p}async function m(e,t){let l=async e=>{if("string"==typeof e&&/\{\{.*?\}\}/.test(e))return await g(e,t);if(Array.isArray(e))return Promise.all(e.map(l));if(e&&"object"==typeof e){let t={};for(let[n,o]of Object.entries(e))t[n]=await l(o);return t}return e};return l(e)}async function h(e,t){let l=await f(e.trim(),t),n=await t.runjs(`return ${l}`,{t:t.t});return(null==n?void 0:n.success)?n.value:void 0}async function f(e,t){let l,n=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g,o=[],r=new Set;for(;null!==(l=n.exec(e));){let e=l[0],t=l[1],n=t.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)/);if(n){let l=n[1],i=t.substring(l.length);o.push({fullPath:e,firstKey:l,restPath:i}),r.add(l)}}if(0===o.length)return e;let i=new Map;for(let e of r)try{let l=await t[e],n=l&&!0===l.__isRecordProxy__;i.set(e,n)}catch(t){i.set(e,!1)}o.sort((e,t)=>t.fullPath.length-e.fullPath.length);let a=e;for(let{fullPath:e,firstKey:t,restPath:l}of o){let n,o=i.get(t)||!1;n=""===l?`await ctx.${t}`:o?`await (await ctx.${t})${l}`:`(await ctx.${t})${l}`;let r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=RegExp(`\\b${r}\\b`,"g");a=a.replace(s,n)}return a}async function g(e,t){let l=e=>{let t=e.trim().match(/^ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\.([a-zA-Z_$][a-zA-Z0-9_$-]*(?:\.[a-zA-Z_$][a-zA-Z0-9_$-]*)*))?$/);return t?t[2]?`${t[1]}.${t[2]}`:t[1]:null},o=async e=>{let l=e.split("."),o=l.shift();if(!o)return;let r=await t[o];return 0===l.length?r:(0,n.D)(r,l.join("."))},r=async e=>{let n=l(e);if(n){let l=await o(n);return void 0===l&&n.includes("-")?await h(e,t):l}return await h(e,t)},i=e.match(/^\s*\{\{\s*([^{}]+?)\s*\}\}\s*$/);if(i){let e=i[1];return await r(e)}let a=[...e.matchAll(/\{\{\s*(.+?)\s*\}\}/g)],s=e;for(let[e,t]of a){let l=await r(t);if(void 0!==l){let t="object"==typeof l&&null!==l?JSON.stringify(l):String(l);s=s.replace(e,t)}}return s}},47684(e,t,l){"use strict";function n(e,t){if(!e||"string"!=typeof e)throw Error("invalid url");let l=e.trim();if(l.startsWith("http://")||l.startsWith("https://"))return l;let n=window.__esm_cdn_base_url__||"https://esm.sh",o=(null==t?void 0:t.addSuffix)&&window.__esm_cdn_suffix__||"",r=n.replace(/\/$/,""),i=l.replace(/^\//,"");if(null==t?void 0:t.raw){let e=i.includes("?")?"&":"?";return`${r}/${i}${e}raw`}return`${r}/${i}${o}`}function o(e){return!!e&&"string"==typeof e&&e.split("?")[0].split("#")[0].endsWith(".css")}l.d(t,{i:()=>n,y:()=>o})},51143(e,t,l){"use strict";function n(){var e,t;let l=globalThis;if((null==(e=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:e.windowAllow)&&(null==(t=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:t.documentAllow))return l.__nocobaseRunJSSafeGlobalsRegistry;let n={windowAllow:new Set,documentAllow:new Set};return l.__nocobaseRunJSSafeGlobalsRegistry=n,n}function o(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.windowAllow.add(e)}}function r(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.documentAllow.add(e)}}function i(e){return n().windowAllow.has(e)}function a(e){return n().documentAllow.has(e)}function s(e){let t=()=>`${window.location.origin}${window.location.pathname}`,l=(e,l,n)=>{if(!(e=>{try{let l=new URL(e,t()),n=l.protocol.toLowerCase();if("about:"===n)return"about:blank"===l.href;return"http:"===n||"https:"===n}catch{return!1}})(e))throw Error("Unsafe URL: window.open only allows http/https/about:blank.");let o="_blank",r=(e=>{let t=new Set;return e&&e.split(",").map(e=>e.trim()).filter(Boolean).forEach(e=>{let l=e.split("=")[0].trim().toLowerCase();"noopener"!==l&&"noreferrer"!==l&&t.add(e)}),t.add("noopener"),t.add("noreferrer"),Array.from(t).join(",")})(n),i=window.open.call(window,e,o,r);if(i&&"opener"in i)try{i.opener=null}catch{}return i},n=(e,n)=>{let o=new URL(e,t()),r=o.protocol.toLowerCase(),i="about:"===r&&"about:blank"===o.href;if("http:"!==r&&"https:"!==r&&!i)throw Error("Unsafe URL: only http/https/about:blank are allowed.");if(i)return(null==n?void 0:n.replace)?window.location.replace("about:blank"):window.location.assign("about:blank");if(o.protocol===window.location.protocol&&o.hostname===window.location.hostname&&o.port===window.location.port)return(null==n?void 0:n.replace)?window.location.replace(o.href):window.location.assign(o.href);if(!l(o.href))throw Error("Popup blocked: cross-origin navigation is opened in a new tab.")},o=new Proxy({},{get(e,t){switch(t){case"origin":return window.location.origin;case"protocol":return window.location.protocol;case"host":return window.location.host;case"hostname":return window.location.hostname;case"port":return window.location.port;case"pathname":return window.location.pathname;case"assign":return e=>n(e,{replace:!1});case"replace":return e=>n(e,{replace:!0});case"reload":return window.location.reload.bind(window.location);case"href":throw Error("Reading location.href is not allowed.");default:throw Error(`Access to location property "${t}" is not allowed.`)}},set(e,t,l){if("href"===t)return n(String(l),{replace:!1}),!0;throw Error("Mutation on location is not allowed.")}}),r={setTimeout:window.setTimeout.bind(window),clearTimeout:window.clearTimeout.bind(window),setInterval:window.setInterval.bind(window),clearInterval:window.clearInterval.bind(window),console,Math,Date,FormData,..."u">typeof Blob?{Blob}:{},..."u">typeof URL?{URL}:{},addEventListener:addEventListener.bind(window),open:l,location:o,...e||{}};return new Proxy(Object.create(null),{get(e,t){if("string"!=typeof t)return Reflect.get(e,t);if(t in r)return r[t];if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(i(t)){let e=window[t];return"function"==typeof e?e.bind(window):e}throw Error(`Access to global property "${t}" is not allowed.`)},set(e,t,l){if("string"!=typeof t)return Reflect.set(e,t,l),!0;if(t in r)throw Error(`Mutation of global property "${t}" is not allowed.`);return e[t]=l,!0},has:(e,t)=>"string"!=typeof t?Reflect.has(e,t):!!(t in r||Object.prototype.hasOwnProperty.call(e,t)||i(t))})}function d(e){let t={createElement:document.createElement.bind(document),querySelector:document.querySelector.bind(document),querySelectorAll:document.querySelectorAll.bind(document),...e||{}};return new Proxy(Object.create(null),{get(e,l){if("string"!=typeof l)return Reflect.get(e,l);if(l in t)return t[l];if(Object.prototype.hasOwnProperty.call(e,l))return e[l];if(a(l)){let e=document[l];return"function"==typeof e?e.bind(document):e}throw Error(`Access to document property "${l}" is not allowed.`)},set(e,l,n){if("string"!=typeof l)return Reflect.set(e,l,n),!0;if(l in t)throw Error(`Mutation of document property "${l}" is not allowed.`);return e[l]=n,!0},has:(e,l)=>"string"!=typeof l?Reflect.has(e,l):!!(l in t||Object.prototype.hasOwnProperty.call(e,l)||a(l))})}function u(e){var t;let l="u">typeof window&&window.navigator||void 0,n={},o=null==l||null==(t=l.clipboard)?void 0:t.writeText;"function"==typeof o&&(n.writeText=o.bind(l.clipboard));let r={clipboard:n};return Object.defineProperty(r,"onLine",{get:()=>!!(null==l?void 0:l.onLine),enumerable:!0,configurable:!1}),Object.defineProperty(r,"language",{get:()=>null==l?void 0:l.language,enumerable:!0,configurable:!1}),Object.defineProperty(r,"languages",{get:()=>(null==l?void 0:l.languages)?[...l.languages]:void 0,enumerable:!0,configurable:!1}),Object.assign(r,e||{}),new Proxy({},{get(e,t){if(t in r)return r[t];throw Error(`Access to navigator property "${String(t)}" is not allowed.`)}})}function c(e){let t={};try{let e=u();t.navigator=e;try{t.window=s({navigator:e})}catch{}}catch{}try{t.document=d()}catch{}return e?{...t,...e}:t}async function p(e,t,l,n){if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.runjs)return e.runjs(t,c(n),l)}l.d(t,{D1:()=>u,I2:()=>c,Vm:()=>o,Xh:()=>d,_:()=>p,ey:()=>s,yz:()=>r})},22928(e,t,l){"use strict";function n(e){let t={};return Object.entries(e||{}).forEach(e=>{let[l,n]=e;null!=n&&(t[l]=n)}),t}function o(e,t,l){try{var n,o,r,i,a;let s=null==(o=e.dataSourceManager)||null==(n=o.getDataSource)?void 0:n.call(o,t||"main"),d=null==s||null==(i=s.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,l);return(null==d||null==(a=d.getPrimaryKey)?void 0:a.call(d))||"id"}catch(e){return"id"}}function r(e,t){var l,r;if(!t)return;let i=t.dataSourceKey||"main",a=t.collection||(null==(l=t.record)?void 0:l.__collectionName);if(!a)return;let s=o(e,i,a)||"id",d=void 0!==t.filterByTk?t.filterByTk:void 0!==t.id?t.id:null==(r=t.record)?void 0:r[s];if(void 0!==d)return n({collection:a,filterByTk:d,dataSourceKey:i,associationName:t.associationName,sourceId:t.sourceId,fields:t.fields,appends:t.appends})}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=e=>!!e&&"object"==typeof e&&"string"==typeof e.collection&&(void 0!==e.filterByTk||void 0!==e.id||e.record),n={},o=(t,i)=>{if(l(t)){let l=r(e,t);l&&(n[i.join(".")]=l);return}if(Array.isArray(t)){for(let e=0;e<t.length;e++)o(t[e],[...i,String(e)]);return}if(t&&"object"==typeof t){for(let[e,l]of Object.entries(t))o(l,[...i,e]);return}};return o(t,[]),Object.keys(n).length?n:void 0}l.d(t,{d:()=>i})},88439(e,t,l){"use strict";function n(e,t,l,n){let o={},r={};for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a)){let s=t[a],d={};if(s.uiSchema&&"object"==typeof s.uiSchema){for(let[e,t]of Object.entries(s.uiSchema))if(t&&"object"==typeof t){var i;let l=t;d[e]={type:l.type||"any",title:l.title||(null==(i=l["x-decorator-props"])?void 0:i.label)||e,interface:l["x-component"],uiSchema:l}}}let u=Object.keys(d).length>0;r[a]={type:"object",title:e.t(s.title)||a,display:u?"default":"none",properties:u?{params:{type:"object",title:"Parameters",display:"flatten",properties:d}}:void 0},o[a]={get params(){return l.getStepParams(n,a)||{}},get uiSchema(){return s.uiSchema},result:void 0}}e.defineProperty("steps",{get:()=>o})}l.d(t,{w:()=>n})},73398(e,t,l){"use strict";function n(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=r.exec(o));)t.add(e[1]);let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=i.exec(o));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function o(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=r.exec(o));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],o=e[3]||"";t[l].push(`${n}${o}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],o=e[2]||"";t[l].push(`[${n}]${o}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=i.exec(o));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],o=n[3]||"";t[e].push(`${l}${o}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],o=n[2]||"";t[e].push(`[${l}]${o}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}l.d(t,{xI:()=>h,vP:()=>y,$S:()=>f,pc:()=>g,Cg:()=>c,nN:()=>x,ju:()=>b,Xx:()=>m,vE:()=>p,XU:()=>u,UX:()=>v});var r=l(22928),i=l(35846),a=l(44476),s=l(2543),d=l.n(s);function u(e){var t,l,n,o;let r=e.resource,i=e.collection,a=e.record,s=(null==i?void 0:i.name)||(null==r||null==(t=r.getResourceName)?void 0:t.call(r)),d=(null==i?void 0:i.dataSourceKey)||(null==r||null==(l=r.getDataSourceKey)?void 0:l.call(r)),u=(null==r||null==(n=r.getFilterByTk)?void 0:n.call(r))??(null==i||null==(o=i.getFilterByTK)?void 0:o.call(i,a));if(!s||null==u)return;let c=String(s).split(".");return{collection:c[c.length-1],dataSourceKey:d,filterByTk:u}}function c(e){var t,l,n;let o=e.view;if(!o)return;let r=(null==o?void 0:o.inputArgs)||{},i=(null==r?void 0:r.collectionName)||(null==o||null==(t=o.record)?void 0:t.collection),a=(null==r?void 0:r.dataSourceKey)||(null==o||null==(l=o.record)?void 0:l.dataSourceKey)||"main",s=(null==r?void 0:r.filterByTk)||(null==o||null==(n=o.record)?void 0:n.filterByTk),d=null==r?void 0:r.associationName,u=null==r?void 0:r.sourceId;if(i&&null!=s)return{collection:i,dataSourceKey:a,filterByTk:s,sourceId:u,associationName:d}}function p(e,t){var l,n,o;let r=null==(l=e.inputArgs)?void 0:l.record,i=null==(n=e.collection)?void 0:n.filterTargetKey;if(!r||!i)return;let a=t.view,s=null==a||null==(o=a.inputArgs)?void 0:o.filterByTk,u=r[i];if(null!=s&&null!=u&&s===u)return d().cloneDeep(r)}function m(e,t){return l=>{var n,o,r,i;if(!("record"===l||l.startsWith("record.")))return!1;let s=t();if(!s)return!0;if("record"===l)return!1;let d=c(e),u=null==d?void 0:d.collection,p=(null==d?void 0:d.dataSourceKey)||"main";if(!u)return!0;let m=null==(o=e.dataSourceManager)||null==(n=o.getDataSource)?void 0:n.call(o,p),h=null==m||null==(i=m.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,u);if(!h)return!0;let f=(0,a.H)(()=>h,()=>s),g=l.startsWith("record.")?l.slice(7):"";return!!g&&f(g)}}function h(e,t){let l=(0,a.H)(e,()=>t());return n=>{let o=t();if(!o)return!0;if(!n)return!1;let r=e();if(!n.includes(".")){var i;let e,t=n;return r&&("function"==typeof r.getField&&(e=r.getField(t)),e||"function"!=typeof r.getFields||(e=(r.getFields()||[]).find(e=>(null==e?void 0:e.name)===t))),!!(null==e||null==(i=e.isAssociationField)?void 0:i.call(e))&&null==(null==o?void 0:o[t])}return l(n)}}async function f(e,t,l){let n=await (0,i.H)(e,t,!0)();return n?{...n,buildVariablesParams:e=>l?l(e):u(e)}:null}function g(e,t,l){let n=async()=>f(e,t,l);return n.title=t,n}function v(e,t,l){var n,o;return g(t,(null==l?void 0:l.title)?(null==(n=e.t)?void 0:n.call(e,l.title))||l.title:(null==(o=e.t)?void 0:o.call(e,"Current record"))||"Current record",e=>u(e))}let y=n,x=o;async function b(e,t){let l=Object.keys(o(t)||{});if(!l.length)return;let n={};for(let t of l){var i;let l,o=null==(i=e.getPropertyOptions)?void 0:i.call(e,t),r=null==o?void 0:o.meta;if(r){try{let t="function"==typeof r?await r():r,n=null==t?void 0:t.buildVariablesParams;"function"==typeof n&&(l=await n(e))}catch(e){continue}l&&(n[t]=l)}}return(0,r.d)(e,n)}},67778(e,t,l){"use strict";l.d(t,{sp:()=>j,bt:()=>R,U:()=>et,N5:()=>K,xB:()=>q,mW:()=>O,fP:()=>G});var n=l(74848),o=l(96540),r=l(99418),i=l(11869),a=l(29007),s=l(52568),d=l(73398);function u(e){return null!=e}function c(e,t){if(e===t)return!0;if(!u(e)||!u(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch(l){return String(e)===String(t)}}function p(e){var t;let l=null==e||null==(t=e.navigation)?void 0:t.viewStack;return Array.isArray(l)?l:[]}function m(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p(e);if(!l.length)return -1;let n=(null==e?void 0:e.inputArgs)||{},o=(null==e||null==(t=e.navigation)?void 0:t.viewParams)||{},r=n.viewUid??o.viewUid;if(!r)return l.length-1;let i=l.map((e,t)=>({item:e,index:t})).filter(e=>{let{item:t}=e;return(null==t?void 0:t.viewUid)===r});if(!i.length)return l.length-1;let a=["filterByTk","sourceId","tabUid"],s=i[i.length-1].index,d=-1;for(let{item:e,index:t}of i){let l=0,o=!0;for(let t of a)if(u(n[t])){if(!c(null==e?void 0:e[t],n[t])){o=!1;break}l+=1}o&&l>=d&&(s=t,d=l)}return s}function h(e,t){return t??e.view}function f(e){var t;if(!e)return!1;let l=p(e),n=null==e||null==(t=e.inputArgs)?void 0:t.openerUids,o=Array.isArray(n)&&n.length>0;return m(e,l)>=1||o}function g(e,t){let l=t=>e.t(t),n=function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;return f(h(l,t))},o=async e=>{let l=h(e,t);if(!l||!f(l))return;let n=await v(e,l),o=null==n?void 0:n.resource;return(null==o?void 0:o.collectionName)&&null!=o.filterByTk?{collection:o.collectionName,dataSourceKey:o.dataSourceKey||"main",filterByTk:o.filterByTk,associationName:o.associationName,sourceId:o.sourceId}:(0,d.Cg)(e)},r=async()=>{var t,l,n,r;let i=await o(e);if(!(null==i?void 0:i.collection))return null;let a=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,i.dataSourceKey||"main");return(null==a||null==(r=a.collectionManager)||null==(n=r.getCollection)?void 0:n.call(r,i.collection))||null},i=async(l,n)=>{var o,r,i,a,s,d;try{let s=n||e,d=h(s,t),u=p(d),c=m(d,u);if(c<1||l<1)return;let f=c-l;if(f<1)return;let g=u[f];if(!(null==g?void 0:g.viewUid))return;let v=null==(o=s.engine)?void 0:o.getModel(g.viewUid,!0);if(!v)try{v=await s.engine.loadModel({uid:g.viewUid})}catch(t){null==(a=s.logger||e.logger)||null==(i=a.warn)||i.call(a,{err:t},"[FlowEngine] popup.getParentRecordRef loadModel failed")}let y=(null==v||null==(r=v.getStepParams)?void 0:r.call(v,"popupSettings","openView"))||{},x=null==y?void 0:y.collectionName,b=(null==y?void 0:y.dataSourceKey)||"main",w=(null==g?void 0:g.filterByTk)??(null==g?void 0:g.sourceId);if(!x||null==w)return;return{collection:x,dataSourceKey:b,filterByTk:w,sourceId:null==g?void 0:g.sourceId,associationName:null==y?void 0:y.associationName}}catch(t){null==(d=(null==n?void 0:n.logger)||e.logger)||null==(s=d.warn)||s.call(d,{err:t},"[FlowEngine] popup.getParentRecordRef failed");return}},a=l=>{try{let n=h(e,t),o=p(n);return m(n,o)-l>=1}catch(e){return!1}},s=t=>{let n=()=>({type:"object",title:l("Parent popup"),disabled:()=>!a(t),disabledReason:()=>a(t)?void 0:l("No parent popup"),hidden:()=>!a(t),properties:async()=>{let n=await i(t),o={};if(o.uid={type:"string",title:l("Popup uid")},n){let t=(()=>{try{var t,l,o,r;let i=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,n.dataSourceKey||"main");return(null==i||null==(r=i.collectionManager)||null==(o=r.getCollection)?void 0:o.call(r,n.collection||""))||null}catch(e){return null}})();o.record=await (0,d.$S)(()=>t,l("Popup record"),()=>n)||{type:"object",title:l("Popup record")}}else o.record={type:"object",title:l("Popup record")};return o.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},o}});return n.title=l("Parent popup"),n},u=()=>({type:"object",title:l("Current popup"),disabled:()=>!n(),hidden:()=>!n(),buildVariablesParams:async e=>{var l,r,a,s;if(!n(e))return;let d=await o(e),u=h(e,t),c=null==u?void 0:u.inputArgs,f={};if(d){let e={...d};!e.associationName&&(null==c?void 0:c.associationName)&&(e.associationName=c.associationName),void 0===e.sourceId&&void 0!==(null==c?void 0:c.sourceId)&&(e.sourceId=null==c?void 0:c.sourceId),f.record=e}try{let t=p(u);if(m(u,t)>=2){let t=f,l=1,n=await i(l,e);for(;n;)t.parent||(t.parent={}),t.parent.record=n,t=t.parent,l+=1,n=await i(l,e)}}catch(t){null==(r=e.logger)||null==(l=r.debug)||l.call(r,{err:t},"[FlowEngine] buildVariablesParams: build parent-chain failed")}try{let e=null==c?void 0:c.sourceId,t=null==c?void 0:c.associationName,l=(null==c?void 0:c.dataSourceKey)||"main";if(null!=e&&""!==e&&t&&"string"==typeof t){let n=String(t).split(".")[0];n&&(f.sourceRecord={collection:n,dataSourceKey:l,filterByTk:e})}}catch(t){null==(s=e.logger)||null==(a=s.debug)||a.call(s,{err:t},"[FlowEngine] buildVariablesParams: infer sourceRecord failed")}return f},properties:async()=>{var n,a,u,c;let f={};if(f.uid={type:"string",title:l("Popup uid")},await o(e)){let e=async()=>{let e=await r();return e?await (0,d.$S)(()=>e,l("Current popup record"),e=>o(e)):null};e.title=l("Current popup record"),e.hasChildren=!0,f.record=e}try{let o=h(e,t),r=null==o?void 0:o.inputArgs,i=null==r?void 0:r.sourceId,s=null==r?void 0:r.associationName,u=(null==r?void 0:r.dataSourceKey)||"main";if(!s||"string"!=typeof s||!s.includes(".")){let t=p(o),l=m(o,t),r=l>=0?null==t?void 0:t[l]:void 0;if(null==r?void 0:r.viewUid){let t=null==e||null==(n=e.engine)?void 0:n.getModel(r.viewUid,!0);t||(t=await e.engine.loadModel({uid:r.viewUid}));let l=(null==t||null==(a=t.getStepParams)?void 0:a.call(t,"popupSettings","openView"))||{};s=(null==l?void 0:l.associationName)||s,u=(null==l?void 0:l.dataSourceKey)||u}}if(null!=i&&""!==i&&s&&"string"==typeof s){let t=String(s).includes(".")?String(s).split(".")[0]:void 0;if(t){let n=()=>{try{var l,n,o,r;let i=null==(n=e.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);return(null==i||null==(r=i.collectionManager)||null==(o=r.getCollection)?void 0:o.call(r,t))||null}catch(e){return null}},o=await (0,d.$S)(n,l("Current popup parent record"),()=>({collection:t,dataSourceKey:u,filterByTk:i}));o&&(f.sourceRecord=o)}}}catch(t){null==(c=e.logger)||null==(u=c.debug)||u.call(c,{err:t},"[FlowEngine] popup.properties: build sourceRecord failed")}return f.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},await i(1)&&(f.parent=s(1)),f}});return u.title=l("Current popup"),u.sort=975,u}async function v(e,t){var l;let n=p(t),o=m(t,n),r=null==t||null==(l=t.inputArgs)?void 0:l.openerUids,i=Array.isArray(r)&&r.length>0;if(!(o>=1||i))return;if(!n.length){let e=(null==t?void 0:t.inputArgs)||{};if(!(e.collectionName||null!=e.filterByTk||null!=e.sourceId||e.associationName||e.viewUid))return;return{uid:e.viewUid,resource:{dataSourceKey:e.dataSourceKey||"main",collectionName:e.collectionName,associationName:e.associationName,filterByTk:e.filterByTk,sourceId:e.sourceId}}}let a=async t=>{var l,o,r,i,s,d;if(t<0||!(null==(l=n[t])?void 0:l.viewUid))return;let u=n[t].viewUid,c=null==(o=e.engine)?void 0:o.getModel(u,!0);c||(c=await (null==(d=e.engine)?void 0:d.loadModel({uid:u})));let p=(null==c||null==(r=c.getStepParams)?void 0:r.call(c,"popupSettings","openView"))||{},m=null==p?void 0:p.collectionName,h={uid:u,resource:{dataSourceKey:(null==p?void 0:p.dataSourceKey)||"main",collectionName:m,associationName:null==p?void 0:p.associationName,filterByTk:null==(i=n[t])?void 0:i.filterByTk,sourceId:null==(s=n[t])?void 0:s.sourceId}},f=await a(t-1);return f&&(h.parent=f),h};return await a(o)}function y(e,t){let l=/^(?:record|sourceRecord)(?:\.|$)|^parent(?:\.parent)*(?:\.(?:record|sourceRecord))(?:\.|$)/;e.defineProperty("popup",{get:async()=>v(e,t),meta:g(e,t),resolveOnServer:e=>{try{return!!e&&l.test(e)}catch(e){return!1}}})}var x=l(18182);let b=(0,o.forwardRef)((e,t)=>{let{afterClose:l,footer:r,header:i,hidden:a,...s}=e,[d,u]=(0,o.useState)(!0),[c,p]=(0,o.useState)(s),[m,h]=(0,o.useState)(()=>r),[f,g]=(0,o.useState)(i);(0,o.useImperativeHandle)(t,()=>({destroy:()=>{u(!1),null==l||l()},update:e=>p(t=>({...t,...e})),setFooter:e=>{h(e)},setHeader:e=>{0===Object.values(e||{}).length?g(null):g(e)}}));let v={...c,title:(null==f?void 0:f.title)||c.title,extra:null==f?void 0:f.extra,footer:void 0!==m?m:c.footer??null},y=o.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return(0,n.jsx)(x.A,{closable:!1,rootClassName:a?"nb-hidden":"",getContainer:y,...v,open:d,onCancel:c.onCancel,afterClose:()=>{null==l||l()},children:c.children})});function w(){let[e,t]=o.useState([]);return[e,o.useCallback(e=>(t(t=>[...t,e]),()=>{t(t=>t.filter(t=>t!==e))}),[])]}var S=l(16639),C=l(20616),F=l(47451);async function k(e,t){var l;return!!t.force||!1!==await (null==(l=e.beforeClose)?void 0:l.call(e,t))}function A(e,t){var l;let n=null==t?void 0:t.layoutContext,o=null==t||null==(l=t.engine)?void 0:l.context;n instanceof a.cB&&n!==t&&n!==o&&e.addDelegate(n)}let P=0;function j(){let e=o.useRef(null),t=(t,l)=>{var u,c,p;let m,h,f=null==l?void 0:l.engine;P+=1;let g=o.createRef(),v=new Promise(e=>{h=e}),x=null,w=null,j=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return x=t,null==(e=g.current)||e.setFooter(t),()=>{var e;x=null,null==(e=g.current)||e.setFooter(null)}},[t]),null},M=e=>(o.useEffect(()=>{var t;return w=e,null==(t=g.current)||t.setHeader(e),()=>{var e;w=null,null==(e=g.current)||e.setHeader(null)}},[e]),null),I=new a.cB,T=(0,F._)(l.engine),R=(0,S.eX)(f,T);I.defineProperty("engine",{value:T}),I.addDelegate(T.context),!1!==t.inheritContext?I.addDelegate(l):(I.addDelegate(l.engine.context),A(I,l));let E=!1,N={type:"dialog",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,r;if(E)return;E=!0,null==(l=t.onClose)||l.call(t),null==(n=g.current)||n.destroy(),null==m||m(),null==h||h(e);let i=null==R?void 0:R.emitter;(0,S.Z8)(i),null==i||null==(r=i.emit)||r.call(i,S.B9,{type:"dialog",viewUid:null==N||null==(o=N.inputArgs)?void 0:o.viewUid}),T.unlinkFromStack()},update:e=>{var t;return null==(t=g.current)?void 0:t.update(e)},close:async(e,l)=>{var n,o;return(!t.preventClose||!!l)&&!!await k(N,{result:e,force:l})&&(t.triggerByRouter&&(null==(o=t.inputArgs)||null==(n=o.navigation)?void 0:n.back)?t.inputArgs.navigation.back():N.destroy(e),!0)},Footer:j,Header:M,setFooter:e=>{var t;x=e,null==(t=g.current)||t.setFooter(e)},setHeader:e=>{var t;w=e,null==(t=g.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,I)}};I.defineProperty("view",{get:()=>N,resolveOnServer:(0,d.Xx)(I,()=>(0,d.vE)(l,I))}),T.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),N.destroy()}),y(I,N);let D=(0,i.observer)(()=>{var e,l,i,a;let s=o.useRef(!1),d="function"==typeof t.content?t.content(N,I):t.content,u="string"==typeof d?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(d)}}):d;return(o.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,N,I)},[]),(null==(l=t.inputArgs)||null==(e=l.hidden)?void 0:e.value)&&!s.current)?null:(s.current=!0,(0,n.jsx)(b,{className:"nb-dialog-overflow-hidden",ref:g,hidden:null==(a=t.inputArgs)||null==(i=a.hidden)?void 0:i.value,footer:x,header:w,...t,onCancel:()=>{N.close(t.result)},children:u}))},{displayName:"DialogWithContext"}),B=(null==t||null==(c=t.inputArgs)?void 0:c.viewUid)||`page-${P}`,$=(0,n.jsx)(C.I6,{engine:T,children:(0,n.jsx)(s.YQ,{context:I,children:(0,n.jsx)(D,{})})},B);return m=null==(p=e.current)?void 0:p.patchElement($),Object.assign(v,N)},l=o.useMemo(()=>({open:t}),[]),u=o.memo(o.forwardRef((e,t)=>{let[l,r]=w();return o.useImperativeHandle(t,()=>({patchElement:r}),[r]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(u,{ref:e},"dialog-holder")]}var M=l(97134),I=l(61793);let T=o.forwardRef((e,t)=>{var l;let{children:r,footer:i,title:a,extra:s,hidden:d,isMobile:u,...c}=e,[p,m]=o.useState(!0),[h,f]=o.useState(()=>i),[g,v]=o.useState({title:a,extra:s,...c.header});o.useImperativeHandle(t,()=>({destroy:()=>{m(!1)},update:e=>{Object.assign(c,e)},setFooter:e=>{f(e)},setHeader:e=>{0===Object.values(e||{}).length?v(null):v(e)}}),[]);let y=o.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return u?(0,n.jsx)(I.D,{className:d?"nb-hidden":"",visible:p,...c,footer:h,...g,onClose:c.onClose,children:r}):(0,n.jsx)(M.A,{rootClassName:d?"nb-hidden":"",closable:!1,getContainer:y,...c,open:p,footer:h,styles:{...c.styles,footer:{display:"flex",justifyContent:"flex-end",...null==(l=c.styles)?void 0:l.footer}},...g,onClose:c.onClose,children:r})});function R(){let e=o.useRef(null),t=o.useMemo(()=>i.observable.shallow({value:[]}),[]),l=o.memo(e=>{let{index:r}=e,[a,s]=o.useState(null);return(o.useEffect(()=>{(0,i.autorun)(()=>{let e=t.value;e[r]&&a!==e[r]&&s(e[r]),e[r]||s(null)})},[a,r]),a)?(0,n.jsx)(a,{children:(0,n.jsx)(l,{index:r+1})}):null});l.displayName="RenderNestedDrawer";let u=(t,l)=>{var u,c;let p,m,h=l.engine,f=o.createRef(),g=new Promise(e=>{m=e}),v=null,x=null,b=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return v=t,null==(e=f.current)||e.setFooter(t),()=>{var e;v=null,null==(e=f.current)||e.setFooter(null)}},[t]),null},w=e=>(o.useEffect(()=>{var t;return x=e,null==(t=f.current)||t.setHeader(e),()=>{var e;x=null,null==(e=f.current)||e.setHeader(null)}},[e]),null),P=new a.cB,j=(0,F._)(l.engine),M=(0,S.eX)(h,j);P.defineProperty("engine",{value:j}),P.addDelegate(j.context),!1!==t.inheritContext?P.addDelegate(l):(P.addDelegate(l.engine.context),A(P,l));let I=!1,R={type:"drawer",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,r;if(I)return;I=!0,null==(l=t.onClose)||l.call(t),null==(n=f.current)||n.destroy(),null==p||p(),null==m||m(e);let i=null==M?void 0:M.emitter;(0,S.Z8)(i),null==i||null==(r=i.emit)||r.call(i,S.B9,{type:"drawer",viewUid:null==R||null==(o=R.inputArgs)?void 0:o.viewUid}),j.unlinkFromStack()},update:e=>{var t;return null==(t=f.current)?void 0:t.update(e)},close:async(e,l)=>{var n,o;return(!t.preventClose||!!l)&&!!await k(R,{result:e,force:l})&&(t.triggerByRouter&&(null==(o=t.inputArgs)||null==(n=o.navigation)?void 0:n.back)?t.inputArgs.navigation.back():R.destroy(e),!0)},Footer:b,Header:w,setFooter:e=>{var t;v=e,null==(t=f.current)||t.setFooter(e)},setHeader:e=>{var t;x=e,null==(t=f.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,P)}};P.defineProperty("view",{get:()=>R,resolveOnServer:(0,d.Xx)(P,()=>(0,d.vE)(l,P))}),j.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),R.destroy()}),y(P,R);let E=o.memo((0,i.observer)(e=>{var l,i,a,s;let d=o.useRef(!1),u="function"==typeof t.content?t.content(R,P):t.content,c="string"==typeof u?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(u)}}):u;return(o.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,R,P)},[]),(null==(i=t.inputArgs)||null==(l=i.hidden)?void 0:l.value)&&!d.current)?(0,n.jsx)(n.Fragment,{children:e.children}):(d.current=!0,(0,n.jsxs)(T,{ref:f,...t,footer:v,header:t.header||x,hidden:null==(s=t.inputArgs)||null==(a=s.hidden)?void 0:a.value,onClose:()=>{R.close(t.result)},isMobile:P.isMobileLayout,children:[c,e.children]}))}));E.displayName="DrawerWithContext";let N=o.memo(e=>{let{children:t}=e;return(0,n.jsx)(C.I6,{engine:j,children:(0,n.jsx)(s.YQ,{context:P,children:(0,n.jsx)(E,{children:t})})})});return N.displayName="RenderDrawer",p=null==(c=e.current)?void 0:c.patchElement(N),Object.assign(g,R)},c=o.useMemo(()=>({open:u}),[]),p=o.memo(o.forwardRef((e,r)=>{let[i,a]=w();return o.useImperativeHandle(r,()=>({patchElement:a}),[a]),o.useEffect(()=>{t.value=i},[i]),(0,n.jsx)(l,{index:0})}));return[c,(0,n.jsx)(p,{ref:e},"drawer-holder")]}var E=l(40961),N=l(31333),D=l(71021);let B=(0,o.forwardRef)((e,t)=>{let[l,r]=o.useState({}),{visible:i=!0,footer:a=null,header:s=null,children:d,hidden:u,title:c,styles:p={},zIndex:m=4,onClose:h}={...e,...l},f=(0,o.useRef)(!1),g=(0,C.uf)(),[v,y]=(0,o.useState)(()=>a),[x,b]=(0,o.useState)(s);(0,o.useImperativeHandle)(t,()=>({destroy:()=>{f.current||(f.current=!0)},update:e=>{r(e)},setFooter:e=>{y(e)},setHeader:e=>{0===Object.values(e||{}).length?b(null):b(e)}}));let w=(0,o.useMemo)(()=>({display:u?"none":"flex",flexDirection:"column",height:"100%",zIndex:m}),[u,m]),S=(0,o.useMemo)(()=>{if(!x&&!c)return null;let{title:e=c,extra:t}=x||{},l=g.context.themeToken;return(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${l.paddingSM}px ${l.padding}px`,borderBottom:`1px solid ${l.colorSplit}`,backgroundColor:l.colorBgContainer,...p.header},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:l.marginXS},children:[(0,n.jsx)(D.Ay,{type:"text",size:"small",icon:(0,n.jsx)(N.A,{}),onClick:async()=>{f.current||!1!==await (null==h?void 0:h())&&(f.current=!0)},style:{color:l.colorTextTertiary}}),e&&(0,n.jsx)("div",{style:{fontSize:l.fontSizeLG,fontWeight:l.fontWeightStrong,color:l.colorText},children:e})]}),t&&(0,n.jsx)("div",{children:t})]})},[x,c,g.context.themeToken,p.header,h]),F=(0,o.useMemo)(()=>{if(!v)return null;let e=g.context.themeToken;return(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:`${e.paddingXS}px ${e.padding}px`,borderTop:`1px solid ${e.colorSplit}`,backgroundColor:e.colorBgContainer,...p.footer},children:v})},[v,g.context.themeToken,p.footer]);return i?(0,n.jsxs)("div",{style:{...w,...p.content},children:[S,(0,n.jsx)("div",{style:{flex:1,overflowY:"auto",...p.body},children:d}),F]}):null}),$=0,O="nocobase-embed-container",q="nocobaseEmbedReplacing";function _(e){return!!e&&"function"==typeof e.then}function L(e,t){e.dataset[q]="1";try{let l=t.close();if(_(l))return Promise.resolve(l).finally(()=>{delete e.dataset[q]});return delete e.dataset[q],l}catch(t){throw delete e.dataset[q],t}}function V(e,t,l){let n,o={},r=e.then(e=>{let{page:t}=e;return(n=t)&&("beforeClose"in o&&(n.beforeClose=o.beforeClose),"update"in o&&n.update(o.update),"footer"in o&&n.setFooter(o.footer),"header"in o&&n.setHeader(o.header),o.destroyed&&n.destroy(o.destroyed.result)),{page:t}});return Object.assign(r.then(e=>{let{page:t}=e;return!!t&&t}),{type:"embed",inputArgs:t,preventClose:l,Header:null,Footer:null,get beforeClose(){return(null==n?void 0:n.beforeClose)??o.beforeClose},set beforeClose(value){n?n.beforeClose=value:o.beforeClose=value},close:(e,t)=>r.then(l=>{let{page:n}=l;return!!n&&n.close(e,t)}),destroy:e=>{n?n.destroy(e):o.destroyed={result:e}},update:e=>{n?n.update(e):o.update={...o.update,...e}},setFooter:e=>{n?n.setFooter(e):o.footer=e},setHeader:e=>{n?n.setHeader(e):o.header=e}})}let z=o.memo(o.forwardRef((e,t)=>{let[l,r]=w();return o.useImperativeHandle(t,()=>({patchElement:r}),[r]),(0,n.jsx)(n.Fragment,{children:l})}));function K(){let e=o.useRef(null),t=o.useRef(null),l=o.useRef(0),r=(r,u)=>{let{target:c,content:p,preventClose:m,inheritContext:h=!0,inputArgs:f={},onOpenCancelled:g,...v}=r,x=c instanceof HTMLElement&&c.id===O,b=()=>{var l,g,b;let w,P,j,M=null==u?void 0:u.engine;$+=1;let I=o.createRef(),T=new Promise(e=>{P=e}),R=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return null==(e=I.current)||e.setFooter(t),()=>{var e;null==(e=I.current)||e.setFooter(null)}},[t]),null},N=e=>(o.useEffect(()=>{var t;return null==(t=I.current)||t.setHeader(e),()=>{var e;null==(e=I.current)||e.setHeader(null)}},[e]),null),D=new a.cB,O=(0,F._)(u.engine),_=(0,S.eX)(M,O);D.defineProperty("engine",{value:O}),D.addDelegate(O.context),h?D.addDelegate(u):(D.addDelegate(u.engine.context),A(D,u));let L=!1,V={type:"embed",inputArgs:f,preventClose:!!r.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,i,a;if(!L){if(L=!0,null==(l=r.onClose)||l.call(r),null==P||P(e),null==(n=I.current)||n.destroy(),null==w||w(),x&&t.current===V&&(t.current=null),!(x&&c instanceof HTMLElement&&(null==(o=c.dataset)?void 0:o[q])==="1")){let e=null==_?void 0:_.emitter;(0,S.Z8)(e),null==e||null==(a=e.emit)||a.call(e,S.B9,{type:"embed",viewUid:null==V||null==(i=V.inputArgs)?void 0:i.viewUid})}O.unlinkFromStack()}},update:e=>{var t;return null==(t=I.current)?void 0:t.update(e)},close:(e,t)=>L?Promise.resolve(!0):j||(j=(async()=>{try{var l,n;if(m&&!t)return j=void 0,!1;let o=await k(V,{result:e,force:t});if(L)return!0;if(!o)return j=void 0,!1;if(r.triggerByRouter&&(null==(n=r.inputArgs)||null==(l=n.navigation)?void 0:l.back))return r.inputArgs.navigation.back(),!0;return V.destroy(e),!0}catch(e){throw L||(j=void 0),e}})()),Header:N,Footer:R,setFooter:e=>{var t;null==(t=I.current)||t.setFooter(e)},setHeader:e=>{var t;null==(t=I.current)||t.setHeader(e)},navigation:null==(l=r.inputArgs)?void 0:l.navigation,get record(){return(0,d.vE)(u,D)}};D.defineProperty("view",{get:()=>V,resolveOnServer:(0,d.Xx)(D,()=>(0,d.vE)(u,D))}),y(D,V);let z=(0,i.observer)(()=>{var e,t,l,i;let a=o.useRef(!1),s=o.useMemo(()=>"function"==typeof p?p(V,D):p,[]);return(D.themeToken,o.useEffect(()=>{var e;null==(e=r.onOpen)||e.call(r,V,D)},[]),(null==(t=r.inputArgs)||null==(e=t.hidden)?void 0:e.value)&&!a.current)?null:(a.current=!0,(0,n.jsx)(B,{ref:I,hidden:null==(i=r.inputArgs)||null==(l=i.hidden)?void 0:l.value,...v,onClose:()=>V.close(r.result),children:s}))},{displayName:"PageWithContext"}),K=(null==f?void 0:f.viewUid)||`page-${$}`,U=(0,n.jsx)(C.I6,{engine:O,children:(0,n.jsx)(s.YQ,{context:D,children:(0,n.jsx)(z,{})})},K);return w=c&&c instanceof HTMLElement?null==(g=e.current)?void 0:g.patchElement(E.createPortal(U,c,K)):null==(b=e.current)?void 0:b.patchElement(U),x&&(t.current=V),Object.assign(T,V)};if(x&&t.current){let e,n=l.current+=1,o=()=>null==g?void 0:g();try{e=L(c,t.current)}catch(e){throw o(),e}if(_(e))return V(Promise.resolve(e).then(e=>!1===e||n!==l.current?(o(),{page:null}):{page:b()},e=>{throw o(),e}),f,!!r.preventClose);if(!1===e)return o(),V(Promise.resolve({page:null}),f,!!r.preventClose)}return b()};return[o.useMemo(()=>({open:r}),[]),(0,n.jsx)(z,{ref:e},"page-holder")]}var U=l(28073);let W=0,H=o.forwardRef((e,t)=>{var l,r;let{afterClose:i,content:a,placement:s,rect:d,...u}=e,[c,p]=o.useState(!0),[m,h]=o.useState({content:a,placement:s,rect:d,...u});return o.useImperativeHandle(t,()=>({destroy:()=>p(!1),update:e=>h(t=>({...t,...e})),close:(e,t)=>p(!1)})),o.useEffect(()=>{c||null==i||i()},[c,i]),(0,n.jsx)(U.A,{arrow:!1,open:c,trigger:["click"],destroyTooltipOnHide:!0,content:m.content,placement:m.placement,getPopupContainer:()=>document.querySelector("#nocobase-app-container")||document.body,onOpenChange:e=>{(e||!m.preventClose)&&(p(e),e||null==i||i())},...m,children:(0,n.jsx)("span",{style:{position:"absolute",top:((null==(l=m.rect)?void 0:l.top)??0)+window.scrollY,left:((null==(r=m.rect)?void 0:r.left)??0)+window.scrollX,width:0,height:0}})})});function G(){let e=o.useRef(null),t=t=>{var l,i;let a,s;W+=1;let{target:d,placement:u="rightTop",content:c,...p}=t,m=o.createRef(),h=(null==d||null==(l=d.getBoundingClientRect)?void 0:l.call(d))??{top:0,left:0},f=new Promise(e=>{s=e}),g={type:"popover",destroy:()=>{var e;return null==(e=m.current)?void 0:e.destroy()},update:e=>{var t;return null==(t=m.current)?void 0:t.update(e)},close:e=>{var t;null==s||s(e),null==(t=m.current)||t.close(e)}},v="function"==typeof c?c(g):c,y="string"==typeof v?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(v)}}):v,x=(0,n.jsx)(H,{ref:m,content:y,placement:u,rect:h,afterClose:()=>{var e;null==a||a(),null==(e=t.onClose)||e.call(t),null==s||s(t.result)},...p},`popover-${W}`);return a=null==(i=e.current)?void 0:i.patchElement(x),Object.assign(f,g)},l=o.useMemo(()=>({open:t}),[]),i=o.memo(o.forwardRef((e,t)=>{let[l,r]=w();return o.useImperativeHandle(t,()=>({patchElement:r}),[]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(i,{ref:e},"popover-holder")]}var Y=l(52847),J=l(60182);function X(e){return null==e?"":e&&"object"==typeof e&&!Array.isArray(e)?encodeURIComponent(Object.entries(e).map(e=>{let[t,l]=e;return`${encodeURIComponent(String(t))}=${encodeURIComponent(String(l))}`}).join("&")):encodeURIComponent(String(e))}function Q(e){return null!=e&&""!==String(e)}function Z(e){let t=e||"/admin";return`/${t.replace(/^\/+/,"").replace(/\/+$/,"")}`}function ee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=Z(t.basePath||t.prefix);if(!e||0===e.length)return l;let n=l.replace(/^\/+/,"").split("/").filter(Boolean);return e.forEach((e,t)=>{t>0&&n.push("view"),n.push(e.viewUid);let l=(0,J.Gu)(e.viewUid,e.openViewRouteState);if(l&&n.push("opts",l),e.tabUid&&n.push("tab",e.tabUid),null!=e.filterByTk){let t=X(e.filterByTk);t&&n.push("filterbytk",t)}Q(e.sourceId)&&n.push("sourceid",String(e.sourceId))}),"/"+n.join("/")}class et{setViewStack(e){this.viewStack=Object.freeze([...e]),this.viewParams=this.viewStack[this.viewStack.length-1]||{}}changeTo(e){let t=ee(this.viewStack.map((t,l)=>l===this.viewStack.length-1?{...t,...e}:{...t}),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(t,{replace:!0})}navigateTo(e,t){let l=ee([...this.viewStack,e],{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(l,t)}back(){let e=ee(this.viewStack.slice(0,-1),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(e,{replace:!0})}getLayoutBasePath(){var e,t;let l=null==(e=this.ctx.layout)?void 0:e.routePath;return this.basePath||(null==(t=this.ctx.layoutRoute)?void 0:t.basePathname)||((null==l?void 0:l.startsWith("/"))?l:"/admin")}constructor(e,t,l={}){this.setViewStack(t),this.ctx=e,this.basePath=l.basePath||l.layoutBasePath,(0,Y.E8)(this,{viewParams:Y.sH})}}},16639(e,t,l){"use strict";l.d(t,{B9:()=>o,FH:()=>s,HK:()=>r,Z8:()=>d,eX:()=>p,i6:()=>i,tb:()=>n});let n=Symbol.for("__NOCOBASE_VIEW_ACTIVATED_VERSION__"),o="view:activated",r="dataSource:dirty",i="__NOCOBASE_ENGINE_SCOPE__",a="view";function s(e){let t=Reflect.get(e,n),l="number"==typeof t?t:Number(t);return Number.isFinite(l)&&l>0?l:0}function d(e){let t=s(e);if(!Object.isExtensible(e))return t;let l=t+1;return Reflect.set(e,n,l),l}function u(e){return Reflect.get(e,i)===a}function c(e){let t=e,l=0;for(;t&&l++<50;){if(u(t))return t;t=t.previousEngine}}function p(e,t){if(!e)return;let l=c(e);return l||c(null==t?void 0:t.previousEngine)||e}},40542(e,t,l){"use strict";l.d(t,{D:()=>n});let n=(e,t,l)=>{if(!e)return l;let o=t.split("."),r=[],i=e,a=!1;for(let e=0;e<o.length;e++){let t=o[e];if(Array.isArray(i)){for(let t of(a=!0,i)){let i=n(t,o.slice(e).join("."),l);r=r.concat(i)}break}if((null==i?void 0:i[t])===void 0)break;i=i[t],e===o.length-1&&r.push(i)}return 0===(r=r.filter(e=>void 0!==e)).length?l:a?r.filter(e=>null!==e):r[0]}},96436(e,t,l){"use strict";l.r(t),l.d(t,{getDayRange:()=>tl,isEmptyFilter:()=>ed,sleep:()=>es,getDateVars:()=>ta,isString:()=>ee,unflatten:()=>e4,sortTree:()=>ea,forEach:()=>eA,utc2unit:()=>to,extractUsedVariablePaths:()=>tM,getValuesByPath:()=>eP,isArray:()=>et,moment2str:()=>ex,transformLiquidContext:()=>tT,isURL:()=>tC,isPortalInBody:()=>ty,extractUsedVariableNames:()=>tj,parseHTML:()=>tx,toGmt:()=>ep,isPlainObject:()=>en,lockdownSes:()=>tf,splitPathToTwoParts:()=>ts,transformFilter:()=>Y,parseSQLBindParams:()=>tN,getPickerFormat:()=>eC,nextTick:()=>er,removeNullCondition:()=>eu,CollectionsGraph:()=>V,isValidFilter:()=>eE,evaluateConditions:()=>Z,toUnit:()=>tr,BASE_BLOCKED_IDENTIFIERS:()=>tp,getFormatFromDateStr:()=>ek,removeInvalidFilterItems:()=>J,toLocal:()=>em,getDayRangeByParams:()=>_,getDefaultFormat:()=>ec,transformMultiColumnToSingleColumn:()=>tA,treeFind:()=>ei,transformSQL:()=>tD,parseFilter:()=>tt,flatten:()=>e5,getOffsetRangeByParams:()=>B,isEmpty:()=>el,offsetFromString:()=>eb,tval:()=>tg,error:()=>eL,Registry:()=>td,lodash:()=>o(),parse:()=>e$,hasEmptyValue:()=>eo,toFixedByStep:()=>eJ,getDateTimeFormat:()=>eF,showToast:()=>eH,Handlebars:()=>eI(),getLiquidContext:()=>tR,merge:()=>eU,dayjs:()=>i(),parseLiquidContext:()=>tE,uid:()=>tS,str2moment:()=>eg});var n=l(2543),o=l.n(n),r=l(74353),i=l.n(r),a=l(97375),s=l.n(a),d=l(90445),u=l.n(d),c=l(43522),p=l.n(c),m=l(37872),h=l.n(m),f=l(98867),g=l.n(f),v=l(8906),y=l.n(v),x=l(68313),b=l.n(x),w=l(21840),S=l.n(w),C=l(41816),F=l.n(C),k=l(88569),A=l.n(k),P=l(83826),j=l.n(P),M=l(8134),I=l.n(M),T=l(28623),R=l.n(T),E=l(46986),N=l.n(E);i().extend(N()),i().extend(S()),i().extend(A()),i().extend(j()),i().extend(F()),i().extend(b()),i().extend(h()),i().extend(g()),i().extend(y()),i().extend(I()),i().extend(R()),i().extend(u()),i().extend(s()),i().extend(p());let D=e=>{if(!e)return i()();if(/^[+-]\d{2}:\d{2}$/.test(e)){let[t,l,n]=e.match(/([+-])(\d{2}):(\d{2})/).slice(1),o=(60*parseInt(l)+parseInt(n))*("+"===t?1:-1);return i()().utcOffset(o)}return i()().tz(e)},B=e=>{let t,l,{type:n,unit:o="day",number:r=1,timezone:i}=e,a=D(i),s="week"===o?"isoWeek":o;if("past"===n){let e=a.startOf(s);t=e.subtract(r,o).startOf(s),l=e.subtract(1,o).endOf(s)}else if("next"===n)l=(t=a.startOf(s).add(1,o).startOf(s)).add(r-1,o).endOf(s);else throw Error(`Unsupported type: ${n}`);return[t.format("YYYY-MM-DD HH:mm:ss"),l.format("YYYY-MM-DD HH:mm:ss")]},$=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).startOf(t)},O=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).endOf(t)},q={today:e=>[$(0,"day",null==e?void 0:e.timezone),O(0,"day",null==e?void 0:e.timezone)],yesterday:e=>[$(-1,"day",null==e?void 0:e.timezone),O(-1,"day",null==e?void 0:e.timezone)],tomorrow:e=>[$(1,"day",null==e?void 0:e.timezone),O(1,"day",null==e?void 0:e.timezone)],thisWeek:e=>[$(0,"isoWeek",null==e?void 0:e.timezone),O(0,"isoWeek",null==e?void 0:e.timezone)],lastWeek:e=>[$(-1,"isoWeek",null==e?void 0:e.timezone),O(-1,"isoWeek",null==e?void 0:e.timezone)],nextWeek:e=>[$(1,"isoWeek",null==e?void 0:e.timezone),O(1,"isoWeek",null==e?void 0:e.timezone)],thisMonth:e=>[$(0,"month",null==e?void 0:e.timezone),O(0,"month",null==e?void 0:e.timezone)],lastMonth:e=>[$(-1,"month",null==e?void 0:e.timezone),O(-1,"month",null==e?void 0:e.timezone)],nextMonth:e=>[$(1,"month",null==e?void 0:e.timezone),O(1,"month",null==e?void 0:e.timezone)],thisQuarter:e=>[$(0,"quarter",null==e?void 0:e.timezone),O(0,"quarter",null==e?void 0:e.timezone)],lastQuarter:e=>[$(-1,"quarter",null==e?void 0:e.timezone),O(-1,"quarter",null==e?void 0:e.timezone)],nextQuarter:e=>[$(1,"quarter",null==e?void 0:e.timezone),O(1,"quarter",null==e?void 0:e.timezone)],thisYear:e=>[$(0,"year",null==e?void 0:e.timezone),O(0,"year",null==e?void 0:e.timezone)],lastYear:e=>[$(-1,"year",null==e?void 0:e.timezone),O(-1,"year",null==e?void 0:e.timezone)],nextYear:e=>[$(1,"year",null==e?void 0:e.timezone),O(1,"year",null==e?void 0:e.timezone)]},_=e=>{if("past"===e.type||"next"===e.type)return B(e);let t=q[e.type];if(!t)throw Error(`Unsupported type: ${e.type}`);let[l,n]=t(e);return[l.format("YYYY-MM-DD HH:mm:ss"),n.format("YYYY-MM-DD HH:mm:ss")]};var L=l(38362);class V{static graphlib(){return L}static connectedNodes(e){let t=(0,n.castArray)(e.nodes),l=(0,n.castArray)(e.excludes||[]),o=V.build(e),r=new Set;for(let e of t)for(let t of L.alg.preorder(o,e))l.includes(t)||r.add(t);return Array.from(r)}static preOrder(e){return V.graphlib().alg.preorder(V.build(e),e.node)}static build(e){let t=e.collections,l="forward"===((null==e?void 0:e.direction)||"forward"),n=new L.Graph;for(let e of t)n.setNode(e.name);for(let e of t){for(let t of e.inherits||[])l?n.setEdge(e.name,t):n.setEdge(t,e.name);for(let t of e.fields||[])if(("hasMany"===t.type||"belongsTo"===t.type||"hasOne"===t.type)&&(l?n.setEdge(e.name,t.target):n.setEdge(t.target,e.name)),"belongsToMany"===t.type){let o=t.through;l?(n.setEdge(e.name,o),n.setEdge(o,t.target)):(n.setEdge(t.target,o),n.setEdge(o,e.name))}}return n}}var z=l(81814),K=l.n(z);function U(e){return"path"in e&&"operator"in e}function W(e){return"logic"in e&&"items"in e}function H(e){let{path:t,operator:l,value:n}=e;return{[t]:{[l]:n}}}function G(e){let{logic:t,items:l}=e;return{[t]:l.map(e=>{if(U(e))return H(e);if(W(e))return G(e);throw Error("Invalid filter item type")})}}function Y(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return eu(G(e))}function J(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return e.items=e.items.filter(e=>U(e)?!!e.operator:!!W(e)&&J(e)),{...e}}function X(e,t){let{path:l,operator:n,value:o}=e;return t(l,n,o)}function Q(e,t){let{logic:l,items:n}=e;if(!n||0===n.length)return!0;let o=n.map(e=>{if(U(e))return X(e,t);if(W(e))return Q(e,t);throw Error("Invalid filter item type")});if("$and"===l)return o.every(e=>!0===e);if("$or"===l)return o.some(e=>!0===e);throw Error(`Unsupported logic operator: ${l}`)}function Z(e,t){if(!e||"object"!=typeof e)throw Error("Invalid conditions: conditions must be an object");if(!W(e))throw Error("Invalid conditions: conditions must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid conditions: items must be an array");if("function"!=typeof t)throw Error("Invalid evaluator: evaluator must be a function");return Q(e,t)}let ee=e=>"string"==typeof e,et=e=>Array.isArray(e),el=e=>en(e)?0===Object.keys(e).length:!!Array.isArray(e)&&0===e.length,en=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},eo=e=>{let t=!0;for(let l in e){if(t=!1,et(e[l])&&0===e[l].length||!e[l])return!0;if(en(e[l])||et(e[l]))return eo(e[l])}return t},er=e=>{setTimeout(e)};function ei(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return;let{childrenKey:n="children"}=l;for(let o of Array.isArray(e)?[...e]:[e]){if(t(o))return o;let e="function"==typeof n?n(o):o[n];if(Array.isArray(e)&&e.length>0){let n=ei(e,t,l);if(void 0!==n)return n}}}function ea(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children",n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return e&&Array.isArray(e)&&0!==e.length?o().orderBy(e,t,n?"asc":"desc").map(e=>e[l]&&e[l].length>0?{...e,[l]:ea(e[l],t,l,n)}:e):e}function es(e){return new Promise(t=>{setTimeout(t,e)})}function ed(e){return!!(!e||"$and"in e&&o().isEmpty(e.$and)||"$or"in e&&o().isEmpty(e.$or))}let eu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K(),l=t(e||{}),n={};for(let e in l){let t=l[e];null==t||el(t)||""===t||(n[e]=t)}let r=t.unflatten(n);for(let e in r)Array.isArray(r[e])&&(r[e]=r[e].filter(e=>null!=e));return o().isEmpty(r)?void 0:r},ec=e=>e.format?e.format:e.dateFormat?e.showTime?`${e.dateFormat} ${e.timeFormat||"HH:mm:ss"}`:e.dateFormat:"month"===e.picker?"YYYY-MM":"quarter"===e.picker?"YYYY-\\QQ":"year"===e.picker?"YYYY":"week"===e.picker?"YYYY[W]W":e.showTime?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD",ep=e=>e&&i().isDayjs(e)?`${e.format("YYYY-MM-DD")}T${e.format("HH:mm:ss.SSS")}Z`:e,em=e=>e?Array.isArray(e)?e.map(e=>e.startOf("second").toISOString()):i().isDayjs(e)?e.startOf("second").toISOString():void 0:e,eh=e=>{try{let t=parseInt(e.slice(0,4)),l=parseInt(e.slice(-1));return i()().quarter(l).year(t)}catch(e){return null}},ef=(e,t)=>{if(!e)return;let l=t.utcOffset,{gmt:n,picker:o,utc:r=!0,dateOnly:a}=t;if(!i()(e).isValid())return eh(e);if(a){let t=i()(e);if(!t.isValid())return e;let l=t.format("YYYY-MM-DD");return i().utc(l,"YYYY-MM-DD")}return r?i().isDayjs(e)?l?e.utcOffset(eb(l)):e:n?i()(e).utcOffset(0):l?i()(e).utcOffset(eb(l)):i()(e):i()(e)},eg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?e.map(e=>ef(e,t)):e?ef(e,t):e},ev=(e,t)=>"year"===t?e.format("YYYY")+"-01-01T00:00:00.000Z":"month"===t||"quarter"===t?e.format("YYYY-MM")+"-01T00:00:00.000Z":e.format("YYYY-MM-DD")+"T00:00:00.000Z",ey=(e,t)=>e?Array.isArray(e)?e.map(e=>ev(e,t)):i().isDayjs(e)?ev(e,t):void 0:e,ex=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{showTime:l,gmt:n,picker:o}=t;return e?l?n?ep(e):em(e):ey(e,o):e};function eb(e){if(!o().isString(e))return e;let t=/([+-]|\d\d)/gi,l=/Z|[+-]\d\d(?::?\d\d)?/gi,n=/[+-]?\d+(\.\d{1,3})?/,r=(e||"").match(l);if(null===r&&(r=(e||"").match(n)),null===r)return null;let i=((r[r.length-1]||[])+"").match(t)||["-",0,0],a=+(60*Number(i[1]))+ew(i[2]);return 0===a?0:"+"===i[0]?a:-a}function ew(e){let t=+e,l=0;return 0!==t&&isFinite(t)&&(l=eS(t)),l}function eS(e){return e<0?Math.ceil(e)||0:Math.floor(e)}let eC=e=>{switch(e){case"week":return"YYYY[W]W";case"month":return"YYYY-MM";case"quarter":return"YYYY[Q]Q";case"year":return"YYYY";default:return"YYYY-MM-DD"}},eF=(e,t,l,n)=>"date"===e&&l?`${t} ${n||"HH:mm:ss"}`:t;function ek(e){return/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?"YYYY-MM-DD HH:mm:ss":/^\d{4}-\d{2}-\d{2}$/.test(e)?"YYYY-MM-DD":/^\d{4}-\d{2}$/.test(e)?"YYYY-MM":/^\d{4}$/.test(e)?"YYYY":/^\d{4}Q[1-4]$/.test(e)?"YYYY[Q]Q":/^\d{4}-\d{2}-\d{2}T/.test(e)?"YYYY-MM-DDTHH:mm:ss.SSSZ":null}let eA=(e,t)=>{Array.isArray(e)?e.forEach(t):Object.keys(e).forEach(l=>{t(e[l],l)})},eP=(e,t,l)=>{if(!e)return l;let n=t.split("."),o=[],r=e,i=!1;for(let e=0;e<n.length;e++){let t=n[e];if(Array.isArray(r)){for(let t of(i=!0,r)){let r=eP(t,n.slice(e).join("."),l);o=o.concat(r)}break}if((null==r?void 0:r[t])===void 0)break;r=r[t],e===n.length-1&&o.push(r)}return 0===(o=o.filter(e=>void 0!==e)).length?l:i?o.filter(e=>null!==e):o[0]};var ej=l(88835),eM=l(60639),eI=l.n(eM),eT=l(79441);let eR=l.n(eT)()();function eE(e){if(!e)return!1;let t=[e.$and,e.$or].filter(Boolean);return 0==t.length?Object.keys(e).length>0:t.some(e=>{if(Array.isArray(e))return e.some(eE);if(e.$and||e.$or)return eE(e);let[t]=Object.keys(e);if(!t||!e[t])return!1;let[l]=Object.keys(e[t]);return!!l&&void 0!==e[t][l]})}function eN(e){let t=typeof e;return Array.isArray(e)?t="array":e instanceof Date?t="date":null===e&&(t="null"),t}function eD(e){let t=e.substr(2,e.length-4).trim(),l=t.indexOf(":");return -1!==l?{key:t.substr(0,l),defaultValue:t.substr(l+1)}:{key:t}}function eB(e,t){return e.parameters=Array.from(new Map(t.map(e=>[e.key,e])).values()),e}function e$(e){switch(eN(e)){case"string":return eO(e);case"object":return eq(e);case"array":return e_(e);default:return eB(function(){return e},[])}}Object.keys(eR).forEach(function(e){eI().registerHelper(e,eR[e])}),eI().registerHelper("json",function(e){return JSON.stringify(e)}),eI().registerHelper("urlParse",function(e){try{return JSON.stringify(ej.parse(e))}catch(t){return`Invalid URL: ${e}`}}),eI().registerHelper("dateFormat",(e,t,l)=>"string"==typeof l?i()(e).tz(l).format(t):i()(e).format(t)),eI().registerHelper("isNull",e=>o().isNull(e));let eO=(()=>{let e=/{{(\w|:|[\s-+.,@/()?=*_$])+}}/g;return t=>{let l=[],o=e=>t,r=t.match(e);return r&&(l=r.map(eD),o=e=>(e=e||{},r.reduce((o,i,a)=>{let s=l[a],d=(0,n.get)(e,s.key);return(void 0===d&&(d=s.defaultValue),"function"==typeof d&&(d=d()),1===r.length&&t.startsWith("{{")&&t.endsWith("}}"))?d:(d instanceof Date&&(d=d.toISOString()),o.replace(i,null==d?"":d))},t))),eB(o,l)}})();function eq(e){let t=Object.keys(e).map(t=>({keyTemplate:eO(t),valueTemplate:e$(e[t])}));return eB(e=>t.reduce((t,l)=>(t[l.keyTemplate(e)]=l.valueTemplate(e),t),{}),t.reduce((e,t)=>e.concat(t.valueTemplate.parameters,t.keyTemplate.parameters),[]))}function e_(e){let t=e.map(e$);return eB(e=>t.map(t=>t(e)),t.reduce((e,t)=>e.concat(t.parameters),[]))}let eL=function(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];console.error(e,...l)};var eV=l(14744),ez=l.n(eV);let eK=(e,t,l)=>t;function eU(e,t,l){return ez()(e,t,{arrayMerge:eK,...l})}var eW=l(98892);let eH=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;eW.Ay[t]({message:e,duration:l})};var eG=l(5062),eY=l(85738);function eJ(e,t){if(null==e||""===e)return"";let l=(0,eG.i5)(t);return(0,eY.Mg)(String(e),".",l)}var eX=l(63560),eQ=l.n(eX),eZ=l(95093),e0=l.n(eZ);let e1=/^\s*\{\{([\s\S]*)\}\}\s*$/;function e2(e){return e&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function e8(e){return e}function e5(e,t){let l=(t=t||{}).delimiter||".",n=t.maxDepth,r=t.transformKey||e8,i=t.transformValue||e8,a={};function s(e,d,u){u=u||1,o().isObjectLike(e)&&Object.keys(e).forEach(function(o){var c;let p=e[o],m=t.safe&&Array.isArray(p),h=Object.prototype.toString.call(p),f=e2(p),g="[object Object]"===h||"[object Array]"===h,v=d?d+l+r(o):r(o);if(null==(c=t.breakOn)?void 0:c.call(t,{key:o,value:p,path:v})){a[v]=i(p,v);return}if(!m&&!f&&g&&Object.keys(p).length&&(!t.maxDepth||u<n))return s(p,v,u+1);a[v]=i(p,v)})}return s(e),a}function e4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l={},n=t.transformValue||e8;for(let t of Object.keys(e))eQ()(l,t,n(e[t],t));return l}let e3=e=>{let t=e.split(".").pop()||"";return t.startsWith("$")||(t=""),{operator:t}},e6=e=>["$dateOn","$dateNotOn","$dateBefore","$dateAfter","$dateNotBefore","$dateNotAfter","$dateBetween"].includes(e);function e9(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function e7(e){return(null==e?void 0:e.type)==="dateOnly"||(null==e?void 0:e.type)==="datetimeNoTz"||(null==e?void 0:e.constructor.name)==="DateOnlyField"||(null==e?void 0:e.constructor.name)==="DatetimeNoTzField"}let te=(e,t)=>e?(e.type&&(e=_({...e,timezone:t})),Array.isArray(e))?(2===e.length?e.push("[]",t):3===e.length&&e.push(t),e):"string"==typeof e?!t||/(\+|-)\d\d:\d\d$/.test(e)?e:e+t:e9(e)?e.toISOString():void 0:null,tt=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=new Set,n=t.vars||{},o=t.timezone,r=t.now,i=t.getField,a=e5(e,{breakOn(e){let{key:t}=e;return t.startsWith("$")&&"$and"!==t&&"$or"!==t},transformValue(e){if("string"!=typeof e)return e;let t=e1.exec(e);if(t){let e=t[1].trim();e.startsWith("$user")&&l.add(e.substring(6))}return e}});if(l.size>0){let e=await n.$user({fields:[...l.values()]});Object.assign(n,{$user:e})}return e4(a,{transformValue(e,t){let{operator:l}=e3(t);if("string"==typeof e){let a=e1.exec(e);if(a){let s=eP(n,a[1].trim(),null),d=null==i?void 0:i(t);e="function"==typeof s?null==s?void 0:s({field:d,operator:l,timezone:o,now:r}):s}}if(e6(l)){let l=null==i?void 0:i(t);return e7(l)?e.type?_({...e,timezone:(null==l?void 0:l.timezone)||o}):e:te(e,(null==l?void 0:l.timezone)||o)}return e}})};function tl(e){let{now:t,timezone:l="+00:00",offset:n}=e,o=tn(t).utcOffset(eb(l));return n>0?[(o=o.add(1,"day").startOf("day")).format("YYYY-MM-DD"),o.clone().add(n,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]:[o.clone().subtract(-1*n-1,"day").startOf("day").format("YYYY-MM-DD"),o.clone().add(1,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]}function tn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?i().isDayjs(e)?e:t?e0()(e):i()(e):t?e0()():i()()}function to(e){var t;let{now:l,unit:n,timezone:o="+00:00",offset:r}=e,i=tn(l,"isoWeek"===n);i=(i=i.utcOffset(eb(o))).startOf(n),r>0?i=i.add(r,n):r<0&&(i=i.subtract(-1*r,n));let a={year:()=>i.format("YYYY"),quarter:()=>i.format("YYYY[Q]Q"),month:()=>i.format("YYYY-MM"),week:()=>i.format("gggg[w]ww"),isoWeek:()=>i.format("GGGG[W]WW"),day:()=>i.format("YYYY-MM-DD")},s=null==(t=a[n])?void 0:t.call(a);return o?s+o:s}let tr=(e,t)=>l=>{let{now:n,timezone:o,field:r}=l;return(null==r?void 0:r.timezone)&&(o=null==r?void 0:r.timezone),to({now:n,timezone:o,unit:e,offset:t})},ti=e=>t=>{let{now:l,timezone:n,field:o}=t;return(null==o?void 0:o.timezone)&&(n=null==o?void 0:o.timezone),tl({now:l,timezone:n,offset:e})};function ta(){return{now:new Date().toISOString(),today:tr("day"),yesterday:tr("day",-1),tomorrow:tr("day",1),thisWeek:tr("week"),lastWeek:tr("week",-1),nextWeek:tr("week",1),thisIsoWeek:tr("isoWeek"),lastIsoWeek:tr("isoWeek",-1),nextIsoWeek:tr("isoWeek",1),thisMonth:tr("month"),lastMonth:tr("month",-1),nextMonth:tr("month",1),thisQuarter:tr("quarter"),lastQuarter:tr("quarter",-1),nextQuarter:tr("quarter",1),thisYear:tr("year"),lastYear:tr("year",-1),nextYear:tr("year",1),last7Days:ti(-7),next7Days:ti(7),last30Days:ti(-30),next30Days:ti(30),last90Days:ti(-90),next90Days:ti(90)}}function ts(e){let t=e.split(".");return[t.shift(),t.join(".")]}class td{register(e,t){if(!this.options.override&&this.map.has(e))throw Error(`this registry does not allow to override existing keys: "${e}"`);this.map.set(e,t)}get(e){return this.map.get(e)}getKeys(){return this.map.keys()}getValues(){return this.map.values()}getEntities(){return this.map.entries()}constructor(e={override:!1}){this.map=new Map,this.options=e}}l(67980);let tu=Symbol.for("nocobase.utils.sesLockdown"),tc=Symbol.for("nocobase.utils.bufferOverrides"),tp=["globalThis","global","self","Function","AsyncFunction","GeneratorFunction","eval","Compartment","lockdown","harden","assert"];function tm(e){return!!e&&"object"==typeof e&&(e.message||"").includes("(SES_ALREADY_LOCKED_DOWN)")}function th(){let e=globalThis;if(e[tc])return;let t=e.Buffer;if(!t||!t.prototype)return;let l=t.prototype;for(let e of Reflect.ownKeys(l)){let t=Object.getOwnPropertyDescriptor(l,e);if(!t||"function"!=typeof t.value||!t.configurable)continue;let n=t.value,o=function(){return n},r=function(t){if(this===l)throw TypeError(`Cannot assign to read only property '${String(e)}' of object 'Buffer.prototype'`);Object.defineProperty(this,e,{configurable:!0,enumerable:!0,writable:!0,value:t})};Object.defineProperty(o,"originalValue",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(l,e,{configurable:t.configurable,enumerable:t.enumerable,get:o,set:r})}e[tc]=!0}function tf(e){th();let t=globalThis;if(!t[tu]){if("function"!=typeof lockdown)throw Error("SES lockdown is unavailable in the current runtime environment.");try{lockdown(e)}catch(e){if(!tm(e))throw e}t[tu]=!0}}function tg(e,t){return t?`{{t(${JSON.stringify(e)}, ${JSON.stringify(t)})}}`:`{{t(${JSON.stringify(e)})}}`}var tv=l(65606);let ty=e=>{for(;e;){var t;if("root"===e.id||(null==(t=e.classList)?void 0:t.contains("nb-action")))return!1;e=e.parentNode}return!tv.env.__TEST__};function tx(e,t){return e.replace(/\{\{(\w+)\}\}/g,function(e,l){return void 0!==t[l]?t[l]:e})}let tb=36,tw="";for(;tb--;)tw+=tb.toString(36);function tS(e){let t="",l=e||11;for(;l--;)t+=tw[36*Math.random()|0];return t}function tC(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}var tF=l(27153),tk="2.1.17";let tA=(e,t)=>{if(!e)return e;if("Grid"!==e["x-component"])return Object.keys(e.properties||{}).forEach(l=>{e.properties[l]=tA(e.properties[l],t)}),e;let l=e.parent;e=e.toJSON?e.toJSON():o().cloneDeep(e);let n={},{properties:r={}}=e,i=0;if(Object.keys(r).forEach((e,l)=>{let a=r[e];if("Grid.Row"!==a["x-component"]){a["x-index"]=++i,n[e]=a;return}if(a.properties){if(1===Object.keys(a.properties).length){a["x-index"]=++i,n[e]=a;return}Object.keys(a.properties).forEach((l,r)=>{let s=a.properties[l];if(o().set(s,"x-component-props.width",100),0===r){a["x-index"]=++i,n[e]=a;return}null!=t&&t(s)||(delete a.properties[l],n[`${tS()}_${l}`]=tP(s,l,++i))})}}),e.properties=n,l){let t=new tF.Schema(e,l);return l.properties&&Object.keys(l.properties).forEach(n=>{n===e.name&&(l.properties[n]=t)}),t}return e};function tP(e,t,l){return{type:"void",version:"2.0","x-component":"Grid.Row","x-app-version":tk,"x-uid":tS(),"x-async":!1,"x-index":l,_isJSONSchemaObject:!0,properties:{[t]:e}}}function tj(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=r.exec(o));)t.add(e[1]);let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=i.exec(o));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function tM(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=r.exec(o));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],o=e[3]||"";t[l].push(`${n}${o}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],o=e[2]||"";t[l].push(`[${n}]${o}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=i.exec(o));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],o=n[3]||"";t[e].push(`${l}${o}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],o=n[2]||"";t[e].push(`[${l}]${o}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}let tI=new(l(23155)).HX;function tT(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};for(let l of e){let e=l.replace(/^ctx\./,"").split("."),n=t;for(let t=0;t<e.length;t++){let o=e[t];t===e.length-1?n[o]=`{{${l}}}`:(n[o]=n[o]||{},n=n[o])}}return t}async function tR(e){return tT(await tI.fullVariables(e))}async function tE(e,t){return await tI.parseAndRender(e,{ctx:t})}function tN(e){let t=1,l={};return{sql:e.replace(/{{\s*([^}]+)\s*}}/g,(e,n)=>{let o=`__var${t}`;return l[o]=`{{${n.trim()}}}`,t++,`$${o}`}),bind:l}}async function tD(e){let{sql:t,bind:l}=tN(e),n=await tR(t);return{sql:t,bind:l,liquidContext:n}}},59598(){},23005(){},14892(){},2813(){},61511(){},92489(){},52453(){},72522(){},66883(){},9845(){}},function(e){var t=function(t){return e(e.s=t)};e.O(0,["1339","2174","268","3210","3338","3658","3782","404","8159","8732","8878","9200","9223","957","9817","9967"],function(){return t(81515)}),e.O()}]);