aiware-js 1.0.0-master.819 → 1.0.0-master.820

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.
package/js-core.esm.js CHANGED
@@ -1528,4 +1528,4 @@ createScheduledJob(input:{
1528
1528
  }
1529
1529
  `)}),n},[]).join("\r\n")}
1530
1530
  }
1531
- `,l={entityId:t,entityType:e};try{a=yield baseGraphQLApi({query:s,operationName:n,variables:l,graphEndpoint:u,token:d})}catch(e){i=!0}if(a.errors){if(0===(o=a.errors.filter(({message:e})=>e.includes(' does not exist in "AuthPermissionType" enum.')).map(({message:e})=>{var t='Value "',n=e.substring(t.length).indexOf('"');return e.substring(t.length,t.length+n)})).length)throw i=!0,a={},new Error((null==(f=(a.errors||[])[0])?void 0:f.message)||"Error")}else i=!0}const c=a.data||{};return Object.keys(c).map(e=>{var t=e.split("__");return 3===t.length?{fetchedTargetEntityType:t[0],fetchedTargetGroupType:t[1],fetchedTargetAction:t[2],hasPermission:c[e][0].hasPermission}:{fetchedTargetEntityType:t[0],fetchedTargetAction:t[1],hasPermission:c[e][0].hasPermission}}).reduce((e,t)=>{var n=t.fetchedTargetGroupType||t.fetchedTargetEntityType;return t.hasPermission&&(e[n]||(e[n]={}),e[n][t.fetchedTargetAction]=t.hasPermission),e},{})})}function getMyRights(t){return __awaiter(this,void 0,void 0,function*(){var e="getMyRights";return(yield baseGraphQLApiWithError(Object.assign({query:"\n query getMyRights {\n myRights {\n operations\n }\n }\n ",operationName:e},t))).myRights.operations})}const selectPermissionsByEntity=(t,n,r)=>e=>{return t&&n&&(e=e[namespace].permissionsByObject[t])&&e[n]?e[n][r||t]:void 0},selectMyRights=e=>e[namespace].rights;var index=Object.freeze({__proto__:null,selectPermissionsByEntity:selectPermissionsByEntity,selectMyRights:selectMyRights});function*fetchObjectPermissions(t){var{entityId:t,entityType:n}=t.payload,i=yield select(selectApiConfigs$2),e=yield select(graphEndpointSelector),o=yield select(sessionTokenSelector),a=yield select(selectIsOLPEnabled),r=yield select(selectPermissionsByEntity(n,t));if(!r||"success"!==r.status&&"pending"!==r.status){yield put(actions.fetchObjectPermissionsStarted({entityId:t,entityType:n}));try{let r={};if(a)r=yield call$j(getObjectPermissions,e,o,{entityType:n,entityId:t});else{let e=yield select(selectMyRights);if("success"!==e.status&&"pending"!==e.status){yield put(actions.fetchMyRightsStarted);try{var s=yield call$j(getMyRights,i);yield put(actions.fetchMyRightsSucceeded(s)),e=yield select(selectMyRights)}catch(e){throw yield put(actions.fetchMyRightsFailed),e}}else"pending"===e.status&&(yield take([actions.fetchMyRightsFailed,actions.fetchMyRightsSucceeded]),e=yield select(selectMyRights));const l=e["myRights"];getPermissionTypesToQuery(n).forEach(n=>{var{action:e,resource:t}=n.targetActions.reduce((e,t)=>(e.action[t.targetAction]=convertPermissionsToRights(t.resource||n.targetObjectType,t.targetAction,l),e.resource=t.resource,e),{action:{}});r[t||n.targetObjectType]=e})}yield put(actions.fetchObjectPermissionsSucceeded({entityId:t,entityType:n,permissions:r}))}catch(e){actions.fetchObjectPermissionsFailed({entityId:t,entityType:n})}}}function*watchPermissionsStart(){yield takeEvery$1(actions.fetchObjectPermissionsStart.type,fetchObjectPermissions)}function*rootSaga(){yield all$2([watchPermissionsStart()])}function getPermissionsModule(){return{id:namespace,reducerMap:{[namespace]:permissionsReducer},sagas:[rootSaga],initialActions:[]}}const useOrganizationPermissions=e=>{const t=react$1.exports.useRef(),n=useDispatch(),r=null==(o=useSelector(userSelector$2).organization)?void 0:o.organizationId,i=useSelector(selectPermissionsByEntity(EAuthResourceType.Organization,String(r),e));react$1.exports.useEffect(()=>{!r||i&&"failure"!==i.status&&"idle"!==i.status&&t.current===r||(t.current=r,n(actions.fetchObjectPermissionsStart({entityType:EAuthResourceType.Organization,entityId:String(r)})))},[n,r,i]);var o=react$1.exports.useCallback(e=>{return!isPermissionLoading(i)&&hasPermission(i,e)},[i]);return{permissions:i,hasPermission:o}},rateLimiter=new RateLimiter,checkAndDecodeBase64String=t=>{if(null==t||!t.trim())return t;try{return window.btoa(window.atob(t))==t?window.atob(t):t}catch(e){return t}};function SnackbarRenderer(){return jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getSnackbarModule()]},{children:jsxRuntime.exports.jsx(CustomSnackbar,{})}))}))}store$5.addModules([getWidgetsModule(),getPanelsModule(registry,registryLookup),getDataModule(),getConfigModule(),getAuthModule(),getPermissionsModule()]);let hasLoaded=!1;const AppBarPreLoader=()=>{var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&!hasLoaded&&(hasLoaded=!0,setTimeout(()=>{store$5.addModules([getAppbarPanelModule()])},0)),null};function ApplicationDialogPreLoader(){var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&hasLoaded?jsxRuntime.exports.jsx(ApplicationDialog,{}):null}const authHelpers={updateToken(e){e?store$5.dispatch(updateTokenRequest({token:e})):console.error("[AiWARE JS]: Please provide a valid token!")},logout(e){"function"==typeof e?(e(),setTimeout(()=>{store$5.dispatch(logout())},1e3)):store$5.dispatch(logout())},reportAppActivity(e){rateLimiter.checkIfCanCall(e)&&store$5.dispatch(updateActivityStatus$1())}};function PortalRenderer(){return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(SupportCenterPixel,{}),jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(AppBarPreLoader,{})}))]})}function ApplicationDialogRenderer(){return jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ApplicationDialogPreLoader,{})})}))})}const ThemeInitializer=()=>(useTheme(),null),root=getElement("aiWARE"),reactDOMroot=(root.classList.add("aiware-el"),client$1.createRoot(root)),mountWidget=("_auth"===window.name?handleImplicitRedirect(window.location.hash,window.opener):reactDOMroot.render(jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsxs(AIWareThemeProvider$1,{children:[jsxRuntime.exports.jsx(PortalRenderer,{}),jsxRuntime.exports.jsx(SnackbarRenderer,{}),jsxRuntime.exports.jsx(ApplicationDialogRenderer,{}),jsxRuntime.exports.jsx(ThemeInitializer,{})]})})),(e,t)=>{var n=getUniqueID(),{name:e,elementId:r,config:i}=e;return e&&r&&i||console.error("[aiwarejs-error]: `mountWidget` function should include all the following params: name, elementId, config"),store$5.dispatch(mountWidget$1({elementId:r,widgetName:e,widgetConfig:i,widgetId:n,onComplete:t})),n}),unmountWidget=e=>(store$5.dispatch(unmountWidget$1(e)),!0),mountPanel=(e,t)=>{const n=e.panelId||getUniqueID();var{microFrontend:e,panelConfig:r}=e;store$5.dispatch(mountPanel$1({microFrontend:e,panelId:n,panelConfig:r}));const i=[...(null==(e=null==r?void 0:r.header)?void 0:e.actions)||[],...(null==(e=null==r?void 0:r.footer)?void 0:e.actions)||[]].filter(e=>e.submit).map(e=>e.action);r={id:n,sagas:[function*(){yield takeEvery$1(i.map(e=>e.type),function*(){var e=(yield select(e=>e.data.find(e=>e.id===n)))["data"];t&&t(e)})}]};return store$5.addModule(r),n},unmountPanel=e=>(store$5.dispatch(unmountPanel$1(e)),!0),hidePanel=e=>(store$5.dispatch(hidePanel$1(e)),!0),unmountAllPanel=()=>{store$5.dispatch(unmountAllPanel$1(""))};function init(e,t){var n,e=validateConfig(e);e?(n=e["authToken"],n=checkAndDecodeBase64String(n||""),store$5.dispatch(getInitConfig(Object.assign(Object.assign({},e),{authToken:n,onComplete:t})))):console.error("@aiware/js initialization failed. Please pass valid configuration object.")}function helpCenter(){var e=new HelpCenter$2({actions:{setCustomKnowledgeBaseUrlAction:setCustomKnowledgeBaseUrl,setCustomDocsUrlAction:setCustomDocsUrl,updateSelectedTabAction:updateSelectedTab}});return{openKnowledgeBasePanel:e.openKnowledgeBasePanel.bind(e),openDocsPanel:e.openDocsPanel.bind(e)}}function dataCenter(){var e=new DataCenter$1;return{openImporterPanel:e.openImporterPanel.bind(e)}}function handleEvents(){function n(e){if(!e||"string"!=typeof e)throw new SdkError("Please provide a valid event name!");if(!SdkEvents[e])throw new SdkError("Unknown event: "+e)}return{on:function(e,t){n(e),sdkEventManager.on.call(sdkEventManager,e,t)},off:function(e){n(e),sdkEventManager.off.call(sdkEventManager,e)}}}const mountPanelForResponse=e=>mountPanelForResponse$1(e,store$5),aiwareEvents=handleEvents();window&&(window.aiWare_initTesting=()=>{window.aiWare_store=store$5,window.aiWare_theme={darkTheme:darkTheme$1,lightTheme:lightTheme$1}},window.aiware={init:init,auth:authHelpers,helpCenter:helpCenter(),dataCenter:dataCenter(),on:aiwareEvents.on,off:aiwareEvents.off,hidePanel:hidePanel,unmountPanel:unmountPanel,store:store$5,registry:registry,registerComponent:registerComponent,AvailableWidgets:AvailableWidgets,mountPanelAction:mountPanel$1,unmountPanelAction:unmountPanel$1,hidePanelAction:hidePanel$1,updatePanelMicroFrontendPropsAction:updatePanelMicroFrontendProps,setData:setData,mountWidget:mountWidget,mountPanel:mountPanel,mountPanelForResponse:mountPanelForResponse,unmountWidget:unmountWidget,version:"sdk_release_version",commit:"ba8564acf",releaseDate:"2023-08-30T19:48:18.178Z"});export{Select$1 as $,AIWareIntlProvider as A,Box$1 as B,devErrorLogger as C,useLocation as D,DynamicModuleLoader as E,FormattedMessage$1 as F,Button$1 as G,useSearchParams as H,img$5 as I,StyledEngineProvider as J,LoadingButton$1 as K,LinearProgress$1 as L,authErrorMessage as M,Grid$1 as N,FormControl$1 as O,Provider$2 as P,TextField$1 as Q,Routes as R,Switch$1 as S,Typography$1 as T,classNames as U,resetPasswordRequest as V,InputLabel$1 as W,OutlinedInput$1 as X,InputAdornment$1 as Y,IconButton$1 as Z,_extends$3 as _,generateUtilityClasses as a,takeLatest$1 as a$,Location as a0,MenuItem$1 as a1,Divider$1 as a2,enableBetaFeatures as a3,Popover$1 as a4,all$2 as a5,CheckmarkFilled as a6,Bullet as a7,debounce_1 as a8,takeEvery$1 as a9,ENGINE_OWNER_TYPES as aA,ENGINE_FILTER_TYPES as aB,preferredLanguageSelector as aC,baseUrlSelector as aD,rootApiSelector as aE,sessionTokenSelector as aF,graphEndpointSelector as aG,controllerNodeRedImageSelector as aH,controllerUrlSelector as aI,automateControllerUrlSelector as aJ,flowCenterDialogSelector as aK,automateUrlSelector as aL,Portal$1 as aM,flowCenterDialogReducer as aN,List$2 as aO,ListItem$1 as aP,ListItemIcon$1 as aQ,ListItemText$1 as aR,flowCenterDialogAction as aS,img$q as aT,img$r as aU,img$t as aV,img$u as aW,Tooltip$1 as aX,img$k as aY,img$J as aZ,Skeleton$1 as a_,select as aa,call$j as ab,put as ac,showMessage as ad,MessageSeverity as ae,createTheme$1 as af,systemStyled as ag,useThemeProps$1 as ah,useId as ai,useControlled$1 as aj,usePreviousProps$1 as ak,useEventCallback as al,setRef as am,inputClasses$1 as an,inputBaseClasses$1 as ao,outlinedInputClasses$1 as ap,filledInputClasses$1 as aq,Popper$1 as ar,alpha as as,ListSubheader$1 as at,ClearIcon as au,ArrowDropDownIcon as av,Chip$1 as aw,createBox$1 as ax,createAction as ay,createReducer as az,styled$1 as b,__generator$2 as b$,fetchAllTags as b0,fetchFlows as b1,fetchTemplateGallery as b2,isRevisionsExistOnServerRequest as b3,FormLabel$1 as b4,default_1$e as b5,FormGroup$1 as b6,FormControlLabel$1 as b7,Checkbox$1 as b8,fetchTemplateGalleryFallback as b9,DialogContent$1 as bA,DialogActions$1 as bB,Snackbar$1 as bC,default_1$6 as bD,Search$1 as bE,img$l as bF,img$n as bG,img$X as bH,Tabs$2 as bI,Tab$2 as bJ,deleteEngine as bK,fetchEngine as bL,img$m as bM,AIWareFormatMessage as bN,FormattedDate as bO,fetchVeritoneGraphQLApi as bP,useTheme as bQ,KeyboardArrowRight as bR,KeyboardArrowLeft as bS,InputUnstyled as bT,isHostComponent as bU,getDefaultExportFromNamespaceIfNotNamed as bV,commonjsRequire as bW,reactDom as bX,Transition$1 as bY,_defineProperty$x as bZ,__awaiter$e as b_,Card$1 as ba,CardContent$1 as bb,img$o as bc,CardActions$1 as bd,flowStyles as be,NoResults as bf,CircularProgress$1 as bg,img$e as bh,Dialog$1 as bi,setApiEndpoint as bj,TableContainer$1 as bk,Table$1 as bl,TableHead$1 as bm,TableRow$1 as bn,TableCell$1 as bo,TableSortLabel$1 as bp,TableBody$1 as bq,img$j as br,default_1 as bs,ClickAwayListener as bt,Fade$1 as bu,img$v as bv,img$s as bw,img$T as bx,img$F as by,DialogTitle$1 as bz,Paper$1 as c,ReactMarkdown as c$,__spread as c0,React5 as c1,PropTypes as c2,TransitionGroup$1 as c3,connect$1 as c4,Bookmark as c5,EngineFlagIcons as c6,createAsyncThunk as c7,withStyles as c8,getConfigModule as c9,lightTheme$1 as cA,CssBaseline as cB,Hide as cC,has_1 as cD,Radio$2 as cE,createSvgIcon$2 as cF,_createCompounder as cG,_typeof$D as cH,_assertThisInitialized$x as cI,_setPrototypeOf$z as cJ,_toPropertyKey as cK,_inheritsLoose$2 as cL,hoistNonReactStatics_cjs as cM,commonjsGlobal$2 as cN,combineReducers as cO,createSelector$1 as cP,fork as cQ,statusPill as cR,AIWareThemeProvider$1 as cS,LocalizationProvider as cT,AdapterDateFns as cU,CalendarPicker as cV,Stack$4 as cW,Close$1 as cX,FullscreenExit as cY,Fullscreen as cZ,TabPanel as c_,getAuthModule as ca,getSnackbarModule as cb,AIWareCacheProvider as cc,img$U as cd,img$g as ce,img$f as cf,isEmpty_1 as cg,find_1 as ch,Backdrop$1 as ci,getDefaultMiddleware as cj,isNil_1 as ck,useForm as cl,UpDown as cm,Icon$1 as cn,get_1 as co,map_1 as cp,keys_1 as cq,RadioGroup$1 as cr,Avatar$1 as cs,img$z as ct,baseGraphQLApi as cu,default_1$9 as cv,Controller as cw,FormHelperText$2 as cx,img$i as cy,ThemeProvider as cz,capitalize$2 as d,CurlyBraces as d$,default_1$8 as d0,unmountPanel$1 as d1,AvailableComponents as d2,delay$1 as d3,hidePanel$1 as d4,mountPanel$1 as d5,DialogContentText$1 as d6,userSelector$2 as d7,MoreVert$1 as d8,Menu$1 as d9,_baseTrim as dA,_castSlice as dB,_stringToArray as dC,toString_1 as dD,upperFirst_1 as dE,isArrayLike_1 as dF,isString_1 as dG,toInteger_1 as dH,_baseGet as dI,_baseSlice as dJ,_castPath as dK,_toKey as dL,_isIndex as dM,channel$2 as dN,useFormContext as dO,useIntl as dP,useFieldArray as dQ,VideoCamera as dR,Image$1 as dS,Sound as dT,Description as dU,toNumber_1 as dV,FormProvider as dW,ProgressStepper as dX,size_1 as dY,findIndex_1 as dZ,take as d_,Edit as da,Upload as db,Delete$1 as dc,CustomTabs as dd,useBackupImg as de,img$1C as df,validate as dg,configSelector as dh,baseGraphQLApiWithError as di,VerifiedFilled as dj,Add as dk,ExpandLess$1 as dl,ExpandMore$1 as dm,Collapse$1 as dn,img$19 as dp,Filter$1 as dq,DynamicTable as dr,useTheme$3 as ds,getThemeProps as dt,useEnhancedEffect$3 as du,React as dv,_arrayPush as dw,isArray_1 as dx,_baseIteratee as dy,_baseToString as dz,_objectWithoutPropertiesLoose$2 as e,Information as e$,UnknownDocument as e0,VariableSizeList as e1,sdkEventManager as e2,SdkEvents as e3,SdkError as e4,distributionTypes as e5,EngineClassIcons as e6,Mode2 as e7,EngineModeIcons as e8,DeploymentModelIcons as e9,isSymbol_1 as eA,_baseMap as eB,_baseUnary as eC,_baseFindIndex as eD,_Set as eE,_setToArray as eF,_SetCache as eG,_cacheHas as eH,img$Q as eI,img$P as eJ,img$1y as eK,img$1x as eL,img$1w as eM,img$N as eN,img$1A as eO,img$M as eP,authSelector as eQ,ListItemAvatar$1 as eR,emphasize as eS,useSlotProps as eT,_arraySome as eU,EntityType as eV,generateState as eW,injectIntl as eX,ErrorBoundary$1 as eY,EPermissionAction as eZ,Process as e_,markdown as ea,guid as eb,EditList as ec,ButtonBase$1 as ed,isObject_1 as ee,_arrayMap as ef,_Symbol as eg,isArguments_1 as eh,_baseEach as ei,_arrayFilter as ej,_getNative as ek,eq_1 as el,_root as em,_Uint8Array as en,_overArg as eo,_isPrototype as ep,isObjectLike_1 as eq,_baseGetTag as er,_arrayLikeKeys as es,isBuffer$5 as et,isFunction_1 as eu,isTypedArray_1 as ev,_Stack as ew,_baseFor as ex,identity_1 as ey,_isIterateeCall as ez,clsx as f,index$1 as f$,Download as f0,NewFolder as f1,SpecialFolder as f2,User as f3,Source as f4,Search$2 as f5,selectIsOLPEnabled as f6,ListItemSecondaryAction$1 as f7,getLibraryModule as f8,cmsUrlSelector as f9,FixedSizeList as fA,selectUserOrgEdgeVersion as fB,EditAttributes as fC,gqlIntrospection as fD,ProcessingDetail as fE,img$y as fF,img$A as fG,img$6 as fH,FilterRemove as fI,AlarmTwo as fJ,tableInfiniteScroll as fK,CheckCircle as fL,FolderOpen as fM,Voice as fN,useDoubleClick as fO,FolderFilled as fP,Time as fQ,img$B as fR,Undefined as fS,PodcastSource as fT,YoutubeSource as fU,TVSource as fV,RadioSource as fW,selectOrgId as fX,navSectionStyles as fY,selectIsUserAdmin as fZ,AvatarGroup$1 as f_,SearchStructuredData as fa,Grow$1 as fb,index as fc,actions as fd,hasPermission as fe,UserAddFilled as ff,MenuList$1 as fg,MoveFolder as fh,EAuthResourceType as fi,Slide$1 as fj,img$c as fk,selectApiConfigs$2 as fl,selectPanelByPanelName as fm,FullScreenContainer as fn,EngineCategoryIcons as fo,isPermissionLoading as fp,Settings$2 as fq,Hamburger as fr,List as fs,enginesFilter as ft,panelsSelector as fu,Badge$1 as fv,MoreHor as fw,convertEntityToAuthResource as fx,AutoSizer as fy,InfiniteLoader as fz,generateUtilityClass as g,View as g$,ErrorState$2 as g0,Stepper$1 as g1,StepConnector$1 as g2,Step$1 as g3,StepLabel$1 as g4,isEqual_1 as g5,NullState$2 as g6,Group as g7,PermissionChangedAction as g8,Lock as g9,green$1 as gA,md5 as gB,selectIsSuperAdmin as gC,organizations_selector as gD,actions$5 as gE,AddUser as gF,selectors as gG,LibraryDropdown as gH,Remove as gI,Save as gJ,Input$3 as gK,getElement as gL,client$1 as gM,Copy as gN,ArrowForward as gO,Modal$1 as gP,Slider$1 as gQ,getDefaultExportFromCjs as gR,_getSymbols as gS,stubArray_1 as gT,_baseGetAllKeys as gU,_getTag as gV,_nodeUtil as gW,_getAllKeys as gX,_castFunction as gY,Article as gZ,Task as g_,useOrganizationPermissions as ga,EAuthSubResourceType as gb,AddGroup as gc,initialConfigSelector as gd,EMessageTypes as ge,errors as gf,ConfirmationModal as gg,EnumHelpers as gh,formatBytes as gi,NotInterested as gj,mountPanelForResponse$1 as gk,default_1$a as gl,tableStyles as gm,ArrowDown as gn,ArrowUp as go,useInterval as gp,Iam as gq,safeFormatMessage as gr,contextMenuStyles as gs,Users as gt,SecurityGroup as gu,getOrganizationPanelModule as gv,Lock2 as gw,EApplicationConfigLevel as gx,NoApps as gy,EApplicationConfigType as gz,composeClasses as h,mountPanel as h$,_objectSpread2 as h0,serialize as h1,stringify$4 as h2,compile as h3,isNumber_1 as h4,Check as h5,EngineIconsRenderer as h6,FormattedRelativeTime$1 as h7,BottomQueue as h8,TopQueue as h9,PackagesAvatar as hA,actionChannel as hB,cancelled as hC,flush$4 as hD,tableSearchComponents as hE,cancel as hF,FlowTemplate as hG,Node as hH,Palette as hI,FlowCenter2 as hJ,ArrowBack as hK,Schema$1 as hL,panelComponents as hM,img$1 as hN,img$x as hO,AutomateNode as hP,Clear as hQ,ExpandLess as hR,ExpandMore as hS,registry as hT,registerComponent as hU,AvailableWidgets as hV,updatePanelMicroFrontendProps as hW,setData as hX,root as hY,mountWidget as hZ,unmountWidget as h_,Pause as ha,Cancel as hb,Folder as hc,Hidden as hd,dateRangeFilter as he,statusFilter as hf,TableLoadingState as hg,setDuration as hh,resetDuration as hi,createStack as hj,ButtonGroupContext$1 as hk,toFinite_1 as hl,_baseForOwn as hm,_arrayReduce as hn,hasIn_1 as ho,now_1 as hp,useSyncExternalStoreExports as hq,Engines as hr,EngineComponentLoader as hs,EngineFieldType as ht,imageUpload as hu,characterCountTextField as hv,tabsClasses$1 as hw,Packages as hx,Resources$1 as hy,selectUserCanCreatePackage as hz,createSvgIcon$1 as i,unmountPanel as i0,hidePanel as i1,unmountAllPanel as i2,init as i3,aiwareEvents as i4,jsxRuntime as j,interopRequireDefault as k,createSlice as l,makeStyles as m,Route as n,useDispatch as o,useSelector as p,authStatusSelector as q,react$1 as r,store$5 as s,authContextSelector as t,useThemeProps as u,AuthContext as v,lodash as w,Alert$1 as x,betaFeaturesSelector as y,useNavigate as z};
1531
+ `,l={entityId:t,entityType:e};try{a=yield baseGraphQLApi({query:s,operationName:n,variables:l,graphEndpoint:u,token:d})}catch(e){i=!0}if(a.errors){if(0===(o=a.errors.filter(({message:e})=>e.includes(' does not exist in "AuthPermissionType" enum.')).map(({message:e})=>{var t='Value "',n=e.substring(t.length).indexOf('"');return e.substring(t.length,t.length+n)})).length)throw i=!0,a={},new Error((null==(f=(a.errors||[])[0])?void 0:f.message)||"Error")}else i=!0}const c=a.data||{};return Object.keys(c).map(e=>{var t=e.split("__");return 3===t.length?{fetchedTargetEntityType:t[0],fetchedTargetGroupType:t[1],fetchedTargetAction:t[2],hasPermission:c[e][0].hasPermission}:{fetchedTargetEntityType:t[0],fetchedTargetAction:t[1],hasPermission:c[e][0].hasPermission}}).reduce((e,t)=>{var n=t.fetchedTargetGroupType||t.fetchedTargetEntityType;return t.hasPermission&&(e[n]||(e[n]={}),e[n][t.fetchedTargetAction]=t.hasPermission),e},{})})}function getMyRights(t){return __awaiter(this,void 0,void 0,function*(){var e="getMyRights";return(yield baseGraphQLApiWithError(Object.assign({query:"\n query getMyRights {\n myRights {\n operations\n }\n }\n ",operationName:e},t))).myRights.operations})}const selectPermissionsByEntity=(t,n,r)=>e=>{return t&&n&&(e=e[namespace].permissionsByObject[t])&&e[n]?e[n][r||t]:void 0},selectMyRights=e=>e[namespace].rights;var index=Object.freeze({__proto__:null,selectPermissionsByEntity:selectPermissionsByEntity,selectMyRights:selectMyRights});function*fetchObjectPermissions(t){var{entityId:t,entityType:n}=t.payload,i=yield select(selectApiConfigs$2),e=yield select(graphEndpointSelector),o=yield select(sessionTokenSelector),a=yield select(selectIsOLPEnabled),r=yield select(selectPermissionsByEntity(n,t));if(!r||"success"!==r.status&&"pending"!==r.status){yield put(actions.fetchObjectPermissionsStarted({entityId:t,entityType:n}));try{let r={};if(a)r=yield call$j(getObjectPermissions,e,o,{entityType:n,entityId:t});else{let e=yield select(selectMyRights);if("success"!==e.status&&"pending"!==e.status){yield put(actions.fetchMyRightsStarted);try{var s=yield call$j(getMyRights,i);yield put(actions.fetchMyRightsSucceeded(s)),e=yield select(selectMyRights)}catch(e){throw yield put(actions.fetchMyRightsFailed),e}}else"pending"===e.status&&(yield take([actions.fetchMyRightsFailed,actions.fetchMyRightsSucceeded]),e=yield select(selectMyRights));const l=e["myRights"];getPermissionTypesToQuery(n).forEach(n=>{var{action:e,resource:t}=n.targetActions.reduce((e,t)=>(e.action[t.targetAction]=convertPermissionsToRights(t.resource||n.targetObjectType,t.targetAction,l),e.resource=t.resource,e),{action:{}});r[t||n.targetObjectType]=e})}yield put(actions.fetchObjectPermissionsSucceeded({entityId:t,entityType:n,permissions:r}))}catch(e){actions.fetchObjectPermissionsFailed({entityId:t,entityType:n})}}}function*watchPermissionsStart(){yield takeEvery$1(actions.fetchObjectPermissionsStart.type,fetchObjectPermissions)}function*rootSaga(){yield all$2([watchPermissionsStart()])}function getPermissionsModule(){return{id:namespace,reducerMap:{[namespace]:permissionsReducer},sagas:[rootSaga],initialActions:[]}}const useOrganizationPermissions=e=>{const t=react$1.exports.useRef(),n=useDispatch(),r=null==(o=useSelector(userSelector$2).organization)?void 0:o.organizationId,i=useSelector(selectPermissionsByEntity(EAuthResourceType.Organization,String(r),e));react$1.exports.useEffect(()=>{!r||i&&"failure"!==i.status&&"idle"!==i.status&&t.current===r||(t.current=r,n(actions.fetchObjectPermissionsStart({entityType:EAuthResourceType.Organization,entityId:String(r)})))},[n,r,i]);var o=react$1.exports.useCallback(e=>{return!isPermissionLoading(i)&&hasPermission(i,e)},[i]);return{permissions:i,hasPermission:o}},rateLimiter=new RateLimiter,checkAndDecodeBase64String=t=>{if(null==t||!t.trim())return t;try{return window.btoa(window.atob(t))==t?window.atob(t):t}catch(e){return t}};function SnackbarRenderer(){return jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getSnackbarModule()]},{children:jsxRuntime.exports.jsx(CustomSnackbar,{})}))}))}store$5.addModules([getWidgetsModule(),getPanelsModule(registry,registryLookup),getDataModule(),getConfigModule(),getAuthModule(),getPermissionsModule()]);let hasLoaded=!1;const AppBarPreLoader=()=>{var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&!hasLoaded&&(hasLoaded=!0,setTimeout(()=>{store$5.addModules([getAppbarPanelModule()])},0)),null};function ApplicationDialogPreLoader(){var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&hasLoaded?jsxRuntime.exports.jsx(ApplicationDialog,{}):null}const authHelpers={updateToken(e){e?store$5.dispatch(updateTokenRequest({token:e})):console.error("[AiWARE JS]: Please provide a valid token!")},logout(e){"function"==typeof e?(e(),setTimeout(()=>{store$5.dispatch(logout())},1e3)):store$5.dispatch(logout())},reportAppActivity(e){rateLimiter.checkIfCanCall(e)&&store$5.dispatch(updateActivityStatus$1())}};function PortalRenderer(){return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(SupportCenterPixel,{}),jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(AppBarPreLoader,{})}))]})}function ApplicationDialogRenderer(){return jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ApplicationDialogPreLoader,{})})}))})}const ThemeInitializer=()=>(useTheme(),null),root=getElement("aiWARE"),reactDOMroot=(root.classList.add("aiware-el"),client$1.createRoot(root)),mountWidget=("_auth"===window.name?handleImplicitRedirect(window.location.hash,window.opener):reactDOMroot.render(jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsxs(AIWareThemeProvider$1,{children:[jsxRuntime.exports.jsx(PortalRenderer,{}),jsxRuntime.exports.jsx(SnackbarRenderer,{}),jsxRuntime.exports.jsx(ApplicationDialogRenderer,{}),jsxRuntime.exports.jsx(ThemeInitializer,{})]})})),(e,t)=>{var n=getUniqueID(),{name:e,elementId:r,config:i}=e;return e&&r&&i||console.error("[aiwarejs-error]: `mountWidget` function should include all the following params: name, elementId, config"),store$5.dispatch(mountWidget$1({elementId:r,widgetName:e,widgetConfig:i,widgetId:n,onComplete:t})),n}),unmountWidget=e=>(store$5.dispatch(unmountWidget$1(e)),!0),mountPanel=(e,t)=>{const n=e.panelId||getUniqueID();var{microFrontend:e,panelConfig:r}=e;store$5.dispatch(mountPanel$1({microFrontend:e,panelId:n,panelConfig:r}));const i=[...(null==(e=null==r?void 0:r.header)?void 0:e.actions)||[],...(null==(e=null==r?void 0:r.footer)?void 0:e.actions)||[]].filter(e=>e.submit).map(e=>e.action);r={id:n,sagas:[function*(){yield takeEvery$1(i.map(e=>e.type),function*(){var e=(yield select(e=>e.data.find(e=>e.id===n)))["data"];t&&t(e)})}]};return store$5.addModule(r),n},unmountPanel=e=>(store$5.dispatch(unmountPanel$1(e)),!0),hidePanel=e=>(store$5.dispatch(hidePanel$1(e)),!0),unmountAllPanel=()=>{store$5.dispatch(unmountAllPanel$1(""))};function init(e,t){var n,e=validateConfig(e);e?(n=e["authToken"],n=checkAndDecodeBase64String(n||""),store$5.dispatch(getInitConfig(Object.assign(Object.assign({},e),{authToken:n,onComplete:t})))):console.error("@aiware/js initialization failed. Please pass valid configuration object.")}function helpCenter(){var e=new HelpCenter$2({actions:{setCustomKnowledgeBaseUrlAction:setCustomKnowledgeBaseUrl,setCustomDocsUrlAction:setCustomDocsUrl,updateSelectedTabAction:updateSelectedTab}});return{openKnowledgeBasePanel:e.openKnowledgeBasePanel.bind(e),openDocsPanel:e.openDocsPanel.bind(e)}}function dataCenter(){var e=new DataCenter$1;return{openImporterPanel:e.openImporterPanel.bind(e)}}function handleEvents(){function n(e){if(!e||"string"!=typeof e)throw new SdkError("Please provide a valid event name!");if(!SdkEvents[e])throw new SdkError("Unknown event: "+e)}return{on:function(e,t){n(e),sdkEventManager.on.call(sdkEventManager,e,t)},off:function(e){n(e),sdkEventManager.off.call(sdkEventManager,e)}}}const mountPanelForResponse=e=>mountPanelForResponse$1(e,store$5),aiwareEvents=handleEvents();window&&(window.aiWare_initTesting=()=>{window.aiWare_store=store$5,window.aiWare_theme={darkTheme:darkTheme$1,lightTheme:lightTheme$1}},window.aiware={init:init,auth:authHelpers,helpCenter:helpCenter(),dataCenter:dataCenter(),on:aiwareEvents.on,off:aiwareEvents.off,hidePanel:hidePanel,unmountPanel:unmountPanel,store:store$5,registry:registry,registerComponent:registerComponent,AvailableWidgets:AvailableWidgets,mountPanelAction:mountPanel$1,unmountPanelAction:unmountPanel$1,hidePanelAction:hidePanel$1,updatePanelMicroFrontendPropsAction:updatePanelMicroFrontendProps,setData:setData,mountWidget:mountWidget,mountPanel:mountPanel,mountPanelForResponse:mountPanelForResponse,unmountWidget:unmountWidget,version:"sdk_release_version",commit:"67b86239a",releaseDate:"2023-08-30T22:22:45.374Z"});export{Select$1 as $,AIWareIntlProvider as A,Box$1 as B,devErrorLogger as C,useLocation as D,DynamicModuleLoader as E,FormattedMessage$1 as F,Button$1 as G,useSearchParams as H,img$5 as I,StyledEngineProvider as J,LoadingButton$1 as K,LinearProgress$1 as L,authErrorMessage as M,Grid$1 as N,FormControl$1 as O,Provider$2 as P,TextField$1 as Q,Routes as R,Switch$1 as S,Typography$1 as T,classNames as U,resetPasswordRequest as V,InputLabel$1 as W,OutlinedInput$1 as X,InputAdornment$1 as Y,IconButton$1 as Z,_extends$3 as _,generateUtilityClasses as a,takeLatest$1 as a$,Location as a0,MenuItem$1 as a1,Divider$1 as a2,enableBetaFeatures as a3,Popover$1 as a4,all$2 as a5,CheckmarkFilled as a6,Bullet as a7,debounce_1 as a8,takeEvery$1 as a9,ENGINE_OWNER_TYPES as aA,ENGINE_FILTER_TYPES as aB,preferredLanguageSelector as aC,baseUrlSelector as aD,rootApiSelector as aE,sessionTokenSelector as aF,graphEndpointSelector as aG,controllerNodeRedImageSelector as aH,controllerUrlSelector as aI,automateControllerUrlSelector as aJ,flowCenterDialogSelector as aK,automateUrlSelector as aL,Portal$1 as aM,flowCenterDialogReducer as aN,List$2 as aO,ListItem$1 as aP,ListItemIcon$1 as aQ,ListItemText$1 as aR,flowCenterDialogAction as aS,img$q as aT,img$r as aU,img$t as aV,img$u as aW,Tooltip$1 as aX,img$k as aY,img$J as aZ,Skeleton$1 as a_,select as aa,call$j as ab,put as ac,showMessage as ad,MessageSeverity as ae,createTheme$1 as af,systemStyled as ag,useThemeProps$1 as ah,useId as ai,useControlled$1 as aj,usePreviousProps$1 as ak,useEventCallback as al,setRef as am,inputClasses$1 as an,inputBaseClasses$1 as ao,outlinedInputClasses$1 as ap,filledInputClasses$1 as aq,Popper$1 as ar,alpha as as,ListSubheader$1 as at,ClearIcon as au,ArrowDropDownIcon as av,Chip$1 as aw,createBox$1 as ax,createAction as ay,createReducer as az,styled$1 as b,__generator$2 as b$,fetchAllTags as b0,fetchFlows as b1,fetchTemplateGallery as b2,isRevisionsExistOnServerRequest as b3,FormLabel$1 as b4,default_1$e as b5,FormGroup$1 as b6,FormControlLabel$1 as b7,Checkbox$1 as b8,fetchTemplateGalleryFallback as b9,DialogContent$1 as bA,DialogActions$1 as bB,Snackbar$1 as bC,default_1$6 as bD,Search$1 as bE,img$l as bF,img$n as bG,img$X as bH,Tabs$2 as bI,Tab$2 as bJ,deleteEngine as bK,fetchEngine as bL,img$m as bM,AIWareFormatMessage as bN,FormattedDate as bO,fetchVeritoneGraphQLApi as bP,useTheme as bQ,KeyboardArrowRight as bR,KeyboardArrowLeft as bS,InputUnstyled as bT,isHostComponent as bU,getDefaultExportFromNamespaceIfNotNamed as bV,commonjsRequire as bW,reactDom as bX,Transition$1 as bY,_defineProperty$x as bZ,__awaiter$e as b_,Card$1 as ba,CardContent$1 as bb,img$o as bc,CardActions$1 as bd,flowStyles as be,NoResults as bf,CircularProgress$1 as bg,img$e as bh,Dialog$1 as bi,setApiEndpoint as bj,TableContainer$1 as bk,Table$1 as bl,TableHead$1 as bm,TableRow$1 as bn,TableCell$1 as bo,TableSortLabel$1 as bp,TableBody$1 as bq,img$j as br,default_1 as bs,ClickAwayListener as bt,Fade$1 as bu,img$v as bv,img$s as bw,img$T as bx,img$F as by,DialogTitle$1 as bz,Paper$1 as c,ReactMarkdown as c$,__spread as c0,React5 as c1,PropTypes as c2,TransitionGroup$1 as c3,connect$1 as c4,Bookmark as c5,EngineFlagIcons as c6,createAsyncThunk as c7,withStyles as c8,getConfigModule as c9,lightTheme$1 as cA,CssBaseline as cB,Hide as cC,has_1 as cD,Radio$2 as cE,createSvgIcon$2 as cF,_createCompounder as cG,_typeof$D as cH,_assertThisInitialized$x as cI,_setPrototypeOf$z as cJ,_toPropertyKey as cK,_inheritsLoose$2 as cL,hoistNonReactStatics_cjs as cM,commonjsGlobal$2 as cN,combineReducers as cO,createSelector$1 as cP,fork as cQ,statusPill as cR,AIWareThemeProvider$1 as cS,LocalizationProvider as cT,AdapterDateFns as cU,CalendarPicker as cV,Stack$4 as cW,Close$1 as cX,FullscreenExit as cY,Fullscreen as cZ,TabPanel as c_,getAuthModule as ca,getSnackbarModule as cb,AIWareCacheProvider as cc,img$U as cd,img$g as ce,img$f as cf,isEmpty_1 as cg,find_1 as ch,Backdrop$1 as ci,getDefaultMiddleware as cj,isNil_1 as ck,useForm as cl,UpDown as cm,Icon$1 as cn,get_1 as co,map_1 as cp,keys_1 as cq,RadioGroup$1 as cr,Avatar$1 as cs,img$z as ct,baseGraphQLApi as cu,default_1$9 as cv,Controller as cw,FormHelperText$2 as cx,img$i as cy,ThemeProvider as cz,capitalize$2 as d,CurlyBraces as d$,default_1$8 as d0,unmountPanel$1 as d1,AvailableComponents as d2,delay$1 as d3,hidePanel$1 as d4,mountPanel$1 as d5,DialogContentText$1 as d6,userSelector$2 as d7,MoreVert$1 as d8,Menu$1 as d9,_baseTrim as dA,_castSlice as dB,_stringToArray as dC,toString_1 as dD,upperFirst_1 as dE,isArrayLike_1 as dF,isString_1 as dG,toInteger_1 as dH,_baseGet as dI,_baseSlice as dJ,_castPath as dK,_toKey as dL,_isIndex as dM,channel$2 as dN,useFormContext as dO,useIntl as dP,useFieldArray as dQ,VideoCamera as dR,Image$1 as dS,Sound as dT,Description as dU,toNumber_1 as dV,FormProvider as dW,ProgressStepper as dX,size_1 as dY,findIndex_1 as dZ,take as d_,Edit as da,Upload as db,Delete$1 as dc,CustomTabs as dd,useBackupImg as de,img$1C as df,validate as dg,configSelector as dh,baseGraphQLApiWithError as di,VerifiedFilled as dj,Add as dk,ExpandLess$1 as dl,ExpandMore$1 as dm,Collapse$1 as dn,img$19 as dp,Filter$1 as dq,DynamicTable as dr,useTheme$3 as ds,getThemeProps as dt,useEnhancedEffect$3 as du,React as dv,_arrayPush as dw,isArray_1 as dx,_baseIteratee as dy,_baseToString as dz,_objectWithoutPropertiesLoose$2 as e,Information as e$,UnknownDocument as e0,VariableSizeList as e1,sdkEventManager as e2,SdkEvents as e3,SdkError as e4,distributionTypes as e5,EngineClassIcons as e6,Mode2 as e7,EngineModeIcons as e8,DeploymentModelIcons as e9,isSymbol_1 as eA,_baseMap as eB,_baseUnary as eC,_baseFindIndex as eD,_Set as eE,_setToArray as eF,_SetCache as eG,_cacheHas as eH,img$Q as eI,img$P as eJ,img$1y as eK,img$1x as eL,img$1w as eM,img$N as eN,img$1A as eO,img$M as eP,authSelector as eQ,ListItemAvatar$1 as eR,emphasize as eS,useSlotProps as eT,_arraySome as eU,EntityType as eV,generateState as eW,injectIntl as eX,ErrorBoundary$1 as eY,EPermissionAction as eZ,Process as e_,markdown as ea,guid as eb,EditList as ec,ButtonBase$1 as ed,isObject_1 as ee,_arrayMap as ef,_Symbol as eg,isArguments_1 as eh,_baseEach as ei,_arrayFilter as ej,_getNative as ek,eq_1 as el,_root as em,_Uint8Array as en,_overArg as eo,_isPrototype as ep,isObjectLike_1 as eq,_baseGetTag as er,_arrayLikeKeys as es,isBuffer$5 as et,isFunction_1 as eu,isTypedArray_1 as ev,_Stack as ew,_baseFor as ex,identity_1 as ey,_isIterateeCall as ez,clsx as f,index$1 as f$,Download as f0,NewFolder as f1,SpecialFolder as f2,User as f3,Source as f4,Search$2 as f5,selectIsOLPEnabled as f6,ListItemSecondaryAction$1 as f7,getLibraryModule as f8,cmsUrlSelector as f9,FixedSizeList as fA,selectUserOrgEdgeVersion as fB,EditAttributes as fC,gqlIntrospection as fD,ProcessingDetail as fE,img$y as fF,img$A as fG,img$6 as fH,FilterRemove as fI,AlarmTwo as fJ,tableInfiniteScroll as fK,CheckCircle as fL,FolderOpen as fM,Voice as fN,useDoubleClick as fO,FolderFilled as fP,Time as fQ,img$B as fR,Undefined as fS,PodcastSource as fT,YoutubeSource as fU,TVSource as fV,RadioSource as fW,selectOrgId as fX,navSectionStyles as fY,selectIsUserAdmin as fZ,AvatarGroup$1 as f_,SearchStructuredData as fa,Grow$1 as fb,index as fc,actions as fd,hasPermission as fe,UserAddFilled as ff,MenuList$1 as fg,MoveFolder as fh,EAuthResourceType as fi,Slide$1 as fj,img$c as fk,selectApiConfigs$2 as fl,selectPanelByPanelName as fm,FullScreenContainer as fn,EngineCategoryIcons as fo,isPermissionLoading as fp,Settings$2 as fq,Hamburger as fr,List as fs,enginesFilter as ft,panelsSelector as fu,Badge$1 as fv,MoreHor as fw,convertEntityToAuthResource as fx,AutoSizer as fy,InfiniteLoader as fz,generateUtilityClass as g,View as g$,ErrorState$2 as g0,Stepper$1 as g1,StepConnector$1 as g2,Step$1 as g3,StepLabel$1 as g4,isEqual_1 as g5,NullState$2 as g6,Group as g7,PermissionChangedAction as g8,Lock as g9,green$1 as gA,md5 as gB,selectIsSuperAdmin as gC,organizations_selector as gD,actions$5 as gE,AddUser as gF,selectors as gG,LibraryDropdown as gH,Remove as gI,Save as gJ,Input$3 as gK,getElement as gL,client$1 as gM,Copy as gN,ArrowForward as gO,Modal$1 as gP,Slider$1 as gQ,getDefaultExportFromCjs as gR,_getSymbols as gS,stubArray_1 as gT,_baseGetAllKeys as gU,_getTag as gV,_nodeUtil as gW,_getAllKeys as gX,_castFunction as gY,Article as gZ,Task as g_,useOrganizationPermissions as ga,EAuthSubResourceType as gb,AddGroup as gc,initialConfigSelector as gd,EMessageTypes as ge,errors as gf,ConfirmationModal as gg,EnumHelpers as gh,formatBytes as gi,NotInterested as gj,mountPanelForResponse$1 as gk,default_1$a as gl,tableStyles as gm,ArrowDown as gn,ArrowUp as go,useInterval as gp,Iam as gq,safeFormatMessage as gr,contextMenuStyles as gs,Users as gt,SecurityGroup as gu,getOrganizationPanelModule as gv,Lock2 as gw,EApplicationConfigLevel as gx,NoApps as gy,EApplicationConfigType as gz,composeClasses as h,mountPanel as h$,_objectSpread2 as h0,serialize as h1,stringify$4 as h2,compile as h3,isNumber_1 as h4,Check as h5,EngineIconsRenderer as h6,FormattedRelativeTime$1 as h7,BottomQueue as h8,TopQueue as h9,PackagesAvatar as hA,actionChannel as hB,cancelled as hC,flush$4 as hD,tableSearchComponents as hE,cancel as hF,FlowTemplate as hG,Node as hH,Palette as hI,FlowCenter2 as hJ,ArrowBack as hK,Schema$1 as hL,panelComponents as hM,img$1 as hN,img$x as hO,AutomateNode as hP,Clear as hQ,ExpandLess as hR,ExpandMore as hS,registry as hT,registerComponent as hU,AvailableWidgets as hV,updatePanelMicroFrontendProps as hW,setData as hX,root as hY,mountWidget as hZ,unmountWidget as h_,Pause as ha,Cancel as hb,Folder as hc,Hidden as hd,dateRangeFilter as he,statusFilter as hf,TableLoadingState as hg,setDuration as hh,resetDuration as hi,createStack as hj,ButtonGroupContext$1 as hk,toFinite_1 as hl,_baseForOwn as hm,_arrayReduce as hn,hasIn_1 as ho,now_1 as hp,useSyncExternalStoreExports as hq,Engines as hr,EngineComponentLoader as hs,EngineFieldType as ht,imageUpload as hu,characterCountTextField as hv,tabsClasses$1 as hw,Packages as hx,Resources$1 as hy,selectUserCanCreatePackage as hz,createSvgIcon$1 as i,unmountPanel as i0,hidePanel as i1,unmountAllPanel as i2,init as i3,aiwareEvents as i4,jsxRuntime as j,interopRequireDefault as k,createSlice as l,makeStyles as m,Route as n,useDispatch as o,useSelector as p,authStatusSelector as q,react$1 as r,store$5 as s,authContextSelector as t,useThemeProps as u,AuthContext as v,lodash as w,Alert$1 as x,betaFeaturesSelector as y,useNavigate as z};
package/js-core.esm.js.gz CHANGED
Binary file
package/js-core.esm4.js CHANGED
@@ -10,4 +10,4 @@ import{i as createSvgIcon,k as interopRequireDefault,j as jsxRuntime,F as Format
10
10
  message
11
11
  }
12
12
  }
13
- `,variables:{input:{userName:r}}};try{return yield fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)})}catch(e){return devErrorLogger(e),null}}),createUserInHub=(e,t)=>__awaiter(void 0,void 0,void 0,function*(){try{return!!(yield(yield fetch(e+"/hub/v1/admin/users",{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8",Origin:"https://hub.veritone.com"},body:JSON.stringify(Object.assign(Object.assign({},t),{userUrl:e+"/auth/confirm-email?token=%token%&username=%username%"}))})).json()).success}catch(e){return devErrorLogger(e),!1}}),setPassword=(e,t,r)=>__awaiter(void 0,void 0,void 0,function*(){}),activateUser=()=>__awaiter(void 0,void 0,void 0,function*(){}),updateUserOrg=()=>__awaiter(void 0,void 0,void 0,function*(){}),BlueLinkText=({onClick:e,text:t,type:r})=>jsxRuntime.exports.jsx(Typography,Object.assign({sx:{fontFamily:"Nunito",fontSize:"14px",lineHeight:"20px",letterSpacing:"-1.30385e-09px",color:"#0C53B0",cursor:"pointer"},onClick:e,"data-testid":`os-auth-${r}-link-button`},{children:t})),OrDivider=()=>jsxRuntime.exports.jsxs(Box,Object.assign({sx:{marginTop:"20px",position:"relative"}},{children:[jsxRuntime.exports.jsx(Divider,{sx:{margin:"0 14px",color:"#D5DFE9"}}),jsxRuntime.exports.jsx(Typography,Object.assign({sx:{color:"#D5DFE9",fontSize:"14px",margin:0,top:"-12px",padding:"0 10px",position:"absolute",left:"calc(50% - 15px)",background:"#FFFFFF",fontFamily:"Roboto",letterSpacing:"- 1.30385e-09px",fontStyle:"normal",fontWeight:"normal"}},{children:"or"}))]})),SLICE_NAME="signUp",namespace="initStep",initialState={env:"",status:"idle",activeStep:1,1:{email:"",firstName:"",lastName:""},2:{orgName:"",teamSize:"",country:"",industry:""},errors:{1:{email:!1,firstName:!1,lastName:!1},2:{orgName:!1,country:!1}},userUUID:"",userEmail:"",organizationUUID:""};function isKeyOfObject(e,t){return e in t}function validateEmail(e){return e.match(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)}const signUpSlice=createSlice({name:SLICE_NAME+"/"+namespace,initialState:initialState,reducers:{setStep(e,t){e.activeStep=t.payload},setValue(e,t){var{key:t,value:r}=t.payload;isKeyOfObject(t,e[e.activeStep])&&(e[e.activeStep][t]=r,isKeyOfObject(t,e.errors[e.activeStep]))&&(e.errors[e.activeStep][t]=!1)},validate(e){for(var[t,r]of Object.entries(e[e.activeStep]))isKeyOfObject(t,e.errors[e.activeStep])&&!r&&(e.errors[e.activeStep][t]=!0);1!==e.activeStep||validateEmail(e[1].email)||(e.errors[1].email=!0)},createUserStart(e){e.status="loading"},createUserSuccess(e){e.status="success"},createUserFailure(e){e.status="failure"},setEnv(e,t){t=t.payload;e.env=`https://hub${"prod"===t?"":"."+t}.aiware.com`},resetState:()=>initialState,setPasswordStart(e,t){e.status="loading"},setPasswordSuccess(e){e.status="success"},setPasswordFailure(e){e.status="failure"},activateUserStart(e,t){e.status="loading"},activateUserSuccess(e,t){e.status="success",e.organizationUUID=t.payload.organizationUUID,e.userEmail=t.payload.userEmail},activateUserFailure(e){e.status="failure"},updateUserOrgStart(e,t){e.status="loading"},updateUserOrgSuccess(e){e.status="success"},updateUserOrgFailure(e){e.status="failure"}}}),actions=signUpSlice.actions;var signUpSlice$1=signUpSlice.reducer,whitespaces$2="\t\n\v\f\r                 \u2028\u2029\ufeff",uncurryThis$1=functionUncurryThis,requireObjectCoercible=requireObjectCoercible$8,toString$1=toString$9,whitespaces$1=whitespaces$2,replace$1=functionUncurryThis("".replace),whitespace="["+whitespaces$1+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),createMethod=function(t){return function(e){e=toString$1(requireObjectCoercible(e));return 1&t&&(e=replace$1(e,ltrim,"")),e=2&t?replace$1(e,rtrim,""):e}},stringTrim={start:createMethod(1),end:createMethod(2),trim:createMethod(3)},PROPER_FUNCTION_NAME=functionName.PROPER,fails$1=fails$n,whitespaces=whitespaces$2,non="​…᠎",stringTrimForced=function(e){return fails$1(function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME&&whitespaces[e].name!==e})},$=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$({target:"String",proto:!0,forced:stringTrimForced("trim")},{trim:function(){return $trim(this)}});const selectStatus=e=>{return null==(e=null==e?void 0:e[SLICE_NAME])?void 0:e.status},selectActiveStep=e=>{return null==(e=null==e?void 0:e[SLICE_NAME])?void 0:e.activeStep},selectFormValues=e=>{var t;return null==(t=null==e?void 0:e[SLICE_NAME])?void 0:t[null==(t=null==e?void 0:e[SLICE_NAME])?void 0:t.activeStep]},selectErrors=e=>{var t;return null==(t=null==(t=null==e?void 0:e[SLICE_NAME])?void 0:t.errors)?void 0:t[null==(t=null==e?void 0:e[SLICE_NAME])?void 0:t.activeStep]},selectEnv=e=>{return null==(e=null==e?void 0:e[SLICE_NAME])?void 0:e.env},selectCreateUserPayload=e=>{var{1:{email:e,firstName:t,lastName:r},2:{orgName:o,teamSize:n,country:a,industry:i}}=(null==e?void 0:e[SLICE_NAME])||{1:{},2:{}};return{userFirstName:t.trim(),userLastName:r.trim(),userEmail:e,userPhoneNumber:"",userOccupation:"",userCompany:"",organizationName:o.trim(),salesforceAttributes:JSON.stringify({teamSize:n,country:a,industry:i})}};function*createUserSaga(e){try{var t=yield select(selectEnv),r=yield select(selectCreateUserPayload);(yield call$m(createUserInHub,t,r))?yield put(actions.createUserSuccess()):(yield put(actions.createUserFailure()),yield put(showMessage({content:"Cannot create user at this time. Please try again later or use a different email address",severity:MessageSeverity.Error})))}catch(e){yield put(actions.createUserFailure()),yield put(showMessage({content:"Cannot create user at this time. Please try again later or use a different email address",severity:MessageSeverity.Error})),devErrorLogger(e)}}function*setPasswordSaga(e){var{password:e,userId:t,token:r}=e.payload;try{yield call$m(setPassword,e,t,r),yield put(actions.setPasswordSuccess())}catch(e){yield put(actions.setPasswordFailure()),console.log(e)}}function*activateUserSaga(e){try{var{userInviteToken:t,userPassword:r}=e.payload,{organizationUUID:o,userEmail:n}=yield call$m(activateUser,t,r);o&&n&&(yield put(actions.activateUserSuccess({organizationUUID:o,userEmail:n})))}catch(e){yield put(actions.activateUserFailure()),console.log(e)}}function*updateUserOrgSaga(e){try{var{organizationUUID:t,paid:r}=e.payload;yield call$m(updateUserOrg,t,r),yield put(actions.updateUserOrgSuccess())}catch(e){yield put(actions.updateUserOrgFailure()),console.log(e)}}function*createUserWatcher(){yield takeEvery$1(actions.createUserStart.type,createUserSaga)}function*setPasswordWatcher(){yield takeEvery$1(actions.setPasswordStart.type,setPasswordSaga)}function*activateUserWatcher(){yield takeEvery$1(actions.activateUserStart.type,activateUserSaga)}function*updateUserOrgWatcher(){yield takeEvery$1(actions.updateUserOrgStart.type,updateUserOrgSaga)}function*rootSaga(){yield all([createUserWatcher(),setPasswordWatcher(),activateUserWatcher(),updateUserOrgWatcher()])}function getSignUpModule(){return{id:SLICE_NAME,reducerMap:{[SLICE_NAME]:signUpSlice$1},sagas:[rootSaga],initialActions:[]}}const useStyles$2=makeStyles()((e,{label:t})=>{t="Sign Up"===t;return{button:{position:"absolute",right:t?"220px":"40px",top:"30px",background:t?"#388E3C":"none",border:t?"none":"1px solid #5C6269",color:t?"white":"#5C6269",borderRadius:"4px",paddingLeft:"14px",paddingRight:"14px",fontWeight:400,"&:hover":{background:t?"#42a647":"none"}}}}),SignUpButton=({label:e="Sign Up",navigateTo:t="sign-up"})=>{const r=useNavigate();var o=useSelector(selectStatus),n=useStyles$2({label:e})["classes"];return jsxRuntime.exports.jsx(Button,Object.assign({className:n.button,onClick:()=>{r("/ui/auth/"+t)},disabled:"sign-up"!==t&&"loading"===o},{children:e}))},LoginPage=()=>{const[e,r]=react.exports.useState(1),[t,o]=react.exports.useState(""),[n,a]=react.exports.useState([]),[i,s]=react.exports.useState([]),[l,c]=react.exports.useState(""),[u,p]=react.exports.useState(""),[d,g]=react.exports.useState(""),[$,m]=react.exports.useState(!1),[b,h]=react.exports.useState(!1),[x,y]=react.exports.useState(!1);var f=useSelector(betaFeaturesSelector);const S=useDispatch(),R=(react.exports.useEffect(()=>{"giveMeBeta"===l&&(S(enableBetaFeatures()),c(""))},[l]),useNavigate());let E=!1;react.exports.useEffect(()=>{var e=new URLSearchParams(window.location.search).get("redirect");e&&o(e),E||(E=!0,__awaiter(void 0,void 0,void 0,function*(){var e=yield getGlobalProviders();a(e)}))},[]);const O=()=>__awaiter(void 0,void 0,void 0,function*(){if(u){m(!0);var e=yield userLoginMutation(l,u);if(m(!1),e&&e.ok){e=yield e.json();if(e.errors&&e.errors.length)return"not_found"===e.errors[0].name?void g("Email or Password is incorrect"):void g("Something went wrong with login. Please try again");t?window.location.href=t:window.location.href=generateApiUrlFromHost().replace("api","aiware")+"/switch-app/default"}else g("Something went wrong with login. Please try again")}else g("Password is required")});return jsxRuntime.exports.jsxs(PageContainer,{children:[f&&jsxRuntime.exports.jsx(SignUpButton,{}),jsxRuntime.exports.jsx(DestinationDropdown,{handleDestination:e=>{window.location.href=e}}),jsxRuntime.exports.jsxs("div",Object.assign({style:{display:1===e?"block":"none"}},{children:[jsxRuntime.exports.jsx(Header,{text:"Welcome back"}),jsxRuntime.exports.jsx(EmailInput,{email:l,setEmail:c,onNextStep:()=>{__awaiter(void 0,void 0,void 0,function*(){h(!0),y(!1);var e=yield getOrgOpenIdProviders(l),t=e.find(e=>e.required),e=e.filter(e=>!e.isGlobal);t&&y(!0),s(e),h(!1),r(2)}).catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},isLoading:b,buttonText:"Continue"}),n&&0<n.length&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(OrDivider,{})," ",jsxRuntime.exports.jsx(OpenID,{openIdItems:n})]})]})),jsxRuntime.exports.jsx("div",Object.assign({style:{display:2===e?"block":"none"}},{children:x?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Choose Authentication Option for",subText:l})," ",i&&0<i.length&&jsxRuntime.exports.jsx(OpenID,{openIdItems:i}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>r(1),text:"Back to Login",type:"login"})}))]}):jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Enter Password for",subText:l})," ",jsxRuntime.exports.jsx(PasswordInput,{password:u,errorMessage:d,onPasswordChange:e=>{d&&g(""),p(e)},onPressEnter:()=>{O().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})}}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"14px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>{R("/ui/auth/forgot",{state:{emailFromLogin:l}})},text:"Forgot Password?",type:"forgot"})})),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"25px"}},{children:jsxRuntime.exports.jsx(BlueButton,{onClick:()=>{O().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},text:"Login",type:"login",loading:$})})),i&&0<i.length&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(OrDivider,{})," ",jsxRuntime.exports.jsx(OpenID,{openIdItems:i})]}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>r(1),text:"Back to Login",type:"login"})}))]})}))]})},Forgot=()=>{const[r,e]=react.exports.useState(""),[t,o]=react.exports.useState(!1),[n,a]=react.exports.useState(1),i=useNavigate(),s=useLocation()["state"],l=(react.exports.useEffect(()=>{s&&s.emailFromLogin&&e(s.emailFromLogin)},[s]),()=>__awaiter(void 0,void 0,void 0,function*(){o(!0);try{var e=yield createPasswordResetRequestMutation(r),t=yield null==e?void 0:e.json();t.errors&&t.errors.length?(alert("Something went wrong. Please try again."),o(!1)):(o(!1),a(2))}catch(e){alert("Something went wrong. Please try again."),o(!1)}}));return jsxRuntime.exports.jsxs(PageContainer,{children:[1===n?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Forgot Password",subText:"Enter your registered email to reset your password."}),jsxRuntime.exports.jsx(EmailInput,{email:r,setEmail:e,onNextStep:()=>{l().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},isLoading:t,buttonText:"Send"})]}):jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Password reset requested",subText:"Your password reset will be sent to the email provided if it matches our records."}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"25px"}},{children:jsxRuntime.exports.jsx(BlueButton,{onClick:()=>{l().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},text:"Request Password Again",type:"reset-pw",loading:t})}))]}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>i("/ui/auth/login"),text:"Back to Login",type:"login"})}))]})},RestrictedProvider=()=>{const e=useNavigate();return jsxRuntime.exports.jsxs(PageContainer,{children:[jsxRuntime.exports.jsx(Header,{text:"Authentication Restriction",subText:"Authenticating with this OpenID provider has been restricted by an admin of your account. We are sorry for the inconvenience. Please return to the login screen and choose another authentication provider.",type:"restricted-provider"}),jsxRuntime.exports.jsx(BlueButton,{onClick:()=>e("/ui/auth/login"),text:"Back to Login",type:"back-to-login",loading:!1})]})},AccountLinking=()=>{const[e,t]=react.exports.useState(1),[r,o]=react.exports.useState(""),[n,a]=react.exports.useState(""),i=useNavigate(),[s,l]=react.exports.useState(!1),[c,u]=react.exports.useState(""),[p,d]=react.exports.useState(""),g=(react.exports.useEffect(()=>{var e=new URLSearchParams(window.location.search).get("session");e&&u(e)},[]),react.exports.useEffect(()=>{d("")},[r,n]),()=>__awaiter(void 0,void 0,void 0,function*(){if(!s){l(!0);try{var e=yield linkUserToOidAndLogin(r,n,c);200===e.status?window.location.href=generateApiUrlFromHost().replace("api","aiware")+"/switch-app/default":404===e.status?d("Email or Password is incorrect."):d("Something went wrong. Please try again.")}catch(e){d("Something went wrong. Please try again.")}finally{l(!1)}}}));return jsxRuntime.exports.jsx(PageContainer,{children:1===e?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Account Does Not Exist",subText:"This AiWARE account does not exist. Are you sure you’re using the correct Authentication Provider?",type:"link-oid"}),jsxRuntime.exports.jsx(BlueButton,{onClick:()=>t(2),text:"Link to Existing Account",type:"oid-linking",loading:!1}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"14px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>i("/ui/auth/login"),text:"Back to Login",type:"login"})}))]}):jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Link Account",subText:"Provide the email and password to your aiWARE account."}),jsxRuntime.exports.jsx(EmailInput,{email:r,setEmail:o}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(PasswordInput,{password:n,onPasswordChange:a,onPressEnter:()=>{g().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},errorMessage:p,autoFocus:!1})})),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"14px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>i("/ui/auth/forgot"),text:"Forgot Password?",type:"forgot"})})),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"25px"}},{children:jsxRuntime.exports.jsx(BlueButton,{onClick:()=>{g().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},text:"Link Account & Login",type:"link-oid",loading:s})})),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>i("/ui/auth/login"),text:"Back to Login",type:"login"})}))]})})},ResetPasswordPage=()=>{const e=useNavigate();var t=new URLSearchParams(window.location.search),r=t.get("username")||"",o=t.get("resettoken")||"",n=t.get("organizationinviteid")||"";const a=t.get("redirect");t=parseToken(o),t=!!t&&t.enablePasswordRestriction;return jsxRuntime.exports.jsx(PageContainer,{children:jsxRuntime.exports.jsx(Box,Object.assign({sx:{width:"368px"}},{children:jsxRuntime.exports.jsx(ResetPasswordWidget,{resetToken:o,username:r,organizationInviteId:n,onSuccess:()=>{a?window.location.href=a:e("/ui/auth/login")},requiresPasswordRestriction:t,isNewPage:!0,containerWidth:"100%"})}))})},useStyles$1=makeStyles()(()=>({button:{position:"absolute",left:"40px",top:"30px",border:"none",color:"#5C6269",borderRadius:"4px",paddingLeft:"14px",paddingRight:"14px",fontWeight:400},select:{height:"52px",width:"542px",marginTop:"20px",textAlign:"left"},menu:{"& > .Sdk-MuiPopover-paper":{padding:"0"},"& > .Sdk-MuiPaper-root > ul":{padding:"5px"}},stepOneFullWidthInput:{height:"52px",width:"368px"},stepOneHalfWidthInputContainer:{display:"flex",justifyContent:"space-between",width:"368px",marginTop:"20px"},stepOneHalfWidthInput:{height:"52px",width:"calc(50% - 10px)"},stepTwoContainer:{width:"542px",textAlign:"center"},stepTwoTextField:{height:"52px",width:"542px"},menuItem:{width:"532px"},autoCompleteContainer:{width:"542px",display:"flex",justifyContent:"center"},autoComplete:{width:"542px",marginTop:"20px",height:"52px"},formInputTopMargin:{marginTop:"20px"},formInputTopDoubleMargin:{marginTop:"40px"},previewBox:{width:"164px",height:"164px",borderRadius:"5px",border:"2px dashed #D5DFE9",padding:"10px",boxSizing:"border-box",cursor:"pointer"},logoLanding:{width:"140px",height:"140px",background:"rgba(247, 247, 247, 0.80)",display:"flex",alignItems:"center",justifyContent:"center"},addIcon:{fill:"#555F7C"},logoDescriptionText:{textAlign:"left"},logoUploadBtn:{borderRadius:"4px",border:"1px solid #5C6269",color:"#5C6269",fontWeight:"400",padding:"8px 15px"},orgLogoPreview:{width:"164px",height:"164px"},errorMessage:{color:"red"},confirmationText:{fontSize:"22px",color:"#2A323C",lineHeight:"28px"}}));var countries=[{label:"Afghanistan",id:"AF"},{label:"Åland Islands",id:"AX"},{label:"Albania",id:"AL"},{label:"Algeria",id:"DZ"},{label:"American Samoa",id:"AS"},{label:"AndorrA",id:"AD"},{label:"Angola",id:"AO"},{label:"Anguilla",id:"AI"},{label:"Antarctica",id:"AQ"},{label:"Antigua and Barbuda",id:"AG"},{label:"Argentina",id:"AR"},{label:"Armenia",id:"AM"},{label:"Aruba",id:"AW"},{label:"Australia",id:"AU"},{label:"Austria",id:"AT"},{label:"Azerbaijan",id:"AZ"},{label:"Bahamas",id:"BS"},{label:"Bahrain",id:"BH"},{label:"Bangladesh",id:"BD"},{label:"Barbados",id:"BB"},{label:"Belarus",id:"BY"},{label:"Belgium",id:"BE"},{label:"Belize",id:"BZ"},{label:"Benin",id:"BJ"},{label:"Bermuda",id:"BM"},{label:"Bhutan",id:"BT"},{label:"Bolivia",id:"BO"},{label:"Bosnia and Herzegovina",id:"BA"},{label:"Botswana",id:"BW"},{label:"Bouvet Island",id:"BV"},{label:"Brazil",id:"BR"},{label:"British Indian Ocean Territory",id:"IO"},{label:"Brunei Darussalam",id:"BN"},{label:"Bulgaria",id:"BG"},{label:"Burkina Faso",id:"BF"},{label:"Burundi",id:"BI"},{label:"Cambodia",id:"KH"},{label:"Cameroon",id:"CM"},{label:"Canada",id:"CA"},{label:"Cape Verde",id:"CV"},{label:"Cayman Islands",id:"KY"},{label:"Central African Republic",id:"CF"},{label:"Chad",id:"TD"},{label:"Chile",id:"CL"},{label:"China",id:"CN"},{label:"Christmas Island",id:"CX"},{label:"Cocos (Keeling) Islands",id:"CC"},{label:"Colombia",id:"CO"},{label:"Comoros",id:"KM"},{label:"Congo",id:"CG"},{label:"Congo, The Democratic Republic of the",id:"CD"},{label:"Cook Islands",id:"CK"},{label:"Costa Rica",id:"CR"},{label:"Cote D'Ivoire",id:"CI"},{label:"Croatia",id:"HR"},{label:"Cuba",id:"CU"},{label:"Cyprus",id:"CY"},{label:"Czech Republic",id:"CZ"},{label:"Denmark",id:"DK"},{label:"Djibouti",id:"DJ"},{label:"Dominica",id:"DM"},{label:"Dominican Republic",id:"DO"},{label:"Ecuador",id:"EC"},{label:"Egypt",id:"EG"},{label:"El Salvador",id:"SV"},{label:"Equatorial Guinea",id:"GQ"},{label:"Eritrea",id:"ER"},{label:"Estonia",id:"EE"},{label:"Ethiopia",id:"ET"},{label:"Falkland Islands (Malvinas)",id:"FK"},{label:"Faroe Islands",id:"FO"},{label:"Fiji",id:"FJ"},{label:"Finland",id:"FI"},{label:"France",id:"FR"},{label:"French Guiana",id:"GF"},{label:"French Polynesia",id:"PF"},{label:"French Southern Territories",id:"TF"},{label:"Gabon",id:"GA"},{label:"Gambia",id:"GM"},{label:"Georgia",id:"GE"},{label:"Germany",id:"DE"},{label:"Ghana",id:"GH"},{label:"Gibraltar",id:"GI"},{label:"Greece",id:"GR"},{label:"Greenland",id:"GL"},{label:"Grenada",id:"GD"},{label:"Guadeloupe",id:"GP"},{label:"Guam",id:"GU"},{label:"Guatemala",id:"GT"},{label:"Guernsey",id:"GG"},{label:"Guinea",id:"GN"},{label:"Guinea-Bissau",id:"GW"},{label:"Guyana",id:"GY"},{label:"Haiti",id:"HT"},{label:"Heard Island and Mcdonald Islands",id:"HM"},{label:"Holy See (Vatican City State)",id:"VA"},{label:"Honduras",id:"HN"},{label:"Hong Kong",id:"HK"},{label:"Hungary",id:"HU"},{label:"Iceland",id:"IS"},{label:"India",id:"IN"},{label:"Indonesia",id:"ID"},{label:"Iran, Islamic Republic Of",id:"IR"},{label:"Iraq",id:"IQ"},{label:"Ireland",id:"IE"},{label:"Isle of Man",id:"IM"},{label:"Israel",id:"IL"},{label:"Italy",id:"IT"},{label:"Jamaica",id:"JM"},{label:"Japan",id:"JP"},{label:"Jersey",id:"JE"},{label:"Jordan",id:"JO"},{label:"Kazakhstan",id:"KZ"},{label:"Kenya",id:"KE"},{label:"Kiribati",id:"KI"},{label:"Korea, Democratic People'S Republic of",id:"KP"},{label:"Korea, Republic of",id:"KR"},{label:"Kuwait",id:"KW"},{label:"Kyrgyzstan",id:"KG"},{label:"Lao People'S Democratic Republic",id:"LA"},{label:"Latvia",id:"LV"},{label:"Lebanon",id:"LB"},{label:"Lesotho",id:"LS"},{label:"Liberia",id:"LR"},{label:"Libyan Arab Jamahiriya",id:"LY"},{label:"Liechtenstein",id:"LI"},{label:"Lithuania",id:"LT"},{label:"Luxembourg",id:"LU"},{label:"Macao",id:"MO"},{label:"Macedonia, The Former Yugoslav Republic of",id:"MK"},{label:"Madagascar",id:"MG"},{label:"Malawi",id:"MW"},{label:"Malaysia",id:"MY"},{label:"Maldives",id:"MV"},{label:"Mali",id:"ML"},{label:"Malta",id:"MT"},{label:"Marshall Islands",id:"MH"},{label:"Martinique",id:"MQ"},{label:"Mauritania",id:"MR"},{label:"Mauritius",id:"MU"},{label:"Mayotte",id:"YT"},{label:"Mexico",id:"MX"},{label:"Micronesia, Federated States of",id:"FM"},{label:"Moldova, Republic of",id:"MD"},{label:"Monaco",id:"MC"},{label:"Mongolia",id:"MN"},{label:"Montserrat",id:"MS"},{label:"Morocco",id:"MA"},{label:"Mozambique",id:"MZ"},{label:"Myanmar",id:"MM"},{label:"Namibia",id:"NA"},{label:"Nauru",id:"NR"},{label:"Nepal",id:"NP"},{label:"Netherlands",id:"NL"},{label:"Netherlands Antilles",id:"AN"},{label:"New Caledonia",id:"NC"},{label:"New Zealand",id:"NZ"},{label:"Nicaragua",id:"NI"},{label:"Niger",id:"NE"},{label:"Nigeria",id:"NG"},{label:"Niue",id:"NU"},{label:"Norfolk Island",id:"NF"},{label:"Northern Mariana Islands",id:"MP"},{label:"Norway",id:"NO"},{label:"Oman",id:"OM"},{label:"Pakistan",id:"PK"},{label:"Palau",id:"PW"},{label:"Palestinian Territory, Occupied",id:"PS"},{label:"Panama",id:"PA"},{label:"Papua New Guinea",id:"PG"},{label:"Paraguay",id:"PY"},{label:"Peru",id:"PE"},{label:"Philippines",id:"PH"},{label:"Pitcairn",id:"PN"},{label:"Poland",id:"PL"},{label:"Portugal",id:"PT"},{label:"Puerto Rico",id:"PR"},{label:"Qatar",id:"QA"},{label:"Reunion",id:"RE"},{label:"Romania",id:"RO"},{label:"Russian Federation",id:"RU"},{label:"RWANDA",id:"RW"},{label:"Saint Helena",id:"SH"},{label:"Saint Kitts and Nevis",id:"KN"},{label:"Saint Lucia",id:"LC"},{label:"Saint Pierre and Miquelon",id:"PM"},{label:"Saint Vincent and the Grenadines",id:"VC"},{label:"Samoa",id:"WS"},{label:"San Marino",id:"SM"},{label:"Sao Tome and Principe",id:"ST"},{label:"Saudi Arabia",id:"SA"},{label:"Senegal",id:"SN"},{label:"Serbia and Montenegro",id:"CS"},{label:"Seychelles",id:"SC"},{label:"Sierra Leone",id:"SL"},{label:"Singapore",id:"SG"},{label:"Slovakia",id:"SK"},{label:"Slovenia",id:"SI"},{label:"Solomon Islands",id:"SB"},{label:"Somalia",id:"SO"},{label:"South Africa",id:"ZA"},{label:"South Georgia and the South Sandwich Islands",id:"GS"},{label:"Spain",id:"ES"},{label:"Sri Lanka",id:"LK"},{label:"Sudan",id:"SD"},{label:"Surilabel",id:"SR"},{label:"Svalbard and Jan Mayen",id:"SJ"},{label:"Swaziland",id:"SZ"},{label:"Sweden",id:"SE"},{label:"Switzerland",id:"CH"},{label:"Syrian Arab Republic",id:"SY"},{label:"Taiwan, Province of China",id:"TW"},{label:"Tajikistan",id:"TJ"},{label:"Tanzania, United Republic of",id:"TZ"},{label:"Thailand",id:"TH"},{label:"Timor-Leste",id:"TL"},{label:"Togo",id:"TG"},{label:"Tokelau",id:"TK"},{label:"Tonga",id:"TO"},{label:"Trinidad and Tobago",id:"TT"},{label:"Tunisia",id:"TN"},{label:"Turkey",id:"TR"},{label:"Turkmenistan",id:"TM"},{label:"Turks and Caicos Islands",id:"TC"},{label:"Tuvalu",id:"TV"},{label:"Uganda",id:"UG"},{label:"Ukraine",id:"UA"},{label:"United Arab Emirates",id:"AE"},{label:"United Kingdom",id:"GB"},{label:"United States",id:"US"},{label:"United States Minor Outlying Islands",id:"UM"},{label:"Uruguay",id:"UY"},{label:"Uzbekistan",id:"UZ"},{label:"Vanuatu",id:"VU"},{label:"Venezuela",id:"VE"},{label:"Viet Nam",id:"VN"},{label:"Virgin Islands, British",id:"VG"},{label:"Virgin Islands, U.S.",id:"VI"},{label:"Wallis and Futuna",id:"WF"},{label:"Western Sahara",id:"EH"},{label:"Yemen",id:"YE"},{label:"Zambia",id:"ZM"},{label:"Zimbabwe",id:"ZW"}],industries=["Accounting","Airlines/Aviation","Alternative Dispute Resolution","Alternative Medicine","Animation","Apparel & Fashion","Architecture & Planning","Arts & Crafts","Automotive","Aviation & Aerospace","Banking","Biotechnology","Broadcast Media","Building Materials","Business Supplies & Equipment","Capital Markets","Chemicals","Civic & Social Organization","Civil Engineering","Commercial Real Estate","Computer & Network Security","Computer Games","Computer Hardware","Computer Networking","Computer Software","Construction","Consumer Electronics","Consumer Goods","Consumer Services","Cosmetics","Dairy","Defense & Space","Design","Education Management","E-learning","Electrical & Electronic Manufacturing","Entertainment","Environmental Services","Events Services","Executive Office","Facilities Services","Farming","Financial Services","Fine Art","Fishery","Food & Beverages","Food Production","Fundraising","Furniture","Gambling & Casinos","Glass, Ceramics & Concrete","Government Administration","Government Relations","Graphic Design","Health, Wellness & Fitness","Higher Education","Hospital & Health Care","Hospitality","Human Resources","Import & Export","Individual & Family Services","Industrial Automation","Information Services","Information Technology & Services","Insurance","International Affairs","International Trade & Development","Internet","Investment Banking/Venture","Investment Management","Judiciary","Law Enforcement","Law Practice","Legal Services","Legislative Office","Leisure & Travel","Libraries","Logistics & Supply Chain","Luxury Goods & Jewelry","Machinery","Management Consulting","Maritime","Marketing & Advertising","Market Research","Mechanical or Industrial Engineering","Media Production","Medical Device","Medical Practice","Mental Health Care","Military","Mining & Metals","Motion Pictures & Film","Museums & Institutions","Music","Nanotechnology","Newspapers","Nonprofit Organization Management","Oil & Energy","Online Publishing","Outsourcing/Offshoring","Package/Freight Delivery","Packaging & Containers","Paper & Forest Products","Performing Arts","Pharmaceuticals","Philanthropy","Photography","Plastics","Political Organization","Primary/Secondary","Printing","Professional Training","Program Development","Public Policy","Public Relations","Public Safety","Publishing","Railroad Manufacture","Ranching","Real Estate","Recreational","Facilities & Services","Religious Institutions","Renewables & Environment","Research","Restaurants","Retail","Security & Investigations","Semiconductors","Shipbuilding","Sporting Goods","Sports","Staffing & Recruiting","Supermarkets","Telecommunications","Textiles","Think Tanks","Tobacco","Translation & Localization","Transportation/Trucking/Railroad","Utilities","Venture Capital","Veterinary","Warehousing","Wholesale","Wine & Spirits","Wireless","Writing & Editing"];const teamSizeOptions=["1-10","10-50","50-100","100-500","500-1000","> 1000"],industryOptions=industries.map(e=>({id:e,label:e})),SignUpStep_2=()=>{var e=react.exports.useRef();const r=useDispatch(),t=useSelector(selectFormValues),o=useSelector(selectErrors),n=useSelector(selectStatus),a=!!Object.keys(o).find(e=>o[e])||!!Object.keys(o).find(e=>!t[e])||"loading"===n,i=useStyles$1()["classes"],s=useNavigate(),l=()=>{r(actions.createUserStart())},c=e=>{"Enter"===e.key&&(r(actions.validate()),a||l())};return jsxRuntime.exports.jsxs(Box,Object.assign({className:i.stepTwoContainer},{children:[jsxRuntime.exports.jsx(Header,{text:"success"!==n?"Let's set up your Organization":""}),"success"!==n?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(TextField,{id:"orgName","data-testid":"os-auth-orgName-input-field",label:"Organization Name",variant:"outlined",value:"orgName"in t&&(null===t||void 0===t?void 0:t.orgName),autoComplete:"company",autoFocus:!0,className:i.stepTwoTextField,error:"orgName"in o&&o.orgName,onChange:e=>r(actions.setValue({key:"orgName",value:e.target.value})),onKeyDown:c,disabled:"loading"===n}),jsxRuntime.exports.jsxs(FormControl,{children:[jsxRuntime.exports.jsx(InputLabel,Object.assign({id:"os-auth.sign-up.teamSize",className:i.formInputTopMargin},{children:"Team Size"})),jsxRuntime.exports.jsx(Select,Object.assign({labelId:"os-auth.sign-up.teamSize",id:"os-auth.sign-up.teamSize",value:"teamSize"in t&&(null===t||void 0===t?void 0:t.teamSize),className:i.select,MenuProps:{className:i.menu},label:"Team Size",onChange:e=>r(actions.setValue({key:"teamSize",value:e.target.value||""})),disabled:"loading"===n},{children:teamSizeOptions.map(e=>jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e,className:i.menuItem},{children:e})))}))]}),jsxRuntime.exports.jsx(Box,Object.assign({className:i.autoCompleteContainer},{children:jsxRuntime.exports.jsx(Autocomplete,{disablePortal:!0,id:"os-auth.sign-up.country-autocomplete",options:countries,value:"country"in t&&countries.find(e=>e.id===t.country),onChange:(e,t)=>r(actions.setValue({key:"country",value:(t||{}).id||""})),className:i.autoComplete,renderInput:e=>jsxRuntime.exports.jsx(TextField,Object.assign({},e,{label:"Country",onKeyDown:c,disabled:"loading"===n}))})})),jsxRuntime.exports.jsx(Box,Object.assign({className:i.autoCompleteContainer},{children:jsxRuntime.exports.jsx(Autocomplete,{disablePortal:!0,id:"os-auth.sign-up.industry-autocomplete",options:industryOptions,value:"industry"in t&&industryOptions.find(e=>e.id===t.industry),onChange:(e,t)=>r(actions.setValue({key:"country",value:(t||{}).id||""})),className:i.autoComplete,renderInput:e=>jsxRuntime.exports.jsx(TextField,Object.assign({},e,{label:"Industry",onKeyDown:c,disabled:"loading"===n}))})})),jsxRuntime.exports.jsx(BlueButton,{onClick:l,text:"Create Account",type:"Continue",disableButton:a,className:i.formInputTopDoubleMargin,ref:null!=e&&e.current?e:void 0,loading:"loading"===n})]}):jsxRuntime.exports.jsxs(Box,{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1",className:i.confirmationText},{children:"Thank you for registering! A confirmation email has been sent with an activation link for your new aiWARE account."})),jsxRuntime.exports.jsx(BlueButton,{onClick:()=>s("/ui/auth/login"),text:"Return To Homepage",className:i.formInputTopDoubleMargin,type:"Continue"})]})]}))},SignUpStep_1=()=>{var e=react.exports.useRef();const t=useDispatch(),r=useSelector(selectFormValues);var o=useSelector(selectErrors);const n=!!Object.entries(o).find(([,e])=>e)||!!Object.keys(o).find(e=>!r[e])||!validateEmail$1("email"in r&&(null===r||void 0===r?void 0:r.email)||"");var a=useStyles$1()["classes"],i=e=>{"Enter"===e.key&&(t(actions.validate()),n||s())};const s=()=>{t(actions.setStep(2))};return jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsx(Header,{text:"Sign Up for your aiWARE account"}),jsxRuntime.exports.jsx(TextField,{id:"email","data-testid":"os-auth-email-input-field",label:"email"in o&&o.email?"Please provide a valid email":"Email",InputProps:{type:"email"},variant:"outlined",value:"email"in r&&(null===r||void 0===r?void 0:r.email),autoComplete:"email",autoFocus:!0,className:a.stepOneFullWidthInput,error:"email"in o&&o.email,onChange:e=>t(actions.setValue({key:"email",value:e.target.value.trim()})),onKeyDown:i}),jsxRuntime.exports.jsxs(Box,Object.assign({className:a.stepOneHalfWidthInputContainer},{children:[jsxRuntime.exports.jsx(TextField,{id:"firstName","data-testid":"os-auth-firstName-input-field",label:"First Name",variant:"outlined",value:"firstName"in r&&(null===r||void 0===r?void 0:r.firstName),autoComplete:"first name",className:a.stepOneHalfWidthInput,error:"firstName"in o&&o.firstName,onChange:e=>t(actions.setValue({key:"firstName",value:e.target.value})),onKeyDown:i}),jsxRuntime.exports.jsx(TextField,{id:"lastName","data-testid":"os-auth-lastName-input-field",label:"Last Name",variant:"outlined",value:"lastName"in r&&(null===r||void 0===r?void 0:r.lastName),autoComplete:"last name",className:a.stepOneHalfWidthInput,error:"lastName"in o&&o.lastName,onChange:e=>t(actions.setValue({key:"lastName",value:e.target.value})),onKeyDown:i})]})),jsxRuntime.exports.jsx(BlueButton,{onClick:s,text:"Continue",type:"Continue",disableButton:n,className:a.formInputTopMargin,ref:null!=e&&e.current?e:void 0})]})},SignUp=()=>{var e=useSelector(selectActiveStep);const t=useDispatch();var r=useStyles$1()["classes"],o=useSelector(selectStatus);const n=t=>window.location.href.split("://")[1].split(".").find(e=>e===t);return react.exports.useEffect(()=>{t(actions.resetState()),n("local")||n("dev")?t(actions.setEnv("dev")):n("stage")?t(actions.setEnv("stage")):t(actions.setEnv("prod"))},[]),jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getSignUpModule()]},{children:jsxRuntime.exports.jsxs(PageContainer,Object.assign({showLogoInFooter:!1},{children:[jsxRuntime.exports.jsx(SignUpButton,{label:"Login",navigateTo:"login"}),2===e&&"success"!==o&&jsxRuntime.exports.jsxs(Button,Object.assign({className:r.button,onClick:()=>t(actions.setStep(1)),disabled:"loading"===o},{children:[jsxRuntime.exports.jsx(default_1,{fontSize:"small",sx:{marginRight:"5px"}})," Back"]})),jsxRuntime.exports.jsx("div",{children:1===e?jsxRuntime.exports.jsx(SignUpStep_1,{}):jsxRuntime.exports.jsx(SignUpStep_2,{})})]}))}))},useStyles=makeStyles()((e,{error:t,passwordRequirementsMet:r})=>{let o="auto";return t?o="red":r||(o="rgba(0, 0, 0, 0.26)"),{passwordLabel:{background:"white",padding:"0 3px"},passwordFormMarginTop:{marginTop:"20px"},passwordInput:{width:"368px"},confirmPasswordLabel:{color:o,"&.Mui-focused":{color:o}}}}),usePasswordRequirementStyles=makeStyles()(()=>({container:{width:"357px",height:"256px",display:"flex",alignItems:"center",justifyContent:"center"},popover:{boxSizing:"border-box",padding:"25px 20px",width:"327px",height:"236px",marginTop:"10px",borderRadius:"5px",boxShadow:"0px 2px 10px 0px rgba(0, 0, 0, 0.20)","&::before":{backgroundColor:"white",content:'""',display:"block",position:"absolute",width:12,height:12,top:"calc(50% - 6px)",transform:"rotate(45deg)",left:"calc(100% - 20px)"}},barContainer:{display:"flex",width:"286px",justifyContent:"space-between",padding:"15px 0px"},bar:{width:"70px",height:"4px",borderRadius:"20px"},metRequirement:{color:"#9CA8B4",textDecorationLine:"line-through"},unmetRequirement:{color:"#5C6269"},requirement:{padding:"10px 0",display:"flex",alignItems:"center"},bullet:{transform:"translateY(8px)",marginLeft:"5px"},checkMark:{fill:"#0E6EEC",marginRight:"8px",marginLeft:"-3px"}}));var isCallable=isCallable$p,isObject=isObject$a,setPrototypeOf=objectSetPrototypeOf,inheritIfRequired$1=function(e,t,r){return setPrototypeOf&&isCallable(t=t.constructor)&&t!==r&&isObject(t=t.prototype)&&t!==r.prototype&&setPrototypeOf(e,t),e},defineProperty=objectDefineProperty.f,proxyAccessor$1=function(e,t,r){r in e||defineProperty(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})},DESCRIPTORS=descriptors,global$1=global$p,uncurryThis=functionUncurryThis,isForced=isForced_1,inheritIfRequired=inheritIfRequired$1,createNonEnumerableProperty=createNonEnumerableProperty$6,getOwnPropertyNames=objectGetOwnPropertyNames.f,isPrototypeOf=objectIsPrototypeOf,isRegExp=isRegexp,toString=toString$9,getRegExpFlags=regexpGetFlags,stickyHelpers=regexpStickyHelpers,proxyAccessor=proxyAccessor$1,defineBuiltIn=defineBuiltIn$a,fails=fails$n,hasOwn=hasOwnProperty_1,enforceInternalState=internalState.enforce,setSpecies=setSpecies$2,wellKnownSymbol=wellKnownSymbol$l,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,MATCH=wellKnownSymbol$l("match"),NativeRegExp=global$1.RegExp,RegExpPrototype=NativeRegExp.prototype,SyntaxError=global$1.SyntaxError,exec=uncurryThis(RegExpPrototype.exec),charAt=uncurryThis("".charAt),replace=uncurryThis("".replace),stringIndexOf=uncurryThis("".indexOf),stringSlice=uncurryThis("".slice),IS_NCG=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,re1=/a/g,re2=/a/g,CORRECT_NEW=new NativeRegExp(re1)!==re1,MISSED_STICKY=stickyHelpers.MISSED_STICKY,UNSUPPORTED_Y=stickyHelpers.UNSUPPORTED_Y,BASE_FORCED=DESCRIPTORS&&(!CORRECT_NEW||MISSED_STICKY||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG||fails(function(){return re2[MATCH]=!1,NativeRegExp(re1)!=re1||NativeRegExp(re2)==re2||"/a/i"!=NativeRegExp(re1,"i")})),handleDotAll=function(e){for(var t,r=e.length,o=0,n="",a=!1;o<=r;o++)"\\"===(t=charAt(e,o))?n+=t+charAt(e,++o):a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),n+=t):n+="[\\s\\S]";return n},handleNCG=function(e){for(var t,r=e.length,o=0,n="",a=[],i={},s=!1,l=!1,c=0,u="";o<=r;o++){if("\\"===(t=charAt(e,o)))t+=charAt(e,++o);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:exec(IS_NCG,stringSlice(e,o+1))&&(o+=2,l=!0),n+=t,c++;continue;case">"===t&&l:if(""===u||hasOwn(i,u))throw new SyntaxError("Invalid capture group name");i[u]=!0,l=!(a[a.length]=[u,c]),u="";continue}l?u+=t:n+=t}return[n,a]};if(isForced("RegExp",BASE_FORCED)){for(var RegExpWrapper=function(e,t){var r,o,n=isPrototypeOf(RegExpPrototype,this),a=isRegExp(e),i=void 0===t,s=[],l=e;if(!n&&a&&i&&e.constructor===RegExpWrapper)return e;if((a||isPrototypeOf(RegExpPrototype,e))&&(e=e.source,i)&&(t=getRegExpFlags(l)),e=void 0===e?"":toString(e),t=void 0===t?"":toString(t),l=e,a=t=UNSUPPORTED_DOT_ALL&&"dotAll"in re1&&(r=!!t&&-1<stringIndexOf(t,"s"))?replace(t,/s/g,""):t,MISSED_STICKY&&"sticky"in re1&&(o=!!t&&-1<stringIndexOf(t,"y"))&&UNSUPPORTED_Y&&(t=replace(t,/y/g,"")),UNSUPPORTED_NCG&&(e=(i=handleNCG(e))[0],s=i[1]),i=inheritIfRequired(NativeRegExp(e,t),n?this:RegExpPrototype,RegExpWrapper),(r||o||s.length)&&(t=enforceInternalState(i),r&&(t.dotAll=!0,t.raw=RegExpWrapper(handleDotAll(e),a)),o&&(t.sticky=!0),s.length)&&(t.groups=s),e!==l)try{createNonEnumerableProperty(i,"source",""===l?"(?:)":l)}catch(e){}return i},keys=getOwnPropertyNames(NativeRegExp),index=0;keys.length>index;)proxyAccessor(RegExpWrapper,NativeRegExp,keys[index++]);(RegExpPrototype.constructor=RegExpWrapper).prototype=RegExpPrototype,defineBuiltIn(global$1,"RegExp",RegExpWrapper,{constructor:!0})}setSpecies("RegExp");const PasswordRequirements=({password:r,setPasswordRequirementsMet:o})=>{const n=usePasswordRequirementStyles()["classes"];const a=[{id:"upperLower",label:"Upper & lower case letters",regex:new RegExp("(?=.*[a-z])(?=.*[A-Z])","g"),met:!1},{id:"length",label:"At least 8 characters",regex:new RegExp(".{8}$"),met:!1},{id:"specialCharacter",label:"A symbol (#$&!)",regex:new RegExp("[!#$&()]"),met:!1}],[i,s]=react.exports.useState(a),l={0:"#FF5722",1:"#FFC107",2:"#00BCD4",3:"#4CAF50"};return react.exports.useEffect(()=>{var e=[...a];for(const t of e)t.regex.test(r)&&(t.met=!0);e.find(e=>!e.met)?o(!1):o(!0),s(e)},[r]),jsxRuntime.exports.jsx(Box$1,Object.assign({className:n.container},{children:jsxRuntime.exports.jsxs(Box$1,Object.assign({className:n.popover},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1"},{children:r?{0:"Weak Password",1:"Average Password",2:"Good Password",3:"Strong Password 💪"}[i.filter(e=>e.met).length]:"Please set a strong password"})),jsxRuntime.exports.jsx(Box$1,Object.assign({className:n.barContainer},{children:Array.from(Array(4).keys()).map(e=>{var t=i.filter(e=>e.met).length;return jsxRuntime.exports.jsx(Box$1,{className:n.bar,sx:{background:e<=t&&r?l[t]:"#9CA8B4"}},e)})})),jsxRuntime.exports.jsx(Box$1,{children:i.map(e=>jsxRuntime.exports.jsxs(Box$1,Object.assign({className:classNames(n.requirement,e.met?n.metRequirement:n.unmetRequirement)},{children:[e.met?jsxRuntime.exports.jsx(CheckmarkFilled,{className:n.checkMark}):jsxRuntime.exports.jsx(Bullet,{className:n.bullet}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body2"},{children:e.label}))]}),e.id))})]}))}))},SignUpPassword=({userId:e,token:t})=>{const[r,o]=react.exports.useState(!1),[n,a]=react.exports.useState(!1),[i,s]=react.exports.useState(""),[l,c]=react.exports.useState(""),[u,p]=react.exports.useState(!1),[d,g]=react.exports.useState(!1),[$,m]=react.exports.useState(!1),[b,h]=react.exports.useState(null);var x=useStyles({error:$,passwordRequirementsMet:d})["classes"];const y=useDispatch();var f=react.exports.useRef();react.exports.useEffect(()=>{i&&l&&i===l&&d&&p(!0)},[i,l]);const S=e=>{e(e=>!e)};var R=e=>{e.preventDefault()},E=e=>{"Enter"===e.key&&u&&C()};const O={password:i,confirmPassword:l},I={password:s,confirmPassword:c},P=(e,r)=>{e.target.id===v&&e.target.value&&h(e.currentTarget),m(!1);const o=e.target.value;I[r](o),debounce_1(()=>{var e,t;({password:e,confirmPassword:t}=Object.assign(Object.assign({},O),{[r]:o})),e&&t&&e!==t?m(!0):$&&m(!1)},1e3)()};var j=Boolean(b),T=j?"simple-popover":void 0;const v="sign-up.password";const C=()=>{y(actions.setPasswordStart({password:i,userId:e,token:t}))};return jsxRuntime.exports.jsxs(Box$1,Object.assign({className:x.passwordInput},{children:[jsxRuntime.exports.jsx(Header,{text:"Set a password for your account"}),jsxRuntime.exports.jsxs(FormControl,Object.assign({variant:"outlined",className:x.passwordInput},{children:[jsxRuntime.exports.jsx(InputLabel,Object.assign({htmlFor:v,className:x.passwordLabel},{children:"Password"})),jsxRuntime.exports.jsx(OutlinedInput,{id:v,"data-testid":v,ref:f,type:r?"text":"password",onChange:e=>P(e,"password"),value:i,autoFocus:!0,endAdornment:jsxRuntime.exports.jsx(InputAdornment,Object.assign({position:"end"},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"toggle password visibility",onClick:()=>S(o),onMouseDown:R,edge:"end"},{children:r?jsxRuntime.exports.jsx(default_1$3,{}):jsxRuntime.exports.jsx(default_1$4,{})}))})),onKeyDown:E,onClick:e=>{h(e.currentTarget)}}),jsxRuntime.exports.jsx(Popover,Object.assign({id:T,open:j,anchorEl:b,onClose:()=>{h(null)},disableAutoFocus:!0,disableEnforceFocus:!0,anchorReference:b,transformOrigin:{vertical:"center",horizontal:"right"},anchorOrigin:{vertical:"center",horizontal:"left"},PaperProps:{style:{backgroundColor:"transparent",boxShadow:"none",borderRadius:0}}},{children:jsxRuntime.exports.jsx(PasswordRequirements,{password:i,setPasswordRequirementsMet:g})}))]})),jsxRuntime.exports.jsxs(FormControl,Object.assign({className:classNames(x.passwordInput,x.passwordFormMarginTop),variant:"outlined"},{children:[jsxRuntime.exports.jsx(InputLabel,Object.assign({htmlFor:"sign-up.confirm-password",className:classNames(x.passwordLabel,x.confirmPasswordLabel)},{children:$?"Passwords must match":"Confirm Password"})),jsxRuntime.exports.jsx(OutlinedInput,{id:"sign-up.confirm-password","data-testid":"sign-up.confirm-password",type:n?"text":"password",onChange:e=>P(e,"confirmPassword"),value:l,endAdornment:jsxRuntime.exports.jsx(InputAdornment,Object.assign({position:"end"},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"toggle password visibility",onClick:d?()=>S(a):()=>({}),onMouseDown:R,edge:"end",disabled:!d},{children:n?jsxRuntime.exports.jsx(default_1$3,{}):jsxRuntime.exports.jsx(default_1$4,{})}))})),error:$,onKeyDown:E,disabled:!d})]})),jsxRuntime.exports.jsx(BlueButton,{className:x.passwordFormMarginTop,onClick:C,text:"Create Account",type:"sign-up",disableButton:!u})]}))},SetPassword=()=>{const[r]=useSearchParams(),[e,o]=react.exports.useState(""),[t,n]=react.exports.useState(""),a=useNavigate(),i=useSelector(selectStatus);return react.exports.useEffect(()=>{var e=r.get("useruuid")||"",t=r.get("token")||"";e&&t?(o(e),n(t)):a("/ui/auth/login")},[]),react.exports.useEffect(()=>{"success"===i&&a("/ui/tiers")},[i]),jsxRuntime.exports.jsx(PageContainer,Object.assign({showLogoInFooter:!1},{children:jsxRuntime.exports.jsx(SignUpPassword,{userId:e,token:t})}))},Plans=()=>{var e=useLocation();return new URLSearchParams(e.search).get("giveMeBeta")?(e=window&&(null==(e=window.config)?void 0:e.stripePublishableKey)||"pk_test_51NNcicInolL392yPuFClPywpUYp0ppNltcHBEdkPNkpMgmagbymPCeal9Dl3dDYn63IOfIafuobscqZhCJQfp3KN00Th3bxbLx",jsxRuntime.exports.jsx("stripe-pricing-table",{"pricing-table-id":"prctbl_1NZylVInolL392yP1vWkrOAO","publishable-key":e})):null},PaymentResult=()=>jsxRuntime.exports.jsxs(Box,Object.assign({sx:{position:"fixed",width:"100%",height:"100vh",top:"0",left:"0",backgroundColor:"#ffffff",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",textAlign:"center",fontSize:"14px",zIndex:99999}},{children:[jsxRuntime.exports.jsx(Box,Object.assign({sx:{height:"200px",width:"405px",mb:6},id:"loaderAnimation"},{children:jsxRuntime.exports.jsx("img",{src:img,alt:"aiware-logo",style:{height:"200px",width:"200px"}})})),jsxRuntime.exports.jsxs(Box,Object.assign({sx:{height:"200px",width:"405px"}},{children:[jsxRuntime.exports.jsx(StyledEngineProvider,Object.assign({injectFirst:!0},{children:jsxRuntime.exports.jsx(LinearProgress,{color:"primary",sx:{height:"7px",backgroundColor:"#D9D9D9",mt:2,borderRadius:"20px"}})})),jsxRuntime.exports.jsx(Typography,Object.assign({sx:{color:"#2A323C",textTransform:"none",mt:4,fontFamily:"Nunito Sans",fontSize:"18px",fontWeight:600,lineHeight:"24px",letterSpacing:"-1.3038520263464193e-9px",textAlign:"center"}},{children:"Creating your custom experience..."}))]}))]})),AuthRoutes=()=>jsxRuntime.exports.jsxs(Routes,{children:[jsxRuntime.exports.jsx(Route,{path:"/login",element:jsxRuntime.exports.jsx(LoginPage,{})}),jsxRuntime.exports.jsx(Route,{path:"sign-up",element:jsxRuntime.exports.jsx(SignUp,{})}),jsxRuntime.exports.jsx(Route,{path:"/plans",element:jsxRuntime.exports.jsx(Plans,{})}),jsxRuntime.exports.jsx(Route,{path:"/payment-result",element:jsxRuntime.exports.jsx(PaymentResult,{})}),jsxRuntime.exports.jsx(Route,{path:"/forgot",element:jsxRuntime.exports.jsx(Forgot,{})}),jsxRuntime.exports.jsx(Route,{path:"/restricted-provider",element:jsxRuntime.exports.jsx(RestrictedProvider,{})}),jsxRuntime.exports.jsx(Route,{path:"/link-oid",element:jsxRuntime.exports.jsx(AccountLinking,{})}),jsxRuntime.exports.jsx(Route,{path:"/reset-password",element:jsxRuntime.exports.jsx(ResetPasswordPage,{})}),jsxRuntime.exports.jsx(Route,{path:"/activate",element:jsxRuntime.exports.jsx(SetPassword,{})})]});export{AuthRoutes,ResetPassword,generateApiUrlFromHost};
13
+ `,variables:{input:{userName:r}}};try{return yield fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)})}catch(e){return devErrorLogger(e),null}}),createUserInHub=(e,t)=>__awaiter(void 0,void 0,void 0,function*(){try{return!!(yield(yield fetch(e+"/hub/v1/admin/users",{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8",Origin:"https://hub.veritone.com"},body:JSON.stringify(Object.assign(Object.assign({},t),{userUrl:e+"/auth/confirm-email?token=%token%&username=%username%"}))})).json()).success}catch(e){return devErrorLogger(e),!1}}),setPassword=(e,t,r)=>__awaiter(void 0,void 0,void 0,function*(){}),activateUser=()=>__awaiter(void 0,void 0,void 0,function*(){}),updateUserOrg=()=>__awaiter(void 0,void 0,void 0,function*(){}),BlueLinkText=({onClick:e,text:t,type:r})=>jsxRuntime.exports.jsx(Typography,Object.assign({sx:{fontFamily:"Nunito",fontSize:"14px",lineHeight:"20px",letterSpacing:"-1.30385e-09px",color:"#0C53B0",cursor:"pointer"},onClick:e,"data-testid":`os-auth-${r}-link-button`},{children:t})),OrDivider=()=>jsxRuntime.exports.jsxs(Box,Object.assign({sx:{marginTop:"20px",position:"relative"}},{children:[jsxRuntime.exports.jsx(Divider,{sx:{margin:"0 14px",color:"#D5DFE9"}}),jsxRuntime.exports.jsx(Typography,Object.assign({sx:{color:"#D5DFE9",fontSize:"14px",margin:0,top:"-12px",padding:"0 10px",position:"absolute",left:"calc(50% - 15px)",background:"#FFFFFF",fontFamily:"Roboto",letterSpacing:"- 1.30385e-09px",fontStyle:"normal",fontWeight:"normal"}},{children:"or"}))]})),SLICE_NAME="signUp",namespace="initStep",initialState={env:"",status:"idle",activeStep:1,1:{email:"",firstName:"",lastName:""},2:{orgName:"",teamSize:"",country:"",industry:""},errors:{1:{email:!1,firstName:!1,lastName:!1},2:{orgName:!1,country:!1}},userUUID:"",userEmail:"",organizationUUID:""};function isKeyOfObject(e,t){return e in t}function validateEmail(e){return e.match(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)}const signUpSlice=createSlice({name:SLICE_NAME+"/"+namespace,initialState:initialState,reducers:{setStep(e,t){e.activeStep=t.payload},setValue(e,t){var{key:t,value:r}=t.payload;isKeyOfObject(t,e[e.activeStep])&&(e[e.activeStep][t]=r,isKeyOfObject(t,e.errors[e.activeStep]))&&(e.errors[e.activeStep][t]=!1)},validate(e){for(var[t,r]of Object.entries(e[e.activeStep]))isKeyOfObject(t,e.errors[e.activeStep])&&!r&&(e.errors[e.activeStep][t]=!0);1!==e.activeStep||validateEmail(e[1].email)||(e.errors[1].email=!0)},createUserStart(e){e.status="loading"},createUserSuccess(e){e.status="success"},createUserFailure(e){e.status="failure"},setEnv(e,t){t=t.payload;e.env=`https://hub${"prod"===t?"":"."+t}.aiware.com`},resetState:()=>initialState,setPasswordStart(e,t){e.status="loading"},setPasswordSuccess(e){e.status="success"},setPasswordFailure(e){e.status="failure"},activateUserStart(e,t){e.status="loading"},activateUserSuccess(e,t){e.status="success",e.organizationUUID=t.payload.organizationUUID,e.userEmail=t.payload.userEmail},activateUserFailure(e){e.status="failure"},updateUserOrgStart(e,t){e.status="loading"},updateUserOrgSuccess(e){e.status="success"},updateUserOrgFailure(e){e.status="failure"}}}),actions=signUpSlice.actions;var signUpSlice$1=signUpSlice.reducer,whitespaces$2="\t\n\v\f\r                 \u2028\u2029\ufeff",uncurryThis$1=functionUncurryThis,requireObjectCoercible=requireObjectCoercible$8,toString$1=toString$9,whitespaces$1=whitespaces$2,replace$1=functionUncurryThis("".replace),whitespace="["+whitespaces$1+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),createMethod=function(t){return function(e){e=toString$1(requireObjectCoercible(e));return 1&t&&(e=replace$1(e,ltrim,"")),e=2&t?replace$1(e,rtrim,""):e}},stringTrim={start:createMethod(1),end:createMethod(2),trim:createMethod(3)},PROPER_FUNCTION_NAME=functionName.PROPER,fails$1=fails$n,whitespaces=whitespaces$2,non="​…᠎",stringTrimForced=function(e){return fails$1(function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME&&whitespaces[e].name!==e})},$=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$({target:"String",proto:!0,forced:stringTrimForced("trim")},{trim:function(){return $trim(this)}});const selectStatus=e=>{return null==(e=null==e?void 0:e[SLICE_NAME])?void 0:e.status},selectActiveStep=e=>{return null==(e=null==e?void 0:e[SLICE_NAME])?void 0:e.activeStep},selectFormValues=e=>{var t;return null==(t=null==e?void 0:e[SLICE_NAME])?void 0:t[null==(t=null==e?void 0:e[SLICE_NAME])?void 0:t.activeStep]},selectErrors=e=>{var t;return null==(t=null==(t=null==e?void 0:e[SLICE_NAME])?void 0:t.errors)?void 0:t[null==(t=null==e?void 0:e[SLICE_NAME])?void 0:t.activeStep]},selectEnv=e=>{return null==(e=null==e?void 0:e[SLICE_NAME])?void 0:e.env},selectCreateUserPayload=e=>{var{1:{email:e,firstName:t,lastName:r},2:{orgName:o,teamSize:n,country:a,industry:i}}=(null==e?void 0:e[SLICE_NAME])||{1:{},2:{}};return{userFirstName:t.trim(),userLastName:r.trim(),userEmail:e,userPhoneNumber:"",userOccupation:"",userCompany:"",organizationName:o.trim(),salesforceAttributes:JSON.stringify({teamSize:n,country:a,industry:i})}};function*createUserSaga(e){try{var t=yield select(selectEnv),r=yield select(selectCreateUserPayload);(yield call$m(createUserInHub,t,r))?yield put(actions.createUserSuccess()):(yield put(actions.createUserFailure()),yield put(showMessage({content:"Cannot create user at this time. Please try again later or use a different email address",severity:MessageSeverity.Error})))}catch(e){yield put(actions.createUserFailure()),yield put(showMessage({content:"Cannot create user at this time. Please try again later or use a different email address",severity:MessageSeverity.Error})),devErrorLogger(e)}}function*setPasswordSaga(e){var{password:e,userId:t,token:r}=e.payload;try{yield call$m(setPassword,e,t,r),yield put(actions.setPasswordSuccess())}catch(e){yield put(actions.setPasswordFailure()),console.log(e)}}function*activateUserSaga(e){try{var{userInviteToken:t,userPassword:r}=e.payload,{organizationUUID:o,userEmail:n}=yield call$m(activateUser,t,r);o&&n&&(yield put(actions.activateUserSuccess({organizationUUID:o,userEmail:n})))}catch(e){yield put(actions.activateUserFailure()),console.log(e)}}function*updateUserOrgSaga(e){try{var{organizationUUID:t,paid:r}=e.payload;yield call$m(updateUserOrg,t,r),yield put(actions.updateUserOrgSuccess())}catch(e){yield put(actions.updateUserOrgFailure()),console.log(e)}}function*createUserWatcher(){yield takeEvery$1(actions.createUserStart.type,createUserSaga)}function*setPasswordWatcher(){yield takeEvery$1(actions.setPasswordStart.type,setPasswordSaga)}function*activateUserWatcher(){yield takeEvery$1(actions.activateUserStart.type,activateUserSaga)}function*updateUserOrgWatcher(){yield takeEvery$1(actions.updateUserOrgStart.type,updateUserOrgSaga)}function*rootSaga(){yield all([createUserWatcher(),setPasswordWatcher(),activateUserWatcher(),updateUserOrgWatcher()])}function getSignUpModule(){return{id:SLICE_NAME,reducerMap:{[SLICE_NAME]:signUpSlice$1},sagas:[rootSaga],initialActions:[]}}const useStyles$2=makeStyles()((e,{label:t})=>{t="Sign Up"===t;return{button:{position:"absolute",right:t?"220px":"40px",top:"30px",background:t?"#388E3C":"none",border:t?"none":"1px solid #5C6269",color:t?"white":"#5C6269",borderRadius:"4px",paddingLeft:"14px",paddingRight:"14px",fontWeight:400,"&:hover":{background:t?"#42a647":"none"}}}}),SignUpButton=({label:e="Sign Up",navigateTo:t="sign-up"})=>{const r=useNavigate();var o=useSelector(selectStatus),n=useStyles$2({label:e})["classes"];return jsxRuntime.exports.jsx(Button,Object.assign({className:n.button,onClick:()=>{r("/ui/auth/"+t)},disabled:"sign-up"!==t&&"loading"===o},{children:e}))},LoginPage=()=>{const[e,r]=react.exports.useState(1),[t,o]=react.exports.useState(""),[n,a]=react.exports.useState([]),[i,s]=react.exports.useState([]),[l,c]=react.exports.useState(""),[u,p]=react.exports.useState(""),[d,g]=react.exports.useState(""),[$,m]=react.exports.useState(!1),[b,h]=react.exports.useState(!1),[x,y]=react.exports.useState(!1);var f=useSelector(betaFeaturesSelector);const S=useDispatch(),R=(react.exports.useEffect(()=>{"giveMeBeta"===l&&(S(enableBetaFeatures()),c(""))},[l]),useNavigate());let E=!1;react.exports.useEffect(()=>{var e=new URLSearchParams(window.location.search).get("redirect");e&&o(e),E||(E=!0,__awaiter(void 0,void 0,void 0,function*(){var e=yield getGlobalProviders();a(e)}))},[]);const O=()=>__awaiter(void 0,void 0,void 0,function*(){if(u){m(!0);var e=yield userLoginMutation(l,u);if(m(!1),e&&e.ok){e=yield e.json();if(e.errors&&e.errors.length)return"not_found"===e.errors[0].name?void g("Email or Password is incorrect"):void g("Something went wrong with login. Please try again");t?window.location.href=t:window.location.href=generateApiUrlFromHost().replace("api","aiware")+"/switch-app/default"}else g("Something went wrong with login. Please try again")}else g("Password is required")});return jsxRuntime.exports.jsxs(PageContainer,{children:[f&&jsxRuntime.exports.jsx(SignUpButton,{}),jsxRuntime.exports.jsx(DestinationDropdown,{handleDestination:e=>{window.location.href=e}}),jsxRuntime.exports.jsxs("div",Object.assign({style:{display:1===e?"block":"none"}},{children:[jsxRuntime.exports.jsx(Header,{text:"Welcome back"}),jsxRuntime.exports.jsx(EmailInput,{email:l,setEmail:c,onNextStep:()=>{__awaiter(void 0,void 0,void 0,function*(){h(!0),y(!1);var e=yield getOrgOpenIdProviders(l),t=e.find(e=>e.required),e=e.filter(e=>!e.isGlobal);t&&y(!0),s(e),h(!1),r(2)}).catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},isLoading:b,buttonText:"Continue"}),n&&0<n.length&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(OrDivider,{})," ",jsxRuntime.exports.jsx(OpenID,{openIdItems:n})]})]})),jsxRuntime.exports.jsx("div",Object.assign({style:{display:2===e?"block":"none"}},{children:x?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Choose Authentication Option for",subText:l})," ",i&&0<i.length&&jsxRuntime.exports.jsx(OpenID,{openIdItems:i}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>r(1),text:"Back to Login",type:"login"})}))]}):jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Enter Password for",subText:l})," ",jsxRuntime.exports.jsx(PasswordInput,{password:u,errorMessage:d,onPasswordChange:e=>{d&&g(""),p(e)},onPressEnter:()=>{O().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})}}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"14px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>{R("/ui/auth/forgot",{state:{emailFromLogin:l}})},text:"Forgot Password?",type:"forgot"})})),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"25px"}},{children:jsxRuntime.exports.jsx(BlueButton,{onClick:()=>{O().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},text:"Login",type:"login",loading:$})})),i&&0<i.length&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(OrDivider,{})," ",jsxRuntime.exports.jsx(OpenID,{openIdItems:i})]}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>r(1),text:"Back to Login",type:"login"})}))]})}))]})},Forgot=()=>{const[r,e]=react.exports.useState(""),[t,o]=react.exports.useState(!1),[n,a]=react.exports.useState(1),i=useNavigate(),s=useLocation()["state"],l=(react.exports.useEffect(()=>{s&&s.emailFromLogin&&e(s.emailFromLogin)},[s]),()=>__awaiter(void 0,void 0,void 0,function*(){o(!0);try{var e=yield createPasswordResetRequestMutation(r),t=yield null==e?void 0:e.json();t.errors&&t.errors.length?(alert("Something went wrong. Please try again."),o(!1)):(o(!1),a(2))}catch(e){alert("Something went wrong. Please try again."),o(!1)}}));return jsxRuntime.exports.jsxs(PageContainer,{children:[1===n?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Forgot Password",subText:"Enter your registered email to reset your password."}),jsxRuntime.exports.jsx(EmailInput,{email:r,setEmail:e,onNextStep:()=>{l().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},isLoading:t,buttonText:"Send"})]}):jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Password reset requested",subText:"Your password reset will be sent to the email provided if it matches our records."}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"25px"}},{children:jsxRuntime.exports.jsx(BlueButton,{onClick:()=>{l().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},text:"Request Password Again",type:"reset-pw",loading:t})}))]}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>i("/ui/auth/login"),text:"Back to Login",type:"login"})}))]})},RestrictedProvider=()=>{const e=useNavigate();return jsxRuntime.exports.jsxs(PageContainer,{children:[jsxRuntime.exports.jsx(Header,{text:"Authentication Restriction",subText:"Authenticating with this OpenID provider has been restricted by an admin of your account. We are sorry for the inconvenience. Please return to the login screen and choose another authentication provider.",type:"restricted-provider"}),jsxRuntime.exports.jsx(BlueButton,{onClick:()=>e("/ui/auth/login"),text:"Back to Login",type:"back-to-login",loading:!1})]})},AccountLinking=()=>{const[e,t]=react.exports.useState(1),[r,o]=react.exports.useState(""),[n,a]=react.exports.useState(""),i=useNavigate(),[s,l]=react.exports.useState(!1),[c,u]=react.exports.useState(""),[p,d]=react.exports.useState(""),g=(react.exports.useEffect(()=>{var e=new URLSearchParams(window.location.search).get("session");e&&u(e)},[]),react.exports.useEffect(()=>{d("")},[r,n]),()=>__awaiter(void 0,void 0,void 0,function*(){if(!s){l(!0);try{var e=yield linkUserToOidAndLogin(r,n,c);200===e.status?window.location.href=generateApiUrlFromHost().replace("api","aiware")+"/switch-app/default":404===e.status?d("Email or Password is incorrect."):d("Something went wrong. Please try again.")}catch(e){d("Something went wrong. Please try again.")}finally{l(!1)}}}));return jsxRuntime.exports.jsx(PageContainer,{children:1===e?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Account Does Not Exist",subText:"This AiWARE account does not exist. Are you sure you’re using the correct Authentication Provider?",type:"link-oid"}),jsxRuntime.exports.jsx(BlueButton,{onClick:()=>t(2),text:"Link to Existing Account",type:"oid-linking",loading:!1}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"14px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>i("/ui/auth/login"),text:"Back to Login",type:"login"})}))]}):jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Header,{text:"Link Account",subText:"Provide the email and password to your aiWARE account."}),jsxRuntime.exports.jsx(EmailInput,{email:r,setEmail:o}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(PasswordInput,{password:n,onPasswordChange:a,onPressEnter:()=>{g().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},errorMessage:p,autoFocus:!1})})),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"14px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>i("/ui/auth/forgot"),text:"Forgot Password?",type:"forgot"})})),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"25px"}},{children:jsxRuntime.exports.jsx(BlueButton,{onClick:()=>{g().catch(e=>{devErrorLogger("Error: "+JSON.stringify(e))})},text:"Link Account & Login",type:"link-oid",loading:s})})),jsxRuntime.exports.jsx(Box,Object.assign({sx:{mt:"20px"}},{children:jsxRuntime.exports.jsx(BlueLinkText,{onClick:()=>i("/ui/auth/login"),text:"Back to Login",type:"login"})}))]})})},ResetPasswordPage=()=>{const e=useNavigate();var t=new URLSearchParams(window.location.search),r=t.get("username")||"",o=t.get("resettoken")||"",n=t.get("organizationinviteid")||"";const a=t.get("redirect");t=parseToken(o),t=!!t&&t.enablePasswordRestriction;return jsxRuntime.exports.jsx(PageContainer,{children:jsxRuntime.exports.jsx(Box,Object.assign({sx:{width:"368px"}},{children:jsxRuntime.exports.jsx(ResetPasswordWidget,{resetToken:o,username:r,organizationInviteId:n,onSuccess:()=>{a?window.location.href=a:e("/ui/auth/login")},requiresPasswordRestriction:t,isNewPage:!0,containerWidth:"100%"})}))})},useStyles$1=makeStyles()(()=>({button:{position:"absolute",left:"40px",top:"30px",border:"none",color:"#5C6269",borderRadius:"4px",paddingLeft:"14px",paddingRight:"14px",fontWeight:400},select:{height:"52px",width:"542px",marginTop:"20px",textAlign:"left"},menu:{"& > .Sdk-MuiPopover-paper":{padding:"0"},"& > .Sdk-MuiPaper-root > ul":{padding:"5px"}},stepOneFullWidthInput:{height:"52px",width:"368px"},stepOneHalfWidthInputContainer:{display:"flex",justifyContent:"space-between",width:"368px",marginTop:"20px"},stepOneHalfWidthInput:{height:"52px",width:"calc(50% - 10px)"},stepTwoContainer:{width:"542px",textAlign:"center"},stepTwoTextField:{height:"52px",width:"542px"},menuItem:{width:"532px"},autoCompleteContainer:{width:"542px",display:"flex",justifyContent:"center"},autoComplete:{width:"542px",marginTop:"20px",height:"52px"},formInputTopMargin:{marginTop:"20px"},formInputTopDoubleMargin:{marginTop:"40px"},previewBox:{width:"164px",height:"164px",borderRadius:"5px",border:"2px dashed #D5DFE9",padding:"10px",boxSizing:"border-box",cursor:"pointer"},logoLanding:{width:"140px",height:"140px",background:"rgba(247, 247, 247, 0.80)",display:"flex",alignItems:"center",justifyContent:"center"},addIcon:{fill:"#555F7C"},logoDescriptionText:{textAlign:"left"},logoUploadBtn:{borderRadius:"4px",border:"1px solid #5C6269",color:"#5C6269",fontWeight:"400",padding:"8px 15px"},orgLogoPreview:{width:"164px",height:"164px"},errorMessage:{color:"red"},confirmationText:{fontSize:"22px",color:"#2A323C",lineHeight:"28px"}}));var countries=[{label:"Afghanistan",id:"AF"},{label:"Åland Islands",id:"AX"},{label:"Albania",id:"AL"},{label:"Algeria",id:"DZ"},{label:"American Samoa",id:"AS"},{label:"AndorrA",id:"AD"},{label:"Angola",id:"AO"},{label:"Anguilla",id:"AI"},{label:"Antarctica",id:"AQ"},{label:"Antigua and Barbuda",id:"AG"},{label:"Argentina",id:"AR"},{label:"Armenia",id:"AM"},{label:"Aruba",id:"AW"},{label:"Australia",id:"AU"},{label:"Austria",id:"AT"},{label:"Azerbaijan",id:"AZ"},{label:"Bahamas",id:"BS"},{label:"Bahrain",id:"BH"},{label:"Bangladesh",id:"BD"},{label:"Barbados",id:"BB"},{label:"Belarus",id:"BY"},{label:"Belgium",id:"BE"},{label:"Belize",id:"BZ"},{label:"Benin",id:"BJ"},{label:"Bermuda",id:"BM"},{label:"Bhutan",id:"BT"},{label:"Bolivia",id:"BO"},{label:"Bosnia and Herzegovina",id:"BA"},{label:"Botswana",id:"BW"},{label:"Bouvet Island",id:"BV"},{label:"Brazil",id:"BR"},{label:"British Indian Ocean Territory",id:"IO"},{label:"Brunei Darussalam",id:"BN"},{label:"Bulgaria",id:"BG"},{label:"Burkina Faso",id:"BF"},{label:"Burundi",id:"BI"},{label:"Cambodia",id:"KH"},{label:"Cameroon",id:"CM"},{label:"Canada",id:"CA"},{label:"Cape Verde",id:"CV"},{label:"Cayman Islands",id:"KY"},{label:"Central African Republic",id:"CF"},{label:"Chad",id:"TD"},{label:"Chile",id:"CL"},{label:"China",id:"CN"},{label:"Christmas Island",id:"CX"},{label:"Cocos (Keeling) Islands",id:"CC"},{label:"Colombia",id:"CO"},{label:"Comoros",id:"KM"},{label:"Congo",id:"CG"},{label:"Congo, The Democratic Republic of the",id:"CD"},{label:"Cook Islands",id:"CK"},{label:"Costa Rica",id:"CR"},{label:"Cote D'Ivoire",id:"CI"},{label:"Croatia",id:"HR"},{label:"Cuba",id:"CU"},{label:"Cyprus",id:"CY"},{label:"Czech Republic",id:"CZ"},{label:"Denmark",id:"DK"},{label:"Djibouti",id:"DJ"},{label:"Dominica",id:"DM"},{label:"Dominican Republic",id:"DO"},{label:"Ecuador",id:"EC"},{label:"Egypt",id:"EG"},{label:"El Salvador",id:"SV"},{label:"Equatorial Guinea",id:"GQ"},{label:"Eritrea",id:"ER"},{label:"Estonia",id:"EE"},{label:"Ethiopia",id:"ET"},{label:"Falkland Islands (Malvinas)",id:"FK"},{label:"Faroe Islands",id:"FO"},{label:"Fiji",id:"FJ"},{label:"Finland",id:"FI"},{label:"France",id:"FR"},{label:"French Guiana",id:"GF"},{label:"French Polynesia",id:"PF"},{label:"French Southern Territories",id:"TF"},{label:"Gabon",id:"GA"},{label:"Gambia",id:"GM"},{label:"Georgia",id:"GE"},{label:"Germany",id:"DE"},{label:"Ghana",id:"GH"},{label:"Gibraltar",id:"GI"},{label:"Greece",id:"GR"},{label:"Greenland",id:"GL"},{label:"Grenada",id:"GD"},{label:"Guadeloupe",id:"GP"},{label:"Guam",id:"GU"},{label:"Guatemala",id:"GT"},{label:"Guernsey",id:"GG"},{label:"Guinea",id:"GN"},{label:"Guinea-Bissau",id:"GW"},{label:"Guyana",id:"GY"},{label:"Haiti",id:"HT"},{label:"Heard Island and Mcdonald Islands",id:"HM"},{label:"Holy See (Vatican City State)",id:"VA"},{label:"Honduras",id:"HN"},{label:"Hong Kong",id:"HK"},{label:"Hungary",id:"HU"},{label:"Iceland",id:"IS"},{label:"India",id:"IN"},{label:"Indonesia",id:"ID"},{label:"Iran, Islamic Republic Of",id:"IR"},{label:"Iraq",id:"IQ"},{label:"Ireland",id:"IE"},{label:"Isle of Man",id:"IM"},{label:"Israel",id:"IL"},{label:"Italy",id:"IT"},{label:"Jamaica",id:"JM"},{label:"Japan",id:"JP"},{label:"Jersey",id:"JE"},{label:"Jordan",id:"JO"},{label:"Kazakhstan",id:"KZ"},{label:"Kenya",id:"KE"},{label:"Kiribati",id:"KI"},{label:"Korea, Democratic People'S Republic of",id:"KP"},{label:"Korea, Republic of",id:"KR"},{label:"Kuwait",id:"KW"},{label:"Kyrgyzstan",id:"KG"},{label:"Lao People'S Democratic Republic",id:"LA"},{label:"Latvia",id:"LV"},{label:"Lebanon",id:"LB"},{label:"Lesotho",id:"LS"},{label:"Liberia",id:"LR"},{label:"Libyan Arab Jamahiriya",id:"LY"},{label:"Liechtenstein",id:"LI"},{label:"Lithuania",id:"LT"},{label:"Luxembourg",id:"LU"},{label:"Macao",id:"MO"},{label:"Macedonia, The Former Yugoslav Republic of",id:"MK"},{label:"Madagascar",id:"MG"},{label:"Malawi",id:"MW"},{label:"Malaysia",id:"MY"},{label:"Maldives",id:"MV"},{label:"Mali",id:"ML"},{label:"Malta",id:"MT"},{label:"Marshall Islands",id:"MH"},{label:"Martinique",id:"MQ"},{label:"Mauritania",id:"MR"},{label:"Mauritius",id:"MU"},{label:"Mayotte",id:"YT"},{label:"Mexico",id:"MX"},{label:"Micronesia, Federated States of",id:"FM"},{label:"Moldova, Republic of",id:"MD"},{label:"Monaco",id:"MC"},{label:"Mongolia",id:"MN"},{label:"Montserrat",id:"MS"},{label:"Morocco",id:"MA"},{label:"Mozambique",id:"MZ"},{label:"Myanmar",id:"MM"},{label:"Namibia",id:"NA"},{label:"Nauru",id:"NR"},{label:"Nepal",id:"NP"},{label:"Netherlands",id:"NL"},{label:"Netherlands Antilles",id:"AN"},{label:"New Caledonia",id:"NC"},{label:"New Zealand",id:"NZ"},{label:"Nicaragua",id:"NI"},{label:"Niger",id:"NE"},{label:"Nigeria",id:"NG"},{label:"Niue",id:"NU"},{label:"Norfolk Island",id:"NF"},{label:"Northern Mariana Islands",id:"MP"},{label:"Norway",id:"NO"},{label:"Oman",id:"OM"},{label:"Pakistan",id:"PK"},{label:"Palau",id:"PW"},{label:"Palestinian Territory, Occupied",id:"PS"},{label:"Panama",id:"PA"},{label:"Papua New Guinea",id:"PG"},{label:"Paraguay",id:"PY"},{label:"Peru",id:"PE"},{label:"Philippines",id:"PH"},{label:"Pitcairn",id:"PN"},{label:"Poland",id:"PL"},{label:"Portugal",id:"PT"},{label:"Puerto Rico",id:"PR"},{label:"Qatar",id:"QA"},{label:"Reunion",id:"RE"},{label:"Romania",id:"RO"},{label:"Russian Federation",id:"RU"},{label:"RWANDA",id:"RW"},{label:"Saint Helena",id:"SH"},{label:"Saint Kitts and Nevis",id:"KN"},{label:"Saint Lucia",id:"LC"},{label:"Saint Pierre and Miquelon",id:"PM"},{label:"Saint Vincent and the Grenadines",id:"VC"},{label:"Samoa",id:"WS"},{label:"San Marino",id:"SM"},{label:"Sao Tome and Principe",id:"ST"},{label:"Saudi Arabia",id:"SA"},{label:"Senegal",id:"SN"},{label:"Serbia and Montenegro",id:"CS"},{label:"Seychelles",id:"SC"},{label:"Sierra Leone",id:"SL"},{label:"Singapore",id:"SG"},{label:"Slovakia",id:"SK"},{label:"Slovenia",id:"SI"},{label:"Solomon Islands",id:"SB"},{label:"Somalia",id:"SO"},{label:"South Africa",id:"ZA"},{label:"South Georgia and the South Sandwich Islands",id:"GS"},{label:"Spain",id:"ES"},{label:"Sri Lanka",id:"LK"},{label:"Sudan",id:"SD"},{label:"Surilabel",id:"SR"},{label:"Svalbard and Jan Mayen",id:"SJ"},{label:"Swaziland",id:"SZ"},{label:"Sweden",id:"SE"},{label:"Switzerland",id:"CH"},{label:"Syrian Arab Republic",id:"SY"},{label:"Taiwan, Province of China",id:"TW"},{label:"Tajikistan",id:"TJ"},{label:"Tanzania, United Republic of",id:"TZ"},{label:"Thailand",id:"TH"},{label:"Timor-Leste",id:"TL"},{label:"Togo",id:"TG"},{label:"Tokelau",id:"TK"},{label:"Tonga",id:"TO"},{label:"Trinidad and Tobago",id:"TT"},{label:"Tunisia",id:"TN"},{label:"Turkey",id:"TR"},{label:"Turkmenistan",id:"TM"},{label:"Turks and Caicos Islands",id:"TC"},{label:"Tuvalu",id:"TV"},{label:"Uganda",id:"UG"},{label:"Ukraine",id:"UA"},{label:"United Arab Emirates",id:"AE"},{label:"United Kingdom",id:"GB"},{label:"United States",id:"US"},{label:"United States Minor Outlying Islands",id:"UM"},{label:"Uruguay",id:"UY"},{label:"Uzbekistan",id:"UZ"},{label:"Vanuatu",id:"VU"},{label:"Venezuela",id:"VE"},{label:"Viet Nam",id:"VN"},{label:"Virgin Islands, British",id:"VG"},{label:"Virgin Islands, U.S.",id:"VI"},{label:"Wallis and Futuna",id:"WF"},{label:"Western Sahara",id:"EH"},{label:"Yemen",id:"YE"},{label:"Zambia",id:"ZM"},{label:"Zimbabwe",id:"ZW"}],industries=["Accounting","Airlines/Aviation","Alternative Dispute Resolution","Alternative Medicine","Animation","Apparel & Fashion","Architecture & Planning","Arts & Crafts","Automotive","Aviation & Aerospace","Banking","Biotechnology","Broadcast Media","Building Materials","Business Supplies & Equipment","Capital Markets","Chemicals","Civic & Social Organization","Civil Engineering","Commercial Real Estate","Computer & Network Security","Computer Games","Computer Hardware","Computer Networking","Computer Software","Construction","Consumer Electronics","Consumer Goods","Consumer Services","Cosmetics","Dairy","Defense & Space","Design","Education Management","E-learning","Electrical & Electronic Manufacturing","Entertainment","Environmental Services","Events Services","Executive Office","Facilities Services","Farming","Financial Services","Fine Art","Fishery","Food & Beverages","Food Production","Fundraising","Furniture","Gambling & Casinos","Glass, Ceramics & Concrete","Government Administration","Government Relations","Graphic Design","Health, Wellness & Fitness","Higher Education","Hospital & Health Care","Hospitality","Human Resources","Import & Export","Individual & Family Services","Industrial Automation","Information Services","Information Technology & Services","Insurance","International Affairs","International Trade & Development","Internet","Investment Banking/Venture","Investment Management","Judiciary","Law Enforcement","Law Practice","Legal Services","Legislative Office","Leisure & Travel","Libraries","Logistics & Supply Chain","Luxury Goods & Jewelry","Machinery","Management Consulting","Maritime","Marketing & Advertising","Market Research","Mechanical or Industrial Engineering","Media Production","Medical Device","Medical Practice","Mental Health Care","Military","Mining & Metals","Motion Pictures & Film","Museums & Institutions","Music","Nanotechnology","Newspapers","Nonprofit Organization Management","Oil & Energy","Online Publishing","Outsourcing/Offshoring","Package/Freight Delivery","Packaging & Containers","Paper & Forest Products","Performing Arts","Pharmaceuticals","Philanthropy","Photography","Plastics","Political Organization","Primary/Secondary","Printing","Professional Training","Program Development","Public Policy","Public Relations","Public Safety","Publishing","Railroad Manufacture","Ranching","Real Estate","Recreational","Facilities & Services","Religious Institutions","Renewables & Environment","Research","Restaurants","Retail","Security & Investigations","Semiconductors","Shipbuilding","Sporting Goods","Sports","Staffing & Recruiting","Supermarkets","Telecommunications","Textiles","Think Tanks","Tobacco","Translation & Localization","Transportation/Trucking/Railroad","Utilities","Venture Capital","Veterinary","Warehousing","Wholesale","Wine & Spirits","Wireless","Writing & Editing"];const teamSizeOptions=["1-10","10-50","50-100","100-500","500-1000","> 1000"],industryOptions=industries.map(e=>({id:e,label:e})),SignUpStep_2=()=>{var e=react.exports.useRef();const r=useDispatch(),t=useSelector(selectFormValues),o=useSelector(selectErrors),n=useSelector(selectStatus),a=!!Object.keys(o).find(e=>o[e])||!!Object.keys(o).find(e=>!t[e])||"loading"===n,i=useStyles$1()["classes"],s=useNavigate(),l=()=>{r(actions.createUserStart())},c=e=>{"Enter"===e.key&&(r(actions.validate()),a||l())};return jsxRuntime.exports.jsxs(Box,Object.assign({className:i.stepTwoContainer},{children:[jsxRuntime.exports.jsx(Header,{text:"success"!==n?"Let's set up your Organization":""}),"success"!==n?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(TextField,{id:"orgName","data-testid":"os-auth-orgName-input-field",label:"Organization Name",variant:"outlined",value:"orgName"in t&&(null===t||void 0===t?void 0:t.orgName),autoComplete:"company",autoFocus:!0,className:i.stepTwoTextField,error:"orgName"in o&&o.orgName,onChange:e=>r(actions.setValue({key:"orgName",value:e.target.value})),onKeyDown:c,disabled:"loading"===n}),jsxRuntime.exports.jsxs(FormControl,{children:[jsxRuntime.exports.jsx(InputLabel,Object.assign({id:"os-auth.sign-up.teamSize",className:i.formInputTopMargin},{children:"Team Size"})),jsxRuntime.exports.jsx(Select,Object.assign({labelId:"os-auth.sign-up.teamSize",id:"os-auth.sign-up.teamSize",value:"teamSize"in t&&(null===t||void 0===t?void 0:t.teamSize),className:i.select,MenuProps:{className:i.menu},label:"Team Size",onChange:e=>r(actions.setValue({key:"teamSize",value:e.target.value||""})),disabled:"loading"===n},{children:teamSizeOptions.map(e=>jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e,className:i.menuItem},{children:e})))}))]}),jsxRuntime.exports.jsx(Box,Object.assign({className:i.autoCompleteContainer},{children:jsxRuntime.exports.jsx(Autocomplete,{disablePortal:!0,id:"os-auth.sign-up.country-autocomplete",options:countries,value:"country"in t&&countries.find(e=>e.id===t.country),onChange:(e,t)=>r(actions.setValue({key:"country",value:(t||{}).id||""})),className:i.autoComplete,renderInput:e=>jsxRuntime.exports.jsx(TextField,Object.assign({},e,{label:"Country",onKeyDown:c,disabled:"loading"===n}))})})),jsxRuntime.exports.jsx(Box,Object.assign({className:i.autoCompleteContainer},{children:jsxRuntime.exports.jsx(Autocomplete,{disablePortal:!0,id:"os-auth.sign-up.industry-autocomplete",options:industryOptions,value:"industry"in t&&industryOptions.find(e=>e.id===t.industry),onChange:(e,t)=>r(actions.setValue({key:"country",value:(t||{}).id||""})),className:i.autoComplete,renderInput:e=>jsxRuntime.exports.jsx(TextField,Object.assign({},e,{label:"Industry",onKeyDown:c,disabled:"loading"===n}))})})),jsxRuntime.exports.jsx(BlueButton,{onClick:l,text:"Create Account",type:"Continue",disableButton:a,className:i.formInputTopDoubleMargin,ref:null!=e&&e.current?e:void 0,loading:"loading"===n})]}):jsxRuntime.exports.jsxs(Box,{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1",className:i.confirmationText},{children:"Thank you for registering! A confirmation email has been sent with an activation link for your new aiWARE account."})),jsxRuntime.exports.jsx(BlueButton,{onClick:()=>s("/ui/auth/login"),text:"Return To Homepage",className:i.formInputTopDoubleMargin,type:"Continue"})]})]}))},SignUpStep_1=()=>{var e=react.exports.useRef();const t=useDispatch(),r=useSelector(selectFormValues);var o=useSelector(selectErrors);const n=!!Object.entries(o).find(([,e])=>e)||!!Object.keys(o).find(e=>!r[e])||!validateEmail$1("email"in r&&(null===r||void 0===r?void 0:r.email)||"");var a=useStyles$1()["classes"],i=e=>{"Enter"===e.key&&(t(actions.validate()),n||s())};const s=()=>{t(actions.setStep(2))};return jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsx(Header,{text:"Sign Up for your aiWARE account"}),jsxRuntime.exports.jsx(TextField,{id:"email","data-testid":"os-auth-email-input-field",label:"email"in o&&o.email?"Please provide a valid email":"Email",InputProps:{type:"email"},variant:"outlined",value:"email"in r&&(null===r||void 0===r?void 0:r.email),autoComplete:"email",autoFocus:!0,className:a.stepOneFullWidthInput,error:"email"in o&&o.email,onChange:e=>t(actions.setValue({key:"email",value:e.target.value.trim()})),onKeyDown:i}),jsxRuntime.exports.jsxs(Box,Object.assign({className:a.stepOneHalfWidthInputContainer},{children:[jsxRuntime.exports.jsx(TextField,{id:"firstName","data-testid":"os-auth-firstName-input-field",label:"First Name",variant:"outlined",value:"firstName"in r&&(null===r||void 0===r?void 0:r.firstName),autoComplete:"first name",className:a.stepOneHalfWidthInput,error:"firstName"in o&&o.firstName,onChange:e=>t(actions.setValue({key:"firstName",value:e.target.value})),onKeyDown:i}),jsxRuntime.exports.jsx(TextField,{id:"lastName","data-testid":"os-auth-lastName-input-field",label:"Last Name",variant:"outlined",value:"lastName"in r&&(null===r||void 0===r?void 0:r.lastName),autoComplete:"last name",className:a.stepOneHalfWidthInput,error:"lastName"in o&&o.lastName,onChange:e=>t(actions.setValue({key:"lastName",value:e.target.value})),onKeyDown:i})]})),jsxRuntime.exports.jsx(BlueButton,{onClick:s,text:"Continue",type:"Continue",disableButton:n,className:a.formInputTopMargin,ref:null!=e&&e.current?e:void 0})]})},SignUp=()=>{var e=useSelector(selectActiveStep);const t=useDispatch();var r=useStyles$1()["classes"],o=useSelector(selectStatus);const n=t=>window.location.href.split("://")[1].split(".").find(e=>e===t);return react.exports.useEffect(()=>{t(actions.resetState()),n("local")||n("dev")?t(actions.setEnv("dev")):n("stage")?t(actions.setEnv("stage")):t(actions.setEnv("prod"))},[]),jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getSignUpModule()]},{children:jsxRuntime.exports.jsxs(PageContainer,Object.assign({showLogoInFooter:!1},{children:[jsxRuntime.exports.jsx(SignUpButton,{label:"Login",navigateTo:"login"}),2===e&&"success"!==o&&jsxRuntime.exports.jsxs(Button,Object.assign({className:r.button,onClick:()=>t(actions.setStep(1)),disabled:"loading"===o},{children:[jsxRuntime.exports.jsx(default_1,{fontSize:"small",sx:{marginRight:"5px"}})," Back"]})),jsxRuntime.exports.jsx("div",{children:1===e?jsxRuntime.exports.jsx(SignUpStep_1,{}):jsxRuntime.exports.jsx(SignUpStep_2,{})})]}))}))},useStyles=makeStyles()((e,{error:t,passwordRequirementsMet:r})=>{let o="auto";return t?o="red":r||(o="rgba(0, 0, 0, 0.26)"),{passwordLabel:{background:"white",padding:"0 3px"},passwordFormMarginTop:{marginTop:"20px"},passwordInput:{width:"368px"},confirmPasswordLabel:{color:o,"&.Mui-focused":{color:o}}}}),usePasswordRequirementStyles=makeStyles()(()=>({container:{width:"357px",height:"256px",display:"flex",alignItems:"center",justifyContent:"center"},popover:{boxSizing:"border-box",padding:"25px 20px",width:"327px",height:"236px",marginTop:"10px",borderRadius:"5px",boxShadow:"0px 2px 10px 0px rgba(0, 0, 0, 0.20)","&::before":{backgroundColor:"white",content:'""',display:"block",position:"absolute",width:12,height:12,top:"calc(50% - 6px)",transform:"rotate(45deg)",left:"calc(100% - 20px)"}},barContainer:{display:"flex",width:"286px",justifyContent:"space-between",padding:"15px 0px"},bar:{width:"70px",height:"4px",borderRadius:"20px"},metRequirement:{color:"#9CA8B4",textDecorationLine:"line-through"},unmetRequirement:{color:"#5C6269"},requirement:{padding:"10px 0",display:"flex",alignItems:"center"},bullet:{transform:"translateY(8px)",marginLeft:"5px"},checkMark:{fill:"#0E6EEC",marginRight:"8px",marginLeft:"-3px"}}));var isCallable=isCallable$p,isObject=isObject$a,setPrototypeOf=objectSetPrototypeOf,inheritIfRequired$1=function(e,t,r){return setPrototypeOf&&isCallable(t=t.constructor)&&t!==r&&isObject(t=t.prototype)&&t!==r.prototype&&setPrototypeOf(e,t),e},defineProperty=objectDefineProperty.f,proxyAccessor$1=function(e,t,r){r in e||defineProperty(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})},DESCRIPTORS=descriptors,global$1=global$p,uncurryThis=functionUncurryThis,isForced=isForced_1,inheritIfRequired=inheritIfRequired$1,createNonEnumerableProperty=createNonEnumerableProperty$6,getOwnPropertyNames=objectGetOwnPropertyNames.f,isPrototypeOf=objectIsPrototypeOf,isRegExp=isRegexp,toString=toString$9,getRegExpFlags=regexpGetFlags,stickyHelpers=regexpStickyHelpers,proxyAccessor=proxyAccessor$1,defineBuiltIn=defineBuiltIn$a,fails=fails$n,hasOwn=hasOwnProperty_1,enforceInternalState=internalState.enforce,setSpecies=setSpecies$2,wellKnownSymbol=wellKnownSymbol$l,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,MATCH=wellKnownSymbol$l("match"),NativeRegExp=global$1.RegExp,RegExpPrototype=NativeRegExp.prototype,SyntaxError=global$1.SyntaxError,exec=uncurryThis(RegExpPrototype.exec),charAt=uncurryThis("".charAt),replace=uncurryThis("".replace),stringIndexOf=uncurryThis("".indexOf),stringSlice=uncurryThis("".slice),IS_NCG=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,re1=/a/g,re2=/a/g,CORRECT_NEW=new NativeRegExp(re1)!==re1,MISSED_STICKY=stickyHelpers.MISSED_STICKY,UNSUPPORTED_Y=stickyHelpers.UNSUPPORTED_Y,BASE_FORCED=DESCRIPTORS&&(!CORRECT_NEW||MISSED_STICKY||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG||fails(function(){return re2[MATCH]=!1,NativeRegExp(re1)!=re1||NativeRegExp(re2)==re2||"/a/i"!=NativeRegExp(re1,"i")})),handleDotAll=function(e){for(var t,r=e.length,o=0,n="",a=!1;o<=r;o++)"\\"===(t=charAt(e,o))?n+=t+charAt(e,++o):a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),n+=t):n+="[\\s\\S]";return n},handleNCG=function(e){for(var t,r=e.length,o=0,n="",a=[],i={},s=!1,l=!1,c=0,u="";o<=r;o++){if("\\"===(t=charAt(e,o)))t+=charAt(e,++o);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:exec(IS_NCG,stringSlice(e,o+1))&&(o+=2,l=!0),n+=t,c++;continue;case">"===t&&l:if(""===u||hasOwn(i,u))throw new SyntaxError("Invalid capture group name");i[u]=!0,l=!(a[a.length]=[u,c]),u="";continue}l?u+=t:n+=t}return[n,a]};if(isForced("RegExp",BASE_FORCED)){for(var RegExpWrapper=function(e,t){var r,o,n=isPrototypeOf(RegExpPrototype,this),a=isRegExp(e),i=void 0===t,s=[],l=e;if(!n&&a&&i&&e.constructor===RegExpWrapper)return e;if((a||isPrototypeOf(RegExpPrototype,e))&&(e=e.source,i)&&(t=getRegExpFlags(l)),e=void 0===e?"":toString(e),t=void 0===t?"":toString(t),l=e,a=t=UNSUPPORTED_DOT_ALL&&"dotAll"in re1&&(r=!!t&&-1<stringIndexOf(t,"s"))?replace(t,/s/g,""):t,MISSED_STICKY&&"sticky"in re1&&(o=!!t&&-1<stringIndexOf(t,"y"))&&UNSUPPORTED_Y&&(t=replace(t,/y/g,"")),UNSUPPORTED_NCG&&(e=(i=handleNCG(e))[0],s=i[1]),i=inheritIfRequired(NativeRegExp(e,t),n?this:RegExpPrototype,RegExpWrapper),(r||o||s.length)&&(t=enforceInternalState(i),r&&(t.dotAll=!0,t.raw=RegExpWrapper(handleDotAll(e),a)),o&&(t.sticky=!0),s.length)&&(t.groups=s),e!==l)try{createNonEnumerableProperty(i,"source",""===l?"(?:)":l)}catch(e){}return i},keys=getOwnPropertyNames(NativeRegExp),index=0;keys.length>index;)proxyAccessor(RegExpWrapper,NativeRegExp,keys[index++]);(RegExpPrototype.constructor=RegExpWrapper).prototype=RegExpPrototype,defineBuiltIn(global$1,"RegExp",RegExpWrapper,{constructor:!0})}setSpecies("RegExp");const PasswordRequirements=({password:r,setPasswordRequirementsMet:o})=>{const n=usePasswordRequirementStyles()["classes"];const a=[{id:"upperLower",label:"Upper & lower case letters",regex:new RegExp("(?=.*[a-z])(?=.*[A-Z])","g"),met:!1},{id:"length",label:"At least 8 characters",regex:new RegExp(".{8}$"),met:!1},{id:"specialCharacter",label:"A symbol (#$&!)",regex:new RegExp("[!#$&()]"),met:!1}],[i,s]=react.exports.useState(a),l={0:"#FF5722",1:"#FFC107",2:"#00BCD4",3:"#4CAF50"};return react.exports.useEffect(()=>{var e=[...a];for(const t of e)t.regex.test(r)&&(t.met=!0);e.find(e=>!e.met)?o(!1):o(!0),s(e)},[r]),jsxRuntime.exports.jsx(Box$1,Object.assign({className:n.container},{children:jsxRuntime.exports.jsxs(Box$1,Object.assign({className:n.popover},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1"},{children:r?{0:"Weak Password",1:"Average Password",2:"Good Password",3:"Strong Password 💪"}[i.filter(e=>e.met).length]:"Please set a strong password"})),jsxRuntime.exports.jsx(Box$1,Object.assign({className:n.barContainer},{children:Array.from(Array(4).keys()).map(e=>{var t=i.filter(e=>e.met).length;return jsxRuntime.exports.jsx(Box$1,{className:n.bar,sx:{background:e<=t&&r?l[t]:"#9CA8B4"}},e)})})),jsxRuntime.exports.jsx(Box$1,{children:i.map(e=>jsxRuntime.exports.jsxs(Box$1,Object.assign({className:classNames(n.requirement,e.met?n.metRequirement:n.unmetRequirement)},{children:[e.met?jsxRuntime.exports.jsx(CheckmarkFilled,{className:n.checkMark}):jsxRuntime.exports.jsx(Bullet,{className:n.bullet}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body2"},{children:e.label}))]}),e.id))})]}))}))},SignUpPassword=({userId:e,token:t})=>{const[r,o]=react.exports.useState(!1),[n,a]=react.exports.useState(!1),[i,s]=react.exports.useState(""),[l,c]=react.exports.useState(""),[u,p]=react.exports.useState(!1),[d,g]=react.exports.useState(!1),[$,m]=react.exports.useState(!1),[b,h]=react.exports.useState(null);var x=useStyles({error:$,passwordRequirementsMet:d})["classes"];const y=useDispatch();var f=react.exports.useRef();react.exports.useEffect(()=>{i&&l&&i===l&&d&&p(!0)},[i,l]);const S=e=>{e(e=>!e)};var R=e=>{e.preventDefault()},E=e=>{"Enter"===e.key&&u&&C()};const O={password:i,confirmPassword:l},I={password:s,confirmPassword:c},P=(e,r)=>{e.target.id===v&&e.target.value&&h(e.currentTarget),m(!1);const o=e.target.value;I[r](o),debounce_1(()=>{var e,t;({password:e,confirmPassword:t}=Object.assign(Object.assign({},O),{[r]:o})),e&&t&&e!==t?m(!0):$&&m(!1)},1e3)()};var j=Boolean(b),T=j?"simple-popover":void 0;const v="sign-up.password";const C=()=>{y(actions.setPasswordStart({password:i,userId:e,token:t}))};return jsxRuntime.exports.jsxs(Box$1,Object.assign({className:x.passwordInput},{children:[jsxRuntime.exports.jsx(Header,{text:"Set a password for your account"}),jsxRuntime.exports.jsxs(FormControl,Object.assign({variant:"outlined",className:x.passwordInput},{children:[jsxRuntime.exports.jsx(InputLabel,Object.assign({htmlFor:v,className:x.passwordLabel},{children:"Password"})),jsxRuntime.exports.jsx(OutlinedInput,{id:v,"data-testid":v,ref:f,type:r?"text":"password",onChange:e=>P(e,"password"),value:i,autoFocus:!0,endAdornment:jsxRuntime.exports.jsx(InputAdornment,Object.assign({position:"end"},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"toggle password visibility",onClick:()=>S(o),onMouseDown:R,edge:"end"},{children:r?jsxRuntime.exports.jsx(default_1$3,{}):jsxRuntime.exports.jsx(default_1$4,{})}))})),onKeyDown:E,onClick:e=>{h(e.currentTarget)}}),jsxRuntime.exports.jsx(Popover,Object.assign({id:T,open:j,anchorEl:b,onClose:()=>{h(null)},disableAutoFocus:!0,disableEnforceFocus:!0,anchorReference:b,transformOrigin:{vertical:"center",horizontal:"right"},anchorOrigin:{vertical:"center",horizontal:"left"},PaperProps:{style:{backgroundColor:"transparent",boxShadow:"none",borderRadius:0}}},{children:jsxRuntime.exports.jsx(PasswordRequirements,{password:i,setPasswordRequirementsMet:g})}))]})),jsxRuntime.exports.jsxs(FormControl,Object.assign({className:classNames(x.passwordInput,x.passwordFormMarginTop),variant:"outlined"},{children:[jsxRuntime.exports.jsx(InputLabel,Object.assign({htmlFor:"sign-up.confirm-password",className:classNames(x.passwordLabel,x.confirmPasswordLabel)},{children:$?"Passwords must match":"Confirm Password"})),jsxRuntime.exports.jsx(OutlinedInput,{id:"sign-up.confirm-password","data-testid":"sign-up.confirm-password",type:n?"text":"password",onChange:e=>P(e,"confirmPassword"),value:l,endAdornment:jsxRuntime.exports.jsx(InputAdornment,Object.assign({position:"end"},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"toggle password visibility",onClick:d?()=>S(a):()=>({}),onMouseDown:R,edge:"end",disabled:!d},{children:n?jsxRuntime.exports.jsx(default_1$3,{}):jsxRuntime.exports.jsx(default_1$4,{})}))})),error:$,onKeyDown:E,disabled:!d})]})),jsxRuntime.exports.jsx(BlueButton,{className:x.passwordFormMarginTop,onClick:C,text:"Create Account",type:"sign-up",disableButton:!u})]}))},SetPassword=()=>{const[r]=useSearchParams(),[e,o]=react.exports.useState(""),[t,n]=react.exports.useState(""),a=useNavigate(),i=useSelector(selectStatus);return react.exports.useEffect(()=>{var e=r.get("useruuid")||"",t=r.get("token")||"";e&&t?(o(e),n(t)):a("/ui/auth/login")},[]),react.exports.useEffect(()=>{"success"===i&&a("/ui/tiers")},[i]),jsxRuntime.exports.jsx(PageContainer,Object.assign({showLogoInFooter:!1},{children:jsxRuntime.exports.jsx(SignUpPassword,{userId:e,token:t})}))},Plans=()=>{var e=useLocation();return new URLSearchParams(e.search).get("giveMeBeta")?(e=window&&(null==(e=window.config)?void 0:e.stripePublishableKey)||"pk_test_51NNcicInolL392yPuFClPywpUYp0ppNltcHBEdkPNkpMgmagbymPCeal9Dl3dDYn63IOfIafuobscqZhCJQfp3KN00Th3bxbLx",jsxRuntime.exports.jsx("stripe-pricing-table",{"pricing-table-id":"prctbl_1NkvOrInolL392yPOejCV1RT","publishable-key":e})):null},PaymentResult=()=>jsxRuntime.exports.jsxs(Box,Object.assign({sx:{position:"fixed",width:"100%",height:"100vh",top:"0",left:"0",backgroundColor:"#ffffff",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",textAlign:"center",fontSize:"14px",zIndex:99999}},{children:[jsxRuntime.exports.jsx(Box,Object.assign({sx:{height:"200px",width:"405px",mb:6},id:"loaderAnimation"},{children:jsxRuntime.exports.jsx("img",{src:img,alt:"aiware-logo",style:{height:"200px",width:"200px"}})})),jsxRuntime.exports.jsxs(Box,Object.assign({sx:{height:"200px",width:"405px"}},{children:[jsxRuntime.exports.jsx(StyledEngineProvider,Object.assign({injectFirst:!0},{children:jsxRuntime.exports.jsx(LinearProgress,{color:"primary",sx:{height:"7px",backgroundColor:"#D9D9D9",mt:2,borderRadius:"20px"}})})),jsxRuntime.exports.jsx(Typography,Object.assign({sx:{color:"#2A323C",textTransform:"none",mt:4,fontFamily:"Nunito Sans",fontSize:"18px",fontWeight:600,lineHeight:"24px",letterSpacing:"-1.3038520263464193e-9px",textAlign:"center"}},{children:"Creating your custom experience..."}))]}))]})),AuthRoutes=()=>jsxRuntime.exports.jsxs(Routes,{children:[jsxRuntime.exports.jsx(Route,{path:"/login",element:jsxRuntime.exports.jsx(LoginPage,{})}),jsxRuntime.exports.jsx(Route,{path:"sign-up",element:jsxRuntime.exports.jsx(SignUp,{})}),jsxRuntime.exports.jsx(Route,{path:"/plans",element:jsxRuntime.exports.jsx(Plans,{})}),jsxRuntime.exports.jsx(Route,{path:"/payment-result",element:jsxRuntime.exports.jsx(PaymentResult,{})}),jsxRuntime.exports.jsx(Route,{path:"/forgot",element:jsxRuntime.exports.jsx(Forgot,{})}),jsxRuntime.exports.jsx(Route,{path:"/restricted-provider",element:jsxRuntime.exports.jsx(RestrictedProvider,{})}),jsxRuntime.exports.jsx(Route,{path:"/link-oid",element:jsxRuntime.exports.jsx(AccountLinking,{})}),jsxRuntime.exports.jsx(Route,{path:"/reset-password",element:jsxRuntime.exports.jsx(ResetPasswordPage,{})}),jsxRuntime.exports.jsx(Route,{path:"/activate",element:jsxRuntime.exports.jsx(SetPassword,{})})]});export{AuthRoutes,ResetPassword,generateApiUrlFromHost};
Binary file