@corva/dc-platform-shared 0.67.0 → 0.68.1

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.
Files changed (50) hide show
  1. package/CLI/components/App/App.js +1 -1
  2. package/CLI/components/App/components/AppBar/AppBar.js +1 -1
  3. package/CLI/hocs/effects/useProvideAuth/useProvideAuth.js +1 -1
  4. package/CLI/hocs/utils.js +1 -1
  5. package/CLI/hocs/withAppDataProviderHOC.js +1 -1
  6. package/CLI/hocs/withCLIAppSettingsHOC.js +1 -1
  7. package/CLI/hocs/withCorvaMagicHOC.js +1 -1
  8. package/CLI/hocs/withDevCenterRouterHOC.js +1 -1
  9. package/CLI/hocs/withGridLayoutHOC/withGridLayoutHOC.js +1 -1
  10. package/CLI/hocs/withPDFLayoutHOC.js +1 -1
  11. package/CLI/hocs/withReactRouterHOC.js +1 -1
  12. package/CLI/screens/LoginScreen/LoginScreen.js +1 -1
  13. package/CLI/screens/LoginScreen/components/Auth.js +1 -1
  14. package/CLI/screens/LoginScreen/components/AuthStep.js +1 -1
  15. package/CLI/screens/LoginScreen/components/EmailStep.js +1 -1
  16. package/CLI/screens/LoginScreen/components/SSOButton.js +1 -1
  17. package/CLI/screens/OAuthCallbackScreen/index.js +1 -1
  18. package/cjs/devcenter/webpack/DevServerEntryPoint.js +1 -1
  19. package/cjs/devcenter/webpack/DevServerIsolatedAppEntryPoint.js +1 -1
  20. package/cjs/devcenter/webpack/constants.js +1 -1
  21. package/cjs/devcenter/webpack/plugins/checkCorvaUIVersion.js +11 -1
  22. package/cjs/devcenter/webpack/utils/middlewares.js +1 -1
  23. package/cjs/devcenter/webpack/utils/serializeDotEnv.js +1 -1
  24. package/cjs/devcenter/webpack/validators/dependencies.js +1 -1
  25. package/cjs/devcenter/webpack/validators/index.js +1 -1
  26. package/cjs/devcenter/webpack/webpack.config.common.js +1 -1
  27. package/cjs/devcenter/webpack/webpack.config.dev.js +1 -1
  28. package/cjs/devcenter/webpack/webpack.config.prod.js +1 -1
  29. package/clients/auth0/index.js +1 -1
  30. package/components/GridLockButton/index.js +1 -1
  31. package/components/Login/components/Chip.js +1 -1
  32. package/components/Login/components/EmailField.js +1 -1
  33. package/components/Login/components/HiddenEmailField.js +1 -1
  34. package/components/Login/components/Login.js +1 -1
  35. package/components/Login/components/PasswordField.js +1 -1
  36. package/components/Login/components/StepFooter.js +1 -1
  37. package/components/Login/components/VerificationStep.js +1 -1
  38. package/package.json +23 -13
  39. package/utils/devcenter.js +1 -1
  40. package/utils/recaptcha.js +1 -1
  41. package/vite/corva-vite-config.mjs +858 -0
  42. package/_virtual/_commonjsHelpers.js +0 -1
  43. package/_virtual/toPrimitive.js +0 -1
  44. package/_virtual/toPropertyKey.js +0 -1
  45. package/_virtual/typeof.js +0 -1
  46. package/ext-cjs/@babel/runtime/helpers/defineProperty.js +0 -1
  47. package/ext-cjs/@babel/runtime/helpers/taggedTemplateLiteral.js +0 -1
  48. package/ext-cjs/@babel/runtime/helpers/toPrimitive.js +0 -1
  49. package/ext-cjs/@babel/runtime/helpers/toPropertyKey.js +0 -1
  50. package/ext-cjs/@babel/runtime/helpers/typeof.js +0 -1
@@ -1 +1 @@
1
- import{useReducer as o,useEffect as t}from"react";import r from"classnames";import{MuiThemeProvider as e}from"@material-ui/core";import{MuiPickersUtilsProvider as m}from"@material-ui/pickers";import i from"@date-io/moment";import a from"moment";import{isPDFReportView as n}from"@corva/ui/utils/reports";import{LOCAL_STORAGE_APP_THEME_KEY as p}from"@corva/ui/constants/localStorageKeys";import{NotificationsContainer as s}from"@corva/ui/components";import{THEMES as c}from"@corva/ui/constants/theme";import{darkTheme as l,lightTheme as f}from"@corva/ui/config/theme";import{setThemeVariables as u}from"@corva/ui/utils/themeVariables";import{LOGIN_ROUTE_REG_EXP as d}from"../../constants/index.js";import h from"./components/AppBar/AppBar.js";import{AuthContext as v}from"../../context/auth.js";import A from"../../hocs/effects/useProvideAuth/useProvideAuth.js";import g from"./App.css.js";import{jsx as j,jsxs as x,Fragment as I}from"react/jsx-runtime";function K(K){var C;let{children:D,router:P}=K;const R=A(P),S=!d.test(P.location.pathname)&&!R.loading,[,b]=o((o=>o+1),0),B=null!==(C=localStorage.getItem(p))&&void 0!==C?C:c.DARK,N=!S||!n&&B===c.DARK;t((()=>u(N)),[N]);return j(v.Provider,{value:R,children:j(e,{theme:N?l:f,children:j(m,{libInstance:a,utils:i,children:x(I,{children:[!S&&D,S&&x("div",{className:g.app,children:[j(s,{}),j(h,{toggleTheme:()=>{localStorage.setItem(p,N?c.LIGHT:c.DARK),b()}}),j("div",{className:r(g.appContent,n&&g.pdfAppContent,!N&&g.lightAppContent),children:D})]})]})})})})}export{K as default};
1
+ import{useReducer as o,useEffect as t}from"react";import r from"classnames";import{MuiThemeProvider as e}from"@material-ui/core";import{MuiPickersUtilsProvider as m}from"@material-ui/pickers";import i from"@date-io/moment";import a from"moment";import{isPDFReportView as n}from"@corva/ui/utils/reports";import{LOCAL_STORAGE_APP_THEME_KEY as p}from"@corva/ui/constants/localStorageKeys";import{NotificationsContainer as s}from"@corva/ui/components";import{THEMES as c}from"@corva/ui/constants/theme";import{darkTheme as l,lightTheme as f}from"@corva/ui/config/theme";import{setThemeVariables as u}from"@corva/ui/utils/themeVariables";import{LOGIN_ROUTE_REG_EXP as h}from"../../constants/index.js";import d from"./components/AppBar/AppBar.js";import{AuthContext as v}from"../../context/auth.js";import A from"../../hocs/effects/useProvideAuth/useProvideAuth.js";import g from"./App.css.js";import{jsx as j,jsxs as x,Fragment as I}from"react/jsx-runtime";function K({children:K,router:C}){const D=A(C),P=!h.test(C.location.pathname)&&!D.loading,[,R]=o((o=>o+1),0),S=localStorage.getItem(p)??c.DARK,b=!P||!n&&S===c.DARK;t((()=>u(b)),[b]);return j(v.Provider,{value:D,children:j(e,{theme:b?l:f,children:j(m,{libInstance:a,utils:i,children:x(I,{children:[!P&&K,P&&x("div",{className:g.app,children:[j(s,{}),j(d,{toggleTheme:()=>{localStorage.setItem(p,b?c.LIGHT:c.DARK),R()}}),j("div",{className:r(g.appContent,n&&g.pdfAppContent,!b&&g.lightAppContent),children:K})]})]})})})})}export{K as default};
@@ -1 +1 @@
1
- import{useState as e}from"react";import o from"prop-types";import{makeStyles as t,useTheme as r,AppBar as a,Toolbar as l,FormControlLabel as i,Checkbox as n,Tooltip as c,IconButton as s,Typography as p,Menu as m,MenuItem as d}from"@material-ui/core";import h from"@material-ui/icons/AccountCircle";import u from"@corva/ui/components/SwitchControl";import{FEATURE_FLAG_APPS_ISOLATION as g}from"@corva/ui/clients/clientStorage";import{LOCAL_STORAGE_PDF_REPORT_VIEW_KEY as f}from"@corva/ui/constants/localStorageKeys";import{isPDFReportView as v}from"@corva/ui/utils/reports";import C from"../../../../assets/DevCenterLogo.js";import{useAuth as b}from"../../../../context/auth.js";import{jsxs as w,jsx as B}from"react/jsx-runtime";const k=t((e=>({grow:{flexGrow:1},flex:{display:"flex"},appBar:{backgroundColor:"rgb(30, 31, 31)"},iconButtonRoot:{borderRadius:"unset"},userProfileIcon:{marginLeft:4},headerControl:{marginRight:32},formControlLabel:{fontSize:14}})));function S(o){var t,S;let{toggleTheme:L}=o;const A=k(),{user:I,logout:N}=b(),x=r(),[T,_]=e(null),z=Boolean(T),R=()=>_(null),y="".concat(null==I||null===(t=I.first_name)||void 0===t?void 0:t[0]).concat(null==I||null===(S=I.last_name)||void 0===S?void 0:S[0]).toUpperCase();return w("div",{children:[B(a,{position:"static",className:A.appBar,children:w(l,{children:[B(C,{}),B("div",{className:A.grow}),B(i,{control:B(n,{checked:"false"!==localStorage.getItem(g),size:"small",onChange:e=>{localStorage.setItem(g,e.target.checked),window.location.reload()}}),label:"App Isolation",classes:{label:A.formControlLabel},className:A.headerControl}),B(i,{control:B(n,{"data-testid":"".concat("AppBar","_pdfReport"),checked:v,size:"small",onChange:e=>{localStorage.setItem(f,e.target.checked),window.location.reload()}}),label:"PDF report view",classes:{label:A.formControlLabel},className:A.headerControl}),!v&&B(c,{title:"Switch to light theme to tune your app for PDF reports",placement:"bottom",children:B("div",{children:B(u,{"data-testid":"".concat("AppBar","_themeSwitch"),className:A.headerControl,leftLabel:"Dark Theme",rightLabel:"Light Theme",onChange:L,checked:x.isLightTheme,size:"small",title:""})})}),B("div",{children:B(s,{edge:"end","aria-label":"account of current user","aria-controls":"app-bar-menu","aria-haspopup":"true",onClick:e=>_(e.currentTarget),color:"inherit",className:A.iconButtonRoot,children:w("div",{className:A.flex,children:[B(p,{"data-testid":"".concat("AppBar","_userInitials"),children:y}),B(h,{className:A.userProfileIcon})]})})})]})}),B(m,{"data-testid":"".concat("AppBar","_userDropdown"),anchorEl:T,id:"app-bar-menu",keepMounted:!0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:z,onClose:R,children:B(d,{"data-testid":"".concat("AppBar","_signOutMenuItem"),onClick:()=>{N(),R()},children:"Sign Out"})})]})}S.propTypes={toggleTheme:o.func.isRequired};export{S as default};
1
+ import{useState as e}from"react";import o from"prop-types";import{makeStyles as r,useTheme as t,AppBar as a,Toolbar as l,FormControlLabel as i,Checkbox as n,Tooltip as c,IconButton as s,Typography as p,Menu as m,MenuItem as d}from"@material-ui/core";import h from"@material-ui/icons/AccountCircle";import u from"@corva/ui/components/SwitchControl";import{FEATURE_FLAG_APPS_ISOLATION as g}from"@corva/ui/clients/clientStorage";import{LOCAL_STORAGE_PDF_REPORT_VIEW_KEY as f}from"@corva/ui/constants/localStorageKeys";import{isPDFReportView as C}from"@corva/ui/utils/reports";import b from"../../../../assets/DevCenterLogo.js";import{useAuth as v}from"../../../../context/auth.js";import{jsxs as w,jsx as B}from"react/jsx-runtime";const k=r((e=>({grow:{flexGrow:1},flex:{display:"flex"},appBar:{backgroundColor:"rgb(30, 31, 31)"},iconButtonRoot:{borderRadius:"unset"},userProfileIcon:{marginLeft:4},headerControl:{marginRight:32},formControlLabel:{fontSize:14}})));function S({toggleTheme:o}){const r=k(),{user:S,logout:L}=v(),A=t(),[I,N]=e(null),x=Boolean(I),T=()=>N(null),_=`${S?.first_name?.[0]}${S?.last_name?.[0]}`.toUpperCase();return w("div",{children:[B(a,{position:"static",className:r.appBar,children:w(l,{children:[B(b,{}),B("div",{className:r.grow}),B(i,{control:B(n,{checked:"false"!==localStorage.getItem(g),size:"small",onChange:e=>{localStorage.setItem(g,e.target.checked),window.location.reload()}}),label:"App Isolation",classes:{label:r.formControlLabel},className:r.headerControl}),B(i,{control:B(n,{"data-testid":"AppBar_pdfReport",checked:C,size:"small",onChange:e=>{localStorage.setItem(f,e.target.checked),window.location.reload()}}),label:"PDF report view",classes:{label:r.formControlLabel},className:r.headerControl}),!C&&B(c,{title:"Switch to light theme to tune your app for PDF reports",placement:"bottom",children:B("div",{children:B(u,{"data-testid":"AppBar_themeSwitch",className:r.headerControl,leftLabel:"Dark Theme",rightLabel:"Light Theme",onChange:o,checked:A.isLightTheme,size:"small",title:""})})}),B("div",{children:B(s,{edge:"end","aria-label":"account of current user","aria-controls":"app-bar-menu","aria-haspopup":"true",onClick:e=>N(e.currentTarget),color:"inherit",className:r.iconButtonRoot,children:w("div",{className:r.flex,children:[B(p,{"data-testid":"AppBar_userInitials",children:_}),B(h,{className:r.userProfileIcon})]})})})]})}),B(m,{"data-testid":"AppBar_userDropdown",anchorEl:I,id:"app-bar-menu",keepMounted:!0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:x,onClose:T,children:B(d,{"data-testid":"AppBar_signOutMenuItem",onClick:()=>{L(),T()},children:"Sign Out"})})]})}S.propTypes={toggleTheme:o.func.isRequired};export{S as default};
@@ -1 +1 @@
1
- import{useState as t,useRef as n,useEffect as o}from"react";import{get as i}from"lodash";import*as s from"@corva/ui/clients/jsonApi";import{updateUserUnits as r}from"@corva/ui/utils/convert";import a from"../../../../clients/auth0/index.js";import{LOGIN_ROUTE_REG_EXP as e}from"../../../constants/index.js";import{ERRORS as c}from"./constants.js";import{getUserToken as m}from"./api.js";const u=t=>fetch("/dotenv",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});function l(l){const[p,d]=t(null),[f,y]=t(!0),[h,g]=t(null),v=n(null);async function C(){y(!0);const t=await s.getCurrentUser();t?(d(t),r({userUnits:t.unit_system,companyUnits:i(t,"company.unit_system"),companyCustomUnitSystem:i(t,"company.custom_unit_system"),userCustomUnitSystem:i(t,"custom_unit_system"),companyCustomUnits:i(t,"company.custom_units")})):l.push("/login"),y(!1)}v.current||(v.current=new a);return o((()=>{if(e.test(l.location.pathname))return y(!1);C()}),[l.location.pathname]),{user:p,loading:f,error:h,login:async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;g(null),y(!0);const i={auth:n};t&&(i.platform=t);try{const t=await m(i);u({AUTH_TOKEN:t.jwt}),C().then(o)}catch(t){var s,r;null!==(s=t.isInvalidVerificationCode)&&void 0!==s&&s.call(t)?g(c.invalidVerificationCode):null!==(r=t.isMissingVerificationCode)&&void 0!==r&&r.call(t)?g(c.missingVerificationCode):g(c.wrongEmailOrPassword)}y(!1)},logout:async()=>{u({AUTH_TOKEN:""}),await s.logout(),l.push("/login")},auth0:v.current}}export{l as default};
1
+ import{useState as t,useRef as n,useEffect as o}from"react";import{get as i}from"lodash";import*as s from"@corva/ui/clients/jsonApi";import{updateUserUnits as r}from"@corva/ui/utils/convert";import a from"../../../../clients/auth0/index.js";import{LOGIN_ROUTE_REG_EXP as e}from"../../../constants/index.js";import{ERRORS as c}from"./constants.js";import{getUserToken as m}from"./api.js";const u=t=>fetch("/dotenv",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});function l(l){const[p,f]=t(null),[y,d]=t(!0),[h,g]=t(null),C=n(null);async function _(){d(!0);const t=await s.getCurrentUser();t?(f(t),r({userUnits:t.unit_system,companyUnits:i(t,"company.unit_system"),companyCustomUnitSystem:i(t,"company.custom_unit_system"),userCustomUnitSystem:i(t,"custom_unit_system"),companyCustomUnits:i(t,"company.custom_units")})):l.push("/login"),d(!1)}C.current||(C.current=new a);return o((()=>{if(e.test(l.location.pathname))return d(!1);_()}),[l.location.pathname]),{user:p,loading:y,error:h,login:async(t="",n,o)=>{g(null),d(!0);const i={auth:n};t&&(i.platform=t);try{const t=await m(i);u({AUTH_TOKEN:t.jwt}),_().then(o)}catch(t){t.isInvalidVerificationCode?.()?g(c.invalidVerificationCode):t.isMissingVerificationCode?.()?g(c.missingVerificationCode):g(c.wrongEmailOrPassword)}d(!1)},logout:async()=>{u({AUTH_TOKEN:""}),await s.logout(),l.push("/login")},auth0:C.current}}export{l as default};
package/CLI/hocs/utils.js CHANGED
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import{DEFAULT_APP_SIZE as e}from"@corva/ui/constants/apps";function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function o(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?r(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function n(t){return JSON.parse(localStorage.getItem(t))||{}}function i(t,e){const r=n(t)||{};localStorage.setItem(t,JSON.stringify(o(o({},r),e)))}const c=t=>{var r,i,c,l;const p=null!==(r=null==t||null===(i=t.application)||void 0===i||null===(c=i.ui)||void 0===c?void 0:c.initial_size)&&void 0!==r?r:e;return n(null==t||null===(l=t.application)||void 0===l?void 0:l.key).coordinates||o(o({},p),{},{x:0,y:0})};export{c as getAppCoordinates,n as getLocalAppData,i as updateLocalAppData};
1
+ import{DEFAULT_APP_SIZE as t}from"@corva/ui/constants/apps";function o(t){return JSON.parse(localStorage.getItem(t))||{}}function i(t,i){const n=o(t)||{};localStorage.setItem(t,JSON.stringify({...n,...i}))}const n=i=>{const n=i?.application?.ui?.initial_size??t;return o(i?.application?.key).coordinates||{...n,x:0,y:0}};export{n as getAppCoordinates,o as getLocalAppData,i as updateLocalAppData};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/objectWithoutProperties";import{DEV_CENTER_CLI_APP_ID as r}from"@corva/ui/constants";import{getFeatureFlagAppsIsolation as o}from"@corva/ui/clients/clientStorage";import{AppsDataProvider as n,DevCenterIsolatedApp as p}from"@corva/ui/components";import{jsx as s}from"react/jsx-runtime";const i=["manifest","dashboardProps","coordinates"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function c(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?a(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}const m=o(),b=e=>{let{CLIAppComponent:o,CLIAppSettings:a,packageJson:b}=e;return e=>{let{manifest:f,dashboardProps:l,coordinates:u}=e,d=t(e,i);const O=f.application.key,{version:g}=b,y={app:{app_key:O,platform:"dev_center"},id:r,package:{manifest:f,build:"".concat(O,"-").concat(g),version:g},segment:f.application.segments,settings:d.settings};return s(n,{dashboardAssetId:l.assetId,apps:[y],children:s(p,c(c({},d),{},{isIsolationFeatureEnabled:m,app:y,coordinates:u,CLIAppComponent:o,CLIAppSettings:a}))})}};export{b as default};
1
+ import{DEV_CENTER_CLI_APP_ID as t}from"@corva/ui/constants";import{getFeatureFlagAppsIsolation as e}from"@corva/ui/clients/clientStorage";import{AppsDataProvider as o,DevCenterIsolatedApp as s}from"@corva/ui/components";import{jsx as a}from"react/jsx-runtime";const n=e(),p=({CLIAppComponent:e,CLIAppSettings:p,packageJson:i})=>({manifest:r,dashboardProps:c,coordinates:m,...d})=>{const l=r.application.key,{version:g}=i,f={app:{app_key:l,platform:"dev_center"},id:t,package:{manifest:r,build:`${l}-${g}`,version:g},segment:r.application.segments,settings:d.settings};return a(o,{dashboardAssetId:c.assetId,apps:[f],children:a(s,{...d,isIsolationFeatureEnabled:n,app:f,coordinates:m,CLIAppComponent:e,CLIAppSettings:p})})};export{p as default};
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import{useState as e}from"react";import{getLocalAppData as r,updateLocalAppData as n}from"./utils.js";import{useAuth as o}from"../context/auth.js";import{jsx as s}from"react/jsx-runtime";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?i(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const p=t=>i=>{const{user:p}=o(),f=i.manifest.application.key,[a,u]=e(r(f).settings||{});return s(t,c(c({},i),{},{currentUser:p,settings:a,onSettingChange:(t,e)=>{const r=c(c({},a||{}),{},{[t]:e});n(f,{settings:r}),u(r)},onSettingsChange:t=>{const e=c(c({},a||{}),t);n(f,{settings:e}),u(e)}}))};export{p as default};
1
+ import{useState as t}from"react";import{getLocalAppData as s,updateLocalAppData as e}from"./utils.js";import{useAuth as n}from"../context/auth.js";import{jsx as r}from"react/jsx-runtime";const o=o=>i=>{const{user:a}=n(),m=i.manifest.application.key,[c,g]=t(s(m).settings||{});return r(o,{...i,currentUser:a,settings:c,onSettingChange:(t,s)=>{const n={...c||{},[t]:s};e(m,{settings:n}),g(n)},onSettingsChange:t=>{const s={...c||{},...t};e(m,{settings:s}),g(s)}})};export{o as default};
@@ -1 +1 @@
1
- import*as o from"@corva/ui";import{ProvidePermissions as r}from"@corva/ui/permissions";import"@corva/ui/styles/index.global.css.js";import"@corva/ui/styles/reactVirtualized.global.css.js";import"@corva/ui/styles/emojiMart.global.css.js";import"@corva/ui/styles/mapbox.global.css.js";import"@corva/ui/styles/lightbox.global.css.js";import"@corva/ui/styles/generatedThemesVariables.global.css.js";import"@corva/ui/styles/customScrollbars.global.css.js";import{initGlobalDependencies as t}from"@corva/ui/config/initGlobalDependencies";import{isPDFReportView as s}from"@corva/ui/utils/reports";import i from"./withAppDataProviderHOC.js";import e from"./withCLIAppSettingsHOC.js";import a from"./withReactRouterHOC.js";import m from"./withGridLayoutHOC/withGridLayoutHOC.js";import p from"./withPDFLayoutHOC.js";import{withDevCenterRouterHOC as c}from"./withDevCenterRouterHOC.js";import{jsx as l}from"react/jsx-runtime";window["@corva/ui"]=o,t();const n=o=>{let{component:t,settings:n,manifest:u,packageJson:f}=o;return()=>{const o=e(i({CLIAppComponent:t,CLIAppSettings:n,packageJson:f})),g=s?p(o):m(o),j=a(c(g));return l(r,{children:l(j,{manifest:u,dashboardProps:{}})})}};export{n as default};
1
+ import*as o from"@corva/ui";import{ProvidePermissions as r}from"@corva/ui/permissions";import"@corva/ui/styles/index.global.css.js";import"@corva/ui/styles/reactVirtualized.global.css.js";import"@corva/ui/styles/emojiMart.global.css.js";import"@corva/ui/styles/mapbox.global.css.js";import"@corva/ui/styles/lightbox.global.css.js";import"@corva/ui/styles/generatedThemesVariables.global.css.js";import"@corva/ui/styles/customScrollbars.global.css.js";import{initGlobalDependencies as s}from"@corva/ui/config/initGlobalDependencies";import{isPDFReportView as t}from"@corva/ui/utils/reports";import i from"./withAppDataProviderHOC.js";import a from"./withCLIAppSettingsHOC.js";import e from"./withReactRouterHOC.js";import m from"./withGridLayoutHOC/withGridLayoutHOC.js";import p from"./withPDFLayoutHOC.js";import{withDevCenterRouterHOC as c}from"./withDevCenterRouterHOC.js";import{jsx as l}from"react/jsx-runtime";window["@corva/ui"]=o,s();const n=({component:o,settings:s,manifest:n,packageJson:u})=>()=>{const f=a(i({CLIAppComponent:o,CLIAppSettings:s,packageJson:u})),g=t?p(f):m(f),j=e(c(g));return l(r,{children:l(j,{manifest:n,dashboardProps:{}})})};export{n as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{useMemo as t}from"react";import{createDevCenterRouter as o}from"../../utils/devcenter.js";import"../../utils/recaptcha.js";import{jsx as n}from"react/jsx-runtime";const c=["router"];function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function p(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}const s=e=>i=>{let{router:s}=i,u=r(i,c);const b=t((()=>o(s)),[s.location]);return n(e,p(p({},u),{},{devCenterRouter:b}))};export{s as default,s as withDevCenterRouterHOC};
1
+ import{useMemo as t}from"react";import{createDevCenterRouter as r}from"../../utils/devcenter.js";import"../../utils/recaptcha.js";import{jsx as e}from"react/jsx-runtime";const o=o=>({router:c,...i})=>{const m=t((()=>r(c)),[c.location]);return e(o,{...i,devCenterRouter:m})};export{o as default,o as withDevCenterRouterHOC};
@@ -1 +1 @@
1
- import o from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import{useState as t}from"react";import{WidthProvider as r,Responsive as i}from"react-grid-layout";import{pick as n,cloneDeep as s}from"lodash";import{withSize as p}from"react-sizeme";import{isPhoneDetected as a,isNativeDetected as m,isMobileDetected as c}from"@corva/ui/utils/mobileDetect";import{getAppSize as l}from"@corva/ui/utils/apps";import{GRID_BREAKPOINTS as d,GRID_COLUMN_SIZES as g,GRID_ROW_HEIGHT as u,NON_DRAGGABLE_ELEMENT_SELECTOR as f}from"@corva/ui/constants/apps";import"../../../components/Login/components/Chip.js";import"../../../components/Login/components/EmailField.js";import"../../../components/Login/components/HiddenEmailField.js";import"../../../components/Login/components/Login.js";import"../../../components/Login/components/OrDivider.js";import"../../../components/Login/components/PasswordField.js";import"../../../components/Login/components/Step.js";import"../../../components/Login/components/StepContent.js";import"../../../components/Login/components/StepFooter.js";import"../../../components/Login/components/StepHeader.js";import"../../../components/Login/components/VerificationStep.js";import{AppsGridDragHandle as b}from"../../../components/AppsGridDragHandle/AppsGridDragHandle.js";import j from"../../../components/GridLockButton/index.js";import{isAppMaximized as h}from"../../../utils/devcenter.js";import"../../../utils/recaptcha.js";import{getLocalAppData as y,getAppCoordinates as O,updateLocalAppData as L}from"../utils.js";import"./withGridLayoutHOC.global.css.js";import D from"./withGridLayoutHOC.css.js";import{jsxs as v,jsx as w}from"react/jsx-runtime";const S=["size"];function P(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),t.push.apply(t,r)}return t}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}))}return e}const x=".".concat(b.GRID_LAYOUT_DRAG_HANDLE_CLASS),C=r(i),z=o=>p()((r=>{var i;let{size:p}=r,P=e(r,S);const z=p.width,A=P.manifest.application.key,[G,R]=t(null!==(i=y(A).isDraggable)&&void 0!==i&&i),E=m||c,k=h(P.devCenterRouter.location.query),[F,M]=t(O(P.manifest)),{pixelHeight:W,pixelWidth:_}=l({coordinates:F,dashboardWidth:z,isMaximized:k}),N=o=>{let[e]=o;const t=n(e,["x","y","w","h"]);M(t),L(A,{coordinates:t})},[B,T]=t({});return v("div",{children:[w(C,{breakpoints:a?d.phone:d.general,cols:g,rowHeight:u,measureBeforeMount:!0,onResizeStop:N,onDragStop:N,isDraggable:!E&&G,isResizable:!E&&G,draggableCancel:f,useCSSTransforms:!1,draggableHandle:x,onLayoutChange:(o,e)=>{o===e.small?T(e):T(H(H({},B),{},{medium:s(o),large:s(o)}))},layouts:B,children:w("div",{"data-grid":F,children:v("div",{className:k?D.appMaximized:"",children:[w(o,H(H({},P),{},{coordinates:H(H({},F),{},{pixelHeight:W,pixelWidth:_}),layoutEnvironment:{type:"general",pdfReportMode:!1}})),!E&&G&&w(b,{})]})},"with-grid-layout-hoc")}),w(j,{isDraggableAndResizable:G,onClick:()=>{R(!G),L(A,{isDraggable:!G})},pageName:"DashboardPo"})]})}));export{z as default};
1
+ import{useState as o}from"react";import{WidthProvider as e,Responsive as i}from"react-grid-layout";import{pick as t,cloneDeep as n}from"lodash";import{withSize as r}from"react-sizeme";import{isPhoneDetected as s,isNativeDetected as p,isMobileDetected as m}from"@corva/ui/utils/mobileDetect";import{getAppSize as a}from"@corva/ui/utils/apps";import{GRID_BREAKPOINTS as c,GRID_COLUMN_SIZES as d,GRID_ROW_HEIGHT as l,NON_DRAGGABLE_ELEMENT_SELECTOR as g}from"@corva/ui/constants/apps";import"../../../components/Login/components/Chip.js";import"../../../components/Login/components/EmailField.js";import"../../../components/Login/components/HiddenEmailField.js";import"../../../components/Login/components/Login.js";import"../../../components/Login/components/OrDivider.js";import"../../../components/Login/components/PasswordField.js";import"../../../components/Login/components/Step.js";import"../../../components/Login/components/StepContent.js";import"../../../components/Login/components/StepFooter.js";import"../../../components/Login/components/StepHeader.js";import"../../../components/Login/components/VerificationStep.js";import{AppsGridDragHandle as u}from"../../../components/AppsGridDragHandle/AppsGridDragHandle.js";import h from"../../../components/GridLockButton/index.js";import{isAppMaximized as f}from"../../../utils/devcenter.js";import"../../../utils/recaptcha.js";import{getLocalAppData as j,getAppCoordinates as L,updateLocalAppData as b}from"../utils.js";import"./withGridLayoutHOC.global.css.js";import D from"./withGridLayoutHOC.css.js";import{jsxs as y,jsx as H}from"react/jsx-runtime";const S=`.${u.GRID_LAYOUT_DRAG_HANDLE_CLASS}`,v=e(i),x=e=>r()((({size:i,...r})=>{const x=i.width,C=r.manifest.application.key,[w,z]=o(j(C).isDraggable??!1),A=p||m,G=f(r.devCenterRouter.location.query),[R,k]=o(L(r.manifest)),{pixelHeight:E,pixelWidth:F}=a({coordinates:R,dashboardWidth:x,isMaximized:G}),M=([o])=>{const e=t(o,["x","y","w","h"]);k(e),b(C,{coordinates:e})},[O,_]=o({});return y("div",{children:[H(v,{breakpoints:s?c.phone:c.general,cols:d,rowHeight:l,measureBeforeMount:!0,onResizeStop:M,onDragStop:M,isDraggable:!A&&w,isResizable:!A&&w,draggableCancel:g,useCSSTransforms:!1,draggableHandle:S,onLayoutChange:(o,e)=>{o===e.small?_(e):_({...O,medium:n(o),large:n(o)})},layouts:O,children:H("div",{"data-grid":R,children:y("div",{className:G?D.appMaximized:"",children:[H(e,{...r,coordinates:{...R,pixelHeight:E,pixelWidth:F},layoutEnvironment:{type:"general",pdfReportMode:!1}}),!A&&w&&H(u,{})]})},"with-grid-layout-hoc")}),H(h,{isDraggableAndResizable:w,onClick:()=>{z(!w),b(C,{isDraggable:!w})},pageName:"DashboardPo"})]})}));export{x as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{makeStyles as r}from"@material-ui/core";import{getAppType as t,getPDFAppPixelSize as o}from"@corva/ui/utils/dashboardReports";import{getAppCoordinates as i}from"./utils.js";import{jsx as n}from"react/jsx-runtime";function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function c(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?p(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}const a=r({page:{backgroundColor:"#fff",width:"21cm",height:"29.7cm",margin:"auto",overflow:"hidden",position:"relative",pageBreakAfter:"always",boxShadow:"#ccc 0px 1px 3px 0px, #ccc 0px 0px 0px 1px",paddingTop:2},pdfReportApp:{display:"inline-block",overflow:"hidden",position:"relative",zoom:"0.5",margin:"0 0.1cm",pointerEvents:"none"}}),l=e=>r=>{var p;const l=a(),s=i(r.manifest),f=!(null===(p=r.manifest.application.ui)||void 0===p||!p.full_screen_report),d=t({coordinates:s,isFullScreenReport:f});return n("div",{className:l.page,children:n("div",{className:l.pdfReportApp,style:{width:"".concat(d.width,"cm"),height:"".concat(d.height,"cm")},children:n(e,c(c({},r),{},{coordinates:c(c({},s),o(d)),layoutEnvironment:{type:"general",pdfReportMode:!0}}))})})};export{l as default};
1
+ import{makeStyles as e}from"@material-ui/core";import{getAppType as o,getPDFAppPixelSize as i}from"@corva/ui/utils/dashboardReports";import{getAppCoordinates as r}from"./utils.js";import{jsx as t}from"react/jsx-runtime";const p=e({page:{backgroundColor:"#fff",width:"21cm",height:"29.7cm",margin:"auto",overflow:"hidden",position:"relative",pageBreakAfter:"always",boxShadow:"#ccc 0px 1px 3px 0px, #ccc 0px 0px 0px 1px",paddingTop:2},pdfReportApp:{display:"inline-block",overflow:"hidden",position:"relative",zoom:"0.5",margin:"0 0.1cm",pointerEvents:"none"}}),a=e=>a=>{const n=p(),c=r(a.manifest),d=!!a.manifest.application.ui?.full_screen_report,l=o({coordinates:c,isFullScreenReport:d});return t("div",{className:n.page,children:t("div",{className:n.pdfReportApp,style:{width:`${l.width}cm`,height:`${l.height}cm`},children:t(e,{...a,coordinates:{...c,...i(l)},layoutEnvironment:{type:"general",pdfReportMode:!0}})})})};export{a as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import{useMemo as e}from"react";import{BrowserRouter as t,useHistory as o,useLocation as n,Switch as c,Redirect as p,Route as a}from"react-router-dom";import{LoadingIndicator as i}from"@corva/ui/components";import s from"../screens/LoginScreen/LoginScreen.js";import u from"../screens/OAuthCallbackScreen/index.js";import{useAuth as m}from"../context/auth.js";import l from"../components/App/App.js";import{jsx as f,jsxs as h}from"react/jsx-runtime";function b(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,o)}return t}function O(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?b(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}function d(r){const e=new URLSearchParams(r),t={};return e.forEach(((r,e)=>{t[e]=r})),t}function j(r){let{WrappedComponent:e,componentProps:t,router:o,location:n}=r;const{loading:c}=m();return c?f(i,{fullscreen:!0}):f(e,O({location:n,router:o},t))}function y(r){let{WrappedComponent:t,componentProps:i}=r;const m=o(),b=n(),y=e((()=>function(r,e){const t=r=>{if("string"==typeof r)return r;const{pathname:e,query:t}=r;return{pathname:e,search:t?"?".concat(new URLSearchParams(t).toString()):""}};return{push:e=>r.push(t(e)),replace:e=>r.replace(t(e)),location:O(O({},e),{},{query:d(e.search)})}}(m,b)),[m,b]);return f(l,{router:y,children:h(c,{children:[f(p,{exact:!0,from:"/",to:"/app"}),f(a,{path:"/login/oauth-callback",children:f(u,{router:y})}),f(a,{path:"/login",children:f(s,{router:y,location:y.location})}),f(a,{path:"/app",children:f(j,{WrappedComponent:t,componentProps:i,router:y,location:y.location})})]})})}const P=r=>e=>f(t,{children:f(y,{WrappedComponent:r,componentProps:e})});export{P as default};
1
+ import{useMemo as o}from"react";import{BrowserRouter as r,useHistory as n,useLocation as t,Switch as e,Redirect as c,Route as p}from"react-router-dom";import{LoadingIndicator as a}from"@corva/ui/components";import i from"../screens/LoginScreen/LoginScreen.js";import m from"../screens/OAuthCallbackScreen/index.js";import{useAuth as s}from"../context/auth.js";import u from"../components/App/App.js";import{jsx as l,jsxs as h}from"react/jsx-runtime";function f(o){const r=new URLSearchParams(o),n={};return r.forEach(((o,r)=>{n[r]=o})),n}function d({WrappedComponent:o,componentProps:r,router:n,location:t}){const{loading:e}=s();return e?l(a,{fullscreen:!0}):l(o,{location:t,router:n,...r})}function g({WrappedComponent:r,componentProps:a}){const s=n(),g=t(),P=o((()=>function(o,r){const n=o=>{if("string"==typeof o)return o;const{pathname:r,query:n}=o;return{pathname:r,search:n?`?${new URLSearchParams(n).toString()}`:""}};return{push:r=>o.push(n(r)),replace:r=>o.replace(n(r)),location:{...r,query:f(r.search)}}}(s,g)),[s,g]);return l(u,{router:P,children:h(e,{children:[l(c,{exact:!0,from:"/",to:"/app"}),l(p,{path:"/login/oauth-callback",children:l(m,{router:P})}),l(p,{path:"/login",children:l(i,{router:P,location:P.location})}),l(p,{path:"/app",children:l(d,{WrappedComponent:r,componentProps:a,router:P,location:P.location})})]})})}const P=o=>n=>l(r,{children:l(g,{WrappedComponent:o,componentProps:n})});export{P as default};
@@ -1 +1 @@
1
- import{useEffect as o}from"react";import{getCurrentUser as n}from"@corva/ui/clients/jsonApi";import"../../../components/Login/components/Chip.js";import"../../../components/Login/components/EmailField.js";import"../../../components/Login/components/HiddenEmailField.js";import t from"../../../components/Login/components/Login.js";import"../../../components/Login/components/OrDivider.js";import"../../../components/Login/components/PasswordField.js";import"../../../components/Login/components/Step.js";import"../../../components/Login/components/StepContent.js";import"../../../components/Login/components/StepFooter.js";import"../../../components/Login/components/StepHeader.js";import"../../../components/Login/components/VerificationStep.js";import e from"./components/Auth.js";import i from"./components/IconLogo.js";import m from"./LoginScreen.css.js";import{jsx as p}from"react/jsx-runtime";function s(s){let{router:r,location:c}=s;return o((()=>{!async function(){let o=null;try{o=await n()}catch(o){console.error(o)}o&&r.replace("/")}()}),[]),p("div",{className:m.loginScreen,children:p(t,{location:c,logoIcon:p(i,{}),promoLink:"https://youtu.be/-q6LkceqpGs",children:p(e,{router:r})})})}export{s as default};
1
+ import{useEffect as o}from"react";import{getCurrentUser as n}from"@corva/ui/clients/jsonApi";import"../../../components/Login/components/Chip.js";import"../../../components/Login/components/EmailField.js";import"../../../components/Login/components/HiddenEmailField.js";import t from"../../../components/Login/components/Login.js";import"../../../components/Login/components/OrDivider.js";import"../../../components/Login/components/PasswordField.js";import"../../../components/Login/components/Step.js";import"../../../components/Login/components/StepContent.js";import"../../../components/Login/components/StepFooter.js";import"../../../components/Login/components/StepHeader.js";import"../../../components/Login/components/VerificationStep.js";import e from"./components/Auth.js";import i from"./components/IconLogo.js";import m from"./LoginScreen.css.js";import{jsx as p}from"react/jsx-runtime";function s({router:s,location:r}){return o((()=>{!async function(){let o=null;try{o=await n()}catch(o){console.error(o)}o&&s.replace("/")}()}),[]),p("div",{className:m.loginScreen,children:p(t,{location:r,logoIcon:p(i,{}),promoLink:"https://youtu.be/-q6LkceqpGs",children:p(e,{router:s})})})}export{s as default};
@@ -1 +1 @@
1
- import{useState as e}from"react";import t from"./EmailStep.js";import s from"./AuthStep.js";import{jsx as i}from"react/jsx-runtime";function m(m){let{router:a}=m;const[o,r]=e({email:null,schemas:{},step:0});return 0===o.step?i(t,{onNext:(e,t)=>r((s=>({step:s.step+1,email:e,schemas:t})))}):i(s,{email:o.email,schemas:o.schemas.schemas,identityVerification:o.schemas.identity_verification,onBack:()=>r((e=>({step:e.step-1,email:null,schemas:null}))),onFinishLogin:()=>a.push("/")})}export{m as default};
1
+ import{useState as e}from"react";import t from"./EmailStep.js";import s from"./AuthStep.js";import{jsx as i}from"react/jsx-runtime";function m({router:m}){const[a,o]=e({email:null,schemas:{},step:0});return 0===a.step?i(t,{onNext:(e,t)=>o((s=>({step:s.step+1,email:e,schemas:t})))}):i(s,{email:a.email,schemas:a.schemas.schemas,identityVerification:a.schemas.identity_verification,onBack:()=>o((e=>({step:e.step-1,email:null,schemas:null}))),onFinishLogin:()=>m.push("/")})}export{m as default};
@@ -1 +1 @@
1
- import{memo as o,useState as n,useRef as e,useEffect as i}from"react";import{styled as t,Grid as r,Button as c}from"@material-ui/core";import{showErrorNotification as a}from"@corva/ui/utils";import{isSSOPlatformSupported as m}from"@corva/ui/clients/sso";import{initializeRecaptcha as s,GOOGLE_RECAPTCHA_KEY as p}from"../../../../utils/recaptcha.js";import l from"../../../../components/Login/components/Chip.js";import"../../../../components/Login/components/EmailField.js";import d from"../../../../components/Login/components/HiddenEmailField.js";import"../../../../components/Login/components/Login.js";import f from"../../../../components/Login/components/OrDivider.js";import u from"../../../../components/Login/components/PasswordField.js";import g from"../../../../components/Login/components/Step.js";import h from"../../../../components/Login/components/StepContent.js";import v from"../../../../components/Login/components/StepFooter.js";import j from"../../../../components/Login/components/StepHeader.js";import{VerificationStep as w}from"../../../../components/Login/components/VerificationStep.js";import{useAuth as L}from"../../../context/auth.js";import{NEED_HELP_EXTERNAL_LINK as S}from"../../../constants/index.js";import{ERRORS as C}from"../../../hocs/effects/useProvideAuth/constants.js";import{requestVerification as b}from"../../../hocs/effects/useProvideAuth/api.js";import y from"./SSOButton.js";import{jsx as k,jsxs as B}from"react/jsx-runtime";const P=t(r)((o=>{let{theme:n}=o;return{marginTop:2*n.spacing(1),marginBottom:2*n.spacing(1),"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0}}})),_=t(c)((o=>{let{theme:n}=o;return{width:71,padding:n.spacing(),whiteSpace:"nowrap",backgroundColor:n.status.loginButton,"&:hover":{backgroundColor:"".concat(n.status.loginButtonHovered)}}}));var x=o((function(o){let{email:t,schemas:c,onBack:x,onFinishLogin:F,identityVerification:V}=o;const E=L(),[H,A]=n(""),[I,O]=n(!1),[T,z]=n({code:null,mode:null}),D=e(null),q=I&&E.error===C.wrongEmailOrPassword?E.error:null;i((()=>{s()}),[]);const M=o=>{if(!o)return a("Problem with initializing recaptcha");D.current=o;const n={email:t,password:H,recaptcha_token:o};T.code&&(n.verification_code=T.code,n.verification_mode=T.mode),E.login(null,n,F).then((()=>O(!0)))},G=async o=>{if(o.preventDefault(),!window.grecaptcha)return M();let n=!1;return window.grecaptcha.enterprise.ready((()=>{n=!0;try{window.grecaptcha.enterprise.execute(p,{action:"login"}).then(M).catch(console.error)}catch(o){console.error(o),a(o.message)}})),setTimeout((()=>{n||M()}),1e3)};i((()=>{if(!T.code)return;const o={email:t,password:H,recaptcha_token:D.current};T.code&&(o.verification_code=T.code,o.verification_mode=T.mode),E.login(null,o,F)}),[T.code]);const J=c.find((o=>"password"===o.provider)),K=c.filter((o=>{var n;return"password"!==o.provider&&m(null==o||null===(n=o.platform)||void 0===n?void 0:n.identifier)}));return I&&null!=V&&V.enabled&&!q?k(w,{email:t,identityVerification:V,loginVerificationFailure:E.error===C.invalidVerificationCode,onCodeProvided:z,password:H,requestVerification:b}):B(g,{children:[k(j,{children:"Sign In"}),k(h,{children:B(r,{container:!0,direction:"column",children:[k(l,{"data-not-migrated-MuiChip":!0,label:t,onClick:x}),K.map((o=>k(P,{item:!0,children:k(y,{title:o.title,provider:o.provider,connection:o.connection,platform:o.platform})},o.title))),J&&K.length>0&&k(r,{item:!0,children:k(f,{})}),J&&k(P,{item:!0,children:B("form",{id:"sign-in-form",onSubmit:G,children:[k(d,{email:t}),k(u,{value:H,onChange:o=>{A(o.target.value),O(!1)},disabled:E.loading,error:q})]})})]})}),k(v,{needHelpExternalLink:S,children:J&&k(_,{"data-testid":"".concat("AuthorizationPo","_signInButton"),form:"sign-in-form",type:"submit",variant:"contained",color:"primary",disabled:!H||E.loading||!!q,onClick:G,children:"Sign In"})})]})}));export{x as default};
1
+ import{memo as o,useState as e,useRef as n,useEffect as i}from"react";import{styled as t,Grid as r,Button as c}from"@material-ui/core";import{showErrorNotification as m}from"@corva/ui/utils";import{isSSOPlatformSupported as a}from"@corva/ui/clients/sso";import{initializeRecaptcha as s,GOOGLE_RECAPTCHA_KEY as p}from"../../../../utils/recaptcha.js";import d from"../../../../components/Login/components/Chip.js";import"../../../../components/Login/components/EmailField.js";import l from"../../../../components/Login/components/HiddenEmailField.js";import"../../../../components/Login/components/Login.js";import f from"../../../../components/Login/components/OrDivider.js";import g from"../../../../components/Login/components/PasswordField.js";import u from"../../../../components/Login/components/Step.js";import h from"../../../../components/Login/components/StepContent.js";import v from"../../../../components/Login/components/StepFooter.js";import j from"../../../../components/Login/components/StepHeader.js";import{VerificationStep as w}from"../../../../components/Login/components/VerificationStep.js";import{useAuth as L}from"../../../context/auth.js";import{NEED_HELP_EXTERNAL_LINK as S}from"../../../constants/index.js";import{ERRORS as C}from"../../../hocs/effects/useProvideAuth/constants.js";import{requestVerification as b}from"../../../hocs/effects/useProvideAuth/api.js";import y from"./SSOButton.js";import{jsx as k,jsxs as B}from"react/jsx-runtime";const P=t(r)((({theme:o})=>({marginTop:2*o.spacing(1),marginBottom:2*o.spacing(1),"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0}}))),_=t(c)((({theme:o})=>({width:71,padding:o.spacing(),whiteSpace:"nowrap",backgroundColor:o.status.loginButton,"&:hover":{backgroundColor:`${o.status.loginButtonHovered}`}})));var x=o((function({email:o,schemas:t,onBack:c,onFinishLogin:x,identityVerification:F}){const V=L(),[E,H]=e(""),[A,I]=e(!1),[O,T]=e({code:null,mode:null}),z=n(null),D=A&&V.error===C.wrongEmailOrPassword?V.error:null;i((()=>{s()}),[]);const q=e=>{if(!e)return m("Problem with initializing recaptcha");z.current=e;const n={email:o,password:E,recaptcha_token:e};O.code&&(n.verification_code=O.code,n.verification_mode=O.mode),V.login(null,n,x).then((()=>I(!0)))},M=async o=>{if(o.preventDefault(),!window.grecaptcha)return q();let e=!1;return window.grecaptcha.enterprise.ready((()=>{e=!0;try{window.grecaptcha.enterprise.execute(p,{action:"login"}).then(q).catch(console.error)}catch(o){console.error(o),m(o.message)}})),setTimeout((()=>{e||q()}),1e3)};i((()=>{if(!O.code)return;const e={email:o,password:E,recaptcha_token:z.current};O.code&&(e.verification_code=O.code,e.verification_mode=O.mode),V.login(null,e,x)}),[O.code]);const $=t.find((o=>"password"===o.provider)),G=t.filter((o=>"password"!==o.provider&&a(o?.platform?.identifier)));return A&&F?.enabled&&!D?k(w,{email:o,identityVerification:F,loginVerificationFailure:V.error===C.invalidVerificationCode,onCodeProvided:T,password:E,requestVerification:b}):B(u,{children:[k(j,{children:"Sign In"}),k(h,{children:B(r,{container:!0,direction:"column",children:[k(d,{"data-not-migrated-MuiChip":!0,label:o,onClick:c}),G.map((o=>k(P,{item:!0,children:k(y,{title:o.title,provider:o.provider,connection:o.connection,platform:o.platform})},o.title))),$&&G.length>0&&k(r,{item:!0,children:k(f,{})}),$&&k(P,{item:!0,children:B("form",{id:"sign-in-form",onSubmit:M,children:[k(l,{email:o}),k(g,{value:E,onChange:o=>{H(o.target.value),I(!1)},disabled:V.loading,error:D})]})})]})}),k(v,{needHelpExternalLink:S,children:$&&k(_,{"data-testid":"AuthorizationPo_signInButton",form:"sign-in-form",type:"submit",variant:"contained",color:"primary",disabled:!E||V.loading||!!D,onClick:M,children:"Sign In"})})]})}));export{x as default};
@@ -1 +1 @@
1
- import{memo as o,useState as n}from"react";import{styled as t}from"@material-ui/core/styles";import e from"@material-ui/core/Button";import{getUserAuthSchemas as i}from"@corva/ui/clients/jsonApi";import"../../../../components/Login/components/Chip.js";import r from"../../../../components/Login/components/EmailField.js";import"../../../../components/Login/components/HiddenEmailField.js";import"../../../../components/Login/components/Login.js";import"../../../../components/Login/components/OrDivider.js";import"../../../../components/Login/components/PasswordField.js";import m from"../../../../components/Login/components/Step.js";import p from"../../../../components/Login/components/StepContent.js";import s from"../../../../components/Login/components/StepFooter.js";import c from"../../../../components/Login/components/StepHeader.js";import"../../../../components/Login/components/VerificationStep.js";import{NEED_HELP_EXTERNAL_LINK as a}from"../../../constants/index.js";import{jsxs as l,jsx as d}from"react/jsx-runtime";const u=t(e)((o=>{let{theme:n}=o;return{width:71,padding:n.spacing(),backgroundColor:n.status.loginButton,"&:hover":{backgroundColor:"".concat(n.status.loginButtonHovered)}}}));var f=o((function(o){let{onNext:t}=o;const[e,f]=n(!1),[g,h]=n(null),[j,L]=n(""),v=o=>{if(o.preventDefault(),!j)return h("Required");f(!0),i({email:j,with_provider:!0}).then((o=>t(j,o))).catch((()=>h("Invalid email"))).finally((()=>f(!1)))};return l(m,{children:[d(c,{children:"Sign In"}),d(p,{children:d("form",{id:"email-form",onSubmit:v,autoComplete:"on",children:d(r,{value:j,onChange:o=>{L(o.target.value),h(null)},disabled:!!e,error:g})})}),d(s,{needHelpExternalLink:a,children:d(u,{"data-testid":"EmailPo_nextButton",form:"email-form",type:"submit",variant:"contained",color:"primary",disabled:e||!!g,onClick:v,children:"Next"})})]})}));export{f as default};
1
+ import{memo as o,useState as n}from"react";import{styled as t}from"@material-ui/core/styles";import e from"@material-ui/core/Button";import{getUserAuthSchemas as i}from"@corva/ui/clients/jsonApi";import"../../../../components/Login/components/Chip.js";import r from"../../../../components/Login/components/EmailField.js";import"../../../../components/Login/components/HiddenEmailField.js";import"../../../../components/Login/components/Login.js";import"../../../../components/Login/components/OrDivider.js";import"../../../../components/Login/components/PasswordField.js";import m from"../../../../components/Login/components/Step.js";import p from"../../../../components/Login/components/StepContent.js";import s from"../../../../components/Login/components/StepFooter.js";import c from"../../../../components/Login/components/StepHeader.js";import"../../../../components/Login/components/VerificationStep.js";import{NEED_HELP_EXTERNAL_LINK as a}from"../../../constants/index.js";import{jsxs as l,jsx as d}from"react/jsx-runtime";const u=t(e)((({theme:o})=>({width:71,padding:o.spacing(),backgroundColor:o.status.loginButton,"&:hover":{backgroundColor:`${o.status.loginButtonHovered}`}})));var f=o((function({onNext:o}){const[t,e]=n(!1),[f,g]=n(null),[h,j]=n(""),L=n=>{if(n.preventDefault(),!h)return g("Required");e(!0),i({email:h,with_provider:!0}).then((n=>o(h,n))).catch((()=>g("Invalid email"))).finally((()=>e(!1)))};return l(m,{children:[d(c,{children:"Sign In"}),d(p,{children:d("form",{id:"email-form",onSubmit:L,autoComplete:"on",children:d(r,{value:h,onChange:o=>{j(o.target.value),g(null)},disabled:!!t,error:f})})}),d(s,{needHelpExternalLink:a,children:d(u,{"data-testid":"EmailPo_nextButton",form:"email-form",type:"submit",variant:"contained",color:"primary",disabled:t||!!f,onClick:L,children:"Next"})})]})}));export{f as default};
@@ -1 +1 @@
1
- import{useState as t}from"react";import{withStyles as e,ButtonBase as o,Grid as r,Avatar as i,Typography as a,CircularProgress as n}from"@material-ui/core";import{getSSOProvider as s}from"@corva/ui/clients/sso";import{jsx as l,jsxs as c}from"react/jsx-runtime";const d={google:"/static/media/55de612562c712e3a9d6ea86000e18c7.svg",microsoft:"/static/media/319d9b9a39d511547cf55d1336a8eca4.svg"};var f=e((t=>({button:{width:"100%",height:56,fontSize:16,fontWeight:400,color:"#fff",display:"inline-flex",padding:0,alignItems:"center",justifyContent:"flex-start",whiteSpace:"nowrap",borderRadius:4,borderWidth:1,borderStyle:"solid",borderColor:"#616161",textDecoration:"none","&:hover":{borderColor:t.status.loginButton}},logo:{height:30,width:30,margin:12},avatar:{height:30,width:30,margin:12,color:"#ffffff",backgroundColor:t.status.loginButton},progressRoot:{margin:"12px 24px"},progressColor:{color:t.status.loginButton}})))((function(e){let{platform:f,connection:m,title:g,provider:h,classes:p}=e;const[u,b]=t(!1),v=d[h];return l(o,{className:p.button,onClick:t=>{if(t.preventDefault(),!u){b(!0),localStorage.setItem("ssoPlatform",f.identifier);const t=s(f.identifier);t.configure(f.options),t.authorize(m)}},children:c(r,{container:!0,justify:"space-between",alignItems:"center",children:[l(r,{item:!0,children:c(r,{container:!0,justify:"flex-start",alignItems:"center",children:[l(r,{item:!0,children:v?l("img",{className:p.logo,src:v,alt:g}):l(i,{className:p.avatar,children:g&&g[0].toUpperCase()})}),l(r,{item:!0,children:l(a,{variant:"body2",children:g})})]})}),l(r,{item:!0,children:u&&l(n,{classes:{root:p.progressRoot,colorPrimary:p.progressColor},color:"primary",size:30})})]})})}));export{f as default};
1
+ import{useState as t}from"react";import{withStyles as e,ButtonBase as o,Grid as r,Avatar as i,Typography as a,CircularProgress as n}from"@material-ui/core";import{getSSOProvider as s}from"@corva/ui/clients/sso";import{jsx as l,jsxs as c}from"react/jsx-runtime";const d={google:"/static/media/55de612562c712e3a9d6ea86000e18c7.svg",microsoft:"/static/media/319d9b9a39d511547cf55d1336a8eca4.svg"};var f=e((t=>({button:{width:"100%",height:56,fontSize:16,fontWeight:400,color:"#fff",display:"inline-flex",padding:0,alignItems:"center",justifyContent:"flex-start",whiteSpace:"nowrap",borderRadius:4,borderWidth:1,borderStyle:"solid",borderColor:"#616161",textDecoration:"none","&:hover":{borderColor:t.status.loginButton}},logo:{height:30,width:30,margin:12},avatar:{height:30,width:30,margin:12,color:"#ffffff",backgroundColor:t.status.loginButton},progressRoot:{margin:"12px 24px"},progressColor:{color:t.status.loginButton}})))((function({platform:e,connection:f,title:m,provider:g,classes:h}){const[p,u]=t(!1),b=d[g];return l(o,{className:h.button,onClick:t=>{if(t.preventDefault(),!p){u(!0),localStorage.setItem("ssoPlatform",e.identifier);const t=s(e.identifier);t.configure(e.options),t.authorize(f)}},children:c(r,{container:!0,justify:"space-between",alignItems:"center",children:[l(r,{item:!0,children:c(r,{container:!0,justify:"flex-start",alignItems:"center",children:[l(r,{item:!0,children:b?l("img",{className:h.logo,src:b,alt:m}):l(i,{className:h.avatar,children:m&&m[0].toUpperCase()})}),l(r,{item:!0,children:l(a,{variant:"body2",children:m})})]})}),l(r,{item:!0,children:p&&l(n,{classes:{root:h.progressRoot,colorPrimary:h.progressColor},color:"primary",size:30})})]})})}));export{f as default};
@@ -1 +1 @@
1
- import{useEffect as o}from"react";import{LoadingIndicator as t}from"@corva/ui/components";import{showErrorNotification as r}from"@corva/ui/utils";import{getUserAuthPlatform as e}from"@corva/ui/clients/jsonApi";import{getSSOProvider as i}from"@corva/ui/clients/sso";import{useAuth as n}from"../../context/auth.js";import{jsx as a}from"react/jsx-runtime";function c(c){let{router:s}=c;const{login:u}=n(),m=o=>{console.error(o),r("Sorry, but we couldn’t log you in. Please contact Corva support if you need assistance"),s.push("/login")},f=async()=>{const o=localStorage.getItem("ssoPlatform");localStorage.removeItem("ssoPlatform");const{platform:t}=await e(o),r=i(t.identifier);if(!r)return m("No authentication platform found for ".concat(t.identifier));try{r.configure(t.options);const o=await r.authenticate();return((o,t)=>{u(o,{token:t},(()=>s.push("/")))})(t.identifier,o)}catch(o){return m(o)}};return o((()=>{f()}),[]),a(t,{fullscreen:!1})}export{c as default};
1
+ import{useEffect as o}from"react";import{LoadingIndicator as t}from"@corva/ui/components";import{showErrorNotification as r}from"@corva/ui/utils";import{getUserAuthPlatform as e}from"@corva/ui/clients/jsonApi";import{getSSOProvider as i}from"@corva/ui/clients/sso";import{useAuth as n}from"../../context/auth.js";import{jsx as a}from"react/jsx-runtime";function c({router:c}){const{login:s}=n(),u=o=>{console.error(o),r("Sorry, but we couldn’t log you in. Please contact Corva support if you need assistance"),c.push("/login")},m=async()=>{const o=localStorage.getItem("ssoPlatform");localStorage.removeItem("ssoPlatform");const{platform:t}=await e(o),r=i(t.identifier);if(!r)return u(`No authentication platform found for ${t.identifier}`);try{r.configure(t.options);const o=await r.authenticate();return((o,t)=>{s(o,{token:t},(()=>c.push("/")))})(t.identifier,o)}catch(o){return u(o)}};return o((()=>{m()}),[]),a(t,{fullscreen:!1})}export{c as default};
@@ -1 +1 @@
1
- import t from"../../../CLI/hocs/withCorvaMagicHOC.js";import{createAdaptiveRoot as e}from"./createAdaptiveRoot.js";import{jsx as o}from"react/jsx-runtime";Promise.all([import("".concat(process.env.DEV_CENTER_APP_PATH,"/src/index.js")),import("".concat(process.env.DEV_CENTER_APP_PATH,"/manifest.json")),import("".concat(process.env.DEV_CENTER_APP_PATH,"/package.json"))]).then((n=>{let[s,r,c]=n;const a=t({component:s.default.component,settings:s.default.settings,manifest:r.default,packageJson:c.default});e(document.getElementById("root")).render(o(a,{}))}));
1
+ import e from"../../../CLI/hocs/withCorvaMagicHOC.js";import{createAdaptiveRoot as t}from"./createAdaptiveRoot.js";import{jsx as o}from"react/jsx-runtime";Promise.all([import(`${process.env.DEV_CENTER_APP_PATH}/src/index.js`),import(`${process.env.DEV_CENTER_APP_PATH}/manifest.json`),import(`${process.env.DEV_CENTER_APP_PATH}/package.json`)]).then((([s,n,r])=>{const m=e({component:s.default.component,settings:s.default.settings,manifest:n.default,packageJson:r.default});t(document.getElementById("root")).render(o(m,{}))}));
@@ -1 +1 @@
1
- import o from"prop-types";import{makeStyles as t}from"@material-ui/core";import*as n from"@corva/ui";import{DevCenterIsolatedAppPage as e}from"@corva/ui/components";import{initGlobalDependencies as p}from"@corva/ui/config";import{createAdaptiveRoot as r}from"./createAdaptiveRoot.js";import{jsx as i}from"react/jsx-runtime";window["@corva/ui"]=n,p();const m=t((()=>({reportsContainer:{zoom:"0.5"}})));function s(o){let{CLIAppComponent:t=null,CLIAppSettings:n=null}=o;const p=m();return i(e,{CLIAppComponent:t,CLIAppSettings:n,containerReportClassName:p.reportsContainer})}s.propTypes={CLIAppComponent:o.func,CLIAppSettings:o.func},import("".concat(process.env.DEV_CENTER_APP_PATH,"/src/index.js")).then((o=>{const t=o.default.component,n=o.default.settings;r(document.getElementById("root")).render(i(s,{CLIAppComponent:t,CLIAppSettings:n}))}));
1
+ import o from"prop-types";import{makeStyles as t}from"@material-ui/core";import*as n from"@corva/ui";import{DevCenterIsolatedAppPage as p}from"@corva/ui/components";import{initGlobalDependencies as r}from"@corva/ui/config";import{createAdaptiveRoot as e}from"./createAdaptiveRoot.js";import{jsx as i}from"react/jsx-runtime";window["@corva/ui"]=n,r();const m=t((()=>({reportsContainer:{zoom:"0.5"}})));function s({CLIAppComponent:o=null,CLIAppSettings:t=null}){const n=m();return i(p,{CLIAppComponent:o,CLIAppSettings:t,containerReportClassName:n.reportsContainer})}s.propTypes={CLIAppComponent:o.func,CLIAppSettings:o.func},import(`${process.env.DEV_CENTER_APP_PATH}/src/index.js`).then((o=>{const t=o.default.component,n=o.default.settings;e(document.getElementById("root")).render(i(s,{CLIAppComponent:t,CLIAppSettings:n}))}));
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-cjs/@babel/runtime/helpers/defineProperty.js');function t(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function a(a){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){e(a,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(o,e))}))}return a}const r={qa:"qa",staging:"staging",production:"production"},o={REACT_APP_AUTH0_REDIRECT_URI:"http://app.local.corva.ai:8080/login/oauth-callback",REACT_APP_AUTH0_DOMAIN:"corva.auth0.com",REACT_APP_AUTH0_CLIENT_ID:"L1B0xGD5AuXwuTDFdFA9czDTM7Vvw464"},i={[r.qa]:a(a({},o),{},{REACT_APP_API_URL:"https://api.qa.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.qa.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.qa.corva.ai/v1"}),[r.staging]:a(a({},o),{},{REACT_APP_API_URL:"https://api.staging.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.staging.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.staging.corva.ai/v1"}),[r.production]:a(a({},o),{},{REACT_APP_API_URL:"https://api.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.corva.ai/v1"})};exports.CORVA_API_ENVS=r,exports.CORVA_API_ENV_VARIABLES=i,exports.CORVA_GLOBAL_DEPENDENCIES={"@corva/ui":"","@material-ui/core":"4.11.2","@material-ui/icons":"4.9.1","@material-ui/lab":"4.0.0-alpha.57","@material-ui/pickers":"3.2.10",classnames:"2.2.6","corva-convert-units":"1.10.33",highcharts:["8.1.2","10.3.3"],"highcharts-react-official":"2.2.2",html2canvas:"1.0.0-alpha.12","@icon-park/react":"1.4.2",jsona:"1.5.1",lodash:["^4.17.21","^4.18.1"],"mapbox-gl":"3.16.0",moment:"2.29.4","moment-timezone":"0.5.43",react:["17.0.1","18.3.1"],"react-dom":["17.0.1","18.3.1"],"react-grid-layout":"1.3.4","react-sortable-hoc":"0.6.8","react-sizeme":"2.5.2","react-redux":"5.1.1","react-virtualized":"9.21.2",redux:"3.7.2","redux-thunk":"2.3.0",reselect:"2.5.4","prop-types":"^15.6.1",uuid:"3.4.0"},exports.DEPRECATED_DEPENDENCIES=[{dependency:"mapbox.js",message:'mapbox.js is deprecated and is no longer provided to Dev Center apps as a shared dependency. Use mapbox-gl 3.16.0 instead (provided by the platform as the window["mapbox-gl"] shared dependency). Remove mapbox.js from your package.json and migrate any L.mapbox usage to mapbox-gl.'}],exports.UNSUPPORTED_DEPENDENCIES=[{dependency:"date-fns",alternative:"moment"},{dependency:"date-fns-tz",alternative:"moment-timezone"},{dependency:"date-fns-timezone",alternative:"moment-timezone"}];
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const a={qa:"qa",staging:"staging",production:"production"},e={REACT_APP_AUTH0_REDIRECT_URI:"http://app.local.corva.ai:8080/login/oauth-callback",REACT_APP_AUTH0_DOMAIN:"corva.auth0.com",REACT_APP_AUTH0_CLIENT_ID:"L1B0xGD5AuXwuTDFdFA9czDTM7Vvw464"},t={[a.qa]:{...e,REACT_APP_API_URL:"https://api.qa.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.qa.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.qa.corva.ai/v1"},[a.staging]:{...e,REACT_APP_API_URL:"https://api.staging.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.staging.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.staging.corva.ai/v1"},[a.production]:{...e,REACT_APP_API_URL:"https://api.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.corva.ai/v1"}};exports.CORVA_API_ENVS=a,exports.CORVA_API_ENV_VARIABLES=t,exports.CORVA_GLOBAL_DEPENDENCIES={"@corva/ui":"","@material-ui/core":"4.11.2","@material-ui/icons":"4.9.1","@material-ui/lab":"4.0.0-alpha.57","@material-ui/pickers":"3.2.10",classnames:"2.2.6","corva-convert-units":"1.10.33",highcharts:["8.1.2","10.3.3"],"highcharts-react-official":"2.2.2",html2canvas:"1.0.0-alpha.12","@icon-park/react":"1.4.2",jsona:"1.5.1",lodash:["^4.17.21","^4.18.1"],"mapbox-gl":"3.16.0",moment:"2.29.4","moment-timezone":"0.5.43",react:["17.0.1","18.3.1"],"react-dom":["17.0.1","18.3.1"],"react-grid-layout":"1.3.4","react-sortable-hoc":"0.6.8","react-sizeme":"2.5.2","react-redux":"5.1.1","react-virtualized":"9.21.2",redux:"3.7.2","redux-thunk":"2.3.0",reselect:"2.5.4","prop-types":"^15.6.1",uuid:"3.4.0"},exports.DEPRECATED_DEPENDENCIES=[{dependency:"mapbox.js",message:'mapbox.js is deprecated and is no longer provided to Dev Center apps as a shared dependency. Use mapbox-gl 3.16.0 instead (provided by the platform as the window["mapbox-gl"] shared dependency). Remove mapbox.js from your package.json and migrate any L.mapbox usage to mapbox-gl.'}],exports.UNSUPPORTED_DEPENDENCIES=[{dependency:"date-fns",alternative:"moment"},{dependency:"date-fns-tz",alternative:"moment-timezone"},{dependency:"date-fns-timezone",alternative:"moment-timezone"}];
@@ -1 +1,11 @@
1
- "use strict";var e,r=require('./../../../../ext-cjs/@babel/runtime/helpers/taggedTemplateLiteral.js');const o=require("node-fetch"),n=require("chalk"),t=require("semver/functions/gt"),a=require("path"),s=require("fs"),i=process.cwd(),u=JSON.parse(s.readFileSync(a.resolve(i,"./node_modules/@corva/ui/package.json"),"utf-8"));let c=null;module.exports=function(a){a.hooks.afterCompile.tapPromise("checkCorvaUIVersion",(async a=>{const s=a.getLogger("checkCorvaUIVersion"),i=u.version;c||(c=await function(e){return o("https://registry.npmjs.org/@corva/ui/latest").then((r=>r.ok?r.json().then((e=>e.version)):e.warn("Could not fetch latest @corva/ui version"))).catch((r=>e.warn("Connection error",r)))}(s)),c&&t(c,i)&&s.warn(n(e||(e=r(["\n ****************************************************************\n\n You are using outdated version of @corva/ui {grey (",")}.\n Current latest version is {green.bold (",")}.\n This may lead to problems once the app is published.\n Please update the @corva/ui with the following command:\n\n {green.bold yarn add @corva/ui@latest}\n\n ****************************************************************"])),i,c))}))};
1
+ "use strict";const e=require("node-fetch"),r=require("chalk"),o=require("semver/functions/gt"),t=require("path"),n=require("fs"),s=process.cwd(),a=JSON.parse(n.readFileSync(t.resolve(s,"./node_modules/@corva/ui/package.json"),"utf-8"));let i=null;module.exports=function(t){t.hooks.afterCompile.tapPromise("checkCorvaUIVersion",(async t=>{const n=t.getLogger("checkCorvaUIVersion"),s=a.version;i||(i=await function(r){return e("https://registry.npmjs.org/@corva/ui/latest").then((e=>e.ok?e.json().then((e=>e.version)):r.warn("Could not fetch latest @corva/ui version"))).catch((e=>r.warn("Connection error",e)))}(n)),i&&o(i,s)&&n.warn(r`
2
+ ****************************************************************
3
+
4
+ You are using outdated version of @corva/ui {grey (${s})}.
5
+ Current latest version is {green.bold (${i})}.
6
+ This may lead to problems once the app is published.
7
+ Please update the @corva/ui with the following command:
8
+
9
+ {green.bold yarn add @corva/ui@latest}
10
+
11
+ ****************************************************************`)}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./serializeDotEnv.js");const r=require("fs").promises,t=require("path"),o=require("express");exports.onBeforeSetupMiddleware=function(s,i){let{APP_DIRECTORY:n}=i;s.use(o.json()),s.patch("/dotenv",(async function(o,s){let i="";try{i=await r.readFile(t.resolve(n,"./.env"),"utf8")}catch(e){}try{await r.writeFile(t.resolve(n,"./.env"),e.updateDotEnv(i,o.body))}catch(e){console.error("Could not write to .env file"),console.error(e)}s.sendStatus(200)}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./serializeDotEnv.js");const r=require("fs").promises,t=require("path"),o=require("express");exports.onBeforeSetupMiddleware=function(s,{APP_DIRECTORY:i}){s.use(o.json()),s.patch("/dotenv",(async function(o,s){let n="";try{n=await r.readFile(t.resolve(i,"./.env"),"utf8")}catch(e){}try{await r.writeFile(t.resolve(i,"./.env"),e.updateDotEnv(n,o.body))}catch(e){console.error("Could not write to .env file"),console.error(e)}s.sendStatus(200)}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t=(t,e)=>"".concat(t,"=").concat((t=>{let e=t.replace(/\n/g,"\\n");return(e.includes(" ")||e.includes("\t"))&&(e='"'.concat(e.replace(/"/g,'\\"'),'"')),e})(e));exports.updateDotEnv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;const c=n||{};return e.split("\n").map((e=>{if(!e.length||e.startsWith("#"))return e;const[n]=e.split("=");if(Object.keys(c).includes(n)){const e=c[n];return delete c[n],t(n,e)}return e})).concat(Object.entries(c).map((e=>{let[n,c]=e;return t(n,c)}))).join("\n")};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=(e,t)=>`${e}=${(e=>{let t=e.replace(/\n/g,"\\n");return(t.includes(" ")||t.includes("\t"))&&(t=`"${t.replace(/"/g,'\\"')}"`),t})(t)}`;exports.updateDotEnv=(t="",n)=>{const r=n||{};return t.split("\n").map((t=>{if(!t.length||t.startsWith("#"))return t;const[n]=t.split("=");if(Object.keys(r).includes(n)){const t=r[n];return delete r[n],e(n,t)}return t})).concat(Object.entries(r).map((([t,n])=>e(t,n)))).join("\n")};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../constants.js");exports.default=function(n){let{dependencies:t={}}=n;const s=[];return Object.entries(e.CORVA_GLOBAL_DEPENDENCIES).forEach((e=>{let[n,c]=e;if(c&&n in t){const e=t[n];Array.isArray(c)?c.includes(e)||s.push("".concat(n," version must be one of [").concat(c.join(", "),"]")):e!==c&&s.push("".concat(n," version must be ").concat(c))}})),e.UNSUPPORTED_DEPENDENCIES.forEach((e=>{let{dependency:n,alternative:c=""}=e;n in t&&s.push("".concat(n," is not supported.").concat(c?" Please use ".concat(c," instead."):""))})),s},exports.getDependenciesWarnings=function(n){let{dependencies:t={}}=n;const s=[];return e.DEPRECATED_DEPENDENCIES.forEach((e=>{let{dependency:n,message:c}=e;n in t&&s.push(c)})),s};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../constants.js");exports.default=function({dependencies:n={}}){const s=[];return Object.entries(e.CORVA_GLOBAL_DEPENDENCIES).forEach((([e,t])=>{if(t&&e in n){const r=n[e];Array.isArray(t)?t.includes(r)||s.push(`${e} version must be one of [${t.join(", ")}]`):r!==t&&s.push(`${e} version must be ${t}`)}})),e.UNSUPPORTED_DEPENDENCIES.forEach((({dependency:e,alternative:t=""})=>{e in n&&s.push(`${e} is not supported.${t?` Please use ${t} instead.`:""}`)})),s},exports.getDependenciesWarnings=function({dependencies:n={}}){const s=[];return e.DEPRECATED_DEPENDENCIES.forEach((({dependency:e,message:t})=>{e in n&&s.push(t)})),s};
@@ -1 +1 @@
1
- "use strict";var e=require("./dependencies.js");const o=require("chalk");module.exports=function(n){let{packageJson:s}=n;const c=e.default(s);e.getDependenciesWarnings(s).forEach((e=>console.log(o.yellow(e)))),c.forEach((e=>console.log(o.red(e)))),c.length&&process.exit(1)};
1
+ "use strict";var e=require("./dependencies.js");const o=require("chalk");module.exports=function({packageJson:n}){const s=e.default(n);e.getDependenciesWarnings(n).forEach((e=>console.log(o.yellow(e)))),s.forEach((e=>console.log(o.red(e)))),s.length&&process.exit(1)};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./validators/index.js");const s=require("webpack"),o=require("path"),r=require("uuid/v1"),{CleanWebpackPlugin:t}=require("clean-webpack-plugin"),a=require("fs"),l=process.cwd(),n=JSON.parse(a.readFileSync(o.resolve(l,"./package.json"),"utf-8")),p=JSON.parse(a.readFileSync(o.resolve(l,"./manifest.json"),"utf-8"));exports.APP_DIRECTORY=l,exports.default=function(a,l){return e({packageJson:n}),{entry:"./src/index.js",output:{filename:"[name].[contenthash].js",path:o.resolve(process.cwd(),"dist")},devServer:{historyApiFallback:!0},performance:{maxAssetSize:1024e3},plugins:[new t,new s.ProvidePlugin({process:"process/browser"})],resolve:{symlinks:!1,extensions:[".js",".jsx",".json",".ts",".tsx"]},module:{rules:[{test:/\.(s[ac]|c)ss$/i,use:["style-loader",{loader:"css-loader",options:{modules:{localIdentName:"development"===l.mode?"[path][name]__[local]__[hash:base64:10]__".concat(r().substr(-5)):"[name]--[local]__[hash:base64:10]__".concat(r().substr(-5)),namedExport:!1},importLoaders:2}},{loader:"postcss-loader",options:{postcssOptions:{plugins:["postcss-preset-env"]}}},{loader:"sass-loader",options:{sourceMap:!0}}]},{test:/\.(js|jsx)$/,exclude:/[\\/]node_modules[\\/]/,use:{loader:"babel-loader",options:{presets:["@babel/preset-env",["@babel/preset-react",{runtime:"automatic"}]]}}},{test:/\.ts(x?)$/,exclude:/[\\/]node_modules[\\/]/,use:[{loader:"babel-loader",options:{presets:["@babel/preset-env",["@babel/preset-react",{runtime:"automatic"}]]}},{loader:"ts-loader",options:{compilerOptions:{noEmit:!1}}}]},{test:/\.m?js/,resolve:{fullySpecified:!1}}]}}},exports.manifestJson=p,exports.packageJson=n;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./validators/index.js");const s=require("webpack"),o=require("path"),r=require("uuid/v1"),{CleanWebpackPlugin:t}=require("clean-webpack-plugin"),a=require("fs"),l=process.cwd(),n=JSON.parse(a.readFileSync(o.resolve(l,"./package.json"),"utf-8")),p=JSON.parse(a.readFileSync(o.resolve(l,"./manifest.json"),"utf-8"));exports.APP_DIRECTORY=l,exports.default=function(a,l){return e({packageJson:n}),{entry:"./src/index.js",output:{filename:"[name].[contenthash].js",path:o.resolve(process.cwd(),"dist")},devServer:{historyApiFallback:!0},performance:{maxAssetSize:1024e3},plugins:[new t,new s.ProvidePlugin({process:"process/browser"})],resolve:{symlinks:!1,extensions:[".js",".jsx",".json",".ts",".tsx"]},module:{rules:[{test:/\.(s[ac]|c)ss$/i,use:["style-loader",{loader:"css-loader",options:{modules:{localIdentName:"development"===l.mode?`[path][name]__[local]__[hash:base64:10]__${r().substr(-5)}`:`[name]--[local]__[hash:base64:10]__${r().substr(-5)}`,namedExport:!1},importLoaders:2}},{loader:"postcss-loader",options:{postcssOptions:{plugins:["postcss-preset-env"]}}},{loader:"sass-loader",options:{sourceMap:!0}}]},{test:/\.(js|jsx)$/,exclude:/[\\/]node_modules[\\/]/,use:{loader:"babel-loader",options:{presets:["@babel/preset-env",["@babel/preset-react",{runtime:"automatic"}]]}}},{test:/\.ts(x?)$/,exclude:/[\\/]node_modules[\\/]/,use:[{loader:"babel-loader",options:{presets:["@babel/preset-env",["@babel/preset-react",{runtime:"automatic"}]]}},{loader:"ts-loader",options:{compilerOptions:{noEmit:!1}}}]},{test:/\.m?js/,resolve:{fullySpecified:!1}}]}}},exports.manifestJson=p,exports.packageJson=n;
@@ -1 +1 @@
1
- "use strict";var e=require('./../../../ext-cjs/@babel/runtime/helpers/defineProperty.js'),r=require("./webpack.config.common.js"),t=require("./constants.js"),o=require("./plugins/checkCorvaUIVersion.js"),n=require("./utils/middlewares.js");function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function i(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}const c=require("@pmmmwh/react-refresh-webpack-plugin"),{merge:a}=require("webpack-merge"),p=require("path"),l=require("webpack"),{CleanWebpackPlugin:u}=require("clean-webpack-plugin"),d=require("copy-webpack-plugin"),m=require("html-webpack-plugin"),v=require("chalk");require("dotenv").config({path:p.resolve(r.APP_DIRECTORY,"./.env")});const _=()=>{const e=process.env.CORVA_API_ENV||t.CORVA_API_ENVS.production;return e in t.CORVA_API_ENVS?t.CORVA_API_ENV_VARIABLES[e]:(console.log(v.red("CORVA_API_ENV should be one of [".concat(Object.keys(t.CORVA_API_ENVS).join(", "),"]"))),process.exit(1))};function P(e,r,t){const o=p.join("@corva","dc-platform-shared"),n="@corva/ui",s=new RegExp("(^".concat(n,"$|^").concat(n,"/)([^]+)?"));if(!e.includes(o)){const e=s.exec(r);if(null!==e){return t(null,["window",n,...(e[2]||"").split("/").filter(Boolean)])}}return t()}const f=e=>p.dirname(require.resolve("".concat(e,"/package.json"),{paths:[r.APP_DIRECTORY]}));module.exports=function(e,t){const s=process.env.HOST||t.host||"app.local.corva.ai",v=process.env.PORT||t.port||8080,O="mapbox-gl"in(r.packageJson.dependencies||{})?[p.resolve(__dirname,"MapboxGlDevSetupEntryPoint.js")]:[];return a(r.default(e,t),{mode:"development",devtool:"inline-source-map",resolve:{alias:{react:f("react"),"react-dom":f("react-dom")}},devServer:{static:"./dist",host:s,port:v,onBeforeSetupMiddleware:e=>n.onBeforeSetupMiddleware(e.app,{APP_DIRECTORY:r.APP_DIRECTORY}),hot:!0,open:!1},entry:{devApp:[p.resolve(__dirname,"DevServerEntryPoint.js"),...O],isolatedApp:[p.resolve(__dirname,"DevServerIsolatedAppEntryPoint.js"),...O]},output:{filename:"[name].js"},plugins:[new u,new d({patterns:[{from:p.resolve(__dirname,"public")},{from:p.resolve(process.cwd(),"node_modules","@corva/ui/assets"),to:"static/media",noErrorOnMissing:!0},{from:p.resolve(process.cwd(),"node_modules","@corva/dc-platform-shared/assets"),to:"static/media",noErrorOnMissing:!0}]}),new m({filename:"index.html",inject:!1,template:p.resolve(__dirname,"public","index.html")}),new m({filename:"DevCenterIsolatedAppPage.html",inject:!1,template:p.resolve(__dirname,"public","DevCenterIsolatedAppPage.html")}),new l.EnvironmentPlugin(i(i({},process.env),{},{DEV_CENTER_APP_PATH:process.cwd(),REACT_APP_ENVIRONMENT:process.env.REACT_APP_ENVIRONMENT||"development"},_())),o,new c],externals:P,module:{rules:[{test:/\.(png|jpe?g|gif)$/i,type:"asset/resource"},{test:/\.svg$/,use:[{loader:"svg-url-loader",options:{limit:1e4}}]}]}})};
1
+ "use strict";var e=require("./webpack.config.common.js"),r=require("./constants.js"),o=require("./plugins/checkCorvaUIVersion.js"),n=require("./utils/middlewares.js");const s=require("@pmmmwh/react-refresh-webpack-plugin"),{merge:t}=require("webpack-merge"),i=require("path"),a=require("webpack"),{CleanWebpackPlugin:l}=require("clean-webpack-plugin"),p=require("copy-webpack-plugin"),c=require("html-webpack-plugin"),u=require("chalk");require("dotenv").config({path:i.resolve(e.APP_DIRECTORY,"./.env")});const d=()=>{const e=process.env.CORVA_API_ENV||r.CORVA_API_ENVS.production;return e in r.CORVA_API_ENVS?r.CORVA_API_ENV_VARIABLES[e]:(console.log(u.red(`CORVA_API_ENV should be one of [${Object.keys(r.CORVA_API_ENVS).join(", ")}]`)),process.exit(1))};function m(e,r,o){const n=i.join("@corva","dc-platform-shared"),s="@corva/ui",t=new RegExp("(^@corva/ui$|^@corva/ui/)([^]+)?");if(!e.includes(n)){const e=t.exec(r);if(null!==e){return o(null,["window",s,...(e[2]||"").split("/").filter(Boolean)])}}return o()}const v=r=>i.dirname(require.resolve(`${r}/package.json`,{paths:[e.APP_DIRECTORY]}));module.exports=function(r,u){const _=process.env.HOST||u.host||"app.local.corva.ai",A=process.env.PORT||u.port||8080,P="mapbox-gl"in(e.packageJson.dependencies||{})?[i.resolve(__dirname,"MapboxGlDevSetupEntryPoint.js")]:[];return t(e.default(r,u),{mode:"development",devtool:"inline-source-map",resolve:{alias:{react:v("react"),"react-dom":v("react-dom")}},devServer:{static:"./dist",host:_,port:A,setupMiddlewares:(r,o)=>(n.onBeforeSetupMiddleware(o.app,{APP_DIRECTORY:e.APP_DIRECTORY}),r),hot:!0,open:!1},entry:{devApp:[i.resolve(__dirname,"DevServerEntryPoint.js"),...P],isolatedApp:[i.resolve(__dirname,"DevServerIsolatedAppEntryPoint.js"),...P]},output:{filename:"[name].js"},plugins:[new l,new p({patterns:[{from:i.resolve(__dirname,"public")},{from:i.resolve(process.cwd(),"node_modules","@corva/ui/assets"),to:"static/media",noErrorOnMissing:!0},{from:i.resolve(process.cwd(),"node_modules","@corva/dc-platform-shared/assets"),to:"static/media",noErrorOnMissing:!0}]}),new c({filename:"index.html",inject:!1,template:i.resolve(__dirname,"public","index.html")}),new c({filename:"DevCenterIsolatedAppPage.html",inject:!1,template:i.resolve(__dirname,"public","DevCenterIsolatedAppPage.html")}),new a.EnvironmentPlugin({...process.env,DEV_CENTER_APP_PATH:process.cwd(),REACT_APP_ENVIRONMENT:process.env.REACT_APP_ENVIRONMENT||"development",...d()}),o,new s],externals:m,module:{rules:[{test:/\.(png|jpe?g|gif)$/i,type:"asset/resource"},{test:/\.svg$/,use:[{loader:"svg-url-loader",options:{limit:1e4}}]}]}})};
@@ -1 +1 @@
1
- "use strict";var e=require("./webpack.config.common.js"),r=require("./constants.js");const t=require("webpack"),{merge:n}=require("webpack-merge"),o=require("path"),s=require("terser-webpack-plugin"),i=require("copy-webpack-plugin"),{application:{key:a}}=e.manifestJson,{version:c}=e.packageJson,l=e=>{const r=a.replace(/\./g,"_");return e?r:"".concat(r,"-").concat(c)},u=Object.keys(r.CORVA_GLOBAL_DEPENDENCIES).map((e=>[e,new RegExp("(^".concat(e,"$|^").concat(e,"/)([^]+)?"))])),p=["react/jsx-runtime","highcharts/"];module.exports=function(r,a){const c=!(null==r||!r.local_debug);return n(e.default(r,a),{entry:"./src/index.js",output:{library:l(c),path:o.resolve(e.APP_DIRECTORY,"dist"),filename:"app.js",libraryTarget:"window"},mode:c?"development":"production",plugins:[new t.EnvironmentPlugin(process.env),new i({patterns:[{from:o.resolve(process.cwd(),"manifest.json"),to:"./",noErrorOnMissing:!0}]})],optimization:{minimizer:[new s({parallel:!0})]},externals:[function(e,r,t){if(r.endsWith(".css"))return t();for(let e=0;e<p.length;e+=1)if(r.startsWith(p[e]))return t();for(let e=0;e<u.length;e+=1){const[n,o]=u[e],s=o.exec(r);if(null!==s){return t(null,[n,...(s[2]||"").split("/").filter(Boolean)])}}return t()}],module:{rules:[{test:/\.(png|jpe?g|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource"},{test:/\.svg$/,use:[{loader:"svg-url-loader",options:{limit:1e4}}]}]}})};
1
+ "use strict";var e=require("./webpack.config.common.js"),r=require("./constants.js");const t=require("webpack"),{merge:n}=require("webpack-merge"),s=require("path"),i=require("terser-webpack-plugin"),o=require("copy-webpack-plugin"),{application:{key:l}}=e.manifestJson,{version:a}=e.packageJson,u=e=>{const r=l.replace(/\./g,"_");return e?r:`${r}-${a}`},p=Object.keys(r.CORVA_GLOBAL_DEPENDENCIES).map((e=>[e,new RegExp(`(^${e}$|^${e}/)([^]+)?`)])),c=["react/jsx-runtime","highcharts/"];module.exports=function(r,l){const a=!!r?.local_debug;return n(e.default(r,l),{entry:"./src/index.js",output:{library:u(a),path:s.resolve(e.APP_DIRECTORY,"dist"),filename:"app.js",libraryTarget:"window"},mode:a?"development":"production",plugins:[new t.EnvironmentPlugin(process.env),new o({patterns:[{from:s.resolve(process.cwd(),"manifest.json"),to:"./",noErrorOnMissing:!0}]})],optimization:{minimizer:[new i({parallel:!0})]},externals:[function(e,r,t){if(r.endsWith(".css"))return t();for(let e=0;e<c.length;e+=1)if(r.startsWith(c[e]))return t();for(let e=0;e<p.length;e+=1){const[n,s]=p[e],i=s.exec(r);if(null!==i){return t(null,[n,...(i[2]||"").split("/").filter(Boolean)])}}return t()}],module:{rules:[{test:/\.(png|jpe?g|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource"},{test:/\.svg$/,use:[{loader:"svg-url-loader",options:{limit:1e4}}]}]}})};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import o from'./../../ext-esm/auth0-js/dist/auth0.min.esm.js';class t{constructor(){e(this,"handleAuthentication",((e,o)=>this.webAuth.parseHash(((t,i)=>{i&&i.accessToken?e(i):t&&o(t)})))),e(this,"loginWithConnection",(e=>this.webAuth.authorize({connection:e}))),this.webAuth=new o.WebAuth({domain:process.env.REACT_APP_AUTH0_DOMAIN,clientID:process.env.REACT_APP_AUTH0_CLIENT_ID,redirectUri:"".concat(window.location.origin,"/login/oauth-callback"),audience:process.env.REACT_APP_AUTH0_AUDIENCE,responseType:"token",scope:"openid profile email"})}}export{t as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import o from'./../../ext-esm/auth0-js/dist/auth0.min.esm.js';class t{constructor(){e(this,"handleAuthentication",((e,o)=>this.webAuth.parseHash(((t,i)=>{i&&i.accessToken?e(i):t&&o(t)})))),e(this,"loginWithConnection",(e=>this.webAuth.authorize({connection:e}))),this.webAuth=new o.WebAuth({domain:process.env.REACT_APP_AUTH0_DOMAIN,clientID:process.env.REACT_APP_AUTH0_CLIENT_ID,redirectUri:`${window.location.origin}/login/oauth-callback`,audience:process.env.REACT_APP_AUTH0_AUDIENCE,responseType:"token",scope:"openid profile email"})}}export{t as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{makeStyles as r,Tooltip as t,IconButton as o}from"@material-ui/core";import{UnlockIcon as c,LockIcon as a}from"@corva/ui/icons";import n from"classnames";import{jsx as i}from"react/jsx-runtime";function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function l(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}const b=r({root:{width:36,height:36,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"},borderRadius:8},button:{width:"100%",height:"100%","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"}}});function d(e){let{className:r,disabled:s,isDraggableAndResizable:d,LockIcon:u=a,lockIconClassName:p,onClick:m,pageName:f,tooltipProps:h={}}=e;const g=b();return i(t,l(l({title:s?"Can't unlock dashboard layout":d?"Lock Dashboard Layout":"Unlock Dashboard Layout"},h),{},{children:i("div",{className:n(g.root,r),children:i(o,{className:g.button,"data-testid":"".concat(f,"_").concat(d?"gridUnlocked":"gridLocked"),disabled:s,onClick:m,children:d?i(c,{}):i(u,{className:p})})})}))}export{d as default};
1
+ import{makeStyles as o,Tooltip as a,IconButton as r}from"@material-ui/core";import{UnlockIcon as t,LockIcon as e}from"@corva/ui/icons";import i from"classnames";import{jsx as c}from"react/jsx-runtime";const s=o({root:{width:36,height:36,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"},borderRadius:8},button:{width:"100%",height:"100%","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"}}});function d({className:o,disabled:d,isDraggableAndResizable:l,LockIcon:n=e,lockIconClassName:m,onClick:u,pageName:b,tooltipProps:h={}}){const g=s();return c(a,{title:d?"Can't unlock dashboard layout":l?"Lock Dashboard Layout":"Unlock Dashboard Layout",...h,children:c("div",{className:i(g.root,o),children:c(r,{className:g.button,"data-testid":`${b}_${l?"gridUnlocked":"gridLocked"}`,disabled:d,onClick:u,children:l?c(t,{}):c(n,{className:m})})})})}export{d as default};
@@ -1 +1 @@
1
- import e from"prop-types";import{styled as t,withStyles as i,Grid as r,Chip as a}from"@material-ui/core";import o from"@material-ui/icons/ArrowBack";import{jsx as n}from"react/jsx-runtime";const l=t(o)((e=>{let{theme:t}=e;return{color:t.palette.primary.text6,fontSize:16}})),p=e=>{let{label:t,onClick:i,classes:o,dataTestid:p=null}=e;return n(r,{item:!0,className:o.chip,children:n(a,{label:t,className:o.chipContent,icon:n(l,{}),variant:"outlined",onClick:i,"data-testid":p})})};p.propTypes={label:e.string.isRequired,dataTestid:e.string,onClick:e.func.isRequired,classes:e.shape({}).isRequired};var s=i((e=>({chip:{marginTop:"-25px",marginBottom:20,textAlign:"center"},chipContent:{color:e.palette.primary.text6,fontSize:13,border:"none",background:"#2C2C2C",padding:"0 5px 0 10px"}})))(p);export{s as default};
1
+ import e from"prop-types";import{styled as t,withStyles as i,Grid as r,Chip as a}from"@material-ui/core";import o from"@material-ui/icons/ArrowBack";import{jsx as n}from"react/jsx-runtime";const p=t(o)((({theme:e})=>({color:e.palette.primary.text6,fontSize:16}))),s=({label:e,onClick:t,classes:i,dataTestid:o=null})=>n(r,{item:!0,className:i.chip,children:n(a,{label:e,className:i.chipContent,icon:n(p,{}),variant:"outlined",onClick:t,"data-testid":o})});s.propTypes={label:e.string.isRequired,dataTestid:e.string,onClick:e.func.isRequired,classes:e.shape({}).isRequired};var l=i((e=>({chip:{marginTop:"-25px",marginBottom:20,textAlign:"center"},chipContent:{color:e.palette.primary.text6,fontSize:13,border:"none",background:"#2C2C2C",padding:"0 5px 0 10px"}})))(s);export{l as default};
@@ -1 +1 @@
1
- import e from"prop-types";import{withStyles as l,TextField as i}from"@material-ui/core";import{jsx as o}from"react/jsx-runtime";const a=e=>{let{value:l,onChange:a,disabled:t=!1,error:r=null,classes:d}=e;return o(i,{"data-testid":"".concat("EmailField","_emailInput"),id:"email-input",label:"Email",type:"email",name:"email",autoComplete:"email",value:l,placeholder:"Enter your email address",variant:"outlined",InputLabelProps:{classes:{root:d.emailFieldLabelRoot,focused:d.emailFieldFocused}},InputProps:{classes:{root:d.emailFieldRoot,input:d.emailInput,disabled:d.emailFieldDisabled,focused:d.emailFieldFocused,error:d.emailFieldError}},onChange:a,disabled:t,error:!!r,helperText:r,fullWidth:!0})};a.propTypes={value:e.string.isRequired,onChange:e.func.isRequired,disabled:e.bool,error:e.string,classes:e.shape({}).isRequired};var t=l((e=>({emailFieldRoot:{"&:hover:not($emailFieldDisabled):not($emailFieldFocused):not($emailFieldError) $emailFieldNotchedOutline":{borderColor:e.status.loginButton},"&$emailFieldFocused $emailFieldNotchedOutline":{borderColor:e.status.loginButton}},emailInput:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #233 inset"}},emailFieldLabelRoot:{color:"#666","&$emailFieldFocused":{color:e.status.loginButton}}})))(a);export{t as default};
1
+ import e from"prop-types";import{withStyles as l,TextField as i}from"@material-ui/core";import{jsx as o}from"react/jsx-runtime";const a=({value:e,onChange:l,disabled:a=!1,error:t=null,classes:r})=>o(i,{"data-testid":"EmailField_emailInput",id:"email-input",label:"Email",type:"email",name:"email",autoComplete:"email",value:e,placeholder:"Enter your email address",variant:"outlined",InputLabelProps:{classes:{root:r.emailFieldLabelRoot,focused:r.emailFieldFocused}},InputProps:{classes:{root:r.emailFieldRoot,input:r.emailInput,disabled:r.emailFieldDisabled,focused:r.emailFieldFocused,error:r.emailFieldError}},onChange:l,disabled:a,error:!!t,helperText:t,fullWidth:!0});a.propTypes={value:e.string.isRequired,onChange:e.func.isRequired,disabled:e.bool,error:e.string,classes:e.shape({}).isRequired};var t=l((e=>({emailFieldRoot:{"&:hover:not($emailFieldDisabled):not($emailFieldFocused):not($emailFieldError) $emailFieldNotchedOutline":{borderColor:e.status.loginButton},"&$emailFieldFocused $emailFieldNotchedOutline":{borderColor:e.status.loginButton}},emailInput:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #233 inset"}},emailFieldLabelRoot:{color:"#666","&$emailFieldFocused":{color:e.status.loginButton}}})))(a);export{t as default};
@@ -1 +1 @@
1
- import e from"prop-types";import{withStyles as i}from"@material-ui/core/styles";import{jsx as t}from"react/jsx-runtime";function r(e){let{email:i=null,classes:r}=e;return i?t("input",{name:"hidden-email",className:r.input,type:"email",defaultValue:i}):null}r.propTypes={email:e.string,classes:e.shape({input:e.string.isRequired}).isRequired};var s=i({input:{display:"none"}})(r);export{s as default};
1
+ import e from"prop-types";import{withStyles as i}from"@material-ui/core/styles";import{jsx as r}from"react/jsx-runtime";function s({email:e=null,classes:i}){return e?r("input",{name:"hidden-email",className:i.input,type:"email",defaultValue:e}):null}s.propTypes={email:e.string,classes:e.shape({input:e.string.isRequired}).isRequired};var t=i({input:{display:"none"}})(s);export{t as default};
@@ -1 +1 @@
1
- import o from"prop-types";import r from"classnames";import{styled as e,Tooltip as i}from"@material-ui/core";import{isMobileDetected as n,isTabletDetected as c}from"@corva/ui/utils/mobileDetect";import l from"./LogoIcon.js";import"./Login.global.css.js";import{jsx as t,jsxs as a}from"react/jsx-runtime";const m="/static/media/67f05495a7dbbee777bb0c7974f4588a.jpg",g=window.innerHeight<window.innerWidth,p=e(i)({maxWidth:300,margin:0}),s=t(l,{}),d=o=>{let{children:e,location:i,logoIcon:l=s,logoTooltip:d="",promoBackgroundImage:u=m,promoBackgroundWebM:h,promoBackgroundMp4:b,promoLink:f="https://www.corva.ai/"}=o;const k=h||b,v=a("a",{href:f,target:"_blank",rel:"noreferrer",className:r("c-login-promo",!k&&"c-login-promo__image"),style:{backgroundImage:!k&&"url(".concat(u,")")},children:["Promo",k&&a("video",{loop:!0,muted:!0,autoPlay:!0,playsinline:!0,className:"c-login-promo__video",children:[h&&t("source",{src:h,type:"video/webm"}),b&&t("source",{src:b,type:"video/mp4"})]})]});return a("div",{className:r("c-login",{"c-login-mobile":n||c,"c-login-large_content":"/login"!==i.path,"c-login-landscape":g}),children:[v,a("div",{className:"c-login-content",children:[t("div",{className:"c-login-logo",children:t(p,{title:d,placement:"bottom",children:t("div",{children:l})})}),e]})]})};d.propTypes={children:o.node,logoIcon:o.node,logoTooltip:o.string,promoLink:o.string,promoBackgroundImage:o.string,promoBackgroundWebM:o.string,promoBackgroundMp4:o.string};export{d as default};
1
+ import o from"prop-types";import r from"classnames";import{styled as e,Tooltip as i}from"@material-ui/core";import{isMobileDetected as n,isTabletDetected as c}from"@corva/ui/utils/mobileDetect";import l from"./LogoIcon.js";import"./Login.global.css.js";import{jsx as t,jsxs as a}from"react/jsx-runtime";const m=window.innerHeight<window.innerWidth,g=e(i)({maxWidth:300,margin:0}),p=t(l,{}),s=({children:o,location:e,logoIcon:i=p,logoTooltip:l="",promoBackgroundImage:s="/static/media/67f05495a7dbbee777bb0c7974f4588a.jpg",promoBackgroundWebM:d,promoBackgroundMp4:u,promoLink:h="https://www.corva.ai/"})=>{const b=d||u,f=a("a",{href:h,target:"_blank",rel:"noreferrer",className:r("c-login-promo",!b&&"c-login-promo__image"),style:{backgroundImage:!b&&`url(${s})`},children:["Promo",b&&a("video",{loop:!0,muted:!0,autoPlay:!0,playsinline:!0,className:"c-login-promo__video",children:[d&&t("source",{src:d,type:"video/webm"}),u&&t("source",{src:u,type:"video/mp4"})]})]});return a("div",{className:r("c-login",{"c-login-mobile":n||c,"c-login-large_content":"/login"!==e.path,"c-login-landscape":m}),children:[f,a("div",{className:"c-login-content",children:[t("div",{className:"c-login-logo",children:t(g,{title:l,placement:"bottom",children:t("div",{children:i})})}),o]})]})};s.propTypes={children:o.node,logoIcon:o.node,logoTooltip:o.string,promoLink:o.string,promoBackgroundImage:o.string,promoBackgroundWebM:o.string,promoBackgroundMp4:o.string};export{s as default};
@@ -1 +1 @@
1
- import{useState as o}from"react";import{withStyles as e,TextField as s,InputAdornment as r}from"@material-ui/core";import i from"@material-ui/core/IconButton";import d from"@material-ui/icons/Visibility";import t from"@material-ui/icons/VisibilityOff";import{jsx as a}from"react/jsx-runtime";var l=e((o=>({passwordFieldRoot:{"&:hover:not($passwordFieldDisabled):not($passwordFieldFocused):not($passwordFieldError) $passwordFieldNotchedOutline":{borderColor:o.status.loginButton},"&$passwordFieldFocused $passwordFieldNotchedOutline":{borderColor:o.status.loginButton}},passwordFieldLabelRoot:{"&$passwordFieldFocused":{color:o.status.loginButton}},passwordField:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #233 inset"}}})))((e=>{let{value:l,onChange:n,disabled:p,error:u,classes:c}=e;const[w,F]=o(!1);return a(s,{id:"password-input",label:"Password",type:w?"text":"password",name:"password",value:l,variant:"outlined",onChange:n,autoComplete:"password",disabled:p,error:!!u,helperText:u,InputProps:{endAdornment:a(r,{position:"end",children:a(i,{"aria-label":"Toggle password visibility",onClick:()=>F((o=>!o)),children:a(w?d:t,{})})}),classes:{root:c.passwordFieldRoot,input:c.passwordField,disabled:c.passwordFieldDisabled,focused:c.passwordFieldFocused,error:c.passwordFieldError,notchedOutline:c.passwordFieldNotchedOutline}},InputLabelProps:{classes:{root:c.passwordFieldLabelRoot,focused:c.passwordFieldFocused}},fullWidth:!0})}));export{l as default};
1
+ import{useState as o}from"react";import{withStyles as s,TextField as e,InputAdornment as r}from"@material-ui/core";import i from"@material-ui/core/IconButton";import d from"@material-ui/icons/Visibility";import t from"@material-ui/icons/VisibilityOff";import{jsx as a}from"react/jsx-runtime";var l=s((o=>({passwordFieldRoot:{"&:hover:not($passwordFieldDisabled):not($passwordFieldFocused):not($passwordFieldError) $passwordFieldNotchedOutline":{borderColor:o.status.loginButton},"&$passwordFieldFocused $passwordFieldNotchedOutline":{borderColor:o.status.loginButton}},passwordFieldLabelRoot:{"&$passwordFieldFocused":{color:o.status.loginButton}},passwordField:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #233 inset"}}})))((({value:s,onChange:l,disabled:n,error:p,classes:u})=>{const[c,w]=o(!1);return a(e,{id:"password-input",label:"Password",type:c?"text":"password",name:"password",value:s,variant:"outlined",onChange:l,autoComplete:"password",disabled:n,error:!!p,helperText:p,InputProps:{endAdornment:a(r,{position:"end",children:a(i,{"aria-label":"Toggle password visibility",onClick:()=>w((o=>!o)),children:a(c?d:t,{})})}),classes:{root:u.passwordFieldRoot,input:u.passwordField,disabled:u.passwordFieldDisabled,focused:u.passwordFieldFocused,error:u.passwordFieldError,notchedOutline:u.passwordFieldNotchedOutline}},InputLabelProps:{classes:{root:u.passwordFieldLabelRoot,focused:u.passwordFieldFocused}},fullWidth:!0})}));export{l as default};
@@ -1 +1 @@
1
- import e from"prop-types";import{withStyles as r}from"@material-ui/core/styles";import i from"@material-ui/core/Grid";import{UniversalLink as t}from"@corva/ui/components";import{jsx as n,jsxs as l}from"react/jsx-runtime";function a(e){let{children:r=null,classes:a,showNeedHelp:o=!0,needHelpExternalLink:d=null}=e;return n(i,{item:!0,className:a.gridItem,children:l(i,{container:!0,direction:"row",justify:"space-between",alignItems:"center",children:[l(i,{item:!0,children:[o&&!d&&n(t,{"data-testid":"".concat("EmailPo","_needHelp"),className:a.helpLink,href:"/login/help",children:"Need help?"}),o&&d&&n("a",{"data-testid":"".concat("EmailPo","_needHelp"),className:a.helpLink,href:d,target:"_blank",rel:"noreferrer",children:"Need help?"})]}),n(i,{item:!0,children:r})]})})}a.propTypes={children:e.node,showNeedHelp:e.bool,needHelpExternalLink:e.string,classes:e.shape({gridItem:e.string.isRequired,helpLink:e.string.isRequired}).isRequired};var o=r((e=>({gridItem:{padding:e.spacing(2,4,4,4),width:"100%"},helpLink:{color:e.palette.primary.text6,textTransform:"uppercase",padding:e.spacing(1),borderRadius:4,"&:hover":{background:"#333",color:"#fff"}}})))(a);export{o as default};
1
+ import e from"prop-types";import{withStyles as r}from"@material-ui/core/styles";import i from"@material-ui/core/Grid";import{UniversalLink as t}from"@corva/ui/components";import{jsx as n,jsxs as l}from"react/jsx-runtime";function a({children:e=null,classes:r,showNeedHelp:a=!0,needHelpExternalLink:o=null}){return n(i,{item:!0,className:r.gridItem,children:l(i,{container:!0,direction:"row",justify:"space-between",alignItems:"center",children:[l(i,{item:!0,children:[a&&!o&&n(t,{"data-testid":"EmailPo_needHelp",className:r.helpLink,href:"/login/help",children:"Need help?"}),a&&o&&n("a",{"data-testid":"EmailPo_needHelp",className:r.helpLink,href:o,target:"_blank",rel:"noreferrer",children:"Need help?"})]}),n(i,{item:!0,children:e})]})})}a.propTypes={children:e.node,showNeedHelp:e.bool,needHelpExternalLink:e.string,classes:e.shape({gridItem:e.string.isRequired,helpLink:e.string.isRequired}).isRequired};var o=r((e=>({gridItem:{padding:e.spacing(2,4,4,4),width:"100%"},helpLink:{color:e.palette.primary.text6,textTransform:"uppercase",padding:e.spacing(1),borderRadius:4,"&:hover":{background:"#333",color:"#fff"}}})))(a);export{o as default};
@@ -1 +1 @@
1
- import{useState as e,useRef as t,useEffect as r}from"react";import{Button as i}from"@corva/ui/components";import{makeStyles as n,Grid as o,Typography as a}from"@material-ui/core";import c from"classnames";import l from"./Step.js";import s from"./StepContent.js";import{jsxs as d,jsx as m,Fragment as p}from"react/jsx-runtime";const u=n((e=>({stepHeader:{padding:e.spacing(4),textAlign:"center",width:"100%",display:"flex",flexDirection:"column",alignItems:"center"},subtitle:{marginTop:e.spacing(2),color:e.palette.primary.text6,fontSize:16,letterSpacing:-.01,lineHeight:"normal"},form:{display:"flex",justifyContent:"space-between"},actions:{display:"flex",justifyContent:e=>{let{isResendButtonVisible:t}=e;return t?"space-between":"end"},width:"100%",padding:"24px 32px 40px"},input:{"&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{"-webkit-appearance":"none",margin:0},padding:8,border:"1px solid ".concat(e.palette.primary.text9),borderRadius:4,backgroundColor:e.palette.background.b4,color:e.palette.primary.contrastText,fontSize:30,textAlign:"center","&:active, &:hover, &:focus-visible":{border:"1px solid ".concat(e.palette.primary.main),outline:"none"}},inputError:{border:"1px solid ".concat(e.palette.error.main," !important")},footer:{width:"100%",padding:"0 32px",fontSize:14,letterSpacing:-.01,color:e.palette.primary.text6,textAlign:"center"},divider:{borderTop:"1px solid rgba(255, 255, 255, 0.2)",width:"100%",marginBottom:40},footerButton:{cursor:"pointer",color:e.palette.primary.main}}))),f="email",h="sms",b=Array.from({length:6},(()=>""));function g(n){let{email:g,identityVerification:v,loginVerificationFailure:x,onCodeProvided:y,requestVerification:S}=n;const[N,C]=e(v.enabled_modes[0]),[w,k]=e(b),[B,j]=e(x),[T,V]=e(!1),A=u({isResendButtonVisible:T}),D=t(null),E=t(null);r((()=>{j(x),x&&(V(!0),E.current=null)}),[x]),r((()=>(S({email:g,mode:N}).then((()=>{E.current=setTimeout((()=>{V(!0),E.current=null}),15e3)})).catch(console.error),()=>{E.current&&clearTimeout(E.current)})),[]);const I=()=>{w.every(Boolean)&&y({code:w.join(""),mode:N})},R=w.every(Boolean);r((()=>{R&&I()}),[w.join(),R]);const z=e=>{e.preventDefault(),I()},H=e=>t=>{const[r,i]=t.target.value,n=w[e];let o=r;i&&i!==n&&(o=i);const a=[...w];a[e]=o,k(a),j(!1),void 0===o&&e>0?D.current.childNodes[e-1].focus():o&&e<5&&D.current.childNodes[e+1].focus()},M=e=>()=>{C(e),S({email:g,mode:e}).catch(console.error),V(!1),j(!1),k(b),E.current&&clearTimeout(E.current),E.current=setTimeout((()=>{V(!0),E.current=null}),15e3)};return d(l,{children:[d(o,{item:!0,className:A.stepHeader,children:[m(a,{variant:"h6",children:B?"Invalid Verification Code":"Verify Your Identity"}),m("div",{className:A.subtitle,children:N===f?"Enter a 6-digit code which was set to ".concat(g):"We have sent an SMS with one time verification code to your phone number"})]}),m(s,{children:m("form",{className:A.form,id:"verification-form",onSubmit:z,autoComplete:"on",ref:D,onPaste:e=>{const t=String(e.clipboardData.getData("text")).trim().slice(0,6).split("");t.every((e=>Number.isInteger(Number(e))))&&6===t.length&&k(t)},children:w.map(((e,t)=>m("input",{type:"number",min:0,max:9,onChange:H(t),className:c(A.input,B&&A.inputError),value:e},t)))})}),d("div",{className:A.actions,children:[T&&m(i,{onClick:M(N),variation:"secondary",children:"Resend Code"}),m(i,{disabled:!R||B,form:"verification-form",onClick:z,type:"submit",variation:"primary",children:"Next"})]}),v.enabled_modes.length>1&&d("div",{className:A.footer,children:[m("div",{className:A.divider}),d(p,N===f?{children:["Send a code via"," ",m("span",{className:A.footerButton,onClick:M(h),children:"SMS"})]}:{children:["Send a code to"," ",m("span",{className:A.footerButton,onClick:M(f),children:"Email"})]})]})]})}export{g as VerificationStep};
1
+ import{useState as e,useRef as t,useEffect as r}from"react";import{Button as i}from"@corva/ui/components";import{makeStyles as n,Grid as o,Typography as a}from"@material-ui/core";import l from"classnames";import c from"./Step.js";import s from"./StepContent.js";import{jsxs as d,jsx as m,Fragment as p}from"react/jsx-runtime";const u=n((e=>({stepHeader:{padding:e.spacing(4),textAlign:"center",width:"100%",display:"flex",flexDirection:"column",alignItems:"center"},subtitle:{marginTop:e.spacing(2),color:e.palette.primary.text6,fontSize:16,letterSpacing:-.01,lineHeight:"normal"},form:{display:"flex",justifyContent:"space-between"},actions:{display:"flex",justifyContent:({isResendButtonVisible:e})=>e?"space-between":"end",width:"100%",padding:"24px 32px 40px"},input:{"&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{"-webkit-appearance":"none",margin:0},padding:8,border:`1px solid ${e.palette.primary.text9}`,borderRadius:4,backgroundColor:e.palette.background.b4,color:e.palette.primary.contrastText,fontSize:30,textAlign:"center","&:active, &:hover, &:focus-visible":{border:`1px solid ${e.palette.primary.main}`,outline:"none"}},inputError:{border:`1px solid ${e.palette.error.main} !important`},footer:{width:"100%",padding:"0 32px",fontSize:14,letterSpacing:-.01,color:e.palette.primary.text6,textAlign:"center"},divider:{borderTop:"1px solid rgba(255, 255, 255, 0.2)",width:"100%",marginBottom:40},footerButton:{cursor:"pointer",color:e.palette.primary.main}}))),f="email",h="sms",b=Array.from({length:6},(()=>""));function g({email:n,identityVerification:g,loginVerificationFailure:v,onCodeProvided:x,requestVerification:y}){const[S,N]=e(g.enabled_modes[0]),[C,w]=e(b),[k,B]=e(v),[j,T]=e(!1),V=u({isResendButtonVisible:j}),A=t(null),D=t(null);r((()=>{B(v),v&&(T(!0),D.current=null)}),[v]),r((()=>(y({email:n,mode:S}).then((()=>{D.current=setTimeout((()=>{T(!0),D.current=null}),15e3)})).catch(console.error),()=>{D.current&&clearTimeout(D.current)})),[]);const E=()=>{C.every(Boolean)&&x({code:C.join(""),mode:S})},I=C.every(Boolean);r((()=>{I&&E()}),[C.join(),I]);const R=e=>{e.preventDefault(),E()},$=e=>t=>{const[r,i]=t.target.value,n=C[e];let o=r;i&&i!==n&&(o=i);const a=[...C];a[e]=o,w(a),B(!1),void 0===o&&e>0?A.current.childNodes[e-1].focus():o&&e<5&&A.current.childNodes[e+1].focus()},z=e=>()=>{N(e),y({email:n,mode:e}).catch(console.error),T(!1),B(!1),w(b),D.current&&clearTimeout(D.current),D.current=setTimeout((()=>{T(!0),D.current=null}),15e3)};return d(c,{children:[d(o,{item:!0,className:V.stepHeader,children:[m(a,{variant:"h6",children:k?"Invalid Verification Code":"Verify Your Identity"}),m("div",{className:V.subtitle,children:S===f?`Enter a 6-digit code which was set to ${n}`:"We have sent an SMS with one time verification code to your phone number"})]}),m(s,{children:m("form",{className:V.form,id:"verification-form",onSubmit:R,autoComplete:"on",ref:A,onPaste:e=>{const t=String(e.clipboardData.getData("text")).trim().slice(0,6).split("");t.every((e=>Number.isInteger(Number(e))))&&6===t.length&&w(t)},children:C.map(((e,t)=>m("input",{type:"number",min:0,max:9,onChange:$(t),className:l(V.input,k&&V.inputError),value:e},t)))})}),d("div",{className:V.actions,children:[j&&m(i,{onClick:z(S),variation:"secondary",children:"Resend Code"}),m(i,{disabled:!I||k,form:"verification-form",onClick:R,type:"submit",variation:"primary",children:"Next"})]}),g.enabled_modes.length>1&&d("div",{className:V.footer,children:[m("div",{className:V.divider}),d(p,S===f?{children:["Send a code via"," ",m("span",{className:V.footerButton,onClick:z(h),children:"SMS"})]}:{children:["Send a code to"," ",m("span",{className:V.footerButton,onClick:z(f),children:"Email"})]})]})]})}export{g as VerificationStep};