react-declarative
Version:
A React form builder which interacts with a JSON endpoint to generate nested 12-column grids with input fields and automatic state management in a declarative style. Endpoint is typed by TypeScript guards (IntelliSense available). This tool is based on ma
1 lines • 807 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/styles"),n=require("tss-react"),r=require("@mui/material/Box"),o=require("@mui/material/CircularProgress"),a=require("@mui/material/ListItemIcon"),i=require("@mui/material/Typography"),l=require("@mui/material/MenuItem"),c=require("@mui/material/Divider"),u=require("@mui/material/Menu"),s=require("react-dom"),d=require("uuid"),f=require("@mui/material/Grid"),m=require("@mui/material"),p=require("@mui/material/Checkbox"),h=require("@mui/material/FormControlLabel"),v=require("@mui/material/FormGroup"),b=require("@mui/material/Button"),g=require("@mui/material/Stack"),y=require("@mui/material/Autocomplete"),E=require("@mui/material/TextField"),x=require("@mui/material/Radio"),w=require("@mui/material/Paper"),C=require("@mui/material/Modal"),k=require("@mui/material/InputAdornment"),S=require("@mui/material/IconButton"),L=require("@mui/material/List"),M=require("@mui/material/ListItemButton"),R=require("@mui/icons-material/ArrowDropUp"),N=require("@mui/icons-material/ArrowDropDown"),I=require("@mui/icons-material/MoreVert"),T=require("@mui/material/Fab"),P=require("@mui/material/LinearProgress"),A=require("@mui/material/Backdrop"),D=require("@mui/material/ListItemText"),j=require("@mui/icons-material/Close"),O=require("@mui/icons-material/RadioButtonChecked"),F=require("@mui/icons-material/RadioButtonUnchecked"),_=require("@mui/material/Chip"),B=require("@mui/icons-material/CheckBox"),H=require("@mui/icons-material/CheckBoxOutlineBlank"),W=require("@mui/material/RadioGroup"),z=require("@mui/material/Rating"),V=require("dayjs"),q=require("@mui/material/Popover"),Y=require("@mui/material/Toolbar"),U=require("@mui/icons-material/KeyboardArrowLeft"),$=require("@mui/icons-material/KeyboardArrowRight"),G=require("@mui/icons-material/CalendarTodayOutlined"),X=require("@mui/icons-material/ArrowForward"),K=require("@mui/icons-material/AlarmOutlined"),Q=require("@mui/material/Switch"),J=require("@mui/material/Slider"),Z=require("@mui/material/ListItem"),ee=require("@mui/icons-material/Clear"),te=require("@mui/material/ListSubheader"),ne=require("@mui/icons-material/Search"),re=require("@mui/icons-material/ExpandMore"),oe=require("@mui/material/Tab"),ae=require("@mui/material/Tabs"),ie=require("history"),le=require("@mui/material/Dialog"),ce=require("@mui/material/DialogContent"),ue=require("@mui/material/DialogActions"),se=require("@mui/material/DialogTitle"),de=require("@mui/material/Badge"),fe=require("@mui/icons-material/Fullscreen"),me=require("@mui/material/Table"),pe=require("@mui/material/TableBody"),he=require("@mui/material/TableHead"),ve=require("@mui/material/TableContainer"),be=require("@mui/material/TableRow"),ge=require("@mui/material/TableCell"),ye=require("@mui/material/TablePagination"),Ee=require("@mui/material/PaginationItem"),xe=require("@mui/material/Pagination"),we=require("@mui/icons-material/ArrowUpward"),Ce=require("@mui/icons-material/ArrowDownward"),ke=require("@mui/material/Tooltip"),Se=require("@mui/material/TableSortLabel"),Le=require("@mui/icons-material/Add"),Me=require("@mui/icons-material/CleaningServicesOutlined"),Re=require("@mui/icons-material/Refresh"),Ne=require("@mui/icons-material/Sort"),Ie=require("@mui/icons-material/Settings"),Te=require("@mui/material/Collapse"),Pe=require("@mui/icons-material/ExpandLess"),Ae=require("@mui/icons-material/NotInterested"),De=require("@mui/icons-material/FilterList"),je=require("path-to-regexp"),Oe=require("@mui/material/colors"),Fe=require("@mui/material/AppBar"),_e=require("@mui/material/CssBaseline"),Be=require("@mui/material/Drawer"),He=require("@mui/icons-material/Menu"),We=require("@mui/material/ButtonBase"),ze=require("@mui/icons-material/OutlinedFlag"),Ve=require("@mui/material/SwipeableDrawer"),qe=require("@mui/material/InputBase"),Ye=require("@mui/material/Breadcrumbs"),Ue=require("@mui/material/Link"),$e=require("@mui/material/ButtonGroup"),Ge=require("@mui/icons-material/Palette"),Xe=require("@mui/icons-material/Remove"),Ke=require("@mui/material/Snackbar"),Qe=require("@mui/icons-material/KeyboardArrowUp"),Je=require("@mui/material/Box/Box"),Ze=require("@mui/material/Alert"),et=require("@mui/icons-material/CloudUpload"),tt=require("@mui/icons-material/Delete"),nt=require("@mui/material/Step"),rt=require("@mui/material/StepLabel"),ot=require("@mui/material/Stepper"),at=require("xlsx"),it=require("dayjs/plugin/isToday"),lt=require("dayjs/plugin/localeData"),ct=require("dayjs/locale/en-gb"),ut=require("dayjs/plugin/utc"),st=require("@mui/icons-material/ArrowBackIos"),dt=require("@mui/icons-material/ArrowForwardIos"),ft=require("@mui/icons-material/Send"),mt=require("@mui/icons-material/Stop"),pt=require("@mui/icons-material/KeyboardVoice"),ht=require("@mui/icons-material/AttachFile"),vt=require("@mui/icons-material/Folder"),bt=require("@mui/icons-material/ContentCopy"),gt=require("@mui/icons-material/AccessTime"),yt=require("file-type/core"),Et=require("@mui/material/Avatar"),xt=require("@mui/material/ListItemAvatar"),wt=require("@mui/icons-material/CloudSync");function Ct(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function kt(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var St=kt(e),Lt=Ct(e),Mt=Ct(r),Rt=Ct(o),Nt=Ct(a),It=Ct(i),Tt=Ct(l),Pt=Ct(c),At=Ct(u),Dt=kt(s),jt=Ct(f),Ot=Ct(p),Ft=Ct(h),_t=Ct(v),Bt=Ct(b),Ht=Ct(g),Wt=Ct(y),zt=Ct(E),Vt=Ct(x),qt=Ct(w),Yt=Ct(C),Ut=Ct(k),$t=Ct(S),Gt=Ct(L),Xt=Ct(M),Kt=Ct(R),Qt=Ct(N),Jt=Ct(I),Zt=Ct(T),en=Ct(P),tn=Ct(A),nn=Ct(D),rn=Ct(j),on=Ct(O),an=Ct(F),ln=Ct(_),cn=Ct(B),un=Ct(H),sn=Ct(W),dn=Ct(z),fn=Ct(V),mn=Ct(q),pn=Ct(Y),hn=Ct(U),vn=Ct($),bn=Ct(G),gn=Ct(X),yn=Ct(K),En=Ct(Q),xn=Ct(J),wn=Ct(Z),Cn=Ct(ee),kn=Ct(te),Sn=Ct(ne),Ln=Ct(re),Mn=Ct(oe),Rn=Ct(ae),Nn=Ct(le),In=Ct(ce),Tn=Ct(ue),Pn=Ct(se),An=Ct(de),Dn=Ct(fe),jn=Ct(me),On=Ct(pe),Fn=Ct(he),_n=Ct(ve),Bn=Ct(be),Hn=Ct(ge),Wn=Ct(ye),zn=Ct(Ee),Vn=Ct(xe),qn=Ct(we),Yn=Ct(Ce),Un=Ct(ke),$n=Ct(Se),Gn=Ct(Le),Xn=Ct(Me),Kn=Ct(Re),Qn=Ct(Ne),Jn=Ct(Ie),Zn=Ct(Te),er=Ct(Pe),tr=Ct(Ae),nr=Ct(De),rr=Ct(Fe),or=Ct(_e),ar=Ct(Be),ir=Ct(He),lr=Ct(We),cr=Ct(ze),ur=Ct(Ve),sr=Ct(qe),dr=Ct(Ye),fr=Ct(Ue),mr=Ct($e),pr=Ct(Ge),hr=Ct(Xe),vr=Ct(Ke),br=Ct(Qe),gr=Ct(Je),yr=Ct(Ze),Er=Ct(et),xr=Ct(tt),wr=Ct(nt),Cr=Ct(rt),kr=Ct(ot),Sr=kt(at),Lr=Ct(it),Mr=Ct(lt),Rr=Ct(ct),Nr=Ct(ut),Ir=Ct(st),Tr=Ct(dt),Pr=Ct(ft),Ar=Ct(mt),Dr=Ct(pt),jr=Ct(ht),Or=Ct(vt),Fr=Ct(bt),_r=Ct(gt),Br=Ct(Et),Hr=Ct(xt),Wr=Ct(wt),zr=function(e,t){return zr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},zr(e,t)};function Vr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}zr(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var qr=function(){return qr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qr.apply(this,arguments)};function Yr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function Ur(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function l(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}c((r=r.apply(e,t||[])).next())}))}function $r(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Gr(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xr(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function Kr(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Qr(e){return this instanceof Qr?(this.v=e,this):new Qr(e)}function Jr(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),a=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=o[e](t)).value instanceof Qr?Promise.resolve(n.value.v).then(c,u):s(a[0][2],n)}catch(e){s(a[0][3],e)}var n}function c(e){l("next",e)}function u(e){l("throw",e)}function s(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}function Zr(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Gr(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function eo(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}globalThis.window||(globalThis.window=globalThis);var to=e.createContext(null),no=function(t){var n=t.children,r=t.apiRef,o=void 0===r?null:r,a=t.reloadSubject,i=void 0===a?null:a,l=t.changeSubject,c=void 0===l?null:l,u=t.updateSubject,s=void 0===u?null:u,d=e.useMemo((function(){return{apiRef:o,reloadSubject:i,changeSubject:c,updateSubject:s}}),[o,i,c,s]);return St.createElement(to.Provider,{value:d},n)},ro=n.createMakeAndWithStyles({useTheme:t.useTheme}).makeStyles,oo=function(n){var r=n.children,o=t.useTheme(),a=e.useMemo((function(){return t.createTheme(o)}),[o]);return St.createElement(t.ThemeProvider,{theme:a},r)};exports.FieldType=void 0,function(e){e.Layout="custom-layout",e.Switch="switch-field",e.YesNo="yesno-field",e.Line="line-field",e.File="file-field",e.Group="group-layout",e.Paper="paper-layout",e.Outline="outline-layout",e.Expansion="expansion-layout",e.Radio="radio-field",e.Checkbox="checkbox-field",e.Text="text-field",e.Date="date-field",e.Time="time-field",e.Progress="progress-field",e.Component="component-field",e.Slider="slider-field",e.Combo="combo-field",e.Choose="choose-field",e.Tree="tree-field",e.Dict="dict-field",e.Init="init-field",e.Phony="phony-field",e.Button="button-field",e.Icon="icon-field",e.Complete="complete-field",e.Items="items-field",e.Rating="rating-field",e.Typography="typography-field",e.Fragment="fragment-layout",e.Div="div-layout",e.Box="box-layout",e.Tabs="tabs-layout",e.Hero="hero-layout",e.Center="center-layout",e.Stretch="stretch-layout",e.Condition="condition-layout"}(exports.FieldType||(exports.FieldType={})),Object.entries(exports.FieldType).forEach((function(e){var t=Xr(e,2),n=t[0],r=t[1];exports.FieldType[n]=Symbol.for(r)}));var ao=exports.FieldType,io=new Set([ao.Group,ao.Box,ao.Paper,ao.Outline,ao.Expansion,ao.Div,ao.Tabs,ao.Hero,ao.Fragment,ao.Center,ao.Stretch,ao.Condition,ao.Layout]),lo=function(e){return io.has(e)},co=function(e){var t=e.type;return e.name&&!io.has(t)},uo=function(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype},so=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(Array.isArray(e[n])?t[n]=e[n].slice(0):uo(e[n])?t[n]=so(e[n]):t[n]=e[n]);return t},fo=function(e,t,n){var r=(Array.isArray(t)?t:t.split(".").filter((function(e){return e}))).flatMap((function(e){return"string"==typeof e?e.split("."):e})),o=r.slice(0,r.length-1).reduce((function(e,t){return e&&e[t]}),e),a=Xr(r.reverse(),1)[0];try{return o[a]=n,!0}catch(e){return!1}},mo=function(e,t){return(Array.isArray(t)?t:t.split(".").filter((function(e){return e}))).flatMap((function(e){return"string"==typeof e?e.split("."):e})).reduce((function(e,t){return e&&e[t]}),e)},po=function(e,t){if(e===t)return!0;if(uo(e)&&uo(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!po(e[n],t[n]))return!1;return!0}return!1};var ho,vo=function(){function e(){var e=this;this._events={},this.getListeners=function(t){return e._events[t]||[]},this.subscribe=function(t,n){!e._events[t]&&(e._events[t]=[]),e._events[t].push(n)},this.unsubscribe=function(t,n){!e._events[t]&&(e._events[t]=[]),e._events[t]=e._events[t].filter((function(e){return n!==e}))},this.unsubscribeAll=function(){e._events={}},this.once=function(t,n){var r=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return Ur(e,void 0,void 0,(function(){return $r(this,(function(e){switch(e.label){case 0:return[4,n.apply(void 0,Kr([],Xr(o),!1))];case 1:return e.sent(),this.unsubscribe(t,r),[2]}}))}))};return e.subscribe(t,r),function(){e.unsubscribe(t,r)}},this.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Ur(e,void 0,void 0,(function(){var e,r;return $r(this,(function(o){switch(o.label){case 0:e=Kr([],Xr(this._events&&this._events[t]||[]),!1),r=0,o.label=1;case 1:return r===e.length?[3,4]:[4,e[r].apply(e,Kr([],Xr(n),!1))];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))}}return Object.defineProperty(e.prototype,"hasListeners",{get:function(){return e=this._events,!(0===Object.getOwnPropertySymbols(e).length&&0===Object.getOwnPropertyNames(e).length);var e},enumerable:!1,configurable:!0}),e}(),bo=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return e}:1===e.length?e[0]:e.reduce((function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(void 0,Kr([],Xr(n),!1)))}}))},go=function(e){return void 0===e&&(e=1e3),new Promise((function(t){return setTimeout((function(){return t()}),e)}))},yo=Symbol("cancelable-canceled"),Eo=function(e){var t,n=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new Promise((function(r,o){var a=!1;t&&t(),t=function(){a=!0,r(yo)};var i=e.apply(void 0,Kr([],Xr(n),!1));i.then((function(e){a||r(e)})),i.catch((function(e){a||o(e)}))}))};return n.cancel=function(){t&&t()},n},xo=function(e){var t=Promise.resolve(),n=void 0,r=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var i=!1,l=function(){i=!0};return n=n?bo(n,l):l,t=t.then((function(){return Ur(void 0,void 0,void 0,(function(){return $r(this,(function(t){switch(t.label){case 0:return i?[3,2]:[4,e.apply(void 0,Kr([],Xr(o),!1))];case 1:return[2,t.sent()];case 2:return[2,yo]}}))}))})).finally((function(){r.clear(),n=void 0})),t};return r.clear=function(){t=Promise.resolve(),n=void 0},r.cancel=function(){t=Promise.resolve(),n&&n(),n=void 0},r},wo=function(e){return requestAnimationFrame(e)},Co=function(e){return cancelAnimationFrame(e)},ko=function(e,t){var n;void 0===t&&(t=1e3);var r=null,o=t?setTimeout:wo,a=t?clearTimeout:Co,i=function(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];null!==n&&a(n);var c=function(){r=null,n=null,e.apply(void 0,Kr([],Xr(i),!1))};r=c,n=o(c,t)};return i.clear=function(){null!==n&&a(n),n=null,r=null},i.flush=function(){null!==n&&a(n),r&&r(),n=null,r=null},i.pending=function(){return!!r},i},So=Symbol("observer-subscribe"),Lo=Symbol("observer-connect"),Mo=Symbol("observer-disconnect"),Ro=Symbol("observer-connect-listen"),No=Symbol("observer-disconnect-listen"),Io=function(){function e(t){var n=this;this.dispose=t,this.broadcast=new vo,this._isShared=!1,this._subscribe=function(e,t){n.broadcast.subscribe(So,t),e[Ro]((function(){n.broadcast.emit(Lo)})),e[No]((function(){n.hasListeners||n.broadcast.emit(Mo)}))},this._unsubscribe=function(e){n.broadcast.unsubscribe(So,e)},this.tryDispose=function(){n.hasListeners||n._isShared||(n.dispose(),n.broadcast.emit(Mo))},this.map=function(t){var r,o=new e(bo((function(){return n.tryDispose()}),(function(){return r()}))),a=function(e){var n=t(e);o.emit(n)};return n._subscribe(o,a),r=function(){return n._unsubscribe(a)},o},this.flatMap=function(t){var r,o=new e(bo((function(){return n.tryDispose()}),(function(){return r()}))),a=function(e){var n=t(e);Array.isArray(n)?n.forEach((function(e){o.emit(e)})):o.emit(n)};return n._subscribe(o,a),r=function(){return n._unsubscribe(a)},o},this.operator=function(e){return e(n)},this.reduce=function(t,r){var o,a=r,i=new e(bo((function(){return n.tryDispose()}),(function(){return o()}))),l=function(e){var n=t(a,e);a=n,i.emit(n)};return n._subscribe(i,l),o=function(){return n._unsubscribe(l)},i},this.split=function(){var t,r=new e(bo((function(){return n.tryDispose()}),(function(){return t()}))),o=function(e){Array.isArray(e)?e.flat(Number.POSITIVE_INFINITY).forEach((function(e){r.emit(e)})):r.emit(e)};return n._subscribe(r,o),t=function(){return n._unsubscribe(o)},r},this.mapAsync=function(t,r){var o,a=new e(bo((function(){return n.tryDispose()}),(function(){return o()}))),i=xo(t),l=function(e){return Ur(n,void 0,void 0,(function(){var t,n;return $r(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,i(e)];case 1:return(t=o.sent())!==yo&&a.emit(t),[3,3];case 2:if(n=o.sent(),!r)throw n;return r(n),[3,3];case 3:return[2]}}))}))};return n._subscribe(a,l),o=bo((function(){return n._unsubscribe(l)}),(function(){return i.clear()})),a},this.filter=function(t){var r,o=new e(bo((function(){return n.tryDispose()}),(function(){return r()}))),a=function(e){t(e)&&o.emit(e)};return n._subscribe(o,a),r=function(){return n._unsubscribe(a)},o},this.tap=function(t){var r,o=new e(bo((function(){return n.tryDispose()}),(function(){return r()}))),a=function(e){t(e),o.emit(e)};return n._subscribe(o,a),r=function(){return n._unsubscribe(a)},o},this.debounce=function(t){var r,o=new e(bo((function(){return n.tryDispose()}),(function(){return r()}))),a=ko((function(e){o.emit(e)}),t);return n._subscribe(o,a),r=bo((function(){return a.clear()}),(function(){return n._unsubscribe(a)})),o},this.delay=function(t){var r,o=new e(bo((function(){return n.tryDispose()}),(function(){return r()}))),a=!1,i=xo((function(e){return Ur(n,void 0,void 0,(function(){return $r(this,(function(n){switch(n.label){case 0:return[4,go(t)];case 1:return n.sent(),a?[3,3]:[4,o.emit(e)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}));return n._subscribe(o,i),r=bo((function(){return i.clear()}),(function(){return n._unsubscribe(i)}),(function(){a=!0})),o},this.emit=function(e){return Ur(n,void 0,void 0,(function(){return $r(this,(function(t){switch(t.label){case 0:return[4,this.broadcast.emit(So,e)];case 1:return t.sent(),[2]}}))}))},this.connect=function(e){return n.broadcast.subscribe(So,e),n.broadcast.emit(Lo),bo((function(){return n.tryDispose()}),(function(){return n._unsubscribe(e)}))},this.once=function(e){var t;return t=n.connect((function(n){e(n),t()}))},this.share=function(){return n._isShared=!0,n},this.repeat=function(t){var r,o;void 0===t&&(t=1e3);var a=new e(bo((function(){return n.tryDispose()}),(function(){return r()}),(function(){return void 0!==o&&clearTimeout(o)}))),i=function(e){void 0!==o&&clearTimeout(o),a.emit(e),n.hasListeners&&(o=setTimeout(i,t,e))};return n._subscribe(a,i),r=function(){return n._unsubscribe(i)},a},this.merge=function(t){var r,o=new e(bo((function(){return n.tryDispose()}),(function(){return r()}))),a=function(e){o.emit(e)};n._subscribe(o,a);var i=function(){};return o[Ro]((function(){i=t.connect(a)||function(){}})),r=bo((function(){return n._unsubscribe(a)}),(function(){return i()})),o},this.unsubscribe=function(){n.broadcast.unsubscribeAll(),n.broadcast.emit(Mo),n.dispose()},this.toPromise=function(){return new Promise((function(e){n.once((function(t){return e(t)}))}))},this.toIteratorContext=function(){var e=n,t=!1;return{iterate:function(){return Jr(this,arguments,(function(){return $r(this,(function(n){switch(n.label){case 0:return t?[3,4]:[4,Qr(e.toPromise())];case 1:return[4,Qr(n.sent())];case 2:return[4,n.sent()];case 3:return n.sent(),[3,0];case 4:return[2]}}))}))},done:function(){t=!0}}}}return Object.defineProperty(e.prototype,"isShared",{get:function(){return this._isShared},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasListeners",{get:function(){return!!this.broadcast.getListeners(So).length},enumerable:!1,configurable:!0}),e.prototype[Ro]=function(e){this.broadcast.once(Lo,e)},e.prototype[No]=function(e){this.broadcast.once(Mo,e)},e}(),To=Symbol("react-declarative-subject"),Po=function(){function e(){var e=this;this._emitter=new vo,this.map=function(t){var n,r=new Io((function(){return n()}));return n=e.subscribe(r.emit),r.map(t)},this.flatMap=function(t){var n,r=new Io((function(){return n()}));return n=e.subscribe(r.emit),r.flatMap(t)},this.reduce=function(t,n){var r,o=new Io((function(){return r()}));return r=e.subscribe(o.emit),o.reduce(t,n)},this.mapAsync=function(t,n){var r,o=new Io((function(){return r()}));return r=e.subscribe(o.emit),o.mapAsync(t,n)},this.filter=function(t){var n,r=new Io((function(){return n()}));return n=e.subscribe(r.emit),r.filter(t)},this.tap=function(t){var n,r=new Io((function(){return n()}));return n=e.subscribe(r.emit),r.tap(t)},this.operator=function(t){var n,r=new Io((function(){return n()}));return n=e.subscribe(r.emit),r.operator(t)},this.split=function(){var t,n=new Io((function(){return t()}));return t=e.subscribe(n.emit),n.split()},this.debounce=function(t){var n,r=new Io((function(){return n()}));return n=e.subscribe(r.emit),r.debounce(t)},this.delay=function(t){var n,r=new Io((function(){return n()}));return n=e.subscribe(r.emit),r.delay(t)},this.repeat=function(t){var n,r=new Io((function(){return n()}));return n=e.subscribe(r.emit),r.repeat(t)},this.merge=function(t){var n,r=new Io((function(){return n()}));return n=e.subscribe(r.emit),r.merge(t)},this.subscribe=function(t){return e._emitter.subscribe(To,t),function(){e._emitter.unsubscribe(To,t)}},this.unsubscribeAll=function(){e._emitter.unsubscribeAll()},this.once=function(t){return e._emitter.once(To,t)},this.toPromise=function(){return e.toObserver().toPromise()},this.toIteratorContext=function(){return e.toObserver().toIteratorContext()},this.next=this.next.bind(this),this.toObserver=this.toObserver.bind(this),this.toIteratorContext=this.toIteratorContext.bind(this)}return e.prototype.next=function(e){return Ur(this,void 0,void 0,(function(){return $r(this,(function(t){switch(t.label){case 0:return[4,this._emitter.emit(To,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.toObserver=function(){var e,t=new Io((function(){return e()}));return e=this.subscribe(t.emit),t},e}(),Ao=function(e){var t,n=0,r=new Io((function(){void 0!==t&&clearTimeout(t)})),o=function(){r.emit(n),n++,t=setTimeout(o,e)};return r[Ro]((function(){o()})),r},Do=function(e,t){var n=!1,r=new Io((function(){n=!0}));return r[Ro]((function(){Ur(void 0,void 0,void 0,(function(){var o,a;return $r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e()];case 1:return o=i.sent(),n||r.emit(o),[3,3];case 2:if(a=i.sent(),!t)throw a;return t(a),[3,3];case 3:return[2]}}))}))})),r},jo=function(e){var t,n=new Io((function(){void 0!==t&&clearTimeout(t)})),r=function(){t=void 0,n.emit()};return n[Ro]((function(){setTimeout(r,e)})),n},Oo=function(e){var t=new Io((function(){}));return t[Ro]((function(){Array.isArray(e)?e.flat(Number.POSITIVE_INFINITY).forEach((function(e){t.emit(e)})):t.emit(e)})),t},Fo=function(e){var t=new Io((function(){document.removeEventListener(e,t.emit)}));if("document"in globalThis){t[Ro]((function(){document.addEventListener(e,t.emit)}))}return t},_o=function(e){return{tap:function(t){return e().tap(t)},debounce:function(t){return e().debounce(t)},delay:function(t){return e().delay(t)},repeat:function(t){return e().repeat(t)},filter:function(t){return e().filter(t)},map:function(t){return e().map(t)},flatMap:function(t){return e().flatMap(t)},operator:function(t){return e().operator(t)},reduce:function(t,n){return e().reduce(t,n)},mapAsync:function(t,n){return e().mapAsync(t,n)},merge:function(t){return e().merge(t)},split:function(){return e().split()},connect:function(t){return e().connect(t)},once:function(t){return e().once(t)},unsubscribe:function(){return e().unsubscribe()},share:function(){return e().share()},toPromise:function(){return e().toPromise()},toIteratorContext:function(){return e().toIteratorContext()}}},Bo=function(){function e(){}var t;return t=e,e.merge=function(e){var t=(new Po).toObserver();return e.forEach((function(e){e&&(t=t.merge(e))})),t},e.join=function(e,t){var n=void 0===t?{}:t,r=n.race,o=void 0!==r&&r,a=n.buffer,i=void 0===a?[]:a,l=function(){},c=new Io((function(){return l()}));e=e.filter((function(e){return!!e})),i=Kr([],Xr(new Array(e.length)),!1).map((function(e,t){return i[t]}));var u=[],s=function(){i.every((function(e){return void 0!==e}))&&(c.emit(Kr([],Xr(i),!1)),!o&&i.fill(void 0))};return c[Ro]((function(){e.forEach((function(e,t){if(e){var n=e.connect((function(e){i[t]=e,s()}));u.push((function(){return n()}))}})),l=bo.apply(void 0,Kr([],Xr(u),!1))})),c},e.unicast=function(e){return qr(qr({},_o(e)),{isUnicasted:!0})},e.multicast=function(e){var t;return qr(qr({},_o((function(){return t||(t=e())[No]((function(){t=void 0})),t}))),{getRef:function(){return t},isMulticasted:!0})},e.createHot=function(e){var t,n=new Io((function(){return t()}));return t=e(n.emit)||function(){},n},e.createCold=function(e){var t=function(){},n=new Io((function(){return t()}));return n[Ro]((function(){t=e(n.emit)||function(){}})),n},e.create=t.createCold,e.pipe=function(e,t){var n=function(){},r=new Io((function(){return n()}));return r[Ro]((function(){var o=new Po,a=e.connect(o.next),i=t(o,r.emit)||function(){};n=bo((function(){return i()}),(function(){return a()}))})),r},e.fromInterval=Ao,e.fromPromise=Do,e.fromDelay=jo,e.fromArray=Oo,e.fromEvent=Fo,e.fromValue=function(e){var t=new Io((function(){}));return t[Ro]((function(){"function"==typeof e?t.emit(e()):t.emit(e)})),t},e.fromSubject=function(e){var t,n=new Io((function(){return t()}));return t=e.subscribe(n.emit),n},e.fromBehaviorSubject=function(e){var t,n=new Io((function(){return t()}));return n[Ro]((function(){e.data&&n.emit(e.data)})),t=e.subscribe(n.emit),n},e}(),Ho=Bo.create((function(e){return document.addEventListener("mousemove",e),function(){return document.removeEventListener("mousemove",e)}})),Wo=Bo.create((function(e){return document.addEventListener("touchmove",e),function(){return document.removeEventListener("touchmove",e)}})),zo=Bo.create((function(e){return document.addEventListener("scroll",e),function(){return document.removeEventListener("scroll",e)}})),Vo=Bo.unicast((function(){var e=0;return Bo.merge([Ho,Wo,zo]).filter((function(){return 20===e||(e+=1,!1)})).tap((function(){e=0})).share()})),qo=function(e){return Vo.connect(e)},Yo=Bo.unicast((function(){return Bo.create((function(e){return Bo.fromEvent("keydown").connect((function(t){"Tab"===t.code&&e()}))})).share()})),Uo=Bo.unicast((function(){return Bo.create((function(e){return document.addEventListener("touchstart",e,{passive:!1}),document.addEventListener("mousedown",e),function(){document.removeEventListener("touchstart",e),document.removeEventListener("mousedown",e)}})).share()})),$o=function(t){var n=e.createContext(t||null);return[function(e){var t=e.children,r=e.payload;return Lt.default.createElement(n.Provider,{value:r},t)},function(){return e.useContext(n)}]},Go=Xr($o(),2),Xo=Go[0],Ko=Go[1],Qo=e.createContext(null),Jo={},Zo=function(e){var t=e.children,n=e.payload,r=void 0===n?Jo:n;return St.createElement(Qo.Provider,{value:r},t)},ea=function(){return e.useContext(Qo)},ta=((ho={})[ao.Checkbox]=!1,ho[ao.Radio]=null,ho[ao.Text]="",ho[ao.Switch]=!1,ho[ao.Progress]=1,ho[ao.Slider]=0,ho[ao.Combo]=null,ho[ao.Items]=null,ho[ao.Rating]=3,ho[ao.Typography]="",ho[ao.Date]="",ho[ao.Time]="",ho[ao.File]=null,ho[ao.Choose]=null,ho[ao.Component]=null,ho[ao.Complete]="",ho[ao.Init]=null,ho[ao.YesNo]=null,ho[ao.Dict]=null,ho[ao.Tree]=null,ho),na=function(e){var t=ta[e];return void 0===t?void console.warn("react-declarative One initialValue unknown type ".concat(String(e))):t},ra=function(e){void 0===e&&(e=[]);var t=[],n=function(e){return void 0===e&&(e=[]),null==e?void 0:e.forEach((function(e){var r=e.fields||[],o=e.child?[e.child]:[];n(Kr(Kr([],Xr(r),!1),Xr(o),!1)),t.push(e)}))};return n(e),t},oa=function(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(!r.length)return e;var a=r.shift();if(uo(e)&&uo(a))for(var i in a)Array.isArray(a[i])?e[i]=a[i].slice(0):uo(a[i])?(e[i]||Object.assign(e,((t={})[i]={},t)),oa(e[i],a[i])):Object.assign(e,((n={})[i]=a[i],n));return oa.apply(void 0,Kr([e],Xr(r),!1))},aa=function(e,t){var n=(Array.isArray(t)?t:t.split(".").filter((function(e){return e}))).flatMap((function(e){return"string"==typeof e?e.split("."):e}));n.slice(0,n.length-1).reduce((function(e,t){return e[t]=e[t]?e[t]:{}}),e)},ia=function(t){var n=Xr(e.useState(t),2),r=n[0],o=n[1],a=e.useRef(r),i=e.useCallback((function(e){var t;t="function"==typeof e?e(a.current):e,a.current=t,o(t)}),[]);return[a,i]},la=Symbol("empty-value"),ca=function(t){var n=e.useRef(la);return n.current===la&&(n.current=function(e){return"function"==typeof e?e():e}(t)),n.current},ua=function(t){var n=ca((function(){return new Po}));return e.useEffect((function(){var e=void 0;return t&&(e=t.subscribe(n.next)),e}),[t]),n},sa="one-resolve",da=function(e){return e},fa=function(e,t,n){var r={};return e&&ra(e).filter((function(e){return!n||!e.features||e.features.some((function(e){return n.includes(e)}))})).filter((function(e){return e.type!==ao.Phony})).filter((function(e){return e.type!==ao.Button})).filter((function(e){return e.type!==ao.Icon})).forEach((function(e){if(co(e)){if(aa(r,e.name),"function"==typeof e.hidden?e.hidden(t):e.hidden)return;void 0===e.defaultValue?fo(r,e.name,mo(r,e.name)||na(e.type)):"function"==typeof e.defaultValue?fo(r,e.name,e.defaultValue(t)):fo(r,e.name,e.defaultValue)}})),r},ma=function(t){var n=t.handler,r=t.fallback,o=t.fields,a=t.features,i=t.payload,l=t.change,c=t.loadStart,u=t.loadEnd,s=t.incomingTransform,d=void 0===s?da:s,f=Xr(ia(null),2),m=f[0],p=f[1],h=e.useContext(to),v=h.apiRef,b=h.changeSubject,g=h.reloadSubject,y=h.updateSubject,E=e.useRef(!0),x=e.useRef(!1),w=ua(b),C=ua(g),k=ua(y);e.useEffect((function(){var e,t=function(){return Ur(void 0,void 0,void 0,(function(){var e,t,s,f,h,v,b;return $r(this,(function(g){switch(g.label){case 0:return x.current?[2]:[3,1];case 1:if("function"!=typeof n)return[3,9];e=!0,c&&c(sa),g.label=2;case 2:return g.trys.push([2,6,7,8]),(t=n(i))instanceof Promise?(s=oa,f=[{},fa(o,i,a)],h=so,[4,t]):[3,4];case 3:return b=s.apply(void 0,f.concat([h.apply(void 0,[g.sent()])])),l(b,!0),E.current&&p(d(b,i)),[3,5];case 4:b=oa({},fa(o,i,a),so(t)),l(b,!0),E.current&&p(d(b,i)),g.label=5;case 5:return[3,8];case 6:if(v=g.sent(),e=!1,!r)throw v;return r(v),[3,8];case 7:return u&&u(e,sa),x.current=!0,[7];case 8:return[3,10];case 9:n&&!po(m.current,n)&&(b=oa({},fa(o,i,a),so(n)),E.current&&p(d(b,i))),g.label=10;case 10:return[2]}}))}))};t(),e={reload:t,change:function(e,t){void 0===t&&(t=!1),p(d(e,i)),l(e,t)},getData:function(){return qr({},m.current||{})}},"function"==typeof v?v(e):v&&(v.current=e),C.unsubscribeAll(),C.subscribe(e.reload),w.unsubscribeAll(),w.subscribe((function(t){t&&t!==m.current&&e.change(t,!0)})),k.unsubscribeAll(),k.subscribe((function(t){t&&t!==m.current&&e.change(t,!1)}))}),[n]),e.useLayoutEffect((function(){return function(){E.current=!1}}),[]);var S=e.useCallback((function(){return m.current}),[]);return[m.current,p,S]},pa=function(t){var n=e.useRef(t);return n.current=t,n},ha=e.createContext(null),va=function(t){var n=t.children,r=Yr(t,["children"]),o=e.useRef({}),a=e.useRef(!1),i=r.fields,l=void 0===i?[]:i,c=r.features,u=r.change,s=void 0===u?function(){return null}:u,d=r.fallback,f=void 0===d?function(){return null}:d,m=r.handler,p=void 0===m?function(){return{}}:m,h=r.payload,v=r.loadStart,b=r.loadEnd,g=r.incomingTransform,y=Xr(ma({handler:p,fallback:f,fields:l,features:c,payload:h,change:s,loadStart:v,loadEnd:b,incomingTransform:g}),3),E=y[0],x=y[1],w=y[2],C=pa(E),k=e.useCallback((function(e,t){var n=o.current,r=C.current;x(e),Object.entries(t).forEach((function(e){var t=Xr(e,2),r=t[0],o=t[1];n[r]=o})),Object.values(n).some((function(e){return e}))?a.current=!0:(e!==r||a.current)&&(a.current=!1,s(e,!1))}),[]),S=e.useCallback((function(e){return k(so(qr(qr({},C.current),e)),{})}),[]),L=e.useMemo((function(){return{object:E,setObject:k,changeObject:S,getObjectRef:w}}),[E]);return St.createElement(ha.Provider,{value:L},!!E&&n)},ba=function(){return e.useContext(ha)},ga=function(){},ya=function(t,n,r){void 0===n&&(n=[]),void 0===r&&(r=!1);var o=e.useRef(!0),a=e.useRef(r);return e.useEffect((function(){return o.current?(o.current=!1,ga):a.current?ga:t()||ga}),n),e.useMemo((function(){return{resetWatcher:function(){o.current=!0},beginWatch:function(){o.current=!1,a.current=!1},stopWatch:function(){a.current=!0}}}),[])},Ea=function(e){var t=ca((function(){return new Po}));return ya((function(){t.next(e)}),[e]),t},xa=function(){return d.v4()},wa=xa(),Ca=function(t){void 0===t&&(t=0);var n=Xr(e.useState(wa),2),r=n[0],o=n[1],a=e.useCallback((function(){return o(xa())}),[]);return e.useEffect((function(){var e;return t&&(e=setTimeout((function(){e=void 0,a()}),t)),function(){void 0!==e&&clearTimeout(e)}}),[r,t,a]),{reloadTrigger:r,doReload:a}},ka=function(t){var n=t.reloadSubject,r=t.loading,o=t.disabled,a=t.children,i=t.fallback,l=t.Loader,c=void 0===l?function(){return null}:l,u=t.Error,d=void 0===u?function(){return null}:u,f=t.onLoadStart,m=t.onLoadEnd,p=t.payload,h=t.deps,v=void 0===h?[]:h,b=t.throwError,g=void 0!==b&&b,y=Xr(e.useState(""),2),E=y[0],x=y[1],w=Xr(e.useState(o),2),C=w[0],k=w[1],S=Ea(o);e.useEffect((function(){return S.subscribe((function(e){e||k(!1)}))}),[]);var L=Ca(),M=L.reloadTrigger,R=L.doReload,N=ua(n);e.useEffect((function(){return N.subscribe((function(){R()}))}),[]);var I=e.useRef(null),T=Xr(e.useState(!1),2),P=T[0],A=T[1],D=Xr(e.useState(!1),2),j=D[0],O=D[1],F=e.useRef(!0),_=r||P;return e.useLayoutEffect((function(){return function(){F.current=!1}}),[]),e.useEffect((function(){if(!C){I.current&&I.current.cancel();var e=Eo((function(){return Ur(void 0,void 0,void 0,(function(){var e,t,n;return $r(this,(function(r){switch(r.label){case 0:e=!0,f&&f(),r.label=1;case 1:return r.trys.push([1,5,6,7]),(t=a(p))instanceof Promise?[4,t]:[3,3];case 2:return[2,r.sent()||null];case 3:return[2,t||null];case 4:return[3,7];case 5:throw n=r.sent(),e=!1,n;case 6:return m&&m(e),[7];case 7:return[2]}}))}))}));I.current=e;Ur(void 0,void 0,void 0,(function(){var t,n,r;return $r(this,(function(o){switch(o.label){case 0:t=!1,F.current&&A(!0),F.current&&O(!1),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,e()];case 2:return(n=o.sent())===yo?(t=!0,[2]):(I.current=null,F.current&&queueMicrotask((function(){return s.flushSync((function(){x(n)}))})),[3,5]);case 3:if(r=o.sent(),F.current&&O(!0),g)throw r;return i&&i(r),[3,5];case 4:return t||F.current&&A(!1),[7];case 5:return[2]}}))}))}}),Kr(Kr([p,C],Xr(v),!1),[M],!1)),_?St.createElement(c,{payload:p}):j?St.createElement(d,{payload:p}):St.createElement(St.Fragment,null,E)},Sa=function(){function e(e){var t=this;this.target=e,this._status="pending",e.then((function(){return t._status="fulfilled"})),e.catch((function(){return t._status="rejected"}))}return Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),e}(),La=function(e){var t=void 0,n=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return"pending"!==(null==t?void 0:t.status)&&(t=new Sa(e.apply(void 0,Kr([],Xr(n),!1)))),null==t?void 0:t.target};return n.clear=function(){t=void 0},n.getStatus=function(){return(null==t?void 0:t.status)||"ready"},n},Ma=function(t,n){void 0===n&&(n=[]);var r=e.useRef(t);return r.current=t,e.useCallback((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.current.apply(r,Kr([],Xr(e),!1))}),n)},Ra=function(t,n){var r=void 0===n?{}:n,o=r.onLoadStart,a=r.onLoadEnd,i=r.fallback,l=r.throwError,c=Xr(e.useState(!1),2),u=c[0],s=c[1],d=Xr(e.useState(!1),2),f=d[0],m=d[1],p=e.useRef(!0),h=Ma(t);e.useLayoutEffect((function(){return function(){p.current=!1}}),[]);var v=e.useMemo((function(){return La((function(e){return Ur(void 0,void 0,void 0,(function(){var t,n,r;return $r(this,(function(c){switch(c.label){case 0:t=function(){return Ur(void 0,void 0,void 0,(function(){var t,n,r;return $r(this,(function(i){switch(i.label){case 0:t=!0,o&&o(),i.label=1;case 1:return i.trys.push([1,5,6,7]),(n=h(e))instanceof Promise?[4,n]:[3,3];case 2:return[2,i.sent()||null];case 3:return[2,n||null];case 4:return[3,7];case 5:throw r=i.sent(),t=!1,r;case 6:return a&&a(t),[7];case 7:return[2]}}))}))},p.current&&s(!0),p.current&&m(!1),n=!1,c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,t()];case 2:return[2,c.sent()];case 3:if(r=c.sent(),p.current&&m(!0),l)throw r;return i&&i(r),[3,5];case 4:return n||p.current&&s(!1),[7];case 5:return[2,null]}}))}))}))}),[]);return{loading:u,error:f,execute:v}},Na=function(t){var n=ca(t),r=e.useRef(n),o=e.useCallback((function(e){var t;t="function"==typeof e?e(r.current):e,r.current=t}),[]);return[r,o]},Ia={name:"",menu:function(){return null},menuItems:[],onValueChange:function(){return null}},Ta=ro()({container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"}}),Pa=function(t){var n=t.requestSubject,r=Ta().classes,o=Xr(e.useState(null),2),a=o[0],i=o[1],l=Xr(e.useState(0),2),c=l[0],u=l[1],s=Xr(Na(Ia),2),d=s[0],f=s[1],m=Xr(Na(0),2),p=m[0],h=m[1],v=ba(),b=v.object,g=v.changeObject,y=ea(),E=e.useCallback((function(){u((function(e){return e+1}))}),[]),x=e.useCallback((function(){u((function(e){return Math.max(e-1,0)}))}),[]),w=Ra((function(e){return Ur(void 0,void 0,void 0,(function(){return $r(this,(function(t){switch(t.label){case 0:return[4,d.current.menu(d.current.name,e,C.current,y,d.current.onValueChange,g)];case 1:return t.sent(),i(null),[2]}}))}))}),{onLoadStart:E,onLoadEnd:x}).execute,C=pa(b),k=e.useMemo((function(){return d.current.menuItems.map((function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,a=Yr(e,["isDisabled","isVisible"]);return qr(qr({},a),{isDisabled:function(){return n(C.current,y)},isVisible:function(){return o(C.current,y)}})}))}),[d.current.menuItems]),S=pa(k);return e.useEffect((function(){return n.subscribe(xo((function(e){var t=e.event,n=e.menuItems,r=e.menu,o=e.name,a=e.onValueChange;return Ur(void 0,void 0,void 0,(function(){var e;return $r(this,(function(l){switch(l.label){case 0:return[4,go(350)];case 1:return l.sent(),h((function(e){return e+1})),f({name:o,menuItems:n,onValueChange:a,menu:r}),e=document.elementFromPoint(t.clientX,t.clientY),i(e||t.target),[2]}}))}))})))}),[]),St.createElement(At.default,{key:p.current,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},anchorEl:a,open:!!a,onClose:function(){return i(null)},MenuListProps:{disablePadding:!0}},St.createElement("div",{className:r.container},0!==c&&St.createElement("div",{className:r.loader},St.createElement(Rt.default,{size:14})),St.createElement("div",{className:r.content},S.current.map((function(e,t){var n=e.label,r=void 0===n?"unknown-label":n,o=e.action,a=void 0===o?"unknown-action":o,l=e.divider,c=e.onClick,u=e.icon,s=e.isDisabled,f=void 0===s?function(){return!1}:s,m=e.isVisible,h=void 0===m?function(){return!0}:m;return St.createElement(ka,{Loader:function(){return l?null:St.createElement(Tt.default,{sx:{visibility:"hidden",minWidth:225}},!!u&&St.createElement(Nt.default,null,St.createElement(u,null)),St.createElement(It.default,{variant:"inherit"},r))},onLoadStart:E,onLoadEnd:x,key:"".concat(p.current,"-").concat(t),payload:y},(function(e){return Ur(void 0,void 0,void 0,(function(){var t;return $r(this,(function(n){switch(n.label){case 0:return[4,go(0)];case 1:return n.sent(),[4,f(e)];case 2:return t=n.sent(),[4,h(e)];case 3:return n.sent()?l?[2,St.createElement(Pt.default,{orientation:"horizontal"})]:[2,St.createElement(Tt.default,{disabled:t,onClick:function(){if(c)return c(C.current,e,d.current.onValueChange,g),void i(null);w(a)},sx:{minWidth:225}},!!u&&St.createElement(Nt.default,null,St.createElement(u,null)),St.createElement(It.default,{variant:"inherit"},r))]:[2,null]}}))}))}))})))))},Aa=e.createContext(null),Da=function(t){var n=t.children,r=ua(),o=e.useMemo((function(){return{createContextMenu:function(e){var t=e.menuItems,n=void 0===t?[]:t,o=e.onValueChange,a=void 0===o?function(){return null}:o,i=e.menu,l=e.name;return function(e){return Ur(void 0,void 0,void 0,(function(){return $r(this,(function(t){switch(t.label){case 0:return n?(e.preventDefault(),e.stopPropagation(),(null==n?void 0:n.length)?[4,r.next({name:l,menu:i,event:e,menuItems:n,onValueChange:a})]:[2]):[2];case 1:return[2,t.sent()]}}))}))}},requestSubject:r}}),[]);return St.createElement(Aa.Provider,{value:o},n,St.createElement(Pa,{requestSubject:r}))},ja=function(){return e.useContext(Aa)};var Oa=function(e){var t=!1,n=null,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return t||(t=!0,n=e.apply(void 0,Kr([],Xr(r),!1))),n};return r.clear=function(){t=!1},r},Fa=function(){return!0},_a=function(e,t){var n=e.compute,r=e.type,o=e.readTransform,a=e.name,i=e.object,l=e.payload,c=e.config;if(n&&c.WITH_SYNC_COMPUTE){var u=t?n(i,l):na(r);return!(u instanceof Promise)&&u}return!(n||!a)&&(o(mo(i,a),a,i,l)||na(r))},Ba=function(e,t){var n=void 0===t?{}:t,r=n.allowedErrors,o=n.fallback,a=n.defaultValue,i=void 0===a?null:a;return function(){for(var t,n,a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];try{var c=e.apply(void 0,Kr([],Xr(a),!1));return c instanceof Promise?function(e,t){var n=t.fallback,r=t.defaultValue;return Ur(void 0,void 0,void 0,(function(){var t;return $r(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e];case 1:return[2,o.sent()];case 2:return t=o.sent(),n&&n(t),[2,r];case 3:return[2]}}))}))}(c,{fallback:o,defaultValue:i}):c}catch(e){if(o&&o(e),r){try{for(var u=Gr(r),s=u.next();!s.done;s=u.next()){if(e instanceof s.value)return i}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}throw e}return i}}},Ha=function(){return!1},Wa=function(){return!0},za=function(){return null},Va=function(){return null},qa=function(){return!1},Ya=function(e,t,n){var r="".concat(t,"(").concat(e||"unknown",")");return function(e){console.error("react-declarative ".concat(r," ").concat(n," exception"),e)}},Ua=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[];return e.forEach((function(e){if(e)if("string"==typeof e)n.push(e);else if(Array.isArray(e)){if(e.length){var t=Ua.apply(void 0,Kr([],Xr(e),!1));t&&n.push(t)}}else"object"==typeof e&&(e.toString!==Object.prototype.toString?n.push(e.toString()):Object.entries(e).filter((function(e){var t=Xr(e,2);return t[0],!!t[1]})).forEach((function(e){var t=Xr(e,1)[0];return n.push(t)})))})),n.join(" ")},$a="12",Ga=function(e){return Number(e)},Xa=ro()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",width:"100%","& > *":{flex:1}}}),Ka=function(t,n){var r=t.className,o=t.style,a=t.sx,i=t.columns,l=void 0===i?"":i,c=t.phoneColumns,u=void 0===c?"":c,s=t.tabletColumns,d=void 0===s?"":s,f=t.desktopColumns,m=void 0===f?"":f,p=t.fieldRightMargin,h=void 0===p?"1":p,v=t.fieldBottomMargin,b=void 0===v?"2":v,g=t.children,y=t.onClick,E=t.onFocus,x=t.onContextMenu,w=Yr(t,["className","style","sx","columns","phoneColumns","tabletColumns","desktopColumns","fieldRightMargin","fieldBottomMargin","children","onClick","onFocus","onContextMenu"]),C=Xa().classes,k=e.useMemo((function(){return{xs:Ga(u||l||$a),sm:Ga(d||l||$a),md:Ga(d||l||$a),lg:Ga(m||l||$a),xl:Ga(m||l||$a),mr:Ga(h),mb:Ga(b)}}),[]),S=k.xs,L=k.sm,M=k.md,R=k.lg,N=k.xl,I=k.mr,T=k.mb;return St.createElement(jt.default,qr({},w,{ref:n,item:!0,className:Ua(r,C.root),style:o,onFocus:E,onClick:y,xs:S,sm:L,md:M,lg:R,xl:N,sx:a,onContextMenu:x}),St.createElement(Mt.default,{className:C.container,mr:I,mb:T},g))};Ka.displayName="Item";var Qa=e.forwardRef(Ka),Ja=function(t,n){var r=t.className,o=t.style,a=t.children,i=t.onFocus,l=t.onClick,c=t.isBaselineAlign,u=t.columnsOverride,s=t.sx,d=t.onContextMenu,f=Yr(t,["className","style","children","onFocus","onClick","isBaselineAlign","columnsOverride","sx","onContextMenu"]),p=e.useMemo((function(){return u&&Number(u)}),[]);return St.createElement(m.Grid,qr({},f,{ref:n,container:!0,alignItems:c?"flex-end":"flex-start",className:r,style:o,onClick:l,onFocus:i,columns:p,onContextMenu:d,sx:s}),a)};Ja.displayName="Container";var Za=e.forwardRef(Ja),ei=ro()({root:{position:"relative","& > *":{width:"100%"}}}),ti=function(e,t){var n=e.className,r=void 0===n?"":n,o=e.columns,a=void 0===o?"":o,i=e.phoneColumns,l=void 0===i?"":i,c=e.tabletColumns,u=void 0===c?"":c,s=e.desktopColumns,d=void 0===s?"":s,f=e.children,m=e.isItem,p=e.isBaselineAlign,h=e.style,v=e.columnsOverride,b=e.sx,g=e.fieldRightMargin,y=void 0===g?"1":g,E=e.fieldBottomMargin,x=void 0===E?"2":E,w=e.onClick,C=e.onFocus,k=e.onContextMenu,S=Yr(e,["className","columns","phoneColumns","tabletColumns","desktopColumns","children","isItem","isBaselineAlign","style","columnsOverride","sx","fieldRightMargin","fieldBottomMargin","onClick","onFocus","onContextMenu"]),L=ei().classes;return m?St.createElement(Qa,qr({},S,{ref:t,className:Ua(L.root,r),style:h,columns:a,phoneColumns:l,tabletColumns:u,desktopColumns:d,fieldRightMargin:y,fieldBottomMargin:x,onFocus:C,onClick:w,onContextMenu:k,sx:b}),f):St.createElement(Za,qr({},S,{ref:t,className:Ua(L.root,r),isBaselineAlign:p,columnsOverride:v,style:h,onFocus:C,onContextMenu:k,onClick:w,sx:b}),f)};ti.displayName="Group";var ni=e.forwardRef(ti),ri=function(e){if(e){if(e.includes(".")){var t=e.split(".");e=Xr(t.reverse(),1)[0]}var n=Xr(e.split("_")),r=n[0],o=n.slice(1);return Kr(["".concat(r.charAt(0).toUpperCase()).concat(r.slice(1))],Xr(o),!1).join(" ")}},oi={WITH_DIRTY_CLICK_LISTENER:!0,WITH_MOBILE_READONLY_FALLBACK:!0,WITH_WAIT_FOR_MOVE_LISTENER:!0,WITH_WAIT_FOR_TAB_LISTENER:!0,WITH_WAIT_FOR_TOUCH_LISTENER:!0,WITH_DISMOUNT_LISTENER:!0,WITH_SYNC_COMPUTE:!1,CUSTOM_FIELD_DEBOUNCE:800,FIELD_BLUR_DEBOUNCE:100},ai=function(){var e=this;this._config=oi,this.getRef=function(){return e._config},this.setValue=function(t){Object.assign(e._config,oi,t)}},ii=Symbol("get-reference"),li=function(){function e(){}var t;return t=ii,e.instance=new ai,e[t]=e.instance.getRef,e.setValue=e.instance.setValue,e}(),ci={display:"flex",alignItems:"stretch",justifyContent:"stretch"},ui=ro()((function(e){var t,n,r;return{root:qr(qr({},ci),{"& > *":qr(qr({},ci),{flexGrow:1}),"& > * > *":{flexGrow:1},pointerEvents:"all"}),hidden:{display:"none !important"},fieldReadonly:{"& > *":{pointerEvents:"none !important"}},phoneHidden:(t={},t[e.breakpoints.only("xs")]={display:"none !important"},t),tabletHidden:(n={},n[e.breakpoints.between("sm","lg")]={display:"none !important"},n),desktopHidden:(r={},r[e.breakpoints.up("lg")]={display:"none !important"},r)}})),si=function(e){return console.log({v:e})},di=function(){return null},fi=function(){return null},mi=function(e){return e},pi=function(){},hi=function(){return null},vi=function(){return null},bi=function(e){return e},gi=function(e){return e};function yi(t,n){var r=this;void 0===n&&(n={withApplyQueue:!1,skipDirtyClickListener:!1,skipClickListener:!1,skipFocusReadonly:!1,skipFocusBlurCall:!1,skipDebounce:!1,defaultProps:{}});var o=e.memo(t),a=li[ii](),i=function(i){var l,c,u,s,d,f,m,p=i.className,h=void 0===p?"":p,v=i.sx,b=i.columns,g=void 0===b?"":b,y=i.phoneColumns,E=void 0==