const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Column-1.0.74-BfP-iBAD.js","./RestApiError-1.0.74-Bb1un17k.js","./vendor-1.0.74-CN03Eozo.js","./tanstack-1.0.74-aU0azVkW.js","./redux-1.0.74-D8bIc6ki.js","./lib-1.0.74-B5IEqfHg.js","./utils-1.0.74-7xWhx9mc.js","./ActionsDml-1.0.74-C175Bq0Y.js","./RestApi-1.0.74-5XKxNzpR.js","./hooks-1.0.74-NYCTWeI9.js","./useAppFunctions-1.0.74-YEA5Kc-A.js","./useMetadata-1.0.74--jxfVI7W.js","./TargetEnum-1.0.74-BJN_W527.js","./index-1.0.74-CwV9FnQf.js","./Autocomplete-1.0.74-1_REDbpQ.js","./CircularProgress-1.0.74-QfwfRJ7i.js","./Select-1.0.74-DHOnlEEH.js","./Menu-1.0.74-CdjCBJ4R.js","./ThemeProvider-1.0.74-4uzbYYLM.js","./Typography-1.0.74-B4mhsevh.js","./useEnhancedEffect-1.0.74-B56M26dS.js","./index-1.0.74-DxwH6OqZ.js","./ButtonBase-1.0.74-W6tAH7AI.js","./Portal-1.0.74-BrUPeMX9.js","./iconBase-1.0.74-Cs0vntJu.js","./isHostComponent-1.0.74-DVu5iVWx.js","./Modal-1.0.74-BfLid1bk.js","./createSvgIcon-1.0.74-Cw_ZFbxi.js","./Close-1.0.74-Ce0z5IFm.js","./Chip-1.0.74-BR6j83mk.js","./TextField-1.0.74-BW9Byijb.js"])))=>i.map(i=>d[i]);
import{_ as U}from"./RestApiError-1.0.74-Bb1un17k.js";import{j as a}from"./tanstack-1.0.74-aU0azVkW.js";import{r as m}from"./redux-1.0.74-D8bIc6ki.js";import{l,b_ as Y,bV as q,al as b,ad as z,cq as I}from"./lib-1.0.74-B5IEqfHg.js";import{u as F,a as X}from"./hooks-1.0.74-NYCTWeI9.js";import{u as w}from"./useTableSettings-1.0.74-DOrceZPc.js";import{a as k}from"./FormContainer-1.0.74-CMURz_WD.js";import{u as G}from"./useFormColumns-1.0.74-yDkpiSEG.js";import{u as J}from"./useLocaleApp-1.0.74-BAnA1P2j.js";import{a as K}from"./useFullScreen-1.0.74-DAWjksdW.js";import{B as M}from"./Box-1.0.74-DEbuVvGV.js";import"./vendor-1.0.74-CN03Eozo.js";import"./utils-1.0.74-7xWhx9mc.js";import"./AdminTheme-1.0.74-BtTaJUu_.js";import"./CircularProgress-1.0.74-QfwfRJ7i.js";import"./SharedContainer-1.0.74-EDNOiamc.js";import"./DynamicModeEnum-1.0.74-BXuL5kgA.js";import"./index-1.0.74-DxwH6OqZ.js";import"./ButtonBase-1.0.74-W6tAH7AI.js";import"./Typography-1.0.74-B4mhsevh.js";import"./useEnhancedEffect-1.0.74-B56M26dS.js";import"./ThemeProvider-1.0.74-4uzbYYLM.js";import"./Portal-1.0.74-BrUPeMX9.js";import"./iconBase-1.0.74-Cs0vntJu.js";import"./useRemoveAppFromStore-1.0.74-CJatuZ_l.js";import"./Languages-1.0.74-DaJcF5OJ.js";import"./CleanupDetails-1.0.74-CpCDzf3e.js";import"./useFormDetails-1.0.74-eGZBYCv4.js";import"./useMetadata-1.0.74--jxfVI7W.js";import"./useTheme-1.0.74-CW3awVDs.js";import"./index-1.0.74-iJ_9eGZx.js";import"./getThemeProps-1.0.74-DOfDN6_V.js";import"./useChartSettings-1.0.74-C6-5LBxk.js";import"./useBuiltins-1.0.74-D-15qGZw.js";import"./RestApi-1.0.74-5XKxNzpR.js";import"./ConfirmDialog-1.0.74-CXu4CqK2.js";import"./Modal-1.0.74-BfLid1bk.js";import"./useStoreFormSettings-1.0.74-3dBRbl0S.js";import"./useScreenSize-1.0.74-DEibwIMk.js";import"./ActionsDml-1.0.74-C175Bq0Y.js";import"./useAppFunctions-1.0.74-YEA5Kc-A.js";import"./Spinner-1.0.74-B63QTBL9.js";import"./index-1.0.74-CwV9FnQf.js";import"./dayjs.min-1.0.74-DSE__uTX.js";import"./useFormStore-1.0.74-D7tcZmQW.js";import"./DynamicComponent-1.0.74-MTJLprNJ.js";import"./index-1.0.74-FmkvObU2.js";import"./StoreTypeEnum-1.0.74-BO7CLiE1.js";import"./FallbackSpinner-1.0.74-7h-h2HIM.js";import"./ThemeContainer-1.0.74-LGT-FhpN.js";import"./useGlobalCode-1.0.74-D0fKEv_n.js";import"./useLocaleUd-1.0.74-DiRzsyAi.js";const Q=e=>{const r=F(u=>{var i,p;return((p=(i=u.forms[e])==null?void 0:i.state)==null?void 0:p.validation)??{}});return l.debug("rowValidation",r),r},W=e=>{const r=F(u=>{var i;return(i=u.forms[e])==null?void 0:i.context});return l.debug("context",r),r},Z=m.lazy(()=>U(()=>import("./Column-1.0.74-BfP-iBAD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url)),Zo=({appId:e,metaData:r,formMode:u,formSettings:i,language:p})=>{var T,E;l.debug(r,u,i,p);const R=X(),_=m.useRef(0),d=400,C=m.useRef(0),V=((E=(T=r==null?void 0:r.settings)==null?void 0:T.wp)==null?void 0:E.scroll_offset)??120,s=G(e),y=J(e),L=Q(e),j=k(e),x=w(e),B=W(e),v=K(e),f=w(e),A=m.useMemo(()=>s.map(t=>t.columnName),[s]),H=(t,o)=>{l.debug(t,o),R(I({appId:e,columnName:t,columnValue:o}))},S={label:"",type:Y.TEXT,expression:""};l.debug(S);const h=()=>{const t=z(e,"pp_app_"),o=window.document.getElementById(t);o!==null&&o.getBoundingClientRect().height>_.current&&(window.scrollTo({top:o.getBoundingClientRect().top+window.pageYOffset-V,behavior:"smooth"}),_.current=o.getBoundingClientRect().height,C.current++,d*C.current<3e3&&setTimeout(()=>{h()},d))};m.useLayoutEffect(()=>{!v&&(f==null?void 0:f.formModal)!==!0&&setTimeout(()=>{h()},d)},[]);const O=(t,o)=>(l.debug(t,o),null),P=(t,o,c)=>(l.debug(t,o,c),a.jsx(m.Suspense,{children:a.jsx(M,{sx:{display:"grid",padding:"0"},children:a.jsx(Z,{appId:e,columnName:o,columnMetaData:c,storeColumn:s[t],columnValidation:L[o],onColumnChange:H,metaData:r,context:B,storeTable:x,storeForm:i,formMode:u,locale:y,language:p},o+t)})},o+t));return a.jsx(a.Fragment,{children:A.map((t,o)=>{if(s[o].computedField!==void 0)return O(s,o);const c=q(r,t);if(c===void 0)return null;const n={...c},g=((n==null?void 0:n.is_nullable)??"").toUpperCase()!=="YES";return s[o].more&&!j&&!(u===b.INSERT&&g)||n.column_name&&u===b.INSERT&&g&&!s[o].visible&&(n.column_default!==null||n.column_default!=="NULL"||n.column_default!==""||s[o].defaultValue!==null||s[o].defaultValue!=="")?null:n.column_name&&(s[o].visible===!0||u===b.INSERT&&g&&(n.extra??"")!=="auto_increment"&&(i==null?void 0:i.remoteAutoIncrementColumn)!==n.column_name)?(n.formLabel=s[o].columnLabel,P(o,t,n)):null})})};export{Zo as default};
