import o from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/objectWithoutProperties";import{useEffect as n,useRef as s}from"react";import e from"prop-types";import{makeStyles as r}from"@material-ui/core";import i from"classnames";import c from"moment-timezone";import{useXProps as p}from"./effects/useXProps.js";import{ISOLATED_PAGE_APP_CONTAINER_ID as m}from"./constants.js";import{replaceUndefinedValuesWithNull as a}from"./utils/replaceUndefinedValuesWithNull.js";import l from"../DevCenterAppContainer/DevCenterAppContainer.js";import"../../../icons/WithCustomSize.js";import{IconParkProvider as u}from"../../../icons/IconParkProvider.js";import"../../../icons/customIcons/icons/AddMessage.js";import"../../../icons/customIcons/icons/Attention.js";import"../../../icons/customIcons/icons/Collapse.js";import"../../../icons/customIcons/icons/Dashboard.js";import"../../../icons/customIcons/icons/Expand.js";import"../../../icons/customIcons/icons/FolderClosed.js";import"../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../icons/customIcons/icons/FolderOpened.js";import"../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../icons/customIcons/icons/LessOrEqual.js";import"../../../icons/customIcons/icons/Search.js";import"../../../icons/customIcons/icons/Wellhub.js";import"../../../icons/customIcons/icons/MultiRuler.js";import"../../../icons/customIcons/icons/Checkbox.js";import"../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../icons/customIcons/icons/Radio.js";import"../../../icons/customIcons/icons/RadioChecked.js";import"../../../icons/customIcons/icons/SimulFrac.js";import"../../../icons/customIcons/icons/ZipperFrac.js";import"../../../icons/customIcons/icons/CautionFilled.js";import"../../../icons/customIcons/icons/MoreApp.js";import f from"../../../hocs/withMUIProvidersHOC.js";import"../../../hocs/withAssetEditorLockHOC.js";import j from"../AppContext.js";import{THEMES as C}from"../../../constants/theme.js";import{LOCAL_STORAGE_APP_THEME_KEY as d}from"../../../CLI/hocs/constants.js";import{setThemeVariables as h}from"../../../utils/themeVariables.js";import{isPDFReportView as I}from"../../../CLI/hocs/utils.js";import{PermissionsContext as b}from"../../../permissions/PermissionsContext.js";import{updateUserUnits as g}from"../../../utils/index.js";import"../../../config/initGlobalDependencies.js";import"../../../styles/globalStyles.js";import"./DevCenterAppZoidComponent.js";import{jsx as v}from"react/jsx-runtime";var O=["appContextValue","globalMixpanelEventTracker","globalNotificationToastsAPI","onSettingChange","onSettingsChange","permissionsContextValue","timezone","userUnits"];function A(o,t){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),n.push.apply(n,s)}return n}function P(t){for(var n=1;n<arguments.length;n++){var s=null!=arguments[n]?arguments[n]:{};n%2?A(Object(s),!0).forEach((function(n){o(t,n,s[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):A(Object(s)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(s,o))}))}return t}var y=f(l),S=r((function(){return{"@global":{body:{backgroundColor:"transparent",overflow:"hidden"}}}}));function x(o){var e,r=o.CLIAppComponent,l=o.CLIAppSettings,f=o.containerReportClassName;S();var A=p(),x=A.appContextValue,D=A.globalMixpanelEventTracker,w=A.globalNotificationToastsAPI,L=A.onSettingChange,k=A.onSettingsChange,R=A.permissionsContextValue,E=A.timezone,T=A.userUnits,F=t(A,O),M=F.location.pathname.startsWith("/reports/")||I,N=null!==(e=localStorage.getItem(d))&&void 0!==e?e:C.DARK,z=!M&&N===C.DARK;n((function(){h(z)}),[z]),n((function(){window[Symbol.for("notificationToasts")]=w,window[Symbol.for("logToMixpanel")]=D}),[w,D]);var V=s(!0);return V.current&&(V.current=!1,g({userUnits:T})),n((function(){return E&&c.tz.setDefault(E),function(){return c.tz.setDefault(null)}}),[E]),v(b.Provider,{value:R,children:v(j.Provider,{value:x,children:v(u,{children:v("div",{id:m,className:i(M&&f),children:v(y,P(P({},F),{},{theme:z?C.DARK:C.LIGHT,onSettingsChange:function(o){return k(a(o))},onSettingChange:function(o,t){return L(o,a(t))},CLIAppComponent:r,CLIAppSettings:l}))})})})})}x.propTypes={CLIAppComponent:e.func,CLIAppSettings:e.func,containerReportClassName:e.string},x.defaultProps={CLIAppComponent:null,CLIAppSettings:null,containerReportClassName:null};export{x as DevCenterIsolatedAppPage};
