@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
@@ -0,0 +1,2 @@
1
+ var e,t,n={953:e=>{class t{constructor(e,t,n,s,a){this.converter=c(),this.width=e,this.poly=t,this.xor_in=n,this.reflected_xor_in=l(n,e),this.xor_out=s,this.reflect=a,this.msb_mask=1<<this.width-1,this.mask=this.msb_mask-1<<1|1,this.crc_shift=this.width<8?8-this.width:0,this.shifted_xor_in=this.xor_in<<this.crc_shift;let r=this.gen_table();this.table=r,8!==this.width||this.xor_in||this.xor_out||this.reflect||(this.calculate=function(e){e=this.converter.validate_buffer(e);let t=0;for(let n=0;n<e.length;n++)t=r[t^e[n]];return t})}calculate(e){let t;e=this.converter.validate_buffer(e);let{table:n,width:s,crc_shift:a,mask:r}=this;if(this.reflect){t=this.reflected_xor_in;for(let s=0;s<e.length;s++){t=(n[255&(t^e[s])]^t>>>8)&r}}else{t=this.shifted_xor_in;for(let o=0;o<e.length;o++)t=n[255&(t>>s-8+a^e[o])]<<a^t<<8-a&r<<a;t>>=a}return t^=this.xor_out,t>>>0}calculate_no_table(e){e=this.converter.validate_buffer(e);let t=this.xor_in;for(let n=0;n<e.length;n++){let s=e[n];this.reflect&&(s=l(s,8));for(let e=0;e<8;e++){let n=t&this.msb_mask;s&128>>e&&(n^=this.msb_mask),t<<=1,n&&(t^=this.poly)}t&=this.mask}return this.reflect&&(t=l(t,this.width)),t^=this.xor_out,t>>>0}gen_table(){let e=[];for(let t=0;t<256;t++){let n=t;this.reflect&&(n=l(n,8)),n<<=this.width-8+this.crc_shift;for(let e=0;e<8;e++)0!=(n&this.msb_mask<<this.crc_shift)?(n<<=1,n^=this.poly<<this.crc_shift):n<<=1;this.reflect&&(n=l(n>>this.crc_shift,this.width)<<this.crc_shift),n=n>>this.crc_shift&this.mask,e[t]=n>>>0}return new Int32Array(e)}print_table(){let e=this.table,t=Math.ceil(this.width/4),n=t<4?4:3,s=e.length>>n,a=1<<n,r="";for(let o=0;o<s;o++){let s="";for(let r=0;r<a;r++){let a=e[o<<n|r];a="000000000"+a.toString(16),a=a.substr(a.length-t),s+="0x"+a+", "}r+=" "+s+"\n"}return r="[\n"+r.slice(0,-3)+"\n]",r}}const n="undefined"!=typeof Buffer,s="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,a=void 0!==typeof BigInt&&BigInt(256);class r{validate_buffer(e){switch(typeof e){case"number":{if(!Number.isSafeInteger(e)||e<0)throw Error(`number data must be a nonnegative safe integer, not ${e}`);if(this.fromUInt32&&e<=4294967295)return this.fromUInt32(e);const t=[];for(;e>0||t.length<4;)t.unshift(e%256),e=Math.floor(e/256);return this.fromByteArray(t)}case"string":return this.fromString(e);case"bigint":{if(e<0)throw Error(`bigint data must be nonnegative, not ${e}`);const t=[];for(;e>0||t.length<4;)t.unshift(Number(e%a)),e/=a;return this.fromByteArray(t)}default:if(n&&Buffer.isBuffer(e))return e;if(s){if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e)}throw new Error(`Unrecognized data type ${typeof e}: ${e}`)}}}class o extends r{fromUInt32(e){const t=Buffer.alloc(4);return t.writeUInt32BE(e),t}fromByteArray=Buffer.from.bind(Buffer);fromString=Buffer.from.bind(Buffer)}class i extends r{fromByteArray=Uint8Array.from.bind(Uint8Array);fromString(e){return new TextEncoder("utf-8").encode(e)}}function c(e=!1){if(s&&(e||!n))return new i;if(n)return new o;throw Error("either need TypedArrays or Buffer")}function l(e,t){let n=0;for(let s=0;s<t;s++)n=n<<1|1&e,e>>=1;return n}const u={crc1:new t(1,1,0,0,!1),crc6:new t(6,47,0,0,!1),crc8:new t(8,7,0,0,!1),crc10:new t(10,563,0,0,!1),crc16:new t(16,32773,0,0,!0),crc24:new t(24,8801531,11994318,0,!1),crc32:new t(32,79764919,4294967295,4294967295,!0),crc32c:new t(32,517762881,4294967295,4294967295,!0)};function d(e){}e.exports={CRC:t,crc:function(e,n,s,a,r){let o=new t(e,n,s,a,r);return o.calculate.bind(o)},makeBufferConverter:c,models:u,crc1:d,crc6:d,crc8:d,crc10:d,crc16:d,crc24:d,crc32:d,crc32c:d};for(let t in u){let n=u[t];e.exports[t]=n.calculate.bind(n)}},754:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=754,e.exports=t}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>"js/libphonenumber.a5a4a2d2.js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),e={388:0},t=t=>{var n,s,{__webpack_ids__:r,__webpack_modules__:o,__webpack_runtime__:i}=t,c=0;for(n in o)a.o(o,n)&&(a.m[n]=o[n]);for(i&&i(a);c<r.length;c++)s=r[c],a.o(e,s)&&e[s]&&e[s][0](),e[r[c]]=0},a.f.j=(n,s)=>{var r=a.o(e,n)?e[n]:void 0;if(0!==r)if(r)s.push(r[1]);else{var o=import("./"+a.u(n)).then(t,(t=>{throw 0!==e[n]&&(e[n]=void 0),t}));o=Promise.race([o,new Promise((t=>r=e[n]=[t]))]),s.push(r[1]=o)}};var r={};a.d(r,{A:()=>Yb});var o={};a.r(o),a.d(o,{buildContextName:()=>Qs,buildModalContext:()=>ea,buildTransientContextName:()=>Js,getContainerIdFromContext:()=>na,getParentContext:()=>ta,getParentContextName:()=>Ks,getTargetFromContext:()=>Zs,getTransientContext:()=>Xs});var i={};a.r(i),a.d(i,{getResolvedTargetName:()=>Wr,getRoutingInfo:()=>Hr,getSemanticURLFromRoutingInfo:()=>qr});var c={};a.r(c),a.d(c,{evaluate:()=>No,handleChange:()=>So,hasDeclareExpression:()=>Co,updateDeclareExpressions:()=>_o});var l={};a.r(l),a.d(l,{hasBrowserEnv:()=>Yi,hasStandardBrowserEnv:()=>Qi,hasStandardBrowserWebWorkerEnv:()=>Ji,navigator:()=>Ki,origin:()=>Xi});var u={};a.r(u),a.d(u,{publishExpressions:()=>mp,publishMetadata:()=>fp,publishResponse:()=>Ip});var d={};a.r(d),a.d(d,{doesRestApiExist:()=>_p,getCancelTokenSource:()=>Np,getCaseApi:()=>Pp,getHeaderProcessor:()=>Ap,invokeCustomRestApi:()=>Sp,invokeRestApi:()=>Cp,isRequestCanceled:()=>Tp,registerInterceptor:()=>Dp});var p={};a.r(p),a.d(p,{fetchViewResources:()=>_f,refreshViewByName:()=>Df,updateViewResources:()=>Sf});var g={};a.r(g),a.d(g,{CONTAINER_NAMES:()=>xE,CONTAINER_TYPES:()=>vE,addRootContainerItem:()=>hy,areContainerItemsPresent:()=>kE,cleanupTransientContainer:()=>Sy,clearContainerItems:()=>Ny,clearTransientData:()=>Ay,closeContainerItem:()=>gy,getActiveContainerItemContext:()=>XE,getActiveContainerItemIDFromRoutingInfo:()=>My,getActiveContainerItemName:()=>YE,getActiveContext:()=>by,getChildContainerItemId:()=>UE,getChildContainerItems:()=>ZE,getChildContainers:()=>ey,getChildContainersContexts:()=>ty,getContainerAPI:()=>Ty,getContainerAccessOrder:()=>jE,getContainerData:()=>LE,getContainerItemByKey:()=>HE,getContainerItemData:()=>FE,getContainerItemName:()=>GE,getContainerItems:()=>VE,getContainerLimit:()=>oy,getContainerParentContext:()=>wy,getContainerType:()=>zE,getContextByTargetAndKey:()=>xy,getDataContextName:()=>JE,getFlowContainer:()=>Uy,getLeastRecentlyUsedNonDirtyContainerItemID:()=>dy,getParentContainerItem:()=>Ly,getRootContainerName:()=>Ry,getSuggestionContexts:()=>ny,getTargetFromContainerItemID:()=>py,getTransientItems:()=>Iy,hasContainerItems:()=>ry,isContainerDirty:()=>uy,isContainerInitialized:()=>qE,isContainerItemActive:()=>KE,isContainerItemContextBeingUsedInOtherContainers:()=>my,isContainerItemExists:()=>BE,isContainerItemExistsWithoutKey:()=>$E,isContainerLimitReached:()=>cy,isContainerMultipleMode:()=>ay,isContainerSingleMode:()=>sy,purgeTransientData:()=>Cy,removeContainer:()=>Dy,replaceTransientData:()=>yy,resetContainersPayload:()=>ly,setContainerLimit:()=>iy,updateCaseContextEtag:()=>Oy,updateParentLastUpdateTime:()=>vy,updateRelatedContextEtag:()=>Py,updateTransientData:()=>Ey});var h={};a.r(h),a.d(h,{beginDesignerRefresh:()=>OA,endDesignerRefresh:()=>RA,getAIAgent:()=>GA,getAdditionalInfo:()=>YA,getDataPageKeys:()=>HA,getDataPageMetadata:()=>LA,getDesignerViewStoreVersion:()=>PA,getEditableFieldConfigUtil:()=>QA,getEmbeddedPropertyMetadata:()=>TA,getFieldParameters:()=>jA,getFieldsByClassName:()=>VA,getFormat:()=>BA,getGenAICoach:()=>$A,getInsight:()=>FA,getLocaleUtilsForLanguage:()=>_A,getLocalizationServiceFromStore:()=>NA,getLookUpDataPage:()=>qA,getLookUpDataPageInfo:()=>zA,getParagraph:()=>kA,getPersonalizationMetadata:()=>UA,getPropertyMetadata:()=>SA,getResolvedFieldMetadata:()=>KA,getSavableDataPage:()=>WA,isViewExists:()=>wA,mergeStore:()=>CA,resolveNavigation:()=>MA,resolveView:()=>xA,updateNavigationStore:()=>bA,updateStores:()=>vA,updateViewStore:()=>DA});var f={};a.r(f),a.d(f,{dispatch:()=>sC,doesContextExist:()=>EC,getActionType:()=>uC,getContextValue:()=>cC,getDataObject:()=>aC,getReferenceTokens:()=>eC,getSharedDataObject:()=>rC,getStore:()=>nC,getValue:()=>iC,isMergeable:()=>pC,lookupContextValue:()=>lC,mergeDeep:()=>hC,performReplaceAndRearrange:()=>gC,removeItem:()=>dC,replaceValue:()=>mC,resetStore:()=>IC,setStore:()=>tC,updateValue:()=>fC});var m={};a.r(m),a.d(m,{activateContainerItem:()=>KC,addContainerItem:()=>jC,addMessages:()=>QC,addSharedData:()=>oS,addTransientItem:()=>kC,addWork:()=>LC,clearTransientData:()=>$C,createWork:()=>RC,error:()=>rS,finishAssignment:()=>tS,initContainers:()=>FC,listAction:()=>cS,loadView:()=>wC,mergeData:()=>vC,openAssignment:()=>nS,openWorkByHandle:()=>UC,postProcess:()=>aS,purgeTransientData:()=>WC,removeAllTransientItems:()=>XC,removeContainerItem:()=>JC,removeSharedData:()=>iS,removeTransientItem:()=>ZC,replaceContainerItem:()=>eS,replaceTransientData:()=>GC,resetContainers:()=>VC,resetLoading:()=>zC,setLoading:()=>qC,setSharedProperty:()=>uS,setStateProperty:()=>dS,showCasePreview:()=>lS,showHarness:()=>xC,showHistory:()=>sS,showPage:()=>MC,upMergeAndRemoveContainerItem:()=>YC,updateContainerItem:()=>HC,updateTransientData:()=>BC});var I={};a.r(I),a.d(I,{buildResizeMessage:()=>DR,mashup:()=>PR});const E=function(){this.__data__=[],this.size=0};const y=function(e,t){return e===t||e!=e&&t!=t};const A=function(e,t){for(var n=e.length;n--;)if(y(e[n][0],t))return n;return-1};var C=Array.prototype.splice;const S=function(e){var t=this.__data__,n=A(t,e);return!(n<0)&&(n==t.length-1?t.pop():C.call(t,n,1),--this.size,!0)};const _=function(e){var t=this.__data__,n=A(t,e);return n<0?void 0:t[n][1]};const N=function(e){return A(this.__data__,e)>-1};const T=function(e,t){var n=this.__data__,s=A(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this};function D(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}D.prototype.clear=E,D.prototype.delete=S,D.prototype.get=_,D.prototype.has=N,D.prototype.set=T;const P=D;const O=function(){this.__data__=new P,this.size=0};const R=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const b=function(e){return this.__data__.get(e)};const v=function(e){return this.__data__.has(e)};const x="object"==typeof global&&global&&global.Object===Object&&global;var w="object"==typeof self&&self&&self.Object===Object&&self;const M=x||w||Function("return this")();const L=M.Symbol;var U=Object.prototype,F=U.hasOwnProperty,V=U.toString,j=L?L.toStringTag:void 0;const k=function(e){var t=F.call(e,j),n=e[j];try{e[j]=void 0;var s=!0}catch(e){}var a=V.call(e);return s&&(t?e[j]=n:delete e[j]),a};var B=Object.prototype.toString;const $=function(e){return B.call(e)};var G=L?L.toStringTag:void 0;const W=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":G&&G in Object(e)?k(e):$(e)};const H=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const q=function(e){if(!H(e))return!1;var t=W(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const z=M["__core-js_shared__"];var Y,K=(Y=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"";const Q=function(e){return!!K&&K in e};var J=Function.prototype.toString;const X=function(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Z=/^\[object .+?Constructor\]$/,ee=Function.prototype,te=Object.prototype,ne=ee.toString,se=te.hasOwnProperty,ae=RegExp("^"+ne.call(se).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const re=function(e){return!(!H(e)||Q(e))&&(q(e)?ae:Z).test(X(e))};const oe=function(e,t){return null==e?void 0:e[t]};const ie=function(e,t){var n=oe(e,t);return re(n)?n:void 0};const ce=ie(M,"Map");const le=ie(Object,"create");const ue=function(){this.__data__=le?le(null):{},this.size=0};const de=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var pe=Object.prototype.hasOwnProperty;const ge=function(e){var t=this.__data__;if(le){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return pe.call(t,e)?t[e]:void 0};var he=Object.prototype.hasOwnProperty;const fe=function(e){var t=this.__data__;return le?void 0!==t[e]:he.call(t,e)};const me=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=le&&void 0===t?"__lodash_hash_undefined__":t,this};function Ie(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ie.prototype.clear=ue,Ie.prototype.delete=de,Ie.prototype.get=ge,Ie.prototype.has=fe,Ie.prototype.set=me;const Ee=Ie;const ye=function(){this.size=0,this.__data__={hash:new Ee,map:new(ce||P),string:new Ee}};const Ae=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Ce=function(e,t){var n=e.__data__;return Ae(t)?n["string"==typeof t?"string":"hash"]:n.map};const Se=function(e){var t=Ce(this,e).delete(e);return this.size-=t?1:0,t};const _e=function(e){return Ce(this,e).get(e)};const Ne=function(e){return Ce(this,e).has(e)};const Te=function(e,t){var n=Ce(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this};function De(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}De.prototype.clear=ye,De.prototype.delete=Se,De.prototype.get=_e,De.prototype.has=Ne,De.prototype.set=Te;const Pe=De;const Oe=function(e,t){var n=this.__data__;if(n instanceof P){var s=n.__data__;if(!ce||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pe(s)}return n.set(e,t),this.size=n.size,this};function Re(e){var t=this.__data__=new P(e);this.size=t.size}Re.prototype.clear=O,Re.prototype.delete=R,Re.prototype.get=b,Re.prototype.has=v,Re.prototype.set=Oe;const be=Re;const ve=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const xe=function(e){return this.__data__.has(e)};function we(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pe;++t<n;)this.add(e[t])}we.prototype.add=we.prototype.push=ve,we.prototype.has=xe;const Me=we;const Le=function(e,t){for(var n=-1,s=null==e?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1};const Ue=function(e,t){return e.has(t)};const Fe=function(e,t,n,s,a,r){var o=1&n,i=e.length,c=t.length;if(i!=c&&!(o&&c>i))return!1;var l=r.get(e),u=r.get(t);if(l&&u)return l==t&&u==e;var d=-1,p=!0,g=2&n?new Me:void 0;for(r.set(e,t),r.set(t,e);++d<i;){var h=e[d],f=t[d];if(s)var m=o?s(f,h,d,t,e,r):s(h,f,d,e,t,r);if(void 0!==m){if(m)continue;p=!1;break}if(g){if(!Le(t,(function(e,t){if(!Ue(g,t)&&(h===e||a(h,e,n,s,r)))return g.push(t)}))){p=!1;break}}else if(h!==f&&!a(h,f,n,s,r)){p=!1;break}}return r.delete(e),r.delete(t),p};const Ve=M.Uint8Array;const je=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,s){n[++t]=[s,e]})),n};const ke=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Be=L?L.prototype:void 0,$e=Be?Be.valueOf:void 0;const Ge=function(e,t,n,s,a,r,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new Ve(e),new Ve(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return y(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var i=je;case"[object Set]":var c=1&s;if(i||(i=ke),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;s|=2,o.set(e,t);var u=Fe(i(e),i(t),s,a,r,o);return o.delete(e),u;case"[object Symbol]":if($e)return $e.call(e)==$e.call(t)}return!1};const We=function(e,t){for(var n=-1,s=t.length,a=e.length;++n<s;)e[a+n]=t[n];return e};const He=Array.isArray;const qe=function(e,t,n){var s=t(e);return He(e)?s:We(s,n(e))};const ze=function(e,t){for(var n=-1,s=null==e?0:e.length,a=0,r=[];++n<s;){var o=e[n];t(o,n,e)&&(r[a++]=o)}return r};const Ye=function(){return[]};var Ke=Object.prototype.propertyIsEnumerable,Qe=Object.getOwnPropertySymbols;const Je=Qe?function(e){return null==e?[]:(e=Object(e),ze(Qe(e),(function(t){return Ke.call(e,t)})))}:Ye;const Xe=function(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s};const Ze=function(e){return null!=e&&"object"==typeof e};const et=function(e){return Ze(e)&&"[object Arguments]"==W(e)};var tt=Object.prototype,nt=tt.hasOwnProperty,st=tt.propertyIsEnumerable;const at=et(function(){return arguments}())?et:function(e){return Ze(e)&&nt.call(e,"callee")&&!st.call(e,"callee")};const rt=function(){return!1};var ot="object"==typeof exports&&exports&&!exports.nodeType&&exports,it=ot&&"object"==typeof module&&module&&!module.nodeType&&module,ct=it&&it.exports===ot?M.Buffer:void 0;const lt=(ct?ct.isBuffer:void 0)||rt;var ut=/^(?:0|[1-9]\d*)$/;const dt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ut.test(e))&&e>-1&&e%1==0&&e<t};const pt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var gt={};gt["[object Float32Array]"]=gt["[object Float64Array]"]=gt["[object Int8Array]"]=gt["[object Int16Array]"]=gt["[object Int32Array]"]=gt["[object Uint8Array]"]=gt["[object Uint8ClampedArray]"]=gt["[object Uint16Array]"]=gt["[object Uint32Array]"]=!0,gt["[object Arguments]"]=gt["[object Array]"]=gt["[object ArrayBuffer]"]=gt["[object Boolean]"]=gt["[object DataView]"]=gt["[object Date]"]=gt["[object Error]"]=gt["[object Function]"]=gt["[object Map]"]=gt["[object Number]"]=gt["[object Object]"]=gt["[object RegExp]"]=gt["[object Set]"]=gt["[object String]"]=gt["[object WeakMap]"]=!1;const ht=function(e){return Ze(e)&&pt(e.length)&&!!gt[W(e)]};const ft=function(e){return function(t){return e(t)}};var mt="object"==typeof exports&&exports&&!exports.nodeType&&exports,It=mt&&"object"==typeof module&&module&&!module.nodeType&&module,Et=It&&It.exports===mt&&x.process,yt=function(){try{var e=It&&It.require&&It.require("util").types;return e||Et&&Et.binding&&Et.binding("util")}catch(e){}}();var At=yt&&yt.isTypedArray;const Ct=At?ft(At):ht;var St=Object.prototype.hasOwnProperty;const _t=function(e,t){var n=He(e),s=!n&&at(e),a=!n&&!s&&lt(e),r=!n&&!s&&!a&&Ct(e),o=n||s||a||r,i=o?Xe(e.length,String):[],c=i.length;for(var l in e)!t&&!St.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||dt(l,c))||i.push(l);return i};var Nt=Object.prototype;const Tt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Nt)};const Dt=function(e,t){return function(n){return e(t(n))}};const Pt=Dt(Object.keys,Object);var Ot=Object.prototype.hasOwnProperty;const Rt=function(e){if(!Tt(e))return Pt(e);var t=[];for(var n in Object(e))Ot.call(e,n)&&"constructor"!=n&&t.push(n);return t};const bt=function(e){return null!=e&&pt(e.length)&&!q(e)};const vt=function(e){return bt(e)?_t(e):Rt(e)};const xt=function(e){return qe(e,vt,Je)};var wt=Object.prototype.hasOwnProperty;const Mt=function(e,t,n,s,a,r){var o=1&n,i=xt(e),c=i.length;if(c!=xt(t).length&&!o)return!1;for(var l=c;l--;){var u=i[l];if(!(o?u in t:wt.call(t,u)))return!1}var d=r.get(e),p=r.get(t);if(d&&p)return d==t&&p==e;var g=!0;r.set(e,t),r.set(t,e);for(var h=o;++l<c;){var f=e[u=i[l]],m=t[u];if(s)var I=o?s(m,f,u,t,e,r):s(f,m,u,e,t,r);if(!(void 0===I?f===m||a(f,m,n,s,r):I)){g=!1;break}h||(h="constructor"==u)}if(g&&!h){var E=e.constructor,y=t.constructor;E==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof y&&y instanceof y||(g=!1)}return r.delete(e),r.delete(t),g};const Lt=ie(M,"DataView");const Ut=ie(M,"Promise");const Ft=ie(M,"Set");const Vt=ie(M,"WeakMap");var jt="[object Map]",kt="[object Promise]",Bt="[object Set]",$t="[object WeakMap]",Gt="[object DataView]",Wt=X(Lt),Ht=X(ce),qt=X(Ut),zt=X(Ft),Yt=X(Vt),Kt=W;(Lt&&Kt(new Lt(new ArrayBuffer(1)))!=Gt||ce&&Kt(new ce)!=jt||Ut&&Kt(Ut.resolve())!=kt||Ft&&Kt(new Ft)!=Bt||Vt&&Kt(new Vt)!=$t)&&(Kt=function(e){var t=W(e),n="[object Object]"==t?e.constructor:void 0,s=n?X(n):"";if(s)switch(s){case Wt:return Gt;case Ht:return jt;case qt:return kt;case zt:return Bt;case Yt:return $t}return t});const Qt=Kt;var Jt="[object Arguments]",Xt="[object Array]",Zt="[object Object]",en=Object.prototype.hasOwnProperty;const tn=function(e,t,n,s,a,r){var o=He(e),i=He(t),c=o?Xt:Qt(e),l=i?Xt:Qt(t),u=(c=c==Jt?Zt:c)==Zt,d=(l=l==Jt?Zt:l)==Zt,p=c==l;if(p&&lt(e)){if(!lt(t))return!1;o=!0,u=!1}if(p&&!u)return r||(r=new be),o||Ct(e)?Fe(e,t,n,s,a,r):Ge(e,t,c,n,s,a,r);if(!(1&n)){var g=u&&en.call(e,"__wrapped__"),h=d&&en.call(t,"__wrapped__");if(g||h){var f=g?e.value():e,m=h?t.value():t;return r||(r=new be),a(f,m,n,s,r)}}return!!p&&(r||(r=new be),Mt(e,t,n,s,a,r))};const nn=function e(t,n,s,a,r){return t===n||(null==t||null==n||!Ze(t)&&!Ze(n)?t!=t&&n!=n:tn(t,n,s,a,e,r))};const sn=function(e,t){return nn(e,t)};let an,rn,on;const cn=e=>{e&&(an=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},an.BASEURL=e.server,an.ACTIONURL=e["action-end-point"],an.DATAURL=e["data-end-point"],on=e.reAuthUrl)},ln=()=>on,un=()=>an.BASEURL,dn=e=>fetch(`${an.BASEURL}${an.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),pn=e=>{rn=e},gn=()=>rn;var hn=a(953);const fn=function(e){return"symbol"==typeof e||Ze(e)&&"[object Symbol]"==W(e)};var mn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,In=/^\w*$/;const En=function(e,t){if(He(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!fn(e))||(In.test(e)||!mn.test(e)||null!=t&&e in Object(t))};function yn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var s=arguments,a=t?t.apply(this,s):s[0],r=n.cache;if(r.has(a))return r.get(a);var o=e.apply(this,s);return n.cache=r.set(a,o)||r,o};return n.cache=new(yn.Cache||Pe),n}yn.Cache=Pe;const An=yn;const Cn=function(e){var t=An(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t};var Sn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_n=/\\(\\)?/g;const Nn=Cn((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Sn,(function(e,n,s,a){t.push(s?a.replace(_n,"$1"):n||e)})),t}));const Tn=function(e,t){for(var n=-1,s=null==e?0:e.length,a=Array(s);++n<s;)a[n]=t(e[n],n,e);return a};var Dn=L?L.prototype:void 0,Pn=Dn?Dn.toString:void 0;const On=function e(t){if("string"==typeof t)return t;if(He(t))return Tn(t,e)+"";if(fn(t))return Pn?Pn.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};const Rn=function(e){return null==e?"":On(e)};const bn=function(e,t){return He(e)?e:En(e,t)?[e]:Nn(Rn(e))};const vn=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const xn=function(e){if("string"==typeof e||fn(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};const wn=function(e,t){for(var n=0,s=(t=bn(t,e)).length;null!=e&&n<s;)e=e[xn(t[n++])];return n&&n==s?e:void 0};const Mn=function(e,t,n){var s=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(a);++s<a;)r[s]=e[s+t];return r};const Ln=function(e,t){return t.length<2?e:wn(e,Mn(t,0,-1))};var Un=Object.prototype.hasOwnProperty;const Fn=function(e,t){var n=-1,s=(t=bn(t,e)).length;if(!s)return!0;for(;++n<s;){var a=xn(t[n]);if("__proto__"===a&&!Un.call(e,"__proto__"))return!1;if(("constructor"===a||"prototype"===a)&&n<s-1)return!1}var r=Ln(e,t);return null==r||delete r[xn(vn(t))]};const Vn=function(e,t){return null==e||Fn(e,t)};var jn=Object.prototype.hasOwnProperty;const kn=function(e,t){return null!=e&&jn.call(e,t)};const Bn=function(e,t,n){for(var s=-1,a=(t=bn(t,e)).length,r=!1;++s<a;){var o=xn(t[s]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++s!=a?r:!!(a=null==e?0:e.length)&&pt(a)&&dt(o,a)&&(He(e)||at(e))};const $n=function(e,t){return null!=e&&Bn(e,t,kn)};const Gn=function(e,t,n){var s=null==e?void 0:wn(e,t);return void 0===s?n:s};const Wn=function(){try{var e=ie(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const Hn=function(e,t,n){"__proto__"==t&&Wn?Wn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var qn=Object.prototype.hasOwnProperty;const zn=function(e,t,n){var s=e[t];qn.call(e,t)&&y(s,n)&&(void 0!==n||t in e)||Hn(e,t,n)};const Yn=function(e,t,n,s){if(!H(e))return e;for(var a=-1,r=(t=bn(t,e)).length,o=r-1,i=e;null!=i&&++a<r;){var c=xn(t[a]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(a!=o){var u=i[c];void 0===(l=s?s(u,c,i):void 0)&&(l=H(u)?u:dt(t[a+1])?[]:{})}zn(i,c,l),i=i[c]}return e};const Kn=function(e,t,n){return null==e?e:Yn(e,t,n)};const Qn=function(e,t,n){(void 0!==n&&!y(e[t],n)||void 0===n&&!(t in e))&&Hn(e,t,n)};const Jn=function(e){return function(t,n,s){for(var a=-1,r=Object(t),o=s(t),i=o.length;i--;){var c=o[e?i:++a];if(!1===n(r[c],c,r))break}return t}}();var Xn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Zn=Xn&&"object"==typeof module&&module&&!module.nodeType&&module,es=Zn&&Zn.exports===Xn?M.Buffer:void 0,ts=es?es.allocUnsafe:void 0;const ns=function(e,t){if(t)return e.slice();var n=e.length,s=ts?ts(n):new e.constructor(n);return e.copy(s),s};const ss=function(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t};const as=function(e,t){var n=t?ss(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const rs=function(e,t){var n=-1,s=e.length;for(t||(t=Array(s));++n<s;)t[n]=e[n];return t};var os=Object.create;const is=function(){function e(){}return function(t){if(!H(t))return{};if(os)return os(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const cs=Dt(Object.getPrototypeOf,Object);const ls=function(e){return"function"!=typeof e.constructor||Tt(e)?{}:is(cs(e))};const us=function(e){return Ze(e)&&bt(e)};var ds=Function.prototype,ps=Object.prototype,gs=ds.toString,hs=ps.hasOwnProperty,fs=gs.call(Object);const ms=function(e){if(!Ze(e)||"[object Object]"!=W(e))return!1;var t=cs(e);if(null===t)return!0;var n=hs.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&gs.call(n)==fs};const Is=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};const Es=function(e,t,n,s){var a=!n;n||(n={});for(var r=-1,o=t.length;++r<o;){var i=t[r],c=s?s(n[i],e[i],i,n,e):void 0;void 0===c&&(c=e[i]),a?Hn(n,i,c):zn(n,i,c)}return n};const ys=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var As=Object.prototype.hasOwnProperty;const Cs=function(e){if(!H(e))return ys(e);var t=Tt(e),n=[];for(var s in e)("constructor"!=s||!t&&As.call(e,s))&&n.push(s);return n};const Ss=function(e){return bt(e)?_t(e,!0):Cs(e)};const _s=function(e){return Es(e,Ss(e))};const Ns=function(e,t,n,s,a,r,o){var i=Is(e,n),c=Is(t,n),l=o.get(c);if(l)Qn(e,n,l);else{var u=r?r(i,c,n+"",e,t,o):void 0,d=void 0===u;if(d){var p=He(c),g=!p&&lt(c),h=!p&&!g&&Ct(c);u=c,p||g||h?He(i)?u=i:us(i)?u=rs(i):g?(d=!1,u=ns(c,!0)):h?(d=!1,u=as(c,!0)):u=[]:ms(c)||at(c)?(u=i,at(i)?u=_s(i):H(i)&&!q(i)||(u=ls(c))):d=!1}d&&(o.set(c,u),a(u,c,s,r,o),o.delete(c)),Qn(e,n,u)}};const Ts=function e(t,n,s,a,r){t!==n&&Jn(n,(function(o,i){if(r||(r=new be),H(o))Ns(t,n,i,s,e,a,r);else{var c=a?a(Is(t,i),o,i+"",t,n,r):void 0;void 0===c&&(c=o),Qn(t,i,c)}}),Ss)};const Ds=function(e){return e};const Ps=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var Os=Math.max;const Rs=function(e,t,n){return t=Os(void 0===t?e.length-1:t,0),function(){for(var s=arguments,a=-1,r=Os(s.length-t,0),o=Array(r);++a<r;)o[a]=s[t+a];a=-1;for(var i=Array(t+1);++a<t;)i[a]=s[a];return i[t]=n(o),Ps(e,this,i)}};const bs=function(e){return function(){return e}};const vs=Wn?function(e,t){return Wn(e,"toString",{configurable:!0,enumerable:!1,value:bs(t),writable:!0})}:Ds;var xs=Date.now;const ws=function(e){var t=0,n=0;return function(){var s=xs(),a=16-(s-n);if(n=s,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(vs);const Ms=function(e,t){return ws(Rs(e,t,Ds),e+"")};const Ls=function(e,t,n){if(!H(n))return!1;var s=typeof t;return!!("number"==s?bt(n)&&dt(t,n.length):"string"==s&&t in n)&&y(n[t],e)};const Us=function(e){return Ms((function(t,n){var s=-1,a=n.length,r=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(a--,r):void 0,o&&Ls(n[0],n[1],o)&&(r=a<3?void 0:r,a=1),t=Object(t);++s<a;){var i=n[s];i&&e(t,i,s,r)}return t}))}((function(e,t,n,s){Ts(e,t,n,s)}));var Fs=Object.prototype.hasOwnProperty;const Vs=function(e){if(null==e)return!0;if(bt(e)&&(He(e)||"string"==typeof e||"function"==typeof e.splice||lt(e)||Ct(e)||at(e)))return!e.length;var t=Qt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Tt(e))return!Rt(e).length;for(var n in e)if(Fs.call(e,n))return!1;return!0};class js{static setNamespaceSupport=(e=!1)=>{js.namespaceEnabled=e};static isNamespaceEnabled=()=>js.namespaceEnabled??!1;static getNamespaceList=()=>{const e=globalThis.PCore,t=e?.getEnvironmentInfo?.();if(t&&"function"==typeof t.getFeatureMap)return t.getFeatureMap()?.namespaceList};static getQualifiedName=(e,t)=>{if(!js.isNamespaceEnabled())return e;const n=js.getNamespaceList();if(Array.isArray(n)){if(n.some((t=>{const n=`${t}__`;return e.startsWith(n)})))return e}return`${t}__${e}`};static getDefaultQualifiedName=e=>js.getQualifiedName(e,"PegaPlatform");static namespacePrefixedRuleName(e,t){return t?js.getQualifiedName(e,t):js.getDefaultQualifiedName(e)}static getQualifiedNameForComplexRuleReferences(e,t){const{namespace:n,marker:s}=t??{},a=`${s??"caseInfo.content"}.`,r=e.lastIndexOf(a);if(-1!==r){return e.slice(0,r+a.length)+e.slice(r+a.length).split(".").map((e=>js.namespacePrefixedRuleName(e,n))).join(".")}if(e.includes(".")){const t=e.startsWith("."),s=(t?e.slice(1):e).split(".").filter(Boolean).map((e=>js.namespacePrefixedRuleName(e,n))).join(".");return t?`.${s}`:s}return js.namespacePrefixedRuleName(e,n)}}const ks=js;const Bs=new class{constructor(){this.needsMapping=!1}getNeedsMapping(){return this.needsMapping}setNeedsMapping(e){this.needsMapping=e}map(e){return this.needsMapping?this.replacer(e):e}transformObjectToCase(e){let t,n=!1;try{const n=this.replaceToCase(JSON.stringify(e));t=JSON.parse(n)}catch(e){console.error("not a Valid JSON",e),n=!0}return n?e:t}transformCaseData(e){const t=e?.data?.caseInfo,n=e?.uiResources;return{data:{objectInfo:{content:{...t?.content}}},uiResources:{...n}}}analyseResponse(e){e?.data?.objectInfo&&window?.PCore?.getEnvironmentInfo()?.isUnifiedObject()?this.setNeedsMapping(!0):this.setNeedsMapping(!1)}replacer(e){return this.needsMapping&&(e=e.replace("caseInfo","objectInfo").replace("caseTypeName","objectTypeName").replace("caseTypeID","objectTypeID")),e}replaceToCase(e){return e.replace("objectInfo","caseInfo").replace("objectTypeName","caseTypeName").replace("objectTypeID","caseTypeID")}},$s={APP:{APP:"app",ROOT:"root",INFINITY_RUNTIME:"Infinity",PXREQUESTOR:"pxRequestor",PXUSERNAME:".pxUserName",OPERATORID:"OperatorID",USERNAME:"pxRequestor.pxUserName",PXUSERIDENTIFIER:".pxUserIdentifier",USERIDENTIFIER:"pxRequestor.pxUserIdentifier",PYIMAGEINSKEY:".pyImageInsKey",OPERATORID_IMG_INSKEY:"OperatorID.pyImageInsKey",OPERATORID_LOCALE:"OperatorID.pyUseLocale",APPLICATION_LABEL:"Application.pyLabel",APPLICATION_RULE_NAME:"Application.pyRuleName"},RESOURCE_TYPES:{ASSIGNMENT:"ASSIGNMENT",CASE:"CASE",DATA:"DATA",PAGE:"PAGE",OBJECT:"OBJECT"},RESOURCE_STATUS:{CREATE:"CREATE",UPDATE:"UPDATE",OPEN_FLOW_ACTION:"OPEN_FLOW_ACTION"},VIEW_NAMES:{PY_CASE_TAB:ks.getDefaultQualifiedName("pyCaseTab"),DATA_OBJECT_CREATE_VIEW:ks.getDefaultQualifiedName("Create"),DATA_OBJECT_EDIT_VIEW:ks.getDefaultQualifiedName("pyEdit"),PY_DATA_PREVIEW:ks.getDefaultQualifiedName("pyDataPreview"),PY_DETAILS:ks.getDefaultQualifiedName("pyDetails"),OBJECT_CREATE_VIEW:"Create",SUBSCRIPT_CREATE_VIEW:ks.getDefaultQualifiedName("SubscriptView")},CONTAINERS:{ROOT_CONTAINER:"RootContainer",VIEW_CONTAINER:"ViewContainer",FLOW_CONTAINER:"FlowContainer",MODAL_VIEW_CONTAINER:"ModalViewContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",HYBRID_VIEW_CONTAINER:"HybridViewContainer"},WORK_BASKET:{MY_WORK_LIST:"myWorkList",REPORTEE:"reportee",WORK_QUEUE:"workQueue",DATA_PAGES:{D__PY_GET_USER_WORK_LIST_BY_USER_ID:ks.getDefaultQualifiedName("D_pyGetUserWorkListByUserId"),D__WORK_BASKET:ks.getDefaultQualifiedName("D_WorkBasket"),D__PY_MY_WORK_LIST:ks.getDefaultQualifiedName("D_pyMyWorkList")}},CONTEXT_TREE_NODE_TYPES:{VIEW:"VIEW",FIELD:"FIELD",DECLARATIVE_TARGET:"DECLARATIVE_TARGET",WHEN:"WHEN",CONTEXT:"CONTEXT",PAGELIST:"PAGELIST"},WORKLIST:"worklist",WAIT:"wait",TODO:"todo",STANDARD_FLOW:"Standard",CASE:"CASE",ASSIGNMENT:"ASSIGNMENT",FIX_BROKEN_ASSIGNMENTS:"FixBrokenAssignments",PAGE:"PAGE",PZINSKEY:".pzInsKey",CREATE_DETAILS_VIEW_NAME:ks.getDefaultQualifiedName("pzCreateDetails"),PREVIEW_VIEW_NAME:ks.getDefaultQualifiedName("pyCasePreview"),CASESUMMARY_VIEW_NAME:"pyCaseSummary",APPSHELL_ACTIVE_CASES:"appshell-activecases",TRACE_ID:"x-b3-traceid",LOAD_VIEW_STRING:"View",PRIMARY:"primary",DEFER_UPDATE_CASESUMMARY_VIEW:"deferUpdateCaseSummaryView",NEXT_ASSIGNMENT_INFO_ID:"nextAssignmentInfo.ID",WORKCLASS:"Work-",DATA_INFO:{DATA_INFO:"dataInfo",DATA_INFO_CONTENT:"dataInfo.content",DATA_INFO_CONTEXT_KEY:"dataInfo.contextKey"},OBJECT_INFO:{OBJECT_INFO:"objectInfo",OBJECT_INFO_ID:"objectInfo.ID",OBJECT_INFO_CONTENT:"objectInfo.content",ACTIVE_ACTION_ID:"objectInfo.activeActionID",OBJECT_INFO_CONTENT_CLASS_ID:"objectInfo.content.classID"},CASE_INFO:{CASE_INFO:"caseInfo",CASE_INFO_COLLABORATORS:"caseInfo.collaborators",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_ENCRYPTED_CONTENT:"caseInfo.encryptedContent",CASE_INFO_NAME:"caseInfo.name",CASE_INFO_ID:"caseInfo.ID",CASE_INFO_CLASSID:"caseInfo.content.classID",CASE_INFO_CLASSNAME:"caseInfo.className",CASE_TYPE_ID:"caseInfo.caseTypeID",CASE_TYPE_NAME:"caseInfo.caseTypeName",CASE_INFO_PZINSKEY:ks.getQualifiedNameForComplexRuleReferences("caseInfo.content.pzInsKey"),CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:ks.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyViewName"),ACTION_BUTTONS:"caseInfo.actionButtons",ACTIVE_ACTION_ID:"caseInfo.activeActionID",ASSIGNMENT_LABEL:"caseInfo.assignments[0].name",ASSIGNMENT_ID:"caseInfo.assignments[0].ID",ASSIGNMENTS:"caseInfo.assignments",INSTRUCTIONS:"caseInfo.assignments[0].instructions",NAVIGATION:"caseInfo.navigation",STAGES:"caseInfo.stages",STAGEID:"caseInfo.stageID",CASECLASS:"caseInfo.caseClass",AVAILABLEACTIONS:"caseInfo.availableActions",AVAILABLEPROCESSES:"caseInfo.availableProcesses",D_CASE_ASSIGNMENTS_RESULTS:"caseInfo.assignments",CHILD_ASSIGNMENTS:"caseInfo.childCases",ASSIGNMENTACTION_ID:"caseInfo.assignments[0].actions[0].ID",ISINCREATESTAGE:"caseInfo.isInCreateStage",APPROVALFLAG:ks.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyApprovalResult"),DUPLICATECASEFLAG:ks.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateCaseActions"),DUPLICATECASEID:ks.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateID"),DUPLICATECASEINSKEY:ks.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateCaseReference.pzInsKey"),HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",IS_ASSIGNMENT:"caseInfo.isAssignment",GETNEXTWORK:"caseInfo.confirmationLinks.getNextWork",ACTION_REFRESH_CONDITIONS:"caseInfo.assignments[0].actions[0].refreshConditions",IS_LOCAL_ACTION:"caseInfo.isLocalAction",BUSINESS_ID:"caseInfo.businessID",IS_FIRST_ASSIGNMENT:"caseInfo.isFirstAssignment",CASE_INFO_ATTACHMENTS:"caseInfo.attachments"},ACTIONS:{ACTION_ID:"actionID",ACTIONS:"availableActions",DELETEAVIALACTIONS:"deleteAvailActions",FLOWACTION:"FlowAction",DATA_PAGES:{D_PY_ADDITIONAL_CASE_ACTIONS:ks.getDefaultQualifiedName("D_pyAdditionalCaseActions")}},PROCESS:{FLOWPROBLEMS:"FlowProblems"},PAGE_TYPES:{PAGE:"page",LANDINGPAGE:"landingpage",LISTPAGE:"listpage"},LOCAL_ACTION_TYPE:{CASE_WIDE:"case",EXPRESS:"express",ASSIGNMENT:"Assignment",LOCAL_ACTION:"LocalAction"},LOCAL_ACTIONS:{TRANSFER_ASSIGNMENT:ks.getDefaultQualifiedName("pyTransferAssignment")},CONTENT:"content",MODAL:"modal",ACTIONAREA:"actionarea",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:ks.getQualifiedNameForComplexRuleReferences("context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime"),SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:ks.getQualifiedNameForComplexRuleReferences("context_data.caseInfo.content.summary_of_attachments__.lastRefreshTime"),CONTEXT_DATA_ASSIGNMENTID:"context_data.assignmentID",BANNER_VARIANT_SUCCESS:"success",BANNER_VARIANT_WARNING:"warning",BANNER_VARIANT_URGENT:"urgent",BANNER_VARIANT_INFO:"info",INVALID_INPUTS:"Invalid inputs",VALIDATION_FAIL:"Validation fail",MESSAGES:{MESSAGES_TYPE_SUCCESS:"success",MESSAGES_TYPE_INFO:"info",MESSAGES_TYPE_ERROR:"error"},PUB_SUB_EVENTS:{EVENT_RENDER_APP:"renderApp",EVENT_UNMOUNT_APP:"unmountApp",EVENT_REAUTH:"reAuth",EVENT_FULL_REAUTH:"fullReAuth",EVENT_CUSTOM_REAUTH:"customReAuth",EVENT_CANCEL:"cancel",EVENT_MINIMIZE:"minimize",EVENT_EXPRESS_LOCALACTION:"expressLocalActionSubmit",EVENT_BULKACTION:"bulkActionSubmit",EVENT_SHOW_CANCEL_ALERT:"showCancelAlert",EVENT_SHOW_DELETE_ALERT:"showDeleteAlert",EVENT_DASHBOARD_FILTER_CHANGE:"dashboardFilterChange",EVENT_DASHBOARD_FILTER_CLEAR_ALL:"dashboardFilterClearAll",EVENT_PROMOTED_FILTERS_CHANGE:"promotedFiltersChange",EVENT_LOCALACTION_SUBMISSION:"localActionSubmit",EVENT_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{INSPECTOR:"inspector",INSPECTOR_SHOW_ALL:"inspectorShowAll",UI_DESIGNER:"uiDesigner",UI_DESIGNER_TOOLBAR_EXPANDED:"uiDesignerToolbarExpanded",SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted",THEME_CHANGE:"themeChange",THEME_MODE_CHANGE:"themeModeChange",NAV_ORIENTATION_CHANGE:"navOrientationChange",CASE_VIEW_TEMPLATE_CHANGE:"caseViewTemplateChange"},CASE_EVENTS:{CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW:"caseAttachmentsUpdateFromCaseview",CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW:"caseFollowerUpdateByOperatorFromCaseview",CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET:"caseFollowerUpdateByOperatorFromWidget",CASE_CREATED:"caseCreated",CREATE_STAGE_DONE:"caseCreatedDone",CREATE_STAGE_CANCELLED:"caseCancelled",CREATE_STAGE_SAVED:"caseSaved",CREATE_STAGE_DELETED:"caseDeleted",ASSIGNMENT_SUBMISSION:"assignmentSubmission",END_OF_ASSIGNMENT_PROCESSING:"endOfAssignmentProcessing",CLOSE_CONFIRM_VIEW:"closeConfirmView",CASE_OPENED:"caseOpened",CASE_VIEW_OPENED_AFTER_CREATE:"caseViewOpenedAfterCreate",CASE_CLOSED:"caseClosed",ASSIGNMENT_OPENED:"assignmentOpened",CASE_PREVIEW:"casePreview",CURRENT_ASSIGNMENT_UPDATED:"currentAssignmentUpdated",CASE_LOCK_EVENT:"caseLockEvent",GET_NEXT_WORK:"getNextWork",SAVE_ASSIGNMENT_COMPLETE:"saveAssignmentComplete",CASE_LOAD:"caseLoad",CASE_UNLOAD:"caseUnload",CASE_EDIT_OPEN:"caseEditOpen",CASE_EDIT_CLOSE:"caseEditClose"},ASSIGNMENT_EVENTS:{ASSIGNMENT_LOAD:"assignmentLoad",ASSIGNMENT_UNLOAD:"assignmentUnload"},WORK_EVENTS:{WORK_DELETED:"workDeleted"},BOOTSTRAP_SHELL_EVENTS:{CONSTELLATION_LOADED:"CONSTELLATION_LOADED"},CONTAINER_EVENTS:{CLOSE_CONTAINER_ITEM:"CLOSE_CONTAINER_ITEM",CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM:"CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM"},DISPLAY_CASE_CREATED_TOASTER:"displayCaseCreatedToaster",DISPLAY_CASE_SUBMITTED_TOASTER:"displayCaseSubmittedToaster",DATA_EVENTS:{DATA_OBJECT_CREATED:"dataObjectCreated",DATA_OBJECT_DELETED:"dataObjectDeleted",DATA_OBJECT_UPDATED:"dataObjectUpdated"},FETCH_SUCCESS:"fetchSuccess",FETCH_FAILURE:"fetchFailure",REVERSE_COEXISTENCE_EVENTS:{HANDLE_DISCARD:"handleDiscard",CHECK_IS_FORM_DIRTY:"checkIsFormDirty"},TIMEOUT_REMINDER:"sessionAboutToTimeout",RESET_TIMER:"resetInactivityTimer",PEGA_EMBED_CUSTOM:"pegaEmbedCustom",SUGGESTION_PROCESSED:"suggestion_processed",ERROR_ON_FINISH_ASSIGNMENT:"errorOnFinishAssignment",URL_NAVIGATION:"urlNavigation",ON_REFRESH_START:"onRefreshStart",ON_REFRESH_COMPLETE:"onRefreshComplete",EVENT_LOCALE_CHANGED:"localeChanged"},ERROR_TYPE:{CLIENT:"client",SERVER:"server"},CONTAINER_TYPE:{MULTIPLE:"multiple",SINGLE:"single",HYBRID:"HybridViewContainer"},REMOTE_SYSTEM_ID:"RemoteSystemID",LIST_SELECTION_MODE:{MULTI:"multi",SINGLE:"single",MULTI_ON_HOVER:"multi_on_hover"},SUBMISSION_FAILURE_TYPE:{FORM_VALIDATION_ERROR:"formValidationError"},USER_SETTINGS:{UTILITY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.utilityPanelExpanded",SUMMARY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.summaryPanelExpanded",ASSIGNMENT_COLLAPSED_STATE_PATH:"presentation.templates.CaseView.assignmentWidgetCollapsed",CASE_VIEW_PATH:"presentation.templates.CaseView",PORTAL_AGENT_SPLIT_VIEW_PATH:"presentation.templates.GenAICoach",PORTAL_AGENT_WIDTH_PATH:"presentation.templates.GenAICoach.agentPanelWidth"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},PORTAL_TYPE:{WSS:"wss"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:ks.getDefaultQualifiedName("pyEmbedAssignment"),PY_DETAILS:ks.getDefaultQualifiedName("pyDetails")},ACTION:"action",CONTEXT_DATA_MODAL_VIEW:{CONTEXT_DATA_MODAL_VIEW:"context_data.modalView",IS_MULTI_RECORD_DATA:"context_data.modalView.isMultiRecordData",VIEW_NAME:"context_data.modalView.viewName",PARENT_CONTEXT:"context_data.modalView.parentContext",INTERESTPAGE:"context_data.modalView.interestPage",EDIT_TYPE:"context_data.modalView.editType",ACTION_ID:"context_data.modalView.actionID"},FEED:{MESSAGE_VIEW_REFERENCE:ks.getDefaultQualifiedName("messageViewReference"),PARENT_MESSAGE_ID:ks.getDefaultQualifiedName("parentMessageID"),PX_RESULTS:ks.getDefaultQualifiedName("pxResults"),NAME:ks.getDefaultQualifiedName("name"),POSTED_BY_USER:ks.getDefaultQualifiedName("postedByUser"),UPDATED_TIME:ks.getDefaultQualifiedName("updatedTime"),POST_MESSAGE:ks.getDefaultQualifiedName("PostMessage"),PZ_INS_KEY:ks.getDefaultQualifiedName("pzInsKey"),PZ_PRIVATE_POST_DETAILS:ks.getDefaultQualifiedName("pzPrivatePostDetails"),PY_SELECTED:ks.getDefaultQualifiedName("pySelected"),PY_LABEL:ks.getDefaultQualifiedName("pyLabel"),PY_RECIPIENTS:ks.getDefaultQualifiedName("pyRecipients"),MENTIONS:ks.getDefaultQualifiedName("mentions"),PY_IS_DELETE_ENABLED:ks.getDefaultQualifiedName("pyIsDeleteEnabled"),TAGS:ks.getDefaultQualifiedName("tags"),PZ_POST_DETAILS:ks.getDefaultQualifiedName("pzPostDetails"),PY_FEED_SOURCE_REFERENCE:ks.getDefaultQualifiedName("pyFeedSourceReference"),IS_EDITED:ks.getDefaultQualifiedName("isEdited"),PY_LIKES:ks.getDefaultQualifiedName("pyLikes"),PY_POST_TYPE:ks.getDefaultQualifiedName("pyPostType"),POSTED_TIME:ks.getDefaultQualifiedName("postedTime"),PY_MESSAGE_VIEW_REFERENCE:ks.getDefaultQualifiedName("pyMessageViewReference"),ID:ks.getDefaultQualifiedName("ID"),PY_COMMENT_CONTEXT:ks.getDefaultQualifiedName("pyCommentContext"),PX_LIKE_COUNT:ks.getDefaultQualifiedName("pxLikeCount"),MESSAGE:ks.getDefaultQualifiedName("message")},CASE_VIEW_MODE:{PERFORM:"perform",REVIEW:"review",CONFIRM:"confirm"}},Gs={CONTEXT:"context",AJAXCONTAINER:"primary",VIEW_CONTAINER:"ViewContainer",APP_SHELL:"AppShell",ROOT_CONTAINER:"RootContainer",HYBRID:"hybrid",HYBRID_VIEW_CONTAINER:"HybridViewContainer",HYRBID_ROOT_CONTAINERNAME:"hybridRootContainerName",MODAL_VIEW_CONTAINER:"ModalViewContainer",FLOW_CONTAINER:"FlowContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",OBJECT_PAGE:"ObjectPage",CASE_CREATE_STAGE:"CaseCreateStage",CASE_VIEW:"CaseView",RULE_VIEW:"RuleView",SELF_SERVICE_CASE_VIEW:"SelfServiceCaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",RULE_PREVIEW:"RulePreview",CASE_STAGES:"Stages",CASEMESSAGES:"caseMessages",SUGGESTION:"suggestion",PREVIEW:"preview",TERTIARY:"tertiary",DEFAULT:"default",ACPRIMARY:"primary",ACTERTIARY:"tertiary",PERFORM_MODE:"perform",CASE_VIEW_MODE_PROP:".caseViewMode",REVIEW_MODE:"review",WORKAREA:"workarea",OBJECTACTIONCONTAINER:"ObjectActionContainer",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",UNDERSCORE_STRING:"_",DOUBLE_UNDERSCORE_STRING:"__",WORK_ID:"WORK_ID",EMPTY_STRING:"",PROPERTY_MESSAGES:"propertyMessages__",CONTEXT_MESSAGES:"contextMessages__",HTTP_MESSAGES:"httpMessages__",PAGE_MESSAGES:"pageMessages__",SUMMARY_OF_LISTS:"summary_of_lists__",SUMMARY_OF_GROUPS:"summary_of_groups__",SUMMARY_OF_MESSAGES:"summary_of_messages__",SUMMARY_OF_FIELD_VALUES:"summary_of_field_values__",SUMMARY_OF_WHEN_CONDITIONS:"summary_of_when_conditions__",SUMMARY_OF_DYNAMIC_WHENS:"summary_of_dynamic_whens__",SUMMARY_OF_EXPRESSIONS:"summary_of_expressions__",SUMMARY_OF_ASSOCIATED_LISTS:"summary_of_associated_lists__",CONTEXT_DATA:"context_data",TABLE:e=>`Table[${e}]`,HTTP:"HTTP",PROPERTY:"PROPERTY",PAGE_ERRORS:"page_level_errors",CUSTOM_ERROR:"custom error",NO_MESSAGES:"No messages existing",PULSE_REFERENCE:"pulse.messages",IS_LOADING:"isLoading",APPROVED:"Approved",REJECTED:"Rejected",DUPLICATE:"Duplicate",IGNORE:"Ignore",PARAGRAPH:"PARAGRAPH",X_ORIGIN_CHANNEL:"x-origin-channel",AUTHORING_PREVIEW_CONTAINER:"root/authoring-preview",EMBED:"EMBED",ERROR_FIELD_IN_PAGE:"erroneousInputOutputFieldInPage",ERROR_IN_PAGE_IDENTIFIER:"erroneousInputOutputIdentifier",ON_REFRESH_ERROR:"onRefreshError",UI_RESOURCES:"uiResources",UI_RESOURCES_CONTEXT_DATA:"uiResources.context_data",ACTION_BUTTONS:"uiResources.actionButtons",RESOURCES:"uiResources.resources",ROOT:"uiResources.root",CASE_INFO_IS_LOCAL_ACTION:"caseInfo.isLocalAction",OBJECT_INFO_IS_LOCAL_ACTION:"objectInfo.isObjectWideAction",DATA:"data",OPTIONS:"options",VIEWS:"uiResources.resources.views",NAVIGATIONS:"uiResources.resources.navigations",COMPONENTS:"uiResources.components",UI_RESOURCES_ROOT_CONTEXT:"uiResources.root.config.context",LOCALE_REFERENCES:"uiResources.localeReferences",STATIC_SERVER_URL:"staticServer",APPLICATION_DATA:"data.Application",REFERENCED_USERS:"referencedUsers",CASE_INFO_REFRESH_CONDITIONS:"caseInfo.refreshConditions",FIELD_LEVEL_SUCCESS:"success",FIELD_LEVEL_WARNING:"warning",FIELD_LEVEL_ERROR:"error",HASH_DELIMITER:"~^|^~",NULL_STRING:"null",DATA_PAGE:"DataPage",DECISION:"Decision",RULE_REFERENCE:"RuleReference",GET_PAGE_DATA:"getPageData",PROPERTY_ANNOTATION:"@P",FIELD_LABEL_ANNOTATION:"@FL",ATTACHMENT_ANNOTATION:"@ATTACHMENT",PARAGRAPH_ANNOTATION:"@PARAGRAPH",FORMAT_ANNOTATION:"@FORMAT",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",CLASS_ASSOCIATION_ANNOTATION:"@CA",FILTERED_LIST_ANNOTATION:"@FILTERED_LIST",CLASS_ANNOTATION:"@CLASS",ASSOCIATED:"associated",CLASS_ID:".classID",CLASSID:"classID",READONLY:"readonly",SHARED:"shared",RELOAD_IF_OLDER_THAN:"reloadIfOlderThan",RELOAD_ONCE_PER_INTERACTION:"reloadOncePerInteraction",PY_DETAILS:ks.getDefaultQualifiedName("pyDetails"),PY_CONFIRM:ks.getDefaultQualifiedName("pyConfirm"),LIST_ACTIONS:{ADD:"ADD",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE",DELETE_ALL:"DELETE ALL",MOVE:"MOVE",SELECT:"SELECT",DESELECT:"DESELECT",REPLACE:"REPLACE",DELETEPAGE:"DELETEPAGE"},LIST_ACTIONS_TYPE:{SELECT_DESELECT:"SELECT_DESELECT",DESELECT_ALL:"DESELECT_ALL"},ENV_INFO_KEYS:{APPLICATION_NAME:"APPLICATION_NAME",APPLICATION_DESC:"APPLICATION_DESC",APPLICATION_ID:"APPLICATION_ID",ACCESS_GROUP:"ACCESS_GROUP",USER_NAME:"USER_NAME",USER_ID:"USER_ID",USER_IMAGE:"USER_IMAGE",LOCALE:"LOCALE",TIMEZONE:"TIMEZONE",WORK_GROUP:"WORK_GROUP"},ID:"ID",SCALARLIST:"ScalarList",COREHEADERS:"coreHeaders",SKIPCOREHEADERS:"skipCoreHeaders",COREHEADER_APP_DEBUG_ID:"X-Pega-App-Debug-ID",COREHEADER_APP_DEBUG_LEVELS:"X-Pega-App-Debug-Levels",EMBEDDED_DATA_MODAL:{SHOW_ROW:"showRow",SUBMIT_ROW:"submitRow",EDIT_TYPE:"editType",ACTION_NAME:"actionName",REFRESH_CONDITIONS:"caseInfo.refreshConditions"},LOCALIZATION_V2:2,DATA_CLASS_NOT_FOUND:"Data object class not found",PRIORITY:{CRITICAL:100,HIGH:500,MEDIUM:1e3,LOW:2e3,TRIVIAL:3e3,PING:6500},...$s,getProperty:e=>Bs.map(e),getDefaultQualifiedName:e=>ks.getDefaultQualifiedName(e)},Ws=ks.getDefaultQualifiedName("pyRemoteCaseDetails");class Hs{static remoteCaseMapping={};static setRemoteCaseMapping=e=>{this.remoteCaseMapping=e,this.setAdditionalParameters()};static getRemoteCaseMapping=()=>this.remoteCaseMapping;static getRemoteCase=e=>this.remoteCaseMapping?.[e];static isRemoteCase=e=>!!(e&&this.remoteCaseMapping&&this.remoteCaseMapping[e]);static getRemoteHeaderByContext=e=>NC.getProperty(".RemoteSystemID",Gs.CASE_INFO.HEADERS,e);static getRemoteHeader=e=>this.remoteCaseMapping[e]?.RemoteSystemID;static injectRemoteCaseHeader=(e,t,n)=>{if(e&&e.RemoteSystemID)return;const s=this.getRemoteHeaderByContext(n);s?e.RemoteSystemID=s:t&&this.isRemoteCase(t.caseTypeID)&&(e.RemoteSystemID=this.getRemoteHeader(t.caseTypeID))};static isTraditionalRemoteCase=(e="")=>"Traditional"===Hs.getRemoteCase(e)?.RemoteApplicationType;static setAdditionalParameters=()=>{const e=Gy.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteAppPlatformVersion=e=>{if(!e)return;const t=Gy.environmentInfoObject?.pyRemoteAppPlatformVersion;if(t){return JSON.parse(t)[e]}};static isRemoteCaseVersionDifferent=e=>{if(!this.isRemoteCase(e))return!1;const t=this.getRemoteHeader(e);if(!t)return!1;const n=this.getRemoteAppPlatformVersion(t);return Boolean(n)};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID};static getRemoteCaseClassBySourceClass=e=>{if(e)for(const[t,n]of Object.entries(this.remoteCaseMapping))if(n.RemoteClassName===e)return t}}const qs=Hs,zs={},Ys=new Map,Ks=e=>{let t=Gs.EMPTY_STRING;return t=e&&e.includes(Gs.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},Qs=(e,t,n=!1)=>{let s=Gs.EMPTY_STRING;if(t&&e){let a=`${t}${Gs.FORWARD_SLASH_STRING}${e}`;const r=LE(a);if(r||t!==Gs.APP.APP&&t!==Gs.APP.ROOT)if(r){if(n&&zs[a])return s=`${a}${Gs.UNDERSCORE_STRING}${zs[a]}`,s;zs[a]?zs[a]+=1:zs[a]=1,s=`${a}${Gs.UNDERSCORE_STRING}${zs[a]}`}else s=Qs(e,Ks(t));else a=`${t}${Gs.FORWARD_SLASH_STRING}${Gs.PRIMARY}`,zs[a]?zs[a]+=1:zs[a]=1,s=`${a}${Gs.UNDERSCORE_STRING}${zs[a]}`}return s},Js=(e,t)=>{if(e&&t){const n=(Ys[t]?.[e]??0)+1;return Ys[t]||(Ys[t]={}),Ys[t][e]=n,`${t}${Gs.FORWARD_SLASH_STRING}${e}_${n}`}return""},Xs=(e,t)=>{if(e&&t){const n=Ys[t]?.[e];return n?`${t}${Gs.FORWARD_SLASH_STRING}${e}_${n}`:Js(e,t)}return""},Zs=e=>{let t=Gs.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},ea=(e,t)=>{if(null===e)return t;const[,n]=t.split(Gs.FORWARD_SLASH_STRING);return e+Gs.FORWARD_SLASH_STRING+n},ta=e=>{const t=e.indexOf(Gs.FORWARD_SLASH_STRING),n=e.lastIndexOf(Gs.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},na=e=>{const t=e.split(Gs.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+Gs.FORWARD_SLASH_STRING+t[2]},sa="SET_PROPERTY",aa="REPLACE_PROPERTY",ra="FIELD_CHANGE",oa="LOAD_VIEW",ia="SHOW_PAGE",ca="SHOW_DATA",la="SHOW_INSIGHT",ua="SHOW_DASHBOARD",da="SET_LOADING",pa="RESET_LOADING",ga="APP_OFFLINE",ha="APP_ONLINE",fa="SET_SHARED_PROPERTY",ma="CREATE_WORK",Ia="OPEN_WORK_BY_HANDLE",Ea="UPDATE_DOCUMENT",ya="FINISH_ASSIGNMENT",Aa="SAVE_AND_CLOSE",Ca="CANCEL_ASSIGNMENT",Sa="OPEN_ASSIGNMENT",_a="NAVIGATE_TO_STEP",Na="OPEN_LOCAL_ACTION",Ta="OPEN_PROCESS_ACTION",Da="MERGE_DATA",Pa="REMOVE_ITEM",Oa="GET_DATAOBJECT_ACTIONS",Ra="SHOW_HISTORY",ba="ERROR",va="INIT_CONTAINERS",xa="RESET_CONTAINERS",wa="ADD_CONTAINER_ITEM",Ma="REMOVE_CONTAINER_ITEM",La="ADD_TRANSIENT_ITEM",Ua="UPDATE_TRANSIENT_DATA",Fa="REMOVE_TRANSIENT_ITEM",Va="REMOVE_ALL_TRANSIENT_ITEMS",ja="CLEAR_TRANSIENT_DATA",ka="PURGE_TRANSIENT_DATA",Ba="REPLACE_TRANSIENT_DATA",$a="ACTIVATE_CONTAINER_ITEM",Ga="UPDATE_CONTAINER_ITEM",Wa="UPMERGE_AND_REMOVE_CONTAINER_ITEM",Ha="REPLACE_CONTAINER_ITEM",qa="ACTIVATE_MODAL_CONTAINER_ITEM",za="REMOVE_CONTAINER",Ya="ADD_SUGGESTION_CONTEXT",Ka="showView",Qa="showData",Ja="showInsight",Xa="showDashboard",Za="openWorkByHandle",er="openAssignment",tr="createNewWork",nr="finishAssignment",sr="SHOW_CANCEL_ALERT",ar="deleteCaseInCreateStage",rr="openLocalAction",or="openProcessAction",ir="caseWideActions",cr="executeCaseWideActions",lr="openBulkAction",ur="performBulkAction",dr="launchAssignment",pr="ADD_MESSAGES",gr="CLEAR_MESSAGES",hr="RESET_STORE",fr="FETCH_DATAPAGE",mr="ADD_SHARED_DATA",Ir="REMOVE_SHARED_DATA",Er="LIST_ACTION",yr="DELETE_CASE_SUMMARY",Ar="ALTER_BLOCKING_ACTION_COUNT",Cr="SET_APP_LOCALE",Sr="CREATE_DATA_OBJECT",_r="DELETE_DATA_OBJECT",Nr="VIEW_DATA_OBJECT",Tr="UPDATE_DATA_OBJECT",Dr="OPEN_DATA_OBJECT_ACTION",Pr="SUBMIT_DATA_OBJECT_ACTION",Or="OPEN_EMBEDDED_DATA_MODAL",Rr="GET_EMBEDDED_DATA_VIEW",br="SUBMIT_EMBEDDED_DATA_MODAL",vr="SUBMIT_SUBSCRIPT",xr="FILL_FORM_WITH_AI",wr="createWork",Mr="openAssignment",Lr="openCase",Ur="EXECUTE_OBJECT_WIDE_ACTION",Fr="CREATE_EXTERNAL_CASE",Vr="DELETE_WORK",jr="createObject",kr="getObject",Br="getObjectWideAction",$r="createExternalObject",Gr="retrieveActionViewForNewCase",Wr=(e,t)=>{if(!e||!t)return null;let n,s=Gs.EMPTY_STRING;return t&&(s=`${t}${Gs.FORWARD_SLASH_STRING}${e}`,n=LE(s),n||t.includes("/")?n||(s=Wr(e,Ks(t))):s=`${t}${Gs.FORWARD_SLASH_STRING}${e}`),s},Hr=(e,t)=>{const n=Wr(e,t);return n&&LE(n)?LE(n):{}},qr=(e,t)=>By.getSemanticURL(Ka,{page:e},t);class zr{constructor(e,t,n){this._grammar=e,this._state="expectOperand",this._exprStr=t||"",this._endState=n||{},this._subParser=null}static _setParent(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}_addToken(e){const t=no[this._state],n=this._exprStr;if(this._exprStr+=e.element,t.subHandler){this._subParser||this._startSubExpression(n);const t=this._subParser?._addToken(e);t&&(this._endSubExpression(),this._state=t)}else{if(!t.operatorTypes?.[e.tokenType]){if(this._endState[e.tokenType])return this._endState[e.tokenType];throw new Error(`Token ${e.element} (${e.tokenType}) unexpected in expression: ${this._exprStr}`)}{const n=t.operatorTypes[e.tokenType],s=to[e.tokenType];s&&s.call(this,e),n.toState&&(this._state=n.toState)}}return!1}addTokens(e){e.forEach(this._addToken,this)}buildAst(){return this._subParser&&this._endSubExpression(),this._state="complete",this._position?this._tree:null}_startSubExpression(e){const{endStates:t}=no[this._state];this._subParser=new zr(this._grammar,e,t)}_endSubExpression(){no[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,zr._setParent(e,this._position)):this._tree=e,this._position=e}}const Yr=zr,Kr="identifier",Qr={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&(e&&t)},Jr={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&(e||t)},Xr=(e,t,n)=>{const s=""===e,a=""===t||null==t;if(s&&a)return n;if("boolean"==typeof t){const a=!!(!s&&"false"!==e&&"0"!==e)&&Boolean(e);return n?a===t:a!==t}return s!==a?!n:n?e===t:e!==t},Zr={">":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>t},">=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>=t},"<":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<t},"<=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<=t},"==":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&Xr(e,t,!0)},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>"object"==typeof e||"object"==typeof t||Xr(e,t,!1)},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{const t="object"==typeof e?e.value:e;return"true"===t||"false"===t?"true"!==t:!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":Qr,AND:Qr,and:Qr,"||":Jr,OR:Jr,or:Jr,CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).includes(String(t))},NOT_CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).includes(String(t))},STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).startsWith(String(t))},NOT_STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).startsWith(String(t))},ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).endsWith(String(t))},NOT_ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).endsWith(String(t))},IS_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!e},IS_NOT_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!!e},IS_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(t).split(",").includes(String(e))},IS_NOT_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(t).split(",").includes(String(e))}},eo={BinaryExpression:function(e){const t=[],n=e.right,s=e.operator??"",a=e.left;if(!a)return!1;let r="boolean"==typeof a.value?"True-False":"";t[0]=this.evaluateAST(a),r||a.operationType!==Kr||(r=((e,t,n)=>{if("string"!=typeof e.value)return"";const s=e.value.substring(1),a=t?.getFieldMetadata(s)?.type??"";if(a)return a;const{pageReference:r,context:o}=n??{};if(!r||!o)return"";const i=NC.resolveClassID(e.value,r,o),c=SA(s,i);return c&&!Array.isArray(c)?c.type??"":""})(a,this._context,this._contextTreeNodeContext)),t[1]=n?this.evaluateAST(n,r):"";const o=this._grammar[s];return!!o?.evaluate&&o.evaluate(t[0],t[1])},identifier:function(e){const t="string"==typeof e.value?e.value:"";if(this._localDataObject)return AC.getIn(this._localDataObject,t?t.substring(1).split("."):[])??"";if(this._contextTreeNodeContext)return NC.getLitePropertyValue(this._contextTreeNodeContext,t)??"";if(!this._context)return"";const n=this._context.getFieldMetadata(t)?.type??"",s=this._context.getValue(t)??"";if("Decimal"===n&&"string"==typeof s){const e=parseFloat(s);return Number.isNaN(e)?"":e}return s},literal:function(e,t){return!(void 0===t||""===t||"True-False"===t)||"true"!==e.value&&"false"!==e.value?e.value??"":"true"===e.value},UnaryExpression:function(e){const t=e.operator,n=e.right;if(!t||!n)return!1;const s=this._grammar[t];return!!s?.evaluate&&s.evaluate(n)}},to={unaryOperator:function(e){this.setPositionInAST({operationType:"UnaryExpression",operator:String(e.value)})},binaryOperator:function(e){const t=String(e.value),{precedence:n}=this._grammar[t];let s=this._position._parent;const a=s?s.operator:null,r=a?this._grammar[a]:null,o=r?r.precedence:null;if(o&&n)for(;s?.operator&&o>=n;)this._position=s,s=s._parent;const i={operationType:"BinaryExpression",operator:t,left:this._position};Yr._setParent(this._position,i),s?(this._position=s,this.setPositionInAST(i)):(this._tree=i,this._position=i)},identifier:function(e){const t={operationType:Kr,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){var t;"object"==typeof(t=e)&&null!==t&&"operationType"in t&&this.setPositionInAST(e)}},no={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:Kr},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:to.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},so=["binaryOperator","unaryOperator","openParenthesis"],ao=/^\s*$/,ro=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,oo=/\\\\/,io=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],co=["[a-zA-Z_.$][a-zA-Z0-9_.$]*(?:\\(\\d+\\))?(?:\\.[a-zA-Z0-9_.$]+)*","[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}|[0-9]{4}-[0-9]{2}-[0-9]{2}","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],lo=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class uo{constructor(e){this._grammar=e}static _isNegative(e){return so.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(ao)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(ro)&&(e=`\\b${e}\\b`),e}static _unquote(e){const[t]=e,n=new RegExp(`\\\\${t}`,"g");return e.substr(1,e.length-2).replace(n,t).replace(oo,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>uo._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[io.join("|"),e.join("|"),co.join("|")].join("|")})`)}return this._splitRegex}_splitExpression(e){const t=this._getSplitRegex();return e.split(t).filter((e=>e.trim()))}_createToken(e){const t={tokenType:"literal",value:e,element:e};return e.startsWith('"')||e.startsWith("'")?t.value=uo._unquote(e):e.match(lo)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(ro)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let s=0;s<e.length;s+=1)uo._isWhitespace(e[s])?t.length&&(t[t.length-1].element+=e[s]):"-"===e[s]&&uo._isNegative(t)?n=!0:(n&&(e[s]=`-${e[s]}`,n=!1),t.push(this._createToken(e[s])));return t}tokenize(e){const t=this._splitExpression(e);return this._getTokens(t)}}const po=uo;const go=class{constructor(e,t){this._grammar={...Zr},this._expression=e,this._ast=null,this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new po(this._grammar).tokenize(this._expression),t=new Yr(this._grammar);return t.addTokens(e),this._ast=t.buildAst(),this}evaluate(e,t){return this._context=e,this._contextTreeNodeContext=t,this.evaluateAST(this._ast)}evaluateAST(e,t){return Eo(e.operationType,eo)&&eo[e.operationType].call(this,e,t)}},ho=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new go(n,t)},fo=e=>!e||e.buildAST(),mo=(e,t,n)=>!e||e.evaluate(t,n),Io=(e,t,n)=>{const s=ho(e,t),a=fo(s);return mo(a,n)},Eo=(e,t)=>e in t;const yo=class{static handleExpression(e,t,n,s){const a=this.getContext(e,s);dn({actionObject:{action:"decexp",params:{source:e,value:t,targets:n},context:a}}).then((e=>e.json())).then((e=>{this.updateState(e,s)})).catch((e=>window.console.log(e)))}static getContext(e,t){const n=e.substring(0,e.indexOf("."));return{name:n,class:NC.getPropertyValue(`${n}.${ks.getDefaultQualifiedName("pxObjClass")}`,null,t)||NC.getPropertyValue(`${n}.${ks.getDefaultQualifiedName("pyClassName")}`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>sC({type:sa,payload:{context:t,reference:n,value:e[n]}})))}},Ao={},Co=(e,t)=>Ao[t]&&Object.hasOwn(Ao[t],e),So=e=>{const{context:t}=e;Co(e.reference,t)&&yo.handleExpression(e.reference,e.value,Ao[t][e.reference],t)},_o=(e={})=>{AC.copy(e,Ao)},No=(e,t,n)=>Io(e,t,n?.pConnect.getPConnect());const To=new class{constructor(){this._dataSourceMap={}}hasContextName(e){return e in this._dataSourceMap}addContextName(e,t){t&&Object.keys(t).length>0?this._dataSourceMap[e]=t:this._dataSourceMap[e]={}}getContextObjectByName(e){return e in this._dataSourceMap?this._dataSourceMap[e]:null}deleteContextName(e){this.hasContextName(e)&&delete this._dataSourceMap[e]}addOrUpdatePropertyInContext(e,t,n){if(this.hasContextName(e)){const s=this.getContextObjectByName(e);if(s)if(Array.isArray(n))s[t]=n;else{const e=s[t];s[t]=[...new Set([...e,n])]}}else{const s={};Array.isArray(n)?s[t]=n:s[t]=[n],this.addContextName(e,s)}}deletePropertyInContext(e,t){if(this.hasContextName(e)){const n=this.getContextObjectByName(e);n&&t in n&&delete n[t]}}getPropertyFromContext(e,t){if(this.hasContextName(e)){const n=this.getContextObjectByName(e);if(n&&t in n)return n[t]}return[]}getDependencies(e,t){const n=this.getPropertyFromContext(e,t),s=new Set(n);return n.forEach((e=>{s.add(e)})),[...s]}};const Do=new class{constructor(){this.componentMap={},this.overrideMap={},this.lazyMap={},this.customComponentLazyMap={}}register(e,t){this.componentMap[e]=t}registerLazyMap(e,t){this.lazyMap[e]=t}registerCustomComponentLazyMap(e,t){this.customComponentLazyMap[e]=t}getComponent(e){return this.componentMap[e]}getLazyComponent(e){return this.lazyMap[e]}getCustomComponent(e){return this.customComponentLazyMap[e]}mergeComponentsMap(e={}){AC.copy(e,this.componentMap)}mergeOverrideMap(e={}){AC.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const Po=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}},Oo=/^@\w+\s+(.+)$/s;const Ro=class{static handleAnnotation(e,t,n){const s=e.indexOf(" "),a=-1===s?e:e.substring(0,s),r=Po.getHandler(a);if(!r)return e;const o=e.match(Oo);return r((o?o[1]:"").trim(),t,n)}static trimAnnotation(e){if("string"!=typeof e)return e;const t=e.indexOf(" "),n=e.substring(0,t),s=e.substring(t+1);return Po.getHandler(n)?s:e}static handleComponentMapping(e,t,n){const s=Do.getComponent(t.type);if(!s?.mapping)return;const a=s.mapping(t.config);if(a&&a["@map"]){const t=a["@map"],{source:s}=t;if(!s)return;const r=n.getValue(s);if("function"==typeof t.advanced)t.advanced(e,r);else{const n=t.inputs_map;e[t.output_property]=[];const s=e[t.output_property];r.forEach((e=>{const t={};Object.keys(n).forEach((s=>{let a=n[s];a?.startsWith(".")?(a=a.substring(1),t[s]=e[a]):t[s]=a})),s.push(t)}))}}}static getPropertyName(e=""){if(e&&AC.isString(e)){const t=e.startsWith(Gs.PROPERTY_ANNOTATION)||e.startsWith(Gs.ATTACHMENT_ANNOTATION)||e.startsWith(Gs.ASSOCIATED_PROPERTY_ANNOTATION)||e.startsWith(Gs.CLASS_ASSOCIATION_ANNOTATION)||e.startsWith(Gs.FILTERED_LIST_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(AC.isString(e)&&!!e?.startsWith(Gs.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return AC.isString(e)&&!!e?.startsWith(Gs.PROPERTY_ANNOTATION)}};function bo(e,t){return function(){return e.apply(t,arguments)}}const{toString:vo}=Object.prototype,{getPrototypeOf:xo}=Object,{iterator:wo,toStringTag:Mo}=Symbol,Lo=(Uo=Object.create(null),e=>{const t=vo.call(e);return Uo[t]||(Uo[t]=t.slice(8,-1).toLowerCase())});var Uo;const Fo=e=>(e=e.toLowerCase(),t=>Lo(t)===e),Vo=e=>t=>typeof t===e,{isArray:jo}=Array,ko=Vo("undefined");function Bo(e){return null!==e&&!ko(e)&&null!==e.constructor&&!ko(e.constructor)&&Wo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $o=Fo("ArrayBuffer");const Go=Vo("string"),Wo=Vo("function"),Ho=Vo("number"),qo=e=>null!==e&&"object"==typeof e,zo=e=>{if("object"!==Lo(e))return!1;const t=xo(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Mo in e||wo in e)},Yo=Fo("Date"),Ko=Fo("File"),Qo=Fo("Blob"),Jo=Fo("FileList");const Xo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Zo=void 0!==Xo.FormData?Xo.FormData:void 0,ei=Fo("URLSearchParams"),[ti,ni,si,ai]=["ReadableStream","Request","Response","Headers"].map(Fo);function ri(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let s,a;if("object"!=typeof e&&(e=[e]),jo(e))for(s=0,a=e.length;s<a;s++)t.call(null,e[s],s,e);else{if(Bo(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),r=a.length;let o;for(s=0;s<r;s++)o=a[s],t.call(null,e[o],o,e)}}function oi(e,t){if(Bo(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s,a=n.length;for(;a-- >0;)if(s=n[a],t===s.toLowerCase())return s;return null}const ii="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ci=e=>!ko(e)&&e!==ii;const li=(ui="undefined"!=typeof Uint8Array&&xo(Uint8Array),e=>ui&&e instanceof ui);var ui;const di=Fo("HTMLFormElement"),pi=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),gi=Fo("RegExp"),hi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};ri(n,((n,a)=>{let r;!1!==(r=t(n,a,e))&&(s[a]=r||n)})),Object.defineProperties(e,s)};const fi=Fo("AsyncFunction"),mi=(Ii="function"==typeof setImmediate,Ei=Wo(ii.postMessage),Ii?setImmediate:Ei?(yi=`axios@${Math.random()}`,Ai=[],ii.addEventListener("message",(({source:e,data:t})=>{e===ii&&t===yi&&Ai.length&&Ai.shift()()}),!1),e=>{Ai.push(e),ii.postMessage(yi,"*")}):e=>setTimeout(e));var Ii,Ei,yi,Ai;const Ci="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ii):"undefined"!=typeof process&&process.nextTick||mi,Si={isArray:jo,isArrayBuffer:$o,isBuffer:Bo,isFormData:e=>{if(!e)return!1;if(Zo&&e instanceof Zo)return!0;const t=xo(e);if(!t||t===Object.prototype)return!1;if(!Wo(e.append))return!1;const n=Lo(e);return"formdata"===n||"object"===n&&Wo(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$o(e.buffer),t},isString:Go,isNumber:Ho,isBoolean:e=>!0===e||!1===e,isObject:qo,isPlainObject:zo,isEmptyObject:e=>{if(!qo(e)||Bo(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ti,isRequest:ni,isResponse:si,isHeaders:ai,isUndefined:ko,isDate:Yo,isFile:Ko,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:Qo,isRegExp:gi,isFunction:Wo,isStream:e=>qo(e)&&Wo(e.pipe),isURLSearchParams:ei,isTypedArray:li,isFileList:Jo,forEach:ri,merge:function e(...t){const{caseless:n,skipUndefined:s}=ci(this)&&this||{},a={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=n&&oi(a,r)||r,i=pi(a,o)?a[o]:void 0;zo(i)&&zo(t)?a[o]=e(i,t):zo(t)?a[o]=e({},t):jo(t)?a[o]=t.slice():s&&ko(t)||(a[o]=t)};for(let e=0,n=t.length;e<n;e++)t[e]&&ri(t[e],r);return a},extend:(e,t,n,{allOwnKeys:s}={})=>(ri(t,((t,s)=>{n&&Wo(t)?Object.defineProperty(e,s,{__proto__:null,value:bo(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:s}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,s)=>{let a,r,o;const i={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),r=a.length;r-- >0;)o=a[r],s&&!s(o,e,t)||i[o]||(t[o]=e[o],i[o]=!0);e=!1!==n&&xo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Lo,kindOfTest:Fo,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return-1!==s&&s===n},toArray:e=>{if(!e)return null;if(jo(e))return e;let t=e.length;if(!Ho(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[wo]).call(e);let s;for(;(s=n.next())&&!s.done;){const n=s.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const s=[];for(;null!==(n=e.exec(t));)s.push(n);return s},isHTMLForm:di,hasOwnProperty:pi,hasOwnProp:pi,reduceDescriptors:hi,freezeMethods:e=>{hi(e,((t,n)=>{if(Wo(e)&&["arguments","caller","callee"].includes(n))return!1;const s=e[n];Wo(s)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},s=e=>{e.forEach((e=>{n[e]=!0}))};return jo(e)?s(e):s(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:oi,global:ii,isContextDefined:ci,isSpecCompliantForm:function(e){return!!(e&&Wo(e.append)&&"FormData"===e[Mo]&&e[wo])},toJSONObject:e=>{const t=new Array(10),n=(e,s)=>{if(qo(e)){if(t.indexOf(e)>=0)return;if(Bo(e))return e;if(!("toJSON"in e)){t[s]=e;const a=jo(e)?[]:{};return ri(e,((e,t)=>{const r=n(e,s+1);!ko(r)&&(a[t]=r)})),t[s]=void 0,a}}return e};return n(e,0)},isAsyncFn:fi,isThenable:e=>e&&(qo(e)||Wo(e))&&Wo(e.then)&&Wo(e.catch),setImmediate:mi,asap:Ci,isIterable:e=>null!=e&&Wo(e[wo])},_i=Si.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ni=Symbol("internals"),Ti=/[^\x09\x20-\x7E\x80-\xFF]/g;function Di(e){return e&&String(e).trim().toLowerCase()}function Pi(e){return!1===e||null==e?e:Si.isArray(e)?e.map(Pi):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(Ti,""))}function Oi(e,t,n,s,a){return Si.isFunction(s)?s.call(this,t,n):(a&&(t=n),Si.isString(t)?Si.isString(s)?-1!==t.indexOf(s):Si.isRegExp(s)?s.test(t):void 0:void 0)}class Ri{constructor(e){e&&this.set(e)}set(e,t,n){const s=this;function a(e,t,n){const a=Di(t);if(!a)throw new Error("header name must be a non-empty string");const r=Si.findKey(s,a);(!r||void 0===s[r]||!0===n||void 0===n&&!1!==s[r])&&(s[r||t]=Pi(e))}const r=(e,t)=>Si.forEach(e,((e,n)=>a(e,n,t)));if(Si.isPlainObject(e)||e instanceof this.constructor)r(e,t);else if(Si.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))r((e=>{const t={};let n,s,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),s=e.substring(a+1).trim(),!n||t[n]&&_i[n]||("set-cookie"===n?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)})),t})(e),t);else if(Si.isObject(e)&&Si.isIterable(e)){let n,s,a={};for(const t of e){if(!Si.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[s=t[0]]=(n=a[s])?Si.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}r(a,t)}else null!=e&&a(t,e,n);return this}get(e,t){if(e=Di(e)){const n=Si.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}(e);if(Si.isFunction(t))return t.call(this,e,n);if(Si.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Di(e)){const n=Si.findKey(this,e);return!(!n||void 0===this[n]||t&&!Oi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let s=!1;function a(e){if(e=Di(e)){const a=Si.findKey(n,e);!a||t&&!Oi(0,n[a],a,t)||(delete n[a],s=!0)}}return Si.isArray(e)?e.forEach(a):a(e),s}clear(e){const t=Object.keys(this);let n=t.length,s=!1;for(;n--;){const a=t[n];e&&!Oi(0,this[a],a,e,!0)||(delete this[a],s=!0)}return s}normalize(e){const t=this,n={};return Si.forEach(this,((s,a)=>{const r=Si.findKey(n,a);if(r)return t[r]=Pi(s),void delete t[a];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(a):String(a).trim();o!==a&&delete t[a],t[o]=Pi(s),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Si.forEach(this,((n,s)=>{null!=n&&!1!==n&&(t[s]=e&&Si.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Ni]=this[Ni]={accessors:{}}).accessors,n=this.prototype;function s(e){const s=Di(e);t[s]||(!function(e,t){const n=Si.toCamelCase(" "+t);["get","set","has"].forEach((s=>{Object.defineProperty(e,s+n,{__proto__:null,value:function(e,n,a){return this[s].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[s]=!0)}return Si.isArray(e)?e.forEach(s):s(e),this}}Ri.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Si.reduceDescriptors(Ri.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Si.freezeMethods(Ri);const bi=Ri;function vi(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),s=[],a=e=>{if(null===e||"object"!=typeof e)return e;if(Si.isBuffer(e))return e;if(-1!==s.indexOf(e))return;let t;if(e instanceof bi&&(e=e.toJSON()),s.push(e),Si.isArray(e))t=[],e.forEach(((e,n)=>{const s=a(e);Si.isUndefined(s)||(t[n]=s)}));else{if(!Si.isPlainObject(e)&&function(e){if(Si.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Si.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return s.pop(),e;t=Object.create(null);for(const[s,r]of Object.entries(e)){const e=n.has(s.toLowerCase())?"[REDACTED ****]":a(r);Si.isUndefined(e)||(t[s]=e)}}return s.pop(),t};return a(e)}class xi extends Error{static from(e,t,n,s,a,r){const o=new xi(e.message,t||e.code,n,s,a);return o.cause=e,o.name=e.name,null!=e.status&&null==o.status&&(o.status=e.status),r&&Object.assign(o,r),o}constructor(e,t,n,s,a){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),a&&(this.response=a,this.status=a.status)}toJSON(){const e=this.config,t=e&&Si.hasOwnProp(e,"redact")?e.redact:void 0,n=Si.isArray(t)&&t.length>0?vi(e,t):Si.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}xi.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",xi.ERR_BAD_OPTION="ERR_BAD_OPTION",xi.ECONNABORTED="ECONNABORTED",xi.ETIMEDOUT="ETIMEDOUT",xi.ECONNREFUSED="ECONNREFUSED",xi.ERR_NETWORK="ERR_NETWORK",xi.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",xi.ERR_DEPRECATED="ERR_DEPRECATED",xi.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",xi.ERR_BAD_REQUEST="ERR_BAD_REQUEST",xi.ERR_CANCELED="ERR_CANCELED",xi.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",xi.ERR_INVALID_URL="ERR_INVALID_URL",xi.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const wi=xi;function Mi(e){return Si.isPlainObject(e)||Si.isArray(e)}function Li(e){return Si.endsWith(e,"[]")?e.slice(0,-2):e}function Ui(e,t,n){return e?e.concat(t).map((function(e,t){return e=Li(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Fi=Si.toFlatObject(Si,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Vi=function(e,t,n){if(!Si.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const s=(n=Si.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Si.isUndefined(t[e])}))).metaTokens,a=n.visitor||d,r=n.dots,o=n.indexes,i=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,l=i&&Si.isSpecCompliantForm(t);if(!Si.isFunction(a))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Si.isDate(e))return e.toISOString();if(Si.isBoolean(e))return e.toString();if(!l&&Si.isBlob(e))throw new wi("Blob is not supported. Use a Buffer instead.");return Si.isArrayBuffer(e)||Si.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,a){let i=e;if(Si.isReactNative(t)&&Si.isReactNativeBlob(e))return t.append(Ui(a,n,r),u(e)),!1;if(e&&!a&&"object"==typeof e)if(Si.endsWith(n,"{}"))n=s?n:n.slice(0,-2),e=JSON.stringify(e);else if(Si.isArray(e)&&function(e){return Si.isArray(e)&&!e.some(Mi)}(e)||(Si.isFileList(e)||Si.endsWith(n,"[]"))&&(i=Si.toArray(e)))return n=Li(n),i.forEach((function(e,s){!Si.isUndefined(e)&&null!==e&&t.append(!0===o?Ui([n],s,r):null===o?n:n+"[]",u(e))})),!1;return!!Mi(e)||(t.append(Ui(a,n,r),u(e)),!1)}const p=[],g=Object.assign(Fi,{defaultVisitor:d,convertValue:u,isVisitable:Mi});if(!Si.isObject(e))throw new TypeError("data must be an object");return function e(n,s,r=0){if(!Si.isUndefined(n)){if(r>c)throw new wi("Object is too deeply nested ("+r+" levels). Max depth: "+c,wi.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(n))throw Error("Circular reference detected in "+s.join("."));p.push(n),Si.forEach(n,(function(n,o){!0===(!(Si.isUndefined(n)||null===n)&&a.call(t,n,Si.isString(o)?o.trim():o,s,g))&&e(n,s?s.concat(o):[o],r+1)})),p.pop()}}(e),t};function ji(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function ki(e,t){this._pairs=[],e&&Vi(e,this,t)}const Bi=ki.prototype;Bi.append=function(e,t){this._pairs.push([e,t])},Bi.toString=function(e){const t=e?function(t){return e.call(this,t,ji)}:ji;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const $i=ki;function Gi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Wi(e,t,n){if(!t)return e;const s=n&&n.encode||Gi,a=Si.isFunction(n)?{serialize:n}:n,r=a&&a.serialize;let o;if(o=r?r(t,a):Si.isURLSearchParams(t)?t.toString():new $i(t,a).toString(s),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const Hi=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Si.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},qi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},zi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:$i,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Yi="undefined"!=typeof window&&"undefined"!=typeof document,Ki="object"==typeof navigator&&navigator||void 0,Qi=Yi&&(!Ki||["ReactNative","NativeScript","NS"].indexOf(Ki.product)<0),Ji="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Xi=Yi&&window.location.href||"http://localhost",Zi={...l,...zi};const ec=function(e){function t(e,n,s,a){let r=e[a++];if("__proto__"===r)return!0;const o=Number.isFinite(+r),i=a>=e.length;if(r=!r&&Si.isArray(s)?s.length:r,i)return Si.hasOwnProp(s,r)?s[r]=Si.isArray(s[r])?s[r].concat(n):[s[r],n]:s[r]=n,!o;s[r]&&Si.isObject(s[r])||(s[r]=[]);return t(e,n,s[r],a)&&Si.isArray(s[r])&&(s[r]=function(e){const t={},n=Object.keys(e);let s;const a=n.length;let r;for(s=0;s<a;s++)r=n[s],t[r]=e[r];return t}(s[r])),!o}if(Si.isFormData(e)&&Si.isFunction(e.entries)){const n={};return Si.forEachEntry(e,((e,s)=>{t(function(e){return Si.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),s,n,0)})),n}return null},tc=(e,t)=>null!=e&&Si.hasOwnProp(e,t)?e[t]:void 0;const nc={transitional:qi,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",s=n.indexOf("application/json")>-1,a=Si.isObject(e);a&&Si.isHTMLForm(e)&&(e=new FormData(e));if(Si.isFormData(e))return s?JSON.stringify(ec(e)):e;if(Si.isArrayBuffer(e)||Si.isBuffer(e)||Si.isStream(e)||Si.isFile(e)||Si.isBlob(e)||Si.isReadableStream(e))return e;if(Si.isArrayBufferView(e))return e.buffer;if(Si.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(a){const t=tc(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Vi(e,new Zi.classes.URLSearchParams,{visitor:function(e,t,n,s){return Zi.isNode&&Si.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((r=Si.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=tc(this,"env"),s=n&&n.FormData;return Vi(r?{"files[]":e}:e,s&&new s,t)}}return a||s?(t.setContentType("application/json",!1),function(e,t,n){if(Si.isString(e))try{return(t||JSON.parse)(e),Si.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=tc(this,"transitional")||nc.transitional,n=t&&t.forcedJSONParsing,s=tc(this,"responseType"),a="json"===s;if(Si.isResponse(e)||Si.isReadableStream(e))return e;if(e&&Si.isString(e)&&(n&&!s||a)){const n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,tc(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw wi.from(e,wi.ERR_BAD_RESPONSE,this,null,tc(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Zi.classes.FormData,Blob:Zi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Si.forEach(["delete","get","head","post","put","patch","query"],(e=>{nc.headers[e]={}}));const sc=nc;function ac(e,t){const n=this||sc,s=t||n,a=bi.from(s.headers);let r=s.data;return Si.forEach(e,(function(e){r=e.call(n,r,a.normalize(),t?t.status:void 0)})),a.normalize(),r}function rc(e){return!(!e||!e.__CANCEL__)}const oc=class extends wi{constructor(e,t,n){super(null==e?"canceled":e,wi.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function ic(e,t,n){const s=n.config.validateStatus;n.status&&s&&!s(n.status)?t(new wi("Request failed with status code "+n.status,n.status>=400&&n.status<500?wi.ERR_BAD_REQUEST:wi.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const cc=function(e,t){e=e||10;const n=new Array(e),s=new Array(e);let a,r=0,o=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=s[o];a||(a=c),n[r]=i,s[r]=c;let u=o,d=0;for(;u!==r;)d+=n[u++],u%=e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),c-a<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}};const lc=function(e,t){let n,s,a=0,r=1e3/t;const o=(t,r=Date.now())=>{a=r,n=null,s&&(clearTimeout(s),s=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-a;i>=r?o(e,t):(n=e,s||(s=setTimeout((()=>{s=null,o(n)}),r-i)))},()=>n&&o(n)]},uc=(e,t,n=3)=>{let s=0;const a=cc(50,250);return lc((n=>{const r=n.loaded,o=n.lengthComputable?n.total:void 0,i=null!=o?Math.min(r,o):r,c=Math.max(0,i-s),l=a(c);s=Math.max(s,i);e({loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-i)/l:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},dc=(e,t)=>{const n=null!=e;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},pc=e=>(...t)=>Si.asap((()=>e(...t))),gc=Zi.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Zi.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Zi.origin),Zi.navigator&&/(msie|trident)/i.test(Zi.navigator.userAgent)):()=>!0,hc=Zi.hasStandardBrowserEnv?{write(e,t,n,s,a,r,o){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];Si.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),Si.isString(s)&&i.push(`path=${s}`),Si.isString(a)&&i.push(`domain=${a}`),!0===r&&i.push("secure"),Si.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const s=t[n].replace(/^\s+/,""),a=s.indexOf("=");if(-1!==a&&s.slice(0,a)===e)return decodeURIComponent(s.slice(a+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function fc(e,t,n){let s=!("string"==typeof(a=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a));var a;return e&&(s||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const mc=e=>e instanceof bi?{...e}:e;function Ic(e,t){t=t||{};const n=Object.create(null);function s(e,t,n,s){return Si.isPlainObject(e)&&Si.isPlainObject(t)?Si.merge.call({caseless:s},e,t):Si.isPlainObject(t)?Si.merge({},t):Si.isArray(t)?t.slice():t}function a(e,t,n,a){return Si.isUndefined(t)?Si.isUndefined(e)?void 0:s(void 0,e,0,a):s(e,t,0,a)}function r(e,t){if(!Si.isUndefined(t))return s(void 0,t)}function o(e,t){return Si.isUndefined(t)?Si.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function i(n,a,r){return Si.hasOwnProp(t,r)?s(n,a):Si.hasOwnProp(e,r)?s(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>a(mc(e),mc(t),0,!0)};return Si.forEach(Object.keys({...e,...t}),(function(s){if("__proto__"===s||"constructor"===s||"prototype"===s)return;const r=Si.hasOwnProp(c,s)?c[s]:a,o=r(Si.hasOwnProp(e,s)?e[s]:void 0,Si.hasOwnProp(t,s)?t[s]:void 0,s);Si.isUndefined(o)&&r!==i||(n[s]=o)})),n}const Ec=["content-type","content-length"];const yc=e=>{const t=Ic({},e),n=e=>Si.hasOwnProp(t,e)?t[e]:void 0,s=n("data");let a=n("withXSRFToken");const r=n("xsrfHeaderName"),o=n("xsrfCookieName");let i=n("headers");const c=n("auth"),l=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");var p;if(t.headers=i=bi.from(i),t.url=Wi(fc(l,d,u),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?(p=c.password,encodeURIComponent(p).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))):""))),Si.isFormData(s)&&(Zi.hasStandardBrowserEnv||Zi.hasStandardBrowserWebWorkerEnv?i.setContentType(void 0):Si.isFunction(s.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t).forEach((([t,n])=>{Ec.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(i,s.getHeaders(),n("formDataHeaderPolicy"))),Zi.hasStandardBrowserEnv){Si.isFunction(a)&&(a=a(t));if(!0===a||null==a&&gc(t.url)){const e=r&&o&&hc.read(o);e&&i.set(r,e)}}return t},Ac="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const s=yc(e);let a=s.data;const r=bi.from(s.headers).normalize();let o,i,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:g}=s;function h(){l&&l(),u&&u(),s.cancelToken&&s.cancelToken.unsubscribe(o),s.signal&&s.signal.removeEventListener("abort",o)}let f=new XMLHttpRequest;function m(){if(!f)return;const s=bi.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());ic((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:s,config:e,request:f}),f=null}f.open(s.method.toUpperCase(),s.url,!0),f.timeout=s.timeout,"onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&f.responseURL.startsWith("file:"))&&setTimeout(m)},f.onabort=function(){f&&(n(new wi("Request aborted",wi.ECONNABORTED,e,f)),h(),f=null)},f.onerror=function(t){const s=t&&t.message?t.message:"Network Error",a=new wi(s,wi.ERR_NETWORK,e,f);a.event=t||null,n(a),h(),f=null},f.ontimeout=function(){let t=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const a=s.transitional||qi;s.timeoutErrorMessage&&(t=s.timeoutErrorMessage),n(new wi(t,a.clarifyTimeoutError?wi.ETIMEDOUT:wi.ECONNABORTED,e,f)),h(),f=null},void 0===a&&r.setContentType(null),"setRequestHeader"in f&&Si.forEach(r.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),Si.isUndefined(s.withCredentials)||(f.withCredentials=!!s.withCredentials),d&&"json"!==d&&(f.responseType=s.responseType),g&&([c,u]=uc(g,!0),f.addEventListener("progress",c)),p&&f.upload&&([i,l]=uc(p),f.upload.addEventListener("progress",i),f.upload.addEventListener("loadend",l)),(s.cancelToken||s.signal)&&(o=t=>{f&&(n(!t||t.type?new oc(null,e,f):t),f.abort(),h(),f=null)},s.cancelToken&&s.cancelToken.subscribe(o),s.signal&&(s.signal.aborted?o():s.signal.addEventListener("abort",o)));const I=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(s.url);!I||Zi.protocols.includes(I)?f.send(a||null):n(new wi("Unsupported protocol "+I+":",wi.ERR_BAD_REQUEST,e))}))},Cc=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,s=new AbortController;const a=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;s.abort(t instanceof wi?t:new oc(t instanceof Error?t.message:t))}};let r=t&&setTimeout((()=>{r=null,a(new wi(`timeout of ${t}ms exceeded`,wi.ETIMEDOUT))}),t);const o=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)})),e=null)};e.forEach((e=>e.addEventListener("abort",a)));const{signal:i}=s;return i.unsubscribe=()=>Si.asap(o),i}},Sc=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let s,a=0;for(;a<n;)s=a+t,yield e.slice(a,s),a=s},_c=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Nc=(e,t,n,s)=>{const a=async function*(e,t){for await(const n of _c(e))yield*Sc(n,t)}(e,t);let r,o=0,i=e=>{r||(r=!0,s&&s(e))};return new ReadableStream({async pull(e){try{const{done:t,value:s}=await a.next();if(t)return i(),void e.close();let r=s.byteLength;if(n){let e=o+=r;n(e)}e.enqueue(new Uint8Array(s))}catch(e){throw i(e),e}},cancel:e=>(i(e),a.return())},{highWaterMark:2})};const Tc="1.16.0",{isFunction:Dc}=Si,Pc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Oc=e=>{const t=Si.global??globalThis,{ReadableStream:n,TextEncoder:s}=t;e=Si.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:r,Response:o}=e,i=a?Dc(a):"function"==typeof fetch,c=Dc(r),l=Dc(o);if(!i)return!1;const u=i&&Dc(n),d=i&&("function"==typeof s?(p=new s,e=>p.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var p;const g=c&&u&&Pc((()=>{let e=!1;const t=new r(Zi.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),s=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!s})),h=l&&u&&Pc((()=>Si.isReadableStream(new o("").body))),f={stream:h&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!f[e]&&(f[e]=(t,n)=>{let s=t&&t[e];if(s)return s.call(t);throw new wi(`Response type '${e}' is not supported`,wi.ERR_NOT_SUPPORT,n)})}));const m=async(e,t)=>{const n=Si.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Si.isBlob(e))return e.size;if(Si.isSpecCompliantForm(e)){const t=new r(Zi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Si.isArrayBufferView(e)||Si.isArrayBuffer(e)?e.byteLength:(Si.isURLSearchParams(e)&&(e+=""),Si.isString(e)?(await d(e)).byteLength:void 0)})(t):n};return async e=>{let{url:t,method:n,data:i,signal:l,cancelToken:u,timeout:d,onDownloadProgress:p,onUploadProgress:I,responseType:E,headers:y,withCredentials:A="same-origin",fetchOptions:C,maxContentLength:S,maxBodyLength:_}=yc(e);const N=Si.isNumber(S)&&S>-1,T=Si.isNumber(_)&&_>-1;let D=a||fetch;E=E?(E+"").toLowerCase():"text";let P=Cc([l,u&&u.toAbortSignal()],d),O=null;const R=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let b;try{if(N&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),s=e.slice(t+1);if(/;base64/i.test(n)){let e=s.length;const t=s.length;for(let n=0;n<t;n++)if(37===s.charCodeAt(n)&&n+2<t){const t=s.charCodeAt(n+1),a=s.charCodeAt(n+2);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102)&&(e-=2,n+=2)}let n=0,a=t-1;const r=e=>e>=2&&37===s.charCodeAt(e-2)&&51===s.charCodeAt(e-1)&&(68===s.charCodeAt(e)||100===s.charCodeAt(e));a>=0&&(61===s.charCodeAt(a)?(n++,a--):r(a)&&(n++,a-=3)),1===n&&a>=0&&(61===s.charCodeAt(a)||r(a))&&n++;const o=3*Math.floor(e/4)-(n||0);return o>0?o:0}if("undefined"!=typeof Buffer&&"function"==typeof Buffer.byteLength)return Buffer.byteLength(s,"utf8");let a=0;for(let e=0,t=s.length;e<t;e++){const n=s.charCodeAt(e);if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=s.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a}(t);if(n>S)throw new wi("maxContentLength size of "+S+" exceeded",wi.ERR_BAD_RESPONSE,e,O)}if(T&&"get"!==n&&"head"!==n){const t=await m(y,i);if("number"==typeof t&&isFinite(t)&&t>_)throw new wi("Request body larger than maxBodyLength limit",wi.ERR_BAD_REQUEST,e,O)}if(I&&g&&"get"!==n&&"head"!==n&&0!==(b=await m(y,i))){let e,n=new r(t,{method:"POST",body:i,duplex:"half"});if(Si.isFormData(i)&&(e=n.headers.get("content-type"))&&y.setContentType(e),n.body){const[e,t]=dc(b,uc(pc(I)));i=Nc(n.body,65536,e,t)}}Si.isString(A)||(A=A?"include":"omit");const a=c&&"credentials"in r.prototype;if(Si.isFormData(i)){const e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete("content-type")}y.set("User-Agent","axios/"+Tc,!1);const l={...C,signal:P,method:n.toUpperCase(),headers:y.normalize().toJSON(),body:i,duplex:"half",credentials:a?A:void 0};O=c&&new r(t,l);let u=await(c?D(O,C):D(t,l));if(N){const t=Si.toFiniteNumber(u.headers.get("content-length"));if(null!=t&&t>S)throw new wi("maxContentLength size of "+S+" exceeded",wi.ERR_BAD_RESPONSE,e,O)}const d=h&&("stream"===E||"response"===E);if(h&&u.body&&(p||N||d&&R)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=u[e]}));const n=Si.toFiniteNumber(u.headers.get("content-length")),[s,a]=p&&dc(n,uc(pc(p),!0))||[];let r=0;const i=t=>{if(N&&(r=t,r>S))throw new wi("maxContentLength size of "+S+" exceeded",wi.ERR_BAD_RESPONSE,e,O);s&&s(t)};u=new o(Nc(u.body,65536,i,(()=>{a&&a(),R&&R()})),t)}E=E||"text";let v=await f[Si.findKey(f,E)||"text"](u,e);if(N&&!h&&!d){let t;if(null!=v&&("number"==typeof v.byteLength?t=v.byteLength:"number"==typeof v.size?t=v.size:"string"==typeof v&&(t="function"==typeof s?(new s).encode(v).byteLength:v.length)),"number"==typeof t&&t>S)throw new wi("maxContentLength size of "+S+" exceeded",wi.ERR_BAD_RESPONSE,e,O)}return!d&&R&&R(),await new Promise(((t,n)=>{ic(t,n,{data:v,headers:bi.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:O})}))}catch(t){if(R&&R(),P&&P.aborted&&P.reason instanceof wi){const n=P.reason;throw n.config=e,O&&(n.request=O),t!==n&&(n.cause=t),n}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new wi("Network Error",wi.ERR_NETWORK,e,O,t&&t.response),{cause:t.cause||t});throw wi.from(t,t&&t.code,e,O,t&&t.response)}}},Rc=new Map,bc=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:a}=t,r=[s,a,n];let o,i,c=r.length,l=Rc;for(;c--;)o=r[c],i=l.get(o),void 0===i&&l.set(o,i=c?new Map:Oc(t)),l=i;return i},vc=(bc(),{http:null,xhr:Ac,fetch:{get:bc}});Si.forEach(vc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const xc=e=>`- ${e}`,wc=e=>Si.isFunction(e)||null===e||!1===e;const Mc={getAdapter:function(e,t){e=Si.isArray(e)?e:[e];const{length:n}=e;let s,a;const r={};for(let o=0;o<n;o++){let n;if(s=e[o],a=s,!wc(s)&&(a=vc[(n=String(s)).toLowerCase()],void 0===a))throw new wi(`Unknown adapter '${n}'`);if(a&&(Si.isFunction(a)||(a=a.get(t))))break;r[n||"#"+o]=a}if(!a){const e=Object.entries(r).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(xc).join("\n"):" "+xc(e[0]):"as no adapter specified";throw new wi("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return a},adapters:vc};function Lc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new oc(null,e)}function Uc(e){Lc(e),e.headers=bi.from(e.headers),e.data=ac.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Mc.getAdapter(e.adapter||sc.adapter,e)(e).then((function(t){Lc(e),e.response=t;try{t.data=ac.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=bi.from(t.headers),t}),(function(t){if(!rc(t)&&(Lc(e),t&&t.response)){e.response=t.response;try{t.response.data=ac.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=bi.from(t.response.headers)}return Promise.reject(t)}))}const Fc={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Fc[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Vc={};Fc.transitional=function(e,t,n){function s(e,t){return"[Axios v"+Tc+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,r)=>{if(!1===e)throw new wi(s(a," has been removed"+(t?" in "+t:"")),wi.ERR_DEPRECATED);return t&&!Vc[a]&&(Vc[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,r)}},Fc.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const jc={assertOptions:function(e,t,n){if("object"!=typeof e)throw new wi("options must be an object",wi.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let a=s.length;for(;a-- >0;){const r=s[a],o=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(o){const t=e[r],n=void 0===t||o(t,r,e);if(!0!==n)throw new wi("option "+r+" must be "+n,wi.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new wi("Unknown option "+r,wi.ERR_BAD_OPTION)}},validators:Fc},kc=jc.validators;class Bc{constructor(e){this.defaults=e||{},this.interceptors={request:new Hi,response:new Hi}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),s=-1===t?-1:n.indexOf("\n",t+1),a=-1===s?"":n.slice(s+1);String(e.stack).endsWith(a)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ic(this.defaults,t);const{transitional:n,paramsSerializer:s,headers:a}=t;void 0!==n&&jc.assertOptions(n,{silentJSONParsing:kc.transitional(kc.boolean),forcedJSONParsing:kc.transitional(kc.boolean),clarifyTimeoutError:kc.transitional(kc.boolean),legacyInterceptorReqResOrdering:kc.transitional(kc.boolean)},!1),null!=s&&(Si.isFunction(s)?t.paramsSerializer={serialize:s}:jc.assertOptions(s,{encode:kc.function,serialize:kc.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),jc.assertOptions(t,{baseUrl:kc.spelling("baseURL"),withXsrfToken:kc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=a&&Si.merge(a.common,a[t.method]);a&&Si.forEach(["delete","get","head","post","put","patch","query","common"],(e=>{delete a[e]})),t.headers=bi.concat(r,a);const o=[];let i=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;i=i&&e.synchronous;const n=t.transitional||qi;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!i){const e=[Uc.bind(this),void 0];for(e.unshift(...o),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=o.length;let p=t;for(;d<u;){const e=o[d++],t=o[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=Uc.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return Wi(fc((e=Ic(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Si.forEach(["delete","get","head","options"],(function(e){Bc.prototype[e]=function(t,n){return this.request(Ic(n||{},{method:e,url:t,data:(n||{}).data}))}})),Si.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,s,a){return this.request(Ic(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:s}))}}Bc.prototype[e]=t(),"query"!==e&&(Bc.prototype[e+"Form"]=t(!0))}));const $c=Bc;class Gc{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const s=new Promise((e=>{n.subscribe(e),t=e})).then(e);return s.cancel=function(){n.unsubscribe(t)},s},e((function(e,s,a){n.reason||(n.reason=new oc(e,s,a),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Gc((function(t){e=t})),cancel:e}}}const Wc=Gc;const Hc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Hc).forEach((([e,t])=>{Hc[t]=e}));const qc=Hc;const zc=function e(t){const n=new $c(t),s=bo($c.prototype.request,n);return Si.extend(s,$c.prototype,n,{allOwnKeys:!0}),Si.extend(s,n,null,{allOwnKeys:!0}),s.create=function(n){return e(Ic(t,n))},s}(sc);zc.Axios=$c,zc.CanceledError=oc,zc.CancelToken=Wc,zc.isCancel=rc,zc.VERSION=Tc,zc.toFormData=Vi,zc.AxiosError=wi,zc.Cancel=zc.CanceledError,zc.all=function(e){return Promise.all(e)},zc.spread=function(e){return function(t){return e.apply(null,t)}},zc.isAxiosError=function(e){return Si.isObject(e)&&!0===e.isAxiosError},zc.mergeConfig=Ic,zc.AxiosHeaders=bi,zc.formToJSON=e=>ec(Si.isHTMLForm(e)?new FormData(e):e),zc.getAdapter=Mc.getAdapter,zc.HttpStatusCode=qc,zc.default=zc;const Yc=zc;function Kc(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Qc=Kc((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var Jc=function(e,t){return Jc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Jc(e,t)};function Xc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Jc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Zc(e,t,n,s){return new(n||(n=Promise))((function(a,r){function o(e){try{c(s.next(e))}catch(e){r(e)}}function i(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,i)}c((s=s.apply(e,t||[])).next())}))}function el(e,t){var n,s,a,r={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=i(0),o.throw=i(1),o.return=i(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(r=0)),r;)try{if(n=1,s&&(a=2&i[0]?s.return:i[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,i[1])).done)return a;switch(s=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,s=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(!(a=r.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){r=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(6===i[0]&&r.label<a[1]){r.label=a[1],a=i;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(i);break}a[2]&&r.ops.pop(),r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e],s=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}Object.create;function tl(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],s=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function nl(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var s,a,r=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=r.next()).done;)o.push(s.value)}catch(e){a={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function sl(e,t,n){if(n||2===arguments.length)for(var s,a=0,r=t.length;a<r;a++)!s&&a in t||(s||(s=Array.prototype.slice.call(t,0,a)),s[a]=t[a]);return e.concat(s||Array.prototype.slice.call(t))}function al(e){return this instanceof al?(this.v=e,this):new al(e)}function rl(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,a=n.apply(e,t||[]),r=[];return s=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),s[Symbol.asyncIterator]=function(){return this},s;function o(e,t){a[e]&&(s[e]=function(t){return new Promise((function(n,s){r.push([e,t,n,s])>1||i(e,t)}))},t&&(s[e]=t(s[e])))}function i(e,t){try{(n=a[e](t)).value instanceof al?Promise.resolve(n.value.v).then(c,l):u(r[0][2],n)}catch(e){u(r[0][3],e)}var n}function c(e){i("next",e)}function l(e){i("throw",e)}function u(e,t){e(t),r.shift(),r.length&&i(r[0][0],r[0][1])}}function ol(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=tl(e),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(n){t[n]=e[n]&&function(t){return new Promise((function(s,a){(function(e,t,n,s){Promise.resolve(s).then((function(t){e({value:t,done:n})}),t)})(s,a,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError;var il=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function cl(e){return"function"==typeof e}function ll(e){return cl(null==e?void 0:e.then)}var ul=Kc((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function dl(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var pl=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,s,a;if(!this.closed){this.closed=!0;var r=this._parentage;if(r)if(this._parentage=null,Array.isArray(r))try{for(var o=tl(r),i=o.next();!i.done;i=o.next()){i.value.remove(this)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else r.remove(this);var c=this.initialTeardown;if(cl(c))try{c()}catch(e){a=e instanceof ul?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=tl(l),d=u.next();!d.done;d=u.next()){var p=d.value;try{fl(p)}catch(e){a=null!=a?a:[],e instanceof ul?a=sl(sl([],nl(a)),nl(e.errors)):a.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}}if(a)throw new ul(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)fl(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&dl(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&dl(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),gl=pl.EMPTY;function hl(e){return e instanceof pl||e&&"closed"in e&&cl(e.remove)&&cl(e.add)&&cl(e.unsubscribe)}function fl(e){cl(e)?e():e.unsubscribe()}var ml={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Il={setTimeout:function(e,t){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];var a=Il.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,sl([e,t],nl(n))):setTimeout.apply(void 0,sl([e,t],nl(n)))},clearTimeout:function(e){var t=Il.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function El(e){Il.setTimeout((function(){var t=ml.onUnhandledError;if(!t)throw e;t(e)}))}function yl(){}var Al=Cl("C",void 0,void 0);function Cl(e,t,n){return{kind:e,value:t,error:n}}var Sl=null;function _l(e){if(ml.useDeprecatedSynchronousErrorHandling){var t=!Sl;if(t&&(Sl={errorThrown:!1,error:null}),e(),t){var n=Sl,s=n.errorThrown,a=n.error;if(Sl=null,s)throw a}}else e()}var Nl=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,hl(t)&&t.add(n)):n.destination=vl,n}return Xc(t,e),t.create=function(e,t,n){return new Ol(e,t,n)},t.prototype.next=function(e){this.isStopped?bl(function(e){return Cl("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?bl(Cl("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?bl(Al,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(pl),Tl=Function.prototype.bind;function Dl(e,t){return Tl.call(e,t)}var Pl=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Rl(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Rl(e)}else Rl(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Rl(e)}},e}(),Ol=function(e){function t(t,n,s){var a,r,o=e.call(this)||this;cl(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=s?s:void 0}:o&&ml.useDeprecatedNextContext?((r=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},a={next:t.next&&Dl(t.next,r),error:t.error&&Dl(t.error,r),complete:t.complete&&Dl(t.complete,r)}):a=t;return o.destination=new Pl(a),o}return Xc(t,e),t}(Nl);function Rl(e){var t;ml.useDeprecatedSynchronousErrorHandling?(t=e,ml.useDeprecatedSynchronousErrorHandling&&Sl&&(Sl.errorThrown=!0,Sl.error=t)):El(e)}function bl(e,t){var n=ml.onStoppedNotification;n&&Il.setTimeout((function(){return n(e,t)}))}var vl={closed:!0,next:yl,error:function(e){throw e},complete:yl},xl="function"==typeof Symbol&&Symbol.observable||"@@observable";function wl(e){return e}function Ml(e){return 0===e.length?wl:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Ll=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var s,a=this,r=(s=e)&&s instanceof Nl||function(e){return e&&cl(e.next)&&cl(e.error)&&cl(e.complete)}(s)&&hl(s)?e:new Ol(e,t,n);return _l((function(){var e=a,t=e.operator,n=e.source;r.add(t?t.call(r,n):n?a._subscribe(r):a._trySubscribe(r))})),r},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Ul(t))((function(t,s){var a=new Ol({next:function(t){try{e(t)}catch(e){s(e),a.unsubscribe()}},error:s,complete:t});n.subscribe(a)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[xl]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ml(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Ul(e))((function(e,n){var s;t.subscribe((function(e){return s=e}),(function(e){return n(e)}),(function(){return e(s)}))}))},e.create=function(t){return new e(t)},e}();function Ul(e){var t;return null!==(t=null!=e?e:ml.Promise)&&void 0!==t?t:Promise}function Fl(e){return cl(e[xl])}function Vl(e){return Symbol.asyncIterator&&cl(null==e?void 0:e[Symbol.asyncIterator])}function jl(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var kl="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Bl(e){return cl(null==e?void 0:e[kl])}function $l(e){return rl(this,arguments,(function(){var t,n,s;return el(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,al(t.read())];case 3:return n=a.sent(),s=n.value,n.done?[4,al(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,al(s)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function Gl(e){return cl(null==e?void 0:e.getReader)}function Wl(e){if(e instanceof Ll)return e;if(null!=e){if(Fl(e))return a=e,new Ll((function(e){var t=a[xl]();if(cl(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(il(e))return s=e,new Ll((function(e){for(var t=0;t<s.length&&!e.closed;t++)e.next(s[t]);e.complete()}));if(ll(e))return n=e,new Ll((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,El)}));if(Vl(e))return Hl(e);if(Bl(e))return t=e,new Ll((function(e){var n,s;try{for(var a=tl(t),r=a.next();!r.done;r=a.next()){var o=r.value;if(e.next(o),e.closed)return}}catch(e){n={error:e}}finally{try{r&&!r.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}e.complete()}));if(Gl(e))return Hl($l(e))}var t,n,s,a;throw jl(e)}function Hl(e){return new Ll((function(t){(function(e,t){var n,s,a,r;return Zc(this,void 0,void 0,(function(){var o,i;return el(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=ol(e),c.label=1;case 1:return[4,n.next()];case 2:if((s=c.sent()).done)return[3,4];if(o=s.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i=c.sent(),a={error:i},[3,11];case 6:return c.trys.push([6,,9,10]),s&&!s.done&&(r=n.return)?[4,r.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function ql(e,t,n,s,a){void 0===s&&(s=0),void 0===a&&(a=!1);var r=t.schedule((function(){n(),a?e.add(this.schedule(null,s)):this.unsubscribe()}),s);if(e.add(r),!a)return r}function zl(e){return function(t){if(function(e){return cl(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Yl(e,t,n,s,a){return new Kl(e,t,n,s,a)}var Kl=function(e){function t(t,n,s,a,r,o){var i=e.call(this,t)||this;return i.onFinalize=r,i.shouldUnsubscribe=o,i._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,i._error=a?function(e){try{a(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,i._complete=s?function(){try{s()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,i}return Xc(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(Nl);function Ql(e,t){return void 0===t&&(t=0),zl((function(n,s){n.subscribe(Yl(s,(function(n){return ql(s,e,(function(){return s.next(n)}),t)}),(function(){return ql(s,e,(function(){return s.complete()}),t)}),(function(n){return ql(s,e,(function(){return s.error(n)}),t)})))}))}function Jl(e,t){return void 0===t&&(t=0),zl((function(n,s){s.add(e.schedule((function(){return n.subscribe(s)}),t))}))}function Xl(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ll((function(n){ql(n,t,(function(){var s=e[Symbol.asyncIterator]();ql(n,t,(function(){s.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function Zl(e,t){if(null!=e){if(Fl(e))return function(e,t){return Wl(e).pipe(Jl(t),Ql(t))}(e,t);if(il(e))return function(e,t){return new Ll((function(n){var s=0;return t.schedule((function(){s===e.length?n.complete():(n.next(e[s++]),n.closed||this.schedule())}))}))}(e,t);if(ll(e))return function(e,t){return Wl(e).pipe(Jl(t),Ql(t))}(e,t);if(Vl(e))return Xl(e,t);if(Bl(e))return function(e,t){return new Ll((function(n){var s;return ql(n,t,(function(){s=e[kl](),ql(n,t,(function(){var e,t,a;try{t=(e=s.next()).value,a=e.done}catch(e){return void n.error(e)}a?n.complete():n.next(t)}),0,!0)})),function(){return cl(null==s?void 0:s.return)&&s.return()}}))}(e,t);if(Gl(e))return function(e,t){return Xl($l(e),t)}(e,t)}throw jl(e)}function eu(e,t){return t?Zl(e,t):Wl(e)}function tu(e){return zl((function(t,n){var s,a=null,r=!1;a=t.subscribe(Yl(n,void 0,void 0,(function(o){s=Wl(e(o,tu(e)(t))),a?(a.unsubscribe(),a=null,s.subscribe(n)):r=!0}))),r&&(a.unsubscribe(),a=null,s.subscribe(n))}))}class nu{constructor(e,t,n={}){this.type=e,this.name=t,this.parent=null,this.children=[],this.eventSubscribers=[],this.value="",this.previousValue="|~#-old-#~|",this.props=n,this.references=new Map}addReference(e,t){this.references.set(e,t)}getReference(e){return e?this.references.get(e):void 0}getNode(e,t,n){return this.children.find((s=>s.type===e&&s.name===t&&s.props.index===n))}addNode(e,t,n={}){let s=this.getNode(e,t,n.index);return s?s.props=n:(s=new nu(e,t,n),s.parent=this,this.children.push(s)),s}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e,t=!1){this.eventSubscribers.forEach((t=>{t(e)})),!t&&this.parent&&this.parent.triggerEvent(e)}setPreviousDefaultValue(){"|~#-old-#~|"===this.previousValue&&(this.previousValue=this.value)}removeReference(e,t){const n=this.references.get(e);n?.props?.index===t&&this.references.delete(e)}removeChildNode(e){const t=this.children.findIndex((t=>t.name.startsWith(e)));-1!==t&&this.children.splice(t,1)}removeChildren(){this.children.splice(0,this.children.length)}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const s=this.children[n];if(s.props.index===t&&s.name===e){this.children.splice(n,1);break}}}}const su=nu;const au=class{constructor(e,t,n,s={}){this.type=$s.CONTEXT_TREE_NODE_TYPES.WHEN,this.subType=e,this.referenceName=t,this.name=n,this.props=s}},ru=/(([^.]+)\[\d+\])/g,ou=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(ru);if(!t)return[e];let n,s=t[t.length-1];return e=e?.split(s)[0],e=e?.substring(0,e.length-1),[s,n]=s.split("["),n=n?.split("]")[0],[e,s,n]},iu=(e,t)=>{if(!e.startsWith(t))return-1;const n=e.slice(t.length).match(/\[([0-9]+)\]/);return n?parseInt(n[1],10):-1},{FIELD:cu,WHEN:lu,DECLARATIVE_TARGET:uu,PAGELIST:du}=Gs.CONTEXT_TREE_NODE_TYPES;let pu;const gu=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[cu,new Map],[lu,new Map],[uu,new Map]])}addReference(e,t){if(this.references.has(t.type)){const n=this.references.get(t.type);n.set(e,t),this.references.set(t.type,n)}else{if(t.type===du){const n=this.references.get(cu);n.set(e,t),this.references.set(cu,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const s=iu(n.name,e);return-1!==s&&+s>=t}));n.length>0&&n.forEach((e=>{this.removeChildNode(e.name,t)}))}removeChildNode(e,t){const n=this.children.findIndex((t=>t.name.startsWith(e)));if(-1!==n){const[t]=this.children.splice(n,1),s=t?.parent;s?.removeChildNode(e)}const s=this.references.get(cu),a=this.references.get(uu);[...s.keys(),...a.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=ou(e);return+n>=t})).forEach((e=>{const t=s.get(e),n=t?.parent;n?.removeChildren(),s.delete(e)}))}getReference(e,t){if(this.references.has(t))return this.references.get(t)?.get(e)}getNode(e,t,n){return this.children.find((s=>s.type===e&&s.name===t&&s.props.index===n))}addNode(e,t,n={}){let s=this.getNode(e,t,n.index);return s?s.props=n:(s=new su(e,t,n),s.parent=this,this.children.push(s)),s}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e){this.eventSubscribers.forEach((t=>{t(e)}))}removeReference(e,t,n){const s=this.references.get(t),a=s?.get(e);if(a?.props?.index===n){const n=a?.props?.context;s.delete(e),t===cu&&n&&pu?.(n,e)}}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const s=this.children[n];if(s.props.index===t&&s.name===e){this.children.splice(n,1);break}}}addWhen(e,t,n,s,a){if(!(n&&s&&e&&t))return;n.startsWith(".")&&(n=n.substring(1));const r=`${e}.${n}.${s}`,o=new au(t,n,s,a),i=this.references.get("WHEN");i?.set(r,o)}},{VIEW:hu,FIELD:fu,CONTEXT:mu,DECLARATIVE_TARGET:Iu,WHEN:Eu}=$s.CONTEXT_TREE_NODE_TYPES;const yu=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new gu(mu,e);this.rootNodes[e]=t}return this.rootNodes[e]}getContextNode(e){return e?this.rootNodes[e]:void 0}addPageNode(e,t){return this.addContextNode(e).addNode("PAGE",t)}_addParentViewNode(e,t,n){const s=this.addContextNode(e).addNode("PAGE",t);let a=s.getReference(n);return a||(a=s.addNode("VIEW",n),s.addReference(n,a)),a}pushChildPageNodeToParentView(e,t,n){const s=e.children;let a=!1;if(s)for(let e=0;e<s.length;e+=1)if(s[e].name===n){a=!0;break}a||s.push(t),t.parent=e}addViewNode(e,t,n,s,a={}){const r=this.addContextNode(e).addNode("PAGE",t);let o=null;if(s&&n!==s){o=this._addParentViewNode(e,t,s).addNode("VIEW",n,a)}else o=r.addNode("VIEW",n,a);r.addReference(n,o);const i=t.split(".");for(;i.length>0;){i.pop();const n=i.join("."),a=this.getContextNode(e)?.getNode("PAGE",n),o=a?.getReference(s);if(o){this.pushChildPageNodeToParentView(o,r,t);break}}return o}getViewNode(e,t,n){return this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n)}addPageListNode(e,t,n,s,a){if(!s)return;s.startsWith(".")&&(s=s.substring(1));const r=this.addContextNode(e),o=r.addNode("PAGE",t)?.getReference(n)?.addNode("PAGELIST",`${t}.${s}`,a);return o&&r.addReference(`${t}.${s}`,o),o}updatePageListNode(e,t,n,s){if(!n)return;n.startsWith(".")&&(n=n.substring(1));this.addContextNode(e).removePageListNodes(`${t}.${n}`,s)}removeFieldNode(e,t,n,s,a){const r=this.getContextNode(e);r?.getNode("PAGE",t)?.getReference(n)?.removeNode(`${t}${s}`,a),r?.removeReference(`${t}${s}`,fu,a),r?.removeReference(`${t}${s}`,Iu,a)}removeViewNode(e,t,n,s,a={}){const r=this.getContextNode(e),o=r?.getNode("PAGE",t),i=o?.getReference(n);if("visibility"in a&&i?.props&&"visibility"in i.props&&a.visibility!==i.props.visibility)return;this.removeChildViewNodes(e,t,n,s);const c=i?.parent?.children?.findIndex((e=>e.name===n))??-1;c>-1&&i?.parent?.children.splice(c,1)}removeChildViewNodes(e,t,n,s){const a=this.getContextNode(e),r=a?.getNode("PAGE",t),o=r?.getReference(n);o?.children.forEach((r=>{"PAGE"===r.type?this.removeViewNode(e,r.name,n,s):r.type===hu?this.removeChildViewNodes(e,t,r.name,s):(a.removeReference(r.name,fu,r.props.index),a.removeReference(r.name,Iu,r.props.index),"PAGELIST"!==r.type&&"Address"!==r.props?.componentName||this.deleteAllListNodes(e,r.name))})),r?.references.delete(n)}deleteAllListNodes(e,t,n=!0){const s=s=>{const a=this.getContextNode(e),r=a?.references?.get(s);if(r)for(const[e]of r)(n&&e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&a?.references?.get(s)?.delete(e)};s(fu),s(Iu)}deleteListNode(e,t,n){const s=s=>{const a=this.getContextNode(e),r=a?.references?.get(s);if(r)for(const[e]of r)e.includes(`${t.join(".")}[${n}]`)&&a?.references?.get(s)?.delete(e)};s(fu),s(Iu)}getPageListNode(e,t,n,s){const a=this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n);return a?.children.find((e=>"PAGELIST"===e.type&&e.name===`${t}.${s}`))}getFieldNode(e,t,n,s){return this.getViewNode(e,t,n)?.getNode(fu,s)}_findViewNode(e,t,n,s){let a=s.addNode("PAGE",t)?.getReference(n);if(a)return a;const r=t.split(".");for(;r.length>0;){r.pop();const e=r.join(".");if(a=s.addNode("PAGE",e)?.getReference(n),a)return a}return this.addViewNode(e,t,n)}addFieldNode(e,t,n,s,a,r={}){const o=this.addContextNode(e),i=this._findViewNode(e,t,n,o),c=this.createFieldNode(i,t,s,r);return c&&this.updateFieldNode(o,i,c,e,t,s,a),c}createFieldNode(e,t,n,s){const{isDeclarativeTarget:a}=s;return a?e.addNode(Iu,`${t}${n}`,s):e.addNode(fu,`${t}${n}`,s)}updateFieldNode(e,t,n,s,a,r,o){const i=`${a}${r}`;"Address"===n.props?.componentName&&this.deleteAllListNodes(s,n.name),e.addReference(i,n),n.value=o,n.setPreviousDefaultValue(),n.props.isInsideList&&this.handleFieldInsideList(e,t,s,a,r)}handleFieldInsideList(e,t,n,s,a){const r=py(n),o=FE(r,n)||{},i=`${s}${a}`;let c=null;if(o?.subscriptFieldName||o?.isPageGroup)c=s.substring(0,s.lastIndexOf(`.${o?.index??""}`))||i.substring(0,i.lastIndexOf(`.${o?.index}`)),this.createListNodeIfNotExist(e,t,c);else{const n=s.substring(0,s.lastIndexOf("["))||i.substring(0,i.lastIndexOf("["));this.createListNodeIfNotExist(e,t,n)}}createListNodeIfNotExist(e,t,n){let s=e.getReference(n,fu);s||(s=t.addNode(fu,n,{}),e.addReference(n,s))}removeContextTreeNode(e){delete this.rootNodes[e]}onViewMutate(e,t,n,s){this.getViewNode(e,t,n)?.addEventListener(s)}mutateField(e,t,n,s){const a=this.getContextNode(e),[r,o,i]=ou(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,r,o,{...s,rowIndex:i});const c=a?.getReference(`${t}.${n}`,fu);c&&c instanceof su&&c.triggerEvent(s)}onPageListMutate(e,t,n,s,a){this.getPageListNode(e,t,n,s)?.addEventListener(a)}mutatePageList(e,t,n,s,a=!1){const r=this.getContextNode(e),o=r?.getReference(`${t}.${n}`,fu);o&&o instanceof su&&o.triggerEvent(s,a)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(fu)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(fu)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Iu)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(fu)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Iu)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const s=this.getContextNode(e)?.references?.get(fu)?.get(t);s instanceof su&&s&&(s.previousValue=s.value,void 0===s.value&&(s.previousValue=n),s.value=n)}getContextReferences(e){if(!this.getContextNode(e))return;const t=this.getContextReferencesByType(e,fu),n=this.getContextReferencesByType(e,Iu);return new Map([...t.entries(),...n.entries()])}getContextReferencesByType(e,t){return this.getContextNode(e)?.references.get(t)||new Map}isFieldExists(e,t){return!!this.getContextReferencesByType(e,fu)?.get(t)||!!this.getContextReferencesByType(e,Iu)?.get(t)}addWhenNode(e,t,n,s,a,r){const o=this.getContextNode(e);o?.addWhen(t,n,s,a,r)}getDeclarativeTargets(e){const t=this.getContextNode(e),n=t?.references?.get(Iu)||new Map,s=[];return n.forEach((e=>{const t=e?.props||{},{propertyName:n=""}=t,a=t.pageReference??$s.CASE_INFO.CASE_INFO_CONTENT;s.push({pageReference:a,name:n})})),s}getWhens(e){const t=this.getContextNode(e),n=t?.references?.get(Eu)||new Map,s=[];return n.forEach((e=>{const t=e.subType,n=e.referenceName,a=e.name,r=e?.props?.pageReference??$s.CASE_INFO.CASE_INFO_CONTENT;s.push({name:a,pageReference:r,referenceName:n,type:t})})),s}},Au={CONTENT_FIELDS_PATH:[Gs.CONTEXT_DATA,Gs.CASE_INFO.CASE_INFO,Gs.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[Gs.CONTEXT_DATA,Gs.DATA_INFO.DATA_INFO,Gs.CONTENT],OBJECT_CONTENT_FIELDS_PATH:[Gs.CONTEXT_DATA,Gs.OBJECT_INFO.OBJECT_INFO,Gs.CONTENT],FIELD_MESSAGES_PATH:[Gs.CONTEXT_DATA,Gs.CASE_INFO.CASE_INFO,Gs.CONTENT,Gs.SUMMARY_OF_MESSAGES,Gs.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[Gs.CONTEXT_DATA,Gs.DATA_INFO.DATA_INFO,Gs.CONTENT,Gs.SUMMARY_OF_MESSAGES,Gs.PROPERTY_MESSAGES],OBJECT_FIELD_MESSAGES_PATH:[Gs.CONTEXT_DATA,Gs.OBJECT_INFO.OBJECT_INFO,Gs.CONTENT,Gs.SUMMARY_OF_MESSAGES,Gs.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[Gs.CONTEXT_DATA,Gs.SUMMARY_OF_MESSAGES,Gs.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[Gs.CONTEXT_DATA,Gs.SUMMARY_OF_MESSAGES,Gs.HTTP_MESSAGES],CASE_MESSAGE_PATH:[Gs.CASEMESSAGES]},Cu=(e="",t="",n,s)=>{let a=[],r=[];null!==e&&(r=(e=>e?.startsWith(".")?e.substring(1).split("."):e.split("."))(e));const o=t&&t.startsWith(".")?t.substr(1):t;if(n===Gs.PROPERTY&&e||e){a=[Gs.CONTEXT_DATA,...o.split(".")];for(let e=0;e<r.length-1;e+=1)a.push(r[e]);a.push(Gs.SUMMARY_OF_MESSAGES,Gs.PROPERTY_MESSAGES,r[r.length-1])}else n===$s.PAGE?a=[...Au.PAGE_MESSAGES_PATH]:n===Gs.HTTP?a=[...Au.HTTP_MESSAGES_PATH]:n===Gs.CASEMESSAGES?a=[...Au.CASE_MESSAGE_PATH]:s&&(a=[Gs.CONTEXT_DATA,...o.split(".")]);return a.filter(Boolean)},Su=(e,t,n)=>{const s={content:{}},a=`${t.split(".").slice(2).join(".")}[${n}]`,r=AC.getIn(e?.content,a.split("."));return r&&AC.setIn(s.content,a.split("."),{...r}),s},_u=(e,t,n,s,a,r,o={})=>{const i=((e,t,n)=>t<n?e.filter((e=>parseInt(e.match(/\d+/)?.[0],10)>t&&parseInt(e.match(/\d+/)?.[0],10)<=n)):e.filter((e=>parseInt(e.match(/\d+/)?.[0],10)<t&&parseInt(e.match(/\d+/)?.[0],10)>=n)))(n,s,a),c=s>a?"up":"down";i&&i?.length>0&&i?.forEach((n=>{const s=parseInt(n.match(/\d+/)?.[0],10),a=`${r}[${s}]`;o[`${r}[${s+("up"===c?1:-1)}]`]=AC.getIn(e[t],[Gs.CONTEXT_DATA,...a.split(".")]),AC.deleteIn(e[t],[Gs.CONTEXT_DATA,...a.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{AC.setIn(e[t],[Gs.CONTEXT_DATA,...n.split(".")],o[n])}))},Nu=(e,t,n,s,a)=>{const r=AC.deepClone(AC.getIn(e,[`${t}`])),o=AC.getIn(r,[Gs.CONTEXT_DATA,Gs.CASE_INFO.CASE_INFO]);if(!o)return;const i=(e=>{const t=[];let n=0;for(;n<e.length;)n+1<e.length&&!Number.isNaN(parseInt(e[n+1],10))?(t.push(`${e[n]}[${e[n+1]}]`),n+=2):(t.push(e[n]),n+=1);return t.join(".")})(n.split(".")),c=i.substring(0,i.lastIndexOf(".")),l=((e,t,n)=>{const s=AC.getIn(e,[Gs.CONTEXT_DATA,...n.split(".")],{});return Object.keys(s).filter((e=>e.includes(`${t}[`)))})(r,i.substring(i.lastIndexOf(".")+1),c);if(0===l.length)return;const u=Su(o,i,s).content;if(u&&Object.keys(u).length>0){const n={},o=`${i}[${s}]`,c=AC.getIn(r,[Gs.CONTEXT_DATA,...o.split(".")]);n[`${i}[${a}]`]=c,AC.deleteIn(e[t],[Gs.CONTEXT_DATA,...o.split(".")]),_u(e,t,l,s,a,i,n)}else _u(e,t,l,s,a,i)},Tu=e=>{const{type:t,property:n,category:s,context:a,pageReference:r}=e;let o;n&&(o=n.slice(1));const i=aC(a);let c=[];const l=AC.getIn(i,Cu(o,r,s));return t&&"all"!==t?(l&&Array.isArray(l)&&l.length>0&&(c=l.filter((e=>e.type===t))),t===$s.MESSAGES.MESSAGES_TYPE_ERROR&&c.length>0&&n&&yu.mutateField(a,r,n,{messages:[...c],type:$s.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},Du=e=>{const{property:t,pageReference:n,category:s,context:a,type:r,subType:o,isListEntry:i,clearContextMessages:c,deletingIndex:l}=e,u={context:a,type:r,subType:o};t&&!i?(yu.mutateField(a,n,t,{type:gr,fieldName:t}),u.property=t,u.pageReference=n):i?(u.pageReference=n,u.isListEntry=i,u.deletingIndex=l):u.category=s,sC(c?{type:gr,payload:{stateObj:e.stateObj,context:a}}:{type:gr,payload:u})},Pu=e=>{const{messages:t,property:n,pageReference:s,category:a,context:r}=e,o={messages:t,context:r};n?(o.property=n,o.pageReference=s):o.category=a,sC({type:pr,payload:o})},Ou=(e,t,n)=>{for(const s of Object.keys(e)){if(t.push(s),s===Gs.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[s]&&Ou(e[s],t,n)}t.pop()}return n},Ru=(e,t)=>{let n=Tu({context:Gs.APP.ROOT,category:"HTTP"});if(Gy.getRenderingMode()===Gs.EMBED){const e=Tu({context:Gs.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=Tu({context:t,category:"HTTP"});n?e&&(n=n.concat(Tu({context:t,category:"HTTP"}))):n=Tu({context:t,category:"HTTP"})}return n},bu=e=>{let t=null;t=ey(e)[0]?YE(ey(e)[0]):e,t&&Du({context:t,stateObj:aC(t),clearContextMessages:!0})},vu=e=>(AC.getIn(aC(e),Au.PAGE_MESSAGES_PATH)??[]).some((e=>e.subType===Gs.CUSTOM_ERROR)),xu={addMessages:Pu,getValidationErrorMessages:(e,t)=>{const n=aC(e),s=(e=>{let t=Au.CONTENT_FIELDS_PATH;e?.objectInfo?t=lI.isObjectCaseType(e?.objectInfo?.objectTypeID)?Au.OBJECT_CONTENT_FIELDS_PATH:t:e?.dataInfo?.content&&(t=Au.DATA_OBJECT_CONTENT_FIELDS_PATH);return t})(n),a=AC.getIn(n,[...s])||{},r=[];return Ou(a,[],[]).forEach((e=>{const n=AC.getIn(a,[...e,Gs.PROPERTY_MESSAGES]);n&&Object.keys(n).forEach((e=>{n[e].forEach((e=>{if(e.type===Gs.MESSAGES.MESSAGES_TYPE_ERROR){const n=t?.getLocalizedMessage(e.message)??e.message;e.fieldLabel?r.push({label:`${e.fieldLabel}:`,description:n}):r.push(n)}}))}))})),r},getMessages:Tu,clearMessages:Du,getRootContainerHttpMessages:Ru,clearContextMessagesInActiveWorkArea:bu,clearContextMessages:e=>{const{context:t}=e;sC({type:gr,payload:{clearAll:!0,context:t}})},isCustomPageErrorExist:vu},wu=xu;const Mu=class{constructor(e,t,n,s){this.eventType=e,this.callback=n,this.contextName=s,this.id=t}};const Lu=new class{constructor(){this.subscribers={}}publish(e,t){(this.subscribers[e]||[]).slice().forEach((e=>{e.callback(t)}))}unsubscribe(e,t,n){const s=this.subscribers[e]||[];let a=0,r=-1;s.forEach((e=>{e.id===t&&e.contextName===n&&(r=a),a+=1})),-1!==r&&s.splice(r,1)}unsubscribeAllWithEventType(e){this.subscribers[e]=[]}subscribe(e,t,n,s,a){this.subscribers[e]=this.subscribers[e]||[];let r=!1;if(a&&this.subscribers[e].forEach((e=>{r=e.id===t&&e.contextName===s})),!r){const a=new Mu(e,t,n,s);this.subscribers[e].push(a)}}clearContext(e){const t=this.subscribers;Object.keys(t).forEach((t=>{const n=this.subscribers[t],s=[];n.forEach((t=>{t.contextName!==e&&s.push(t)})),this.subscribers[t]=s}))}};const Uu=class{static subscribe(e,t,n,s=!1,a="app"){Lu.subscribe(e,n,t,a,s)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){Lu.publish(e,t)}static unsubscribe(e,t,n="app"){Lu.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){Lu.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){Lu.clearContext(e)}};const Fu=new class{override=null;discoveredOffline=!1;subscribers=new Set;constructor(){"function"==typeof globalThis.addEventListener&&(globalThis.addEventListener("online",this.handleOnline),globalThis.addEventListener("offline",this.handleOffline))}isOnline(){return null!==this.override?this.override:!this.discoveredOffline&&("undefined"==typeof navigator||!("onLine"in navigator)||navigator.onLine)}setOnlineOverride(e){const t=this.isOnline();this.override=e;const n=this.isOnline();n!==t&&this.notifyAll(n)}onStatusChange(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}reportNetworkFailure(){null===this.override&&(this.discoveredOffline||(this.discoveredOffline=!0,this.notifyAll(!1)))}reportNetworkRecovery(){null===this.override&&this.discoveredOffline&&(this.discoveredOffline=!1,this.notifyAll(!0))}handleOnline=()=>{null===this.override&&(this.discoveredOffline=!1,this.notifyAll(!0))};handleOffline=()=>{null===this.override&&this.notifyAll(!1)};notifyAll(e){sC({type:e?ha:ga,payload:{context:"app"}}),this.subscribers.forEach((t=>{t(e)}))}};const Vu=new class{#e;#t;#n;#s;constructor(){this.#e="undefined"!=typeof localStorage&&"true"===localStorage.getItem("inspectorFlag"),this.#t=!1,this.#n=!1,this.#s=!1,this.isPreview=!1,this.debugLevels="vcv=1;tracer=0;log=0;metric=1"}#a(){return this.#n&&this.#s}toggleXRay(e){console.warn("The toggleXRay method is deprecated. Please use the toggleInspector method going forward."),e&&!this.inspectorEnabled&&this.toggleInspector(),!e&&this.inspectorEnabled&&this.toggleInspector()}get inspectorEnabled(){return this.#e}get inspectorShowAll(){return this.#t}toggleInspector(){const e="undefined"!=typeof localStorage?localStorage:null,t="true"===e?.getItem("inspectorFlag");!t&&this.#a()||(this.#e=!t,e?.setItem("inspectorFlag",this.#e.toString()),Uu.publish(Gs.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e))}disableInspectorIfEnabled(){if(!this.#e)return;this.#e=!1;const e="undefined"!=typeof localStorage?localStorage:null;e?.setItem("inspectorFlag",this.#e.toString()),Uu.publish(Gs.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e)}toggleInspectorShowAll(){this.#t=!this.#t,Uu.publish(Gs.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR_SHOW_ALL,this.#t)}get uiDesignerEnabled(){return this.#n}setDesignerToolbarExpanded(e){this.#s=e,Uu.publish(Gs.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER_TOOLBAR_EXPANDED,e)}get uiDesignerToolbarExpanded(){return this.#s}toggleUIDesigner(){this.#n=!this.#n,this.#n||(this.#s=!1),Uu.publish(Gs.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER,this.#n),Uu.publish(Gs.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER_TOOLBAR_EXPANDED,this.#s)}setPreviewMode(){this.isPreview=!0}getPreviewMode(){return this.isPreview}enableTracer=()=>{this.debugLevels="vcv=1;tracer=1;log=0;metric=1"};disableTracer=()=>{this.debugLevels="vcv=1;tracer=0;log=0;metric=1"};getDebugLevels=()=>this.debugLevels};class ju{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new ju(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):Id(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=Ed()}async buildAuthorizeUrl(e){e=e||window.btoa(window.location.origin);let{sessionIndex:t}=this.config;const{password:n}=this.config,s=this.config.clientId?this.config.clientId:this.config.client_id,a=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,r=this.config.authorizeUri?this.config.authorizeUri:this.config.endPoints?.authorize,o=this.config.authService?this.config.authService:this.config.authentication_service||"pega",i=this.config.appAlias?this.config.appAlias:By.getApplicationAlias(),c=this.config.userIdentifier?this.config.userIdentifier:this.config.user_identifier;t=t||this.config.tokenInfo?.session_index;let l="";t?l=`&session_index=${t}`:`${c}`?l=`&UserIdentifier=${c}`:n&&(l=`&Password=${window.atob(n)}`);const u=new Uint8Array(64);window.crypto?.getRandomValues(u),this.config.codeVerifier=this.base64UrlSafeEncode(u),this.updateConfig(this.config,!1);const d=i?`+app.alias.${i.replace(/^app\//,"")}`:"";return this.getCodeChallenge(this.config.codeVerifier)?.then((t=>`${r}?client_id=${s}&response_type=code&redirect_uri=${a}&scope=openid${d}&state=${e}&code_challenge=${t}&code_challenge_method=S256&authentication_service=${o}&enable_psyncId=true${l}`))?.catch((()=>null))}getTokenAndFinish=e=>{window.removeEventListener("message",this.authMessageHandler,!1),this.getToken(e,!1).then((()=>{})).catch((e=>{console.log(e)}))};authMessageHandler=e=>{if(e.origin!==this.getRedirectUriOrigin())return;if(!e.data||!e.data.type||"PegaAuth"!==e.data.type)return;const t=e.data.code.toString();this.getTokenAndFinish(t)};getRedirectUriOrigin=()=>{let{redirectUri:e}=this.config;e=e||this.config.redirect_uri||"";const t=e.indexOf("//"),n=e.indexOf("/",t+2);return-1!==n?e.substring(0,n):e};getToken(e,t){this.reloadConfig(t);const n=this.config.clientId?this.config.clientId:this.config.client_id,s=this.config.clientSecret?this.config.clientSecret:this.config.client_secret,a=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,r=this.config.tokenUri?this.config.tokenUri:this.config.endPoints?.token,{codeVerifier:o}=this.config,i=window.location.search,c=new URLSearchParams(i),l=e||c.get("code"),u=new URLSearchParams;return n&&u.append("client_id",n),s&&u.append("client_secret",s),u.append("grant_type","authorization_code"),u.append("code",l),a&&u.append("redirect_uri",a),o&&u.append("code_verifier",o),this.config?.secureCookie&&u.append("send_token_as_cookie","true"),ud(r,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:u.toString()}).then((e=>e.data)).then((e=>{e.eA=Date.now()+1e3*e.expires_in;let n=!1;if(this.config.codeVerifier&&(delete this.config.codeVerifier,n=!0),e.session_index&&(this.config.session_index=e.session_index,n=!0),n){this.updateConfig(this.config,t),this.config?.secureCookie?fd({pzCTkn:e?.csrf}):(md({tokenInfo:e}),fd({Authorization:`${e?.token_type} ${e?.access_token}`}));const{onTokenRetrieval:n}=this.config;n&&"function"==typeof n&&n(e),window.postMessage("oAuthSuccess")}return e})).catch((()=>null))}sha256Hash(e){return window.crypto?.subtle?.digest("SHA-256",(new TextEncoder).encode(e))}encode64(e){return window.btoa(new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),""))}base64UrlSafeEncode(e){return this.encode64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}getCodeChallenge(e){return this.sha256Hash(e)?.then((e=>this.base64UrlSafeEncode(e))).catch((e=>{console.log(e)})).finally((()=>null))}}const ku=ju,Bu=async()=>new Promise((async(e,t)=>{const n=yd();if(!("tokenInfo"in n)||!n?.tokenInfo)return void t(new Error("Missing token information."));const{access_token:s,refresh_token:a=null}=n.tokenInfo,r=n.endPoints?.revoke,{client_id:o="",client_secret:i="",secureCookie:c,serverType:l}=n,u="launchpad"===l,d={"content-type":"application/x-www-form-urlencoded"};i&&!u&&(d.authorization=`Basic ${window.btoa(`${o}:${i}`)}`);const p=new URLSearchParams;i?u&&(p.append("client_id",o),p.append("client_secret",i)):p.append("client_id",o),c&&p.append("send_token_as_cookie","true");const g=a?"refresh_token":"access_token",h="access_token"===g?s:a;!c&&h&&p.append("token",h),p.append("token_type_hint",g),r&&await ud(r,{method:"POST",headers:d,withCredentials:c,body:p.toString(),withoutDefaultHeaders:!0}),fd({Authorization:null}),md({tokenInfo:null}),e()})),$u=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new ku(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=un()+(ln()?`${ln()}`:"/?reAuth=true");return t},Gu=(e,t)=>{$u(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};Uu.publish($s.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},Wu=e=>{let t="",n={},s={},a=!0;if("OAuth2.0"===e?.authType){t=e.endPoints.token;const r=new URLSearchParams;(!e.tokenInfo.refresh_token||e.tokenInfo.refresh_token&&e.tokenInfo.refresh_token.length<=0)&&(a=!1),r.append("client_id",e.client_id),r.append("grant_type","refresh_token"),e.client_secret&&r.append("client_secret",e.client_secret),e.secureCookie&&r.append("send_token_as_cookie","true"),e.tokenInfo?.refresh_token&&r.append("refresh_token",e.tokenInfo.refresh_token),n={method:"POST",body:r.toString(),headers:{"content-type":"application/x-www-form-urlencoded"}},s={success:t=>{const{data:n}=t,s={access_token:n?.access_token,refresh_token:n?.refresh_token};md({tokenInfo:{...e.tokenInfo,...s}}),e.secureCookie?fd({pzCTkn:n?.csrf}):fd({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:a}=e;a&&"function"==typeof a&&a(n)},failure:t=>{if(e.popupReauth)return Gu(t,e);Uu.publish($s.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${un()}/updateSession`,n={method:"GET",headers:{}},s={failure:Gu};return{url:t,config:n,callback:s,isRefreshTokenPresent:a}},Hu=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),qu=e=>{const{config:t}=e,n=t.headers&&t.headers.context;return t.data&&(t.body=t.data),{url:t.url,config:t,context:n}},zu=e=>{const{url:t,config:n,callback:s}=Wu(e);return ud(t,n).then((e=>{s?.success?.(e),Uu.publish("updateSession",{updateStatus:"success"}),Uu.publish("OnUpdateSession",{})})).catch((e=>{throw e}))},Yu=(e,t,n)=>{const{config:s}=e,{url:a,config:r,callback:o,isRefreshTokenPresent:i}=Wu(n),c=s?.headers&&s.headers.context;s?.data&&(s.body=s.data);const l=dd(s.url,s,c,t);return i?ud(a,r).then((e=>new Promise(((n,a)=>{setTimeout((()=>{t.setUpdateSessionStatus(!1),t.latestUpdateSessionTimeStamp=Date.now(),o?.success?.(e,s),Uu.publish("updateSession",{updateStatus:"success"}),Uu.publish("OnUpdateSession",{}),l.then((e=>{n(e)})).catch((e=>{a(e)}))}),0)})))).catch((e=>e&&e.config&&Hu(e.config.url,n)?(o?.failure?.(s.url,n),l):Promise.reject(e))):(o?.failure?.(s.url,n),l)},Ku=e=>"object"==typeof e&&null!==e,Qu=(e,t,n,s)=>{if(e.config&&Hu(e.config.url,n))return Promise.reject(e);if(e.response&&e.response.status&&401===e.response.status&&!e.config.isExternalUrl&&!t.getUpdateSessionStatus()&&e.config.fetchTimeStamp>t.latestUpdateSessionTimeStamp){if(Uu.unsubscribeAllWithEventType(ed),t.setUpdateSessionStatus(!0),"custom"===n?.authType){Uu.publish($s.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:s,context:a}=qu(e);return dd(n,s,a,t)}return Yu(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&!e.config.isExternalUrl&&t.getUpdateSessionStatus()){const{url:t,config:n,context:s}=qu(e);return ud(t,n,s)}const a=(e=>{if(e instanceof ArrayBuffer)try{const t=(new TextDecoder).decode(e),n=JSON.parse(t);return Ku(n)?n:{}}catch{return{}}return Ku(e)?e:{}})(e.response?.data);if(e.response&&e.response.status&&422!==e.response.status&&424!==e.response.status&&(400!==e.response.status||a.errorClassification!==$s.INVALID_INPUTS)&&e.config.headers.context&&e.response.data&&!s){const t=a.errorDetails&&a.errorDetails.map((t=>((e,t)=>t[$s.TRACE_ID]?{type:"error",message:e.localizedValue||e.message,correlationID:t[$s.TRACE_ID]}:{type:"error",message:e.localizedValue||e.message})(t,e.response.headers)));let n=e.config.headers.context;return n&&n.includes("/workarea")&&!n.includes("/modal")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),Pu({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const Ju=class{constructor(){this.updateSessionInProgress=!1,this.latestUpdateSessionTimeStamp=Date.now()}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const Xu=new class{constructor(){this.externalHeaders={},this.defaultHeaders={},this.SPECIAL_CHARS={SLASH:"/"}}registerHeader(e,t){return!this.defaultHeaders[e]&&(this.externalHeaders[e]=t,!0)}unRegisterHeader(e){this.externalHeaders[e]&&delete this.externalHeaders[e]}getRegisteredHeaders(){return this.externalHeaders}setDefaultHeaders(e){e?.Prefer&&this.defaultHeaders.Prefer&&(e.Prefer=`${this.defaultHeaders.Prefer},${e.Prefer}`),this.defaultHeaders={...this.defaultHeaders,...e}}setRequestContext(e){if(!e||0===e.length)return;const t=new URLSearchParams(window.location.search),n=this.buildHeaderMapFromRequestContext(e,t);this.registerHeadersFromMap(n)}buildHeaderMapFromRequestContext(e,t){const n={};return e?.forEach((e=>{Array.isArray(e.IncludeInHeaders)&&e.IncludeInHeaders.forEach((s=>{const a=s.Value,r=t.get(e.Key);r&&(n[a]||(n[a]=[]),n[a].push(`${e.Key}=${r}`))}))})),n}registerHeadersFromMap(e){Object.entries(e).forEach((([e,t])=>{t.length>0&&this.registerHeader(e,t.join("; "))}))}getDefaultHeaders(){return this.defaultHeaders}addDebugHeaders(e={}){return{[Gs.COREHEADER_APP_DEBUG_ID]:e.debugId,[Gs.COREHEADER_APP_DEBUG_LEVELS]:Vu.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=NC.getProperty(Gs.COREHEADERS,"",e);return t?{...t,debugInfo:Vu.getPreviewMode()&&{...t.debugInfo,[Gs.COREHEADER_APP_DEBUG_LEVELS]:Vu.getDebugLevels()}}:(e=e.substr(0,e.lastIndexOf(this.SPECIAL_CHARS.SLASH)),this.getCoreHeadersFromContext(e))}processCoreHeaders(e,t,n){const s=this.getCoreHeadersFromContext(n);if(s){const t=Object.keys(e);if(t.includes(Gs.SKIPCOREHEADERS))return void delete e[Gs.SKIPCOREHEADERS];const n=Object.assign({},...Object.values(s));Object.keys({...n}).forEach((s=>{t.includes(s)||(e[s]=n[s])}))}}injectCoreAdditionalHeaders(e,t,n,s){s?.includeRemoteSystemIdIfPresent&&qs.injectRemoteCaseHeader(e,t,n),this.processCoreHeaders(e,t,n)}},Zu=Xu;const ed="updateSession",td={},nd=new Ju,sd=new class{constructor(){this.timerID=void 0,this.expiryBuffer=45,this.timeoutWarned=!1}setTimerID=e=>{this.timerID=e};getTimerID=()=>this.timerID;resetInactiveTimeout=e=>{const t=window.PCore?.getEnvironmentInfo().getInactivityTimeout();if(this.timeoutWarned&&(Uu.unsubscribe($s.PUB_SUB_EVENTS.RESET_TIMER,"resetCallback"),this.timeoutWarned=!1),t)return e&&clearTimeout(e),this.startInactivityTimeout(t>60?t:60)};startInactivityTimeout=e=>{const t=setTimeout((()=>{Uu.publish($s.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),Uu.subscribe($s.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let ad={},rd={},od={},id="";const cd=e=>{ad=e},ld=e=>{if("OAuth2.0"===e?.authType&&e.secureCookie||"custom"===e?.authType&&e.customCookies)return!0},ud=(e,t,n="root",s={})=>{const{doNotMergeHttpMessagesForStatusCode:a=null,cancelContext:r=n,includeRemoteSystemIdIfPresent:o=!0}=s;id=a,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:i,signal:c,responseType:l,adapter:u,withoutDefaultHeaders:d=!1,...p}=t,{Authorization:g,pzCTkn:h,...f}=t.headers||{};d||Zu.injectCoreAdditionalHeaders(f,t.body,n,{includeRemoteSystemIdIfPresent:o}),r&&td[r]>=0?td[r]+=1:r&&void 0===td[r]&&(td[r]=1);let m=d?{...f}:{...Zu.getDefaultHeaders(),...Zu.getRegisteredHeaders(),...f,context:n};if(p.isExternalUrl=(e=>!e?.startsWith(un()||""))(e||""),p.fetchTimeStamp=Date.now(),e&&Hu(e,rd)&&nd.getUpdateSessionStatus()||!nd.getUpdateSessionStatus()||p.isExternalUrl){Hu(e,rd)&&"OAuth2.0"===rd?.authType&&(m={...f});const{restApi:t}=By.doesRestApiExist("Logout")&&By.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&sd.setTimerID(sd.resetInactiveTimeout(sd.getTimerID())),function(e,t){var n="object"==typeof t;return new Promise((function(s,a){var r,o=!1;e.subscribe({next:function(e){r=e,o=!0},error:a,complete:function(){o?s(r):n?s(t.defaultValue):a(new Qc)}})}))}(eu(Yc({context:n,...p,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},responseType:l,adapter:u,headers:m,withCredentials:ld(rd)})).pipe((I=()=>{const e=Zu.getCoreHeadersFromContext(m.context);e&&(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.FETCH_SUCCESS,e)})({...e})},(A=cl(I)||E||y?{next:I,error:E,complete:y}:I)?zl((function(e,t){var n;null===(n=A.subscribe)||void 0===n||n.call(A);var s=!0;e.subscribe(Yl(t,(function(e){var n;null===(n=A.next)||void 0===n||n.call(A,e),t.next(e)}),(function(){var e;s=!1,null===(e=A.complete)||void 0===e||e.call(A),t.complete()}),(function(e){var n;s=!1,null===(n=A.error)||void 0===n||n.call(A,e),t.error(e)}),(function(){var e,t;s&&(null===(e=A.unsubscribe)||void 0===e||e.call(A)),null===(t=A.finalize)||void 0===t||t.call(A)})))})):wl),tu((e=>{const t=m,n=!!t?.[Gs.COREHEADER_APP_DEBUG_ID]?{debugInfo:{[Gs.COREHEADER_APP_DEBUG_ID]:t?.[Gs.COREHEADER_APP_DEBUG_ID],[Gs.COREHEADER_APP_DEBUG_LEVELS]:Vu.getDebugLevels()}}:Zu.getCoreHeadersFromContext(m.context);throw n&&(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.FETCH_FAILURE,e)})({...n,error:e}),e}))))}var I,E,y,A;return dd(e,t,n,nd)},dd=(e,t,n,s)=>new Promise(((a,r)=>{Uu.subscribe(ed,(o=>{s.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?ud(e,t,n).then((e=>a(e))).catch((e=>r(e))):r(o.updateStatus.error)}),ed)})),pd=e=>{td[e]>0&&(td[e]-=1,0===td[e]&&delete td[e])};Yc.interceptors.request.use((e=>Fu.isOnline()?(ad?.request&&(e=ad.request(e)),e):(aC(e.context)?.isLoading&&sC({type:pa,payload:{context:e.context}}),sC({type:ga,payload:{context:"app"}}),Promise.reject(new Error("Network Offline")))),(e=>Promise.reject(e))),Yc.interceptors.response.use((e=>{if(202===e.status&&e.config.headers.context&&e.data?.caseInfo&&"object"==typeof e.data.caseInfo&&"errorMessage"in e.data.caseInfo){const t=[{type:"error",message:String(e.data.caseInfo.errorMessage)}];let n=e.config.headers.context;return n&&n.includes("/workarea")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),Pu({messages:t,category:"HTTP",context:n}),Promise.reject(e)}if(e.config.headers&&e.config.headers.context){if(!e.config.skipClearErrorMessages){Tu({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&Du({type:"error",category:"HTTP",context:e.config.headers.context}),Tu({type:"error",category:e.config.headers.context===Gs.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&Du({type:"error",category:"PAGE",context:e.config.headers.context});e.config.headers.context.slice(e.config.headers.context.lastIndexOf("/")+1).startsWith("primary")&&(Tu({type:"error",category:"HTTP",context:Gs.APP.APP}).length>0&&Du({type:"error",category:"HTTP",context:Gs.APP.APP}),Tu({type:"error",category:"PAGE",context:Gs.APP.APP}).length>0&&Du({type:"error",category:"PAGE",context:Gs.APP.APP}))}pd(e.config.headers.context)}return ad?.response&&(e=ad.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&pd(e.config.headers.context),"ERR_NETWORK"===e.code||"ECONNABORTED"===e.code||"Network Offline"===e.message||!0===e.isOffline?(aC(e.config?.headers?.context)?.isLoading&&sC({type:pa,payload:{context:e.config?.headers?.context}}),Fu.reportNetworkFailure(),Promise.reject(new Error("Network Offline"))):("Network Offline"!==e.message&&aC(Gs.APP.APP)?.context_data?.isOffline&&Fu.reportNetworkRecovery(),!e.response&&e.cause?.response&&(e.response=e.cause.response),!e.response||!e.response.status||401!==e.response.status||e.config.isExternalUrl||e.config&&Hu(e.config.url,rd)||Uu.subscribe(ed,(e=>{nd.setUpdateSessionStatus(!e.updateStatus)}),ed),Qu(e,nd,rd,e.response&&e.response.status&&e.response.status===Number(id)?id:null)))));const gd=()=>Yc.CancelToken.source(),hd=e=>Yc.isCancel(e),fd=e=>{Zu.setDefaultHeaders(e)},md=e=>{rd={...rd,...e}},Id=e=>{od={...od,...e}},Ed=()=>({...od}),yd=()=>({...rd});const Ad=class{static formatPageReference(e){const t=e?.split(".").map((e=>{if(e.includes("[")){const t=e.indexOf("["),n=e.indexOf("]"),s=e.substring(t+1,n),a=Number(s)+1;return`${e.substring(0,t)}(${a})${e.substring(n+1)}`}return e}));return t.join(".")}static formatePageReferenceToArrayIndex(e){const t=e?.split(".").map((e=>{if(e.includes("(")){const t=e.indexOf("("),n=e.indexOf(")"),s=e.substring(t+1,n),a=Number(s);if(!Number.isNaN(a)){const s=a-1;return`${e.substring(0,t)}[${s}]${e.substring(n+1)}`}}return e}));return t.join(".")}static getFieldLabel(e){let t=e?.label;if(!t&&e?.inheritedProps){const n=e?.inheritedProps;(n.showLabel??1)&&(t=n.label)}return t}};const Cd=class{static execute(e,t,n,s){const a=!Gy.isInfinityRuntime(),r={};Object.hasOwn(n,"nonFormProperties")&&(n.nonFormProperties.forEach((e=>{r[e]=n[e],delete n[e]})),delete n.nonFormProperties);const o={instruction:"string"==typeof t?"ADD":"INSERT",content:{...AC.unflatten(n)}},i=JSON.parse(JSON.stringify(o)),c=i.content.classID||i.content["@class"];delete i.content.classID;return{instruction:{target:AC.buildInstructionPageReference(s,e),content:{...a&&c?{"@class":c}:{},...i.content},["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"string"==typeof t?"ADD":"INSERT"},actionPayload:o,displayPropertPayload:r}}};const Sd=class{static execute(e,t,n,s,a,r,o,i){const c=!Gy.isInfinityRuntime(),l="string"==typeof n?`${t}(${n})`:`${t}[${n-1}]`,u=iC(".classID",`${a}${l}`,e)||iC(".@class",`${a}${l}`,e),d={instruction:"UPDATE",content:{...AC.unflatten(s)},isDefault:i},p={content:{...c&&u?{"@class":u}:{},...d.content},target:AC.buildInstructionPageReference(a,t),["string"==typeof n?"groupIndex":"listIndex"]:n,instruction:"UPDATE"};return r||sC(cS({...d,["string"==typeof n?"groupIndex":"listIndex"]:"string"==typeof n?n:n-1,context:e,referenceList:`${a}${t}`,skipDirtyValidation:o})),p}};const _d=class{static execute(e,t,n){return{target:AC.buildInstructionPageReference(n,e),["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"DELETE"}}};const Nd=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:AC.buildInstructionPageReference(e,t)}}static execute(e,t,n,s){s||sC(cS({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const Td=class{static execute(e,t,n,s){return{target:AC.buildInstructionPageReference(s,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const Dd=class{static execute(e,t,n){const s=!Gy.isInfinityRuntime(),a={instruction:"REPLACE",content:{...AC.unflatten(t)}},r=a.content.classID||a.content["@class"];delete a.content.classID;return{instruction:{target:AC.buildInstructionPageReference(n,e),content:{...s&&r?{"@class":r}:{},...a.content},instruction:"REPLACE"},actionPayload:a}}};const Pd=class{static execute(e,t){return{target:AC.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const Od=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const Rd=class{constructor(e,t,n){this.target=e,this.pageReference=t,this.contextName=n,this.root=null,this.current=null,this.changeList={},this.hasEncryptedContent=!1,this.targetPageReference=t+e,this.children=[],this.visibility=!0}addChild(e){null===this.current&&this.insertNode({}),this.current.childrenStateMachines.push(e)}insertNode(e){const t=new Od(e);null===this.root&&(this.root=t),null!==this.current&&(t.previous=this.current,this.current.next=t),this.current=t}applyEncryptedContent(e){void 0!==e&&(this.current.instruction.encryptedContent=e)}buildChildSumbitPageInstructions(e,t){let n=[];return e.childrenStateMachines.forEach((e=>{e.visibility&&(n=n.concat(e.buildSubmitPageInstructions(t)))})),n}buildSubmitPageInstructions(e=!1){let t=this.root,n=[];for(;t;)!t.instruction.instruction||e&&t.automatic||n.push(t.instruction),n=[...n,...this.buildChildSumbitPageInstructions(t,e)],t=t.next;return n}initPageInstructions(e,t,n){const s=e.getValue(this.target)||[];if(Array.isArray(s)){if(t)return void s.forEach(((e,s)=>{t.forEach((t=>{const a=Ym(t),r={};let o=!0;n&&(r[Ym(n)]=crypto.randomUUID(),o=!1);const i={[a]:AC.getIn(e,a),...r};this.update(i,s+1,o,{isDefault:!0,skipDirtyValidation:!0})}))}));s.forEach(((e,t)=>{if(n&&!e[Ym(n)]){const e={};e[Ym(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{isDefault:!0,skipDirtyValidation:!0})}}))}t&&s&&"object"==typeof s&&!Array.isArray(s)&&Object.keys(s).length>0&&this.processObjectRows(s,t,n)}processObjectRows(e,t,n){Object.keys(e).forEach((s=>{const a=e[s];t.forEach((e=>{const t=Ym(e),r={};let o=!0;n&&(r[Ym(n)]=crypto.randomUUID(),o=!1);const i={[`${t}`]:AC.getIn(a,t),...r};this.update(i,s,o,{isDefault:!0})}))}))}getChangeList(){return this.changeList}initChangeList(e){this.changeList[this.targetPageReference]=this.changeList[this.targetPageReference]||[],this.changeList[this.targetPageReference][e]=this.changeList[this.targetPageReference][e]||{}}update(e,t,n,s){const{isDefault:a=!1,skipPageinstruction:r,skipDirtyValidation:o=!1,encryptedContent:i}=s,c=Sd.execute(this.contextName,this.target,t,e,this.pageReference,n,o,a);if(!r){if("string"==typeof t?this.initChangeList(t):this.initChangeList(t-1),!a){const n=this.changeList?.[this.targetPageReference]?.["string"==typeof t?t:t-1].content;this.changeList[this.targetPageReference]["string"==typeof t?t:t-1]=hC(AC.deepClone(n),e,s)}if(this.current?.automatic===a&&(this.current?.instruction?.groupIndex===t||this.current?.instruction?.listIndex===t)&&"UPDATE"===this.current?.instruction.instruction){const t=this.current.instruction.content;return this.current.instruction.content=hC(AC.deepClone(t),AC.unflatten(e),s),void this.applyEncryptedContent(i)}this.insertNode(c),this.applyEncryptedContent(i),a&&(this.current.automatic=!0)}}delete(e,t){const n=_d.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||sC(cS({instruction:"DELETE",listIndex:"string"==typeof e?e:e-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}insert(e,t,n,s){const{instruction:a,actionPayload:r={content:{}},displayPropertPayload:o={}}=Cd.execute(this.target,t,e,this.pageReference),{isDefault:i=!1,encryptedContent:c,skipDirtyValidation:l=!1}=s;if(this.initChangeList("string"==typeof t?t:t-1),!i){const n=this.changeList?.[this.targetPageReference]?.["string"==typeof t?t:t-1].content;this.changeList[this.targetPageReference]["string"==typeof t?t:t-1]=hC(AC.deepClone(n),e,s)}this.root&&!this.root.instruction?.instruction&&this.current&&!this.current.instruction?.instruction?this.root.instruction=a:this.insertNode(a),this.applyEncryptedContent(c),n||(r.content={...r.content,...o},sC(cS({...r,["string"==typeof t?"groupIndex":"listIndex"]:"string"==typeof t?t:t-1,c11nEnv:s.c11nEnv,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,skipDirtyValidation:l}))),i&&(this.current.automatic=!0)}replacePage(e,t,n,s,a){const r=s??this.pageReference,o=n??this.target,{instruction:i,actionPayload:c}=Dd.execute(o,e,r);this.insertNode(i),this.applyEncryptedContent(a),t||sC(cS({...c,context:this.contextName,referenceList:`${r}${AC.convertClipboardPageToPageRefNotation(o)}`}))}deletePage(e){const t=Pd.execute(this.target,this.pageReference);this.insertNode(t),e||sC(cS({instruction:"DELETEPAGE",context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}move(e,t){const n=this.changeList[this.targetPageReference]?.splice(e-1,1);this.changeList[this.targetPageReference]?.splice(t-1,0,n[0]);const s=Td.execute(this.target,e,t,this.pageReference);this.insertNode(s),sC(cS({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=Nd.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),Nd.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){if(!this.current?.instruction||!e)return;const t=this.current.instruction.content||{};this.current.instruction.content=hC(AC.deepClone(t),e)}},bd={},vd={},xd={},wd=(e,t,n)=>{bd[e]||(bd[e]={}),bd[e][t]||(bd[e][t]={content:[]}),vd[e]||(vd[e]=[],xd[e]=[]),qm.isStateMachineExist(e,n,t)||qm.setStateMachine(e,t,n,new Rd(t,n,e))},Md=e=>Ad.formatPageReference(e),Ld=(e,t)=>{const n=vd[e],s=xd[e],a=Ym(t),r=a?.substring(0,a.indexOf("["));s?.indexOf(r)<0&&xd[e].push(r),n?.indexOf(a)<0&&vd[e].push(a)},Ud=e=>{delete vd[e]},Fd=e=>qm.buildPageInstructionsByContext(e),Vd=e=>{qm.clearStateMachines(e),delete bd[e]},jd=(e,t,n,s)=>{let[,a]=t.split(`${e}[${s}]`);""!==a&&void 0!==a&&(a=a.startsWith(".")?a.substring(1):a,Object.keys(n).forEach((e=>{n[`${a}.${e}`]=n[e],delete n[e]})))},kd=(e,t,n,s,a)=>{const{skipStateUpdate:r=!1,insertIfEmpty:o=!1,skipDirtyValidation:i=!1}=a||{},c=n.getContextName(),l=n.getReferenceList(),u=s||n.getPageReference(),d=Md(l);wd(c,d,u),Ld(c,`${l}[${t}]`),jd(l,u,e,t);const p={instruction:Gs.LIST_ACTIONS.INSERT,content:{...AC.unflatten(e)}};delete JSON.parse(JSON.stringify(p)).content.classID;const g=qm.getStateMachine(c,u,d);o&&g?.root||g.insert(e,t+1,r,{c11nEnv:n,skipDirtyValidation:i})},Bd=(e,t,n=0,s={})=>{const{skipStateUpdate:a=!0,pageRef:r}=s,o=t.getContextName();let i=t.getReferenceList();const c=r||t.getPageReference();i||(i=((e,t)=>{const n=e.indexOf($s.CONTENT)+$s.CONTENT.length,s=e.lastIndexOf(`[${t}]`);return e.substring(n,s)})(c,n));const l=Md(i);wd(o,l,c),Ld(o,`${i}[${n}]`),jd(i,c,e,n);qm.getStateMachine(o,c,l).update(e,n+1,a,s)},$d=(e,t)=>{const[,n]=e.split("."),s=t?.split(".").pop();return n===s},Gd=e=>{const t=AC.getPropertyName(e),n=t.indexOf(".");return n>=0?t.slice(n+1):t},Wd=(e,t,n)=>{const s={};return Object.values(e).forEach((e=>{if($d(e,n)){const n=Gd(e).split(".");if(n.length>1){let e=AC.getIn(t,n)??"";if(!e){const s=`!P!${n.join(":")}`;e=AC.getIn(t,s)??""}AC.setIn(s,n,e)}else{const e=AC.getIn(t,n)??"";s[n[n.length-1]]=e}}})),s},Hd=(e,t,n,s,a)=>{const r=e.getValue(t)||{};n&&Object.keys(r).length>0&&e.clearErrorMessages({property:s?a:e.getStateProps().value})},qd=(e,t,n)=>new Promise((s=>{const{skipPageInstructions:a=!1}=n,{selectionMode:r,selectionList:o,required:i}=t.getConfigProps(),c=r===Gs.LIST_SELECTION_MODE.MULTI,l=t.getContextName();let u=t.getPageReference(),d=((e,t,n)=>e?n.substring(1):t.substring(t.lastIndexOf(".")+1))(c,u,o);const p=t.getRawMetadata();let g=null;const h=(e=>e?.config?.dataRelationshipContext&&"SimpleTableSelect"===e.type&&"single"===e.config?.selectionMode)(p);h&&(d=p?.config?.dataRelationshipContext,g=u.concat(".").concat(d),u=g);const f=((e,t,n)=>e?`${t}${n}`:t)(c,u,o),m=((e,t,n,s)=>t?e.getFieldMetadata(`${n}`):e.getCurrentPageFieldMetadata(s))(t,c,d,g),{datasource:{parameters:I={}}}=m,E={...I};if(((e,t,n)=>{t?.descriptors?.length&&!n&&t.descriptors.forEach((t=>{e[Gd(t)]=t}))})(E,m,c),c){let n=o;n=Md(n);const s=t.getValue(f)||[];wd(t.getContextName(),n,u);const r=[];let i=s.length;e.forEach((e=>{const t=Wd(I,e,d),o={};if(Object.hasOwn(e,"displayProperty")){const t=e.displayProperty;o[t]=e[t]}const c=Object.entries(t);let p=s.findIndex((e=>c.every((([t,n])=>e[t]===n))));if(-1===p?(p=i,e.$selected&&(i+=1)):i=i?i-1:0,!a){const s=qm.getStateMachine(l,u,n);e.$selected?s.insert(t,p+1,!0,{}):s.delete(p+1,!0)}r.push({instruction:e.$selected?Gs.LIST_ACTIONS.SELECT:Gs.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...o}})})),sC(cS({instruction:Gs.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${u}.${d}`,actions:r}))}else{const n=Wd(E,e[0],d),s=p?.config?.compositeKeys||[];if(t.getRawConfigProps().onlyAllowRefreshOnCompositeKeys&&s.length){const a=s?.reduce(((e,t)=>(e[Gd(t)]=t,e)),{})||{},r=Wd(a,e[0],d);Object.keys(r).forEach((e=>{delete n[e],t.getActionsApi().updateFieldValue(`.${e}`,r[e],h?{contextPageReference:u}:{}),t.getActionsApi().triggerFieldChange(`.${d}.${e}`,r[e])}));const o=(e=>e.length>1&&e.pop()||"")(u.split(/\[\d+\]/gm));t.getActionsApi().updateFieldValue(o,n,h?{contextPageReference:u}:{}),t.getActionsApi().triggerFieldChange(o,n)}else Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],h?{contextPageReference:u}:{}),t.getActionsApi().triggerFieldChange(`.${d}.${e}`,n[e])}))}Hd(t,f,i,c,d),s()})),zd=e=>{if(!e)return!1;const t=(n=e,qm.buildPageInstructionsByContext(n,!0));var n;return Array.isArray(t)&&t.length>0};const Yd=(e,t,n={})=>{const{skipStateUpdate:s=!1}=n,a=e.getPageReference(),r=Md(t);wd(e.getContextName(),t,a);qm.getStateMachine(e.getContextName(),a,r).deleteAll(s);const o=qm.getUnConnectedStateMachines(e.getContextName())||{};Object.keys(o).forEach((e=>{e.includes(`${a}${r}`)&&e!==`${a}${r}`&&(o[e]=null)}))},Kd=e=>({insert:(t,n,s,a)=>kd(t,n,e,s,a),update:(t,n,s)=>Bd(t,e,n,s),updateProperty:(t,n,s)=>((e,t,n,s={})=>{const a=n.getPageReference(),{stateMachineTarget:r}=qm.getStateMachineObjByPath(`${a}${e}`,n.getContextName(),`${a}${e}`.endsWith("]"));if(!r){let e=a.substring(0,a.lastIndexOf("["));e||(e=a.substring(0,a.lastIndexOf(".")));const t=e.substring(e.lastIndexOf("."));e=e.substring(0,e.lastIndexOf(".")),e&&t&&wd(n.getContextName(),t,e)}qm.executeStateMachine(n.getContextName(),`${a}${e}`,t,!0,s)})(t,n,e,s),deleteEntry:(t,n,s)=>((e,t,n,s)=>{const{skipStateUpdate:a=!1}=s||{},r=t.getContextName(),o=t.getReferenceList(),i=n||t.getPageReference(),c=`${i+o}[${e}]`,l=Md(o);Du({type:$s.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:c,context:r,isListEntry:!0,deletingIndex:e}),wd(r,l,i),Ld(r,`${o}[${e}]`);const u=qm.getStateMachine(r,i,l);"string"==typeof e?u.delete(e,a):u.delete(e+1,a);const d=qm.getUnConnectedStateMachines(r)||{};Object.keys(d).forEach((e=>{e.includes(`${i}${l}`)&&e!==`${i}${l}`&&(d[e]=null)}))})(t,e,n,s),reorder:(t,n)=>((e,t,n)=>{const s=n.getContextName(),a=n.getReferenceList(),r=n.getPageReference(),o=Md(a);wd(s,o,r),yu.deleteAllListNodes(s,`${r}${o}`,!1),Ld(s,`${a}[${t}]`),qm.getStateMachine(s,r,o).move(e+1,t+1);const i=qm.getUnConnectedStateMachines(s)||{};Object.keys(i)?.forEach((e=>{e.includes(`${r}${o}`)&&e!==`${r}${o}`&&delete i[e]}))})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>qd(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:s}=t.getConfigProps(),a=[];let r=t.getPageReference();const o=n===Gs.LIST_SELECTION_MODE.MULTI;let i=o?s.substring(1):r.substring(r.lastIndexOf(".")+1);const c=t.getRawMetadata();let l=null;c?.config?.dataRelationshipContext&&"SimpleTableSelect"===c.type&&"single"===c.config?.selectionMode&&(i=c.config.dataRelationshipContext,l=r.concat(".").concat(i),r=l);const u=o?`${r}${s}`:r;let d=t.getValue(u)||[];if(Array.isArray(d)||(d=[d]),e)return Promise.resolve(d);const{datasource:{parameters:p={}}={}}=o?t.getFieldMetadata(`${i}`):t.getCurrentPageFieldMetadata(l);return d.forEach((e=>{const t=Object.values(p).reduce(((t,n)=>{const s=n.substring(n.lastIndexOf(".")+1);return $d(n,i)&&e[s]?`${t}${e[s]}`:t}),"");t.trim()&&a.push(t.trim())})),Promise.resolve(a)})(t,e),clearSelectedRows:()=>function(e){const{selectionList:t,required:n}=e.getConfigProps(),s=e.getContextName(),a=e.getPageReference(),r=t,o=`${a}${t}`;return new Promise((t=>{let i=r;i=Md(i),wd(s,i,a),qm.getStateMachine(s,a,i).deleteAll(),Hd(e,o,n,!0,r),t()}))}(e),setVisibility:t=>((e,t=!0)=>{const n=e.getContextName(),{selectionMode:s,selectionList:a,renderMode:r,referenceList:o}=e.getComponentConfig();let i;if(s===Gs.LIST_SELECTION_MODE.MULTI&&a?i=a:"Editable"===r&&o&&(i=e.getStateProps().referenceList),i){i=Md(i);const s=qm.getStateMachine(n,"",`${e.getPageReference()}${i}`);s&&(s.visibility=t)}})(e,t),initDefaultPageInstructions:(t,n,s)=>((e,t,n,s)=>{const a=e.getContextName(),r=e.getPageReference(),o=Md(t);wd(a,o,r),qm.getStateMachine(a,r,o).initPageInstructions(e,n,s)})(e,t,n,s),deleteAll:(t,n)=>Yd(e,t,n),replacePage:(t,n,s)=>((e,t,n,s)=>{const{skipStateUpdate:a=!1}=s||{},r=e.getPageReference(),o=e.getContextName();wd(o,t,r),Ld(o,AC.buildInstructionPageReference(r,t)),qm.getStateMachine(o,r,t).replacePage(n,a)})(e,t,n,s),deletePage:(t,n)=>((e,t,n)=>{const{skipStateUpdate:s=!1}=n||{},a=e.getPageReference(),r=e.getContextName();wd(r,t,a),Ld(r,AC.buildInstructionPageReference(a,t)),qm.getStateMachine(r,a,t).deletePage(s)})(e,t,n)});const Qd=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?AC.mergeDeep(e,this.fieldDefaults):AC.copy(e,this.fieldDefaults))}setFieldDefault(e,t,n){e&&t&&(this.fieldDefaults[e]=this.fieldDefaults[e]||{},"object"==typeof this.fieldDefaults[e]&&null!==this.fieldDefaults[e]&&(this.fieldDefaults[e][t]=n))}getDefaultsforType(e){return this.fieldDefaults[e]}},Jd="downloadAttachment",Xd={};function Zd(e,t){const n=ks.getDefaultQualifiedName(t);return n!==t&&n in e?e[n]:e[t]}const ep=e=>{const t=gd();return Xd[e]=t,t};function tp(e){const t=new URL(e,window.location.origin),n=Gy.environmentInfoObject?.encCSRFToken;return n&&t.searchParams.set("pzencv1zzz",n),t.searchParams.set("mode","stream"),t.toString()}async function np(e){const t=function(){if("undefined"!=typeof window&&"showSaveFilePicker"in window)return window.showSaveFilePicker}();if(!t)return null;try{const n=await t({suggestedName:e}),s=await n.createWritable();return{fh:n,writable:s}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return null;throw e}}async function sp(e,t,n){const s=await np(t);if(s)try{const t=await async function(e,t){let n;await ud(e,{method:"GET",adapter:async e=>(n=e,{data:null,status:204,statusText:"No Content",headers:{},config:e}),withoutDefaultHeaders:!1},t,{includeRemoteSystemIdIfPresent:!0});const s={};return Object.entries(n?.headers??{}).forEach((([e,t])=>{"string"==typeof t&&(s[e]=t)})),s}(e,n),a=await fetch(e,{method:"GET",headers:t});if(!a.ok)throw new Error(`Download failed: ${a.status}`);if(!a.body)throw new Error("Download response has no body");await a.body.pipeTo(s.writable)}catch(e){throw await s.writable.abort().catch((()=>{})),e}}const ap=e=>{let t="document-doc";if(!e)return t;if(e.startsWith("audio"))t="audio";else if(e.startsWith("video"))t="video";else if(e.startsWith("image"))t="picture";else if(e.includes("pdf"))t="document-pdf";else{const[,n]=e.split("/"),s=e=>e.some((e=>n.includes(e)));s(["excel","spreadsheet"])?t="document-xls":s(["zip","compressed","gzip","rar","tar"])&&(t="document-compress")}return t},rp=e=>{const t=Zd(e,"pyCategoryLabel"),n=Zd(e,"pyCategoryName"),s=Zd(e,"Category"),a=Zd(e,"pxCreateOpName"),r=Zd(e,"pxCreateOperator"),o=e.CreateUser,i=Zd(e,"pyFileName"),c=Zd(e,"FileName"),l=Zd(e,"FileExtension"),u=Zd(e,"pyAttachName"),d=Zd(e,"pyMimeFileExtension"),p=Zd(e,"MimeType"),g=Zd(e,"pzInsKey"),h=Zd(e,"ID"),f=Zd(e,"pyAttachmentLink"),m=Zd(e,"AttachmentURL"),I=Zd(e,"pxAttachmentCreateTime"),E=Zd(e,"pxCreateDateTime"),y=Zd(e,"CreateDateTime"),A=Zd(e,"pxStorageType"),C=Zd(e,"pyFileSize"),S=Zd(e,"error"),_=Zd(e,"thumbnail"),N=Zd(e,"pyIsLargeAttachment"),T=Zd(e,"IsLargeAttachment");let D,P,O,R;return D=t?`${t},`:n?`${n},`:s,P=a||(r||o?.Name||""),O=i||(l&&""!==l&&c?.endsWith(l)?c.substring(0,c.lastIndexOf(l)-1):c),R=u&&i?u.startsWith(i)&&u.split(".").length-1===i.split(".").length?u.split(".").pop():"":l??"",{props:{meta:`${D} ${P}`,name:u??c??"",icon:ap(d??p??""),error:S??null,thumbnail:_??null},responseProps:{fileName:u??c??"",name:O??"",category:n??s??"",extension:R,ID:g??h??"",mimeType:d??p??"",attachmentURL:f??m??"",createUser:P??"",createDateTime:I??E??y??"",responseType:e.responseType??(h?"binary":null),localAttachment:!!e.localAttachment,storageType:A??void 0,fileSize:C??void 0,isLargeAttachment:void 0!==N?"true"===N:T}}},op=e=>{let t=[],n=!1;if(e&&Object.hasOwn(e,ks.getDefaultQualifiedName("pyCount"))){n=!0;const s=Zd(e,"pxResults");t=Array.isArray(s)?s.filter((e=>!!Zd(e,"pzInsKey"))).map((e=>rp(e))):[]}else if(e&&"object"==typeof e){let n;n=Array.isArray(e)?e:[e],t=n?.filter((e=>Zd(e,"ID")&&Zd(e,"FileName")||Zd(e,"pzInsKey"))).map(rp)}else t=[];const s=e?Zd(e,"pyCategoryName"):void 0;return{hasUploadedFiles:t.length>0,categoryName:("string"==typeof s?s:"")||t?.[0]?.responseProps?.category||"",attachments:t,isOldAttachment:n}},ip={uploadAttachment:(e,t,n,s,a,r)=>{const o=new FormData;o.append("appendUniqueIdToFileName","true"),o.append("file",e),a&&o.append("contextID",a),r&&o.append("category",r);const{restApi:i,reqType:c}=_S("uploadAttachment",{}),l={"Content-Type":"multipart/form-data"};return Boolean(Gy?.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories)&&(l["x-pega-stream-support"]="repository-stream"),ud(i,{method:c,headers:l,body:o,onUploadProgress:t,signal:ep(e.ID).token},s).then((t=>({type:"File",category:e.category||"File",ID:t.data.ID,clientFileID:e.ID,filename:e.name}))).catch(n?n(hd,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete Xd[e.ID]))},linkAttachmentsToCase:(e,t,n,s)=>{const a={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,n&&(a.signal=ep(n).token)}const{restApi:r,reqType:o}=_S("linkCaseAttachment",{caseID:e});return ud(r,{...a,body:{attachments:t},method:o},s)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:s,reqType:a}=_S("getCaseAttachments",{caseID:e,includeThumbnail:n});return ud(s,{method:a},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:s,reqType:a}=_S("getAttachmentCategories",{caseID:e,type:t});return ud(s,{method:a},n).then((e=>e.data))},downloadAttachment:(e,t,n,s,a)=>{e=e.replace(/\//g,"_");const{restApi:r,reqType:o}=_S(Jd,{attachmentID:e}),i=a&&r?(()=>{const e=new URL(r,window.location.origin);return e.searchParams.set("encoding",a),e.toString()})():r;return function(e){const t=Gy.environmentInfoObject;return!(!t?.pyFeatures?.pyEnableStreamingForRepositories||"repository"!==e?.toLowerCase()||"EMBED"===t?.renderingMode&&!Gy.isPegaMobile())}(s)&&r?async function(e){return await zu(yd()),{data:tp(e)}}(r):ud(i,{method:o,..."binary"===n&&!a&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:s,reqType:a}=_S("editAttachment",{attachmentID:e});return ud(s,{method:a,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:s}=_S("deleteAttachment",{attachmentID:e});return ud(n,{method:s},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:s}=_S("downloadDocument",{documentID:e});return ud(n,{method:s},t)},deleteDocument:(e,t,n)=>{const{restApi:s,reqType:a}=_S("deleteDocument",{caseID:e,documentID:t});return ud(s,{method:a},n)},getDocumentURL:e=>{const t=PCore.getEnvironmentInfo().getDocumentUrlDP()||ks.getDefaultQualifiedName("D_pxGetDocumentURL");return PCore.getDataPageUtils().getPageDataAsync(t,e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getDocumentURL API : ",t.response)}))},cancelRequest:e=>{Xd[e]&&(Xd[e].cancel(),delete Xd[e])},buildFilePropsFromResponse:rp,getAttachmentURL:e=>{const{restApi:t}=_S(Jd,{attachmentID:e});return t},prepareAttachmentData:op,validateAttachments:(e,t)=>{let n=e;if((e=>null!==e&&"object"==typeof e&&"hasUploadedFiles"in e&&"boolean"==typeof e.hasUploadedFiles)(t)){const{attachments:e}=t;0===e.length&&(n="")}else{const{attachments:e}=op(t);0===e.length&&(n="")}return n},streamDownloadAttachment:async(e,t,n)=>{if(!Gy.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories)return;e=e.replace(/\//g,"_");const{restApi:s}=_S(Jd,{attachmentID:e});s&&(await zu(yd()),await sp(tp(s),t,n))}};let cp=!1;const lp=e=>{cp=e},up=new Map,dp=(e,t)=>{up.set(e,t)},pp=e=>{up.delete(e)};class gp{constructor(){this.validators={}}static messageDispatcher(e,t,n,s,a,r){if(s){const o=[];o.push({type:$s.MESSAGES.MESSAGES_TYPE_ERROR,fieldLabel:a,message:s,...r??{}}),Pu({messages:o,property:e,pageReference:t,context:n})}}register(e,t){this.validators[e]=t}getValidator(e){return this.validators[e]}validateRequired(e,t,n,s,a,r){const{required:o,value:i}=r;let c=null;if(!("true"!==o&&!0!==o)){let o=s;switch(e){case"radiobuttons":o=i;break;case"attachment":o=ip.validateAttachments(s,i);break;case"checkbox":o&&"false"!==o||(o="");break;default:"string"==typeof o&&(o=o.trim())}c=this.getValidator("required")(o),gp.messageDispatcher(t,n,a,c,Ad.getFieldLabel(r),{subType:"required"})}return c}validateType(e,t,n,s,a,r){let o=null;const i={pageReference:n,context:a,property:t,...r};let c=Qd.getDefaultsforType(r?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(s,i),(""!==s||Qd.getDefaultsforType(r?.componentName||"")?.showErrorWhenEmpty)&&gp.messageDispatcher(t,n,a,o,r?.label));const l=r?.validationType;return c=l&&Qd.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(s,i),gp.messageDispatcher(t,n,a,o,r?.label)),o}validate(e,t,n,s={}){const{context:a,disabled:r,readOnly:o,pageReference:i,skipRequiredValidation:c}=s;let l=null;return r||o||(c||cp||(l=this.validateRequired(e,t,i,n,a,s)),l||(l=this.validateType(e,t,i,n,a,s))),{message:l}}isValidatorExist(e){return!!e.validatetype}}const hp=new gp,fp=e=>{e&&vA(e)},mp=(e,t)=>{e.DeclareExpressions&&t.context&&_o({[t.context]:e.DeclareExpressions})},Ip=(e,t,n=!1)=>{const s=AC.getIn(e,Gs.RESOURCES);s&&(fp(s),mp(s,t)),n||vS({...e,options:t})};class Ep{static createCase(e,t){const{caseInfo:n,startingFields:s,flowType:a,viewType:r=Im.PAGE,pageName:o,context:i=Gs.APP.APP,debugInfo:c,headers:l,theType:u,retrieveActionViewForNewObject:d=!1}=t;let p={};n&&n.content&&(p=n.content);const{content:g={},pageInstructions:h}=Ep.getExternalCaseOrObjectContent(e,d,i);let f={[Ep.getKeyBasedOnWorkType(e)]:e,content:{...p,...s,...g}};if(f={...f,...h&&{pageInstructions:h},...!lI.isObjectCaseType(e)&&{processID:a}},"CREATE_EXTERNAL_CASE"===u){const e=aC(i)?.caseInfo?.content;if(e){const t=AC.pruneKeys(e,new Set(["pxObjClass",ks.getDefaultQualifiedName("pxObjClass"),"EmbedListUUID__",ks.getDefaultQualifiedName("EmbedListUUID__")]),!1);f.content[Gs.getDefaultQualifiedName("pyAddCaseContextPage")]=t}}const m=Ep.getObjectTypeViewPayload(d,e);return Cp(lI.getRouteKeyForCreateWork(e,d),{body:f,queryPayload:{...m,...lI.isExternalCaseType(e)?{casetypeID:e}:{caseClassName:e},viewType:r,params:{pageName:o}},headers:{...l,...c&&{...Zu.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:f,headers:ym(t.headers,e,l)})))}static getObjectTypeViewPayload=(e,t)=>e?lI.shouldUseUnifiedHandling()?{casetypeID:t,actionID:Gs.getDefaultQualifiedName(Gs.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{objectTypeID:t,actionID:Gs.getDefaultQualifiedName(Gs.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{};static getExternalCaseOrObjectContent=(e,t,n)=>{const s=lI.isExternalObject(e),a=lI.isExternalCaseType(e);if((a||s)&&!t){const e=Am(n,{isExternalObject:Boolean(!a&&s)}),{content:t,pageInstructions:r}=e.content;return{content:t,pageInstructions:r}}return{}};static getKeyBasedOnWorkType=e=>lI.shouldUseUnifiedHandling()?"caseTypeID":lI.isObjectCaseType(e)?"objectTypeID":"caseTypeID"}const yp=Ep,Ap=()=>({registerHeader:(...e)=>Zu.registerHeader(...e),unRegisterHeader:(...e)=>Zu.unRegisterHeader(...e),getRegisteredHeaders:()=>Zu.getRegisteredHeaders()}),Cp=(e,{body:t={},queryPayload:n={},cancelTokenSource:s,headers:a={},responseType:r},o,i)=>{const{restApi:c,reqType:l}=_S(e,n),u={method:l,headers:a,body:t,...r&&{responseType:r}};s&&(u.signal=s.token);const d="createWork"===e?lI.appendExcludeQueryParamToUrl(c):c;return ud(d,u,o,i??{})},Sp=(e,{method:t="GET",body:n={},headers:s={},withoutDefaultHeaders:a=!1},r)=>{e.startsWith("http:")||e.startsWith("https:")||(e=un()+e);return ud(e,{method:t,headers:s,body:n,withoutDefaultHeaders:a},r)},_p=e=>By.doesRestApiExist(e),Np=()=>gd(),Tp=e=>hd(e),Dp=e=>{cd(e)},Pp=()=>yp,Op=new Set;function Rp(e){try{const t=new URL(e);"https:"!==t.protocol&&"http:"!==t.protocol||Op.add(t.origin)}catch{}}function bp(e){let t,n;try{t=new URL(e,window.location.href).origin}catch{throw new Error("Blocked: malformed URL")}try{n=window.location.origin??new URL(window.location.href).origin}catch{n=""}if(t!==n&&!Op.has(t))throw new Error(`Blocked: untrusted script origin "${t}"`)}const vp="getCustomComponent",xp="text/javascript";function wp(e){return"localhost"===e||"127.0.0.1"===e}function Mp(e){let t;try{t=new URL(e).hostname}catch{throw new Error("Component fetch blocked: malformed dev server URL")}if(wp(t)){if(!function(){try{return wp(new URL(window.location.href).hostname)}catch{return!1}}())throw new Error("Component fetch blocked: localhost dev server is only allowed from loopback pages")}else bp(e)}const Lp=new class{getTypes={SCRIPT:"script",STYLE:"link"};constructor(){this.loaderObj={},this.staticServerURL="",this.appStaticUrl=null,this.pegaOnlyUrl=!1,this.loadedAssets={},this.componentsConfig=null,this.appAlias="",this.b2sJWT=null,this.ccV2LibId="",this.imageBlobUrlCache={}}getStaticServerUrl(){return this.staticServerURL}setCCV2LibId(e){this.ccV2LibId=e}getCCV2LibId(){return this.ccV2LibId}async getThemeSchemaJSON(){const e=`${this.staticServerURL}themeOverrides.schema.json`;return fetch(e).then((e=>e.json()))}getConstellationServiceUrl(){return this.staticServerURL?.endsWith("/")?this.staticServerURL.substring(0,this.staticServerURL.length-1):this.staticServerURL}setAppAlias(e){this.appAlias=e}getAppAlias(){return this.appAlias}async getSvcComponentsConfig(e,t={}){let n="",s=0;return e.forEach((e=>{n+=`${0===s?"?":"&"}field${s}=${e.field}&value${s}=${e.value}`,s+=1})),this.pegaOnlyUrl?this.getSvcComponentsConfigSeparatedUrls(e,n,t):this.getSvcComponentsConfigCombinedUrl(e,n,t)}async getSvcComponentsConfigSeparatedUrls(e,t,n){const s=Gy.getBuiltOnAppNames(),a=this.loadAndFilterPegaComponentsConfig(e,s);let r=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(r=this.loadAndCustomerComponentsConfig(t,e));const o=[],i=Gy.environmentInfoObject?.pyInfinityStaticService;if(i){const e=[],t=await Promise.all([a,r]),[n,s]=t,i=[];for(const t of s)!0===t.isSdkOverridden?e.push(t.componentDefinition):i.push(t.componentDefinition);const c=this.mergeComponentList([n,i,e]);o.push(...c)}else{const e=this.fetchSDKComponent(t);await Promise.all([a,r,e]).then((e=>{const t=this.mergeComponentList(e);o.push(...t)}))}if(n.alternateDesignSystemURL&&1===o.length){const s=await this.getSvcComponentsConfigADS(e,t,n);o[0].alternateDesignSystemConfig=s}return{data:{components:o}}}mergeComponentList=e=>{const[t=[],n=[],s=[]]=e,a=[...t,...n];return this.appStaticUrl?a.map((e=>{const{name:t,type:n,subtype:a}=e,r=s.reduce(((e,s)=>(t===s.name&&n===s.type&&a===s.subtype&&(e=s),e)),{});return Object.keys(r).length>0?{...e,alternateDesignSystemConfig:{...r}}:e})):a};async fetchSDKComponent(e){if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const t=`${this.appStaticUrl}v102/${this.appAlias}/componentslist-ext${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}return Promise.resolve([])}async loadAndFilterPegaComponentsConfig(e,t){return this.loadPegaComponentsConfig().then((()=>{const n=[];return this.componentsConfig&&this.componentsConfig.forEach((s=>{let a=!0;e.forEach((e=>{Array.isArray(s[e.field])?s[e.field].includes(e.value)||(a=!1):s[e.field]!==e.value&&(a=!1)})),a&&this.checkForBuiltOnSupport(t,s.allowedApplications)&&n.push(s)})),n}))}async loadPegaComponentsConfig(){let e=null;if(null===this.componentsConfig){const t=`${this.staticServerURL}components/componentsconfig.json?v=${(new Date).getTime()}`;e=fetch(t,{method:"GET"}).then((e=>e.json())).then((async e=>{this.componentsConfig=e,this.ccV2LibId&&await this.loadLibraryComponentsConfig(this.ccV2LibId).then((e=>{e&&e.length>0&&(this.componentsConfig=(this.componentsConfig||[]).concat(e))})).catch((e=>{console.error(`Exception while appending custom component config from library ${this.ccV2LibId} : ${e}`)}))})).catch()}else e=Promise.resolve();return e}async loadLibraryComponentsConfig(e){let t=null;return t=fetch(`${this.appStaticUrl}v100/componentlib/componentsconfig/${e}?v=${Date.now()}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw console.error("Error while fetching custom component config/library component config"),new Error(e.statusText);return e})).then((e=>e.json())).then((e=>Promise.resolve(e))).catch((t=>(console.error(`Exception while fetching custom component config from library ${e} : ${t}`),{error:t.message}))),t}async loadAndCustomerComponentsConfig(e,t){let n=null;const s=Gy.environmentInfoObject?.pyInfinityStaticService;if(s){const e={};t.forEach(((t,n)=>{e[`field${n}`]=t.field,e[`value${n}`]=t.value})),n=PCore.getDataPageUtils().getDataAsync(ks.getDefaultQualifiedName("D_pzGetComponentsConfig"),"",e).then((e=>e.data.map((e=>({componentDefinition:JSON.parse(e.pxComponentDefinition),isSdkOverridden:void 0!==e.pyIsSDKOverridden&&e.pyIsSDKOverridden})))))}else if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const t=`${this.appStaticUrl}v103/${this.appAlias}/componentslist${e}`;n=fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}else n=Promise.resolve([]);return n}checkForBuiltOnSupport(e,t){if(!e||!t||0===e.length||0===t.length)return!0;const n=e.split(",");return 0===n.length||n.some((e=>t.includes(e)))}async getSvcComponentsConfigCombinedUrl(e,t,n){const s=`${this.staticServerURL}v102/${this.appAlias}/componentslist${t}`,a=await fetch(s,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>({data:e})));if(!0===n.skipLoadCustomerComponents&&a?.data?.components?.length>0&&(a.data.components=a.data.components.filter((e=>void 0===e.componentKey))),n.alternateDesignSystemURL&&1===a?.data?.components?.length){const s=await this.getSvcComponentsConfigADS(e,t,n);a.data.components[0].alternateDesignSystemConfig=s}return a}getSvcComponentsConfigADS(e,t,n){const s=`${n.alternateDesignSystemURL}${n.alternateDesignSystemURL?.endsWith("/")?"":"/"}components/${e[0].value}/config-ext.json`;return fetch(s,{method:"GET"}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})).catch((e=>({error:e.message})))}getSvcImage(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).catch()}getSvcImageUrl(e){try{const t=Gy.environmentInfoObject?.pyInfinityStaticService,{callUrlKey:n,queryPayload:s,callUrl:a}=this.buildImageRequest(e,t);return this.imageBlobUrlCache[a]||(this.imageBlobUrlCache[a]=this.fetchImage(n,s,a,t)),this.imageBlobUrlCache[a]}catch(e){return Promise.resolve(null)}}buildImageRequest(e,t){let n,s="getBinaryFile",a=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;if(t){const t=/DATA-CONTENT-IMAGE\s([^!]*)!.*\/OPERATORIMAGES\//i,r=e.match(t);if(r){const e=r[1]?.trim();if(!e)throw console.warn("AssetLoader.buildImageRequest: operator image key is missing user id"),new Error("AssetLoader.buildImageRequest: operator image key is missing user id");s="getOperatorImage",n={user_ID:e.toLowerCase()}}else n={fileID:e};a=_S(s,n)?.restApi||a}return{callUrlKey:s,queryPayload:n,callUrl:a}}fetchImage(e,t,n,s){return s?Cp(e,{queryPayload:t}).then((e=>{const n=this.decodeBase64ToByteArray(e.data),s=this.getMimeTypeFromKey(t?.fileID||t?.user_ID||""),a=new Blob([n],{type:s});return window.URL.createObjectURL(a)})).catch((e=>{throw console.error("Error fetching image:",e),e})):fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).then((e=>window.URL.createObjectURL(e))).catch()}decodeBase64ToByteArray(e){const t=atob(e),n=t.length,s=new Uint8Array(n);for(let e=0;e<n;e+=1)s[e]=t.charCodeAt(e);return s}getMimeTypeFromKey(e){const t={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"},n=e.toLowerCase().split("!").pop()||"";return t[n]?t[n]:"application/octet-stream"}getSvcLocale(e,t){const n=`${this.appStaticUrl}v102/${this.appAlias}/locales/${e}/${t}`;return fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}})}getSvcAvailableLocales(){const e=`${this.appStaticUrl}v102/app/${this.appAlias}/locales/getLocaleCodes`;return fetch(e,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).catch((()=>[]))}async getSvcComponent(e){try{const t=Gy.environmentInfoObject?.pyInfinityStaticService;if(t){const t=Gy.environmentInfoObject?.pxApplication?.pxUpdateDateTime,n=t?AC.parsePegaDateTimeToTimestamp(t):null,s=`${e}${n?`?v=${n}`:""}`;return(await Cp(vp,{queryPayload:{componentName:s}})).data}const n=Gy.environmentInfoObject?.pyC11nDXCBDevURL;n&&Mp(n);const s=n?`${n}/index.js`:`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`,a=await fetch(s,n?{}:{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}});if(!a.ok)throw new Error(a.statusText);return await a.text()}catch(e){throw console.error("Error fetching service component:",e),e}}async importCustomComponentMap(e,t){try{const n=Gy.environmentInfoObject?.pyInfinityStaticService,s=Gy.environmentInfoObject?.pyC11nDXCBDevURL;let a=`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`;if(s){const e=s.replace(/\/+$/,"");Mp(e),a=`${e}/index.js`}if(n&&!s){const n=Gy.environmentInfoObject?.pxApplication?.pxUpdateDateTime,s=AC.parsePegaDateTimeToTimestamp(n),a=AC.parsePegaDateTimeToTimestamp(t),r=[];s&&r.push(`v=${s}`),a&&r.push(`libV=${a}`);const o=r.length?`${e}?${r.join("&")}`:e,i=await Cp(vp,{queryPayload:{componentName:o}});return void this.appendCustomScriptToHead(i.data)}if(n||s){if("undefined"==typeof document)return;const e=document.createElement("script");return e.src=a,e.type="text/javascript",e.onerror=()=>console.error("Error while appending custom component map"),void document.head.appendChild(e)}const r=await fetch(a,{headers:{Authorization:`Bearer ${this.b2sJWT}`}});r.ok||console.error("Error while fetching custom component map");const o=await r.text();this.setCCV2LibId(e),this.appendCustomScriptToHead(o)}catch(e){console.error("Exception while appending custom component map (or load blocked):",e)}}async appendCustomScriptToHead(e){if("undefined"!=typeof document)try{const t=document.createElement("script");t.src=window.URL.createObjectURL(new Blob([e],{type:xp})),t.onerror=()=>console.error("Error while appending custom component map"),document.head.appendChild(t)}catch(e){console.error("Exception appendCustomScriptToHead:",e)}}loadSvcComponent(e){return new Promise(((t,n)=>{this.getSvcComponent(e).then((s=>{if("undefined"==typeof document)return void n(e);const a=document.createElement("script");a.src=window.URL.createObjectURL(new Blob([s],{type:xp})),a.onload=()=>t(e),a.onerror=()=>n(e),document.head.appendChild(a)})).catch((()=>{n(e)}))}))}initServer(e,t,n){console.log(`asset-loader.initServer(${e}, ${t})`),this.appStaticUrl=null,this.staticServerURL=null,this.pegaOnlyUrl=!1,this.componentsConfig=null,Op.clear(),e&&t&&"no-appstatic"!==t&&"no-cdn"!==t?(this.appStaticUrl=t.endsWith("/")?t:`${t}/`,this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.pegaOnlyUrl=!0,Rp(this.staticServerURL),Rp(this.appStaticUrl)):e&&t&&"no-appstatic"===t?(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,this.pegaOnlyUrl=!0,Rp(this.staticServerURL)):e&&t&&"no-cdn"===t&&(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,Rp(this.staticServerURL)),console.log(`asset-loader.initServer() staticServerURL=${this.staticServerURL}, appStaticUrl=${this.appStaticUrl}, pegaOnlyUrl=${this.pegaOnlyUrl})`),this.b2sJWT=n}register(e,t){this.loaderObj[e]=t}getLoader(e){let t;const n=(e,t)=>new Promise(((n,s)=>{if("undefined"==typeof document)return void s(e);const a=document.createElement(t);if("script"===t){const t=a;t.onload=()=>{n(e)},t.onerror=()=>{s(e)},t.type=xp,t.charset="UTF-8",t.async=!1,t.src=e}else{const t=a;t.type="text/css",t.rel="stylesheet",t.href=e}document.head.appendChild(a)})).catch((e=>{console.log(e)}));return t=e?this.loaderObj[e]:n,t}loadAssets(e,t){const{isDevServerMode:n}=t;if(!e)return Promise.resolve();const s=[];return e.forEach((e=>{const t=Object.keys(e)[0];let a=n?Object.values(e)[0]:this.getStaticServerUrl();a=a.endsWith("/")?a:`${a}/`,this.loadedAssets[t]||(t.includes(".js")?s.push(this.getLoader()(a+t,this.getTypes.SCRIPT)):t.includes(".css")&&this.getLoader()(a+t,this.getTypes.STYLE),this.loadedAssets[t]=!0)})),Promise.all(s)}getAssetsFromIsolations(e){const t=this.b2sJWT?.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")||"",n=decodeURIComponent(a.g.atob(t).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")),s=JSON.parse(n),r=s?.tenant_id,{restApi:o,reqType:i}=SS("getAssetsFromIsolations",{isolationID:r,assetPath:e})||{},c=`${this.appStaticUrl}${o}`;return fetch(c,{method:i,credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob()))}},Up="component-loader",Fp={},Vp=async(e,t)=>{if(!e?.length||!1===window.PCore?.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();const n=Lp.getLoader(),s=t||Lp.staticServerURL;if(Lp.getLoader(Up))return Lp.getLoader(Up)(e,s);const a=new Set(Object.keys(Fp)),r=e.flatMap((e=>{if(a.has(e))return[];const t=Do.getComponent(e);if(!t){const t=`${Lp.getConstellationServiceUrl()}/v860/${Lp.getAppAlias()}/component/${e}.js`;return a.add(e),[n(t,Lp.getTypes.SCRIPT)]}const r=(t.scripts||[]).map((e=>n(e.startsWith("http")?e:`${s}${e}`,Lp.getTypes.SCRIPT))),o=(t.styles||[]).map((e=>n(`${s}${e}`,Lp.getTypes.STYLE)));return a.add(e),[...r,...o]}));return Promise.all(r.map((e=>e.catch((e=>console.error("Error loading asset:",e))))))},jp="component-state-lru-index";function kp(e){return"object"==typeof e&&null!==e&&"key"in e&&"accessedAt"in e&&"string"==typeof e.key&&"number"==typeof e.accessedAt}function Bp(){try{const e=sessionStorage.getItem(jp);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(kp):[]}catch{return[]}}function $p(e){try{sessionStorage.setItem(jp,JSON.stringify(e))}catch{}}function Gp(e){const t=Bp().filter((t=>t.key!==e));t.unshift({key:e,accessedAt:Date.now()}),$p(t)}const Wp=()=>"undefined"!=typeof sessionStorage?sessionStorage:null;const Hp=new class{#r;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#r=!1}getNormalizedKey(e){return e?.toString().trim().replace(/\s/g,"-").toLowerCase()}setComponentState=(e,t,n)=>{Wp()?n?.managed&&"FULL_PORTAL"!==Gy.getRenderingMode()||(Wp()?.setItem(this.getNormalizedKey(e),JSON.stringify(t)),n?.managed&&(Gp(this.getNormalizedKey(e)),function(e){const t=Bp();if(t.length<=100)return[];const n=[],s=t.slice(0,100),a=t.slice(100);for(const t of a){try{e(t.key)}catch{}n.push(t.key)}$p(s)}((e=>{Wp()?.removeItem(e)})))):console.error("Session Storage not found")};getComponentState=(e,t)=>{if(t?.managed&&"FULL_PORTAL"!==Gy.getRenderingMode())return;const n=Wp()?.getItem(this.getNormalizedKey(e))??null,s=n?AC.isValidJson(n):void 0;return t?.managed&&null!=(s??n)&&Gp(this.getNormalizedKey(e)),s||n};removeComponentState=(e,t)=>{t?.managed&&"FULL_PORTAL"!==Gy.getRenderingMode()||(Wp()?.removeItem(this.getNormalizedKey(e)),t?.managed&&function(e){const t=Bp(),n=t.filter((t=>t.key!==e));n.length!==t.length&&$p(n)}(this.getNormalizedKey(e)))};fetchUserSettings=async()=>{if(_p("getUserSettings")){const{restApi:e,reqType:t}=_S("getUserSettings");ud(e,{method:t,headers:{}}).then((e=>{if(200!==e.status||!e.data)throw new Error("something went wrong while fetching getUserSettings");this.userSettings=e.data})).catch((e=>console.error(e)))}};init=()=>{Gy.getUserSettings()?this.userSettings=Gy.getUserSettings():this.fetchUserSettings()};getUserSettings=e=>{if(!e)throw new Error("path is required parameter");if("string"!=typeof e)throw new TypeError("path must be string");return AC.getIn(this.userSettings,e,{})};setUserSettings=async(e,t)=>{if(!e)return Promise.reject(new Error("path is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("path must be string"));if(null==t||""===t)return Promise.reject(new Error("value is required parameter"));let n;if(!_p("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=_S("updateUserSettings");const{restApi:s,reqType:a}=n;return ud(s,{method:a,body:AC.setIn({},e,t)}).then((e=>{if(200!==e.status||!e.data)throw new Error("something went wrong");this.userSettings=e.data})).catch((e=>{console.error(e)}))};setComponentCache(e,t,n={}){if("string"!=typeof e||!e?.trim())return;const s=n.clearOnCancelForContext;if(s&&(Object.hasOwn(this.contextMapToClearOnCancel,s)?this.contextMapToClearOnCancel[s].add(this.getNormalizedKey(e)):this.contextMapToClearOnCancel[s]=new Set([this.getNormalizedKey(e)])),this.componentCache[this.getNormalizedKey(e)]=t,!this.#r){this.#r=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};Uu.subscribe(Gs.PUB_SUB_EVENTS.EVENT_CANCEL,e,"RESET_COMPONENT_CACHE")}}getComponentCache(e){return"string"==typeof e&&e?.trim()?Object.hasOwn(this.componentCache,this.getNormalizedKey(e))?this.componentCache[this.getNormalizedKey(e)]:void 0:null}getURLParam(e,t){let n=new URL(globalThis.location.href).searchParams.get(e);return n?(n=t?atob(n):n,n):null}setURLParam(e,t,n){if(!Gy.shouldUseURLParams())return;const s=new URL(globalThis.location.href);if(t=n?btoa(t):t,s.searchParams.get(e)===t)return;s.searchParams.set(e,t);globalThis.history.pushState({type:"ui-navigation"},"",s)}setURLParams(e){const t=new URL(globalThis.location.href);Object.entries(e).forEach((([e,n])=>{t.searchParams.set(e,n)}));globalThis.history.pushState({type:"update-history"},"",t)}resetComponentCache(e){return!("string"!=typeof e||!e?.trim())&&(!!Object.hasOwn(this.componentCache,this.getNormalizedKey(e))&&(delete this.componentCache[this.getNormalizedKey(e)],!0))}};const qp=new class{constructor(){this.contextArray={},this.pauseDuration=2e3,this.waitingToPutUpIndicator=!1}getLoadingContext(e){let t=null;return e&&(({context:t}=e),t||(t=e.containerItemID),t||(t=e.contextName)),t}enableLoadingIndicator(e,t=!0){const n=this.getLoadingContext(e);n&&(this.addToContextArray(n),this.waitingToPutUpIndicator||(this.waitingToPutUpIndicator=!0,this.pauseBeforeShowing(n).then((e=>{Fu.isOnline()&&t&&void 0!==this.contextArray[e]&&this.contextArray[e]>0&&sC({type:da,payload:{context:e}})}))))}pauseBeforeShowing=e=>new Promise((t=>{setTimeout((()=>t(e)),this.pauseDuration)}));disableLoadingIndicator(e,t=!0){const n=this.getLoadingContext(e);n&&(this.waitingToPutUpIndicator=!1,this.removeFromContextArray(n),t&&void 0!==this.contextArray[n]&&0===this.contextArray[n]&&sC({type:pa,payload:{context:n}}))}addToContextArray=e=>{void 0===this.contextArray[e]&&(this.contextArray[e]=0),this.contextArray[e]+=1};removeFromContextArray=e=>{void 0!==this.contextArray[e]&&this.contextArray[e]>0&&(this.contextArray[e]-=1)}};const zp=new class{constructor(){this.counterActionMgrId=0,this.actionMgrActions={}}getNextActionMgrId(){return this.counterActionMgrId+=1,this.counterActionMgrId.toString()}register(e,t,n,s,a="unknown",r,o=!0){if(void 0!==this.actionMgrActions[e])return null;const i={actionType:a,promise:t,resolve:n,reject:s,actionPayload:r};return this.actionMgrActions[e]=i,o&&qp.enableLoadingIndicator(i.actionPayload),e}actionManagerPromise=(e,t="")=>{let n,s;""===t&&(t=this.getNextActionMgrId());const a=new Promise(((e,t)=>{n=e,s=t}));if(!n||!s)throw new Error("resolveFn or rejectFn is not defined.");return this.register(t,a,n,s,e),{actionMgrID:t,promise:a}};resolveActionByID(e,t,n=!0){const s=this.actionMgrActions[e];let a=e;return s?(setTimeout((()=>{s.resolve(t)}),0),qp.disableLoadingIndicator(s.actionPayload,n)):a=null,a}rejectActionByID(e,t=!0,n){const s=this.actionMgrActions[e];let a=e;return s?(s.reject(n),qp.disableLoadingIndicator(s.actionPayload,t)):a=null,a}setRemoteCaseHeaderByContext(e,t){t&&(e.headers=e.headers||{},e.headers.RemoteSystemID=t)}setTraditionalRemoteCaseParams(e,t){return e.className=t.className,e.isTraditionalRemoteCase=qs.isTraditionalRemoteCase(t.className),e.remoteClassName=t.remoteClassName,e.action=t.action,e.viewName=Ws,e.gadgetId=t.gadgetId??lI.getUniqueGadgetId(),e.name=t.name,e.isRemoteCase=!0,e.skipSemanticUrl=!0,ia}};class Yp{static actionsTargetMap=new Map;static getTargetViewContainerName=e=>{if(e){const t=e.toLowerCase();let n="primary";return this.actionsTargetMap.has(t)&&(n=this.actionsTargetMap.get(t)),n}return""};static buildActionTargetMap=e=>{e&&Object.keys(e).forEach((t=>{const n=e[t];n&&n.actions&&n.actions.forEach((e=>{this.actionsTargetMap.set(e.toLowerCase(),t)}))}))}}const Kp=Yp,Qp=(e,t,n,s)=>By.getResolvedSemanticURL(e,t,n,s),Jp={getResolvedSemanticURL:Qp,getActions:()=>({ACTION_OPENWORKBYHANDLE:Za,ACTION_SHOWDATA:Qa,ACTION_SHOWVIEW:Ka,ACTION_GETOBJECT:kr,ACTION_SHOWINSIGHT:Ja,ACTION_SHOWDASHBOARD:Xa}),updateSemanticURLAndDocumentTitle:(e,t)=>By.updateSemanticURLAndDocumentTitle(e,t),getSemanticURLForToaster:(e,t,n=!1,s)=>Qp(n?kr:Za,{caseClassName:e},{[n?"objectID":"workID"]:t},s)},Xp={CASE_INFO:`${Gs.DATA}.${Gs.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${Gs.DATA}.${Gs.CASE_INFO.CASE_TYPE_ID}`,CASE_INFO_ID:`${Gs.DATA}.${Gs.CASE_INFO.CASE_INFO_ID}`,BUSINESS_ID:`${Gs.DATA}.${Gs.CASE_INFO.BUSINESS_ID}`},Zp=e=>AC.getIn(e,Gs.getProperty(Xp.CASE_CLASS_NAME),Gs.EMPTY_STRING),eg=e=>AC.getIn(e,Gs.getProperty(Xp.CASE_INFO_ID),Gs.EMPTY_STRING),tg=(e,t)=>{const n=eg(t);AC.setIn(e,"key",n)},ng=e=>AC.getIn(e,Gs.getProperty(Xp.CASE_INFO),{}),sg=e=>{const t=nC();if(!e)return!1;const n=Ks(e),s=py(n),a=py(e);if(!s||!a)return!1;const r=FE(s,n),o=FE(a,e);if(!r||!o)return!1;const{key:i}=r;let{key:c}=o;return c||(c=t?.getState().data?.[e]?.objectInfo?.ID),i&&c&&i===c},ag=e=>{const t=eg(e),n=AC.getIn(e,Gs.getProperty(Xp.BUSINESS_ID),Gs.EMPTY_STRING),s=t.toLowerCase().includes(n.toLowerCase())?n:t,a=Zp(e);return{businessID:n,caseType:a,resolvedURL:Jp.getSemanticURLForToaster(a,s,lI.isObjectCaseType(a))}};const rg=class{constructor(e){this.c11nEnv=e}validate(e,t){const{value:n}=this.c11nEnv.getStateProps();if(!t&&!(t=n)){const e=this.c11nEnv.getComponentConfig(),n=this.c11nEnv.getStateProps();t="multi"===e.selectionMode?n.selectionList:"Editable"===e.renderMode?n.referenceList:"single"===e.selectionMode?n.selectionKey:n.value}const s=sI(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:a}=hp.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,s);return a?{status:!1,message:a}:{status:!0}}validateEmail(e,t={}){const n=hp.getValidator("email");if(!n)return{status:"success"};const s=n(e,t);return s?{status:"failure",message:s}:{status:"success"}}},og="OPEN_PROCESS_ACTION",ig="OPEN_ASSIGNMENT",cg="DELETE_CASE_IN_CREATE_STAGE",lg="SAVE_AND_CLOSE",ug=e=>({type:lg,payload:e}),dg="DELETE_WORK",pg=e=>({type:dg,payload:e});const gg=class{static getSavableDataPage(e){return WA(e)}static getLookUpDataPage(e){return qA(e)}static getLookUpDataPageInfo(e){return zA(e)}static getDataPageKeys(e){return HA(e)}};const hg=class{static getPropertyName(e){return Ro.getPropertyName(e)}static isProperty(e){return Ro.isProperty(e)}static getLeafPropertyName(e){return Ro.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};class fg{static createContainerPConnect(e,t,n,s=!1){const{accessedOrder:a,items:r}=e;if(a&&r){const e=a[a.length-1];if(r[e]?.view&&Object.keys(r[e].view).length>0){const a=r[e],o=e.substring(0,e.lastIndexOf("_")),{view:i,context:c}=a,{viewName:l,viewContext:u}=this.processRootViewDetails(i,a,t);if(!l)return null;return Ff({meta:i,options:{context:c,pageReference:u||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:s||n===xE.WORKAREA||n===xE.MODAL||l===Gs.CREATE_DETAILS_VIEW_NAME,target:o}}).getPConnect}}return null}static processRootViewDetails(e,t,n){const{config:{context:s,name:a}={}}=e,{context:r}=t;let o=a,i=s;const c=hg.isProperty(a),l=hg.isProperty(s);if(l){const e=hg.getPropertyName(s);i=iC(`.${e}`,e.startsWith(".")?n:"",r)}if(i||(i=n),c){const e=hg.getPropertyName(a);o=iC(`.${e}`,i,r)}return c&&l&&""!==o&&(o=a,i=s),{viewName:o,viewContext:i}}static addFlowContainerItem(e){const t=e.getContainerManager(),n=e.getContextName();let s,a;if("review"!==e.getValue("context_data.caseViewMode")){const e=n.substring(0,n.lastIndexOf("_")),t=YE(e),r=FE(e,t);r&&({key:s,flowName:a}=r)}t.addContainerItem({semanticURL:"",key:s,flowName:a,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}static hasContainerItems=e=>{const t=e.getContextName(),n=e.getContainerName();return PCore.getContainerUtils().hasContainerItems(`${t}/${n}`)};static hasGetNextWorkLinks=e=>e.getValue(Gs.CASE_INFO.GETNEXTWORK);static getActiveCaseActionName=e=>{const t=e.getValue(Gs.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(Gs.CASE_INFO.ACTIVE_ACTION_ID),s=t.find((e=>e.ID===n));return s?.name||""};static getFirstCaseActionName=e=>{const t=e.getValue(Gs.CASE_INFO.CASE_INFO_ACTIONS);return t[0]?.name||""};static hasNotificationMessages=e=>!!e.getValue("caseMessages");static isCaseWideLocalAction=e=>{const t=e.getValue(Gs.CASE_INFO.ACTIVE_ACTION_ID),n=e.getValue(Gs.CASE_INFO.CASE_INFO_ACTIONS);if(n&&t){const e=n.find((e=>e.ID===t));return"Case"===e?.type}return!1};static getChildCaseAssignments=e=>{const t=e.getValue(Gs.CASE_INFO.CHILD_ASSIGNMENTS);let n=[];return t&&t.length>0&&t.forEach((({assignments:e=[],Name:t,caseTypeID:s})=>{const a=e.map((e=>({...e,caseName:t,caseTypeID:s})));n=n.concat(a)})),n};static hasAssignments=e=>{const t=e.getValue(Gs.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),n=fg.getChildCaseAssignments(e);return!!(Array.isArray(n)&&n.length>0||Array.isArray(t)&&t.length>0||fg.isCaseWideLocalAction(e))};static showBanner=e=>{const t=e();return fg.hasNotificationMessages(t)||!fg.hasAssignments(t)};static showTodo=e=>"perform"!==e.getValue("context_data.caseViewMode");static isRenderWithToDoWrapper=(e,t)=>{const n=e(),{showWithToDo:s}=t;return s&&(!fg.isCaseWideLocalAction(n)||fg.showTodo(n))};static getToDoAssignments=e=>{const t=e.getValue(Gs.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(Gs.CASE_INFO.ASSIGNMENT_LABEL),s=e.getValue(Gs.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)||[],a=fg.getChildCaseAssignments(e)||[];let r=JSON.parse(JSON.stringify(a));r=r.map((e=>(e.isChild=!0,e)));const o=[...s,...r];let i=JSON.parse(JSON.stringify(o));return t&&!fg.showTodo(e)&&(i=i.map((t=>(t.name=fg.getActiveCaseActionName(e)||t?.name||n,t)))),i}}const mg=fg;const Ig=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=zp.getNextActionMgrId();let n,s;const a=new Promise(((e,t)=>{n=e,s=t}));if(!n||!s)throw new Error("resolveFn or rejectFn is not defined.");return zp.register(t,a,n,s,e),{actionMgrID:t,promise:a}};initializeContainers(e){const t=va,n=this.c11nEnv,s={context:n.getContextName(),name:n.getContainerName(),type:Gs.CONTAINER_TYPE.SINGLE},{actionMgrID:a,promise:r}=this.containerManagerPromise(t),o={...s,...e,actionMgrID:a};return sC(FC(o)),r}addContainerItem(e){const t=wa,n=this.c11nEnv,s=n.getMetadata(),{children:a}=s||{};let r;Array.isArray(a)&&a.length>0&&([r]=a);const o=n.getContextName(),i=n.getContainerName(),c=Qs(i,o,e?.containerType===Gs.CONTAINER_TYPE.SINGLE),l=Wr(i,o),u={root:{...r,config:{...r?.config,context:r?.config?.context||n.getPageReference?.()}},containerItemID:c,context:c,target:l,containerName:i};e=JSON.parse(JSON.stringify(e)),[Gs.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:d,promise:p}=this.containerManagerPromise(t),g={...u,...e,actionMgrID:d};return sC(jC(g)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=Ga,n={context:JE(e.containerItemID),target:py(e.containerItemID)},{actionMgrID:s,promise:a}=this.containerManagerPromise(t),r={...n,...e,actionMgrID:s};return sC(HC(r)),a}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=$a,n={target:py(e.containerItemID)},{actionMgrID:s,promise:a}=this.containerManagerPromise(t),r={...n,...e,actionMgrID:s};return sC(KC(r)),a}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Ma,n={context:JE(e.containerItemID),target:py(e.containerItemID)},{actionMgrID:s,promise:a}=this.containerManagerPromise(t),r={...n,...e,actionMgrID:s};return sC(JC(r)),a}resetContainers(e){if(!e?.context||!e?.name)return Promise.reject(new Error("resetContainers : context and name are required in containerInfo object"));const t=xa,n=ly(e),{actionMgrID:s,promise:a}=this.containerManagerPromise(t),r={...n,...e,actionMgrID:s};return sC(VC(r)),a}addTransientItem(e){const{id:t,data:n,sourceContainerItemId:s}=e,a=this.c11nEnv.getContextName(),r=Xs(t,a),o=Iy(a);if(r&&o.includes(r))return r;let i=n;if(s){const e=aC(s);if(!e)throw new Error(`addTransientItem: source container item "${s}" not found in store`);i=AC.deepClone(e)}return sC(kC({transientItemID:r,contextName:a,target:py(a),data:i})),r}updateTransientData(e){const{transientItemID:t,data:n}=e,s=this.c11nEnv.getContextName();if(t){if(!Iy(s).includes(t))return;sC(BC({transientItemID:t,data:n}))}}removeTransientItem(e){const t=this.c11nEnv.getContextName(),{target:n=this.c11nEnv.getTarget(),containerItemID:s,transientItemID:a}=e;if(a&&s){if(!Iy(t).includes(a))return;sC(ZC({target:n,containerItemID:s,transientItemID:a}))}}createContainerPConnect(e,t,n,s=!1){mg.createContainerPConnect(e,t,n,s)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return ry(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return qE(e,t)}};function Eg(e,t){return zl((function(n,s){var a=null,r=0,o=!1,i=function(){return o&&!a&&s.complete()};n.subscribe(Yl(s,(function(n){null==a||a.unsubscribe();var o=0,c=r++;Wl(e(n,c)).subscribe(a=Yl(s,(function(e){return s.next(t?t(n,e,c,o++):e)}),(function(){a=null,i()})))}),(function(){o=!0,i()})))}))}function yg(e,t){return zl((function(n,s){var a=0;n.subscribe(Yl(s,(function(n){s.next(e.call(t,n,a++))})))}))}function Ag(e,t,n){return void 0===n&&(n=1/0),cl(t)?Ag((function(n,s){return yg((function(e,a){return t(n,e,s,a)}))(Wl(e(n,s)))}),n):("number"==typeof t&&(n=t),zl((function(t,s){return function(e,t,n,s,a,r,o,i){var c=[],l=0,u=0,d=!1,p=function(){!d||c.length||l||t.complete()},g=function(e){return l<s?h(e):c.push(e)},h=function(e){r&&t.next(e),l++;var i=!1;Wl(n(e,u++)).subscribe(Yl(t,(function(e){null==a||a(e),r?g(e):t.next(e)}),(function(){i=!0}),void 0,(function(){if(i)try{l--;for(var e=function(){var e=c.shift();o?ql(t,o,(function(){return h(e)})):h(e)};c.length&&l<s;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(Yl(t,g,(function(){d=!0,p()}))),function(){null==i||i()}}(t,s,e,n)})))}function Cg(e){return e&&cl(e.schedule)}function Sg(e){return e[e.length-1]}function _g(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Cg(Sg(e))?e.pop():void 0}(e);return eu(e,n)}var Ng=Kc((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Tg=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return Xc(t,e),t.prototype.lift=function(e){var t=new Dg(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ng},t.prototype.next=function(e){var t=this;_l((function(){var n,s;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=tl(t.currentObservers),r=a.next();!r.done;r=a.next()){r.value.next(e)}}catch(e){n={error:e}}finally{try{r&&!r.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;_l((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;_l((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,s=n.hasError,a=n.isStopped,r=n.observers;return s||a?gl:(this.currentObservers=null,r.push(e),new pl((function(){t.currentObservers=null,dl(r,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,s=t.thrownError,a=t.isStopped;n?e.error(s):a&&e.complete()},t.prototype.asObservable=function(){var e=new Ll;return e.source=this,e},t.create=function(e,t){return new Dg(e,t)},t}(Ll),Dg=function(e){function t(t,n){var s=e.call(this)||this;return s.destination=t,s.source=n,s}return Xc(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:gl},t}(Tg),Pg=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return Xc(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,s=e._value;if(t)throw n;return this._throwIfClosed(),s},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Tg);function Og(e,t){return zl((function(n,s){var a=0;n.subscribe(Yl(s,(function(n){return e.call(t,n,a++)&&s.next(n)})))}))}class Rg extends Pg{constructor(e,t){super(t)}}const bg=(...e)=>Og((t=>e.includes(t.type)));var vg=new Ll((function(e){return e.complete()}));function xg(e){return e?function(e){return new Ll((function(t){return e.schedule((function(){return t.complete()}))}))}(e):vg}const wg=(e,t,n)=>tu((s=>("ERR_CANCELED"!==s?.code&&console.error(e,s),_g(rS(e,s,t,null,n))))),Mg=(e,t)=>n=>new Ll((s=>{let a={},r=0;return n.pipe(Ag((n=>{const s=Date.now();let o;return o=t||sn,o&&o(n,a)&&s-r<e?xg():(a=n,r=s,_g(n))}))).subscribe(s)})),Lg=e=>{const{dataPageID:t,context:n,headers:s,containerItemID:a}=e,r={data_view_ID:t},{restApi:o,reqType:i}=_S("createDataObject",r),{content:c}=Am(a);return eu(ud(o,{method:i,headers:s,body:{data:c.content,pageInstructions:c?.pageInstructions}},a)).pipe(yg((t=>({response:t.data,actionInPayload:e}))),wg("Error occurred during ajax call at createDataObject Epic",n))},Ug=e=>{const{dataLookUp:t,context:n,headers:s,viewName:a,requestPayload:r}=e,o={data_view_ID:t,view_ID:a},{restApi:i,reqType:c}=_S("readDataObject",o);return eu(ud(i,{method:c,headers:s,body:{dataViewParameters:r}},n)).pipe(yg((t=>({response:t.data,headers:ym(t.headers),actionInPayload:e}))),wg("Error occurred during ajax call at getDataObjectView Epic",n))},Fg=e=>{const{dataPageID:t,context:n,headers:s,containerItemID:a,key:r}=e,o={data_view_ID:t},{restApi:i,reqType:c}=_S("updateDataObject",o),{content:l}=Am(a);return eu(ud(i,{method:c,headers:{...s,"if-match":e?.etag},body:{data:{...l.content,...r},pageInstructions:l.pageInstructions||[]}},a)).pipe(yg((t=>({response:t.data,actionInPayload:e}))),wg("Error occurred during ajax call at updateDataObject Epic",n))},Vg=e=>{const{lookupDatapage:t,context:n,headers:s,actionID:a,dataViewParameters:r}=e,o={data_view_ID:t,action_ID:a},{restApi:i,reqType:c}=_S("openDataObjectAction",o);return eu(ud(i,{method:c,headers:s,body:{dataViewParameters:r}},n)).pipe(yg((t=>({response:t.data,headers:ym(t.headers),actionInPayload:e}))),wg("Error occurred during ajax call at getDataObjectView Epic",n))},jg=e=>{const{savableDatapage:t,context:n,headers:s,actionID:a,keys:r,containerItemID:o,jsActionQueryParams:i}=e,c={data_view_ID:t,action_ID:a};let{restApi:l}=_S("submitDataObjectAction",c);const{reqType:u}=_S("submitDataObjectAction",c),{content:d}=Am(o);return l=CI(i,l),eu(ud(l,{method:u,headers:{...s,"if-match":e?.etag},body:{data:{...d?.content,...r},pageInstructions:d?.pageInstructions||[]}},n)).pipe(yg((t=>({response:t.data,actionInPayload:e}))),wg("Error occurred during ajax call at getDataObjectView Epic",n))};const kg=new class{constructor(){this.components={}}_checkComponent(e,t){return!!this.components[t]?.[e]}start(e,t,n,s,a){const r={viewName:e,pageReference:n,contextName:s,isInProgress:!0,active:!0,caseKey:t};this.components[s]=this.components[s]||{},this.components[s][a]=r}stop(e,t){this._checkComponent(e,t)&&(this.components[t][e].isInProgress=!1)}remove(e,t){this._checkComponent(e,t)&&delete this.components[t][e]}removeContext(e){delete this.components[e]}enableCascade(e){this.components[e]&&Object.values(this.components[e]).forEach((e=>{e.isInProgress&&(e.cascade=!0)}))}activate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!0)}deactivate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!1)}refreshActiveComponents(e){e&&this.components[e]&&Object.keys(this.components[e]).forEach((t=>{this.refreshComponent(t,e)}))}refreshComponent(e,t){if(!this._checkComponent(e,t))return;const n=this.components[t][e];if(n.active&&n.cascade){const{caseKey:e,viewName:s,pageReference:a}=n;DI(e,s,t,a,{})}}},Bg="postDataViewMetadata",$g={getData:(e,t,n,s)=>((e,t,n,s={})=>{const a={dataViewName:e},{skipClearErrorMessages:r,signal:o,doNotMergeMessagesForStatusCode:i}=s,{restApi:c,reqType:l}=_S("getListData",a);return ud(c,{method:l,body:t,...o&&{signal:o},...r&&{skipClearErrorMessages:r}},n,i)})(e,t,n,s),getListCount:(e,t,n)=>{const s={dataViewName:e},{restApi:a,reqType:r}=_S("getListDataCount",s);return ud(a,{method:r,body:t},n)},getDataViewMetadata:(e,t,n,s)=>{const a=!!n,r=!!s,o=By.doesRestApiExist(Bg),i=(a||r)&&o?Bg:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:u}=_S(i,c);if(o){if(a)return ud(l,{method:u,body:{associationFilter:n}},t);if(r)return ud(l,{method:u,body:{propertyFilter:s}},t)}return ud(l,{method:u},t)},getDataObjectView:(e,t,n,s,a={})=>{const{skipClearErrorMessages:r,signal:o,doNotMergeMessagesForStatusCode:i}=a,c={data_view_ID:e,view_ID:t},l={dataViewParameters:n},{restApi:u,reqType:d}=_S("readDataObject",c);return ud(u,{method:d,body:l,...o&&{signal:o},...r&&{skipClearErrorMessages:r}},s,i)},getCaseEditMetadata:(e,t)=>lI.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>lI.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,s)=>lI.updateCaseEditFieldsData(e,t,n,s),moveListRecords:(e,t)=>{const{sourceID:n,destinationID:s,context:a,listClass:r,viewName:o,viewClassName:i}=e,c={viewName:o,viewClassName:i},{restApi:l,reqType:u}=_S("moveListRecords",c);return ud(l,{method:u,body:{content:{sourceID:n,destinationID:s,context:a,listClass:r}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===Gs.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===Gs.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==ey("root").find((e=>e.includes("authoring-preview")))?`${Gs.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${Lp.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=Gy.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}},Gg=/{(.*?)}/i,Wg=/{(.*?)}/g,Hg=e=>null!==e.match(Gg),qg=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),zg=e=>{const t=e[e.length-1],n=e[e.length-2];if("y"!==t.toLowerCase())return`${e}s`;switch(n.toLowerCase()){case"a":case"e":case"i":case"o":case"u":return`${e}s`;default:return`${e=e.substring(0,e.length-1)}ies`}},Yg=e=>e.replaceAll("+","%20"),Kg=["portal","noPortal","debug","activeTab","contextParam","lang"],Qg=e=>{if(e.indexOf("?")>0){const[t,n]=e.split("?"),s=new URLSearchParams(n),a=new Map;for(const[e,t]of s)Kg.includes(e)||a.set(e,t);const r=Yg(new URLSearchParams(Array.from(a.entries())).toString());return r?`${t}?${r}`:t}return e},Jg=(e,t)=>e.includes("/assignments")?((e,t)=>{const n=e.split("/"),s=n.indexOf("assignments"),a=n.slice(s-2).join("/"),r=n[n.length-1],o=SS(er,{assignmentID:r});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:r},options:t,routeKey:dr,urlPath:a}})(e,t):By.getEndPointInfo(e),Xg=()=>{const e=Gy.environmentInfoObject?.pyExecutionRuntimeName;return"Infinity"===e};const Zg=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const eh=class{constructor(){this.users={},this.connected=!1,this.connectionsCount=1}_handleUserPresence({message:e}){const{state:t,updateById:n}=e,s=this.users[n];s&&(s.state=t,Object.keys(s.subscribers).forEach((e=>{s.subscribers[e]?.callback({state:s.state})})))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t,n){const s=this._getAutoGenId(),a=this.users[e];if(a)return a.subscribers[s]={callback:t,contextName:n},s;this.users[e]={subscribers:{[s]:{callback:t,contextName:n}}};const r={matcher:"PRESENCE",criteria:{userId:e}};return Ah.subscribe(r,this._handleUserPresence.bind(this)),s}unsubscribe(e,t){const n={matcher:"PRESENCE",unsubscribeUsers:{users:[e]}};this.users[e]&&this.users[e].subscribers&&(delete this.users[e].subscribers[t],0===Object.keys(this.users[e].subscribers).length&&(delete this.users[e],Ah.publishMessage(n)))}getUserState(e){return this.users[e]&&this.users[e].state}clearContext(e){Object.keys(this.users).forEach((t=>{Object.keys(this.users[t].subscribers).forEach((n=>{this.users[t].subscribers[n].contextName===e&&this.unsubscribe(t,n)}))}))}};const th=function(e,t,n,s){for(var a=e.length,r=n+(s?1:-1);s?r--:++r<a;)if(t(e[r],r,e))return r;return-1};const nh=function(e){return e!=e};const sh=function(e,t,n){for(var s=n-1,a=e.length;++s<a;)if(e[s]===t)return s;return-1};const ah=function(e,t,n){return t==t?sh(e,t,n):th(e,nh,n)};const rh=function(e,t){return!!(null==e?0:e.length)&&ah(e,t,0)>-1};const oh=function(e,t,n){for(var s=-1,a=null==e?0:e.length;++s<a;)if(n(t,e[s]))return!0;return!1};const ih=function(e,t,n,s){var a=-1,r=rh,o=!0,i=e.length,c=[],l=t.length;if(!i)return c;n&&(t=Tn(t,ft(n))),s?(r=oh,o=!1):t.length>=200&&(r=Ue,o=!1,t=new Me(t));e:for(;++a<i;){var u=e[a],d=null==n?u:n(u);if(u=s||0!==u?u:0,o&&d==d){for(var p=l;p--;)if(t[p]===d)continue e;c.push(u)}else r(t,d,s)||c.push(u)}return c};var ch=L?L.isConcatSpreadable:void 0;const lh=function(e){return He(e)||at(e)||!!(ch&&e&&e[ch])};const uh=function e(t,n,s,a,r){var o=-1,i=t.length;for(s||(s=lh),r||(r=[]);++o<i;){var c=t[o];n>0&&s(c)?n>1?e(c,n-1,s,a,r):We(r,c):a||(r[r.length]=c)}return r};const dh=Ms((function(e,t){return us(e)?ih(e,uh(t,1,us,!0)):[]}));const ph=class{constructor(e,t){this.atomicSubscribers={},this.connectionsCount=0,this.connected=!1,this.matcher=e,this.criteria=t,this.messagingServiceSubscriptionID=""}_handleAtomicMessage({message:e}){Object.keys(this.atomicSubscribers).forEach((t=>{const n=this.atomicSubscribers[t];if(!n)return;const s=Object.keys(n.criteria),a=Object.keys(e);0===dh(s,a).length&&n.callback(e)}))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t){const n=this._getAutoGenId();if(!this.messagingServiceSubscriptionID){this.messagingServiceSubscriptionID=n;const e={matcher:this.matcher,criteria:this.criteria},t=Ah.subscribe(e,this._handleAtomicMessage.bind(this),void 0,n);this.messagingServiceSubscriptionID=t||n,this.connected=!0}return this.atomicSubscribers[n]={criteria:e,callback:t},n}unsubscribe(e){delete this.atomicSubscribers[e],0===Object.keys(this.atomicSubscribers).length&&(this.connected=!1,this.messagingServiceSubscriptionID&&(Ah.unsubscribe(this.messagingServiceSubscriptionID),this.messagingServiceSubscriptionID=""))}};const gh=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new ph("CASE",t)}return this.subscriptions[e]}};const hh=class{static transformReference(e){return e.replace(/^[^.]*\./,"caseInfo.content.")}static extractReferenceParts(e){const t=e.split("."),n=t.pop()||"";return{pageReference:t.join("."),propertyName:n}}static getContextPath(e){return e.includes("workarea")?e:XE(`${e}/workarea`)||""}static publishCaseValuesUpdate(e,t){const n=this.getContextPath(t.actionInContext);Object.entries(e.message).forEach((([e,t])=>{const s=this.transformReference(e),{pageReference:a,propertyName:r}=this.extractReferenceParts(s);e.match(/\.\w+\[\d+\]\.\w+/)&&qm.executeStateMachine(n,s,t,!0,{skipStateUpdate:!0});sC([{type:sa,payload:{reference:s,value:t,context:n}},{type:ra,payload:{reference:s,value:t,context:n,pageReference:a,propertyName:r}}])}))}},{RESOURCE_TYPES:fh}=$s;const mh=class{static openCase(e,t,n,s={}){const a={insKey:e,acTargetName:n,actionMgrID:zp.getNextActionMgrId(),context:t,...s},r=Ia;s&&s.channelName?a.headers={[Gs.X_ORIGIN_CHANNEL]:s.channelName}:Gy.isWSSPortal()&&(a.headers={[Gs.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=zp.actionManagerPromise(r,a.actionMgrID);return sC({type:r,payload:a}),o}static openAssignment(e,t,n,s={}){const a={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:zp.getNextActionMgrId(),context:t,...s},r=Sa;s&&s.channelName?a.headers={[Gs.X_ORIGIN_CHANNEL]:s.channelName}:Gy.isWSSPortal()&&(a.headers={[Gs.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=zp.actionManagerPromise(r,a.actionMgrID);return sC({type:r,payload:{...a}}),o}static createCase(e,t,n,s={}){const a=ma,r={class:e,acTargetName:n,actionMgrID:zp.getNextActionMgrId(),context:t,...s};s&&s.channelName?r.headers={[Gs.X_ORIGIN_CHANNEL]:s.channelName}:Gy.isWSSPortal()&&(r.headers={[Gs.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=zp.actionManagerPromise(a,r.actionMgrID);return sC({type:a,payload:{...r}}),o}static getNextWork(e,t,n={}){const s=Sa,a={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:zp.getNextActionMgrId(),context:e,...n},{promise:r}=zp.actionManagerPromise(s,a.actionMgrID);return sC({type:s,payload:{...a}}),r}static getOpenedCaseItems(e){const t=[],n=LE(e);if(n){const{items:s={}}=n,a=Object.keys(s),r=YE(e);a.forEach((n=>{if(s[n]&&(s[n].resourceType===fh.CASE||s[n].resourceType===fh.ASSIGNMENT||s[n].resourceType===fh.OBJECT)){const{key:a="",context:o}=s[n],i=s[n],c=a.substring(a.indexOf(" ")+1),l=iC(".caseTypeID",Gs.CASE_INFO.CASE_INFO,o),u=r===n;t.push({...i,key:a,workID:a,caseID:c,className:l,context:o,containerItemID:n,target:e,active:u})}}))}return t}static getCaseDetails=(e,t)=>{if(!e)return Promise.reject(new Error("Case ID is required"));const n={caseID:e},{restApi:s,reqType:a}=_S(Za,n),r={},o=qs.getRemoteHeaderFromSourceClass(t??"");return o&&(r.RemoteSystemID=o),ud(s,{method:a,headers:r})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=_S("getBulkActions"),s=e.map((e=>({ID:e}))),a=s.length,r=a/5,o={},i=[];for(let e=0;e<a;e+=r)o.cases=s.slice(e,e+r),o.cases.length&&i.push(ud(t,{method:n,body:o}));const c=await Promise.all(i);let l=[];for(let e=0;e<c.length;e+=1)0===e?l=c[e].data.availableActions:l.length&&(l=l.filter((t=>c[e].data.availableActions.some((e=>t.ID===e.ID)))));return l};static getCaseBulkActionsByCaseTypeID=async e=>{const t={casetypeID:e},{restApi:n,reqType:s}=_S("getCaseBulkActions",t),a=await ud(n,{method:s});let r=[];return a.data?.availableActions?.length&&(r=a.data.availableActions),r};static getAssignmentBulkActions=async e=>{const{restApi:t,reqType:n}=_S("getAssignmentBulkActions"),s={assignments:e.map((e=>({ID:e})))},a=await ud(t,{method:n,body:s});return a.data?.availableActions??[]}};class Ih{static CLOSE_CONTAINER_ITEM_EVENT=$s.PUB_SUB_EVENTS.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM;static objectRedirectionSubIds={};static truncateNamespace(e){let t=e;return!ks.isNamespaceEnabled()&&e&&e.includes("__")&&(t=e.substring(e.indexOf("__")+2)),t}static handleOpenObject(e){const{ObjectID:t}=e;let n;({ActionName:n}=e),n=this.truncateNamespace(n);const s=Hp.getComponentCache("lastActionID")||"";if("string"==typeof s&&s?.toLowerCase()!==n?.toLowerCase())return;let a=!1;const r=YE("app/modal");r&&(a=FE("app/modal",r)?.isMinimizable??!1),!r||a?mh.openCase(t,Gs.APP.APP,Gs.PRIMARY,{isAutoRedirection:!0}):Uu.subscribe(this.CLOSE_CONTAINER_ITEM_EVENT,(e=>{e?.containerItemID===r&&(Uu.unsubscribe(this.CLOSE_CONTAINER_ITEM_EVENT,"closeContainerItemForRedirection"),mh.openCase(t,Gs.APP.APP,Gs.PRIMARY,{isAutoRedirection:!0}))}),"closeContainerItemForRedirection",!0)}static handleRefreshObject(e){mh.openCase(e,Gs.APP.APP,Gs.PRIMARY,{forceRefresh:!0})}static handleObjectRedirection(e,t){const{message:n,filter:s}=e,{caseId:a,currUserID:r}=t;if(s?.criteria?.CurrentObjectID!==a||s?.criteria?.UserID?.toLowerCase()!==r?.toLowerCase())return;const{RedirectionType:o}=n||{};switch(o){case"OpenObject":this.handleOpenObject(n);break;case"RefreshObject":this.handleRefreshObject(a)}}static subscribeToRedirection(e){const t=Gy.getOperatorIdentifier()||"",n={matcher:"REDIRECTION",criteria:{CurrentObjectID:e,UserID:t?.toLowerCase()}},s=Ah.subscribe(n,(n=>{this.handleObjectRedirection(n,{caseId:e,currUserID:t})}));this.objectRedirectionSubIds[e]=s}static unsubscribeToRedirection(e){Ah.unsubscribe(this.objectRedirectionSubIds[e]),delete this.objectRedirectionSubIds[e]}static subscribeToEvent(e,t){let n=null;if(e===Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?n=e=>{const{caseId:t}=e;this.objectRedirectionSubIds[t]||this.subscribeToRedirection(t)}:e===Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD&&(n=e=>{const{caseId:t}=e;this.objectRedirectionSubIds[t]&&this.unsubscribeToRedirection(t)}),!n)throw new Error(`Unhandled eventKey: ${e}`);Uu.subscribe(e,n,t)}static unsubscribeToEvent(e,t){Uu.unsubscribe(e,t)}static subscribeToCaseEvents(){this.subscribeToEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.subscribeToEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}static unsubscribeToCaseEvents(){this.unsubscribeToEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.unsubscribeToEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}}const Eh=Ih;class yh{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new eh;static refreshB2SOffset=10;static agentSubscribeIdMap=new Map;static filterKeyToSubscriberIdMap=new Map;static get offlineEnabled(){return"undefined"!=typeof navigator&&(navigator.userAgent||"").includes("pxUsesOffline")}static isAuthenticated=!1;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=Lp.b2sJWT;if(!n||n.length<4)return;this.webSocket&&(this.webSocket.close(),this.cleanSocketListeners());const s=t.endsWith("/")?t+"ws":t+"/ws";try{const e=new WebSocket(`${s}`);this.webSocket=e,this.boundHandleOnOpen=this.handleOnOpen.bind(this),this.boundHandleOnMessage=this.handleOnMessage.bind(this),this.boundHandleOnError=this.handleOnError.bind(this),this.boundHandleOnClose=this.handleOnClose.bind(this),e.addEventListener("open",this.boundHandleOnOpen),e.addEventListener("message",this.boundHandleOnMessage),e.addEventListener("error",this.boundHandleOnError),e.addEventListener("close",this.boundHandleOnClose)}catch(e){console.log(e)}}static handleOnError(e){this.getTokenExpiryTime()<=0&&(clearInterval(this.reInitInterval),this.reInitInterval=void 0,this.isAuthenticated=!1),console.error("web socket error - readyState:",this.webSocket?.readyState,"| isTrusted:",e?.isTrusted)}static handleOnClose(e){null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),this.isAuthenticated=!1,console.debug("web socket closed - code:",e?.code,"| wasClean:",e?.wasClean),e&&4001===e.code||this.connectionConfig?.disableReInit||this.reInitInterval||this.getTokenExpiryTime()<=0||this.reInitialization()}static handleOnOpen(){if(clearInterval(this.reInitInterval),this.reInitInterval=void 0,null!==this.webSocket&&1===this.webSocket.readyState){const e=Lp.b2sJWT;if(!e||e.length<4)return;this.publishMessage({token:e})}}static unsubscribeAgentMessageCaseValues(e){if(e.assignmentID){const t=yh.agentSubscribeIdMap.get(e.assignmentID);yh.unsubscribe(t??""),yh.agentSubscribeIdMap.delete(e.assignmentID)}}static subscribeAgentMessageCaseValues(e){const t={matcher:"COACH_UPDATE",criteria:{caseId:e.caseKey,assignmentId:e.assignmentID}},n=yh.subscribe(t,(t=>{hh.publishCaseValuesUpdate(t,e)}));yh.agentSubscribeIdMap.set(e.assignmentID,n)}static handleOnMessage(e){if(null!==e&&"ALIVE"===e.data)null===this.isServiceAlive&&this.checkLiveliness(Gs.PRIORITY.PING),this.isServiceAlive=!0;else{let t=null;try{t=JSON.parse(e.data)}catch(t){console.error("Invalid data received from messaging service",e.data)}if(t&&t.msgId&&this.webSocket?.send(`{"ack":"${t.msgId}"}`),t&&t.filter){const{matcher:e,criteria:n}=t.filter;delete n.environmentID,n.productionLevel&&delete n.productionLevel,this.dispatchToSubscribers(e,n,t)}else if(t?.tokenExpiryTime){Uu.subscribe(Gs.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_LOAD,yh.subscribeAgentMessageCaseValues),Uu.subscribe(Gs.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_UNLOAD,yh.unsubscribeAgentMessageCaseValues),this.isAuthenticated=!0,this.setTokenExpiryTime({tokenExpiryTime:t.tokenExpiryTime});const e=1e3*(this.getTokenExpiryTime()-this.refreshB2SOffset);setTimeout((()=>this.refreshB2STokenReInit()),e),this.inProgressSubscriptions.forEach((({messageSubscriber:e,id:t})=>{this.subscribeToSocket(e,t)})),this.inProgressSubscriptions=[],this.inProgressMessages.forEach((e=>{this.publishMessage(e)})),this.inProgressMessages=[]}else console.error("filter missing from received data from messaging service",e.data)}}static dispatchToSubscribers(e,t,n){Object.keys(this.subscribers).forEach((s=>{const a=this.subscribers[s];a?.filter&&a.filter.matcher===e&&AC.isEqual(a.filter.criteria,t)&&a.messageHandler(n)}))}static reInitialization(e){this.reInitInterval||(Object.keys(this.subscribers).forEach((e=>{this.unsubscribe(e,!0)})),Object.keys(this.subscribers).forEach((e=>{this.inProgressSubscriptions.push({messageSubscriber:this.subscribers[e],id:e})})),e?this.initConnection(this.connectionConfig):this.reInitInterval=setInterval((()=>{this.initConnection(this.connectionConfig)}),5500))}static checkLiveliness(e){!1===this.isServiceAlive?this.reInitialization(!0):this.isServiceAlive=!1,null!==this.serviceAliveHandler&&clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=setTimeout((()=>{this.checkLiveliness(e)}),e)}static setConnectionConfig(e){this.connectionConfig=e}static cleanSocketListeners(){null!==this.webSocket&&(this.webSocket.removeEventListener("open",this.boundHandleOnOpen),this.webSocket.removeEventListener("message",this.boundHandleOnMessage),this.webSocket.removeEventListener("error",this.boundHandleOnError),this.webSocket.removeEventListener("close",this.boundHandleOnClose))}static disconnect(){null!==this.webSocket&&(this.cleanSocketListeners(),this.webSocket.close(),this.webSocket=null)}static getFilterKey(e){return`${e.matcher}:${JSON.stringify(e.criteria)}`}static findExistingSubscriberId(e){return this.filterKeyToSubscriberIdMap.get(this.getFilterKey(e))}static subscribe(e,t,n,s){this.connectionsCount+=1;const a=s||`${Date.now()}_${this.connectionsCount}`;if("COACH_UPDATE"===e.matcher){const t=this.findExistingSubscriberId(e);if(t)return t}const r=new Zg(e,t,n);return null!==this.webSocket&&1===this.webSocket.readyState&&this.isAuthenticated?(this.subscribeToSocket(r,a),a):(this.inProgressSubscriptions.push({messageSubscriber:r,id:a}),e&&this.filterKeyToSubscriberIdMap.set(this.getFilterKey(e),a),this.offlineEnabled&&(this.subscribers[a]=r),null===this.webSocket&&this.initConnection(this.connectionConfig),a)}static subscribeToSocket(e,t){this.subscribers[t]=e,e.filter&&this.filterKeyToSubscriberIdMap.set(this.getFilterKey(e.filter),t);if(Object.keys(this.subscribers).filter((t=>this.subscribers[t]===e)).length>1)return;const n={filter:e.filter,subscribe:{id:t}};this.webSocket?.send(JSON.stringify(n))}static unsubscribe(e,t){if(this.subscribers[e]){if(!t){const t=this.subscribers[e].filter;t&&this.filterKeyToSubscriberIdMap.delete(this.getFilterKey(t)),delete this.subscribers[e]}const n={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(n))}this.offlineEnabled&&!t&&this.removeFromInProgressSubscriptions(e)}static removeFromInProgressSubscriptions(e){const t=this.inProgressSubscriptions.findIndex((t=>t.id===e));if(-1!==t){const e=this.inProgressSubscriptions[t].messageSubscriber.filter;e&&this.filterKeyToSubscriberIdMap.delete(this.getFilterKey(e)),this.inProgressSubscriptions.splice(t,1)}}static publishMessage(e){null!==this.webSocket?null===this.webSocket||1!==this.webSocket.readyState?this.inProgressMessages.push(e):this.webSocket.send(JSON.stringify(e)):console.error("Web socket not initialized.")}static getUserPresence=()=>this.userPresence;static dispatchLocalMessage(e){const{matcher:t,criteria:n,message:s={}}=e,{environmentID:a,productionLevel:r,...o}=n,i={msgId:`local_${Date.now()}`,filter:{matcher:t,criteria:o},message:s};this.dispatchToSubscribers(t,o,i)}static getCaseSubscription=e=>gh.getOrCreateSubscription(e);static initObjectRedirectionSubscription=()=>Eh.subscribeToCaseEvents();static refreshB2STokenReInit=async()=>{if(Xg()){const e={body:{B2SToken:Lp.b2sJWT}};Cp("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(Lp.b2sJWT=t,this.setTokenExpiryTime({tokenExpiryTime:Math.round(Date.now()/1e3)+60}),this.webSocket?.close()):console.log("refreshB2S: invalid b2s length")})).catch((e=>{console.log(`refreshB2S: error occurred while fetching: ${e}`)}))}else if(!_p("refreshB2S")){Sp("/uas/api/v1/isolations/token/websocket-ticket",{method:"GET",withoutDefaultHeaders:!1},"").then((e=>{const{token:t}=e.data;t&&(Lp.b2sJWT=t,this.setTokenExpiryTime({tokenExpiryTime:Math.round(Date.now()/1e3)+60}),this.webSocket?.close())})).catch((e=>{console.error(`websocket-ticket: error occurred while fetching: ${e}`)}))}};static getTokenExpiryTime=()=>{const e=Math.round(Date.now()/1e3);return this.tokenExpiryTime-e};static setTokenExpiryTime=e=>{this.tokenExpiryTime=e.tokenExpiryTime};static clearContext(e){Object.keys(this.subscribers).forEach((t=>{this.subscribers[t].contextName===e&&this.unsubscribe(t)})),this.userPresence.clearContext(e)}}const Ah=yh;const Ch=class{constructor(){this.records=[],this.maxRecords=0,this.isDirty=!1}getRecords(e){if(Number.isInteger(e?.pageNumber)&&Number.isInteger(e?.pageSize)){const t=[],{pageNumber:n,pageSize:s}=e,a=n*s;let r=a-s;for(;r<a;r+=1){if(!this.records[r])return this.maxRecords===r?t:[];t.push(this.records[r])}return t}return this.records}mergeRecords(e,t){if(Number.isInteger(t?.pageNumber)&&Number.isInteger(t?.pageSize)){const{pageNumber:n,pageSize:s}=t,a=n*s;let r=0;for(let t=a-s+1-1;t<a;t+=1)this.records[t]=e[r],r+=1;if(e.length<s){const t=(n-1)*s+e.length;this.setMaxRecordsCount(t)}}else e||(e=[]),Array.isArray(this.records)&&Array.isArray(e)&&(this.records=hC(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const Sh=new class{SUBSCRIPTION_STATUS_FAILED="FAILED";SUBSCRIPTION_STATUS_SUCCESS="SUCCESS";DATAPAGE_NOT_CACHED="Data Page Not Cached";DUPLICATE_SUBSCRIPTION_ID="Duplicate Subscription Id";MISSING_MANDATORY_FIELD="Missing Mandatory Field(s)";constructor(){this.dataStore={},this.dataStoreMeta={},this.subscribers={},this.dataPageSubscribers={},this.isCacheEnabled=!0,this.subscribedDataPageNames=new Map}getDataViewParameters(e,t){if(!e||!t)return e;if(!t.parameters)return{};const n=Array.isArray(t.parameters)?t.parameters:[t.parameters],s=new Set(n.map((e=>e.name))),a={};return Object.keys(e).forEach((t=>{s.has(t)&&(a[t]=e[t])})),a}resolveParameterValue(e,t,n,s,a){return AC.resolveParameterValue(e,t,n,s,a)}formatParameterValue(e,t,n,s,a){return AC.formatParameterValue(e,t,n,s,a)}resolveAndFormatParameters(e,t,n,s,a){return AC.resolveAndFormatParameters(e,t,n,s,a)}getData(e,t,n,s){const a=this.generateHash(e,t,s);if(this.dataStore[e]&&this.dataStore[e][a]){const t=this.dataStore[e][a];return t.isDirty?[]:t.getRecords(n)}return[]}async getDataAsync(e,t,n={},s,a,r={}){const o=LA(e),i=this.getDataViewParameters(n,o);r.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e));const c={skipClearErrorMessages:!0,...r};if(!this.isCacheable(e,a)||r.invalidateCache){const n=await this.fetchData(e,i,s,a,t,c);return{...n.data,data:this.isCacheable(e,a)?this.mergeDataStore(e,i,s,a,n):n.data?.data??[],pageNumber:n?.data?.pageNumber,pageSize:n?.data?.pageSize,queryStats:n?.data?.queryStats,status:n?.status}}const l=this.getData(e,i,s,a);if(l.length>0)return Promise.resolve({data:l});const u=await this.fetchData(e,i,s,a,t,c);return{...u.data,data:this.mergeDataStore(e,i,s,a,u),pageNumber:u?.data?.pageNumber,pageSize:u?.data?.pageSize,queryStats:u?.data?.queryStats,status:u?.status}}async getPageDataAsync(e,t,n={},s={}){const a=this.generateHash(e,n,null);if(s.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),this.isCacheable(e)&&this.dataStore[e]&&this.dataStore[e][a]){if(!s?.invalidateCache)return Promise.resolve(this.dataStore[e][a]);delete this.dataStore[e][a],this._removeDataStoreMetaEntry(e,n,a)}const{restApi:r,reqType:o}=_S(Gs.GET_PAGE_DATA,{dataViewName:e,dataViewParameters:encodeURIComponent(JSON.stringify(n))}),i={method:o,...s.skipClearErrorMessages&&{skipClearErrorMessages:s.skipClearErrorMessages}};if(s.enableStreaming){const e=s.streamOptions||{};Object.assign(i,{responseType:"stream",adapter:"fetch",headers:{Accept:"text/event-stream"},...e})}const c=r&&n&&0===Object.keys(n).length?r.split("?")[0]:r;return ud(c,i,t).then((t=>(this.isCacheable(e)&&(this.dataStore[e]={...this.dataStore[e],[a]:t.data},this._addDataStoreMetaEntry(e,n,a)),s.enableStreaming?t:t.data)))}subscribeToDataPageUpdates(e,t,n,s={}){if(!e||!t||!n)return!1;const a=this.generateHash(n,s,null);this.dataPageSubscribers[n]??={};const r=this.dataPageSubscribers[n];r[a]??={};const o=r[a];return this.subscribeToMessageService(n,e),!o[e]&&(o[e]??=t,!0)}unsubscribeToDataPageUpdates(e,t,n={}){if(!e||!t)return!1;const s=this.generateHash(t,n,null);delete this.dataPageSubscribers[t]?.[s]?.[e];const a=this.subscribedDataPageNames.get(t)??0;return a<=1?(this.subscribedDataPageNames.delete(t),e&&Ah.unsubscribe(e)):this.subscribedDataPageNames.set(t,a-1),!0}unsubscribeToDatapageUpdates(e,t,n={}){return this.unsubscribeToDataPageUpdates(e,t??"",n)}_isDataPageCached(e,t){if(t&&AC.isObjectEmpty(t))return!!this.dataStore[e];const n=this.generateHash(e,t,null);return!!this.dataStoreMeta[e]?.[n]?.length}updateDataPageStore(e={}){Object.keys(e).forEach((t=>{this.dataStore[t]||(this.dataStore[t]={});const n=e[t],s=ks.getDefaultQualifiedName("pxResults");Object.keys(n).forEach((n=>{if(this.dataStore[t][n]){this.dataStore[t][n].mergeRecords(e[t][n][s])}else{const a=new Ch;this.dataStore[t][n]=a,a.mergeRecords(e[t][n][s]||[])}}))}))}_addDataStoreMetaEntry(e,t,n){const s=this.generateHash(e,t,null);this.dataStoreMeta[e]??={};const a=this.dataStoreMeta[e];a[s]??=[];const r=a[s];r.includes(n)||r.push(n)}_removeDataStoreMetaEntry(e,t,n){if(!e||t||n||(this.dataStoreMeta[e]={}),e&&t&&n){const s=this.generateHash(e,t,null);this.dataStoreMeta[e][s]=this.dataStoreMeta[e][s].filter((e=>e!==n))}}mergeDataStore(e,t,n,s,a){const r=this.generateHash(e,t,s),o=a?.data?.data;if(!o||0===o.length)return[];this.dataStore[e]||(this.dataStore[e]={}),this.dataStore[e][r]||(this.dataStore[e][r]=new Ch);const i=this.dataStore[e][r];return i.mergeRecords(o,n),i.isDirty=!1,this._addDataStoreMetaEntry(e,t,r),i.getRecords(n)}isDataPage(e=""){return e.startsWith("D_")||e.startsWith("Declare_")||e.startsWith(ks.getDefaultQualifiedName("D_"))||e.startsWith(ks.getDefaultQualifiedName("Declare_"))}subscribeToUpdate(e,t,n,s,a,r){this.subscribers[e]=this.subscribers[e]||{},this.subscribers[e].callback=this.subscribers[e].callback||{},r&&!this.subscribers[e].callback?.[r]&&(this.subscribers[e].callback[r]=a),this.subscribeToCascadeUpdates(e,t,n,s,r)}unsubscribe(e,t,n,s,a){delete this.subscribers[e]?.callback?.[a],t&&t.length>0&&XA.unRegisterFields(n,s,t,a)}handleMessage(e){const{msgId:t,message:n}=e,{datapage:s,parameters:a=""}=n,r=this.subscribers[s];this.markDataInstanceDirty(s,""===a?null:JSON.parse(a)),t&&this._executeDataPageSubscriptions(e),!t&&r?.callback&&Object.keys(r.callback).forEach((t=>{r.callback?.[t](e.message)}))}markDataInstanceDirty(e,t){let n,s;if((!t||(n=this.generateHash(e,t,null),s=this.dataStoreMeta[e]?.[n],s?.push(this.generateHash(e,null)),s))&&this.dataStore[e]){Object.keys(this.dataStore[e]).filter((e=>!t||!s||s.includes(e))).forEach((t=>{this.dataStore[e][t].isDirty=!0}))}}_executeDataPageSubscriptions(e){const{message:t}=e,{datapage:n,parameters:s}=t,a=s?JSON.parse(s):null;if(this.dataPageSubscribers[n])if(a){const t=[];t.push(this.generateHash(n,a,null)),t.push(this.generateHash(n,null,null)),t.forEach((t=>{const s=this.dataPageSubscribers[n]?.[t]??{};Object.keys(s).forEach((t=>{s[t](e.message)}))}))}else{const t=this.dataPageSubscribers[n];Object.keys(t).forEach((n=>{const s=t[n];Object.keys(s).forEach((s=>{t[n][s](e.message)}))}))}}isPerInteraction(e){const t=LA(e);return!t||"reloadOncePerInteraction"===t.refreshStrategy?.type}disableCache(e){this.isCacheEnabled=!e}generateHash(e,t,n){const s=LA(e);let a=[];s||(a=Object.keys(t||{}).map((e=>({name:e}))));const r=s?.parameters||a;let o="",i=e;const c=[];return Array.isArray(r)&&r.forEach((e=>{t?.[e.name]?c.push(t[e.name]):c.push(e.defaultValue??Gs.NULL_STRING)})),n&&c.push(JSON.stringify(n)),c.join(Gs.HASH_DELIMITER)&&(o=AC.getHashedString(c.join(Gs.HASH_DELIMITER)),i=e+Gs.UNDERSCORE_STRING+o),i}async fetchData(e,t,n,s,a,r){const{additionalApiParams:{useExtendedTimeout:o=!1,includeTotalCount:i=!1}={},...c}=r,l={dataViewParameters:t};return i&&(l.includeTotalCount=!0),o&&(l.useExtendedTimeout=!0),n&&(l.paging=n),s&&(l.query=s),$g.getData(e,l,a,c)}handleCascadeUpdate(){const{dataPageName:e,scope:t}=this;t.handleMessage({message:{datapage:e,parameters:""}})}subscribeToCascadeUpdates(e,t,n,s,a){t&&t.length>0&&XA.registerFields(n,s,t,this.handleCascadeUpdate.bind({dataPageName:e,scope:this}),a)}subscribeToMessageService(e,t){if(e&&this.subscribedDataPageNames.has(e)){const t=this.subscribedDataPageNames.get(e)??0;return void this.subscribedDataPageNames.set(e,t+1)}const n={matcher:"DATAPAGE_UPDATED",criteria:{datapage:e}};Ah.subscribe(n,this.handleMessage.bind(this),void 0,t),this.subscribedDataPageNames.set(e,1)}isCacheable(e,t){return!(this.isPerInteraction(e)||!this.isCacheEnabled)&&!(t&&Object.keys(t).length>1)}};const _h=class{constructor(e,t,n,s,a=100,r=500){this.finalDataViewCall=e,this.combiner=t,this.comparator=n,this.separator=s,this.maxtime=a,this.maxsize=r,this.groupedDataViewArray=[]}findCombinableDataViewCall(e){return this.groupedDataViewArray.find((t=>this.comparator(t,e)))}dequeueAllDataViewCalls(){for(this.groupedDataViewArray.reverse();this.groupedDataViewArray.length>0;){const e=this.groupedDataViewArray.pop();this.finalDataViewCall(e).then((t=>{this.separator(e,t)}))}clearTimeout(this.timeoutId)}dequeueDataViewCallOnSizeExceed(e){const t=this.groupedDataViewArray.findIndex((t=>this.comparator(t,e)));this.groupedDataViewArray[t]&&(this.groupedDataViewArray.splice(t,1),this.finalDataViewCall(e).then((t=>{this.separator(e,t)})))}queueDataViewCall(e,t){let n,s,a=this.findCombinableDataViewCall(e);return n=new Promise((e=>{s=e})),a&&!a.dataViewCallMap[t]?(this.combiner(a,e),a.dataViewCallMap[t]={promise:n,resolve:s}):a?n=a.dataViewCallMap[t].promise:(a={...e,dataViewCallMap:{[t]:{promise:n,resolve:s}}},this.groupedDataViewArray.push({...e,dataViewCallMap:{[t]:{promise:n,resolve:s}}})),Object.keys(a.dataViewCallMap).length===this.maxsize?this.dequeueDataViewCallOnSizeExceed(a):(clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>this.dequeueAllDataViewCalls()),this.maxtime)),n}};const Nh=class{constructor(){this.bufferedDataQueues={}}getBufferedDataQueueForDataPage(e){return this.bufferedDataQueues[e]}addBufferedDataQueueForDataPage(e,t,n,s,a,r,o){return this.getBufferedDataQueueForDataPage(e)||(this.bufferedDataQueues[e]=new _h(t,n,a,s,r,o)),this.bufferedDataQueues[e]}},Th=(e,t)=>((e,t)=>1===Object.keys(e).length&&Object.keys(e).length===Object.keys(t).length)(e,t)&&((e,t)=>"EQ"===t.F0.comparator&&(e.F0.comparator===t.F0.comparator||"IN"===e.F0.comparator))(e,t)&&e.F0.ignoreCase===t.F0.ignoreCase,Dh=e=>e.map((e=>e.field)),Ph=(e,t)=>{const n=(e.query?.filter).filterConditions,s=(t.query?.filter).filterConditions;let a=(t.query?.filter).logic;const r=Object.keys(n).length;Th(n,s)?("EQ"===n.F0.comparator&&(e=>{const t=e?.F0.rhs?.value;e.F0.rhs={values:[t]},e.F0.comparator="IN"})(n),(n.F0.rhs?.values).push(s.F0.rhs?.value)):(Object.keys(s).forEach(((e,t)=>{const o=`F${r+t}`;n[o]=s[e],a=a.replace(e,o)})),(e.query?.filter).logic+=` OR ${a}`);const o=Dh(e.query?.select);Dh(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},Oh=(e,t)=>((e,t)=>Object.keys(e.filterConditions).length%Object.keys(t.filterConditions).length==0&&!Object.keys(t.filterConditions).some((n=>e.filterConditions[n].lhs.field!==t.filterConditions[n]?.lhs.field)))(e.query?.filter,t.query?.filter)&&(((e,t)=>e.dataViewParameters&&t.dataViewParameters&&Object.keys(t.dataViewParameters).length===Object.keys(e.dataViewParameters).length&&!Object.keys(e.dataViewParameters).some((n=>"string"==typeof t.dataViewParameters?.[n]?e.dataViewParameters?.[n]!==t.dataViewParameters?.[n]:!AC.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),Rh=(e,t)=>{const{data:n}=t,{dataViewCallMap:s,filterDataOnClient:a}=e;Object.keys(s).forEach((e=>{s[e].resolve({data:a(e,n)})}))},bh=e=>({combiner:Ph,comparator:Oh,separator:Rh,...e}),vh=(e,t)=>{if("undefined"!=typeof window)try{window.sessionStorage.setItem(e,t)}catch(e){}},xh=(e,t="",n="IS_NULL")=>({comparator:n,lhs:{field:e},...t&&{rhs:{value:t}}}),wh=e=>null!=e&&"object"==typeof e&&!("then"in e);class Mh{constructor(e,t){this.isInitialised=!1,this.isQueryable=!0,this.dataSourceMetaData={},this.nonQueryableData=[],this.fetchedNQData=!1,this.previousSearchText=null,this.totalRecordCount=0,this.fetchedRecordCount=0,this.cache=new Map,this.keyCache=new Map,this.pageNumber=0,this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null,this.dataSource="",this.bufferInitialized=!1,e&&(this.listType=e.listType,this.dataSource=e.dataSource,e.enablePagination?(this.enablePagination=e.enablePagination,this.pageSize=e.pageSize):this.maxResultsDisplay=e.maxResultsDisplay,this.parameters=e.parameters,this.columns=e.columns,this.matchPosition=e.matchPosition,this.ignoreCase=!1!==e.ignoreCase,this.dataSourceMetaData=e.dataSourceMetaData,this.context=t)}static searchResultsCache={};static init(e,t){return new Promise(((n,s)=>{const a=[...e.columns.map((e=>e.value)),...Object.entries(e.parameters).map((([e,t])=>`${e}+${t}`)),e.matchPosition,e.maxResultsDisplay].join(Gs.HASH_DELIMITER),r=AC.getHashedString(a),o=`${e.dataSource}_${r}`,i=`__dataviewmetadata__${e.dataSource}`,c=$g.getAppCacheKey(i);if("undefined"!=typeof window&&window.sessionStorage.getItem(c)){const a=JSON.parse(`${window.sessionStorage.getItem(c)}`);if(t&&Mh.searchResultsCache?.[t]?.[o])n(Mh.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Mh.searchResultsCache?.persisted?.[o])n(Mh.searchResultsCache.persisted[o]);else{const r=new Mh(e,t);JSON.stringify(a.associationFilter)===JSON.stringify(e.associationFilter)?(r.dataSourceMetaData=a.dataSourceMetaData,r.isQueryable=a.isQueryable,r.isInitialised=a.isInitialised,r.associationFilter=a.associationFilter,Mh.initializeCache(t,e,o,r),n(r)):(r.associationFilter=e.associationFilter,r.propertyFilter=e.propertyFilter,r.fetchMetaData(t).then((s=>{vh(c,JSON.stringify({isQueryable:s.data.isQueryable,dataSourceMetaData:s.data,isInitialised:!0,associationFilter:e.associationFilter})),r.isQueryable=s.data.isQueryable,r.dataSourceMetaData=s.data,r.isInitialised=!0,Mh.initializeCache(t,e,o,r),n(r)})).catch((e=>{r.isInitialised=!1,s(e)})))}}else if(e.deferDatasource&&LA(e.dataSource)){const s=new Mh(e,t),a=LA(e.dataSource);s.isQueryable=!!a?.isQueryable,s.isInitialised=!0,s.dataSourceMetaData=a,vh(c,JSON.stringify({isQueryable:a?.isQueryable,dataSourceMetaData:a,isInitialised:!0})),s.context=t,Mh.initializeCache(t,e,o,s),n(s)}else{const a=new Mh(e,t);a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((s=>{vh(c,JSON.stringify({isQueryable:s.data.isQueryable,dataSourceMetaData:s.data,isInitialised:!0,associationFilter:e.associationFilter})),a.isQueryable=s.data.isQueryable,a.dataSourceMetaData=s.data,a.isInitialised=!0,Mh.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,s(e)}))}}))}static bufferedDataView=new Nh;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(bh(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Mh.searchResultsCache[e]}static initializeCache(e,t,n,s){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Mh.searchResultsCache[e]&&(Mh.searchResultsCache[e]={}),Mh.searchResultsCache[e][n]=s):(void 0===Mh.searchResultsCache.persisted&&(Mh.searchResultsCache.persisted={}),Mh.searchResultsCache.persisted[n]=s)}fetchMetaData(e){return $g.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Mh.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>Sh.getDataAsync(this.dataSource,this.context,e.dataViewParameters,e.paging,e.query)),e.combiner,e.separator,e.comparator,e.waitTime,e.maxSize)}buildSchemaForQueryableBufferDP(e){return{...this.buildSchemaForQueryableDP(e),paging:void 0,filterDataOnClient:this.filterDataOnClient.bind(this)}}buildQueryWithKeys=(e,t,n)=>{const s=this.buildSelect(n),a=((e=[],t={},n="")=>{if(!e.length||!Object.keys(t))return;const s={};return e.forEach(((e,n)=>{const a=t[e];let r;r=a?xh(e,a,"EQ"):xh(e),s[`T${n+1}`]=r})),{logic:Object.keys(s).join(` ${n} `),filterConditions:s}})(e,t,"AND");return{select:s,...a&&{filter:a},...$g.isDistinctResultsOnly(s)&&{distinctResultsOnly:"true"}}};buildSchemaForQueryableDPWithKeys=(e,t,n)=>({dataViewParameters:this.parameters,query:this.buildQueryWithKeys(e,t,n),paging:this.buildPageOptions()});getRowDataByKeys=async(e,t,n)=>this.memoizedGetRowDataByKeys(e,t,n);buildKeyCacheKey(e,t,n){const s=e.map((e=>[e,t[e]??""])),a=n?.columns?.map((e=>e.value));return JSON.stringify({filterEntries:s,columns:a,pageNumber:this.pageNumber})}memoizedGetRowDataByKeys(e,t,n){const s=this.buildKeyCacheKey(e,t,n);(n?.invalidateCache||n?.purgeDataPageCache)&&this.keyCache.delete(s);const a=this.keyCache.get(s);if(a)return a;const r=this.isQueryable?this.buildSchemaForQueryableDPWithKeys(e,t,n):this.buildSchemaForNonQueryableDP(),o=Sh.getDataAsync(this.dataSource,this.context,r.dataViewParameters,this.isQueryable?r.paging:void 0,this.isQueryable?r.query:void 0,{...n}).catch((e=>(this.keyCache.delete(s),Promise.reject(e))));return this.keyCache.set(s,o),o}getData(e,t){if(this.isQueryable){if(this.bufferInitialized)try{const t=this.buildSchemaForQueryableBufferDP(e);return Mh.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return Sh.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return Sh.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query,{...t})}return this.fetchNonQueryableResults(e,t)}getCachedResult(e,t){if(this.enablePagination&&wh(t)&&t.has(this.pageNumber))return t.get(this.pageNumber);const n=this.cache.get(e);return this.enablePagination||!n||wh(n)?void 0:n}handleCacheError(e,t){if(this.enablePagination){const t=this.cache.get(e);t&&wh(t)&&t.delete(this.pageNumber)}else this.cache.delete(e);return Promise.reject(t)}storeCacheResult(e,t){if(this.enablePagination){let n=this.cache.get(e);n&&wh(n)||(n=new Map,this.cache.set(e,n)),n.set(this.pageNumber,t)}else this.cache.set(e,t)}isResultCached(e){if(!this.isInitialised||!this.isValidDatasource()||this.context&&!EC(this.context))return!1;const t=e.toLowerCase(),n=this.cache.get(t);return!!n&&(!this.enablePagination||wh(n)&&n.has(this.pageNumber))}memoizedGetData(e,t){const n=e?.toLowerCase(),s=this.cache.get(n);if(this.isResultCached(e)&&s){const e=this.getCachedResult(n,s);if(e)return e}const a=this.getData(e,t).catch((e=>this.handleCacheError(n,e)));return this.storeCacheResult(n,a),a}fetchData(e,t=!1,n){return this.isValidDatasource()?this.context&&!EC(this.context)?Promise.resolve({data:[]}):this.isInitialised?(this.pageNumber=t?this.pageNumber:1,this.memoizedGetData(e??"",n)):Promise.reject(new Error):Promise.reject(new Error)}fetchPaginatedData(e){return this.pageNumber+=1,this.fetchData(e,!0)}fetchNonQueryableResults(e,t){if(void 0===e)return Promise.resolve({data:[]});if(this.fetchedNQData)return Promise.resolve({data:this.filterDataOnClient(e,this.nonQueryableData,t)});if(this.isNQDataFetchInProgress&&this.fetchNQDataPromise)return this.fetchNQDataPromise.then((()=>({data:this.filterDataOnClient(e,this.nonQueryableData,t)}))).catch((e=>Promise.reject(e)));if(this.dataSourceMetaData&&"structure"in this.dataSourceMetaData&&"list"===this.dataSourceMetaData.structure?.toLowerCase()){const n=this.buildSchemaForNonQueryableDP();return this.fetchNQDataPromise=Sh.getDataAsync(this.dataSource,this.context,n.dataViewParameters,void 0,void 0,t),this.isNQDataFetchInProgress=!0,new Promise(((n,s)=>{this.fetchNQDataPromise?.then((s=>(this.nonQueryableData=[...s.data],this.fetchedNQData=!0,n({data:this.filterDataOnClient(e,this.nonQueryableData,t)})))).catch((e=>s(e))).finally((()=>{this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null}))}))}return Promise.resolve(null)}filterDataOnClient(e,t,n){const s=(n?.columns??this.columns)?.filter((e=>e.useForSearch)).map((e=>e.value));return t.reduce(((t,a)=>{const r=s?.some((t=>{const s=Mh.resolveEmbeddedPath(t),r=AC.getIn(a,s);return null!=r&&this.positionMatches(`${r}`,e,n)}));return r&&t.push({...a}),t}),[])}static resolveEmbeddedPath(e){return e.startsWith("!P!")||e.startsWith("!PL!")?e.substring(e.lastIndexOf("!")+1).replace(/:/g,"."):e}positionMatches(e,t,n){const s=n?.ignoreCase??this.ignoreCase,a=s?e.toLowerCase():e,r=s?t.toLowerCase():t;switch(n?.matchPosition??this.matchPosition){case"start":return a.startsWith(r);case"contains":return a.includes(r);case"equals":return a===r;default:return!1}}buildSelect(e){const t=[],n=[];return(e?.columns??this.columns)?.forEach((e=>{if(!n.includes(e.value)){n.push(e.value);const s={field:e.value};t.push(s)}})),t}buildFilters(e,t){const n=t?.matchPosition??this.matchPosition,s=t?.ignoreCase??this.ignoreCase,a={};let r=0;(t?.columns??this.columns)?.forEach((t=>{if(t.useForSearch){const o=`F${r}`;r+=1;const i={field:t.value},c={value:e};let l="CONTAINS";"start"===n?l="STARTS_WITH":"equals"===n&&(l="EQ");const u={...`${parseFloat(e)}`!==e==!0&&{ignoreCase:s?"true":"false"},lhs:i,rhs:c,comparator:l};a[o]=u}}));const o=Object.keys(a).join(" OR ");return{filterConditions:a,logic:o}}buildQuery(e,t){const n=this.buildSelect(t);return e?{select:n,filter:this.buildFilters(e,t),...$g.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...$g.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}}buildPageOptions(){return this.enablePagination?{pageNumber:this.pageNumber,pageSize:this.pageSize}:{maxResultsToFetch:this.maxResultsDisplay}}buildSchemaForQueryableDP(e,t){return{dataViewParameters:this.parameters,query:this.buildQuery(e,t),paging:this.buildPageOptions()}}buildSchemaForNonQueryableDP(){return{dataViewParameters:this.parameters}}isValidDatasource(){return!!this.dataSource}}const Lh=Mh;class Uh{constructor(){this.refreshMap={},this.propChangeRefreshMap={}}static initializeRefreshCache(e,t,n,s,a){void 0===e[t]&&(e[t]={}),e[t][n]=[{uniqueHash:s,callback:a}]}registerForRefresh(e,t,n,s,a){n=AC.convertClipboardPageToPageRefNotation(n);const r=s.split("/").join(Gs.HASH_DELIMITER),o=AC.getHashedString(r);if("PROP_CHANGE"===e)if(this.propChangeRefreshMap?.[a]?.[n]){this.propChangeRefreshMap[a][n].some((e=>e.uniqueHash===o))||this.propChangeRefreshMap[a][n].push({uniqueHash:o,callback:t})}else Uh.initializeRefreshCache(this.propChangeRefreshMap,a,n,o,t);else if(this.refreshMap?.[a]?.[`${e}-${n}`]){this.refreshMap[a][`${e}-${n}`].some((e=>e.uniqueHash===o))||this.refreshMap[a][`${e}-${n}`].push({uniqueHash:o,callback:t})}else Uh.initializeRefreshCache(this.refreshMap,a,`${e}-${n}`,o,t)}triggerPropChangeRefresh(e,t){const n=this.propChangeRefreshMap?.[t];if(!n)return!1;const s=NC.getPropertyValue(Gs.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,e,t),{interestPage:a=""}=s||{},r=e=>AC.convertPageRefToClipboardPageNotation(e).replace(`${Gs.CASE_INFO?.CASE_INFO_CONTENT}${a}`,"");if(n[e]){const t=r(e);return n[e].forEach((e=>e.callback(t))),!0}const o=yu.getContextReferences(t)?.get(e),i=o&&NC.resolveContextTreeNodeProps(o.props)||{},{contextPageRef:c}=i;if(c&&n[c]){const e=r(c);return n[c].forEach((t=>t.callback(e))),!0}for(const t of Object.keys(n)){let s;if(AC.segmentsMatch(t,e)?s=e:c&&AC.segmentsMatch(t,c)&&(s=c),s){const e=r(s);return n[t].forEach((t=>t.callback(e))),!0}}return!1}triggerRefreshForType(e,t,n){return"PROP_CHANGE"===e?this.triggerPropChangeRefresh(t,n):!!this.refreshMap?.[n]?.[`${e}-${t}`]&&(this.refreshMap[n][`${e}-${t}`].forEach((e=>e.callback())),!0)}deRegisterForRefresh(e){delete this.propChangeRefreshMap[e],delete this.refreshMap[e]}}const Fh=new Uh;const Vh=class{static cleanCaches(e){XA.purgeCascadeFields(e),kg.removeContext(e),Lh.clearContextedCache(e),Uu.cleanContextSubscribers(e),Km(e),yu.removeContextTreeNode(e),Ah.clearContext(e),Fh.deRegisterForRefresh(e)}},jh="GET_DESCENDANTS",kh={REFRESH_DATA:"REFRESH_DATA",WHENS:"WHENS",DECLARE_EXPRESSIONS:"DECLARE_EXPRESSIONS",REFRESH:"refresh",REFRESH_CASE_DATA:"refreshCaseData",REFRESH_ASSIGNMENT_DATA:"refreshAssignmentData",REFRESH_CASE_VIEW:"refreshCaseView",RECALCULATE:"recalculate",RECALCULATE_CASE_DATA:"recalculateCaseData",RECALCULATE_ASSIGNMENT_DATA:"recalculateAssignmentData",REFRESH_EXTERNAL_OBJECT:"refreshExternalObjectData",REFRESH_EXTERNAL_CASE_DATA:"refreshExternalCaseData"};const Bh=new class{constructor(){this.runtimeParams={},this.runtimeParamsMap={}}setRuntimeParams(e){this.runtimeParams=e}getRuntimeParams(){return this.runtimeParams}setRuntimeParam(e,t){this.runtimeParamsMap[e]=t}getRuntimeParam(e){return this.runtimeParamsMap[e]}},$h=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},Gh=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)},Wh=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e)},Hh=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,e)},qh=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_LOAD,e)},zh=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_UNLOAD,e)};const Yh=new class{MISSING_CONTEXT_PARAM="context is required parameter";INVALID_CONTEXT_DETAILS="Invalid Context";INVALID_CONTEXT_OPERATION="Invalid Operation on Given Context";schedulePendingActionOnCompletion(e,t){const n=[],s=t.context_data?.blocking_action_counter??0,a=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let r=t.context_data?.is_deferred_action_in_progress??!1;if(s<=0){if(r)n.push({type:Da,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}});else{if(!(a.length>0))return;{const t=a.shift();r=!r,n.push({type:Da,payload:{context:e,data:{context_data:{deferred_action_queue:a,blocking_action_counter:s,is_deferred_action_in_progress:r}}}}),t&&n.push(t)}}sC(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=aC(e?.payload?.context);if(t){const n=[],s=t.context_data?.blocking_action_counter??0,a=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let r=t.context_data?.is_deferred_action_in_progress??!1;return a.length<=0&&!r&&(s<=0?(n.push(e),r=!r):a.push(e),n.unshift({type:Da,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:a,blocking_action_counter:s,is_deferred_action_in_progress:r}}}}),sC(n)),Promise.resolve()}return Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}handleDeferredActionCompletion(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=aC(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(sC({type:Da,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}}),this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}registerBlockingAction(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));return aC(e)?(sC({type:Ar,payload:{context:e,isInitiateBlockingAction:!0}}),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}deRegisterBlockingAction(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t={...aC(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(sC({type:Ar,payload:{context:e,isInitiateBlockingAction:!1}}),t.context_data.blocking_action_counter-=1,this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_OPERATION))}cancelDeferredActionsOnError(e){if(!e)return;const t=aC(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&AC.rejectPendingActions(n.context_data.deferred_action_queue)&&(n.context_data.deferred_action_queue=[]),n.context_data?.blocking_action_counter&&(n.context_data.blocking_action_counter=0),n.context_data?.is_deferred_action_in_progress&&(n.context_data.is_deferred_action_in_progress=!1),sC({type:Da,payload:{context:e,data:{...n}}}),qp.disableLoadingIndicator({context:e})}}isDeferredActionInProgress(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=aC(e);return!(!t||!0!==t.context_data?.is_deferred_action_in_progress)}},Kh=(e,t)=>{const n={},s=gg.getLookUpDataPage(e),a=gg.getDataPageKeys(s);if(a)for(const e of a)n[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];return{dataViewParameters:n,dataPageID:s,dataPageKeys:a}},Qh=(e,t)=>{const n=gg.getSavableDataPage(e),s=gg.getDataPageKeys(n);return s?.forEach((e=>{e.isAlternateKeyStorage&&(e.keyName===e.linkedField||Object.keys(t).includes(e.linkedField))?e.keyName=t[e.linkedField]:e.isAlternateKeyStorage&&Object.keys(t).includes(e.keyName)&&e.keyName!==e.linkedField?(t[e.linkedField]=t[e.keyName],delete t[e.keyName]):e.keyName=t[e.keyName]})),{keys:t,dataPageID:n,dataPageKeys:s}},Jh=e=>{Uu.publish($s.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Xh=(e,t,n)=>lI.shouldUseUnifiedHandling()||(e=>{if(e.includes(Gs.ACTIONAREA))return!0;const t=Ly(e),n=YE(`${t}/${Gs.ACTIONAREA}`);return Boolean(n?.includes(Gs.ACTIONAREA))})(e)?ya:yI(t,n??!1),Zh=(e,t,n)=>{const{callbacks:s}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?s?.cancel?.():s?.submit?.()}))},ef=(e,t,n)=>n||t!==Gs.ACTION?e.getValue($s.CASE_INFO.ACTIVE_ACTION_ID):e.getValue($s.CASE_INFO.ASSIGNMENTACTION_ID);const tf=class{MSG_CLASSNAME_REQUIRED="className is required parameter";MSG_CLASSNAME_STRING="className must be a string";MSG_ACTION_ID_REQUIRED="actionID is required parameter";MSG_ACTION_ID_STRING="actionID must be a string";MSG_ACTION_NAME_REQUIRED="actionName is required parameter";MSG_ACTION_NAME_STRING="actionName must be a string";MSG_KEY_PROPERTIES_REQUIRED="keyProperties is required parameter";MSG_DATAVIEWID_REQUIRED="dataViewID is required parameter";MSG_DATAVIEWID_STRING="dataViewID must be a string";MSG_CONTAINERITEMID_REQUIRED="containerItemID is required parameter";MSG_CONTAINERITEMID_STRING="containerItemID must be a string";MSG_PAGENAME_REQUIRED="pageName is required parameter";MSG_PAGENAME_STRING="pageName must be string";MSG_INSIGHTID_REQUIRED="insightID is required parameter";MSG_DASHBOARDID_REQUIRED="DashboardID is required parameter";MSG_ACTIVE_SUGGESTION_UNATTENDED="You must accept or decline autofilled fields.";MSG_CASE_ID_REQUIRED="caseID is required parameter";MSG_CONTEXT_STRING="context must be string";MSG_SUBSCRIPT_VIEW_REQUIRED="subscriptView is required";constructor(e){this.c11nEnv=e}shouldDeleteCaseInCreateStage=(e,t,n)=>!e&&t||n;getCaseID=e=>e.caseID||this.c11nEnv.getValue(Gs.getProperty($s.CASE_INFO.CASE_INFO_ID))||e?.links?.open?.href?.split("/")?.[2];getSaveActionPayload=(e,t=!1,n=!1)=>{const s=e,a=s&&s.includes(Gs.MODAL),r=this.c11nEnv.getValue($s.CASE_INFO.CASE_INFO_ID),o=this.c11nEnv.getValue($s.CASE_INFO.ASSIGNMENT_ID),i=this.c11nEnv.getValue($s.CASE_INFO.ACTIVE_ACTION_ID)?this.c11nEnv.getValue($s.CASE_INFO.ACTIVE_ACTION_ID):this.c11nEnv.getValue($s.CASE_INFO.ASSIGNMENTACTION_ID),c=this.c11nEnv.getContainerName(),l=this.c11nEnv.getValue($s.CASE_INFO.CASE_TYPE_ID),u=t?void 0:aI(this.c11nEnv.getContextName()),d=this.c11nEnv.getValue("isProcessAction","isProcessAction");return PC.buildActionObject({context:s,containerItemID:e,assignmentID:o,actionID:i,caseID:r,containerName:c,caseType:l,isModalAction:a,isFormValid:u,isProcessAction:d,saveOnly:t,autosave:n},this.c11nEnv)};actionsApiPromise=(e,t,n=!0)=>{let s,a,r="";r=t&&null!==t.actionMgrID?t.actionMgrID||"":zp.getNextActionMgrId();const o=new Promise(((e,t)=>{s=e,a=t}));if(!s||!a)throw new Error("resolveFn or rejectFn is not defined.");return zp.register(r,o,s,a,e,t,n),{actionMgrID:r,promise:o}};showDataObjectCreateView(e,t=$s.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=PC.buildActionObject({viewName:t,className:e},this.c11nEnv),s=ia,{promise:a}=this.actionsApiPromise(s,n);return sC({type:s,payload:{...n,containerName:$s.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),a}cancelDataObject(e){if(!e)return Promise.reject(new Error("containerItemId is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=e;if(!NE(t)){return new Ig(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=sr,s=PC.buildActionObject({containerItemID:e,context:t},this.c11nEnv),a=t&&t.includes(Gs.MODAL);sC({type:n,payload:{...s,isModalAction:a,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:r}=this.actionsApiPromise(n,s);return r.then((()=>{Jh({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=nC()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(Gs.DATA_CLASS_NOT_FOUND));if(xA($s.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW)){const t=this.handleSubscript.call(this,e,this.c11nEnv);if(t)return t}const s=gg.getSavableDataPage(n),a=Sr,r=!!e&&e.includes(Gs.MODAL),o=PC.buildActionObject({containerItemID:e,dataPageID:s},this.c11nEnv),{promise:i}=this.actionsApiPromise(a,o);return sC({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:r,isFormValid:aI(e)}}),i}deleteDataObject(e,t){if(!e)return Promise.reject(new Error("className is required parameter"));if(!t)return Promise.reject(new Error("keys is required parameter"));const n=_r,s=gg.getSavableDataPage(e),a=gg.getDataPageKeys(s),r={};if(a)for(const e of a)r[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=PC.buildActionObject({dataViewName:s,dataViewParameters:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return sC({type:"DELETE_DATA_OBJECT",payload:{...o}}),i}getDataObjectView(e,t,n={viewName:"",readOnly:!1,actionName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(!t)return Promise.reject(new TypeError(this.MSG_KEY_PROPERTIES_REQUIRED));if("object"!=typeof t)return Promise.reject(new TypeError("keyProperties must be a object"));const s=Nr,{dataPageID:a,dataViewParameters:r}=Kh(e,t),o=PC.buildActionObject({dataLookUp:a,keyProperties:t,requestPayload:r,viewName:n.viewName||$s.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:Gs.MODAL,readOnly:n.readOnly,actionName:n.actionName},this.c11nEnv),{promise:i}=this.actionsApiPromise(s,o);return sC({type:"VIEW_DATA_OBJECT",payload:{...o}}),i}updateDataObject(e,t){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if(!t)return Promise.reject(new Error("keys is required parameter"));const{data:n}=nC()?.getState()||{},s=n[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(Gs.DATA_CLASS_NOT_FOUND));const{dataPageID:a,keys:r}=Qh(s,t),o=Tr,i=e&&e.includes(Gs.MODAL),c=PC.buildActionObject({containerItemID:e,dataPageID:a,key:r},this.c11nEnv),l=n[e]?.caseInfo?.headers?.etag,{promise:u}=this.actionsApiPromise(o,c);return sC({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:aI(e),etag:l}}),u}openDataObjectAction(e,t,n,s){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(!t)return Promise.reject(new TypeError(this.MSG_KEY_PROPERTIES_REQUIRED));if("object"!=typeof t)return Promise.reject(new TypeError("keyProperties must be a object"));if(!n)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if(!s)return Promise.reject(new Error(this.MSG_ACTION_NAME_REQUIRED));const a=Dr,{dataViewParameters:r,dataPageID:o,dataPageKeys:i}=Kh(e,t),c=PC.buildActionObject({actionID:n,actionName:s,dataViewParameters:r,lookupDatapage:o,containerName:Gs.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(a,c);return sC({type:a,payload:{...c}}),l}submitDataObjectAction(e,t,n,s){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));if(!t)return Promise.reject(new Error(this.MSG_KEY_PROPERTIES_REQUIRED));if(!n)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));const{data:a}=nC()?.getState()||{},r=a[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(Gs.DATA_CLASS_NOT_FOUND));const o=s?.jsActionQueryParams,i=Ly(e),c=py(i),l=FE(c,i)||{},{resourceType:u="",key:d=""}=l,p=Pr,{dataPageID:g,keys:h}=Qh(r,t),f=PC.buildActionObject({containerItemID:e,actionID:n,resourceType:u,key:d,keys:h,savableDatapage:g,containerName:Gs.MODAL,context:e,jsActionQueryParams:o},this.c11nEnv);f.context=e;const m=a[e]?.caseInfo?.headers?.etag,{promise:I}=this.actionsApiPromise(p,f);return sC({type:p,payload:{...f,isFormValid:aI(e),etag:m}}),I}createWork(e,t={flowType:"",containerName:"",openCaseViewAfterCreate:!1,modalOptions:{dockable:!1},startingFields:Object,remoteCaseMeta:{},channelName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(e=qs.getRemoteCaseClassBySourceClass(e)??e,window.pms?.plugins?.c11n?.createWork)return window.pms.plugins.c11n.createWork(e,ks.getDefaultQualifiedName("pyStartCase"),t);const{dockable:n=!1}=t?.modalOptions||{};let s=t.theType?t.theType:(e=>{const t=lI.shouldUseUnifiedHandling();return lI.isExternalCaseType(e)?Fr:lI.isExternalObject(e)?t?Fr:"CREATE_EXTERNAL_OBJECT":t?ma:lI.isObjectCaseType(e)?"CREATE_OBJECT":ma})(e);const a=PC.buildActionObject({class:e,flowType:ks.getDefaultQualifiedName("pyStartCase"),containerName:Gs.PRIMARY,openCaseViewAfterCreate:!0,...t,theType:s,modalOptions:{isDockable:n}},this.c11nEnv),{promise:r}=this.actionsApiPromise(s,a);if(a.headers={...a.headers},t.channelName?a.headers[Gs.X_ORIGIN_CHANNEL]=t.channelName:Gy.isWSSPortal()&&(a.headers[Gs.X_ORIGIN_CHANNEL]="WSS"),s=this.handleRemoteCaseForCreateWork(e,a,s),Vu.getPreviewMode()){a.debugInfo={debugId:AC.generateUniqueID()};const e=Zu.getCoreHeadersFromContext(a?.context||""),t=String(e?.debugInfo?.[Gs.COREHEADER_APP_DEBUG_ID]||"");t&&s!==ma&&(a.debugInfo={debugId:t})}return sC({type:s,payload:{...a}}),r}handleRemoteCaseForCreateWork(e,t,n){if(qs.isRemoteCase(e)){const{RemoteClassName:n,RemoteSystemID:s,name:a}=qs.getRemoteCase(e);if(t.className=e,t.class=n,zp.setRemoteCaseHeaderByContext(t,s),qs.isTraditionalRemoteCase(e)||qs.isRemoteCaseVersionDifferent(e)){const s={className:e,name:a,action:wr,remoteClassName:n};return zp.setTraditionalRemoteCaseParams(t,s)}}return n}createCase(e,t={}){return this.createWork(e,{...t,theType:"CREATE_WORK"})}getDataObjectActions(e,t){if(!e)return Promise.reject(new Error(this.MSG_DATAVIEWID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_DATAVIEWID_STRING));const n=Oa,s=PC.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:a}=this.actionsApiPromise(n,s);return sC({type:n,payload:{...s}}),a}getDescendants(e,t){if(!e)return Promise.reject(new Error(this.MSG_CASE_ID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTEXT_STRING));const n=t||this.c11nEnv.getContextName(),s=PC.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:a}=this.actionsApiPromise("GET_DESCENDANTS",s),r=(o={...s,context:n},{type:jh,payload:o});var o;return sC(r),a}openWorkByHandle(e,t,n={}){if(!e)return Promise.reject(new Error("workID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("workID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(t=qs.getRemoteCaseClassBySourceClass(t)??t,window.pms?.plugins?.c11n?.openWorkByHandle)return window.pms.plugins.c11n.openWorkByHandle(e,t);const s={insKey:e,acTargetName:n.targetContainer||Gs.PRIMARY,containerName:n.targetContainer||Gs.PRIMARY};let a=lI.shouldUseUnifiedHandling()||!lI.isObjectCaseType(t)?Ia:"GET_OBJECT";const r=PC.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(a,r);return r.headers={...r.headers},n.channelName?r.headers[Gs.X_ORIGIN_CHANNEL]=n.channelName:Gy.isWSSPortal()&&(r.headers[Gs.X_ORIGIN_CHANNEL]="WSS"),r.className=t,qs.isRemoteCase(t)&&(a=this.setRemoteCaseParamsForOpenCase(r,t,a,n.remoteCaseMeta)),Vu.getPreviewMode()&&n.targetContainer!==Gs.WORKAREA&&(r.debugInfo={debugId:AC.generateUniqueID()}),sC({type:a,payload:{...n,...r}}),o}setRemoteCaseParamsForOpenCase(e,t,n,s={}){const{RemoteSystemID:a,RemoteClassName:r,name:o}=qs.getRemoteCase(t);if(zp.setRemoteCaseHeaderByContext(e,a),e.isRemoteCase=!0,e.remoteCaseClass=t,e.remoteCaseMeta=s,qs.isTraditionalRemoteCase(t)||qs.getRemoteAppPlatformVersion(a??"")){const n={className:t,name:o,action:Lr,remoteClassName:r};return zp.setTraditionalRemoteCaseParams(e,n)}return n}openAssignment(e,t,n={isActionFromToDoList:!1,isChild:!1,context:"",viewType:"",skipBrowserSemanticUrlUpdate:!1,containerName:"",channelName:"",remoteCaseMeta:{}}){if(!e)return Promise.reject(new Error("assignmentID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("assignmentID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(t=qs.getRemoteCaseClassBySourceClass(t)??t,window.pms?.plugins?.c11n?.openAssignment)return window.pms.plugins.c11n.openAssignment(e,t);const s={assignmentID:e,doDeleteCaseSummary:!0,containerName:n.containerName,isActionFromToDoList:n.isActionFromToDoList,isChild:!1,...void 0!==n.renderInline&&{renderInline:n.renderInline},...void 0!==n.pageName&&{pageName:n.pageName}};n.isChild&&(s.containerName=Gs.PRIMARY,s.isChild=n.isChild);let a=ig;const r=PC.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(a,r);if(r.headers=r.headers||{},n.channelName?r.headers[Gs.X_ORIGIN_CHANNEL]=n.channelName:Gy.isWSSPortal()&&(r.headers[Gs.X_ORIGIN_CHANNEL]="WSS"),qs.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:s,name:o}=qs.getRemoteCase(t);if(zp.setRemoteCaseHeaderByContext(r,s),r.remoteCaseMeta=n.remoteCaseMeta,qs.isTraditionalRemoteCase(t)||qs.getRemoteAppPlatformVersion(s??"")){const n={className:t,name:o,action:Mr,remoteClassName:e};a=zp.setTraditionalRemoteCaseParams(r,n)}}r.className=t,r.activeItemCaseViewMode=this.c11nEnv.getValue("context_data.caseViewMode"),Vu.getPreviewMode()&&![Gs.WORKAREA].includes(n.containerName)&&(r.debugInfo={debugId:AC.generateUniqueID()});const i={context:r.context||n.context,containerName:r.containerName||n.containerName,targetContainerName:r.containerName||n.containerName,viewType:r.viewType||n.viewType,skipBrowserSemanticUrlUpdate:n.skipBrowserSemanticUrlUpdate};return sC({type:a,payload:{...r,...i}}),o}finishAssignment(e,t={outcomeID:"",jsActionQueryParams:{}}){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));e.endsWith(Gs.ACTIONAREA)&&(e=YE(e)||e);const n=JE(e);let s=n;if(n?.includes(`/${Gs.WORKAREA}`)&&(s=n.substring(0,s?.lastIndexOf(`/${Gs.WORKAREA}`))),rI(n)){const e=[{type:"error",message:this.c11nEnv.getLocalizationService().getLocalizedMessage(this.MSG_ACTIVE_SUGGESTION_UNATTENDED)}];return Pu({messages:e,context:s,category:$s.PAGE}),Promise.reject({type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR})}const a=t?.isTriggeredFromDifferentContext,{caseID:r,assignments:o,localActionID:i,caseActions:c,caseInfo:l,businessID:u,caseTypeID:d,caseTypeName:p}=AI(e,this.c11nEnv,{isTriggeredFromDifferentContext:a}),g=dI(l);let h,f=!1;const m=c?.find((e=>e.ID===i));m?f="Case"===m?.type:h=aC(n);let{assignmentID:I}=AI(e,this.c11nEnv,{isTriggeredFromDifferentContext:a});h?.context_data?.actionType&&(f=h.context_data.actionType===Gs.CASE,I=I||h.context_data.assignmentID);const E=EI(o,I,i,l?.activeActionID),[y,A]=r.split(" "),C={class:y,actionID:E,assignmentID:I,caseID:r,workID:A,containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:f,doDeleteCaseSummary:!0,isInCreateStage:g,businessID:u,caseTypeID:d,caseTypeName:p};e?.includes(Gs.MODAL)&&(C.containerName=Gs.MODAL,C.isModalAction=!0),C.outcome=t.outcomeID,C.jsActionQueryParams=t.jsActionQueryParams,l?.isLocalAction&&(C.viewType=Im.FORM);const S=Xh(e,d,l?.isObjectWideAction),_=PC.buildActionObject(C,this.c11nEnv),{promise:N}=this.actionsApiPromise(S,_);return _.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||aC(n).context_data.isProcessAction,_.headers??={},Gy.isWSSPortal()&&(_.headers[Gs.X_ORIGIN_CHANNEL]="WSS"),Yh.executeOrQueueDeferredAction({type:S,payload:{..._,context:n}}),N}getNextWork(){if("HYBRID"===Gy.getRenderingMode())return Uu.publish($s.PUB_SUB_EVENTS.CASE_EVENTS.GET_NEXT_WORK,{userIdentifier:Gy.getOperatorIdentifier()}),Promise.resolve();const e=ig,t=PC.buildActionObject({containerName:Gs.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return sC({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=ig,n=this.c11nEnv.getValue($s.CASE_INFO.CASE_INFO_ID),s=this.c11nEnv.getCaseSummary().headers,a=PC.buildActionObject({containerName:this.c11nEnv.getContainerName(),isOpenStage:!0,stageID:e},this.c11nEnv),{promise:r}=this.actionsApiPromise(t,a),o={type:t,payload:{...a,caseID:n,headers:s}};return sC(o),r}submitBulkAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION",n=this.c11nEnv.getValue($s.CASE_INFO.CASES),s=this.c11nEnv.getValue($s.CASE_INFO.ACTIVE_ACTION_ID),a=this.c11nEnv.getValue($s.CASE_INFO.IS_ASSIGNMENT),r={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(Gs.MODAL)&&(r.containerName=Gs.MODAL,r.isModalAction=!0);const o=PC.buildActionObject(r,this.c11nEnv),{promise:i}=this.actionsApiPromise(t,o),c=JE(e);return sC({type:t,payload:{...o,context:c,cases:n,actionID:s,isAssignment:a,isFormValid:aI(c),classID:this.c11nEnv.getCurrentClassID()}}),i}submitBulkActionAsync(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION_ASYNC",n=this.c11nEnv.getValue($s.CASE_INFO.CASES),s=this.c11nEnv.getValue($s.CASE_INFO.ACTIVE_ACTION_ID),a={containerName:e.includes(Gs.MODAL)?Gs.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(Gs.MODAL)},r=PC.buildActionObject(a,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,r),i=JE(e);return sC({type:t,payload:{...r,context:i,cases:n,actionID:s,isFormValid:aI(i),classID:this.c11nEnv.getCurrentClassID()}}),o}openBulkAction(e,t){if(!e)return Promise.reject(new Error("actionID is required parameter for openBulkAction"));if("string"!=typeof e)return Promise.reject(new TypeError("actionID must be a string openBulkAction"));if(window.pms?.plugins?.c11n?.openBulkAction){const{callbacks:n}=t;return t.callbacks=null,window.pms.plugins.c11n.openBulkAction(e,t).then((e=>{"cancel"===e?n?.cancel?.():n?.submit?.()}))}const{selectedList:n,runningMode:s}=t,a=t.type,r={selectedList:n,vcName:t.target,actionName:t?.name,actionID:e,doDeleteCaseSummary:!0,localActionType:a,runningMode:s,...t},o="OPEN_BULK_ACTION",i=PC.buildActionObject(r,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return sC({type:o,payload:{...i}}),c}cancelBulkAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));return new Ig(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(sC({type:sa,payload:{reference:$s.CASE_INFO.APPROVALFLAG,value:Gs.APPROVED,context:e}}),this.finishAssignment(e)):Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED))}rejectCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(sC({type:sa,payload:{reference:$s.CASE_INFO.APPROVALFLAG,value:Gs.REJECTED,context:e}}),this.finishAssignment(e)):Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED))}resolveDuplicateCase(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const[,t]=this.c11nEnv.getValue($s.CASE_INFO.DUPLICATECASEINSKEY).split(" "),n={type:sa,payload:{reference:$s.CASE_INFO.DUPLICATECASEFLAG,value:Gs.DUPLICATE,context:e}},s={type:sa,payload:{reference:$s.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return sC([n,s]),this.finishAssignment(e)}ignoreDuplicateCase(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t={type:sa,payload:{reference:$s.CASE_INFO.DUPLICATECASEFLAG,value:Gs.IGNORE,context:e}},n={type:sa,payload:{reference:$s.CASE_INFO.DUPLICATECASEID,value:"",context:e}},s={type:sa,payload:{reference:$s.CASE_INFO.DUPLICATECASEINSKEY,value:"",context:e}};return sC([t,n,s]),this.finishAssignment(e)}openLocalAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=this.getCaseID(t);if(window.pms?.plugins?.c11n?.openLocalAction)return t.caseID=n,Zh(window.pms.plugins.c11n.openLocalAction,e,t);const s=t.assignKey||this.c11nEnv.getValue($s.CASE_INFO.ASSIGNMENT_ID),a=t.type,r={caseID:n,assignmentID:s,vcName:t.target,actionName:t?.name,assignKey:s,actionID:e,doDeleteCaseSummary:!0,localActionType:a,...t},o=t.containerName===Gs.ACTIONAREA?Na:(e=>lI.shouldUseUnifiedHandling()||"Object"!==e.type&&!lI.isObjectCaseType(e?.caseClassName||"")&&!window.location.href.includes("/objects/")?Na:"OPEN_OBJECT_ACTION")(t),i=PC.buildActionObject(r,this.c11nEnv);t.containerName!==Gs.ACTIONAREA&&t.containerName!==Gs.WORKAREA||(i.skipMergeAssignmentsAndActions=!1);const{promise:c}=this.actionsApiPromise(o,i),l=this.c11nEnv.getContextName(),u=ey(l)[0];let d;if(d=YE(u),d?.includes("actionarea")&&o===Na)return sC({type:o,payload:{...i}}),c;if("Object"===t.type)return sC({type:o,payload:{...i}}),c;const p=YE(u),g=n!==this.c11nEnv.getValue(Gs.getProperty($s.CASE_INFO.CASE_INFO_ID))&&p&&qs.getRemoteHeaderByContext(p)||qs.getRemoteHeaderByContext(l);if(zp.setRemoteCaseHeaderByContext(i,g),!u)return d=l,sC({type:o,payload:{...i,contextName:l,continueExecution:!1}}),c;const{continueExecution:h,containerItemID:f}=UE(l,n,u);if(d=f,!h||d&&"review"===nC()?.getState()?.data[d]?.context_data?.caseViewMode)return sC({type:o,payload:{...i,contextName:l,continueExecution:h}}),c;const m=d,I=m&&m.includes(Gs.MODAL),E=t.assignKey||this.c11nEnv.getValue($s.CASE_INFO.ASSIGNMENT_ID),y=aC(d),A=y?.caseInfo?.assignments?y.caseInfo.assignments[0]?.actions[0]?.ID:void 0,C=this.c11nEnv.getContainerName(),S=this.c11nEnv.getValue($s.CASE_INFO.CASE_TYPE_ID),_=this.c11nEnv.getValue("isProcessAction","isProcessAction"),N=PC.buildActionObject({context:m,containerItemID:d,assignmentID:E,actionID:A,caseID:n,containerName:C,caseType:S,isModalAction:I,isFormValid:!0,isProcessAction:_},this.c11nEnv);N.context=d;const T=JE(d),D=this.c11nEnv.getCaseSummary(),P=dI(D),O=PC.buildActionObject({caseID:n,containerItemID:d,cancelContext:T},this.c11nEnv);let R={};return I?(O.acTargetName=Gs.MODAL,O.isInCreateStage=P,O.isModalAction=I,R={...O}):R={...O,acName:Wr(this.c11nEnv.getContainerName(),O.context)},sC({type:o,payload:{...i,contextName:l,saveActionPayload:N,cancelActionPayload:R,continueExecution:h}}),c}openProcessAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=this.c11nEnv.getValue($s.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,Zh(window.pms.plugins.c11n.openProcessAction,e,t);const s=this.c11nEnv.getValue($s.CASE_INFO.ASSIGNMENT_ID)||t.assignKey,a=t.type,r={caseID:n,assignmentID:s,vcName:t.target,actionName:t?.name,assignKey:s,actionID:e,doDeleteCaseSummary:!0,processActionType:a,isProcessAction:!0,...t},o=og,i=PC.buildActionObject(r,this.c11nEnv),c=this.c11nEnv.getContextName(),l=ey(c)[0];let u=qs.getRemoteHeaderByContext(c);if(!u&&l){const e=LE(l);e?.accessedOrder.forEach((s=>{(t.caseID||n)===e.items[s].key&&(u=qs.getRemoteHeaderByContext(e.items[s].context))}))}zp.setRemoteCaseHeaderByContext(i,u);const{promise:d}=this.actionsApiPromise(o,i),{containerItemID:p}=UE(c,n,l);return sC({type:o,payload:{...i,saveContainerItemID:p}}),d}navigateToStep(e,t){if(!e)return Promise.reject(new Error("stepID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("stepID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n=_a,s=this.c11nEnv.getValue($s.NEXT_ASSIGNMENT_INFO_ID)?this.c11nEnv.getValue($s.NEXT_ASSIGNMENT_INFO_ID):this.c11nEnv.getValue($s.CASE_INFO.ASSIGNMENT_ID),a=dI(this.c11nEnv.getCaseSummary()),r=this.c11nEnv.getValue($s.CASE_INFO.CASE_INFO_ID),o={ID:s,stepID:e,acTargetName:this.c11nEnv.getContainerName(),targetContainerName:this.c11nEnv.getContainerName(),containerItemID:t,doDeleteCaseSummary:!0,isInCreateStage:a,caseID:r};t&&t.includes(Gs.MODAL)&&(o.acTargetName=Gs.MODAL);const i=PC.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=JE(t);return sC({type:n,payload:{...i,containerItemID:t,context:l}}),c}cancelAssignment(e,t){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:n}=$s,s=Ca,a=JE(e),r=e&&e.includes(Gs.MODAL),o=this.c11nEnv.getCaseSummary(),i=dI(o),c=this.c11nEnv.getValue(Gs.getProperty(n.CASE_INFO_ID)),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),u=PC.buildActionObject({caseID:c,containerItemID:e,context:a},this.c11nEnv);let d={};r?(u.acTargetName=Gs.MODAL,u.isInCreateStage=i,u.isModalAction=r,d={...u}):d={...u,acName:Wr(this.c11nEnv.getContainerName(),u.context)};const{promise:p}=this.actionsApiPromise(s,u);return sC({type:s,payload:d}),p.then((()=>{t||Jh({caseID:c,assignmentID:l,context:this.c11nEnv.getContextName()})}))}cancelLocalAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:t}=$s,n=e,s=sr,a=e&&e.includes(Gs.MODAL),r=this.c11nEnv.getValue(t.CASE_INFO_ID),o=PC.buildActionObject({caseID:r,containerItemID:e,context:n},this.c11nEnv);if(!NE(n)){return new Ig(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{Hh(r),Jh({caseID:r,context:this.c11nEnv.getContextName()})}))}sC({type:s,payload:{...o,isModalAction:a}});const{promise:i}=this.actionsApiPromise(s,o);return i}cancelCreateStageAssignment(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:t}=$s,n=sr,s=e,a=s&&s.includes(Gs.MODAL),r=this.c11nEnv.getCaseSummary(),o=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_TYPE_ID)),i=dI(r),c=this.c11nEnv.getValue(Gs.getProperty(t.CASE_INFO_ID)),l=PC.buildActionObject({caseID:c,containerItemID:e,context:s},this.c11nEnv),u=this.c11nEnv.getValue("isProcessAction","isProcessAction"),d=Gy.isCoexistenceAppOfType(Gs.APP_TYPE.UIKIT);l.isProcessAction=u;const p=Gy.getRenderingMode();if(i&&(a||d||"EMBED"===p)&&!uI(r)){const t=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.IS_FIRST_ASSIGNMENT)),c=NE(s);if(this.shouldDeleteCaseInCreateStage(c,t,d)){const t=!0===Boolean(lI.isExternalObject(o));return this.deleteCaseInCreateStage(e,t)}sC({type:n,payload:{...l,isModalAction:a,isChildCase:mI(r),isInCreateStage:i}})}const{promise:g}=this.actionsApiPromise(n,l);return g.then((()=>{}))}saveAssignment(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=lg,n=this.getSaveActionPayload(e,!0),{promise:s}=this.actionsApiPromise(t,n);return Yh.executeOrQueueDeferredAction(ug(n)),s}saveAndClose(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=lg,n=this.getSaveActionPayload(e),{promise:s}=this.actionsApiPromise(t,n);return sC(ug(n)),s}deleteCaseInCreateStage(e,t=!1){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n=cg,s=e,a=s&&s.includes(Gs.MODAL),r=this.c11nEnv.getValue(Gs.getProperty($s.CASE_INFO.CASE_INFO_ID)),o=this.c11nEnv.getValue(Gs.getProperty($s.CASE_INFO.CASE_TYPE_ID)),i=PC.buildActionObject({caseID:r,caseType:o,containerItemID:e,context:s,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(Gs.getProperty($s.CASE_INFO.PARENTCASEINFO));i.isProcessAction=c,i.parentCaseInfo=l;const u=`${Gs.APP.APP}/${xE.PRIMARY}`,d=Om(u,xE.PRIMARY);i.parentContext=d,a&&(i.targetName=Gs.MODAL,i.containerName=xE.MODAL,i.isModalAction=a),sC((e=>({type:cg,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Jh({caseID:r,context:this.c11nEnv.getContextName()})}))}getRecents(e){if(!e)return Promise.reject(new Error("maxResultsToFetch is required parameter"));if("number"!=typeof e)return Promise.reject(new TypeError("maxResultsToFetch must be number"));let{restApi:t}=By.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=un()+t;return ud(n,{method:"GET",headers:{}})}updateRecents(e,t,n,s){const{restApi:a}=By.getRestEndPoint("updateRecents")||{},r=`${un()}${a}`;return ud(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:s}})}logout(){const{restApi:e}=By.getRestEndPoint("Logout")||{},t=`${un()}${e}`;return ud(t,{method:"GET",headers:{}}).then((e=>(Object.keys(yu.rootNodes).forEach((e=>{Vh.cleanCaches(e)})),yu.rootNodes={},sessionStorage.clear(),IC(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return ud(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,ks.getDefaultQualifiedName("pyCasePreview"),{container:xE.PREVIEW,containerName:xE.PREVIEW,context:$s.APP.APP,...t})}showDataPreview(e,t,n){return e?"string"!=typeof e?Promise.reject(new TypeError("dataContext must be string")):t?"object"!=typeof t?Promise.reject(new TypeError("dataContextParameters must be an object")):this.showData(ks.getDefaultQualifiedName("pyDataPreview"),e,t,{container:xE.PREVIEW,containerName:xE.PREVIEW,context:$s.APP.APP,...n||{},skipSemanticUrl:!0}):Promise.reject(new Error("dataContextParameters is required parameter")):Promise.reject(new Error("dataContext is required parameter"))}loadView(e,t,n){let s=PC.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(Gs.getProperty($s.CASE_INFO.CASE_TYPE_ID)),RemoteSystemID:qs.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv);n||(n={containerName:this.c11nEnv.getContainerName(),updateData:!1}),n&&"object"==typeof n?(Object.hasOwn(n,"container")&&!Object.hasOwn(n,"containerName")&&(n.containerName=n.container),s={...s,...n}):s={...s,containerName:this.c11nEnv.getContainerName()};const a=oa,{promise:r}=this.actionsApiPromise(a,s,!1);return sC({type:a,payload:{...s}}),r}showPage(e,t,n={containerName:"",skipSemanticUrl:""}){if(!e)return Promise.reject(new Error(this.MSG_PAGENAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_PAGENAME_STRING));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.showPage)return window.pms.plugins.c11n.showPage(e,t,n);const s=PC.buildActionObject({viewName:e,className:t},this.c11nEnv),a=ia,{promise:r}=this.actionsApiPromise(a,s);return Vu.getPreviewMode()&&(s.debugInfo={debugId:AC.generateUniqueID()}),sC({type:a,payload:{...s,...n,containerName:n.containerName||this.c11nEnv.getContainerName(),skipSemanticUrl:n.skipSemanticUrl}}),r}showInsight(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_INSIGHTID_REQUIRED));const n=PC.buildActionObject({},this.c11nEnv),s=la,{promise:a}=this.actionsApiPromise(s,n);return sC({type:s,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,insightID:e}}),a}showDashboard(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_DASHBOARDID_REQUIRED));const n=PC.buildActionObject({},this.c11nEnv),s=ua,{promise:a}=this.actionsApiPromise(s,n);return sC({type:s,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,dashboardID:e}}),a}showData(e,t,n,s={containerName:"",skipSemanticUrl:!1}){if(!e)return Promise.reject(new Error(this.MSG_PAGENAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_PAGENAME_STRING));if(!t)return Promise.reject(new Error("dataContext is required parameter"));if("string"!=typeof t)return Promise.reject(new TypeError("dataContext must be string"));const a=PC.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:qs.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),r=ca;s?.containerName||(s.containerName="HYBRID"===Gy.getRenderingMode()?Bh.getRuntimeParam(Gs.HYRBID_ROOT_CONTAINERNAME):Kp.getTargetViewContainerName(r));const{promise:o}=this.actionsApiPromise(r,a);return sC({type:r,payload:{...a,...s,skipSemanticUrl:Boolean(s.skipSemanticUrl)}}),o}changeHandler(e,t){PC.changeHandler(e,t)}eventHandler(e,t){PC.eventHandler(e,t)}triggerFieldChange(e,t,n=!1,s={skipDirtyValidation:!1,skipPageInstructionGeneration:!1}){const a=this.c11nEnv.getContextName(),r=this.c11nEnv.getPageReference(),o=NC.getContextPath(r,e);n||this.c11nEnv.getValidationApi().validate(t),this.c11nEnv.isInsideList()&&!s.skipPageInstructionGeneration&&this.c11nEnv.getListActions().updateProperty(e,t,s);let i=this.c11nEnv.getValue(Gs.CLASS_ID);const c=e?e.split(".").filter((e=>!!e)):[];c.length>1&&(c.pop(),i=iC(`.${c.join(".")}.classID`,r,a)),e=AC.trimDotForProperty(e),sC({type:ra,payload:{reference:o,value:t,context:a,pageReference:this.c11nEnv.getPageReference(),propertyName:e||this.c11nEnv.getComponentConfig().value,classID:i}})}updateFieldValue(e,t,n={}){const{removePropertyFromChangedList:s=!1,isArrayDeepMerge:a=!0,contextPageReference:r="",isListEntry:o=!1,skipDirtyValidation:i=!1,associatedProperty:c,skipPageInstructionGeneration:l=!1}=n,u=this.c11nEnv.getContextName();let d=this.c11nEnv.getPageReference();const p=r?.startsWith(d)?r.replace(d,""):r;d=r||d;const g=NC.getContextPath(d,e);let h=!1;this.c11nEnv.isInsideList()&&!l&&this.c11nEnv.getListActions().updateProperty(p?`${p}${e}`:e,t,{isArrayDeepMerge:a,skipDirtyValidation:i}),this.c11nEnv.isBulkAction()&&(h=!0),e||(e=this.c11nEnv.getStateProps().value),Du({type:$s.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:d,context:u,isListEntry:o}),sC({type:sa,payload:{reference:g,value:t,context:u,isArrayDeepMerge:a,skipDirtyValidation:i,...h&&{isStrictTracking:h},...s&&{removePropertyFromChangedList:s},...c&&{associatedProperty:`${d}${c}`}}})}activateModalContainerItem(e){const t=qa,{context:n}=e,s=n&&n.includes(Gs.MODAL),a=PC.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);s&&(a.containerName=Gs.MODAL,a.isModalAction=s),sC({type:t,payload:a});const{promise:r}=this.actionsApiPromise(t,a);return r}refreshCaseView(e,t,n,s={}){const{promise:a,actionMgrID:r}=this.actionsApiPromise("REFRESH_DATA"),{autoDetectRefresh:o,propertyName:i,preserveClientChanges:c,classID:l,context:u,optionalPayload:d,isArrayDeepMerge:p}=s,g={actionMgrID:r,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,isArrayDeepMerge:p,optionalPayload:d};s.refreshFor&&(g.refreshFor=s?.refreshFor),s.resetForm&&(g.resetForm=s?.resetForm),s.skipPayloadGeneration&&(g.skipPayloadGeneration=s?.skipPayloadGeneration);const h=u||this.c11nEnv.getContextName(),f=this.c11nEnv.getPageReference(),m=this.c11nEnv.getValue(Gs.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW),{isMultiRecordData:I,editType:E}=m||{};if(o&&I&&E===Gs.ACTION){const t=this.c11nEnv.getValue($s.CASE_INFO.ASSIGNMENT_ID),{actionID:n,interestPage:s,interestPageActionID:a,isLocalAction:r}=m;PI(e,t,n,h,s,a,r,I,E,g)}else!I&&o&&(fI(h,f)||gI(h,f))?MI(h,n,g):DI(e,t,h,n,g);return a}refreshEmbeddedDataWithAction(e,t,n,s,a,r,o,i,c={}){const{promise:l}=this.actionsApiPromise(kh.REFRESH_DATA),u=this.c11nEnv.getContextName();return PI(e,t,n,u,s||this.c11nEnv.getPageReference(),a,r,o,i,c),l}openEmbeddedDataModal(e,t,n,s,a,r,o,i,c=!1,l=$s.MODAL){const u=Or;let d=t.getCaseInfo().getKey();const p=t.getValue($s.CASE_INFO.IS_LOCAL_ACTION),g=t.getValue($s.CASE_INFO.ASSIGNMENT_ID),h=ef(t,o,p),f=t.getPageReference();let m="string"==typeof s?`${t.getPageReference().replace(Gs.getProperty($s.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${s}`:`${t.getPageReference().replace(Gs.getProperty($s.CASE_INFO.CASE_INFO_CONTENT),"")}${n}[${s}]`;f.startsWith($s.OBJECT_INFO.OBJECT_INFO)&&!d&&(d=t.getCaseInfo().getObjectKey(),m=`${t.getPageReference().replace($s.OBJECT_INFO.OBJECT_INFO_CONTENT,"")}${n}[${s}]`);const I=t.getMetadata(),E=Array.isArray(I?.config?.children)&&I.config.children[0]?.children||[],y={readOnly:c,targetProperty:n,index:s,viewID:e,ID:d,actionType:a,interestPage:AC.convertPageRefToClipboardPageNotation(m),heading:r,editType:o,interestPageActionID:o===Gs.ACTION?i:void 0,actionID:h,isLocalAction:p,operationFlag:Gs.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof s,assignmentID:p||o!==Gs.ACTION?void 0:g,columns:E},A=PC.buildActionObject(y,this.c11nEnv);if(o===Gs.ACTION){const e=AC.getETag(A.context);A.headers={"If-Match":e}}const{promise:C}=this.actionsApiPromise(u,A);return Gy.getFeatureMap().granularUIRefresh&&E.forEach((e=>{const n=Ro.trimAnnotation(e.config.value),s=SA(n.startsWith(".")?n.replace(".",""):n,e.config.classID);s&&!Array.isArray(s)&&s.isDeclarativeTarget&&yu.addFieldNode(t.getContextName(),f+m,t.viewName??"",n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:f+m})})),sC({type:u,payload:{...A,containerName:l,skipSemanticUrl:!0}}),C}getEmbeddedDataView(e,t,n,s,a,r="",o="",i=!1,c=""){const l=Rr;let u=t.getCaseInfo().getKey();const d=t.getValue($s.CASE_INFO.IS_LOCAL_ACTION),p=t.getValue($s.CASE_INFO.ASSIGNMENT_ID),g=ef(t,r,d),h=t.getPageReference();let f="string"==typeof s?`${t.getPageReference().replace(Gs.getProperty($s.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${s}`:`${t.getPageReference().replace(Gs.getProperty($s.CASE_INFO.CASE_INFO_CONTENT),"")}${n}[${s}]`;h.startsWith($s.OBJECT_INFO.OBJECT_INFO)&&!u&&(u=t.getCaseInfo().getObjectKey(),f=`${t.getPageReference().replace($s.OBJECT_INFO.OBJECT_INFO_CONTENT,"")}${n}[${s}]`);const m={readOnly:i,targetProperty:n,index:s,viewID:e,ID:u,actionType:a,interestPage:AC.convertPageRefToClipboardPageNotation(f),editType:r,interestPageActionID:r===Gs.ACTION?o:void 0,actionID:g,isLocalAction:d,operationFlag:Gs.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof s,assignmentID:d||r!==Gs.ACTION?void 0:p,containerName:c},I=PC.buildActionObject(m,this.c11nEnv);if(r===Gs.ACTION){const e=AC.getETag(I.context);I.headers={"If-Match":e}}const{promise:E}=this.actionsApiPromise(l,I);return sC({type:l,payload:{...I,skipSemanticUrl:!0}}),E}submitEmbeddedDataModal(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=br;let n=this.c11nEnv.getValue(Gs.getProperty($s.CASE_INFO.CASE_INFO_ID));const s=this.c11nEnv.getValue(Gs.getProperty($s.CASE_INFO.ASSIGNMENT_ID));let a=this.c11nEnv.getPageReference().replace(Gs.getProperty($s.CASE_INFO.CASE_INFO_CONTENT),"");const r=JE(e),o=this.c11nEnv.getValue(Gs.getProperty(Gs.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW)),{interestPageActionID:i,editType:c,isLocalAction:l,actionID:u,viewName:d,parentContext:p}=o;a.startsWith($s.OBJECT_INFO.OBJECT_INFO)&&!n&&(n=this.c11nEnv.getValue($s.OBJECT_INFO.OBJECT_INFO_ID),a=this.c11nEnv.getPageReference().replace($s.OBJECT_INFO.OBJECT_INFO_CONTENT,"")),Du({context:r,stateObj:aC(r),clearContextMessages:!0});const g={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:n,viewID:d,isFormValid:aI(r),interestPage:AC.convertPageRefToClipboardPageNotation(a),parentContext:p,isModalAction:!1,target:this.c11nEnv.getTarget(),editType:c,actionID:u,operationFlag:Gs.EMBEDDED_DATA_MODAL.SUBMIT_ROW,interestPageActionID:i,isLocalAction:l,assignmentID:s};e&&e.includes(Gs.MODAL)&&(g.containerName=Gs.MODAL,g.isModalAction=!0);const h=PC.buildActionObject(g,this.c11nEnv);if(c===Gs.ACTION){const e=AC.getETag(h.context);h.headers={"If-Match":e}}const{promise:f}=this.actionsApiPromise(t,h);if(NE(r)){const[e,t,n]=ou(this.c11nEnv.getPageReference());yu.mutatePageList(p,e,t,{type:gr,rowIndex:n}),sC({type:gr,payload:{pageReference:this.c11nEnv.getPageReference(),context:p,isListEntry:!0}})}return Yh.executeOrQueueDeferredAction({type:t,payload:{...h,context:r}}),f}fillFormWithAI(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=JE(e),n=this.c11nEnv.getPageReference(),{promise:s,actionMgrID:a}=this.actionsApiPromise(xr);return MI(t,n,{actionMgrID:a,isFillFormWithAI:!0,preserveClientChanges:!1}),s}handleSubscript(e,t){if(!xA($s.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW))return Promise.reject(new Error(this.MSG_SUBSCRIPT_VIEW_REQUIRED));const n=vr,s=PC.buildActionObject({containerItemID:e},t);sC({type:n,payload:{...s,isDataObject:!0,skipReleaseLockRequest:!0,isFormValid:aI(e),context:e}});const{promise:a}=this.actionsApiPromise(n,s);return a}showSubscriptCreateView(e,t,n,s=$s.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW){const a=PC.buildActionObject({viewName:s,className:e,referenceListStr:t,subscriptName:n},this.c11nEnv),r=ia,{promise:o}=this.actionsApiPromise(r,a);return sC({type:r,payload:{...a,containerName:$s.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),o}deleteWork(e,t,n){if(!e)return Promise.reject(new Error("workId is required parameter"));const s=Vr,a=lI.isExternalCaseType(t),r=PC.buildActionObject({workId:e,caseTypeID:t,isExternalCase:a,...n?.skipDeleteConfirmation&&{skipDeleteConfirmation:!0},...n?.enableBackNavigation&&{enableBackNavigation:!0}},this.c11nEnv),{promise:o}=this.actionsApiPromise(s,r);return sC(pg({...r})),o}deleteDataRecord(e,t){if(!e)return Promise.reject(new Error("className is required parameter"));if(!t)return Promise.reject(new Error("keys is required parameter"));const n=Vr,s=PC.buildActionObject({className:e,keys:t},this.c11nEnv),{promise:a}=this.actionsApiPromise(n,s);return sC(pg({...s})),a}};const nf=class{constructor(e){this.c11nEnv=e}buildRemoteCaseHeaders(e,t){const n={};if(e){const s=qs.getRemoteCaseClassBySourceClass(e)??e;qs.injectRemoteCaseHeader(n,{caseTypeID:s},t)}return n}async getCaseStages(e,t,n){const s={caseID:e},{restApi:a,reqType:r}=_S("getCaseStages",s),{caseTypeID:o}=n||{},i=this.buildRemoteCaseHeaders(o,t);return(await ud(a,{method:r,headers:i},t)).data.stages}async getCaseActions(e,t,n){const s={caseID:e},{restApi:a,reqType:r}=_S("getActions",s),{caseTypeID:o}=n||{},i=this.buildRemoteCaseHeaders(o,t);return(await ud(a,{method:r,headers:i},t)).data}getCaseTypeName(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_TYPE_NAME))}getName(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO_NAME))}getClassName(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_TYPE_ID))}getAvailableProcesses(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.AVAILABLEPROCESSES))}getKey(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO_ID))}getObjectKey(){return this.c11nEnv.getValue(Gs.OBJECT_INFO.OBJECT_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.ASSIGNMENT_ID))}getActions(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.ACTION_BUTTONS))}getActiveFlowActionID(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.ACTIVE_ACTION_ID))||this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.ASSIGNMENTACTION_ID))}getParentCaseInfo(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.PARENTCASEINFO))}isPerform(){return this.c11nEnv.getValue(`${Gs.CONTEXT_DATA}${Gs.CASE_VIEW_MODE_PROP}`)===Gs.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${Gs.CONTEXT_DATA}${Gs.CASE_VIEW_MODE_PROP}`)===Gs.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO));return dI(e)}isReviewAfterCreateStage(){if(!this.isReview())return!1;const e=this.c11nEnv.getContextName(),t=ty(e)[0];if(!t)return!1;const n=nC()?.getState().data[t]?.caseInfo?.stages;if(!Array.isArray(n))return!1;const s=[...n].reverse().find((e=>"object"==typeof e&&null!==e&&"visited_status"in e&&"transitionType"in e&&"completed"===e.visited_status));return"create"===s?.transitionType}isLocalAction(){const e=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO));return uI(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===Gs.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),s=FE(t,n),{config:a}=t&&n?s&&s.view:this.c11nEnv.getMetadata();e=a?.type===Gs.VIEW?a?.name:null}(e&&e.startsWith(Gs.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(ks.getQualifiedNameForComplexRuleReferences(Gs.getProperty(Gs.CASE_INFO.VIEW_NAME))))}return e}getValueByPath(e,t){let n=e;if((t=t.replace("@P ","").trim()).includes(ks.getDefaultQualifiedName("pyViewContext"))){const t=e.caseInfo?.content??{},s=t[ks.getDefaultQualifiedName("pyViewContext")];if(!s)return n.caseInfo.content;if("string"==typeof s&&s.includes("(")&&s.includes(")")){const e=s.substring(1,s.indexOf("(")),n=parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")),10)-1;if(Array.isArray(t[e]))return t[e][n]}}const s=t.split(/[.[\]]/).filter((e=>e));for(const e of s)if("object"==typeof n&&null!==n&&e in n)n=n[e];else{if(!Array.isArray(n)||Number.isNaN(Number(e)))return;n=n[parseInt(e,10)-1]}return n}getCurrentAssignmentViewClassName(){const e=this.c11nEnv.getTarget(),t=this.c11nEnv.getContextName(),n=FE(e,t),{config:s}=e&&t&&n?n.view:this.c11nEnv.getMetadata(),a=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO)),r=s?.type===Gs.VIEW?s.context:null;if(r){const e=this.getValueByPath({caseInfo:a},r);if("object"==typeof e&&null!==e&&"classID"in e)return e.classID}return null}getActionRefreshConditions(){if(this.c11nEnv.getValue(Gs.getProperty(Gs.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)))return this.c11nEnv.getValue(Gs.getProperty(Gs.EMBEDDED_DATA_MODAL.REFRESH_CONDITIONS));const e=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.ACTIVE_ACTION_ID)),t=Ks(this.c11nEnv.getContextName());let n;t&&(n=aC(t));const s=n?.caseInfo?.availableActions,a=aC(this.c11nEnv.getContextName()),r=a?.caseInfo?.refreshConditions;if(e){if(s){const t=s.find((t=>t.ID===e));return t?t.refreshConditions:r}return r}return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.ACTION_REFRESH_CONDITIONS))}getBusinessID(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.BUSINESS_ID))}getAssignments(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO))?.assignments}getChildAssignments(){return this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO))?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.ACTIVE_ACTION_ID)),t=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO_ACTIONS));if(t&&e){const n=t.find((t=>t.ID===e));return"Case"===n?.type}return!1};getAllAssignments(){const e=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.ASSIGNMENT_LABEL)),n=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS))||[],s=this.getChildAssignments()||[];let a=JSON.parse(JSON.stringify(s));a=a.map((e=>(e.isChild=!0,e)));const r=[...n,...a];let o=JSON.parse(JSON.stringify(r));return e&&!this.isPerform()&&(o=o.map((e=>(e.name=this.getActiveCaseActionName()||e?.name||t,e)))),o}getActiveCaseActionName(){const e=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.ACTIVE_ACTION_ID)),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_INFO_ACTIONS));return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(Gs.getProperty(Gs.CASE_INFO.GETNEXTWORK))}isObjectWideAction(){const e=this.c11nEnv.getValue(Gs.OBJECT_INFO.OBJECT_INFO);return uI(e)}getCaseCollaborators=(e=!0)=>{const t=this.c11nEnv.getValue(Gs.CASE_INFO.CASE_INFO_COLLABORATORS)||[];if(e){const e=Gy.getOperatorIdentifier();return t.filter((t=>t.ID!==e))}return t}};const sf=class{constructor(e){this.c11nEnv=e}getContextKey(){return this.c11nEnv.getValue(Gs.getProperty(Gs.DATA_INFO.DATA_INFO_CONTEXT_KEY))}};class af{constructor(e){af._instance=this,this.context=`${e}/${Gs.SUGGESTION}`,nC()?.getState().data?.[this.context]||sC({type:Ya,payload:{context:this.context,data:{}}})}getField(e){return iC(e,"",this.context)}setField(e,t){sC({type:sa,payload:{reference:e,value:t,context:this.context}})}removeField(e,t={}){sC({type:Pa,payload:{reference:e,context:this.context,...t}}),Uu.publish(Gs.PUB_SUB_EVENTS.SUGGESTION_PROCESSED,{reference:e,context:this.context,...t})}setState(e){sC(vC({context:this.context,data:e,isArrayDeepMerge:!0}))}}const rf=af;const of=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=rC();return n?AC.getIn(n,t):null}static setSharedState(e,t){e&&sC(uS({key:e,value:t}))}static updateState(e,t,n,s={}){const{isArrayDeepMerge:a=!0,pageReference:r,removePropertyFromChangedList:o=!1,skipDirtyValidation:i=!1}=s;if(!e||!t)return;sC(dS({context:e,reference:r?`${r}.${t}`:t,value:n,isArrayDeepMerge:a,removePropertyFromChangedList:o,skipDirtyValidation:i}))}static getSuggestionsContext(e){return new rf(e)}static triggerRefresh(e,t){LI({context:e,pageReference:t})}};class cf{static getParagraphStream(e,t,n){return((e,t,n)=>{if(!e)return e;const s=(new DOMParser).parseFromString(e,"text/html"),a=s.querySelectorAll("pega-reference");for(const e of a){const n=e.getAttribute("data-rule-id");if(n){const a=t.getValue(n),r=s.createTextNode(a??"");e.replaceWith(r),t.registerAdditionalProps({[n]:`@P ${n}`})}else e.replaceWith("")}let r;return r="simple"===n?s?.body?.textContent||"":s?.body?.innerHTML||"",/^(<p>)\s*(<\/p>)$/.test(r)?null:r})(e,t,n)}static isDecisionParagraph(e,t){const n=kA(e,t);return!!n?.useDecision}static processParagraph(e,t){const n=t.getCurrentClassID(),s=kA(e,n);let a;if(s?.useDecision){const n=s.dynamicContents.length;for(let r=0;r<n-1;r+=1)if(NC.resolveWhen(s.dynamicContents[r].when,t)){a=s.dynamicContents[r],e=`${e}#${a.when}`;break}a||(a=s.dynamicContents.pop())}else a=s;const r=s?.definedOnClassID,o=Yy().getParagraphLocaleValue(r||n,e);return o?cf.getParagraphStream(o.content,t,o?.category):a?.content?cf.getParagraphStream(a.content,t,a?.category):null}static processBannerDecisionParagraph(e,t){const n=t.getCurrentClassID(),s=kA(e,n);let a;if(s?.useDecision){const n=s.dynamicContents.length;for(let r=0;r<n-1;r+=1)if(NC.resolveWhen(s.dynamicContents[r].when,t)){a=s.dynamicContents[r],e=`${e}#${a.when}`;break}a||(a=s.dynamicContents.pop())}else a=s;const r=s?.definedOnClassID,o=Yy().getParagraphLocaleValue(r||n,e);let i=null;return o?i=cf.getParagraphStream(o.content,t,o.category):a?.content&&(i=cf.getParagraphStream(a.content,t,a?.category)),{htmlContent:i,messageType:a?.messageType,dismissBanner:a?.dismissBanner,isBanner:a?.isBanner}}static getParagraphProperties(e,t){const n=t.getCurrentClassID(),s=kA(e,n);return{useDecision:s?.useDecision,isBanner:s?.isBanner,messageType:s?.messageType,dismissBanner:s?.dismissBanner}}static isADecisionParagraph(e,t){return this.getParagraphProperties(e,t).useDecision}static isBanner(e,t){return this.getParagraphProperties(e,t).isBanner}static getParagraphMessageType(e,t){return this.getParagraphProperties(e,t).messageType}static isDismissibleBanner(e,t){return this.getParagraphProperties(e,t).dismissBanner}static hasDecisionBannerContent(e,t){const n=t.getCurrentClassID(),s=kA(e,n);return!(!s?.useDecision||!s?.dynamicContents)&&s.dynamicContents.some((e=>e.isBanner))}}const lf=cf;class uf{constructor(e){this.fieldType=e}applyFallback(e){const t=Qd.getDefaultsforType(this.fieldType);e.currencyISOCode=e.currencyISOCode||t?.currencyISOCode||"USD"}}class df{static getStrategy(e){switch(e){case"Currency":case"Decimal":case"Integer":case"Percentage":return new uf(e);default:return}}}const pf="DATAPAGE",gf="VIEW",hf="FIELD",ff="CASE",mf="PARAGRAPH",If=(e,t,n,s)=>{const a=[gf,hf,mf],r=[pf,mf].includes(e)&&s?`#${s}`:"",o=e===pf?"@BASECLASS":n;return e===pf||a.includes(e)?`${o}!${e}!${t}${r}`.toUpperCase():`${e}!${t}${r}`.toUpperCase()};class Ef{static COMMON_LABELS="COMMONLABELS";static MESSAGES="MESSAGES";static COMPONENT_FIELDS="COMPONENTFIELDS";lookupList=[];constructor(e,t){this.localeReference=t,this.locale=e}getLocalizedText(e,t){const n=[...this.localeReference?[this.localeReference.toUpperCase()]:[],...this.lookupList,Ef.COMPONENT_FIELDS,Ef.COMMON_LABELS],s=this.#o(e,n)||e;return(t?this.#i(s,t):s)||e}getLocalizedMessage(e,t){const n=this.#o(e,[Ef.MESSAGES,Ef.COMMON_LABELS])??e;return(t?this.#i(n,t):n)||e}getLocalizedDataPage(e,t,n,s){if(!t||!n||!e)return e;const a=[If(pf,t,void 0,n),Ef.COMMON_LABELS,...this.lookupList],r=this.#o(e,a)??e;return(s?this.#i(r,s):r)||e}#i(e,t){return 0===t.length?e:e.replace(/\{(\d+)\}/g,((e,n)=>t[""+(Number(n)-1)]??e))}#o(e,t=this.lookupList){if(0===t.length)return;const n=_A(this.locale);for(const s of t){const t=this.#c(e,n.localeStore[s]);if(t)return t}}#c(e,t={}){const n=t[e];if("string"==typeof n)return n}setLookupList(e){Array.isArray(e)&&(this.lookupList=e)}}const yf=e=>Bs.getNeedsMapping()||e?.info===$s.OBJECT_INFO.OBJECT_INFO?$s.OBJECT_INFO.OBJECT_INFO:$s.CASE_INFO.CASE_INFO,Af=(e,t)=>{const n=yf(t);e.data=e.data??{};const{assignments:s,availableActions:a=[]}=e.data[n]??{};if(s&&Array.isArray(s)&&s.length>0&&s[0].actions&&Array.isArray(s[0].actions)&&!t?.stopMergeActions){s[0].actions.forEach((e=>{"Assignment"!==e.type&&"LocalAction"!==e.type||a.push(e)})),e.data[n]=e.data[n]??{},e.data[n].availableActions=a}},Cf=(e,t)=>{const n=yf(t),s=um();if(e.confirmationLinks&&(e.data=e.data??{},e.data[n]=e.data[n]??{},e.data[n].confirmationLinks=e.confirmationLinks),!e.uiResources&&e.confirmationNote){let t=e;const{confirmationNote:n}=t;return void 0===s||s||Af(t),t=((e,t)=>{const n=[e];return t.data=t.data??{},t.data.caseMessages=n,t})(n,t),t}if(!e.uiResources||!e.data||!e?.uiResources?.root)return e;const a=e,{uiResources:{actionButtons:r,navigation:o,settings:i},nextAssignmentInfo:c}=a;if(r&&r.main&&(r.main=r.main.map((e=>"createWork"===e.jsAction?{...e,jsAction:"createCase"}:e))),a.data&&a.data[n]&&(r&&(a.data[n].actionButtons=r),o&&(a.data[n].navigation=o),i&&(a.data[n].settings=i),t&&t[$s.ACTIONS.DELETEAVIALACTIONS]&&delete a.data[n].availableActions,void 0===s||s||Af(a,t),e.confirmationNote)){const{confirmationNote:e}=a,t=[e];a.data.caseMessages=t}return t&&t.isCreateDataObject&&(a.data=a.data??{},a.data.dataInfo={},a.data.dataInfo.content=a.data.pyPortal,a.uiResources.root.config.context="dataInfo.content",a.uiResources.context_data.dataInfo=a.uiResources.context_data.dataInfo??{},a.uiResources.context_data.dataInfo.content=a.uiResources.context_data.dataInfo.content??{},a.uiResources.context_data.dataInfo.content=a.uiResources.context_data?.pyPortal,delete a.data.pyPortal,delete a.key),c&&(a.data=a.data??{},a.data.nextAssignmentInfo=c),a},Sf=async e=>{const t=Cf(e),n=AC.getIn(t,Gs.COMPONENTS);Ip(t,{},!0),await Vp(n)},_f=(e,t,n)=>NC.resolveView(e,t,n),Nf=(e,t,n,s)=>{const a=e[t];if(!a)return!1;const r=AC.getIn(a,$s.CASE_INFO.CASE_INFO_CLASSID);return AC.getIn(a,Gs.CASE_INFO.VIEW_NAME)===n&&(!s||r===s)},Tf=e=>{const{accessedOrder:t,items:n}=e;if(!t||!n)return null;const s=t[t.length-1];return s?n[s]?.context??null:null},Df=(e,t="",n="")=>{let s=n||null;if(!s){const n=`${$s.APP.APP}/primary`;s=((e,t)=>{const n=nC();if(!n)return null;const s=n.getState(),{data:a,containers:r}=s;if(!r||!a)return null;const o=`${$s.APP.APP}/primary`;if(r[o]){const n=Tf(r[o]);if(n&&Nf(a,n,e,t))return n}for(const n of Object.keys(r)){if(n===o)continue;const s=Tf(r[n]);if(s&&Nf(a,s,e,t))return s}return null})(e,t),s||(s=XE(n))}if(!s)return Promise.reject(new Error(`Unable to find an active context for view "${e}".`));const a=aC(s);if(!a)return Promise.reject(new Error(`No data found for context "${s}".`));const r=AC.getIn(a,$s.CASE_INFO.CASE_INFO_ID)||"",o=Ff({options:{context:s,pageReference:$s.CASE_INFO.CASE_INFO_CONTENT}});return OA(),o.getPConnect().getActionsApi().refreshCaseView(r,e,"",{autoDetectRefresh:!0,preserveClientChanges:!1}).finally((()=>{RA()}))};let Pf=function(e){return e.CURRENCY="Currency",e.PERCENTAGE="Percentage",e.DECIMAL="Decimal",e.INTEGER="Integer",e.TEXT_SINGLE_LINE="Text (single line)",e.TEXT_PARAGRAPH="Text (paragraph)",e.EMAIL="Email",e.URL="URL",e.PHONE="Phone",e.PICKLIST="Picklist",e.USER_REFERENCE="User Reference",e.BOOLEAN="Boolean",e.DATE_AND_TIME="Date & time",e.DATE_ONLY="Date only",e.TIME_ONLY="Time only",e.IDENTIFIER="Identifier",e.DOUBLE="Double",e.TEXT_ENCRYPTED="Text Encrypted",e.PASSWORD="Password",e}({});const Of=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=NC.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=NC.getContextPath(this.datasource,this.index);return this.index+=1,Ff({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class Rf{constructor(e,t){this.children=e,this.index=0,this.options=t}hasNext(){return this.index<this.children.length}next(){if(!this.hasNext())throw new Error("No Children");const e=this.index,t=this.children[e];this.index+=1;const n=t?._relativePath??`${this.options?.relativePath??""}.children[${e}]`;return Ff({meta:t,index:this.index,options:{...this.options,relativePath:n}})}resetIndex(){this.index=0}}const bf=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new Of(e,e.context||"",t);if(n){const n=lC(`${t.context}.${Gs.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new Of(e.children[0],n||e.context,t)}return e?.children?new Rf(e.children,t):void 0};class vf{static allowedComponetsForBulkProcessing={Currency:!0,TextInput:!0,Phone:!0,Percentage:!0,Email:!0,Integer:!0,Decimal:!0,URL:!0,SemanticLink:!0,Checkbox:!0,RadioButtons:!0,DateTime:!0,Date:!0,Time:!0,Text:!0,TextArea:!0,RichText:!0,Dropdown:!0,Search:!0,Location:!0,Attachment:!0,AutoComplete:!0,MultiSelect:!0,UserReference:!0,Region:!0,TextContent:!0,View:{Forms:!0,DefaultForm:!0,OneColumn:!0,TwoColumn:!0,ThreeColumn:!0}};static getItemView(e,t){const n=[];if(e&&["portal","view"].includes(t)){const{accessedOrder:t,items:s}=e;if(t&&s){const e=t[t.length-1];s[e]&&s[e].view&&Object.keys(s[e].view).length>0&&n.push(s[e])}}return n}static getDependentProperties=e=>{let t=[];return e._rawConfig?.config?.parameters?t=Object.values(e._rawConfig?.config?.parameters||{}):e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters&&(t=(e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters||[]).map((e=>e?.value))),t.filter((e=>hg.isProperty(e))).map((e=>hg.getPropertyName(e)))}}const xf=new vf;let wf;Object.freeze(xf);const Mf=(e,t,n)=>{e&&(Object.keys(e).forEach((s=>{if("children"!==s){const a=e[s],r=Ro.trimAnnotation(a);if("string"!=typeof r&&"string"!=typeof a||!(AC.isValidAnnotation(a)&&AC.isPropertyRef(r)||a.startsWith("@W ")||a.startsWith("@DW ")||a.startsWith("@E ")||a.startsWith("@ATTACHMENT "))){if(Array.isArray(r))r.forEach(((e,n)=>{const a={parentStateObj:t,parentKey:s,isObjHasValue:!!t[s]};t[s]=t[s]||[],t[s][n]=Object.create({}),Mf(e,t[s][n],a)}));else if(r&&"object"==typeof r&&"exp"!==r.type){const e={parentStateObj:t,parentKey:s,isObjHasValue:!!t[s]};t[s]=t[s]||{},Mf(r,t[s],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[s]=r}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},Lf=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...AC.deepClone(t.inheritedProps)]};class Uf{constructor(e){const{meta:t,isRoot:n,options:s={},useCustomContext:a}=e;this.meta=t,this._isRoot=n,this.options=s,this.useCustomContext=a,this._rawConfig=t?.config,this._isExpressionExist=!1,this._isWhenExist=!1,this._isValidatorExist=!1,this._pageReference="",this._referenceContext="",this._contextName="",this._stateProps={},this._actions={},this._children="",this._additionalRegisteredProps={},this._caseInfo=null,this._dataInfo=null,this.viewName=s.viewName,this.parentViewName=s.viewName??"",this._referenceList=s.referenceList||"",this._isInsideList=s.isInsideList||!1,this._inheritedConfig={},this._localeRuleName=s.localeReference,this._containerTarget=s.target,this._readOnly=t?.config?.readOnly||s.readOnly,this._hasSuggestions=!1,this._actionsApi=null,this._classID=null,this.index=e.index,this.categoryName=s.categoryName||"",this._relativePath=s.relativePath??"",s.inheritedConfig&&(this._inheritedConfig=AC.deepClone(s.inheritedConfig)),t?.config?.inheritedProps&&Lf(this._inheritedConfig,t?.config),this.meta?.config?.value&&"string"==typeof this.meta?.config?.value&&this.meta?.config?.value?.startsWith("@P ")&&this.meta?.config?.value?.includes("(")&&(this.meta.config.value=Ad.formatePageReferenceToArrayIndex(this.meta.config.value)),Mf(this._rawConfig,this._stateProps),this._isState=!AC.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=AC.isExpressionExist(this._rawConfig.config),this._isWhenExist=AC.isWhenExist(this._rawConfig.config),this._isValidatorExist=hp.isValidatorExist(this._rawConfig.config)),this._isRoot?this._contextName=$s.APP.APP:this._contextName=this.meta?.config?.contextName||this.options.context||"",this._type=this.meta?.type;let r=this.options.pageReference;this.options.pageReference&&(r=Ro.handleAnnotation(this.options.pageReference,this)),this._pageReference=NC.getContextPath(r||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t);const o="reference"===this._type&&AC.isWhenExist({visibility:this.meta?.config?.visibility}),i=this._checkAndSetDecisionParagraph("instructions",this._rawConfig?.instructions);let c=!1;if("reference"!==this._type&&t&&(this._rawConfig=NC.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=Ro.trimAnnotation(e.localeReference)||s.localeReference,this._isExpressionExist=AC.isExpressionExist(e),this._isWhenExist=AC.isWhenExist(e),this._isValidatorExist=hp.isValidatorExist(e),c=this._checkAndSetDecisionParagraph("label",e?.label)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===Gs.VIEW&&this._rawConfig.name&&(this.viewName=Ro.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&xI(this)}(o||i||c)&&OI(this.viewName,this._contextName,this._pageReference)}_checkAndSetDecisionParagraph(e,t){let n=!1;if(t&&t.startsWith(Gs.PARAGRAPH_ANNOTATION)){const s=Ro.trimAnnotation(t);n=lf.isDecisionParagraph(s,this.getCurrentClassID()),n&&this.setStateProps({[e]:t})}return n}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=Ro.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=Ro.trimAnnotation(this.getPropertyName());return""===this._pageReference&&e.startsWith(".")?e.substring(1,e.length):e}addFieldNode(){const e=this._getPropertyName(),{value:t,contextPage:n,label:s,required:a,readOnly:r,disabled:o,visibility:i,validationType:c,caption:l,allowMultiple:u,useRFC822Validation:d}=this.getRawConfigProps();if(this.getValue(this._pageReference)||""===this._pageReference){const p="Address"===this._type&&this._rawConfig?.config?.associatedView?Ro.trimAnnotation(this._rawConfig.config.associatedView):"",g=s||l,h=this._rawConfig?.type,f={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:Ro.trimAnnotation(t),label:g?.startsWith("@")?Ro.handleAnnotation(g,this,void 0):g,required:a,readOnly:r,disabled:o,visibility:i||this.options?.visibility,skipRequiredValidation:this.options?.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:t,validationType:c,...n&&{contextPageRef:`${this._pageReference}${Ro.trimAnnotation(n)}`},componentName:h,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),index:this.index,allowMultiple:u,isDeclarativeTarget:this.isDeclarativeTarget(),...this._type===Pf.EMAIL&&{useRFC822Validation:d}};yu.addFieldNode(this._contextName,this._pageReference,(p||this.categoryName||this.viewName)??"",e,this.getValue(e),f)}}removeNode(){if(Object.hasOwn(this._rawConfig?.config??{},"value")&&"Address"!==this._type)yu.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",Ro.trimAnnotation(this.getPropertyName()),this.index);else if("Address"===this._type&&this._rawConfig?.config?.associatedView)yu.removeViewNode(this._contextName,this._pageReference,Ro.trimAnnotation(this._rawConfig.config.associatedView),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference,t={visibility:this.options?.visibility??this._rawConfig?.config?.visibility??this._rawConfig?.config?.referenceVisibility};yu.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index,t)}}addViewNode(){if(!this.isReadOnly()){if(this._rawConfig?.type?.toLowerCase()===Gs.VIEW&&this._rawConfig.name&&this.viewName){const e={visibility:this.options?.visibility??this._rawConfig.config?.visibility??this._rawConfig.config?.referenceVisibility};yu.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName,e)}"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&yu.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&yu.addViewNode(this._contextName,this._pageReference,Ro.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&yu.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}}addWhenNode(){let e="",t="";const n=AC.getWhenNames(this._rawConfig?.config),s=this.getRawConfigProps();if(s?.type&&s?.type?.toLowerCase()===Gs.VIEW)t=Gs.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=Gs.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=Ro.isProperty(n)?Ro.trimAnnotation(n):""}e&&n.forEach((n=>{yu.addWhenNode(this.getContextName(),this.getPageReference(),t,e,n,{pageReference:this.getPageReference(),context:this.getContextName()})}))}updateContextTree(){if(this.isVisible()&&(this.addViewNode(),this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&"DISPLAY_ONLY"!==this._inheritedConfig.displayMode&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode&&this.addFieldNode(),(this._rawConfig?.type?.toLowerCase()!==Gs.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,contextPage:s,readOnly:a,disabled:r,visibility:o,validationType:i,selectionMode:c,selectionList:l,selectionKey:u,referenceList:d,renderMode:p,caption:g,uniqueField:h}=this.getRawConfigProps(),f=t||g;let m=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(m=this.getSelfReferencingDatapageKeys()),yu.addPageListNode(this._contextName,this._pageReference,this.viewName??"",Ro.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:Ro.trimAnnotation(this.getPropertyName()),label:f?.startsWith("@")?Ro.handleAnnotation(f,this,void 0):f,required:n,readOnly:a,disabled:r,...s&&{contextPageRef:`${this._pageReference}${Ro.trimAnnotation(s)}`},visibility:o||this.options.visibility,skipRequiredValidation:this.options.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:e,validationType:i,componentName:this._rawConfig.type,type:this._rawConfig.config?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),selectionMode:c,selectionList:l,renderMode:p,referenceList:d,selectionKey:u,index:this.index,uniqueField:h,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?m:void 0});const I=this.getValue(Ro.trimAnnotation(this.getPropertyName()),this._pageReference)||[];yu.updatePageListNode(this._contextName,this._pageReference,Ro.trimAnnotation(this.getPropertyName()),I.length)}this.isWhenExist()&&this.addWhenNode(),this.isVisible()||this.removeNode()}getStateProps(){return this._stateProps}setStateProps(e){AC.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getSharedDataPageForReferenceList(){const e=this.getCaseInfo().getClassName(),t=this.getCurrentView();if(!t||!e)return;const n=_f(t,this,e);if(!n)return;const s=this.getRawMetadata()?.config?.referenceList;if(!s)return;let a={};"object"==typeof n.config?.parameters&&null!==n.config.parameters&&(a=n.config.parameters);const r=AC.generateDataPageHashWithParameters(a,s,this),o=rC(),i=o?o[s]?.[r]:{};return Array.isArray(i?.[ks.getDefaultQualifiedName("pxResults")])?i[ks.getDefaultQualifiedName("pxResults")]:void 0}getCaseInfo(){return this._caseInfo||(this._caseInfo=new nf(this)),this._caseInfo}getDataInfo(){return this._dataInfo||(this._dataInfo=new sf(this)),this._dataInfo}getCaseLocaleReference(e){const t=this.getRawConfigProps(),n=e||this.getValue(Gs.getProperty(Gs.CASE_INFO.CASE_TYPE_ID))||this.getValue(Gs.CLASS_ID,Gs.getProperty(Gs.DATA_INFO.DATA_INFO_CONTENT))||t?.referenceClass||t?.className;return n?If(ff,n):null}getListActions(){return Kd(this)}getReferenceList(){return this._referenceList}isInsideList(){return this._isInsideList||/\[\d+\]/g.test(this.getPageReference())||/\[\d+\]/g.test(this.getPropertyName())}getRawMetadata(){return this.getMetadata()}setReferenceList(e){this._referenceList=e}getComponentConfig(){return this.getMetadata()?.config||{}}isExpressionExist(){return this._isExpressionExist}isWhenExist(){return this._isWhenExist}isConditionExist(){return this.isExpressionExist()||this.isWhenExist()}isBoundToState(){return this._isState}getPageReference(){return this._pageReference}getPropertyName(){const e=this.getComponentConfig();let t;return t="multi"===e.selectionMode?"selectionList":"single"===e.selectionMode&&e.selectionKey?"selectionKey":"Editable"===e.renderMode?"referenceList":"Address"===this._type?"addressProp":"value",this.getComponentConfig()[t]}getFullReference(){const e=this.getPageReference(),t=this.getPropertyName();return NC.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[Gs.CONTAINERS.ROOT_CONTAINER,Gs.CONTAINERS.VIEW_CONTAINER,Gs.CONTAINERS.FLOW_CONTAINER,Gs.CONTAINERS.MODAL_VIEW_CONTAINER,Gs.CONTAINERS.PREVIEW_VIEW_CONTAINER,Gs.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=xE.PRIMARY,name:s,routingInfo:a}=this.getComponentConfig();return(e&&t.includes(e)||"@ROUTING_INFO"===a)&&s?s:this.options.containerName||n}getTarget(){return this._containerTarget}getCurrentView(){return this.viewName}populateSuggestionProps(e){if(this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&this.getStateProps()?.value&&this.options.hasForm){const t=f?.getStore()?.getState()?.data[`${this.getContextName()}/${Gs.SUGGESTION}`],n=this.getStateProps()?.value,s=NC.getContextPath(this.getPageReference(),n),a=t?of.getSuggestionsContext(this.getContextName()).getField(s):void 0;this._hasSuggestions=!!a,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...Qd.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig},n=df.getStrategy(this._type);return n?.applyFallback(t),this.populateSuggestionProps(t),this.resolveConfigProps(t,e),AC.resolveStringBooleans(e)}getLocalizationService(e){const t=this.getComponentName(),n=e||("View"===t?this._rawConfig?.config?.template:t),s=Gy.getLocale()??"en-US",a=new Ef(s,n),r=this.getCaseLocaleReference();return a.setLookupList(["APP!APPLICATION"]),r&&a.setLookupList([r]),a}getRawConfigProps(){const e={...Qd.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(NC.resolveProps(e,t,this),Ro.handleComponentMapping(t,{type:this.getComponentName()||"",config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),Mf(e,this._stateProps),this.resolveConfigProps(this._additionalRegisteredProps)}deRegisterAdditionalProps(e=[]){return e.forEach((e=>{delete this._additionalRegisteredProps[e]})),!0}populateAdditionalProps(e){const t=e=>e?.map((e=>({...e,message:this.getLocalizationService()?.getLocalizedMessage(e.message)??e.message}))),n=this.getComponentName(),s=this.getComponentConfig(),a=n===Gs.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(n===Gs.MODAL_VIEW_CONTAINER||n===Gs.CASE_CREATE_STAGE||n===Gs.OBJECTACTIONCONTAINER){const n=YE(`${Gs.APP.APP}/${this.getContainerName()}`),s=Tu({context:n,category:$s.PAGE});e.pageMessages=t(s),this._stateProps.pageMessages=e.pageMessages}if(this.isEditable()){let{value:t}=this.getStateProps();void 0===t&&"multi"===this.getComponentConfig()?.selectionMode?t=this.getStateProps().selectionList||Ro.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=Tu({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:$s.MESSAGES.MESSAGES_TYPE_ERROR}),s=Tu({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:$s.MESSAGES.MESSAGES_TYPE_INFO});if(n&&n[0]){e.validatemessage=n.map((e=>this.getLocalizationService().getLocalizedMessage(e.message).replace(/\.$/,""))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=Gs.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status;const s=n?.find((e=>"error"===e.type&&"required"===e.subType));s&&!e.required&&this.isVisible()&&this.clearErrorMessages({property:t,subType:"required"})}s&&s[0]&&(e.infoMessage=s[0].message,e.status=Gs.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(n===Gs.ROOT_CONTAINER){const n=Ru(a,YE(`${Gs.APP.APP}/${this.getContainerName()}`));e.httpMessages=Array.isArray(n)?t(n):n,this._stateProps.httpMessages=e.httpMessages;const s=of.getSharedState("isLoggedOut");e.isLoggedOut=s,this._stateProps.isLoggedOut=s;const r=Tu({context:Gs.APP.ROOT,category:"PAGE"});e.pageMessages=t(r),this._stateProps.pageMessages=e.pageMessages}if(n===Gs.HYBRID_VIEW_CONTAINER){const n=Tu({context:Gs.APP.APP,category:Gs.HTTP});e.httpMessages=t(n),this._stateProps.httpMessages=n}if(n===Gs.APP_SHELL&&e.portalDocMode===Gs.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=mh.getOpenedCaseItems(`${$s.APP.APP}/${Gs.PRIMARY}`),this._stateProps.activeCases=e.activeCases),n===Gs.APP_SHELL){const n=Gs.APP.APP,s=YE(`${n}/${this.getContainerName()}`),a=[...Tu({context:n,category:"PAGE"})||[],...Tu({context:s,category:"PAGE"})||[]],r=a.length>0?a:void 0;e.pageMessages=r&&t(r),this._stateProps.pageMessages=e.pageMessages}if(e.value&&n===Gs.SCALARLIST&&(this._stateProps.value=e.value),n===Gs.APP_SHELL||n===Gs.MODAL_VIEW_CONTAINER||n===Gs.CASE_CREATE_STAGE||s.template===Gs.CASE_PREVIEW||s.template===Gs.RULE_PREVIEW){let t=Tu({context:Gs.APP.APP,category:"HTTP"});const n="HYBRID"===Gy.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${Gs.APP.APP}/${this.getContainerName()}`,s=Tu({context:YE(n),category:"HTTP"});t?s&&(t=t.concat(Tu({context:YE(n),category:"HTTP"}))):t=Tu({context:YE(n),category:"HTTP"}),e.httpMessages=t?t.map((e=>this.getLocalizationService().getLocalizedMessage(e.message))):t,this._stateProps.httpMessages=e.httpMessages,t?.forEach((t=>{t.errorDetails&&(e.errorDetails=e.errorDetails?e.errorDetails.push(...t.errorDetails):t.errorDetails,this._stateProps.errorDetails=e.errorDetails),t.correlationID&&(e.correlationID=t.correlationID)}))}if(n===Gs.VIEW_CONTAINER||n===Gs.FLOW_CONTAINER||n===Gs.MODAL_VIEW_CONTAINER||n===Gs.PREVIEW_VIEW_CONTAINER||n===Gs.ROOT_CONTAINER||n===Gs.OBJECTACTIONCONTAINER){if(e.routingInfo=Hr(this.getContainerName(),this._contextName),n===Gs.ROOT_CONTAINER&&(e.rootConfig=vf.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,n===Gs.FLOW_CONTAINER||n===Gs.OBJECTACTIONCONTAINER){const n=Tu({context:this.getContextName(),category:Gs.CASEMESSAGES}),s=this.getContextName();e.caseMessages=n,this._stateProps.caseMessages=e.caseMessages,e.caseViewMode=this.getValue("context_data.caseViewMode"),this._stateProps.caseViewMode=e.caseViewMode;const a=ey(s)[0];if(a){const n=YE(a),s=f?.getStore()?.getState()?.data;s&&n&&(e.lastUpdateTime=s[n]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=s[n]?.caseInfo?.lastUpdateTime);const r=Tu({context:n,category:$s.PAGE}),o=Tu({context:n,category:"HTTP"});e.httpMessages=t(o),e.pageMessages=t(r),this._stateProps.pageMessages=e.pageMessages,this._stateProps.httpMessages=e.httpMessages,o?.forEach((t=>{t.errorDetails&&(e.errorDetails=e.errorDetails?e.errorDetails.push(...t.errorDetails):t.errorDetails,this._stateProps.errorDetails=e.errorDetails),t.correlationID&&(e.correlationID=t.correlationID)}))}}if(e.loadingInfo=this.getLoadingStatus(this.getContextName()),e.isAppOffline=aC(Gs.APP.APP).context_data?.isOffline,e.assignmentNames=this.getCaseInfo().getAssignments()?.map((e=>e.name)),e.childAssignmentNames=this.getCaseInfo().getChildAssignments()?.map((e=>e.name)),n===Gs.MODAL_VIEW_CONTAINER){const t=e.routingInfo?.accessedOrder||[],n=t[t.length-1];n&&(e.loadingInfo=this.getLoadingStatus(n))}this._stateProps.loadingInfo=e.loadingInfo,this._stateProps.isAppOffline=e.isAppOffline,this._stateProps.assignmentNames=e.assignmentNames,this._stateProps.childAssignmentNames=e.childAssignmentNames}else s.template===Gs.CASE_VIEW||s.template===Gs.RULE_VIEW||s.template===Gs.SELF_SERVICE_CASE_VIEW||s.template===Gs.CASE_PREVIEW||s.template===Gs.RULE_PREVIEW||s.template===Gs.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):n===Gs.CASE_STAGES&&(e.stages=this.getCaseStages(),e.stageID=this.getStageID(),this._stateProps.stages=e.stages,this._stateProps.stageID=e.stageID);const r=this.getInheritedProps()?.shouldAutoRefresh;r&&this.meta?.config?.value?.includes("@P")&&void 0===this.meta.config._autoRefresh_&&(this.meta.config._autoRefresh_=`@REFRESH ${this.meta.config?.value.split("@P ")[1]}`),this.populateFieldMetadata(e),this.updateContextTree()}populateFieldMetadata(e){const{value:t,datasource:n,listType:s}=this.getComponentConfig(),{propertyValue:a,propertyAnnotation:r}=this.getPropertyDetails(s,n,t);if(a&&"string"==typeof a&&(a.includes(r)||a.includes(Gs.ATTACHMENT_ANNOTATION))){const t=Ro.getPropertyName(a),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=YA(`${this._pageReference}.${t}`,this._contextName);if(e?.additionalInformation&&this.setStateProps({additionalInformation:n}),!Array.isArray(e)){e.additionalInformation=n;const{inputFormat:t}=e;if("string"==typeof t&&t.startsWith("@")){const n=Ro.handleAnnotation(t,this);"object"==typeof n&&null!==n&&"pattern"in n&&"string"==typeof n.pattern?e.inputFormat={pattern:n.pattern}:e.inputFormat=null}}return e}getFieldMetadata(e){if(!e)return null;const t=e.split(".");if(t.length<2){let t=this.getValue(Gs.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata(SA(e,t),e)}const n=t.pop(),s=t.join(".")?".":"";let a=this.getValue(`${s}${t.join(".")}${Gs.CLASS_ID}`);return a||(a=AC.resolvePageClass(e,this.getCurrentClassID())),this.resolvePropertyMetadata(SA(n,a),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata(SA(n,this.getValue(`${t.join(".")}${Gs.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(Gs.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[Gs.getProperty($s.CASE_INFO.CASE_INFO)]};return e.CaseID=e.CaseID||this.getValue(Gs.getProperty($s.CASE_INFO.CASE_INFO_PZINSKEY)),{...e,isCaseWideAction:()=>gI(this.getContextName(),this.getPageReference())}}getReferencedUser(e){const t=this.getValue("referencedUsers");if(Array.isArray(t)){const n=t.find((t=>t.UserID===e));if(n)return{userId:n.UserID,UserName:n.UserName}}return t&&t[e]?t[e]:null}getCaseStages(){return this.getDataObject()[$s.CASE_INFO.CASE_INFO].stages}getStageID(){return this.getDataObject()[$s.CASE_INFO.CASE_INFO].stageID}getActions(){return this._actions}isRoot(){return this._isRoot}getRelativePath(){return this._relativePath}resolveContextProps(e){const{value:t}=this.getStateProps();t&&(e.error=this.getContextDataValue(`${this.getPageReference()+t}.error`),e.validatemessage=this.getContextDataValue(`${this.getPageReference()+t}.validatemessage`))}isValidatorExist(){return!!this._isValidatorExist}getValidationApi(){return new rg(this)}isEditable(){return!(!this._rawConfig||!this._rawConfig.config||this._inheritedConfig&&this._inheritedConfig.readOnly||!(Object.hasOwn(this._rawConfig.config,"value")||this._rawConfig.config.selectionList||"Editable"===this._rawConfig.config.renderMode&&this._rawConfig.config.referenceList)||"string"==typeof this._rawConfig.config?.value&&this._rawConfig.config.value.includes("@FILTERED_LIST")||Object.hasOwn(this._rawConfig.config,"readOnly")&&("true"===this._rawConfig.config.readOnly||!0===this._rawConfig.config.readOnly)||Object.hasOwn(this._rawConfig.config,"disabled")&&!0===this._rawConfig.config.disabled)}isVisible(){return this._rawConfig?.config&&Object.hasOwn(this._rawConfig?.config,"visibility")&&"string"==typeof this._rawConfig?.config?.visibility?Ro.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||Ro.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&!0===Ro.handleAnnotation(this._readOnly,this))}hasChildren(){return!!this._children}getComputedVisibility(e=[]){const t="reference"===this._type&&!!this.getReferencedView(),n=t?this.getReferencedViewPConnect().getPConnect():this;if(t){const t=`${this.getRawMetadata()?.config?.name}!${this._ruleClass}`;if(e.includes(t))return!1;e.push(t)}if(!1===this.getConfigProps().visibility)return!1;if(!1===n.getConfigProps().requiresVisibleChildren||!1===this.getConfigProps().requiresVisibleChildren)return!0;const s=n.getConfigProps(),a={includeTypes:["Group","Region","View"],excludeTemplates:["ListView","SimpleTable","StudioTable"]};let r=n._type&&a.includeTypes.includes(n._type)&&!a.excludeTemplates.includes(s.template);if(!!s.highlightedData&&s.highlightedData.length&&s.showHighlightedData&&(r=!1),!r)return!0;const o=n.getChildren();return!!o&&o.some((t=>t.getPConnect().getComputedVisibility(e)))}getChildrenIterator(){return this._children.setContext(this.getPageReference()),this._children}setAction(e,t){this._actions[e]=t}getComponentName(){return this._rawConfig&&this._rawConfig.type}isComponentRefreshable(){return!(!this._rawConfig||!this._rawConfig.isRefreshable)}getDataObject(e){return aC(e||this.getContextName())}getImagePath(e){return`${Lp.getConstellationServiceUrl()}/v860/${Lp.getAppAlias()}/image/${e}?org=${By.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=this.options?.inheritedProps?.find((e=>"shouldAutoRefresh"===e?.prop));e&&(this._inheritedConfig._inheritedProps=[...this._inheritedConfig._inheritedProps||[],e]);const t=bf(this._rawConfig,{pageReference:this._pageReference,context:this._contextName,localeReference:this._localeRuleName,hasForm:this.options.hasForm,isBulkAction:this.options.isBulkAction,containerName:this.getContainerName(),containerItemName:this.options.containerItemName,viewName:this.viewName,inheritedConfig:this._inheritedConfig,target:this._containerTarget,readOnly:this._readOnly,categoryName:"Group"===this._type?this._rawConfig?.config?.id:null,relativePath:this._relativePath}),n=[];for(;t?.hasNext();){const e=t.next();this.isBulkAction()&&this.#l(e)||n.push(e)}return t?.resetIndex(),n}return[]}setInheritedProp(e,t){this._inheritedConfig[e]=t}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const s=n||this.getLocaleRuleName(),a=s&&t?`${s}#${t}`:s,r=this.getLocalizationService(a).getLocalizedText(e);return r===e?this.getLocalizationService().getLocalizedText(e):r}getLocaleRuleNameFromKeys(e,t,n){return`${e}!${t}!${n}`}getValue(e,t){return e=e?.replace(/\((\d+)\)/g,((e,t)=>`[${parseInt(t,10)-1}]`)),this.useCustomContext?(e=e.startsWith?.(".")?e.substring(1):e,e.split?.(".").reduce(((e,t)=>e?.[t]??void 0),this.useCustomContext)):this._hasSuggestions&&this.getStateProps()?.value===e?NC.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${Gs.SUGGESTION}`):NC.getPropertyValue(e,t||this.getPageReference(),this._contextName)}setInheritedConfig(e){if(!e)return;const{readOnly:t,displayMode:n,referenceType:s,hideLabel:a}=e;a&&(this._inheritedConfig.hideLabel=a),s&&(this._inheritedConfig.referenceType=s),n&&(this._inheritedConfig.displayMode=n),(this._inheritedConfig.readOnly||t)&&(this._inheritedConfig.readOnly=t),e.inheritedProps&&(e.inheritedProps?.forEach((e=>{"required"===e.prop&&(this._inheritedConfig[e.prop]=e.value)})),Lf(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),NC.resolveProps(t,e,this),e}setValue(e,t,n,s=!1,a={}){if(!AC.isValidPropertyReference(e))return;let r,o;const{isArrayDeepMerge:i}=a;this.isInsideList()&&this.getListActions().updateProperty(e,t),this.isBulkAction()&&(r=!0,t||(o=!0)),sC({type:"SET_PROPERTY",payload:{reference:NC.getContextPath(this.getPageReference(),e),value:t,initialValue:n,isImplicit:s,context:this.getContextName(),...void 0!==i&&{isArrayDeepMerge:i},...r&&{isStrictTracking:r},...o&&{removePropertyFromChangedList:o}}})}updateDirtyCheckChangeList(e,t){const n={reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()};_E(n)}getContextDataValue(e,t){return cC(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(Gs.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let s=Gs.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(s=n>0?this._pageReference.substring(n):this._pageReference),sC(vC({context:this._contextName,data:e,rootPageReference:s}))}replaceState(e,t,n={}){if(!AC.isValidPropertyReference(e))return;const{skipDirtyValidation:s=!1}=n;sC({type:"REPLACE_PROPERTY",payload:{reference:NC.getContextPath(this.getPageReference(),e),value:t,context:this.getContextName(),skipDirtyValidation:s}})}reportError(e,t,n){sC(rS(e,t||{},n,t?.formFields))}getComponent(){return wf({getPConnect:()=>this})}createComponent(e,t,n,s){let a=this._pageReference;if(t){const e=lC(`${this.getPageReference()}.${Gs.SUMMARY_OF_LISTS}`,t,this._contextName);a=NC.getContextPath(e||t,n)||t}else if(s&&s.pageReference){let e=s.pageReference;e=Ro.handleAnnotation(e,this),a=NC.getContextPath(this._pageReference,e)||""}return wf(Ff({meta:e,index:this.index,options:{containerName:this.getContainerName(),hasForm:this.options.hasForm,...e.options,pageReference:a,context:this._contextName,target:this._containerTarget,readOnly:this._readOnly||this._inheritedConfig?.readOnly,viewName:this.viewName},useCustomContext:this.useCustomContext}),s)}getReferencedView(){if(this.meta)return NC.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(Gs.CLASS_ANNOTATION)?this.getPageReference():`${this.getPageReference()}${e}`}getReferencedViewPConnect(e=!1){const t={...this.getComponentConfig()},n=this.options?.inheritedConfig?._inheritedProps?.find((e=>"shouldAutoRefresh"===e.prop));return n&&!t?.inheritedProps?.some((e=>"shouldAutoRefresh"===e.prop))&&t?.inheritedProps?.push(n),delete t?.name,delete t?.type,Ff({meta:this.getReferencedView(),options:{...e?this.options:void 0,...t,context:this.getContextName(),pageReference:t.context?this._resolvePageRef(t.context):this.getPageReference(),viewName:this.viewName}})}getContainerManager(){return new Ig(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new tf(this)),this._actionsApi}getActionManager(){return zp}doesContextExist(e){return EC(e??this.getContextName())}getGoogleMapsAPIKey(){return gn()}getServerURL(){return un()}getLoadingStatus(e){let t=null;return e?(t=aC(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?Du({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName(),...e.subType&&{subType:e.subType}}):e?.context?Du({type:"error",...e}):(Du({type:"error",...e,context:Gs.APP.APP}),Du({type:"error",...e,context:YE(`${Gs.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return lC(`${this.getPageReference()}.${Gs.SUMMARY_OF_LISTS}`,e,this.getContextName())||e}removeFormField(){}addFormField(){}setPageValue(e,t,n){delete e?.classID,this.replaceState(t,e),n?((e,t,n)=>{const s=(e,t)=>{Object.entries(e).forEach((([e,a])=>{if(Array.isArray(a)){const s=PCore.createPConnect({options:{pageReference:n.getPageReference(),context:n.getContextName(),referenceList:`${t}.${e}`}}).getPConnect();Yd(s,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<a.length;e+=1)kd(a[e],e,s,void 0,{})}else"object"==typeof a&&s(a,`${t}.${e}`)}))};s(e,t)})(e,t,this):Qm(this.getContextName(),`${this.getPageReference()}${t}`,this.getStateProps()?.value??"")}acceptSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=of.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,s=NC.getContextPath(this.getPageReference(),n),a=t.getField(s);this._hasSuggestions=!1,this.getActionsApi().updateFieldValue(n,a),this.getActionsApi().triggerFieldChange(n,a),t.removeField(s,{actionPerformed:"accepted"})}}ignoreSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=this.getStateProps()?.value||e,n=NC.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,of.getSuggestionsContext(this.getContextName()).removeField(n,{actionPerformed:"ignored"});const s=To.getDependencies(this._contextName,n);s?.forEach((e=>{of.getSuggestionsContext(this.getContextName()).removeField(e,{actionPerformed:"ignored"})}))}}getSelfReferencingDatapageKeys(){const e=[],t=this.getPropertyName(),n=this.getFieldMetadata(t),{datasource:{parameters:s={}}={}}=n||{};return Object.values(s).forEach((n=>{const[,s]=n.split("."),a=t?.split(".").pop();s===a&&e.push(n.substring(n.lastIndexOf(".")+1))})),e}isReadOnlyField(){const{value:e,datasource:t,listType:n}=this.getComponentConfig(),{propertyValue:s,propertyAnnotation:a}=this.getPropertyDetails(n,t,e);if(!s||"string"!=typeof s||!s.includes(a)&&!s.includes(Gs.ATTACHMENT_ANNOTATION))return!1;const r=Ro.getPropertyName(s),o=this.getFieldMetadata(r);if(!o)return!1;const i={...this.getComponentConfig(),fieldMetadata:o,template:this._rawConfig?.config?.template};return this.#u(i,r)}#u(e,t){const n=hg.isPropertyInternal(t),s=e.datasource,a=this.getComponentConfig().isSearchField,{isClassKey:r,isSpecial:o,isDeclarativeTarget:i}=e.fieldMetadata??{},c="DataReference"===e.template||"ObjectReference"===this.meta?.type,l=e.listType!==Gs.ASSOCIATED;return!a&&!!(i||n||!s&&(r&&!c||o)&&l)}getPropertyDetails(e,t,n){return e===Gs.ASSOCIATED?{propertyValue:t,propertyAnnotation:Gs.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:Gs.PROPERTY_ANNOTATION}}updateConfigData(e,t,n){e.fieldMetadata=t,t.additionalInformation&&(e.additionalInformation=t?.additionalInformation),t.inputFormat&&"string"!=typeof t.inputFormat&&(e.inputFormat=t.inputFormat),this.#u(e,n)&&(e.readOnly=!0,this._stateProps.readOnly=e.readOnly,e.fieldMetadata.isDeclarativeTarget&&this.registerAdditionalProps({readOnly:!0})),e.fieldMetadata?.isReadOnly&&(e.readOnly=!0,this.registerAdditionalProps({readOnly:!0}))}#l(e){const t=e.getPConnect().getComponentName(),n=e.getPConnect().getConfigProps().template;return!(!0===vf.allowedComponetsForBulkProcessing[t]||!0===vf.allowedComponetsForBulkProcessing[t]?.[n])}}function Ff(e){const t=new Uf(e);return{getPConnect:()=>t}}function Vf(e){wf=e}const jf={CASE_INFO:`${Gs.DATA}.${Gs.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${Gs.DATA}.${Gs.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${Gs.DATA}.${Gs.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${Gs.DATA}.${Gs.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${Gs.DATA}.${Gs.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${Gs.DATA}.${Gs.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${Gs.DATA}.${Gs.CASE_INFO.ASSIGNMENT_ID}`},kf=(e,t)=>{const{vcName:n,containerName:s}=t;return s||n||Kp.getTargetViewContainerName(e)},Bf=e=>{const t=e.lastIndexOf(Gs.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(Gs.UNDERSCORE_STRING);return e.substring(t,n)},$f=e=>e===xE.WORKAREA,Gf=e=>e===xE.MODAL,Wf=e=>e===$a,Hf=e=>e===ba,qf=e=>e&&e.find((e=>e.type===ba)),zf=e=>AC.getIn(e,jf.CASE_INFO,{}),Yf=e=>e?e.split(" ").pop():void 0,Kf=e=>AC.getIn(e,jf.CASE_CLASS_NAME,Gs.EMPTY_STRING),Qf=(e,t=!1)=>{const n=t?ng(e):zf(e);return dI(n)&&pI(Gy.getOperatorIdentifier(),n)},Jf=e=>AC.getIn(e,jf.CASE_INFO_ID,Gs.EMPTY_STRING),Xf=e=>AC.getIn(e,jf.CASE_FIRST_ASSIGNMENT_ID,Gs.EMPTY_STRING),Zf=(e,t)=>{const{removeActionPayload:n,target:s}=t;if(n&&n.containerItemID){const{containerItemID:t,context:a}=n;e.push(aS(JC,{containerItemID:t,context:a||JE(t),target:s}))}},em=e=>{const t=e.context;if(lI.shouldUseUnifiedHandling()){const e=py(t),{accessedOrder:n=[],type:s}=LE(e),a=n.filter((e=>e!==t));sC(JC({containerItemID:t,context:t,target:e,containerInfo:{newAccessedOrder:a,containerType:s}}))}else gy(t,{skipDirtyCheck:!0})},tm=e=>{const t=nC();if(!e)return!1;const n=Ks(e),s=py(n),a=py(e);if(!s||!a)return!1;const r=FE(s,n),o=FE(a,e);if(!r||!o)return!1;const{key:i}=r||{};let{key:c}=o||{};return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),i&&c&&i===c},nm=(e,t,n={})=>{const{skipFlowNameUpdate:s}=n,a=Jf(t);AC.setIn(e,"key",a);const r=dI(zf(t));if(!s&&(e=>{const t=AC.getIn(e,jf.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=Xf(t),[,s]=n.split("!");(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,e)})({assignmentID:n,isInCreateStage:r}),AC.setIn(e,"flowName",s)}},sm=(e,t)=>{const{attachmentsExist:n}=t;n&&AC.setIn(e,$s.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),AC.setIn(e,$s.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},am=(e,t,n)=>{let s=Gs.PROMISE_VALUE.RESOLVE;return qf(e)?(s=Gs.PROMISE_VALUE.REJECT,n?zp.rejectActionByID(t,!0,n):zp.rejectActionByID(t)):zp.resolveActionByID(t),s},rm=e=>{if(!e)return!1;const t=Gy.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},om=()=>"true"===Gy?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,im=(e,t,n,s)=>{const{containerItemID:a}=t;if(a){const{caseClassName:r,skipAssignmentsUpdate:o}=s,i=Ks(a),c=py(i),l=c&&LE(c),u=c&&YE(c),d=Zs(i),p=n?.data?.caseInfo?.ID;u&&l?.items?.[u]?.key===t?.caseID&&e.push(aS(wC,{containerItemID:i,context:i,container:d,containerName:d,caseId:p,viewName:Gs.getDefaultQualifiedName($s.CASESUMMARY_VIEW_NAME),updateData:!0,viewLoadingContainer:{context:i},caseClassName:r,...void 0!==o&&{skipAssignmentsUpdate:o}}))}},cm=async(e,t)=>{const{context:n,containerItemID:s,shouldUpdateCaseActionsInParentContext:a}=e,r=t?.data?.caseInfo?.ID?Jf(t):void 0;if(!n||!r)return;const o=r?`${r}_actionsLoading`:"actionsLoading";try{const i=new Uf({}),c=new nf(i);Hp.setComponentCache(o,!0);const l=t?.data?.caseInfo?.caseTypeID?Kf(t):void 0,u=await c.getCaseActions(r,n,{caseTypeID:l});Af(t);const d=AC.getIn(t.data,Gs.getProperty(Gs.CASE_INFO.CASE_INFO_ACTIONS)),p=Array.isArray(u.availableProcesses)&&u.availableProcesses.length>0?{availableProcesses:u.availableProcesses}:[],g=u?.availableActions,h=["pyUpdateCaseDetails"],f=Array.isArray(g)&&g.find((e=>h.includes(e.ID))),m={data:{caseInfo:{availableActions:[...u.availableActions,...void 0!==d?d:[]],...p,editActions:f?[f]:[]}}};Hp.setComponentCache(o,!1),sC(aS(vC,{context:n,...m})),!0===a&&s&&(async(e,t)=>{const{containerItemID:n,caseID:s}=t;if(n){const t=Ks(n),a=py(t),r=a&&LE(a),o=a&&YE(a);o&&r?.items?.[o]?.key===s&&sC(aS(vC,{context:t,...e}))}})(m,e)}catch(e){Hp.setComponentCache(o,!1),console.error("Error fetching case actions:",e)}},lm=(e,t)=>{const n=Kf(e?.response),s=zf(e?.response),{caseTypeID:a}=s,r=Gy.getFeatureMap();(r?.deferUpdateCaseSummaryView??!Object.hasOwn(r,Gs.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&im(t,e?.actionInPayload,e?.response,{caseClassName:n,skipAssignmentsUpdate:!e?.actionInPayload?.context?.includes(Gs.PREVIEW)})},um=()=>Gy.isOptimizedCaseLoadingEnabled(),dm=(e,t)=>{um()&&cm(t,e)},pm=e=>aC(e)?.context_data?.caseViewMode,gm=e=>!(!Hp.getComponentCache("redirectionInProgress")||!e)&&(am([],e),!0);const hm=new class{confirmHandler=null;registerConfirmHandler(e){this.confirmHandler=e||null}confirm(e){return this.confirmHandler?this.confirmHandler(e):Promise.resolve(window.confirm(e))}},fm=hm,{RESOURCE_TYPES:mm}=$s,Im={PAGE:"page",FORM:"form"},Em={[mm.CASE]:[tr,Za,er],[mm.OBJECT]:[jr,kr,$r],[mm.PAGE]:[Ka,Ja],[mm.DATA]:[Qa],ASSIGNMENT:[dr]},ym=(e,t,n={})=>{if(!e)return{};const s={etag:e.etag},{RemoteSystemID:a}=n;return e[$s.REMOTE_SYSTEM_ID]||e[$s.REMOTE_SYSTEM_ID.toLowerCase()]||a?s.RemoteSystemID=e[$s.REMOTE_SYSTEM_ID]||e[$s.REMOTE_SYSTEM_ID.toLowerCase()]||a:t&&qs.isRemoteCase(t)&&(s.RemoteSystemID=qs.getRemoteHeader(t)),s},Am=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:s=!1,skipUUID:a=!0,isTransientContext:r=!1,includeDisabledFields:o=!1,isObjectWideAction:i,isExternalObject:c}=t;let l={};l=nI(e,{isTransientContext:r,includeDisabledFields:o,isObjectWideAction:i,isExternalObject:c}),n&&(delete l?.caseInfo?.content,r&&(l={}));const u=mE(e,!1),d=aC(e),p=Gn(d,Gs.CASE_INFO.CASE_INFO_ENCRYPTED_CONTENT),g=void 0!==p;!r&&s&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,s])=>{const a=aC(t),r=Gn(a,$s.CASE_INFO.CASE_INFO_CLASSID),o=SA(n,r);("True-False"===o?.type&&!s||""===s)&&delete e.caseInfo.content[n]}))})(l,e);const h=Us(u,l);let f={};({content:f}=((e,t,n=!1,s=!1)=>{let a={};const r=lI.shouldUseUnifiedHandling()||!n&&!s?t?.caseInfo:t?.objectInfo;return(e||r)&&(a=e?{...t}:{...r}),{content:a}})(r,h,i,c));const m=[...Fd(e)];if(a){const e=ks.getDefaultQualifiedName("EmbedListUUID__");m.forEach((t=>{delete t.content?.EmbedListUUID__,delete t.content?.[e]}))}f.pageInstructions=m;if((vd[e]||[]).forEach((e=>{if(f?.content){const t=e?.replace(Gs.getProperty(Gs.CASE_INFO.CASE_INFO_CONTENT),"");AC.deleteIn(f.content,(e=>{if(!e)return"";const t=e.split(".");let n,s="";for(n of t)if(n){if(n.includes("[")&&n.includes("]"))return s+=`['${n.substring(0,n.lastIndexOf("["))}']`,s;s+=`['${n}']`}return s})(t))}})),g&&(f.encryptedContent=p),!r&&h?.dataInfo)return f={...h.dataInfo,pageInstructions:f.pageInstructions},{content:f};const I=iC(ks.getQualifiedNameForComplexRuleReferences(".pzAdditionalPayload"),Gs.CASE_INFO.CASE_INFO_CONTENT,e);return f.content&&I&&(f.content[ks.getDefaultQualifiedName("pzAdditionalPayload")]=I),{content:f}},Cm=(e,t)=>{let n,s,a={};const r=AC.getIn(e,Gs.UI_RESOURCES),o=AC.getIn(e,"confirmationNote");r?(n=AC.getIn(e,Gs.UI_RESOURCES_CONTEXT_DATA),s=AC.getIn(e,Gs.ROOT),a=AC.getIn(e,Gs.ACTION_BUTTONS)):o&&!t.isActiveWorkAreaPrimaryAndWorkareaAbsent&&(s={});const{data:i={},Errors:c,flowName:l}=e;let{semanticURL:u,key:d}=e;const p=i?.objectInfo?.ID;p&&(d=d||p,u=u||`objects/${p}`);const g=AC.getIn(e,"nextAssignmentInfo",null),h=AC.getIn(e,"nextAssignmentInfo.context",""),f=AC.getIn(e,"confirmationLinks",null),{isInCreateStage:m,openCaseViewAfterCreate:I,debugInfo:E,isExternalObjectCreationFlow:y,isExternalCaseCreationFlow:A}=t;return{data:{...i,key:d,flowName:l,coreHeaders:E&&{debugInfo:{[Gs.COREHEADER_APP_DEBUG_ID]:E.debugId}},[Gs.getProperty(Gs.CASE_INFO.CASE_INFO)]:{...i[Gs.getProperty(Gs.CASE_INFO.CASE_INFO)],actionButtons:a,headers:t.headers},[Gs.CONTEXT_DATA]:m?{...i[Gs.CONTEXT_DATA],...n,openCaseViewAfterCreate:I,errors:c,...y&&{isExternalObjectCreationFlow:y},...A&&{isExternalCaseCreationFlow:A}}:{...i[Gs.CONTEXT_DATA],...n,errors:c}},semanticURL:u,nextAssignmentInfo:g,assignmentContext:h,confirmationLinks:f,key:d,root:s,...t}},Sm=async(e,t,n,s=!1,a=!1)=>{const r=AC.getIn(e,Gs.COMPONENTS);if(r)try{await Vp(r)}catch(e){console.error(e)}const o={actionConfig:t,...n};s?vS({...e,options:o,directUrlUpdation:!0}):Ip(e,o,a)},_m=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},Nm=e=>{if(e){const[,t]=e.split("!");return{key:_m(e),flowName:t}}return{}},Tm=(e,t,n,s)=>{switch(!0){case Boolean(e[Gs.ERROR_IN_PAGE_IDENTIFIER]&&e[Gs.ERROR_FIELD_IN_PAGE]):{const a=`${e[Gs.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),r=`${a}${e[Gs.ERROR_IN_PAGE_IDENTIFIER]}`,o=AC.deepClone(e);o[Gs.ERROR_FIELD_IN_PAGE]=a,t.includes(r.slice(1))||t.includes(r.substring(r.indexOf(".")+1,r.indexOf("[")))||t.includes(r.substring(r.indexOf(".")+1,r.indexOf("(")))?s.push(o):n.push(e);break}case Boolean(e[Gs.ERROR_IN_PAGE_IDENTIFIER]&&!e[Gs.ERROR_FIELD_IN_PAGE]):{const a=e[Gs.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(a)?s.push(e):n.push(e);break}default:n.push(e)}},Dm=e=>{const{payload:t}=e,{err:n,context:s,actionMgrID:a}=t,r=n&&n.response?n.response.data:"",o=oI(s);return a&&zp.rejectActionByID(a,!0,n),aS(rS,"Error action triggered",r,s,o)},Pm=(e,t)=>sy(e)&&ry(e)?aS(eS,t):aS(jC,t),Om=(e,t,n=Gs.APP.APP,s={})=>{let a=null;const{buildNew:r=!0}=s;return sy(e)?a=ry(e)?YE(e):Qs(t,n):ay(e)&&(ry(e)&&!r?a=XE(e):ry(e)&&!r||(a=Qs(t,n))),a},Rm=e=>e&&e.type===wa,bm=e=>{let t=!1;const n=ty(e);for(let e=0;e<n.length;e+=1){const s=n[e];if(s&&NE(s)){t=!0;break}}return t},vm=async(e,t={})=>{let n=!1,s=!1,a={},r=!0,o=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:u=!1,loadingContext:d}=t,p=Yy();if(sy(e)){const t=YE(e);if(!t)return{continueExecution:r,removeActionPayload:a};const s=JE(t);NE(s)&&(n=!0),u||n||(n=bm(t))}else if(ay(e)&&cy(e)){let t=dy(e);t||(t=YE(e),s=!0),a.containerItemID=t,a.context=JE(t)}if(n){const t={context:d||e};qp.disableLoadingIndicator(t);const n=l||hE;o=await fm.confirm(p.getLocaleValue(n,"Messages")),qp.enableLoadingIndicator(t)}if(!o&&n&&(a={},r=!1),s){const t={context:d||e};qp.disableLoadingIndicator(t);const n=p.getLocaleValue(fE,"Messages");c?i=await fm.confirm(n):(await fm.confirm(n),r=!1),qp.enableLoadingIndicator(t)}return!i&&s&&(a={},r=!1),{continueExecution:r,removeActionPayload:a}},xm=(e,t)=>{let n=!1;const s=Gy.isCoexistenceAppOfType(Gs.APP_TYPE.UIKIT),{insKey:a,isParallelCall:r,skipFlowNameCheck:o}=t;if(!a)return{};const[,i]=a.split("!")||"",c=o?a:_m(a),l=GE(e,c);let u={},d=!1;if(l&&!s&&((e,t)=>{const n=FE(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,u=FE(e,l),!o)){let e=u?.flowName;const t=Bf(l),s=ZE(l);if(s.length){const n=((e,t)=>e?.includes(Gs.WORKAREA)?Gs.WORKAREA:t)(s[0],t),a=Wr(n,s[0]);e=FE(a,s[0])?.flowName}else n=e===i;(e!==i||r)&&(d=!0)}return n=((e,t)=>!t&&e)(n,t.forceRefresh),{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:d,containerItemID:l,semanticURL:u.semanticURL,insKey:a}}},wm=(e,t,n)=>e===mm.PAGE?((e,t={})=>{let n=!1;const{semanticURL:s}=t,a=GE(e,s);return a&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:a,semanticURL:s}}})(t,n):e===mm.ASSIGNMENT?xm(t,{...n,type:e}):e===mm.CASE||e===mm.OBJECT?xm(t,{...n,skipFlowNameCheck:!0,type:e}):{},Mm=e=>{if(e){const t=(e=>{const t=VE(e);if(!t)return null;for(const[e,n]of Object.entries(t))if(!n.key&&n.resourceType===$s.PAGE)return e;return null})(e);if(t)return{activate:!0,activateContainerActionPayload:{target:e,containerItemID:t,semanticURL:""}}}return{activate:!1}},Lm=(e,t,n)=>{const{semanticURL:s,isDefaultNavPage:a}=((e,t)=>{const n=CS(Ka,{page:e,pageClass:t}),s=nC()?.getState()?.data?.app?.pyPortal?.pyPrimaryNavPages,a=Array.isArray(s)?s[0]:void 0;return{semanticURL:n,isDefaultNavPage:!(a?.pyRuleName!==e||a?.pyClassName!==t)}})(e,t);if(n&&s&&!a){const e=wm(mm.PAGE,n,{semanticURL:s});if(e.activate)return{semanticURL:s,activate:!0,activateContainerActionPayload:e.activateContainerActionPayload}}if(a){const e=Mm(n);return e.activate?{semanticURL:s,...e}:{semanticURL:"",activate:!1}}return{semanticURL:s,activate:!1}},Um=(e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e),Fm=(e=[])=>{ry(`${Gs.APP.APP}/${Gs.PREVIEW}`)&&e.push(aS(VC,ly({context:$s.APP.APP,name:Gs.PREVIEW})))},Vm=e=>{let t;for(const n of Object.keys(Em))if(Em[n].includes(e)){t=n;break}return t},jm=(e,t,n="",s={})=>{const{data:a={},context:r,caseViewMode:o,skipMergeAssignmentsAndActions:i=!0}=e,c={data:{...a},caseViewMode:o,context:Ks(r)};AC.deleteIn(c.data,"shared"),AC.setIn(c.data,["context_data","caseViewMode"],o),t.push({type:yr,payload:{context:c.context,skipMergeAssignmentsAndActions:i}});const l=n&&![$s.CASE_INFO.CASE_INFO_CONTENT,$s.DATA_INFO.DATA_INFO_CONTENT].includes(n),{propertiesToReplace:u=[]}=s;t.push(aS(vC,{...c,...l&&{uiRootReference:n}},...u.length>0?[{propertiesToReplace:u}]:[]))},km=e=>{if(Array.isArray(e)&&e.length>0){const t=(e=>{const t=e[0];for(const t of e)if("other"===t?.payload?.nextAssignmentInfo?.context||"remote"===t?.payload?.nextAssignmentInfo?.context)return t;return t})(e),n=AC.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const s=AC.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:AC.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:AC.getIn(t,["payload","context"]),context:AC.getIn(t,["payload","context"])},s={type:Ca,payload:{...n}};e.push(s),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),sC(e),e=e.filter((e=>e.type!==Ca))}const a=((e,t,n)=>({assignmentID:e,vcName:Gs.PRIMARY,targetContainerName:AC.getIn(t,["payload","target"]),context:AC.getIn(t,["payload","context"]),..."other"===n&&{isChild:!0},isProcessAction:t?.payload?.isProcessAction,..."remote"===n&&{isRemote:!0},..."remote"===n&&{remoteClassName:t.payload.nextAssignmentInfo.className}}))(s,t,n);sy(a.targetContainerName)||t?.payload?.containerName!==Gs.WORKAREA||(a.isMultiDoc=!0,e=[]);const r={type:Sa,payload:{...a}};e.push(r),sC(e)}else sC(e)}},Bm=(e,t)=>Us(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),$m=e=>{let t={},n=wy(e);for(;n;){const e=Am(n);t=Bm(e.content,t),n=wy(n)}return t},Gm=e=>{e?.containerItemID&&of.updateState(e.containerItemID,"traditionalGadgetId",lI.getUniqueGadgetId(),{skipDirtyValidation:!0})};class Wm{static getChanges(e){return{...mE(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:s=!1,onlyChangedData:a=!1}=t||{},{content:r}=Am(e,{isTransientContext:n,includeDisabledFields:s,onlyChangedData:a});return r}static isStateModified(e){return NE(e)}static hasUnsavedChanges(e){return NE(e)||zd(e??null)}static resetComplexObjectDirtyStatus(e){return AE(e)}static isFormValid(e,t){return aI(e,t)}static clearChangedProperties(e){return Vd(e),Ud(e),DE(e)}static getEditableFields(e){return iI(e)}static setCustomValidator(e,t){hp.register(e,t)}static isPropertyEditable(e,t){return Wm.getEditableFields(e).some((e=>e.name===t))}}const Hm=Wm;const qm=new class{constructor(){this.states={},this.unConnectedStates={}}getStateMachine(e,t,n){return this.states?.[e]?.[`${t}${n}`]||this.unConnectedStates?.[e]?.[`${t}${n}`]}getAllStateMachines(e,t,n){return{states:this.states?.[e]?.[`${t}${n}`],unConnectedStates:this.unConnectedStates?.[e]?.[`${t}${n}`]}}getAllStateMachinesByContext(e){return{states:this.states?.[e],unConnectedStates:this.unConnectedStates?.[e]}}isStateMachineExist(e,t,n){return!!this.states?.[e]?.[`${t}${n}`]||!!this.unConnectedStates?.[e]?.[`${t}${n}`]}getUnConnectedStateMachines(e){return this.unConnectedStates?.[e]}setStateMachine(e,t,n,s){const a=`${n}${t}`,{stateMachine:r}=this.getStateMachineObjByPath(a,e,!0,!0),o=(t,n,s=!1)=>{const a=s?this.states:this.unConnectedStates;a[e]||(a[e]={}),a[e][t]||(a[e][t]={}),a[e][t]=n};if(r&&r.targetPageReference!==s.targetPageReference)return r.addChild(s),void o(a,s);const i=Object.entries(this.states[e]||{}).filter((([e])=>{if(e.includes(a)){const t=e.substring(0,a.length).length;return e.substring(t).startsWith("[")||e.substring(t).startsWith(".")}return!1})).reduce(((e,[t,n])=>({...e,[t]:n})),{});Object.keys(i)?.length?(Object.entries(i).forEach((([t,n])=>{delete this.states[e][t],s.addChild(n),o(t,n)})),this.states[e][a]=s):o(a,s,!0)}buildPageInstructionsByContext(e,t){const n=this.getStateMachinesByContext(e)||{},s=[];return Object.keys(n).sort().forEach((a=>{const r=yu.getContextReferences(e)?.get(a),o=r&&NC.resolveContextTreeNodeProps(r.props)||{},i=n[a];if(r&&!0!==o.readOnly){const e=i.buildSubmitPageInstructions(t);s.push(...e)}else if(i.hasEncryptedContent){const e=i.buildSubmitPageInstructions(t).filter((e=>void 0!==e.encryptedContent));s.push(...e)}else r||this.setStateMachineEmpty(e,a)})),s}buildClientChangeList(e){const t=this.getStateMachinesByContext(e)||{};let n={};const s={};return Object.keys(t).forEach((e=>{const s=t[e].getChangeList();n={...n,...s}})),AC.flatten(n,"",s),s}getStateMachinesByContext(e){return e?this.states?.[e]:void 0}clearStateMachines(e){this.states[e]={},this.unConnectedStates[e]={}}setStateMachineEmpty(e,t){const n=this.getStateMachine(e,t,"");n.root=null,n.current=null,n.hasEncryptedContent=!1;const s=this.getUnConnectedStateMachines(e)||{};Object.keys(s).forEach((e=>{e.includes(t)&&delete s[e]}))}removeStateMachine(e,t){delete this.states[e]?.[t]}createStateMachine(e,t){let n=e.substring(0,e.lastIndexOf("["));const s=n.substring(n.lastIndexOf("."));n=n.substring(0,n.lastIndexOf(".")),n&&s&&wd(t,s,n)}getStateMachineObjByPath(e,t,n,s=!1){const a=/\[\d+\]$/gm,r=e;let o;for(;e&&!this.isStateMachineExist(t,"",e);){const i=py(t),c=FE(i,t)||{},l=c?.isPageGroup||c?.subscriptFieldName||"string"==typeof c?.index;if(o=null,n&&e.endsWith("]")){if(o=e.match(a),o=o?.[o.length-1]?.substring(1,o[o.length-1].length-1),[e]=e.split(a),!s&&!this.isStateMachineExist(t,"",e)){this.createStateMachine(r,t);break}}else{if(c?.index&&e.includes(c.index)&&l){const t=e.split(".");o=t[3],e=t.slice(0,3).join(".");break}e=e.substring(0,e.lastIndexOf("."))}}return e?{stateMachineTarget:e,stateMachine:this.getStateMachine(t,"",e),index:o}:{}}executeStateMachine(e,t,n,s=!0,a={}){const{stateMachineTarget:r,index:o}=this.getStateMachineObjByPath(t,e,s);if(!r)return!1;const i=py(e),c=FE(i,e)||{};let[,l]=t.split(r);if(!l)return!1;const u=c?.subscriptFieldName&&t.includes(c?.index)||c?.isPageGroup;null!==o&&([,l]=u?l.split(/(?=\.\w+)/):l.split(/^\[\d+\]/gm));const d={[Ym(l)]:n},p=this.getStateMachine(e,"",r);if(null!==o)if(u){const t=Fd(e);"CREATE"===c?.resourceStatus&&t.forEach((e=>{"UPDATE"!==e.instruction||e.groupIndex!==c.index||e.content[c.subscriptFieldName]||p.update({[c.subscriptFieldName]:c.index},o,a.skipStateUpdate??!0,a)})),p?.update(d,o,a.skipStateUpdate??!0,a)}else p?.update(d,Number(o)+1,a.skipStateUpdate??!0,a);else p?.updatePage(AC.unflatten(d));return!0}setUniqueField(e,t,n){const s=yu.getContextReferences(e)?.get(n)?.props?.uniqueField;s&&(t.content||(t.content={}),t.content[Ym(s)]=crypto.randomUUID())}getBasePageReference(e){return iC($s.DATA_INFO.DATA_INFO_CONTENT,"",e)?$s.DATA_INFO.DATA_INFO_CONTENT:$s.CASE_INFO.CASE_INFO_CONTENT}mergeServerPageInstructions(e,t){t.forEach((t=>{if(t.target){const n=AC.convertClipboardPageToPageRefNotation(t.target),s=`${this.getBasePageReference(e)}${n}`;if(!this.isStateMachineExist(e,s,"")){const t=s.substring(s.lastIndexOf(".")),n=s.substring(0,s.lastIndexOf("."));wd(e,t,n)}const a=this.getStateMachine(e,s,"");"INSERT"===t.instruction&&this.setUniqueField(e,t,s),void 0!==t.encryptedContent&&a&&(a.hasEncryptedContent=!0),a?.insertNode(t)}}))}registerForServerChanges(){XA.registerForListChanges(((e,t,n)=>{setTimeout((()=>{this.generatePageInstructions(e,t,n)}),0)}))}registerForServerChangesSync(){XA.registerForListChanges(((e,t,n)=>{this.generatePageInstructions(e,t,n)}))}generatePageInstructions(e,t,n){const s="].";if(!t.includes(".classID")&&Hm.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(s)){const a=t.substring(0,t.lastIndexOf("[")),r=Hm.getEditableFields(e);if(["multiselect","checkbox"].includes(r.find((e=>e.name===a))?.type)){const r=yu.getContextReferences(e),o=r?.get(a),i=t.substring(t.lastIndexOf(s)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}unRegisterForServerChanges(){XA.unRegisterForListChanges()}},zm={},Ym=e=>e.startsWith(".")?e.substring(1):e,Km=e=>{delete zm[e]},Qm=(e,t,n)=>{const s=Ym(t);zm[e]?zm[e].fieldOrder[s]=n:zm[e]={fieldOrder:{[s]:n}}},Jm=(e,t={})=>{const{includeDisabledFields:n=!1}=t,s=NC.resolveContextTreeNodeProps(e),a=!0!==s.readOnly&&!1!==s.visibility&&(n||!0!==s.disabled),r="string"==typeof e?.value&&e?.value.includes("@FILTERED_LIST"),o=(e=>e.selectionList||e.selectionKey||"Editable"===e.renderMode&&e.referenceList)(e);return(e?.value||o)&&!r&&a},Xm=(e,t,n,s,a)=>(qm.executeStateMachine(e,s,NC.getLitePropertyValue(n,t))||a.push(s),a),Zm=(e,t,n)=>{const s=t.isInsideList,{ignoreFieldsInsideList:a=!0}=n;return(!s||s&&!a)&&!Array.isArray(NC.getLitePropertyValue(t,e))&&!(t.componentName&&["Address","Attachment"].includes(t.componentName))},eI=(e,t={})=>{let n=[];const s=[],a=yu.getContextReferences(e);return a?(({editableFormFieldsReferenceList:n}=((e,t,n)=>{const{includeDisabledFields:s=!1}=n;let a=[];for(const[r,o]of e){const e=NC.resolveContextTreeNodeProps(o.props),i=e.propertyName;Jm(o.props,{includeDisabledFields:s})&&Zm(r,e,n)&&(a=Xm(t,i,e,r,a))}return{editableFormFieldsReferenceList:a}})(a,e,t)),zm[e]&&s.push(...Object.keys(zm[e].fieldOrder??{})),{formInputs:n,formPageFields:s}):{formInputs:n,formPageFields:s}},tI=e=>{let t=[];const n=yu.getContextReferences(e);if(n)for(const[e,s]of n){const n=s?.props;if(Jm(n)&&"Attachment"===n?.componentName){const s="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:s,fullPath:e}]}}return t},nI=(e,t={})=>{const n={},s=aC(e),{ignoreFieldsInsideList:a=!0,isTransientContext:r=!1,includeDisabledFields:o=!1,isObjectWideAction:i=!1,isExternalObject:c=!1}=t,l=((e,t,n)=>lI.shouldUseUnifiedHandling()||!e&&!t?n?.caseInfo:n?.objectInfo)(i,c,s);if(r||l){const{formInputs:t,formPageFields:i}=eI(e,{ignoreFieldsInsideList:a,includeDisabledFields:o});((e,t,n)=>{e.forEach((e=>{let s=AC.getIn(t,e);"object"==typeof s&&(s=AC.deepClone(s),delete s?.classID),AC.buildObject(e,n,s)}))})(i,s,n),t&&t.length>0?t.forEach((e=>{AC.buildObject(e,n,AC.getIn(s,e))})):r||AC.buildObject($s.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!r&&s?.dataInfo?.content){const{formInputs:t}=eI(e,{ignoreFieldsInsideList:a});t.forEach((e=>{AC.buildObject(e,n,AC.getIn(s,e))}))}return n},sI=(e,t,n)=>{const s=""===t&&n?.startsWith(".")?n.substring(1,n.length):n,a=yu.getContextReferences(e)?.get(`${t}${s}`)?.props;return a?NC.resolveContextTreeNodeProps(a):a},aI=(e,t)=>{const n=yu.getContextReferences(e);let s=!0;if(!n)return s;for(const[e,a]of n){const n=NC.resolveContextTreeNodeProps(a.props);if(Jm(a.props)&&(!t||e.includes(t))){const e=hp.validate(n.componentName?.toLowerCase(),n.propertyName,NC.getLitePropertyValue(n,n.propertyName),n);s&&(s=!e.message)}}return s},rI=e=>{const t=yu.getContextReferences(e);if(t)for(const[,e]of t){if(NC.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0}return!1},oI=(e,t=!1)=>{const n=yu.getContextReferences(e),s=[];if(n)for(const[e,a]of n){if(!1!==NC.resolveContextTreeNodeProps(a.props).visibility){const n=8,a=t?e:e.substring(e.indexOf("content")+n);s.push(a)}}return s},iI=e=>{const t=[],n=yu.getContextReferences(e);if(n)for(const[e,s]of n){const n=NC.resolveContextTreeNodeProps(s.props);Jm(s.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};class cI{static getCaseInlineEditAction(e){return e?Gy.getInlineEditActions(e):[]}static isCaseActive(e,t){if(!e||!t)return!1;const n=LE(t);if(n){const s=YE(t),{items:a={}}=n;return!(!s||!a[s]||a[s].key!==e)}return!1}static getCaseEditMetadata=(e,t)=>{const n={caseID:e,viewID:ks.getDefaultQualifiedName("pyEdit")},{restApi:s,reqType:a}=_S("loadView",n);return ud(s,{method:a},t)};static isExternalCaseType=e=>{let t;return this.shouldUseUnifiedHandling()?(t=Gy.getCaseTypeList()?.find((t=>t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t):(t=Gy.getCaseTypeList()?.find((t=>"Case"===t.objectType&&t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t)};static getCaseEditLock=(e,t,n)=>{const s={caseID:e,actionID:this.getCaseInlineEditAction(n)[0]??ks.getDefaultQualifiedName("pyUpdateCaseDetails")},{restApi:a,reqType:r}=_S(ir,s);return ud(`${a}?viewType=page`,{method:r},t)};static updateCaseEditFieldsData=(e,t,n,s,a)=>{const r=this.getCaseInlineEditAction(a),o=r.length?r:[ks.getDefaultQualifiedName("pyUpdateCaseDetails")],i=t[e],c=(t,n)=>{const[a,...r]=t;return((t,n)=>{const a={caseID:e,actionID:t},{restApi:r}=_S(ir,a);return ud(`${r}?viewType=form`,{method:"PATCH",body:{content:{...i}},headers:{"if-match":n}},s)})(a,n).then((e=>r.length>0?c(r,e.headers.etag):e))};return c(o,n)};static getCaseMessages=e=>aC(e)?.caseMessages;static getPropertiesToReplace=e=>(tI(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getPropertiesToReArrange=e=>(tI(e)||[]).filter((e=>e.allowMultiple)).map((e=>e.fullPath));static getUniqueGadgetId=()=>AC.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>qs.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>qs.isTraditionalRemoteCase(e);static isRemoteCase=e=>qs.isRemoteCase(e);static isRemoteCaseVersionDifferent=e=>qs.isRemoteCaseVersionDifferent(e);static getRemoteCaseKey=(e,t)=>{let n=t;try{e&&(n=e.slice(e.indexOf(" ")+1,e.indexOf("!")))}catch{}return n};static isObjectCaseType=e=>{const t=Gy.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e));return t&&t.length>0&&"Object"===t[0].objectType};static isExternalObject=e=>{const t=Gy.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e)),{DisplayMandatoryInputsForObject:n,objectType:s}=t?.[0]||{};return t&&t.length>0&&n&&"Object"===s};static getRouteKeyForCreateWork=(e,t=!1)=>this.isExternalCaseType(e)&&t?Gr:this.isExternalObject(e)&&t?this.shouldUseUnifiedHandling()?Gr:"retrieveActionViewForNewObject":this.shouldUseUnifiedHandling()?wr:this.isObjectCaseType(e)?jr:wr;static shouldUseUnifiedHandling=()=>!0;static shouldAppendExcludeQueryParam=()=>Gy.isOptimizedCaseLoadingEnabled();static appendExcludeQueryParamToUrl=e=>{if(!e)return e;if(!this.shouldAppendExcludeQueryParam())return e;let t=e;if(t.includes("excludeAdditionalActions=true"))return t=t.replace("excludeAdditionalActions=true","exclude=availableActions,availableProcesses"),t;const n=t.includes("?")?"&":"?";return`${t}${n}exclude=availableActions,availableProcesses`};static setTraditionalGadgetId=e=>{e.traditionalGadgetId=cI.getUniqueGadgetId()}}const lI=cI,uI=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},dI=e=>{if(lI.shouldUseUnifiedHandling()&&lI.isObjectCaseType(String(e?.caseTypeID))&&!uI(e))return!0;if(lI.isObjectCaseType(String(e?.objectTypeID))&&!uI(e))return!0;if(e){const{stageID:t,stages:n=[]}=e,s=n.length;for(let e=0;e<s;e+=1){if(n[e].ID===t)return"create"===n[e].transitionType&&"active"===n[e].visited_status}}return!1},pI=(e,t)=>{if(e&&t){const n=AC.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:s,type:a}=n;return"worklist"===a?.toLowerCase()&&s===e}return!1},gI=(e,t)=>{const n=NC.getPropertyValue($s.CASE_INFO.ACTIVE_ACTION_ID,t,e),s=NC.getPropertyValue($s.CASE_INFO.AVAILABLEACTIONS,t,e);let a=!1;if(s&&n){const e=s.find((e=>e.ID===n));e&&(a=e.type.toLowerCase()===$s.LOCAL_ACTION_TYPE.CASE_WIDE.toLowerCase())}if(e&&!s){const t=aC(e);a=t?.context_data?.actionType===Gs.CASE}return a},hI=e=>cC(null,Gs.CASE_VIEW_MODE_PROP,e)===Gs.PERFORM_MODE&&(e.includes(Gs.WORKAREA)||e.includes(Gs.MODAL)||e.includes(Gs.ACTIONAREA)),fI=(e,t)=>hI(e)&&!gI(e,t),mI=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},II=(e,t,n)=>{let s;const a=e?.find((e=>e.ID===t))?.actions,r=a?.filter((e=>e.ID===Gs.FIX_BROKEN_ASSIGNMENTS))||[];return s=n&&r?.length>0?r[0].ID:n||((e,t)=>{if(!Array.isArray(e)||!t)throw new Error("Invalid parameters passed to getAssignmentActionID API");return e.find((e=>e.ID===t))?.actions?.[0]?.ID})(e,t),s},EI=(e,t,n,s)=>{let a;return a=e?II(e,t,n):s||ks.getDefaultQualifiedName("Create"),a},yI=(e,t)=>lI.shouldUseUnifiedHandling()?ya:lI.isObjectCaseType(e)||t?Ur:ya,AI=(e,t,n)=>{let s,a,r,o,i,c,l,u,d;const p=aC(e),g=p?.caseInfo?.caseTypeID||p?.objectInfo?.objectTypeID,h=lI.shouldUseUnifiedHandling();return n?.isTriggeredFromDifferentContext||e.includes(Gs.ACTIONAREA)?(s=e.includes(Gs.ACTIONAREA)?void 0:p.caseInfo?.assignments?.[0]?.ID,a=p.caseInfo.ID,r=p.caseInfo.assignments,o=p.caseInfo.activeActionID,i=p.caseInfo.availableActions,c=p.caseInfo,l=p.caseInfo.businessID,u=p.caseInfo.caseTypeID,d=p.caseInfo.caseTypeName):!h&&p?.objectInfo&&lI.isObjectCaseType(g)?(a=p.objectInfo.ID,o=p.objectInfo.activeActionID,i=p.objectInfo.availableActions,c=p.objectInfo,l=p.objectInfo.businessID,u=p.objectInfo.objectTypeID,d=p.objectInfo.objectTypeName):(s=t.getValue(Gs.getProperty($s.CASE_INFO.ASSIGNMENT_ID)),a=t.getValue(Gs.getProperty($s.CASE_INFO.CASE_INFO_ID)),r=t.getValue(Gs.getProperty($s.CASE_INFO.ASSIGNMENTS)),o=t.getValue(Gs.getProperty($s.CASE_INFO.ACTIVE_ACTION_ID)),i=t.getValue(Gs.getProperty($s.CASE_INFO.AVAILABLEACTIONS)),c=t.getValue(Gs.getProperty($s.CASE_INFO.CASE_INFO)),l=t.getValue(Gs.getProperty($s.CASE_INFO.BUSINESS_ID)),u=t.getValue(Gs.getProperty($s.CASE_INFO.CASE_TYPE_ID)),d=t.getValue(Gs.getProperty($s.CASE_INFO.CASE_TYPE_NAME))),{assignmentID:s,caseID:a,assignments:r,localActionID:o,caseActions:i,caseInfo:c,businessID:l,caseTypeID:u,caseTypeName:d}},CI=(e,t)=>{if(Object.keys(e??{}).length>0&&t?.startsWith("http")){const n=new URL(t),s=new URLSearchParams(n.search);return Object.keys(e).forEach((t=>{s.append(t,String(e[t]))})),n.search=s.toString(),n.toString()}return t},SI=(e,t="case")=>{const n=e?.payload?.err?.response?.data?.displayButtonsOnErrors||[],s=e?.payload?.err?.response?.status;if(Array.isArray(n)&&n.length>0&&424===s){n.forEach((e=>{e.isErrorButton=!0}));const s=e.payload.context,a=aC(s),r=((e,t)=>(e.forEach((e=>{!0!==e.isErrorButton||t.some((t=>t.actionID===e.actionID))||(t=[...t,e])})),t))(n,a?.caseInfo?.actionButtons?.secondary||[]),o={data:{["dataObject"===t?$s.DATA_INFO.DATA_INFO:$s.CASE_INFO.CASE_INFO]:{actionButtons:{secondary:r}}},target:py(s),context:s};sC({type:Da,payload:o})}},_I=e=>({type:kh.REFRESH_DATA,payload:e}),NI={},TI=(e,t,n,s,a,r,o,i,c,l)=>{if(!(e&&s&&t))return;const u=l.actionMgrID||zp.getNextActionMgrId(),d={ID:e,actionID:t,objectTypeID:n,context:s,caseWideAction:a,isObjectType:r,isExternalObject:o,isExternalCase:i,casetypeID:c,options:{...l,actionMgrID:u}};l.isFillFormWithAI?sC((e=>({type:xr,payload:e}))(d)):sC(_I(d))},DI=(e,t,n,s,a)=>{if(!(e&&n&&t))return;s&&(s=AC.convertPageRefToClipboardPageNotation(s));sC(_I({ID:e,viewID:t,context:n,options:a,caseViewAction:!0,interestPage:s}))},PI=(e,t,n,s,a,r,o,i,c,l={})=>{if(!((e||t)&&s&&n&&a))return;a&&(a=AC.convertPageRefToClipboardPageNotation(a));const u={ID:o||c!==Gs.ACTION?e:t,actionID:n,context:s,options:l,interestPage:a,interestPageActionID:r,isLocalAction:o,isMultiRecordData:i,editType:c};sC(_I(u))},OI=(e,t,n)=>{NI[t]||(NI[t]={}),e&&!NI[t][e]&&(NI[t][e]={pageReference:n})},RI=(e,t,n)=>{const s={pageName:(a=t.substring(t.lastIndexOf(" ")+1)).substring(0,a.lastIndexOf(".")),propertyName:a.substring(a.lastIndexOf(".")+1)};var a;const r=SA(s.propertyName,n||e.getValue(Gs.CLASS_ID,s.pageName));return!!r?.isDeclarativeTarget},bI=(e,t,n)=>{const s=n||e.getRawMetadata()?.config?.value;let a=!1;if(s){const n=Ro.trimAnnotation(s);let r;r=t?AC.resolvePageClass(n,t):NC.resolveClassID(s,e.getPageReference(),e.getContextName());const o=SA(Ro.getLeafPropertyName(s),r);if(a=!!o?.isDeclarativeTarget,!a&&o?.additionalInformation){const e=Ro.trimAnnotation(o?.additionalInformation);a=lf.isDecisionParagraph(e,o.classID)}!a&&o?.datasource?.parameters&&(a=((e,t,n)=>{let s=!1;if(Array.isArray(t)){const a=t=>{const a=t.value;return a.startsWith("@P")&&(s=RI(e,a,n)),s};t.some(a)}else if("object"==typeof t)for(const a of Object.keys(t))if(t[a].startsWith("@P")&&(s=RI(e,t[a],n),s))break;return s})(e,o?.datasource?.parameters,t)),a||(a=o?.datasource?.tableType===Gs.DECISION)}return a},vI=(e,t)=>{const n=n=>(e=>"string"==typeof e&&e.startsWith(Gs.PROPERTY_ANNOTATION))(n)&&bI(e,t,n),s=e=>!(!e||"object"!=typeof e)&&Object.values(e).some((e=>n(e)||s(e)));return s(e.getRawMetadata()?.config)},xI=e=>{(e.isWhenExist()||vI(e))&&OI(e.getCurrentView(),e.getContextName(),e.getPageReference())},wI=e=>{if(!e)return!1;const t=nC()?.getState()?.data?.[e],n=t?.caseInfo?.caseTypeID||t?.objectInfo?.objectTypeID;return lI.isObjectCaseType(n)},MI=(e,t,n)=>{const s=gI(e,t);let a,r,o="",i="";const c=n=>NC.getPropertyValue(n,t,e)||"",l=lI.shouldUseUnifiedHandling(),u=c($s.CASE_INFO.CASE_INFO_CLASSID)||c($s.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID)||n?.classID||"",d=lI.isObjectCaseType(u)||t.startsWith(Gs.OBJECT_INFO.OBJECT_INFO),p=lI.isExternalCaseType(c($s.CASE_INFO.CASE_INFO_CLASSID)),g=lI.isExternalObject(u),h=c(Gs.getProperty($s.CASE_INFO.BUSINESS_ID));if(d&&wI(e)&&!p)o=u,n.isObjectWideAction=!0,a=c(l?$s.CASE_INFO.ACTIVE_ACTION_ID:$s.OBJECT_INFO.ACTIVE_ACTION_ID),a||(a=Gs.getDefaultQualifiedName(Gs.VIEW_NAMES.OBJECT_CREATE_VIEW)),r=c(Gs.getProperty($s.CASE_INFO.CASE_INFO_ID))||o;else if(p&&!h)a=Gs.getDefaultQualifiedName(Gs.VIEW_NAMES.OBJECT_CREATE_VIEW),r=c($s.CASE_INFO.CASE_INFO_CLASSID),i=c($s.CASE_INFO.CASE_TYPE_ID);else if(a=c($s.CASE_INFO.ACTIVE_ACTION_ID)||c($s.CASE_INFO.ASSIGNMENTACTION_ID),s)r=c(Gs.getProperty($s.CASE_INFO.CASE_INFO_ID));else{r=c(Gs.getProperty($s.CASE_INFO.ASSIGNMENT_ID))||c(Gs.getProperty($s.CONTEXT_DATA_ASSIGNMENTID))}TI(r,a,o,e,s,d,g,p,i,n)},LI=e=>{const{context:t,pageReference:n}=e,s=(e=>NI[e]&&Object.keys(NI[e]).length>0&&hI(e))(t);if(!s)return;const a=NC.getPropertyValue(Gs.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,t),{isMultiRecordData:r,editType:o}=a||{};if(r){const e=NC.getPropertyValue($s.CASE_INFO.CASE_INFO_ID,n,t),s=NC.getPropertyValue($s.CASE_INFO.ASSIGNMENT_ID,n,t),{interestPage:i,interestPageActionID:c,actionID:l,isLocalAction:u,viewName:d}=a;o===Gs.ACTION?PI(e,s,l,t,i,c,u,r,o):DI(e,d,t,i,{})}else MI(t,n,{})},UI=(e,t)=>{const{requestType:n}=e;if(e?.options?.refreshFor&&"refresh"===n){t+=`?refreshFor=${e.options.refreshFor.replace(/\[(\d+)\]/g,((e,t)=>`(${parseInt(t,10)+1})`))}`}return e?.options?.isFillFormWithAI&&"refresh"===n&&(t+="?fillFormWithAI=true"),t},FI=(e,t)=>{const n=e.url===t.url,s=e.interestPage===t.interestPage;return n&&s},VI=(e,t)=>{const n=e.url?.includes("/refresh?refreshFor="),s=t.url?.includes("/refresh?refreshFor="),a=e.url?.endsWith("/refresh")&&!n,r=t.url?.endsWith("/refresh")&&!s;if(a&&r)return FI(e,t);if(a&&s)return!0;if(n){if(r)return"CANCEL_REFRESH";if(s)return FI(e,t)}return!1},jI=e=>{const t=(e=>{const t=[];return yu.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const s=n.split(".");s.shift();let a=s.join(".");e&&a&&(a=AC.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a}))})),t})(e),n=(e=>{const t=[];return yu.getWhens(e).forEach((({name:e,type:n,pageReference:s})=>{const a=s.split(".");a.shift();let r=a.join(".");e&&r&&(r=AC.convertPageRefToClipboardPageNotation(r),t.push({name:e,context:r,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}};const kI=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}},BI={IDLE:"idle",SAVING:"saving",SKIPPED:"skipped",ERROR:"error"},$I='input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], input[type="password"], input[type="date"], input[type="time"], input[type="month"], input[type="week"], input[type="datetime-local"], input:not([type])',GI=`${$I}, textarea, [contenteditable="true"]`,WI=new Map,HI=new Map,qI=new Set,zI=new Map,YI=new Map,KI=new Set,QI=(e,t)=>{zI.get(e)?.forEach((e=>e(t)))},JI=(e,t)=>{const n=HI.get(e);void 0!==n&&clearTimeout(n),HI.set(e,setTimeout((()=>{HI.delete(e),t()}),(()=>{const e=Number(Gy.getFeatureMap()?.pyAutoSaveDurationInMS);return e>0?e:5e3})()))},XI=e=>{const t=Ks(e),n=py(t);return!n||!ay(n)||YE(n)===t},ZI=async e=>{if(qI.has(e))return;if(KI.has(e))return;const t=WI.get(e);if(!t)return;if(!XI(e))return;const n="undefined"!=typeof document?document.activeElement:null;if(n&&n===(e=>up.get(e)??null)(e)&&n.matches($I))return void JI(e,(()=>ZI(e).catch((()=>{}))));(e=>{const t=YI.get(e);if(t&&0!==t.size){for(const[n,s]of t)qm.executeStateMachine(e,n,s,!0,{skipStateUpdate:!1,skipDirtyValidation:!1})||sC(dS({reference:n,value:s,context:e,isImplicit:!1,skipDirtyValidation:!1}));YI.delete(e)}})(e);let s=!1;lp(!0);try{if(!Hm.hasUnsavedChanges(e))return;s=Hm.isFormValid(e)}finally{lp(!1)}if(s){qI.add(e),QI(e,BI.SAVING);try{await((e,t)=>{const n=e,s=n.includes(Gs.MODAL),a=iC($s.CASE_INFO.CASE_INFO_ID,null,n),r=iC($s.CASE_INFO.ASSIGNMENT_ID,null,n),o=iC($s.CASE_INFO.ACTIVE_ACTION_ID,null,n)||iC($s.CASE_INFO.ASSIGNMENTACTION_ID,null,n),i=iC($s.CASE_INFO.CASE_TYPE_ID,null,n),c=iC("isProcessAction","isProcessAction",n),l=zp.getNextActionMgrId(),u={context:n,containerItemID:e,assignmentID:r,actionID:o,caseID:a,containerName:t,caseType:i,isModalAction:s,isFormValid:void 0,isProcessAction:c,saveOnly:!0,autosave:!0,actionMgrID:l};let d,p;const g=new Promise(((e,t)=>{d=e,p=t}));if(!d||!p)throw new Error("Promise executor did not synchronously assign resolveFn/rejectFn.");return zp.register(l,g,d,p,lg,u,!0),Yh.executeOrQueueDeferredAction(ug(u)),g})(e,t.containerName),Hm.clearChangedProperties(e),QI(e,BI.IDLE)}catch{QI(e,BI.ERROR)}finally{qI.delete(e)}}else QI(e,BI.SKIPPED)},eE=()=>{if("undefined"==typeof document)return;const e=document.activeElement;if(e?.matches(GI))for(const e of WI.keys())HI.has(e)&&XI(e)&&JI(e,(()=>ZI(e).catch((()=>{}))))},tE=eE,nE=e=>{"Tab"===e.key&&eE()},sE=e=>{const{target:t}=e;if("undefined"!=typeof Element&&t instanceof Element&&t.matches($I))for(const e of WI.keys())HI.has(e)&&XI(e)&&(dp(e,t),JI(e,(()=>ZI(e).catch((()=>{})))))},aE=e=>WI.has(e),rE=e=>{const t=HI.get(e);void 0!==t&&clearTimeout(t),HI.delete(e),qI.delete(e),WI.delete(e),KI.delete(e),YI.delete(e),pp(e),0===WI.size&&"undefined"!=typeof document&&(document.removeEventListener("pointerdown",tE),document.removeEventListener("keydown",nE),document.removeEventListener("input",sE,{capture:!0}))},oE=e=>{const t=`${e}/`;for(const e of[...WI.keys()])e.startsWith(t)&&rE(e)},iE=e=>{const t=HI.get(e);void 0!==t&&(clearTimeout(t),HI.delete(e))},cE=e=>{WI.has(e)&&(KI.has(e)||JI(e,(()=>ZI(e).catch((()=>{})))))},lE=e=>{KI.delete(e),Hm.hasUnsavedChanges(e)&&cE(e)},{APP:uE}=Gs;let dE={},pE={},gE={};const hE="You will lose unsaved changes. Do you want to continue?",fE="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",mE=(e=uE.APP,t,n)=>{let s=[],a=[];t||(s=oI(e,!0)),n||(a=(e=>{const t=yu.getContextReferences(e),n=[];if(t)for(const[e,s]of t)!0===NC.resolveContextTreeNodeProps(s.props).readOnly&&n.push(e);return n})(e));const r={};((e,t,n)=>{const s=pE[t]||{};Object.keys(s).forEach((t=>{const a=s[t].associatedProperty;Object.hasOwn(s,t)&&(void 0===a||n.includes(a))&&AC.buildObject(t,e,s[t].value)}))})(r,e,s);const o=dE[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&s.includes(e)||t;Object.hasOwn(o,e)&&n&&!a.includes(e)&&AC.buildObject(e,r,o[e].value)})),r},IE=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete dE[t]?.[n],delete pE[t]?.[n]};var EE;EE=(e,t)=>{IE({context:e,reference:t})},pu=EE;const yE=e=>e&&gE[e],AE=e=>{e&&gE[e]&&(gE[e]=!1)},CE=(e,t)=>{const{context:n,initialValue:s="",isStrictTracking:a,associatedProperty:r}=t,o=t.reference.startsWith(".")?t.reference.substr(1):t.reference;e[o]?e[o].previousValue=iC(t.reference,null,n):(e[o]={initialValue:s||iC(t.reference,null,n)},e[o].previousValue=e[o].initialValue),e[o].value=t.value,r&&(e[o].associatedProperty=r),a&&e[o].value===e[o].initialValue&&IE(t)},SE=e=>{const{payload:t}=e,{context:n}=t,s=t.reference.startsWith(".")?t.reference.substr(1):t.reference;yu.isFieldExists(n,s)||(pE[n]=pE[n]||{},CE(pE[n],t)),dE[n]=dE[n]||{},CE(dE[n],t)},_E=({value:e,context:t,reference:n})=>{const s=py(t),a=FE(s,t)||{};if(kI.isPageInstruction(n)||a?.subscriptFieldName)return;const r=n?.startsWith(".")?n?.substr(1):n;dE[t]=dE[t]||{};dE[t][r]||(dE[t][r]={initialValue:iC(r,null,t)}),dE[t][r].value=e},NE=e=>e&&dE[e]&&Object.keys(dE[e]).some((t=>dE[e][t].initialValue!==dE[e][t].value))||!!yE(e),TE=(e,t)=>{if(!e||!t)return!1;const n=dE[e]&&dE[e][t];return!!n&&n.previousValue!==n.value},DE=e=>{e&&dE[e]?(dE[e]={},pE[e]={}):"all"===e&&(dE={},pE={},gE={}),gE[e]&&(gE[e]=!1),pp(e)},PE=(e,t,n=new Set)=>{if(n.has(t))return;n.add(t);[...To.getDependencies(e,t),...XA.getResetDependencies(e,t)].forEach((t=>{const s=AC.getPropertyNameFromDependency(t);if("object"==typeof t&&"multiRecord"===t.mode){const t=s.split("."),n=`.${t.pop()}`,a=t.join(".");if(qm.isStateMachineExist(e,a,n)){qm.getStateMachine(e,a,n).deleteAll()}else if(aE(e)){qm.setStateMachine(e,n,a,new Rd(n,a,e));const t=qm.getStateMachine(e,a,n);t?.deleteAll(!1)}}else kI.isPageInstruction(s)&&qm.executeStateMachine(e,s,""),sC({type:sa,payload:{reference:s,value:"",context:e,isArrayDeepMerge:!0,isImplicit:!0}});PE(e,s,n)}))},OE={propertyChangeMiddleware:()=>e=>t=>{const{type:n,payload:s={}}=t||{};if(n===ra&&(So(s),(e=>{const{context:t,pageReference:n,value:s,reference:a}=e;XA.triggerCascade(t,a,s);const r=To.getDependencies(t,a),o={context:t,datapages:{}};PE(t,a),r.forEach((s=>{let a=n;s.startsWith(n)||(a="");const r=s.replace(`${a}`,"").split(".").filter((e=>!!e));r.pop();const i=r.join("."),c=iC(`.${i}`,a,t)?.classID||e.classID,l=SA(s.split(".").pop(),c),{datasource:u}=l,d={},p=[];u.parameters.forEach((e=>{e?.value?(d[e.name]=hg.isProperty(e.value)?iC(`.${AC.getFullPropertyReference([i,AC.getPropertyName(e.value)])}`,a,t):e.value,void 0===d[e.name]||null===d[e.name]||""===d[e.name]?(d[e.name]="",p.push(Gs.NULL_STRING)):p.push(d[e.name])):(d[e.name]="",p.push(Gs.NULL_STRING))}));const g=u.name.concat(Gs.UNDERSCORE_STRING,AC.getHashedString(p.join(Gs.HASH_DELIMITER))),{name:h}=u,f=LA(h);o.datapages[g]={mode:u.mode,propertyName:s,name:u.name,dataViewParameters:d,refreshStrategy:f?.refreshStrategy}})),r.length&&sC({type:fr,payload:o})})(s),Yh.registerBlockingAction(s.context).catch((()=>{})),setTimeout((()=>{(TE(s.context,s.reference)||zd(s.context))&&LI(s),Fh.triggerRefreshForType("PROP_CHANGE",s.reference,s.context),Yh.deRegisterBlockingAction(s.context).catch((()=>{}))}),0)),n===Er&&!s?.isDefault){const{context:e,referenceList:t,c11nEnv:n,listIndex:a,instruction:r,skipDirtyValidation:o=!1}=s;0===a&&"INSERT"===r&&n&&(e=>{let t=!1;const n=e?.getRawMetadata()?.config;n?.type&&"multirecordlist"===n.type&&n?.contextClass&&(t=function e(t,n){for(const s of n){const n=Ff({meta:s}).getPConnect();if(n.isWhenExist()||vI(n,t))return!0;if(s.children&&e(t,s.children))return!0}return!1}(n.contextClass,n.children??[])),t&&OI(e.getCurrentView(),e.getContextName(),e.getPageReference())})(n),setTimeout((()=>{Fh.triggerRefreshForType("PROP_CHANGE",t,e)||LI({context:e,pageReference:t})}),0),o||(gE[`${e}`]=!0)}if(n===sa||n===aa){const{reference:e,isImplicit:n,context:a,skipDirtyValidation:r=!1}=s;yu.updateFieldNodeValue(a,e,s.value),kI.isPageInstruction(e)||r?r||(gE[`${a}`]=!0):SE(t),(s.removePropertyFromChangedList||n)&&IE(s)}if(n===ja||n===ka){const{transientItemID:e,data:t}=s;AC.iterateLeafNodes(t,(t=>{IE({context:e,reference:t.join(".")})}))}if(n&&[Ga,Ma,Ha,Va].includes(n)){DE(s.context),XA.purgeResetDependencies(s.context),(e=>{e&&NI[e]&&delete NI[e]})(s.context);(s.childContainersContexts||[]).forEach((e=>{DE(e)}));(s.transientItems||[]).forEach((e=>{DE(e)}))}e(t)},getChanges:mE,recordChange:SE,isDirty:()=>Object.keys(dE).some((e=>NE(e))),isPropertyDirty:TE,isContextDirty:NE,resetChangedProperties:DE,deleteRecordedChange:IE,isComplexObjectMerged:yE,resetComplexObjectDirtyStatus:AE};const RE=new class{getCoreheaders(e){const t=`${$s.APP.APP}${Gs.FORWARD_SLASH_STRING}${Gs.PRIMARY}`,n=YE(t),s=JE(n),a=NC.getProperty(Gs.COREHEADERS,"",s);if(a&&e in a)return a[e]}},bE={defaultLimit:16},vE={SINGLE:"single",MULTIPLE:"multiple"},xE={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},wE=()=>nC()?.getState()?.containers;function ME(e){return"string"==typeof e&&""!==e.trim()}const LE=e=>ME(e)?nC()?.getState().containers[e]:null,UE=(e,t,n)=>{if(!n)return{continueExecution:!1,containerItemID:e};const s=LE(n);let a=!1,r=e;return s?.accessedOrder.forEach((e=>{t===s.items[e].key&&(a=!0,r=s.items[e].context)})),{continueExecution:a,containerItemID:r}},FE=(e,t)=>{if(!ME(e)||!ME(t))return null;const n=wE(),s=n?.[e];return s&&s.items&&s.items[t]||null},VE=e=>ME(e)?nC()?.getState().containers[e]?.items:null,jE=e=>ME(e)&&nC()?.getState().containers[e]?.accessedOrder||[],kE=e=>ME(e)&&jE(e)?.length>0||!1,BE=(e,t,n)=>{if(!ME(e)||!ME(t))return!1;const s=wE(),a=s?.[e],r=a&&a.items||null,o=n||((e,t)=>e===t);if(t&&r)for(const e of Object.keys(r))if(o(t,r[e].key))return!0;return!1},$E=e=>{const{containers:t}=nC()?.getState()||{};return!(!t||!ME(e))&&Object.keys(t).some((n=>t[n]?.accessedOrder?.includes(e)))},GE=(e,t,n)=>{if(!ME(e)||!ME(t))return null;const s=wE(),a=s?.[e],r=a&&a.items||null,o=n||((e,t)=>e?.toLowerCase()===t?.toLowerCase());if(t&&r)for(const e of Object.keys(r))if(o(t,r[e].key))return e;return null},WE=(e,t)=>{if(e&&t)for(const a of Object.keys(t))if(n=e,s=t[a].key,n?.toLowerCase()===s?.toLowerCase())return t[a];var n,s;return null},HE=e=>{if(!ME(e))return null;const t=wE()??{};for(const n of Object.keys(t))if(t[n]){const s=t[n].items??null,a=WE(e,s);if(a)return a}return null},qE=(e,t)=>{if(!ME(e)||!ME(t))return!1;const n=wE();return n&&Object.hasOwn(n,`${e}/${t}`)},zE=(e,t)=>{if(!ME(e)||!ME(t))return null;const n=wE(),s=n?.[`${e}/${t}`];return s&&s.type},YE=e=>{if(!ME(e))return null;let t=null;const n=wE();if(n&&n[e]){const s=n[e],{accessedOrder:a}=s;t=a&&a.length>0?a[a.length-1]:null}return t},KE=(e,t,n)=>{if(!ME(e)||!ME(t))return!1;const s=GE(e,t,n);return!!s&&s===YE(e)},QE=(e,t)=>{let n=null;const s=wE();if(!s)return null;for(const a of Object.keys(s))if(s[a].items){const r=s[a].items[e];if(n=r?r[t]:null,n)break}return n},JE=e=>ME(e)?QE(e,"context"):null,XE=e=>{if(!ME(e))return null;let t=null;const n=wE();if(n&&n[e]){const s=n[e],{accessedOrder:a}=s,r=a&&a.length>0?a[a.length-1]:null;t=JE(r)}return t},ZE=e=>{if(!ME(e))return[];const t=e.endsWith("/")?e:`${e}/`;let n=[],s=!1;const a=wE();if(!a)return[];const r=n=>{const a=[];return Object.keys(n).forEach((n=>{n.startsWith(t)&&n!==t&&a.push(n),n===e&&(s=!0)})),a};for(const e of Object.keys(a))if(a[e].items){const t=r(a[e].items);t&&t.length>0&&(n=n.concat(t)),n=n.sort()}return s?n:[]},ey=e=>{if(!ME(e))return[];const t=[],n=wE();if(!n)return[];for(const s of Object.keys(n))s.startsWith(e)&&s!==e&&t.push(s);return t},ty=e=>{if(!ME(e))return[];const t=[],n=wE();if(!n)return[];for(const s of Object.keys(n))if(s.startsWith(e)&&s!==e){(jE(s)||[]).forEach((n=>{JE(n)!==e&&t.push(JE(n))}))}return t},ny=e=>{const t=[...ty(e),e],n=[],s=nC()?.getState().data||{};return t.forEach((e=>{Object.hasOwn(s,`${e}/${Gs.SUGGESTION}`)&&n.push(`${e}/${Gs.SUGGESTION}`)})),n},sy=e=>ME(e)?e&&LE(e)&&LE(e).type===vE.SINGLE:null,ay=e=>ME(e)?e&&LE(e)&&LE(e).type===vE.MULTIPLE:null,ry=e=>ME(e)&&LE(e)&&LE(e).items&&Object.keys(LE(e)?.items).length>0||!1,oy=e=>e&&bE[e]?bE[e]:bE.defaultLimit,iy=(e,t=bE.defaultLimit)=>{ME(e)&&(bE[e]=t)},cy=e=>{if(!ME(e))return!1;let t=!1;const n=LE(e),{items:s={}}=n,a=Object.keys(s),r=oy(e);return a&&a.length>0&&a.length>=r&&(t=!0),t},ly=e=>{if(!e||!ME(e.name)||!ME(e.context))return null;const t=e?.name,n=LE(`${e?.context}/${t}`),s=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],a=ey(`${Gs.APP.APP}/${Gs.PREVIEW}`),r=ty(`${Gs.APP.APP}/${Gs.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...s,...r],childContainers:a}},uy=e=>{if(!ME(e))return!1;const t=JE(e);return NE(t)||bm(e)},dy=e=>{if(!ME(e))return null;let t;const n=LE(e),{accessedOrder:s=[]}=n;for(let e=0;e<s.length;e+=1){const n=s[e];if(!uy(n)){t=n;break}}return t},py=e=>{if(!ME(e))return null;const{containers:t}=nC()?.getState()||{};if(t)for(const n of Object.keys(t))if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(Gs.UNDERSCORE_STRING);return e.slice(0,n)},gy=async(e,t={})=>{if(!ME(e))return Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=py(e),s=JE(e),{skipDirtyCheck:a}=t;let r=!0,o=[];if(uy(e)&&!a&&(qp.disableLoadingIndicator({context:s}),r=await fm.confirm(Yy().getLocaleValue(hE,"Messages")),qp.enableLoadingIndicator({context:s})),r){const{accessedOrder:a=[],items:r={},type:i}=LE(n);o=a.filter((t=>t!==e));const c=o[o.length-1],l=r[c]||{},{semanticURL:u=Gs.FORWARD_SLASH_STRING,context:d}=l;o.length>0&&u&&u!==Gs.FORWARD_SLASH_STRING?vS({directUrlUpdation:!0,semanticURL:u,options:{containerItemID:c,context:d}}):vS({directUrlUpdation:!0,semanticURL:Gs.FORWARD_SLASH_STRING,options:{}});sC(JC({containerItemID:e,context:s,target:n,containerInfo:{newAccessedOrder:o,containerType:i},...void 0!==t.eventName?{eventName:t.eventName}:{}}))}return{newAccessedOrder:o,removeItem:r}},hy=(e,t,n,s)=>{const a="root",r=Qs(t,a,!0),o=Wr(t,a),i={data:n,context:s?"app":r},c=[jC({root:e,containerItemID:r,context:s?"app":r,target:o,containerName:t})];c.push(vC(i)),sC(c)},fy=(e,t,n)=>{let s=jE(e);s=s.filter((e=>e!==t));let a=!1;for(let e=0;e<s.length;e+=1){if(JE(s[e])===n){a=!0;break}}return a},my=e=>{if(!ME(e))return!1;const t=wE(),n=JE(e),s=t?Object.keys(t):[];let a=!1;for(let t=0;t<s.length&&(a=fy(s[t],e,n),!a);t+=1);return a},Iy=e=>{Array.isArray(e)||(e=[e]);const t=wE()||{};return e.map((e=>{const n=py(e);return AC.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},Ey=e=>{const{transientItemID:t,data:n,options:s}=e,a=AC.deepClone(nC()?.getState().data[t]);s?.reset&&AC.iterateLeafNodes(a,(e=>{"classID"!==e[e.length-1]&&AC.setIn(a,e,"")})),sC(BC({transientItemID:t,data:AC.mergeDeep(n,a)}))},yy=e=>{const{transientItemID:t,data:n}=e;sC(GC({transientItemID:t,data:n}))},Ay=e=>{const t=AC.deepClone(nC()?.getState().data[e]);AC.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&AC.setIn(t,e,"")})),sC($C({transientItemID:e,data:t}))},Cy=e=>{const t=AC.deepClone(nC()?.getState().data[e]);AC.iterateLeafNodes(t,(e=>AC.setIn(t,e,""))),sC(WC({transientItemID:e,data:t}))},Sy=e=>{nC()?.getState().data[e]&&Cy(e);const t=e.lastIndexOf("/"),n=t>0?e.substring(0,t):e,s=py(n);sC(ZC({transientItemID:e,containerItemID:n,target:s}))};class _y{static addContainerItems(e){this.items=e}static getContainerItems(){return this.items}static deleteContainerItem(e){const t=this?.items?.indexOf(e);void 0!==t&&-1!==t&&this.items.splice(t,1)}}const Ny=(e,t={})=>{if(!ME(e))return;const n=LE(e),s=Array.isArray(n?.accessedOrder)?n.accessedOrder:[];if(0===s.length)return;const{remove:a,keep:r}=t;let o;if(void 0!==r){const e=new Set(r);o=s.filter((t=>!e.has(t)))}else if(void 0!==a){const e=new Set(a);o=s.filter((t=>e.has(t)))}else o=[...s];for(const t of o){const n=JE(t),s=Iy(t);sC(JC({containerItemID:t,context:n,target:e,...s.length>0&&{transientItems:s}}))}},Ty=()=>_y,Dy=e=>{const t={containerName:e};t.childContainers=ey(e),sC({type:za,payload:t})},Py=(e,t)=>{const n=ZE(e),{key:s}=FE(py(e),e),a=[];n.forEach((e=>{const{key:n}=FE(py(e),e);if(n===s){const n={data:{caseInfo:{headers:{etag:t}}},target:py(e),context:e};a.push({type:Da,payload:n})}})),a.length&&sC(a)},Oy=(e,t)=>{const n=[],s={data:{caseInfo:{headers:{etag:t}}},target:py(e),context:e};n.push({type:Da,payload:s}),n.length&&sC(n)},Ry=()=>Gy.isPortalLoaded?"app":"root",by=()=>RE,vy=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:py(e),context:e};sC({type:Da,payload:n})},xy=(e,t)=>{const n=GE(e,t),s=GE(`${n}/workarea`,t);return JE(s)},wy=e=>ME(e)?QE(e,"parentContext"):null,My=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},Ly=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},Uy=()=>mg,Fy=()=>"undefined"==typeof window?"":qg(window.location.pathname),Vy=()=>"undefined"==typeof window?"":qg(window.location.pathname+window.location.search),jy=(e,t,n)=>{switch(n){case"warning":t?console.warn(e,t):console.warn(e);break;case"error":t?console.error(e,t):console.error(e);break;default:t?console.log(e,t):console.error(e)}};const ky=new class{staticRoutesList=[];constructor(){this.staticRoutesList=[],this.dynamicRoutesList=[],this.reqContextName="",this.defaultViewUrlPath="",this.staticRoutePage="",this.defaultClassName="",this.portalName=""}init=(e,t)=>{e&&e.routes&&e.routesMeta?(this.routingInfo=e,this.appRoutes=e.routes,this.appRoutesMeta=e.routesMeta,this.reqContextName=e.reqContextName,this.reqServletPath=e.reqServletPath,this.appName=e.appName,this.appAlias=e.appAlias,this.orgName=e.orgName,this.defaultViewUrlPath=t,this.defaultClassName="",this._createStaticDynamicRoutesList(this.appRoutes),this.appDelimeter=e.appDelimeter,this.reqServletNameReal=e.pxReqServletNameReal,this.bDefaultPortal=e.isDefaultPortal,this.portalName=e.portalName,this.ignoreFromEndPoint=["reactMode=dev","reactMode=prod"]):console.error("Routing info is not appropriate. Missing routes and routesMeta objects in routingInfo",JSON.stringify(e))};addRoutes=e=>{e?.routes&&e.routesMeta&&(this.appRoutes={...this.appRoutes,...e.routes},this.appRoutesMeta={...this.appRoutesMeta,...e.routesMeta},this.routingInfo&&(this.routingInfo.routes={...this.routingInfo.routes,...e.routes},this.routingInfo.routesMeta={...this.routingInfo.routesMeta,...e.routesMeta}),this._createStaticDynamicRoutesList(e.routes))};setDefaultRoute=e=>{this.defaultViewUrlPath=e};setStaticRoutePage=e=>{this.staticRoutePage=e};getStaticRoutePage=()=>this.staticRoutePage||"";setDefaultClassName=e=>{this.defaultClassName=e};_createStaticDynamicRoutesList=e=>{Object.keys(e).forEach((t=>{Hg(t)?this.dynamicRoutesList?.push(t):this.staticRoutesList?.push({[t]:e[t]})}))};_getDynamicKeyName=e=>{const t=e.indexOf("{")+1,n=e.lastIndexOf("}");return e.slice(t,n)};isDefaultPortal=()=>"false"!=`${this.bDefaultPortal}`;getPortalName=()=>this.portalName;getApplicationPath=()=>qg(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>qg(this.reqContextName);getRoutingInfo=()=>this.routingInfo;processUrl=(e,t)=>{t&&(e=e.toLowerCase()),e&&(e=decodeURIComponent(e));const n=new RegExp(this.getApplicationPath(),"i");return(e=e.replace(n,"")).startsWith("/")&&Xg()&&"PREVIEW"!==Gy.getRenderingMode()&&this.setDefaultClassName(""),qg(e)};stripIgnoredParams(e){return this.ignoreFromEndPoint?.forEach((t=>{e.includes(t)&&(e=e.substring(0,e.indexOf(t)))})),e}getRouteDetails=(e,t)=>{if(!t)return this.appRoutes[e];let n="",s={caseClassName:"",caseID:"",RemoteSystemID:void 0,page:""};return Object.keys(this.appRoutes||{}).forEach((t=>{const a=this.appRoutes[t];a&&a.payload&&a.payload.page===e&&(n=a.routeKey,s={...a.payload})})),!n&&this.appRoutes&&this.appRoutes[e]&&(n=this.appRoutes[e].routeKey,s={...this.appRoutes[e].payload}),{routeKey:n,payload:s}};transformRemoteCasePayload(e){const{caseClassName:t,caseID:n}=e;if(!qs.isRemoteCase(t))return e;const{RemoteClassGroup:s,RemoteSystemID:a}=qs.getRemoteCase(t??"");return{...e,caseID:n?.replace(t??"",s?.toUpperCase()),RemoteSystemID:a}}getEndPointInfo=e=>{e=this.stripIgnoredParams(e);const t=Xg();let n=this.processUrl(e,!0),s=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0);s||(n=this.processUrl(this.defaultViewUrlPath,!t),s=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0)||"");const{routeKey:a,payload:r}=this.getRouteDetails(s,t);if(!this.appRoutesMeta?.[a]?.restApi)return null;const{reqType:o,endPoint:i,params:c}=this.appRoutesMeta[a].restApi,l={routeKey:a,requestType:o,routeEndpoint:i,payload:{...c,...this.transformRemoteCasePayload(r)}};return this._resolveRoute(l,this.processUrl(e,!1),s)};getSemanticURL(e,t,n){return this.buildSemanticURL(e,t,n)}getResolvedSemanticURL(e,t,n={},s){const a=this.getSemanticURL(e,t,n);let r=a;if(Hg(a)){const e=a.match(Wg);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(r=r.replace(e,String(n[t])))}))}const o=bS(r,s),i=new URL(o);return this.isDefaultPortal()||!this.getPortalName()||i.searchParams.toString().includes("portal=")||i.searchParams.append("portal",this.getPortalName()),s&&!i.searchParams.has("lang")&&i.searchParams.append("lang",s),Yg(i.toString())}buildDocumentTitle(e,t,n){const s=n??"";return Gy.getCaseLabelFirstInTitle()?e&&t?`${e} (${t}) - ${s}`:s:e&&t?`${t}: ${e} - ${s}`:s}updateSemanticURLAndDocumentTitle(e,t){const{key:n,actionName:s,caseClassName:a,isRemoteCase:r,name:o}=e;if(r&&!a)return;const i=this.getSemanticURL(s,{caseClassName:a}).replace(/{.+?}/,String(Yf(n))),c=`${$s.APP.APP}${Gs.FORWARD_SLASH_STRING}${$s.PRIMARY}`,l={semanticURL:i,directUrlUpdation:!0,options:{acName:c,context:XE(c)}},u=Fy();i&&!u.includes(i)&&RS(l,t);const d=n.substring(n.lastIndexOf(" ")+1),p=Gy.environmentInfoObject?.pxApplication?.pyLabel,g=this.buildDocumentTitle(o,d,p);jS(g)}buildSemanticURL(e,t,n){const{urlPattern:s}=this.appRoutesMeta?.[e]||{},a=s?.split("/").length,r=s?.split("/");this.setDefaultClassName(t?.pageClass||this.defaultClassName);const o=Object.keys(this.appRoutes).filter((e=>a===e.split("/").length)).filter((e=>{const t=e.split("?")[0].split("/");return r?.every(((e,n)=>e.startsWith("{")||e===t[n]))}));if(1===o.length)return this._getQueryParamsResolvedURL(o[0],n);if(0===Object.keys(t).length)return"";const i=o.find((e=>{const s=this.appRoutes[e].payload,a={...n};delete a.dataViewName,delete a.dataContext;const r=s.dataViewKeys||s.dataContextParameters||{},o=Object.keys(t).every((e=>t[e]===s[e]));return!!o&&(AC.isEmpty(r)||AC.isEmpty(a)?o:Object.keys(a).every((e=>Object.hasOwn(r,e))))}));return i?this._getQueryParamsResolvedURL(i,n):o.includes("cases/{id}")&&n?.id?"cases/{id}":""}_getQueryParamsResolvedURL(e,t,n=!1){const[s,a]=e.includes("?")?e.split("?"):[e];if(a&&t&&Object.keys(t).length>0){const e={};for(const[n,s]of Object.entries(t))e[n.toLowerCase()]=s;const r=new URLSearchParams(a),o={};for(const[s,a]of r.entries())if("string"==typeof a&&Hg(a)){const r=this._getDynamicKeyName(a),i=r.toLowerCase(),c=n?e:t,l=n?t[r]??c[i]:c[r];null!=l&&(o[s]=l)}else"string"==typeof a&&(o[s]=a);const i=new URLSearchParams(Object.entries(o).map((([e,t])=>[e,String(t??"")])));return`${s}?${Yg(i.toString())}`}return s}_getQueryParamsObject(e){const t={};if(!e)return t;for(const n of e.split("&")){const e=n.indexOf("=");if(-1!==e){const s=n.slice(0,e),a=n.slice(e+1);try{t[decodeURIComponent(s)]=decodeURIComponent(a)}catch{t[s]=a}}}return t}getRestEndPoint(e,t){try{return this._buildRestApi(e,t)}catch(e){return console.error(e),null}}_buildRestApi(e,t){if(e&&this.appRoutesMeta?.[e]){const{reqType:n,body:s}=this.appRoutesMeta[e].restApi;let{endPoint:a}=this.appRoutesMeta[e].restApi;t?.params&&t.params.pageName&&(a=`${a}&pageName=${t.params.pageName}`);const r=a.match(Wg);if(r)for(let e=0;e<r.length;e+=1){const n=r[e].replace("{","").replace("}",""),s=new RegExp(r[e],"g");a=a.replace(s,t?.[n])}if(s){let e={};return Object.keys(s).forEach((n=>{if(t&&this._isSpecialInstruction(n)){const a=s[n];Array.isArray(a)&&a.every((e=>"string"==typeof e))&&(e={...e,...this._processInstruction(n,a,t)})}})),{restApi:a,reqType:n,body:e}}return{restApi:a,reqType:n}}throw new Error(`Cannot find route metadata for the routeKey: ${e}.`)}_isSpecialInstruction(e){return e&&e.startsWith("@")}_processInstruction(e,t,n){const s={};return"@COPY"===e&&t.forEach((e=>{s[e]=n?.[e]})),s}doesRestApiExist(e){return!(!this.appRoutesMeta||!this.appRoutesMeta[e])}_resolveMatchedRouteQueryParams=(e,t,n,s)=>{if(!e)return;const a=t.indexOf("?"),r=-1!==a?t.substring(a+1):void 0;if(r){const e=`${n.join("/")}?${r}`;return this._getQueryParamsResolvedURL(e,s,!0)}};_resolveRoute=(e,t,n)=>{const s=[],[a,r]=t.includes("?")?t.split("?"):[t],[o,i]=n.includes("?")?n.split("?"):[n],c=a.split("/"),l=o.split("/"),u={};for(let e=0;e<l.length;e+=1)if(s[e]=l[e],Hg(l[e])){u[this._getDynamicKeyName(l[e])]=c[e],s[e]=c[e]}const d=this._getQueryParamsObject(i),p=this._getQueryParamsObject(r),g={};for(const[e,t]of Object.entries(p))g[e.toLowerCase()]=t;for(const e of Object.keys(d))Hg(d[e])?u[e]=p[e]||g[e.toLowerCase()]:u[e]=d[e];const h=this._resolveMatchedRouteQueryParams(r,n,s,p),f=this._resolvePayload(e,u,n);return{...this._resolveRouteEndPoint(f,n),urlPath:h||s.join("/")}};_resolveRouteEndPoint=(e,t)=>{let{routeEndpoint:n}=e;if(!Hg(n))return e;const s={};if(s[t]=e,void 0!==e.payload){const t=n.match(Wg);for(let a=0;a<t.length;a+=1){const r=t[a],o=this._getDynamicKeyName(r);if(void 0!==e.payload[o]){const t=e.payload[o];n=n.replace(r,t)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${o}} in routeEndpoint- ${o} is missing in payload`,s)}}else this._sendWarningAndErrorMessages("Unable to resolve dynamic token(s) in routeEndpoint- payload is missing in routing table for-",s);return{...e,routeEndpoint:n}};_resolvePayload=(e,t,n)=>{if(void 0===e.payload)return e;const s={...e.payload,...this._resolvePayloadRecursive(e.payload,t)};return{...e,payload:s}};_resolvePayloadRecursive(e,t){if(Array.isArray(e))return e.map((e=>this._resolvePayloadRecursive(e,t))).flat();const n={};for(const s of Object.keys(e)){let a=e[s];if("string"==typeof a&&Hg(a)){const e=a.match(Wg)??[];for(const n of e){const e=this._getDynamicKeyName(n);void 0!==t[e]?a=a.replace(n,t[e]):this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${e}} in payload - {${e}} is missing in semantic url construct`)}n[s]=a}else n[s]=a&&"object"==typeof a?this._resolvePayloadRecursive(a,t):a}return n}_getMatchedRouteInRoutingTable=(e,t)=>{const[n]=e.includes("?")?e.split("?"):[e];let s=this._findMatchedRouteInStaticList(n,t);return void 0!==s?s:(s=this._findMatchedRouteInDynamicList(e),void 0!==s?s:void 0)};_findMatchedRouteInStaticList=(e,t)=>{if(!this.staticRoutesList||!e)return;const n=e.toLowerCase(),s=t?.toLowerCase();if(Xg()){const e=this._findMatchingRouteByClass(n,s);if(!e)return;const t=Object.values(e)[0],a=t?.payload?.page||"";return this.setStaticRoutePage(a),Object.keys(e)[0]}return this._findInStaticList(n)};_findMatchingRouteByClass=(e,t)=>{if(this.staticRoutesList)return this.staticRoutesList.find((n=>Object.entries(n).some((([n,s])=>{if(!s)return!1;const a=s.payload?.page?.toLowerCase(),r=s.payload?.pageClass?.toLowerCase(),o=a===e||n.toLowerCase()===e;return t?o&&r===t:o}))))};_findInStaticList=e=>{if(!this.staticRoutesList)return;const t=this.staticRoutesList.find((t=>Object.keys(t)[0].toLowerCase()===e));return t?Object.keys(t)[0]:void 0};_findMatchedRouteInDynamicList=e=>{const[t,n]=e.includes("?")?e.split("?"):[e],s=t.split("/");return this.dynamicRoutesList?.find((e=>{const[t,a]=e.includes("?")?e.split("?"):[e],r=t.split("/");if(r.length!==s.length)return!1;let o=0;for(o=0;o<r.length;o+=1){const e=r[o].toLowerCase();if(!Hg(e)&&e!==s[o]&&zg(e)!==s[o])return!1}if(a){const e=new URLSearchParams(n.toLowerCase()),t=new URLSearchParams(a.toLowerCase()),s=new Set,r=new Set,o=/\{[a-zA-Z]+\}/;for(const t of e.keys())s.add(t);for(const e of t.keys())r.add(e);if(r.size!==s.size)return!1;for(const n of s){if(!r.has(n))return!1;const s=t.get(n);if(e.get(n)!==s&&!o.test(s??""))return!1}}return!0}))};_sendWarningAndErrorMessages=(e,t)=>{jy(e,t,"warning"),jy("Error in Generated Routing Table",null,"error"),jy("Back | Forward for this page may NOT work as intended",null,"warning"),jy("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},By=ky;const $y=new class{constructor(){this.languagePacks=[]}getLocalizationBundles(e=Gy.getLocale()){return(this.languagePacks.find((t=>t.pyLangCode===e))?.pyBundles??this.languagePacks.find((e=>e.pyLangCode===Gs.DEFAULT.toUpperCase()))?.pyBundles??[]).sort(((e,t)=>e.pyOrder-t.pyOrder))}async loadLocaleBundle(e){const t=e.map((e=>Sh.getPageDataAsync("D_pzBundlesForLocalization","",{locale:e,onlyApp:"false"},{invalidateCache:!0}))),n=(await Promise.allSettled(t)).filter((e=>"fulfilled"===e.status)).flatMap((e=>e.value.pyLanguagePacks));this.setLanguagePack(n)}setLanguagePack(e){e.forEach((e=>{const t=this.languagePacks.findIndex((t=>t.pyLangCode===e.pyLangCode));-1!==t?this.languagePacks[t]=e:this.languagePacks.push(e)}))}};const Gy=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false",this.enablePriorityAndUrgencyImprovements=!1}setEnvironmentInfo(e){const t=e?.pxOperator?.pyUserName,n=t?AC.decodeHtmlEntities(t):void 0,s={...e,pxOperator:e.pxOperator?{...e.pxOperator,...n?{pyUserName:n}:{}}:e.pxOperator};this.environmentInfoObject=s;const a=this.environmentInfoObject?.features||AC.convertObjectWithStringToBoolean(this.environmentInfoObject?.pyFeatures)||{granularUIRefresh:!1};this.environmentInfoObject.features={...a,granularUIRefresh:a.granularUIRefresh||a.pyEnableGranularUIRefresh||!1},this.environmentInfoObject.pyGenAIEnabled=!!this.environmentInfoObject.pyGenAIEnabled,ks.setNamespaceSupport(this.getFeatureMap()?.isNamespaceEnabled);const r=e.requestContext;if(Array.isArray(r)&&r.length>0){const e=r.filter((e=>e.IncludeInURL)).map((e=>e.Key));e.length>0&&kS(e)}$y.setLanguagePack(this.environmentInfoObject.pyLanguagePacks||[])}getOperatorName(){return this.environmentInfoObject?.pxOperator?.pyUserName}getOperatorWorkGroup(){return this.environmentInfoObject?.pxOperator?.pyWorkGroup}getOperatorIdentifier(){return this.environmentInfoObject?.pxOperator?.pyUserIdentifier}getOperatorImageInsKey(){return this.environmentInfoObject?.pxOperator?.pyImageInsKey}getApplicationLabel(){return this.environmentInfoObject?.pxApplication?.pyLabel}getPortalName(){return By.getPortalName()}setCaseLabelFirstInTitle(e=!0){this.caseLabelFirstInTitle=e}getCaseLabelFirstInTitle(){return this.caseLabelFirstInTitle}getApplicationName(){return this.environmentInfoObject?.pxApplication?.pyRuleName}getUseLocale(){return this.environmentInfoObject?.pxLocale?.pyUseLocale}getAccessGroup(){return this.environmentInfoObject?.pxOperator?.pyAccessGroup}getApplicationID(){return this.environmentInfoObject?.pxApplication?.pyRuleId}getTimeZone(){return this.environmentInfoObject?.pxLocale?.pyTimeZone?.trim()||void 0}getTheme(e){return"dark"===e?.type?this.darkThemeOverrides:this.themeOverrides}setTheme(e,t){return"dark"===t?.type?this.darkThemeOverrides=e:this.themeOverrides=e,Uu.publish(Gs.PUB_SUB_EVENTS.UI_EVENTS.THEME_CHANGE,e),"dark"===t?.type?this.darkThemeOverrides:this.themeOverrides}getNavOrientation(){return this.navOrientation??this.environmentInfoObject?.pyNavOrientation}setNavOrientation(e){return this.navOrientation=e,Uu.publish(Gs.PUB_SUB_EVENTS.UI_EVENTS.NAV_ORIENTATION_CHANGE,e),this.navOrientation}setIsWebEmbed(e){return this.isWebEmbed=e,this.isWebEmbed}isWSSPortal(){return this.environmentInfoObject?.pyPortalTemplate===Gs.PORTAL_TYPE.WSS}isDefaultWSSPortal(){return this.isWSSPortal()&&!this.environmentInfoObject?.pyFullObjectDisplayTemplate}isInfinityRuntime(){return"Infinity"===this.environmentInfoObject?.pyExecutionRuntimeName}isGenAIEnabled(){return!!this.environmentInfoObject?.pyGenAIEnabled}getRewriteGenAIDP(){return this.environmentInfoObject?.pyRewriteGenAIDP}isBlueprintExperience(){return!!this.environmentInfoObject?.features?.fromBlueprintExperience}getBrandingInfo(e){return"dark"===e?.type?this.brandingInfoDark:this.brandingInfo}setBrandingInfo(e,t){return"dark"===t?.type?this.brandingInfoDark=e:this.brandingInfo=e,this.brandingInfo}getCookieComplianceMethod(){return this.cookieComplianceMethod}setCookieComplianceMethod(e){this.cookieComplianceMethod=e}setLocale(e){const t=e.replaceAll("-","_").split("_").slice(0,2);this.locale=t.join("-"),this.environmentInfoObject?.pxLocale&&(this.environmentInfoObject.pxLocale.pyUseLocale=this.locale)}getLocale=()=>this.locale;getEnvironmentKeys(){return Object.keys(Gs.ENV_INFO_KEYS)}getMaxAttachmentSize(){return this.environmentInfoObject?.pxApplication?.pyMaxAttachmentSize}getDefaultOperatorDP(){return this.environmentInfoObject?.pxApplication?.pyDefaultOperatorDP}getDocumentUrlDP(){return this.environmentInfoObject?.pxApplication?.pyDocumentUrlDP}getCaseInstanceListDP(){return this.environmentInfoObject?.pxApplication?.pyCaseInstanceListDP}getBaseLocale(){return this.environmentInfoObject?.pxApplication?.pyBaseLocale||"en-US"}getRenderingMode(){return this.environmentInfoObject?.renderingMode}isPegaMobile(){return!!window.pms?.plugins?.c11n_spa||!!window.pms?.plugins?.c11n}shouldUseURLParams(){return"FULL_PORTAL"===this.environmentInfoObject?.renderingMode&&this.getFeatureMap()?.pyUseURLParams}getBuiltOnAppNames(){return this.environmentInfoObject?.pxApplication?.pyBuiltOnApplications}setPreviewMode(){Vu.setPreviewMode()}setDefaultCasePage(e){this.pageName=e}getDefaultCasePage(){return this.pageName}disableAssignmentHeader(e){this.isAssignmentHeaderHidden=e}isAssignmentHeaderDisabled(){return this.isAssignmentHeaderHidden}getDefaultPortal(){return this.environmentInfoObject?.pxOperator?.pyDefaultPortal}updateFeatureMap(e){const t=this.environmentInfoObject?.features;return this.environmentInfoObject&&e&&(this.environmentInfoObject?.features?this.environmentInfoObject.features={...t,...e}:this.environmentInfoObject.features={...e}),this.getFeatureMap()}getFeatureMap(){return this.environmentInfoObject?.features||{}}setKeyMapping(e){return this.KeyMapping=e,this.KeyMapping}getKeyMapping(e){const t=this.KeyMapping[e];return void 0!==t?t:null}setCoexistenceMeta(e){return e&&(this.coexistenceMeta=e),this.getCoexistenceMeta()}getCoexistenceMeta(){return this.coexistenceMeta}isCoexistenceAppOfType(e){return!(!this.coexistenceMeta.isCoexistence||this.coexistenceMeta.appType!==e)}isOptimizedCaseLoadingEnabled(){return this.getFeatureMap().pyEnableOptimizedCaseLoading||this.getFeatureMap().optimizedCaseLoading||!1}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getClassesAccessList(){return this.environmentInfoObject?.pyClassesAccessList?.pxResults??[]}getUserSettings(){return this.environmentInfoObject?.pyUserSettings||null}getLocalizationVersion(){const e=this.getFeatureMap().pyLocalizationVersion,t=this.getFeatureMap().localizationVersion;return void 0!==t?t:void 0!==e?parseInt(e,10):1}getLocalizationBundles(e=this.locale){return $y.getLocalizationBundles(e)}getAvailableLocalePacks(){return this.getFeatureMap()?.availableLanguagePacks||void 0}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getEnablePriorityAndUrgencyImprovements(){return this.enablePriorityAndUrgencyImprovements}setEnablePriorityAndUrgencyImprovements(e){this.enablePriorityAndUrgencyImprovements=e}getInactivityTimeout(){const e=this.environmentInfoObject?.pxOperator?.pyAuthenticationTimeout;return e?Number(e):e}isUnifiedObject(){return this.environmentInfoObject?.features?.isUnifiedObject||!1}getRuntime(){return"undefined"!=typeof window&&window.document?"Browser":"Native"}getInlineEditActions(e){return this.environmentInfoObject?.pyInlineEditActions?.filter((t=>t.pyClassName===e)).map((e=>e.pyActionName))??[]}getInlineEditActionViews(e){return this.environmentInfoObject?.pyInlineEditActions?.filter((t=>t.pyClassName===e)).map((e=>e.pyViewName))??[]}getFullObjectDisplayTemplate(){return this.environmentInfoObject?.pyFullObjectDisplayTemplate??void 0}setFullObjectDisplayTemplate(e){this.environmentInfoObject&&(this.environmentInfoObject.pyFullObjectDisplayTemplate=e),Uu.publish(Gs.PUB_SUB_EVENTS.UI_EVENTS.CASE_VIEW_TEMPLATE_CHANGE,e)}},Wy=e=>"fulfilled"===e.status,Hy=async(e=Gy.getLocale())=>{try{await(async e=>{const t=Gy.getAvailableLocalePacks(),n=Gy.getLocalizationBundles(e);let s;if(e&&t&&t.includes(e)?s=[Cp("getLocalizationPack",{queryPayload:{locale:e}})]:n.length>0&&(s=n.map((e=>Cp("getLocalizationPack",{queryPayload:{version:e.pyBundleVersion,bundle:e.pyBundleName}})))),!s||0===s.length)return;const a=200,r=201,o=await Promise.allSettled(s),i=_A(e??"en-US");o.filter(Wy).forEach((({value:e})=>{if([a,r].includes(e.status)&&e.data){const t=e.data;Object.keys(t).forEach((e=>{i.setLocaleForRule(t[e],e)}))}}))})(e)}catch(e){console.warn(e)}};const qy=class{static regex=/\{@P[^}]*\s*:\s*[^}]*\}/g;static subRegex=/:'[a-zA-Z0-9!@#$&()\\-`.+,/\s"]*'/;static keyMap={};static formatLocaleKey(e){let t=0,n="";for(;t<=e.length;){const s=e.indexOf("{@P ",t);if(-1===s){n+=e.substring(t,e.length);break}n+=e.substring(t,s);const a=e.indexOf("}",t),r=e.substring(s,a+1),[o,i]=this.getKeyAndValue(r);this.addKeyToMap(o,i),n+=`${r.split(":")[0]}}`,t=a+1}return n}static getKeyAndValue(e){const t=e.indexOf(":"),n=e.indexOf("}");return[`${e.substring(0,t)}}`,e.substring(t+1,n)]}static addKeyToMap(e,t){this.keyMap[e]=t}static replaceWithValue(e){let t=0,n="";for(;t<=e.length;){const s=e.indexOf("{@P ",t);if(-1===s){n+=e.substring(t,e.length);break}n+=e.substring(t,s);const a=e.indexOf("}",t),r=e.substring(s,a+1);n+=this.keyMap[r],t=a+1}return n}};class zy{GENERIC_BUNDLE_KEY="@BASECLASS!GENERIC!PYGENERICFIELDS";FIELD_LABELS_BUNDLE_KEY="@BASECLASS!LABEL!PYFIELDLABELS";GENERIC_BUNDLE_KEY_LP="GENERIC!GENERICFIELDS";MESSAGE_BUNDLE_KEY="@BASECLASS!MESSAGE!PYMESSAGES";BASE_CLASS="@BASECLASS";DATA_PAGE_LOCALECONTEXT="datapage";constructor(){this.localeStore={},this.getLocaleValue=this.getLocaleValue.bind(this)}setLocaleForRule=(e,t)=>{const n=e.LocaleContent,s=t.toUpperCase();s.startsWith("@BASECLASS!DATAPAGE!")&&s.split(/[!#]/).length<4?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&"fields"in t&&this.updateLocaleStore(t,`${s}#${e}`.toUpperCase())})):"GENERIC!GENERICFIELDS"===s?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&this.sanitizeLocaleField(t,e.toUpperCase())})):this.sanitizeLocaleField(n,s)};updateLocaleStore=(e,t)=>{const n=e.fields||e,s=this.localeStore[t];s?AC.mergeDeep(n,s):n&&"object"==typeof n&&(this.localeStore[t]=n)};sanitizeLocaleField=(e,t)=>{["DASHBOARDSMANAGER","DATAEXPLORER","INSIGHT"].includes(t.toUpperCase())&&Object.entries(e).forEach((([,e])=>{null!==e&&"object"==typeof e&&"fields"in e&&this.updateLocaleStore(e,t)})),this.updateLocaleStore(e,t)};getLocaleForRule(e){return this.localeStore[e]}resetLocaleStore=()=>{this.localeStore={}};getLocaleValue(e,t,n,s){const a=this.#d(n,t),r=this.#p(e);r&&(e=qy.formatLocaleKey(e));const o=a?this.localeStore[a.toUpperCase()]??{}:{},i=s?this.localeStore[s.toUpperCase()]??{}:{};return"MESSAGES"===n?.toUpperCase()&&"string"==typeof e?this.getLocalizedErrorMessage(o,e)||e:r?qy.replaceWithValue(o[e]||i[e]||e):o[e]||i[e]||e}#d(e,t){return e?.toUpperCase().startsWith("@BASECLASS!DATAPAGE!")?t?`${e}#${t}`:e:e||t}getParagraphLocaleValue(e,t){const n=`${e}!${Gs.PARAGRAPH}!${t}`,s=this.localeStore[n.toUpperCase()];return s?{category:s.category,content:decodeURIComponent(atob(s.content).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join(""))}:null}getPortalLocaleReference(e){return 2!==Gy.getLocalizationVersion()?"":e?`PORTAL!${e}`.toUpperCase():`PORTAL!${Gy.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return 2}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=Gy.getUseLocale(),n=[],s=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!s[e]))).map((e=>e.toUpperCase()))).length>0){const s=e.map((e=>({localeRuleKey:e,promise:Lp.getSvcLocale(t,`${e}.json`)}))),a=await Promise.allSettled(s.map((e=>e.promise)));await Promise.all(a.map((async(e,t)=>{if("fulfilled"===e.status){const a=s[t];let r;try{r=await e.value.json()}catch{r=null}r&&n.push({localeRuleKey:a.localeRuleKey,jsonData:r})}})))}return n}async loadLocaleResources(e){await $y.loadLocaleBundle(e),await Promise.all(e.map((e=>Hy(e))))}setTimezone(e){this.timezone=e}getTimeZoneInUse(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return this.timezone||e}matchPatternWithText(e,t){let n=t;const s=[];for(let t=0;t<e.length;){const a=e[t];if(0!==a.length){const e=n.indexOf(a);if(-1===e)return null;if(t>0){const t=n.slice(0,e);s.push(t)}n=n.slice(e+a.length)}t+=1}return n&&s.push(n),s}getLocalizedErrorMessage(e,t){let n="";if(e[t])return e[t];for(const s of Object.keys(e)){const a=s.split(/\{\d+\}/),r=this.matchPatternWithText(a,t);if(r){const t=e[s];if(n=this.replacePlaceHolders(r,t),n)return n}}return n}replacePlaceHolders(e,t){for(let n=0;n<e.length;){if(!t.includes(`{${n+1}}`))return"";t=t.replace(`{${n+1}}`,e[n]),n+=1}return t}async isCurrentLocalePackAvailable(){const e=Gy.getLocale();return this.availableLangPacks||(this.availableLangPacks=await Lp.getSvcAvailableLocales()),e&&this.availableLangPacks.includes(e)}getBaseComponentLabels=()=>this.getLocaleForRule("COSMOSFIELDS");#p(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}}const Yy=e=>{const t=e??Gy.getLocale()??"en-US";return _A(t)};Po.registerHandler("@L",((e,t)=>t?t.getLocalizationService(t.getLocaleRuleName()).getLocalizedText(e):e)),Po.registerHandler("@P",((e,t,n)=>n?NC.getLitePropertyValue(n):t.getValue(e))),Po.registerHandler("@E",((e,t,n)=>{try{const s=ho(e),a=fo(s);return mo(a,t,n)}catch(e){}return!0})),Po.registerHandler("@W",((e,t,n)=>{let s;if(n){const{pageReference:t,context:a}=n;s=cC(t,`.${Gs.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,a)}else s=t.getContextDataValue(`.${Gs.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);return!0===s||"true"===s})),Po.registerHandler("@ASSOCIATED",((e,t)=>{let n={};const s=[];let a="",r="";const o=t.getPageReference();if(e.startsWith(".")){a=`${o}.${e.substring(1)}`;const s=e.split(".").filter((e=>!!e));s.length>1&&(s.pop(),r=s.join(".")),n=t.getFieldMetadata(e.substring(1))}else n=t.getFieldMetadata(e),a=e;const i=n?.datasource?.tableType,c=n?.datasource?.mode===Gs.READONLY,l=n?.datasource?.name||"",u=t.getComponentConfig();if(u&&u.deferDatasource&&("object"==typeof u.datasourceMetadata&&null!==u.datasourceMetadata||(u.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:u.datasourceMetadata})),i===Gs.DATA_PAGE))return null;if(i===Gs.DECISION||i===Gs.RULE_REFERENCE)return function(e,t){const n=Ro.getPropertyName(e?.propertyForDisplayText??""),s=Ro.getPropertyName(e?.propertyForValue??""),a=t.getContextDataValue(`.${Gs.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return a?.map((e=>({key:e[s]||e[`.${s}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==Gs.DATA_PAGE){const e=t.getLocalizationService(n?.localeReference);return n?.datasource?.records?.map((t=>({key:t.key,value:e.getLocalizedText(t.value)})))}const d=Ro.getPropertyName(n?.datasource?.propertyForDisplayText),p=Ro.getPropertyName(n?.datasource?.propertyForValue),g=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],h=t.getContextName(),f=[];if(g.forEach((e=>{if(Ro.isProperty(e?.value)){let t=iC(`.${AC.getFullPropertyReference([r,Ro.getPropertyName(e.value)])}`,o,h);f.push(AC.getFullPropertyReference([o,r,Ro.getPropertyName(e?.value)])),null!=t&&""!==t||(t=Gs.NULL_STRING),s.push(t)}else s.push(e?.value||Gs.NULL_STRING)})),h){const e=To.getContextObjectByName(h)||{};f.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,a])]}else e[t]=[a]})),To.addContextName(h,e)}const m=function(e,t,n,s){let a="",r=n;if(t.join(Gs.HASH_DELIMITER)&&(a=AC.getHashedString(t.join(Gs.HASH_DELIMITER)),r=n+Gs.UNDERSCORE_STRING+a),s){const e=rC(),t=e?e[n]?.[r]:{};return Array.isArray(t?.[ks.getDefaultQualifiedName("pxResults")])?t[ks.getDefaultQualifiedName("pxResults")]:[]}const o=e.getDataObject(),i=o?.[n]||{},c=i?.[r]||{};return Array.isArray(c?.[ks.getDefaultQualifiedName("pxResults")])?c[ks.getDefaultQualifiedName("pxResults")]:[]}(t,s,l,c),I=t.getLocalizationService();return m.map((e=>{let t=e[d]||e[`.${d}`];var n;return"string"==typeof t&&(n=t,t=I.getLocalizedDataPage(n,l,d)),{key:e[p]||e[`.${p}`],value:t}}))})),Po.registerHandler("@ROUTING_INFO",((e,t)=>Hr(t.getContainerName(),t.getContextName()))),Po.registerHandler("@ENV",((e,t)=>{switch(e){case Gs.ENV_INFO_KEYS.APPLICATION_NAME:return Gy.getApplicationName();case Gs.ENV_INFO_KEYS.ACCESS_GROUP:return Gy.getAccessGroup();case Gs.ENV_INFO_KEYS.APPLICATION_ID:return Gy.getApplicationID()||Gy.getApplicationName();case Gs.ENV_INFO_KEYS.USER_NAME:return Gy.getOperatorName();case Gs.ENV_INFO_KEYS.USER_ID:return Gy.getOperatorIdentifier();case Gs.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizationService().getLocalizedText(Gy.getApplicationLabel()||"");case Gs.ENV_INFO_KEYS.USER_IMAGE:return Gy.getOperatorImageInsKey();case Gs.ENV_INFO_KEYS.LOCALE:return Gy.getUseLocale();case Gs.ENV_INFO_KEYS.TIMEZONE:return Gy.getTimeZone();case Gs.ENV_INFO_KEYS.WORK_GROUP:return Gy.getOperatorWorkGroup();default:return e}})),Po.registerHandler("@DATASOURCE",((e,t)=>{const n=t.getSharedDataPageForReferenceList()||t.getValue(e)||[],s=t.getComponentConfig(),a=Object.keys(s).find((t=>s[t]?.source?.includes(e)));if(a){const{fields:e,copyAll:t,filterDownloadedFields:r}=s[a],o=[];return n.forEach((n=>{const s={};t||r?Object.keys(n).forEach((e=>{const t=Ro.getPropertyName(e);s[t]=n[t]})):Object.keys(e).forEach((t=>{const a=Ro.getPropertyName(e[t]);s[t]=n[a]})),o.push(s)})),o}return[]})),Po.registerHandler("@FIELD_META",((e,t)=>{let n,s={};if(s=e.startsWith(".")?t.getFieldMetadata(e.substring(1)):t.getFieldMetadata(e),s&&s.datasource&&s.datasource.parameters){let a="";const r=e.split(".").filter((e=>!!e));if(r.length>1&&(r.pop(),a=`.${r.join(".")}`),Array.isArray(s.datasource.parameters)){const e=[];s.datasource.parameters.forEach((n=>{const s={},{name:r,value:o}=n;s.name=r,"string"==typeof o&&o.startsWith("@P")?s.value=`@P ${a}${o.substring(3)}`:s.value=o,e.push(t.resolveConfigProps(s))})),n=e}else n=t.resolveConfigProps(s.datasource.parameters);s={...s,datasource:{...s.datasource,parameters:n}}}return s})),Po.registerHandler("@USER",((e,t,n)=>{const s=n?NC.getLitePropertyValue(n,e):t.getValue(e),a=n?NC.getReferencedUser(s,n):t.getReferencedUser(s);return{userId:s,userName:a?a.UserName:null}})),Po.registerHandler("@ACTIVE_CASES",((e,t)=>mh.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),Po.registerHandler("@LR",(e=>e)),Po.registerHandler("@CASE",((e,t)=>e===Gs.ID?t.getCaseInfo().getKey():e)),Po.registerHandler("@SHARED",(e=>of.getSharedState(e))),Po.registerHandler("@PARAGRAPH",((e,t)=>{const{useDecision:n,isBanner:s,messageType:a,dismissBanner:r}=lf.getParagraphProperties(e,t),o=lf.hasDecisionBannerContent(e,t);return n&&o?lf.processBannerDecisionParagraph(e,t):s?{htmlContent:lf.processParagraph(e,t),messageType:a,dismissBanner:r}:lf.processParagraph(e,t)})),Po.registerHandler("@FORMAT",((e,t)=>{const n=t.getCurrentClassID(),s=BA(e,n);if(!s?.dynamicContents?.length)return null;const{dynamicContents:a}=s;for(let e=0;e<a.length-1;e+=1)if(NC.resolveWhen(a[e].when,t))return{pattern:a[e].content};return{pattern:a[a.length-1].content}})),Po.registerHandler("@FILTERED_LIST",((e,t)=>{const n=e.substring(1,e.indexOf("[")),s=e.substring(e.indexOf("]")+2),a=e.substring(e.indexOf("[")+1,e.indexOf("]"));if(!t)return null;const{useCustomContext:r}=t;let o;return AC.isEmpty(r)?o=t.getValue(`.${n}`):(o=r,o=AC.getIn(o,n)),o&&s.length>0?(a&&(o=o.filter((e=>Io(a,e)))),o.map((e=>AC.getIn(e,s)))):null})),Po.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.[ks.getDefaultQualifiedName("pyCountry")];return n?`${PCore.getDefaultQualifiedName("pyAddressForm")}_${n}`:PCore.getDefaultQualifiedName("pyAddressForm")})),Po.registerHandler("@DATATYPE",((e,t)=>t.getValue(e))),Po.registerHandler("@ATTACHMENT",((e,t,n)=>{let s;return s=n?NC.getLitePropertyValue(n):t.getValue(e),ip.prepareAttachmentData(s)}));const Ky=e=>{const t=e.lastIndexOf(".");return t<0?e:e.slice(t+1)};function Qy(e,t){const n=e.authorContext;if("string"!=typeof n||!n)return!1;return(n.startsWith(".")?n.substring(1):n)===t}function Jy(e,t){const n=e.config;if(!n?.name||"string"!=typeof n.name)return null;const s=t(n.name);return s?Array.isArray(s)?s.find((e=>e.classID===n.ruleClass))??null:s:null}function Xy(e,t,n,s="root",a=[]){if(e.config&&function(e,t){const n="string"!=typeof(s=e.value)?null:s.startsWith("@")?s.replace(/^@\w+\s+\./,""):null;var s;return!!n&&n===t}(e.config,t)&&a.push({type:e?.type,config:e.config,path:s}),!e.children)return a;for(let r=0;r<e.children.length;r+=1){const o=e.children[r],i=`${s}.children[${r}]`,c="reference"===o.type?Jy(o,n):o;c&&Xy(c,t,n,i,a)}return a}Po.registerHandler("@FL",((e,t)=>{const n=(e=>e.startsWith(".")?e.slice(1):e)(e),s=t.getFieldMetadata(n);return s&&s.label?t.getLocalizationService(s.localeReference).getLocalizedText(s.label):Ky(n)})),Po.registerHandler("@DEFERRED",((e,t)=>{const n=t.getFieldMetadata(e);return n?.isDeclarativeTarget?{isDeferred:!0,propertyName:e}:t.getValue(e)})),Po.registerHandler("@GENAICOACH",((e,t)=>$A(e,t.getCurrentClassID()))),Po.registerHandler("@AIAGENT",((e,t)=>{const n=GA(e,t.getCurrentClassID());if(n)return n;const s=t.getComponentConfig();if(s){const n=s?.coaches?.find((t=>t?.config?.coach?.substring(9)===e&&t?.config?.ruleNamespace))?.config;if(n?.label){const s={label:n.label};t.resolveConfigProps({label:n.label},s);const a=s.label;return{insName:Gy.getFeatureMap()?.isNamespaceEnabled&&e.includes(Gs.DOUBLE_UNDERSCORE_STRING)?e:`${n.ruleNamespace}${Gs.DOUBLE_UNDERSCORE_STRING}${e}`,label:t.getLocalizedValue(a),type:"agent"}}}return null})),Po.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),s=t.getContextName(),a=t.getPageReference();Fh.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",a,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:`${a.replace("caseInfo.content","")}${e}`,resetForm:!0}),`${a}${e}`,`${s}/${a}`,s)})),Po.registerHandler("@DW",((e,t,n)=>{let s;const a=`${Gs.CONTEXT_DATA}.${Gs.SUMMARY_OF_DYNAMIC_WHENS}.${e}`;if(n){const{context:e}=n??{};s=iC(a,null,e)}else s=t.getValue(a);return!0===s||"true"===s})),Po.registerHandler("@CA",((e,t,n)=>n?NC.getLitePropertyValue(n):t.getValue(e)));const Zy=new Set(["autocomplete","dropdown"]),eA=["displayAs","hideLabel","linkReference","localeReference","matchPosition","referenceType","selectionMode"];function tA(e,t,n){const s=t.config,a=function(e){const t=e.config??{},n={};return eA.forEach((e=>{void 0!==t[e]&&(n[e]=t[e])})),void 0===t.contextClass&&void 0===t.targetObjectClass||(n.contextClass=t.contextClass??t.targetObjectClass),void 0!==t.referenceList&&(n.referenceList=t.referenceList),n.parameters=t.parameters,n}(e),r=function(e){const t=e.inheritedProps;return Array.isArray(t)?t.reduce(((e,t)=>("object"!=typeof t||null===t||Array.isArray(t)||"prop"in t&&"string"==typeof t.prop&&"value"in t&&(e[t.prop]=t.value),e)),{}):{}}(n),o={...s??{},...a,...r};return"AutoComplete"===t.type&&void 0!==a.referenceList&&(o.datasource=a.referenceList),o}function nA(e,t,n,s){try{if(!e.name||"string"!=typeof e.name)return null;const t=s(e.name);let a;if(Array.isArray(t))a=t;else{if(!t)return null;a=[t]}const r=a.find((t=>t.classID===e.ruleClass));if(!r||!function(e){const t=e.config;return!!t&&"DataReference"===t.template&&"string"==typeof t.displayAs&&Zy.has(t.displayAs.toLowerCase())}(r))return null;const o=function(e){const t=e?.children;return Array.isArray(t)&&t.length>0?t[0]:null}(r);return o?{type:o.type,config:tA(r,o,e),path:n}:null}catch{return null}}function sA(e,t,n,s="root",a=[]){if(e.config&&Qy(e.config,t)){const t=nA(e.config,e.type,s,n);t&&a.push(t)}if(!e.children)return a;for(let r=0;r<e.children.length;r+=1){const o=e.children[r],i=`${s}.children[${r}]`,c="reference"!==o.type||o.config&&Qy(o.config,t)?o:Jy(o,n);c&&sA(c,t,n,i,a)}return a}function aA(e,t,n){const s=Gy.getInlineEditActionViews(t),a=function(e,t){if(!e||"object"!=typeof e)return null;if(Array.isArray(e))return e.find((e=>e.classID===t))??null;return e}(n(s&&s.length>0?s[0]:ks.getDefaultQualifiedName("pyEdit")),t);if(!a)return[];const r=Xy(a,e,n,"root");return r.length>0?r:sA(a,e,n)}const rA={},oA={},iA={};let cA=0,lA=!1;const uA={},dA={},pA={},gA={},hA={},fA={},mA={},IA={},EA={},yA={},AA={},CA=(e={},t={})=>{0!==Object.keys(t).length?Object.keys(e).forEach((n=>{const s=e[n],a=t[n];a?((e,t,n,s)=>{const a=Array.isArray(n)?n:[n];(Array.isArray(s)?s:[s]).forEach((e=>{const t=a.findIndex((t=>t.classID===e.classID));if(-1===t)a.push(e);else{const n={isDeclarativeTarget:!1},s={...a[t],...n,...e};a[t]=s}})),t[e]=1===a.length?a[0]:a})(n,t,a,s):t[n]=s})):AC.copy(e,t)},SA=(e,t="")=>{if(!e)return null;const n=dA[e];if(!n)return null;if(!t)return AC.deepClone(n);let s;return s=Array.isArray(n)?n.find((e=>e.classID.toLowerCase()===t.toLowerCase()))||null:n.classID.toLowerCase()===t.toLowerCase()||("Page"===n.type||"Page List"===n.type)&&n?.pageClass?.toLowerCase()===t.toLowerCase()?n:null,s?AC.deepClone(s):null},_A=e=>(yA[e]||(yA[e]=new zy),yA[e]),NA=(e,t)=>(AA[e]||(AA[e]=t()),AA[e]),TA=(e,t,n,s=[])=>{if(!t||!e)return null;if(!e.includes(".")){let a;const r=SA(e,t);return s.length&&(a=s.join(".")),{...r,embeddedType:n,category:a}}const[a,...r]=e.split("."),o=SA(a,t);return o&&s.push(o.label),TA(r.join("."),o?.pageClass,o?.type,s)},DA=e=>{0!==Object.keys(e).length&&(CA(e,iA),lA&&(cA+=1))},PA=()=>cA,OA=()=>{lA=!0},RA=()=>{lA=!1},bA=e=>{CA(e,uA)},vA=e=>{(e=>{e.views&&Object.keys(e.views).length>0&&(CA(e.views,iA),lA&&(cA+=1)),e.navigations&&CA(e.navigations,uA),e.personalizations&&CA(e.personalizations,gA),e.insights&&CA(e.insights,hA),e.paragraphs&&CA(e.paragraphs,rA),e.formats&&CA(e.formats,oA),e.dataTypes&&CA(e.dataTypes,fA),e.datapages&&CA(e.datapages,mA),e.genAICoaches&&CA(e.genAICoaches,IA),e.AIAgents&&CA(e.AIAgents,EA)})(e),(e=>{const t=e.fields||{};Object.keys(t).forEach((n=>{const s=t[n];if(Array.isArray(s)){if(s.forEach((t=>{e.datapages&&t.datasource&&"DataPage"===t.datasource.tableType&&(t.datasource.mode=e.datapages?.[t.datasource.name].mode);const s=If(hf,n,t.definedOnClassID??t.classID);t.localeReference=s})),1===s.length){const[e]=s;t[n]=e}}else e.datapages&&s?.datasource&&"DataPage"===s.datasource.tableType&&(s.datasource.mode=e.datapages[s.datasource.name].mode)}))})(e);const{datapages:t={}}=e;Object.keys(t).forEach((e=>{pA[e]=t[e]})),CA(e.fields,dA)},xA=e=>iA[e],wA=(e,t)=>{const n=iA[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},MA=e=>uA[e],LA=e=>e in pA?pA[e]:null,UA=e=>e in gA?gA[e]:null,FA=e=>e in hA?hA[e]:null,VA=e=>{const t={};return Object.keys(dA).forEach((n=>{const s=dA[n];let a;Array.isArray(s)?a=s.find((t=>e===t.classID)):e===s.classID&&(a=s),a&&(t[n]=AC.deepClone(a))})),t},jA=(e,t)=>{const n=SA(e,t),s=n?.datasource?.parameters;return s?AC.deepClone(s):null},kA=(e,t)=>{let n=null;const s=rA[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?AC.deepClone(n):null},BA=(e,t)=>{let n=null;const s=oA[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?AC.deepClone(n):null},$A=(e,t)=>{let n=null;const s=IA[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?AC.deepClone(n):null},GA=(e,t)=>{let n=null;const s=EA[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?AC.deepClone(n):null},WA=e=>{if(e in fA){const{savableDataPage:t}=fA[e];return t}return null},HA=e=>{const t=mA[e];if(!t)return null;const{classID:n,isAlternateKeyStorage:s,parameters:a}=t;if(s)return a.map((e=>({keyName:e.name,isAlternateKeyStorage:s,linkedField:e.linkedField})));const r=fA[n];return r?r.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:s}))):[]},qA=e=>{if(e in fA){const{lookupDataPage:t}=fA[e];return t}return null},zA=e=>{if(Object.hasOwn(fA,e)){const{lookupDataPageInfo:t}=fA[e];return t}return null},YA=(e,t)=>{const n=e.split("."),s=n.pop(),a=new Uf({options:{pageReference:`${n.join(".")}`,context:t}}),r=SA(s,a.getCurrentClassID())?.additionalInformation;if(!r?.includes("@PARAGRAPH"))return r;const o=Ro.trimAnnotation(r);return lf.processParagraph(o,a)},KA=(e,t)=>{const n=e.split("."),s=n.pop(),a=new Uf({options:{pageReference:`${n.join(".")}`,context:t}}),r=SA(s,a.getCurrentClassID()),o={};return a._classID=a.getCurrentClassID(),a.resolveConfigProps(r,o),o},QA=(e,t)=>aA(e,t,xA);class JA{constructor(){this.name="CascadeManager",this.cascadeSubscribers={},this.cascadeResetSubscribers={},this.listChangeSubscribers=[]}registerResetDependencies(e,t,n,s,a,r="singleRecord"){if(!e||!n||!s?.length)return;const o=n.startsWith(".")?`${t}.${n.substring(1)}`:n,i=this.cascadeResetSubscribers[e]||{},c=this._handlePageReference(t,n,a);s.forEach((e=>{if(!e)return;let t=e.startsWith(".")?e.substring(1):e;if(t=AC.getFullPropertyReference([c,t]),t in i){const e=i[t];e.find((e=>e.propertyName===o))||e.push({propertyName:o,mode:r})}else i[t]=[{propertyName:o,mode:r}]})),Object.keys(i).length>0&&(this.cascadeResetSubscribers[e]=i)}deregisterResetDependencies(e,t,n,s,a){if(!e||!n||!s?.length)return;const r=n.startsWith(".")?`${t}.${n.substring(1)}`:n,o=this.cascadeResetSubscribers[e]||{},i=this._handlePageReference(t,n,a);s.forEach((e=>{if(e){let t=e.startsWith(".")?e.substring(1):e;if(t=AC.getFullPropertyReference([i,t]),t in o){const e=o[t];AC.removeExistingDependentProperty(e,r)}}})),Object.keys(o).length>0&&(this.cascadeResetSubscribers[e]=o)}getResetDependencies(e,t){return this.cascadeResetSubscribers[e]?.[t]||[]}purgeResetDependencies(e){e&&this.cascadeResetSubscribers[e]&&delete this.cascadeResetSubscribers[e]}registerFields(e,t,n,s,a){this.cascadeSubscribers[e]=this.cascadeSubscribers[e]||{},n?.forEach((n=>{this.cascadeSubscribers[e][`${t}${n}`]=this.cascadeSubscribers[e][`${t}${n}`]||{};const r=this.cascadeSubscribers[e][`${t}${n}`];if(!r[a]){r[a]=s;const o=iC(n,t,e);r.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,s,a){const r=JA._getFieldsForList(e,t,n);r.length>0&&(this.registerFields(e,t,r,s,a),kg.enableCascade(e))}unRegisterListField(e,t,n,s){const a=JA._getFieldsForList(e,t,n);a.length>0&&this.unRegisterFields(e,t,a,s)}static _getFieldsForList(e,t,n){const s=[],a=SA(n,iC("classID",t,e));return a&&!Array.isArray(a)&&a.datasource&&a.datasource.parameters&&Object.values(a.datasource.parameters).forEach((e=>{if(Ro.isProperty(e)){const t=Ro.trimAnnotation(e);s.push(t)}})),s}unRegisterFields(e,t,n,s){this.cascadeSubscribers[e]&&n?.forEach((n=>{if(!this.cascadeSubscribers[e][`${t}${n}`])return;const a=this.cascadeSubscribers[e][`${t}${n}`];a[s]&&delete a[s]}))}triggerCascade(e,t,n,s){let a=!1;this.cascadeSubscribers[e]&&this.cascadeSubscribers[e][t]&&(Object.keys(this.cascadeSubscribers[e][t]).forEach((r=>{const o=this.cascadeSubscribers[e][t];"previousValue"!==r&&o.previousValue!==n&&(a=!0,s?s.add(o[r]):o[r](t,n))})),a&&(this.cascadeSubscribers[e][t].previousValue=n))}purgeCascadeFields(e){delete this.cascadeSubscribers[e]}handleServerChanges(e,t=[],n=[]){if(!e)return;const s=new Set;n.forEach((t=>{const n=iC(t,"",e);this.triggerCascade(e,t,n,s)})),s.forEach((e=>{e()})),0!==this.listChangeSubscribers.length&&0!==t.length&&t.forEach((t=>{this.listChangeSubscribers.forEach((n=>{const s=iC(t,"",e);n(e,t,s)}))}))}_updateChangedProperties(e,t,n,s,a,r,o,i){const c=n&&i.some((e=>s.startsWith(e)));if(e!==t||c){const e=s.lastIndexOf("."),t=s.substring(0,e),i=s.substring(e),c=wu.getMessages({type:"error",property:i,context:a,pageReference:t});if(c?.length>0&&o.push(s),!n)return;r.push(s)}}isChangedListPropertyExist(e){let t=!0;return 0!==this.listChangeSubscribers.length&&AC.isValidPageListProperty(e)||(t=!1),t}_getServerProperties(e,t,n,s,a,r,o){if("object"!=typeof e){a.push(n.replace(/\.(\d+)/g,"[$1]"));const i=this.isChangedListPropertyExist(n);n=n.replace(/\.(\d+)/g,"[$1]");const c=iC(n,"",t);if(void 0===c&&!e&&0!==e)return;return void this._updateChangedProperties(c,e,i,n,t,s,r,o)}const i=Object.keys(e??{});for(let c=0,l=i.length;c<l;c+=1){const l=i[c],u=`${n}.${l}`;if(Array.isArray(e[l])){const n=iC(u,"",t);n&&n?.length===e[l].length||o.push(u.replace(/\.(\d+)/g,"[$1]"))}this._getServerProperties(e[l],t,u,s,a,r,o)}}getServerProperties(e,t,n=Gs.CASE_INFO.CASE_INFO_CONTENT){const s=[],a=[],r=[],o=AC.getIn(e,n);return o&&t?(this._getServerProperties(o,t,n,s,r,a,[]),{changedListProperty:s,leafProperty:r,changedPropertyWithError:a}):{changedListProperty:s,leafProperty:r,changedPropertyWithError:a}}_handlePageReference(e,t,n){let s=e;if("Page"===n&&t.startsWith(".")&&t.slice(1).includes(".")){s=`${e}${t.substring(0,t.lastIndexOf("."))}`}return s}registerForListChanges(e=(()=>{})){this.listChangeSubscribers.push(e)}unRegisterForListChanges(){this.listChangeSubscribers=[]}}const XA=new JA;let ZA=null;const eC=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),tC=e=>{ZA=e},nC=()=>ZA,sC=e=>{if(!e)return;let t=[],n=[],s=[];if(Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:s}=XA.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),ZA?.dispatch(e),!Array.isArray(e)&&"MERGE_DATA"===e.type){if(s.length&&!e.payload.skipValidation){s.map((e=>{const t=e.lastIndexOf(".");return{property:e.substring(t),pageReference:e.substring(0,t)}})).forEach((({property:t,pageReference:n})=>{wu.clearMessages({type:"error",property:t,pageReference:n,context:e.payload.context});const s=yu.getFieldReferenceForProperty(e.payload.context,`${n}${t}`);if(s){const e=NC.resolveContextTreeNodeProps(s.props);hp.validate(e.componentName?.toLowerCase(),e.propertyName,NC.getLitePropertyValue(e,e.propertyName),e)}}))}XA.handleServerChanges(e.payload.context,t,n)}},aC=e=>nC()?.getState().data?.[e],rC=()=>nC()?.getState().data[Gs.SHARED],oC=(e,t,n)=>{if(!(s=e)||s.startsWith('"')||s.startsWith("'"))return(e=>e&&e.trim().substring(1,e.length-1))(e);var s;const a=e?.startsWith(".")?t+e:e,r=eC(a);return AC.getIn(n,r)},iC=(e,t,n)=>oC(e,t,aC(n)),cC=(e,t,n)=>oC(t,e?`${Gs.CONTEXT_DATA}.${e}`:`${Gs.CONTEXT_DATA}`,aC(n)),lC=(e,t,n)=>((e,t,n)=>{const s=eC(`${t}.${n}`);return AC.getIn(e,s)})(aC(n),`${Gs.CONTEXT_DATA}.${e}`,t),uC=e=>{const{context:t}=e,n=nC()?.getState().data[t];if(n)return Ea;const{action:s}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(s)?wa:Ea},dC=(e,t)=>{const n=eC(t);return AC.deleteIn(e,n)},pC=e=>!Array.isArray(e)&&"object"==typeof e,gC=(e,t=[],n=[])=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&!n.includes(t.path)&&AC.setIn(e,t.path,[]):AC.setIn(e,t.path,{})})),n.length>0&&AC.rearrangeProperties(n,e)},hC=(e,t,n={})=>{const{isArrayDeepMerge:s,propertiesToReplace:a=[],propertiesToReArrange:r=[]}=n;Array.isArray(e)&&!t&&(t=[]),gC(e,a,r);const o=(e,t)=>{if(pC(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return Array.isArray(t)?t:Us(e,t,o);if(Array.isArray(e)&&null!==t&&Array.isArray(t)){if(s)return Us(e,t,o);{const n=t.length;if(void 0===s&&n===e.length)return Us(e,t,o)}}return""===t&&e&&"object"==typeof e?e:t};return o(e,t)},fC=(e,t,n,s={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:a}=s,r=eC(t);if("object"==typeof n){const t=hC(AC.getIn(e,r),n,{isArrayDeepMerge:a});return AC.setIn(e,r,t)}return AC.setIn(e,r,n)},mC=(e,t,n)=>{const s=eC(t);return AC.setIn(e,s,n)},IC=()=>{const e=hr,{promise:t,actionMgrID:n}=zp.actionManagerPromise(e);return sC({type:e,payload:{actionMgrID:n}}),t},EC=e=>{const t=nC()?.getState();return!!t?.data?.[e]};class yC{static mergeDeep(e,t){return Us(t,e)}static hasIn(e,t){return $n(e,t)}static getIn(e,t,n){return Gn(e,t,n)}static setIn(e,t,n){return Kn(e,t,n)}static deleteIn(e,t){return Vn(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return Vs(e)}static deepClone(e={}){return JSON.parse(JSON.stringify(e))}static copy(e,t){Object.keys(e).forEach((n=>{t[n]=e[n]}))}static isPropertyRef(e){if(!e||!e.includes("."))return!1;for(let t=0;t<e.length;t+=1)if(" @#$%=!<>/\\".includes(e[t]))return!1;return!0}static isValidPropertyReference(e){return"string"==typeof e&&(""===e||""!==e.trim())}static isWhenExist(e){const t=["visibility","disabled","readOnly","required"];let n=!1;for(const s of Object.keys(e)){const a=e[s];a&&"object"==typeof a&&!Array.isArray(a)?n=n||yC.isWhenExist(a):t.includes(s)&&"string"==typeof a&&a?.startsWith("@W ")&&(n=!0)}return n||"multirecordlist"!==e?.type||"Editable"!==e?.renderMode||(n=Object.keys(e?.allowActions??{}).some((t=>"string"==typeof e?.allowActions?.[t]&&e.allowActions[t]?.startsWith("@W ")))),n}static getWhenNames(e){const t=["visibility","disabled","readOnly","required"];let n="";const s=new Set;if(e&&Object.keys(e).forEach((a=>{const r=e[a];t.includes(a)&&"string"==typeof r&&r.startsWith("@W ")&&(n=Ro.trimAnnotation(r),s.add(n))})),"multirecordlist"===e?.type&&"Editable"===e?.renderMode){const t=e?.allowActions??{};Object.keys(t).forEach((e=>{"string"==typeof t[e]&&t[e]?.startsWith("@W ")&&(n=Ro.trimAnnotation(t[e]),s.add(n))}))}return[...s]}static isExpressionExist(e){const t=["disabled","visibility","readOnly","required"];let n=!1;for(const s of Object.keys(e))t.includes(s)&&"string"==typeof e[s]&&e[s]?.startsWith("@E ")&&(n=!0);return n}static buildDataObject(e,t){let n={};const s=n;if(t.indexOf(".")>0){t.split(".").forEach((e=>{if(e.includes("[")){const[t]=e.split("[");n[t]=[],n=n[t],e=e.substring(e.indexOf("[")+1,e.lastIndexOf("]"))}n[e]={},n=n[e]}))}else n[t]={},n=n[t];return Object.keys(e).forEach((t=>{let s=t;t.startsWith(".")&&(s=t.substring(1)),n[s]=e[t]})),s}static buildObject=(e,t,n)=>{if(void 0===n)return;const s=e.split(".");let a=0;for(;a<s.length-1;a+=1){const e=s[a];e?.toString().length&&!t[e]&&(t[e]={}),t[e]&&(t=t[e])}"object"==typeof n?(t[s[a]]||(t[s[a]]=Array.isArray(n)?[]:{}),hC(t[s[a]],n,{isArrayDeepMerge:!0})):t[s[a]]=n};static getHashedString(e){return(0,hn.crc32)(e).toString(16)}static getPropertyName(e){if(e){const t=e.startsWith("@P"),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getPropertyNameFromDependency(e){return"string"==typeof e?e:e.propertyName}static isValidJson(e){try{return JSON.parse(e)}catch(e){return console.error("not a Valid JSON",e),!1}}static isEqual(e,t){return sn(e,t)}static isContains(e,t){const n=Object.keys(e);for(let s=0;s<n.length;s+=1)if(e[n[s]]&&yC.isEqual(e[n[s]],t))return!0;return!1}static removeExistingDependentProperty(e,t){const n=e.findIndex((e=>e.propertyName===t));n>=0&&e.splice(n,1)}static getFullPropertyReference(e){return Array.isArray(e)?e.filter((e=>!!e)).join("."):""}static iterateLeafNodes(e,t){const n=(e,s=[])=>{Object.entries(e).forEach((([a,r])=>{s.push(Array.isArray(e)?Number(a):a),Array.isArray(r)?r.forEach(((e,t)=>{s.push(t),n(e,s),s.pop()})):"object"==typeof r?n(r,s):t(s.slice(),r),s.pop()}))};n(e)}static resolveStringBooleans(e){const t=["required","readOnly","visibility"];return Object.keys(e).forEach((n=>{t.includes(n)&&"string"==typeof e[n]&&(e[n]="true"===e[n])})),e}static generateUniqueID(){return crypto.randomUUID()}static unflatten(e){const t={};return Object.entries(e).forEach((([e,n])=>{const s=e.split(".");let a;s.reduce(((e,t,r)=>(a=e[t]?e[t]:Number.isNaN(Number(s[r+1]))?s.length-1===r?n:{}:[],e[t]=a,e[t])),t)})),t}static flatten(e,t,n){t||(t=""),Array.isArray(e)?e.forEach(((e,s)=>{yC.flatten(e,`${t}[${s}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((s=>{const a=t?`${t}.${s}`:s;yC.flatten(e[s],a,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=e.startsWith(Gs.OBJECT_INFO.OBJECT_INFO)?`${e}${t}`.replace(Gs.OBJECT_INFO.OBJECT_INFO_CONTENT,""):`${e}${t}`.replace(Gs.CASE_INFO.CASE_INFO_CONTENT,"").replace(Gs.DATA_INFO.DATA_INFO_CONTENT,"");return Ad.formatPageReference(n)}static convertPageRefToClipboardPageNotation(e){return e.replace(/\[\d+\]/g,(e=>e.replace(/\d+/g,(e=>`${parseInt(e,10)+1}`)).replace("[","(").replace("]",")")))}static convertClipboardPageToPageRefNotation(e){return e.replace(/\(\d+\)/g,(e=>e.replace(/\d+/g,(e=>""+(parseInt(e,10)-1))).replace("(","[").replace(")","]")))}static segmentsMatch=(e,t)=>{const n=e.split("."),s=t.split(".");return n.length===s.length&&n.every(((e,t)=>{if(e===s[t])return!0;if(e.endsWith("()")){const n=e.slice(0,-2),a=s[t];return a.startsWith(n)&&/^\[\d+\]$/.test(a.slice(n.length))}return!1}))};static isString(e){return"string"==typeof e}static rejectPendingActions(e){return e.forEach((e=>e.payload.actionMgrID&&zp.rejectActionByID(e.payload.actionMgrID))),!0}static isValidAnnotation(e){const t=new Set(["@DATASOURCE","@ACTIVE_CASES","@ADDRESS","@ASSOCIATED","@ATTACHMENT","@CASE","@FILTERED_LIST","@PARAGRAPH","@P","@ROUTING_INFO","@USER","@W","@E","@SHARED","@CA"]),n=e.indexOf(" "),s=e.substring(0,n);return t.has(s)}static trimDotForProperty(e){return"string"==typeof e&&e.startsWith(".")?e.substring(1):e}static decodeHtmlEntities(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}static convertObjectWithStringToBoolean(e){if(e&&!Array.isArray(e)&&"object"==typeof e)return Object.keys(e).forEach((t=>{let n;const s=e[t];"string"==typeof s?n="true"===s||"false"!==s&&s:"object"==typeof s?(n=s,yC.convertObjectWithStringToBoolean(s)):n=s,e[t]=n})),e}static rearrangeProperties(e,t){e.forEach((e=>{let n=yC.getIn(t,e);if(!n)return;const s=Object.hasOwn(n,ks.getDefaultQualifiedName("pyCount"));if(s&&(n=n.pxResults),!n)return;const a=n.filter((e=>!e.error)),r=n.filter((e=>e.error));yC.setIn(t,s?`${e}.pxResults`:e,[...a,...r])}))}static getETag(e){if(!e)return;let t=e;const n=t?.split("/")||[],s=["workarea","modal","actionarea"],a=n.findIndex((e=>s.some((t=>e.startsWith(t)))));return-1!==a&&(t=n.slice(0,a+1).join("/")),nC()?.getState()?.data[t]?.caseInfo?.headers?.etag}static PAGELIST_PATH_REGEX=/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/;static isValidPageListProperty(e){return yC.PAGELIST_PATH_REGEX.test(e)}static generateDataPageHashWithParameters(e,t,n){const s=[];let a="";const r=n.getPageReference(),o=n.getContextName();Object.keys(e).forEach((t=>{const n=e[t];let a=Ro.isProperty(n)?iC(`.${Ro.getPropertyName(n)}`,r,o):n;null!=a&&""!==a||(a=Gs.NULL_STRING),s.push(a)}));let i=t;const c=s.join(Gs.HASH_DELIMITER);return c&&(a=yC.getHashedString(c),i=t+Gs.UNDERSCORE_STRING+a),i}static parsePegaDateTimeToTimestamp(e){if(!e)return null;const t=e.replace(" GMT","").match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})\.(\d{3})$/);if(!t){const t=new Date(e).getTime();return Number.isNaN(t)?null:t}const[,n,s,a,r,o,i,c]=t.map(Number);return new Date(n,s-1,a,r,o,i,c).getTime()}static formatToUTCDate(e,t){if(!e)return e;const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=(e,t=2)=>String(e).padStart(t,"0"),a=n.getUTCFullYear(),r=s(n.getUTCMonth()+1),o=s(n.getUTCDate());if("Date"===t)return`${a}${r}${o}`;return`${a}${r}${o}T${s(n.getUTCHours())}${s(n.getUTCMinutes())}${s(n.getUTCSeconds())}.${s(n.getUTCMilliseconds(),3)} GMT`}static isLeafProperty(e){return Boolean(e)&&!e.includes(".")}static getMetadataType(e,t,n){const s=yC.isLeafProperty(e)?SA(e,t):n.getFieldMetadata(e);return Array.isArray(s)?s[0]?.type:s?.type}static toStringParameterValue(e){return"string"==typeof e?e:e instanceof Date?e.toISOString():null}static resolveParameterValue(e,t,n,s,a){if(n&&Object.hasOwn(n,e))return n[e];if(!hg.isProperty(t))return t;const r=null!==a?hg.getPropertyName(t):hg.getLeafPropertyName(t);return s.getValue(`.${r}`)}static formatParameterValue(e,t,n,s,a){if(!hg.isProperty(t))return e;const r=null!==s?hg.getPropertyName(t):hg.getLeafPropertyName(t);if(!r)return e;const o=yC.getMetadataType(r,a,n);if(!o)return e;const i=yC.toStringParameterValue(e);return"Date"===o?i?i.includes("T")?yC.formatToUTCDate(i,"Date"):yC.formatToUTCDate(`${i}T00:00:00Z`,"Date"):e:"DateTime"===o&&i?yC.formatToUTCDate(i,"DateTime"):e}static resolveAndFormatParameters(e,t,n,s,a){const r={};for(const o of Object.keys(e)){const i=e[o];if("string"!=typeof i)r[o]=i;else{const e=yC.resolveParameterValue(o,i,a,t,n);r[o]=yC.formatParameterValue(e,i,t,n,s)}}return r}static normalizePropertyRef(e){const t=e.replace(/\[\d+\]/g,"");return t.startsWith(".")?t.substring(1):t}static resolvePageClass(e,t){if(!t)return;const n=(e=this.normalizePropertyRef(e)).split(".");let s;s=n.length>1?n.slice(0,-1):n;let a=t;for(const e of s){const t=SA(e,a);if(!t)return;if(Array.isArray(t)&&t[0]?.pageClass?a=t[0].pageClass:!Array.isArray(t)&&t.pageClass&&(a=t.pageClass),!a)return}return a}static isNestedObject(e){return ms(e)&&!Array.isArray(e)}static pruneKeys=(e,t,n=!1)=>{if(!H(e))return e;const s=t instanceof Set?t:new Set(t);return n?(yC.isNestedObject(e)?Object.keys(e).forEach((t=>{const n=e[t];if(s.has(t)){const n=Object.getOwnPropertyDescriptor(e,t);n&&n.configurable?delete e[t]:Reflect.set(e,t,void 0)}else n&&(ms(n)||Array.isArray(n))&&yC.pruneKeys(n,s,!0)})):Array.isArray(e)&&e.forEach((e=>{(ms(e)||Array.isArray(e))&&yC.pruneKeys(e,s,!0)})),e):Array.isArray(e)?e.map((e=>ms(e)||Array.isArray(e)?yC.pruneKeys(e,s,!1):e)):yC.isNestedObject(e)?Object.keys(e).reduce(((t,n)=>{if(!s.has(n)){const a=e[n];t[n]=ms(a)||Array.isArray(a)?yC.pruneKeys(a,s,!1):a}return t}),{}):e}}const AC=yC,CC=Gs.SUMMARY_OF_LISTS,SC=Gs.SUMMARY_OF_WHEN_CONDITIONS;class _C{static updateData(e){Object.keys(e).forEach((t=>{sC(vC({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{sC(vC({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${SC}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){const n=this.resolveName(e,t);return MA("string"==typeof n?n:"")}static resolveView(e,t,n=""){const s=xA(this.resolveName(e,t));let a=[];if(Array.isArray(s)&&s.length>0){if(t&&s.length>1){if(n||(n=t.getValue(Gs.CLASS_ID)||""),!n)return;a=s.filter((e=>e[Gs.CLASSID]===n))}return 0===a.length?s[0]:a[0]}return s}static resolveName(e,t){return e&&"string"==typeof e&&e.startsWith("param.")?(e=e.substring(6),t.getContextDataValue(`.$parameters.${e}`)):(e&&"string"==typeof e&&e.startsWith("@")&&(e=Ro.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=Ro.trimAnnotation(t))||"string"==typeof t)?"number"==typeof t&&Number.isInteger(t)?`${e}[${t}]`:"string"==typeof t&&t.startsWith(".")?e+t:t:e}static getRuleClass(e,t,n){let s;if(t)s=t.startsWith(Gs.CLASS_ANNOTATION)?t.split(Gs.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName(),e.getValue(Gs.CASE_INFO.CASE_INFO_CLASSID));else if(n?.authorContext){const t=e.getFieldMetadata(n.authorContext);if(t){const e=["refer","copy"].includes(t.dataRetrievalType),n="Page List"===t.type;s=e&&n?t.pageClass:t.classID}s||(s=n.ruleClass)}return s}static resolveReference(e,t){const{type:n}=e;let s;if("reference"===n){const{config:n}=e,a=n?.type,{ref:r,name:o,context:i}=n||{},c=this.getRuleClass(t,i,n);return t&&(t._ruleClass=c),"navigation"===a?s=this.resolveNavigation(r||o,t):"view"===a?s=this.resolveView(r||o,t,c||""):"widget"===a&&(s={type:"Widget",config:{name:o,ruleClass:c}}),s}return e}static resolvePropertyReference(e,t,n){return iC(t,e,n)}static getProperty(e,t,n){let s=this.resolvePropertyReference(t,e,n);if(null==s||0===s.length){const a=lC(`${t}.${CC}`,e,n);a&&(s=this.resolvePropertyReference(t,a,n))}return s}static getPropertyValue(e,t,n){return e=Ro.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=_C.getLitePropertyValue(t,"referencedUsers");if(Array.isArray(n)){const t=n.find((t=>t.UserID===e));if(t)return{userId:t.UserID,UserName:t.UserName}}return n?.[e]}static getLitePropertyValue(e,t){if(!e)return;const{useCustomContext:n,propertyName:s,hasSuggestions:a,pageReference:r,context:o}=e;let i=t||s||"";return n?(i=i.startsWith(".")?i.substring(1):i,i.split(".").reduce(((e,t)=>e?.[t]??void 0),n)):a&&i===s?_C.getPropertyValue(i,r,o?`${o}/${Gs.SUGGESTION}`:void 0):_C.getPropertyValue(i,r,o||void 0)}static _handlePropString(e,t,n,s,a){n.startsWith("@")?e[t]=Ro.handleAnnotation(n,s,a):e[t]=n}static _resolveProps(e,t,n){e&&Object.keys(e).forEach((s=>{const a=e[s];"string"==typeof a?this._handlePropString(e,s,a,t,n):Array.isArray(a)?a.forEach((s=>{this._resolveProps("object"==typeof s?s:e[s],t,n)})):"object"==typeof a&&this._resolveProps(e[s],t,n)}))}static resolveProps(e,t,n){return e&&t?(AC.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(AC.mergeDeep(e,t),this._resolveProps(t,void 0,e),AC.resolveStringBooleans(t)):t}static resolvePropertyPageClass(e,t){const n=AC.resolvePageClass(e,t),s=e.substring(e.lastIndexOf(".")+1),a=SA(s,n);let r;if(a)return r=Array.isArray(a)?a[0]?.pageClass:a.pageClass,r}static resolveClassID(e,t,n,s){const a=Ro.trimAnnotation(e);let r=a.startsWith(".")?`${t}${a}`:a;for(;r;){const e=iC(Gs.CLASS_ID,r,n);if(e)return e;if(s){const e=this.resolvePropertyPageClass(a,s);if(e)return e}const t=r.lastIndexOf(".");if(-1===t)break;r=r.substring(0,t)}return null}}const NC=_C;const TC=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}},DC=TC;const PC=class{static#g=[];static#h=!1;static getActionHandlers=(e,t,n)=>{const s=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=DC.getHandler(e.action),{config:n}=e;s.push({handler:t,config:n})})),s};static isEditable=e=>{const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||"DATETIME"===t};static isNonKeyInput=e=>{const{tagName:t,type:n}=e;return"SELECT"===t||"checkbox"===n||"radio"===n};static#f=(e,t,n)=>{for(let s=0;s<e.length;s+=1){const a=e[s],r={actionHandler:a.handler,component:t,eventType:n,config:a.config};this.#g.push(r)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===Gy.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=zp.getNextActionMgrId(),n};static#m=e=>{const t=e.actionHandler,n=e.component,{config:s}=e,a={};NC.resolveProps(s,a,n),t&&(t(e.eventType,a,n),this.#I())};static#I=()=>{if(!this.#h){if(0===this.#g.length)return;const e=this.#g.shift();if(!e)return;this.#m(e),e.config&&"true"===e.config.parallel&&this.#g.length>0&&this.#I()}};static#E=()=>{this.#I()};static#y=(e,t,n)=>{this.#f(e,t,n),this.#E()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return NC.getContextPath(t,n)};static#A(e,t){const n=e.getComponentConfig().behaviours||[];for(let s=0;s<n.length;s+=1){const{behaviour:a,actions:r}=n[s];if(r){const n=this.getActionHandlers(r,a,t);n&&n.length>0&&this.#y(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,s=e.getContextName();Du({type:$s.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:s});if(!("Browser"===Gy.getRuntime()?"nativeEvent"in t&&t.nativeEvent instanceof Event||t instanceof Event:"nativeEvent"in t&&!!t.nativeEvent||t instanceof Event)&&"value"in t&&(null===t.value||"prop"in t&&void 0!==t.prop)){if("object"==typeof(a=t)&&null!==a){const n=e.getPageReference(),a=e.getStateProps();for(const e of Object.keys(t)){const r=a[e],o=t[e];sC({type:sa,payload:{reference:NC.getContextPath(n,r),value:o,context:s}}),sC({type:ra,payload:{reference:NC.getContextPath(n,r),value:o,context:s}})}}}else{let n,{target:a}=t;null===a&&t&&"auxiliaryTarget"in t&&t.auxiliaryTarget&&(a=t.auxiliaryTarget),n=void 0===a?"value"in t?t.value:void 0:"value"in a?a.value:a.innerText;const r=this.getFullRef(e);sC({type:sa,payload:{reference:r,value:n,context:s}}),void 0!==a&&this.isEditable(a)&&!this.isNonKeyInput(a)||sC({type:ra,payload:{reference:r,pageReference:e.getPageReference(),value:n,context:s,propertyName:e.getComponentConfig().value,classID:e.getValue(Gs.CLASS_ID)}})}var a};static blurHandler=(e,t)=>{let{target:n}=t;null===n&&t&&"auxiliaryTarget"in t&&(n=t.auxiliaryTarget);const{value:s,validationValue:a}=n,r=this.getFullRef(e),o=e.getContextName();n.clearMessages&&Du({type:$s.MESSAGES.MESSAGES_TYPE_ERROR,property:e.getStateProps().value,pageReference:e.getPageReference(),context:o}),this.isEditable(n)&&(e.getValidationApi().validate("validationValue"in n?a:s),e.isInsideList()&&e.getListActions().updateProperty(e.getStateProps().value,s),this.isNonKeyInput(n)||sC({type:ra,payload:{reference:r,pageReference:e.getPageReference(),value:s,context:o,propertyName:e.getComponentConfig().value,classID:e.getValue(Gs.CLASS_ID)}}))};static eventHandler=(e,t)=>{const{type:n}=t;switch(n){case"change":this.changeHandler(e,t);break;case"blur":this.blurHandler(e,t)}n&&this.#A(e,n)};static pause=()=>{this.#h=!0};static resume=()=>{this.#h=!1,this.#I()};static isQueueEmpty=()=>0===this.#g.length;static clearQueue=()=>{this.#g=[]};static getActionsQueue=()=>this.#g;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},OC="CREATE_WORK",RC=e=>({type:OC,payload:e});const bC=(e,t,n,s,a="")=>{const r=[];Object.keys(e).forEach((o=>{"object"==typeof e[o]&&o.includes("[")?function(e,t,n,s,a,r,o){const i=s.substring(0,s.indexOf("[")),c=s.substring(s.indexOf("[")+1,s.indexOf("]"));let l=t[i];const u=`${AC.trimDotForProperty(a)}.${i}`;o.includes(u)&&Object.hasOwn(l,ks.getDefaultQualifiedName("pyCount"))&&(l=l.pxResults),Array.isArray(l)&&(l?.splice(+c,1,e[s]),r.push(i),n.add(`${a}.${s}`))}(e,t,n,o,a,r,s):e[o]&&"object"==typeof e[o]?(t[o]||(t[o]=Array.isArray(e[o])?[]:{}),bC(e[o],t[o],n,s,`${a}.${o}`)):t[o]=e[o]})),function(e,t,n){Object.keys(e).forEach((s=>{(Array.isArray(e[s])&&!n.includes(s)||!Array.isArray(e[s])&&!Object.hasOwn(t,s))&&delete e[s]}))}(t,e,r)},vC=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:s=[],propertiesToReArrange:a=[]}=t,{context:r,data:o,isArrayDeepMerge:i,preserveClientChanges:c=!1}=e,l=mE(r,!0),u=aC(r);let d={};if(u&&o){d=JSON.parse(JSON.stringify(u));const e=JSON.parse(JSON.stringify(o));a.length>0&&AC.rearrangeProperties(a,d);const t=new Set;bC(l,d,t,a),((e,t,n)=>{const s=new Set;e.forEach((e=>{e=AC.trimDotForProperty(e);const[a,r,o]=ou(e);if(a&&r&&o&&!s.has(`${a}.${r}`)){const e=AC.getIn(n,`${a}.${r}`)||[];Array.isArray(e)&&e.forEach(((e,n)=>{n!==+o&&AC.setIn(t,`${a}.${r}[${n}]`,e)})),s.add(`${a}.${r}`)}}))})(t,d,e)}!function(e,t){const n=AC.getIn(e,Gs.REFERENCED_USERS);let s;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return s=AC.getIn(t,Gs.REFERENCED_USERS,{}),void AC.setIn(e,Gs.REFERENCED_USERS,{...s,...n});s=AC.getIn(t,Gs.REFERENCED_USERS,[]);const a=new Map;for(const e of[...s,...n])if(a.has(e.UserID)){const t=a.get(e.UserID);a.set(e.UserID,{...t,...e})}else a.set(e.UserID,e);n.length=0;for(const e of a.values())n.push(e)}}(o,u);const p=AC.getIn(e?.data,Gs.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID),g=lI.isExternalObject(p),h=g?{[Gs.OBJECT_INFO.OBJECT_INFO]:{[Gs.CONTENT]:{...d[Gs.OBJECT_INFO.OBJECT_INFO]?.[Gs.CONTENT]}}}:{[Gs.CASE_INFO.CASE_INFO]:{[Gs.CONTENT]:{...d[Gs.CASE_INFO.CASE_INFO]?.[Gs.CONTENT]}}},f=g?Gs.OBJECT_INFO.OBJECT_INFO_CONTENT:Gs.CASE_INFO.CASE_INFO_CONTENT;let m=o;return c?(n.forEach((e=>{const t=`${f}.${e}`;AC.deleteIn(h,t)})),m=hC(o,h,{isArrayDeepMerge:i??!0})):((e,t)=>{const n=dE[e]||{};Object.keys(n).forEach((e=>{AC.hasIn(t,e)&&(n[e].value=AC.getIn(t,e))}))})(r,o),{type:Da,payload:{...e,data:m,...s.length>0?{propertiesToReplace:s}:null,...a.length>0?{propertiesToReArrange:a}:null}}},xC=e=>({type:"SHOW_HARNESS",payload:e}),wC=e=>({type:oa,payload:e}),MC=e=>({type:ia,payload:e}),LC=e=>({type:"ADD_WORK",payload:e}),UC=e=>({type:Ia,payload:e}),FC=e=>({type:va,payload:e}),VC=e=>({type:xa,payload:e}),jC=e=>({type:wa,payload:e}),kC=e=>({type:La,payload:e}),BC=e=>({type:Ua,payload:e}),$C=e=>({type:ja,payload:e}),GC=e=>({type:Ba,payload:e}),WC=e=>({type:ka,payload:e}),HC=e=>{const{containerItemID:t}=e;e.suggestionContexts=ny(t);const n=e?.data?.caseInfo?.content,s=Object.keys(n||{}).length>0;return e.propertiesToReplace||(e.propertiesToReplace=s?lI.getPropertiesToReplace(t):[]),{type:Ga,payload:e}},qC=e=>{const{context:t}=e;return{type:da,payload:{context:t}}},zC=e=>{const{context:t}=e;return{type:pa,payload:{context:t}}},YC=e=>({type:Wa,payload:e}),KC=e=>({type:$a,payload:e}),QC=e=>({type:pr,payload:e}),JC=e=>{const{context:t,containerItemID:n}=e;let s=t;return s||(s=JE(n)),e.context=s,e.deleteContext=!my(n),e.childContainers=ey(n),e.childContainersContexts=ty(n),e.transientItems=Iy([...e.childContainersContexts,n]),e.suggestionContexts=ny(n),n===t&&(e.caseID=iC(Gs.CASE_INFO.CASE_INFO_ID,"",t)||iC(Gs.OBJECT_INFO.OBJECT_INFO_ID,"",t),e.RemoteSystemID=iC(Gs.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Ma,payload:e}},XC=e=>{const{containerItemID:t}=e;return e.transientItems=Iy([...ty(t),t]),{type:Va,payload:e}},ZC=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:Fa,payload:e}},eS=e=>{const{context:t,containerItemID:n}=e;let s=t;if(s||(s=JE(n)),e.context=s,e.childContainers=ey(n),e.childContainersContexts=ty(n),e.transientItems=Iy([...e.childContainersContexts,n]),e.suggestionContexts=ny(n),n===t){e.caseID=iC(Gs.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=iC(Gs.CASE_INFO.REMOTESYSTEMID,"",t);const n=iC(Gs.CASE_INFO.CASE_INFO_CLASSNAME,"",t);qs.isTraditionalRemoteCase(n)&&(e.skipReleaseLockRequest=!0)}return{type:Ha,payload:e}},tS=e=>({type:ya,payload:e}),nS=e=>({type:Sa,payload:e}),sS=e=>({type:Ra,payload:e}),aS=(e,...t)=>(PC.resume(),e(...t)),rS=(e,t,n,s,a)=>({type:ba,payload:{msg:e,err:t,context:n,formFields:s,actionMgrID:a}}),oS=e=>({type:mr,payload:e}),iS=e=>({type:Ir,payload:e}),cS=e=>({type:Er,payload:e}),lS=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),uS=e=>({type:fa,payload:e}),dS=e=>({type:sa,payload:e}),pS="add",gS="replace",hS=["portal","noPortal","preview","debug","devtool","activeTab","contextParam","lang"];let fS="",mS="Home",IS="",ES=!0;const yS=e=>(ES=e,ES),AS=()=>ES,CS=(e,t,n)=>By.getSemanticURL(e,t,n),SS=(e,t)=>By.getRestEndPoint(e,t),_S=(e,t)=>{let n=un();const s=SS(e,t);return s?(s.restApi?.startsWith("/")||(s.restApi=`/${s.restApi}`),n?.endsWith("/")&&(n=n.substring(0,n.length-1)),s.restApi=n+s.restApi,s):{}},NS=(e,t,n)=>{const{root:s,resources:a}=e,{views:r}=a,{config:o}=s,i=pS;let c="";if(n)c=n;else{const e=r[o.name];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);c=t.config.urlPath}const l=c.match(Wg);if(l){const e=AC.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},TS=(e,t)=>{const n=`${e}/${t}`;if(!("EMBED"===Gy.getRenderingMode()))return n;const s=By.getRoutingInfo()?.authServiceAlias;if(!s)return n;const a=encodeURIComponent(s);let r;try{r=new URL(n)}catch{return n}const o=r.pathname.split("/").filter(Boolean),i=o.findIndex((e=>"app"===e.toLowerCase()));if(i<0)return n;"prauth"!==o[i-1]?.toLowerCase()&&o.splice(i,0,"PRAuth");const c=o.findIndex((e=>"app"===e.toLowerCase()))+2;return c!==o.length&&o[c]===a||o.splice(c,0,a),r.pathname=`/${o.join("/")}`,r.toString().replace(/\/$/,"")},DS=(e,t,n,s)=>{let a,r;a=qg(t)?TS(e,t):e;const o=qg(n?.pxURLPath||"");o&&(a=`${a}/${o}`);try{r=new URL(a).searchParams,a=a.includes("?")?a.split("?")[0]:a}catch(e){return console.log("Invalid url",e),""}const i=a.split("/"),c=i[i.length-1],l=new URLSearchParams("undefined"==typeof window?"":window.location.search);if(Xg()?(a=((e,t,n,s,a)=>{const r=By.getStaticRoutePage(),o=mS?.toLowerCase(),i=r?.toLowerCase(),c=s?.toLowerCase();return i!==o&&c!==o||a.has("noPortal")?e:TS(t,n)})(a,e,t,c,l),By.setStaticRoutePage("")):c.toLowerCase()!==mS.toLowerCase()||l.has("noPortal")||(a=TS(e,t)),!By.isDefaultPortal()){const e=By.getPortalName();l.has("portal")?l.set("portal",e):l.append("portal",e)}r=((e,t,n)=>{for(const[n,s]of t.entries())!e.has(n)&&hS.includes(n)&&e.append(n,s);n&&!e.has("lang")&&e.append("lang",n);const s=By.getRoutingInfo()?.embedQueryParams;if(s)for(const[t,n]of Object.entries(s))e.has(t)||e.append(t,String(n));return e})(r,l,s);const u=Yg(r.toString());return u&&(a+=`?${u}`),a},PS=(e,{urlPathObjParam:t,infoParam:n,optionsParam:s,queryParam:a},r=!1,o)=>{let i,c,l;if(!1===window.PCore.getBehaviorOverride("dynamicSemanticUrl"))return;if(r)i=t,c=n,l=s;else{const{uiResources:n,data:s}=e;({options:l}=e),i=t&&t.pxURLPath&&Hg(t.pxURLPath)?NS(n,s,t.pxURLPath):t||NS(n,s),c=By.getEndPointInfo(i.pxURLPath),i.pxURLPath=c.urlPath}let u=DS(fS,By.getApplicationPath(),i,o);const{title:d}=((e,t,n)=>{if(e=(e=>{let t=e.split(" ");return t=t.map((e=>e.charAt(0).toUpperCase()+e.slice(1))),t.join(" ")})(e=e&&""!==e?e:By.getApplicationName()),n===`${fS}/${t}/`)return{title:e};const s=new URL(n).pathname.replace(`${t}/`,""),a=s.split("/");return/\d/.test(s)?{title:`${e} - ${a[a.length-1]}`}:{title:`${e} - ${a[0]}`}})(IS,By.getApplicationPath(),u),p=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(c,{...l,title:d});i?.historyAction===pS?((e,t,n)=>{if("undefined"!=typeof window)try{window.history.pushState(e,t,n),window.scrollTo(0,0)}catch(e){throw new Error("Error- Unable to Add to Browser History")}})(p,d,u):i?.historyAction===gS&&(a&&(u+=`?${a}`),((e,t,n)=>{if("undefined"!=typeof window)try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(p,d,u))},OS=(e,t)=>{let n=null;e.directUrlUpdation&&(n={historyAction:pS,pxURLPath:""},n.pxURLPath=e.semanticURL),PS(e,{urlPathObjParam:n,infoParam:null,optionsParam:null},!1,t)},RS=(e,t)=>{OS(e,t)},bS=(e,t)=>{const n={pxURLPath:e};return DS(fS,By.getApplicationPath(),n,t)},vS=e=>{const{uiResources:t}=e;AS()&&(e.directUrlUpdation||(e=>{if(e&&e.root){const{root:t}=e,{resources:n}=e,{views:s}=n,a=t.config,r=a.type,o=a.name;if("VIEW"===r.toUpperCase()){const e=s[o];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);const n=t.config;if(n.type){const e=n.type;return!(!n.urlPath||"PAGE"!==e.toUpperCase())}}return!1}return!1})(t))&&OS(e)},xS=e=>{const t={routeEndpoint:e.routeEndpoint,requestType:e.requestType,payload:e.payload,routeKey:e.routeKey,options:null};return e.options&&(t.options=e.options),t},wS=(e,t,n)=>{const{caseClassName:s,workID:a}=e.payload,{containerName:r,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=qs.getRemoteCase(s),u={...e,headers:{RemoteSystemID:c},className:s,isTraditionalRemoteCase:qs.isTraditionalRemoteCase(s),isRemoteCase:qs.isRemoteCase(s),action:Lr,viewName:Ws,gadgetId:lI.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${a}`,containerName:r,name:l};sC(m.showPage(u))};let MS=!1;const LS=async e=>{if(MS)return void(MS=!1);const t=(e=>"ui-navigation"===e.state?.type?(Uu.publish($s.PUB_SUB_EVENTS.URL_NAVIGATION,e.state),null):e.state?e.state.stateObj:null)(e);if(t){const e=Ry(),n=YE(`${e}/primary`);if(n&&uy(n)){const e=Yy().getLocaleValue(hE,"Messages");if(!await fm.confirm(e))return MS=!0,void window.history.go(1)}qs.isRemoteCase(t.payload?.caseClassName)?wS({...t},t.options):sC(m.showHistory(xS(t)))}},US=()=>By.getApplicationPath()!==Fy(),FS=e=>{const{acName:t,context:n,defaultViewLabel:s,ruleName:a,className:r}=e,o=((e,t)=>{const n=By.getRoutingInfo();if(Xg()&&Object.values(n?.routes??{}).find((n=>n?.payload?.pageClass===t&&n?.payload?.page===e)))return e;const s=e.split(" ").join(""),a=e.split(" ").join("-").toLowerCase(),r=(e=>{const t=e.replace(/(?=[A-Z][a-z])/g,"-").toLowerCase();return t.startsWith("-")?t.substring(1):t})(e);return n?.routes?.[s]?s:n?.routes?.[a]?a:n?.routes?.[r]?r:e})(a||s,r);(e=>{mS=e})(o),By.setDefaultRoute(o),By.setDefaultClassName(r);const i=Qs(t,n),c=Wr(t,n),l=(()=>{const e=Gy.getIsExtraCallRequiredForDefaultHome();return!0===e||"true"===e})(),u={historyAction:gS,pxURLPath:""};let d,p=null;const g={acName:c,context:i,actionConfig:{context:i}};if(l||!l&&US()){const t=Qg(Vy());Gy.shouldUseURLParams()&&(p=t.includes("?")?t.split("?")[1]:null),d=Jg(t,g),u.pxURLPath=d.urlPath,void 0!==d.payload?.pageClass&&(d.payload.pageClass=nC()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",s={routeEndpoint:d.routeEndpoint,requestType:d.requestType,payload:d.payload,options:g,routeKey:d.routeKey};qs.isRemoteCase(d?.payload?.caseClassName)?wS(s,e,g.context):sC(m[n](xS(s)))}else d=By.getEndPointInfo(mS),u.pxURLPath="";PS(null,{urlPathObjParam:u,infoParam:d,optionsParam:g,queryParam:p},!0)},VS=(e,t=!1)=>{var n;fS=e.domain,!1===t&&AS()&&(n=LS,"undefined"!=typeof window&&window.addEventListener("popstate",(e=>n(e))),"undefined"!=typeof window&&(window.onbeforeunload=()=>null)),By.init(e,mS)},jS=e=>{(e=>{"undefined"!=typeof window&&(window.document.title=e)})(e)},kS=e=>{for(const t of e)hS.includes(t)||hS.push(t)};var BS=Symbol.for("immer-nothing"),$S=Symbol.for("immer-draftable"),GS=Symbol.for("immer-state");function WS(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var HS=Object,qS=HS.getPrototypeOf,zS="constructor",YS="prototype",KS="configurable",QS="enumerable",JS="writable",XS="value",ZS=e=>!!e&&!!e[GS];function e_(e){return!!e&&(s_(e)||l_(e)||!!e[$S]||!!e[zS]?.[$S]||u_(e)||d_(e))}var t_=HS[YS][zS].toString(),n_=new WeakMap;function s_(e){if(!e||!p_(e))return!1;const t=qS(e);if(null===t||t===HS[YS])return!0;const n=HS.hasOwnProperty.call(t,zS)&&t[zS];if(n===Object)return!0;if(!g_(n))return!1;let s=n_.get(n);return void 0===s&&(s=Function.toString.call(n),n_.set(n,s)),s===t_}function a_(e,t,n=!0){if(0===r_(e)){(n?Reflect.ownKeys(e):HS.keys(e)).forEach((n=>{t(n,e[n],e)}))}else e.forEach(((n,s)=>t(s,n,e)))}function r_(e){const t=e[GS];return t?t.type_:l_(e)?1:u_(e)?2:d_(e)?3:0}var o_=(e,t,n=r_(e))=>2===n?e.has(t):HS[YS].hasOwnProperty.call(e,t),i_=(e,t,n=r_(e))=>2===n?e.get(t):e[t],c_=(e,t,n,s=r_(e))=>{2===s?e.set(t,n):3===s?e.add(n):e[t]=n};var l_=Array.isArray,u_=e=>e instanceof Map,d_=e=>e instanceof Set,p_=e=>"object"==typeof e,g_=e=>"function"==typeof e,h_=e=>"boolean"==typeof e;var f_=e=>e.copy_||e.base_,m_=e=>e.modified_?e.copy_:e.base_;function I_(e,t){if(u_(e))return new Map(e);if(d_(e))return new Set(e);if(l_(e))return Array[YS].slice.call(e);const n=s_(e);if(!0===t||"class_only"===t&&!n){const t=HS.getOwnPropertyDescriptors(e);delete t[GS];let n=Reflect.ownKeys(t);for(let s=0;s<n.length;s++){const a=n[s],r=t[a];!1===r[JS]&&(r[JS]=!0,r[KS]=!0),(r.get||r.set)&&(t[a]={[KS]:!0,[JS]:!0,[QS]:r[QS],[XS]:e[a]})}return HS.create(qS(e),t)}{const t=qS(e);if(null!==t&&n)return{...e};const s=HS.create(t);return HS.assign(s,e)}}function E_(e,t=!1){return A_(e)||ZS(e)||!e_(e)||(r_(e)>1&&HS.defineProperties(e,{set:y_,add:y_,clear:y_,delete:y_}),HS.freeze(e),t&&a_(e,((e,t)=>{E_(t,!0)}),!1)),e}var y_={[XS]:function(){WS(2)}};function A_(e){return null===e||!p_(e)||HS.isFrozen(e)}var C_="MapSet",S_="Patches",__="ArrayMethods",N_={};function T_(e){const t=N_[e];return t||WS(0),t}var D_,P_=e=>!!N_[e];var O_=()=>D_;function R_(e,t){t&&(e.patchPlugin_=T_(S_),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function b_(e){v_(e),e.drafts_.forEach(w_),e.drafts_=null}function v_(e){e===D_&&(D_=e.parent_)}var x_=e=>D_={drafts_:[],parent_:D_,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:P_(C_)?T_(C_):void 0,arrayMethodsPlugin_:P_(__)?T_(__):void 0};function w_(e){const t=e[GS];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function M_(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[GS].modified_&&(b_(t),WS(4)),e_(e)&&(e=L_(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[GS].base_,e,t)}else e=L_(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&E_(t,n)}(t,e,!0),b_(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==BS?e:void 0}function L_(e,t){if(A_(t))return t;const n=t[GS];if(!n){return $_(t,e.handledSet_,e)}if(!F_(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;){t.pop()(e)}k_(n,e)}return n.copy_}function U_(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var F_=(e,t)=>e.scope_===t,V_=[];function j_(e,t,n,s){const a=f_(e),r=e.type_;if(void 0!==s){if(i_(a,s,r)===t)return void c_(a,s,n,r)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;a_(a,((e,n)=>{if(ZS(n)){const s=t.get(n)||[];s.push(e),t.set(n,s)}}))}const o=e.draftLocations_.get(t)??V_;for(const e of o)c_(a,e,n,r)}function k_(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const s=n.getPath(e);s&&n.generatePatches_(e,s,t)}U_(e)}}function B_(e,t,n){const{scope_:s}=e;if(ZS(n)){const a=n[GS];F_(a,s)&&a.callbacks_.push((function(){Y_(e);const s=m_(a);j_(e,n,s,t)}))}else e_(n)&&e.callbacks_.push((function(){const a=f_(e);3===e.type_?a.has(n)&&$_(n,s.handledSet_,s):i_(a,t,e.type_)===n&&s.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&$_(i_(e.copy_,t,e.type_),s.handledSet_,s)}))}function $_(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ZS(e)||t.has(e)||!e_(e)||A_(e)||(t.add(e),a_(e,((s,a)=>{if(ZS(a)){const t=a[GS];if(F_(t,n)){const n=m_(t);c_(e,s,n,e.type_),U_(t)}}else e_(a)&&$_(a,t,n)}))),e}var G_={get(e,t){if(t===GS)return e;let n=e.scope_.arrayMethodsPlugin_;const s=1===e.type_&&"string"==typeof t;if(s&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const a=f_(e);if(!o_(a,t,e.type_))return function(e,t,n){const s=q_(t,n);return s?XS in s?s[XS]:s.get?.call(e.draft_):void 0}(e,a,t);const r=a[t];if(e.finalized_||!e_(r))return r;if(s&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return r;if(r===H_(e.base_,t)){Y_(e);const n=1===e.type_?+t:t,s=K_(e.scope_,r,e,n);return e.copy_[n]=s}return r},has:(e,t)=>t in f_(e),ownKeys:e=>Reflect.ownKeys(f_(e)),set(e,t,n){const s=q_(f_(e),t);if(s?.set)return s.set.call(e.draft_,n),!0;if(!e.modified_){const s=H_(f_(e),t),o=s?.[GS];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((a=n)===(r=s)?0!==a||1/a==1/r:a!=a&&r!=r)&&(void 0!==n||o_(e.base_,t,e.type_)))return!0;Y_(e),z_(e)}var a,r;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),B_(e,t,n)),!0},deleteProperty:(e,t)=>(Y_(e),void 0!==H_(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),z_(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=f_(e),s=Reflect.getOwnPropertyDescriptor(n,t);return s?{[JS]:!0,[KS]:1!==e.type_||"length"!==t,[QS]:s[QS],[XS]:n[t]}:s},defineProperty(){WS(11)},getPrototypeOf:e=>qS(e.base_),setPrototypeOf(){WS(12)}},W_={};for(let e in G_){let t=G_[e];W_[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function H_(e,t){const n=e[GS];return(n?f_(n):e)[t]}function q_(e,t){if(!(t in e))return;let n=qS(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=qS(n)}}function z_(e){e.modified_||(e.modified_=!0,e.parent_&&z_(e.parent_))}function Y_(e){e.copy_||(e.assigned_=new Map,e.copy_=I_(e.base_,e.scope_.immer_.useStrictShallowCopy_))}W_.deleteProperty=function(e,t){return W_.set.call(this,e,t,void 0)},W_.set=function(e,t,n){return G_.set.call(this,e[0],t,n,e[0])};function K_(e,t,n,s){const[a,r]=u_(t)?T_(C_).proxyMap_(t,n):d_(t)?T_(C_).proxySet_(t,n):function(e,t){const n=l_(e),s={type_:n?1:0,scope_:t?t.scope_:O_(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=s,r=G_;n&&(a=[s],r=W_);const{revoke:o,proxy:i}=Proxy.revocable(a,r);return s.draft_=i,s.revoke_=o,[i,s]}(t,n);return(n?.scope_??O_()).drafts_.push(a),r.callbacks_=n?.callbacks_??[],r.key_=s,n&&void 0!==s?function(e,t,n){e.callbacks_.push((function(s){const a=t;if(!a||!F_(a,s))return;s.mapSetPlugin_?.fixSetContents(a);const r=m_(a);j_(e,a.draft_??a,r,n),k_(a,s)}))}(n,r,s):r.callbacks_.push((function(e){e.mapSetPlugin_?.fixSetContents(r);const{patchPlugin_:t}=e;r.modified_&&t&&t.generatePatches_(r,[],e)})),a}function Q_(e){if(!e_(e)||A_(e))return e;const t=e[GS];let n,s=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=I_(e,t.scope_.immer_.useStrictShallowCopy_),s=t.scope_.immer_.shouldUseStrictIteration()}else n=I_(e,!0);return a_(n,((e,t)=>{c_(n,e,Q_(t))}),s),t&&(t.finalized_=!1),n}var J_=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(g_(e)&&!g_(t)){const n=t;t=e;const s=this;return function(e=n,...a){return s.produce(e,(e=>t.call(this,e,...a)))}}let s;if(g_(t)||WS(6),void 0===n||g_(n)||WS(7),e_(e)){const a=x_(this),r=K_(a,e,void 0);let o=!0;try{s=t(r),o=!1}finally{o?b_(a):v_(a)}return R_(a,n),M_(s,a)}if(!e||!p_(e)){if(s=t(e),void 0===s&&(s=e),s===BS&&(s=void 0),this.autoFreeze_&&E_(s,!0),n){const t=[],a=[];T_(S_).generateReplacementPatches_(e,s,{patches_:t,inversePatches_:a}),n(t,a)}return s}WS(1)},this.produceWithPatches=(e,t)=>{if(g_(e))return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,s;return[this.produce(e,t,((e,t)=>{n=e,s=t})),n,s]},h_(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),h_(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),h_(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){e_(e)||WS(8),ZS(e)&&(e=function(e){ZS(e)||WS(10);return Q_(e)}(e));const t=x_(this),n=K_(t,e,void 0);return n[GS].isManual_=!0,v_(t),n}finishDraft(e,t){const n=e&&e[GS];n&&n.isManual_||WS(9);const{scope_:s}=n;return R_(s,t),M_(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(0===s.path.length&&"replace"===s.op){e=s.value;break}}n>-1&&(t=t.slice(n+1));const s=T_(S_).applyPatches_;return ZS(e)?s(e,t):this.produce(e,(e=>s(e,t)))}},X_=J_.produce;function Z_(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var eN=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),tN=()=>Math.random().toString(36).substring(7).split("").join("."),nN={INIT:`@@redux/INIT${tN()}`,REPLACE:`@@redux/REPLACE${tN()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${tN()}`};function sN(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function aN(e,t,n){if("function"!=typeof e)throw new Error(Z_(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Z_(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Z_(1));return n(aN)(e,t)}let s=e,a=t,r=new Map,o=r,i=0,c=!1;function l(){o===r&&(o=new Map,r.forEach(((e,t)=>{o.set(t,e)})))}function u(){if(c)throw new Error(Z_(3));return a}function d(e){if("function"!=typeof e)throw new Error(Z_(4));if(c)throw new Error(Z_(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(Z_(6));t=!1,l(),o.delete(n),r=null}}}function p(e){if(!sN(e))throw new Error(Z_(7));if(void 0===e.type)throw new Error(Z_(8));if("string"!=typeof e.type)throw new Error(Z_(17));if(c)throw new Error(Z_(9));try{c=!0,a=s(a,e)}finally{c=!1}return(r=o).forEach((e=>{e()})),e}p({type:nN.INIT});return{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Z_(10));s=e,p({type:nN.REPLACE})},[eN]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Z_(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[eN](){return this}}}}}function rN(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const a=t[s];0,"function"==typeof e[a]&&(n[a]=e[a])}const s=Object.keys(n);let a;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:nN.INIT}))throw new Error(Z_(12));if(void 0===n(void 0,{type:nN.PROBE_UNKNOWN_ACTION()}))throw new Error(Z_(13))}))}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let r=!1;const o={};for(let a=0;a<s.length;a++){const i=s[a],c=n[i],l=e[i],u=c(l,t);if(void 0===u){t&&t.type;throw new Error(Z_(14))}o[i]=u,r=r||u!==l}return r=r||s.length!==Object.keys(e).length,r?o:e}}function oN(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function iN(e){return({dispatch:t,getState:n})=>s=>a=>"function"==typeof a?a(t,n,e):s(a)}var cN=iN(),lN=iN,uN="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?oN:oN.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function dN(e,t){function n(...n){if(t){let s=t(...n);if(!s)throw new Error(CN(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return sN(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var pN=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function gN(e){return e_(e)?X_(e,(()=>{})):e}var hN="RTK_autoBatch",fN=e=>t=>{setTimeout(t,e)},mN=(e={type:"raf"})=>t=>(...n)=>{const s=t(...n);let a=!0,r=!1,o=!1;const i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?(l=window.requestAnimationFrame,u=100,e=>{let t=!1;const n=()=>{t||(t=!0,cancelAnimationFrame(s),clearTimeout(a),e())},s=l(n),a=setTimeout(n,u)}):fN(10):"callback"===e.type?e.queueNotification:fN(e.timeout);var l,u;const d=()=>{o=!1,r&&(r=!1,i.forEach((e=>e())))};return Object.assign({},s,{subscribe(e){const t=s.subscribe((()=>a&&e()));return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return a=!e?.meta?.[hN],r=!a,r&&(o||(o=!0,c(d))),s.dispatch(e)}finally{a=!0}}})};function IN(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:a=!0}=e??{};let r=new pN;return t&&("boolean"==typeof t?r.push(cN):r.push(lN(t.extraArgument))),r},{reducer:n,middleware:s,devTools:a=!0,duplicateMiddlewareCheck:r=!0,preloadedState:o,enhancers:i}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!sN(n))throw new Error(CN(1));c=rN(n)}l="function"==typeof s?s(t):t();let u=oN;a&&(u=uN({trace:!1,..."object"==typeof a&&a}));const d=function(...e){return t=>(n,s)=>{const a=t(n,s);let r=()=>{throw new Error(Z_(15))};const o={getState:a.getState,dispatch:(e,...t)=>r(e,...t)},i=e.map((e=>e(o)));return r=oN(...i)(a.dispatch),{...a,dispatch:r}}}(...l),p=(e=>function(t){const{autoBatch:n=!0}=t??{};let s=new pN(e);return n&&s.push(mN("object"==typeof n?n:void 0)),s})(d);return aN(c,o,u(..."function"==typeof i?i(p):p()))}function EN(e){const t={},n=[];let s;const a={addCase(e,n){const s="string"==typeof e?e:e.type;if(!s)throw new Error(CN(28));if(s in t)throw new Error(CN(29));return t[s]=n,a},addAsyncThunk:(e,s)=>(s.pending&&(t[e.pending.type]=s.pending),s.rejected&&(t[e.rejected.type]=s.rejected),s.fulfilled&&(t[e.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:e.settled,reducer:s.settled}),a),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),a),addDefaultCase:e=>(s=e,a)};return e(a),[t,n,s]}function yN(e,t){let n,[s,a,r]=EN(t);if("function"==typeof e)n=()=>gN(e());else{const t=gN(e);n=()=>t}function o(e=n(),t){let o=[s[t.type],...a.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===o.filter((e=>!!e)).length&&(o=[r]),o.reduce(((e,n)=>{if(n){if(ZS(e)){const s=n(e,t);return void 0===s?e:s}if(e_(e))return X_(e,(e=>n(e,t)));{const s=n(e,t);if(void 0===s){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return s}}return e}),e)}return o.getInitialState=n,o}var{assign:AN}=Object;function CN(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const SN=e=>{let t=new Set,n=t;const s=()=>{t===n&&(t=new Set(t))},a=e=>{let n=!0;return s(),t.add(e),()=>{n&&(s(),t.delete(e),n=!1)}},r=()=>{const e=Array.from(t);n=t,e.forEach((e=>e()))};return(...t)=>{const n=e(...t);let s=!1,o=!1;const i=e=>Array.isArray(e)?e.map(i):n.dispatch(e);return n.subscribe((()=>{o?s=!0:r()})),{...n,dispatch:e=>{const t=o;t||(s=!1,o=!0);const n=i(e),a=s&&!t;return t||(s=!1,o=!1),a&&r(),n},subscribe:a}}},_N=(e,t)=>{const{data:{shared:n={}}={},context:s}=t;((e,t)=>{Sh.updateDataPageStore(t),Object.keys(t).forEach((n=>{AC.getIn(e,[Gs.SHARED,n])?Object.keys(t[n]).forEach((s=>{AC.setIn(e,[Gs.SHARED,n,s],t[n][s])})):AC.setIn(e,[Gs.SHARED,n],t[n])}))})(e,n),s&&AC.deleteIn(e,[s,"shared"])},NN=(e,t,n=!1)=>{const{context:s,caseViewMode:a=(n?void 0:Gs.PERFORM_MODE),containerName:r}=t;r!==xE.WORKAREA&&a&&AC.setIn(e,[s,"context_data","caseViewMode"],a)},TN=(e,t)=>{const{context:n}=t;AC.setIn(e,[n,"context_data","actionType"],t.actionType),AC.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},DN=e=>null!==e&&"object"==typeof e,PN=(e,t=[])=>{t.forEach((t=>AC.deleteIn(e,t)))},ON=(e,t=[])=>{t.forEach((t=>AC.deleteIn(e,t)))},RN=(e,t=[])=>{t.forEach((t=>{AC.deleteIn(e,t)}))},bN=(e,t,n={})=>{const{deleteAssignmentSpecificResources:s=!0,doDeleteConfirmationDetails:a=!0,skipMergeAssignmentsAndActions:r=!0}=n;AC.deleteIn(e,[t,"nextAssignmentInfo"]),r&&(AC.deleteIn(e,[t,Gs.CASE_INFO.CASE_INFO,"availableActions"]),AC.deleteIn(e,[t,Gs.CASE_INFO.CASE_INFO,"availableProcesses"]),AC.deleteIn(e,[t,Gs.CASE_INFO.CASE_INFO,"assignments"])),AC.deleteIn(e,[t,Gs.CASE_INFO.CASE_INFO,"activeActionID"]),AC.deleteIn(e,[t,Gs.CASE_INFO.CASE_INFO,"childCases"]),a&&(AC.deleteIn(e,[t,Gs.CASE_INFO.CASE_INFO,"confirmationLinks"]),AC.deleteIn(e,[t,"caseMessages"])),s&&(AC.deleteIn(e,[t,Gs.CASE_INFO.CASE_INFO,"actionButtons"]),AC.deleteIn(e,[t,Gs.CASE_INFO.CASE_INFO,"navigation"]))},vN=yN({},(e=>{e.addCase(wa,((e,t)=>{if(!t.payload.data||e[t.payload.context])return;t.payload.doDeleteCaseSummary&&bN(e,t.payload.context);const{target:n}=t.payload;n&&(n.includes(Gs.WORKAREA)||n.includes(Gs.MODAL))?e[t.payload.context]=t.payload.data:e[t.payload.containerItemID]=t.payload.data,NN(e,t.payload),TN(e,t.payload),_N(e,t.payload),((e,t)=>{const{context:n}=t;AC.deleteIn(e,[n,"context_data","blocking_action_counter"]),AC.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload)})).addCase(Ga,((e,t)=>{t.payload.doDeleteCaseSummary&&bN(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:s=[]}=t.payload;if(n&&(n.includes(Gs.WORKAREA)||n.includes(Gs.MODAL))){const n=e[t.payload.context];DN(n)&&(e[t.payload.context]=hC(n,t.payload.data,{propertiesToReplace:[...s]}))}else{const n=e[t.payload.containerItemID];DN(n)&&(e[t.payload.containerItemID]=hC(n,t.payload.data,{propertiesToReplace:[...s]}))}(t.payload.actionType||t.payload.assignmentID)&&TN(e,t.payload),NN(e,t.payload),_N(e,t.payload),ON(e,t.payload.suggestionContexts)})).addCase(Ma,((e,t)=>{const{childContainersContexts:n=[]}=t.payload;((e,t)=>{const{containerItemID:n,context:s,deleteContext:a}=t;a&&AC.deleteIn(e,[s]),AC.deleteIn(e,[n])})(e,t.payload),RN(e,n),PN(e,t.payload.transientItems),ON(e,t.payload.suggestionContexts)})).addCase(xa,((e,t)=>{const{containerItems:n}=t.payload;Array.isArray(n)?n.forEach((t=>{AC.deleteIn(e,[t])})):AC.deleteIn(e,[n])})).addCase(Wa,((e,t)=>{const{context:n,contextToBeRemoved:s,data:a,childContainersContextsToBeRemoved:r}=t.payload;bN(e,t.payload.context),NN(e,t.payload);const o=e[n],i=e[s];if(!DN(o)||!DN(i))return;const c=hC(o,i);DN(c)&&(e[n]=hC(c,a),AC.deleteIn(e,[s]),RN(e,r),_N(e,t.payload))})).addCase(Ha,((e,t)=>{const{context:n,pulseReplace:s=!0,childContainersContexts:a=[]}=t.payload;let{data:r}=t.payload;const o=AC.getIn(e[n],"pulse");let i=AC.getIn(e[n],"OperatorID"),c=AC.getIn(e[n],"pxRequestor");c&&r.pxRequestor&&(c=AC.mergeDeep(c,r.pxRequestor)),i&&r.OperatorID&&(i=AC.mergeDeep(i,r.OperatorID)),!s&&o&&(r=fC(r,"pulse",o),r=fC(r,"OperatorID",i),r=fC(r,"pxRequestor",c)),AC.setIn(e,n,r),NN(e,t.payload),_N(e,t.payload),RN(e,a),PN(e,t.payload.transientItems),ON(e,t.payload.suggestionContexts)})).addCase(yr,((e,t)=>{const{context:n,doDeleteConfirmationDetails:s=!0,skipMergeAssignmentsAndActions:a=!0}=t.payload;bN(e,n,{doDeleteConfirmationDetails:s,skipMergeAssignmentsAndActions:a})})).addCase(La,((e,t)=>{const{transientItemID:n,data:s}=t.payload;AC.setIn(e,n,s)})).addCase(Fa,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>AC.deleteIn(e,t)))})).addCase(Va,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>AC.deleteIn(e,t)))})).addCase(Ua,((e,t)=>{const{transientItemID:n,data:s}=t.payload;hC(AC.getIn(e,n),s)})).addCase(ja,((e,t)=>{const{transientItemID:n,data:s}=t.payload;hC(AC.getIn(e,n),s)})).addCase(ka,((e,t)=>{const{transientItemID:n,data:s}=t.payload;Object.keys(s??{}).forEach((t=>{AC.deleteIn(e,[n,t])}))})).addCase(Ba,((e,t)=>{const{transientItemID:n,data:s}=t.payload;AC.deleteIn(e,n),AC.setIn(e,n,s)})).addCase(fa,((e,t)=>{const{key:n,value:s}=t.payload;AC.setIn(e,`${Gs.SHARED}.${n}`,s)})).addCase(Ya,((e,t)=>{const{context:n,data:s}=t.payload;return AC.setIn(e,n,s)}))})),xN=vN;function wN(e){if("object"==typeof e&&null!==e&&"payload"in e&&"object"==typeof e.payload&&null!==e.payload){const t=e.payload.context;return"string"==typeof t?t:void 0}}const MN=dN(Cr),LN=yN({},(e=>{e.addCase(Da,((e,t)=>{const{propertiesToReplace:n=[],propertiesToReArrange:s=[],uiRootReference:a="",interestPath:r}=t.payload,o=a&&"string"==typeof t.payload.context?`${t.payload.context}.${a}`:t.payload.context,i="string"==typeof o?eC(o):[],c={isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n],propertiesToReArrange:[...s]};if(a&&i.length)AC.setIn(e,i,hC(AC.getIn(e,i),AC.getIn(t.payload.data,eC(a)),c));else if(r){const a=AC.getIn(e[t.payload.context],r),o=AC.getIn(t.payload.data,r),i=hC(a,o,{isArrayDeepMerge:!0}),c=AC.getIn(t.payload.data.context_data,r);gC(e[t.payload.context],[...n],[...s]),AC.setIn(e[t.payload.context],r,i),e[t.payload.context]&&c&&AC.setIn(e[t.payload.context].context_data,r,hC(AC.getIn(e[t.payload.context].context_data,r),c,{isArrayDeepMerge:!0}))}else e[t.payload.context]=hC(e[t.payload.context],t.payload.data,c);NN(e,t.payload,!0),_N(e,t.payload)})).addCase(sa,((e,t)=>{const{context:n,reference:s,value:a,isArrayDeepMerge:r}=t.payload;fC(e[n],s,a,{isArrayDeepMerge:r})})).addCase(aa,((e,t)=>{const{context:n,reference:s,value:a}=t.payload;mC(e[n],s,a)})).addCase(Pa,((e,t)=>{dC(e[t.payload.context],t.payload.reference)})).addCase(da,((e,t)=>{AC.setIn(e[t.payload.context],"context_data.isLoading",!0)})).addCase(pa,((e,t)=>{AC.setIn(e[t.payload.context],"context_data.isLoading",!1)})).addCase(ga,((e,t)=>{const n=wN(t);n&&(e[n]||(e[n]={}),AC.setIn(e[n],"context_data.isOffline",!0))})).addCase(ha,((e,t)=>{const n=wN(t);n&&(e[n]||(e[n]={}),AC.setIn(e[n],"context_data.isOffline",!1))})).addCase(mr,((e,t)=>{const{data:n}=t.payload;_N(e,{data:{shared:n}})})).addCase(Ir,((e,t)=>{const{dataPagesToBeRemoved:n=[]}=t.payload;n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:s}=t;AC.deleteIn(e.shared,[n,s]);const a=AC.getIn(e.shared,[n]);a&&0===Object.keys(a).length&&AC.deleteIn(e.shared,[n])}))})).addCase(Ar,((e,t)=>{const n=AC.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);t.payload.isInitiateBlockingAction?AC.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):AC.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1)})).addCase(MN,((e,t)=>{e.locale=AC.getIn(t.payload,"locale","")}))})),UN=LN,FN=/\[(\d+)\]$/gi,VN=/(\d+)/gi,jN=/\[\d+\]$/,kN=(e,t,n,s=[Gs.CONTEXT_DATA,Gs.CASE_INFO.CASE_INFO,Gs.CONTENT])=>{const a=AC.getIn(t,s);if(a){const t=Ou(a,[],[]);for(const a of t)AC.setIn(e[n],[...s,...a],{})}},BN=(e,t,n,s)=>{const{property:a,pageReference:r,category:o,type:i,subType:c}=s.payload,l=AC.getIn(e[t],n);if(l&&o===Gs.CASEMESSAGES)AC.setIn(e[t],Cu(a,r,o),"");else if(l&&l.length>0&&Array.isArray(l)){let s;s=c?l.filter((e=>!(e.type===i&&e.subType===c))):l.filter((e=>e.type!==i)),n&&n.length>0&&AC.setIn(e[t],Cu(a,r,o),s)}},$N=(e,t)=>{const{property:n,pageReference:s,category:a,isListEntry:r,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return kN(e,i,c),e;const l=Cu(n,s,a,r);if(Number.isInteger(o)){AC.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=AC.getIn(e[c],t)||{};const s=(e=>[...e].sort(((e,t)=>{const n=e.match(FN),s=t.match(FN);if(!n&&!s)return e.localeCompare(t);if(!n&&s)return-1;if(n?.length&&s?.length){const e=n[0].match(VN),t=s[0].match(VN);if(e?.length&&t?.length)return parseInt(e[0],10)-parseInt(t[0],10)}return 1})))(Object.keys(n));n=s.map((e=>n[e])),n.forEach(((n,a)=>{const r=s[a].match(FN);if(r?.length){const i=parseInt(r[0].match(VN)[0],10);i>o&&(AC.deleteIn(e[c],t.concat(s[a])),AC.setIn(e[c],t.concat(s[a].replace(jN,`[${i-1}]`)),n))}}))}else AC.setIn(e[c],l,{});return e};function GN(e,t){const n=AC.getIn(e,t);return void 0!==n?.dataInfo?.content}const WN=(e,t)=>{const n=AC.getIn(e,t);return!0===lI.isObjectCaseType(n?.objectInfo?.objectTypeID)};function HN(e,t){let n=Au.FIELD_MESSAGES_PATH;return GN(e,t)?n=Au.DATA_OBJECT_FIELD_MESSAGES_PATH:WN(e,t)&&(n=Au.OBJECT_FIELD_MESSAGES_PATH),n}const qN=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const s=AC.getIn(n,Gs.ERROR_FIELD_IN_PAGE).slice(1),a=AC.getIn(n,Gs.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(a){let r="caseInfo.content";GN(e,t)?r="dataInfo.content":WN(e,t)&&(r="objectInfo.content");let o=s?`${r}.${s}`:r;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=Cu(a,o,Gs.PROPERTY),c=AC.getIn(e[t],`${o}.classID`),l=SA(a,c),u=Gy.getLocale()??"en-US",d=new Ef(u,l?.localeReference),p={type:$s.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:d.getLocalizedText(l.label)}},g=AC.getIn(e[t],i,[]);if(AC.isContains(g,p))return;AC.setIn(e[t],i,[...g,p])}})(e,t,n)}))};function zN(e,t){const{err:n,formFields:s}=t.payload;let{context:a}=t.payload;const{fieldErrors:r,pageErrors:o}=((e,t)=>{const n=new Map(t.map(((e,t)=>[e,t]))),s=e=>n.get((e=>{const t=(e.erroneousInputOutputFieldInPage||"").replace(/^\./,""),n=(e.erroneousInputOutputIdentifier||"").replace(/^\./,"");return t?`${t}.${n}`:n})(e))??Number.MAX_SAFE_INTEGER,a=e.slice().sort(((e,t)=>s(e)-s(t))),r=[],o=[];for(const e of a)Tm(e,t,r,o);return{fieldErrors:o,pageErrors:r}})(n.errorDetails,s),i=HN(e,a);if(AC.setIn(e,[a,...i],{}),AC.setIn(e,[a,...Au.PAGE_MESSAGES_PATH],[]),r.forEach((t=>{const n=AC.getIn(t,Gs.ERROR_FIELD_IN_PAGE);if(n){const t=n.slice(1);if(t){const n=function(e){let t=null;const n=e.lastIndexOf(".");return n<0?null:(t=e.substring(0,n),t?`caseInfo.content.${t}`.replace(/\(/g,"[").replace(/\)/g,"]"):t)}(t);if(!n)return!1;const s=t.substring(t.lastIndexOf(".")+1),r=Cu(s,n,Gs.PROPERTY);AC.setIn(e,[a,...r],[])}}})),r.length>0&&qN(e,a,r),o.length>0){const t=(e=>{const t=[];return e.forEach((e=>{t.push({type:$s.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue})})),t})(o);e[a]||(a=Gs.APP.APP),AC.setIn(e,[a,...Au.PAGE_MESSAGES_PATH],t)}else a.includes&&a.includes(xE.WORKAREA)&&(a=Ks(a)),AC.deleteIn(e,[a,...Au.PAGE_MESSAGES_PATH]);return e}const YN=yN({},(e=>{e.addCase(ba,((e,t)=>t.payload.err.errorDetails&&(t.payload.err.errorClassification===$s.VALIDATION_FAIL||t.payload.err.errorClassification===$s.INVALID_INPUTS||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?zN(e,t):e)).addCase(Ga,((e,t)=>{const{context:n}=t.payload,s=[n,...HN(e,n)],a=[n,...Au.PAGE_MESSAGES_PATH];if(AC.setIn(e,s,{}),AC.setIn(e,a,[]),n&&n.includes(xE.WORKAREA)){const t=[ta(n),...Au.PAGE_MESSAGES_PATH];AC.setIn(e,t,[])}})).addCase(gr,((e,t)=>{const{isListEntry:n,clearAll:s,context:a}=t.payload;return s?(AC.deleteIn(e,[a,Gs.CONTEXT_DATA]),e):n?$N(e,t):((e,t)=>{const{property:n,pageReference:s,category:a,isListEntry:r,stateObj:o}=t.payload,{context:i}=t.payload;let c=i;if(o)return kN(e,o,i),e;const l=Cu(n,s,a,r);return a===Gs.PAGE&&i?.includes(xE.WORKAREA)&&(c=Ks(i)),BN(e,c,l,t),BN(e,i,l,t),e})(e,t)})).addCase(pr,((e,t)=>{const{messages:n,property:s,pageReference:a,context:r,category:o}=t.payload,i=Cu(s,a,o);n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&AC.setIn(e[r],Cu(s,a,o),n)}))})),KN=YN,QN=(e,t,n,s,a)=>{AC.setIn(e[t],[...n,s],a)},JN=yN({},(e=>{e.addCase(Er,((e,t)=>{const{instruction:n,actions:s,context:a,referenceList:r,listIndex:o,groupIndex:i,listMoveToIndex:c,content:l={}}=t.payload,u=eC(r);switch(n){case Gs.LIST_ACTIONS.ADD:QN(e,a,u,i,l);break;case Gs.LIST_ACTIONS.INSERT:QN(e,a,u,o,l);break;case Gs.LIST_ACTIONS.UPDATE:((e,t,n,s,a)=>{const r=hC(AC.getIn(e[t],[...n,s],{}),a);AC.setIn(e[t],[...n,s],r)})(e,a,u,o??i,l);break;case Gs.LIST_ACTIONS.DELETE:((e,t,n,s,a)=>{const r=AC.getIn(e[t],n,[]);"string"==typeof s?delete r[s]:r.splice(s,1),AC.setIn(e[t],n,r),yu.deleteListNode(t,[a],r.length)})(e,a,u,o??i,r);break;case Gs.LIST_ACTIONS.MOVE:((e,t,n,s,a)=>{const r=AC.getIn(e[t],[...n,s],{}),o=AC.getIn(e[t],n,[]);o.splice(s,1),o.splice(a,0,r),AC.setIn(e[t],n,o),Nu(e,t,n?.join("."),s,a)})(e,a,u,o,c);break;case Gs.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,s)=>{const a=AC.getIn(e[t],n)||[];s.forEach((e=>{const{instruction:s,content:r,listIndex:o}=e;if(s===Gs.LIST_ACTIONS.SELECT){a[o]=r;const e=n?.join(".");Ld(t,e)}else delete a[o]})),AC.setIn(e[t],n,a.filter(Boolean))})(e,a,u,s);break;case Gs.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{AC.setIn(e[t],n,[])})(e,a,u);break;case Gs.LIST_ACTIONS.REPLACE:((e,t,n,s)=>{AC.setIn(e[t],n,s)})(e,a,u,l);break;case Gs.LIST_ACTIONS.DELETEPAGE:((e,t,n)=>{AC.setIn(e[t],n,{})})(e,a,u)}}))})),XN=[UN,xN,KN,JN],ZN=(e,t)=>(e||(e=oT().data),t.type===hr?oT().data:(XN.forEach((n=>{e=n(e,t)})),e)),eT={},tT=(e,t=[])=>{t.forEach((t=>{AC.deleteIn(e,[t])}))},nT=(e,t)=>{const{type:n,payload:s}=t,a=n===Ga,{target:r,context:o,semanticURL:i="",root:c,containerItemID:l,childContainers:u,flowName:d,resourceType:p="",key:g="",clearView:h=!1}=s;return c?AC.setIn(e,[r,"items",l,"view"],c):h&&AC.deleteIn(e,[r,"items",l,"view"]),o&&AC.setIn(e,[r,"items",l,"context"],o),d&&AC.setIn(e,[r,"items",l,"flowName"],d),(!a||a&&g)&&AC.setIn(e,[r,"items",l,"key"],g.trim()),((e,t,n,s)=>{""===e&&AC.deleteIn(t,[n,"items",s,"key"])})(g,e,r,l),(!a||a&&i)&&AC.setIn(e,[r,"items",l,"semanticURL"],i),(!a||a&&p)&&AC.setIn(e,[r,"items",l,"resourceType"],p),tT(e,u),e},sT=yN(eT,(e=>{e.addCase(hr,(()=>eT)).addCase(va,((e,t)=>{const{context:n,name:s,type:a,actionMgrID:r}=t.payload,o=`${n}/${s}`;if(zp.resolveActionByID(r,null,!1),e[o])return e;AC.setIn(e,[o],{type:a,accessedOrder:[],items:{}})})).addCase(za,((e,t)=>{const{containerName:n,childContainers:s=[]}=t.payload;AC.deleteIn(e,[n]),s.forEach((t=>{AC.deleteIn(e,[t])}))})).addCase(xa,((e,t)=>{const{context:n,name:s,actionMgrID:a,childContainers:r}=t.payload,o=`${n}/${s}`;zp.resolveActionByID(a,null,!1),AC.setIn(e,[o,"accessedOrder"],[]),AC.setIn(e,[o,"items"],{}),Array.isArray(r)&&r.forEach((t=>{AC.deleteIn(e,[t])}))})).addCase(wa,((e,t)=>{const{target:n,context:s,isInCreateStage:a,isBulkAction:r,semanticURL:o,root:i,containerItemID:c,actionMgrID:l,key:u,flowName:d,resourceType:p,actionName:g,isMinimizable:h,showProgress:f,progressMessage:m,modalOptions:I,resourceStatus:E,actionID:y,isMultiRecordData:A,acTertiary:C,parentContext:S,heading:_,isTraditionalRemoteCase:N,readOnly:T,referenceList:D,subscriptName:P,subscriptFieldName:O,pageGroupName:R,isPageGroup:b,index:v,isDeleteConfirmation:x,workId:w,caseTypeID:M,className:L,keys:U,enableBackNavigation:F}=t.payload,V=e[n],j=V&&V.type,k=V&&V.accessedOrder||[],B=V&&V.items||{};if(e[n]&&"single"===j&&k.length>0)return nT(e,t);const $={accessedOrder:[...k,c],items:{...B,[c]:{view:i,semanticURL:o,key:u,flowName:d,readOnly:T,context:s,isInCreateStage:a,resourceType:p,actionName:g,isMinimizable:h,...r&&{isBulkAction:r},showProgress:f,progressMessage:m,modalOptions:I,isTraditionalRemoteCase:N,resourceStatus:E,referenceList:D,subscriptName:P,subscriptFieldName:O,pageGroupName:R,isPageGroup:b,index:v,...y&&{actionID:y},...C&&{acTertiary:C},...A&&{isMultiRecordData:A},...S&&{parentContext:S},...x&&{isDeleteConfirmation:x,workId:w,caseTypeID:M,className:L,keys:U,enableBackNavigation:F},heading:_}}};zp.resolveActionByID(l,null,!1),e[n]=Us(e[n],$)})).addCase(Ga,((e,t)=>{const{actionMgrID:n,data:s}=t.payload;try{nT(e,t),zp.resolveActionByID(n,s,!1)}catch{zp.rejectActionByID(n,!1)}})).addCase(Ha,((e,t)=>((e,t)=>{const{actionMgrID:n,data:s,target:a,containerItemID:r}=t.payload;let o=e;try{const i=e&&e[a]?.type;let c=e&&e[a]?.accessedOrder||[];c="single"===i?c.length>0?c:[...c,r]:c.includes(r)?c:[...c,r],AC.setIn(e,[a,"items",r,"transientItems"],[]),AC.setIn(e,[a,"accessedOrder"],c),o=nT(e,t),zp.resolveActionByID(n,s,!1)}catch{zp.rejectActionByID(n,!1)}return o})(e,t))).addCase($a,((e,t)=>{const{target:n,containerItemID:s,actionMgrID:a}=t.payload;try{const t=AC.getIn(e,[n,"accessedOrder"]).filter((e=>e!==s));t.push(s),AC.setIn(e,[n,"accessedOrder"],t),zp.resolveActionByID(a,null,!1)}catch{zp.rejectActionByID(a,!1)}})).addCase(Wa,((e,t)=>{const{target:n,containerItemID:s,actionMgrID:a,childContainers:r}=t.payload;try{const t=AC.getIn(e,[n,"accessedOrder"]).filter((e=>e!==s));AC.setIn(e,[n,"accessedOrder"],t),AC.deleteIn(e,[n,"items",s]),tT(e,r),zp.resolveActionByID(a,null,!1)}catch{zp.rejectActionByID(a,!1)}})).addCase(Ma,((e,t)=>{const{target:n,containerItemID:s,actionMgrID:a,childContainers:r}=t.payload;try{const t=AC.getIn(e,[n,"accessedOrder"]).filter((e=>e!==s));AC.setIn(e,[n,"accessedOrder"],t),AC.deleteIn(e,[n,"items",s]),tT(e,r),zp.resolveActionByID(a,null,!1)}catch{zp.rejectActionByID(a,!1)}})).addCase(La,((e,t)=>{const{transientItemID:n,target:s,contextName:a}=t.payload,r=AC.getIn(e,[s,"items",a,"transientItems"])??[];AC.setIn(e,[s,"items",a,"transientItems"],[...r,n])})).addCase(Va,((e,t)=>{const{target:n,containerItemID:s}=t.payload;AC.deleteIn(e,[n,"items",s,"transientItems"])})).addCase(Fa,((e,t)=>{const{target:n,transientItemID:s,containerItemID:a}=t.payload,r=(AC.getIn(e,[n,"items",a,"transientItems"])??[]).filter((e=>e!==s));AC.setIn(e,[n,"items",a,"transientItems"],r)}))})),aT=sT;let rT={};const oT=()=>rT,iT=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,s=n[Gs.CONTEXT_DATA]||e[Gs.CONTEXT_DATA];rT={data:{locale:Gy.getLocale(),[Gs.APP.APP]:{...t,[Gs.CONTEXT_DATA]:s}},containers:{}}})(e),{data:ZN,containers:aT}),cT=(e,t=!1)=>e===Gs.ACTION?t?kh.REFRESH_CASE_DATA:kh.REFRESH_ASSIGNMENT_DATA:kh.REFRESH_CASE_VIEW,lT=e=>{const{context:t}=e;let n={...Am(t).content,contextData:!1};const s=$m(t);AC.isEmpty(s)||(n=Bm(s,n));const a=cT(e.editType,e.isLocalAction),{restApi:r,reqType:o}=_S(a,{ID:e.isLocalAction||e.editType!==Gs.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=r;return e.editType===Gs.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID),n.interestPage=e.interestPage,eu(ud(i,{method:o,body:n,headers:e.headers},t)).pipe(yg((t=>({actionInPayload:e,response:t.data,headers:ym(t.headers)}))),wg(": Error occurred during ajax call : ",t))},uT={},{VIEW:dT,FIELD:pT}=Gs.CONTEXT_TREE_NODE_TYPES,gT=(e,t,n)=>{const s=t.value.data[n]?.objectInfo?.headers,a=t.value.data[n]?.caseInfo?.headers;return!lI.shouldUseUnifiedHandling()&&e&&s?s:a},hT=e=>(e=>td[e])(e)>0&&uT[e],fT=(e,t)=>{const{caseWideAction:n,caseViewAction:s,fieldsWithDeclarativeTargets:a,fieldsWithWhen:r,isViewsWithWhen:o,interestPage:i,options:c,isMultiRecordData:l,editType:u,isLocalAction:d,interestPageActionID:p}=e,{optionalPayload:g}=c;g&&(t.content={...g});let h={},f={...t},m=kh.REFRESH;if(s||l&&u===Gs.ACTION){const t=cT(u,d);l&&u===Gs.ACTION&&(f.interestPageActionID=p),h=_S(t,e),f={...f,interestPage:i}}else o?h=((e,t)=>{const{isObjectType:n,isExternalObject:s,actionID:a,context:r,isExternalCase:o,casetypeID:i}=e,c=Gs.getDefaultQualifiedName(Gs.VIEW_NAMES.OBJECT_CREATE_VIEW);if(t||n&&wI(r)){let t=s&&a===c?kh.REFRESH_EXTERNAL_OBJECT:kh.REFRESH_CASE_DATA;const n=lI.shouldUseUnifiedHandling();return s&&a===c&&n&&(t=kh.REFRESH_EXTERNAL_CASE_DATA),_S(t,e)}return _S(o&&i&&a===c?kh.REFRESH_EXTERNAL_CASE_DATA:kh.REFRESH_ASSIGNMENT_DATA,e)})(e,n):(a.length>0||r.length>0)&&({restAPI:h,requestBody:f,requestType:m}=((e,t,n,s,a)=>(a={...a,calculations:{fields:t,whens:n}},{restAPI:_S(s?kh.RECALCULATE_CASE_DATA:kh.RECALCULATE_ASSIGNMENT_DATA,e),requestBody:a,requestType:kh.RECALCULATE}))(e,a,r,n,f));return{restAPI:h,requestBody:f,requestType:m}},mT=[(e,t)=>e.pipe(bg(kh.REFRESH_DATA,xr),yg((e=>e.payload)),Og((e=>!gm(e?.options?.actionMgrID))),Ag((e=>{const{context:n,contextData:s,options:a,isObjectType:r}=e,{propertyName:o="",classID:i="",isObjectWideAction:c,skipPayloadGeneration:l}=a,u=l?{content:{}}:Am(n,{skipUUID:!1,isObjectWideAction:c});let d=[],p=[],g=!1;Gy.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:d=[],whens:p=[]}=jI(n)),g=p.some((e=>e.type===dT))):g=!0;const h=p.filter((e=>e.type===pT)),f=AC.getPropertyName(o),m=f?f.split("."):[],I=m.pop(),E=m.join("."),y=[];E&&((e,t,n,s,a)=>{const r=SA(e,t);if(!r||"copy"!==r.dataRetrievalType)return;const o=AC.getIn(n,`content.content.${e}`);if(!o||"object"!=typeof o)return;const i=s?Object.keys(o).filter((e=>e!==s)):Object.keys(o);i.length>0&&(i.forEach((e=>delete o[e])),a.push(e))})(E,i,u,I,y),e.serverPrecedenceFields=y;let A={...u.content,contextData:s};const C=$m(n);AC.isEmpty(C)||(A=Bm(C,A));const S=fT({...e,fieldsWithDeclarativeTargets:d,fieldsWithWhen:h,isViewsWithWhen:g},A);Yh.registerBlockingAction(n).catch((()=>{}));const{restAPI:_,requestBody:N,requestType:T}=S;(e={...e,requestType:T}).requestType=T;const{reqType:D,restApi:P}=_,O={...gT(r,t,n)};O&&!O.etag&&e.isMultiRecordData&&e.editType===Gs.ACTION&&(O.etag=AC.getETag(e.context));return eu(((e,t)=>{const{context:n}=e;(e=>{const{reqHeaders:t}=e;t&&(e.headers=e.headers||{},t.etag&&(e.headers["if-match"]=t.etag))})(e);const s=(e=>{const{ID:t,actionID:n,context:s}=e;return`${t}.${s}.${n}`})(t);if(t.interestPage&&(e.interestPage=t.interestPage),hT(s)){const t=[];for(let n=0;n<uT[s].length;){const a=uT[s][n],r=VI(a,e);if("CANCEL_REFRESH"===r){const e=new Error;return e.code="ERR_CANCELED",Promise.reject(e)}!0===r&&(t.push(n),a.cancelConfig?.cancel()),n+=1}t.forEach((e=>{uT[s].splice(e,1)}))}const a=gd();return e.signal=a.token,e.cancelConfig=a,uT[s]?uT[s].push(e):uT[s]=[e],Uu.publish($s.PUB_SUB_EVENTS.ON_REFRESH_START,{context:n}),ud(e.url,e,n,{cancelContext:s}).then((e=>(delete uT[s],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete uT[s],e}))})({reqHeaders:O,context:n,method:D,body:N,url:UI(e,P)},e)).pipe(yg((t=>{const s=((e,t,n)=>{const s=lI.shouldUseUnifiedHandling(),a=lI.isObjectCaseType(t)||n;if(s||!a)return e;const r=AC.getIn(e?.data,$s.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID);return lI.isExternalObject(r)?e:Bs.transformCaseData(e)})(t?.data,a?.classID,r);return a?.resetForm&&yu.removeContextTreeNode(n),{response:{...s},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:ym(t.headers)}})),wg(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),Ag((async e=>{if(e&&e.type===ba)return Yh.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),"ERR_CANCELED"===e.payload?.err?.code?[]:(Uu.publish(Gs.ON_REFRESH_ERROR,{context:e.payload?.context}),Dm(e));const{actionConfig:t,response:n,actionMgrID:s}=e,{context:a,serverPrecedenceFields:r,requestType:o}=t,i=Kp.getTargetViewContainerName(Ka),c=Wr(i,a),l={acName:c,context:a},u=Cf(n,{[$s.STOPMERGEACTIONS]:!0,[$s.ACTIONS.DELETEAVIALACTIONS]:!0});u.directUrlUpdation=!1,o===kh.REFRESH&&await Sm(u,t,l);const d=Cm(u,{target:c,context:a});t.interestPage&&(d.interestPath=`caseInfo.content${AC.convertClipboardPageToPageRefNotation(t.interestPage)}`),d.isArrayDeepMerge=t.options?.isArrayDeepMerge,d.preserveClientChanges=void 0===t.options?.preserveClientChanges||t.options.preserveClientChanges;const p=lI.getPropertiesToReArrange(a),g=aS(vC,d,{serverPrecedenceFields:r,propertiesToReArrange:p}),h=g.payload?.data?.pageInstructions;return h?.length>0&&(delete g.payload?.data?.pageInstructions,qm.mergeServerPageInstructions(a,h)),sC(g),zp.resolveActionByID(s,d),Uu.publish($s.PUB_SUB_EVENTS.ON_REFRESH_COMPLETE,{context:a}),Yh.deRegisterBlockingAction(a).catch((()=>{})),[]})))],IT=mT,ET=[e=>e.pipe(bg(fr),Ag((async e=>{const{context:t}=e.payload,n={},s={},a=Object.keys(e.payload.datapages).map((a=>{const r=e.payload.datapages[a];if(r.mode===Gs.READONLY&&r?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=r?.refreshStrategy||{},n=rC()[r.name];if(n&&a in n){const s=n[a],{loadTime:r}=s;if(!$g.isTimeElapsed(r,e,t))return}}return $g.getData(r.name,{dataViewParameters:r.dataViewParameters},t).then((e=>{const t=r.mode===Gs.READONLY?s:n;t[r.name]?t[r.name][a]={pxResults:e.data.data,parameters:r.dataViewParameters,loadTime:e.data?.fetchDateTime}:t[r.name]={[a]:{pxResults:e.data.data,parameters:r.dataViewParameters,loadTime:e.data?.fetchDateTime}}})).catch((()=>{}))}));await Promise.allSettled(a);const r=[];return Object.keys(n).length&&r.push(vC({context:t,data:n})),Object.keys(s).length&&r.push(oS({data:s,context:t})),sC(r),[]})))],yT=ET;class AT{static OPEN_ASSIGNMENT_ACTION="openAssignment";static DIRTY_POPUP_C11N="displayDirtyPopupFromConstellation";static HANDLE_INFINITY_DISCARD="handleDiscardInInfinity";static OPEN_ASSIGNMENT_MODAL="openAssignmentInModal";static DISPLAY_DIRTY_POPUP="displayDirtyPopup";static LOAD_PREVIEW="loadPreview";static UPDATE_COEXISTENCE_DRILLDOWN_CASE="updateCoexistenceDrilldownCase";static OPEN_WORK_ITEM="openWorkItem";static OPEN_WORK_BY_HANDLE="openWorkByHandle";static GET_NEXT_WORK_ACTION="getNextWork";static CLOSE_CONTAINER_ACTION="closeContainer";static CANCEL_CASE="cancelCase";static CREATE_WORK="createWork";constructor(){this.broadcastChannel=null,this.callback=null,this.isReverseCoexistenceCase=!1,this.broadcastEventToIframe=!1,this.isDirtyDialogActive=!1,this.onCreateCallback=null,this.openAssignmentParams=null}getGlobalObject=()=>a.g;getUniqueId=()=>this.getGlobalObject().uniqueId;setUniqueId=()=>{this.getGlobalObject().uniqueId=(new Date).getTime()};initBroadcastChannel=()=>{this.setUniqueId(),this.broadcastChannel=new BroadcastChannel("coexistence"),this.broadcastChannel.onmessage=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId())switch(e.data.action){case AT.DISPLAY_DIRTY_POPUP:this.displayDirtyPopup(e);break;case AT.LOAD_PREVIEW:this.loadPreview(e);break;case AT.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case AT.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case AT.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case AT.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case AT.CLOSE_CONTAINER_ACTION:this.closeContainer(e);break;case AT.CANCEL_CASE:this.handleCaseCancel();break;case AT.CREATE_WORK:this.createWork(e)}}};displayDirtyPopup=e=>{this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(Uu.publish(Gs.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this))};handleCaseCancel=()=>{const e=ey($s.APP.APP),t=e[e.length-1],n=YE(t),s=aC(n)?.caseInfo?.ID;if(s&&n&&Ff({}).getPConnect().getActionsApi().getDescendants(s,n),tm(n)){const e=Ly(n);e&&Ff({}).getPConnect().getActionsApi().getDescendants(s,e)}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:s}=e.data;if(s===this.getUniqueId()){Ff({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=ks.getDefaultQualifiedName("Data-Portal"),t=ks.getDefaultQualifiedName("pyHome"),n=Ff({isRoot:!0}),s=PCore.getStore()?.getState().data.app?.pyPortal?.pyPrimaryNavPages;let a;Array.isArray(s)&&s[0]&&(a=s[0]);const r=a?.pyClassName||e,o=a?.pyRuleName||t;n.getPConnect().getActionsApi().showPage(o,r)};closeContainer=e=>{const{uniqueId:t}=e.data;t===this.getUniqueId()&&this.navigateToDefaultPage()};updateCoexistenceDrilldownCase=e=>{const{key:t,caseClassName:n,actionApi:s,caseLabel:a,uniqueId:r}=e.data;if(r!==this.getUniqueId())return;let o=s;s===AT.OPEN_WORK_ITEM&&(o=AT.OPEN_WORK_BY_HANDLE),By.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:o,name:a});Ff({}).getPConnect().getActionsApi().updateRecents(n,t.substring(t.lastIndexOf(" ")+1),a,t)};openAssignment=e=>{const{pzInsKey:t,caseClassName:n,uniqueId:s}=e.data;if(s===this.getUniqueId()){if(this.onCreateCallback&&this.openAssignmentParams&&(t&&this.openAssignmentParams[0]&&this.openAssignmentParams[0].payload&&this.openAssignmentParams[0].payload.data?this.openAssignmentParams[0].payload.data.caseInfo.assignments[0].ID=t:this.openAssignmentParams[0]&&this.openAssignmentParams[0].payload&&this.openAssignmentParams[0].payload.data&&(this.openAssignmentParams[0].payload.data.caseInfo.content.coexistenceAction="openWorkByHandle"),t)){Ff({}).getPConnect().getActionsApi().openAssignment(t,n,{containerName:$s.PRIMARY,context:$s.APP.APP})}this.onCreateCallback=null,this.openAssignmentParams=null}};getNextWork=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId()){const e=`${$s.APP.APP}${Gs.FORWARD_SLASH_STRING}${$s.PRIMARY}`;Ff({meta:{},options:{context:XE(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:s}=e.data;if(s===this.getUniqueId()){const e=`${$s.APP.APP}${Gs.FORWARD_SLASH_STRING}${$s.PRIMARY}`;Ff({meta:{},options:{context:XE(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};createWork=e=>{const{strClassName:t,uniqueId:n,strFlowParams:s,caseInitProperties:a}=e.data;if(n===this.getUniqueId()){const e=`${$s.APP.APP}${Gs.FORWARD_SLASH_STRING}${$s.PRIMARY}`,n=Ff({meta:{},options:{context:XE(e)}}),r=new URLSearchParams((a+s).slice(1)),o=this.setStartingFields(r);n.getPConnect().getActionsApi().createWork(t,{startingFields:o})}};setStartingFields=e=>{const t={};return e.forEach(((e,n)=>{n&&(t[n]=e)})),t};destroyBroadcastChannel=()=>{this.getBroadCastChannel()?.close(),this.broadcastChannel=null};subscribeEvents=()=>{this.setReverseCoexistenceCaseLoaded(!0),Uu.subscribe($s.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),Uu.subscribe($s.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{Uu.unsubscribeAllWithEventType($s.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),Uu.unsubscribeAllWithEventType($s.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD),this.setReverseCoexistenceCaseLoaded(!1),this.isDirtyDialogActive=!1};init=(e=!0)=>{null===this.broadcastChannel&&this.initBroadcastChannel(),e&&this.subscribeEvents()};destroy=()=>{this.destroyBroadcastChannel(),this.unsubscribeEvents()};setCallBackFunction=e=>{this.callback=e};setReverseCoexistenceCaseLoaded=e=>{this.isReverseCoexistenceCase=e};setIsDirtyDialogActive=e=>{this.isDirtyDialogActive=e};getBroadCastChannel=()=>this.broadcastChannel;getCallBackFunction=()=>this.callback;isReverseCoexistenceCaseLoaded=()=>this.isReverseCoexistenceCase;postDirtyPopupMessage=({callBackFunction:e})=>{this.broadcastChannel?.postMessage({action:AT.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:AT.HANDLE_INFINITY_DISCARD,uniqueId:this.getUniqueId()}),this.broadcastEventToIframe=!1):(this.callback?.call(this),this.callback=null),this.isDirtyDialogActive=!1};postCreateCaseMessage=(e,t,n)=>{null===this.broadcastChannel&&this.init(!1),this.broadcastChannel?.postMessage({action:AT.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const CT=new AT,ST="nextAssignmentInfo",_T="nextAssignmentInfo.context",NT=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Gs.MODAL:t||Kp.getTargetViewContainerName(tr)},TT=async(e,t)=>{if(sy(e))return{continueExecution:!0,removeActionPayload:{},dirtyCheckPerformed:!1};return{...await vm(e,t),dirtyCheckPerformed:!0}},DT=e=>{if(lI.shouldUseUnifiedHandling())return e?.uiResources?.root?.config?.name===ks.getDefaultQualifiedName("pzCreateDetails")||!1;const t=AC.getIn(e,[Gs.DATA,Gs.CASE_INFO.CASE_INFO]);return dI(t)&&pI(Gy.getOperatorIdentifier(),t)},PT=(e,t)=>{const{class:n,context:s,viewType:a=Im.PAGE}=e,{removeActionPayload:r}=t;let o=e?.pageName?e?.pageName:Gy.getDefaultCasePage();return e.isTraditionalUICase&&(o=ks.getDefaultQualifiedName("pyDetails")),eu(yp.createCase(n,{...e,pageName:o,viewType:a,context:s})).pipe(yg((({response:t,headers:n})=>(Bs.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:r}))),wg("Error occurred during ajax call at createWork Epic : ",s))},OT=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},RT=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},bT=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_VIEW_OPENED_AFTER_CREATE,e)},vT=e=>{let t,n=0,s=[],a={},r=!1,o=!1;return e.pipe(bg(OC),Mg(100),yg((e=>(({actionMgrID:n}=e.payload),e.payload))),Ag((e=>{const{context:s}=e;if(t=e.class,o=!1,lI.isExternalCaseType(t)&&(Du({context:s,stateObj:aC(s),clearContextMessages:!0}),!aI(s))){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(n,!0,e),xg()}const a=NT(e),i=Wr(a,s);return r=rm(t),eu(TT(i,{loadingContext:s})).pipe(Ag((({continueExecution:t,removeActionPayload:s,dirtyCheckPerformed:a})=>t?(o=a,e.isTraditionalUICase=r,PT(e,{removeActionPayload:s})):(zp.rejectActionByID(n),vg))))})),Ag((async e=>{if(e?.type===ba)return e.payload.context=((e,t)=>lI.isExternalCaseType(e)&&t?t:Ry())(t,e.payload.context),s.push(Dm(e)),s;const{actionInPayload:i,response:c,headers:l,removeActionPayload:u}=e,d=lI.isExternalCaseType(i.class);let p=DT(c);(i.renderInline||Gy.getDefaultCasePage()||r)&&(p=!1),AC.setIn(c.data,$s.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const g=NT({...i,isInCreateStage:p}),h=Wr(g,i.context),f=Om(h,g,i.context),{openCaseViewAfterCreate:m}=i;if(!o&&((e,t,n)=>!Gf(e)&&sy(t)&&(n??!0))(g,h,m)){const{continueExecution:e}=await vm(h,{loadingContext:i.context});if(!e)return zp.rejectActionByID(n),s}const I=i?.openCaseViewAfterCreate??!0,E=Cf(c);if(!I&&!p){const e=Xf(c),{businessID:t,caseType:n,resolvedURL:r}=ag(c);return a={id:t,label:n,href:r},OT(a),RT({caseId:t,assignmentId:e,caseType:n,ID:Jf(E)}),d&&em(i),s}const y=String(Yf(Jf(E)));let A=CS("createWork",{caseClassName:Kf(E)});A=A.replace(/{.+?}/,y),E.semanticURL=A,Hp.setComponentCache(y,Zu.addDebugHeaders(i.debugInfo)),((e,t)=>{const n=DT(e),{skipBrowserSemanticUrlUpdate:s=!1,isTraditionalUICase:a}=t,r=a&&!om();AC.setIn(e,["directUrlUpdation"],(!n||r)&&!s)})(E,i);const C={acName:h,context:f},S=pm(f);await Sm(E,i,C);const _={target:h,context:f,containerItemID:f,headers:l,semanticURL:A,isInCreateStage:p,isMinimizable:p,caseViewMode:E.confirmationNote?Gs.REVIEW_MODE:Gs.PERFORM_MODE,currentCaseViewMode:S,assignmentContext:AC.getIn(E,_T),nextAssignmentInfo:AC.getIn(E,ST),resourceType:$s.CASE,openCaseViewAfterCreate:i.openCaseViewAfterCreate,modalOptions:i.modalOptions,debugInfo:i.debugInfo};nm(_,E);const N=Cm(E,_);r&&(N.data.caseInfo.content.coexistenceAction="openAssignment"),lI.setTraditionalGadgetId(N.data);const T=Pm(h,N);return Rm(T)&&Zf(s,{removeActionPayload:u,target:h}),d&&em(i),s.push(T),dm(E,_),bT({caseId:y}),s})),yg((()=>{const e=om(),t=dI(AC.getIn(s[0]?.payload,"data.caseInfo"));return r&&e&&t?CT.postCreateCaseMessage(s[0]?.payload?.nextAssignmentInfo?.ID,km,s):km(s),am(s,n),a={},s=[],s})))},{RESOURCE_TYPES:xT}=$s,wT=(e,t)=>{const{containerItemID:n,context:s,actionMgrID:a,isInCreateStage:r,isModalAction:o}=t;if(r&&o){const t=Bf(n),r=Wr(t,s);e.push(aS(KC,{containerItemID:n,target:r,actionMgrID:a}))}},MT=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:s,isInCreateStage:a,isProcessAction:r}=t,o=JE(n),i=`${o?.includes("root")?Gs.APP.ROOT:Gs.APP.APP}/${xE.MODAL}`;e.push(aS(JC,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:s,isInCreateStage:a,isProcessAction:r}))},LT=e=>iC(".openCaseViewAfterCreate",Gs.CONTEXT_DATA,e)??!0,UT=async(e,{translatedDXAPIResponse:t,actionInPayload:n},s,a,r)=>{const{caseID:o}=n,i=(c=t,AC.getIn(c,jf.NEXT_ASSIGNMENT_INFO_ID,Gs.EMPTY_STRING));var c;const l=a?Zp(t):Kf(t),{caseViewMode:u,headers:d,semanticURL:p,actionMgrID:g,directUrlUpdation:h,key:f,flowName:m,resourceType:I}=s,E=py(n?.context),y=FE(E,n?.context)?.acTertiary;Object.assign(r,{caseId:o,assignmentId:i,caseType:l,isSubmitFromBlendedUI:y}),MT(e,{...n,skipReleaseLockRequest:!0});const A=`${n?.containerItemID.includes("root")?Gs.APP.ROOT:Gs.APP.APP}/${xE.PRIMARY}`,C=Om(A,xE.PRIMARY),S=Zu.getCoreHeadersFromContext(n.context)||!1,_=Cm(t,{target:A,context:C,containerItemID:C,caseViewMode:u,headers:d,semanticURL:p,key:f,flowName:m,resourceType:I,directUrlUpdation:h,debugInfo:S&&S.debugInfo&&{debugId:S.debugInfo[Gs.COREHEADER_APP_DEBUG_ID]},shouldUpdateCaseActionsInParentContext:!0});if(sy(A)){const t=aC(C),a=Jf({data:t}),[,r]=a?a.split(" "):[],o=`You will lose unsaved changes for ${r}. Do you want to continue?`;if(!LT(n.context))return e;{const{continueExecution:t}=await vm(A,{dirtyMessage:o});if(!t)return s.directUrlUpdation=!1,zp.rejectActionByID(g),xg();_.currentCaseViewMode=pm(_?.context),e.push(aS(eS,_)),n.__deferCaseActionsPayload=_}}else e.push(aS(jC,_));return t.directUrlUpdation=h,t.semanticURL=p,await Sm(t,{..._,acName:A},{acName:A,context:C}),e},FT=(e,{isModalAction:t,target:n,transientItemID:s})=>{if(t){const t=e.find((({type:e})=>e===Ha));t?.payload&&(n=t.payload.target,s=t.payload.containerItemID)}const a=XC({target:n,containerItemID:s});a.payload.transientItems.length&&e.push(a)},VT=e=>/^app\/preview_[0-9]*/g.test(e),jT=(e,t)=>{const n=Ks(e);return!VT(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},kT=e=>{if(!LT(e.context)){let t;const n=e?.caseTypeID,s=e?.caseTypeName;return t=e.businessID?e.businessID:e.workID,{caseID:t,caseTypeID:n,caseTypeName:s}}return{}},BT=(e,t,n,s)=>{const{data:a,caseViewMode:r}=t,o={data:a,caseViewMode:r,context:n};if(AC.setIn(o.data,["context_data","caseViewMode"],r),e.push({type:yr,payload:{context:n}}),s){const t={data:Bs.transformObjectToCase(a),caseViewMode:r,context:n};e.push(aS(vC,t))}e.push(aS(vC,o))},$T=async(e,t,n,s,a,r,o,i,c,l)=>{const{headers:u}=c,d=l?Gs.OBJECT_INFO.OBJECT_INFO:Gs.CASE_INFO.CASE_INFO;if(e){if("object"!=typeof c?.response?.uiResources?.root){const t=(e,t)=>{const n=e.findIndex((e=>e.ID===t));if(-1!==n){const[t]=e.splice(n,1);e.unshift(t)}return e},n=aC(e),s=c?.response?.data?.caseInfo?.assignments??[],a=n?.caseInfo?.assignments??[],r=pm(e)===Gs.PERFORM_MODE,o=s[0]?.ID!==a[0]?.ID,i=s.length>0&&a.length>0;r&&o&&i&&c?.response?.data?.caseInfo?.assignments&&(c.response.data.caseInfo.assignments=t(s,a[0]?.ID))}const p=sy(py(e));let g=!1;const h=py(n),f=LE(h),m=YE(h);m&&f?.items?.[m]?.key===c?.actionInPayload?.caseID&&(g=!0),MT(a,{...s,skipReleaseLockRequest:!0});const I=Bf(e),E={target:py(e),containerItemID:e,context:e,containerName:I};t.doDeleteCaseSummary=s.doDeleteCaseSummary;const y=ta(n),A=aC(y),C=aC(s.context),S=A[d]?.ID,_=C[d]?.ID,N=aC(e)?.caseInfo?.ID;if(p&&S===_||!p&&(""===o||E.containerItemID.includes(Gs.WORKAREA)&&t.caseViewMode===Gs.REVIEW_MODE&&N===t.data?.caseInfo?.ID||!r&&t.root&&0===Object.keys(t.root).length&&N===t.data?.caseInfo?.ID))(void 0===t?.data[d]?.content||void 0!==t.data[d].content&&"object"==typeof t.data[d].content&&0===Object.keys(t.data[d].content).length)&&(t.root=void 0,delete t.data?.caseMessages),e.includes(Gs.WORKAREA)&&t.caseViewMode===Gs.REVIEW_MODE&&((e,t)=>{const n=e?.assignmentID,s=t?.data?.caseInfo?.assignments??[],a=s[0]?.ID;return n!==a})(s,i)&&(t.flowName=" ",t.clearView=!0),e.includes(Gs.ACTIONAREA)?a.push(aS(vC,{...t,key:o,resourceType:"",...E})):a.push(aS(HC,{...t,key:o,resourceType:"",...E}));else if(r){const r=py(e),i=GE(r,o);if(i)E.target=r,E.context=i,E.containerItemID=i,a.push(aS(HC,{...t,key:o,resourceType:"",...E}));else{const e=ey(n)[0];if(s.target=e,s.context=Om(e,Gs.WORKAREA,n),s?.context){s.containerItemID=s.context,a.push(aS(jC,{...s,...t}));const n=s.containerItemID;a.push(aS(KC,{parentContainerTarget:e,containerItemID:n}))}}}if(s.target=py(e),s.containerName=Bf(e),s.context=e,s.containerItemID=e,s.shouldUpdateCaseActionsInParentContext=!0,AC.setIn(t,"acName",E.target),await Sm(i,t),s.__deferCaseActionsPayload=s,g&&(n.includes(Gs.WORKAREA)&&tm(n)&&(n=ta(n)),BT(a,t,n,l)),!r&&t.caseViewMode===Gs.PERFORM_MODE){const t=((e,t)=>{const n=py(e);return GE(n,t)})(e,o),n={data:{[d]:{headers:u}},context:t};a.push(aS(vC,n)),a.push(_I(((e,t=!1,n=!1)=>{const s=zp.getNextActionMgrId();return{ID:NC.getPropertyValue($s.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:NC.getPropertyValue($s.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:s}}})(t)))}}else{MT(a,s);let e=!1;const o=py(n),i=LE(o),u=YE(o);if(u&&i?.items?.[u]?.key===c?.actionInPayload?.caseID&&(e=!0),r){const e=ey(n)[0];s.target=e,s.context=Om(e,Gs.WORKAREA,n),s.containerItemID=s.context,a.push(aS(jC,{...s,...t}));const r=s.containerItemID;a.push(aS(KC,{parentContainerTarget:e,containerItemID:r}))}e&&BT(a,t,n,l)}},GT=async(e,t,n,s,a,r,o)=>{const i=r?"objectInfo":"caseInfo";((e,t,n)=>{if(t.isProcessAction&&(MT(n,{...t,skipReleaseLockRequest:!0}),e)){const s=`${t?.containerItemID.includes("root")?Gs.APP.ROOT:Gs.APP.APP}/${xE.PRIMARY}`,a=Om(s,xE.PRIMARY),r={insKey:e.ID,className:e.content.classID,context:a,acTargetName:Gs.PRIMARY,isChild:!0},o={type:Ia,payload:{...r}};n.push(o)}})(e.data[i].parentCaseInfo,t,a);const c=e?.data[i]?.parentCaseInfo?.ID;if(c){const n=py(t?.context),s=FE(n,t?.context)?.parentContext,a=py(s);t?.isProcessAction&&BE(a,c)&&vy(s,e?.data[i]?.lastUpdateTime)}n.resourceType=xT.CASE,n.directUrlUpdation=!0,t.isProcessAction||await UT(a,{translatedDXAPIResponse:s,actionInPayload:t},n,r,o)},WT=async(e,t,n,s,a)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===Gs.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:r}=t;sy(py(r))||AC.setIn(e.data,["context_data","caseViewMode"],e.caseViewMode);const o=lI.getPropertiesToReplace(r);a.push(aS(HC,{...e,...s,propertiesToReplace:o})),AC.setIn(e,"acName",s.target),await Sm(n,e),((e,t,n)=>{const{containerItemID:s}=t,a=JE(s),{data:r,caseViewMode:o}=n;if(a&&tm(s)){const n=ta(a),i={data:r,caseViewMode:o,context:n};AC.setIn(i.data,["context_data","caseViewMode"],o),e.push({type:yr,payload:{context:n}});const c=lI.getPropertiesToReplace(s);e.push(aS(vC,i,{propertiesToReplace:c})),t.shouldUpdateCaseActionsInParentContext=!0,t.__deferCaseActionsPayload=t}})(a,t,e)},HT=async(e,t,n,s,a,r,o,i,c,l={})=>{const{isCaseWideAction:u,isInCreateStage:d,containerItemID:p}=e,g=Ks(e.context),h=Qf(a,c),f=c?Zp(a):Kf(a),m=d&&!h&&!u,I=ey(g)[0],E=I?YE(I):g,y=Bf(p),A=JE(p),C=Object.freeze({target:e.target,containerItemID:p,context:A,containerName:y});m&&!VT(e.context)?await GT(i,e,t,a,r,c,l):jT(e.context,E)?await $T(E,t,g,e,r,n,s,a,o,c):!u&&!c||jT(e.context,E)?await WT(t,e,a,C,r):(MT(r,e),((e,t,n)=>{const{containerItemID:s,caseID:a}=t;if(s&&/^app\/preview_[0-9]*/g.test(s)){const{caseClassName:t}=n,r=Ks(s),o=JE(r);e.push(aS(wC,{containerItemID:r,context:o,container:xE.PREVIEW,containerName:xE.PREVIEW,caseId:a,viewName:$s.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(r,e,{caseClassName:f}))},qT=(e,t,n)=>{const{isModalAction:s,isCaseWideAction:a,caseID:r}=t,o=jT(t.context,n),i=e?.data?.caseInfo?.stages,c=e?.data?.caseInfo?.stageID;$h({caseID:r,isModalAction:s,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:a,stages:i,stageID:c})},zT=e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[Gs.ERROR_FIELD_IN_PAGE]=e[Gs.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[Gs.ERROR_FIELD_IN_PAGE].slice(1),s=e[Gs.ERROR_IN_PAGE_IDENTIFIER],a=s.startsWith(".")?s.slice(1):s;if(a){let r=t?`caseInfo.content.${t}`:"caseInfo.content";r=Gs.getProperty(r.replace(/\(/g,"[").replace(/\)/g,"]"));const o=Cu(a,r,Gs.PROPERTY),i={type:$s.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};yu.mutateField(n,r,o[o.length-1],{messages:[i],type:$s.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:s})}}))},YT=e=>{const t=aC("app")?.pyPortal?.pyPrimaryNavPages,n=Array.isArray(t)?t[0]:null;return n?(Hm.clearChangedProperties(e),[{type:ia,payload:{className:n.pyClassName,containerName:Gs.PRIMARY,context:Gs.APP.APP,pageReference:"pyPortal",viewName:n.pyRuleName,skipSemanticUrl:""}}]):[]},KT=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Gs.MODAL:t||Kp.getTargetViewContainerName(jr)},QT=e=>e?.uiResources?.root?.config?.name===ks.getDefaultQualifiedName("pzCreateDetails")||!1,JT=(e,t)=>{const n=QT(e),{skipBrowserSemanticUrlUpdate:s=!1}=t;AC.setIn(e,["directUrlUpdation"],!n&&!s)},XT=e=>e.confirmationNote?Gs.REVIEW_MODE:Gs.PERFORM_MODE,ZT=(e,t)=>{let n;return n=!e.renderInline&&!Gy.getDefaultCasePage()&&QT(t),n},eD=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Gs.MODAL:t||Kp.getTargetViewContainerName($r)},tD=(e,t)=>{const{class:n,context:s,viewType:a=Im.PAGE}=e,{removeActionPayload:r}=t,o=e?.pageName?e?.pageName:Gy.getDefaultCasePage();return eu(yp.createCase(n,{...e,pageName:o,viewType:a,context:s,retrieveActionViewForNewObject:!0})).pipe(yg((({response:t,headers:n})=>(Bs.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:r}))),wg("Error occurred during ajax call at createObject Epic : ",s))},nD="CREATE_EXTERNAL_CASE",sD=e=>{let t=0,n=[],s=!1;return e.pipe(bg(nD),Mg(100),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>{const{context:n}=e,a=eD(e),r=Wr(a,n);return s=!1,eu(TT(r,{loadingContext:n})).pipe(Ag((({continueExecution:n,removeActionPayload:a,dirtyCheckPerformed:r})=>n?(s=r,tD(e,{removeActionPayload:a})):(zp.rejectActionByID(t),vg))))})),Ag((async e=>{if(e&&e.type===ba)return e.payload.context=Ry(),n.push(Dm(e)),n;const{actionInPayload:a,response:r,headers:o,removeActionPayload:i}=e,c=ZT(a,r);AC.setIn(r.data,Gs.getProperty(Gs.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const l=eD({...a,isInCreateStage:c}),u=Wr(l,a.context),d=Om(u,l,a.context);if(!s&&!Gf(l)&&sy(u)){const{continueExecution:e}=await vm(u,{loadingContext:a.context});if(!e)return zp.rejectActionByID(t),n}const p=Cf(r);let g=CS(wr,{caseClassName:Kf(p)});g=g.replace(/{.+?}/,String(Yf(Jf(p)))),p.semanticURL=g,JT(p,a);const h={acName:u,context:d};await Sm(p,a,h);const f={target:u,context:d,headers:o,semanticURL:g,caseViewMode:XT(p),containerItemID:d,isInCreateStage:c,isMinimizable:c,assignmentContext:AC.getIn(p,_T),nextAssignmentInfo:AC.getIn(p,ST),resourceType:$s.RESOURCE_TYPES.CASE,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo,isExternalCaseCreationFlow:!0};nm(f,p);const m=Cm(p,f),I=Pm(u,m);return Rm(I)&&Zf(n,{removeActionPayload:i,target:u}),n.push(I),Fm(n),n})),yg((()=>(km(n),am(n,t),n=[],n))))},{RESOURCE_TYPES:aD}=$s,rD=(e,t={})=>{const{viewType:n,containerName:s,targetContainerName:a,isChild:r}=e,o=zf(t);return(e=>{if(e){const{stageID:t,stages:n=[]}=e,s=n.length;for(let e=0;e<s;e+=1)if(n[e].ID===t)return"manual"===n[e].transitionType}return!1})(o)&&e?.stageID===o.stageID?Im.PAGE:n||(!$f(s)&&!$f(a)||r?Im.PAGE:Im.FORM)},oD=(e,t,n,s,a)=>{if(Zf(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=YE(t);let s=null;return n&&(s=FE(t,n)),s?.key===e&&ay(t)})(s.key,n))s.context=XE(n),s.containerItemID=s.context,e.push(aS(eS,s));else if((a?.isChild||a?.isRemote)&&a?.isMultiDoc){const t=py(a.context);s.target=t,s.context=a.context,s.containerItemID=a.context,e.push(aS(eS,s))}else{const t=py(s.context),n=GE(t,s.key);n?(s.target=t,s.context=n,s.containerItemID=n,e.push(aS(eS,s))):e.push(aS(jC,s))}},iD=(e,t,n,s,a,r,o)=>{sy(t)&&ry(t)?((e,t,n,s,a)=>{rD(e,t)===Im.FORM?(n.caseViewMode=s||Gs.PERFORM_MODE,a.push(aS(HC,n))):a.push(aS(eS,n))})(s,a,e,r,n):oD(n,o,t,e,s)},cD=(e,t,n)=>{if(!(e&&t&&(e=>{const{inlineViewType:t,caseTypeID:n,RedirectURL:s}=e;if(t&&t.toLowerCase().includes("remote"))return!1;const a=qs.getRemoteCaseClassBySourceClass(n)??n;return!qs.isRemoteCase(a)&&!!s})(t)&&t.RedirectURL))return!1;try{const e=new URL(t.RedirectURL);if("https:"===e.protocol)return globalThis.open(e.href,"_blank","noopener,noreferrer"),zp.resolveActionByID(n),!0}catch{}return!1},lD=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:s,context:a,isGetNextWork:r,doNotMergeMessagesForStatusCode:o})=>{const i=lI.appendExcludeQueryParamToUrl(e);return ud(i,{method:t,headers:{"if-match":n&&n.etag,...n,...s&&{...Zu.addDebugHeaders(s)}}},a,{doNotMergeHttpMessagesForStatusCode:r?o:""})},uD=(e,t)=>{const n=rD(e),{headers:s,context:a,assignmentID:r,isGetNextWork:o,debugInfo:i,isOpenStage:c,stageID:l,caseID:u,jsActionQueryParams:d,isLastStepInCreateStage:p}=e;let g,h;({restApi:g,reqType:h}=o?_S("getNextWork",{viewType:n}):c?_S("openStage",{caseID:u,stageID:l}):_S(er,{assignmentID:r,viewType:n}));const{removeActionPayload:f}=t,m=Gy.getDefaultCasePage();let I="",E=e.pageName;e.isTraditionalUICase&&(E=ks.getDefaultQualifiedName("pyDetails")),I=m?`${g}?viewType=${n}&pageName=${m}`:E?`${g}?viewType=${n}&pageName=${E}`:`${g}?viewType=${n}`,d&&Object.keys(d).forEach((e=>{I+=`&${e}=${d[e]}`}));const y=(e=>{let t=e?.headers??{};return e?.isRemote&&(t=ym(t,e.remoteClassName)),t})(e);return eu(lD({restUrl:I,reqType:h,requestHeaders:y,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe(yg((e=>{if(Gy.isCoexistenceAppOfType(Gs.APP_TYPE.UIKIT)&&!p){return dI(e.data.data.caseInfo)?e:(I=E?I.replaceAll(E,ks.getDefaultQualifiedName("pyDetails")):I,Gy.setDefaultCasePage(ks.getDefaultQualifiedName("pyDetails")),{isReloadWithDifferentViewTypeRequired:!0,restUrl:I})}return e})),Ag((e=>e?.isReloadWithDifferentViewTypeRequired?lD({restUrl:I,reqType:h,requestHeaders:y,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):_g(e))),yg((t=>{const{key:a,flowName:o}=Nm(r);return Bs.analyseResponse(t),{response:{...t.data,key:a,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:ym({...s,...t.headers})}})),wg("Error occurred during ajax call at openAssignment Epic : ",a))},{RESOURCE_TYPES:dD}=$s,pD=e=>{const t="Browser"===Gy.getRuntime();let n=0,s=[];const a=[];let r=!1,o=!1;return e.pipe(bg(ig),yg((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),Ag((e=>{r=e.isGetNextWork;const{context:t}=e;let s;s=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?Im.FORM:rD(e),e.viewType=s;const a=kf(er,e),i=Wr(a,t),{activate:c,activateContainerActionPayload:l}=wm(dD.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return _g({type:$a,activateContainerActionPayload:l,actionInPayload:e});const u=YE(i);let d;return d=l?.isParallelAssignment?Promise.resolve({continueExecution:!0,removeActionPayload:{}}):u?vm(i,{loadingContext:t}):Promise.resolve({continueExecution:!0,removeActionPayload:{}}),eu(d).pipe(Ag((({continueExecution:t,removeActionPayload:s})=>t?(o=rm(e.className),e.isTraditionalUICase=o,Gy.isWSSPortal()&&(e.headers={...e.headers,[Gs.X_ORIGIN_CHANNEL]:"WSS"}),uD(e,{removeActionPayload:s})):(zp.rejectActionByID(n),vg))))})),Ag((async e=>{if(e?.type===ba){if(r){const{payload:t}=e,{err:n}=t,s=n.response.status;a.push({status:Number(s)})}return s.push(Dm(e)),s}const{type:t,actionInPayload:i,response:c,viewType:l,headers:u,removeActionPayload:d,activateContainerActionPayload:p}=e;if("openStage"===c?.redirectInfo?.jsAction){const e=c?.redirectInfo?.stageID,t=ig,n=c?.data?.caseInfo?.ID;i.isOpenStage=!0,i.stageID=e,i.jsActionQueryParams=c?.redirectInfo?.jsActionQueryParams;const a={type:t,payload:{...i,caseID:n,headers:u}};return s.push(a),s}if(cD(r,c?.data?.caseInfo,n))return s;const{context:g,caseViewMode:h,debugInfo:f}=i,m=c?.data?.caseInfo?.assignments?.find((e=>e.ID===i.assignmentID));i.caseViewMode=((e,t)=>e&&"false"===String(e.canPerform)?Gs.REVIEW_MODE:t??Gs.PERFORM_MODE)(m,h);const I=c?.data?.caseInfo?.caseTypeID;o=rm(I),i.isTraditionalUICase=o;let E=((e,t)=>{const n=zf(e);let s;s=!Gy.getDefaultCasePage()&&dI(n);const{isChild:a,containerName:r,isTraditionalUICase:o}=t,i=a&&s,c=s&&!t.isActionFromToDoList;return!i&&!c||o||t.renderInline?r||kf(er,t):Gs.MODAL})(c,i);o&&(E=i.containerName??E);const y=Wr(E,g);if(t===$a)return await(async(e,t,n)=>{const{semanticURL:s,containerItemID:a,isParallelAssignment:r,insKey:o}=t,{target:i,actionInPayload:c}=n,{skipBrowserSemanticUrlUpdate:l=!1}=c,u=JE(a);await Sm({directUrlUpdation:!l,semanticURL:s},c,{acName:i,target:i,context:u}),e.push(aS(KC,{containerItemID:a,target:i,isParallelAssignment:r,insKey:o,resourceType:aD.CASE,context:u,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(s,p,{actionInPayload:i,target:y}),s;const A=c?.data?.caseInfo?.content,C=c?.data?.caseInfo?.ID,S=c?.uiResources?.root?.config?.name,_=c?.uiResources?.root?.config?.context;A&&!A[ks.getDefaultQualifiedName("pyViewName")]&&S&&"page"!==i.viewType&&(AC.setIn(A,ks.getDefaultQualifiedName("pyViewName"),S),AC.setIn(A,ks.getDefaultQualifiedName("pyViewContext"),_));const N=Cf(c);((e,t)=>{const n=zf(e),s=Jf(e),a=dI(n),{skipBrowserSemanticUrlUpdate:r=!1,viewType:o,isTraditionalUICase:i}=t,c=i&&!om(),l=o===Im.PAGE&&(!a||c)&&!r,{caseTypeID:u}=n;if(l){const t=CS(Za,{caseClassName:u}).replace(/{.+?}/,String(Yf(s)));e.semanticURL=t,e.directUrlUpdation=!0}})(N,i);const T=Om(y,E,g),D={...i.debugInfo,debugId:i.debugInfo?.debugId??Zu.getCoreHeadersFromContext(g)?.debugInfo?.[Gs.COREHEADER_APP_DEBUG_ID]};D.debugId&&Hp.setComponentCache(C,Zu.addDebugHeaders(D));const P={acName:y,target:y,context:T};await Sm(N,i,P);const O={target:y,context:T,containerItemID:T,headers:u,parentContext:Ks(i?.context),isMinimizable:dI(AC.getIn(N,"data.caseInfo")),doDeleteCaseSummary:i.doDeleteCaseSummary,acTertiary:i.acTertiary,resourceType:$s.ASSIGNMENT,debugInfo:f,shouldUpdateCaseActionsInParentContext:!0,caseID:C};nm(O,N,{skipFlowNameUpdate:i?.caseViewMode===Gs.REVIEW_MODE});const R=Cm(N,O);return i.isProcessAction&&(R.data.isProcessAction=i.isProcessAction),((e,t)=>{e&&(t.data.caseInfo.content.coexistenceAction="openAssignment")})(o,R),lI.setTraditionalGadgetId(R.data),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(i,R),R.caseViewMode=i.caseViewMode,iD(R,y,s,i,c,h,d),((e,t)=>{if(e=qs.getRemoteCaseClassBySourceClass(e)??e,qs.isRemoteCase(e)){const{RemoteClassName:n,RemoteSystemID:s,name:a}=qs.getRemoteCase(e);if(t.headers?.RemoteSystemID||zp.setRemoteCaseHeaderByContext(t,s),qs.isTraditionalRemoteCase(e)||qs.getRemoteAppPlatformVersion(s)){t.assignmentID=t.assignments?.[0]?.ID;const s={className:e,name:a,action:Mr,remoteClassName:n};zp.setTraditionalRemoteCaseParams(t,s)}}})(I,R.data.caseInfo),l===Im.FORM&&tm(R.containerItemID)&&(R.skipMergeAssignmentsAndActions=!1,jm(R,s,_)),dm(N,O),(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,e)})({actionInContext:g,assignmentID:i.assignmentID,caseKey:R.key}),s})),yg((()=>{const e=n,t=om(),r=dI(AC.getIn(s[0]?.payload,"data.caseInfo"));return o&&t&&r?CT.postCreateCaseMessage(s[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,sC,s):sC(s),am(s,e,a),s[0]?.payload?.isParallelAssignment&&sC({type:ig,payload:{...s[0].payload,isParallelCall:!0}}),s=[],s})))};const gD=(e,t)=>{const{insKey:n,headers:s,context:a,debugInfo:r,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:Gy.getDefaultCasePage(),l=_S(Za,{caseID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),u=lI.appendExcludeQueryParamToUrl(u),eu(ud(u,{method:d,headers:{...s,...r&&{...Zu.addDebugHeaders(r)}}},a)).pipe(yg((t=>(Bs.analyseResponse(t),{response:t.data,actionInPayload:e,headers:ym({...s,...t.headers}),removeActionPayload:i}))),wg("Error occurred during ajax call at openWorkByHandle Epic : ",a))},hD="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:fD}=$s,mD=async(e,t,n)=>{const s=t?.containerItemID||null,a=s&&ey(s)[0]?YE(ey(s)[0]):s,r=a||s,o=JE(r)||r,i=py(o)||py(r),c=o?pm(o):void 0,l=a?aC(a)?.caseInfo?.ID:void 0,u=e?.insKey;if(!(o&&r&&c===Gs.REVIEW_MODE&&a!==s&&l&&u&&l===u))return;let d;try{d=await function(e,t){var n="object"==typeof t;return new Promise((function(s,a){var r=new Ol({next:function(e){s(e),r.unsubscribe()},error:a,complete:function(){n?s(t.defaultValue):a(new Qc)}});e.subscribe(r)}))}(gD({...e,context:o,viewType:"none"},{removeActionPayload:void 0}))}catch(e){return}if(!d||Hf(d.type))return;const p=Cf(d.response),g=[{path:Gs.CASE_INFO.ASSIGNMENTS,allowMultiple:!0}],h={...p?.data,caseInfo:{...p?.data?.caseInfo??{},assignments:p?.data?.caseInfo?.assignments??[]}};n.push(aS(eS,{containerItemID:r,target:i,context:o,data:h,isArrayDeepMerge:!0,propertiesToReplace:g}))},ID=async(e,t,n)=>{const{actionInPayload:s,activateContainerActionPayload:a,type:r,response:o,removeActionPayload:i,headers:c}=e,{context:l,skipBrowserSemanticUrlUpdate:u,debugInfo:d}=s,p=kf(Za,s),g=Wr(p,l);if(Wf(r))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:s},actionInPayload:a,actionInPayload:{context:r,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=kf(Za,a),l=Wr(c,r),u=JE(s);await Sm({directUrlUpdation:!o,semanticURL:n},a,{acName:l,containerName:c,target:l,context:u}),e.push(aS(KC,{containerItemID:s,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:a,actionInPayload:s}),await mD(s,a,t);else{const a=Om(g,p,l,{buildNew:!0}),r=Cf(o),h=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:s}=t,a=Jf(e),r=n?s:Kf(e);let o=CS(Za,{caseClassName:r},{id:t?.insKey});return o=o?.replace("{workID}",String(Yf(a)))?.replace("{id}",t?.insKey),o})(r,s);r.semanticURL=h,r.directUrlUpdation=!u;const f={acName:g,context:a};await Sm(r,s,f);const m=Cm(r,{target:g,context:a,containerItemID:a,semanticURL:h,headers:c,debugInfo:d});m.caseViewMode=Gs.REVIEW_MODE,m.resourceType=fD.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle",m.data.caseID=m.data.caseInfo.ID),lI.setTraditionalGadgetId(m.data),nm(m,r,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=pm(e?.actionInPayload?.context);const I=Pm(g,m);i.containerItemID&&Rm(I)&&t.push(aS(JC,{containerItemID:i.containerItemID,target:g})),t.push(I),dm(r,m)}const h=s.insKey;Wh({caseKey:h,actionInContext:l})},ED=e=>{let t=0,n=[],s=!1;return e.pipe(bg(hD),yg((e=>(({actionMgrID:t,isAutoRedirection:s=!1}=e.payload),e.payload))),Ag((e=>{const{context:n,isChild:a,viewType:r}=e,o=kf(Za,e),i=Wr(o,n);return eu("none"!==r?vm(i,{loadingContext:n}):Promise.resolve({continueExecution:!0,removeActionPayload:void 0})).pipe(Ag((({continueExecution:n,removeActionPayload:o})=>{if(!n)return zp.rejectActionByID(t),vg;let{activate:c,activateContainerActionPayload:l}=wm(fD.CASE,i,e);const u=sy(i);if(!c&&!u&&e.insKey&&i){const t=((e,t)=>{const n=GE(e,t);if(!n)return null;const s=FE(e,n);if(s?.resourceType!==fD.ASSIGNMENT||"string"!=typeof s?.context||""===s.context)return null;const a="string"==typeof s.semanticURL?s.semanticURL.trim():"";return a?{target:e,containerItemID:n,semanticURL:a,insKey:t}:null})(i,e.insKey);t&&(c=!0,l=t)}return c&&!a&&"none"!==r?(Gm(l),_g({type:$a,activateContainerActionPayload:l,actionInPayload:e})):(s&&Hp.setComponentCache("redirectionInProgress",!0),gD(e,{removeActionPayload:o}))})))})),Ag((async e=>{if(e&&Hf(e.type))return n.push(Dm(e)),n;const t=aC(e?.actionInPayload?.context),s=rm(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=Cf(e?.response),a={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:yr,payload:{context:a.context,doDeleteConfirmationDetails:!1}}),s&&a.data.caseInfo?.content&&(a.data.caseInfo.content.coexistenceAction="openWorkByHandle",a.data.caseID=a.data.caseInfo.ID),lI.setTraditionalGadgetId(a.data),n.push(aS(vC,a));const r=py(e?.actionInPayload?.context),o=Bf(e?.actionInPayload?.context),i=Object.freeze({target:r,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(tm(e?.actionInPayload?.context)){const t=Cm(e?.response,{...i});jm({...t,isArrayDeepMerge:!0},n)}e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,e.actionInPayload.containerItemID=e?.actionInPayload?.context,e.actionInPayload.caseID=e?.actionInPayload?.insKey,dm(t,e?.actionInPayload)}}else await ID(e,n,s);return n})),yg((()=>(s&&Hp.setComponentCache("redirectionInProgress",!1),sC(n),am(n,t),n=[],n))))},yD="FINISH_ASSIGNMENT",AD=(e,t)=>{const{assignmentID:n,actionID:s,caseID:a,context:r,additionalHeaders:o={},outcome:i,jsActionQueryParams:c,headers:l}=e,{state$:u}=t,d=(e=>{const{isModalAction:t,viewType:n,isInCreateStage:s,isCaseWideAction:a}=e;return t&&s&&!a?Im.PAGE:n||Im.FORM})(e),p=(e=>{const{isCaseWideAction:t,caseTypeID:n}=e;return lI.shouldUseUnifiedHandling()?t||lI.isObjectCaseType(n)?cr:nr:t?cr:nr})(e),g={assignmentID:n,actionID:s,caseID:a,viewType:d};let{restApi:h}=_S(p,g);const{reqType:f}=_S(p,g);d&&!h?.includes("viewType=")&&(h=h?.includes("?")?`${h}&viewType=${d}`:`${h}?viewType=${d}`),i&&!h?.includes("outcome")&&(h=h?.includes("?")?`${h}&outcome=${i}`:`${h}?outcome=${i}`),h=CI(c,h),h=lI.appendExcludeQueryParamToUrl(h),e.viewType=d;const{content:m}=Am(r),I=u.value.data[r]?.caseInfo?.headers||{},{etag:E}=I,y={"if-match":E,...l,...o};return eu(ud(h,{method:f,body:m,headers:y},r)).pipe(yg((t=>{const{data:n,headers:s}=t;return Bs.analyseResponse(n),{response:n,actionInPayload:e,headers:ym({...y,...s})}})),wg("Error occurred during ajax call at finishAssignment Epic : ",r))},CD=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)},SD=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,e)},{RESOURCE_TYPES:_D}=$s,ND=e=>{const t=nC()?.getState()?.data,n=t?Object.keys(t).find((e=>e.includes(Gs.WORKAREA))):void 0;return/^app\/primary(_\d+)?$/.test(e)&&!n},TD=(e,t)=>{let n=0,s=[],a={},r="",o={},i=!1,c=!1;return e.pipe(bg(yD),Ag((e=>{let l,u;const d=Gy.isCoexistenceAppOfType(Gs.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),r=e.payload.context,Du({context:r,stateObj:aC(r),clearContextMessages:!0}),!aI(r)||vu(r)){const t={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(n,!0,t),Yh.handleDeferredActionCompletion(e.payload.context).then((()=>{SD({errorType:$s.ERROR_TYPE.CLIENT})})),_g([])}return _g(e.payload).pipe(Ag((e=>{Hp.setComponentCache("lastActionID",e?.actionID),wT(s,e);const n={...e};return AD(n,{state$:t})})),Ag((async e=>{if(e&&e.type===ba){SI(e);const t=Dm(e);return s.push(t),s}Lh.clearContextedCache(r);const{headers:t,actionInPayload:p,response:g}=e,{containerItemID:h,context:f=JE(h),isModalAction:m,isInCreateStage:I}=p;i=p.isCaseWideAction,c=p.isProcessAction;const E=py(h);p.target=E;const y=Bf(h),A=Object.freeze({target:p.target,containerItemID:h,context:f,containerName:y});AC.setIn(g.data,Gs.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),AC.setIn(g.data,Gs.CASE_INFO_IS_LOCAL_ACTION,!1),g?.uiResources?.root?.config?.name&&"page"!==p.viewType&&AC.setIn(g.data,Gs.CASE_INFO.VIEW_NAME,g?.uiResources?.root?.config?.name),CD({submitResponse:g});let C=Cf(g,{[$s.STOPMERGEACTIONS]:!g.nextAssignmentInfo});const S=Kf(C),_=Ks(p.context),N=ey(_)[0]?YE(ey(_)[0]):_,T=Qf(C),D=I&&!T;!m||I||jT(p.context,N)||(C=Um(C,aC(h)));const P=Cm(C,{headers:t,actionMgrID:n,directUrlUpdation:!1,isActiveWorkAreaPrimaryAndWorkareaAbsent:ND(N||"")});sm(P.data,p),P.caseClassName=S,P.resourceType=_D.ASSIGNMENT,P.headers=t;const O=C?.uiResources?.root;if("AutoClose"===O?.type){const e=nC()?.getState()?.data?.[A.context]?.caseInfo,{ID:t,name:n,content:a}=e;return s=await(async e=>{const{target:t,containerItemID:n,context:s}=e,a=XE("app/primary"),r=FE(t,n)?.parentContext,o=Boolean(t)&&ay(t),i=ay("app/primary");if(o&&r!==Gs.APP.APP){if(await gy(n,{skipDirtyCheck:!0}),0===jE(t).length)return YT(s)}else{if(!a||!i||r)return YT(s);await gy(a,{skipDirtyCheck:!0,eventName:"Dismiss case"})}return[]})(p),(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.DISPLAY_CASE_SUBMITTED_TOASTER,e)})({ID:t,caseName:n,content:a,status:zf(C).status}),s}let R,b;const v=C?.data?.caseInfo?.assignments?.some((e=>e.ID===p.assignmentID)),x=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(C,p),w=((e,t,n,s,a)=>{let r;const o=py(t);r=ay(o)?GE(o,n.data?.caseInfo?.ID):YE(o);let i=!0;if(e&&r){const e=NC.getPropertyValue($s.CASE_INFO.ASSIGNMENTACTION_ID,"",r),t=NC.getPropertyValue($s.CASE_INFO.ASSIGNMENT_ID,"",r);if(e){const s=n?.data?.caseInfo?.assignments?.find((e=>e.ID===t)),a=s?.actions;a&&!a.some((t=>t?.ID===e))&&(i=!1)}}return s&&e&&i&&cC(null,Gs.CASE_VIEW_MODE_PROP,r)===Gs.PERFORM_MODE&&a})(v,N,C,m,x),M=p?.actionID===$s.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(C?.data?.nextAssignmentInfo&&!M)P.caseViewMode=Gs.PERFORM_MODE,R=Jf(C),b=!0;else if(w&&!M)C?.confirmationNote&&C?.uiResources?.root?.config?.name===Gs.PY_CONFIRM?P.caseViewMode=Gs.REVIEW_MODE:P.caseViewMode=Gs.PERFORM_MODE,R=Jf(C),P.flowName=" ",P.deleteAssignmentSpecificResources=!1,b=!1;else{P.caseViewMode=Gs.REVIEW_MODE;const e=sy(py(N)),t=(e=>{if(e){const{stageID:t,stages:n=[]}=e,s=n.length;for(let e=0;e<s;e+=1)if(n[e].ID===t)return"resolution"===n[e].transitionType}return!1})(C?.data?.caseInfo);R=!C?.confirmationNote||!t&&C?.uiResources?.root?.config?.name!==Gs.PY_CONFIRM||e?"":Jf(C),b=!1}const L=Jf(C);nm(P,C,{skipFlowNameUpdate:P?.caseViewMode===Gs.REVIEW_MODE||w});const U=CS("createWork",{caseClassName:S}).replace(/{.+?}/,String(Yf(L)));if(C.semanticURL=U,P.semanticURL=U,m?(await HT(p,P,b,R,C,s,e,g,!1,o),D&&(a=kT(p))):I&&d&&!T?(Gy.setDefaultCasePage(Gs.PY_DETAILS),await(async(e,t,n)=>{const s={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:xE.PRIMARY,targetContainerName:xE.PRIMARY,viewType:Im.PAGE,isLastStepInCreateStage:!0,context:n},a={type:Sa,payload:{...s}};t.push(a)})(g,s,Ks(f))):await WT(P,p,C,A,s),N?.includes(Gs.ACTIONAREA)&&f===N){DE(f);const e=aC(N);s=[{type:Na,payload:{actionID:e.caseInfo.activeActionID,context:N,containerItemID:h,target:py(N),actionMgrID:zp.getNextActionMgrId(),containerName:Gs.ACTIONAREA,localActionType:$s.LOCAL_ACTION_TYPE.CASE_WIDE,caseID:e.caseInfo.ID}}]}if(lm(e,s),Yh.handleDeferredActionCompletion(r).catch((()=>{})),qT(P,p,N),!C?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:s,actionID:a}=t;return{isCaseWideAction:n,caseID:Jf(e),assignmentID:n?null:s,actionID:a||null}})(C,p);Gh({...e,containerItemID:h})}return FT(s,{transientItemID:h,target:E,isModalAction:m}),l=C,u=p,s})),yg((()=>{const t=s.find((e=>e.type===ba));if(t?(Yh.handleDeferredActionCompletion(r).then((()=>{SD({errorType:$s.ERROR_TYPE.SERVER})})).catch((()=>{})),zT(t),zp.rejectActionByID(n)):zp.resolveActionByID(n,a),o?.caseId&&(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)})(o),km(s),um()&&l&&u&&dm(l,u.__deferCaseActionsPayload??u),!t&&(i||c)){const t=e.payload.caseID;Hh(t),(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0})}return s=[],a={},o={},s})))})))},DD="CANCEL_ASSIGNMENT",PD=e=>{const t={},{routeKey:n,isModalAction:s,caseID:a,context:r,RemoteSystemID:o}=e;o&&(t.RemoteSystemID=o);const i=n||"releaseAssignmentLock",{restApi:c,reqType:l}=_S(i,{ID:a,caseID:a,viewType:Im.PAGE}),u=Hp.getComponentCache(a),d=u&&"object"==typeof u?u:{},p=lI.appendExcludeQueryParamToUrl(c);return eu(ud(p,{method:l,headers:{...t,...d}},r,{includeRemoteSystemIdIfPresent:!!o})).pipe(yg((t=>(Hp.resetComponentCache(a),s?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:ym(t.headers)}))),wg(": Error occurred during ajax call at release lock request : ",r))},OD=(e,t)=>{const{isModalAction:n}=t;return PD({routeKey:"cancelAssignment",isModalAction:n,...e})},RD=e=>{let t=0,n=[];return e.pipe(bg(DD),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>{const{isModalAction:n}=e;e.context||(e.context=JE(e.containerItemID));const{context:s}=e,a=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?xE.MODAL:Bf(n)})(e),r=Wr(a,s);return eu(vm(r,{loadingContext:s})).pipe(Ag((({continueExecution:s})=>s?(e.RemoteSystemID=qs.getRemoteHeaderByContext(e.context)??void 0,eu(OD(e,{isModalAction:n}))):(zp.rejectActionByID(t),vg))))})),Ag((e=>{if(e&&e.type===ba)return n.push(Dm(e)),eu([n]);const{actionInPayload:s,response:a}=e,{containerItemID:r,isModalAction:o,isInCreateStage:i}=s;a?.data.caseInfo&&(a.data.caseInfo.availableProcesses=a.data.caseInfo.availableProcesses??[]);const c=py(r),l=JE(r),u={target:o?`${Gs.APP.APP}/${Gs.MODAL}`:c,containerItemID:r,caseViewMode:o?Gs.PERFORM_MODE:Gs.REVIEW_MODE,context:l,actionMgrID:t,key:Jf(a),skipReleaseLockRequest:!1};return i&&n.push(aS(HC,u)),!o&&tm(r)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:s,referencedUsers:a,response:r}=t,o=Ks(n),i=JE(o);let c=!1;const l=r?.data?.caseInfo;l&&(c=Object.prototype.hasOwnProperty.call(l,"assignments"),l.assignments??=[]);const u={context:i,data:{...r.data,referencedUsers:a,context_data:{caseViewMode:s}}},d=[];c&&d.push({path:Gs.CASE_INFO.ASSIGNMENTS,allowMultiple:!0}),d.length>0?e.push(aS(vC,u,{propertiesToReplace:d})):e.push(aS(vC,u))})(n,{childContainerItemID:r,caseViewMode:Gs.REVIEW_MODE,referencedUsers:a?.data.referencedUsers,response:a}),u.skipReleaseLockRequest=!0,e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,dm(e?.response,e?.actionInPayload),n.push(aS(JC,u)),eu([n])})),yg((()=>(sC(n),am(n,t),n=[],n))))},bD="NAVIGATE_TO_STEP",vD=(e,t)=>{const{ID:n,stepID:s,containerItemID:a,context:r=JE(a),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:s,viewType:o?Im.PAGE:Im.FORM},{restApi:l,reqType:u}=_S("navigateToStep",c),{content:d}=Am(r),p=i.value.data[r].caseInfo.headers,g=lI.appendExcludeQueryParamToUrl(l);return eu(ud(`${g}`,{method:u,body:d,headers:{"if-match":p&&p.etag}},r)).pipe(yg((t=>({response:t.data,actionInPayload:e,headers:ym({...p,...t.headers})}))),wg("Error occurred during ajax call at navigateToStep Epic : ",r))},{RESOURCE_TYPES:xD}=$s,wD=(e,t)=>{let n=0,s=[];return e.pipe(bg(bD),Eg((e=>{let a,r;return({actionMgrID:n}=e.payload),_g(e.payload).pipe(Ag((e=>(bu(e.context),vD(e,{state$:t})))),Ag((async e=>{if(e&&Hf(e.type))return s.push(Dm(e)),s;const{actionInPayload:t,response:n,headers:o}=e,{containerItemID:i,context:c=JE(i),isModalAction:l}=t;Lh.clearContextedCache(t.context);const u=py(i),d=Bf(i),p=Object.freeze({target:u,containerItemID:i,context:c,containerName:d}),g=n?.data?.caseInfo?.content,h=n?.uiResources?.root?.config?.name,f=n?.uiResources?.root?.config?.context;g&&!g[ks.getDefaultQualifiedName("pyViewName")]&&h&&"page"!==t.viewType&&(AC.setIn(g,ks.getDefaultQualifiedName("pyViewName"),h),AC.setIn(g,ks.getDefaultQualifiedName("pyViewContext"),f)),a=Cf(n);const m={acName:u,...p};await Sm(a,t,m),r=Cm(a,{...p,headers:o}),n?.nextAssignmentInfo||(r.caseViewMode=Gs.REVIEW_MODE),lm(e,s),r.doDeleteCaseSummary=t.doDeleteCaseSummary,r.resourceType=xD.ASSIGNMENT,r.caseID=Jf(a),nm(r,a),sm(r.data,t);const I=a.data?.caseInfo?.stages,E=a.data?.caseInfo?.stageID;if($h({caseID:Jf(a),isModalAction:l,stages:I,stageID:E}),tm(i)){const e=lI.getPropertiesToReplace(i);jm(r,s,"",{propertiesToReplace:e})}return s.push(aS(HC,r)),r.shouldUpdateCaseActionsInParentContext=!0,s})),yg((()=>(sC(s),a&&r&&dm(a,r),am(s,n),s=[],s))))})))},MD=e=>{const{caseID:t,context:n}=e,{restApi:s,reqType:a}=_S(ar,{ID:t});return eu(ud(s,{method:a},n)).pipe(yg((t=>(Bs.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:ym(t.headers)}))),wg(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},LD=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},UD=(e,t)=>{let n,s=0,a=[];return e.pipe(bg(cg),yg((e=>(({actionMgrID:s,caseType:n}=e.payload),e.payload))),Ag((e=>e.ignoreCaseDeletion?_g({actionInPayload:e}):MD(e))),Ag((async e=>{if(e&&Hf(e.type)){const{payload:t}=e,n=Dm({...e,...t,actionMgrID:s});return a.push(n),a}const{actionInPayload:n}=e,{context:r,isModalAction:o}=n,i=o?xE.MODAL:xE.PRIMARY,c=Wr(i,r);if(!o&&c){const e={acName:c,target:c,context:r},s=t.value.containers[c],{semanticURL:a}=(e=>{const{accessedOrder:t,items:n}=e;if(t&&t.length>1){const e=n[t[t.length-2]],{semanticURL:s}=e;if(s)return e}return{semanticURL:""}})(s);await Sm({directUrlUpdation:!0,semanticURL:a},n,e)}if(n.isProcessAction&&n.parentCaseInfo){const e={insKey:n.parentCaseInfo.ID,className:n.parentCaseInfo.content.classID,context:n.parentContext,acTargetName:Gs.PRIMARY,isChild:!0},t={type:Ia,payload:{...e}};a.push(t)}const l={target:c,containerItemID:r,context:r,caseDeleted:!0};return a.push(aS(JC,l)),a})),yg((()=>(sC(a),am(a,s)===Gs.PROMISE_VALUE.RESOLVE&&LD({caseType:n}),a=[],a))))};function FD(e,t){return cl(t)?Ag(e,t,1):Ag(e,1)}const VD=(e,t)=>{const{assignmentID:n,actionID:s,context:a}=e,{restApi:r,reqType:o}=_S("save",{assignmentID:n,actionID:s}),{content:i}=Am(a),c=t.value.data[a]?.caseInfo?.headers,l=lI.appendExcludeQueryParamToUrl(r);return eu(ud(l,{method:o,body:i,headers:{"if-match":c&&c.etag}},a)).pipe(yg((t=>({response:t.data,actionInPayload:e,headers:ym(t.headers)}))),wg(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",a))},jD=(e,t=!1)=>{const{action:n,state$:s,actionMgrID:a}=e,r=!0===n.payload.autosave;let o=[];return _g(n.payload).pipe(Ag((e=>VD(e,s))),FD((e=>{if(e&&Hf(e.type))return _g(e);const{containerItemID:t}=e&&e.actionInPayload,s=Ks(t),a=py(s),i=LE(a),c=ey(s)[0];let l=c?YE(c):s;!sy(py(l))&&({containerItemID:l}=UE(l,e.actionInPayload.caseID,c));const u=YE(a);n.payload.canUpdateAvailableActions&&Af(e.response);const d=qs.getRemoteHeaderByContext(e.actionInPayload.context),p={...e.actionInPayload,RemoteSystemID:null===d?void 0:d};if(l&&o.push((t=>aS(vC,{context:t,data:{caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}}))(l)),i?.items?.[u]?.key===e?.actionInPayload?.caseID){const n={context:s,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},a=lI.getPropertiesToReplace(t);o.push(aS(vC,n,{propertiesToReplace:a}))}return r||o.push(aS(HC,{context:t})),lm(e,o),PD(p)})),Ag((async n=>{if(n&&Hf(n.type)){const{payload:t}=n,s=Dm({...n,...t,actionMgrID:a});o.push(s);const r=e.action.payload.modalLoadingContainer;if(r){const e=r.context,{context_data:t}=aC(e)||{};t?.isLoading&&gy(e)}return o}const{actionInPayload:s,response:i}=n,{context:c,containerName:l}=s,u={target:Wr(l,c),containerItemID:c,context:c};return s.shouldUpdateCaseActionsInParentContext=!0,dm(i,s),t||r||o.push(aS(JC,u)),o})),yg((()=>(sC(o),am(o,a),r||(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.SAVE_ASSIGNMENT_COMPLETE,e)})({context:n.payload.context,assignmentID:n.payload.assignmentID}),t||(o=[]),Yh.isDeferredActionInProgress(n.payload.context)&&Yh.handleDeferredActionCompletion(n.payload.context),o))))},kD=(e,t)=>{let n,s=0;return e.pipe(bg(lg),Eg((e=>{const{saveOnly:a}=e.payload;({actionMgrID:s,caseType:n}=e.payload);return jD({action:e,state$:t,actionMgrID:s,caseType:n},a)})))},BD=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",Uu.unsubscribe(Gs.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,s="expressLocalActionSubmit",Uu.subscribe(Gs.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,s)}var n,s},{LOCAL_ACTION_TYPE:$D}=Gs,{RESOURCE_TYPES:GD}=$s,WD=(e,t)=>{const{actionID:n,assignmentID:s,caseID:a,context:r,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,u=l?or:(e=>{const t=e.localActionType?.toLowerCase();return t===$D.CASE_WIDE||t===$D.EXPRESS||t&&e.isPromotedAction?ir:rr})(e),d=Im.FORM,{reqType:p}=_S(u,{caseID:a,ID:s,actionID:n,viewType:d});let{restApi:g}=_S(u,{caseID:a,ID:s,actionID:n,viewType:d});e.actionType=u===ir?Gs.CASE:Gs.ASSIGNMENT,g&&!g.includes("viewType=")&&(g=g.includes("?")?`${g}&viewType=${d}`:`${g}?viewType=${d}`),g=lI.appendExcludeQueryParamToUrl(g);const h=i?.context??r;return eu(ud(g,{method:p,headers:c},h)).pipe(yg((t=>({response:t.data,actionInPayload:e,headers:ym(t.headers,"",e.headers)}))),wg(`: Error occurred during ajax call at ${o} Epic : `,h))},HD=(e,t)=>{const{isProcessAction:n}=t,s=n?or:rr;e.openActionType=s;let a;if("modal"===kf(s,e)){if(!Fu.isOnline()||e.isAppOffline)return zp.rejectActionByID(e.actionMgrID),Promise.resolve();a=ey(e.contextName)[0]?ey(e.contextName)[0]:py(e.contextName);const n=a?YE(a):e.contextName,s=JE(n),r=kf(e.openActionType,e),o=Wr(r,e.context),i=ea(e.context,Qs(r,e.context));if(sC(jC({target:o,context:i,containerItemID:i,key:e.caseID,caseViewMode:Gs.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:Gs.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}},headers:{...e.headers}})),sC(qC({context:i})),e.modalLoadingContainer={target:o,context:i},!ey(e.contextName)[0])return WD(e,t);if(!e.continueExecution)return WD(e,t);if(!NE(s))return WD(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return eu([ug(e.saveActionPayload)]).pipe(Ag((e=>(e=>{let t,n=0;const s=[],a={value:nC()?.getState()};return _g(e).pipe(bg(lg),Eg((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!r){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(n,!0,e),_g([])}return jD({action:e,state$:a,actionMgrID:n,caseType:t,actionsOut:s},!0)})))})(e))),Ag((n=>1===n.length&&Hf(n[0].type)?eu(vm(a,{loadingContext:e.context})).pipe(Ag((({continueExecution:n})=>n?WD(e,t):(zp.rejectActionByID(e.actionMgrID),vg)))):WD(e,t))),yg((e=>e)))}return WD(e,t)},qD=async(e,t,{headers:n,actionInPayload:s})=>{const{context:a,actionName:r,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c,skipMergeAssignmentsAndActions:l}=s,u=Cf(e),d=kf(o,s),p=c?.target??Wr(d,a);let g,h,f=!1;!ry(p)||ay(p)&&!BE(p,e.data.caseInfo.ID)?(h=Qs(d,a),Gf(d)&&(h=ea(a,h)),g=h,f=!0):(g=ay(p)?GE(p,e.data.caseInfo.ID):YE(p),h=JE(g));const m={acName:p,target:p,containerName:d,context:h};await Sm(u,s,m),(void 0===u?.data?.caseInfo?.content||void 0!==u.data.caseInfo.content&&"object"==typeof u.data.caseInfo.content&&0===Object.keys(u.data.caseInfo.content).length)&&delete u.data?.caseMessages;const I=u.uiResources?.root;let E;E=I?Gs.PERFORM_MODE:Gs.REVIEW_MODE;const y=Cm(u,{target:p,context:h,containerItemID:g,caseViewMode:E,doDeleteCaseSummary:i,headers:n,actionName:r,isMinimizable:!1,isInCreateStage:Gf(d),resourceType:GD.ASSIGNMENT,isProcessAction:s.isProcessAction,showProgress:s.showProgress,progressMessage:s.progressMessage,assignmentID:s.assignmentID,actionType:s.actionType,skipMergeAssignmentsAndActions:l});let A;if(I&&nm(y,u),Gf(d)&&delete y.doDeleteCaseSummary,s.openActionType===lr&&(y.isBulkAction=!0,y.data.caseInfo.actionButtons.main[0].jsAction="async"===s.runningMode?"submitBulkActionAsync":"submitBulkAction",y.data.caseInfo.actionButtons.secondary[0].jsAction="cancelBulkAction",y.data.caseInfo.cases=s.selectedList,y.data.caseInfo.isAssignment=s.isAssignment),A=f?jC:s.isProcessAction||(e=>e.containerItemID?.includes(Gs.ACTIONAREA)&&e.context?.includes(Gs.ACTIONAREA))(s)?eS:HC,y.data.context_data.isProcessAction=s.isProcessAction,t.push(aS(A,y)),f||t.push(aS(zC,y)),f){const a=ey(s.contextName),r=GE(a,e.data.caseInfo.ID);if(r){const e={data:{caseInfo:{headers:n}},context:r};t.push(aS(vC,e))}}g!==YE(p)&&t.push(aS(KC,{target:p,containerItemID:g})),tm(g)&&!c?.context&&jm(y,t),s.isProcessAction&&!rm(y.nextAssignmentInfo?.className)&&lm({response:u,actionInPayload:{...s,containerItemID:g}},t),y.caseViewMode===Gs.REVIEW_MODE&&t.push(aS(JC,y)),y.shouldUpdateCaseActionsInParentContext=!0;return AC.getIn(e.data,["caseInfo","isLocalAction"])||dm(u,y),t},zD="OPEN_LOCAL_ACTION",YD=(e,t)=>HD(e,t),KD=e=>{let t=0,n=[];return e.pipe(bg(zD),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Og((()=>!gm(t))),Ag((e=>YD(e,{actionMgrID:t}))),Ag((async e=>{if(!e)return vg;if(Hf(e.type)){const t=Dm(e);n.push(t);const{context_data:s}=aC(e.payload.context)||{};return s?.isLoading&&n.push(aS(zC,e.payload)),n}const{actionInPayload:t,headers:s,response:a}=e,{actionID:r}=t;AC.setIn(a,"data.caseInfo.activeActionID",r);return(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,e)})(AC.getIn(a,"data.caseInfo.ID")),AC.setIn(a.data,Gs.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&AC.setIn(a.data,Gs.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await qD(a,n,{headers:s,actionInPayload:t}),BD(t),n})),yg((()=>(sC(n),am(n,t),n=[],n))))},QD=e=>{const{actionID:t,context:n,openActionType:s,caseTypeID:a,bulkContextID:r="",bulkContextType:o=""}=e,i=lr,{reqType:c,restApi:l}=_S(i,{caseTypeID:a,actionID:t,bulkContextID:r,bulkContextType:o});return eu(ud(l,{method:c},n)).pipe(yg((t=>({response:t.data,actionInPayload:e,headers:ym(t.headers)}))),wg(`: Error occurred during ajax call at ${s} Epic : `,n))},JD=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",Uu.unsubscribe(Gs.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,s="bulkActionSubmit",Uu.subscribe(Gs.PUB_SUB_EVENTS.EVENT_BULKACTION,n,s)}var n,s},XD="OPEN_BULK_ACTION",ZD=e=>{let t=0,n=[];return e.pipe(bg(XD),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>((e,t)=>{const{context:n}=e,{actionMgrID:s}=t;e.openActionType=lr;const a=kf(lr,e),r=Wr(a,n);return eu(vm(r,{loadingContext:n})).pipe(Ag((({continueExecution:t})=>t?QD(e):(zp.rejectActionByID(s),vg))))})(e,{actionMgrID:t}))),Ag((async e=>{if(e&&Hf(e.type??"")){const t=Dm(e);return n.push(t),n}const{actionInPayload:t,headers:s,response:a}=e,{actionID:r}=t;return AC.setIn(a,"data.caseInfo.activeActionID",r),await qD(a,n,{headers:s,actionInPayload:t}),JD(t),n})),yg((()=>(1===n.length&&Hf(n[0].type)?zp.rejectActionByID(t):zp.resolveActionByID(t),sC(n),n=[],n))))};var eP=Array.isArray,tP=Object.getPrototypeOf,nP=Object.prototype,sP=Object.keys;function aP(e){if(1===e.length){var t=e[0];if(eP(t))return{args:t,keys:null};if((s=t)&&"object"==typeof s&&tP(s)===nP){var n=sP(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var s;return{args:e,keys:null}}var rP=Array.isArray;function oP(e){return yg((function(t){return function(e,t){return rP(t)?e.apply(void 0,sl([],nl(t))):e(t)}(e,t)}))}function iP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return cl(Sg(e))?e.pop():void 0}(e),s=aP(e),a=s.args,r=s.keys,o=new Ll((function(e){var t=a.length;if(t)for(var n=new Array(t),s=t,o=t,i=function(t){var i=!1;Wl(a[t]).subscribe(Yl(e,(function(e){i||(i=!0,o--),n[t]=e}),(function(){return s--}),void 0,(function(){s&&i||(o||e.next(r?function(e,t){return e.reduce((function(e,n,s){return e[n]=t[s],e}),{})}(r,n):n),e.complete())})))},c=0;c<t;c++)i(c);else e.complete()}));return n?o.pipe(oP(n)):o}const cP=e=>{const{actionID:t,context:n,cases:s,classID:a,isAssignment:r}=e,{content:o}=Am(n,{nonEmptyAndChangedData:!0});let i=5;try{const e=of.getSharedState(ks.getQualifiedNameForComplexRuleReferences("D_pySingleExecutionBulkActionsMeta.D_pySingleExecutionBulkActionsMeta.pxResults"));e?.find((e=>e[ks.getDefaultQualifiedName("pyClassName")]===a))?.pyList.split(",").includes(t)&&(i=1)}catch(e){console.error('Failed to fetch to "D_pySingleExecutionBulkActionsMeta" DP response',e)}const c=s.map((e=>({ID:e}))),l=c.length/i,u=r?"performAssignmentBulkAction":ur,{reqType:d,restApi:p}=_S(u,{actionID:t}),g=[],h=c.length;for(let t=0;t<h;t+=l){const s=c.slice(t,t+l);r?o.assignments=s:o.cases=s,s.length&&g.push(eu(ud(p,{method:d,body:o},n)).pipe(yg((t=>{const{data:n,headers:s}=t;return{response:n,actionInPayload:e,headers:ym({...s})}})),wg("Error occurred during ajax call at submitbulkaction Epic : ",n)))}return iP(g)},lP=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},uP="SUBMIT_BULK_ACTION",dP=e=>{let t,n=0,s=[],a="";return e.pipe(bg(uP),Eg((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:n}=e.payload),!r){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(n,!0,e),_g([])}return _g(e.payload).pipe(Ag((e=>(t=e,cP(t)))),Ag((e=>{let n=0,r=0;const o=[],{containerItemID:i,context:c}=t;return e.forEach((e=>{const{response:t}=e;n+=Number(t.successCount),r+=Number(t.failureCount),r&&t.results.forEach((e=>{"200"!==e.status&&e.error&&e.error.errorDetails&&e.error.errorDetails.forEach((t=>{o.push({ID:e.BusinessID,message:t.localizedValue})}))}))})),a=`${n} record(s) updated`,lP({submitResponse:e}),t.target="HYBRID"===Gy.getRenderingMode()?py(i):`${Gs.APP.APP}/${xE.MODAL}`,s.push(aS(JC,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),r&&s.push(aS(QC,{messages:[{type:"error",message:1===r?"1 record failed to update":`${r} records failed to update`,errorDetails:o,showHeader:!1}],context:Ks(c)||c,category:"HTTP",showHeader:!1})),s})),yg((()=>(zp.resolveActionByID(n,a),sC(s),s=[],s))))})))},pP=e=>{const{actionID:t,context:n,cases:s}=e,{content:a}=Am(n,{nonEmptyAndChangedData:!0});a.cases=s.map((e=>({ID:e})));const r=ur,{reqType:o,restApi:i}=_S(r,{actionID:t,runningMode:"async"});return eu(ud(i,{method:o,body:a},n)).pipe(yg((t=>{const{data:n,headers:s}=t;return{response:n,actionInPayload:e,headers:ym({...s})}})),wg("Error occurred during ajax call at submitbulkactionasync Epic : ",n))},gP=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},hP="SUBMIT_BULK_ACTION_ASYNC",fP=e=>{let t,n=0,s=[],a={};return e.pipe(bg(hP),Eg((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:n}=e.payload),!r){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(n,!0,e),_g([])}return _g(e.payload).pipe(Eg((e=>(t=e,pP(t)))),yg((e=>{const{containerItemID:n,context:r}=t,{response:o}=e;return a={caseID:o.caseID,caseTypeID:"BackgroundJob"},gP({submitResponse:o}),t.target=`${Gs.APP.APP}/${xE.MODAL}`,s.push(aS(JC,{containerItemID:n,context:r,target:t.target,skipReleaseLockRequest:!0})),s})),yg((()=>(zp.resolveActionByID(n,a),sC(s),s=[],s))))})))},mP=(e,t)=>HD(e,t),IP=e=>{let t=0,n=[];return e.pipe(bg(og),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>{const n=kf(or,e),s=Wr(n,e.context);return eu(vm(s,{loadingContext:e.context})).pipe(Ag((({continueExecution:n})=>n?(bu(e.context),mP(e,{actionMgrID:t,isProcessAction:!0})):(zp.rejectActionByID(e.actionMgrID),vg))))})),Ag((async e=>{if(e&&Hf(e.type)){const t=Dm(e);return n.push(t),n}const{actionInPayload:t,headers:s,response:a}=e;return await qD(a,n,{headers:s,actionInPayload:t}),n})),yg((()=>(km(n),am(n,t),n=[],n))))},EP=e=>{let t=0,n=[];return e.pipe(bg(Ma,Ha),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>{const{containerItemID:t,caseID:n,context:s,caseDeleted:a,skipReleaseLockRequest:r,currentCaseViewMode:o,isProcessAction:i,isInCreateStage:c,deleteWork:l}=e,u=o===Gs.PERFORM_MODE,d=n&&u;return l?_g([]):i&&c?PD(e):t!==s||a||r||!d?t?.includes(Gs.MODAL)&&pm(Ly(t))===Gs.REVIEW_MODE?PD(e):_g([]):PD(e)})),Ag((e=>(e&&Hf(e.type)&&n.push(Dm(e)),n))),yg((()=>(sC(n),am(n,t),n=[],n))))};var yP=function(e){function t(t,n){return e.call(this)||this}return Xc(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(pl),AP={setInterval:function(e,t){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];var a=AP.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,sl([e,t],nl(n))):setInterval.apply(void 0,sl([e,t],nl(n)))},clearInterval:function(e){var t=AP.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},CP=function(e){function t(t,n){var s=e.call(this,t,n)||this;return s.scheduler=t,s.work=n,s.pending=!1,s}return Xc(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var s=this.id,a=this.scheduler;return null!=s&&(this.id=this.recycleAsyncId(a,s,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(a,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),AP.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&AP.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,s=!1;try{this.work(e)}catch(e){s=!0,n=e||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,s=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,dl(s,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(yP),SP={now:function(){return(SP.delegate||Date).now()},delegate:void 0},_P=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=SP.now,e}(),NP=new(function(e){function t(t,n){void 0===n&&(n=_P.now);var s=e.call(this,t,n)||this;return s.actions=[],s._active=!1,s}return Xc(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(_P))(CP),TP=NP;function DP(e,t,n){void 0===e&&(e=0),void 0===n&&(n=TP);var s=-1;return null!=t&&(Cg(t)?n=t:s=t),new Ll((function(t){var a,r=(a=e)instanceof Date&&!isNaN(a)?+e-n.now():e;r<0&&(r=0);var o=0;return n.schedule((function(){t.closed||(t.next(o++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}function PP(e,t){return void 0===e&&(e=0),void 0===t&&(t=NP),e<0&&(e=0),DP(e,e,t)}function OP(e){return zl((function(t,n){var s=!1,a=null,r=null,o=function(){if(null==r||r.unsubscribe(),r=null,s){s=!1;var e=a;a=null,n.next(e)}};t.subscribe(Yl(n,(function(t){null==r||r.unsubscribe(),s=!0,a=t,r=Yl(n,o,yl),Wl(e(t)).subscribe(r)}),(function(){o(),n.complete()}),void 0,(function(){a=r=null})))}))}const RP=(e,t,n,s,a)=>{if(a!==Gs.RESOURCE_STATUS.CREATE)return;qm.isStateMachineExist(e,t,n)||qm.setStateMachine(e,n,t,new Rd(n,t,e));qm.getStateMachine(e,t,n).insert({},"string"==typeof s?s:s+1,!0,{isDefault:!0})},bP=(e,t,n,s,a)=>{"string"==typeof t&&e.data?.caseInfo?.content&&n&&("CREATE"===s||"UPDATE"===s)&&(e.data.caseInfo.content[a][t][n]=t)},vP=e=>{const t=!e.isLocalAction&&e.editType===Gs.ACTION;return{...t?{}:{activeActionID:e.actionID},assignments:[{ID:e.assignmentID,...t?{actions:[{ID:e.actionID}]}:{}}]}},xP=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),wP=e=>{const t={};return Object.keys(e).forEach((n=>{const s=e[n];if(n===Gs.CLASSID)t[n]=s;else if(Array.isArray(s)){const e=s.filter(xP).map(wP);e.length>0&&(t[n]=e)}else if(xP(s)){const e=wP(s);Object.keys(e).length>0&&(t[n]=e)}})),t},MP=e=>{let t=0,n=[],s="";return e.pipe(bg(Or),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>lT(e))),Ag((async e=>{if(e&&e.type===ba)return n.push(Dm(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:a,headers:r}=e,o=t.containerName,i=Wr(o,t.context);let c=Om(i,o,t.context);c=ea(t.context,c);const{pageReference:l,targetProperty:u,index:d,subscriptFieldName:p,pageGroupName:g,actionType:h,isPageGroup:f}=t,m=l?.startsWith($s.OBJECT_INFO.OBJECT_INFO);let I=null;m?(I=Bs.transformCaseData(a),I.uiResources.root.config.context=`${l}${u}[${d}]`):I=a;const E=Cf(I);E.key=t.ID,E.data?.caseInfo?(E.data.caseInfo.ID=t.ID,bP(E,d,p,h,g)):E.data?.objectInfo&&(E.data.objectInfo.ID=t.ID);const{interestPageActionID:y,editType:A,isLocalAction:C,actionID:S}=t,_={isMultiRecordData:!0,viewName:t.viewID,parentContext:t.context,interestPage:t.interestPage,interestPageActionID:y,editType:A,isLocalAction:C,actionID:S};E.uiResources.context_data.modalView=_;const N=aC(t.context)?.context_data?.caseInfo,T=`${t.pageReference}${t.targetProperty}`,D=Su(N,T,t.index);E.uiResources.context_data.caseInfo={...E.uiResources.context_data.caseInfo,content:AC.mergeDeep(E.uiResources.context_data.caseInfo?.content,D?.content)};const P=NC.getProperty(Gs.CASE_INFO.REMOTESYSTEMID,"",t.context),O={acName:i,context:c};await Sm(E,t,O);const R={target:i,context:c,containerItemID:c,headers:r,index:d,subscriptFieldName:p,pageGroupName:g,isPageGroup:f};P&&(R.headers={...R.headers,RemoteSystemID:P});const b=AC.deepClone(E.data?.caseInfo?.content);if(E.data?.caseInfo&&A===Gs.ACTION){Kn(E.data,`${l}${u}`,new Array(d+1).fill({}));const e=AC.deepClone(iC(`${u}[${d}]`,l,t.context)??{});((e,t,n,s,a)=>{const r=t===$s.CASE_INFO.CASE_INFO_CONTENT?`${n.replace(".","")}[${s}]`:`${(t.split($s.CASE_INFO.CASE_INFO_CONTENT)[1]??"").replace(".","")}${n}[${s}]`,o=AC.getIn(a,r);xP(o)&&AC.mergeDeep(wP(o),e)})(e,l,u,d,b),Kn(E.data,`${l}${u}[${d}]`,e)}const v=Cm(E,R);E.data?.caseInfo&&(E.data.caseInfo.content=b);const x=Cm(E,R);v.resourceStatus=t.actionType,v.isMultiRecordData=!0,v.readOnly=t.readOnly,v.parentContext=t.context,v.heading=t.heading,v.data.caseInfo&&A===Gs.ACTION&&(v.data.caseInfo={...v.data.caseInfo,...vP(t),isLocalAction:t.isLocalAction}),v.clearStateMachine=!1,x.skipValidation=!0,x.isArrayDeepMerge=!0;const w=Pm(i,v);s=c,n.push(w);const M=aS(vC,x);return{actionsOut:n,actionInPayload:t,mergeAction:M}})),yg((({actionInPayload:e,mergeAction:a})=>{if(qf(n)?zp.rejectActionByID(t):zp.resolveActionByID(t),e.skipPageInstructions||RP(s,e.pageReference,e.targetProperty,e.index,e.actionType),sC(n),n=[],e.editType===Gs.ACTION){qm.registerForServerChanges(),sC(a),qm.unRegisterForServerChanges();const t=Gs.getProperty($s.CASE_INFO.CASE_INFO_CONTENT)+AC.convertClipboardPageToPageRefNotation(e.interestPage);e.columns.forEach((n=>{const a=Ro.trimAnnotation(n.config.value),r=iC(a,t,s),o=SA(a.startsWith(".")?a.split(".").pop():a,n.config.classID);yu.addFieldNode(s,t,e.viewID,a,r,{isDeclarativeTarget:!!o?.isDeclarativeTarget,context:s,propertyName:a,pageReference:t,value:n.config.value,isInsideList:/\[\d+\]/.test(t)||/\[\d+\]/.test(a)})}))}return n})))},LP=e=>{const{context:t}=e;let n={...Am(t).content,contextData:!1};const s=$m(t);AC.isEmpty(s)||(n=Bm(s,n));const a=((e,t=!1)=>e===Gs.ACTION?t?kh.REFRESH_CASE_DATA:kh.REFRESH_ASSIGNMENT_DATA:kh.REFRESH_CASE_VIEW)(e.editType,e.isLocalAction),{restApi:r,reqType:o}=_S(a,{ID:e.isLocalAction||e.editType!==Gs.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=r;return e.editType===Gs.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID),n.interestPage=e.interestPage,eu(ud(i,{method:o,body:n,headers:e.headers},t)).pipe(yg((t=>({actionInPayload:e,response:t.data,headers:ym(t.headers)}))),wg(": Error occurred during getEmbeddedDataView request : ",t))},UP=(e,t,n)=>"string"==typeof n?`${e}${t}.${n}`:`${e}${t}[${n}]`,FP=(e,t,n,s,a)=>{const r=e.data?.caseInfo?.content;if(r){const e=((e,t,n)=>{const s=(e,t)=>{if((e=>"object"==typeof e&&null!==e)(e))return e[t]},a=t.replace(/^\./,"").split(".");let r=e;for(const e of a)r=s(r,e);return"string"==typeof n?s(r,n)??null:Array.isArray(r)?r[n]??null:null})(r,s,a);e&&sC(dS({context:t,reference:n,value:e}))}const o=e.uiResources?.context_data;o&&sC(dS({context:t,reference:Gs.CONTEXT_DATA,value:o}))},VP=e=>{let t=0,n=[];return e.pipe(bg(Rr),yg((e=>{const{payload:n}=e;return({actionMgrID:t}=n),n})),Ag((e=>LP(e))),FD((async e=>{const t={rootView:null,data:null,uiResources:null,containerContext:null};if(e?.type===ba)return n.push(Dm(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0},responseData:t};const{actionInPayload:s,response:a,headers:r}=e,{pageReference:o,targetProperty:i,index:c,containerName:l}=s,u=o?.startsWith($s.OBJECT_INFO.OBJECT_INFO),{context:d,containerContext:p,target:g}=(e=>{const{containerName:t,context:n}=e;if(!t)return{context:n,containerContext:null,target:null};const s=Wr(t,n),a=Om(s,t,n)||t,r=ea(n,a);return{context:r,containerContext:r,target:s}})(s),h=((e,t,n,s,a)=>{if(a){const a=Bs.transformCaseData(e);return a.uiResources.root.config.context=UP(t,n,s),a}return e})(a,o,i,c,u),f=Cf(h);f.key=s.ID;const m=UP(o,i,c),I=l?{acName:g,context:d}:{context:d};if(await Sm(f,s,I),l&&g){const e=Cm(f,{target:g,context:d,containerItemID:d,headers:r,index:c});e.resourceStatus=s.actionType,e.isMultiRecordData=!0,e.readOnly=s.readOnly,e.parentContext=s.context,e.clearStateMachine=!1;const t=Pm(g,e);n.push(t)}else FP(f,d,m,i,c);const E=f.uiResources?.root||null;return E?.config&&(E.config.context=m),t.rootView=E,t.data=f.data,t.uiResources=f.uiResources,t.containerContext=p,{actionsOut:n,actionInPayload:s,responseData:t}})),yg((({actionsOut:e,responseData:s})=>{qf(e)?zp.rejectActionByID(t):zp.resolveActionByID(t,s);return n=[],e})))},jP=e=>{let t,n="",s=[];return e.pipe(bg(br),Eg((e=>{t=e.payload;const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const t={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(n,!0,t),Yh.handleDeferredActionCompletion(e.payload.context),_g([])}return _g(e.payload).pipe(Ag((e=>(t=e,lT(t)))),Ag((async e=>((e,t)=>{if(e&&"action"===t.editType&&e.type!==ba){const{context:n,pageReference:s}=t,a={context:n},{response:r}=e,o=s?.startsWith($s.OBJECT_INFO.OBJECT_INFO);let i=null;o?(i=Bs.transformCaseData(r),i.uiResources.root.config.context=s):i=r;const c=Cf(i);c.key=t.ID,c.data?.caseInfo?c.data.caseInfo.ID=t.ID:c.data?.objectInfo&&(c.data.objectInfo.ID=t.ID);const l=Cm(c,a);l.skipValidation=!0;const u=aS(vC,l);qm.registerForServerChangesSync(),sC(u),qm.unRegisterForServerChanges()}return e})(e,t))),Ag((async e=>{if(e&&e.type===ba){const t=Dm(e);return s.push(t),s}const{containerItemID:n,context:a,pageReference:r,interestPage:o}=t,i=o?.replace(/\(\d+\)$/,"");return((e,t,n,s,a)=>{Fd(e).forEach((e=>{const r=a&&"replace"===e.instruction.toLowerCase()?AC.convertClipboardPageToPageRefNotation(a):AC.convertClipboardPageToPageRefNotation(e.target);qm.isStateMachineExist(t,n,r)||qm.setStateMachine(t,r,n,new Rd(r,n,t));const o=qm.getStateMachine(t,n,r);switch(e.instruction.toLowerCase()){case"insert":o.insert(e.content,e.listIndex,s,{encryptedContent:e.encryptedContent});break;case"update":o.update(e.content,e.listIndex??e.groupIndex,s,{encryptedContent:e.encryptedContent});break;case"delete":e.listIndex?o.delete(e.listIndex,s):e.groupIndex?o.delete(e.groupIndex,s):o.deletePage();break;case"replace":o.replacePage(e.content,s,a?e.target:void 0,a?n:void 0,e.encryptedContent);break;case"move":o.move(e.listIndex,e.listMoveToIndex);break;case"add":o.insert(e.content,e.groupIndex,s,{encryptedContent:e.encryptedContent});break;case"delete all":o.deleteAll()}}))})(a,t.parentContext,r.startsWith($s.OBJECT_INFO.OBJECT_INFO_CONTENT)?Gs.getProperty($s.OBJECT_INFO.OBJECT_INFO_CONTENT):Gs.getProperty($s.CASE_INFO.CASE_INFO_CONTENT),!1,i),s.push(aS(JC,{containerItemID:n,context:a,target:t.target,skipReleaseLockRequest:!0})),s})),yg((()=>{if(qf(s))zp.rejectActionByID(n),Yh.handleDeferredActionCompletion(t.context);else{zp.resolveActionByID(n),Yh.handleDeferredActionCompletion(t.context);const{pageReference:s}=e.payload,a=NC.getPropertyValue(Gs.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,s,t.parentContext);a?((e,t)=>{const{pageReference:n,isMultiRecordData:s}=t,a=NC.getPropertyValue(Gs.getProperty($s.CASE_INFO.CASE_INFO_ID),n,e.parentContext),r=NC.getPropertyValue(Gs.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,e.parentContext),o=NC.getPropertyValue($s.CASE_INFO.ASSIGNMENT_ID,n,e.parentContext),i=NC.getPropertyValue(Gs.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,e.parentContext),{interestPage:c,interestPageActionID:l,actionID:u,isLocalAction:d}=i,p=e.pageReference.substring(0,e.pageReference?.lastIndexOf(".")).replace(Gs.getProperty(Gs.CASE_INFO.CASE_INFO_CONTENT),"");"action"===i.editType?PI(a,o,u,e.parentContext,c,l,d,s,i.editType):DI(a,r,e.parentContext,p,{})})(t,{isMultiRecordData:a,pageReference:s}):MI(t.parentContext,Gs.getProperty(Gs.CASE_INFO.CASE_INFO_CONTENT),{})}return sC(s),s=[],s})))})))},kP=e=>{const{caseID:t,headers:n,debugInfo:s,context:a}=e,r=_S("getDescendants",{caseID:t}),{restApi:o}=r,{reqType:i}=r;return eu(ud(o,{method:i,headers:{...n,...s&&{...Zu.addDebugHeaders(s)}}},a)).pipe(yg((t=>({actionInPayload:e,response:t.data,headers:ym({...n,...t.headers})}))),wg("Error ocurred during ajax call at getDescendants Epic : ",a))},BP=e=>{let t=0,n=[];return e.pipe(bg(jh),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>kP(e))),Ag((async e=>{if(e&&Hf(e.type))return n.push(Dm(e)),n;const{actionInPayload:t,response:s}=e,a={};AC.setIn(a,"caseInfo.childCases",s?.childCases??[]);const r={data:a,context:t?.context};return n.push(aS(vC,r)),n})),yg((()=>(sC(n),am(n,t),n=[],n))))},$P=e=>{let t,n="",s=[],a={};return e.pipe(bg(vr),Eg((e=>{t=e.payload;const{isFormValid:r}=e.payload;return({actionMgrID:n}=e.payload),r?_g(e.payload).pipe(Ag((e=>(t=e,_g({})))),Ag((async()=>{const{containerItemID:e}=t,r=aC(e),o=e,i=r?.dataInfo.content;delete i.classID;const c=Ks(o),l=ey(c).length,u=ey(c)[l-1]?YE(ey(c)[l-1]):c,d=py(e),p=FE(d,e)||{},g=p?.referenceList?.replaceAll(".",""),h=p?.subscriptName,f=aC(u),m={containerItemID:u,data:{...f,caseInfo:{content:{...i}}}};s.push(aS(HC,m)),((e,t,n)=>{NE(t)&&e.push(aS(JC,{containerItemID:n,skipReleaseLockRequest:!0}))})(s,o,e);const I=(({itemData:e,workareaContainerData:t,subscriptData:n,pageGroupName:s,activeWorkArea:a,subscriptFieldName:r,actionMgrID:o,containerItemID:i})=>{const c={referenceList:e?.referenceList,ID:t?.caseInfo?.ID,index:n[r],containerName:$s.MODAL,pageReference:$s.CASE_INFO.CASE_INFO_CONTENT,viewID:$s.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW,skipSemanticUrl:!0,actionType:$s.RESOURCE_STATUS.CREATE,interestPage:`.${s}.${n[r]??""}`,targetProperty:`.${s??""}`,pageGroupName:s,context:a??"",subscriptFieldName:r};return{type:Or,payload:{isInCreateStage:!1,isModalAction:!0,parentContext:"",target:"",...c,actionMgrID:o,containerItemID:i,doDeleteCaseSummary:!1,isFormValid:!0}}})({itemData:p,workareaContainerData:f,subscriptData:i,pageGroupName:g,activeWorkArea:u,subscriptFieldName:h,actionMgrID:n,containerItemID:e});return s.push(I),a=i,s})),yg((()=>(zp.resolveActionByID(n,a),sC(s),s=[],s)))):(((e,t)=>{const n={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};zp.rejectActionByID(e,!0,n),Yh.handleDeferredActionCompletion(t)})(n,e.payload.context),_g([]))})))},GP=[vT,sD,pD,ED,KD,ZD,dP,fP,IP,TD,wD,RD,EP,kD,UD,e=>e.pipe(bg(sr),OP((()=>PP(100))),yg((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:s,isProcessAction:a,isDataObject:r,skipReleaseLockRequest:o,isInCreateStage:i,containerItemID:c,context:l}=e.payload;return zp.resolveActionByID(t),Uu.publish(Gs.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:s,hideDelete:!a&&n,isDataObject:r,skipReleaseLockRequest:o,isInCreateStage:i,containerItemID:l||c}),[]}))),e=>e.pipe(bg(qa),OP((()=>PP(100))),yg((e=>{const{actionMgrID:t,context:n,containerName:s,containerItemID:a}=e.payload,r=Wr(s,n);return zp.resolveActionByID(t),sC(aS(KC,{containerItemID:a,target:r,doDeleteCaseSummary:!1})),[]}))),MP,VP,jP,BP,$P],WP=GP;function HP(){return zl((function(e,t){e.subscribe(Yl(t,yl))}))}const{RESOURCE_TYPES:qP}=$s,zP="pyCasePreview",YP=(e,t)=>{const n=lI.isObjectCaseType(e.caseClassName);if(e.key&&!n){const n=py(e?.context),s=GE(n,e.key),a=e?.context;(s||e.updateData||(e=>{const t=nC();if(!e)return!1;const n=Ks(e),s=py(n),a=py(e);if(!s||!a)return!1;const r=FE(s,n),o=FE(a,e);if(!r||!o)return!1;const{key:i}=r;let{key:c}=o;return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),!(!i||!c||i===c)})(a))&&t.actionsOut.push(aS(vC,e))}else t.actionsOut.push(aS(vC,e))},KP=[e=>e.pipe(bg(oa),yg((e=>e.payload)),Og((e=>!gm(e.actionMgrID))),Ag((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===xE.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=Wr(xE.PREVIEW,e.context),n=Om(t,xE.PREVIEW,e.context,{buildNew:!0}),s=decodeURI(e.caseId);sC(jC({...e,context:n,target:t,containerItemID:n,key:s,caseViewMode:Gs.REVIEW_MODE,root:{type:"reference",config:{context:Gs.getProperty(Gs.CASE_INFO.CASE_INFO_CONTENT),name:e.viewName,type:"view"}},data:{key:s,caseInfo:{ID:s,progress:!0,error:!1,caseTypeID:e.caseClassName,content:{classID:e.caseClassName}}}})),e.viewLoadingContainer={target:t,context:n}}const n={};if(t.RemoteSystemID)n.RemoteSystemID=t.RemoteSystemID;else if(qs.isRemoteCase(t.caseClassName)){const{RemoteSystemID:e}=qs.getRemoteCase(t.caseClassName);n.RemoteSystemID=e}const{restApi:s,reqType:a}=((e,t)=>{let n=_S("loadView",t);e.viewContext===qP.PAGE&&(n=_S(Ka,{page:e.viewName,pageClass:e.pageClass}));const s=ks.getDefaultQualifiedName(zP);return e.containerName===xE.PREVIEW&&Boolean(e.caseId)&&e.viewContext!==qP.PAGE&&(e.viewName===s||e.viewName===zP)&&(n=_S(Za,{caseID:e.caseId,params:{pageName:s}})),n})(e,t);return eu(ud(lI.appendExcludeQueryParamToUrl(s),{method:a,headers:n},e.context)).pipe(yg((t=>{const n=decodeURI(e.caseId);let s="";return"string"==typeof t.data?t.data?s=JSON.parse(t.data):(console.error("response data is empty!!"),s={}):s=t.data,{response:{...s,key:n},actionConfig:e,headers:ym(t.headers),rootView:AC.getIn(s,Gs.ROOT)}})),wg(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),Ag((async e=>{const t={};if(e?.type===ba){if(t.actionsOut=Dm(e),e?.payload?.context?.includes(xE.PREVIEW)){const n={...aC(e.payload.context),caseInfo:{progress:!1,error:!0}},s=Wr(xE.PREVIEW,e.payload.context);t.actionsOut=aS(HC,{key:n.key,target:s,containerName:xE.PREVIEW,context:e.payload.context,containerItemID:e.payload.context,data:n})}return t}try{t.actionMgrID=e?.actionConfig?.actionMgrID,t.rootView=e?.rootView;const{actionConfig:n,response:s,headers:a}=e;e?.actionConfig?.skipAssignmentsUpdate&&(delete s?.data?.caseInfo?.assignments,delete s?.data?.caseInfo?.availableActions,delete s?.data?.caseInfo?.availableProcesses);const{containerItemID:r,containerName:o}=n,{target:i,context:c}=(e=>{const{containerName:t,updateData:n,viewLoadingContainer:s}=e,a=t||Kp.getTargetViewContainerName(Ka),r=s?.target??Wr(a,e.context);return{target:r,context:s?.context??(t===xE.PREVIEW&&n?e.context:Om(r,a,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let u={};u=Cf(s),u.directUrlUpdation=!1,await Sm(u,n,l);const d={...n,target:i,context:c,containerItemID:r||c,headers:a},p=Cm(u,d);if(p.resourceType=qP.CASE,o&&!p.updateData){p.caseViewMode=Gs.REVIEW_MODE,AC.setIn(p.data,["context_data","caseViewMode"],p.caseViewMode);const e=py(p?.context);((e,t,n,s,a)=>{e&&a===xE.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,dm(n,n),s.actionsOut=aS(HC,{...n,containerName:a})):e?(s.actionsOut=[],s.actionsOut.push(aS(KC,{target:t,containerItemID:e}))):s.actionsOut=aS(jC,{...n,containerName:a})})(GE(e,p.key),e,p,t,o)}else{p.preserveClientChanges=!0,t.actionsOut=[],o===xE.PREVIEW&&t.actionsOut.push({type:yr,payload:{context:c}});const{viewName:e}=n;e===ks.getDefaultQualifiedName(zP)&&dm(p,p),YP(p,t)}}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:s,viewName:a}=e.actionConfig;return a===ks.getDefaultQualifiedName(zP)&&(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:s}),t})),yg((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(zp.resolveActionByID(n,e),Bs.setNeedsMapping(!1),t)))),e=>{let t=0,n=[];return e.pipe(bg(ia),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>{Uu.publish($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:s,viewName:a,className:r,skipSemanticUrl:o=!1,containerName:i=Kp.getTargetViewContainerName(Ka)}=e,c=n&&{...Zu.addDebugHeaders(n)},l=Wr(i,s);let u="";if(!o){const{semanticURL:t,activate:n,activateContainerActionPayload:s}=Lm(a,r,l);if(u=t,n)return Gm(s),_g({type:$a,activateContainerActionPayload:s,actionConfig:e})}return eu(YE(l)?vm(l,{loadingContext:s}):Promise.resolve({continueExecution:!0,removeActionPayload:{}})).pipe(Ag((({continueExecution:n,removeActionPayload:i})=>{if(!n)return zp.rejectActionByID(t),vg;const{restApi:l,reqType:d}=_S(Ka,{page:a,pageClass:r});return eu(ud(l,{method:d,headers:c},s)).pipe(yg((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:u,semanticURL:u},actionConfig:e,headers:ym(t.headers),removeActionPayload:i,skipSemanticUrl:o}})),wg(": Error ocurred during ajax call at showPage Epic : ",e.context))})))})),Ag((async e=>{const t={};if(t.actionManagerID=e?.actionConfig?.actionMgrID,e&&e.type===ba)return n.push(Dm(e)),t;let{type:s}=e;const{actionConfig:a,skipSemanticUrl:r}=e,o=a.containerName||Kp.getTargetViewContainerName(ia),i=Wr(o,a.context);Uu.publish($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className});const{remoteCasePayload:c,updatedType:l}=((e,t,n,s)=>{let a={},r=e;if(n.isRemoteCase){a={...n};const e=GE(s,a.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},r=$a)}return{remoteCasePayload:a,updatedType:r}})(s,e,a,i);if(s=l??s,a.isDeferLoaded){const{response:s,headers:o={}}=e,{isCreateDataObject:c,context:l}=a,u=Cf(s,{isCreateDataObject:c});u.directUrlUpdation=!r;const d={acName:i,context:l};await Sm(u,a,d);const p=Cm(u,{containerItemID:l,target:i,headers:o,context:l});t.rootView=AC.getIn(u,Gs.ROOT),n.push(aS(vC,p))}else if(s===$a){const{activateContainerActionPayload:{semanticURL:t,containerItemID:s}}=e,r={acName:i,context:JE(s)};a.isTraditionalRemoteCase||await Sm({directUrlUpdation:!0,semanticURL:t},a,r,!0),n.push(aS(KC,{target:i,containerItemID:s}))}else{const t=Om(i,o,a.context),{response:s,headers:l={},removeActionPayload:u}=e,d=Cf(s,{isCreateDataObject:a.isCreateDataObject});d.directUrlUpdation=!r;const p={acName:i,context:t},g=pm(t);await Sm(d,a,p);const h={target:i,context:t,containerItemID:t,headers:l,debugInfo:a.debugInfo,currentCaseViewMode:g,referenceList:a?.referenceListStr,subscriptName:a?.subscriptName},f=Cm(d,h);f.resourceType=$s.PAGE,a.isCreateDataObject&&(f.resourceType=$s.RESOURCE_TYPES.DATA,f.resourceStatus=$s.RESOURCE_STATUS.CREATE,delete f.data.caseInfo,f.referenceList=a.referenceListStr,f.subscriptName=a.subscriptName),((e,t,n)=>{e.isRemoteCase&&(n.resourceType=$s.CASE,n.key=lI.getRemoteCaseKey(t.assignmentID,t.insKey),n.data.caseInfo={...n.data.caseInfo,...t,classID:t.className,target:n.target,containerItemID:n.containerItemID,caseTypeID:t.className,content:{pyLabel:t.name,pyID:Yf(lI.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=e.isTraditionalRemoteCase||!1,n.className=t.className)})(a,c,f),f.data??={},f.data.traditionalGadgetId=lI.getUniqueGadgetId();const m=Pm(i,f);u.containerItemID&&Rm(m)&&n.push(aS(JC,{containerItemID:u.containerItemID,target:i})),n.push(m)}return Uu.publish($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:i,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),t})),yg((({actionManagerID:e=0,rootView:t})=>{zp.resolveActionByID(e,t),sC(n),n=[]})),HP())}],QP=KP,JP=(e,t)=>{const{context:n,pageName:s,dataContext:a,dataContextParameters:r,semanticURL:o,skipSemanticUrl:i,RemoteSystemID:c}=e,{removeActionPayload:l}=t,{restApi:u,reqType:d,body:p}=_S(Qa,{pageName:s,dataContext:a,dataContextParameters:r}),g={};return g.RemoteSystemID=c,eu(ud(u,{method:d,headers:g,body:p},n)).pipe(yg((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:ym(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),wg("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:XP}=$s,ZP=e=>{let t,n=0,s=[];return e.pipe(bg(ca),FD((e=>(({actionMgrID:n}=e.payload),_g(e.payload).pipe(Ag((e=>((e,t)=>{const{context:n,pageName:s,dataContext:a,dataContextParameters:r,skipSemanticUrl:o=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l,containerName:u,RemoteSystemID:d}=e,p=Wr(u,n);let g="";const h={context:n,pageName:s,dataContext:a,dataContextParameters:r,semanticURL:g,skipSemanticUrl:o,containerName:u,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:d};if(!o){g=CS(Qa,{pageName:s,dataViewName:a},r),h.semanticURL=g;const{activate:o,activateContainerActionPayload:i}=wm(XP.PAGE,p,{semanticURL:g});return o?_g({type:$a,activateContainerActionPayload:i,actionConfig:e}):eu(vm(p,{loadingContext:n})).pipe(Ag((({continueExecution:e,removeActionPayload:n})=>e?JP(h,{removeActionPayload:n}):(zp.rejectActionByID(t),vg))))}return JP(h,{removeActionPayload:{}})})(e,n))),Ag((async e=>{if(e&&e.type===ba)return s.push(Dm(e)),s;const{type:n,actionConfig:a,headers:r,response:o,skipSemanticUrl:i}=e;t=AC.getIn(o,Gs.ROOT);const{containerName:c,parentAction:l,resourceType:u}=a,d=Wr(c,a.context);let p;const g=pm(a?.context);if(a.isDeferLoaded){p=Cf(o),p.directUrlUpdation=!i;const t={acName:d,context:a.context};await Sm(p,a,t);const n={target:d,headers:r,context:a.context,containerItemID:e.containerItemID},c=Cm(p,n);return s=aS(vC,c),s}if(n===$a){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,r={acName:d,context:JE(n)};await Sm({directUrlUpdation:!0,semanticURL:t},a,r,!0),s.push(aS(KC,{target:d,containerItemID:n,resourceType:XP.DATA}))}else if("DATA"===u&&l===Pr){const{context:e}=a,t=o?.data,n={context:e,data:t};s.push(aS(vC,n))}else{const t=Om(d,c,a.context),{removeActionPayload:n}=e;p=Cf(o),p.directUrlUpdation=!i;const l={acName:d,context:t};await Sm(p,a,l);const u=Cm(p,{target:d,context:t,containerItemID:t,headers:r,currentCaseViewMode:g});u.resourceType=XP.DATA;const h=Pm(d,u);n.containerItemID&&Rm(h)&&s.push(aS(JC,{containerItemID:n.containerItemID,target:d})),Fm(s),s.push(h)}return s})),yg((()=>(zp.resolveActionByID(n,t),sC(s),s=[],s))))))))},eO=e=>{const{dataViewName:t,context:n,dataViewParameters:s}=e,a={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(s))},{restApi:r,reqType:o}=_S("deleteDataObject",a);return eu(ud(r,{method:o},n)).pipe(yg((t=>({response:t.data,actionInPayload:e}))),wg("Error occurred during ajax call at deleteDataObject Epic",n))},tO=e=>{let t=0,n=[];return e.pipe(bg(_r),Mg(100),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>eO(e))),Ag((async e=>{if(e&&e.type===ba){const{payload:s}=e,a=Dm({...e,...s,actionMgrID:t});return n.push(a),n}return[]})),yg((()=>(1===n.length&&Hf(n[0].type)?zp.rejectActionByID(t):zp.resolveActionByID(t),sC(n),n=[],n))))},nO=e=>{const{dataViewID:t,dataViewParameters:n,context:s}=e,a={data_view_ID:t},{restApi:r,reqType:o}=_S("getDataObjectActions",a);return eu(ud(r,{method:o,body:{dataViewParameters:n}},s)).pipe(yg((e=>({...e.data}))),wg("Error occurred during ajax call at GET data object actions : ",e.context))},sO=e=>{let t=0,n=[];let s={};return e.pipe(bg(Oa),Mg(100),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>nO(e))),Ag((async e=>e&&e.type===ba?(n.push(Dm(e)),n):(s=e,[]))),yg((()=>(1===n.length&&Hf(n[0].type)?zp.rejectActionByID(t):zp.resolveActionByID(t,s),sC(n),n=[],n))))},aO=[ZP,e=>{let t=0,n=[];return e.pipe(bg(Sr),Mg(100),Eg((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:t}=e.payload),!s){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(t,!0,e),_g([])}return _g(e.payload).pipe(Ag((e=>Lg(e))),Ag((async e=>{if(e&&e.type===ba){const{payload:s}=e,a=Dm({...e,...s,actionMgrID:t});return n.push(a),{actionsOut:n,data:void 0}}const{actionInPayload:s}=e,{containerItemID:a,isModalAction:r}=s,o=r?xE.MODAL:xE.PRIMARY,i={target:Wr(o,a),containerItemID:a,context:a};return n.push(aS(JC,i)),{actionsOut:n,data:e?.response}})),yg((({data:e})=>(1===n.length&&Hf(n[0].type)?zp.rejectActionByID(t):zp.resolveActionByID(t,e),sC(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(bg(Nr),Mg(100),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>Ug(e))),Ag((async e=>{if(e&&e.type===ba){const{payload:s}=e,a=Dm({...e,...s,actionMgrID:t});return n.push(a),n}const{actionInPayload:s,response:a,headers:r={}}=e,{containerName:o,readOnly:i,actionName:c}=s,l=Wr(o,s.context),u=Om(l,o,s.context),d={acName:l,context:u};if(a?.data?.dataInfo){const{dataInfo:e}=a.data;e.dataContext||=s.dataLookUp,e.dataContextParameters||=s.requestPayload}await Sm(a,s,d);const p=Cm(a,{target:l,context:u,containerItemID:u,headers:r});return p.resourceType=$s.RESOURCE_TYPES.DATA,p.resourceStatus=$s.RESOURCE_STATUS.UPDATE,p.readOnly=i,p.actionName=c,p.key=JSON.stringify(s.requestPayload),n.push(aS(jC,p)),n})),yg((()=>(1===n.length&&Hf(n[0].type)?zp.rejectActionByID(t):zp.resolveActionByID(t),sC(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(bg(Tr),Mg(100),Eg((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:t}=e.payload),!s){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(t,!0,e),_g([])}return _g(e.payload).pipe(Ag((e=>Fg(e))),Ag((async e=>{if(e&&e.type===ba){const{payload:s}=e,a=Dm({...e,...s,actionMgrID:t});return n.push(a),n}const{actionInPayload:s}=e,{containerItemID:a,isModalAction:r}=s,o=r?xE.MODAL:xE.PRIMARY,i={target:Wr(o,a),containerItemID:a,context:a};return n.push(aS(JC,i)),n})),yg((()=>(1===n.length&&Hf(n[0].type)?zp.rejectActionByID(t):zp.resolveActionByID(t),sC(n),n=[],n))))})))},tO,sO,e=>{let t=0,n=[];return e.pipe(bg(Dr),Mg(100),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>Vg(e))),Ag((async e=>{if(e&&e.type===ba){const{payload:s}=e,a=Dm({...e,...s,actionMgrID:t});return n.push(a),n}const{actionInPayload:s,response:a,headers:r={}}=e,{containerName:o,actionID:i,context:c,actionName:l}=s,u=Wr(o,s.context);let d=Qs(o,c);d=ea(c,d);const p={target:u,context:d,containerItemID:d,headers:r,resourceType:$s.RESOURCE_TYPES.DATA,resourceStatus:$s.RESOURCE_STATUS.OPEN_FLOW_ACTION,key:JSON.stringify(s.dataViewParameters),actionID:i,actionName:l};if(a?.data?.dataInfo){const{dataInfo:e}=a.data;e.dataContext||=s.lookupDatapage,e.dataContextParameters||=s.dataViewParameters}const g={acName:u,context:c};await Sm(a,s,g);const h=Cm(a,p);return n.push(aS(jC,h)),n})),yg((()=>(1===n.length&&Hf(n[0].type)?zp.rejectActionByID(t):zp.resolveActionByID(t),sC(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(bg(Pr),Mg(100),Eg((e=>{const{isFormValid:s}=e.payload;({actionMgrID:t}=e.payload);const a=e.payload.context;if(!s){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(t,!0,e),_g([])}return Du({context:a,stateObj:aC(a),clearContextMessages:!0}),_g(e.payload).pipe(Ag((e=>jg(e))),Ag((async e=>{if(e&&e.type===ba){SI(e,"dataObject");const{payload:s}=e,a=Dm({...e,...s,actionMgrID:t});return n.push(a),n}const{actionInPayload:s,response:a,headers:r={}}=e,{containerName:o,containerItemID:i,resourceType:c,key:l}=s,u=Wr(o,s.context),d={acName:u,context:s.context};await Sm(a,s,d);const p={key:l,target:u,resourceType:c,containerItemID:i,headers:r,context:s.context};return n=((e,t,n,s)=>{const{resourceType:a,key:r,containerItemID:o}=s,i=Cm(n,t);i.resourceType=a||$s.RESOURCE_TYPES.DATA;const c=ta(o);e.push(aS(JC,i));const l=iC(".dataContext","dataInfo",c),u=iC(".dataContextParameters","dataInfo",c),d={context:c,skipSemanticUrl:!0,resourceType:a,parentAction:Pr,dataContext:l,dataContextParameters:u},p=l&&u&&CS(Qa,{pageName:Gs.PY_DETAILS,dataViewName:l},u)||"";if(o?.includes(Gs.PREVIEW)){const t={type:ca,payload:{pageName:Gs.VIEW_NAMES.PY_DATA_PREVIEW,container:Gs.PREVIEW,containerName:Gs.PREVIEW,...d}};e.push(t)}else if(a!==Gs.PAGE&&r===p&&o?.includes(Gs.PRIMARY)){const t={type:ca,payload:{pageName:Gs.VIEW_NAMES.PY_DETAILS,containerName:"",...d}};e.push(t)}return e})(n,p,a,{key:l,resourceType:c,containerItemID:i}),n})),yg((()=>(1===n.length&&Hf(n[0].type)?zp.rejectActionByID(t):zp.resolveActionByID(t),sC(n),n=[],n))))})))}],rO=aO;function oO(e,t){return void 0===t&&(t=NP),zl((function(n,s){var a=null,r=null,o=null,i=function(){if(a){a.unsubscribe(),a=null;var e=r;r=null,s.next(e)}};function c(){var n=o+e,r=t.now();if(r<n)return a=this.schedule(void 0,n-r),void s.add(a);i()}n.subscribe(Yl(s,(function(n){r=n,o=t.now(),a||(a=t.schedule(c,e),s.add(a))}),(function(){i(),s.complete()}),void 0,(function(){r=a=null})))}))}const{RESOURCE_TYPES:{CASE:iO,DATA:cO,OBJECT:lO}}=$s;let uO=[],dO=!1,pO=!1;const gO={},hO=[e=>e.pipe(bg(Ra),oO(200),yg((e=>e.payload)),Ag((e=>{pO=!1,Uu.subscribe($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{pO=!0}));const t=Vu.getPreviewMode()&&Zu.addDebugHeaders({debugId:AC.generateUniqueID()});gO.dataContext=e.payload.dataViewName,gO.dataContextParameters=e.payload.dataViewKeys;const{context:n,requestType:s,routeKey:a}=e;let{routeEndpoint:r}=e;r&&(r.indexOf("viewType={viewType}")>0?r=r.replace("{viewType}","page"):r.indexOf('viewType=""')>0&&(r=r.replace('viewType=""','viewType="page"'))),dO=a===kr,dO&&Bs.setNeedsMapping(!0);const o=un()+r,i=e.options.context;let c;const l={},u=e?.payload?.caseClassName;if(qs.isRemoteCase(u)){const{RemoteSystemID:e}=qs.getRemoteCase(u);l.RemoteSystemID=e}if(Gy.isWSSPortal()&&(l[Gs.X_ORIGIN_CHANNEL]="WSS"),"POST"===s){c=e.payload,r.indexOf("viewType=")<0&&(r=`${r}?viewType=page`);let i;switch(Vm(a)){case iO:case lO:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case cO:i=gO;break;default:i=c}return eu(ud(o,{method:s,body:i,headers:{...l,...t}},n)).pipe(yg((t=>({response:{...t.data},payload:e,headers:ym(t.headers,"",l)}))),wg(": Error occurred during ajax call at historyEpic : ",e))}return eu(ud(lI.appendExcludeQueryParamToUrl(o),{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(yg((n=>({response:n.data,payload:e,headers:{...ym(n.headers),...t}}))),tu((s=>{if(a===dr){const n={messages:[{type:"error",message:s.response.data.errorDetails[0].localizedValue}],category:"PAGE"};Hp.setComponentCache("assignments-launchAssignment-Error",n);const a=Qg(Vy()),r=By.getEndPointInfo(a.split("/assignments")[0]),o=un()+r.routeEndpoint;return e={...e,routeKey:Za,resetSemanticURL:!0},eu(ud(o,{method:r.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(yg((n=>({response:n.data,payload:e,headers:{...ym(n.headers),...t}}))))}return _g(rS(": Error occurred during ajax call at historyEpic : ",s,n))})))})),Ag((async e=>{if(pO)return uO;if(Uu.subscribe($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{pO=!0})),e&&e.type===ba)return Dm(e);const{headers:t={},response:n,payload:s}=e,a=Cf(n,{[$s.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),r=s.options.acName,o=sy(r)&&ry(r)?YE(r):e.payload.options.context,i=o;t.RemoteSystemID=s?.payload?.RemoteSystemID;const c={target:r,context:o,containerItemID:i,headers:t,debugInfo:{debugId:t[Gs.COREHEADER_APP_DEBUG_ID]}};let l=s?.payload?.pageClass;const u=s?.payload?.page,d=dO?kr:Za,p=dO?s.payload.objectID:s.payload.workID,g=dO?"{objectID}":"{workID}";let h=dO?`objects/${p}`:"";s?.payload?.caseName&&p&&(h=CS(d,{caseName:e.payload.payload.caseName}),h=h?.replace(g,p)||"",l=s?.payload?.caseClassName),(s?.routeKey===dr||s?.resetSemanticURL)&&((e,t)=>{const n=Jf(t);let s=CS(Za,{caseClassName:Kf(t)},{id:n});s=s?.replace("{workID}",String(Yf(n))).replace("{id}",String(Yf(n))),vS({directUrlUpdation:!0,semanticURL:s,options:{}})})(0,a),((e,t)=>{const n=t?.data?.caseInfo;e===dr&&n?.caseTypeID&&n?.content&&rm(n.caseTypeID)&&(n.content.coexistenceAction=er)})(s?.routeKey,a),(e=>{const t=e?.data?.caseInfo;if(!t)return;const{ID:n,caseTypeID:s}=t;n&&s&&rm(s)&&(e.data.caseID=n)})(a),Uu.publish($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:u,pageClass:l});const f=AC.getIn(a,Gs.COMPONENTS);f&&await Vp(f),Ip(a,s.options.actionConfig,!0),Uu.publish($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:r,pageName:u,pageClass:l});let m=Cm(a,c);return m=((e,t,n)=>{if(e===mm.CASE||e===mm.OBJECT||e===mm.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:s}=Nm(t.caseInfo.assignments[0].ID);n.key=e||t.caseInfo.ID,n.flowName=s}else n.flowName="",n.key=t?.caseInfo?.ID||t?.objectInfo?.ID||t.semanticURL;n.resourceType=e,n.semanticURL=t.semanticURL,e===mm.ASSIGNMENT?(n.caseViewMode=Gs.PERFORM_MODE,n.resourceType=mm.CASE):n.caseViewMode=Gs.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(Vm(e.payload.routeKey),{...n.data,semanticURL:h,caseViewMode:Gs.REVIEW_MODE},m),m.data.traditionalGadgetId=lI.getUniqueGadgetId(),uO.push(Pm(r,m)),dm(a,c),((e,t)=>{let n=Hp.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(aS(QC,n)),Hp.resetComponentCache("assignments-launchAssignment-Error"))})(o,uO),uO})),yg((()=>(pO||sC(uO),uO=[],dO=!1,pO=!1,uO))),wg("Error occurred"))],fO=hO,mO=[e=>{let t=0;return e.pipe(bg(hr),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),yg((()=>{const e=nC()?.getState(),n=oT();return sn(e,n)&&t>0?zp.resolveActionByID(t,{}):zp.rejectActionByID(t),[]})),HP())}],IO=[e=>{let t=0,n=[];return e.pipe(bg(la),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:s}=e;let a,r="";n||(r=CS(Ja,{insightID:"{insightID}"}),r=r.replace("{insightID}",s),a=By.getEndPointInfo(r));const{restApi:o,reqType:i}=_S(Ja,{...a?.payload||[],insightID:s});return eu(ud(o,{method:i},t)).pipe(yg((t=>{let s={};return s="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...s,key:r,semanticURL:r},actionConfig:e,skipSemanticUrl:n}})),wg(": Error occurred during ajax call at showPage Epic : ",e.context))})),Ag((async e=>{if(e&&e.type===ba)return n.push(Dm(e)),n;const{actionConfig:t,skipSemanticUrl:s}=e,a=Kp.getTargetViewContainerName(ia),r=Wr(a,t.context),o=Om(r,a,t.context),{response:i}=e,c=Cf(i);c.directUrlUpdation=!s;const l={acName:r,context:o},u=!s,d=s;await Sm(c,t,l,u,d);const p=Cm(c,{target:r,context:o,containerItemID:o});p.resourceType=$s.PAGE;const g=Pm(r,p);return n.push(g),n})),yg((()=>{zp.resolveActionByID(t),sC(n),n=[]})),HP())}],EO=IO,yO=[e=>{let t=0,n=[];return e.pipe(bg(ua),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:s}=e;let a="";n||(a=CS(Xa,{dashboardID:s}),a=a.replace("{dashboardID}",s));const{restApi:r,reqType:o}=_S(Xa,{dashboardID:s});return eu(ud(r,{method:o},t)).pipe(yg((t=>{let s={};return s="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...s,key:a,semanticURL:a},actionConfig:e,skipSemanticUrl:n}})),wg(": Error occurred during ajax call at showPage Epic : ",e.context))})),Ag((async e=>{if(e&&e.type===ba)return n.push(Dm(e)),n;const{actionConfig:t,skipSemanticUrl:s}=e,a=Kp.getTargetViewContainerName(ia),r=Wr(a,t.context),o=Om(r,a,t.context),{response:i}=e,c=Cf(i);c.directUrlUpdation=!s;const l={acName:r,context:o},u=!s,d=s;await Sm(c,t,l,u,d);const p=Cm(c,{target:r,context:o,containerItemID:o});p.resourceType=$s.PAGE;const g=Pm(r,p);return n.push(g)})),yg((()=>{zp.resolveActionByID(t),sC(n),n=[]})),HP())}],AO=yO,CO=(e,t)=>{const{class:n,context:s,viewType:a=Im.PAGE}=e,{removeActionPayload:r}=t,o=e?.pageName?e?.pageName:Gy.getDefaultCasePage();return eu(yp.createCase(n,{...e,pageName:o,viewType:a,context:s})).pipe(yg((({response:t,headers:n})=>(Bs.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:r}))),wg("Error occurred during ajax call at createObject Epic : ",s))},SO="CREATE_OBJECT",_O=e=>{let t,n=0,s=[],a={};let r=!1;return e.pipe(bg(SO),Mg(100),Eg((e=>{if(({actionMgrID:n}=e.payload),lI.isExternalObject(e.payload.class)&&!aI(e.payload.context)){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(n,!0,e),_g([])}return _g(e.payload).pipe(Ag((e=>{const{context:s}=e;t=e.class;const a=KT(e),o=Wr(a,s);return r=!1,eu(TT(o,{loadingContext:s})).pipe(Ag((({continueExecution:t,removeActionPayload:s,dirtyCheckPerformed:a})=>t?(r=a,CO(e,{removeActionPayload:s})):(zp.rejectActionByID(n),vg))))})),Ag((async e=>{if(e&&e.type===ba)return e.payload.context=((e,t)=>lI.isExternalObject(e)&&t?t:Ry())(t,e.payload.context),s.push(Dm(e)),s;const{actionInPayload:o,response:i,headers:c,removeActionPayload:l}=e,u=ZT(o,i);AC.setIn(i.data,Gs.getProperty(Gs.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const d=KT({...o,isInCreateStage:u}),p=Wr(d,o.context),g=Om(p,d,o.context);if(((e,t)=>{lI.isExternalObject(e.class)&&(e.containerItemID=e.context,MT(t,e))})(o,s),!r&&((e,t,n)=>!Gf(e)&&sy(t)&&!lI.isExternalObject(n))(d,p,t)){const{continueExecution:e}=await vm(p,{loadingContext:o.context});if(!e)return zp.rejectActionByID(n),s}if(((e,t)=>!e&&!t)(o?.openCaseViewAfterCreate??!0,u)){const{businessID:e,caseType:t,resolvedURL:n}=ag(i);return a={id:e,label:t,href:n},OT(a),RT({caseId:e,caseType:t}),s}(e=>{lI.isExternalObject(e.class)&&OT({content:Yy().getLocaleValue("Successfully submitted!","Assignment")})})(o);const h=Cf(i),f=String(Yf(eg(h)));let m=CS(jr,{caseClassName:Zp(h)});m=m.replace(/{.+?}/,f),h.semanticURL=m,Hp.setComponentCache(f,Zu.addDebugHeaders(o.debugInfo)),JT(h,o);const I={acName:p,context:g};await Sm(h,o,I);const E={target:p,context:g,headers:c,semanticURL:m,caseViewMode:XT(h),containerItemID:g,isInCreateStage:u,isMinimizable:u,assignmentContext:AC.getIn(h,_T),nextAssignmentInfo:AC.getIn(h,ST),resourceType:$s.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:o.openCaseViewAfterCreate,modalOptions:o.modalOptions,debugInfo:o.debugInfo};tg(E,h);const y=Cm(h,E),A=Pm(p,y);return((e,t,n)=>{if(Rm(e)){const{removeActionPayload:e,target:s}=t;Zf(n,{removeActionPayload:e,target:s})}})(A,{removeActionPayload:l,target:p},s),s.push(A),s})),yg((()=>(km(s),am(s,n),setTimeout((()=>(e=>{lI.isExternalObject(e)&&Bs.setNeedsMapping(!1)})(t))),a={},s=[],s))))})))},NO=(e,t)=>{const{assignmentID:n,actionID:s,caseID:a,context:r,additionalHeaders:o={},jsActionQueryParams:i}=e,{state$:c}=t,l=Im.PAGE,u="executeObjectWideAction",d={assignmentID:n,actionID:s,viewType:l,objectID:a};let{restApi:p}=_S(u,d);const{reqType:g}=_S(u,d);l&&!p?.includes("viewType=")&&(p=p?.includes("?")?`${p}&viewType=${l}`:`${p}?viewType=${l}`),p=CI(i,p),e.viewType=l;const{content:h}=Am(r,{isObjectWideAction:!0}),f=c.value.data[r]?.objectInfo?.headers||{},{etag:m}=f,I={"if-match":m,...o};return eu(ud(p,{method:g,body:h,headers:I},r)).pipe(yg((t=>{const{data:n,headers:s}=t;return Bs.analyseResponse(t.data),{actionInPayload:e,response:n,headers:ym({...I,...s})}})),wg("Error occurred during ajax call at executeObjectWideAction Epic : ",r))},TO=(e,t)=>{const{isCaseWideAction:n}=t;return{isCaseWideAction:n,caseID:eg(e)}},{RESOURCE_TYPES:DO}=$s,PO=(e,t)=>{let n=0,s=[],a={},r="";return e.pipe(bg(Ur),Eg((e=>{if(({actionMgrID:n}=e.payload),r=e.payload.context,Du({context:r,stateObj:aC(r),clearContextMessages:!0}),!aI(r)){const t={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return zp.rejectActionByID(n,!0,t),Yh.handleDeferredActionCompletion(e.payload.context),_g([])}return _g(e.payload).pipe(Ag((e=>{wT(s,e);const n={...e};return NO(n,{state$:t})})),Ag((async e=>{if(e?.type===ba){const t=Dm(e);return s.push(t),s}Lh.clearContextedCache(r);const{headers:t,actionInPayload:o,response:i}=e,{containerItemID:c,isModalAction:l,isInCreateStage:u}=o,d=py(c);o.target=d,AC.setIn(i.data,Gs.OBJECT_INFO_IS_LOCAL_ACTION,!1),CD({submitResponse:i});let p=Cf(i,{[$s.STOPMERGEACTIONS]:!i.nextAssignmentInfo});const g=Zp(p),h=Ks(o.context),f=ey(h)[0]?YE(ey(h)[0]):h,m=(e=>{const t=ng(e);return dI(t)&&pI(Gy.getOperatorIdentifier(),t)})(p),I=u&&!m;!l||u||jT(o.context,f)||(p=Um(p,aC(c)));const E=Cm(p,{headers:t,actionMgrID:n,directUrlUpdation:!1});((e,t)=>{const{attachmentsExist:n}=t;n&&AC.setIn(e,$s.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),AC.setIn(e,$s.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())})(E.data,o),E.caseClassName=g,E.resourceType=DO.ASSIGNMENT,E.headers=t;const y=eg(p);tg(E,p);const A=CS(jr,{caseClassName:g}).replace(/{.+?}/,String(Yf(y)));p.semanticURL=A,E.semanticURL=A,await HT(o,E,!1,y,p,s,e,i,!0),I&&(a=kT(o),RT({caseId:o.caseID,caseType:o.caseTypeID,assignmentId:o.assignmentID})),((e,t)=>{const n=Zp(e?.response),s=ng(e?.response),{caseTypeID:a}=s,r=Gy.getFeatureMap();(r?.deferUpdateCaseSummaryView??!Object.hasOwn(r,Gs.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&wA(Gs.CASESUMMARY_VIEW_NAME,a)&&im(t,e?.actionInPayload,e?.response,{caseClassName:n})})(e,s),Yh.handleDeferredActionCompletion(r),qT(E,o,f);const C=TO(p,o);return Gh({...C,containerItemID:c}),FT(s,{transientItemID:c,target:d,isModalAction:l}),s})),yg((()=>{const e=s.find((e=>e.type===ba));return e?(Yh.handleDeferredActionCompletion(r),zT(e),zp.rejectActionByID(n)):zp.resolveActionByID(n,a),km(s),Bs.setNeedsMapping(!1),s=[],a={},s})))})))},OO=(e,t)=>{const{insKey:n,headers:s,context:a,debugInfo:r,viewType:o}=e,{removeActionPayload:i}=t,c=e.pageName?e.pageName:Gs.VIEW_NAMES.PY_DETAILS,l=_S(kr,{objectID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),eu(ud(u,{method:d,headers:{...s,...r&&{...Zu.addDebugHeaders(r)}}},a)).pipe(yg((t=>(Bs.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:ym({...s,...t.headers}),removeActionPayload:i}))),wg("Error occurred during ajax call at getObject Epic : ",a))},RO="GET_OBJECT",{RESOURCE_TYPES:bO}=$s,vO=async(e,t)=>{const{actionInPayload:n,activateContainerActionPayload:s,type:a,response:r,removeActionPayload:o,headers:i}=e,{context:c,skipBrowserSemanticUrlUpdate:l,debugInfo:u}=n,d=kf(kr,n),p=Wr(d,c);if(Wf(a))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:s},actionInPayload:a,actionInPayload:{context:r,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=kf(kr,a),l=Wr(c,r),u=JE(s);await Sm({directUrlUpdation:!o,semanticURL:n},a,{acName:l,containerName:c,target:l,context:u}),e.push(aS(KC,{containerItemID:s,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:s,actionInPayload:n});else{const e=Om(p,d,c,{buildNew:!0}),s=Cf(r),a=(e=>{const t=eg(e),n=Zp(e);let s=CS(kr,{objectClassName:n});return s=s?.replace("{objectID}",String(Yf(t))),s})(s);s.semanticURL=a,s.directUrlUpdation=!l;const g={acName:p,context:e};await Sm(s,n,g);const h=Cm(s,{target:p,context:e,containerItemID:e,semanticURL:a,headers:i,debugInfo:u});h.caseViewMode=Gs.REVIEW_MODE,h.resourceType=bO.OBJECT,tg(h,s);const f=Pm(p,h);o.containerItemID&&Rm(f)&&t.push(aS(JC,{containerItemID:o.containerItemID,target:p})),t.push(f)}const g=n.insKey;Wh({caseKey:g,actionInContext:c})},xO=e=>{let t=0,n=[];return e.pipe(bg(RO),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>{const{context:n,isChild:s,viewType:a}=e,r=kf(kr,e),o=Wr(r,n);return eu("none"!==a?vm(o,{loadingContext:n}):Promise.resolve({continueExecution:!0,removeActionPayload:void 0})).pipe(Ag((({continueExecution:n,removeActionPayload:r})=>{if(!n)return zp.rejectActionByID(t),vg;const{activate:i,activateContainerActionPayload:c}=wm(bO.OBJECT,o,e);return i&&!s&&"none"!==a?_g({type:$a,activateContainerActionPayload:c,actionInPayload:e}):OO(e,{removeActionPayload:r})})))})),Ag((async e=>{if(e&&Hf(e.type))return n.push(Dm(e)),n;if("none"===e?.actionInPayload?.viewType){const t=aC(e?.actionInPayload?.context);if(t?.context_data?.caseViewMode!==Gs.PERFORM_MODE){const t=Cf(e?.response),s={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:yr,payload:{context:s.context,doDeleteConfirmationDetails:!1}}),n.push(aS(vC,s));const a=py(e?.actionInPayload?.context),r=Bf(e?.actionInPayload?.context),o=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:r});if(sg(e?.actionInPayload?.context)){const t=Cm(e?.response,{...o});jm({...t,isArrayDeepMerge:!0},n)}}}else await vO(e,n);return n})),yg((()=>(sC(n),am(n,t),n=[],n))))},wO="OPEN_OBJECT_ACTION",MO=e=>{const{actionID:t,caseID:n,context:s,openActionType:a,modalLoadingContainer:r}=e,o=Im.FORM,i=_S(Br,{objectID:n,actionID:t,viewType:o}),{reqType:c}=i;let{restApi:l}=i;e.actionType=Gs.RESOURCE_TYPES.OBJECT,l&&!l.includes("viewType=")&&(l=l.includes("?")?`${l}&viewType=${o}`:`${l}?viewType=${o}`);const u=r?.context??s;return eu(ud(l,{method:c,headers:{}},u)).pipe(yg((t=>(Bs.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:ym(t.headers)}))),wg(`: Error occurred during ajax call at ${a} Epic : `,u))},LO=async(e,t,{headers:n,actionInPayload:s})=>{const{context:a,actionName:r,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=s,l=Cf(e,{info:$s.OBJECT_INFO.OBJECT_INFO}),u=kf(o,s),d=c?.target??Wr(u,a),{context:p,containerItemID:g,isNewContainerItem:h}=((e,t,n,s)=>{let a,r,o=!1;const i=ay(e);return!ry(e)||i&&!BE(e,s)?(r=Qs(t,n),Gf(t)&&(r=ea(n,r)),a=r,o=!0):(a=i?GE(e,s):YE(e),r=JE(a)),{context:r,containerItemID:a,isNewContainerItem:o}})(d,u,a,e.data.objectInfo.ID),f={acName:d,target:d,containerName:u,context:p};await Sm(l,s,f);const m=l.uiResources?.root,I=(e=>e?Gs.PERFORM_MODE:Gs.REVIEW_MODE)(m),E=Cm(l,{target:d,context:p,containerItemID:g,caseViewMode:I,doDeleteCaseSummary:i,headers:n,actionName:r,isMinimizable:!1,isInCreateStage:Gf(u),resourceType:$s.RESOURCE_TYPES.OBJECT,isProcessAction:s.isProcessAction,showProgress:s.showProgress,progressMessage:s.progressMessage,actionType:s.actionType});if(m&&tg(E,l),Gf(u)&&delete E.doDeleteCaseSummary,t.push(aS((e=>e?jC:HC)(h),E)),h||t.push(aS(zC,E)),h){const a=ey(s.contextName),r=GE(a,e.data.objectInfo.ID);if(r){const e={data:{objectInfo:{headers:n}},context:r};t.push(aS(vC,e))}}return g!==YE(d)&&t.push(aS(KC,{target:d,containerItemID:g})),sg(g)&&!c?.context&&jm(E,t),t},UO=e=>{e.openActionType=Br;if(kf(e.openActionType,e)===Gs.MODAL){const t=kf(e.openActionType,e),n=Wr(t,e.context),s=ea(e.context,Qs(t,e.context));return sC(jC({target:n,context:s,containerItemID:s,key:e.caseID,caseViewMode:Gs.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:Gs.getProperty(Gs.CASE_INFO.CASE_INFO_CONTENT),type:"view"}},data:{key:e.caseID,objectInfo:{ID:e.caseID}}})),sC(qC({context:s})),e.modalLoadingContainer={target:n,context:s},MO(e)}return MO(e)},FO=e=>{let t=0,n=[];return e.pipe(bg(wO),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>UO(e))),Ag((async e=>{if(Hf(e.type)){const t=Dm(e);n.push(t);const s=aC(e.payload.context);return s?.context_data?.isLoading&&n.push(aS(zC,e.payload)),n}const{actionInPayload:t,headers:s,response:a}=e,{actionID:r}=t;return AC.setIn(a,"data.objectInfo.activeActionID",r),AC.setIn(a.data,Gs.getProperty(Gs.OBJECT_INFO_IS_LOCAL_ACTION),!0),t.refreshConditions&&AC.setIn(a.data,Gs.getProperty(Gs.CASE_INFO_REFRESH_CONDITIONS),t.refreshConditions),await LO(a,n,{headers:s,actionInPayload:t}),BD(t),n})),yg((()=>(sC(n),am(n,t),n=[],n))))},VO=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Gs.MODAL:t||Kp.getTargetViewContainerName($r)},jO=(e,t)=>{const{class:n,context:s,viewType:a=Im.PAGE}=e,{removeActionPayload:r}=t,o=e?.pageName?e?.pageName:Gy.getDefaultCasePage();return eu(yp.createCase(n,{...e,pageName:o,viewType:a,context:s,retrieveActionViewForNewObject:!0})).pipe(yg((({response:t,headers:n})=>(Bs.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:r}))),wg("Error occurred during ajax call at createObject Epic : ",s))},kO="CREATE_EXTERNAL_OBJECT",BO=e=>{let t=0,n=[],s=!1;return e.pipe(bg(kO),Mg(100),yg((e=>(({actionMgrID:t}=e.payload),e.payload))),Ag((e=>{const{context:n}=e,a=VO(e),r=Wr(a,n);return s=!1,eu(TT(r,{loadingContext:n})).pipe(Ag((({continueExecution:n,removeActionPayload:a,dirtyCheckPerformed:r})=>n?(s=r,jO(e,{removeActionPayload:a})):(zp.rejectActionByID(t),vg))))})),Ag((async e=>{if(e&&e.type===ba)return e.payload.context=Ry(),n.push(Dm(e)),n;const{actionInPayload:a,response:r,headers:o,removeActionPayload:i}=e,c=ZT(a,r);AC.setIn(r.data,Gs.getProperty(Gs.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const l=VO({...a,isInCreateStage:c}),u=Wr(l,a.context),d=Om(u,l,a.context);if(!s&&!Gf(l)&&sy(u)){const{continueExecution:e}=await vm(u,{loadingContext:a.context});if(!e)return zp.rejectActionByID(t),n}const p=Cf(r);let g=CS($r,{caseClassName:Zp(p)});g=g.replace(/{.+?}/,String(Yf(eg(p)))),p.semanticURL=g,JT(p,a);const h={acName:u,context:d};await Sm(p,a,h);const f={target:u,context:d,headers:o,semanticURL:g,caseViewMode:XT(p),containerItemID:d,isInCreateStage:c,isMinimizable:c,assignmentContext:AC.getIn(p,_T),nextAssignmentInfo:AC.getIn(p,ST),resourceType:$s.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo,isExternalObjectCreationFlow:!0};tg(f,p);const m=Cm(p,f),I=Pm(u,m);return Rm(I)&&Zf(n,{removeActionPayload:i,target:u}),n.push(I),n})),yg((()=>(km(n),am(n,t),n=[],n))))},$O=e=>{const{workId:t,context:n,isExternalCase:s}=e,a=s?ar:"deleteWork",{restApi:r,reqType:o}=_S(a,{ID:t});return eu(ud(r,{method:o},n)).pipe(yg((t=>({response:t.data,actionInPayload:e,headers:ym(t.headers)}))),wg("Error occurred during ajax call at deleteWork Epic : ",n))},GO=e=>{Uu.publish(Gs.PUB_SUB_EVENTS.WORK_EVENTS.WORK_DELETED,e)},WO=e=>{let t,n=0,s=[];return e.pipe(bg(dg),yg((e=>(({actionMgrID:n,caseTypeID:t}=e.payload),e.payload))),Ag((e=>{if(!e.skipDeleteConfirmation&&!e.ignoreWorkDeletion){const s=xE.MODAL,a=Wr(s,e.context),r=ea(e.context,Qs(s,e.context));return sC([aS(jC,{target:a,context:r,containerItemID:r,containerName:s,isDeleteConfirmation:!0,actionName:"Delete",workId:e.workId,caseTypeID:t,className:e.className,keys:e.keys,...e.enableBackNavigation&&{enableBackNavigation:!0},data:{caseInfo:{caseTypeID:t}}})]),zp.resolveActionByID(n),vg}return e.ignoreWorkDeletion?_g({actionInPayload:e}):$O(e)})),Ag((async e=>{if(e&&Hf(e.type)){const{payload:t}=e;return s.push(Dm({...e,...t,actionMgrID:n})),s}const{actionInPayload:t}=e,{context:a}=t;if(OT({content:Yy().getLocaleValue("Deleted successfully!","Messages")}),a?.includes(Gs.PREVIEW)&&s.push(aS(VC,ly({context:Gs.APP.APP,name:Gs.PREVIEW}))),a?.includes(Gs.MODAL)){const e=xE.MODAL,t=Wr(e,a),n=FE(t,a);n?.enableBackNavigation&&window?.history?.back()}return s})),yg((()=>(sC(s),am(s,n)===Gs.PROMISE_VALUE.RESOLVE&&GO({caseTypeID:t}),s=[],s))))},HO=((...e)=>(t,n)=>new Ll((s=>{const a=e.map((e=>e(t,n).subscribe(s)));return()=>{a.forEach((e=>e.unsubscribe()))}})))(...IT,...WP,...QP,...fO,...rO,...yT,...mO,...EO,...AO,...[_O,xO,PO,FO,BO,WO]),qO=()=>e=>t=>{const{type:n="",payload:s={}}=t||{},{category:a,context:r,transientItemID:o}=s;"HTTP"!==a&&[wa,Ga,Ma,Ha,Ua,Ba].includes(n)&&(Km(r||o),yu.removeContextTreeNode(r||o),n!==wa&&n!==Ma||-1===s?.target?.indexOf("modal")||Uu.publish($s.PUB_SUB_EVENTS.PEGA_EMBED_CUSTOM,n)),e(t)},zO={},YO=e=>{const t=AC.getIn(zO,[Gs.CONTEXT,e],[]),n=[];t.forEach((t=>{const s=t.substr(0,t.lastIndexOf("_")),a=AC.getIn(zO,[s,t],[]),r=a&&a.length>0&&a.indexOf(e);if(r>-1&&a.splice(r,1),!a||a&&0===a.length){AC.deleteIn(zO,[s,t]);const e=AC.getIn(zO,[s]);e&&0===Object.keys(e).length&&AC.deleteIn(zO,[s]),n.push({dataPageName:s,dataPageNameWithHash:t})}})),AC.deleteIn(zO,[Gs.CONTEXT,e]);const s=AC.getIn(zO,[Gs.CONTEXT]);(!s||s&&0===Object.keys(s).length)&&AC.deleteIn(zO,[Gs.CONTEXT]),n.length>0&&sC(iS({dataPagesToBeRemoved:n}))},KO=(e={},t)=>{Object.keys(e).forEach((n=>{const s=AC.getIn(e,[n],{});Object.keys(s).forEach((e=>{((e,t,n)=>{const s=AC.getIn(zO,[Gs.CONTEXT,n]);if(AC.getIn(zO,[e])){const s=AC.getIn(zO,[e,t],[]);AC.setIn(zO,[e,t],[...new Set([...s,n])])}else AC.setIn(zO,[e,t],[n]);s?AC.setIn(zO,[Gs.CONTEXT,n],[...new Set([...s,t])]):AC.setIn(zO,[Gs.CONTEXT,n],[t])})(n,e,t)}))}))},QO=()=>e=>t=>{(Array.isArray(t)?t:[t]).forEach((e=>{const{payload:{data:t={},context:n=null,childContainersContexts:s=[]}={},type:a}=e;if(((e,t)=>{t&&t.length>0&&(e===Ha||e===Ma)&&t.forEach((e=>{YO(e)}))})(a,s),a===wa||a===Da||a===mr){const e=a===mr?t:t.shared;KO(e,n)}else a===Ha?(YO(n),KO(t.shared,n)):a===Ma&&YO(n)})),e(t)},{PUB_SUB_EVENTS:JO}=$s,XO=e=>t=>n=>{const{type:s,payload:{target:a,containerItemID:r,context:o,childContainersContexts:i=[],containerInfo:{newAccessedOrder:c,containerType:l}={newAccessedOrder:new Array,containerType:""},eventName:u}={}}=n;s===Ma&&((e,t,n,s,a,r)=>{const{resourceType:o,key:i,context:c}=AC.getIn(e.getState(),["containers",t,"items",n])||{},l={resourceType:o,key:i,context:c,containerItemID:n,...void 0!==s?{eventName:s}:{}};Uu.publish(JO.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,l),t===`${$s.APP.APP}/${Gs.PRIMARY}`&&r===Gs.CONTAINER_TYPE.MULTIPLE&&Uu.publish(JO.CONTAINER_EVENTS.CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM,{key:i,newAccessedOrder:a})})(e,a,r,u,c,l),((e,t)=>{t&&t.length>0&&(e===Ha||e===Ma)&&t.forEach((e=>{e&&Vh.cleanCaches(e)}))})(s,i),s!==Ha&&s!==Ma||!o||Vh.cleanCaches(o),t(n)},ZO=(e,t,n,s)=>{e&&t&&(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,e)})({caseId:e,caseClass:n,context:s||""})},eR=e=>{e&&(e=>{Uu.publish(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,e)})({caseId:e})},tR=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t){const{type:e,payload:n}=t,{target:s,key:a,context:r,data:o}=n||{};if((e=>e===`${Gs.APP.APP}/${Gs.PRIMARY}`)(s)){const t=o?.caseInfo?.ID,n=r||"",s=iC(Gs.CASE_INFO.CASE_INFO_ID,"",n)||"",i=o?.caseInfo?.caseTypeID||"";e!==Ha&&e!==Ma||eR(s),e!==wa&&e!==Ha||ZO(a,!!t,i,n)}}e(t)},nR=()=>e=>t=>{const{payload:{context:n=null,transientItemID:s=null,clearStateMachine:a=!0}={},type:r}=t;n&&(r===wa||r===Ga||r===Ha||r===Ma)&&a&&(Vd(n),Ud(n)),s&&r===ja&&(Vd(s),Ud(s)),e(t)},sR=e=>AC.getIn(e,Gs.CASE_INFO.ASSIGNMENT_ID),aR=e=>{Object.keys(Ah.subscribers).forEach((t=>{"COACH_UPDATE"===Ah.subscribers[t].filter.matcher&&Ah.subscribers[t].filter.criteria?.caseId===e&&Ah.unsubscribe(t)}))},rR=(e,t)=>{if(n=t.target,n?.toString().includes(Gs.MODAL))return;var n;const{context:s,data:a,resourceType:r,caseID:o}=t;e===wa?((e,t,n)=>{if(n===Gs.RESOURCE_TYPES.ASSIGNMENT){const n=sR(t),s=AC.getIn(t,["caseInfo","ID"]);n&&s&&qh({actionInContext:e,assignmentID:n,caseKey:s})}else if(n===Gs.RESOURCE_TYPES.CASE&&e?.includes("workarea")){const n=AC.getIn(t,["caseInfo","ID"]),s=sR(t);n&&s&&qh({actionInContext:e,assignmentID:s,caseKey:n})}})(s,a,r):e===Ga?((e,t,n)=>{if(n!==Gs.RESOURCE_TYPES.ASSIGNMENT)return;const s=sR(aC(e)),a=sR(t),r=AC.getIn(t,["caseInfo","ID"]);s&&s!==a&&zh({actionInContext:e,assignmentID:s,caseKey:r}),a&&r&&qh({actionInContext:e,assignmentID:a,caseKey:r})})(s,a,r):e===Ma&&o?((e,t)=>{if(e?.includes("workarea")){const n=sR(aC(e));n&&zh({actionInContext:e,assignmentID:n,caseKey:t})}else aR(t)})(s,o):e===Ha&&o&&((e,t,n,s)=>{if(e?.includes("workarea")){const t=sR(aC(e));t&&zh({actionInContext:e,assignmentID:t,caseKey:s})}else aR(s);if(n===Gs.RESOURCE_TYPES.ASSIGNMENT){const n=sR(t);n&&qh({actionInContext:e,assignmentID:n,caseKey:s})}})(s,a,r,o)},oR=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t){const{type:e,payload:s}=t;"object"==typeof(n=s)&&null!==n&&rR(e,s)}var n;e(t)},iR=[ya,Ca,_a,"DELETE_CASE_IN_CREATE_STAGE",Na,Ta],cR=new Set([wa,Ha,Ga,Ma,Aa,Or,ra,Er,...iR]),lR=(e,t)=>{if(!(e=>{const t=e?.data?.caseInfo?.settings?.autoSave;if(null!=t)return Boolean(t);const n=e?.containerItemID??e?.context;if(n){const e=iC("caseInfo.settings.autoSave",null,n);if(null!=e)return Boolean(e)}return!1})(t))return!1;const n=t.containerItemID||e,s=t.target||py(n),a=FE(s,n),r=t.resourceType||a?.resourceType,o=t.key||a?.key;return r===Gs.RESOURCE_TYPES.ASSIGNMENT&&Boolean(o)},uR=(e,t,n)=>{e===wa||e===Ha||e===Ga&&t.data?(aE(n)&&rE(n),e===Ha&&oE(n),lR(n,t)&&((e,t)=>{0===WI.size&&"undefined"!=typeof document&&(document.addEventListener("pointerdown",tE,{passive:!0}),document.addEventListener("keydown",nE,{passive:!0}),document.addEventListener("input",sE,{capture:!0,passive:!0})),WI.set(e,t)})(n,{containerName:t.containerName??""})):e===Ma&&(aE(n)&&rE(n),oE(n))},dR=(e,t)=>{if(e!==Ma||!t.includes(Gs.MODAL))return;const n=ta(t),s=`${n}/`;for(const e of KI)(e===n||e.startsWith(s))&&lE(e)},pR=(e,t,n)=>{e!==Aa?e!==Or?iR.includes(e)&&iE(n):(e=>{iE(e),KI.add(e)})(n):t.autosave||iE(n)},gR=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t&&"string"==typeof t.type&&cR.has(t.type)&&("object"==typeof(n=t.payload)&&null!==n)){const{type:e,payload:n}=t,s=((e,t)=>e===Na?t.saveActionPayload?.containerItemID:e===Ta?t.saveContainerItemID??t.context:t.containerItemID??t.context)(e,n);s&&(dR(e,s),uR(e,n,s),aE(s)&&(((e,t)=>{if(t.context)e===ra?(dp(t.context,null),cE(t.context)):e!==Er||t?.isDefault||t?.skipDirtyValidation||cE(t.context)})(e,n),pR(e,n,s)))}var n;e(t)},hR=(()=>{const e=new Tg;let t=null,n=null;const s=s=>(n=s,t=new Rg(e.asObservable(),s.getState()),n=>a=>{const r=n(a);var o;return t?.next(s.getState()),"object"==typeof(o=a)&&null!==o&&"type"in o&&"string"==typeof o.type&&e.next(a),r});return s.run=s=>{if(!t||!n)throw new Error("Epic middleware must be added to the store before calling run().");return s(e.asObservable(),t).subscribe((e=>{n?.dispatch(e)}))},s})(),fR=e=>{if(null!==nC())return void IC();const t=[OE.propertyChangeMiddleware,qO,QO,nR,hR,oR,gR,tR,XO],n=IN({reducer:iT(e),middleware:e=>e({serializableCheck:!1,thunk:!1}).concat(t),enhancers:e=>e().prepend(SN).concat(SN)});hR.run(HO),tC(n)},mR=["ar","arc","ckb","dv","fa","ha","he","khw","ks","ps","ur","yi"],IR=e=>mR.includes(e.split("-")[0])?"rtl":"ltr";const ER=async function(e){if(!e)return;const t=Gy.getLocale();Gy.setLocale(e);const n=Gy.getLocale();if(n&&n!==t){if(kS(["lang"]),"undefined"!=typeof window){const e=new URL(window.location.href);e.searchParams.set("lang",n),window.history.replaceState(window.history.state,"",e.toString())}Gy.isInfinityRuntime()&&await $y.loadLocaleBundle([n]),await Hy(n),"undefined"!=typeof document&&(document.documentElement.lang=n,document.documentElement.dir=IR(n)),sC({type:Cr,payload:{locale:n}}),Uu.publish(Gs.PUB_SUB_EVENTS.EVENT_LOCALE_CHANGED,{locale:n,previousLocale:t})}};class yR{static EDIT_OPEN="edit_open";static EDIT_CLOSE="edit_close";static VIEW_OPEN="view_open";static VIEW_CLOSE="view_close";static caseCollabSubIds={};static init(e){e&&(this.collabConfig=e)}static dispatchCollaboratorAction=(e,t,n,s,a)=>{sC({type:"LIST_ACTION",payload:{instruction:e,context:t,referenceList:s,listIndex:n,content:a,skipDirtyValidation:!0}})};static handleCaseCollaboratorsUpdate(e,t){const n=t?.message??{},[s,a]=Object.entries(n)[0];if(s===Gy.getOperatorIdentifier())return;const r={ID:s,state:a},o=iC(Gs.CASE_INFO.CASE_INFO_COLLABORATORS,"",e)||[],i=o.findIndex((e=>e.ID===s));if(-1!==i)"closed"===a?this.dispatchCollaboratorAction("DELETE",e,i,Gs.CASE_INFO.CASE_INFO_COLLABORATORS,null):this.dispatchCollaboratorAction("REPLACE",e,null,`${Gs.CASE_INFO.CASE_INFO_COLLABORATORS}[${i}]`,r);else{if("closed"===a)return;this.dispatchCollaboratorAction("INSERT",e,o.length,Gs.CASE_INFO.CASE_INFO_COLLABORATORS,r)}}static subscribeToCollaborators(e,t){const n=Ah.subscribe({matcher:"CASE_COLLABORATOR",criteria:{caseId:e}},(e=>this.handleCaseCollaboratorsUpdate(t,e)));this.caseCollabSubIds[e]=n}static unsubscribeToCollaborators(e){Ah.unsubscribe(this.caseCollabSubIds[e]),delete this.caseCollabSubIds[e]}static publishCaseEvent(e,t){Ah.publishMessage({filter:{matcher:"CASE_COLLABORATOR",criteria:{caseId:t}},message:e})}static subscribeToEvent(e,t,n){let s=null;if(e===Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN||e===Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE?s=e=>this.publishCaseEvent(t,e):e===Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?s=e=>{const{caseId:t,context:n}=e;this.caseCollabSubIds[t]||this.subscribeToCollaborators(t,n)}:e===Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD&&(s=e=>{const{caseId:t}=e;this.caseCollabSubIds[t]&&this.unsubscribeToCollaborators(t)}),!s)throw new Error(`Unhandled eventKey: ${e}`);Uu.subscribe(e,s,n)}static unsubscribeFromEvent(e,t){Uu.unsubscribe(e,t)}static subscribeToCaseEvents(){yR.collabConfig?.appEnabled&&yR.collabConfig?.portalEnabled&&(this.subscribeToEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,this.VIEW_OPEN,"case_view_open"),this.subscribeToEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,this.VIEW_CLOSE,"case_view_close"),this.subscribeToEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,this.EDIT_OPEN,"case_edit_open"),this.subscribeToEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,this.EDIT_CLOSE,"case_edit_close"))}static unsubscribeToCaseEvents(){yR.collabConfig?.appEnabled&&yR.collabConfig?.portalEnabled&&(this.unsubscribeFromEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_view_open"),this.unsubscribeFromEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_view_close"),this.unsubscribeFromEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,"case_edit_open"),this.unsubscribeFromEvent(Gs.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,"case_edit_close"))}}const AR=yR;const CR=new class{#C(e,t,n,s,a){let r=!1;return e.IncludeInURL&&void 0!==t&&(s[e.Key]=t,"portal"===e.Key&&t!==n&&(r=!0)),Array.isArray(e.IncludeInHeaders)&&void 0!==t&&e.IncludeInHeaders.forEach((n=>{a[n.Value]||(a[n.Value]=[]),a[n.Value].push(`${e.Key}=${t}`)})),r}#S(e,t,n){const s={},a={};let r=!1;return Array.isArray(e)&&e.forEach((e=>{const o=t[e.Key];this.#C(e,o,n,s,a)&&(r=!0)})),{urlParams:s,headerMap:a,isPortalChanged:r}}#_(e){const t=Hp.getComponentCache("lastActionID");return Eh.truncateNamespace(e)===Eh.truncateNamespace("string"==typeof t?t:(t??"").toString())}#N({message:e}){const{RequestContext:t,ActionName:n}=e;if(!this.#_(n))return;const s=JSON.parse(t),a=Gy.environmentInfoObject?.requestContext,r=new URL(window.location.href).searchParams.get("portal"),{urlParams:o,headerMap:i,isPortalChanged:c}=this.#S(a,s,r);Hp.setURLParams(o),Object.entries(i).forEach((([e,t])=>{Zu.registerHeader(e,t.join("; "))})),Hp.setComponentCache("lastActionID",""),c&&globalThis.location.reload()}subscribeToGlobalEvents(){const e=AC.generateUniqueID(),t={matcher:"SWITCH_REQUEST_CONTEXT",criteria:{UserID:Gy.getOperatorIdentifier()||""}};Ah.subscribe(t,this.#N.bind(this),void 0,e)}},SR={publishConstellationLoadedEvent:()=>{Uu.publish(Gs.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const _R=new class{activateContainerItemOnSwitch(e){const t=`${Gs.APP.APP}/${Gs.PRIMARY}`,n={target:t,containerItemID:GE(t,e)};Ff({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${Gs.APP.APP}/${Gs.PRIMARY}`,n={target:t,containerItemID:GE(t,e)};Ff({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=Ff({meta:{type:"PreviewViewContainer",config:{name:Gs.PREVIEW}},options:{context:Gs.APP.APP,target:"root/hybrid_preview"}});n.getPConnect().getContainerManager().resetContainers({name:Gs.PRIMARY,context:Gs.APP.APP}),qE(Gs.APP.APP,Gs.PREVIEW)||n.getPConnect().getContainerManager().initializeContainers({type:"multiple",name:Gs.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){Ff({}).getPConnect().getContainerManager().resetContainers({name:Gs.PREVIEW,context:Gs.APP.APP})}isFormDirty(e){const t=`${Gs.APP.APP}/${Gs.PRIMARY}`,n=xy(t,e);return Hm.isStateModified(n)}getEventUtils(){return SR}getBroadcastUtils(){return CT}isTraditionalUICase(e){return rm(e)}};const NR=class{static openCase(e,t=$s.APP.APP,n={}){return n.renderInline=!0,n.pageName?(Gy.setDefaultCasePage(ks.getDefaultQualifiedName(n.pageName)),n.pageName=ks.getDefaultQualifiedName(n.pageName)):(Gy.setDefaultCasePage(ks.getDefaultQualifiedName(Gs.PY_DETAILS)),n.pageName=ks.getDefaultQualifiedName(Gs.PY_DETAILS)),n?.disableAssignmentHeader?Gy.disableAssignmentHeader(n.disableAssignmentHeader):Gy.disableAssignmentHeader(!1),mh.openCase(e,t,Gs.PRIMARY,n)}static createCase(e,t=$s.APP.APP,n={}){return n.renderInline=!0,n.pageName?(Gy.setDefaultCasePage(ks.getDefaultQualifiedName(n.pageName)),n.pageName=ks.getDefaultQualifiedName(n.pageName)):(Gy.setDefaultCasePage(ks.getDefaultQualifiedName(Gs.PY_DETAILS)),n.pageName=ks.getDefaultQualifiedName(Gs.PY_DETAILS)),n?.disableAssignmentHeader?Gy.disableAssignmentHeader(n.disableAssignmentHeader):Gy.disableAssignmentHeader(!1),mh.createCase(e,t,Gs.PRIMARY,n)}static getNextWork(e=$s.APP.APP,t={}){return t.renderInline=!0,t.pageName?(Gy.setDefaultCasePage(ks.getDefaultQualifiedName(t.pageName)),t.pageName=ks.getDefaultQualifiedName(t.pageName)):(Gy.setDefaultCasePage(ks.getDefaultQualifiedName(Gs.PY_DETAILS)),t.pageName=ks.getDefaultQualifiedName(Gs.PY_DETAILS)),t?.disableAssignmentHeader?Gy.disableAssignmentHeader(t.disableAssignmentHeader):Gy.disableAssignmentHeader(!1),mh.getNextWork(e,Gs.PRIMARY,t)}static openAssignment(e,t=$s.APP.APP,n={}){return n.renderInline=!0,n.pageName?(Gy.setDefaultCasePage(ks.getDefaultQualifiedName(n.pageName)),n.pageName=ks.getDefaultQualifiedName(n.pageName)):(Gy.setDefaultCasePage(ks.getDefaultQualifiedName(Gs.PY_DETAILS)),n.pageName=ks.getDefaultQualifiedName(Gs.PY_DETAILS)),n?.disableAssignmentHeader?Gy.disableAssignmentHeader(n.disableAssignmentHeader):Gy.disableAssignmentHeader(!1),mh.openAssignment(e,t,Gs.PRIMARY,n)}static openPage(e,t,n=$s.APP.APP,s={}){const a=ia;s?.defaultCasePage?(Gy.setDefaultCasePage(ks.getDefaultQualifiedName(s.defaultCasePage)),s.defaultCasePage=ks.getDefaultQualifiedName(s.defaultCasePage)):Gy.setDefaultCasePage(ks.getDefaultQualifiedName(Gs.PY_DETAILS)),s?.disableAssignmentHeader?Gy.disableAssignmentHeader(s.disableAssignmentHeader):Gy.disableAssignmentHeader(!1);const r={viewName:e,className:t,acTargetName:Gs.PRIMARY,actionMgrID:zp.getNextActionMgrId(),context:n},{promise:o}=zp.actionManagerPromise(a,r.actionMgrID);return sC({type:a,payload:{...r}}),o}static getCurrentContextAPI(e,t=$s.APP.APP){return Ff({meta:{config:{}},options:{context:t,pageReference:e,containerName:Gs.PRIMARY}}).getPConnect()}};function TR(e){if(!e||"*"===e||"null"===e)return"";try{const t=new URL(e);return"https:"!==t.protocol&&"http:"!==t.protocol||"null"===t.origin?"":t.origin}catch{return""}}function DR(e){if(e.contentRect)return{height:e.contentRect.height};const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize;return"blockSize"in t?{height:t.blockSize}:"height"in t&&"number"==typeof t.height?{height:t.height}:{height:0}}const PR=new class{gadgetName="";resize=!1;parentOrigin="";boundOnMessage=this.onMessage.bind(this);init(e){if("undefined"==typeof window)return;const{resizing:t,parentOrigin:n}=e;this.gadgetName=window.name,this.resize="stretch"===t,this.parentOrigin="",n?this.parentOrigin=TR(n):document.referrer?this.parentOrigin=TR(document.referrer):this.parentOrigin=TR(function(){try{const{ancestorOrigins:e}=window.location;if(e&&e.length>0)return e[0]??""}catch{}return""}());const s=document.getElementsByTagName("app-root")[0];s.classList.add("mashup"),window.parent!==window&&this.resize&&this._registerResizeObserver(s)}send(e){const{action:t,message:n}=e,s=JSON.stringify({gadgetName:this.gadgetName,action:t,message:n});window.parent.postMessage(s,this.parentOrigin||window.location.origin)}_registerResizeObserver(e){new ResizeObserver((e=>{for(const t of e){const e=DR(t);this.send({action:"resize",message:e})}})).observe(e)}_updateUrl(e){window.history.pushState({},"home",e),PCore.configureForBrowserBookmark({semanticURL:"",context:Gs.APP.ROOT,acName:"primary"})}onMessage(e){if(!this.parentOrigin||e.origin!==this.parentOrigin)return!1;if("string"!=typeof e.data)return!1;let t;try{t=JSON.parse(e.data)}catch{return!1}return"UpdateUrl"===t.action&&this._updateUrl(t.message.url),!0}getMessageHandler(){return this.boundOnMessage}};"undefined"!=typeof window&&window.addEventListener("message",PR.getMessageHandler(),!1);const OR={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},RR={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary",contextName:"app"},children:[]}]},bR="portal-less-styles";const vR=new class{createC11nEnv=e=>Ff(e);getContextUtils=()=>o;getRoutingManager=()=>i;getComponentsRegistry=()=>Do;getStateManager=()=>f;getActionCreators=()=>m;getStreamObservable=()=>u;getActionProcessor=()=>PC;getActionHandler=()=>DC;renderApp=(e,t)=>{const n={context:Gs.APP.APP},s={...AC.getIn(e,Gs.ROOT),options:n};fR(e),Ip(e,n,!0);const a=this.createC11nEnv({meta:s,isRoot:!0});Uu.publish($s.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:a,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const{data:s,uiResources:a={}}=e,{root:r}=a,o=AC.getIn(a,Gs.CONTEXT_DATA),i=Cf(e);await Sm(i,{},{},!1,!0);const c={...s,[Gs.CONTEXT_DATA]:o};hy(r,t,c,n)};fetchEndPointResource=(e,t,n)=>{ud(e,{method:"GET"},Gs.APP.ROOT).then((e=>{200===e.status&&this.updateStoreWithUiRoot(e.data,t,n)}))};loadComponent=async(e,t,n)=>{await Vp(n);const s=this.createC11nEnv({meta:e,isRoot:!0});nC()||fR({}),Uu.publish($s.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:s,domContainerID:t})};setStaticServerUrl=(e,t,n)=>{Lp.initServer(e,t,n)};loadView=async(e,t,n=[])=>{cn();const s=Cf(e),a=AC.getIn(s,Gs.VIEWS),r=AC.getIn(s,Gs.NAVIGATIONS),o=AC.getIn(s,Gs.COMPONENTS)||[];o.push(...n);const i=AC.getIn(s,Gs.STATIC_SERVER_URL),c=AC.getIn(s,Gs.APPLICATION_DATA);a&&DA(a),r&&bA(r),(e=>{e&&(IS=e.pyLabel)})(c),i&&Lp.initServer(i),await Vp(o,i),this.renderApp(s,t)};initAppShell=(e,t,n)=>{VS(e),Kp.buildActionTargetMap(t),cn(n)};initRoutingTable=(e,t)=>{VS(e,!0),cn(t)};setAppAlias=e=>{Lp.setAppAlias(e)};getHomeRestApi=e=>{const t=un(),{restApi:n}=SS("home",{portalName:e});return`${t}${n}`};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(US()&&!t){const t=Fy(),s=By.processUrl(t,!0),a=By._getMatchedRouteInRoutingTable(s)||"",r=By.getRoutingInfo(),o=By.processUrl(t,!1).split("/"),i=o[o.length-1],c=r?.routes?.[a]?.payload?.caseID?.replace("{workID}",i).replace("{id}",i);n=By.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=By.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return un()+n};loadRootComponent=async(e,t,n=[],s,a,r)=>{const{config:o}=t||{},i=o?.name;if(nC()||fR({}),r){const e=`${Gs.APP.ROOT}/${i}`;Dy(e),Ty().deleteContainerItem(e)}(Ty().getContainerItems()||[]).length>1&&!i?.startsWith("hybrid_")&&"authoring-preview"!==i&&IC(),sC(vC({data:{},context:Gs.APP.ROOT}));const c=this.createC11nEnv({meta:t,options:{context:Gs.APP.ROOT,pageReference:"",target:`${Gs.APP.ROOT}/${i}`}}),l=c.getPConnect(),u=`${l.getContextName()}/${l.getContainerName()}`;YE(u)||"noPortal"===o?.renderingMode||l.getContainerManager().initializeContainers({type:"single"});const d=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference","URL",...n];await Vp(d),Uu.publish($s.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:c,domContainerID:e,componentName:"RootContainer",portalTarget:s,styleSheetTarget:a})};loadViewByName=(e,t,n,s)=>{let a=this.getViewRestApi(e,n);a===un()&&(a=this.getHomeRestApi(t)),this.fetchEndPointResource(a,s)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{FS(e)};checkIfSemanticURL=()=>US();onPCoreReady=e=>{Uu.subscribe($s.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{Uu.subscribe($s.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{Qd.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{pn(e)};setFetchDefaultHeaders=e=>{fd(e)};setFetchAuthInfo=e=>{md(e)};getCaseApi=()=>mh;getMashupApi=()=>NR;enableAppRouting=e=>{yS(e)};initStore=()=>fR({});getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`;return fetch(`${e}/api/application/v2/data_views/D_pxBootstrapConfig`,{method:"GET",headers:new Headers({Authorization:n})}).then((e=>e.json()))};getBootstrapConfigViaSB=async(e,t,n)=>{const s=n?`?dataViewParameters=${encodeURIComponent(JSON.stringify({themeID:n}))}`:"";return ud(`${e}/api/application/v2/data_views/D_pxBootstrapConfig${s}`,{method:"GET",headers:new Headers(t)}).then((e=>{if(e.data)return e.data;throw Error("D_pxBootstrapConfig load failed.",{cause:e.status})}))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=Ff({meta:OR,options:{context:"root",pageReference:"",target:"root"}});return n.getPConnect().getContainerManager().initializeContainers({type:t,name:"primary",context:"app"}),{props:{getPConnect:n.getPConnect}}};loadMashup=async(e,t=!0)=>{if(t){const t=document.querySelector(e)??document.getElementsByTagName(e)[0],n=t?.parentNode;if(n&&!document.getElementById(bR)){const e=document.createElement("style");e.id=bR,e.textContent="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",n.appendChild(e)}}await this.loadRootComponent(e,OR,[Gs.LOAD_VIEW_STRING,"ViewContainer"]),globalThis.parent!==globalThis&&PR.init({resizing:"stretch"})};bootstrapWithAuthHeader=async(e,t,n=[],s,a)=>{const{customRendering:r=!1,onPCoreReadyCallback:o,staticContentServerUrl:i,dynamicSetCookie:c=!1,renderingMode:l,locale:u,envType:d,themeID:p,customCookies:g,enableRouting:h}=e;let{restServerUrl:f,authInfo:m,authorizationHeader:I,appAlias:E,theme:y={}}=e,A=e.additionalHeaders?{...e.additionalHeaders}:{},C=null;const S=!I&&m&&!m.authType;if(m||(e.authInfo={},m=e.authInfo),(I&&0===Object.keys(m).length||g)&&(S||(m.authType="custom"),m.customCookies=g),!I&&m.tokenInfo?.access_token){const{tokenInfo:e}=m;I=`${e.token_type} ${e.access_token}`}if(m.tokenInfo?.csrf&&(A={...A,pzCTkn:m.tokenInfo.csrf}),E&&-1===E.indexOf("/")&&(E=`app/${E}`),"LAUNCHPAD"===d){A={...A,"X-Constellation-App":"Pega"},f=f.endsWith("/dx")?f:`${f}/dx`;const e=p?`?themeID=${p}`:"";globalThis.PCore&&(C=await this.getLPConfig(`${f}/api/application/v2/environmentInfo${e}`,I,A,g)),0===Object.keys(y).length&&C?.theme?.definition&&(y=JSON.parse(C.theme.definition).Theme)}else C=S?await this.preInitBootstrapConfig(e,E,A,p):await this.getBootstrapConfigExtended(E?`${f}/${E}`:`${f}`,I,A,p,g,u);const _=C?.pyConfigJSON?JSON.parse(C.pyConfigJSON):{...C};"LAUNCHPAD"===d&&await this.applyEnvironmentInfoResponse(_),_.restServerConfig=f,_.dynamicSemanticUrl=!1,_.dynamicSetCookie=c,_.enableRouting=!1,_.serviceConfig?Object.assign(_.serviceConfig,{contextPath:"",appAlias:E}):_.serviceConfig={contextPath:"",appAlias:E,staticContentServer:i,appStaticContentServer:"no-appstatic"},_.additionalHeaders={Authorization:I,...A},_.envType=d,_.dynamicLoadComponents=!r,_.dynamicSemanticUrl=!r,_.noHistory=!0,_.theme=y??{};const N=p&&_?.themeObject?_.themeObject:null;_.theme=N||y,_.renderingMode=l??_.renderingMode,_.locale=u||_.locale,e.semanticUrlArgs&&(_.semanticUrlArgs=e.semanticUrlArgs);const T=i||_.serviceConfig.staticContentServer;if(_.isSdk?(_.enableRouting=h,_.dynamicSemanticUrl=_.enableRouting,Lp.initServer(i,"no-appstatic")):(_.serviceConfig.staticContentServer=T,_.serviceConfig.appStaticContentServer=_.serviceConfig.appStaticContentServer||"no-appstatic",Lp.initServer(T,T)),"EMBED"===_.renderingMode&&m?.authentication_service&&"pega"!==m.authentication_service&&(_.routingInfo||(_.routingInfo={}),_.routingInfo.authServiceAlias=m.authentication_service),await UR.initCoreConfig(_),o&&Uu.subscribe($s.PUB_SUB_EVENTS.EVENT_RENDER_APP,o,"renderAppCallback"),"LAUNCHPAD"===_.envType&&"EMBED"===_.renderingMode&&Gy.setIsWebEmbed(!0),m&&["OAuth2.0","custom"].includes(m?.authType)&&this.setFetchAuthInfo(m),!r){const e=Gy.environmentInfoObject?.pyInfinityStaticService;let r=null;if(e){const e=await Sh.getDataAsync("D_pxGetComponentLibraryListAndMap","",{});Array.isArray(e.data)&&e.data.length>0&&(r=e.data)}const o=new Promise((async(e,t)=>{try{const t=async()=>{await this.importReactRoot(),e(!0)};Uu.subscribe("component-map-loaded",t),"ReactRoot"in Do.getLazyMap()&&e(!0)}catch(e){t(e)}}));await o,UR.initCoreContainers(),await this.loadRootContainerWithHybrid(t,n,s,a),r&&await Promise.all(r.map((({pyComponentMap:e,pxUpdateDateTime:t})=>Lp.importCustomComponentMap(e,t))))}};loadRootContainerWithHybrid=(e,t=[],n,s)=>(t.push(Gs.CONTAINER_TYPE?.HYBRID||"HybridViewContainer",Gs.LOAD_VIEW_STRING),this.loadRootComponent(e,RR,t,n,s));getBootstrapConfigExtended=async(e,t,n,s,a,r)=>{const o={};s&&(o.themeID=s),r&&(o.locale=r);const i=`${e}/api/application/v2/data_views/D_pxBootstrapConfig${s||r?`?dataViewParameters=${encodeURIComponent(JSON.stringify(o))}`:""}`,c=t?{Authorization:t,...n}:n;return fetch(i,{method:"GET",headers:new Headers(c),credentials:t&&!a?"same-origin":"include"}).then((e=>{if(e.ok)return e.json();throw Error("D_pxBootstrapConfig load failed.",{cause:e.status})}))};getLPConfig=async(e,t,n,s)=>{const a=new Headers({...n,...t&&{Authorization:t}}),r=await fetch(e,{method:"GET",headers:a,credentials:t&&!s?"same-origin":"include"});if(!r.ok)throw new Error("environmentInfo load failed.",{cause:r.status});return r.json()};applyEnvironmentInfoResponse=async e=>{const{environmentInfo:t,pyCaseTypeList:n,theme:s,keyMapping:a}=e,{pxApplication:r,features:o,pxLocale:i}=t,c={simpleTable:{pageInstructionUUIDGeneration:!1},...o},l=Intl.DateTimeFormat().resolvedOptions().timeZone.toUpperCase(),u="ETC/UNKNOWN"===l?"America/New_York":l;e.environmentInfo={...t,pxApplication:{...r},features:c,pyCaseTypeList:n,pxLocale:{...i,pyTimeZone:u}},e.timezone=u;const d=Object.keys(e.environmentInfo);return{isEnvInfoValid:["pxOperator","pxLocale","pxApplication"].every((e=>d.includes(e))),theme:s,keyMapping:a,features:c}};importReactRoot=async()=>{const e=[];return Do.getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};preInitBootstrapConfig=async(e,t,n,s)=>{const{restServerUrl:a,customRendering:r=!1,staticContentServerUrl:o,dynamicSetCookie:i=!1,authInfo:c,renderingMode:l,locale:u,timezone:d="America/New_York",envType:p,theme:g={}}=e,h=s??null,f={restServerUrl:a,restServerConfig:a,dynamicSetCookie:i,enableRouting:!1,serviceConfig:{contextPath:"",appAlias:t,staticContentServer:o,appStaticContentServer:"no-appstatic"},additionalHeaders:{...n},envType:p,dynamicLoadComponents:!r,dynamicSemanticUrl:!r,noHistory:!0,themeIDObj:h,theme:h||g,renderingMode:l,locale:u,timezone:d,tokens:{C11NB2S:""}};return Lp.initServer(o,"no-appstatic"),await UR.init(f),c&&["OAuth2.0","custom"].includes(c?.authType)&&this.setFetchAuthInfo(c),this.getBootstrapConfigViaSB(t?`${a}/${t}`:`${a}`,n,s)}};const xR=class{constructor(e){this.appAlias=e.appAlias,this.appAliasWithoutServlet=e.appAliasWithoutServlet,this.googleMapKey=e.googleMapKey,this.staticContentServer=e.staticContentServer,this.appStaticContentServer=e.appStaticContentServer??null,this.contextPath=e.contextPath,this.messagingService=e.messagingService??null,this.reAuthUrl=e.reAuthUrl??null}};const wR=class{constructor(e){this.routingInfo=e.routingInfo,this.actionModel=e.actionModel,this.additionalHeaders=e.additionalHeaders,this.tokens=e.tokens,this.semanticUrl=e.semanticUrl,this.queryParams=e.queryParams,this.noPortal=e.noPortal,this.portalTemplate=e.portalTemplate,this.timezone=e.timezone,this.noHistory=e.noHistory,this.viewName=e.viewName,this.theme=e.theme,this.fieldDefaults=e.fieldDefaults,this.restServerConfig=e.restServerConfig,this.dynamicLoadComponents=e.dynamicLoadComponents??!0,this.dynamicSemanticUrl=e.dynamicSemanticUrl??!0,this.enableRouting=e.enableRouting??!0,this.locale=e.locale,this.environmentInfo=e.environmentInfo,this.renderingMode=e.renderingMode??"FULL_PORTAL",this.remoteCaseMapping=e.remoteCaseMapping??{},this.envType=e.envType,this.serviceConfig=new xR(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false",this.enablePriorityAndUrgencyImprovements=e.enablePriorityAndUrgencyImprovements??!1,this.storePercentageAsDecimal=e.storeC11nPercentageAsDecimal??!1,this.collab=e.collab,this.requestContext=e.requestContext,this.pzencv1zzz=e.pzencv1zzz}},MR="@P .viewConfig";let LR=0;const UR=new class{async init(e){const t=new wR(e);yS(t.enableRouting),fR({}),Qd.updateFieldDefaults(t.fieldDefaults),Qd.setFieldDefault("Percentage","storePercentageAsDecimal",t.storePercentageAsDecimal),this.#T(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl});const{appAliasWithoutServlet:n,appAlias:s,googleMapKey:a,staticContentServer:r,appStaticContentServer:o}=t.serviceConfig;Lp.setAppAlias(n||s),pn(a),Lp.initServer(r,o,t.tokens.C11NB2S),qs.setRemoteCaseMapping(t.remoteCaseMapping),AR.init(t.collab),AR.subscribeToCaseEvents(),Eh.subscribeToCaseEvents(),Ah.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),t.initBroadcast&&_R.getBroadcastUtils().init(),Zu.setDefaultHeaders(t.additionalHeaders),Zu.setRequestContext(t.requestContext),"Infinity"===t.envType&&await this.loadEnvironmentInfoFromDataPage(t);const i={...t.environmentInfo,encCSRFToken:t.pzencv1zzz,renderingMode:t.renderingMode,...t.portalTemplate?{pyPortalTemplate:t.portalTemplate}:{}};if(i.pyCaseTypeList?.forEach((e=>{const t=e.pyWorkTypeImplementationClassName;t&&(e.localeReference=If(ff,t))})),i.features?.isNamespaceEnabled&&(t.additionalHeaders.Prefer="namespaced",Zu.setDefaultHeaders(t.additionalHeaders)),t.theme){const e=t.theme,n=e.light,s=e.dark;void 0!==n&&void 0!==s?(this.#D(n),this.#D(s,{type:"dark"})):Gy.setTheme(e)}Gy.setCookieComplianceMethod(t.cookieComplianceMethod),Gy.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),Gy.setEnablePriorityAndUrgencyImprovements(t.enablePriorityAndUrgencyImprovements),Gy.setEnvironmentInfo(i);const c=new URLSearchParams(window.location.search).get("lang")||t.locale||navigator.language||"en-US";Gy.setLocale(c),document.documentElement.lang=c,document.documentElement.dir=IR(c),Yy().setTimezone(t.timezone),Hp.init(),"Infinity"!==t.envType&&CR.subscribeToGlobalEvents(),t.initBroadcast&&_R.getBroadcastUtils().init(),await Hy()}getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`,s=`${e}/api/application/v2/data_views/${ks.getDefaultQualifiedName("D_pxBootstrapConfig")}`;return(await fetch(s,{method:"GET",headers:new Headers({Authorization:n})})).json()};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=Ff({meta:{type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},options:{context:"root",pageReference:"",target:"root"}});return n.getPConnect().getContainerManager().initializeContainers({type:t,name:"primary",context:"app"}),{props:{getPConnect:n.getPConnect}}};importReactRoot=async()=>{const e=[];return vR.getComponentsRegistry().getComponent("ReactRoot")?.modules?.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{bp(e)}catch(e){return void console.error("Design system load blocked: untrusted or malformed URL",e)}try{await((e,t="true")=>new Promise(((n,s)=>{if("undefined"==typeof document)return void s(new Error("document is not available in this environment"));const a=document.createElement("script");a.type="text/javascript",a.src=e,a.async="true"===t,a.onload=()=>n(void 0),a.onerror=()=>s(new Error("Failed to load resource from Design System")),document.body.appendChild(a)})))(`${e}component/project/${t}/designsystems/${n}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}};buildSemanticUrl=(e,t,n,s,a)=>{const r=new URLSearchParams(t),o="true"===n&&!!e,i=new URLSearchParams(window.location.search).get("lang");i&&!r.has("lang")&&r.set("lang",i);let c=null,l=null,u=null;if(e){const t=(e.startsWith("/")?e.substring(1):e).split("/");c=t[0]||null,l=t[1]||null,"assignments"===t[2]&&t[3]&&(u=t[3])}const d=[s];c&&d.push(c),l&&d.push(l),u&&d.push("assignments",u),o&&(r.has("noPortal")||r.append("noPortal","true"),l&&a&&r.append("view",a));const p=r.toString();return d.join("/")+(p?`?${p}`:"")};initCoreConfig=async e=>{const{routingInfo:t,serviceConfig:n,semanticUrl:s,queryParams:a,noPortal:r,noHistory:o,viewName:i,theme:c,restServerConfig:l,dynamicLoadComponents:u=!0,dynamicSemanticUrl:d=!0,renderingMode:p="FULL_PORTAL",envType:g,extras:h}=e,{appAlias:f,contextPath:m}=n,I=window.location,E=I.origin;let y=l??E;const A={};if(m&&(y+=m),f&&"LAUNCHPAD"!==g&&(y+=`/${f}`),e.restServerConfig=y,this.#P(),!0===d){const e=this.buildSemanticUrl(s,a,r,y,i);!o&&e&&"undefined"!=typeof window&&window.history.replaceState({},"home",e)}else if("HYBRID"!==p){const e=I.href,t=e.indexOf("?");t>0&&"undefined"!=typeof window&&window.history.pushState({},"home",e.substring(0,t)),A.dynamicSemanticUrl=!1}else console.log(`renderingMode :${p}`);!0!==u&&(A.dynamicLoadComponents=!1);let C=null;if(f){const e=f.indexOf("/app/");C=e>=0?f.substring(e+1):f}if((!1===A.dynamicSemanticUrl||!1===A.dynamicLoadComponents)&&PCore.setBehaviorOverrides(A),e.appAlias=C,c)if("object"==typeof c)e.theme=c;else try{e.theme=JSON.parse(c)}catch{e.theme={}}let S=I?`${I.protocol}//${I.host}`:t.domain;if("EMBED"===p)try{S=new URL(e.restServerConfig).origin}catch{}const _={...t,domain:S,searchParams:I?I.search:"",embedQueryParams:e.semanticUrlArgs};e.routingInfo=_,e.initBroadcast="true"===Gy.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),h?.cspNonce&&(window.__webpack_nonce__=h.cspNonce),Gy.setCaseLabelFirstInTitle(e.extras?.useDefaultBrowserTabTitle??!0),await this.init(e)};launchViewByName=async(e,t,n,s,a,r,o,i,c=[])=>{LR+=1;const l=i||`mashup${LR}`,u={type:"RootContainer",config:{viewConfig:MR,renderingMode:"view",name:l}};await vR.loadRootComponent(e,u,a,r,o),await this.loadCustomComponentLibrariesIfEnabled(c),vR.loadViewByName(t,n,s,l)};launchView=(e,t,n=[],s,a,r,o)=>{let i;LR+=1,i="hybrid"===o?`hybrid_${LR}`:o||`mashup${LR}`;const c={type:"RootContainer",config:{viewConfig:MR,renderingMode:"portal",name:i}};o===Gs.HYBRID&&Bh.setRuntimeParam(Gs.HYRBID_ROOT_CONTAINERNAME,i),Bh.setRuntimeParams(s),vR.loadRootComponent(e,c,n,a,r).then((()=>vR.updateStoreWithUiRoot(t,i,!1)))};launchPortal=async(e,t,n=`portal${LR+=1}`,s=[],a=[])=>{const r="LoadingComponent",o={type:"RootContainer",config:{viewConfig:MR,renderingMode:"portal",skeleton:r,name:n}},i=[...s,r];Gy.isPortalLoaded=!0;try{return await vR.loadRootComponent(e,o,i),await this.loadCustomComponentLibrariesIfEnabled(a),vR.loadPortalView(t,n)}catch(e){throw console.error(`Failed to launch portal ${t}:`,e),e}};launchMashup=(e,t=!0,n=[])=>{const s={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfoAnnotation:"@ROUTING_INFO",name:"primary"}}]};if(t&&!document.getElementById("portal-less-styles")){const t=document.getElementsByTagName(e),n=t[0]?.parentNode;if(n){const e=document.createElement("style");e.id="portal-less-styles",e.textContent="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",n.appendChild(e)}}if((async()=>{await vR.loadRootComponent(e,s,[Gs.LOAD_VIEW_STRING,"ViewContainer"]),await this.loadCustomComponentLibrariesIfEnabled(n)})(),window.parent!==window){const e=Lp.getStaticServerUrl();a(754)(`${e}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))}};loadEnvironmentInfoFromDataPage=async e=>{if("wss"===e.portalType&&(e.environmentInfo={...e.environmentInfo,features:{case:{createInModal:!1}}}),e.environmentInfo?.pyDataPages&&Array.isArray(e.environmentInfo.pyDataPages)){const t=e.environmentInfo.pyDataPages;setTimeout((()=>{this.loadDataPagesIntoEnvironmentInfo(t).catch((e=>{console.error("Error loading data pages into environment info:",e)}))}),Gs.PRIORITY.TRIVIAL)}};loadDataPagesIntoEnvironmentInfo=async e=>{if(!e?.length)return;const t=Gy.environmentInfoObject;if(!t)return;const n=e.filter((({pyName:e,pyPath:t})=>!(!e||!t)||(console.warn("Invalid data page configuration: missing pyName or pyPath"),!1)));if(0===n.length)return;const s=await Promise.allSettled(n.map((async({pyName:e,pyPath:t})=>{try{return{pyPath:t,response:await Sh.getPageDataAsync(e,"",{})}}catch(t){return console.error(`Failed to load data page ${e}:`,t),null}}))),a=s.length;let r=!1;for(let e=0;e<a;e+=1){const n=s[e];if("fulfilled"===n.status&&n.value){const{pyPath:e,response:s}=n.value;this.setNestedProperty(t,e,s),r=!0}}r&&Gy.setEnvironmentInfo(t)};#O(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}setNestedProperty(e,t,n){const s=t.startsWith(".")?t.slice(1):t;if(!s)return void("object"==typeof n&&null!==n&&Object.assign(e,n));const a=s.split("."),r=a.length;let o=e;for(let e=0;e<r-1;e+=1){const t=a[e],n=o[t];if(this.#O(n))o=n;else{const e={};o[t]=e,o=e}}o[a[r-1]]=n}start=async(e,t)=>{const{serviceConfig:{appStaticContentServer:n},ccV2LibId:s,environmentId:a,isAlternateDesignSystemEnabled:r,alternateDesignSystemName:o}=e;await this.initCoreConfig(e);const i=Gy.environmentInfoObject?.pyC11nDXCBDevURL,c="true"===r&&"other"!==o,l=async()=>{await this.importReactRoot();const e=[];i?e.push(Lp.importCustomComponentMap("")):s&&e.push(Lp.importCustomComponentMap(s)),c&&e.push(this.importDesignSystemComponentMap(n,a,o)),e.length&&await Promise.all(e),t?.()},u=vR.getComponentsRegistry();if("ReactRoot"in u.getLazyMap())return!0;return u.getComponent("ReactRoot")?(await l(),!0):new Promise((e=>{Uu.subscribeOnce("component-map-loaded",(async()=>{await l(),Uu.unsubscribe("component-map-loaded","component-map-loaded-id"),e(!0)}),"component-map-loaded-id")}))};registerForDebugInfo=e=>{if(Gy.setPreviewMode(),!e)return;const t=({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];n&&e.postMessage({appDebugID:n})};Uu.subscribe("fetchSuccess",t,"fetchSuccess"),Uu.subscribe("fetchFailure",t,"fetchFailure")};toggleTracerHeaders=e=>{e.addEventListener("message",(e=>{const t=e?.data?.enableTracer;t?Vu.enableTracer():Vu.disableTracer()}))};loadEnvironmentInfo=async e=>{const t="Android"===window.pms?.device.systemName;if(e.theme&&!t)try{const t=JSON.parse(e.theme.definition),n=t.Branding,s=t.Theme;Gy.setBrandingInfo(n),Gy.setTheme(s)}catch{Gy.setBrandingInfo({}),Gy.setTheme({})}if(e.darkTheme&&!t){const t={type:"dark"};try{const n=JSON.parse(e.darkTheme.definition);Gy.setBrandingInfo(n.Branding,t),Gy.setTheme(n.Theme,t)}catch{Gy.setBrandingInfo({},t),Gy.setTheme(void 0,t)}}e.keyMapping&&Gy.setKeyMapping(e.keyMapping),Gy.setCookieComplianceMethod(e.cookieComplianceMethod??"none")};async loadCustomComponentLibrariesIfEnabled(e){e?.length>0&&Gy.environmentInfoObject?.pyInfinityStaticService&&await this.loadCustomComponentLibraries(e)}async loadCustomComponentLibraries(e){const t=e.map((e=>this.importSingleCustomComponent(e)));await Promise.all(t)}importSingleCustomComponent(e){return"object"==typeof e&&"pyComponentMap"in e?Lp.importCustomComponentMap(e.pyComponentMap,e.pxUpdateDateTime):Lp.importCustomComponentMap(e)}#T(e,t,n){VS(e),Kp.buildActionTargetMap(t),cn(n)}#P(){document.querySelectorAll('head link[rel~="icon"], head link[rel~="apple-touch-icon"]').forEach((e=>{e.setAttribute("href",e.href)}))}#D(e,t){if(null===e)return;if("object"==typeof e)return void Gy.setTheme(e,t);let n;try{n=JSON.parse(e)}catch{return void Gy.setTheme("dark"===t?.type?void 0:{},t)}Gy.setTheme(n,t)}},FR={createViewRule:(e,t)=>{const{restApi:n,reqType:s}=_S("createViewRuleByID");return ud(n,{method:s,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:s}=_S("getViewRuleByID",{ID:e});return ud(n,{method:s},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:s,reqType:a}=_S("updateViewRuleByID",{ID:e});return ud(s,{method:a,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:s}=_S("deleteViewRuleByID",{ID:e});return ud(n,{method:s},t).then((e=>e.data))},getCalculatedFields:(e,t,n)=>{const{restApi:s,reqType:a}=_S("getCalculatedFieldsInViewByID",{caseID:e,viewID:t});return ud(s,{method:a,body:{calculations:{fields:n}}}).then((e=>e.data))}},VR={"Content-Type":"application/json"},jR={addCaseFollower:(e,t,n)=>{const s={caseID:e},a=JSON.stringify({users:t.map((e=>({ID:e})))});return Cp("addCaseFollower",{body:a,queryPayload:s,headers:VR},n)},deleteCaseFollower:(e,t,n)=>Cp("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>Cp("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},kR={addRelatedCases:(e,t,n)=>{const s={caseID:e},a=JSON.stringify({cases:t});return Cp("addRelatedCases",{body:a,queryPayload:s},n)},removeRelatedCase:(e,t,n)=>Cp("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>Cp("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},BR="operatorDetails",$R={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=_S(BR,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return Cp(BR,{queryPayload:t})}return t?Cp("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):Cp(BR,{body:{dataViewParameters:{ID:e}}})}},GR="postCustomFeedMessages",WR={"Content-Type":"application/json"};const HR=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,s,a,r,o)=>{const i=r.getLocalizationService();o||(this.mentions=[]);let c="";s&&Array.isArray(s)&&s?.length>0&&(s.forEach((e=>{e.on&&(c=`${c}${e.id},`)})),""===c&&(c="ClearFilters"));let l="";o&&(l=r.getValue("pulse.pageLastEntry"));const u={filterForContext:"pyDataFeed"===t?encodeURIComponent(e):e,feedID:t,feedClass:n,filterBy:c,pageSize:10,olderThan:l};for(let e=0;e<a.length;e+=1)a[e].cancel();const d=Np();return a.push(d),Cp("getFeedMessages",{queryPayload:u,cancelTokenSource:d},r.getContextName()).then((async t=>{if(200!==t.status||!t.data)return r.reportError(`getFeeds call failed ${t.status}`,t.data),{feedFilters:[],caseMentions:[]};{a.pop();const n=[],c={};let l=!1,u=[];if(t?.data){if(u=Array.isArray(t.data.data.MessageTypes)&&t.data.data.MessageTypes.length?t.data.data.MessageTypes:[],t?.data?.data?.FeedList){const e=t.data.data.FeedList?.pxResults;Array.isArray(e)&&e?.length>0&&e.forEach(((e,t)=>{e.ID=""!==e.pzInsKey?e.pzInsKey:`message${t}`,n.push(e.ID),c[e.ID]=e,e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(...e.mentions)})),l||["pzPostDetails","pzPrivatePostDetails"].includes(e.pyMessageViewReference)||(l=!0)}))}if(l&&await Sf({uiResources:t.data.uiResources}),!s&&(s=[{id:"All",label:i.getLocalizedText("All"),on:!0,disabled:!1}],t?.data?.data?.FeedFilters)){const e=t.data.data.FeedFilters?.pxResults;let n=!0;if(e&&Array.isArray(e)&&e?.length>0){e.forEach((e=>{const t={id:e.pyFeedSourceReference,label:i.getLocalizedText(e.pyLabel),disabled:!1,on:"true"===e.pySelected};t.on||(n=!1),s.push(t)}));const t=s.find((e=>"All"===e.id));t&&(t.on=n)}}}if(o&&r.getValue("pulse.messageIDs")){let e=r.getValue("pulse.messages");e={...e,...c},Object.values(e).forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(...e.mentions)}))}))}if($E(r.getContextName())){r.updateState({pulse:{messages:o&&r.getValue("pulse.messageIDs")?{...r.getValue("pulse.messages"),...c}:c,messageIDs:o&&r.getValue("pulse.messageIDs")?[...r.getValue("pulse.messageIDs"),...n]:n,nextPageFirstEntry:t?.data?.nextPageFirstEntry||"",pageLastEntry:t?.data?.pageLastEntry||"",hideAttachment:t?.data?.hideAttachment||!1,postTypes:u,pulseContext:e}});const a=[...new Map(this.mentions.flat()?.map((e=>[e.mentionsID,e]))).values()].filter((e=>Object.hasOwn(e,"mentionsType"))).filter((e=>!e?.mentionsType?.toLowerCase().includes("user")));return{feedFilters:s,caseMentions:a}}}})).catch((e=>{Tp(e)||r.reportError(": Error occurred during ajax call at getFeeds API : ",e.response)}))};postMessage=(e,t,n,s=[],a=!1,r=[])=>{const o={message:t,context:e,parentMessageId:a?e:"",attachments:s,pyRecipients:r.length?r:void 0},i=0===r.length?{body:JSON.stringify(o),headers:WR}:{body:JSON.stringify(o),queryPayload:{type:"PegaSocial-Post-Private"},headers:WR};return Cp(r.length?GR:"postFeedMessages",i,n.getContextName()).then((t=>{if((201===t.status||200===t.status)&&t.data){const r=t?.data;if(a){r.parentMessageID=e;const{pxResults:t,caseMentions:o}=this.buildMessageObject(r,a,n,s.length>0);return n.updateState({pulse:{messages:{[e]:{pxResults:t}}}}),o}const{messages:o,messageIDs:i,caseMentions:c}=this.buildMessageObject(r,a,n,s.length>0);return n.updateState({pulse:{messages:o,messageIDs:i}}),c}return n.reportError(`postMessage call failed with status ${t.status}`,t),""})).catch((e=>{throw n.reportError(": Error occurred during ajax call at postMessage API : ",e.response),e.response}))};postCustomMessage=(e,t,n)=>Cp(GR,{body:t,queryPayload:{type:e},headers:WR},n.getContextName()).then((async e=>{if(201===e.status&&e.data){const s=e.data.data,a={ID:s.ID,pzInsKey:s.ID,classID:s.classID,pyPostType:s.pyPostType,postedByUser:s.postedByUser,pyIsDeleteEnabled:s.pyIsDeleteEnabled,pyMessageViewReference:s.messageViewReference,pyFeed:{pyIconType:"user",pyCommentContext:s.pyCommentContext,pyPostedOn:s.postedTime,pyFeedTitle:s.postedByUser.name,pyIconReference:s.postedByUser.ID},...s.PostMessage};_f(s.messageViewReference,n,t.context)||await Sf({uiResources:e.data.uiResources}),n.updateState({pulse:{messages:{[a.ID]:a,...n.getValue("pulse.messages")},messageIDs:[a.ID,...n.getValue("pulse.messageIDs")]}})}return n.reportError(`postCustomMessage call failed with status ${e.status}`,e),""})).catch((e=>{throw n.reportError(": Error occurred during ajax call at postCustomMessage API : ",e.response),e.response}));editMessage=({messageID:e,parentMessageID:t,message:n,pConnectObj:s,isReply:a=!1,recipients:r=[]})=>{const o=JSON.stringify({message:n,...r.length&&{pyRecipients:r}});return Cp("editFeedMessage",{queryPayload:{messageID:e},body:o,headers:WR},s.getContextName()).then((e=>{if(200===e?.status&&e?.data){const n=e?.data;if(a){n.parentMessageID=t;const{pxResults:e,caseMentions:r}=this.buildMessageObject(n,a,s,!1);return s.updateState({pulse:{messages:{[t]:{pxResults:e}}}}),r}const{messages:r,caseMentions:o}=this.buildMessageObject(n,a,s,!1);return s.updateState({pulse:{messages:r}}),o}return s.reportError(`editMessage call failed with status ${e.status}`,e),""})).catch((e=>{throw s.reportError(": Error occurred during ajax call at editMessage API : ",e.response),e.response}))};buildMessageObject=(e,t,n,s=!1)=>{const a={ID:e?.ID||"",classID:e?.classID||"PegaSocial-Message",tags:e?.tags||[],pyHasAttachment:s,pzInsKey:e?.ID||"",pyMessage:e?.message||"",mentions:e?.mentions||[],postedByUser:e?.postedByUser,pxCreateDateTime:e?.postedTime||"",pxUpdateDateTime:e?.updatedTime||"",parentMessageID:e?.parentMessageID||"",pyIsDeleteEnabled:e?.pyIsDeleteEnabled||!1,pyIsEdited:"string"==typeof e?.isEdited?"true"===e?.isEdited:e?.isEdited||!1,pyFeed:{pyPostedOn:e?.postedTime||"",pyFeedTitle:e?.postedByUser?.name||"",pyIconType:"user",pyCommentContext:e?.pyCommentContext||".pzInsKey",pyIconReference:"pi pi-case"},pyContext:"",pxIcon:"globe",pyMessageViewReference:e?.messageViewReference||"pzPostDetails",pyPostType:e?.pyPostType,pyRecipients:e?.pyRecipients?.length?e.pyRecipients:void 0},r=n.getValue("pulse.messages");if(t){let{pxResults:e=[]}=Object.values(r)?.find((e=>e?.ID===a?.parentMessageID))||{};const t=e?.findIndex((e=>e?.pzInsKey===a?.ID));if(-1!==t){const n=[...e];n[t]={...n[t],...a},e=n}else e=[...e,a];return{pxResults:e,messages:{},messageIDs:[],caseMentions:this.getCaseMentions(e)}}const o=n.getValue("pulse.messageIDs");if(o){const e=o.includes(a.ID)?{...r[a.ID],...a}:a,t={...r,[a.ID]:e};return{messages:t,messageIDs:o.includes(a.ID)?o:[a.ID,...o],caseMentions:this.getCaseMentions(Object.values(t))}}};getCaseMentions=e=>{const t=e?.filter((e=>e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0))?.map((e=>e.mentions))?.concat(this.mentions);return[...new Map(t.flat()?.map((e=>[e.mentionsID,e]))).values()].filter((e=>Object.hasOwn(e,"mentionsType"))).filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))};likeMessage=({pulseContext:e,likedBy:t,messageID:n,isReply:s,pConnectObj:a})=>{const r=t?"unlikeFeedMessages":"likeFeedMessages",o=JSON.stringify({ContextClass:e});Cp(r,{body:o,queryPayload:{pulseContext:e},headers:WR},a.getContextName()).then((r=>{if(200===r.status)if(s){const s=a.getValue(`pulse.messages.${n}`),r=s?.pxResults&&Array.isArray(s?.pxResults)&&s.pxResults?.length>0&&s.pxResults?.map((n=>{if((n={...n}).pzInsKey===e){let e=0,s=!1;const a=n.pyLikes?n?.pyLikes?.pxLikeCount:0;t?(e=a-1,s=!1):(e=a+1,s=!0),n.pyLikes={pxLikeCount:e,pxIsLiked:s}}return n}));a.updateState({pulse:{messages:{[n]:{pxResults:r}}}})}else{const s={...a.getValue(`pulse.messages.${n}`)},r=s.pyLikes?s.pyLikes.pxLikeCount:0;let o=0,i=!1;t?(o=r-1,i=!1):(o=r+1,i=!0),s.pyLikes={pxLikeCount:o,pxIsLiked:i},a.updateState({pulse:{messages:{[e]:s}}})}else a.reportError(`likeMessage call failed with status ${r.status}`,r)})).catch((e=>{a.reportError(": Error occurred during ajax call at likeMessage API : ",e.response.data)}))};deleteMessage=(e,t,n,s)=>{let a=e;t&&(a=n);Cp("deleteFeedMessage",{queryPayload:{messageID:a}},s.getContextName()).then((a=>{if(200===a.status)if(t){const t=s.getValue(`pulse.messages.${e}`),a=t?.pxResults&&Array.isArray(t?.pxResults)&&t.pxResults?.length>0&&t.pxResults?.filter((e=>e.pzInsKey!==n));s.updateState({pulse:{messages:{[e]:{pxResults:a}}}})}else{const t=s.getValue("pulse.messageIDs"),n=t&&Array.isArray(t)&&t?.length>0&&t?.filter((t=>t!==e)),a={...s.getValue("pulse.messages")};delete a[e],s.updateState({pulse:{messageIDs:n,messages:a}})}else s.reportError(`deleteMessage call failed with status ${a.status}`,a)})).catch((e=>{s.reportError(": Error occurred during ajax call at deleteMessage API : ",e.response)}))};getLikedUsers=(e,t)=>Cp("getFeedMessageLikes",{queryPayload:{messageID:e}},t.getContextName());getMentionSuggestions=(e,t)=>{const{pulseContext:n,searchFor:s,mentionsType:a,listSize:r=5}=e,o={pulseContext:n,searchFor:s,mentionsType:a,listSize:r};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const i=Np();return this.mentionsTagsCancelTokenSource.push(i),Cp("getMentionSuggestions",{queryPayload:o,cancelTokenSource:i},t.getContextName()).then((e=>(this.mentionsTagsCancelTokenSource=[],200===e.status&&e.data?e?.data:(t.reportError(`Get mention suggestions call failed ${e.status}`,e.data),[])))).catch((e=>{Tp(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>Cp("getMentionTypes",{},e.getContextName());getPostTypeView=(e,t)=>Cp("getViewRuleByMessageType",{queryPayload:{type:e}},t.getContextName());getTagSuggestions=(e,t)=>{const{searchFor:n,listSize:s=5}=e,a={searchFor:n,listSize:s};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const r=Np();return this.mentionsTagsCancelTokenSource.push(r),Cp("getTagSuggestions",{queryPayload:a,cancelTokenSource:r},t.getContextName()).then((e=>{this.mentionsTagsCancelTokenSource=[];let n=[];return 200===e.status&&e?.data?n=e?.data?.tags&&Array.isArray(e?.data?.tags)&&e.data.tags.length>0&&e.data.tags?.map((e=>`#${e}`)):t.reportError(`Get tag suggestions call failed ${e.status}`,e.data),n})).catch((e=>{Tp(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},qR={getTaggedCases:(e,t)=>{const n={caseID:e,viewID:ks.getDefaultQualifiedName("pyTaggedCases")};return Cp("loadView",{queryPayload:n},t.getContextName()).then((e=>e?.data)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)}))},getTags:(e,t)=>Cp("getCaseTags",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.tagsList)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTags API : ",e.response)})),postTags:(e,t,n)=>{const s={caseID:e},a=JSON.stringify({tags:t});return Cp("addTagsToCase",{body:a,queryPayload:s},n.getContextName()).then((e=>e?.data?.results)).catch((e=>{n.reportError(": Error occurred during ajax call at postTags API : ",e.response)}))},removeTag:(e,t,n)=>Cp("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>{const t=ks.getDefaultQualifiedName("D_pxGetTagsLandingPageURL");return Sh.getPageDataAsync(t,e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))}},zR=(e,t)=>{Py(t.getContextName(),e.etag),Oy(t.getContextName(),e.etag)},YR={getParticipants:(e,t)=>Cp("getAllParticipants",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.data.content.pyParticipants)).catch((e=>{t.reportError(": Error occurred during ajax call at getParticipants API : ",e.response)})),getRoleView:(e,t,n)=>Cp("getParticipantRoleView",{queryPayload:{caseID:e,participant_roleID:t}},n.getContextName()).then((e=>e?.data)).catch((e=>{n.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)})),getParticipantRoles:(e,t)=>Cp("getParticipantRoles",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.participant_roles)).catch((e=>{t.reportError(": Error occurred during ajax call at getParticipantRoles API : ",e.response)})),getParticipant:(e,t,n)=>Cp("getParticipant",{queryPayload:{caseID:e,participantID:t}},n.getContextName()).then((e=>e?.data)).catch((e=>{n.reportError(": Error occurred during ajax call at getParticipant API : ",e.response)})),createParticipant:async(e,t,n,s,a)=>{const r={caseID:e},o={...n,participantRoleID:t},i={"if-match":s.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Cp("createParticipant",{body:o,queryPayload:r,headers:i},s.getContextName()).then((t=>{zR(t.headers,s),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=oI(a||s.getContextName());s.reportError(": Error occurred during ajax call at createParticipant API : ",{...e.response.data,formFields:n},a),t(e.response)}))}))},updateParticipant:async(e,t,n,s,a)=>{const r={caseID:e,participantID:t},o={"if-match":s.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Cp("updateParticipant",{body:n,queryPayload:r,headers:o},s.getContextName()).then((t=>{zR(t.headers,s),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=oI(a||s.getContextName());s.reportError(": Error occurred during ajax call at updateParticipant API : ",{...e.response.data,formFields:n},a),t(e.response)}))}))},deleteParticipant:(e,t,n)=>{const s={caseID:e,participantID:t},a={"if-match":n.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Cp("deleteParticipant",{queryPayload:s,headers:a},n.getContextName()).then((t=>{zR(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function KR(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const QR="create",JR="update",XR="delete";function ZR(e,t,n,s){const a=UA(t);if(a){switch(e){case QR:case JR:{const{markAsDefault:e,...t}=s;Object.entries(t).length>0&&(a.allPersonalizations[n]=t),e&&(a.defaultPersonalization=n);break}case XR:delete a.allPersonalizations[n],a.defaultPersonalization===n&&(a.defaultPersonalization="");break;default:return null}return a}return null}const eb={},tb=async e=>{const t=UA(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=KR(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:s}=_S("getUIListPersonalizations",{listID:e});return ud(n,{method:s,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:KR(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},nb=async(e,t,n)=>{const{restApi:s,reqType:a}=_S("createListPersonalization",{listID:e});return ZR(QR,e,t,n),ud(s,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return eb[t]=n,e}))},sb=async(e,t,n)=>{const s=eb[t]||t;ZR(JR,e,t,n);const{restApi:a,reqType:r}=_S("updateListPersonalization",{listID:e,personalizationID:s})||{};return ud(a,{method:r,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},ab=async(e,t)=>{const n=eb[t]||t;ZR(XR,e,t);const{restApi:s,reqType:a}=_S("deleteListPersonalization",{listID:e,personalizationID:n});return ud(s,{method:a,body:{}}).then((e=>(eb[t]&&delete eb[t],e)))};const rb=function(e){return e?{createPersonalization:nb.bind(null,e),updatePersonalization:sb.bind(null,e),deletePersonalization:ab.bind(null,e),fetchPersonalizations:tb.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},ob="undefined"!=typeof window?window.sessionStorage:{getItem:()=>null,setItem:()=>{}},ib="getDataObjects",cb="getInsightByID",lb=["LocalList","RemoteList","PromptList","DataPage"];let ub=null;const db=[];const pb={},gb=e=>$g.getAppCacheKey(`PrimaryFields-${e}`);function hb(e){let t;return e[1].category?t=e[1].category:e[0].indexOf(":")>0&&(t=e[0].substring(0,e[0].indexOf(":"))),t}function fb(e){return"object"==typeof e&&null!==e}function mb(e){return{...e[1],fieldID:e[0],fieldType:e[1].fieldType||(e[1].isUserReference?"User reference":void 0),category:hb(e),classID:e[1].associationClassID?e[1].associationClassID:e[1].classID}}function Ib({data:e}){const t=(e,t)=>If("FIELD",e,t),n="string"==typeof e.classID?e.classID:"",s=If("CASE",n);e.classNameLocaleReference=s;const a=Array.isArray(e.fields)?e.fields:[];for(let e=0;e<a.length;e+=1){const n=a[e];if(fb(n)){const e={nameLocaleReference:"INSIGHTS",categoryLocaleReference:"INSIGHTS",parentCategoryLocaleReference:"INSIGHTS"},a=n.definedOnClassIDs;if("string"==typeof a){const r=a.split(":").reverse(),o="string"==typeof n.fieldID?n.fieldID:"",i=o.split("!").pop()?.split(":").reverse()||[];r[0]&&i[0]&&(e.nameLocaleReference=t(i[0],r[0])),r[1]&&i[1]&&(e.categoryLocaleReference=t(i[1],r[1])),r[2]&&i[2]?e.parentCategoryLocaleReference=t(i[2],r[2]):n.parentCategory&&(e.parentCategoryLocaleReference=s)}Object.assign(n,e)}}return{data:e}}const Eb={getDataObjects:function(){const e=$g.getAppCacheKey(ib);if(ob.getItem(e))return Promise.resolve(JSON.parse(`${ob.getItem(e)}`));const{restApi:t,reqType:n}=_S(ib,{}),s=ud(t,{method:n});return s.then((t=>{ob.setItem(e,JSON.stringify(t))})),s},getDataPageObjects:function(e=!0){if(ub)return ub;const t=$g.getAppCacheKey("getDataPageObjects");if(e&&ob.getItem(t))return Promise.resolve(JSON.parse(`${ob.getItem(t)}`));const{restApi:n,reqType:s}=_S("getDataPages",{datapageRequestType:"explorable"});return ub=ud(n,{method:s,datapageRequestType:"explorable"}),ub.then((e=>{ub=null,ob.setItem(t,JSON.stringify(e))})),ub},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=LA(e);if(t&&t.classID){let e=VA(t.classID);const n=t.rdFields,s=(n&&!Array.isArray(n)?n.fields:void 0)?.filter((e=>e.indexOf(".")>0));if(s&&!AC.isEmpty(s)){const n=s.reduce(((e,n)=>{const s=TA(n,t.classID);var a;return s&&"type"in(a=s)&&"classID"in a&&(e[n]=s),e}),{});e={...e,...n}}if(e&&Object.keys(e).length>0){for(const t of Object.keys(e))e[t].type.startsWith("Page")?delete e[t]:e[t]?.datasource&&lb.includes(e[t].datasource.tableType)&&(e[t].fieldType="Picklist");return{sourceFields:e,sourceMetadata:t}}}return{}}(e);if(t&&n&&Object.keys(n).length>0){const e={...t,fields:Object.entries(n).map(mb)};if(fb(s=e)&&"string"==typeof s.classID&&Array.isArray(s.fields)){const t=Ib({data:e});return Promise.resolve(t)}}}var s;const a={dataSource:e,columns:[],parameters:{},associationFilter:n,matchPosition:"",ignoreCase:!1};return Lh.init(a).then((({dataSourceMetaData:e})=>e?Ib({data:e}):{data:{classID:"",className:"",isQueryable:!1,fields:[]}}))},getDefaultColumns:function(e){const t=$g.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(ob.getItem(t))return Promise.resolve(JSON.parse(`${ob.getItem(t)}`));const n={dataViewName:ks.getDefaultQualifiedName("D_pzGetDefaultColumns")},{restApi:s,reqType:a}=_S("getListData",n),r=ud(s,{method:a,body:{dataViewParameters:e}});return r.then((e=>{ob.setItem(t,JSON.stringify(e))})),r},getFieldsForDataSource:function(e,t,n){if(!t){const t=LA(e),n=Array.isArray(t?.rdFields)?t?.rdFields:t?.rdFields?.fields;return n?Promise.resolve({data:{data:n.map((e=>({pyFieldName:e})))}}):Promise.resolve({data:{data:[]}})}const s=$g.getAppCacheKey(`RDColumns-${e}`);if(ob.getItem(s))return Promise.resolve(JSON.parse(`${ob.getItem(s)}`));const a=$g.getData(ks.getDefaultQualifiedName("D_pxFieldsForDataSource"),{dataViewParameters:{DataPageName:e}},n);return a.then((e=>{ob.setItem(s,JSON.stringify(e))})),a},getPrimaryFieldsForDataSource:function(e="",t=""){const n=$g.getAppCacheKey(`PFColumns-${e}${t}`);if(ob.getItem(n))return Promise.resolve(JSON.parse(`${ob.getItem(n)}`));const s=$g.getData(ks.getDefaultQualifiedName("D_pxGetInitialFieldsForDataSource"),{dataViewParameters:{DataPageName:e,ClassName:t}});return s.then((e=>{ob.setItem(n,JSON.stringify(e))})),s},getPrimaryFieldsForInsights:async function(e,t,n,s){const{allClasses:a,promisesToAwait:r,classesToFetch:o,isTopLevelClassPresent:i,joinedClassesToFetch:c}=function(e,t){const n=[],s=[];let a=!1;const r=[],o=[];return e&&o.push(e),t&&t.length>0&&o.push(...t),o.forEach((t=>{const o=gb(t);if(ob.getItem(o))return;const i=pb[t];i?s.push(i):(n.push(t),t===e?a=!0:r.push(t))})),{allClasses:o,promisesToAwait:s,classesToFetch:n,isTopLevelClassPresent:a,joinedClassesToFetch:r}}(e,n);return o.length&&r.push((async(e,t,n,s,a)=>{const r=$g.getData(ks.getDefaultQualifiedName("D_pxGetPrimaryFieldsForInsights"),{dataViewParameters:{...t&&{topLevelClassID:t},...s&&{joinedClassIDs:s.join(",")},...n&&{topLevelDataPageID:n}}},a).then((t=>{const n=t.data?.data||[],s={};e.forEach((e=>{s[e]=[]})),n.forEach((e=>{const t=e.classID,n=e[ks.getDefaultQualifiedName("pyFieldName")];s[t].push(n)})),Object.entries(s).forEach((([e,t])=>{const n=gb(e);ob.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete pb[e]}))}));return e.forEach((e=>{pb[e]=r})),r})(o,i?e:void 0,i?t:void 0,c.length>0?c:void 0,s)),Promise.allSettled(r).then((()=>{const e={};return a.forEach((t=>{const n=gb(t);if(ob.getItem(n))try{e[t]=JSON.parse(`${ob.getItem(n)}`)}catch{}})),{data:e}}))},getInsightIDs:function(){const{restApi:e,reqType:t}=_S("getInsightIDs");return ud(e,{method:t})},getInsightByID:function(e){const t=FA(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:s,reqType:a}=_S(cb,n);return ud(s,{method:a})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:s}=_S(cb,t);return ud(n,{method:s})},loadClassResources:async e=>{const t=e.filter((e=>!db.includes(e)));if(0===t.length)return;const n={classIDs:e.join(",")},{restApi:s,reqType:a}=_S("getClassResources",n);return ud(s,{method:a}).then((e=>{e.data.resources&&(db.push(...t),fp(e.data.resources))}))},createInsight:function(e){const{restApi:t,reqType:n}=_S("createInsight");return ud(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:s,reqType:a}=_S("updateInsight",n);let r;return"UpdateDateTime"in t&&(r=t.UpdateDateTime),ud(s,{method:a,body:JSON.stringify(t),headers:{"if-match":r,"Content-Type":"application/json"}})},deleteInsight:function(e){const t={insightID:e},{restApi:n,reqType:s}=_S("deleteInsight",t);return ud(n,{method:s})},exportToExcel:function(e){const{restApi:t,reqType:n}=_S("exportToExcel");return ud(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=_S("exportToCSV");return ud(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:s,reqType:a}=_S("scheduleInsight",n);return ud(s,{method:a,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const s={insightID:e,scheduleID:t},{restApi:a,reqType:r}=_S("updateScheduledInsight",s);return ud(a,{method:r,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:s,reqType:a}=_S("deleteScheduledInsight",n);return ud(s,{method:a})},translateStrings:function(e){const{restApi:t,reqType:n}=_S("translateStrings");return ud(t,{method:n,body:JSON.stringify(e)})}};const yb=new class{addRoutes=e=>{return t=e,void By.addRoutes(t);var t}};const Ab=class{static registerModule(e,t,n){n[e]=()=>t}};const Cb=class{static getCaseEvent=()=>Object.freeze($s.PUB_SUB_EVENTS.CASE_EVENTS);static getDataEvent=()=>Object.freeze($s.PUB_SUB_EVENTS.DATA_EVENTS);static getTransientEvent=()=>Object.freeze($s.PUB_SUB_EVENTS.EVENT_TRANSIENT_ITEMS);static getBootstrapShellEvent=()=>Object.freeze($s.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS);static getBulkProcessEvent=()=>Object.freeze($s.PUB_SUB_EVENTS.EVENT_BULKACTION);static getLocalActionProcessEvent=()=>Object.freeze($s.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION)};const Sb=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},_b={setTokens:e=>{md({tokenInfo:e}),fd(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>Uu.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Bu(),getAuthInstance:e=>ku.init(e),setAuthorizationHeader:e=>{fd({Authorization:e}),setTimeout((()=>Uu.publish("updateSession",{updateStatus:"success"})),0)}};const Nb=new class{getDebouncedSubject(e){return(new Tg).pipe(oO(e))}},Tb=(()=>{const e="[!#-'*+/0-9=?A-Z\\^_`a-z{|}~\\-]+",t="\\\\[\\x00-\\x7f]",n=`(?:${e}|${`"(?:[^\\r"\\\\\\x80-\\xff]|${t})*"`})`,s=`(?:${e}|${`\\[(?:[^\\r\\[\\]\\\\\\x80-\\xff]|${t})*\\]`})`;return new RegExp(`^${`${n}(?:\\.${n})*`}@${`${s}(?:\\.${s})*`}$`)})();const Db=(()=>{const e="[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+";return new RegExp(`^${`${`(?:${`${e}(?:\\.${e})*`}|"(?:[^\\x0d\\x22\\x5c]|\\\\[\\x00-\\x7f])+")`}@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}`}$`)})();hp.register("email",((e,{useRFC822Validation:t})=>{let n=null;const s=t?(a=e,Tb.test(a)):function(e){return Db.test(e)}(e);var a;return e&&!s&&(n="Enter a valid email address"),n})),hp.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t="Invalid number"),t})),hp.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?"Cannot be blank":null)),hp.register("url",(e=>{let t=null;return e&&!function(e){let t;try{t=new URL(e)}catch{return!1}return"http:"===t.protocol||"https:"===t.protocol||"ftp:"===t.protocol}(e)&&(t="Enter a valid url"),t})),setTimeout((()=>{const e="Enter a valid phone number";a.e(667).then(a.bind(a,816)).then((({parsePhoneNumberFromString:t})=>{hp.register("phone",(n=>{let s=null;n&&!/^\+?\d+$/.test(n)&&(s=e);const a=n?.startsWith("+");if(n&&a){const a=t(n);a&&a.isPossible()&&n===a.number||(s=e)}return s}))}))}),Gs.PRIORITY.TRIVIAL);const Pb=(e,t)=>{switch(t){case"invalid":return`Incorrect ${e}`;case"incomplete":return`Incomplete ${e}`;default:return null}};hp.register("datetime",(e=>Pb("date and time",e))),hp.register("date",(e=>Pb("date",e))),hp.register("time",(e=>Pb("time",e)));const Ob=e=>{for(const t of e)if(t?.error)return"Error with one or more files";return null};hp.register("attachment",(e=>{let t=null;return e?("pyCount"in e&&Array.isArray(e.pxResults)?t=Ob(e.pxResults):Array.isArray(e)?t=Ob(e):"error"in e&&e.error&&(t="Error with one or more files"),t):t}));const Rb=()=>{const e={},t="undefined"!=typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0;t&&(e["user-timezone"]=t);const n="undefined"!=typeof navigator?navigator.language:void 0;return n&&(e["user-locale"]=n),e},bb="createConversation",vb="sendMessage",xb="getConversations",wb="getMessages",Mb="sendMessageForAgent",Lb="getCoach",Ub=(e,t,n,s,a,r,o)=>{for(const e of o)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const i=Np();return o.push(i),Cp(e,{queryPayload:xb===e?{assistantID:t,contextID:n,pageSize:s,pageIndex:a}:{agentID:t,contextID:n,pageSize:s,pageIndex:a},cancelTokenSource:i,headers:Rb()},r).then((e=>(o.pop(),e)))},Fb=(e,t,n,s,a)=>{for(const e of a)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const r=Np();return a.push(r),Cp(e,{queryPayload:wb===e?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},cancelTokenSource:r,headers:Rb()},s).then((e=>(a.pop(),e)))},Vb=(e,t,n,s,a,r)=>{for(const e of a)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const o=Np();return a.push(o),Cp(e,{body:JSON.stringify({contextID:t,executeStarterQuestion:!1,...r&&r.isManualConfirmationSupported&&{capabilities:{tools:{isManualConfirmationSupported:!0}}}}),cancelTokenSource:o,queryPayload:e===bb?{assistantID:n}:{agentID:n},headers:Rb()},s).then((e=>(a.pop(),e)))},jb=(e,t,n,s,a,r,o)=>{const i={...s&&{request:s},...o&&o.additionalInstruction&&{additionalInstruction:o.additionalInstruction},...o&&o.isManualConfirmationSupported&&{capabilities:{tools:{isManualConfirmationSupported:!0}}},...o&&o.toolsReviewed&&o.toolsReviewed.length>0&&{toolsReviewed:o.toolsReviewed},...r&&r?.length>0&&{attachments:r}};return Cp(e,{body:JSON.stringify(i),queryPayload:e===vb?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},headers:Rb()},a)},kb=(e,t,n,s,a,r,o,i)=>{const c={...s&&{request:s},...o&&o.additionalInstruction&&{additionalInstruction:o.additionalInstruction},...r&&r.length>0&&{attachments:r},...o&&o.toolsReviewed&&o.toolsReviewed.length>0&&{toolsReviewed:o.toolsReviewed},capabilities:{stream:{isEnabled:!0},...o&&o.isManualConfirmationSupported&&{tools:{isManualConfirmationSupported:!0}}},...o&&o.questionnaire&&{questionnaire:o.questionnaire}},l=e===vb?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},{restApi:u,reqType:d}=_S(e,l),p={method:d,headers:{Accept:"text/event-stream",...Rb()},body:JSON.stringify(c),responseType:"stream",adapter:"fetch",...i&&{signal:i.token}};return ud(u,p,a)},Bb=(e,t,n,s,a)=>{for(const e of s)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const r=Np();return s.push(r),Cp(e,{queryPayload:e===Lb?{assistantID:t,...a&&{contextID:a}}:{agentID:t,...a&&{contextID:a}},cancelTokenSource:r},n).then((e=>(s.pop(),e))).catch((e=>{throw s.pop(),e}))},$b={createConversation:(e,t,n,s=[])=>Vb(bb,e,t,n,s),sendMessage:(e,t,n,s,a)=>a?.enableStreaming?kb(vb,e,t,n,s,void 0,a):jb(vb,e,t,n,s),createConversationForAgent:(e,t,n,s=[],a)=>Vb("createConversationForAgent",e,t,n,s,a),sendMessageForAgent:(e,t,n,s,a,r)=>r?.enableStreaming?kb(Mb,e,t,n,s,a,r,r.cancelTokenSource):jb(Mb,e,t,n,s,a,r),getAgent:(e,t,n,s=[])=>Bb("getAgent",e,t,s,n),getCoach:(e,t,n,s=[])=>Bb(Lb,e,t,s,n),likeAgentMessage:(e,t,n,s)=>{const a={queryPayload:{agentID:e,conversationID:t,messageID:n},headers:Rb()};return Cp("likeAgentMessage",a,s)},unLikeAgentMessage:(e,t,n,s,a="")=>{const r={queryPayload:{agentID:e,conversationID:t,messageID:n},body:JSON.stringify({feedbackText:a}),headers:Rb()};return Cp("dislikeAgentMessage",r,s)},getConversations:(e,t,n,s,a,r=[])=>Ub(xb,e,t,n,s,a,r),getConversationsForAgent:(e,t,n,s,a,r=[])=>Ub("getConversationsForAgent",e,t,n,s,a,r),getMessages:(e,t,n,s=[])=>Fb(wb,e,t,n,s),getMessagesForAgent:(e,t,n,s=[])=>Fb("getMessagesForAgent",e,t,n,s)};const Gb=new class{async rewriteText(e){const{originalText:t,rewriteAction:n,additionalInstructions:s,context:a}=e,r=Gy.isInfinityRuntime(),o=Gy.getRewriteGenAIDP()??ks.getDefaultQualifiedName("D_RewriteWithAI"),i={OriginalText:t,RewriteAction:n,AdditionalInstructions:s||""};try{let e,t;if(r){const t=await Sh.getPageDataAsync(o,a,i),n=Object.fromEntries(Object.entries(t)).pyResponseData;e="string"==typeof n?n:void 0}else{const n=(await Sh.getDataAsync(o,a,i)).data[0],s=n[ks.getDefaultQualifiedName("Content")];e="string"==typeof s?s:void 0;const r=n[ks.getDefaultQualifiedName("ErrorMessage")];t="string"==typeof r?r:void 0}return e?{success:!0,rewrittenText:e}:{success:!1,errorMessage:t||"AI rewrite failed: No rewritten text returned"}}catch(e){return{success:!1,errorMessage:e instanceof Error?e.message:"An unexpected error occurred during AI rewrite"}}}};const Wb=class{classAccessMap=new Map;constructor(){const e=Gy.getClassesAccessList();0!==e.length?this.classAccessMap=e.reduce(((e,t)=>(e.set(t.pyClassName,t.pyHasCreateAccess),e)),new Map):this.classAccessMap=Gy.getCaseTypeList().reduce(((e,t)=>(e.set(t.pyWorkTypeImplementationClassName,t.hasCreateAccess??!0),e)),new Map)}hasCreateAccess(e){return this.classAccessMap.get(e)}static getInstance(){return this.instance||(this.instance=new this),this.instance}};const Hb=class{static AUTOSAVE_SAVE_STATUS=BI;static isAutosaveEnabledForContext(e){return aE(e)}static subscribeAutosaveStatus(e,t){return((e,t)=>{let n=zI.get(e);return n||(n=new Set,zI.set(e,n)),n.add(t),()=>{const n=zI.get(e);n&&(n.delete(t),0===n.size&&zI.delete(e))}})(e,t)}static notifyChange(e,t,n){aE(e)&&(((e,t,n)=>{let s=YI.get(e);s||(s=new Map,YI.set(e,s)),s.set(t,n)})(e,t,n),cE(e))}};class qb{static behaviorOverrides={};getPersonalizationUtils=rb;constructor(){qb.behaviorOverrides={}}getPCoreVersion=()=>"26.1.0";onPCoreReady=e=>vR.onPCoreReady(e);onPCoreCleanup=e=>vR.onPCoreCleanup(e);getComponentsRegistry=()=>vR.getComponentsRegistry();checkIfSemanticURL=()=>vR.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(US()){const e=By.processUrl(Fy(),!0);return!!By._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>yb;getViewResources=()=>p;configureForBrowserBookmark=e=>vR.configureForBrowserBookmark(e);getStore=()=>nC();resetStore=()=>IC();getMessageManager=()=>wu;getCoexistenceManager=()=>_R;getStoreValue=(e,t,n)=>iC(e,t,n);getContainerUtils=()=>g;getAnnotationUtils=()=>hg;getFieldUtils=()=>Ad;getFieldDefaultUtils=()=>Qd;getAssetLoader=()=>Lp;getAttachmentUtils=()=>ip;getViewRuleApi=()=>FR;getFeedUtils=()=>HR;getTagUtils=()=>qR;getGenAIAssistantUtils=()=>$b;getGenAIUtils=()=>Gb;getStakeholderUtils=()=>YR;getUserApi=()=>$R;getCaseFollowerApi=()=>jR;getCaseUtils=()=>lI;getStateUtils=()=>of;getRelatedCasesApi=()=>kR;getDataApi=()=>Lh;getDataApiUtils=()=>$g;getAnalyticsUtils=()=>Eb;getLocaleUtils=e=>{const t=e??Gy.getLocale()??"en-US";return _A(t)};registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{qb.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{qb.behaviorOverrides[e]=t};getBehaviorOverrides=()=>qb.behaviorOverrides;getBehaviorOverride=e=>qb.behaviorOverrides[e];getAsynchronousUtils=()=>Nb;createPConnect=e=>Ff(e);getPubSubUtils=()=>Uu;registerComponentCreator=e=>{Vf(e)};getConstants=()=>Object.freeze($s);getResolvedConstantValue=e=>Gs.getProperty(e);getEvents=()=>Cb;getRestClient=()=>d;getMashupApi=()=>NR;getEnvironmentInfo=()=>Gy;switchLocale=e=>ER(e);getRuntimeParamsAPI=()=>Bh;getSemanticUrlUtils=()=>Jp;getRemoteCaseUtils=()=>qs;getNavigationUtils=()=>Hp;registerModule=(e,t)=>Ab.registerModule(e,t,this);getErrorHandler=()=>Sb;getFormUtils=()=>Hm;getAutosaveUtils=()=>Hb;getMessagingServiceManager=()=>Ah;getMetadataUtils=()=>h;getDataPageUtils=()=>Sh;getDataTypeUtils=()=>gg;getCascadeManager=()=>XA;isDeepEqual=(e,t)=>sn(e,t);getAuthUtils=()=>_b;getDebugger=()=>Vu;getDeferLoadManager=()=>kg;getExpressionEngine=()=>c;getActionsSequencer=()=>Yh;getRefreshManager=()=>Fh;getInitialiser=()=>UR;getBootstrapUtils=()=>vR;getContextTreeManager=()=>yu;getAccessPrivilege=()=>Wb.getInstance();getObjectTransformer=()=>Bs;getAllStateMachines=(e,t,n)=>t&&n?qm.getAllStateMachines(e,t,n):qm.getAllStateMachinesByContext(e);isNamespaceEnabled=()=>ks.isNamespaceEnabled();getQualifiedName=(e,t)=>ks.getQualifiedName(e,t);getDefaultQualifiedName=e=>this.getQualifiedName(e,"PegaPlatform");getNameSpaceUtils=()=>ks;getNetworkUtils=()=>Fu;getMashupBridge=()=>I;getConfirmDialogService=()=>fm}const zb=new qb;globalThis.PCore=zb;const Yb=zb;var Kb=r.A;export{Kb as default};
2
+ //# sourceMappingURL=constellation-core.c9cf42c5.js.map