import{s as Q,c$ as L,E as k,G as M,V as W,X as R,an as I,a3 as z,aG as O,aH as P,y as h,aM as U,f as u,ad as D,O as j,x as V,b0 as H,aQ as J,ae as X,z as E,P as T,Q as y,T as $,D as G,d0 as K,aK as Y,K as Z,av as q,a5 as ee}from"./index-DT8qTvyx.js";var te=function(C){Q(o,C);function o(e){var t=C.call(this,e)||this;return L(t,["handleAction","handleChange","handleBulkChange","handleQuery","handleDialogConfirm","handleDialogClose","handleDrawerConfirm","handleDrawerClose","handleClick","reload","silentReload","initInterval"]),t.style=document.createElement("style"),t.style.setAttribute("data-page",""),document.getElementsByTagName("head")[0].appendChild(t.style),t.updateStyle(),t.varStyle=document.createElement("style"),t.varStyle.setAttribute("data-vars",""),document.getElementsByTagName("head")[0].appendChild(t.varStyle),t.updateVarStyle(),t}return o.prototype.updateStyle=function(){this.props.css||this.props.mobileCSS?this.style.innerHTML=` `.concat(this.buildCSS(this.props.css),` @media (max-width: 768px) { `).concat(this.buildCSS(this.props.mobileCSS),` } `):this.style.innerHTML=""},o.prototype.buildCSS=function(e){if(!e)return"";var t="";for(var a in e){var n=e[a],r="";for(var s in n){var l="",d=n[s];if(typeof d=="string")r+=" ".concat(s,": ").concat(d,`; `);else{for(var i in d)l+=" ".concat(i,":").concat(d[i],";");r+=" ".concat(s," {").concat(l,`} `)}}t+=` `.concat(a,` { `).concat(r,` } `)}return t},o.prototype.updateVarStyle=function(){var e=this.props.cssVars,t="";if(e){for(var a in e)if(a.startsWith("--")){if(a.indexOf(":")!==-1)continue;var n=e[a];if(typeof n=="string"&&(n.indexOf("expression(")!==-1||n.indexOf(";")!==-1))continue;t+="".concat(a,": ").concat(n,`; `)}this.varStyle.innerHTML=` :root { `.concat(t,` } `)}},o.prototype.componentDidMount=function(){return k(this,void 0,void 0,function(){var e,t,a,n,r,s,l,d,i,p;return M(this,function(f){switch(f.label){case 0:return e=this.props,t=e.initApi,a=e.initFetch,n=e.initFetchOn,r=e.store,s=e.messages,l=e.data,d=e.dispatchEvent,i=e.env,this.mounted=!0,[4,d("init",l,this)];case 1:return p=f.sent(),i!=null&&i.tracker&&i.tracker({eventType:"pageLoaded"},this.props),p!=null&&p.prevented||!Y(r)?[2]:(R(t,r.data,a,n)&&r.fetchInitData(t,r.data,{successMessage:s&&s.fetchSuccess,errorMessage:s&&s.fetchFailed}).then(this.initInterval),[2])}})})},o.prototype.componentDidUpdate=function(e){var t=this.props,a=t.store,n=t.initApi;if(t.initFetchOn&&t.initFetch&&!e.initFetch||t.initFetch!==!1&&W(e.initApi,n,e.data,t.data)){var r=t.messages;R(n,a.data)&&a.fetchData(n,a.data,{successMessage:r&&r.fetchSuccess,errorMessage:r&&r.fetchFailed}).then(this.initInterval)}(JSON.stringify(t.css)!==JSON.stringify(e.css)||JSON.stringify(t.mobileCSS)!==JSON.stringify(e.mobileCSS))&&this.updateStyle(),JSON.stringify(t.cssVars)!==JSON.stringify(e.cssVars)&&this.updateVarStyle(),I(e.defaultData,t.defaultData)&&a.reInitData(t.defaultData)},o.prototype.componentWillUnmount=function(){var e,t;this.mounted=!1,clearTimeout(this.timer),this.style&&((e=this.style.parentNode)===null||e===void 0||e.removeChild(this.style)),this.varStyle&&((t=this.varStyle.parentNode)===null||t===void 0||t.removeChild(this.varStyle))},o.prototype.reloadTarget=function(e,t){},o.prototype.handleAction=function(e,t,a,n,r){var s=this;n===void 0&&(n=!1);var l=this.props,d=l.env,i=l.store,p=l.messages,f=l.onAction;return t.actionType==="dialog"?(i.setCurrentAction(t,this.props.resolveDefinitions),new Promise(function(c){i.openDialog(a,void 0,function(m,v){var g;(g=t.callback)===null||g===void 0||g.call(t,m,v),c({confirmed:m,value:v})},r||s.context)})):t.actionType==="drawer"?(i.setCurrentAction(t,this.props.resolveDefinitions),new Promise(function(c){i.openDrawer(a,void 0,function(m,v){var g;(g=t.callback)===null||g===void 0||g.call(t,m,v),c({confirmed:m,value:v})},r)})):t.actionType==="ajax"?(i.setCurrentAction(t,this.props.resolveDefinitions),R(t.api,a)?i.saveRemote(t.api,a,{successMessage:t.messages&&t.messages.success||p&&p.saveSuccess,errorMessage:t.messages&&t.messages.failed||p&&p.saveSuccess}).then(function(){return k(s,void 0,void 0,function(){var c;return M(this,function(m){switch(m.label){case 0:return t.feedback&&ee(t.feedback,i.data)?[4,this.openFeedback(t.feedback,i.data)]:[3,2];case 1:m.sent(),m.label=2;case 2:return c=t.redirect&&Z(t.redirect,i.data),c&&d.jumpTo(c,t,i.data),t.reload&&this.reloadTarget(q(t.reload,i.data),i.data),[2]}})})}).catch(function(c){if(n||t.countDown)throw c}):void 0):f(e,t,a,n,r||this.context)},o.prototype.handleQuery=function(e){if(this.props.initApi){if(e!=null&&e.hasOwnProperty("orderBy")&&!W(this.props.initApi,this.props.initApi,this.props.store.data,z(this.props.store.data,e)))return!1;this.receive(e);return}return this.props.onQuery?this.props.onQuery(e):!1},o.prototype.handleDialogConfirm=function(e,t){for(var a=[],n=2;n