@pega/constellationjs 0.25.1 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +6 -3
  2. package/dist/bootstrap-shell.js +1 -1
  3. package/dist/bootstrap-shell.js.br +0 -0
  4. package/dist/bootstrap-shell.js.gz +0 -0
  5. package/dist/constellation-core-react-native.js +2 -0
  6. package/dist/constellation-core-react-native.js.br +0 -0
  7. package/dist/constellation-core-react-native.js.gz +0 -0
  8. package/dist/constellation-core-react-native.js.map +1 -0
  9. package/dist/constellation-core-web.js +1 -1
  10. package/dist/constellation-core-web.js.LICENSE.txt +124 -0
  11. package/dist/constellation-core-web.js.br +0 -0
  12. package/dist/constellation-core-web.js.gz +0 -0
  13. package/dist/constellation-core-web.js.map +1 -1
  14. package/dist/constellation-core.c9cf42c5.js +2 -0
  15. package/dist/constellation-core.c9cf42c5.js.LICENSE.txt +124 -0
  16. package/dist/constellation-core.c9cf42c5.js.br +0 -0
  17. package/dist/constellation-core.c9cf42c5.js.gz +0 -0
  18. package/dist/constellation-core.c9cf42c5.js.map +1 -0
  19. package/dist/constellation-core.json +1 -1
  20. package/dist/js/libphonenumber-web.js +1 -1
  21. package/dist/js/libphonenumber-web.js.br +0 -0
  22. package/dist/js/libphonenumber-web.js.gz +0 -0
  23. package/dist/js/libphonenumber-web.js.map +1 -1
  24. package/dist/js/libphonenumber.a5a4a2d2.js +2 -0
  25. package/dist/js/libphonenumber.a5a4a2d2.js.br +0 -0
  26. package/dist/js/libphonenumber.a5a4a2d2.js.gz +0 -0
  27. package/dist/js/libphonenumber.a5a4a2d2.js.map +1 -0
  28. package/dist/lib_asset.json +1 -1
  29. package/package.json +1 -1
  30. package/dist/constellation-core.31733a3d.js +0 -2
  31. package/dist/constellation-core.31733a3d.js.br +0 -0
  32. package/dist/constellation-core.31733a3d.js.gz +0 -0
  33. package/dist/constellation-core.31733a3d.js.map +0 -1
  34. package/dist/js/libphonenumber.1e95a712.js +0 -2
  35. package/dist/js/libphonenumber.1e95a712.js.br +0 -0
  36. package/dist/js/libphonenumber.1e95a712.js.gz +0 -0
  37. package/dist/js/libphonenumber.1e95a712.js.map +0 -1
package/README.md CHANGED
@@ -16,9 +16,9 @@ Open your project's **package.json** file and in the **dependencies** section, s
16
16
 
17
17
  For example:
18
18
 
19
- - If your project requires the ConstellationJS files associated with Pega Infinity 24.2.2, specify
19
+ - If your project requires the ConstellationJS files associated with Pega Infinity 25.1.3, specify
20
20
 
21
- > "@pega/constellationjs": "24.2.2"
21
+ > "@pega/constellationjs": "25.1.3"
22
22
 
23
23
  - If your project requires the ConstellationJS files associated with Pega Infinity 23.1.0, specify
24
24
  > "@pega/constellationjs": "SDK-8.23.0"
@@ -31,10 +31,13 @@ If you are using Pega Infinity 23.1.1 or later, use the corresponding npm versio
31
31
 
32
32
  | Pega Infinity version | npm version |
33
33
  | --------------------- | ----------- |
34
+ | 25.1.3 | 25.1.3 |
35
+ | 25.1.2 | 25.1.2 |
36
+ | 25.1.1 | 25.1.1 |
37
+ | 25.1.0 | 25.1.0 |
34
38
  | 24.2.2 | 24.2.2 |
35
39
  | 24.2.1 | 24.2.1 |
36
40
  | 24.2.0 | 24.2.0 |
37
- | 24.1.3 | 24.1.3 |
38
41
  | 24.1.2 | 24.1.2 |
39
42
  | 24.1.1 | 24.1.1 |
40
43
  | 24.1.0 | 24.1.0 |
@@ -1 +1 @@
1
- const viewConfig="@P .viewConfig",routingInfo="@ROUTING_INFO",rootContainerWithHybrid={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo,name:"primary",contextName:"app"},children:[]}]},rootContainerWithHybridAcTertiary={type:"RootContainer",config:{renderingMode:"hybrid",acTertiary:!0},children:[{type:"HybridViewContainer",config:{routingInfo,name:"primary",contextName:"app",acTertiary:!0},children:[]}]},buildSemanticUrl=(e,t,o,n,i)=>{const a=new URLSearchParams(t);let r=!1;"true"===o&&(r=!0);let s=null,l=null;if(e){e.startsWith("/")&&(e=e.substring(1));const t=e.split("/");t.length>0&&t[0]&&(s=t[0]),t.length>1&&t[1]&&(l=t[1])}else r=!1;let c=n;s&&(c=`${c}/${s}`),l&&(c=`${c}/${l}`),r&&(a.has("noPortal")||a.append("noPortal",!0),l&&i&&a.append("view",i));const C=a.toString();return c+=C?`?${C}`:"",c};let containerCount=0;const loadView=(e,t,o=[],n,i,a,r)=>{const s=("hybrid"===r?`hybrid_${containerCount+=1}`:r)||`mashup${containerCount+=1}`,l={type:"RootContainer",config:{renderingMode:"portal",viewConfig,name:s}};globalThis.PCore.getRuntimeParamsAPI().setRuntimeParams(n),PCore.getBootstrapUtils().loadRootComponent(e,l,o,i,a).then((()=>PCore.getBootstrapUtils().updateStoreWithUiRoot(t,s)))},loadPortal=(e,t,o=[],n)=>{const i=n||`portal${containerCount+=1}`,a={type:"RootContainer",config:{viewConfig,renderingMode:"portal",skeleton:"LoadingComponent",name:i}};o.push(a.config.skeleton),PCore.getEnvironmentInfo().isPortalLoaded=!0,PCore.getBootstrapUtils().loadRootComponent(e,a,o).then((()=>PCore.getBootstrapUtils().loadPortalView(t,i)))},loadComponent=(e,t,o)=>PCore.getBootstrapUtils().loadComponent(t,e,o),loadViewByName=(e,t,o,n,i,a,r,s)=>{const l=s||`mashup${containerCount+=1}`,c={type:"RootContainer",config:{viewConfig,renderingMode:"view",name:l}};PCore.getBootstrapUtils().loadRootComponent(e,c,i,a,r).then((()=>PCore.getBootstrapUtils().loadViewByName(t,o,n,l)))},loadMashup=(e,t=!0)=>{const o={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo,name:"primary"}}]};if(t){const t=document.getElementsByTagName(e)[0]&&document.getElementsByTagName(e)[0].parentNode;if(t){const e=document.createElement("style");e.setAttribute("id","portal-less-styles"),e.innerHTML="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",t.appendChild(e)}}PCore.getBootstrapUtils().loadRootComponent(e,o,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),globalThis.parent!==globalThis&&import(`${PCore.getAssetLoader().getStaticServerUrl()}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))},loadCase=(e,t,o=[],n,i,a={})=>{const{isCaseLocked:r=!1}=a;o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getBootstrapUtils().getCaseApi().openCase(t,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY)))).then((()=>{r&&PCore.getPubSubUtils().publish(PCore.getEvents().getCaseEvent().CASE_LOCK_EVENT),PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}))},loadPreview=(e,t,o=[],n,i)=>{const{caseID:a,caseClass:r}=t;o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),rootContainerWithHybrid.config.name="hybrid_preview",PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getCoexistenceManager().showCasePreview(a,r))))},createCase=(e,t,o=[],n,i)=>{o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getBootstrapUtils().getCaseApi().createCase(t,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY))))},loadAssignment=(e,t,o=[],n,i,{isUIkit:a,isReloadAssignment:r,caseId:s,acTertiary:l,uiKitConstellationCaseInCreateStage:c})=>{if(a){const e=PCore.getEnvironmentInfo().getCoexistenceMeta();e.isCoexistence=!0,e.appType=PCore.getConstants().APP_TYPE.UIKIT,PCore.getEnvironmentInfo().setCoexistenceMeta(e)}if(r)PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),JSON.parse(c)&&a?PCore.getMashupApi().openCase(s,PCore.getConstants().APP.APP,{pageName:PCore.getConstants().VIEW_TYPE.PY_EMBEDASSIGNMENT}):PCore.getBootstrapUtils().getCaseApi().openCase(s,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY)))).then((()=>{PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}));else if(o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),a)PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getMashupApi().openAssignment(t,PCore.getConstants().APP.APP,{pageName:PCore.getConstants().VIEW_TYPE.PY_EMBEDASSIGNMENT})))).then((()=>{PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}));else{const a=l?rootContainerWithHybridAcTertiary:rootContainerWithHybrid;PCore.getBootstrapUtils().loadRootComponent(e,a,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getBootstrapUtils().getCaseApi().openAssignment(t,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY,{acTertiary:l,skipFlowNameCheck:!0})))).then((()=>{PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}))}},registerForDebugInfo=e=>{PCore.getEnvironmentInfo().setPreviewMode(),e&&PCore.getPubSubUtils().subscribe("fetchSuccess",(({debugInfo:t})=>{const o=t&&t["X-Pega-App-Debug-ID"];e.postMessage({appDebugID:o})}),"fetchSuccess")},toggleTracerHeaders=e=>{e.addEventListener("message",(async e=>{const t=e?.data?.enableTracer;t?PCore.getDebugger().enableTracer():PCore.getDebugger().disableTracer()}))},initCoreConfig=e=>{const{serviceConfig:t,semanticUrl:o,queryParams:n,noPortal:i,noHistory:a,viewName:r,theme:s,restServerConfig:l,dynamicLoadComponents:c=!0,dynamicSemanticUrl:C=!0,renderingMode:p="FULL_PORTAL",envType:g,extras:d}=e,{appAlias:m,contextPath:P}=t;let u=globalThis.location.origin;const h={};if(void 0!==l&&(u=l),P&&(u=`${u}${P}`),m&&"LAUNCHPAD"!==g&&(u=`${u}/${m}`),e.restServerConfig=u,!0===C){const e=buildSemanticUrl(o,n,i,u,r);!a&&e&&globalThis.history.pushState({},"home",e)}else if("HYBRID"!==p){let e=globalThis.location.href;e.indexOf("?")>0&&(e=e.substring(0,e.indexOf("?")),globalThis.history.pushState({},"home",e)),h.dynamicSemanticUrl=!1}!0!==c&&(h.dynamicLoadComponents=!1);let f=null;if(m){const e=m.indexOf("/app/");f=e>=0?m.substring(e+1):m}if(Object.keys(h).length>0&&PCore.setBehaviorOverrides(h),e.appAlias=f,s){let t="object"==typeof s?s:null;if(null===t)try{t=JSON.parse(s)}catch{t={}}e.theme=t}const y={...e.routingInfo,domain:`${globalThis.location.protocol}//${globalThis.location.host}`,searchParams:globalThis.location.search};e.routingInfo=y,e.initBroadcast="true"===PCore.getEnvironmentInfo().environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||"HYBRID"===e.renderingMode||(e.renderingMode="EMBED"),d?.cspNonce&&(globalThis.__webpack_nonce__=d.cspNonce),e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),PCore.getInitialiser().init(e)},importConstellationCore=async(e,t)=>{const{isDevServerMode:o,isSdk:n}=t,{prerequisite:i}=t;if(i&&i.length>0){const t=i[0];let a;const r=Object.keys(t)[0];if(o){const e=Object.values(t)[0];a=e.endsWith("/")?`${e}prerequisite/${r}`:`${e}/prerequisite/${r}`}else a=e.endsWith("/")?`${e}prerequisite/${r}`:`${e}/prerequisite/${r}`;if(n){a=`${e?.endsWith("/")?e.slice(0,-1):e}/prerequisite/${r.startsWith("/")?r.slice(1):r}`}return import(a).then((()=>{PCore.getAssetLoader().initServer(e,"no-appstatic");for(let t=1;t<i.length;t+=1){const n=i[t],a=Object.keys(n)[0];if(o){const e=Object.values(n)[0];import(`${e}prerequisite/${a}`).then((e=>{console.log(e)}))}else import(`${e}prerequisite/${a}`).then((e=>{console.log(e)}))}}))}return null},importLocalizationAssets=async(e,t)=>{const o=await PCore.getAssetLoader().getSvcLocale(t,`${e}.json`);if(o.ok){const t=await o.json();PCore.getLocaleUtils().setLocaleForRule(t,e)}},importLocalizationV2Assets=async e=>{const t=PCore.getEnvironmentInfo().getAvailableLocalePacks(),o=PCore.getEnvironmentInfo().getLocalizationBundles();let n;if(e&&t&&t.includes(e)?n=[PCore.getRestClient().invokeRestApi("getLocalizationPack",{queryPayload:{locale:e}})]:o.length>0&&(n=o.map((e=>PCore.getRestClient().invokeRestApi("getLocalizationPack",{queryPayload:{version:e.pyBundleVersion,bundle:e.pyBundleName}})))),!n||0===n.length)return void console.warn(`current locale ${e} is not supported by application.`);(await Promise.allSettled(n)).forEach((({status:e,value:t})=>{if("fulfilled"===e&&(201===t.status||200===t.status)&&t.data){const e=t.data;Object.keys(e).forEach((t=>{PCore.getLocaleUtils().setLocaleForRule(e[t],t)}))}}))},importExternals=async e=>{const{isDevServerMode:t}=e,o=PCore.getEnvironmentInfo().getLocale(),n=PCore.getEnvironmentInfo().getLocalizationVersion();try{let e;e=2===n?[o]:[PCore.getLocaleUtils().GENERIC_BUNDLE_KEY,PCore.getLocaleUtils().MESSAGE_BUNDLE_KEY,PCore.getLocaleUtils().FIELD_LABELS_BUNDLE_KEY];const t=e.map((async e=>{2===n?await importLocalizationV2Assets(e):await PCore.getLocaleUtils().isCurrentLocalePackAvailable()&&await importLocalizationAssets(e,o)}));await Promise.allSettled(t)}catch(e){console.warn(e)}await PCore.getAssetLoader().loadAssets(e.externals,{isDevServerMode:t}),await PCore.getAssetLoader().loadAssets(e.entry,{isDevServerMode:t})},importAssetsJson=async e=>{const t=(new Date).getTime();return fetch(`${e}lib_asset.json?v=${t}`).then((e=>e.json()))},importReactRoot=async()=>{const e=[];return PCore.getComponentsRegistry().getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)},importDesignSystemComponentMap=async(e,t,o)=>{try{await function(e,t=!0){return new Promise(((o,n)=>{const i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",e),i.setAttribute("async",t),i.onload=o(),i.onerror=()=>n(new Error("Failed to load resource from Design System")),document.body.appendChild(i)}))}(`${e}component/project/${t}/designsystems/${o}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}},bootstrap=async(e,t)=>new Promise((async(o,n)=>{try{const{staticContentServer:n,appStaticContentServer:i}=e.serviceConfig,{ccV2LibId:a,environmentId:r,isAlternateDesignSystemEnabled:s,alternateDesignSystemName:l}=e,c=await importAssetsJson(n);await importConstellationCore(n,c),initCoreConfig(e);const C=async()=>{await importReactRoot(),a&&await PCore.getAssetLoader().importCustomComponentMap(a),"true"===s&&"other"!==l&&await importDesignSystemComponentMap(i,r,l),t&&t(),o(!0)};PCore.getPubSubUtils().subscribe("component-map-loaded",C),await importExternals(c),"ReactRoot"in PCore.getComponentsRegistry().getLazyMap()&&o(!0)}catch(e){n(e)}})),loadEnvironmentInfo=async e=>{if(e.theme&&(!globalThis.pms||"Android"!==globalThis.pms.device.systemName))try{const t=JSON.parse(e.theme.definition);PCore.getEnvironmentInfo().setBrandingInfo(t.Branding),PCore.getEnvironmentInfo().setTheme(t.Theme)}catch{PCore.getEnvironmentInfo().setBrandingInfo({}),PCore.getEnvironmentInfo().setTheme({})}e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),PCore.getEnvironmentInfo().setCookieComplianceMethod(e.cookieComplianceMethod??"none"),PCore.getEnvironmentInfo().setIsExtraCallRequiredForDefaultHome(e.isExtraCallRequiredForDefaultHome??"false")},getBootstrapConfig=async(e,t,o,n,i,a)=>{const r={};n&&(r.themeID=n),a&&(r.locale=a);const s=`${e}/api/application/v2/data_views/D_pxBootstrapConfig${n||a?`?dataViewParameters=${encodeURIComponent(JSON.stringify(r))}`:""}`,l=t?{Authorization:t,...o}:o;return fetch(s,{method:"GET",headers:new Headers(l),credentials:t&&!i?"omit":"include"}).then((e=>{if(e.ok)return e.json();throw Error("D_pxBootstrapConfig load failed.",{cause:e.status})}))},applyEnvironmentInfoResponse=async e=>{const{environmentInfo:t,pyCaseTypeList:o,theme:n,keyMapping:i}=e,{pxApplication:a,features:r,pxLocale:s}=t,l={simpleTable:{pageInstructionUUIDGeneration:!1},...r},c=Intl.DateTimeFormat().resolvedOptions().timeZone.toUpperCase(),C="ETC/UNKNOWN"===c?"America/New_York":c;e.environmentInfo={...t,pxApplication:{...a},features:l,pyCaseTypeList:o,pxLocale:{...s,pyTimeZone:C}},e.timezone=C;const p=Object.keys(e.environmentInfo);return{isEnvInfoValid:["pxOperator","pxLocale","pxApplication"].every((e=>p.includes(e))),theme:n,keyMapping:i,features:l}},getLPConfig=async(e,t,o,n)=>{const i=new Headers({...o,...t&&{Authorization:t}}),a=await fetch(e,{method:"GET",headers:i,credentials:t&&!n?"omit":"include"});if(!a.ok)throw new Error("environmentInfo load failed.",{cause:a.status});return a.json()},loadRootContainer=(e,t=[],o,n)=>(t.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,t,o,n)),bootstrapWithAuthHeader=async(e,t,o=[],n,i)=>{const{customRendering:a=!1,onPCoreReadyCallback:r,staticContentServerUrl:s,dynamicSetCookie:l=!1,authInfo:c={},renderingMode:C,locale:p,envType:g,themeID:d,customCookies:m,enableRouting:P}=e;let{restServerUrl:u,authorizationHeader:h,appAlias:f,theme:y={}}=e,v=e.additionalHeaders?{...e.additionalHeaders}:{},I=null;if((h&&0===Object.keys(c).length||m)&&(c.authType="custom",c.customCookies=m),!h&&c.tokenInfo?.access_token){const{tokenInfo:e}=c;h=`${e.token_type} ${e.access_token}`}if(c.tokenInfo?.csrf&&(v={...v,pzCTkn:c.tokenInfo.csrf}),f&&-1===f.indexOf("/")&&(f=`app/${f}`),"LAUNCHPAD"===g){v={...v,"X-Constellation-App":"Pega"},u=u.endsWith("/dx")?u:`${u}/dx`;const e=d?`?themeID=${d}`:"";I=await getLPConfig(`${u}/api/application/v2/environmentInfo${e}`,h,v,m),0===Object.keys(y).length&&I.theme?.definition&&(y=JSON.parse(I.theme.definition).Theme)}else I=await getBootstrapConfig(f?`${u}/${f}`:`${u}`,h,v,d,m,p);const b=I?.pyConfigJSON?JSON.parse(I.pyConfigJSON):{...I};"LAUNCHPAD"===g&&await applyEnvironmentInfoResponse(b),b.restServerConfig=u,b.dynamicSemanticUrl=!1,b.dynamicSetCookie=l,b.enableRouting=!1,b.serviceConfig.contextPath="",b.serviceConfig.appAlias=f,b.additionalHeaders={Authorization:h,...v},b.envType=g,b.dynamicLoadComponents=!a,b.dynamicSemanticUrl=!a,b.noHistory=!0,b.theme=y??{};const A=d&&b?.themeObject?b.themeObject:null;b.theme=A||y,b.renderingMode=C??b.renderingMode,b.locale=p||b.locale;const E=s||b.serviceConfig.staticContentServer,R=await importAssetsJson(E);if(R.isSdk?(b.enableRouting=P,b.dynamicSemanticUrl=b.enableRouting,await importConstellationCore(s,R)):(b.serviceConfig.staticContentServer=E,b.serviceConfig.appStaticContentServer=b.serviceConfig.appStaticContentServer||"no-appstatic",await importConstellationCore(E,R)),initCoreConfig(b),r&&globalThis.PCore.onPCoreReady(r),"LAUNCHPAD"===b.envType&&"EMBED"===b.renderingMode&&PCore.getEnvironmentInfo().setIsWebEmbed(!0),c&&["OAuth2.0","custom"].includes(c?.authType)&&PCore.getBootstrapUtils().setFetchAuthInfo(c),R.isSdk&&a&&await importExternals(R),!a){const e=PCore.getEnvironmentInfo().environmentInfoObject?.pyInfinityStaticService;let a=null;if(e){const e=await PCore.getDataPageUtils().getDataAsync("D_pxGetComponentLibraryListAndMap","",{});Array.isArray(e.data)&&e.data.length>0&&(a=e.data)}const r=async(e,t)=>{try{const t=async()=>{await importReactRoot(),a&&await Promise.all(a.map((({pyComponentMap:e})=>PCore.getAssetLoader().importCustomComponentMap(e)))),e(!0)};PCore.getPubSubUtils().subscribe("component-map-loaded",t),await importExternals(R),"ReactRoot"in PCore.getComponentsRegistry().getLazyMap()&&e(!0)}catch(e){t(e)}},s=new Promise(r);await s,PCore.getInitialiser().initCoreContainers(),await loadRootContainer(t,o,n,i)}},initConstellationCore=async e=>{const t=await importAssetsJson(e);await importConstellationCore(e,t)},loadDefaultPortal=(e,t=[],o)=>{const n=PCore.getEnvironmentInfo().getDefaultPortal();loadPortal(e,n,t,o)},isNewUnifiedBuild=()=>!1,updateLocale=e=>{PCore.getEnvironmentInfo().setLocale(e)};export{bootstrap,loadView,loadPortal,loadDefaultPortal,loadComponent,loadMashup,loadViewByName,loadCase,createCase,loadAssignment,loadPreview,bootstrapWithAuthHeader,initConstellationCore,isNewUnifiedBuild,registerForDebugInfo,toggleTracerHeaders,loadEnvironmentInfo,updateLocale};
1
+ const viewConfig="@P .viewConfig",routingInfo="@ROUTING_INFO",rootContainerWithHybrid={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo,name:"primary",contextName:"app"},children:[]}]},rootContainerWithHybridAcTertiary={type:"RootContainer",config:{renderingMode:"hybrid",acTertiary:!0},children:[{type:"HybridViewContainer",config:{routingInfo,name:"primary",contextName:"app",acTertiary:!0},children:[]}]},buildSemanticUrl=(e,t,o,n,i)=>{const r=new URLSearchParams(t);let a=!1;"true"===o&&(a=!0);let s=null,l=null;if(e){e.startsWith("/")&&(e=e.substring(1));const t=e.split("/");t.length>0&&t[0]&&(s=t[0]),t.length>1&&t[1]&&(l=t[1])}else a=!1;let p=n;s&&(p=`${p}/${s}`),l&&(p=`${p}/${l}`),a&&(r.has("noPortal")||r.append("noPortal",!0),l&&i&&r.append("view",i));const c=r.toString();return p+=c?`?${c}`:"",p};let containerCount=0;const loadView=(e,t,o=[],n,i,r,a)=>{const s=("hybrid"===a?`hybrid_${containerCount+=1}`:a)||`mashup${containerCount+=1}`,l={type:"RootContainer",config:{renderingMode:"portal",viewConfig,name:s}};globalThis.PCore.getRuntimeParamsAPI().setRuntimeParams(n),PCore.getBootstrapUtils().loadRootComponent(e,l,o,i,r).then((()=>PCore.getBootstrapUtils().updateStoreWithUiRoot(t,s)))},loadPortal=(e,t,o=[],n)=>{const i=n||`portal${containerCount+=1}`,r={type:"RootContainer",config:{viewConfig,renderingMode:"portal",skeleton:"LoadingComponent",name:i}};o.push(r.config.skeleton),PCore.getEnvironmentInfo().isPortalLoaded=!0,PCore.getBootstrapUtils().loadRootComponent(e,r,o).then((()=>PCore.getBootstrapUtils().loadPortalView(t,i)))},loadComponent=(e,t,o)=>PCore.getBootstrapUtils().loadComponent(t,e,o),loadViewByName=(e,t,o,n,i,r,a,s)=>{const l=s||`mashup${containerCount+=1}`,p={type:"RootContainer",config:{viewConfig,renderingMode:"view",name:l}};PCore.getBootstrapUtils().loadRootComponent(e,p,i,r,a).then((()=>PCore.getBootstrapUtils().loadViewByName(t,o,n,l)))},loadMashup=(e,t=!0)=>{const o={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo,name:"primary"}}]};if(t){const t=document.getElementsByTagName(e)[0]&&document.getElementsByTagName(e)[0].parentNode;if(t){const e=document.createElement("style");e.setAttribute("id","portal-less-styles"),e.innerHTML="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",t.appendChild(e)}}PCore.getBootstrapUtils().loadRootComponent(e,o,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),globalThis.parent!==globalThis&&import(`${PCore.getAssetLoader().getStaticServerUrl()}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))},loadCase=(e,t,o=[],n,i,r={})=>{const{isCaseLocked:a=!1}=r;o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getBootstrapUtils().getCaseApi().openCase(t,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY)))).then((()=>{a&&PCore.getPubSubUtils().publish(PCore.getEvents().getCaseEvent().CASE_LOCK_EVENT),PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}))},loadPreview=(e,t,o=[],n,i)=>{const{caseID:r,caseClass:a}=t;o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),rootContainerWithHybrid.config.name="hybrid_preview",PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getCoexistenceManager().showCasePreview(r,a))))},createCase=(e,t,o=[],n,i)=>{o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getBootstrapUtils().getCaseApi().createCase(t,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY))))},loadAssignment=(e,t,o=[],n,i,{isUIkit:r,isReloadAssignment:a,caseId:s,acTertiary:l,uiKitConstellationCaseInCreateStage:p})=>{if(r){const e=PCore.getEnvironmentInfo().getCoexistenceMeta();e.isCoexistence=!0,e.appType=PCore.getConstants().APP_TYPE.UIKIT,PCore.getEnvironmentInfo().setCoexistenceMeta(e)}if(a)PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),JSON.parse(p)&&r?PCore.getMashupApi().openCase(s,PCore.getConstants().APP.APP,{pageName:PCore.getConstants().VIEW_TYPE.PY_EMBEDASSIGNMENT}):PCore.getBootstrapUtils().getCaseApi().openCase(s,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY)))).then((()=>{PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}));else if(o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),r)PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getMashupApi().openAssignment(t,PCore.getConstants().APP.APP,{pageName:PCore.getConstants().VIEW_TYPE.PY_EMBEDASSIGNMENT})))).then((()=>{PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}));else{const r=l?rootContainerWithHybridAcTertiary:rootContainerWithHybrid;PCore.getBootstrapUtils().loadRootComponent(e,r,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getBootstrapUtils().getCaseApi().openAssignment(t,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY,{acTertiary:l,skipFlowNameCheck:!0})))).then((()=>{PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}))}},registerForDebugInfo=e=>{PCore.getEnvironmentInfo().setPreviewMode(),e&&PCore.getPubSubUtils().subscribe("fetchSuccess",(({debugInfo:t})=>{const o=t&&t["X-Pega-App-Debug-ID"];e.postMessage({appDebugID:o})}),"fetchSuccess")},toggleTracerHeaders=e=>{e.addEventListener("message",(async e=>{const t=e?.data?.enableTracer;t?PCore.getDebugger().enableTracer():PCore.getDebugger().disableTracer()}))},initCoreConfig=async e=>{const{serviceConfig:t,semanticUrl:o,queryParams:n,noPortal:i,noHistory:r,viewName:a,theme:s,restServerConfig:l,dynamicLoadComponents:p=!0,dynamicSemanticUrl:c=!0,renderingMode:C="FULL_PORTAL",envType:g,extras:d}=e,{appAlias:m,contextPath:P}=t;let h=globalThis.location.origin;const u={};if(void 0!==l&&(h=l),P&&(h=`${h}${P}`),m&&"LAUNCHPAD"!==g&&(h=`${h}/${m}`),e.restServerConfig=h,!0===c){const e=buildSemanticUrl(o,n,i,h,a);!r&&e&&globalThis.history.replaceState({},"home",e)}else if("HYBRID"!==C){let e=globalThis.location.href;e.indexOf("?")>0&&(e=e.substring(0,e.indexOf("?")),globalThis.history.pushState({},"home",e)),u.dynamicSemanticUrl=!1}!0!==p&&(u.dynamicLoadComponents=!1);let f=null;if(m){const e=m.indexOf("/app/");f=e>=0?m.substring(e+1):m}if(Object.keys(u).length>0&&PCore.setBehaviorOverrides(u),e.appAlias=f,s){let t="object"==typeof s?s:null;if(null===t)try{t=JSON.parse(s)}catch{t={}}e.theme=t}const y="object"==typeof globalThis.location?globalThis.location:void 0;let v=y?.protocol&&y?.host?`${y.protocol}//${y.host}`:e.routingInfo?.domain;if("EMBED"===C)try{v=new URL(e.restServerConfig).origin}catch{}const I={...e.routingInfo,domain:v,searchParams:y?.search??"",embedQueryParams:e.semanticUrlArgs};e.routingInfo=I,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||"HYBRID"===e.renderingMode||(e.renderingMode="EMBED"),e.initBroadcast="true"===PCore.getEnvironmentInfo().environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence&&"EMBED"!==e.renderingMode,d?.cspNonce&&(globalThis.__webpack_nonce__=d.cspNonce),e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),await PCore.getInitialiser().init(e)},importConstellationCore=async(e,t)=>{const{isDevServerMode:o,isSdk:n}=t,{prerequisite:i}=t;if(i&&i.length>0){const t=i[0];let r;const a=Object.keys(t)[0];if(o){const e=Object.values(t)[0];r=e.endsWith("/")?`${e}prerequisite/${a}`:`${e}/prerequisite/${a}`}else r=e.endsWith("/")?`${e}prerequisite/${a}`:`${e}/prerequisite/${a}`;if(n){r=`${e?.endsWith("/")?e.slice(0,-1):e}/prerequisite/${a.startsWith("/")?a.slice(1):a}`}return import(r).then((()=>{PCore.getAssetLoader().initServer(e,"no-appstatic");for(let t=1;t<i.length;t+=1){const n=i[t],r=Object.keys(n)[0];if(o){const e=Object.values(n)[0];import(`${e}prerequisite/${r}`).then((e=>{console.log(e)}))}else import(`${e}prerequisite/${r}`).then((e=>{console.log(e)}))}}))}return null},importExternals=async e=>{const{isDevServerMode:t}=e;await PCore.getAssetLoader().loadAssets(e.externals,{isDevServerMode:t}),await PCore.getAssetLoader().loadAssets(e.entry,{isDevServerMode:t})},importAssetsJson=async e=>{const t=(new Date).getTime();return fetch(`${e}lib_asset.json?v=${t}`).then((e=>e.json()))},importReactRoot=async()=>{const e=[];return PCore.getComponentsRegistry().getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)},importDesignSystemComponentMap=async(e,t,o)=>{try{await function(e,t=!0){return new Promise(((o,n)=>{const i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",e),i.setAttribute("async",t),i.onload=o(),i.onerror=()=>n(new Error("Failed to load resource from Design System")),document.body.appendChild(i)}))}(`${e}component/project/${t}/designsystems/${o}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}},bootstrap=async(e,t)=>new Promise((async(o,n)=>{try{const{staticContentServer:n,appStaticContentServer:i}=e.serviceConfig,{ccV2LibId:r,environmentId:a,isAlternateDesignSystemEnabled:s,alternateDesignSystemName:l}=e,p=await importAssetsJson(n);await importConstellationCore(n,p),await initCoreConfig(e);const c=async()=>{await importReactRoot(),r&&await PCore.getAssetLoader().importCustomComponentMap(r),"true"===s&&"other"!==l&&await importDesignSystemComponentMap(i,a,l),t&&t(),o(!0)};PCore.getPubSubUtils().subscribe("component-map-loaded",c),await importExternals(p),"ReactRoot"in PCore.getComponentsRegistry().getLazyMap()&&o(!0)}catch(e){n(e)}})),loadEnvironmentInfo=async e=>{if(e.theme&&(!globalThis.pms||"Android"!==globalThis.pms.device.systemName))try{const t=JSON.parse(e.theme.definition);PCore.getEnvironmentInfo().setBrandingInfo(t.Branding),PCore.getEnvironmentInfo().setTheme(t.Theme)}catch{PCore.getEnvironmentInfo().setBrandingInfo({}),PCore.getEnvironmentInfo().setTheme({})}if(e.darkTheme&&(!globalThis.pms||"Android"!==globalThis.pms.device.systemName))try{const t=JSON.parse(e.darkTheme.definition);PCore.getEnvironmentInfo().setBrandingInfo(t.Branding,{type:"dark"}),PCore.getEnvironmentInfo().setTheme(t.Theme,{type:"dark"})}catch{PCore.getEnvironmentInfo().setBrandingInfo({},{type:"dark"}),PCore.getEnvironmentInfo().setTheme(void 0,{type:"dark"})}e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),PCore.getEnvironmentInfo().setCookieComplianceMethod(e.cookieComplianceMethod??"none"),PCore.getEnvironmentInfo().setIsExtraCallRequiredForDefaultHome(e.isExtraCallRequiredForDefaultHome??"false"),PCore.getEnvironmentInfo().setEnablePriorityAndUrgencyImprovements(e.enablePriorityAndUrgencyImprovements??!1)},getBootstrapConfig=async(e,t,o,n,i,r)=>{const a={};n&&(a.themeID=n),r&&(a.locale=r);const s=`${e}/api/application/v2/data_views/D_pxBootstrapConfig${n||r?`?dataViewParameters=${encodeURIComponent(JSON.stringify(a))}`:""}`,l=t?{Authorization:t,...o}:o;return fetch(s,{method:"GET",headers:new Headers(l),credentials:t&&!i?"same-origin":"include"}).then((e=>{if(e.ok)return e.json();throw Error("D_pxBootstrapConfig load failed.",{cause:e.status})}))},applyEnvironmentInfoResponse=async e=>{const{environmentInfo:t,pyCaseTypeList:o,theme:n,keyMapping:i}=e,{pxApplication:r,features:a,pxLocale:s}=t,l={simpleTable:{pageInstructionUUIDGeneration:!1},...a},p=Intl.DateTimeFormat().resolvedOptions().timeZone.toUpperCase(),c="ETC/UNKNOWN"===p?"America/New_York":p;e.environmentInfo={...t,pxApplication:{...r},features:l,pyCaseTypeList:o,pxLocale:{...s,pyTimeZone:c}},e.timezone=c;const C=Object.keys(e.environmentInfo);return{isEnvInfoValid:["pxOperator","pxLocale","pxApplication"].every((e=>C.includes(e))),theme:n,keyMapping:i,features:l}},getLPConfig=async(e,t,o,n)=>{const i=new Headers({...o,...t&&{Authorization:t}}),r=await fetch(e,{method:"GET",headers:i,credentials:t&&!n?"same-origin":"include"});if(!r.ok)throw new Error("environmentInfo load failed.",{cause:r.status});return r.json()},preInitBootstrapConfig=async(e,t,o,n)=>{const{restServerUrl:i,customRendering:r=!1,staticContentServerUrl:a,dynamicSetCookie:s=!1,authInfo:l,renderingMode:p,locale:c,timezone:C="America/New_York",envType:g,theme:d={}}=e,m=n??null,P={restServerUrl:i,restServerConfig:i,dynamicSetCookie:s,enableRouting:!1,serviceConfig:{contextPath:"",appAlias:t,staticContentServer:a,appStaticContentServer:"no-appstatic"},additionalHeaders:{...o},envType:g,dynamicLoadComponents:!r,dynamicSemanticUrl:!r,noHistory:!0,themeIDObj:m,theme:m||d,renderingMode:p,locale:c,timezone:C,tokens:{C11NB2S:""}},h=await importAssetsJson(a);return await importConstellationCore(a,h),await initCoreConfig(P),l&&["OAuth2.0","custom"].includes(l?.authType)&&PCore.getBootstrapUtils().setFetchAuthInfo(l),PCore.getBootstrapUtils().getBootstrapConfigViaSB(t?`${i}/${t}`:`${i}`,o,n)},loadRootContainer=(e,t=[],o,n)=>(t.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,t,o,n)),bootstrapWithAuthHeader=async(e,t,o=[],n,i)=>{const{customRendering:r=!1,onPCoreReadyCallback:a,staticContentServerUrl:s,dynamicSetCookie:l=!1,renderingMode:p,locale:c,envType:C,themeID:g,customCookies:d,enableRouting:m}=e;let{restServerUrl:P,authInfo:h,authorizationHeader:u,appAlias:f,theme:y={}}=e,v=e.additionalHeaders?{...e.additionalHeaders}:{},I=null;const b=!u&&h&&!h.authType;if(h||(e.authInfo={},h=e.authInfo),(u&&0===Object.keys(h).length||d)&&(b||(h.authType="custom"),h.customCookies=d),!u&&h.tokenInfo?.access_token){const{tokenInfo:e}=h;u=`${e.token_type} ${e.access_token}`}if(h.tokenInfo?.csrf&&(v={...v,pzCTkn:h.tokenInfo.csrf}),f&&!f.startsWith("app/")&&(f=`app/${f}`),"LAUNCHPAD"===C){v={...v,"X-Constellation-App":"Pega"},P=P.endsWith("/dx")?P:`${P}/dx`;const e=g?`?themeID=${g}`:"";I=await getLPConfig(`${P}/api/application/v2/environmentInfo${e}`,u,v,d),0===Object.keys(y).length&&I.theme?.definition&&(y=JSON.parse(I.theme.definition).Theme)}else I=b?await preInitBootstrapConfig(e,f,v,g):await getBootstrapConfig(f?`${P}/${f}`:`${P}`,u,v,g,d,c);const A=I?.pyConfigJSON?JSON.parse(I.pyConfigJSON):{...I};"LAUNCHPAD"===C&&await applyEnvironmentInfoResponse(A),A.restServerConfig=P,A.dynamicSemanticUrl=!1,A.dynamicSetCookie=l,A.enableRouting=!1,A.serviceConfig?Object.assign(A.serviceConfig,{contextPath:"",appAlias:f}):A.serviceConfig={contextPath:"",appAlias:f,staticContentServer:s,appStaticContentServer:"no-appstatic"},A.additionalHeaders={Authorization:u,...v},A.envType=C,A.dynamicLoadComponents=!r,A.dynamicSemanticUrl=!r,A.noHistory=!0,A.theme=y??{};const E=g&&A?.themeObject?A.themeObject:null;A.theme=E||y,A.renderingMode=p??A.renderingMode,A.locale=c||A.locale,e.semanticUrlArgs&&(A.semanticUrlArgs=e.semanticUrlArgs);const S=s||A.serviceConfig.staticContentServer,T=await importAssetsJson(S);if(T.isSdk?(A.enableRouting=m,A.dynamicSemanticUrl=A.enableRouting,await importConstellationCore(s,T)):(A.serviceConfig.staticContentServer=S,A.serviceConfig.appStaticContentServer=A.serviceConfig.appStaticContentServer||"no-appstatic",await importConstellationCore(S,T)),"EMBED"===A.renderingMode&&h?.authentication_service&&"pega"!==h.authentication_service&&(A.routingInfo||(A.routingInfo={}),A.routingInfo.authServiceAlias=h.authentication_service),await initCoreConfig(A),a&&globalThis.PCore.onPCoreReady(a),"LAUNCHPAD"===A.envType&&"EMBED"===A.renderingMode&&PCore.getEnvironmentInfo().setIsWebEmbed(!0),h&&["OAuth2.0","custom"].includes(h?.authType)&&PCore.getBootstrapUtils().setFetchAuthInfo(h),T.isSdk&&r&&await importExternals(T),!r){const e=PCore.getEnvironmentInfo().environmentInfoObject?.pyInfinityStaticService;let r=null;if(e){const e=await PCore.getDataPageUtils().getDataAsync("D_pxGetComponentLibraryListAndMap","",{});Array.isArray(e.data)&&e.data.length>0&&(r=e.data)}const a=new Promise((async(e,t)=>{try{const t=async()=>{await importReactRoot(),e(!0)};PCore.getPubSubUtils().subscribe("component-map-loaded",t),await importExternals(T),"ReactRoot"in PCore.getComponentsRegistry().getLazyMap()&&e(!0)}catch(e){t(e)}}));await a,PCore.getInitialiser().initCoreContainers(),await loadRootContainer(t,o,n,i),r&&await Promise.all(r.map((({pyComponentMap:e,pxUpdateDateTime:t})=>PCore.getAssetLoader().importCustomComponentMap(e,t))))}},initConstellationCore=async e=>{const t=await importAssetsJson(e);await importConstellationCore(e,t)},loadDefaultPortal=(e,t=[],o)=>{const n=PCore.getEnvironmentInfo().getDefaultPortal();loadPortal(e,n,t,o)},isNewUnifiedBuild=()=>!1,updateLocale=e=>{PCore.getEnvironmentInfo().setLocale(e)};export{bootstrap,loadView,loadPortal,loadDefaultPortal,loadComponent,loadMashup,loadViewByName,loadCase,createCase,loadAssignment,loadPreview,bootstrapWithAuthHeader,initConstellationCore,isNewUnifiedBuild,registerForDebugInfo,toggleTracerHeaders,loadEnvironmentInfo,updateLocale};
Binary file
Binary file