@pega/constellationjs 0.25.1 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +5 -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.71753fb7.js +2 -0
  15. package/dist/constellation-core.71753fb7.js.LICENSE.txt +124 -0
  16. package/dist/constellation-core.71753fb7.js.br +0 -0
  17. package/dist/constellation-core.71753fb7.js.gz +0 -0
  18. package/dist/constellation-core.71753fb7.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.4924dfce.js +2 -0
  25. package/dist/js/libphonenumber.4924dfce.js.br +0 -0
  26. package/dist/js/libphonenumber.4924dfce.js.gz +0 -0
  27. package/dist/js/libphonenumber.4924dfce.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.4924dfce.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:()=>vP});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:()=>jr,getRoutingInfo:()=>Vr,getSemanticURLFromRoutingInfo:()=>kr});var c={};a.r(c),a.d(c,{evaluate:()=>Eo,handleChange:()=>mo,hasDeclareExpression:()=>fo,updateDeclareExpressions:()=>Io});var l={};a.r(l),a.d(l,{hasBrowserEnv:()=>xi,hasStandardBrowserEnv:()=>Mi,hasStandardBrowserWebWorkerEnv:()=>Li,navigator:()=>wi,origin:()=>Ui});var u={};a.r(u),a.d(u,{publishExpressions:()=>Jd,publishMetadata:()=>Qd,publishResponse:()=>Xd});var d={};a.r(d),a.d(d,{doesRestApiExist:()=>ap,getCancelTokenSource:()=>rp,getCaseApi:()=>cp,getHeaderProcessor:()=>tp,invokeCustomRestApi:()=>sp,invokeRestApi:()=>np,isRequestCanceled:()=>op,registerInterceptor:()=>ip});var p={};a.r(p),a.d(p,{fetchViewResources:()=>Mh,updateViewResources:()=>wh});var g={};a.r(g),a.d(g,{CONTAINER_NAMES:()=>gI,CONTAINER_TYPES:()=>pI,addRootContainerItem:()=>zI,areContainerItemsPresent:()=>AI,clearTransientData:()=>ZI,closeContainerItem:()=>qI,getActiveContainerItemContext:()=>vI,getActiveContainerItemIDFromRoutingInfo:()=>dE,getActiveContainerItemName:()=>OI,getActiveContext:()=>iE,getChildContainerItems:()=>xI,getChildContainers:()=>wI,getChildContainersContexts:()=>MI,getContainerAPI:()=>nE,getContainerAccessOrder:()=>yI,getContainerData:()=>mI,getContainerItemByKey:()=>NI,getContainerItemData:()=>II,getContainerItemName:()=>SI,getContainerItems:()=>EI,getContainerLimit:()=>VI,getContainerParentContext:()=>uE,getContainerType:()=>DI,getContextByTargetAndKey:()=>lE,getDataContextName:()=>bI,getFlowContainer:()=>gE,getLeastRecentlyUsedNonDirtyContainerItemID:()=>GI,getParentContainerItem:()=>pE,getRootContainerName:()=>oE,getSuggestionContexts:()=>LI,getTargetFromContainerItemID:()=>HI,getTransientItems:()=>QI,hasContainerItems:()=>jI,isContainerDirty:()=>WI,isContainerInitialized:()=>TI,isContainerItemActive:()=>PI,isContainerItemContextBeingUsedInOtherContainers:()=>KI,isContainerItemExists:()=>CI,isContainerLimitReached:()=>BI,isContainerMultipleMode:()=>FI,isContainerSingleMode:()=>UI,purgeTransientData:()=>eE,removeContainer:()=>sE,replaceTransientData:()=>XI,resetContainersPayload:()=>$I,setContainerLimit:()=>kI,updateCaseContextEtag:()=>rE,updateParentLastUpdateTime:()=>cE,updateRelatedContextEtag:()=>aE,updateTransientData:()=>JI});var h={};a.r(h),a.d(h,{getAIAgent:()=>ry,getAdditionalInfo:()=>uy,getDataPageKeys:()=>iy,getDataPageMetadata:()=>XE,getEmbeddedPropertyMetadata:()=>HE,getFieldParameters:()=>ny,getFieldsByClassName:()=>ty,getGenAICoach:()=>ay,getInsight:()=>ey,getLocaleUtilsForLanguage:()=>WE,getLocalizationServiceFromStore:()=>GE,getLookUpDataPage:()=>cy,getLookUpDataPageInfo:()=>ly,getParagraph:()=>sy,getPersonalizationMetadata:()=>ZE,getPropertyMetadata:()=>$E,getResolvedFieldMetadata:()=>dy,getSavableDataPage:()=>oy,isViewExists:()=>QE,mergeStore:()=>BE,resolveNavigation:()=>JE,resolveView:()=>KE,updateNavigationStore:()=>zE,updateStores:()=>YE,updateViewStore:()=>qE});var f={};a.r(f),a.d(f,{dispatch:()=>Ey,doesContextExist:()=>wy,getActionType:()=>Ty,getContextValue:()=>_y,getDataObject:()=>yy,getReferenceTokens:()=>fy,getSharedDataObject:()=>Ay,getStore:()=>Iy,getValue:()=>Sy,isMergeable:()=>Oy,lookupContextValue:()=>Ny,mergeDeep:()=>Ry,performReplaceAndRearrange:()=>Py,removeItem:()=>Dy,replaceValue:()=>vy,resetStore:()=>xy,setStore:()=>my,updateValue:()=>by});var m={};a.r(m),a.d(m,{activateContainerItem:()=>uA,addContainerItem:()=>eA,addMessages:()=>dA,addSharedData:()=>CA,addTransientItem:()=>tA,addWork:()=>Qy,clearTransientData:()=>sA,createWork:()=>Gy,error:()=>AA,finishAssignment:()=>mA,initContainers:()=>Xy,listAction:()=>_A,loadView:()=>Yy,mergeData:()=>qy,openAssignment:()=>IA,openWorkByHandle:()=>Jy,postProcess:()=>yA,purgeTransientData:()=>rA,removeAllTransientItems:()=>gA,removeContainerItem:()=>pA,removeSharedData:()=>SA,removeTransientItem:()=>hA,replaceContainerItem:()=>fA,replaceTransientData:()=>aA,resetContainers:()=>Zy,resetLoading:()=>cA,setLoading:()=>iA,setSharedProperty:()=>TA,setStateProperty:()=>DA,showCasePreview:()=>NA,showHarness:()=>zy,showHistory:()=>EA,showPage:()=>Ky,upMergeAndRemoveContainerItem:()=>lA,updateContainerItem:()=>oA,updateTransientData:()=>nA});var I={};a.r(I),a.d(I,{buildResizeMessage:()=>dO,mashup:()=>pO});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 O=D;const P=function(){this.__data__=new O,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,j=U.toString,V=L?L.toStringTag:void 0;const k=function(e){var t=F.call(e,V),n=e[V];try{e[V]=void 0;var s=!0}catch(e){}var a=j.call(e);return s&&(t?e[V]=n:delete e[V]),a};var B=Object.prototype.toString;const $=function(e){return B.call(e)};var W=L?L.toStringTag:void 0;const G=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":W&&W 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=G(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||O),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 Oe=De;const Pe=function(e,t){var n=this.__data__;if(n instanceof O){var s=n.__data__;if(!ce||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new Oe(s)}return n.set(e,t),this.size=n.size,this};function Re(e){var t=this.__data__=new O(e);this.size=t.size}Re.prototype.clear=P,Re.prototype.delete=R,Re.prototype.get=b,Re.prototype.has=v,Re.prototype.set=Pe;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 Oe;++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 je=M.Uint8Array;const Ve=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 We=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 je(e),new je(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=Ve;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 Ge=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:Ge(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]"==G(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[G(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 Ot=Dt(Object.keys,Object);var Pt=Object.prototype.hasOwnProperty;const Rt=function(e){if(!Tt(e))return Ot(e);var t=[];for(var n in Object(e))Pt.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 jt=ie(M,"WeakMap");var Vt="[object Map]",kt="[object Promise]",Bt="[object Set]",$t="[object WeakMap]",Wt="[object DataView]",Gt=X(Lt),Ht=X(ce),qt=X(Ut),zt=X(Ft),Yt=X(jt),Kt=G;(Lt&&Kt(new Lt(new ArrayBuffer(1)))!=Wt||ce&&Kt(new ce)!=Vt||Ut&&Kt(Ut.resolve())!=kt||Ft&&Kt(new Ft)!=Bt||jt&&Kt(new jt)!=$t)&&(Kt=function(e){var t=G(e),n="[object Object]"==t?e.constructor:void 0,s=n?X(n):"";if(s)switch(s){case Gt:return Wt;case Ht:return Vt;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):We(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]"==G(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||Oe),n}yn.Cache=Oe;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,On=Dn?Dn.toString:void 0;const Pn=function e(t){if("string"==typeof t)return t;if(He(t))return Tn(t,e)+"";if(fn(t))return On?On.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};const Rn=function(e){return null==e?"":Pn(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(var a=null==e||"object"!=typeof e&&"function"!=typeof e;++n<s;){var r=t[n];if("string"==typeof r){if("__proto__"===r&&!Un.call(e,"__proto__"))return!1;if("constructor"===r&&n+1<s&&"string"==typeof t[n+1]&&"prototype"===t[n+1]){if(a&&0===n)continue;return!1}}}var o=Ln(e,t);return null==o||delete o[xn(vn(t))]};const jn=function(e,t){return null==e||Fn(e,t)};var Vn=Object.prototype.hasOwnProperty;const kn=function(e,t){return null!=e&&Vn.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 Wn=function(e,t,n){var s=null==e?void 0:wn(e,t);return void 0===s?n:s};const Gn=function(){try{var e=ie(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const Hn=function(e,t,n){"__proto__"==t&&Gn?Gn(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 je(t).set(new je(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]"!=G(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 Os=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 Ps=Math.max;const Rs=function(e,t,n){return t=Ps(void 0===t?e.length-1:t,0),function(){for(var s=arguments,a=-1,r=Ps(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),Os(e,this,i)}};const bs=function(e){return function(){return e}};const vs=Gn?function(e,t){return Gn(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 js=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 Vs{static setNamespaceSupport=(e=!1)=>{Vs.namespaceEnabled=e};static isNamespaceEnabled=()=>Vs.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(!Vs.isNamespaceEnabled())return e;const n=Vs.getNamespaceList();if(Array.isArray(n)){if(n.some((t=>{const n=`${t}__`;return e.startsWith(n)})))return e}return`${t}__${e}`};static getDefaultQualifiedName=e=>Vs.getQualifiedName(e,"PegaPlatform");static namespacePrefixedRuleName(e,t){return t?Vs.getQualifiedName(e,t):Vs.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=>Vs.namespacePrefixedRuleName(e,n))).join(".")}if(e.includes(".")){const t=e.startsWith("."),s=(t?e.slice(1):e).split(".").filter(Boolean).map((e=>Vs.namespacePrefixedRuleName(e,n))).join(".");return t?`.${s}`:s}return Vs.namespacePrefixedRuleName(e,n)}}const ks=Vs;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:ks.getDefaultQualifiedName("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"},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_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",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",SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted",THEME_CHANGE:"themeChange",THEME_MODE_CHANGE:"themeModeChange"},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_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"},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",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"},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"},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")}},Ws={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",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)},Gs=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=>Vy.getProperty(".RemoteSystemID",Ws.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=NE.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteAppPlatformVersion=e=>{const t=NE.environmentInfoObject?.pyRemoteAppPlatformVersion;if(t){return JSON.parse(t)[e]}};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID};static getRemoteCaseClassBySourceClass=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=Ws.EMPTY_STRING;return t=e&&e.includes(Ws.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},Qs=(e,t,n=!1)=>{let s=Ws.EMPTY_STRING;if(t&&e){let a=`${t}${Ws.FORWARD_SLASH_STRING}${e}`;const r=mI(a);if(r||t!==Ws.APP.APP&&t!==Ws.APP.ROOT)if(r){if(n&&zs[a])return s=`${a}${Ws.UNDERSCORE_STRING}${zs[a]}`,s;zs[a]?zs[a]+=1:zs[a]=1,s=`${a}${Ws.UNDERSCORE_STRING}${zs[a]}`}else s=Qs(e,Ks(t));else a=`${t}${Ws.FORWARD_SLASH_STRING}${Ws.PRIMARY}`,zs[a]?zs[a]+=1:zs[a]=1,s=`${a}${Ws.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}${Ws.FORWARD_SLASH_STRING}${e}_${n}`}return""},Xs=(e,t)=>{if(e&&t){const n=Ys[t]?.[e];return n?`${t}${Ws.FORWARD_SLASH_STRING}${e}_${n}`:Js(e,t)}return""},Zs=e=>{let t=Ws.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(Ws.FORWARD_SLASH_STRING);return e+Ws.FORWARD_SLASH_STRING+n},ta=e=>{const t=e.indexOf(Ws.FORWARD_SLASH_STRING),n=e.lastIndexOf(Ws.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},na=e=>{const t=e.split(Ws.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+Ws.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="CANCEL_ASSIGNMENT",Ca="OPEN_ASSIGNMENT",Sa="OPEN_LOCAL_ACTION",_a="MERGE_DATA",Na="REMOVE_ITEM",Ta="GET_DATAOBJECT_ACTIONS",Da="SHOW_HISTORY",Oa="ERROR",Pa="INIT_CONTAINERS",Ra="RESET_CONTAINERS",ba="ADD_CONTAINER_ITEM",va="REMOVE_CONTAINER_ITEM",xa="ADD_TRANSIENT_ITEM",wa="UPDATE_TRANSIENT_DATA",Ma="REMOVE_TRANSIENT_ITEM",La="REMOVE_ALL_TRANSIENT_ITEMS",Ua="CLEAR_TRANSIENT_DATA",Fa="PURGE_TRANSIENT_DATA",ja="REPLACE_TRANSIENT_DATA",Va="ACTIVATE_CONTAINER_ITEM",ka="UPDATE_CONTAINER_ITEM",Ba="UPMERGE_AND_REMOVE_CONTAINER_ITEM",$a="REPLACE_CONTAINER_ITEM",Wa="ACTIVATE_MODAL_CONTAINER_ITEM",Ga="REMOVE_CONTAINER",Ha="ADD_SUGGESTION_CONTEXT",qa="showView",za="showData",Ya="showInsight",Ka="showDashboard",Qa="openWorkByHandle",Ja="openAssignment",Xa="createNewWork",Za="finishAssignment",er="SHOW_CANCEL_ALERT",tr="deleteCaseInCreateStage",nr="openLocalAction",sr="openProcessAction",ar="caseWideActions",rr="executeCaseWideActions",or="openBulkAction",ir="performBulkAction",cr="launchAssignment",lr="ADD_MESSAGES",ur="CLEAR_MESSAGES",dr="RESET_STORE",pr="FETCH_DATAPAGE",gr="ADD_SHARED_DATA",hr="REMOVE_SHARED_DATA",fr="LIST_ACTION",mr="DELETE_CASE_SUMMARY",Ir="ALTER_BLOCKING_ACTION_COUNT",Er="CREATE_DATA_OBJECT",yr="DELETE_DATA_OBJECT",Ar="VIEW_DATA_OBJECT",Cr="UPDATE_DATA_OBJECT",Sr="OPEN_DATA_OBJECT_ACTION",_r="SUBMIT_DATA_OBJECT_ACTION",Nr="OPEN_EMBEDDED_DATA_MODAL",Tr="SUBMIT_EMBEDDED_DATA_MODAL",Dr="SUBMIT_SUBSCRIPT",Or="FILL_FORM_WITH_AI",Pr="createWork",Rr="openAssignment",br="openCase",vr="EXECUTE_OBJECT_WIDE_ACTION",xr="CREATE_EXTERNAL_CASE",wr="createObject",Mr="getObject",Lr="getObjectWideAction",Ur="createExternalObject",Fr="retrieveActionViewForNewCase",jr=(e,t)=>{if(!e||!t)return null;let n,s=Ws.EMPTY_STRING;return t&&(s=`${t}${Ws.FORWARD_SLASH_STRING}${e}`,n=mI(s),n||t.includes("/")?n||(s=jr(e,Ks(t))):s=`${t}${Ws.FORWARD_SLASH_STRING}${e}`),s},Vr=(e,t)=>{const n=jr(e,t);return n&&mI(n)?mI(n):{}},kr=(e,t)=>_E.getSemanticURL(qa,{page:e},t);class Br{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=Qr[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=Kr[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}=Qr[this._state];this._subParser=new Br(this._grammar,e,t)}_endSubExpression(){Qr[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,Br._setParent(e,this._position)):this._tree=e,this._position=e}}const $r=Br,Wr="identifier",Gr={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e&&t},Hr={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e||t},qr=(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)=>qr(e,t,!0)},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>qr(e,t,!1)},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{let{value:t}=e;return"true"!==t&&"false"!==t||(t="true"===t),!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":Gr,AND:Gr,and:Gr,"||":Hr,OR:Hr,or:Hr,CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.includes(t)},NOT_CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.includes(t)},STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.startsWith(t)},NOT_STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.startsWith(t)},ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.endsWith(t)},NOT_ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.endsWith(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)=>t.split(",").includes(e)},IS_NOT_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!t.split(",").includes(e)}},Yr={BinaryExpression:function(e){const t=[];let n="";const s=e.right,a=e.operator,r=e.left;if(t[0]=this.evaluateAST(r),r.operationType===Wr&&this._context){const e=r.value;n=this._context.getFieldMetadata(e.substring(1))?.type??""}t[1]=s?this.evaluateAST(s,n):"";return(0,this._grammar[a].evaluate)(t[0],t[1])},identifier:function(e){const t="string"==typeof e.value?e.value:"";if(this._localDataObject)return Ly.getIn(this._localDataObject,t?t.substring(1).split("."):[])??"";if(this._contextTreeNodeContext)return Vy.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)?0: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;return(0,this._grammar[t].evaluate)(n)}},Kr={unaryOperator:function(e){this.setPositionInAST({operationType:"UnaryExpression",operator:e.value})},binaryOperator:function(e){const{precedence:t}=this._grammar[e.value];let n=this._position._parent;const s=n?n.operator:null,a=s?this._grammar[s]:null,r=a?a.precedence:null;if(r&&t)for(;n?.operator&&r>=t;)this._position=n,n=n._parent;const o={operationType:"BinaryExpression",operator:e.value,left:this._position};$r._setParent(this._position,o),this._position=n,this.setPositionInAST(o)},identifier:function(e){const t={operationType:Wr,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){this.setPositionInAST(e)}},Qr={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:Wr},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Kr.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},Jr=["binaryOperator","unaryOperator","openParenthesis"],Xr=/^\s*$/,Zr=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,eo=/\\\\/,to=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],no=["[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]+)"],so=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class ao{constructor(e){this._grammar=e}static _isNegative(e){return Jr.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(Xr)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(Zr)&&(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(eo,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>ao._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[to.join("|"),e.join("|"),no.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=ao._unquote(e):e.match(so)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(Zr)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let s=0;s<e.length;s+=1)ao._isWhitespace(e[s])?t.length&&(t[t.length-1].element+=e[s]):"-"===e[s]&&ao._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 ro=ao;const oo=class{constructor(e,t){this._grammar={...zr},this._expression=e,this._ast=null,this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new ro(this._grammar).tokenize(this._expression),t=new $r(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 po(e.operationType,Yr)&&Yr[e.operationType].call(this,e,t)}},io=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new oo(n,t)},co=e=>!e||e.buildAST(),lo=(e,t,n)=>!e||e.evaluate(t,n),uo=(e,t,n)=>{const s=io(e,t),a=co(s);return lo(a,n)},po=(e,t)=>e in t;const go=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:Vy.getPropertyValue(`${n}.${ks.getDefaultQualifiedName("pxObjClass")}`,null,t)||Vy.getPropertyValue(`${n}.${ks.getDefaultQualifiedName("pyClassName")}`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>Ey({type:sa,payload:{context:t,reference:n,value:e[n]}})))}},ho={},fo=(e,t)=>ho[t]&&Object.hasOwn(ho[t],e),mo=e=>{const{context:t}=e;fo(e.reference,t)&&go.handleExpression(e.reference,e.value,ho[t][e.reference],t)},Io=(e={})=>{Ly.copy(e,ho)},Eo=(e,t,n)=>uo(e,t,n?.pConnect.getPConnect());const yo=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 Ao=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={}){Ly.copy(e,this.componentMap)}mergeOverrideMap(e={}){Ly.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const Co=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}};const So=class{static handleAnnotation(e,t,n){const s=e.indexOf(" "),a=-1===s?e:e.substring(0,s),r=Co.getHandler(a);return r?r(e.substring(s+1),t,n):e}static trimAnnotation(e){if("string"!=typeof e)return e;const t=e.indexOf(" "),n=e.substring(0,t),s=e.substring(t+1);return Co.getHandler(n)?s:e}static handleComponentMapping(e,t,n){const s=Ao.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&&0===a.indexOf(".")?(a=a.substring(1),t[s]=e[a]):t[s]=a})),s.push(t)}))}}}static getPropertyName(e=""){if(e&&Ly.isString(e)){const t=e.startsWith(Ws.PROPERTY_ANNOTATION)||e.startsWith(Ws.ATTACHMENT_ANNOTATION)||e.startsWith(Ws.ASSOCIATED_PROPERTY_ANNOTATION)||e.startsWith(Ws.CLASS_ASSOCIATION_ANNOTATION)||e.startsWith(Ws.FILTERED_LIST_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(Ly.isString(e)&&!!e?.startsWith(Ws.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return Ly.isString(e)&&!!e?.startsWith(Ws.PROPERTY_ANNOTATION)}};function _o(e,t){return function(){return e.apply(t,arguments)}}const{toString:No}=Object.prototype,{getPrototypeOf:To}=Object,{iterator:Do,toStringTag:Oo}=Symbol,Po=(Ro=Object.create(null),e=>{const t=No.call(e);return Ro[t]||(Ro[t]=t.slice(8,-1).toLowerCase())});var Ro;const bo=e=>(e=e.toLowerCase(),t=>Po(t)===e),vo=e=>t=>typeof t===e,{isArray:xo}=Array,wo=vo("undefined");function Mo(e){return null!==e&&!wo(e)&&null!==e.constructor&&!wo(e.constructor)&&Fo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Lo=bo("ArrayBuffer");const Uo=vo("string"),Fo=vo("function"),jo=vo("number"),Vo=e=>null!==e&&"object"==typeof e,ko=e=>{if("object"!==Po(e))return!1;const t=To(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Oo in e||Do in e)},Bo=bo("Date"),$o=bo("File"),Wo=bo("Blob"),Go=bo("FileList");const Ho="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},qo=void 0!==Ho.FormData?Ho.FormData:void 0,zo=bo("URLSearchParams"),[Yo,Ko,Qo,Jo]=["ReadableStream","Request","Response","Headers"].map(bo);function Xo(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let s,a;if("object"!=typeof e&&(e=[e]),xo(e))for(s=0,a=e.length;s<a;s++)t.call(null,e[s],s,e);else{if(Mo(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 Zo(e,t){if(Mo(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 ei="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ti=e=>!wo(e)&&e!==ei;const ni=(si="undefined"!=typeof Uint8Array&&To(Uint8Array),e=>si&&e instanceof si);var si;const ai=bo("HTMLFormElement"),ri=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),oi=bo("RegExp"),ii=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Xo(n,((n,a)=>{let r;!1!==(r=t(n,a,e))&&(s[a]=r||n)})),Object.defineProperties(e,s)};const ci=bo("AsyncFunction"),li=(ui="function"==typeof setImmediate,di=Fo(ei.postMessage),ui?setImmediate:di?(pi=`axios@${Math.random()}`,gi=[],ei.addEventListener("message",(({source:e,data:t})=>{e===ei&&t===pi&&gi.length&&gi.shift()()}),!1),e=>{gi.push(e),ei.postMessage(pi,"*")}):e=>setTimeout(e));var ui,di,pi,gi;const hi="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ei):"undefined"!=typeof process&&process.nextTick||li,fi={isArray:xo,isArrayBuffer:Lo,isBuffer:Mo,isFormData:e=>{let t;return e&&(qo&&e instanceof qo||Fo(e.append)&&("formdata"===(t=Po(e))||"object"===t&&Fo(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Lo(e.buffer),t},isString:Uo,isNumber:jo,isBoolean:e=>!0===e||!1===e,isObject:Vo,isPlainObject:ko,isEmptyObject:e=>{if(!Vo(e)||Mo(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Yo,isRequest:Ko,isResponse:Qo,isHeaders:Jo,isUndefined:wo,isDate:Bo,isFile:$o,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:Wo,isRegExp:oi,isFunction:Fo,isStream:e=>Vo(e)&&Fo(e.pipe),isURLSearchParams:zo,isTypedArray:ni,isFileList:Go,forEach:Xo,merge:function e(){const{caseless:t,skipUndefined:n}=ti(this)&&this||{},s={},a=(a,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=t&&Zo(s,r)||r;ko(s[o])&&ko(a)?s[o]=e(s[o],a):ko(a)?s[o]=e({},a):xo(a)?s[o]=a.slice():n&&wo(a)||(s[o]=a)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Xo(arguments[e],a);return s},extend:(e,t,n,{allOwnKeys:s}={})=>(Xo(t,((t,s)=>{n&&Fo(t)?Object.defineProperty(e,s,{value:_o(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{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",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{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&&To(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Po,kindOfTest:bo,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(xo(e))return e;let t=e.length;if(!jo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Do]).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:ai,hasOwnProperty:ri,hasOwnProp:ri,reduceDescriptors:ii,freezeMethods:e=>{ii(e,((t,n)=>{if(Fo(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const s=e[n];Fo(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 xo(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:Zo,global:ei,isContextDefined:ti,isSpecCompliantForm:function(e){return!!(e&&Fo(e.append)&&"FormData"===e[Oo]&&e[Do])},toJSONObject:e=>{const t=new Array(10),n=(e,s)=>{if(Vo(e)){if(t.indexOf(e)>=0)return;if(Mo(e))return e;if(!("toJSON"in e)){t[s]=e;const a=xo(e)?[]:{};return Xo(e,((e,t)=>{const r=n(e,s+1);!wo(r)&&(a[t]=r)})),t[s]=void 0,a}}return e};return n(e,0)},isAsyncFn:ci,isThenable:e=>e&&(Vo(e)||Fo(e))&&Fo(e.then)&&Fo(e.catch),setImmediate:li,asap:hi,isIterable:e=>null!=e&&Fo(e[Do])};class mi extends Error{static from(e,t,n,s,a,r){const o=new mi(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",{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(){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:fi.toJSONObject(this.config),code:this.code,status:this.status}}}mi.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",mi.ERR_BAD_OPTION="ERR_BAD_OPTION",mi.ECONNABORTED="ECONNABORTED",mi.ETIMEDOUT="ETIMEDOUT",mi.ERR_NETWORK="ERR_NETWORK",mi.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",mi.ERR_DEPRECATED="ERR_DEPRECATED",mi.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",mi.ERR_BAD_REQUEST="ERR_BAD_REQUEST",mi.ERR_CANCELED="ERR_CANCELED",mi.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",mi.ERR_INVALID_URL="ERR_INVALID_URL";const Ii=mi;function Ei(e){return fi.isPlainObject(e)||fi.isArray(e)}function yi(e){return fi.endsWith(e,"[]")?e.slice(0,-2):e}function Ai(e,t,n){return e?e.concat(t).map((function(e,t){return e=yi(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Ci=fi.toFlatObject(fi,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Si=function(e,t,n){if(!fi.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const s=(n=fi.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!fi.isUndefined(t[e])}))).metaTokens,a=n.visitor||l,r=n.dots,o=n.indexes,i=(n.Blob||"undefined"!=typeof Blob&&Blob)&&fi.isSpecCompliantForm(t);if(!fi.isFunction(a))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(fi.isDate(e))return e.toISOString();if(fi.isBoolean(e))return e.toString();if(!i&&fi.isBlob(e))throw new Ii("Blob is not supported. Use a Buffer instead.");return fi.isArrayBuffer(e)||fi.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,a){let i=e;if(fi.isReactNative(t)&&fi.isReactNativeBlob(e))return t.append(Ai(a,n,r),c(e)),!1;if(e&&!a&&"object"==typeof e)if(fi.endsWith(n,"{}"))n=s?n:n.slice(0,-2),e=JSON.stringify(e);else if(fi.isArray(e)&&function(e){return fi.isArray(e)&&!e.some(Ei)}(e)||(fi.isFileList(e)||fi.endsWith(n,"[]"))&&(i=fi.toArray(e)))return n=yi(n),i.forEach((function(e,s){!fi.isUndefined(e)&&null!==e&&t.append(!0===o?Ai([n],s,r):null===o?n:n+"[]",c(e))})),!1;return!!Ei(e)||(t.append(Ai(a,n,r),c(e)),!1)}const u=[],d=Object.assign(Ci,{defaultVisitor:l,convertValue:c,isVisitable:Ei});if(!fi.isObject(e))throw new TypeError("data must be an object");return function e(n,s){if(!fi.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+s.join("."));u.push(n),fi.forEach(n,(function(n,r){!0===(!(fi.isUndefined(n)||null===n)&&a.call(t,n,fi.isString(r)?r.trim():r,s,d))&&e(n,s?s.concat(r):[r])})),u.pop()}}(e),t};function _i(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Ni(e,t){this._pairs=[],e&&Si(e,this,t)}const Ti=Ni.prototype;Ti.append=function(e,t){this._pairs.push([e,t])},Ti.toString=function(e){const t=e?function(t){return e.call(this,t,_i)}:_i;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Di=Ni;function Oi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Pi(e,t,n){if(!t)return e;const s=n&&n.encode||Oi,a=fi.isFunction(n)?{serialize:n}:n,r=a&&a.serialize;let o;if(o=r?r(t,a):fi.isURLSearchParams(t)?t.toString():new Di(t,a).toString(s),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const Ri=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){fi.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},bi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},vi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Di,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},xi="undefined"!=typeof window&&"undefined"!=typeof document,wi="object"==typeof navigator&&navigator||void 0,Mi=xi&&(!wi||["ReactNative","NativeScript","NS"].indexOf(wi.product)<0),Li="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ui=xi&&window.location.href||"http://localhost",Fi={...l,...vi};const ji=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&&fi.isArray(s)?s.length:r,i)return fi.hasOwnProp(s,r)?s[r]=[s[r],n]:s[r]=n,!o;s[r]&&fi.isObject(s[r])||(s[r]=[]);return t(e,n,s[r],a)&&fi.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(fi.isFormData(e)&&fi.isFunction(e.entries)){const n={};return fi.forEachEntry(e,((e,s)=>{t(function(e){return fi.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),s,n,0)})),n}return null};const Vi={transitional:bi,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",s=n.indexOf("application/json")>-1,a=fi.isObject(e);a&&fi.isHTMLForm(e)&&(e=new FormData(e));if(fi.isFormData(e))return s?JSON.stringify(ji(e)):e;if(fi.isArrayBuffer(e)||fi.isBuffer(e)||fi.isStream(e)||fi.isFile(e)||fi.isBlob(e)||fi.isReadableStream(e))return e;if(fi.isArrayBufferView(e))return e.buffer;if(fi.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Si(e,new Fi.classes.URLSearchParams,{visitor:function(e,t,n,s){return Fi.isNode&&fi.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((r=fi.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Si(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||s?(t.setContentType("application/json",!1),function(e,t,n){if(fi.isString(e))try{return(t||JSON.parse)(e),fi.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Vi.transitional,n=t&&t.forcedJSONParsing,s="json"===this.responseType;if(fi.isResponse(e)||fi.isReadableStream(e))return e;if(e&&fi.isString(e)&&(n&&!this.responseType||s)){const n=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw Ii.from(e,Ii.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Fi.classes.FormData,Blob:Fi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fi.forEach(["delete","get","head","post","put","patch"],(e=>{Vi.headers[e]={}}));const ki=Vi,Bi=fi.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"]),$i=Symbol("internals");function Wi(e){return e&&String(e).trim().toLowerCase()}function Gi(e){return!1===e||null==e?e:fi.isArray(e)?e.map(Gi):String(e)}function Hi(e,t,n,s,a){return fi.isFunction(s)?s.call(this,t,n):(a&&(t=n),fi.isString(t)?fi.isString(s)?-1!==t.indexOf(s):fi.isRegExp(s)?s.test(t):void 0:void 0)}class qi{constructor(e){e&&this.set(e)}set(e,t,n){const s=this;function a(e,t,n){const a=Wi(t);if(!a)throw new Error("header name must be a non-empty string");const r=fi.findKey(s,a);(!r||void 0===s[r]||!0===n||void 0===n&&!1!==s[r])&&(s[r||t]=Gi(e))}const r=(e,t)=>fi.forEach(e,((e,n)=>a(e,n,t)));if(fi.isPlainObject(e)||e instanceof this.constructor)r(e,t);else if(fi.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]&&Bi[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(fi.isObject(e)&&fi.isIterable(e)){let n,s,a={};for(const t of e){if(!fi.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[s=t[0]]=(n=a[s])?fi.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=Wi(e)){const n=fi.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(fi.isFunction(t))return t.call(this,e,n);if(fi.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wi(e)){const n=fi.findKey(this,e);return!(!n||void 0===this[n]||t&&!Hi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let s=!1;function a(e){if(e=Wi(e)){const a=fi.findKey(n,e);!a||t&&!Hi(0,n[a],a,t)||(delete n[a],s=!0)}}return fi.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&&!Hi(0,this[a],a,e,!0)||(delete this[a],s=!0)}return s}normalize(e){const t=this,n={};return fi.forEach(this,((s,a)=>{const r=fi.findKey(n,a);if(r)return t[r]=Gi(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]=Gi(s),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return fi.forEach(this,((n,s)=>{null!=n&&!1!==n&&(t[s]=e&&fi.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[$i]=this[$i]={accessors:{}}).accessors,n=this.prototype;function s(e){const s=Wi(e);t[s]||(!function(e,t){const n=fi.toCamelCase(" "+t);["get","set","has"].forEach((s=>{Object.defineProperty(e,s+n,{value:function(e,n,a){return this[s].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[s]=!0)}return fi.isArray(e)?e.forEach(s):s(e),this}}qi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),fi.reduceDescriptors(qi.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),fi.freezeMethods(qi);const zi=qi;function Yi(e,t){const n=this||ki,s=t||n,a=zi.from(s.headers);let r=s.data;return fi.forEach(e,(function(e){r=e.call(n,r,a.normalize(),t?t.status:void 0)})),a.normalize(),r}function Ki(e){return!(!e||!e.__CANCEL__)}const Qi=class extends Ii{constructor(e,t,n){super(null==e?"canceled":e,Ii.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ji(e,t,n){const s=n.config.validateStatus;n.status&&s&&!s(n.status)?t(new Ii("Request failed with status code "+n.status,[Ii.ERR_BAD_REQUEST,Ii.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Xi=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 Zi=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)]},ec=(e,t,n=3)=>{let s=0;const a=Xi(50,250);return Zi((n=>{const r=n.loaded,o=n.lengthComputable?n.total:void 0,i=r-s,c=a(i);s=r;e({loaded:r,total:o,progress:o?r/o:void 0,bytes:i,rate:c||void 0,estimated:c&&o&&r<=o?(o-r)/c:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},tc=(e,t)=>{const n=null!=e;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},nc=e=>(...t)=>fi.asap((()=>e(...t))),sc=Fi.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Fi.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Fi.origin),Fi.navigator&&/(msie|trident)/i.test(Fi.navigator.userAgent)):()=>!0,ac=Fi.hasStandardBrowserEnv?{write(e,t,n,s,a,r,o){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];fi.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),fi.isString(s)&&i.push(`path=${s}`),fi.isString(a)&&i.push(`domain=${a}`),!0===r&&i.push("secure"),fi.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function rc(e,t,n){let s=!("string"==typeof(a=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a));var a;return e&&(s||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const oc=e=>e instanceof zi?{...e}:e;function ic(e,t){t=t||{};const n={};function s(e,t,n,s){return fi.isPlainObject(e)&&fi.isPlainObject(t)?fi.merge.call({caseless:s},e,t):fi.isPlainObject(t)?fi.merge({},t):fi.isArray(t)?t.slice():t}function a(e,t,n,a){return fi.isUndefined(t)?fi.isUndefined(e)?void 0:s(void 0,e,0,a):s(e,t,0,a)}function r(e,t){if(!fi.isUndefined(t))return s(void 0,t)}function o(e,t){return fi.isUndefined(t)?fi.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function i(n,a,r){return r in t?s(n,a):r in e?s(void 0,n):void 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,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>a(oc(e),oc(t),0,!0)};return fi.forEach(Object.keys({...e,...t}),(function(s){if("__proto__"===s||"constructor"===s||"prototype"===s)return;const r=fi.hasOwnProp(c,s)?c[s]:a,o=r(e[s],t[s],s);fi.isUndefined(o)&&r!==i||(n[s]=o)})),n}const cc=e=>{const t=ic({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:r,headers:o,auth:i}=t;if(t.headers=o=zi.from(o),t.url=Pi(rc(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&o.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),fi.isFormData(n))if(Fi.hasStandardBrowserEnv||Fi.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(fi.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)}))}if(Fi.hasStandardBrowserEnv&&(s&&fi.isFunction(s)&&(s=s(t)),s||!1!==s&&sc(t.url))){const e=a&&r&&ac.read(r);e&&o.set(a,e)}return t},lc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const s=cc(e);let a=s.data;const r=zi.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=zi.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());Ji((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&&0===f.responseURL.indexOf("file:"))&&setTimeout(m)},f.onabort=function(){f&&(n(new Ii("Request aborted",Ii.ECONNABORTED,e,f)),f=null)},f.onerror=function(t){const s=t&&t.message?t.message:"Network Error",a=new Ii(s,Ii.ERR_NETWORK,e,f);a.event=t||null,n(a),f=null},f.ontimeout=function(){let t=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const a=s.transitional||bi;s.timeoutErrorMessage&&(t=s.timeoutErrorMessage),n(new Ii(t,a.clarifyTimeoutError?Ii.ETIMEDOUT:Ii.ECONNABORTED,e,f)),f=null},void 0===a&&r.setContentType(null),"setRequestHeader"in f&&fi.forEach(r.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),fi.isUndefined(s.withCredentials)||(f.withCredentials=!!s.withCredentials),d&&"json"!==d&&(f.responseType=s.responseType),g&&([c,u]=ec(g,!0),f.addEventListener("progress",c)),p&&f.upload&&([i,l]=ec(p),f.upload.addEventListener("progress",i),f.upload.addEventListener("loadend",l)),(s.cancelToken||s.signal)&&(o=t=>{f&&(n(!t||t.type?new Qi(null,e,f):t),f.abort(),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&&-1===Fi.protocols.indexOf(I)?n(new Ii("Unsupported protocol "+I+":",Ii.ERR_BAD_REQUEST,e)):f.send(a||null)}))},uc=(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 Ii?t:new Qi(t instanceof Error?t.message:t))}};let r=t&&setTimeout((()=>{r=null,a(new Ii(`timeout of ${t}ms exceeded`,Ii.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=()=>fi.asap(o),i}},dc=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},pc=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()}},gc=(e,t,n,s)=>{const a=async function*(e,t){for await(const n of pc(e))yield*dc(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})},{isFunction:hc}=fi,fc=(({Request:e,Response:t})=>({Request:e,Response:t}))(fi.global),{ReadableStream:mc,TextEncoder:Ic}=fi.global,Ec=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},yc=e=>{e=fi.merge.call({skipUndefined:!0},fc,e);const{fetch:t,Request:n,Response:s}=e,a=t?hc(t):"function"==typeof fetch,r=hc(n),o=hc(s);if(!a)return!1;const i=a&&hc(mc),c=a&&("function"==typeof Ic?(l=new Ic,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=r&&i&&Ec((()=>{let e=!1;const t=new n(Fi.origin,{body:new mc,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),d=o&&i&&Ec((()=>fi.isReadableStream(new s("").body))),p={stream:d&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!p[e]&&(p[e]=(t,n)=>{let s=t&&t[e];if(s)return s.call(t);throw new Ii(`Response type '${e}' is not supported`,Ii.ERR_NOT_SUPPORT,n)})}));const g=async(e,t)=>{const s=fi.toFiniteNumber(e.getContentLength());return null==s?(async e=>{if(null==e)return 0;if(fi.isBlob(e))return e.size;if(fi.isSpecCompliantForm(e)){const t=new n(Fi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return fi.isArrayBufferView(e)||fi.isArrayBuffer(e)?e.byteLength:(fi.isURLSearchParams(e)&&(e+=""),fi.isString(e)?(await c(e)).byteLength:void 0)})(t):s};return async e=>{let{url:a,method:o,data:i,signal:c,cancelToken:l,timeout:h,onDownloadProgress:f,onUploadProgress:m,responseType:I,headers:E,withCredentials:y="same-origin",fetchOptions:A}=cc(e),C=t||fetch;I=I?(I+"").toLowerCase():"text";let S=uc([c,l&&l.toAbortSignal()],h),_=null;const N=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let T;try{if(m&&u&&"get"!==o&&"head"!==o&&0!==(T=await g(E,i))){let e,t=new n(a,{method:"POST",body:i,duplex:"half"});if(fi.isFormData(i)&&(e=t.headers.get("content-type"))&&E.setContentType(e),t.body){const[e,n]=tc(T,ec(nc(m)));i=gc(t.body,65536,e,n)}}fi.isString(y)||(y=y?"include":"omit");const t=r&&"credentials"in n.prototype,c={...A,signal:S,method:o.toUpperCase(),headers:E.normalize().toJSON(),body:i,duplex:"half",credentials:t?y:void 0};_=r&&new n(a,c);let l=await(r?C(_,A):C(a,c));const h=d&&("stream"===I||"response"===I);if(d&&(f||h&&N)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=l[t]}));const t=fi.toFiniteNumber(l.headers.get("content-length")),[n,a]=f&&tc(t,ec(nc(f),!0))||[];l=new s(gc(l.body,65536,n,(()=>{a&&a(),N&&N()})),e)}I=I||"text";let D=await p[fi.findKey(p,I)||"text"](l,e);return!h&&N&&N(),await new Promise(((t,n)=>{Ji(t,n,{data:D,headers:zi.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:_})}))}catch(t){if(N&&N(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Ii("Network Error",Ii.ERR_NETWORK,e,_,t&&t.response),{cause:t.cause||t});throw Ii.from(t,t&&t.code,e,_,t&&t.response)}}},Ac=new Map,Cc=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=Ac;for(;c--;)o=r[c],i=l.get(o),void 0===i&&l.set(o,i=c?new Map:yc(t)),l=i;return i},Sc=(Cc(),{http:null,xhr:lc,fetch:{get:Cc}});fi.forEach(Sc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const _c=e=>`- ${e}`,Nc=e=>fi.isFunction(e)||null===e||!1===e;const Tc={getAdapter:function(e,t){e=fi.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,!Nc(s)&&(a=Sc[(n=String(s)).toLowerCase()],void 0===a))throw new Ii(`Unknown adapter '${n}'`);if(a&&(fi.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(_c).join("\n"):" "+_c(e[0]):"as no adapter specified";throw new Ii("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return a},adapters:Sc};function Dc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qi(null,e)}function Oc(e){Dc(e),e.headers=zi.from(e.headers),e.data=Yi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Tc.getAdapter(e.adapter||ki.adapter,e)(e).then((function(t){return Dc(e),t.data=Yi.call(e,e.transformResponse,t),t.headers=zi.from(t.headers),t}),(function(t){return Ki(t)||(Dc(e),t&&t.response&&(t.response.data=Yi.call(e,e.transformResponse,t.response),t.response.headers=zi.from(t.response.headers))),Promise.reject(t)}))}const Pc="1.13.6",Rc={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Rc[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const bc={};Rc.transitional=function(e,t,n){function s(e,t){return"[Axios v"+Pc+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,r)=>{if(!1===e)throw new Ii(s(a," has been removed"+(t?" in "+t:"")),Ii.ERR_DEPRECATED);return t&&!bc[a]&&(bc[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)}},Rc.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const vc={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ii("options must be an object",Ii.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let a=s.length;for(;a-- >0;){const r=s[a],o=t[r];if(o){const t=e[r],n=void 0===t||o(t,r,e);if(!0!==n)throw new Ii("option "+r+" must be "+n,Ii.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ii("Unknown option "+r,Ii.ERR_BAD_OPTION)}},validators:Rc},xc=vc.validators;class wc{constructor(e){this.defaults=e||{},this.interceptors={request:new Ri,response:new Ri}}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=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):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&&vc.assertOptions(n,{silentJSONParsing:xc.transitional(xc.boolean),forcedJSONParsing:xc.transitional(xc.boolean),clarifyTimeoutError:xc.transitional(xc.boolean),legacyInterceptorReqResOrdering:xc.transitional(xc.boolean)},!1),null!=s&&(fi.isFunction(s)?t.paramsSerializer={serialize:s}:vc.assertOptions(s,{encode:xc.function,serialize:xc.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),vc.assertOptions(t,{baseUrl:xc.spelling("baseURL"),withXsrfToken:xc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=a&&fi.merge(a.common,a[t.method]);a&&fi.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),t.headers=zi.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||bi;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=[Oc.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=Oc.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 Pi(rc((e=ic(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}fi.forEach(["delete","get","head","options"],(function(e){wc.prototype[e]=function(t,n){return this.request(ic(n||{},{method:e,url:t,data:(n||{}).data}))}})),fi.forEach(["post","put","patch"],(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}))}}wc.prototype[e]=t(),wc.prototype[e+"Form"]=t(!0)}));const Mc=wc;class Lc{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 Qi(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 Lc((function(t){e=t})),cancel:e}}}const Uc=Lc;const Fc={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(Fc).forEach((([e,t])=>{Fc[t]=e}));const jc=Fc;const Vc=function e(t){const n=new Mc(t),s=_o(Mc.prototype.request,n);return fi.extend(s,Mc.prototype,n,{allOwnKeys:!0}),fi.extend(s,n,null,{allOwnKeys:!0}),s.create=function(n){return e(ic(t,n))},s}(ki);Vc.Axios=Mc,Vc.CanceledError=Qi,Vc.CancelToken=Uc,Vc.isCancel=Ki,Vc.VERSION=Pc,Vc.toFormData=Si,Vc.AxiosError=Ii,Vc.Cancel=Vc.CanceledError,Vc.all=function(e){return Promise.all(e)},Vc.spread=function(e){return function(t){return e.apply(null,t)}},Vc.isAxiosError=function(e){return fi.isObject(e)&&!0===e.isAxiosError},Vc.mergeConfig=ic,Vc.AxiosHeaders=zi,Vc.formToJSON=e=>ji(fi.isHTMLForm(e)?new FormData(e):e),Vc.getAdapter=Tc.getAdapter,Vc.HttpStatusCode=jc,Vc.default=Vc;const kc=Vc;function Bc(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 $c=Bc((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var Wc=function(e,t){return Wc=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])},Wc(e,t)};function Gc(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}Wc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Hc(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 qc(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 zc(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 Yc(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 Kc(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 Qc(e){return this instanceof Qc?(this.v=e,this):new Qc(e)}function Jc(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 Qc?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 Xc(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=zc(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 Zc=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function el(e){return"function"==typeof e}function tl(e){return el(null==e?void 0:e.then)}var nl=Bc((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 sl(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var al=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=zc(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(el(c))try{c()}catch(e){a=e instanceof nl?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=zc(l),d=u.next();!d.done;d=u.next()){var p=d.value;try{il(p)}catch(e){a=null!=a?a:[],e instanceof nl?a=Kc(Kc([],Yc(a)),Yc(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 nl(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)il(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)&&sl(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&sl(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),rl=al.EMPTY;function ol(e){return e instanceof al||e&&"closed"in e&&el(e.remove)&&el(e.add)&&el(e.unsubscribe)}function il(e){el(e)?e():e.unsubscribe()}var cl={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ll={setTimeout:function(e,t){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];var a=ll.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,Kc([e,t],Yc(n))):setTimeout.apply(void 0,Kc([e,t],Yc(n)))},clearTimeout:function(e){var t=ll.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function ul(e){ll.setTimeout((function(){var t=cl.onUnhandledError;if(!t)throw e;t(e)}))}function dl(){}var pl=gl("C",void 0,void 0);function gl(e,t,n){return{kind:e,value:t,error:n}}var hl=null;function fl(e){if(cl.useDeprecatedSynchronousErrorHandling){var t=!hl;if(t&&(hl={errorThrown:!1,error:null}),e(),t){var n=hl,s=n.errorThrown,a=n.error;if(hl=null,s)throw a}}else e()}var ml=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,ol(t)&&t.add(n)):n.destination=_l,n}return Gc(t,e),t.create=function(e,t,n){return new Al(e,t,n)},t.prototype.next=function(e){this.isStopped?Sl(function(e){return gl("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Sl(gl("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Sl(pl,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}(al),Il=Function.prototype.bind;function El(e,t){return Il.call(e,t)}var yl=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){Cl(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Cl(e)}else Cl(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Cl(e)}},e}(),Al=function(e){function t(t,n,s){var a,r,o=e.call(this)||this;el(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=s?s:void 0}:o&&cl.useDeprecatedNextContext?((r=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},a={next:t.next&&El(t.next,r),error:t.error&&El(t.error,r),complete:t.complete&&El(t.complete,r)}):a=t;return o.destination=new yl(a),o}return Gc(t,e),t}(ml);function Cl(e){var t;cl.useDeprecatedSynchronousErrorHandling?(t=e,cl.useDeprecatedSynchronousErrorHandling&&hl&&(hl.errorThrown=!0,hl.error=t)):ul(e)}function Sl(e,t){var n=cl.onStoppedNotification;n&&ll.setTimeout((function(){return n(e,t)}))}var _l={closed:!0,next:dl,error:function(e){throw e},complete:dl},Nl="function"==typeof Symbol&&Symbol.observable||"@@observable";function Tl(e){return e}function Dl(e){return 0===e.length?Tl:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Ol=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 ml||function(e){return e&&el(e.next)&&el(e.error)&&el(e.complete)}(s)&&ol(s)?e:new Al(e,t,n);return fl((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=Pl(t))((function(t,s){var a=new Al({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[Nl]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Dl(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Pl(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 Pl(e){var t;return null!==(t=null!=e?e:cl.Promise)&&void 0!==t?t:Promise}function Rl(e){return el(e[Nl])}function bl(e){return Symbol.asyncIterator&&el(null==e?void 0:e[Symbol.asyncIterator])}function vl(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 xl="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function wl(e){return el(null==e?void 0:e[xl])}function Ml(e){return Jc(this,arguments,(function(){var t,n,s;return qc(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,Qc(t.read())];case 3:return n=a.sent(),s=n.value,n.done?[4,Qc(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Qc(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 Ll(e){return el(null==e?void 0:e.getReader)}function Ul(e){if(e instanceof Ol)return e;if(null!=e){if(Rl(e))return a=e,new Ol((function(e){var t=a[Nl]();if(el(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Zc(e))return s=e,new Ol((function(e){for(var t=0;t<s.length&&!e.closed;t++)e.next(s[t]);e.complete()}));if(tl(e))return n=e,new Ol((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,ul)}));if(bl(e))return Fl(e);if(wl(e))return t=e,new Ol((function(e){var n,s;try{for(var a=zc(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(Ll(e))return Fl(Ml(e))}var t,n,s,a;throw vl(e)}function Fl(e){return new Ol((function(t){(function(e,t){var n,s,a,r;return Hc(this,void 0,void 0,(function(){var o,i;return qc(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Xc(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 jl(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 Vl(e){return function(t){if(function(e){return el(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 kl(e,t,n,s,a){return new Bl(e,t,n,s,a)}var Bl=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 Gc(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}(ml);function $l(e,t){return void 0===t&&(t=0),Vl((function(n,s){n.subscribe(kl(s,(function(n){return jl(s,e,(function(){return s.next(n)}),t)}),(function(){return jl(s,e,(function(){return s.complete()}),t)}),(function(n){return jl(s,e,(function(){return s.error(n)}),t)})))}))}function Wl(e,t){return void 0===t&&(t=0),Vl((function(n,s){s.add(e.schedule((function(){return n.subscribe(s)}),t))}))}function Gl(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ol((function(n){jl(n,t,(function(){var s=e[Symbol.asyncIterator]();jl(n,t,(function(){s.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function Hl(e,t){if(null!=e){if(Rl(e))return function(e,t){return Ul(e).pipe(Wl(t),$l(t))}(e,t);if(Zc(e))return function(e,t){return new Ol((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(tl(e))return function(e,t){return Ul(e).pipe(Wl(t),$l(t))}(e,t);if(bl(e))return Gl(e,t);if(wl(e))return function(e,t){return new Ol((function(n){var s;return jl(n,t,(function(){s=e[xl](),jl(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 el(null==s?void 0:s.return)&&s.return()}}))}(e,t);if(Ll(e))return function(e,t){return Gl(Ml(e),t)}(e,t)}throw vl(e)}function ql(e,t){return t?Hl(e,t):Ul(e)}function zl(e,t,n){var s=el(e)||t||n?{next:e,error:t,complete:n}:e;return s?Vl((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var a=!0;e.subscribe(kl(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;a=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;a=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;a&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):Tl}function Yl(e){return Vl((function(t,n){var s,a=null,r=!1;a=t.subscribe(kl(n,void 0,void 0,(function(o){s=Ul(e(o,Yl(e)(t))),a?(a.unsubscribe(),a=null,s.subscribe(n)):r=!0}))),r&&(a.unsubscribe(),a=null,s.subscribe(n))}))}class Kl{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 Kl(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 Ql=Kl;const Jl=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}},Xl=/(([^.]+)\[\d+\])/g,Zl=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(Xl);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]},eu=(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:tu,WHEN:nu,DECLARATIVE_TARGET:su,PAGELIST:au}=Ws.CONTEXT_TREE_NODE_TYPES;let ru;const ou=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[tu,new Map],[nu,new Map],[su,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===au){const n=this.references.get(tu);n.set(e,t),this.references.set(tu,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const s=eu(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(tu),a=this.references.get(su);[...s.keys(),...a.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=Zl(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 Ql(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===tu&&n&&ru?.(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 Jl(t,n,s,a),i=this.references.get("WHEN");i?.set(r,o)}},{VIEW:iu,FIELD:cu,CONTEXT:lu,DECLARATIVE_TARGET:uu,WHEN:du}=$s.CONTEXT_TREE_NODE_TYPES;const pu=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new ou(lu,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){const a=this.addContextNode(e).addNode("PAGE",t);let r=null;if(s&&n!==s){r=this._addParentViewNode(e,t,s).addNode("VIEW",n)}else r=a.addNode("VIEW",n);a.addReference(n,r);const o=t.split(".");for(;o.length>0;){o.pop();const n=o.join("."),r=this.getContextNode(e)?.getNode("PAGE",n),i=r?.getReference(s);if(i){this.pushChildPageNodeToParentView(i,a,t);break}}return r}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}`,cu,a),r?.removeReference(`${t}${s}`,uu,a)}removeViewNode(e,t,n,s){const a=this.getContextNode(e),r=a?.getNode("PAGE",t),o=r?.getReference(n);this.removeChildViewNodes(e,t,n,s);const i=o?.parent?.children?.findIndex((e=>e.name===n))??-1;i>-1&&o?.parent?.children.splice(i,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===iu?this.removeChildViewNodes(e,t,r.name,s):(a.removeReference(r.name,cu,r.props.index),a.removeReference(r.name,uu,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(cu),s(uu)}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(cu),s(uu)}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(cu,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(uu,`${t}${n}`,s):e.addNode(cu,`${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=HI(n),o=II(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,cu);s||(s=t.addNode(cu,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]=Zl(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,r,o,{...s,rowIndex:i});const c=a?.getReference(`${t}.${n}`,cu);c&&c instanceof Ql&&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}`,cu);o&&o instanceof Ql&&o.triggerEvent(s,a)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(cu)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(cu)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(uu)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(cu)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(uu)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const s=this.getContextNode(e)?.references?.get(cu)?.get(t);s instanceof Ql&&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,cu),n=this.getContextReferencesByType(e,uu);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,cu)?.get(t)||!!this.getContextReferencesByType(e,uu)?.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(uu)||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(du)||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}},gu={CONTENT_FIELDS_PATH:[Ws.CONTEXT_DATA,Ws.CASE_INFO.CASE_INFO,Ws.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[Ws.CONTEXT_DATA,Ws.DATA_INFO.DATA_INFO,Ws.CONTENT],OBJECT_CONTENT_FIELDS_PATH:[Ws.CONTEXT_DATA,Ws.OBJECT_INFO.OBJECT_INFO,Ws.CONTENT],FIELD_MESSAGES_PATH:[Ws.CONTEXT_DATA,Ws.CASE_INFO.CASE_INFO,Ws.CONTENT,Ws.SUMMARY_OF_MESSAGES,Ws.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[Ws.CONTEXT_DATA,Ws.DATA_INFO.DATA_INFO,Ws.CONTENT,Ws.SUMMARY_OF_MESSAGES,Ws.PROPERTY_MESSAGES],OBJECT_FIELD_MESSAGES_PATH:[Ws.CONTEXT_DATA,Ws.OBJECT_INFO.OBJECT_INFO,Ws.CONTENT,Ws.SUMMARY_OF_MESSAGES,Ws.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[Ws.CONTEXT_DATA,Ws.SUMMARY_OF_MESSAGES,Ws.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[Ws.CONTEXT_DATA,Ws.SUMMARY_OF_MESSAGES,Ws.HTTP_MESSAGES],CASE_MESSAGE_PATH:[Ws.CASEMESSAGES]},hu=(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===Ws.PROPERTY&&e||e){a=[Ws.CONTEXT_DATA,...o.split(".")];for(let e=0;e<r.length-1;e+=1)a.push(r[e]);a.push(Ws.SUMMARY_OF_MESSAGES,Ws.PROPERTY_MESSAGES,r[r.length-1])}else n===$s.PAGE?a=[...gu.PAGE_MESSAGES_PATH]:n===Ws.HTTP?a=[...gu.HTTP_MESSAGES_PATH]:n===Ws.CASEMESSAGES?a=[...gu.CASE_MESSAGE_PATH]:s&&(a=[Ws.CONTEXT_DATA,...o.split(".")]);return a.filter(Boolean)},fu=(e,t,n)=>{const s={content:{}},a=`${t.split(".").slice(2).join(".")}[${n}]`,r=Ly.getIn(e?.content,a.split("."));return r&&Ly.setIn(s.content,a.split("."),{...r}),s},mu=(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)}]`]=Ly.getIn(e[t],[Ws.CONTEXT_DATA,...a.split(".")]),Ly.deleteIn(e[t],[Ws.CONTEXT_DATA,...a.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{Ly.setIn(e[t],[Ws.CONTEXT_DATA,...n.split(".")],o[n])}))},Iu=(e,t,n,s,a)=>{const r=Ly.deepClone(Ly.getIn(e,[`${t}`])),o=Ly.getIn(r,[Ws.CONTEXT_DATA,Ws.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=Ly.getIn(e,[Ws.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=fu(o,i,s).content;if(u&&Object.keys(u).length>0){const n={},o=`${i}[${s}]`,c=Ly.getIn(r,[Ws.CONTEXT_DATA,...o.split(".")]);n[`${i}[${a}]`]=c,Ly.deleteIn(e[t],[Ws.CONTEXT_DATA,...o.split(".")]),mu(e,t,l,s,a,i,n)}else mu(e,t,l,s,a,i)},Eu=e=>{const{type:t,property:n,category:s,context:a,pageReference:r}=e;let o;n&&(o=n.slice(1));const i=yy(a);let c=[];const l=Ly.getIn(i,hu(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&&pu.mutateField(a,r,n,{messages:[...c],type:$s.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},yu=e=>{const{property:t,pageReference:n,category:s,context:a,type:r,isListEntry:o,clearContextMessages:i,deletingIndex:c}=e,l={context:a,type:r};t&&!o?(pu.mutateField(a,n,t,{type:ur,fieldName:t}),l.property=t,l.pageReference=n):o?(l.pageReference=n,l.isListEntry=o,l.deletingIndex=c):l.category=s,Ey(i?{type:ur,payload:{stateObj:e.stateObj,context:a}}:{type:ur,payload:l})},Au=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,Ey({type:lr,payload:o})},Cu=(e,t,n)=>{for(const s of Object.keys(e)){if(t.push(s),s===Ws.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[s]&&Cu(e[s],t,n)}t.pop()}return n},Su=(e,t)=>{let n=Eu({context:Ws.APP.ROOT,category:"HTTP"});if(NE.getRenderingMode()===Ws.EMBED){const e=Eu({context:Ws.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=Eu({context:t,category:"HTTP"});n?e&&(n=n.concat(Eu({context:t,category:"HTTP"}))):n=Eu({context:t,category:"HTTP"})}return n},_u=e=>{let t=null;t=wI(e)[0]?OI(wI(e)[0]):e,t&&yu({context:t,stateObj:yy(t),clearContextMessages:!0})},Nu=e=>(Ly.getIn(yy(e),gu.PAGE_MESSAGES_PATH)??[]).some((e=>e.subType===Ws.CUSTOM_ERROR)),Tu={addMessages:Au,getValidationErrorMessages:(e,t)=>{const n=yy(e),s=(e=>{let t=gu.CONTENT_FIELDS_PATH;e?.objectInfo?t=gm.isObjectCaseType(e?.objectInfo?.objectTypeID)?gu.OBJECT_CONTENT_FIELDS_PATH:t:e?.dataInfo?.content&&(t=gu.DATA_OBJECT_CONTENT_FIELDS_PATH);return t})(n),a=Ly.getIn(n,[...s])||{},r=[];return Cu(a,[],[]).forEach((e=>{const n=Ly.getIn(a,[...e,Ws.PROPERTY_MESSAGES]);n&&Object.keys(n).forEach((e=>{n[e].forEach((e=>{if(e.type===Ws.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:Eu,clearMessages:yu,getRootContainerHttpMessages:Su,clearContextMessagesInActiveWorkArea:_u,clearContextMessages:e=>{const{context:t}=e;Ey({type:ur,payload:{clearAll:!0,context:t}})},isCustomPageErrorExist:Nu},Du=Tu;const Ou=class{constructor(e,t,n,s){this.eventType=e,this.callback=n,this.contextName=s,this.id=t}};const Pu=new class{constructor(){this.subscribers={}}publish(e,t){this.subscribers[e]?.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 Ou(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 Ru=class{static subscribe(e,t,n,s=!1,a="app"){Pu.subscribe(e,n,t,a,s)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){Pu.publish(e,t)}static unsubscribe(e,t,n="app"){Pu.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){Pu.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){Pu.clearContext(e)}};const bu=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||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){Ey({type:e?ha:ga,payload:{context:"app"}}),this.subscribers.forEach((t=>{t(e)}))}};const vu=new class{#e;#t;constructor(){this.#e="true"===localStorage.getItem("inspectorFlag"),this.#t=!1,this.isPreview=!1,this.debugLevels="vcv=1;tracer=0;log=0;metric=1"}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="true"===localStorage.getItem("inspectorFlag");this.#e=!e,localStorage.setItem("inspectorFlag",this.#e.toString()),Ru.publish(Ws.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e)}toggleInspectorShowAll(){this.#t=!this.#t,Ru.publish(Ws.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR_SHOW_ALL,this.#t)}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 xu{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new xu(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):cd(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=ld()}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:_E.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"),td(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?od({pzCTkn:e?.csrf}):(id({tokenInfo:e}),od({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 wu=xu,Mu=async()=>new Promise((async(e,t)=>{const n=ud();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 td(r,{method:"POST",headers:d,withCredentials:c,body:p.toString(),withoutDefaultHeaders:!0}),od({Authorization:null}),id({tokenInfo:null}),e()})),Lu=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new wu(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},Uu=(e,t)=>{Lu(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};Ru.publish($s.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},Fu=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};id({tokenInfo:{...e.tokenInfo,...s}}),e.secureCookie?od({pzCTkn:n?.csrf}):od({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:a}=e;a&&"function"==typeof a&&a(n)},failure:t=>{if(e.popupReauth)return Uu(t,e);Ru.publish($s.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${un()}/updateSession`,n={method:"GET",headers:{}},s={failure:Uu};return{url:t,config:n,callback:s,isRefreshTokenPresent:a}},ju=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Vu=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}},ku=(e,t,n)=>{const{config:s}=e,{url:a,config:r,callback:o,isRefreshTokenPresent:i}=Fu(n),c=s?.headers&&s.headers.context;s?.data&&(s.body=s.data);const l=nd(s.url,s,c,t);return i?td(a,r).then((e=>new Promise(((n,a)=>{setTimeout((()=>{t.setUpdateSessionStatus(!1),t.latestUpdateSessionTimeStamp=Date.now(),o?.success?.(e,s),Ru.publish("updateSession",{updateStatus:"success"}),Ru.publish("OnUpdateSession",{}),l.then((e=>{n(e)})).catch((e=>{a(e)}))}),0)})))).catch((e=>e&&e.config&&ju(e.config.url,n)?(o?.failure?.(s.url,n),l):Promise.reject(e))):(o?.failure?.(s.url,n),l)},Bu=(e,t,n,s)=>{if(e.config&&ju(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(Ru.unsubscribeAllWithEventType(Hu),t.setUpdateSessionStatus(!0),"custom"===n?.authType){Ru.publish($s.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:s,context:a}=Vu(e);return nd(n,s,a,t)}return ku(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}=Vu(e);return td(t,n,s)}if(e.response&&e.response.status&&422!==e.response.status&&424!==e.response.status&&(400!==e.response.status||e.response.data.errorClassification!==$s.INVALID_INPUTS)&&e.config.headers.context&&e.response.data&&!s){const t=e.response.data.errorDetails&&e.response.data.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"))),Au({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const $u=class{constructor(){this.updateSessionInProgress=!1,this.latestUpdateSessionTimeStamp=Date.now()}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const Wu=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{[Ws.COREHEADER_APP_DEBUG_ID]:e.debugId,[Ws.COREHEADER_APP_DEBUG_LEVELS]:vu.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=Vy.getProperty(Ws.COREHEADERS,"",e);return t?{...t,debugInfo:vu.getPreviewMode()&&{...t.debugInfo,[Ws.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(Ws.SKIPCOREHEADERS))return void delete e[Ws.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)}},Gu=Wu;const Hu="updateSession",qu={},zu=new $u,Yu=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&&(Ru.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((()=>{Ru.publish($s.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),Ru.subscribe($s.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let Ku={},Qu={},Ju={},Xu="";const Zu=e=>{Ku=e},ed=e=>{if("OAuth2.0"===e?.authType&&e.secureCookie||"custom"===e?.authType&&e.customCookies)return!0},td=(e,t,n="root",s={})=>{const{doNotMergeHttpMessagesForStatusCode:a=null,cancelContext:r=n,includeRemoteSystemIdIfPresent:o=!0}=s;Xu=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||Gu.injectCoreAdditionalHeaders(f,t.body,n,{includeRemoteSystemIdIfPresent:o}),r&&qu[r]>=0?qu[r]+=1:r&&void 0===qu[r]&&(qu[r]=1);let m=d?{...f}:{...Gu.getDefaultHeaders(),...Gu.getRegisteredHeaders(),...f,context:n};if(p.isExternalUrl=(e=>!e?.startsWith(un()||""))(e||""),p.fetchTimeStamp=Date.now(),e&&ju(e,Qu)&&zu.getUpdateSessionStatus()||!zu.getUpdateSessionStatus()||p.isExternalUrl){ju(e,Qu)&&"OAuth2.0"===Qu?.authType&&(m={...f});const{restApi:t}=_E.doesRestApiExist("Logout")&&_E.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&Yu.setTimerID(Yu.resetInactiveTimeout(Yu.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 $c)}})}))}(ql(kc({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:ed(Qu)})).pipe(zl((()=>{const e=Gu.getCoreHeadersFromContext(m.context);e&&(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.FETCH_SUCCESS,e)})({...e})})),Yl((e=>{const t=m,n=!!t?.[Ws.COREHEADER_APP_DEBUG_ID]?{debugInfo:{[Ws.COREHEADER_APP_DEBUG_ID]:t?.[Ws.COREHEADER_APP_DEBUG_ID],[Ws.COREHEADER_APP_DEBUG_LEVELS]:vu.getDebugLevels()}}:Gu.getCoreHeadersFromContext(m.context);throw n&&(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.FETCH_FAILURE,e)})({...n,error:e}),e}))))}return nd(e,t,n,zu)},nd=(e,t,n,s)=>new Promise(((a,r)=>{Ru.subscribe(Hu,(o=>{s.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?td(e,t,n).then((e=>a(e))).catch((e=>r(e))):r(o.updateStatus.error)}),Hu)})),sd=e=>{qu[e]>0&&(qu[e]-=1,0===qu[e]&&delete qu[e])};kc.interceptors.request.use((e=>bu.isOnline()?(Ku?.request&&(e=Ku.request(e)),e):(yy(e.context)?.isLoading&&Ey({type:pa,payload:{context:e.context}}),Ey({type:ga,payload:{context:"app"}}),Promise.reject(new Error("Network Offline")))),(e=>Promise.reject(e))),kc.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"))),Au({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return e.config.headers&&e.config.headers.context&&(e.config.skipClearErrorMessages||(Eu({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&yu({type:"error",category:"HTTP",context:e.config.headers.context}),Eu({type:"error",category:e.config.headers.context===Ws.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&yu({type:"error",category:"PAGE",context:e.config.headers.context})),sd(e.config.headers.context)),Ku?.response&&(e=Ku.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&sd(e.config.headers.context),"ERR_NETWORK"===e.code||"ECONNABORTED"===e.code||"Network Offline"===e.message||!0===e.isOffline?(yy(e.config?.headers?.context)?.isLoading&&Ey({type:pa,payload:{context:e.config?.headers?.context}}),bu.reportNetworkFailure(),Promise.reject(new Error("Network Offline"))):("Network Offline"!==e.message&&yy(Ws.APP.APP)?.context_data?.isOffline&&bu.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&&ju(e.config.url,Qu)||Ru.subscribe(Hu,(e=>{zu.setUpdateSessionStatus(!e.updateStatus)}),Hu),Bu(e,zu,Qu,e.response&&e.response.status&&e.response.status===Number(Xu)?Xu:null)))));const ad=()=>kc.CancelToken.source(),rd=e=>kc.isCancel(e),od=e=>{Gu.setDefaultHeaders(e)},id=e=>{Qu={...Qu,...e}},cd=e=>{Ju={...Ju,...e}},ld=()=>({...Ju}),ud=()=>({...Qu});const dd=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 pd=class{static execute(e,t,n,s){const a={};Object.hasOwn(n,"nonFormProperties")&&(n.nonFormProperties.forEach((e=>{a[e]=n[e],delete n[e]})),delete n.nonFormProperties);const r={instruction:"string"==typeof t?"ADD":"INSERT",content:{...Ly.unflatten(n)}},o=JSON.parse(JSON.stringify(r));delete o.content.classID;return{instruction:{target:Ly.buildInstructionPageReference(s,e),content:{...o.content},["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"string"==typeof t?"ADD":"INSERT"},actionPayload:r,displayPropertPayload:a}}};const gd=class{static execute(e,t,n,s,a,r,o,i){const c={instruction:"UPDATE",content:{...Ly.unflatten(s)},isDefault:i},l={content:{...c.content},target:Ly.buildInstructionPageReference(a,t),["string"==typeof n?"groupIndex":"listIndex"]:n,instruction:"UPDATE"};return r||Ey(_A({...c,["string"==typeof n?"groupIndex":"listIndex"]:"string"==typeof n?n:n-1,context:e,referenceList:`${a}${t}`,skipDirtyValidation:o})),l}};const hd=class{static execute(e,t,n){return{target:Ly.buildInstructionPageReference(n,e),["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"DELETE"}}};const fd=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:Ly.buildInstructionPageReference(e,t)}}static execute(e,t,n,s){s||Ey(_A({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const md=class{static execute(e,t,n,s){return{target:Ly.buildInstructionPageReference(s,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const Id=class{static execute(e,t,n){const s={instruction:"REPLACE",content:{...Ly.unflatten(t)}};return{instruction:{target:Ly.buildInstructionPageReference(n,e),content:{...s.content},instruction:"REPLACE"},actionPayload:s}}};const Ed=class{static execute(e,t){return{target:Ly.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const yd=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const Ad=class{constructor(e,t,n){this.target=e,this.pageReference=t,this.contextName=n,this.root=null,this.current=null,this.changeList={},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 yd(e);null===this.root&&(this.root=t),null!==this.current&&(t.previous=this.current,this.current.next=t),this.current=t}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=Xf(t),r={};let o=!0;n&&(r[Xf(n)]=crypto.randomUUID(),o=!1);const i={[a]:Ly.getIn(e,a),...r};this.update(i,s+1,o,{isDefault:!0,skipDirtyValidation:!0})}))}));s.forEach(((e,t)=>{if(n&&!e[Xf(n)]){const e={};e[Xf(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=Xf(e),r={};let o=!0;n&&(r[Xf(n)]=crypto.randomUUID(),o=!1);const i={[`${t}`]:Ly.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}=s,i=gd.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]=Ry(Ly.deepClone(n),e,s)}if(this.current?.automatic!==a||this.current?.instruction?.groupIndex!==t&&this.current?.instruction?.listIndex!==t||"UPDATE"!==this.current?.instruction.instruction)this.insertNode(i),a&&(this.current.automatic=!0);else{const t=this.current.instruction.content;this.current.instruction.content=Ry(Ly.deepClone(t),Ly.unflatten(e),s)}}}delete(e,t){const n=hd.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||Ey(_A({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={}}=pd.execute(this.target,t,e,this.pageReference),{isDefault:i=!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]=Ry(Ly.deepClone(n),e,s)}this.root&&!this.root.instruction?.instruction&&this.current&&!this.current.instruction?.instruction?this.root.instruction=a:this.insertNode(a),n||(r.content={...r.content,...o},Ey(_A({...r,["string"==typeof t?"groupIndex":"listIndex"]:"string"==typeof t?t:t-1,c11nEnv:s.c11nEnv,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))),i&&(this.current.automatic=!0)}replacePage(e,t){const{instruction:n,actionPayload:s}=Id.execute(this.target,e,this.pageReference);this.insertNode(n),t||Ey(_A({...s,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}deletePage(e){const t=Ed.execute(this.target,this.pageReference);this.insertNode(t),e||Ey(_A({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=md.execute(this.target,e,t,this.pageReference);this.insertNode(s),Ey(_A({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=fd.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),fd.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=Ry(Ly.deepClone(t),e)}},Cd={},Sd={},_d={},Nd=(e,t,n)=>{Cd[e]||(Cd[e]={}),Cd[e][t]||(Cd[e][t]={content:[]}),Sd[e]||(Sd[e]=[],_d[e]=[]),Qf.isStateMachineExist(e,n,t)||Qf.setStateMachine(e,t,n,new Ad(t,n,e))},Td=e=>dd.formatPageReference(e),Dd=(e,t)=>{const n=Sd[e],s=_d[e],a=Xf(t),r=a?.substring(0,a.indexOf("["));s?.indexOf(r)<0&&_d[e].push(r),n?.indexOf(a)<0&&Sd[e].push(a)},Od=e=>{delete Sd[e]},Pd=e=>Qf.buildPageInstructionsByContext(e),Rd=e=>{Qf.clearStateMachines(e),delete Cd[e]},bd=(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]})))},vd=(e,t,n,s,a)=>{const{skipStateUpdate:r=!1,insertIfEmpty:o=!1}=a||{},i=n.getContextName(),c=n.getReferenceList(),l=s||n.getPageReference(),u=Td(c);Nd(i,u,l),Dd(i,`${c}[${t}]`),bd(c,l,e,t);const d={instruction:Ws.LIST_ACTIONS.INSERT,content:{...Ly.unflatten(e)}};delete JSON.parse(JSON.stringify(d)).content.classID;const p=Qf.getStateMachine(i,l,u);o&&p?.root||p.insert(e,t+1,r,{c11nEnv:n})},xd=(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=Td(i);Nd(o,l,c),Dd(o,`${i}[${n}]`),bd(i,c,e,n);Qf.getStateMachine(o,c,l).update(e,n+1,a,s)},wd=(e,t)=>{const[,n]=e.split("."),s=t?.split(".").pop();return n===s},Md=(e,t,n)=>{const s={};return Object.values(e).forEach((e=>{if(wd(e,n)){const n=Ly.getPropertyName(e),a=n.substr(n.indexOf(".")+1).split(".");if(a.length>1){let e=Ly.getIn(t,a)??"";if(!e){const n=`!P!${a.join(":")}`;e=Ly.getIn(t,n)??""}Ly.setIn(s,a,e)}else{const e=Ly.getIn(t,a)??"";s[a[a.length-1]]=e}}})),s},Ld=(e,t,n,s,a)=>{const r=e.getValue(t)||{};n&&Object.keys(r).length>0&&e.clearErrorMessages({property:s?a:e.getStateProps().value})},Ud=(e,t,n)=>new Promise((s=>{const{skipPageInstructions:a=!1}=n,{selectionMode:r,selectionList:o,required:i}=t.getConfigProps(),c=r===Ws.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=>{const n=Ly.getPropertyName(t),s=n.substr(n.indexOf(".")+1).split(".");e[s.join(".")]=t}))})(E,m,c),c){let n=o;n=Td(n);const s=t.getValue(f)||[];Nd(t.getContextName(),n,u);const r=[];let i=s.length;e.forEach((e=>{const t=Md(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=Qf.getStateMachine(l,u,n);e.$selected?s.insert(t,p+1,!0,{}):s.delete(p+1,!0)}r.push({instruction:e.$selected?Ws.LIST_ACTIONS.SELECT:Ws.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...o}})})),Ey(_A({instruction:Ws.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${u}.${d}`,actions:r}))}else{const n=Md(E,e[0],d);Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],h?{contextPageReference:u}:{}),t.getActionsApi().triggerFieldChange(`.${d}.${e}`,n[e])}))}Ld(t,f,i,c,d),s()})),Fd=e=>{if(!e)return!1;const t=(n=e,Qf.buildPageInstructionsByContext(n,!0));var n;return Array.isArray(t)&&t.length>0};const jd=(e,t,n={})=>{const{skipStateUpdate:s=!1}=n,a=e.getPageReference(),r=Td(t);Nd(e.getContextName(),t,a);Qf.getStateMachine(e.getContextName(),a,r).deleteAll(s);const o=Qf.getUnConnectedStateMachines(e.getContextName())||{};Object.keys(o).forEach((e=>{e.includes(`${a}${r}`)&&e!==`${a}${r}`&&(o[e]=null)}))},Vd=e=>({insert:(t,n,s,a)=>vd(t,n,e,s,a),update:(t,n,s)=>xd(t,e,n,s),updateProperty:(t,n,s)=>((e,t,n,s={})=>{const a=n.getPageReference(),{stateMachineTarget:r}=Qf.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&&Nd(n.getContextName(),t,e)}Qf.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=Td(o);yu({type:$s.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:c,context:r,isListEntry:!0,deletingIndex:e}),Nd(r,l,i),Dd(r,`${o}[${e}]`);const u=Qf.getStateMachine(r,i,l);"string"==typeof e?u.delete(e,a):u.delete(e+1,a);const d=Qf.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=Td(a);Nd(s,o,r),pu.deleteAllListNodes(s,`${r}${o}`,!1),Dd(s,`${a}[${t}]`),Qf.getStateMachine(s,r,o).move(e+1,t+1);const i=Qf.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})=>Ud(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:s}=t.getConfigProps(),a=[];let r=t.getPageReference();const o=n===Ws.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 wd(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=Td(i),Nd(s,i,a),Qf.getStateMachine(s,a,i).deleteAll(),Ld(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===Ws.LIST_SELECTION_MODE.MULTI&&a?i=a:"Editable"===r&&o&&(i=e.getStateProps().referenceList),i){i=Td(i);const s=Qf.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=Td(t);Nd(a,o,r),Qf.getStateMachine(a,r,o).initPageInstructions(e,n,s)})(e,t,n,s),deleteAll:(t,n)=>jd(e,t,n),replacePage:(t,n,s)=>((e,t,n,s)=>{const{skipStateUpdate:a=!1}=s||{},r=e.getPageReference(),o=e.getContextName();Nd(o,t,r),Dd(o,Ly.buildInstructionPageReference(r,t)),Qf.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();Nd(r,t,a),Dd(r,Ly.buildInstructionPageReference(a,t)),Qf.getStateMachine(r,a,t).deletePage(s)})(e,t,n)});const kd=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?Ly.mergeDeep(e,this.fieldDefaults):Ly.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]}},Bd="downloadAttachment",$d={},Wd=e=>{const t=ad();return $d[e]=t,t},Gd=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},Hd=e=>{let t,n,s,a;return t=e.pyCategoryLabel?`${e.pyCategoryLabel},`:e.pyCategoryName?`${e.pyCategoryName},`:e.Category,n=e.pxCreateOpName?e.pxCreateOpName:e.pxCreateOperator?e.pxCreateOperator:e.CreateUser?.Name||"",s=e.pyFileName?e.pyFileName:e.FileExtension&&""!==e.FileExtension&&e.FileName.endsWith(e.FileExtension)?e.FileName.substring(0,e.FileName.lastIndexOf(e.FileExtension)-1):e.FileName,a=e.pyAttachName&&e.pyFileName?e.pyAttachName.startsWith(e.pyFileName)&&e.pyAttachName.split(".").length-1===e.pyFileName.split(".").length?e.pyAttachName.split(".").pop():"":e.FileExtension,{props:{meta:`${t} ${n}`,name:e.pyAttachName?e.pyAttachName:e.FileName,icon:Gd(e.pyMimeFileExtension||e.MimeType),error:e.error||null,thumbnail:e.thumbnail||null},responseProps:{fileName:e.pyAttachName?e.pyAttachName:e.FileName,name:s,category:e.pyCategoryName?e.pyCategoryName:e.Category,extension:a,ID:e.pzInsKey?e.pzInsKey:e.ID,mimeType:e.pyMimeFileExtension?e.pyMimeFileExtension:e.MimeType,attachmentURL:e.pyAttachmentLink?e.pyAttachmentLink:e.AttachmentURL,createUser:n,createDateTime:e.pxCreateDateTime?e.pxCreateDateTime:e.CreateDateTime,responseType:e.responseType??(e.ID?"binary":null),localAttachment:!!e.localAttachment,storageType:e.pxStorageType}}},qd=e=>{let t=[],n=!1;if(e&&Object.hasOwn(e,ks.getDefaultQualifiedName("pyCount")))n=!0,t=e?.pxResults?.filter((e=>!!e.pzInsKey)).map((e=>Hd(e)))||[];else if(e&&"object"==typeof e){let n;n=Array.isArray(e)?e:[e],t=n?.filter((e=>e.ID&&e.FileName||e.pzInsKey)).map(Hd)}else t=[];return{hasUploadedFiles:t.length>0,categoryName:e?.pyCategoryName||t?.[0]?.responseProps?.category||"",attachments:t,isOldAttachment:n}},zd={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}=jA("uploadAttachment",{}),l={"Content-Type":"multipart/form-data"};return Boolean(NE?.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories)&&(l["x-pega-stream-support"]="repository-stream"),td(i,{method:c,headers:l,body:o,onUploadProgress:t,signal:Wd(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(rd,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete $d[e.ID]))},linkAttachmentsToCase:(e,t,n,s)=>{const a={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,n&&(a.signal=Wd(n).token)}const{restApi:r,reqType:o}=jA("linkCaseAttachment",{caseID:e});return td(r,{...a,body:{attachments:t},method:o},s)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:s,reqType:a}=jA("getCaseAttachments",{caseID:e,includeThumbnail:n});return td(s,{method:a},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:s,reqType:a}=jA("getAttachmentCategories",{caseID:e,type:t});return td(s,{method:a},n).then((e=>e.data))},downloadAttachment:(e,t,n,s)=>{e=e.replace(/\//g,"_");const{restApi:a,reqType:r}=jA(Bd,{attachmentID:e});if(NE.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories&&a&&"Repository"===s){const e=new URL(a,window.location.origin);NE.environmentInfoObject?.encCSRFToken&&e.searchParams.set("pzencv1zzz",NE.environmentInfoObject.encCSRFToken),e.searchParams.set("mode","stream");const t=e.toString();return Promise.resolve({data:t})}return td(a,{method:r,..."binary"===n&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:s,reqType:a}=jA("editAttachment",{attachmentID:e});return td(s,{method:a,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:s}=jA("deleteAttachment",{attachmentID:e});return td(n,{method:s},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:s}=jA("downloadDocument",{documentID:e});return td(n,{method:s},t)},deleteDocument:(e,t,n)=>{const{restApi:s,reqType:a}=jA("deleteDocument",{caseID:e,documentID:t});return td(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=>{$d[e]&&($d[e].cancel(),delete $d[e])},buildFilePropsFromResponse:Hd,getAttachmentURL:e=>{const{restApi:t}=jA(Bd,{attachmentID:e});return t},prepareAttachmentData:qd,validateAttachments:(e,t)=>{let n=e;if("object"==typeof t&&"attachments"in t){const{attachments:e}=t;0===e.length&&(n="")}else{const{attachments:e}=qd(t);0===e.length&&(n="")}return n}};class Yd{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??{}}),Au({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=zd.validateAttachments(s,i);break;case"checkbox":o&&"false"!==o||(o="");break;default:"string"==typeof o&&(o=o.trim())}c=this.getValidator("required")(o),Yd.messageDispatcher(t,n,a,c,dd.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=kd.getDefaultsforType(r?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(s,i),(""!==s||kd.getDefaultsforType(r?.componentName||"")?.showErrorWhenEmpty)&&Yd.messageDispatcher(t,n,a,o,r?.label));const l=r?.validationType;return c=l&&kd.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(s,i),Yd.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||(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 Kd=new Yd,Qd=e=>{e&&YE(e)},Jd=(e,t)=>{e.DeclareExpressions&&t.context&&Io({[t.context]:e.DeclareExpressions})},Xd=(e,t,n=!1)=>{const s=Ly.getIn(e,Ws.RESOURCES);s&&(Qd(s),Jd(s,t)),n||qA({...e,options:t})};class Zd{static createCase(e,t){const{caseInfo:n,startingFields:s,flowType:a,viewType:r=_f.PAGE,pageName:o,context:i=Ws.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}=Zd.getExternalCaseOrObjectContent(e,d,i);let f={[Zd.getKeyBasedOnWorkType(e)]:e,content:{...p,...s,...g}};if(f={...f,...h&&{pageInstructions:h},...!gm.isObjectCaseType(e)&&{processID:a}},"CREATE_EXTERNAL_CASE"===u){const e=yy(i)?.caseInfo?.content;if(e){const t=Ly.pruneKeys(e,new Set(["pxObjClass","EmbedListUUID__"]),!1);f.content[Ws.getDefaultQualifiedName("pyAddCaseContextPage")]=t}}const m=Zd.getObjectTypeViewPayload(d,e);return np(gm.getRouteKeyForCreateWork(e,d),{body:f,queryPayload:{...m,...gm.isExternalCaseType(e)?{casetypeID:e}:{caseClassName:e},viewType:r,params:{pageName:o}},headers:{...l,...c&&{...Gu.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:f,headers:Tf(t.headers,e,l)})))}static getObjectTypeViewPayload=(e,t)=>e?gm.shouldUseUnifiedHandling()?{casetypeID:t,actionID:Ws.getDefaultQualifiedName(Ws.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{objectTypeID:t,actionID:Ws.getDefaultQualifiedName(Ws.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{};static getExternalCaseOrObjectContent=(e,t,n)=>{const s=gm.isExternalObject(e),a=gm.isExternalCaseType(e);if((a||s)&&!t){const e=Df(n,{isExternalObject:Boolean(!a&&s)}),{content:t,pageInstructions:r}=e.content;return{content:t,pageInstructions:r}}return{}};static getKeyBasedOnWorkType=e=>gm.shouldUseUnifiedHandling()?"caseTypeID":gm.isObjectCaseType(e)?"objectTypeID":"caseTypeID"}const ep=Zd,tp=()=>({registerHeader:(...e)=>Gu.registerHeader(...e),unRegisterHeader:(...e)=>Gu.unRegisterHeader(...e),getRegisteredHeaders:()=>Gu.getRegisteredHeaders()}),np=(e,{body:t={},queryPayload:n={},cancelTokenSource:s,headers:a={},responseType:r},o,i)=>{const{restApi:c,reqType:l}=jA(e,n),u={method:l,headers:a,body:t,...r&&{responseType:r}};s&&(u.signal=s.token);const d="createWork"===e?gm.appendExcludeQueryParamToUrl(c):c;return td(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 td(e,{method:t,headers:s,body:n,withoutDefaultHeaders:a},r)},ap=e=>_E.doesRestApiExist(e),rp=()=>ad(),op=e=>rd(e),ip=e=>{Zu(e)},cp=()=>ep,lp="getCustomComponent",up="text/javascript";const dp=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=NE.getBuiltOnAppNames(),a=this.loadAndFilterPegaComponentsConfig(e,s);let r=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(r=this.loadAndCustomerComponentsConfig(t,e));const o=[],i=NE.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=NE.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){const t=NE.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]}buildImageRequest(e,t){let n,s="getBinaryFile",a=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;if(t){const t=/DATA-CONTENT-IMAGE\s([^\s!]+)!.*\/OPERATORIMAGES\//i,r=e.match(t);r&&r[1]?(s="getOperatorImage",n={user_ID:r[1].toLowerCase()}):n={fileID:e},a=jA(s,n)?.restApi||a}return{callUrlKey:s,queryPayload:n,callUrl:a}}fetchImage(e,t,n,s){return s?np(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=NE.environmentInfoObject?.pyInfinityStaticService;if(t){const t=NE.environmentInfoObject?.pxApplication?.pxUpdateDateTime,n=t?Ly.parsePegaDateTimeToTimestamp(t):null,s=`${e}${n?`?v=${n}`:""}`;return(await np(lp,{queryPayload:{componentName:s}})).data}const n=NE.environmentInfoObject?.pyC11nDXCBDevURL,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=NE.environmentInfoObject?.pyInfinityStaticService,s=NE.environmentInfoObject?.pyC11nDXCBDevURL;let a=`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`;if(s){a=`${s.replace(/\/+$/,"")}/index.js`}if(n&&!s){const n=NE.environmentInfoObject?.pxApplication?.pxUpdateDateTime,s=Ly.parsePegaDateTimeToTimestamp(n),a=Ly.parsePegaDateTimeToTimestamp(t),r=[];s&&r.push(`v=${s}`),a&&r.push(`libV=${a}`);const o=r.length?`${e}?${r.join("&")}`:e,i=await np(lp,{queryPayload:{componentName:o}});return void this.appendCustomScriptToHead(i.data)}if(n||s){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=s?{}:{headers:{Authorization:`Bearer ${this.b2sJWT}`}},o=await fetch(a,r);o.ok||console.error("Error while fetching custom component map");const i=await o.text();this.setCCV2LibId(e),this.appendCustomScriptToHead(i)}catch(e){console.error("Exception while appending custom component map:",e)}}async appendCustomScriptToHead(e){try{const t=document.createElement("script");t.src=window.URL.createObjectURL(new Blob([e],{type:up})),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=>{const a=document.createElement("script");a.src=window.URL.createObjectURL(new Blob([s],{type:up})),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,e&&t&&"no-appstatic"!==t&&"no-cdn"!==t?(this.appStaticUrl=t.endsWith("/")?t:`${t}/`,this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.pegaOnlyUrl=!0):e&&t&&"no-appstatic"===t?(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,this.pegaOnlyUrl=!0):e&&t&&"no-cdn"===t&&(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=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)=>{const a=document.createElement(t);if("script"===t){const t=a;t.onload=()=>{n(e)},t.onerror=()=>{s(e)},t.type=up,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}=FA("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()))}},pp="component-loader",gp={},hp=async(e,t)=>{if(!e?.length||!1===window.PCore?.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();const n=dp.getLoader(),s=t||dp.staticServerURL;if(dp.getLoader(pp))return dp.getLoader(pp)(e,s);const a=new Set(Object.keys(gp)),r=e.flatMap((e=>{if(a.has(e))return[];const t=Ao.getComponent(e);if(!t){const t=`${dp.getConstellationServiceUrl()}/v860/${dp.getAppAlias()}/component/${e}.js`;return a.add(e),[n(t,dp.getTypes.SCRIPT)]}const r=(t.scripts||[]).map((e=>n(e.startsWith("http")?e:`${s}${e}`,dp.getTypes.SCRIPT))),o=(t.styles||[]).map((e=>n(`${s}${e}`,dp.getTypes.STYLE)));return a.add(e),[...r,...o]}));return Promise.all(r.map((e=>e.catch((e=>console.error("Error loading asset:",e))))))};const fp=new class{#n;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#n=!1}getNormalizedKey(e){return e?.toString().trim().replace(/\s/g,"-").toLowerCase()}setComponentState=(e,t)=>{sessionStorage?sessionStorage.setItem(this.getNormalizedKey(e),JSON.stringify(t)):console.error("Session Storage not found")};getComponentState=e=>{const t=sessionStorage.getItem(this.getNormalizedKey(e)),n=t?Ly.isValidJson(t):void 0;return n||t};removeComponentState=e=>{sessionStorage.removeItem(this.getNormalizedKey(e))};fetchUserSettings=async()=>{if(ap("getUserSettings")){const{restApi:e,reqType:t}=jA("getUserSettings");td(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=()=>{NE.getUserSettings()?this.userSettings=NE.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 Ly.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(!ap("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=jA("updateUserSettings");const{restApi:s,reqType:a}=n;return td(s,{method:a,body:Ly.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.#n){this.#n=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};Ru.subscribe(Ws.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(!NE.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 mp=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=>{bu.isOnline()&&t&&void 0!==this.contextArray[e]&&this.contextArray[e]>0&&Ey({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]&&Ey({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 Ip=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&&mp.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),mp.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),mp.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=Gs,e.gadgetId=t.gadgetId??gm.getUniqueGadgetId(),e.name=t.name,e.isRemoteCase=!0,e.skipSemanticUrl=!0,ia}};class Ep{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 yp=Ep,Ap=(e,t,n)=>_E.getResolvedSemanticURL(e,t,n),Cp={getResolvedSemanticURL:Ap,getActions:()=>({ACTION_OPENWORKBYHANDLE:Qa,ACTION_SHOWDATA:za,ACTION_SHOWVIEW:qa,ACTION_GETOBJECT:Mr,ACTION_SHOWINSIGHT:Ya,ACTION_SHOWDASHBOARD:Ka}),updateSemanticURLAndDocumentTitle:e=>_E.updateSemanticURLAndDocumentTitle(e),getSemanticURLForToaster:(e,t,n=!1)=>Ap(n?Mr:Qa,{caseClassName:e},{[n?"objectID":"workID"]:t})},Sp={CASE_INFO:`${Ws.DATA}.${Ws.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${Ws.DATA}.${Ws.CASE_INFO.CASE_TYPE_ID}`,CASE_INFO_ID:`${Ws.DATA}.${Ws.CASE_INFO.CASE_INFO_ID}`,BUSINESS_ID:`${Ws.DATA}.${Ws.CASE_INFO.BUSINESS_ID}`},_p=e=>Ly.getIn(e,Ws.getProperty(Sp.CASE_CLASS_NAME),Ws.EMPTY_STRING),Np=e=>Ly.getIn(e,Ws.getProperty(Sp.CASE_INFO_ID),Ws.EMPTY_STRING),Tp=(e,t)=>{const n=Np(t);Ly.setIn(e,"key",n)},Dp=e=>Ly.getIn(e,Ws.getProperty(Sp.CASE_INFO),{}),Op=e=>{const t=Iy();if(!e)return!1;const n=Ks(e),s=HI(n),a=HI(e);if(!s||!a)return!1;const r=II(s,n),o=II(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},Pp=e=>{const t=Np(e),n=Ly.getIn(e,Ws.getProperty(Sp.BUSINESS_ID),Ws.EMPTY_STRING),s=t.toLowerCase().includes(n.toLowerCase())?n:t,a=_p(e);return{businessID:n,caseType:a,resolvedURL:Cp.getSemanticURLForToaster(a,s,gm.isObjectCaseType(a))}};const Rp=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=im(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:a}=Kd.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,s);return a?{status:!1,message:a}:{status:!0}}},bp="OPEN_PROCESS_ACTION",vp="OPEN_ASSIGNMENT",xp="DELETE_CASE_IN_CREATE_STAGE",wp="SAVE_AND_CLOSE",Mp=e=>({type:wp,payload:e}),Lp="DELETE_WORK";const Up=class{static getSavableDataPage(e){return oy(e)}static getLookUpDataPage(e){return cy(e)}static getLookUpDataPageInfo(e){return ly(e)}static getDataPageKeys(e){return iy(e)}};const Fp=class{static getPropertyName(e){return So.getPropertyName(e)}static isProperty(e){return So.isProperty(e)}static getLeafPropertyName(e){return So.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};class jp{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 Hh({meta:i,options:{context:c,pageReference:u||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:s||n===gI.WORKAREA||n===gI.MODAL||l===Ws.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=Fp.isProperty(a),l=Fp.isProperty(s);if(l){const e=Fp.getPropertyName(s);i=Sy(`.${e}`,e.startsWith(".")?n:"",r)}if(i||(i=n),c){const e=Fp.getPropertyName(a);o=Sy(`.${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=OI(e),r=II(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(Ws.CASE_INFO.GETNEXTWORK);static getActiveCaseActionName=e=>{const t=e.getValue(Ws.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(Ws.CASE_INFO.ACTIVE_ACTION_ID),s=t.find((e=>e.ID===n));return s?.name||""};static getFirstCaseActionName=e=>{const t=e.getValue(Ws.CASE_INFO.CASE_INFO_ACTIONS);return t[0]?.name||""};static hasNotificationMessages=e=>!!e.getValue("caseMessages");static isCaseWideLocalAction=e=>{const t=e.getValue(Ws.CASE_INFO.ACTIVE_ACTION_ID),n=e.getValue(Ws.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(Ws.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(Ws.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),n=jp.getChildCaseAssignments(e);return!!(Array.isArray(n)&&n.length>0||Array.isArray(t)&&t.length>0||jp.isCaseWideLocalAction(e))};static showBanner=e=>{const t=e();return jp.hasNotificationMessages(t)||!jp.hasAssignments(t)};static showTodo=e=>"perform"!==e.getValue("context_data.caseViewMode");static isRenderWithToDoWrapper=(e,t)=>{const n=e(),{showWithToDo:s}=t;return s&&(!jp.isCaseWideLocalAction(n)||jp.showTodo(n))};static getToDoAssignments=e=>{const t=e.getValue(Ws.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(Ws.CASE_INFO.ASSIGNMENT_LABEL),s=e.getValue(Ws.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)||[],a=jp.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&&!jp.showTodo(e)&&(i=i.map((t=>(t.name=jp.getActiveCaseActionName(e)||t?.name||n,t)))),i}}const Vp=jp;const kp=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=Ip.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 Ip.register(t,a,n,s,e),{actionMgrID:t,promise:a}};initializeContainers(e){const t=Pa,n=this.c11nEnv,s={context:n.getContextName(),name:n.getContainerName(),type:Ws.CONTAINER_TYPE.SINGLE},{actionMgrID:a,promise:r}=this.containerManagerPromise(t),o={...s,...e,actionMgrID:a};return Ey(Xy(o)),r}addContainerItem(e){const t=ba,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===Ws.CONTAINER_TYPE.SINGLE),l=jr(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)),[Ws.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:d,promise:p}=this.containerManagerPromise(t),g={...u,...e,actionMgrID:d};return Ey(eA(g)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=ka,n={context:bI(e.containerItemID),target:HI(e.containerItemID)},{actionMgrID:s,promise:a}=this.containerManagerPromise(t),r={...n,...e,actionMgrID:s};return Ey(oA(r)),a}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=Va,n={target:HI(e.containerItemID)},{actionMgrID:s,promise:a}=this.containerManagerPromise(t),r={...n,...e,actionMgrID:s};return Ey(uA(r)),a}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=va,n={context:bI(e.containerItemID),target:HI(e.containerItemID)},{actionMgrID:s,promise:a}=this.containerManagerPromise(t),r={...n,...e,actionMgrID:s};return Ey(pA(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=Ra,n=$I(e),{actionMgrID:s,promise:a}=this.containerManagerPromise(t),r={...n,...e,actionMgrID:s};return Ey(Zy(r)),a}addTransientItem(e){const{id:t,data:n}=e,s=this.c11nEnv.getContextName(),a=Xs(t,s),r=QI(s);return a&&r.includes(a)||Ey(tA({transientItemID:a,contextName:s,target:HI(s),data:n})),a}updateTransientData(e){const{transientItemID:t,data:n}=e,s=this.c11nEnv.getContextName();if(t){if(!QI(s).includes(t))return;Ey(nA({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(!QI(t).includes(a))return;Ey(hA({target:n,containerItemID:s,transientItemID:a}))}}createContainerPConnect(e,t,n,s=!1){Vp.createContainerPConnect(e,t,n,s)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return jI(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return TI(e,t)}};function Bp(e,t){return Vl((function(n,s){var a=null,r=0,o=!1,i=function(){return o&&!a&&s.complete()};n.subscribe(kl(s,(function(n){null==a||a.unsubscribe();var o=0,c=r++;Ul(e(n,c)).subscribe(a=kl(s,(function(e){return s.next(t?t(n,e,c,o++):e)}),(function(){a=null,i()})))}),(function(){o=!0,i()})))}))}function $p(e,t){return Vl((function(n,s){var a=0;n.subscribe(kl(s,(function(n){s.next(e.call(t,n,a++))})))}))}function Wp(e,t,n){return void 0===n&&(n=1/0),el(t)?Wp((function(n,s){return $p((function(e,a){return t(n,e,s,a)}))(Ul(e(n,s)))}),n):("number"==typeof t&&(n=t),Vl((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;Ul(n(e,u++)).subscribe(kl(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?jl(t,o,(function(){return h(e)})):h(e)};c.length&&l<s;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(kl(t,g,(function(){d=!0,p()}))),function(){null==i||i()}}(t,s,e,n)})))}function Gp(e){return e&&el(e.schedule)}function Hp(e){return e[e.length-1]}function qp(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Gp(Hp(e))?e.pop():void 0}(e);return ql(e,n)}var zp=Bc((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Yp=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 Gc(t,e),t.prototype.lift=function(e){var t=new Kp(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new zp},t.prototype.next=function(e){var t=this;fl((function(){var n,s;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=zc(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;fl((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;fl((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?rl:(this.currentObservers=null,r.push(e),new al((function(){t.currentObservers=null,sl(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 Ol;return e.source=this,e},t.create=function(e,t){return new Kp(e,t)},t}(Ol),Kp=function(e){function t(t,n){var s=e.call(this)||this;return s.destination=t,s.source=n,s}return Gc(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:rl},t}(Yp),Qp=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return Gc(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}(Yp);function Jp(e,t){return Vl((function(n,s){var a=0;n.subscribe(kl(s,(function(n){return e.call(t,n,a++)&&s.next(n)})))}))}class Xp extends Qp{constructor(e,t){super(t)}}const Zp=(...e)=>Jp((t=>e.includes(t.type)));var eg=new Ol((function(e){return e.complete()}));function tg(e){return e?function(e){return new Ol((function(t){return e.schedule((function(){return t.complete()}))}))}(e):eg}const ng=(e,t,n)=>Yl((s=>("ERR_CANCELED"!==s?.code&&console.error(e,s),qp(AA(e,s,t,null,n))))),sg=(e,t)=>n=>new Ol((s=>{let a={},r=0;return n.pipe(Wp((n=>{const s=Date.now();let o;return o=t||sn,o&&o(n,a)&&s-r<e?tg():(a=n,r=s,qp(n))}))).subscribe(s)})),ag=e=>{const{dataPageID:t,context:n,headers:s,containerItemID:a}=e,r={data_view_ID:t},{restApi:o,reqType:i}=jA("createDataObject",r),{content:c}=Df(a);return ql(td(o,{method:i,headers:s,body:{data:c.content,pageInstructions:c?.pageInstructions}},a)).pipe($p((t=>({response:t.data,actionInPayload:e}))),ng("Error occurred during ajax call at createDataObject Epic",n))},rg=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}=jA("readDataObject",o);return ql(td(i,{method:c,headers:s,body:{dataViewParameters:r}},n)).pipe($p((t=>({response:t.data,headers:Tf(t.headers),actionInPayload:e}))),ng("Error occurred during ajax call at getDataObjectView Epic",n))},og=e=>{const{dataPageID:t,context:n,headers:s,containerItemID:a,key:r}=e,o={data_view_ID:t},{restApi:i,reqType:c}=jA("updateDataObject",o),{content:l}=Df(a);return ql(td(i,{method:c,headers:{...s,"if-match":e?.etag},body:{data:{...l.content,...r},pageInstructions:l.pageInstructions||[]}},a)).pipe($p((t=>({response:t.data,actionInPayload:e}))),ng("Error occurred during ajax call at updateDataObject Epic",n))},ig=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}=jA("openDataObjectAction",o);return ql(td(i,{method:c,headers:s,body:{dataViewParameters:r}},n)).pipe($p((t=>({response:t.data,headers:Tf(t.headers),actionInPayload:e}))),ng("Error occurred during ajax call at getDataObjectView Epic",n))},cg=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}=jA("submitDataObjectAction",c);const{reqType:u}=jA("submitDataObjectAction",c),{content:d}=Df(o);return l=Tm(i,l),ql(td(l,{method:u,headers:{...s,"if-match":e?.etag},body:{data:{...d?.content,...r},pageInstructions:d?.pageInstructions||[]}},n)).pipe($p((t=>({response:t.data,actionInPayload:e}))),ng("Error occurred during ajax call at getDataObjectView Epic",n))};const lg=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;bm(e,s,t,a,{})}}},ug="postDataViewMetadata",dg={getData:(e,t,n,s)=>((e,t,n,s={})=>{const a={dataViewName:e},{skipClearErrorMessages:r,signal:o,doNotMergeMessagesForStatusCode:i}=s,{restApi:c,reqType:l}=jA("getListData",a);return td(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}=jA("getListDataCount",s);return td(a,{method:r,body:t},n)},getDataViewMetadata:(e,t,n,s)=>{const a=!!n,r=!!s,o=_E.doesRestApiExist(ug),i=(a||r)&&o?ug:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:u}=jA(i,c);if(o){if(a)return td(l,{method:u,body:{associationFilter:n}},t);if(r)return td(l,{method:u,body:{propertyFilter:s}},t)}return td(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}=jA("readDataObject",c);return td(u,{method:d,body:l,...o&&{signal:o},...r&&{skipClearErrorMessages:r}},s,i)},getCaseEditMetadata:(e,t)=>gm.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>gm.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,s)=>gm.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}=jA("moveListRecords",c);return td(l,{method:u,body:{content:{sourceID:n,destinationID:s,context:a,listClass:r}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===Ws.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===Ws.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==wI("root").find((e=>e.includes("authoring-preview")))?`${Ws.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${dp.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=NE.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}},pg=e=>{if(e.indexOf("?")>0){const[t,n]=e.split("?"),s=new URLSearchParams(n),a=new Map;for(const[e,t]of s)"portal"!==e&&"noPortal"!==e&&"debug"!==e&&"activeTab"!==e&&"contextParam"!==e&&a.set(e,t);const r=new URLSearchParams(Array.from(a.entries())).toString();return r?`${t}?${r}`:t}return e},gg=(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=FA(Ja,{assignmentID:r});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:r},options:t,routeKey:cr,urlPath:a}})(e,t):_E.getEndPointInfo(e),hg=()=>{const e=NE.environmentInfoObject?.pyExecutionRuntimeName;return"Infinity"===e};const fg=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const mg=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 Ug.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],Ug.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 Ig=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 Eg=function(e){return e!=e};const yg=function(e,t,n){for(var s=n-1,a=e.length;++s<a;)if(e[s]===t)return s;return-1};const Ag=function(e,t,n){return t==t?yg(e,t,n):Ig(e,Eg,n)};const Cg=function(e,t){return!!(null==e?0:e.length)&&Ag(e,t,0)>-1};const Sg=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 _g=function(e,t,n,s){var a=-1,r=Cg,o=!0,i=e.length,c=[],l=t.length;if(!i)return c;n&&(t=Tn(t,ft(n))),s?(r=Sg,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 Ng=L?L.isConcatSpreadable:void 0;const Tg=function(e){return He(e)||at(e)||!!(Ng&&e&&e[Ng])};const Dg=function e(t,n,s,a,r){var o=-1,i=t.length;for(s||(s=Tg),r||(r=[]);++o<i;){var c=t[o];n>0&&s(c)?n>1?e(c,n-1,s,a,r):Ge(r,c):a||(r[r.length]=c)}return r};const Og=Ms((function(e,t){return us(e)?_g(e,Dg(t,1,us,!0)):[]}));const Pg=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],s=Object.keys(n.criteria),a=Object.keys(e);0===Og(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=Ug.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&&(Ug.unsubscribe(this.messagingServiceSubscriptionID),this.messagingServiceSubscriptionID=""))}};const Rg=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new Pg("CASE",t)}return this.subscriptions[e]}};const bg=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:vI(`${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+/)&&Qf.executeStateMachine(n,s,t,!0,{skipStateUpdate:!0});Ey([{type:sa,payload:{reference:s,value:t,context:n}},{type:ra,payload:{reference:s,value:t,context:n,pageReference:a,propertyName:r}}])}))}},{RESOURCE_TYPES:vg}=$s;const xg=class{static openCase(e,t,n,s={}){const a={insKey:e,acTargetName:n,actionMgrID:Ip.getNextActionMgrId(),context:t,...s},r=Ia;s&&s.channelName?a.headers={[Ws.X_ORIGIN_CHANNEL]:s.channelName}:NE.isWSSPortal()&&(a.headers={[Ws.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Ip.actionManagerPromise(r,a.actionMgrID);return Ey({type:r,payload:a}),o}static openAssignment(e,t,n,s={}){const a={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:Ip.getNextActionMgrId(),context:t,...s},r=Ca;s&&s.channelName?a.headers={[Ws.X_ORIGIN_CHANNEL]:s.channelName}:NE.isWSSPortal()&&(a.headers={[Ws.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Ip.actionManagerPromise(r,a.actionMgrID);return Ey({type:r,payload:{...a}}),o}static createCase(e,t,n,s={}){const a=ma,r={class:e,acTargetName:n,actionMgrID:Ip.getNextActionMgrId(),context:t,...s};s&&s.channelName?r.headers={[Ws.X_ORIGIN_CHANNEL]:s.channelName}:NE.isWSSPortal()&&(r.headers={[Ws.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Ip.actionManagerPromise(a,r.actionMgrID);return Ey({type:a,payload:{...r}}),o}static getNextWork(e,t,n={}){const s=Ca,a={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:Ip.getNextActionMgrId(),context:e,...n},{promise:r}=Ip.actionManagerPromise(s,a.actionMgrID);return Ey({type:s,payload:{...a}}),r}static getOpenedCaseItems(e){const t=[],n=mI(e);if(n){const{items:s={}}=n,a=Object.keys(s),r=OI(e);a.forEach((n=>{if(s[n]&&(s[n].resourceType===vg.CASE||s[n].resourceType===vg.ASSIGNMENT||s[n].resourceType===vg.OBJECT)){const{key:a="",context:o}=s[n],i=s[n],c=a.substring(a.indexOf(" ")+1),l=Sy(".caseTypeID",Ws.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}=jA(Qa,n),r={},o=qs.getRemoteHeaderFromSourceClass(t??"");return o&&(r.RemoteSystemID=o),td(s,{method:a,headers:r})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=jA("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(td(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}=jA("getCaseBulkActions",t),a=await td(n,{method:s});let r=[];return a.data?.availableActions?.length&&(r=a.data.availableActions),r}};class wg{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=fp.getComponentCache("lastActionID")||"";if("string"==typeof s&&s?.toLowerCase()!==n?.toLowerCase())return;let a=!1;const r=OI("app/modal");r&&(a=II("app/modal",r)?.isMinimizable??!1),!r||a?xg.openCase(t,Ws.APP.APP,Ws.PRIMARY,{isAutoRedirection:!0}):Ru.subscribe(this.CLOSE_CONTAINER_ITEM_EVENT,(e=>{e?.containerItemID===r&&(Ru.unsubscribe(this.CLOSE_CONTAINER_ITEM_EVENT,"closeContainerItemForRedirection"),xg.openCase(t,Ws.APP.APP,Ws.PRIMARY,{isAutoRedirection:!0}))}),"closeContainerItemForRedirection",!0)}static handleRefreshObject(e){xg.openCase(e,Ws.APP.APP,Ws.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=NE.getOperatorIdentifier()||"",n={matcher:"REDIRECTION",criteria:{CurrentObjectID:e,UserID:t?.toLowerCase()}},s=Ug.subscribe(n,(n=>{this.handleObjectRedirection(n,{caseId:e,currUserID:t})}));this.objectRedirectionSubIds[e]=s}static unsubscribeToRedirection(e){Ug.unsubscribe(this.objectRedirectionSubIds[e]),delete this.objectRedirectionSubIds[e]}static subscribeToEvent(e,t){let n=null;if(e===Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?n=e=>{const{caseId:t}=e;this.objectRedirectionSubIds[t]||this.subscribeToRedirection(t)}:e===Ws.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}`);Ru.subscribe(e,n,t)}static unsubscribeToEvent(e,t){Ru.unsubscribe(e,t)}static subscribeToCaseEvents(){this.subscribeToEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.subscribeToEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}static unsubscribeToCaseEvents(){this.unsubscribeToEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.unsubscribeToEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}}const Mg=wg;class Lg{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new mg;static refreshB2SOffset=10;static agentSubscribeIdMap=new Map;static isAuthenticated=!1;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=dp.b2sJWT;if(!n||n.length<4)return;this.webSocket&&(console.debug(`[WS] initConnection: cleaning up existing socket (readyState=${this.webSocket.readyState})`),this.webSocket.close(),this.cleanSocketListeners());const s=t.endsWith("/")?t+"ws":t+"/ws";console.debug(`[WS] initConnection: opening new socket → ${s}`);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){console.debug(`[WS] handleOnError: error event (tokenExpiryTime=${this.getTokenExpiryTime()}s, isAuthenticated=${this.isAuthenticated}, reInitInterval=${!!this.reInitInterval})`,e),this.getTokenExpiryTime()<=0&&(console.debug("[WS] handleOnError: token expired — clearing reInitInterval, skipping reconnect"),clearInterval(this.reInitInterval),this.reInitInterval=void 0,this.isAuthenticated=!1)}static handleOnClose(e){console.debug(`[WS] handleOnClose: code=${e?.code}, reason="${e?.reason}", wasClean=${e?.wasClean}, isAuthenticated=${this.isAuthenticated}, reInitInterval=${!!this.reInitInterval}, tokenExpiryTime=${this.getTokenExpiryTime()}s`),null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),this.isAuthenticated=!1,e&&4001===e.code?console.debug("[WS] handleOnClose: code=4001 (invalid token) — skipping reconnect"):this.connectionConfig?.disableReInit?console.debug("[WS] handleOnClose: disableReInit=true — skipping reconnect"):this.reInitInterval||this.getTokenExpiryTime()<=0?console.debug(`[WS] handleOnClose: skipping reInitialization (reInitInterval=${!!this.reInitInterval}, tokenExpiryTime=${this.getTokenExpiryTime()}s)`):(console.debug("[WS] handleOnClose: triggering reInitialization()"),this.reInitialization())}static handleOnOpen(){if(console.debug("[WS] handleOnOpen: socket connected — clearing reInitInterval, sending token"),clearInterval(this.reInitInterval),this.reInitInterval=void 0,null!==this.webSocket&&1===this.webSocket.readyState){const e=dp.b2sJWT;if(!e||e.length<4)return void console.debug("[WS] handleOnOpen: no valid token available — skipping auth message");this.publishMessage({token:e})}}static unsubscribeAgentMessageCaseValues(e){if(e.assignmentID){const t=Lg.agentSubscribeIdMap.get(e.assignmentID);Lg.unsubscribe(t??""),Lg.agentSubscribeIdMap.delete(e.assignmentID)}}static subscribeAgentMessageCaseValues(e){const t={matcher:"COACH_UPDATE",criteria:{caseId:e.caseKey,assignmentId:e.assignmentID}},n=Lg.subscribe(t,(t=>{bg.publishCaseValuesUpdate(t,e)}));Lg.agentSubscribeIdMap.set(e.assignmentID,n)}static handleOnMessage(e){if(null!==e&&"ALIVE"===e.data)null===this.isServiceAlive&&this.checkLiveliness(Ws.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,Object.keys(this.subscribers).forEach((s=>{const a=this.subscribers[s];a?.filter&&a.filter.matcher===e&&Ly.isEqual(a.filter.criteria,n)&&a.messageHandler(t)}))}else if(t?.tokenExpiryTime){Ru.subscribe(Ws.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,Lg.subscribeAgentMessageCaseValues),Ru.subscribe(Ws.PUB_SUB_EVENTS.EVENT_CANCEL,Lg.unsubscribeAgentMessageCaseValues),Ru.subscribe(Ws.PUB_SUB_EVENTS.CASE_EVENTS.SAVE_ASSIGNMENT_COMPLETE,Lg.unsubscribeAgentMessageCaseValues),Ru.subscribe(Ws.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,Lg.unsubscribeAgentMessageCaseValues),this.isAuthenticated=!0,this.setTokenExpiryTime({tokenExpiryTime:t.tokenExpiryTime});const e=1e3*(this.getTokenExpiryTime()-this.refreshB2SOffset);setTimeout((()=>this.refreshB2STokenReInit()),e);let n=[];this.inProgressSubscriptions.forEach((({messageSubscriber:e,id:t})=>{n?.includes(t)||(n?.push(t),this.subscribeToSocket(e,t))})),this.inProgressSubscriptions=[],this.inProgressMessages.forEach((e=>{this.publishMessage(e)})),this.inProgressMessages=[],n=null}else console.error("filter missing from received data from messaging service",e.data)}}static reInitialization(e){const t=(new Error).stack?.split("\n").slice(2).map((e=>e.trim())).join("\n ");console.debug(`[WS] reInitialization: called (skipSetInterval=${e}, reInitInterval=${!!this.reInitInterval}, subscribers=${Object.keys(this.subscribers).length})\n Invoker stack:\n ${t}`),this.reInitInterval?console.debug("[WS] reInitialization: already in progress — skipping"):(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?(console.debug("[WS] reInitialization: skipSetInterval=true — calling initConnection immediately"),this.initConnection(this.connectionConfig)):(console.debug("[WS] reInitialization: scheduling reconnect every 5500ms via setInterval"),this.reInitInterval=setInterval((()=>{console.debug("[WS] reInitialization: interval tick — calling initConnection"),this.initConnection(this.connectionConfig)}),5500)))}static checkLiveliness(e){console.debug(`[WS] checkLiveliness: tick (isServiceAlive=${this.isServiceAlive}, timeToPing=${e}ms)`),!1===this.isServiceAlive?(console.debug("[WS] checkLiveliness: no ALIVE received since last tick — triggering reInitialization"),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 subscribe(e,t,n,s){this.connectionsCount+=1;const a=s||`${Date.now()}_${this.connectionsCount}`,r=new fg(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}),null===this.webSocket&&this.initConnection(this.connectionConfig),a)}static subscribeToSocket(e,t){this.subscribers[t]=e;const n={filter:e.filter,subscribe:{id:t}};this.webSocket?.send(JSON.stringify(n))}static unsubscribe(e,t){if(this.subscribers[e]){t||delete this.subscribers[e];const n={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(n))}}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 getCaseSubscription=e=>Rg.getOrCreateSubscription(e);static initObjectRedirectionSubscription=()=>Mg.subscribeToCaseEvents();static refreshB2STokenReInit=async()=>{if(hg()){const e={body:{B2SToken:dp.b2sJWT}};np("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(dp.b2sJWT=t,this.setTokenExpiryTime({tokenExpiryTime:Math.round(Date.now()/1e3)+60}),console.debug("[WS] refreshB2STokenReInit: new token received (Infinity path) — closing socket to reconnect with new token"),this.webSocket?.close()):console.log("refreshB2S: invalid b2s length")})).catch((e=>{console.log(`refreshB2S: error occurred while fetching: ${e}`)}))}else if(!ap("refreshB2S")){sp("/uas/api/v1/isolations/token/websocket-ticket",{method:"GET",withoutDefaultHeaders:!1},"").then((e=>{const{token:t}=e.data;t&&(dp.b2sJWT=t,this.setTokenExpiryTime({tokenExpiryTime:Math.round(Date.now()/1e3)+60}),console.debug("[WS] refreshB2STokenReInit: new token received (websocket-ticket path) — closing socket to reconnect with new token"),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 Ug=Lg;const Fg=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=Ry(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const jg=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}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={}){if(r.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),!this.isCacheable(e,a)||r.invalidateCache){const o=await this.fetchData(e,n,s,a,t,r);return{...o.data,data:this.isCacheable(e,a)?this.mergeDataStore(e,n,s,a,o):o.data?.data??[],pageNumber:o?.data?.pageNumber,pageSize:o?.data?.pageSize,queryStats:o?.data?.queryStats,status:o?.status}}const o=this.getData(e,n,s,a);if(o.length>0)return Promise.resolve({data:o});const i=await this.fetchData(e,n,s,a,t,r);return{...i.data,data:this.mergeDataStore(e,n,s,a,i),pageNumber:i?.data?.pageNumber,pageSize:i?.data?.pageSize,queryStats:i?.data?.queryStats,status:i?.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}=jA(Ws.GET_PAGE_DATA,{dataViewName:e,dataViewParameters:encodeURIComponent(JSON.stringify(n))}),i={method:o};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 td(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&&Ug.unsubscribe(e)):this.subscribedDataPageNames.set(t,a-1),!0}unsubscribeToDatapageUpdates(e,t,n={}){return this.unsubscribeToDataPageUpdates(e,t??"",n)}_isDataPageCached(e,t){if(t&&Ly.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 Fg;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 Fg);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&&gy.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=XE(e);return!t||"reloadOncePerInteraction"===t.refreshStrategy?.type}disableCache(e){this.isCacheEnabled=!e}generateHash(e,t,n){const s=XE(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??Ws.NULL_STRING)})),n&&c.push(JSON.stringify(n)),c.join(Ws.HASH_DELIMITER)&&(o=Ly.getHashedString(c.join(Ws.HASH_DELIMITER)),i=e+Ws.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),dg.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&&gy.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}};Ug.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 Vg=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 kg=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 Vg(t,n,a,s,r,o)),this.bufferedDataQueues[e]}},Bg=(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,$g=e=>e.map((e=>e.field)),Wg=(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;Bg(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=$g(e.query?.select);$g(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},Gg=(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]:!Ly.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),Hg=(e,t)=>{const{data:n}=t,{dataViewCallMap:s,filterDataOnClient:a}=e;Object.keys(s).forEach((e=>{s[e].resolve({data:a(e,n)})}))},qg=e=>({combiner:Wg,comparator:Gg,separator:Hg,...e}),zg=(e,t)=>{try{window.sessionStorage.setItem(e,t)}catch(e){}},Yg=(e,t="",n="IS_NULL")=>({comparator:n,lhs:{field:e},...t&&{rhs:{value:t}}}),Kg=e=>null!=e&&"object"==typeof e&&!("then"in e);class Qg{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.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(Ws.HASH_DELIMITER),r=Ly.getHashedString(a),o=`${e.dataSource}_${r}`,i=`__dataviewmetadata__${e.dataSource}`,c=dg.getAppCacheKey(i);if(window.sessionStorage.getItem(c)){const a=JSON.parse(`${window.sessionStorage.getItem(c)}`);if(t&&Qg.searchResultsCache?.[t]?.[o])n(Qg.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Qg.searchResultsCache?.persisted?.[o])n(Qg.searchResultsCache.persisted[o]);else{const r=new Qg(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,Qg.initializeCache(t,e,o,r),n(r)):(r.associationFilter=e.associationFilter,r.propertyFilter=e.propertyFilter,r.fetchMetaData(t).then((s=>{zg(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,Qg.initializeCache(t,e,o,r),n(r)})).catch((e=>{r.isInitialised=!1,s(e)})))}}else if(e.deferDatasource&&XE(e.dataSource)){const s=new Qg(e,t),a=XE(e.dataSource);s.isQueryable=!!a?.isQueryable,s.isInitialised=!0,s.dataSourceMetaData=a,zg(c,JSON.stringify({isQueryable:a?.isQueryable,dataSourceMetaData:a,isInitialised:!0})),s.context=t,Qg.initializeCache(t,e,o,s),n(s)}else{const a=new Qg(e,t);a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((s=>{zg(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,Qg.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,s(e)}))}}))}static bufferedDataView=new kg;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(qg(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Qg.searchResultsCache[e]}static initializeCache(e,t,n,s){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Qg.searchResultsCache[e]&&(Qg.searchResultsCache[e]={}),Qg.searchResultsCache[e][n]=s):(void 0===Qg.searchResultsCache.persisted&&(Qg.searchResultsCache.persisted={}),Qg.searchResultsCache.persisted[n]=s)}fetchMetaData(e){return dg.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Qg.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>jg.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?Yg(e,a,"EQ"):Yg(e),s[`T${n+1}`]=r})),{logic:Object.keys(s).join(` ${n} `),filterConditions:s}})(e,t,"AND");return{select:s,...a&&{filter:a},...dg.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)=>{const s=this.isQueryable?this.buildSchemaForQueryableDPWithKeys(e,t,n):this.buildSchemaForNonQueryableDP();return jg.getDataAsync(this.dataSource,this.context,s.dataViewParameters,this.isQueryable?s.paging:void 0,this.isQueryable?s.query:void 0,{...n})};getData(e,t){if(this.isQueryable){if(this.bufferInitialized)try{const t=this.buildSchemaForQueryableBufferDP(e);return Qg.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return jg.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return jg.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query,{...t})}return this.fetchNonQueryableResults(e,t)}getCachedResult(e,t){if(this.enablePagination&&Kg(t)&&t.has(this.pageNumber))return t.get(this.pageNumber);const n=this.cache.get(e);return this.enablePagination||!n||Kg(n)?void 0:n}handleCacheError(e,t){if(this.enablePagination){const t=this.cache.get(e);t&&Kg(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&&Kg(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&&!wy(this.context))return!1;const t=e.toLowerCase(),n=this.cache.get(t);return!!n&&(!this.enablePagination||Kg(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&&!wy(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=jg.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)=>(Object.keys(a).every((r=>!(s?.includes(r)&&a[r]&&this.positionMatches(`${a[r]}`,e,n))||(t.push({...a}),!1))),t)),[])}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),...dg.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...dg.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 Jg=Qg;class Xg{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=Ly.convertClipboardPageToPageRefNotation(n);const r=s.split("/").join(Ws.HASH_DELIMITER),o=Ly.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 Xg.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 Xg.initializeRefreshCache(this.refreshMap,a,`${e}-${n}`,o,t)}triggerPropChangeRefresh(e,t){const n=this.propChangeRefreshMap?.[t];if(!n)return!1;const s=Vy.getPropertyValue(Ws.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,e,t),{interestPage:a=""}=s||{},r=e=>Ly.convertPageRefToClipboardPageNotation(e).replace(`${Ws.CASE_INFO?.CASE_INFO_CONTENT}${a}`,"");if(n[e]){const t=r(e);return n[e].forEach((e=>e.callback(t))),!0}const o=pu.getContextReferences(t)?.get(e),i=o&&Vy.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(Ly.segmentsMatch(t,e)?s=e:c&&Ly.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 Zg=new Xg;const eh=class{static cleanCaches(e){gy.purgeCascadeFields(e),lg.removeContext(e),Jg.clearContextedCache(e),Ru.cleanContextSubscribers(e),Zf(e),pu.removeContextTreeNode(e),Ug.clearContext(e),Zg.deRegisterForRefresh(e)}},th="GET_DESCENDANTS",nh={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 sh=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]}},ah=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},rh=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)},oh=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e)},ih=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,e)};const ch=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:_a,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:_a,payload:{context:e,data:{context_data:{deferred_action_queue:a,blocking_action_counter:s,is_deferred_action_in_progress:r}}}}),t&&n.push(t)}}Ey(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=yy(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:_a,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:a,blocking_action_counter:s,is_deferred_action_in_progress:r}}}}),Ey(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=yy(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(Ey({type:_a,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 yy(e)?(Ey({type:Ir,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={...yy(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(Ey({type:Ir,payload:{context:e,isInitiateBlockingAction:!1}}),t.context_data.blocking_action_counter-=t.context_data.blocking_action_counter,this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_OPERATION))}cancelDeferredActionsOnError(e){if(!e)return;const t=yy(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&Ly.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),Ey({type:_a,payload:{context:e,data:{...n}}}),mp.disableLoadingIndicator({context:e})}}isDeferredActionInProgress(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=yy(e);return!(!t||!0!==t.context_data?.is_deferred_action_in_progress)}},lh=(e,t)=>{const n={},s=Up.getLookUpDataPage(e),a=Up.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}},uh=(e,t)=>{const n=Up.getSavableDataPage(e),s=Up.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}},dh=e=>{Ru.publish($s.PUB_SUB_EVENTS.EVENT_CANCEL,e)},ph=(e,t,n)=>gm.shouldUseUnifiedHandling()||(e=>{if(e.includes(Ws.ACTIONAREA))return!0;const t=pE(e),n=OI(`${t}/${Ws.ACTIONAREA}`);return Boolean(n?.includes(Ws.ACTIONAREA))})(e)?ya:_m(t,n??!1),gh=(e,t,n)=>{const{callbacks:s}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?s?.cancel?.():s?.submit?.()}))};const hh=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(Ws.getProperty($s.CASE_INFO.CASE_INFO_ID))||e?.links?.open?.href?.split("/")?.[2];getSaveActionPayload=(e,t=!1)=>{const n=e,s=n&&n.includes(Ws.MODAL),a=this.c11nEnv.getValue($s.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getValue($s.CASE_INFO.ASSIGNMENT_ID),o=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),i=this.c11nEnv.getContainerName(),c=this.c11nEnv.getValue($s.CASE_INFO.CASE_TYPE_ID),l=t?void 0:cm(this.c11nEnv.getContextName()),u=this.c11nEnv.getValue("isProcessAction","isProcessAction");return $y.buildActionObject({context:n,containerItemID:e,assignmentID:r,actionID:o,caseID:a,containerName:i,caseType:c,isModalAction:s,isFormValid:l,isProcessAction:u,saveOnly:t},this.c11nEnv)};actionsApiPromise=(e,t,n=!0)=>{let s,a,r="";r=t&&null!==t.actionMgrID?t.actionMgrID||"":Ip.getNextActionMgrId();const o=new Promise(((e,t)=>{s=e,a=t}));if(!s||!a)throw new Error("resolveFn or rejectFn is not defined.");return Ip.register(r,o,s,a,e,t,n),{actionMgrID:r,promise:o}};showDataObjectCreateView(e,t=$s.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=$y.buildActionObject({viewName:t,className:e},this.c11nEnv),s=ia,{promise:a}=this.actionsApiPromise(s,n);return Ey({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(!rI(t)){return new kp(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=er,s=$y.buildActionObject({containerItemID:e,context:t},this.c11nEnv),a=t&&t.includes(Ws.MODAL);Ey({type:n,payload:{...s,isModalAction:a,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:r}=this.actionsApiPromise(n,s);return r.then((()=>{dh({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=Iy()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(Ws.DATA_CLASS_NOT_FOUND));if(KE($s.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW)){const t=this.handleSubscript.call(this,e,this.c11nEnv);if(t)return t}const s=Up.getSavableDataPage(n),a=Er,r=!!e&&e.includes(Ws.MODAL),o=$y.buildActionObject({containerItemID:e,dataPageID:s},this.c11nEnv),{promise:i}=this.actionsApiPromise(a,o);return Ey({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:r,isFormValid:cm(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=yr,s=Up.getSavableDataPage(e),a=Up.getDataPageKeys(s),r={};if(a)for(const e of a)r[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=$y.buildActionObject({dataViewName:s,dataViewParameters:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return Ey({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=Ar,{dataPageID:a,dataViewParameters:r}=lh(e,t),o=$y.buildActionObject({dataLookUp:a,keyProperties:t,requestPayload:r,viewName:n.viewName||$s.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:Ws.MODAL,readOnly:n.readOnly,actionName:n.actionName},this.c11nEnv),{promise:i}=this.actionsApiPromise(s,o);return Ey({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}=Iy()?.getState()||{},s=n[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(Ws.DATA_CLASS_NOT_FOUND));const{dataPageID:a,keys:r}=uh(s,t),o=Cr,i=e&&e.includes(Ws.MODAL),c=$y.buildActionObject({containerItemID:e,dataPageID:a,key:r},this.c11nEnv),l=n[e]?.caseInfo?.headers?.etag,{promise:u}=this.actionsApiPromise(o,c);return Ey({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:cm(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=Sr,{dataViewParameters:r,dataPageID:o,dataPageKeys:i}=lh(e,t),c=$y.buildActionObject({actionID:n,actionName:s,dataViewParameters:r,lookupDatapage:o,containerName:Ws.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(a,c);return Ey({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}=Iy()?.getState()||{},r=a[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(Ws.DATA_CLASS_NOT_FOUND));const o=s?.jsActionQueryParams,i=pE(e),c=HI(i),l=II(c,i)||{},{resourceType:u="",key:d=""}=l,p=_r,{dataPageID:g,keys:h}=uh(r,t),f=$y.buildActionObject({containerItemID:e,actionID:n,resourceType:u,key:d,keys:h,savableDatapage:g,containerName:Ws.MODAL,context:e,jsActionQueryParams:o},this.c11nEnv);f.context=e;const m=a[e]?.caseInfo?.headers?.etag,{promise:I}=this.actionsApiPromise(p,f);return Ey({type:p,payload:{...f,isFormValid:cm(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(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=gm.shouldUseUnifiedHandling();return gm.isExternalCaseType(e)?xr:gm.isExternalObject(e)?t?xr:"CREATE_EXTERNAL_OBJECT":t?ma:gm.isObjectCaseType(e)?"CREATE_OBJECT":ma})(e);const a=$y.buildActionObject({class:e,flowType:ks.getDefaultQualifiedName("pyStartCase"),containerName:Ws.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[Ws.X_ORIGIN_CHANNEL]=t.channelName:NE.isWSSPortal()&&(a.headers[Ws.X_ORIGIN_CHANNEL]="WSS"),s=this.handleRemoteCaseForCreateWork(e,a,s),vu.getPreviewMode()){a.debugInfo={debugId:Ly.generateUniqueID()};const e=Gu.getCoreHeadersFromContext(a?.context||""),t=String(e?.debugInfo?.[Ws.COREHEADER_APP_DEBUG_ID]||"");t&&s!==ma&&(a.debugInfo={debugId:t})}return Ey({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,Ip.setRemoteCaseHeaderByContext(t,s),qs.isTraditionalRemoteCase(e)){const s={className:e,name:a,action:Pr,remoteClassName:n};return Ip.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=Ta,s=$y.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:a}=this.actionsApiPromise(n,s);return Ey({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=$y.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:a}=this.actionsApiPromise("GET_DESCENDANTS",s),r=(o={...s,context:n},{type:th,payload:o});var o;return Ey(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||Ws.PRIMARY,containerName:n.targetContainer||Ws.PRIMARY};let a=gm.shouldUseUnifiedHandling()||!gm.isObjectCaseType(t)?Ia:"GET_OBJECT";const r=$y.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(a,r);return r.headers={...r.headers},n.channelName?r.headers[Ws.X_ORIGIN_CHANNEL]=n.channelName:NE.isWSSPortal()&&(r.headers[Ws.X_ORIGIN_CHANNEL]="WSS"),r.className=t,qs.isRemoteCase(t)&&(a=this.setRemoteCaseParamsForOpenCase(r,t,a,n.remoteCaseMeta)),vu.getPreviewMode()&&![Ws.WORKAREA].includes(n.targetContainer)&&(r.debugInfo={debugId:Ly.generateUniqueID()}),Ey({type:a,payload:{...n,...r}}),o}setRemoteCaseParamsForOpenCase(e,t,n,s={}){const{RemoteSystemID:a,RemoteClassName:r,name:o}=qs.getRemoteCase(t);if(Ip.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:br,remoteClassName:r};return Ip.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};n.isChild&&(s.containerName=Ws.PRIMARY,s.isChild=n.isChild);let a=vp;const r=$y.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(a,r);if(r.headers=r.headers||{},n.channelName?r.headers[Ws.X_ORIGIN_CHANNEL]=n.channelName:NE.isWSSPortal()&&(r.headers[Ws.X_ORIGIN_CHANNEL]="WSS"),qs.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:s,name:o}=qs.getRemoteCase(t);if(Ip.setRemoteCaseHeaderByContext(r,s),r.remoteCaseMeta=n.remoteCaseMeta,qs.isTraditionalRemoteCase(t)||qs.getRemoteAppPlatformVersion(s??"")){const n={className:t,name:o,action:Rr,remoteClassName:e};a=Ip.setTraditionalRemoteCaseParams(r,n)}}r.className=t,r.activeItemCaseViewMode=this.c11nEnv.getValue("context_data.caseViewMode"),vu.getPreviewMode()&&![Ws.WORKAREA].includes(n.containerName)&&(r.debugInfo={debugId:Ly.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 Ey({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(Ws.ACTIONAREA)&&(e=OI(e)||e);const n=bI(e);let s=n;if(n?.includes(`/${Ws.WORKAREA}`)&&(s=n.substring(0,s?.lastIndexOf(`/${Ws.WORKAREA}`))),lm(n)){const e=[{type:"error",message:this.c11nEnv.getLocalizationService().getLocalizedMessage(this.MSG_ACTIVE_SUGGESTION_UNATTENDED)}];return Au({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}=Nm(e,this.c11nEnv,{isTriggeredFromDifferentContext:a}),g=fm(l);let h,f=!1;const m=c?.find((e=>e.ID===i));m?f="Case"===m?.type:h=yy(n);let{assignmentID:I}=Nm(e,this.c11nEnv,{isTriggeredFromDifferentContext:a});h?.context_data?.actionType&&(f=h.context_data.actionType===Ws.CASE,I=I||h.context_data.assignmentID);const E=Sm(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(Ws.MODAL)&&(C.containerName=Ws.MODAL,C.isModalAction=!0),C.outcome=t.outcomeID,C.jsActionQueryParams=t.jsActionQueryParams,l?.isLocalAction&&(C.viewType=_f.FORM);const S=ph(e,d,l?.isObjectWideAction),_=$y.buildActionObject(C,this.c11nEnv),{promise:N}=this.actionsApiPromise(S,_);return _.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||yy(n).context_data.isProcessAction,_.headers??={},NE.isWSSPortal()&&(_.headers[Ws.X_ORIGIN_CHANNEL]="WSS"),ch.executeOrQueueDeferredAction({type:S,payload:{..._,context:n}}),N}getNextWork(){if("HYBRID"===NE.getRenderingMode())return Ru.publish($s.PUB_SUB_EVENTS.CASE_EVENTS.GET_NEXT_WORK,{userIdentifier:NE.getOperatorIdentifier()}),Promise.resolve();const e=vp,t=$y.buildActionObject({containerName:Ws.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return Ey({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=vp,n=this.c11nEnv.getValue($s.CASE_INFO.CASE_INFO_ID),s=this.c11nEnv.getCaseSummary().headers,a=$y.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 Ey(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={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(Ws.MODAL)&&(a.containerName=Ws.MODAL,a.isModalAction=!0);const r=$y.buildActionObject(a,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,r),i=bI(e);return Ey({type:t,payload:{...r,context:i,cases:n,actionID:s,isFormValid:cm(i),classID:this.c11nEnv.getCurrentClassID()}}),o}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(Ws.MODAL)?Ws.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(Ws.MODAL)},r=$y.buildActionObject(a,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,r),i=bI(e);return Ey({type:t,payload:{...r,context:i,cases:n,actionID:s,isFormValid:cm(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=$y.buildActionObject(r,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return Ey({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 kp(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(Ey({type:sa,payload:{reference:$s.CASE_INFO.APPROVALFLAG,value:Ws.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)):(Ey({type:sa,payload:{reference:$s.CASE_INFO.APPROVALFLAG,value:Ws.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:Ws.DUPLICATE,context:e}},s={type:sa,payload:{reference:$s.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return Ey([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:Ws.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 Ey([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,gh(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===Ws.ACTIONAREA?Sa:(e=>gm.shouldUseUnifiedHandling()||"Object"!==e.type&&!gm.isObjectCaseType(e?.caseClassName||"")&&!window.location.href.includes("/objects/")?Sa:"OPEN_OBJECT_ACTION")(t),i=$y.buildActionObject(r,this.c11nEnv);t.containerName!==Ws.ACTIONAREA&&t.containerName!==Ws.WORKAREA||(i.skipMergeAssignmentsAndActions=!1);const{promise:c}=this.actionsApiPromise(o,i),l=this.c11nEnv.getContextName(),u=wI(l)[0];let d;if(d=OI(u),d?.includes("actionarea")&&o===Sa)return Ey({type:o,payload:{...i}}),c;if("Object"===t.type)return Ey({type:o,payload:{...i}}),c;let p=!1;const g=qs.getRemoteHeaderByContext(l);if(Ip.setRemoteCaseHeaderByContext(i,g),!u)return d=l,Ey({type:o,payload:{...i,contextName:l,continueExecution:p}}),c;const h=mI(u);if(h?.accessedOrder.forEach((e=>{n===h.items[e].key&&(p=!0,d=h.items[e].context)})),!p||d&&"review"===Iy()?.getState()?.data[d]?.context_data?.caseViewMode)return Ey({type:o,payload:{...i,contextName:l,continueExecution:p}}),c;const f=d,m=f&&f.includes(Ws.MODAL),I=t.assignKey||this.c11nEnv.getValue($s.CASE_INFO.ASSIGNMENT_ID),E=yy(d),y=E?.caseInfo?.assignments?E.caseInfo.assignments[0]?.actions[0]?.ID:void 0,A=this.c11nEnv.getContainerName(),C=this.c11nEnv.getValue($s.CASE_INFO.CASE_TYPE_ID),S=this.c11nEnv.getValue("isProcessAction","isProcessAction"),_=$y.buildActionObject({context:f,containerItemID:d,assignmentID:I,actionID:y,caseID:n,containerName:A,caseType:C,isModalAction:m,isFormValid:!0,isProcessAction:S},this.c11nEnv);_.context=d;const N=bI(d),T=this.c11nEnv.getCaseSummary(),D=fm(T),O=$y.buildActionObject({caseID:n,containerItemID:d,cancelContext:N},this.c11nEnv);let P={};return m?(O.acTargetName=Ws.MODAL,O.isInCreateStage=D,O.isModalAction=m,P={...O}):P={...O,acName:jr(this.c11nEnv.getContainerName(),O.context)},Ey({type:o,payload:{...i,contextName:l,saveActionPayload:_,cancelActionPayload:P,continueExecution:p}}),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,gh(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=bp,i=$y.buildActionObject(r,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return Ey({type:o,payload:{...i}}),c}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="NAVIGATE_TO_STEP",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=fm(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(Ws.MODAL)&&(o.acTargetName=Ws.MODAL);const i=$y.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=bI(t);return Ey({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=Aa,a=bI(e),r=e&&e.includes(Ws.MODAL),o=this.c11nEnv.getCaseSummary(),i=fm(o),c=this.c11nEnv.getValue(Ws.getProperty(n.CASE_INFO_ID)),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),u=$y.buildActionObject({caseID:c,containerItemID:e,context:a},this.c11nEnv);let d={};r?(u.acTargetName=Ws.MODAL,u.isInCreateStage=i,u.isModalAction=r,d={...u}):d={...u,acName:jr(this.c11nEnv.getContainerName(),u.context)};const{promise:p}=this.actionsApiPromise(s,u);return Ey({type:s,payload:d}),p.then((()=>{t||dh({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=er,a=e&&e.includes(Ws.MODAL),r=this.c11nEnv.getValue(t.CASE_INFO_ID),o=$y.buildActionObject({caseID:r,containerItemID:e,context:n},this.c11nEnv);if(!rI(n)){return new kp(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{ih(r),dh({caseID:r,context:this.c11nEnv.getContextName()})}))}Ey({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=er,s=e,a=s&&s.includes(Ws.MODAL),r=this.c11nEnv.getCaseSummary(),o=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_TYPE_ID)),i=fm(r),c=this.c11nEnv.getValue(Ws.getProperty(t.CASE_INFO_ID)),l=$y.buildActionObject({caseID:c,containerItemID:e,context:s},this.c11nEnv),u=this.c11nEnv.getValue("isProcessAction","isProcessAction"),d=NE.isCoexistenceAppOfType(Ws.APP_TYPE.UIKIT);if(l.isProcessAction=u,i&&(a||d)&&!hm(r)){const t=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.IS_FIRST_ASSIGNMENT)),c=rI(s);if(this.shouldDeleteCaseInCreateStage(c,t,d)){const t=!0===Boolean(gm.isExternalObject(o));return this.deleteCaseInCreateStage(e,t)}Ey({type:n,payload:{...l,isModalAction:a,isChildCase:Am(r),isInCreateStage:i}})}const{promise:p}=this.actionsApiPromise(n,l);return p.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=wp,n=this.getSaveActionPayload(e,!0),{promise:s}=this.actionsApiPromise(t,n);return ch.executeOrQueueDeferredAction(Mp(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=wp,n=this.getSaveActionPayload(e),{promise:s}=this.actionsApiPromise(t,n);return Ey(Mp(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=xp,s=e,a=s&&s.includes(Ws.MODAL),r=this.c11nEnv.getValue(Ws.getProperty($s.CASE_INFO.CASE_INFO_ID)),o=this.c11nEnv.getValue(Ws.getProperty($s.CASE_INFO.CASE_TYPE_ID)),i=$y.buildActionObject({caseID:r,caseType:o,containerItemID:e,context:s,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(Ws.getProperty($s.CASE_INFO.PARENTCASEINFO));i.isProcessAction=c,i.parentCaseInfo=l;const u=`${Ws.APP.APP}/${gI.PRIMARY}`,d=Mf(u,gI.PRIMARY);i.parentContext=d,a&&(i.targetName=Ws.MODAL,i.containerName=gI.MODAL,i.isModalAction=a),Ey((e=>({type:xp,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{dh({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}=_E.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=un()+t;return td(n,{method:"GET",headers:{}})}updateRecents(e,t,n,s){const{restApi:a}=_E.getRestEndPoint("updateRecents")||{},r=`${un()}${a}`;return td(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:s}})}logout(){const{restApi:e}=_E.getRestEndPoint("Logout")||{},t=`${un()}${e}`;return td(t,{method:"GET",headers:{}}).then((e=>(Object.keys(pu.rootNodes).forEach((e=>{eh.cleanCaches(e)})),pu.rootNodes={},sessionStorage.clear(),xy(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return td(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,ks.getDefaultQualifiedName("pyCasePreview"),{container:gI.PREVIEW,containerName:gI.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:gI.PREVIEW,containerName:gI.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=$y.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(Ws.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 Ey({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=$y.buildActionObject({viewName:e,className:t},this.c11nEnv),a=ia,{promise:r}=this.actionsApiPromise(a,s);return vu.getPreviewMode()&&(s.debugInfo={debugId:Ly.generateUniqueID()}),Ey({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=$y.buildActionObject({},this.c11nEnv),s=la,{promise:a}=this.actionsApiPromise(s,n);return Ey({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=$y.buildActionObject({},this.c11nEnv),s=ua,{promise:a}=this.actionsApiPromise(s,n);return Ey({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=$y.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:qs.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),r=ca;s?.containerName||(s.containerName="HYBRID"===NE.getRenderingMode()?sh.getRuntimeParam(Ws.HYRBID_ROOT_CONTAINERNAME):yp.getTargetViewContainerName(r));const{promise:o}=this.actionsApiPromise(r,a);return Ey({type:r,payload:{...a,...s,skipSemanticUrl:Boolean(s.skipSemanticUrl)}}),o}changeHandler(e,t){$y.changeHandler(e,t)}eventHandler(e,t){$y.eventHandler(e,t)}triggerFieldChange(e,t,n=!1,s={skipDirtyValidation:!1,skipPageInstructionGeneration:!1}){const a=this.c11nEnv.getContextName(),r=this.c11nEnv.getPageReference(),o=Vy.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(Ws.CLASS_ID);const c=e?e.split(".").filter((e=>!!e)):[];c.length>1&&(c.pop(),i=Sy(`.${c.join(".")}.classID`,r,a)),e=Ly.trimDotForProperty(e),Ey({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=Vy.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),yu({type:$s.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:d,context:u,isListEntry:o}),Ey({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=Wa,{context:n}=e,s=n&&n.includes(Ws.MODAL),a=$y.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);s&&(a.containerName=Ws.MODAL,a.isModalAction=s),Ey({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);const h=u||this.c11nEnv.getContextName(),f=this.c11nEnv.getPageReference();return!this.c11nEnv.getValue(Ws.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)&&o&&(ym(h,f)||Im(h,f))?jm(h,n,g):bm(e,t,h,n,g),a}refreshEmbeddedDataWithAction(e,t,n,s,a,r,o,i,c={}){const{promise:l}=this.actionsApiPromise(nh.REFRESH_DATA),u=this.c11nEnv.getContextName();return vm(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){const l=Nr;let u=t.getCaseInfo().getKey();const d=t.getValue($s.CASE_INFO.IS_LOCAL_ACTION),p=t.getValue($s.CASE_INFO.ASSIGNMENT_ID),g=((e,t,n)=>n||t!==Ws.ACTION?e.getValue($s.CASE_INFO.ACTIVE_ACTION_ID):e.getValue($s.CASE_INFO.ASSIGNMENTACTION_ID))(t,o,d),h=t.getPageReference();let f="string"==typeof s?`${t.getPageReference().replace(Ws.getProperty($s.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${s}`:`${t.getPageReference().replace(Ws.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=t.getMetadata(),I=Array.isArray(m?.config?.children)&&m.config.children[0]?.children||[],E={readOnly:c,targetProperty:n,index:s,viewID:e,ID:u,actionType:a,interestPage:Ly.convertPageRefToClipboardPageNotation(f),heading:r,editType:o,interestPageActionID:o===Ws.ACTION?i:void 0,actionID:g,isLocalAction:d,operationFlag:Ws.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof s,assignmentID:d||o!==Ws.ACTION?void 0:p,columns:I},y=$y.buildActionObject(E,this.c11nEnv);if(o===Ws.ACTION){const e=Ly.getETag(y.context);y.headers={"If-Match":e}}const{promise:A}=this.actionsApiPromise(l,y);return NE.getFeatureMap().granularUIRefresh&&I.forEach((e=>{const n=So.trimAnnotation(e.config.value),s=$E(n.startsWith(".")?n.replace(".",""):n,e.config.classID);s?.isDeclarativeTarget&&pu.addFieldNode(t.getContextName(),h+f,t.viewName??"",n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:h+f})})),Ey({type:l,payload:{...y,containerName:$s.MODAL,skipSemanticUrl:!0}}),A}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=Tr;let n=this.c11nEnv.getValue(Ws.getProperty($s.CASE_INFO.CASE_INFO_ID));const s=this.c11nEnv.getValue(Ws.getProperty($s.CASE_INFO.ASSIGNMENT_ID));let a=this.c11nEnv.getPageReference().replace(Ws.getProperty($s.CASE_INFO.CASE_INFO_CONTENT),"");const r=bI(e),o=this.c11nEnv.getValue(Ws.getProperty(Ws.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,"")),yu({context:r,stateObj:yy(r),clearContextMessages:!0});const g={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:n,viewID:d,isFormValid:cm(r),interestPage:Ly.convertPageRefToClipboardPageNotation(a),parentContext:p,isModalAction:!1,target:this.c11nEnv.getTarget(),editType:c,actionID:u,operationFlag:Ws.EMBEDDED_DATA_MODAL.SUBMIT_ROW,interestPageActionID:i,isLocalAction:l,assignmentID:s};e&&e.includes(Ws.MODAL)&&(g.containerName=Ws.MODAL,g.isModalAction=!0);const h=$y.buildActionObject(g,this.c11nEnv);if(c===Ws.ACTION){const e=Ly.getETag(h.context);h.headers={"If-Match":e}}const{promise:f}=this.actionsApiPromise(t,h);if(rI(r)){const[e,t,n]=Zl(this.c11nEnv.getPageReference());pu.mutatePageList(p,e,t,{type:ur,rowIndex:n}),Ey({type:ur,payload:{pageReference:this.c11nEnv.getPageReference(),context:p,isListEntry:!0}})}return ch.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=bI(e),n=this.c11nEnv.getPageReference(),{promise:s,actionMgrID:a}=this.actionsApiPromise(Or);return jm(t,n,{actionMgrID:a,isFillFormWithAI:!0,preserveClientChanges:!1}),s}handleSubscript(e,t){if(!KE($s.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW))return Promise.reject(new Error(this.MSG_SUBSCRIPT_VIEW_REQUIRED));const n=Dr,s=$y.buildActionObject({containerItemID:e},t);Ey({type:n,payload:{...s,isDataObject:!0,skipReleaseLockRequest:!0,isFormValid:cm(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=$y.buildActionObject({viewName:s,className:e,referenceListStr:t,subscriptName:n},this.c11nEnv),r=ia,{promise:o}=this.actionsApiPromise(r,a);return Ey({type:r,payload:{...a,containerName:$s.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),o}deleteWork(e,t){if(!e)return Promise.reject(new Error("workId is required parameter"));const n=gm.isExternalCaseType(t),s=$y.buildActionObject({workId:e,caseTypeID:t,isExternalCase:n},this.c11nEnv),{promise:a}=this.actionsApiPromise("DELETE_WORK",s);var r;return Ey((r={...s},{type:Lp,payload:r})),a}};const fh=class{constructor(e){this.c11nEnv=e}async getCaseStages(e,t){const n={caseID:e},{restApi:s,reqType:a}=jA("getCaseStages",n);return(await td(s,{method:a},t)).data.stages}async getCaseActions(e,t){const n={caseID:e},{restApi:s,reqType:a}=jA("getActions",n);return(await td(s,{method:a},t)).data}getCaseTypeName(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_TYPE_NAME))}getName(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_INFO_NAME))}getClassName(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_TYPE_ID))}getAvailableProcesses(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.AVAILABLEPROCESSES))}getKey(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_INFO_ID))}getObjectKey(){return this.c11nEnv.getValue(Ws.OBJECT_INFO.OBJECT_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.ASSIGNMENT_ID))}getActions(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.ACTION_BUTTONS))}getActiveFlowActionID(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.ACTIVE_ACTION_ID))||this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.ASSIGNMENTACTION_ID))}getParentCaseInfo(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.PARENTCASEINFO))}isPerform(){return this.c11nEnv.getValue(`${Ws.CONTEXT_DATA}${Ws.CASE_VIEW_MODE_PROP}`)===Ws.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${Ws.CONTEXT_DATA}${Ws.CASE_VIEW_MODE_PROP}`)===Ws.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_INFO));return fm(e)}isLocalAction(){const e=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_INFO));return hm(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===Ws.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),s=II(t,n),{config:a}=t&&n?s&&s.view:this.c11nEnv.getMetadata();e=a?.type===Ws.VIEW?a?.name:null}(e&&e.startsWith(Ws.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(Ws.getProperty(Ws.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=II(e,t),{config:s}=e&&t&&n?n.view:this.c11nEnv.getMetadata(),a=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_INFO)),r=s?.type===Ws.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(Ws.getProperty(Ws.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)))return this.c11nEnv.getValue(Ws.getProperty(Ws.EMBEDDED_DATA_MODAL.REFRESH_CONDITIONS));const e=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.ACTIVE_ACTION_ID)),t=Ks(this.c11nEnv.getContextName());let n;t&&(n=yy(t));const s=n?.caseInfo?.availableActions,a=yy(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(Ws.getProperty(Ws.CASE_INFO.ACTION_REFRESH_CONDITIONS))}getBusinessID(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.BUSINESS_ID))}getAssignments(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_INFO))?.assignments}getChildAssignments(){return this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_INFO))?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.ACTIVE_ACTION_ID)),t=this.c11nEnv.getValue(Ws.getProperty(Ws.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(Ws.getProperty(Ws.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.ASSIGNMENT_LABEL)),n=this.c11nEnv.getValue(Ws.getProperty(Ws.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(Ws.getProperty(Ws.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.ACTIVE_ACTION_ID)),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_INFO_ACTIONS));return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(Ws.getProperty(Ws.CASE_INFO.GETNEXTWORK))}isObjectWideAction(){const e=this.c11nEnv.getValue(Ws.OBJECT_INFO.OBJECT_INFO);return hm(e)}getCaseCollaborators=(e=!0)=>{const t=this.c11nEnv.getValue(Ws.CASE_INFO.CASE_INFO_COLLABORATORS)||[];if(e){const e=NE.getOperatorIdentifier();return t.filter((t=>t.ID!==e))}return t}};class mh{constructor(e){mh._instance=this,this.context=`${e}/${Ws.SUGGESTION}`,Iy()?.getState().data?.[this.context]||Ey({type:Ha,payload:{context:this.context,data:{}}})}getField(e){return Sy(e,"",this.context)}setField(e,t){Ey({type:sa,payload:{reference:e,value:t,context:this.context}})}removeField(e,t={}){Ey({type:Na,payload:{reference:e,context:this.context,...t}}),Ru.publish(Ws.PUB_SUB_EVENTS.SUGGESTION_PROCESSED,{reference:e,context:this.context,...t})}setState(e){Ey(qy({context:this.context,data:e,isArrayDeepMerge:!0}))}}const Ih=mh;const Eh=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=Ay();return n?Ly.getIn(n,t):null}static setSharedState(e,t){e&&Ey(TA({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;Ey(DA({context:e,reference:r?`${r}.${t}`:t,value:n,isArrayDeepMerge:a,removePropertyFromChangedList:o,skipDirtyValidation:i}))}static getSuggestionsContext(e){return new Ih(e)}static triggerRefresh(e,t){Vm({context:e,pageReference:t})}};class yh{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=sy(e,t);return!!n?.useDecision}static processParagraph(e,t){const n=t.getCurrentClassID(),s=sy(e,n);let a;if(s?.useDecision){const n=s.dynamicContents.length;for(let r=0;r<n-1;r+=1)if(Vy.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=OE.getParagraphLocaleValue(r||n,e);return o?yh.getParagraphStream(o.content,t,o?.category):a?.content?yh.getParagraphStream(a.content,t,a?.category):null}static processBannerDecisionParagraph(e,t){const n=t.getCurrentClassID(),s=sy(e,n);let a;if(s?.useDecision){const n=s.dynamicContents.length;for(let r=0;r<n-1;r+=1)if(Vy.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=OE.getParagraphLocaleValue(r||n,e);let i=null;return o?i=yh.getParagraphStream(o.content,t,o.category):a?.content&&(i=yh.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=sy(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=sy(e,n);return!(!s?.useDecision||!s?.dynamicContents)&&s.dynamicContents.some((e=>e.isBanner))}}const Ah=yh;class Ch{constructor(e){this.fieldType=e}applyFallback(e){const t=kd.getDefaultsforType(this.fieldType);e.currencyISOCode=e.currencyISOCode||t?.currencyISOCode||"USD"}}class Sh{static getStrategy(e){switch(e){case"Currency":case"Decimal":case"Integer":case"Percentage":return new Ch(e);default:return}}}const _h="DATAPAGE",Nh="VIEW",Th="FIELD",Dh="CASE",Oh="PARAGRAPH",Ph=(e,t,n,s)=>{const a=[Nh,Th,Oh],r=[_h,Oh].includes(e)&&s?`#${s}`:"",o=e===_h?"@BASECLASS":n;return e===_h||a.includes(e)?`${o}!${e}!${t}${r}`.toUpperCase():`${e}!${t}${r}`.toUpperCase()};class Rh{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=WE(this.locale),s=this.#s(e,this.localeReference?n.localeStore[`${this.localeReference.toUpperCase()}`]:{})||this.#s(e,n.localeStore[Rh.COMMON_LABELS])||this.#s(e,n.localeStore[Rh.COMPONENT_FIELDS])||this.#a(e)||e;return(t?this.#r(s,t):s)||e}getLocalizedMessage(e,t){const n=WE(this.locale).localeStore[Rh.MESSAGES]??{},s=this.#s(e,n)??e;return(t?this.#r(s,t):s)||e}getLocalizedDataPage(e,t,n,s){if(!t||!n||!e)return e;const a=Ph(_h,t,void 0,n),r=WE(this.locale),o=this.#s(e,r.localeStore[a])??this.#s(e,r.localeStore[Rh.COMMON_LABELS])??this.#a(e)??e;return(s?this.#r(o,s):o)||e}#r(e,t){return 0===t.length?e:e.replace(/\{(\d+)\}/g,((e,n)=>t[""+(Number(n)-1)]??e))}#a(e){if(0===this.lookupList.length)return;const t=WE(this.locale);for(const n of this.lookupList){const s=this.#s(e,t.localeStore[n]);if(s)return s}}#s(e,t){if(null==e||!t)return;const n=t[e]??t[e];return"string"==typeof n?n:void 0}setLookupList(e){Array.isArray(e)&&(this.lookupList=e)}}const bh=e=>Bs.getNeedsMapping()||e?.info===$s.OBJECT_INFO.OBJECT_INFO?$s.OBJECT_INFO.OBJECT_INFO:$s.CASE_INFO.CASE_INFO,vh=(e,t)=>{const n=bh(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}},xh=(e,t)=>{const n=bh(t),s=Ef();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||vh(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},nextAssignmentInfo:i}=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),t&&t[$s.ACTIONS.DELETEAVIALACTIONS]&&delete a.data[n].availableActions,void 0===s||s||vh(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),i&&(a.data=a.data??{},a.data.nextAssignmentInfo=i),a},wh=async e=>{const t=xh(e),n=Ly.getIn(t,Ws.COMPONENTS);Xd(t,{},!0);const s=Ly.getIn(t,Ws.LOCALE_REFERENCES);await OE.loadLocaleResources(s||[]),await hp(n)},Mh=(e,t,n)=>Vy.resolveView(e,t,n);let Lh=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 Uh=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=Vy.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=Vy.getContextPath(this.datasource,this.index);return this.index+=1,Hh({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class Fh{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.children[this.index];return this.index+=1,Hh({meta:e,index:this.index,options:this.options})}resetIndex(){this.index=0}}const jh=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new Uh(e,e.context||"",t);if(n){const n=Ny(`${t.context}.${Ws.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new Uh(e.children[0],n||e.context,t)}return e?.children?new Fh(e.children,t):void 0};class Vh{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=>Fp.isProperty(e))).map((e=>Fp.getPropertyName(e)))}}const kh=new Vh;let Bh;Object.freeze(kh);const $h=(e,t,n)=>{e&&(Object.keys(e).forEach((s=>{if("children"!==s){const a=e[s],r=So.trimAnnotation(a);if("string"!=typeof r&&"string"!=typeof a||!(Ly.isValidAnnotation(a)&&Ly.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({}),$h(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]||{},$h(r,t[s],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[s]=r}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},Wh=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...Ly.deepClone(t.inheritedProps)]};class Gh{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.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||"",s.inheritedConfig&&(this._inheritedConfig=Ly.deepClone(s.inheritedConfig)),t?.config?.inheritedProps&&Wh(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=dd.formatePageReferenceToArrayIndex(this.meta.config.value)),$h(this._rawConfig,this._stateProps),this._isState=!Ly.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=Ly.isExpressionExist(this._rawConfig.config),this._isWhenExist=Ly.isWhenExist(this._rawConfig.config),this._isValidatorExist=Kd.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=So.handleAnnotation(this.options.pageReference,this)),this._pageReference=Vy.getContextPath(r||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t);const o="reference"===this._type&&Ly.isWhenExist({visibility:this.meta?.config?.visibility}),i=this._checkAndSetDecisionParagraph("instructions",this._rawConfig?.instructions);let c=!1;if("reference"!==this._type&&t&&(this._rawConfig=Vy.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=So.trimAnnotation(e.localeReference)||s.localeReference,this._isExpressionExist=Ly.isExpressionExist(e),this._isWhenExist=Ly.isWhenExist(e),this._isValidatorExist=Kd.isValidatorExist(e),c=this._checkAndSetDecisionParagraph("label",e?.label)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===Ws.VIEW&&this._rawConfig.name&&(this.viewName=So.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&Um(this)}(o||i||c)&&xm(this.viewName,this._contextName,this._pageReference)}_checkAndSetDecisionParagraph(e,t){let n=!1;if(t&&t.startsWith(Ws.PARAGRAPH_ANNOTATION)){const s=So.trimAnnotation(t);n=Ah.isDecisionParagraph(s,this.getCurrentClassID()),n&&this.setStateProps({[e]:t})}return n}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=So.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=So.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?So.trimAnnotation(this._rawConfig.config.associatedView):"",g=s||l,h=this._rawConfig?.type,f={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:So.trimAnnotation(t),label:g?.startsWith("@")?So.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}${So.trimAnnotation(n)}`},componentName:h,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),index:this.index,allowMultiple:u,isDeclarativeTarget:this.isDeclarativeTarget(),...this._type===Lh.EMAIL&&{useRFC822Validation:d}};pu.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)pu.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",So.trimAnnotation(this.getPropertyName()),this.index);else if("Address"===this._type&&this._rawConfig?.config?.associatedView)pu.removeViewNode(this._contextName,this._pageReference,So.trimAnnotation(this._rawConfig.config.associatedView),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference;pu.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index)}}addViewNode(){this._rawConfig?.type?.toLowerCase()===Ws.VIEW&&this._rawConfig.name&&this.viewName&&pu.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName),"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&pu.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&pu.addViewNode(this._contextName,this._pageReference,So.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&pu.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}addWhenNode(){let e="",t="";const n=Ly.getWhenNames(this._rawConfig?.config),s=this.getRawConfigProps();if(s?.type&&s?.type?.toLowerCase()===Ws.VIEW)t=Ws.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=Ws.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=So.isProperty(n)?So.trimAnnotation(n):""}e&&n.forEach((n=>{pu.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()!==Ws.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()),pu.addPageListNode(this._contextName,this._pageReference,this.viewName??"",So.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:So.trimAnnotation(this.getPropertyName()),label:f?.startsWith("@")?So.handleAnnotation(f,this,void 0):f,required:n,readOnly:a,disabled:r,...s&&{contextPageRef:`${this._pageReference}${So.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(So.trimAnnotation(this.getPropertyName()),this._pageReference)||[];pu.updatePageListNode(this._contextName,this._pageReference,So.trimAnnotation(this.getPropertyName()),I.length)}this.isWhenExist()&&this.addWhenNode(),this.isVisible()||this.removeNode()}getStateProps(){return this._stateProps}setStateProps(e){Ly.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getSharedDataPageForReferenceList(){const e=this.getCaseInfo().getClassName(),t=this.getCurrentView();if(!t||!e)return;const n=Mh(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=Ly.generateDataPageHashWithParameters(a,s,this),o=Ay(),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 fh(this)),this._caseInfo}getCaseLocaleReference(){const e=this.getValue(Ws.getProperty(Ws.CASE_INFO.CASE_TYPE_ID));return OE.getCaseLocaleReference(e)}getListActions(){return Vd(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 Vy.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[Ws.CONTAINERS.ROOT_CONTAINER,Ws.CONTAINERS.VIEW_CONTAINER,Ws.CONTAINERS.FLOW_CONTAINER,Ws.CONTAINERS.MODAL_VIEW_CONTAINER,Ws.CONTAINERS.PREVIEW_VIEW_CONTAINER,Ws.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=gI.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()}/${Ws.SUGGESTION}`],n=this.getStateProps()?.value,s=Vy.getContextPath(this.getPageReference(),n),a=t?Eh.getSuggestionsContext(this.getContextName()).getField(s):void 0;this._hasSuggestions=!!a,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...kd.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig},n=Sh.getStrategy(this._type);return n?.applyFallback(t),this.populateSuggestionProps(t),this.resolveConfigProps(t,e),Ly.resolveStringBooleans(e)}getLocalizationService(e){const t=this.getComponentName(),n=e||("View"===t?this._rawConfig?.config?.template:t),s=NE.getLocale()??"en-US",a=new Rh(s,n),r=this.getCaseLocaleReference();return a.setLookupList(["APP!APPLICATION"]),r&&a.setLookupList([r]),a}getRawConfigProps(){const e={...kd.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(Vy.resolveProps(e,t,this),So.handleComponentMapping(t,{type:this.getComponentName()||"",config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),$h(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===Ws.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(n===Ws.MODAL_VIEW_CONTAINER||n===Ws.CASE_CREATE_STAGE||n===Ws.OBJECTACTIONCONTAINER){const n=OI(`${Ws.APP.APP}/${this.getContainerName()}`),s=Eu({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||So.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=Eu({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:$s.MESSAGES.MESSAGES_TYPE_ERROR}),s=Eu({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=Ws.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.clearErrorMessages({property:t,subType:"required"})}s&&s[0]&&(e.infoMessage=s[0].message,e.status=Ws.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(n===Ws.ROOT_CONTAINER){const n=Su(a,OI(`${Ws.APP.APP}/${this.getContainerName()}`));e.httpMessages=Array.isArray(n)?t(n):n,this._stateProps.httpMessages=e.httpMessages;const s=Eh.getSharedState("isLoggedOut");e.isLoggedOut=s,this._stateProps.isLoggedOut=s;const r=Eu({context:Ws.APP.ROOT,category:"PAGE"});e.pageMessages=t(r),this._stateProps.pageMessages=e.pageMessages}if(n===Ws.HYBRID_VIEW_CONTAINER){const n=Eu({context:Ws.APP.APP,category:Ws.HTTP});e.httpMessages=t(n),this._stateProps.httpMessages=n}if(n===Ws.APP_SHELL&&e.portalDocMode===Ws.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=xg.getOpenedCaseItems(`${$s.APP.APP}/${Ws.PRIMARY}`),this._stateProps.activeCases=e.activeCases),n===Ws.APP_SHELL){const n=Ws.APP.APP,s=OI(`${n}/${this.getContainerName()}`),a=[...Eu({context:n,category:"PAGE"})||[],...Eu({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===Ws.SCALARLIST&&(this._stateProps.value=e.value),n===Ws.APP_SHELL||n===Ws.MODAL_VIEW_CONTAINER||n===Ws.CASE_CREATE_STAGE||s.template===Ws.CASE_PREVIEW||s.template===Ws.RULE_PREVIEW){let t=Eu({context:Ws.APP.APP,category:"HTTP"});const n="HYBRID"===NE.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${Ws.APP.APP}/${this.getContainerName()}`,s=Eu({context:OI(n),category:"HTTP"});t?s&&(t=t.concat(Eu({context:OI(n),category:"HTTP"}))):t=Eu({context:OI(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===Ws.VIEW_CONTAINER||n===Ws.FLOW_CONTAINER||n===Ws.MODAL_VIEW_CONTAINER||n===Ws.PREVIEW_VIEW_CONTAINER||n===Ws.ROOT_CONTAINER||n===Ws.OBJECTACTIONCONTAINER){if(e.routingInfo=Vr(this.getContainerName(),this._contextName),n===Ws.ROOT_CONTAINER&&(e.rootConfig=Vh.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,n===Ws.FLOW_CONTAINER||n===Ws.OBJECTACTIONCONTAINER){const n=Eu({context:this.getContextName(),category:Ws.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=wI(s)[0];if(a){const n=OI(a),s=f?.getStore()?.getState()?.data;s&&n&&(e.lastUpdateTime=s[n]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=s[n]?.caseInfo?.lastUpdateTime);const r=Eu({context:n,category:$s.PAGE}),o=Eu({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=yy(Ws.APP.APP).context_data?.isOffline,e.assignmentNames=this.getCaseInfo().getAssignments()?.map((e=>e.name)),e.childAssignmentNames=this.getCaseInfo().getChildAssignments()?.map((e=>e.name)),n===Ws.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===Ws.CASE_VIEW||s.template===Ws.RULE_VIEW||s.template===Ws.SELF_SERVICE_CASE_VIEW||s.template===Ws.CASE_PREVIEW||s.template===Ws.RULE_PREVIEW||s.template===Ws.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):n===Ws.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(Ws.ATTACHMENT_ANNOTATION))){const t=So.getPropertyName(a),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=uy(`${this._pageReference}.${t}`,this._contextName);return e?.additionalInformation&&this.setStateProps({additionalInformation:n}),Array.isArray(e)||(e.additionalInformation=n),e}getFieldMetadata(e){if(!e)return null;const t=e.split(".");if(t.length<2){let t=this.getValue(Ws.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata($E(e,t),e)}const n=t.pop(),s=t.join(".")?".":"";let a=this.getValue(`${s}${t.join(".")}${Ws.CLASS_ID}`);return a||(a=Ly.resolvePageClass(e,this.getCurrentClassID())),this.resolvePropertyMetadata($E(n,a),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata($E(n,this.getValue(`${t.join(".")}${Ws.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(Ws.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[Ws.getProperty($s.CASE_INFO.CASE_INFO)]};return e.CaseID=e.CaseID||this.getValue(Ws.getProperty($s.CASE_INFO.CASE_INFO_PZINSKEY)),{...e,isCaseWideAction:()=>Im(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}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 Rp(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?So.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||So.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||So.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 yy(e||this.getContextName())}getImagePath(e){return`${dp.getConstellationServiceUrl()}/v860/${dp.getAppAlias()}/image/${e}?org=${_E.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=jh(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}),n=[];for(;t?.hasNext();){const e=t.next();this.isBulkAction()&&this.#o(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}getLocalizedValueForFieldLabel(e){e.startsWith(".")&&(e=e.substring(1));const t=this.getFieldMetadata(e)?.label,n=this.getLocaleRuleName(),s=this?.getMetadata();let a=null;if(s){const n=s?.type,r=["View","Region"];let o=s?.config?.label||s?.config?.caption?`@FL ${e}`:null;const i=Array.isArray(s?.config?.inheritedProps)?s.config.inheritedProps.find((e=>"label"===e.prop)):null;if(!o&&i&&(o=i.value),o?.startsWith(Ws.FIELD_LABEL_ANNOTATION)){const e=this.#i(o);return OE.getLocaleValue(t,void 0,e,a)}n&&!r.includes(n)&&(a=n)}return this.getLocalizationService(n).getLocalizedText(t)}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?Vy.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${Ws.SUGGESTION}`):Vy.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)})),Wh(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),Vy.resolveProps(t,e,this),e}setValue(e,t,n,s=!1,a={}){let r,o;const{isArrayDeepMerge:i}=a;this.isInsideList()&&this.getListActions().updateProperty(e,t),this.isBulkAction()&&(r=!0,t||(o=!0)),Ey({type:"SET_PROPERTY",payload:{reference:`${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()};aI(n)}getContextDataValue(e,t){return _y(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(Ws.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let s=Ws.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(s=n>0?this._pageReference.substring(n):this._pageReference),Ey(qy({context:this._contextName,data:e,rootPageReference:s}))}replaceState(e,t,n={}){const{skipDirtyValidation:s=!1}=n;Ey({type:"REPLACE_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName(),skipDirtyValidation:s}})}reportError(e,t,n){Ey(AA(e,t||{},n,t?.formFields))}getComponent(){return Bh({getPConnect:()=>this})}createComponent(e,t,n,s){let a=this._pageReference;if(t){const e=Ny(`${this.getPageReference()}.${Ws.SUMMARY_OF_LISTS}`,t,this._contextName);a=Vy.getContextPath(e||t,n)||t}else if(s&&s.pageReference){let e=s.pageReference;e=So.handleAnnotation(e,this),a=Vy.getContextPath(this._pageReference,e)||""}return Bh(Hh({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 Vy.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(Ws.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,Hh({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 kp(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new hh(this)),this._actionsApi}getActionManager(){return Ip}doesContextExist(e){return wy(e??this.getContextName())}getGoogleMapsAPIKey(){return gn()}getServerURL(){return un()}getLoadingStatus(e){let t=null;return e?(t=yy(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?yu({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName(),...e.subType&&{subType:e.subType}}):e?.context?yu({type:"error",...e}):(yu({type:"error",...e,context:Ws.APP.APP}),yu({type:"error",...e,context:OI(`${Ws.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return Ny(`${this.getPageReference()}.${Ws.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();jd(s,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<a.length;e+=1)vd(a[e],e,s,void 0,{})}else"object"==typeof a&&s(a,`${t}.${e}`)}))};s(e,t)})(e,t,this):em(this.getContextName(),`${this.getPageReference()}${t}`,this.getStateProps()?.value??"")}acceptSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=Eh.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,s=Vy.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=Vy.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,Eh.getSuggestionsContext(this.getContextName()).removeField(n,{actionPerformed:"ignored"});const s=yo.getDependencies(this._contextName,n);s?.forEach((e=>{Eh.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(e,t){const n=Fp.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!==Ws.ASSOCIATED;return!a&&(i||n||!s&&(r&&!c||o)&&l)}getPropertyDetails(e,t,n){return e===Ws.ASSOCIATED?{propertyValue:t,propertyAnnotation:Ws.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:Ws.PROPERTY_ANNOTATION}}updateConfigData(e,t,n){e.fieldMetadata=t,t.additionalInformation&&(e.additionalInformation=t?.additionalInformation),this.isReadOnlyField(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}))}#o(e){const t=e.getPConnect().getComponentName(),n=e.getPConnect().getConfigProps().template;return!(!0===Vh.allowedComponetsForBulkProcessing[t]||!0===Vh.allowedComponetsForBulkProcessing[t]?.[n])}#i(e){const t=e.split(`${Ws.FIELD_LABEL_ANNOTATION} `).pop(),n=t?.split("."),s=n?.pop();let a=`${s}`;const r=this.getFieldMetadata(a),o=r?.classID||this.getValue(`.${n?.join(".")}${Ws.CLASS_ID}`),i=r?.definedOnClassID;return a=`${i||o}!FIELD!${a}`,a}}function Hh(e){const t=new Gh(e);return{getPConnect:()=>t}}function qh(e){Bh=e}const zh={CASE_INFO:`${Ws.DATA}.${Ws.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${Ws.DATA}.${Ws.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${Ws.DATA}.${Ws.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${Ws.DATA}.${Ws.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${Ws.DATA}.${Ws.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${Ws.DATA}.${Ws.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${Ws.DATA}.${Ws.CASE_INFO.ASSIGNMENT_ID}`},Yh=(e,t)=>{const{vcName:n,containerName:s}=t;return s||n||yp.getTargetViewContainerName(e)},Kh=e=>{const t=e.lastIndexOf(Ws.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(Ws.UNDERSCORE_STRING);return e.substring(t,n)},Qh=e=>e===gI.WORKAREA,Jh=e=>e===gI.MODAL,Xh=e=>e===Va,Zh=e=>e===Oa,ef=e=>e&&e.find((e=>e.type===Oa)),tf=e=>Ly.getIn(e,zh.CASE_INFO,{}),nf=e=>e?e.split(" ").pop():void 0,sf=e=>Ly.getIn(e,zh.CASE_CLASS_NAME,Ws.EMPTY_STRING),af=(e,t=!1)=>{const n=t?Dp(e):tf(e);return fm(n)&&mm(NE.getOperatorIdentifier(),n)},rf=e=>Ly.getIn(e,zh.CASE_INFO_ID,Ws.EMPTY_STRING),of=e=>Ly.getIn(e,zh.CASE_FIRST_ASSIGNMENT_ID,Ws.EMPTY_STRING),cf=(e,t)=>{const{removeActionPayload:n,target:s}=t;if(n&&n.containerItemID){const{containerItemID:t,context:a}=n;e.push(yA(pA,{containerItemID:t,context:a||bI(t),target:s}))}},lf=e=>{const t=Iy();if(!e)return!1;const n=Ks(e),s=HI(n),a=HI(e);if(!s||!a)return!1;const r=II(s,n),o=II(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},uf=(e,t,n={})=>{const{skipFlowNameUpdate:s}=n,a=rf(t);Ly.setIn(e,"key",a);const r=fm(tf(t));if(!s&&(e=>{const t=Ly.getIn(e,zh.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=of(t),[,s]=n.split("!");(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,e)})({assignmentID:n,isInCreateStage:r}),Ly.setIn(e,"flowName",s)}},df=(e,t)=>{const{attachmentsExist:n}=t;n&&Ly.setIn(e,$s.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),Ly.setIn(e,$s.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},pf=(e,t,n)=>{let s=Ws.PROMISE_VALUE.RESOLVE;return ef(e)?(s=Ws.PROMISE_VALUE.REJECT,n?Ip.rejectActionByID(t,!0,n):Ip.rejectActionByID(t)):Ip.resolveActionByID(t),s},gf=e=>{const t=NE.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},hf=()=>"true"===NE?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,ff=(e,t,n)=>{const{containerItemID:s,caseID:a}=t;if(s){const{caseClassName:r,skipAssignmentsUpdate:o}=n,i=Ks(s),c=HI(i),l=c&&mI(c),u=c&&OI(c),d=Zs(i);u&&l?.items?.[u]?.key===t?.caseID&&e.push(yA(Yy,{containerItemID:i,context:i,container:d,containerName:d,caseId:a,viewName:$s.CASESUMMARY_VIEW_NAME,updateData:!0,viewLoadingContainer:{context:i},caseClassName:r,...void 0!==o&&{skipAssignmentsUpdate:o}}))}},mf=async(e,t)=>{const{context:n,containerItemID:s,shouldUpdateCaseActionsInParentContext:a}=e,r=t?.data?.caseInfo?.ID?rf(t):void 0;if(!n||!r)return;const o=r?`${r}_actionsLoading`:"actionsLoading";try{const i=new Gh({}),c=new fh(i);fp.setComponentCache(o,!0);const l=await c.getCaseActions(r,n);vh(t);const u=Ly.getIn(t.data,Ws.getProperty(Ws.CASE_INFO.CASE_INFO_ACTIONS)),d=Array.isArray(l.availableProcesses)&&l.availableProcesses.length>0?{availableProcesses:l.availableProcesses}:[],p=l?.availableActions,g=["pyUpdateCaseDetails"],h=Array.isArray(p)&&p.find((e=>g.includes(e.ID))),f={data:{caseInfo:{availableActions:[...l.availableActions,...void 0!==u?u:[]],...d,editActions:h?[h]:[]}}};fp.setComponentCache(o,!1),Ey(yA(qy,{context:n,...f})),!0===a&&s&&(async(e,t)=>{const{containerItemID:n,caseID:s}=t;if(n){const t=Ks(n),a=HI(t),r=a&&mI(a),o=a&&OI(a);o&&r?.items?.[o]?.key===s&&Ey(yA(qy,{context:t,...e}))}})(f,e)}catch(e){fp.setComponentCache(o,!1),console.error("Error fetching case actions:",e)}},If=(e,t)=>{const n=sf(e?.response),s=tf(e?.response),{caseTypeID:a}=s,r=NE.getFeatureMap();(r?.deferUpdateCaseSummaryView??!Object.hasOwn(r,Ws.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&QE(Ws.CASESUMMARY_VIEW_NAME,a)&&ff(t,e?.actionInPayload,{caseClassName:n,skipAssignmentsUpdate:!e?.actionInPayload?.context?.includes(Ws.PREVIEW)})},Ef=()=>NE.isOptimizedCaseLoadingEnabled(),yf=(e,t)=>{Ef()&&mf(t,e)},Af=e=>yy(e)?.context_data?.caseViewMode,Cf=e=>!(!fp.getComponentCache("redirectionInProgress")||!e)&&(pf([],e),!0),{RESOURCE_TYPES:Sf}=$s,_f={PAGE:"page",FORM:"form"},Nf={[Sf.CASE]:[Xa,Qa,Ja],[Sf.OBJECT]:[wr,Mr,Ur],[Sf.PAGE]:[qa,Ya],[Sf.DATA]:[za],ASSIGNMENT:[cr]},Tf=(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},Df=(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=om(e,{isTransientContext:r,includeDisabledFields:o,isObjectWideAction:i,isExternalObject:c}),n&&(delete l?.caseInfo?.content,r&&(l={}));const u=Jm(e,!1);!r&&s&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,s])=>{const a=yy(t),r=Wn(a,$s.CASE_INFO.CASE_INFO_CLASSID),o=$E(n,r);("True-False"===o?.type&&!s||""===s)&&delete e.caseInfo.content[n]}))})(l,e);const d=Us(u,l);let p={};({content:p}=((e,t,n=!1,s=!1)=>{let a={};const r=gm.shouldUseUnifiedHandling()||!n&&!s?t?.caseInfo:t?.objectInfo;return(e||r)&&(a=e?{...t}:{...r}),{content:a}})(r,d,i,c));const g=[...Pd(e)];a&&g.forEach((e=>{delete e.content?.EmbedListUUID__})),p.pageInstructions=g;if((Sd[e]||[]).forEach((e=>{if(p?.content){const t=e?.replace(Ws.getProperty(Ws.CASE_INFO.CASE_INFO_CONTENT),"");Ly.deleteIn(p.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))}})),!r&&d?.dataInfo)return p={...d.dataInfo,pageInstructions:p.pageInstructions},{content:p};const h=Sy(ks.getQualifiedNameForComplexRuleReferences(".pzAdditionalPayload"),Ws.CASE_INFO.CASE_INFO_CONTENT,e);return p.content&&h&&(p.content[ks.getDefaultQualifiedName("pzAdditionalPayload")]=h),{content:p}},Of=(e,t)=>{let n,s,a={};const r=Ly.getIn(e,Ws.UI_RESOURCES),o=Ly.getIn(e,"confirmationNote");r?(n=Ly.getIn(e,Ws.UI_RESOURCES_CONTEXT_DATA),s=Ly.getIn(e,Ws.ROOT),a=Ly.getIn(e,Ws.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=Ly.getIn(e,"nextAssignmentInfo",null),h=Ly.getIn(e,"nextAssignmentInfo.context",""),f=Ly.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:{[Ws.COREHEADER_APP_DEBUG_ID]:E.debugId}},[Ws.getProperty(Ws.CASE_INFO.CASE_INFO)]:{...i[Ws.getProperty(Ws.CASE_INFO.CASE_INFO)],actionButtons:a,headers:t.headers},[Ws.CONTEXT_DATA]:m?{...i[Ws.CONTEXT_DATA],...n,openCaseViewAfterCreate:I,errors:c,...y&&{isExternalObjectCreationFlow:y},...A&&{isExternalCaseCreationFlow:A}}:{...i[Ws.CONTEXT_DATA],...n,errors:c}},semanticURL:u,nextAssignmentInfo:g,assignmentContext:h,confirmationLinks:f,key:d,root:s,...t}},Pf=async(e,t,n,s=!1,a=!1)=>{const r=Ly.getIn(e,Ws.LOCALE_REFERENCES);await OE.loadLocaleResources(r);const o=Ly.getIn(e,Ws.COMPONENTS);if(o)try{await hp(o)}catch(e){console.error(e)}const i={actionConfig:t,...n};s?qA({...e,options:i,directUrlUpdation:!0}):Xd(e,i,a)},Rf=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},bf=e=>{if(e){const[,t]=e.split("!");return{key:Rf(e),flowName:t}}return{}},vf=(e,t,n,s)=>{switch(!0){case Boolean(e[Ws.ERROR_IN_PAGE_IDENTIFIER]&&e[Ws.ERROR_FIELD_IN_PAGE]):{const a=`${e[Ws.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),r=`${a}${e[Ws.ERROR_IN_PAGE_IDENTIFIER]}`,o=Ly.deepClone(e);o[Ws.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[Ws.ERROR_IN_PAGE_IDENTIFIER]&&!e[Ws.ERROR_FIELD_IN_PAGE]):{const a=e[Ws.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(a)?s.push(e):n.push(e);break}default:n.push(e)}},xf=e=>{const{payload:t}=e,{err:n,context:s,actionMgrID:a}=t,r=n&&n.response?n.response.data:"",o=um(s);return a&&Ip.rejectActionByID(a,!0,n),yA(AA,"Error action triggered",r,s,o)},wf=(e,t)=>UI(e)&&jI(e)?yA(fA,t):yA(eA,t),Mf=(e,t,n=Ws.APP.APP,s={})=>{let a=null;const{buildNew:r=!0}=s;return UI(e)?a=jI(e)?OI(e):Qs(t,n):FI(e)&&(jI(e)&&!r?a=vI(e):jI(e)&&!r||(a=Qs(t,n))),a},Lf=e=>e&&e.type===ba,Uf=e=>{let t=!1;const n=MI(e);for(let e=0;e<n.length;e+=1){const s=n[e];if(s&&rI(s)){t=!0;break}}return t},Ff=(e,t={})=>{let n=!1,s=!1,a={},r=!0,o=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:u=!1}=t;if(UI(e)){const t=OI(e);if(!t)return{continueExecution:r,removeActionPayload:a};const s=bI(t);rI(s)&&(n=!0),u||n||(n=Uf(t))}else if(FI(e)&&BI(e)){let t=GI(e);t||(t=OI(e),s=!0),a.containerItemID=t,a.context=bI(t)}if(n){const e=l||Km;o=window.confirm(OE.getLocaleValue(e,"Messages"))}if(!o&&n&&(a={},r=!1),s){const e=OE.getLocaleValue(Qm,"Messages");c?i=window.confirm(e):(window.alert(e),r=!1)}return!i&&s&&(a={},r=!1),{continueExecution:r,removeActionPayload:a}},jf=(e,t)=>{let n=!1;const s=NE.isCoexistenceAppOfType(Ws.APP_TYPE.UIKIT),{insKey:a,isParallelCall:r,skipFlowNameCheck:o}=t;if(!a)return{};const[,i]=a.split("!")||"",c=o?a:Rf(a),l=SI(e,c);let u={},d=!1;if(l&&!s&&((e,t)=>{const n=II(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,u=II(e,l),!o)){let e=u?.flowName;const t=Kh(l),s=xI(l);if(s.length){const n=((e,t)=>e?.includes(Ws.WORKAREA)?Ws.WORKAREA:t)(s[0],t),a=jr(n,s[0]);e=II(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}}},Vf=(e,t,n)=>e===Sf.PAGE?((e,t={})=>{let n=!1;const{semanticURL:s}=t,a=SI(e,s);return a&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:a,semanticURL:s}}})(t,n):e===Sf.ASSIGNMENT?jf(t,{...n,type:e}):e===Sf.CASE||e===Sf.OBJECT?jf(t,{...n,skipFlowNameCheck:!0,type:e}):{},kf=(e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e),Bf=(e=[])=>{jI(`${Ws.APP.APP}/${Ws.PREVIEW}`)&&e.push(yA(Zy,$I({context:$s.APP.APP,name:Ws.PREVIEW})))},$f=e=>{let t;for(const n of Object.keys(Nf))if(Nf[n].includes(e)){t=n;break}return t},Wf=(e,t,n="")=>{const{data:s={},context:a,caseViewMode:r,skipMergeAssignmentsAndActions:o=!0}=e,i={data:{...s},caseViewMode:r,context:Ks(a)};Ly.deleteIn(i.data,"shared"),Ly.setIn(i.data,["context_data","caseViewMode"],r),t.push({type:mr,payload:{context:i.context,skipMergeAssignmentsAndActions:o}});const c=n&&![$s.CASE_INFO.CASE_INFO_CONTENT,$s.DATA_INFO.DATA_INFO_CONTENT].includes(n);t.push(yA(qy,{...i,...c&&{uiRootReference:n}}))},Gf=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=Ly.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const s=Ly.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:Ly.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:Ly.getIn(t,["payload","context"]),context:Ly.getIn(t,["payload","context"])},s={type:Aa,payload:{...n}};e.push(s),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),Ey(e),e=e.filter((e=>e.type!==Aa))}const a=((e,t,n)=>({assignmentID:e,vcName:Ws.PRIMARY,targetContainerName:Ly.getIn(t,["payload","target"]),context:Ly.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);UI(a.targetContainerName)||t?.payload?.containerName!==Ws.WORKAREA||(a.isMultiDoc=!0,e=[]);const r={type:Ca,payload:{...a}};e.push(r),Ey(e)}else Ey(e)}},Hf=(e,t)=>Us(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),qf=e=>{let t={},n=uE(e);for(;n;){const e=Df(n);t=Hf(e.content,t),n=uE(n)}return t},zf=e=>{e?.containerItemID&&Eh.updateState(e.containerItemID,"traditionalGadgetId",gm.getUniqueGadgetId(),{skipDirtyValidation:!0})};class Yf{static getChanges(e){return{...Jm(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:s=!1}=t||{},{content:a}=Df(e,{isTransientContext:n,includeDisabledFields:s});return a}static isStateModified(e){return rI(e)}static resetComplexObjectDirtyStatus(e){return tI(e)}static isFormValid(e,t){return cm(e,t)}static clearChangedProperties(e){return Rd(e),Od(e),iI(e)}static getEditableFields(e){return dm(e)}static setCustomValidator(e,t){Kd.register(e,t)}static isPropertyEditable(e,t){return Yf.getEditableFields(e).some((e=>e.name===t))}}const Kf=Yf;const Qf=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=pu.getContextReferences(e)?.get(a),o=r&&Vy.resolveContextTreeNodeProps(r.props)||{},i=n[a];if(r&&!0!==o.readOnly){const e=i.buildSubmitPageInstructions(t);s.push(...e)}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}})),Ly.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;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&&Nd(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=HI(t),c=II(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=HI(e),c=II(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={[Xf(l)]:n},p=this.getStateMachine(e,"",r);if(null!==o)if(u){const t=Pd(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(Ly.unflatten(d));return!0}setUniqueField(e,t,n){const s=pu.getContextReferences(e)?.get(n)?.props?.uniqueField;s&&(t.content||(t.content={}),t.content[Xf(s)]=crypto.randomUUID())}getBasePageReference(e){return Sy($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=Ly.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("."));Nd(e,t,n)}const a=this.getStateMachine(e,s,"");"INSERT"===t.instruction&&this.setUniqueField(e,t,s),a?.insertNode(t)}}))}registerForServerChanges(){gy.registerForListChanges(((e,t,n)=>{setTimeout((()=>{this.generatePageInstructions(e,t,n)}),0)}))}registerForServerChangesSync(){gy.registerForListChanges(((e,t,n)=>{this.generatePageInstructions(e,t,n)}))}generatePageInstructions(e,t,n){const s="].";if(!t.includes(".classID")&&Kf.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(s)){const a=t.substring(0,t.lastIndexOf("[")),r=Kf.getEditableFields(e);if(["multiselect","checkbox"].includes(r.find((e=>e.name===a))?.type)){const r=pu.getContextReferences(e),o=r?.get(a),i=t.substring(t.lastIndexOf(s)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}unRegisterForServerChanges(){gy.unRegisterForListChanges()}},Jf={},Xf=e=>e.startsWith(".")?e.substring(1):e,Zf=e=>{delete Jf[e]},em=(e,t,n)=>{const s=Xf(t);Jf[e]?Jf[e].fieldOrder[s]=n:Jf[e]={fieldOrder:{[s]:n}}},tm=(e,t={})=>{const{includeDisabledFields:n=!1}=t,s=Vy.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},nm=(e,t,n,s,a)=>(Qf.executeStateMachine(e,s,Vy.getLitePropertyValue(n,t))||a.push(s),a),sm=(e,t,n)=>{const s=t.isInsideList,{ignoreFieldsInsideList:a=!0}=n;return(!s||s&&!a)&&!Array.isArray(Vy.getLitePropertyValue(t,e))&&!(t.componentName&&["Address","Attachment"].includes(t.componentName))},am=(e,t={})=>{let n=[];const s=[],a=pu.getContextReferences(e);return a?(({editableFormFieldsReferenceList:n}=((e,t,n)=>{const{includeDisabledFields:s=!1}=n;let a=[];for(const[r,o]of e){const e=Vy.resolveContextTreeNodeProps(o.props),i=e.propertyName;tm(o.props,{includeDisabledFields:s})&&sm(r,e,n)&&(a=nm(t,i,e,r,a))}return{editableFormFieldsReferenceList:a}})(a,e,t)),Jf[e]&&s.push(...Object.keys(Jf[e].fieldOrder??{})),{formInputs:n,formPageFields:s}):{formInputs:n,formPageFields:s}},rm=e=>{let t=[];const n=pu.getContextReferences(e);if(n)for(const[e,s]of n){const n=s?.props;if(tm(n)&&"Attachment"===n?.componentName){const s="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:s,fullPath:e}]}}return t},om=(e,t={})=>{const n={},s=yy(e),{ignoreFieldsInsideList:a=!0,isTransientContext:r=!1,includeDisabledFields:o=!1,isObjectWideAction:i=!1,isExternalObject:c=!1}=t,l=((e,t,n)=>gm.shouldUseUnifiedHandling()||!e&&!t?n?.caseInfo:n?.objectInfo)(i,c,s);if(r||l){const{formInputs:t,formPageFields:i}=am(e,{ignoreFieldsInsideList:a,includeDisabledFields:o});((e,t,n)=>{e.forEach((e=>{let s=Ly.getIn(t,e);"object"==typeof s&&(s=Ly.deepClone(s),delete s?.classID),Ly.buildObject(e,n,s)}))})(i,s,n),t&&t.length>0?t.forEach((e=>{Ly.buildObject(e,n,Ly.getIn(s,e))})):r||Ly.buildObject($s.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!r&&s?.dataInfo?.content){const{formInputs:t}=am(e,{ignoreFieldsInsideList:a});t.forEach((e=>{Ly.buildObject(e,n,Ly.getIn(s,e))}))}return n},im=(e,t,n)=>{const s=""===t&&n?.startsWith(".")?n.substring(1,n.length):n,a=pu.getContextReferences(e)?.get(`${t}${s}`)?.props;return a?Vy.resolveContextTreeNodeProps(a):a},cm=(e,t)=>{const n=pu.getContextReferences(e);let s=!0;if(!n)return s;for(const[e,a]of n){const n=Vy.resolveContextTreeNodeProps(a.props);if(tm(a.props)&&(!t||e.includes(t))){const e=Kd.validate(n.componentName?.toLowerCase(),n.propertyName,Vy.getLitePropertyValue(n,n.propertyName),n);s&&(s=!e.message)}}return s},lm=e=>{const t=pu.getContextReferences(e);if(t)for(const[,e]of t){if(Vy.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0}return!1},um=(e,t=!1)=>{const n=pu.getContextReferences(e),s=[];if(n)for(const[e,a]of n){if(!1!==Vy.resolveContextTreeNodeProps(a.props).visibility){const n=8,a=t?e:e.substring(e.indexOf("content")+n);s.push(a)}}return s},dm=e=>{const t=[],n=pu.getContextReferences(e);if(n)for(const[e,s]of n){const n=Vy.resolveContextTreeNodeProps(s.props);tm(s.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};class pm{static isCaseActive(e,t){if(!e||!t)return!1;const n=mI(t);if(n){const s=OI(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}=jA("loadView",n);return td(s,{method:a},t)};static isExternalCaseType=e=>{let t;return this.shouldUseUnifiedHandling()?(t=NE.getCaseTypeList()?.find((t=>t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t):(t=NE.getCaseTypeList()?.find((t=>"Case"===t.objectType&&t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t)};static getCaseEditLock=(e,t)=>{const n={caseID:e,actionID:ks.getDefaultQualifiedName("pyUpdateCaseDetails")},{restApi:s,reqType:a}=jA(ar,n);return td(`${s}?viewType=page`,{method:a},t)};static updateCaseEditFieldsData=(e,t,n,s)=>{const a={caseID:e,actionID:ks.getDefaultQualifiedName("pyUpdateCaseDetails")},{restApi:r}=jA(ar,a),o=t[e];return td(`${r}?viewType=form`,{method:"PATCH",body:{content:{...o}},headers:{"if-match":n}},s)};static getCaseMessages=e=>yy(e)?.caseMessages;static getPropertiesToReplace=e=>(rm(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getPropertiesToReArrange=e=>(rm(e)||[]).filter((e=>e.allowMultiple)).map((e=>e.fullPath));static getUniqueGadgetId=()=>Ly.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>qs.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>qs.isTraditionalRemoteCase(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=NE.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e));return t&&t.length>0&&"Object"===t[0].objectType};static isExternalObject=e=>{const t=NE.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?Fr:this.isExternalObject(e)&&t?this.shouldUseUnifiedHandling()?Fr:"retrieveActionViewForNewObject":this.shouldUseUnifiedHandling()?Pr:this.isObjectCaseType(e)?wr:Pr;static shouldUseUnifiedHandling=()=>!0;static shouldAppendExcludeQueryParam=()=>NE.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=pm.getUniqueGadgetId()}}const gm=pm,hm=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},fm=e=>{if(gm.shouldUseUnifiedHandling()&&gm.isObjectCaseType(String(e?.caseTypeID))&&!hm(e))return!0;if(gm.isObjectCaseType(String(e?.objectTypeID))&&!hm(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},mm=(e,t)=>{if(e&&t){const n=Ly.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:s,type:a}=n;return"worklist"===a?.toLowerCase()&&s===e}return!1},Im=(e,t)=>{const n=Vy.getPropertyValue($s.CASE_INFO.ACTIVE_ACTION_ID,t,e),s=Vy.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=yy(e);a=t?.context_data?.actionType===Ws.CASE}return a},Em=e=>_y(null,Ws.CASE_VIEW_MODE_PROP,e)===Ws.PERFORM_MODE&&(e.includes(Ws.WORKAREA)||e.includes(Ws.MODAL)||e.includes(Ws.ACTIONAREA)),ym=(e,t)=>Em(e)&&!Im(e,t),Am=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},Cm=(e,t,n)=>{let s;const a=e?.find((e=>e.ID===t))?.actions,r=a?.filter((e=>e.ID===Ws.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},Sm=(e,t,n,s)=>{let a;return a=e?Cm(e,t,n):s||"Create",a},_m=(e,t)=>gm.shouldUseUnifiedHandling()?ya:gm.isObjectCaseType(e)||t?vr:ya,Nm=(e,t,n)=>{let s,a,r,o,i,c,l,u,d;const p=yy(e),g=p?.caseInfo?.caseTypeID||p?.objectInfo?.objectTypeID,h=gm.shouldUseUnifiedHandling();return n?.isTriggeredFromDifferentContext||e.includes(Ws.ACTIONAREA)?(s=e.includes(Ws.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&&gm.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(Ws.getProperty($s.CASE_INFO.ASSIGNMENT_ID)),a=t.getValue(Ws.getProperty($s.CASE_INFO.CASE_INFO_ID)),r=t.getValue(Ws.getProperty($s.CASE_INFO.ASSIGNMENTS)),o=t.getValue(Ws.getProperty($s.CASE_INFO.ACTIVE_ACTION_ID)),i=t.getValue(Ws.getProperty($s.CASE_INFO.AVAILABLEACTIONS)),c=t.getValue(Ws.getProperty($s.CASE_INFO.CASE_INFO)),l=t.getValue(Ws.getProperty($s.CASE_INFO.BUSINESS_ID)),u=t.getValue(Ws.getProperty($s.CASE_INFO.CASE_TYPE_ID)),d=t.getValue(Ws.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}},Tm=(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},Dm=(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=yy(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:HI(s),context:s};Ey({type:_a,payload:o})}},Om=e=>({type:nh.REFRESH_DATA,payload:e}),Pm={},Rm=(e,t,n,s,a,r,o,i,c,l)=>{if(!(e&&s&&t))return;const u=l.actionMgrID||Ip.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?Ey((e=>({type:Or,payload:e}))(d)):Ey(Om(d))},bm=(e,t,n,s,a)=>{if(!(e&&n&&t))return;s&&(s=Ly.convertPageRefToClipboardPageNotation(s));Ey(Om({ID:e,viewID:t,context:n,options:a,caseViewAction:!0,interestPage:s}))},vm=(e,t,n,s,a,r,o,i,c,l={})=>{if(!((e||t)&&s&&n&&a))return;a&&(a=Ly.convertPageRefToClipboardPageNotation(a));const u={ID:o||c!==Ws.ACTION?e:t,actionID:n,context:s,options:l,interestPage:a,interestPageActionID:r,isLocalAction:o,isMultiRecordData:i,editType:c};Ey(Om(u))},xm=(e,t,n)=>{Pm[t]||(Pm[t]={}),e&&!Pm[t][e]&&(Pm[t][e]={pageReference:n})},wm=(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=$E(s.propertyName,n||e.getValue(Ws.CLASS_ID,s.pageName));return!!r?.isDeclarativeTarget},Mm=(e,t,n)=>{const s=n||e.getRawMetadata()?.config?.value;let a=!1;if(s){const n=So.trimAnnotation(s);let r;r=t?Ly.resolvePageClass(n,t):Vy.resolveClassID(s,e.getPageReference(),e.getContextName());const o=$E(So.getLeafPropertyName(s),r);if(a=!!o?.isDeclarativeTarget,!a&&o?.additionalInformation){const e=So.trimAnnotation(o?.additionalInformation);a=Ah.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=wm(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=wm(e,t[a],n),s))break;return s})(e,o?.datasource?.parameters,t)),a||(a=o?.datasource?.tableType===Ws.DECISION)}return a},Lm=(e,t)=>{const n=n=>(e=>"string"==typeof e&&e.startsWith(Ws.PROPERTY_ANNOTATION))(n)&&Mm(e,t,n),s=e=>!(!e||"object"!=typeof e)&&Object.values(e).some((e=>n(e)||s(e)));return s(e.getRawMetadata()?.config)},Um=e=>{(e.isWhenExist()||Lm(e))&&xm(e.getCurrentView(),e.getContextName(),e.getPageReference())},Fm=e=>{if(!e)return!1;const t=Iy()?.getState()?.data?.[e],n=t?.caseInfo?.caseTypeID||t?.objectInfo?.objectTypeID;return gm.isObjectCaseType(n)},jm=(e,t,n)=>{const s=Im(e,t);let a,r,o="",i="";const c=n=>Vy.getPropertyValue(n,t,e)||"",l=gm.shouldUseUnifiedHandling(),u=c($s.CASE_INFO.CASE_INFO_CLASSID)||c($s.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID)||n?.classID||"",d=gm.isObjectCaseType(u)||t.startsWith(Ws.OBJECT_INFO.OBJECT_INFO),p=gm.isExternalCaseType(c($s.CASE_INFO.CASE_INFO_CLASSID)),g=gm.isExternalObject(u),h=c(Ws.getProperty($s.CASE_INFO.BUSINESS_ID));if(d&&Fm(e)&&!p)o=u,n.isObjectWideAction=!0,a=c(l?$s.CASE_INFO.ACTIVE_ACTION_ID:$s.OBJECT_INFO.ACTIVE_ACTION_ID),a||(a=Ws.getDefaultQualifiedName(Ws.VIEW_NAMES.OBJECT_CREATE_VIEW)),r=c(Ws.getProperty($s.CASE_INFO.CASE_INFO_ID))||o;else if(p&&!h)a=Ws.getDefaultQualifiedName(Ws.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(Ws.getProperty($s.CASE_INFO.CASE_INFO_ID));else{r=c(Ws.getProperty($s.CASE_INFO.ASSIGNMENT_ID))||c(Ws.getProperty($s.CONTEXT_DATA_ASSIGNMENTID))}Rm(r,a,o,e,s,d,g,p,i,n)},Vm=e=>{const{context:t,pageReference:n}=e,s=(e=>Pm[e]&&Object.keys(Pm[e]).length>0&&Em(e))(t);if(!s)return;const a=Vy.getPropertyValue(Ws.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,t),{isMultiRecordData:r,editType:o}=a||{};if(r){const e=Vy.getPropertyValue($s.CASE_INFO.CASE_INFO_ID,n,t),s=Vy.getPropertyValue($s.CASE_INFO.ASSIGNMENT_ID,n,t),{interestPage:i,interestPageActionID:c,actionID:l,isLocalAction:u,viewName:d}=a;o===Ws.ACTION?vm(e,s,l,t,i,c,u,r,o):bm(e,d,t,i,{})}else jm(t,n,{})},km=(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},Bm=(e,t)=>{const n=e.url===t.url,s=e.interestPage===t.interestPage;return n&&s},$m=(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 Bm(e,t);if(a&&s)return!0;if(n){if(r)return"CANCEL_REFRESH";if(s)return Bm(e,t)}return!1},Wm=e=>{const t=(e=>{const t=[];return pu.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const s=n.split(".");s.shift();let a=s.join(".");e&&a&&(a=Ly.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a}))})),t})(e),n=(e=>{const t=[];return pu.getWhens(e).forEach((({name:e,type:n,pageReference:s})=>{const a=s.split(".");a.shift();let r=a.join(".");e&&r&&(r=Ly.convertPageRefToClipboardPageNotation(r),t.push({name:e,context:r,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}};const Gm=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}},{APP:Hm}=Ws;let qm={},zm={},Ym={};const Km="You will lose unsaved changes. Do you want to continue?",Qm="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",Jm=(e=Hm.APP,t,n)=>{let s=[],a=[];t||(s=um(e,!0)),n||(a=(e=>{const t=pu.getContextReferences(e),n=[];if(t)for(const[e,s]of t)!0===Vy.resolveContextTreeNodeProps(s.props).readOnly&&n.push(e);return n})(e));const r={};((e,t,n)=>{const s=zm[t]||{};Object.keys(s).forEach((t=>{const a=s[t].associatedProperty;Object.hasOwn(s,t)&&(void 0===a||n.includes(a))&&Ly.buildObject(t,e,s[t].value)}))})(r,e,s);const o=qm[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&s.includes(e)||t;Object.hasOwn(o,e)&&n&&!a.includes(e)&&Ly.buildObject(e,r,o[e].value)})),r},Xm=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete qm[t]?.[n],delete zm[t]?.[n]};var Zm;Zm=(e,t)=>{Xm({context:e,reference:t})},ru=Zm;const eI=e=>e&&Ym[e],tI=e=>{e&&Ym[e]&&(Ym[e]=!1)},nI=(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=Sy(t.reference,null,n):(e[o]={initialValue:s||Sy(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&&Xm(t)},sI=e=>{const{payload:t}=e,{context:n}=t,s=t.reference.startsWith(".")?t.reference.substr(1):t.reference;pu.isFieldExists(n,s)||(zm[n]=zm[n]||{},nI(zm[n],t)),qm[n]=qm[n]||{},nI(qm[n],t)},aI=({value:e,context:t,reference:n})=>{const s=HI(t),a=II(s,t)||{};if(Gm.isPageInstruction(n)||a?.subscriptFieldName)return;const r=n?.startsWith(".")?n?.substr(1):n;qm[t]=qm[t]||{};qm[t][r]||(qm[t][r]={initialValue:Sy(r,null,t)}),qm[t][r].value=e},rI=e=>e&&qm[e]&&Object.keys(qm[e]).some((t=>qm[e][t].initialValue!==qm[e][t].value))||!!eI(e),oI=(e,t)=>{if(!e||!t)return!1;const n=qm[e]&&qm[e][t];return!!n&&n.previousValue!==n.value},iI=e=>{e&&qm[e]?(qm[e]={},zm[e]={}):"all"===e&&(qm={},zm={},Ym={}),Ym[e]&&(Ym[e]=!1)},cI=(e,t,n=new Set)=>{if(n.has(t))return;n.add(t);[...yo.getDependencies(e,t),...gy.getResetDependencies(e,t)].forEach((t=>{const s=Ly.getPropertyNameFromDependency(t);if("object"==typeof t&&"multiRecord"===t.mode){const t=s.split("."),n=`.${t.pop()}`,a=t.join(".");if(Qf.isStateMachineExist(e,a,n)){Qf.getStateMachine(e,a,n).deleteAll()}}else Gm.isPageInstruction(s)&&Qf.executeStateMachine(e,s,""),Ey({type:sa,payload:{reference:s,value:"",context:e,isArrayDeepMerge:!0,isImplicit:!0}});cI(e,s,n)}))},lI={propertyChangeMiddleware:()=>e=>t=>{const{type:n,payload:s={}}=t||{};if(n===ra&&(mo(s),(e=>{const{context:t,pageReference:n,value:s,reference:a}=e;gy.triggerCascade(t,a,s);const r=yo.getDependencies(t,a),o={context:t,datapages:{}};cI(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=Sy(`.${i}`,a,t)?.classID||e.classID,l=$E(s.split(".").pop(),c),{datasource:u}=l,d={},p=[];u.parameters.forEach((e=>{e?.value?(d[e.name]=Fp.isProperty(e.value)?Sy(`.${Ly.getFullPropertyReference([i,Ly.getPropertyName(e.value)])}`,a,t):e.value,void 0===d[e.name]||null===d[e.name]||""===d[e.name]?(d[e.name]="",p.push(Ws.NULL_STRING)):p.push(d[e.name])):(d[e.name]="",p.push(Ws.NULL_STRING))}));const g=u.name.concat(Ws.UNDERSCORE_STRING,Ly.getHashedString(p.join(Ws.HASH_DELIMITER))),{name:h}=u,f=XE(h);o.datapages[g]={mode:u.mode,propertyName:s,name:u.name,dataViewParameters:d,refreshStrategy:f?.refreshStrategy}})),r.length&&Ey({type:pr,payload:o})})(s),setTimeout((()=>{(oI(s.context,s.reference)||Fd(s.context))&&Vm(s),Zg.triggerRefreshForType("PROP_CHANGE",s.reference,s.context)}),0)),n===fr&&!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=Hh({meta:s}).getPConnect();if(n.isWhenExist()||Lm(n,t))return!0;if(s.children&&e(t,s.children))return!0}return!1}(n.contextClass,n.children??[])),t&&xm(e.getCurrentView(),e.getContextName(),e.getPageReference())})(n),setTimeout((()=>{Zg.triggerRefreshForType("PROP_CHANGE",t,e)||Vm({context:e,pageReference:t})}),0),o||(Ym[`${e}`]=!0)}if(n===sa||n===aa){const{reference:e,isImplicit:n,context:a,skipDirtyValidation:r=!1}=s;pu.updateFieldNodeValue(a,e,s.value),Gm.isPageInstruction(e)||r?r||(Ym[`${a}`]=!0):sI(t),(s.removePropertyFromChangedList||n)&&Xm(s)}if(n===Ua||n===Fa){const{transientItemID:e,data:t}=s;Ly.iterateLeafNodes(t,(t=>{Xm({context:e,reference:t.join(".")})}))}if(n&&[ka,va,$a,La].includes(n)){iI(s.context),gy.purgeResetDependencies(s.context),(e=>{e&&Pm[e]&&delete Pm[e]})(s.context);(s.childContainersContexts||[]).forEach((e=>{iI(e)}));(s.transientItems||[]).forEach((e=>{iI(e)}))}e(t)},getChanges:Jm,recordChange:sI,isDirty:()=>Object.keys(qm).some((e=>rI(e))),isPropertyDirty:oI,isContextDirty:rI,resetChangedProperties:iI,deleteRecordedChange:Xm,isComplexObjectMerged:eI,resetComplexObjectDirtyStatus:tI};const uI=new class{getCoreheaders(e){const t=`${$s.APP.APP}${Ws.FORWARD_SLASH_STRING}${Ws.PRIMARY}`,n=OI(t),s=bI(n),a=Vy.getProperty(Ws.COREHEADERS,"",s);if(a&&e in a)return a[e]}},dI={defaultLimit:16},pI={SINGLE:"single",MULTIPLE:"multiple"},gI={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},hI=()=>Iy()?.getState()?.containers;function fI(e){return"string"==typeof e&&""!==e.trim()}const mI=e=>fI(e)?Iy()?.getState().containers[e]:null,II=(e,t)=>{if(!fI(e)||!fI(t))return null;const n=hI(),s=n?.[e];return s&&s.items&&s.items[t]||null},EI=e=>fI(e)?Iy()?.getState().containers[e]?.items:null,yI=e=>fI(e)&&Iy()?.getState().containers[e]?.accessedOrder||[],AI=e=>fI(e)&&yI(e)?.length>0||!1,CI=(e,t,n)=>{if(!fI(e)||!fI(t))return!1;const s=hI(),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},SI=(e,t,n)=>{if(!fI(e)||!fI(t))return null;const s=hI(),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},_I=(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},NI=e=>{if(!fI(e))return null;const t=hI()??{};for(const n of Object.keys(t))if(t[n]){const s=t[n].items??null,a=_I(e,s);if(a)return a}return null},TI=(e,t)=>{if(!fI(e)||!fI(t))return!1;const n=hI();return n&&Object.hasOwn(n,`${e}/${t}`)},DI=(e,t)=>{if(!fI(e)||!fI(t))return null;const n=hI(),s=n?.[`${e}/${t}`];return s&&s.type},OI=e=>{if(!fI(e))return null;let t=null;const n=hI();if(n&&n[e]){const s=n[e],{accessedOrder:a}=s;t=a&&a.length>0?a[a.length-1]:null}return t},PI=(e,t,n)=>{if(!fI(e)||!fI(t))return!1;const s=SI(e,t,n);return!!s&&s===OI(e)},RI=(e,t)=>{let n=null;const s=hI();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},bI=e=>fI(e)?RI(e,"context"):null,vI=e=>{if(!fI(e))return null;let t=null;const n=hI();if(n&&n[e]){const s=n[e],{accessedOrder:a}=s,r=a&&a.length>0?a[a.length-1]:null;t=bI(r)}return t},xI=e=>{if(!fI(e))return[];const t=e.endsWith("/")?e:`${e}/`;let n=[],s=!1;const a=hI();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:[]},wI=e=>{if(!fI(e))return[];const t=[],n=hI();if(!n)return[];for(const s of Object.keys(n))s.startsWith(e)&&s!==e&&t.push(s);return t},MI=e=>{if(!fI(e))return[];const t=[],n=hI();if(!n)return[];for(const s of Object.keys(n))if(s.startsWith(e)&&s!==e){(yI(s)||[]).forEach((n=>{bI(n)!==e&&t.push(bI(n))}))}return t},LI=e=>{const t=[...MI(e),e],n=[],s=Iy()?.getState().data||{};return t.forEach((e=>{Object.hasOwn(s,`${e}/${Ws.SUGGESTION}`)&&n.push(`${e}/${Ws.SUGGESTION}`)})),n},UI=e=>fI(e)?e&&mI(e)&&mI(e).type===pI.SINGLE:null,FI=e=>fI(e)?e&&mI(e)&&mI(e).type===pI.MULTIPLE:null,jI=e=>fI(e)&&mI(e)&&mI(e).items&&Object.keys(mI(e)?.items).length>0||!1,VI=e=>e&&dI[e]?dI[e]:dI.defaultLimit,kI=(e,t=dI.defaultLimit)=>{fI(e)&&(dI[e]=t)},BI=e=>{if(!fI(e))return!1;let t=!1;const n=mI(e),{items:s={}}=n,a=Object.keys(s),r=VI(e);return a&&a.length>0&&a.length>=r&&(t=!0),t},$I=e=>{if(!e||!fI(e.name)||!fI(e.context))return null;const t=e?.name,n=mI(`${e?.context}/${t}`),s=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],a=wI(`${Ws.APP.APP}/${Ws.PREVIEW}`),r=MI(`${Ws.APP.APP}/${Ws.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...s,...r],childContainers:a}},WI=e=>{if(!fI(e))return!1;const t=bI(e);return rI(t)||Uf(e)},GI=e=>{if(!fI(e))return null;let t;const n=mI(e),{accessedOrder:s=[]}=n;for(let e=0;e<s.length;e+=1){const n=s[e];if(!WI(n)){t=n;break}}return t},HI=e=>{if(!fI(e))return null;const{containers:t}=Iy()?.getState()||{};if(t)for(const n of Object.keys(t))if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(Ws.UNDERSCORE_STRING);return e.slice(0,n)},qI=(e,t={})=>{if(!fI(e))return Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=HI(e),s=bI(e),{skipDirtyCheck:a}=t;let r=!0,o=[];if(WI(e)&&!a&&(r=window.confirm(OE.getLocaleValue(Km,"Messages"))),r){const{accessedOrder:a=[],items:r={},type:i}=mI(n);o=a.filter((t=>t!==e));const c=o[o.length-1],l=r[c]||{},{semanticURL:u=Ws.FORWARD_SLASH_STRING,context:d}=l;o.length>0&&u&&u!==Ws.FORWARD_SLASH_STRING?qA({directUrlUpdation:!0,semanticURL:u,options:{containerItemID:c,context:d}}):qA({directUrlUpdation:!0,semanticURL:Ws.FORWARD_SLASH_STRING,options:{}});Ey(pA({containerItemID:e,context:s,target:n,containerInfo:{newAccessedOrder:o,containerType:i},...void 0!==t.eventName?{eventName:t.eventName}:{}}))}return Promise.resolve({newAccessedOrder:o,removeItem:r})},zI=(e,t,n,s)=>{const a="root",r=Qs(t,a,!0),o=jr(t,a),i={data:n,context:s?"app":r},c=[eA({root:e,containerItemID:r,context:s?"app":r,target:o,containerName:t})];c.push(qy(i)),Ey(c)},YI=(e,t,n)=>{let s=yI(e);s=s.filter((e=>e!==t));let a=!1;for(let e=0;e<s.length;e+=1){if(bI(s[e])===n){a=!0;break}}return a},KI=e=>{if(!fI(e))return!1;const t=hI(),n=bI(e),s=t?Object.keys(t):[];let a=!1;for(let t=0;t<s.length&&(a=YI(s[t],e,n),!a);t+=1);return a},QI=e=>{Array.isArray(e)||(e=[e]);const t=hI()||{};return e.map((e=>{const n=HI(e);return Ly.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},JI=e=>{const{transientItemID:t,data:n,options:s}=e,a=Ly.deepClone(Iy()?.getState().data[t]);s?.reset&&Ly.iterateLeafNodes(a,(e=>{"classID"!==e[e.length-1]&&Ly.setIn(a,e,"")})),Ey(nA({transientItemID:t,data:Ly.mergeDeep(n,a)}))},XI=e=>{const{transientItemID:t,data:n}=e;Ey(aA({transientItemID:t,data:n}))},ZI=e=>{const t=Ly.deepClone(Iy()?.getState().data[e]);Ly.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&Ly.setIn(t,e,"")})),Ey(sA({transientItemID:e,data:t}))},eE=e=>{const t=Ly.deepClone(Iy()?.getState().data[e]);Ly.iterateLeafNodes(t,(e=>Ly.setIn(t,e,""))),Ey(rA({transientItemID:e,data:t}))};class tE{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 nE=()=>tE,sE=e=>{const t={containerName:e};t.childContainers=wI(e),Ey({type:Ga,payload:t})},aE=(e,t)=>{const n=xI(e),{key:s}=II(HI(e),e),a=[];n.forEach((e=>{const{key:n}=II(HI(e),e);if(n===s){const n={data:{caseInfo:{headers:{etag:t}}},target:HI(e),context:e};a.push({type:_a,payload:n})}})),a.length&&Ey(a)},rE=(e,t)=>{const n=[],s={data:{caseInfo:{headers:{etag:t}}},target:HI(e),context:e};n.push({type:_a,payload:s}),n.length&&Ey(n)},oE=()=>NE.isPortalLoaded?"app":"root",iE=()=>uI,cE=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:HI(e),context:e};Ey({type:_a,payload:n})},lE=(e,t)=>{const n=SI(e,t),s=SI(`${n}/workarea`,t);return bI(s)},uE=e=>fI(e)?RI(e,"parentContext"):null,dE=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},pE=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},gE=()=>Vp,hE=/{(.*?)}/i,fE=/{(.*?)}/g,mE=e=>null!==e.match(hE),IE=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),EE=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`}},yE=()=>IE(window.location.pathname),AE=()=>IE(window.location.pathname+window.location.search),CE=(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 SE=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=>{mE(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=()=>IE(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>IE(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("/")&&hg()&&"PREVIEW"!==NE.getRenderingMode()&&this.setDefaultClassName(""),IE(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=hg();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={}){const s=this.getSemanticURL(e,t,n);let a=s;if(mE(s)){const e=s.match(fE);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(a=a.replace(e,String(n[t])))}))}const r=HA(a),o=new URL(r);return this.isDefaultPortal()||this.getPortalName()&&!o.searchParams.toString().includes("portal=")&&o.searchParams.append("portal",this.getPortalName()),o.toString()}buildDocumentTitle(e,t,n){const s=n??"";return e&&t?`${e} (${t}) - ${s}`:s}updateSemanticURLAndDocumentTitle(e){const{key:t,actionName:n,caseClassName:s,isRemoteCase:a,name:r}=e;if(a&&!s)return;const o=this.getSemanticURL(n,{caseClassName:s}).replace(/{.+?}/,String(nf(t))),i=`${$s.APP.APP}${Ws.FORWARD_SLASH_STRING}${$s.PRIMARY}`,c={semanticURL:o,directUrlUpdation:!0,options:{acName:i,context:vI(i)}},l=yE();o&&!l.includes(o)&&GA(c);const u=t.substring(t.lastIndexOf(" ")+1),d=NE.environmentInfoObject?.pxApplication?.pyLabel,p=this.buildDocumentTitle(r,u,d);ZA(p)}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&&(Ly.isEmpty(r)||Ly.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&&mE(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);return`${s}?${new URLSearchParams(Object.fromEntries(Object.entries(o).map((([e,t])=>[e,String(t??"")])))).toString()}`}return s}_getQueryParamsObject(e){const t={},n=new URLSearchParams(e);for(const[e,s]of n.entries())t[e]=s;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(fE);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],mE(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))mE(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(!mE(n))return e;const s={};if(s[t]=e,void 0!==e.payload){const t=n.match(fE);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&&mE(a)){const e=a.match(fE)??[];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(hg()){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(!mE(e)&&e!==s[o]&&EE(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)=>{CE(e,t,"warning"),CE("Error in Generated Routing Table",null,"error"),CE("Back | Forward for this page may NOT work as intended",null,"warning"),CE("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},_E=SE;const NE=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"}setEnvironmentInfo(e){const t=e?.pxOperator?.pyUserName,n=t?Ly.decodeHtmlEntities(t):void 0,s={...e,pxOperator:e.pxOperator?{...e.pxOperator,...n?{pyUserName:n}:{}}:e.pxOperator};this.environmentInfoObject=s;const a=this.environmentInfoObject?.features||Ly.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&&eC(e)}}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 _E.getPortalName()}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}getTheme(e){return"dark"===e?.type?this.darkThemeOverrides:this.themeOverrides}setTheme(e,t){return"dark"===t?.type?this.darkThemeOverrides=e:this.themeOverrides=e,this.themeOverrides}setIsWebEmbed(e){return this.isWebEmbed=e,this.isWebEmbed}isWSSPortal(){return this.environmentInfoObject?.pyPortalTemplate===Ws.PORTAL_TYPE.WSS}isInfinityRuntime(){return"Infinity"===this.environmentInfoObject?.pyExecutionRuntimeName}isGenAIEnabled(){return!!this.environmentInfoObject?.pyGenAIEnabled}getRewriteGenAIDP(){return this.environmentInfoObject?.pyRewriteGenAIDP}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(Ws.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}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){const t=this.environmentInfoObject?.pyLanguagePacks||[];return(t.find((t=>t.pyLangCode===e))?.pyBundles??t.find((e=>e.pyLangCode===Ws.DEFAULT.toUpperCase()))?.pyBundles??[]).sort(((e,t)=>e.pyOrder-t.pyOrder))}getAvailableLocalePacks(){return this.getFeatureMap()?.availableLanguagePacks||void 0}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=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"}};const TE=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 DE{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?Ly.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.#c(n,t),r=this.#l(e);r&&(e=TE.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?TE.replaceWithValue(o[e]||i[e]||e):o[e]||i[e]||e}#c(e,t){return e?.toUpperCase().startsWith("@BASECLASS!DATAPAGE!")?t?`${e}#${t}`:e:e||t}getParagraphLocaleValue(e,t){const n=`${e}!${Ws.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!==NE.getLocalizationVersion()?"":e?`PORTAL!${e}`.toUpperCase():`PORTAL!${NE.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return 2}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=NE.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:dp.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){if(NE.getLocalizationVersion()===Ws.LOCALIZATION_V2)return;const t=NE.getUseLocale(),n=NE.getBaseLocale();if(NE&&t&&(t!==n||"en-US"!==n)&&e?.length>0)try{(await this.getLocaleJsons(e)).forEach((e=>{this.setLocaleForRule(e.jsonData,e.localeRuleKey)}))}catch(e){console.warn(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=NE.getLocale();return this.availableLangPacks||(this.availableLangPacks=await dp.getSvcAvailableLocales()),e&&this.availableLangPacks.includes(e)}getBaseComponentLabels=()=>this.getLocaleForRule("COSMOSFIELDS");#l(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}}const OE=new DE;Co.registerHandler("@L",((e,t)=>t?t.getLocalizationService(t.getLocaleRuleName()).getLocalizedText(e):e)),Co.registerHandler("@P",((e,t,n)=>n?Vy.getLitePropertyValue(n):t.getValue(e))),Co.registerHandler("@E",((e,t,n)=>{try{const s=io(e),a=co(s);return lo(a,t,n)}catch(e){}return!0})),Co.registerHandler("@W",((e,t,n)=>{let s;if(n){const{pageReference:t,context:a}=n;s=_y(t,`.${Ws.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,a)}else s=t.getContextDataValue(`.${Ws.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);return!0===s||"true"===s})),Co.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===Ws.READONLY,l=n?.datasource?.name||"",u=t.getComponentConfig();if(u&&u.deferDatasource&&(u.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:u.datasourceMetadata}),i===Ws.DATA_PAGE))return null;if(i===Ws.DECISION||i===Ws.RULE_REFERENCE)return function(e,t){const n=So.getPropertyName(e?.propertyForDisplayText??""),s=So.getPropertyName(e?.propertyForValue??""),a=t.getContextDataValue(`.${Ws.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return a?.map((e=>({key:e[s]||e[`.${s}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==Ws.DATA_PAGE){const e=t.getLocalizationService(n?.localeReference);return n?.datasource?.records?.map((t=>({key:t.key,value:e.getLocalizedText(t.value)})))}const d=So.getPropertyName(n?.datasource?.propertyForDisplayText),p=So.getPropertyName(n?.datasource?.propertyForValue),g=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],h=t.getContextName(),f=[];if(g.forEach((e=>{if(So.isProperty(e?.value)){let t=Sy(`.${Ly.getFullPropertyReference([r,So.getPropertyName(e.value)])}`,o,h);f.push(Ly.getFullPropertyReference([o,r,So.getPropertyName(e?.value)])),null!=t&&""!==t||(t=Ws.NULL_STRING),s.push(t)}else s.push(e?.value||Ws.NULL_STRING)})),h){const e=yo.getContextObjectByName(h)||{};f.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,a])]}else e[t]=[a]})),yo.addContextName(h,e)}const m=function(e,t,n,s){let a="",r=n;if(t.join(Ws.HASH_DELIMITER)&&(a=Ly.getHashedString(t.join(Ws.HASH_DELIMITER)),r=n+Ws.UNDERSCORE_STRING+a),s){const e=Ay(),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}}))})),Co.registerHandler("@ROUTING_INFO",((e,t)=>Vr(t.getContainerName(),t.getContextName()))),Co.registerHandler("@ENV",((e,t)=>{switch(e){case Ws.ENV_INFO_KEYS.APPLICATION_NAME:return NE.getApplicationName();case Ws.ENV_INFO_KEYS.ACCESS_GROUP:return NE.getAccessGroup();case Ws.ENV_INFO_KEYS.APPLICATION_ID:return NE.getApplicationID()||NE.getApplicationName();case Ws.ENV_INFO_KEYS.USER_NAME:return NE.getOperatorName();case Ws.ENV_INFO_KEYS.USER_ID:return NE.getOperatorIdentifier();case Ws.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizationService().getLocalizedText(NE.getApplicationLabel()||"");case Ws.ENV_INFO_KEYS.USER_IMAGE:return NE.getOperatorImageInsKey();case Ws.ENV_INFO_KEYS.LOCALE:return NE.getUseLocale();case Ws.ENV_INFO_KEYS.TIMEZONE:return NE.getTimeZone();case Ws.ENV_INFO_KEYS.WORK_GROUP:return NE.getOperatorWorkGroup();default:return e}})),Co.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=So.getPropertyName(e);s[t]=n[t]})):Object.keys(e).forEach((t=>{const a=So.getPropertyName(e[t]);s[t]=n[a]})),o.push(s)})),o}return[]})),Co.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})),Co.registerHandler("@USER",((e,t,n)=>{const s=n?Vy.getLitePropertyValue(n,e):t.getValue(e),a=n?Vy.getReferencedUser(s,n):t.getReferencedUser(s);return{userId:s,userName:a?a.UserName:null}})),Co.registerHandler("@ACTIVE_CASES",((e,t)=>xg.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),Co.registerHandler("@LR",(e=>e)),Co.registerHandler("@CASE",((e,t)=>e===Ws.ID?t.getCaseInfo().getKey():e)),Co.registerHandler("@SHARED",(e=>Eh.getSharedState(e))),Co.registerHandler("@PARAGRAPH",((e,t)=>{const{useDecision:n,isBanner:s,messageType:a,dismissBanner:r}=Ah.getParagraphProperties(e,t),o=Ah.hasDecisionBannerContent(e,t);return n&&o?Ah.processBannerDecisionParagraph(e,t):s?{htmlContent:Ah.processParagraph(e,t),messageType:a,dismissBanner:r}:Ah.processParagraph(e,t)})),Co.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 Ly.isEmpty(r)?o=t.getValue(`.${n}`):(o=r,o=Ly.getIn(o,n)),o&&s.length>0?(a&&(o=o.filter((e=>uo(a,e)))),o.map((e=>Ly.getIn(e,s)))):null})),Co.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.[ks.getDefaultQualifiedName("pyCountry")];return n?`${PCore.getDefaultQualifiedName("pyAddressForm")}_${n}`:PCore.getDefaultQualifiedName("pyAddressForm")})),Co.registerHandler("@DATATYPE",((e,t)=>t.getValue(e))),Co.registerHandler("@ATTACHMENT",((e,t,n)=>{let s;return s=n?Vy.getLitePropertyValue(n):t.getValue(e),zd.prepareAttachmentData(s)})),Co.registerHandler("@FL",((e,t)=>t.getLocalizedValueForFieldLabel(e))),Co.registerHandler("@DEFERRED",((e,t)=>{const n=t.getFieldMetadata(e);return n?.isDeclarativeTarget?{isDeferred:!0,propertyName:e}:t.getValue(e)})),Co.registerHandler("@GENAICOACH",((e,t)=>ay(e,t.getCurrentClassID()))),Co.registerHandler("@AIAGENT",((e,t)=>{const n=ry(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:NE.getFeatureMap()?.isNamespaceEnabled&&e.includes(Ws.DOUBLE_UNDERSCORE_STRING)?e:`${n.ruleNamespace}${Ws.DOUBLE_UNDERSCORE_STRING}${e}`,label:t.getLocalizedValue(a),type:"agent"}}}return null})),Co.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),s=t.getContextName(),a=t.getPageReference();Zg.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)})),Co.registerHandler("@DW",((e,t,n)=>{let s;const a=`${Ws.CONTEXT_DATA}.${Ws.SUMMARY_OF_DYNAMIC_WHENS}.${e}`;if(n){const{context:e}=n??{};s=Sy(a,null,e)}else s=t.getValue(a);return!0===s||"true"===s})),Co.registerHandler("@CA",((e,t,n)=>n?Vy.getLitePropertyValue(n):t.getValue(e)));const PE={},RE={},bE={},vE={},xE={},wE={},ME={},LE={},UE={},FE={},jE={},VE={},kE={},BE=(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})):Ly.copy(e,t)},$E=(e,t="")=>{if(!e)return null;const n=vE[e];if(!n)return null;if(!t)return Ly.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?Ly.deepClone(s):null},WE=e=>(VE[e]||(VE[e]=new DE),VE[e]),GE=(e,t)=>(kE[e]||(kE[e]=t()),kE[e]),HE=(e,t,n,s=[])=>{if(!t||!e)return null;if(!e.includes(".")){let a;const r=$E(e,t);return s.length&&(a=s.join(".")),{...r,embeddedType:n,category:a}}const[a,...r]=e.split("."),o=$E(a,t);return o&&s.push(o.label),HE(r.join("."),o?.pageClass,o?.type,s)},qE=e=>{BE(e,RE)},zE=e=>{BE(e,bE)},YE=e=>{(e=>{e.views&&BE(e.views,RE),e.navigations&&BE(e.navigations,bE),e.personalizations&&BE(e.personalizations,wE),e.insights&&BE(e.insights,ME),e.paragraphs&&BE(e.paragraphs,PE),e.dataTypes&&BE(e.dataTypes,LE),e.datapages&&BE(e.datapages,UE),e.genAICoaches&&BE(e.genAICoaches,FE),e.AIAgents&&BE(e.AIAgents,jE)})(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=Ph(Th,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=>{xE[e]=t[e]})),BE(e.fields,vE)},KE=e=>RE[e],QE=(e,t)=>{const n=RE[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},JE=e=>bE[e],XE=e=>e in xE?xE[e]:null,ZE=e=>e in wE?wE[e]:null,ey=e=>e in ME?ME[e]:null,ty=e=>{const t={};return Object.keys(vE).forEach((n=>{const s=vE[n];let a;Array.isArray(s)?a=s.find((t=>e===t.classID)):e===s.classID&&(a=s),a&&(t[n]=Ly.deepClone(a))})),t},ny=(e,t)=>{const n=$E(e,t),s=n?.datasource?.parameters;return s?Ly.deepClone(s):null},sy=(e,t)=>{let n=null;const s=PE[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?Ly.deepClone(n):null},ay=(e,t)=>{let n=null;const s=FE[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?Ly.deepClone(n):null},ry=(e,t)=>{let n=null;const s=jE[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?Ly.deepClone(n):null},oy=e=>{if(e in LE){const{savableDataPage:t}=LE[e];return t}return null},iy=e=>{const t=UE[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=LE[n];return r?r.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:s}))):[]},cy=e=>{if(e in LE){const{lookupDataPage:t}=LE[e];return t}return null},ly=e=>{if(Object.hasOwn(LE,e)){const{lookupDataPageInfo:t}=LE[e];return t}return null},uy=(e,t)=>{const n=e.split("."),s=n.pop(),a=new Gh({options:{pageReference:`${n.join(".")}`,context:t}}),r=$E(s,a.getCurrentClassID())?.additionalInformation;if(!r?.includes("@PARAGRAPH"))return r;const o=So.trimAnnotation(r);return Ah.processParagraph(o,a)},dy=(e,t)=>{const n=e.split("."),s=n.pop(),a=new Gh({options:{pageReference:`${n.join(".")}`,context:t}}),r=$E(s,a.getCurrentClassID()),o={};return a._classID=a.getCurrentClassID(),a.resolveConfigProps(r,o),o};class py{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=Ly.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=Ly.getFullPropertyReference([i,t]),t in o){const e=o[t];Ly.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=Sy(n,t,e);r.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,s,a){const r=py._getFieldsForList(e,t,n);r.length>0&&(this.registerFields(e,t,r,s,a),lg.enableCascade(e))}unRegisterListField(e,t,n,s){const a=py._getFieldsForList(e,t,n);a.length>0&&this.unRegisterFields(e,t,a,s)}static _getFieldsForList(e,t,n){const s=[],a=$E(n,Sy("classID",t,e));return a&&!Array.isArray(a)&&a.datasource&&a.datasource.parameters&&Object.values(a.datasource.parameters).forEach((e=>{if(So.isProperty(e)){const t=So.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=Sy(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=Sy(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=Du.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&&Ly.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=Sy(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=Sy(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=Ws.CASE_INFO.CASE_INFO_CONTENT){const s=[],a=[],r=[],o=Ly.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 gy=new py;let hy=null;const fy=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),my=e=>{hy=e},Iy=()=>hy,Ey=e=>{if(!e)return;let t=[],n=[],s=[];if(Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:s}=gy.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),hy?.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})=>{Du.clearMessages({type:"error",property:t,pageReference:n,context:e.payload.context});const s=pu.getFieldReferenceForProperty(e.payload.context,`${n}${t}`);if(s){const e=Vy.resolveContextTreeNodeProps(s.props);Kd.validate(e.componentName?.toLowerCase(),e.propertyName,Vy.getLitePropertyValue(e,e.propertyName),e)}}))}gy.handleServerChanges(e.payload.context,t,n)}},yy=e=>Iy()?.getState().data?.[e],Ay=()=>Iy()?.getState().data[Ws.SHARED],Cy=(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=fy(a);return Ly.getIn(n,r)},Sy=(e,t,n)=>Cy(e,t,yy(n)),_y=(e,t,n)=>Cy(t,e?`${Ws.CONTEXT_DATA}.${e}`:`${Ws.CONTEXT_DATA}`,yy(n)),Ny=(e,t,n)=>((e,t,n)=>{const s=fy(`${t}.${n}`);return Ly.getIn(e,s)})(yy(n),`${Ws.CONTEXT_DATA}.${e}`,t),Ty=e=>{const{context:t}=e,n=Iy()?.getState().data[t];if(n)return Ea;const{action:s}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(s)?ba:Ea},Dy=(e,t)=>{const n=fy(t);return Ly.deleteIn(e,n)},Oy=e=>!Array.isArray(e)&&"object"==typeof e,Py=(e,t=[],n=[])=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&!n.includes(t.path)&&Ly.setIn(e,t.path,[]):Ly.setIn(e,t.path,{})})),n.length>0&&Ly.rearrangeProperties(n,e)},Ry=(e,t,n={})=>{const{isArrayDeepMerge:s,propertiesToReplace:a=[],propertiesToReArrange:r=[]}=n;Array.isArray(e)&&!t&&(t=[]),Py(e,a,r);const o=(e,t)=>{if(Oy(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return 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)},by=(e,t,n,s={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:a}=s,r=fy(t);if("object"==typeof n){const t=Ry(Ly.getIn(e,r),n,{isArrayDeepMerge:a});return Ly.setIn(e,r,t)}return Ly.setIn(e,r,n)},vy=(e,t,n)=>{const s=fy(t);return Ly.setIn(e,s,n)},xy=()=>{const e=dr,{promise:t,actionMgrID:n}=Ip.actionManagerPromise(e);return Ey({type:e,payload:{actionMgrID:n}}),t},wy=e=>{const t=Iy()?.getState();return!!t?.data?.[e]};class My{static mergeDeep(e,t){return Us(t,e)}static hasIn(e,t){return $n(e,t)}static getIn(e,t,n){return Wn(e,t,n)}static setIn(e,t,n){return Kn(e,t,n)}static deleteIn(e,t){return jn(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return js(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 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=My.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=So.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=So.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)?[]:{}),Ry(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]]&&My.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)=>{My.flatten(e,`${t}[${s}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((s=>{const a=t?`${t}.${s}`:s;My.flatten(e[s],a,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=e.startsWith(Ws.OBJECT_INFO.OBJECT_INFO)?`${e}${t}`.replace(Ws.OBJECT_INFO.OBJECT_INFO_CONTENT,""):`${e}${t}`.replace(Ws.CASE_INFO.CASE_INFO_CONTENT,"").replace(Ws.DATA_INFO.DATA_INFO_CONTENT,"");return dd.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&&Ip.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,My.convertObjectWithStringToBoolean(s)):n=s,e[t]=n})),e}static rearrangeProperties(e,t){e.forEach((e=>{let n=My.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));My.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("/")),Iy()?.getState()?.data[t]?.caseInfo?.headers?.etag}static PAGELIST_PATH_REGEX=/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/;static isValidPageListProperty(e){return My.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=So.isProperty(n)?Sy(`.${So.getPropertyName(n)}`,r,o):n;null!=a&&""!==a||(a=Ws.NULL_STRING),s.push(a)}));let i=t;const c=s.join(Ws.HASH_DELIMITER);return c&&(a=My.getHashedString(c),i=t+Ws.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 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=$E(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?(My.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))&&My.pruneKeys(n,s,!0)})):Array.isArray(e)&&e.forEach((e=>{(ms(e)||Array.isArray(e))&&My.pruneKeys(e,s,!0)})),e):Array.isArray(e)?e.map((e=>ms(e)||Array.isArray(e)?My.pruneKeys(e,s,!1):e)):My.isNestedObject(e)?Object.keys(e).reduce(((t,n)=>{if(!s.has(n)){const a=e[n];t[n]=ms(a)||Array.isArray(a)?My.pruneKeys(a,s,!1):a}return t}),{}):e}}const Ly=My,Uy=Ws.SUMMARY_OF_LISTS,Fy=Ws.SUMMARY_OF_WHEN_CONDITIONS;class jy{static updateData(e){Object.keys(e).forEach((t=>{Ey(qy({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{Ey(qy({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${Fy}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){const n=this.resolveName(e,t);return JE("string"==typeof n?n:"")}static resolveView(e,t,n=""){const s=KE(this.resolveName(e,t));let a=[];if(Array.isArray(s)&&s.length>0){if(t&&s.length>1){if(n||(n=t.getValue(Ws.CLASS_ID)||""),!n)return;a=s.filter((e=>e[Ws.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=So.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=So.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(Ws.CLASS_ANNOTATION)?t.split(Ws.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName(),e.getValue(Ws.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 Sy(t,e,n)}static getProperty(e,t,n){let s=this.resolvePropertyReference(t,e,n);if(null==s||0===s.length){const a=Ny(`${t}.${Uy}`,e,n);a&&(s=this.resolvePropertyReference(t,a,n))}return s}static getPropertyValue(e,t,n){return e=So.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=jy.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?jy.getPropertyValue(i,r,o?`${o}/${Ws.SUGGESTION}`:void 0):jy.getPropertyValue(i,r,o||void 0)}static _handlePropString(e,t,n,s,a){n.startsWith("@")?e[t]=So.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?(Ly.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(Ly.mergeDeep(e,t),this._resolveProps(t,void 0,e),Ly.resolveStringBooleans(t)):t}static resolvePropertyPageClass(e,t){const n=Ly.resolvePageClass(e,t),s=e.substring(e.lastIndexOf(".")+1),a=$E(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=So.trimAnnotation(e);let r=a.startsWith(".")?`${t}${a}`:a;for(;r;){const e=Sy(Ws.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 Vy=jy;const ky=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}},By=ky;const $y=class{static#u=[];static#d=!1;static getActionHandlers=(e,t,n)=>{const s=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=By.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#p=(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.#u.push(r)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===NE.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=Ip.getNextActionMgrId(),n};static#g=e=>{const t=e.actionHandler,n=e.component,{config:s}=e,a={};Vy.resolveProps(s,a,n),t&&(t(e.eventType,a,n),this.#h())};static#h=()=>{if(!this.#d){if(0===this.#u.length)return;const e=this.#u.shift();this.#g(e),e.config&&"true"===e.config.parallel&&this.#u.length>0&&this.#h()}};static#f=()=>{this.#h()};static#m=(e,t,n)=>{this.#p(e,t,n),this.#f()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return Vy.getContextPath(t,n)};static#I(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.#m(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,s=e.getContextName();yu({type:$s.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:s});if(("Browser"===NE.getRuntime()?t?.nativeEvent instanceof Event||t instanceof Event:!!t?.nativeEvent)||null!==t.value&&void 0===t.prop){let n,{target:a}=t;null===a&&t&&t.auxiliaryTarget&&(a=t.auxiliaryTarget),n=void 0===a?t.value:"value"in a?a.value:a.innerText;const r=this.getFullRef(e);Ey({type:sa,payload:{reference:r,value:n,context:s}}),void 0!==a&&this.isEditable(a)&&!this.isNonKeyInput(a)||Ey({type:ra,payload:{reference:r,pageReference:e.getPageReference(),value:n,context:s,propertyName:e.getComponentConfig().value,classID:e.getValue(Ws.CLASS_ID)}})}else{const n=e.getPageReference(),a=e.getStateProps();for(const e of Object.keys(t)){const r=a[e],o=t[e];Ey({type:sa,payload:{reference:Vy.getContextPath(n,r),value:o,context:s}}),Ey({type:ra,payload:{reference:Vy.getContextPath(n,r),value:o,context:s}})}}};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&&yu({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)||Ey({type:ra,payload:{reference:r,pageReference:e.getPageReference(),value:s,context:o,propertyName:e.getComponentConfig().value,classID:e.getValue(Ws.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.#I(e,n)};static pause=()=>{this.#d=!0};static resume=()=>{this.#d=!1,this.#h()};static isQueueEmpty=()=>0===this.#u.length;static clearQueue=()=>{this.#u=[]};static getActionsQueue=()=>this.#u;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},Wy="CREATE_WORK",Gy=e=>({type:Wy,payload:e});const Hy=(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=`${Ly.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])?[]:{}),Hy(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)},qy=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:s=[],propertiesToReArrange:a=[]}=t,{context:r,data:o,isArrayDeepMerge:i,preserveClientChanges:c=!1}=e,l=Jm(r,!0),u=yy(r);let d={};if(u&&o){d=JSON.parse(JSON.stringify(u));const e=JSON.parse(JSON.stringify(o));a.length>0&&Ly.rearrangeProperties(a,d);const t=new Set;Hy(l,d,t,a),((e,t,n)=>{const s=new Set;e.forEach((e=>{e=Ly.trimDotForProperty(e);const[a,r,o]=Zl(e);if(a&&r&&o&&!s.has(`${a}.${r}`)){const e=Ly.getIn(n,`${a}.${r}`)||[];Array.isArray(e)&&e.forEach(((e,n)=>{n!==+o&&Ly.setIn(t,`${a}.${r}[${n}]`,e)})),s.add(`${a}.${r}`)}}))})(t,d,e)}!function(e,t){const n=Ly.getIn(e,Ws.REFERENCED_USERS);let s;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return s=Ly.getIn(t,Ws.REFERENCED_USERS,{}),void Ly.setIn(e,Ws.REFERENCED_USERS,{...s,...n});s=Ly.getIn(t,Ws.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=Ly.getIn(e?.data,Ws.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID),g=gm.isExternalObject(p),h=g?{[Ws.OBJECT_INFO.OBJECT_INFO]:{[Ws.CONTENT]:{...d[Ws.OBJECT_INFO.OBJECT_INFO]?.[Ws.CONTENT]}}}:{[Ws.CASE_INFO.CASE_INFO]:{[Ws.CONTENT]:{...d[Ws.CASE_INFO.CASE_INFO]?.[Ws.CONTENT]}}},f=g?Ws.OBJECT_INFO.OBJECT_INFO_CONTENT:Ws.CASE_INFO.CASE_INFO_CONTENT;let m=o;return c?(n.forEach((e=>{const t=`${f}.${e}`;Ly.deleteIn(h,t)})),m=Ry(o,h,{isArrayDeepMerge:i??!0})):((e,t)=>{const n=qm[e]||{};Object.keys(n).forEach((e=>{Ly.hasIn(t,e)&&(n[e].value=Ly.getIn(t,e))}))})(r,o),{type:_a,payload:{...e,data:m,...s.length>0?{propertiesToReplace:s}:null,...a.length>0?{propertiesToReArrange:a}:null}}},zy=e=>({type:"SHOW_HARNESS",payload:e}),Yy=e=>({type:oa,payload:e}),Ky=e=>({type:ia,payload:e}),Qy=e=>({type:"ADD_WORK",payload:e}),Jy=e=>({type:Ia,payload:e}),Xy=e=>({type:Pa,payload:e}),Zy=e=>({type:Ra,payload:e}),eA=e=>({type:ba,payload:e}),tA=e=>({type:xa,payload:e}),nA=e=>({type:wa,payload:e}),sA=e=>({type:Ua,payload:e}),aA=e=>({type:ja,payload:e}),rA=e=>({type:Fa,payload:e}),oA=e=>{const{containerItemID:t}=e;e.suggestionContexts=LI(t);const n=e?.data?.caseInfo?.content,s=Object.keys(n||{}).length>0;return e.propertiesToReplace=s?gm.getPropertiesToReplace(t):[],{type:ka,payload:e}},iA=e=>{const{context:t}=e;return{type:da,payload:{context:t}}},cA=e=>{const{context:t}=e;return{type:pa,payload:{context:t}}},lA=e=>({type:Ba,payload:e}),uA=e=>({type:Va,payload:e}),dA=e=>({type:lr,payload:e}),pA=e=>{const{context:t,containerItemID:n}=e;let s=t;return s||(s=bI(n)),e.context=s,e.deleteContext=!KI(n),e.childContainers=wI(n),e.childContainersContexts=MI(n),e.transientItems=QI([...e.childContainersContexts,n]),e.suggestionContexts=LI(n),n===t&&(e.caseID=Sy(Ws.CASE_INFO.CASE_INFO_ID,"",t)||Sy(Ws.OBJECT_INFO.OBJECT_INFO_ID,"",t),e.RemoteSystemID=Sy(Ws.CASE_INFO.REMOTESYSTEMID,"",t)),{type:va,payload:e}},gA=e=>{const{containerItemID:t}=e;return e.transientItems=QI([...MI(t),t]),{type:La,payload:e}},hA=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:Ma,payload:e}},fA=e=>{const{context:t,containerItemID:n}=e;let s=t;if(s||(s=bI(n)),e.context=s,e.childContainers=wI(n),e.childContainersContexts=MI(n),e.transientItems=QI([...e.childContainersContexts,n]),e.suggestionContexts=LI(n),n===t){e.caseID=Sy(Ws.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Sy(Ws.CASE_INFO.REMOTESYSTEMID,"",t);const n=Sy(Ws.CASE_INFO.CASE_INFO_CLASSNAME,"",t);qs.isTraditionalRemoteCase(n)&&(e.skipReleaseLockRequest=!0)}return{type:$a,payload:e}},mA=e=>({type:ya,payload:e}),IA=e=>({type:Ca,payload:e}),EA=e=>({type:Da,payload:e}),yA=(e,...t)=>($y.resume(),e(...t)),AA=(e,t,n,s,a)=>({type:Oa,payload:{msg:e,err:t,context:n,formFields:s,actionMgrID:a}}),CA=e=>({type:gr,payload:e}),SA=e=>({type:hr,payload:e}),_A=e=>({type:fr,payload:e}),NA=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),TA=e=>({type:fa,payload:e}),DA=e=>({type:sa,payload:e}),OA="add",PA="replace",RA=["portal","noPortal","preview","debug","devtool","activeTab","contextParam"];let bA="",vA="Home",xA="",wA=!0;const MA=e=>(wA=e,wA),LA=()=>wA,UA=(e,t,n)=>_E.getSemanticURL(e,t,n),FA=(e,t)=>_E.getRestEndPoint(e,t),jA=(e,t)=>{let n=un();const s=FA(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):{}},VA=(e,t,n)=>{const{root:s,resources:a}=e,{views:r}=a,{config:o}=s,i=OA;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(fE);if(l){const e=Ly.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},kA=(e,t)=>{const n=`${e}/${t}`;if(!("EMBED"===NE.getRenderingMode()))return n;const s=_E.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(/\/$/,"")},BA=(e,t,n)=>{let s,a;s=IE(t)?kA(e,t):e;const r=IE(n?.pxURLPath||"");r&&(s=`${s}/${r}`);try{a=new URL(s).searchParams,s=s.includes("?")?s.split("?")[0]:s}catch(e){return console.log("Invalid url",e),""}const o=s.split("/"),i=o[o.length-1],c=new URLSearchParams(window.location.search);if(hg()?(s=((e,t,n,s,a)=>{const r=_E.getStaticRoutePage(),o=vA?.toLowerCase(),i=r?.toLowerCase(),c=s?.toLowerCase();return i!==o&&c!==o||a.has("noPortal")?e:kA(t,n)})(s,e,t,i,c),_E.setStaticRoutePage("")):i.toLowerCase()!==vA.toLowerCase()||c.has("noPortal")||(s=kA(e,t)),!_E.isDefaultPortal()){const e=_E.getPortalName();c.has("portal")?c.set("portal",e):c.append("portal",e)}return a=((e,t)=>{for(const[n,s]of t.entries())!e.has(n)&&RA.includes(n)&&e.append(n,s);return e})(a,c),a.toString()&&(s+=`?${a.toString()}`),s},$A=(e,{urlPathObjParam:t,infoParam:n,optionsParam:s,queryParam:a},r=!1)=>{let o,i,c;if(!1===window.PCore.getBehaviorOverride("dynamicSemanticUrl"))return;if(r)o=t,i=n,c=s;else{const{uiResources:n,data:s}=e;({options:c}=e),o=t&&t.pxURLPath&&mE(t.pxURLPath)?VA(n,s,t.pxURLPath):t||VA(n,s),i=_E.getEndPointInfo(o.pxURLPath),o.pxURLPath=i.urlPath}let l=BA(bA,_E.getApplicationPath(),o);const{title:u}=((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:_E.getApplicationName()),n===`${bA}/${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]}`}})(xA,_E.getApplicationPath(),l),d=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(i,{...c,title:u});o?.historyAction===OA?((e,t,n)=>{try{window.history.pushState(e,t,n),window.scrollTo(0,0)}catch(e){throw new Error("Error- Unable to Add to Browser History")}})(d,u,l):o?.historyAction===PA&&(a&&(l+=`?${a}`),((e,t,n)=>{try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(d,u,l))},WA=e=>{let t=null;e.directUrlUpdation&&(t={historyAction:OA,pxURLPath:""},t.pxURLPath=e.semanticURL),$A(e,{urlPathObjParam:t,infoParam:null,optionsParam:null},!1)},GA=e=>{WA(e)},HA=e=>{const t={pxURLPath:e};return BA(bA,_E.getApplicationPath(),t)},qA=e=>{const{uiResources:t}=e;LA()&&(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))&&WA(e)},zA=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},YA=(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:br,viewName:Gs,gadgetId:gm.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${a}`,containerName:r,name:l};Ey(m.showPage(u))},KA=e=>{const t=(e=>"ui-navigation"===e.state?.type?(Ru.publish($s.PUB_SUB_EVENTS.URL_NAVIGATION,e.state),null):e.state?e.state.stateObj:null)(e);t&&(qs.isRemoteCase(t.payload?.caseClassName)?YA({...t},t.options):Ey(m.showHistory(zA(t))))},QA=()=>_E.getApplicationPath()!==yE(),JA=e=>{const{acName:t,context:n,defaultViewLabel:s,ruleName:a,className:r}=e,o=((e,t)=>{const n=_E.getRoutingInfo();if(hg()&&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=>{vA=e})(o),_E.setDefaultRoute(o),_E.setDefaultClassName(r);const i=Qs(t,n),c=jr(t,n),l=(()=>{const e=NE.getIsExtraCallRequiredForDefaultHome();return!0===e||"true"===e})(),u={historyAction:PA,pxURLPath:""};let d,p=null;const g={acName:c,context:i,actionConfig:{context:i}};if(l||!l&&QA()){const t=pg(AE());NE.shouldUseURLParams()&&(p=t.includes("?")?t.split("?")[1]:null),d=gg(t,g),u.pxURLPath=d.urlPath,void 0!==d.payload?.pageClass&&(d.payload.pageClass=Iy()?.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)?YA(s,e,g.context):Ey(m[n](zA(s)))}else d=_E.getEndPointInfo(vA),u.pxURLPath="";$A(null,{urlPathObjParam:u,infoParam:d,optionsParam:g,queryParam:p},!0)},XA=(e,t=!1)=>{var n;bA=e.domain,!1===t&&LA()&&(n=KA,window.addEventListener("popstate",(e=>n(e))),window.onbeforeunload=()=>null),_E.init(e,vA)},ZA=e=>{(e=>{window.document.title=e})(e)},eC=e=>{for(const t of e)RA.includes(t)||RA.push(t)};var tC=Symbol.for("immer-nothing"),nC=Symbol.for("immer-draftable"),sC=Symbol.for("immer-state");function aC(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var rC=Object,oC=rC.getPrototypeOf,iC="constructor",cC="prototype",lC="configurable",uC="enumerable",dC="writable",pC="value",gC=e=>!!e&&!!e[sC];function hC(e){return!!e&&(IC(e)||_C(e)||!!e[nC]||!!e[iC]?.[nC]||NC(e)||TC(e))}var fC=rC[cC][iC].toString(),mC=new WeakMap;function IC(e){if(!e||!DC(e))return!1;const t=oC(e);if(null===t||t===rC[cC])return!0;const n=rC.hasOwnProperty.call(t,iC)&&t[iC];if(n===Object)return!0;if(!OC(n))return!1;let s=mC.get(n);return void 0===s&&(s=Function.toString.call(n),mC.set(n,s)),s===fC}function EC(e,t,n=!0){if(0===yC(e)){(n?Reflect.ownKeys(e):rC.keys(e)).forEach((n=>{t(n,e[n],e)}))}else e.forEach(((n,s)=>t(s,n,e)))}function yC(e){const t=e[sC];return t?t.type_:_C(e)?1:NC(e)?2:TC(e)?3:0}var AC=(e,t,n=yC(e))=>2===n?e.has(t):rC[cC].hasOwnProperty.call(e,t),CC=(e,t,n=yC(e))=>2===n?e.get(t):e[t],SC=(e,t,n,s=yC(e))=>{2===s?e.set(t,n):3===s?e.add(n):e[t]=n};var _C=Array.isArray,NC=e=>e instanceof Map,TC=e=>e instanceof Set,DC=e=>"object"==typeof e,OC=e=>"function"==typeof e,PC=e=>"boolean"==typeof e;var RC=e=>e.copy_||e.base_,bC=e=>e.modified_?e.copy_:e.base_;function vC(e,t){if(NC(e))return new Map(e);if(TC(e))return new Set(e);if(_C(e))return Array[cC].slice.call(e);const n=IC(e);if(!0===t||"class_only"===t&&!n){const t=rC.getOwnPropertyDescriptors(e);delete t[sC];let n=Reflect.ownKeys(t);for(let s=0;s<n.length;s++){const a=n[s],r=t[a];!1===r[dC]&&(r[dC]=!0,r[lC]=!0),(r.get||r.set)&&(t[a]={[lC]:!0,[dC]:!0,[uC]:r[uC],[pC]:e[a]})}return rC.create(oC(e),t)}{const t=oC(e);if(null!==t&&n)return{...e};const s=rC.create(t);return rC.assign(s,e)}}function xC(e,t=!1){return MC(e)||gC(e)||!hC(e)||(yC(e)>1&&rC.defineProperties(e,{set:wC,add:wC,clear:wC,delete:wC}),rC.freeze(e),t&&EC(e,((e,t)=>{xC(t,!0)}),!1)),e}var wC={[pC]:function(){aC(2)}};function MC(e){return null===e||!DC(e)||rC.isFrozen(e)}var LC="MapSet",UC="Patches",FC="ArrayMethods",jC={};function VC(e){const t=jC[e];return t||aC(0),t}var kC,BC=e=>!!jC[e];var $C=()=>kC;function WC(e,t){t&&(e.patchPlugin_=VC(UC),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function GC(e){HC(e),e.drafts_.forEach(zC),e.drafts_=null}function HC(e){e===kC&&(kC=e.parent_)}var qC=e=>kC={drafts_:[],parent_:kC,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:BC(LC)?VC(LC):void 0,arrayMethodsPlugin_:BC(FC)?VC(FC):void 0};function zC(e){const t=e[sC];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function YC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[sC].modified_&&(GC(t),aC(4)),hC(e)&&(e=KC(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[sC].base_,e,t)}else e=KC(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xC(t,n)}(t,e,!0),GC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==tC?e:void 0}function KC(e,t){if(MC(t))return t;const n=t[sC];if(!n){return nS(t,e.handledSet_,e)}if(!JC(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)}eS(n,e)}return n.copy_}function QC(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var JC=(e,t)=>e.scope_===t,XC=[];function ZC(e,t,n,s){const a=RC(e),r=e.type_;if(void 0!==s){if(CC(a,s,r)===t)return void SC(a,s,n,r)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;EC(a,((e,n)=>{if(gC(n)){const s=t.get(n)||[];s.push(e),t.set(n,s)}}))}const o=e.draftLocations_.get(t)??XC;for(const e of o)SC(a,e,n,r)}function eS(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)}QC(e)}}function tS(e,t,n){const{scope_:s}=e;if(gC(n)){const a=n[sC];JC(a,s)&&a.callbacks_.push((function(){cS(e);const s=bC(a);ZC(e,n,s,t)}))}else hC(n)&&e.callbacks_.push((function(){const a=RC(e);3===e.type_?a.has(n)&&nS(n,s.handledSet_,s):CC(a,t,e.type_)===n&&s.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&nS(CC(e.copy_,t,e.type_),s.handledSet_,s)}))}function nS(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||gC(e)||t.has(e)||!hC(e)||MC(e)||(t.add(e),EC(e,((s,a)=>{if(gC(a)){const t=a[sC];if(JC(t,n)){const n=bC(t);SC(e,s,n,e.type_),QC(t)}}else hC(a)&&nS(a,t,n)}))),e}var sS={get(e,t){if(t===sC)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=RC(e);if(!AC(a,t,e.type_))return function(e,t,n){const s=oS(t,n);return s?pC in s?s[pC]:s.get?.call(e.draft_):void 0}(e,a,t);const r=a[t];if(e.finalized_||!hC(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===rS(e.base_,t)){cS(e);const n=1===e.type_?+t:t,s=lS(e.scope_,r,e,n);return e.copy_[n]=s}return r},has:(e,t)=>t in RC(e),ownKeys:e=>Reflect.ownKeys(RC(e)),set(e,t,n){const s=oS(RC(e),t);if(s?.set)return s.set.call(e.draft_,n),!0;if(!e.modified_){const s=rS(RC(e),t),o=s?.[sC];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||AC(e.base_,t,e.type_)))return!0;cS(e),iS(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),tS(e,t,n)),!0},deleteProperty:(e,t)=>(cS(e),void 0!==rS(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),iS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=RC(e),s=Reflect.getOwnPropertyDescriptor(n,t);return s?{[dC]:!0,[lC]:1!==e.type_||"length"!==t,[uC]:s[uC],[pC]:n[t]}:s},defineProperty(){aC(11)},getPrototypeOf:e=>oC(e.base_),setPrototypeOf(){aC(12)}},aS={};for(let e in sS){let t=sS[e];aS[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function rS(e,t){const n=e[sC];return(n?RC(n):e)[t]}function oS(e,t){if(!(t in e))return;let n=oC(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=oC(n)}}function iS(e){e.modified_||(e.modified_=!0,e.parent_&&iS(e.parent_))}function cS(e){e.copy_||(e.assigned_=new Map,e.copy_=vC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}aS.deleteProperty=function(e,t){return aS.set.call(this,e,t,void 0)},aS.set=function(e,t,n){return sS.set.call(this,e[0],t,n,e[0])};function lS(e,t,n,s){const[a,r]=NC(t)?VC(LC).proxyMap_(t,n):TC(t)?VC(LC).proxySet_(t,n):function(e,t){const n=_C(e),s={type_:n?1:0,scope_:t?t.scope_:$C(),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=sS;n&&(a=[s],r=aS);const{revoke:o,proxy:i}=Proxy.revocable(a,r);return s.draft_=i,s.revoke_=o,[i,s]}(t,n);return(n?.scope_??$C()).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||!JC(a,s))return;s.mapSetPlugin_?.fixSetContents(a);const r=bC(a);ZC(e,a.draft_??a,r,n),eS(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 uS(e){if(!hC(e)||MC(e))return e;const t=e[sC];let n,s=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=vC(e,t.scope_.immer_.useStrictShallowCopy_),s=t.scope_.immer_.shouldUseStrictIteration()}else n=vC(e,!0);return EC(n,((e,t)=>{SC(n,e,uS(t))}),s),t&&(t.finalized_=!1),n}var dS=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(OC(e)&&!OC(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(OC(t)||aC(6),void 0===n||OC(n)||aC(7),hC(e)){const a=qC(this),r=lS(a,e,void 0);let o=!0;try{s=t(r),o=!1}finally{o?GC(a):HC(a)}return WC(a,n),YC(s,a)}if(!e||!DC(e)){if(s=t(e),void 0===s&&(s=e),s===tC&&(s=void 0),this.autoFreeze_&&xC(s,!0),n){const t=[],a=[];VC(UC).generateReplacementPatches_(e,s,{patches_:t,inversePatches_:a}),n(t,a)}return s}aC(1)},this.produceWithPatches=(e,t)=>{if(OC(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]},PC(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),PC(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),PC(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){hC(e)||aC(8),gC(e)&&(e=function(e){gC(e)||aC(10);return uS(e)}(e));const t=qC(this),n=lS(t,e,void 0);return n[sC].isManual_=!0,HC(t),n}finishDraft(e,t){const n=e&&e[sC];n&&n.isManual_||aC(9);const{scope_:s}=n;return WC(s,t),YC(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=VC(UC).applyPatches_;return gC(e)?s(e,t):this.produce(e,(e=>s(e,t)))}},pS=dS.produce;function gS(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 hS=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),fS=()=>Math.random().toString(36).substring(7).split("").join("."),mS={INIT:`@@redux/INIT${fS()}`,REPLACE:`@@redux/REPLACE${fS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${fS()}`};function IS(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 ES(e,t,n){if("function"!=typeof e)throw new Error(gS(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(gS(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(gS(1));return n(ES)(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(gS(3));return a}function d(e){if("function"!=typeof e)throw new Error(gS(4));if(c)throw new Error(gS(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(gS(6));t=!1,l(),o.delete(n),r=null}}}function p(e){if(!IS(e))throw new Error(gS(7));if(void 0===e.type)throw new Error(gS(8));if("string"!=typeof e.type)throw new Error(gS(17));if(c)throw new Error(gS(9));try{c=!0,a=s(a,e)}finally{c=!1}return(r=o).forEach((e=>{e()})),e}p({type:mS.INIT});return{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(gS(10));s=e,p({type:mS.REPLACE})},[hS]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(gS(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[hS](){return this}}}}}function yS(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:mS.INIT}))throw new Error(gS(12));if(void 0===n(void 0,{type:mS.PROBE_UNKNOWN_ACTION()}))throw new Error(gS(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(gS(14))}o[i]=u,r=r||u!==l}return r=r||s.length!==Object.keys(e).length,r?o:e}}function AS(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function CS(e){return({dispatch:t,getState:n})=>s=>a=>"function"==typeof a?a(t,n,e):s(a)}var SS=CS(),_S=CS,NS="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?AS:AS.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var TS=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 DS(e){return hC(e)?pS(e,(()=>{})):e}var OS="RTK_autoBatch",PS=e=>t=>{setTimeout(t,e)},RS=e=>function(t){const{autoBatch:n=!0}=t??{};let s=new TS(e);return n&&s.push(((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?window.requestAnimationFrame:PS(10):"callback"===e.type?e.queueNotification:PS(e.timeout),l=()=>{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?.[OS],r=!a,r&&(o||(o=!0,c(l))),s.dispatch(e)}finally{a=!0}}})})("object"==typeof n?n:void 0)),s};function bS(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:a=!0}=e??{};let r=new TS;return t&&("boolean"==typeof t?r.push(SS):r.push(_S(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(!IS(n))throw new Error(MS(1));c=yS(n)}l="function"==typeof s?s(t):t();let u=AS;a&&(u=NS({trace:!1,..."object"==typeof a&&a}));const d=function(...e){return t=>(n,s)=>{const a=t(n,s);let r=()=>{throw new Error(gS(15))};const o={getState:a.getState,dispatch:(e,...t)=>r(e,...t)},i=e.map((e=>e(o)));return r=AS(...i)(a.dispatch),{...a,dispatch:r}}}(...l),p=RS(d);return ES(c,o,u(..."function"==typeof i?i(p):p()))}function vS(e){const t={},n=[];let s;const a={addCase(e,n){const s="string"==typeof e?e:e.type;if(!s)throw new Error(MS(28));if(s in t)throw new Error(MS(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 xS(e,t){let n,[s,a,r]=vS(t);if("function"==typeof e)n=()=>DS(e());else{const t=DS(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(gC(e)){const s=n(e,t);return void 0===s?e:s}if(hC(e))return pS(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:wS}=Object;Symbol.for("rtk-state-proxy-original");function MS(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 LS=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}}},US=(e,t)=>{const{data:{shared:n={}}={},context:s}=t;((e,t)=>{jg.updateDataPageStore(t),Object.keys(t).forEach((n=>{Ly.getIn(e,[Ws.SHARED,n])?Object.keys(t[n]).forEach((s=>{Ly.setIn(e,[Ws.SHARED,n,s],t[n][s])})):Ly.setIn(e,[Ws.SHARED,n],t[n])}))})(e,n),s&&Ly.deleteIn(e,[s,"shared"])},FS=(e,t,n=!1)=>{const{context:s,caseViewMode:a=(n?void 0:Ws.PERFORM_MODE),containerName:r}=t;r!==gI.WORKAREA&&a&&Ly.setIn(e,[s,"context_data","caseViewMode"],a)},jS=(e,t)=>{const{context:n}=t;Ly.setIn(e,[n,"context_data","actionType"],t.actionType),Ly.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},VS=e=>null!==e&&"object"==typeof e,kS=(e,t=[])=>{t.forEach((t=>Ly.deleteIn(e,t)))},BS=(e,t=[])=>{t.forEach((t=>Ly.deleteIn(e,t)))},$S=(e,t=[])=>{t.forEach((t=>{Ly.deleteIn(e,t)}))},WS=(e,t,n={})=>{const{deleteAssignmentSpecificResources:s=!0,doDeleteConfirmationDetails:a=!0,skipMergeAssignmentsAndActions:r=!0}=n;Ly.deleteIn(e,[t,"nextAssignmentInfo"]),r&&(Ly.deleteIn(e,[t,Ws.CASE_INFO.CASE_INFO,"availableActions"]),Ly.deleteIn(e,[t,Ws.CASE_INFO.CASE_INFO,"availableProcesses"]),Ly.deleteIn(e,[t,Ws.CASE_INFO.CASE_INFO,"assignments"])),Ly.deleteIn(e,[t,Ws.CASE_INFO.CASE_INFO,"activeActionID"]),Ly.deleteIn(e,[t,Ws.CASE_INFO.CASE_INFO,"childCases"]),a&&(Ly.deleteIn(e,[t,Ws.CASE_INFO.CASE_INFO,"confirmationLinks"]),Ly.deleteIn(e,[t,"caseMessages"])),s&&(Ly.deleteIn(e,[t,Ws.CASE_INFO.CASE_INFO,"actionButtons"]),Ly.deleteIn(e,[t,Ws.CASE_INFO.CASE_INFO,"navigation"]))},GS=xS({},(e=>{e.addCase(ba,((e,t)=>{if(!t.payload.data||e[t.payload.context])return;t.payload.doDeleteCaseSummary&&WS(e,t.payload.context);const{target:n}=t.payload;n&&(n.includes(Ws.WORKAREA)||n.includes(Ws.MODAL))?e[t.payload.context]=t.payload.data:e[t.payload.containerItemID]=t.payload.data,FS(e,t.payload),jS(e,t.payload),US(e,t.payload),((e,t)=>{const{context:n}=t;Ly.deleteIn(e,[n,"context_data","blocking_action_counter"]),Ly.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload)})).addCase(ka,((e,t)=>{t.payload.doDeleteCaseSummary&&WS(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:s=[]}=t.payload;if(n&&(n.includes(Ws.WORKAREA)||n.includes(Ws.MODAL))){const n=e[t.payload.context];VS(n)&&(e[t.payload.context]=Ry(n,t.payload.data,{propertiesToReplace:[...s]}))}else{const n=e[t.payload.containerItemID];VS(n)&&(e[t.payload.containerItemID]=Ry(n,t.payload.data,{propertiesToReplace:[...s]}))}(t.payload.actionType||t.payload.assignmentID)&&jS(e,t.payload),FS(e,t.payload),US(e,t.payload),BS(e,t.payload.suggestionContexts)})).addCase(va,((e,t)=>{const{childContainersContexts:n=[]}=t.payload;((e,t)=>{const{containerItemID:n,context:s,deleteContext:a}=t;a&&Ly.deleteIn(e,[s]),Ly.deleteIn(e,[n])})(e,t.payload),$S(e,n),kS(e,t.payload.transientItems),BS(e,t.payload.suggestionContexts)})).addCase(Ra,((e,t)=>{const{containerItems:n}=t.payload;Array.isArray(n)?n.forEach((t=>{Ly.deleteIn(e,[t])})):Ly.deleteIn(e,[n])})).addCase(Ba,((e,t)=>{const{context:n,contextToBeRemoved:s,data:a,childContainersContextsToBeRemoved:r}=t.payload;WS(e,t.payload.context),FS(e,t.payload);const o=e[n],i=e[s];if(!VS(o)||!VS(i))return;const c=Ry(o,i);VS(c)&&(e[n]=Ry(c,a),Ly.deleteIn(e,[s]),$S(e,r),US(e,t.payload))})).addCase($a,((e,t)=>{const{context:n,pulseReplace:s=!0,childContainersContexts:a=[]}=t.payload;let{data:r}=t.payload;const o=Ly.getIn(e[n],"pulse");let i=Ly.getIn(e[n],"OperatorID"),c=Ly.getIn(e[n],"pxRequestor");c&&r.pxRequestor&&(c=Ly.mergeDeep(c,r.pxRequestor)),i&&r.OperatorID&&(i=Ly.mergeDeep(i,r.OperatorID)),!s&&o&&(r=by(r,"pulse",o),r=by(r,"OperatorID",i),r=by(r,"pxRequestor",c)),Ly.setIn(e,n,r),FS(e,t.payload),US(e,t.payload),$S(e,a),kS(e,t.payload.transientItems),BS(e,t.payload.suggestionContexts)})).addCase(mr,((e,t)=>{const{context:n,doDeleteConfirmationDetails:s=!0,skipMergeAssignmentsAndActions:a=!0}=t.payload;WS(e,n,{doDeleteConfirmationDetails:s,skipMergeAssignmentsAndActions:a})})).addCase(xa,((e,t)=>{const{transientItemID:n,data:s}=t.payload;Ly.setIn(e,n,s)})).addCase(Ma,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>Ly.deleteIn(e,t)))})).addCase(La,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>Ly.deleteIn(e,t)))})).addCase(wa,((e,t)=>{const{transientItemID:n,data:s}=t.payload;Ry(Ly.getIn(e,n),s)})).addCase(Ua,((e,t)=>{const{transientItemID:n,data:s}=t.payload;Ry(Ly.getIn(e,n),s)})).addCase(Fa,((e,t)=>{const{transientItemID:n,data:s}=t.payload;Object.keys(s??{}).forEach((t=>{Ly.deleteIn(e,[n,t])}))})).addCase(ja,((e,t)=>{const{transientItemID:n,data:s}=t.payload;Ly.deleteIn(e,n),Ly.setIn(e,n,s)})).addCase(fa,((e,t)=>{const{key:n,value:s}=t.payload;Ly.setIn(e,`${Ws.SHARED}.${n}`,s)})).addCase(Ha,((e,t)=>{const{context:n,data:s}=t.payload;return Ly.setIn(e,n,s)}))})),HS=GS;function qS(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 zS=xS({},(e=>{e.addCase(_a,((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?fy(o):[],c={isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n],propertiesToReArrange:[...s]};if(a&&i.length)Ly.setIn(e,i,Ry(Ly.getIn(e,i),Ly.getIn(t.payload.data,fy(a)),c));else if(r){const a=Ly.getIn(e[t.payload.context],r),o=Ly.getIn(t.payload.data,r),i=Ry(a,o,{isArrayDeepMerge:!0}),c=Ly.getIn(t.payload.data.context_data,r);Py(e[t.payload.context],[...n],[...s]),Ly.setIn(e[t.payload.context],r,i),e[t.payload.context]&&c&&Ly.setIn(e[t.payload.context].context_data,r,Ry(Ly.getIn(e[t.payload.context].context_data,r),c,{isArrayDeepMerge:!0}))}else e[t.payload.context]=Ry(e[t.payload.context],t.payload.data,c);FS(e,t.payload,!0),US(e,t.payload)})).addCase(sa,((e,t)=>{const{context:n,reference:s,value:a,isArrayDeepMerge:r}=t.payload;by(e[n],s,a,{isArrayDeepMerge:r})})).addCase(aa,((e,t)=>{const{context:n,reference:s,value:a}=t.payload;vy(e[n],s,a)})).addCase(Na,((e,t)=>{Dy(e[t.payload.context],t.payload.reference)})).addCase(da,((e,t)=>{Ly.setIn(e[t.payload.context],"context_data.isLoading",!0)})).addCase(pa,((e,t)=>{Ly.setIn(e[t.payload.context],"context_data.isLoading",!1)})).addCase(ga,((e,t)=>{const n=qS(t);n&&(e[n]||(e[n]={}),Ly.setIn(e[n],"context_data.isOffline",!0))})).addCase(ha,((e,t)=>{const n=qS(t);n&&(e[n]||(e[n]={}),Ly.setIn(e[n],"context_data.isOffline",!1))})).addCase(gr,((e,t)=>{const{data:n}=t.payload;US(e,{data:{shared:n}})})).addCase(hr,((e,t)=>{const{dataPagesToBeRemoved:n=[]}=t.payload;n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:s}=t;Ly.deleteIn(e.shared,[n,s]);const a=Ly.getIn(e.shared,[n]);a&&0===Object.keys(a).length&&Ly.deleteIn(e.shared,[n])}))})).addCase(Ir,((e,t)=>{const n=Ly.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);t.payload.isInitiateBlockingAction?Ly.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):Ly.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1)}))})),YS=zS,KS=/\[(\d+)\]$/gi,QS=/(\d+)/gi,JS=/\[\d+\]$/,XS=(e,t,n,s=[Ws.CONTEXT_DATA,Ws.CASE_INFO.CASE_INFO,Ws.CONTENT])=>{const a=Ly.getIn(t,s);if(a){const t=Cu(a,[],[]);for(const a of t)Ly.setIn(e[n],[...s,...a],{})}},ZS=(e,t,n,s)=>{const{property:a,pageReference:r,category:o,type:i,subType:c}=s.payload,l=Ly.getIn(e[t],n);if(l&&o===Ws.CASEMESSAGES)Ly.setIn(e[t],hu(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&&Ly.setIn(e[t],hu(a,r,o),s)}},e_=(e,t)=>{const{property:n,pageReference:s,category:a,isListEntry:r,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return XS(e,i,c),e;const l=hu(n,s,a,r);if(Number.isInteger(o)){Ly.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=Ly.getIn(e[c],t)||{};const s=(e=>[...e].sort(((e,t)=>{const n=e.match(KS),s=t.match(KS);if(!n&&!s)return e.localeCompare(t);if(!n&&s)return-1;if(n?.length&&s?.length){const e=n[0].match(QS),t=s[0].match(QS);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(KS);if(r?.length){const i=parseInt(r[0].match(QS)[0],10);i>o&&(Ly.deleteIn(e[c],t.concat(s[a])),Ly.setIn(e[c],t.concat(s[a].replace(JS,`[${i-1}]`)),n))}}))}else Ly.setIn(e[c],l,{});return e};function t_(e,t){const n=Ly.getIn(e,t);return void 0!==n?.dataInfo?.content}const n_=(e,t)=>{const n=Ly.getIn(e,t);return!0===gm.isObjectCaseType(n?.objectInfo?.objectTypeID)};function s_(e,t){let n=gu.FIELD_MESSAGES_PATH;return t_(e,t)?n=gu.DATA_OBJECT_FIELD_MESSAGES_PATH:n_(e,t)&&(n=gu.OBJECT_FIELD_MESSAGES_PATH),n}const a_=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const s=Ly.getIn(n,Ws.ERROR_FIELD_IN_PAGE).slice(1),a=Ly.getIn(n,Ws.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(a){let r="caseInfo.content";t_(e,t)?r="dataInfo.content":n_(e,t)&&(r="objectInfo.content");let o=s?`${r}.${s}`:r;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=hu(a,o,Ws.PROPERTY),c=Ly.getIn(e[t],`${o}.classID`),l=$E(a,c),u=NE.getLocale()??"en-US",d=new Rh(u,l?.localeReference),p={type:$s.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:d.getLocalizedText(l.label)}},g=Ly.getIn(e[t],i,[]);if(Ly.isContains(g,p))return;Ly.setIn(e[t],i,[...g,p])}})(e,t,n)}))};function r_(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)vf(e,t,r,o);return{fieldErrors:o,pageErrors:r}})(n.errorDetails,s),i=s_(e,a);if(Ly.setIn(e,[a,...i],{}),Ly.setIn(e,[a,...gu.PAGE_MESSAGES_PATH],[]),r.forEach((t=>{const n=Ly.getIn(t,Ws.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=hu(s,n,Ws.PROPERTY);Ly.setIn(e,[a,...r],[])}}})),r.length>0&&a_(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=Ws.APP.APP),Ly.setIn(e,[a,...gu.PAGE_MESSAGES_PATH],t)}else a.includes&&a.includes(gI.WORKAREA)&&(a=Ks(a)),Ly.deleteIn(e,[a,...gu.PAGE_MESSAGES_PATH]);return e}const o_=xS({},(e=>{e.addCase(Oa,((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)?r_(e,t):e)).addCase(ka,((e,t)=>{const{context:n}=t.payload,s=[n,...s_(e,n)],a=[n,...gu.PAGE_MESSAGES_PATH];if(Ly.setIn(e,s,{}),Ly.setIn(e,a,[]),n&&n.includes(gI.WORKAREA)){const t=[ta(n),...gu.PAGE_MESSAGES_PATH];Ly.setIn(e,t,[])}})).addCase(ur,((e,t)=>{const{isListEntry:n,clearAll:s,context:a}=t.payload;return s?(Ly.deleteIn(e,[a,Ws.CONTEXT_DATA]),e):n?e_(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 XS(e,o,i),e;const l=hu(n,s,a,r);return a===Ws.PAGE&&i?.includes(gI.WORKAREA)&&(c=Ks(i)),ZS(e,c,l,t),ZS(e,i,l,t),e})(e,t)})).addCase(lr,((e,t)=>{const{messages:n,property:s,pageReference:a,context:r,category:o}=t.payload,i=hu(s,a,o);n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&Ly.setIn(e[r],hu(s,a,o),n)}))})),i_=o_,c_=(e,t,n,s,a)=>{Ly.setIn(e[t],[...n,s],a)},l_=xS({},(e=>{e.addCase(fr,((e,t)=>{const{instruction:n,actions:s,context:a,referenceList:r,listIndex:o,groupIndex:i,listMoveToIndex:c,content:l={}}=t.payload,u=fy(r);switch(n){case Ws.LIST_ACTIONS.ADD:c_(e,a,u,i,l);break;case Ws.LIST_ACTIONS.INSERT:c_(e,a,u,o,l);break;case Ws.LIST_ACTIONS.UPDATE:((e,t,n,s,a)=>{const r=Ry(Ly.getIn(e[t],[...n,s],{}),a);Ly.setIn(e[t],[...n,s],r)})(e,a,u,o??i,l);break;case Ws.LIST_ACTIONS.DELETE:((e,t,n,s,a)=>{const r=Ly.getIn(e[t],n,[]);"string"==typeof s?delete r[s]:r.splice(s,1),Ly.setIn(e[t],n,r),pu.deleteListNode(t,[a],r.length)})(e,a,u,o??i,r);break;case Ws.LIST_ACTIONS.MOVE:((e,t,n,s,a)=>{const r=Ly.getIn(e[t],[...n,s],{}),o=Ly.getIn(e[t],n,[]);o.splice(s,1),o.splice(a,0,r),Ly.setIn(e[t],n,o),Iu(e,t,n?.join("."),s,a)})(e,a,u,o,c);break;case Ws.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,s)=>{const a=Ly.getIn(e[t],n)||[];s.forEach((e=>{const{instruction:s,content:r,listIndex:o}=e;if(s===Ws.LIST_ACTIONS.SELECT){a[o]=r;const e=n?.join(".");Dd(t,e)}else delete a[o]})),Ly.setIn(e[t],n,a.filter(Boolean))})(e,a,u,s);break;case Ws.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{Ly.setIn(e[t],n,[])})(e,a,u);break;case Ws.LIST_ACTIONS.REPLACE:((e,t,n,s)=>{Ly.setIn(e[t],n,s)})(e,a,u,l);break;case Ws.LIST_ACTIONS.DELETEPAGE:((e,t,n)=>{Ly.setIn(e[t],n,{})})(e,a,u)}}))})),u_=[YS,HS,i_,l_],d_=(e,t)=>(e||(e=E_().data),t.type===dr?E_().data:(u_.forEach((n=>{e=n(e,t)})),e)),p_={},g_=(e,t=[])=>{t.forEach((t=>{Ly.deleteIn(e,[t])}))},h_=(e,t)=>{const{type:n,payload:s}=t,a=n===ka,{target:r,context:o,semanticURL:i="",root:c,containerItemID:l,childContainers:u,flowName:d,resourceType:p="",key:g="",clearView:h=!1}=s;return c?Ly.setIn(e,[r,"items",l,"view"],c):h&&Ly.deleteIn(e,[r,"items",l,"view"]),o&&Ly.setIn(e,[r,"items",l,"context"],o),d&&Ly.setIn(e,[r,"items",l,"flowName"],d),(!a||a&&g)&&Ly.setIn(e,[r,"items",l,"key"],g.trim()),((e,t,n,s)=>{""===e&&Ly.deleteIn(t,[n,"items",s,"key"])})(g,e,r,l),(!a||a&&i)&&Ly.setIn(e,[r,"items",l,"semanticURL"],i),(!a||a&&p)&&Ly.setIn(e,[r,"items",l,"resourceType"],p),g_(e,u),e},f_=xS(p_,(e=>{e.addCase(dr,(()=>p_)).addCase(Pa,((e,t)=>{const{context:n,name:s,type:a,actionMgrID:r}=t.payload,o=`${n}/${s}`;if(Ip.resolveActionByID(r,null,!1),e[o])return e;Ly.setIn(e,[o],{type:a,accessedOrder:[],items:{}})})).addCase(Ga,((e,t)=>{const{containerName:n,childContainers:s=[]}=t.payload;Ly.deleteIn(e,[n]),s.forEach((t=>{Ly.deleteIn(e,[t])}))})).addCase(Ra,((e,t)=>{const{context:n,name:s,actionMgrID:a,childContainers:r}=t.payload,o=`${n}/${s}`;Ip.resolveActionByID(a,null,!1),Ly.setIn(e,[o,"accessedOrder"],[]),Ly.setIn(e,[o,"items"],{}),Array.isArray(r)&&r.forEach((t=>{Ly.deleteIn(e,[t])}))})).addCase(ba,((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:O,subscriptFieldName:P,pageGroupName:R,isPageGroup:b,index:v}=t.payload,x=e[n],w=x&&x.type,M=x&&x.accessedOrder||[],L=x&&x.items||{};if(e[n]&&"single"===w&&M.length>0)return h_(e,t);const U={accessedOrder:[...M,c],items:{...L,[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:O,subscriptFieldName:P,pageGroupName:R,isPageGroup:b,index:v,...y&&{actionID:y},...C&&{acTertiary:C},...A&&{isMultiRecordData:A},...S&&{parentContext:S},heading:_}}};Ip.resolveActionByID(l,null,!1),e[n]=Us(e[n],U)})).addCase(ka,((e,t)=>{const{actionMgrID:n,data:s}=t.payload;try{h_(e,t),Ip.resolveActionByID(n,s,!1)}catch{Ip.rejectActionByID(n,!1)}})).addCase($a,((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],Ly.setIn(e,[a,"items",r,"transientItems"],[]),Ly.setIn(e,[a,"accessedOrder"],c),o=h_(e,t),Ip.resolveActionByID(n,s,!1)}catch{Ip.rejectActionByID(n,!1)}return o})(e,t))).addCase(Va,((e,t)=>{const{target:n,containerItemID:s,actionMgrID:a}=t.payload;try{const t=Ly.getIn(e,[n,"accessedOrder"]).filter((e=>e!==s));t.push(s),Ly.setIn(e,[n,"accessedOrder"],t),Ip.resolveActionByID(a,null,!1)}catch{Ip.rejectActionByID(a,!1)}})).addCase(Ba,((e,t)=>{const{target:n,containerItemID:s,actionMgrID:a,childContainers:r}=t.payload;try{const t=Ly.getIn(e,[n,"accessedOrder"]).filter((e=>e!==s));Ly.setIn(e,[n,"accessedOrder"],t),Ly.deleteIn(e,[n,"items",s]),g_(e,r),Ip.resolveActionByID(a,null,!1)}catch{Ip.rejectActionByID(a,!1)}})).addCase(va,((e,t)=>{const{target:n,containerItemID:s,actionMgrID:a,childContainers:r}=t.payload;try{const t=Ly.getIn(e,[n,"accessedOrder"]).filter((e=>e!==s));Ly.setIn(e,[n,"accessedOrder"],t),Ly.deleteIn(e,[n,"items",s]),g_(e,r),Ip.resolveActionByID(a,null,!1)}catch{Ip.rejectActionByID(a,!1)}})).addCase(xa,((e,t)=>{const{transientItemID:n,target:s,contextName:a}=t.payload,r=Ly.getIn(e,[s,"items",a,"transientItems"])??[];Ly.setIn(e,[s,"items",a,"transientItems"],[...r,n])})).addCase(La,((e,t)=>{const{target:n,containerItemID:s}=t.payload;Ly.deleteIn(e,[n,"items",s,"transientItems"])})).addCase(Ma,((e,t)=>{const{target:n,transientItemID:s,containerItemID:a}=t.payload,r=(Ly.getIn(e,[n,"items",a,"transientItems"])??[]).filter((e=>e!==s));Ly.setIn(e,[n,"items",a,"transientItems"],r)}))})),m_=f_;let I_={};const E_=()=>I_,y_=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,s=n[Ws.CONTEXT_DATA]||e[Ws.CONTEXT_DATA];I_={data:{[Ws.APP.APP]:{...t,[Ws.CONTEXT_DATA]:s}},containers:{}}})(e),{data:d_,containers:m_}),A_=(e,t=!1)=>e===Ws.ACTION?t?nh.REFRESH_CASE_DATA:nh.REFRESH_ASSIGNMENT_DATA:nh.REFRESH_CASE_VIEW,C_=e=>{const{context:t}=e;let n={...Df(t).content,contextData:!1};const s=qf(t);Ly.isEmpty(s)||(n=Hf(s,n));const a=A_(e.editType,e.isLocalAction),{restApi:r,reqType:o}=jA(a,{ID:e.isLocalAction||e.editType!==Ws.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=r;return e.editType===Ws.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID),n.interestPage=e.interestPage,ql(td(i,{method:o,body:n,headers:e.headers},t)).pipe($p((t=>({actionInPayload:e,response:t.data,headers:Tf(t.headers)}))),ng(": Error occurred during ajax call : ",t))},S_={},{VIEW:__,FIELD:N_}=Ws.CONTEXT_TREE_NODE_TYPES,T_=(e,t,n)=>{const s=t.value.data[n]?.objectInfo?.headers,a=t.value.data[n]?.caseInfo?.headers;return!gm.shouldUseUnifiedHandling()&&e&&s?s:a},D_=e=>(e=>qu[e])(e)>0&&S_[e],O_=(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=nh.REFRESH;if(s||l&&u===Ws.ACTION){const t=A_(u,d);l&&u===Ws.ACTION&&(f.interestPageActionID=p),h=jA(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=Ws.getDefaultQualifiedName(Ws.VIEW_NAMES.OBJECT_CREATE_VIEW);if(t||n&&Fm(r)){let t=s&&a===c?nh.REFRESH_EXTERNAL_OBJECT:nh.REFRESH_CASE_DATA;const n=gm.shouldUseUnifiedHandling();return s&&a===c&&n&&(t=nh.REFRESH_EXTERNAL_CASE_DATA),jA(t,e)}return jA(o&&i&&a===c?nh.REFRESH_EXTERNAL_CASE_DATA:nh.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:jA(s?nh.RECALCULATE_CASE_DATA:nh.RECALCULATE_ASSIGNMENT_DATA,e),requestBody:a,requestType:nh.RECALCULATE}))(e,a,r,n,f));return{restAPI:h,requestBody:f,requestType:m}},P_=[(e,t)=>e.pipe(Zp(nh.REFRESH_DATA,Or),$p((e=>e.payload)),Jp((e=>!Cf(e?.options?.actionMgrID))),Wp((e=>{const{context:n,contextData:s,options:a,isObjectType:r}=e,{propertyName:o="",classID:i="",isObjectWideAction:c}=a,l=Df(n,{skipUUID:!1,isObjectWideAction:c});let u=[],d=[],p=!1;NE.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:u=[],whens:d=[]}=Wm(n)),p=d.some((e=>e.type===__))):p=!0;const g=d.filter((e=>e.type===N_)),h=Ly.getPropertyName(o),f=h?h.split("."):[],m=f.pop(),I=f.join("."),E=[];I&&((e,t,n,s,a)=>{const r=$E(e,t);if(!r||"copy"!==r.dataRetrievalType)return;const o=Ly.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))})(I,i,l,m,E),e.serverPrecedenceFields=E;let y={...l.content,contextData:s};const A=qf(n);Ly.isEmpty(A)||(y=Hf(A,y));const C=O_({...e,fieldsWithDeclarativeTargets:u,fieldsWithWhen:g,isViewsWithWhen:p},y);ch.registerBlockingAction(n).catch((()=>{}));const{restAPI:S,requestBody:_,requestType:N}=C;(e={...e,requestType:N}).requestType=N;const{reqType:T,restApi:D}=S,O={...T_(r,t,n)};O&&!O.etag&&e.isMultiRecordData&&e.editType===Ws.ACTION&&(O.etag=Ly.getETag(e.context));return ql(((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),D_(s)){const t=[];for(let n=0;n<S_[s].length;){const a=S_[s][n],r=$m(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=>{S_[s].splice(e,1)}))}const a=ad();return e.signal=a.token,e.cancelConfig=a,S_[s]?S_[s].push(e):S_[s]=[e],Ru.publish($s.PUB_SUB_EVENTS.ON_REFRESH_START,{context:n}),td(e.url,e,n,{cancelContext:s}).then((e=>(delete S_[s],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete S_[s],e}))})({reqHeaders:O,context:n,method:T,body:_,url:km(e,D)},e)).pipe($p((t=>{const s=((e,t,n)=>{const s=gm.shouldUseUnifiedHandling(),a=gm.isObjectCaseType(t)||n;if(s||!a)return e;const r=Ly.getIn(e?.data,$s.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID);return gm.isExternalObject(r)?e:Bs.transformCaseData(e)})(t?.data,a?.classID,r);return a?.resetForm&&pu.removeContextTreeNode(n),{response:{...s},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:Tf(t.headers)}})),ng(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),Wp((async e=>{if(e&&e.type===Oa)return Ru.publish(Ws.ON_REFRESH_ERROR,{context:e.payload?.context}),ch.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),xf(e);const{actionConfig:t,response:n,actionMgrID:s}=e,{context:a,serverPrecedenceFields:r,requestType:o}=t,i=yp.getTargetViewContainerName(qa),c=jr(i,a),l={acName:c,context:a},u=xh(n,{[$s.STOPMERGEACTIONS]:!0,[$s.ACTIONS.DELETEAVIALACTIONS]:!0});u.directUrlUpdation=!1,o===nh.REFRESH&&await Pf(u,t,l);const d=Of(u,{target:c,context:a});t.interestPage&&(d.interestPath=`caseInfo.content${Ly.convertClipboardPageToPageRefNotation(t.interestPage)}`),d.isArrayDeepMerge=t.options?.isArrayDeepMerge,d.preserveClientChanges=void 0===t.options?.preserveClientChanges||t.options.preserveClientChanges;const p=gm.getPropertiesToReArrange(a),g=yA(qy,d,{serverPrecedenceFields:r,propertiesToReArrange:p}),h=g.payload?.data?.pageInstructions;return h?.length>0&&(delete g.payload?.data?.pageInstructions,Qf.mergeServerPageInstructions(a,h)),Ey(g),Ip.resolveActionByID(s,d),ch.deRegisterBlockingAction(a).catch((()=>{})),Ru.publish($s.PUB_SUB_EVENTS.ON_REFRESH_COMPLETE,{context:a}),[]})))],R_=P_,b_=[e=>e.pipe(Zp(pr),Wp((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===Ws.READONLY&&r?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=r?.refreshStrategy||{},n=Ay()[r.name];if(n&&a in n){const s=n[a],{loadTime:r}=s;if(!dg.isTimeElapsed(r,e,t))return}}return dg.getData(r.name,{dataViewParameters:r.dataViewParameters},t).then((e=>{const t=r.mode===Ws.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(qy({context:t,data:n})),Object.keys(s).length&&r.push(CA({data:s,context:t})),Ey(r),[]})))],v_=b_;class x_{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 x_.DISPLAY_DIRTY_POPUP:this.displayDirtyPopup(e);break;case x_.LOAD_PREVIEW:this.loadPreview(e);break;case x_.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case x_.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case x_.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case x_.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case x_.CLOSE_CONTAINER_ACTION:this.closeContainer(e);break;case x_.CANCEL_CASE:this.handleCaseCancel();break;case x_.CREATE_WORK:this.createWork(e)}}};displayDirtyPopup=e=>{this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(Ru.publish(Ws.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this))};handleCaseCancel=()=>{const e=wI($s.APP.APP),t=e[e.length-1],n=OI(t),s=yy(n)?.caseInfo?.ID;if(s&&n&&Hh({}).getPConnect().getActionsApi().getDescendants(s,n),lf(n)){const e=pE(n);e&&Hh({}).getPConnect().getActionsApi().getDescendants(s,e)}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:s}=e.data;if(s===this.getUniqueId()){Hh({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=ks.getDefaultQualifiedName("Data-Portal"),t=ks.getDefaultQualifiedName("pyHome"),n=Hh({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===x_.OPEN_WORK_ITEM&&(o=x_.OPEN_WORK_BY_HANDLE),_E.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:o,name:a});Hh({}).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)){Hh({}).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}${Ws.FORWARD_SLASH_STRING}${$s.PRIMARY}`;Hh({meta:{},options:{context:vI(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:s}=e.data;if(s===this.getUniqueId()){const e=`${$s.APP.APP}${Ws.FORWARD_SLASH_STRING}${$s.PRIMARY}`;Hh({meta:{},options:{context:vI(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}${Ws.FORWARD_SLASH_STRING}${$s.PRIMARY}`,n=Hh({meta:{},options:{context:vI(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),Ru.subscribe($s.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),Ru.subscribe($s.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{Ru.unsubscribeAllWithEventType($s.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),Ru.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:x_.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:x_.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:x_.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const w_=new x_,M_="nextAssignmentInfo",L_="nextAssignmentInfo.context",U_=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Ws.MODAL:t||yp.getTargetViewContainerName(Xa)},F_=e=>UI(e)?{continueExecution:!0,removeActionPayload:{}}:Ff(e),j_=e=>{if(gm.shouldUseUnifiedHandling())return e?.uiResources?.root?.config?.name===ks.getDefaultQualifiedName("pzCreateDetails")||!1;const t=Ly.getIn(e,[Ws.DATA,Ws.CASE_INFO.CASE_INFO]);return fm(t)&&mm(NE.getOperatorIdentifier(),t)},V_=(e,t)=>{const{class:n,context:s,viewType:a=_f.PAGE}=e,{removeActionPayload:r}=t;let o=e?.pageName?e?.pageName:NE.getDefaultCasePage();return e.isTraditionalUICase&&(o=ks.getDefaultQualifiedName("pyDetails")),ql(ep.createCase(n,{...e,pageName:o,viewType:a,context:s})).pipe($p((({response:t,headers:n})=>(Bs.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:r}))),ng("Error occurred during ajax call at createWork Epic : ",s))},k_=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},B_=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},$_=e=>{let t,n=0,s=[],a={},r=!1;return e.pipe(Zp(Wy),sg(100),$p((e=>(({actionMgrID:n}=e.payload),e.payload))),Wp((e=>{const{context:s}=e;if(t=e.class,gm.isExternalCaseType(t)&&!cm(s)){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Ip.rejectActionByID(n,!0,e),tg()}const a=U_(e),o=jr(a,s),{continueExecution:i,removeActionPayload:c}=F_(o);return r=gf(t),i?(e.isTraditionalUICase=r,V_(e,{removeActionPayload:c})):(Ip.rejectActionByID(n),tg())})),Wp((async e=>{if(e?.type===Oa)return e.payload.context=((e,t)=>gm.isExternalCaseType(e)&&t?t:oE())(t,e.payload.context),s.push(xf(e)),s;const{actionInPayload:o,response:i,headers:c,removeActionPayload:l}=e,u=gm.isExternalCaseType(o.class);let d=j_(i);(o.renderInline||NE.getDefaultCasePage()||r)&&(d=!1),Ly.setIn(i.data,$s.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const p=U_({...o,isInCreateStage:d}),g=jr(p,o.context),h=Mf(g,p,o.context),{openCaseViewAfterCreate:f}=o;if(((e,t,n)=>!Jh(e)&&UI(t)&&(n??!0))(p,g,f)){const{continueExecution:e}=Ff(g);if(!e)return Ip.rejectActionByID(n),tg()}const m=o?.openCaseViewAfterCreate??!0,I=xh(i);if(!m&&!d){const e=of(i),{businessID:t,caseType:n,resolvedURL:r}=Pp(i);return a={id:t,label:n,href:r},k_(a),B_({caseId:t,assignmentId:e,caseType:n,ID:rf(I)}),u&&qI(o.context,{skipDirtyCheck:!0}),s}const E=String(nf(rf(I)));let y=UA("createWork",{caseClassName:sf(I)});y=y.replace(/{.+?}/,E),I.semanticURL=y,fp.setComponentCache(E,Gu.addDebugHeaders(o.debugInfo)),((e,t)=>{const n=j_(e),{skipBrowserSemanticUrlUpdate:s=!1,isTraditionalUICase:a}=t,r=a&&!hf();Ly.setIn(e,["directUrlUpdation"],(!n||r)&&!s)})(I,o);const A={acName:g,context:h},C=Af(h);await Pf(I,o,A);const S={target:g,context:h,containerItemID:h,headers:c,semanticURL:y,isInCreateStage:d,isMinimizable:d,caseViewMode:I.confirmationNote?Ws.REVIEW_MODE:Ws.PERFORM_MODE,currentCaseViewMode:C,assignmentContext:Ly.getIn(I,L_),nextAssignmentInfo:Ly.getIn(I,M_),resourceType:$s.CASE,openCaseViewAfterCreate:o.openCaseViewAfterCreate,modalOptions:o.modalOptions,debugInfo:o.debugInfo};uf(S,I);const _=Of(I,S);r&&(_.data.caseInfo.content.coexistenceAction="openAssignment"),gm.setTraditionalGadgetId(_.data);const N=wf(g,_);return Lf(N)&&cf(s,{removeActionPayload:l,target:g}),u&&(e=>{const t=e.context;if(gm.shouldUseUnifiedHandling()){const e=HI(t),{accessedOrder:n=[],type:s}=mI(e),a=n.filter((e=>e!==t));Ey(pA({containerItemID:t,context:t,target:e,containerInfo:{newAccessedOrder:a,containerType:s}}))}else qI(t,{skipDirtyCheck:!0})})(o),s.push(N),yf(I,S),Bf(s),s})),$p((()=>{const e=hf(),t=fm(Ly.getIn(s[0]?.payload,"data.caseInfo"));return r&&e&&t?w_.postCreateCaseMessage(s[0]?.payload?.nextAssignmentInfo?.ID,Gf,s):Gf(s),pf(s,n),a={},s=[],s})))},{RESOURCE_TYPES:W_}=$s,G_=(e,t)=>{const{containerItemID:n,context:s,actionMgrID:a,isInCreateStage:r,isModalAction:o}=t;if(r&&o){const t=Kh(n),r=jr(t,s);e.push(yA(uA,{containerItemID:n,target:r,actionMgrID:a}))}},H_=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:s,isInCreateStage:a,isProcessAction:r}=t,o=bI(n),i=`${o?.includes("root")?Ws.APP.ROOT:Ws.APP.APP}/${gI.MODAL}`;e.push(yA(pA,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:s,isInCreateStage:a,isProcessAction:r}))},q_=e=>Sy(".openCaseViewAfterCreate",Ws.CONTEXT_DATA,e)??!0,z_=async(e,{translatedDXAPIResponse:t,actionInPayload:n},s,a,r)=>{const{caseID:o}=n,i=(c=t,Ly.getIn(c,zh.NEXT_ASSIGNMENT_INFO_ID,Ws.EMPTY_STRING));var c;const l=a?_p(t):sf(t),{caseViewMode:u,headers:d,semanticURL:p,actionMgrID:g,directUrlUpdation:h,key:f,flowName:m,resourceType:I}=s,E=HI(n?.context),y=II(E,n?.context)?.acTertiary;Object.assign(r,{caseId:o,assignmentId:i,caseType:l,isSubmitFromBlendedUI:y}),H_(e,{...n,skipReleaseLockRequest:!0});const A=`${n?.containerItemID.includes("root")?Ws.APP.ROOT:Ws.APP.APP}/${gI.PRIMARY}`,C=Mf(A,gI.PRIMARY),S=Gu.getCoreHeadersFromContext(n.context)||!1,_=Of(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[Ws.COREHEADER_APP_DEBUG_ID]},shouldUpdateCaseActionsInParentContext:!0});if(UI(A)){const t=yy(C),a=rf({data:t}),[,r]=a?a.split(" "):[],o=`You will lose unsaved changes for ${r}. Do you want to continue?`;if(!q_(n.context))return e;{const{continueExecution:t}=Ff(A,{dirtyMessage:o});if(!t)return s.directUrlUpdation=!1,Ip.rejectActionByID(g),tg();_.currentCaseViewMode=Af(_?.context),e.push(yA(fA,_)),n.__deferCaseActionsPayload=_}}else e.push(yA(eA,_));return t.directUrlUpdation=h,t.semanticURL=p,await Pf(t,{..._,acName:A},{acName:A,context:C}),e},Y_=(e,{isModalAction:t,target:n,transientItemID:s})=>{if(t){const t=e.find((({type:e})=>e===$a));t?.payload&&(n=t.payload.target,s=t.payload.containerItemID)}const a=gA({target:n,containerItemID:s});a.payload.transientItems.length&&e.push(a)},K_=e=>/^app\/preview_[0-9]*/g.test(e),Q_=(e,t)=>{const n=Ks(e);return!K_(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},J_=e=>{if(!q_(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{}},X_=(e,t,n,s)=>{const{data:a,caseViewMode:r}=t,o={data:a,caseViewMode:r,context:n};if(Ly.setIn(o.data,["context_data","caseViewMode"],r),e.push({type:mr,payload:{context:n}}),s){const t={data:Bs.transformObjectToCase(a),caseViewMode:r,context:n};e.push(yA(qy,t))}e.push(yA(qy,o))},Z_=async(e,t,n,s,a,r,o,i,c,l)=>{const{headers:u}=c,d=l?Ws.OBJECT_INFO.OBJECT_INFO:Ws.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=yy(e),s=c?.response?.data?.caseInfo?.assignments??[],a=n?.caseInfo?.assignments??[],r=Af(e)===Ws.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=UI(HI(e));let g=!1;const h=HI(n),f=mI(h),m=OI(h);m&&f?.items?.[m]?.key===c?.actionInPayload?.caseID&&(g=!0),H_(a,{...s,skipReleaseLockRequest:!0});const I=Kh(e),E={target:HI(e),containerItemID:e,context:e,containerName:I};t.doDeleteCaseSummary=s.doDeleteCaseSummary;const y=ta(n),A=yy(y),C=yy(s.context),S=A[d]?.ID,_=C[d]?.ID,N=yy(e)?.caseInfo?.ID;if(p&&S===_||!p&&(""===o||E.containerItemID.includes(Ws.WORKAREA)&&"review"===t.caseViewMode||!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(Ws.WORKAREA)&&t.caseViewMode===Ws.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(Ws.ACTIONAREA)?a.push(yA(qy,{...t,key:o,resourceType:"",...E})):a.push(yA(oA,{...t,key:o,resourceType:"",...E}));else if(r){const r=HI(e),i=SI(r,o);if(i)E.target=r,E.context=i,E.containerItemID=i,a.push(yA(oA,{...t,key:o,resourceType:"",...E}));else{const e=wI(n)[0];if(s.target=e,s.context=Mf(e,Ws.WORKAREA,n),s?.context){s.containerItemID=s.context,a.push(yA(eA,{...s,...t}));const n=s.containerItemID;a.push(yA(uA,{parentContainerTarget:e,containerItemID:n}))}}}if(s.target=HI(e),s.containerName=Kh(e),s.context=e,s.containerItemID=e,s.shouldUpdateCaseActionsInParentContext=!0,Ly.setIn(t,"acName",E.target),await Pf(i,t),s.__deferCaseActionsPayload=s,g&&(n.includes(Ws.WORKAREA)&&lf(n)&&(n=ta(n)),X_(a,t,n,l)),!r&&t.caseViewMode===Ws.PERFORM_MODE){const t=((e,t)=>{const n=HI(e);return SI(n,t)})(e,o),n={data:{[d]:{headers:u}},context:t};a.push(yA(qy,n)),a.push(Om(((e,t=!1,n=!1)=>{const s=Ip.getNextActionMgrId();return{ID:Vy.getPropertyValue($s.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:Vy.getPropertyValue($s.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:s}}})(t)))}}else{H_(a,s);let e=!1;const o=HI(n),i=mI(o),u=OI(o);if(u&&i?.items?.[u]?.key===c?.actionInPayload?.caseID&&(e=!0),r){const e=wI(n)[0];s.target=e,s.context=Mf(e,Ws.WORKAREA,n),s.containerItemID=s.context,a.push(yA(eA,{...s,...t}));const r=s.containerItemID;a.push(yA(uA,{parentContainerTarget:e,containerItemID:r}))}e&&X_(a,t,n,l)}},eN=async(e,t,n,s,a,r,o)=>{const i=r?"objectInfo":"caseInfo";((e,t,n)=>{if(t.isProcessAction&&(H_(n,{...t,skipReleaseLockRequest:!0}),e)){const s=`${t?.containerItemID.includes("root")?Ws.APP.ROOT:Ws.APP.APP}/${gI.PRIMARY}`,a=Mf(s,gI.PRIMARY),r={insKey:e.ID,className:e.content.classID,context:a,acTargetName:Ws.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=HI(t?.context),s=II(n,t?.context)?.parentContext,a=HI(s);t?.isProcessAction&&CI(a,c)&&cE(s,e?.data[i]?.lastUpdateTime)}n.resourceType=W_.CASE,n.directUrlUpdation=!0,t.isProcessAction||await z_(a,{translatedDXAPIResponse:s,actionInPayload:t},n,r,o)},tN=async(e,t,n,s,a)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===Ws.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:r}=t,o=gm.getPropertiesToReplace(r);a.push(yA(oA,{...e,...s,propertiesToReplace:o})),Ly.setIn(e,"acName",s.target),await Pf(n,e),((e,t,n)=>{const{containerItemID:s}=t,a=bI(s),{data:r,caseViewMode:o}=n;if(a&&lf(s)){const n=ta(a),i={data:r,caseViewMode:o,context:n};Ly.setIn(i.data,["context_data","caseViewMode"],o),e.push({type:mr,payload:{context:n}});const c=gm.getPropertiesToReplace(s);e.push(yA(qy,i,{propertiesToReplace:c})),t.shouldUpdateCaseActionsInParentContext=!0,t.__deferCaseActionsPayload=t}})(a,t,e)},nN=async(e,t,n,s,a,r,o,i,c,l={})=>{const{isCaseWideAction:u,isInCreateStage:d,containerItemID:p}=e,g=Ks(e.context),h=af(a,c),f=c?_p(a):sf(a),m=d&&!h&&!u,I=wI(g)[0],E=I?OI(I):g,y=Kh(p),A=bI(p),C=Object.freeze({target:e.target,containerItemID:p,context:A,containerName:y});m&&!K_(e.context)?await eN(i,e,t,a,r,c,l):Q_(e.context,E)?await Z_(E,t,g,e,r,n,s,a,o,c):!u&&!c||Q_(e.context,E)?await tN(t,e,a,C,r):(H_(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=bI(r);e.push(yA(Yy,{containerItemID:r,context:o,container:gI.PREVIEW,containerName:gI.PREVIEW,caseId:a,viewName:$s.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(r,e,{caseClassName:f}))},sN=(e,t,n)=>{const{isModalAction:s,isCaseWideAction:a,caseID:r}=t,o=Q_(t.context,n),i=e?.data?.caseInfo?.stages,c=e?.data?.caseInfo?.stageID;ah({caseID:r,isModalAction:s,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:a,stages:i,stageID:c})},aN=e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[Ws.ERROR_FIELD_IN_PAGE]=e[Ws.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[Ws.ERROR_FIELD_IN_PAGE].slice(1),s=e[Ws.ERROR_IN_PAGE_IDENTIFIER],a=s.startsWith(".")?s.slice(1):s;if(a){let r=t?`caseInfo.content.${t}`:"caseInfo.content";r=Ws.getProperty(r.replace(/\(/g,"[").replace(/\)/g,"]"));const o=hu(a,r,Ws.PROPERTY),i={type:$s.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};pu.mutateField(n,r,o[o.length-1],{messages:[i],type:$s.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:s})}}))},rN=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Ws.MODAL:t||yp.getTargetViewContainerName(wr)},oN=e=>e?.uiResources?.root?.config?.name===ks.getDefaultQualifiedName("pzCreateDetails")||!1,iN=(e,t)=>{const n=oN(e),{skipBrowserSemanticUrlUpdate:s=!1}=t;Ly.setIn(e,["directUrlUpdation"],!n&&!s)},cN=e=>e.confirmationNote?Ws.REVIEW_MODE:Ws.PERFORM_MODE,lN=(e,t)=>{let n;return n=!e.renderInline&&!NE.getDefaultCasePage()&&oN(t),n},uN=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Ws.MODAL:t||yp.getTargetViewContainerName(Ur)},dN=(e,t)=>{const{class:n,context:s,viewType:a=_f.PAGE}=e,{removeActionPayload:r}=t,o=e?.pageName?e?.pageName:NE.getDefaultCasePage();return ql(ep.createCase(n,{...e,pageName:o,viewType:a,context:s,retrieveActionViewForNewObject:!0})).pipe($p((({response:t,headers:n})=>(Bs.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:r}))),ng("Error occurred during ajax call at createObject Epic : ",s))},pN="CREATE_EXTERNAL_CASE",gN=e=>{let t=0,n=[];return e.pipe(Zp(pN),sg(100),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>{const{context:n}=e,s=uN(e),a=jr(s,n),{continueExecution:r,removeActionPayload:o}=F_(a);return r?dN(e,{removeActionPayload:o}):(Ip.rejectActionByID(t),tg())})),Wp((async e=>{if(e&&e.type===Oa)return e.payload.context=oE(),n.push(xf(e)),n;const{actionInPayload:s,response:a,headers:r,removeActionPayload:o}=e,i=lN(s,a);Ly.setIn(a.data,Ws.getProperty(Ws.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const c=uN({...s,isInCreateStage:i}),l=jr(c,s.context),u=Mf(l,c,s.context);if(!Jh(c)&&UI(l)){const{continueExecution:e}=Ff(l);if(!e)return Ip.rejectActionByID(t),tg()}const d=xh(a);let p=UA(Pr,{caseClassName:sf(d)});p=p.replace(/{.+?}/,String(nf(rf(d)))),d.semanticURL=p,iN(d,s);const g={acName:l,context:u};await Pf(d,s,g);const h={target:l,context:u,headers:r,semanticURL:p,caseViewMode:cN(d),containerItemID:u,isInCreateStage:i,isMinimizable:i,assignmentContext:Ly.getIn(d,L_),nextAssignmentInfo:Ly.getIn(d,M_),resourceType:$s.RESOURCE_TYPES.CASE,openCaseViewAfterCreate:s.openCaseViewAfterCreate,modalOptions:s.modalOptions,debugInfo:s.debugInfo,isExternalCaseCreationFlow:!0};uf(h,d);const f=Of(d,h),m=wf(l,f);return Lf(m)&&cf(n,{removeActionPayload:o,target:l}),n.push(m),Bf(n),n})),$p((()=>(Gf(n),pf(n,t),n=[],n))))},{RESOURCE_TYPES:hN}=$s,fN=(e,t={})=>{const{viewType:n,containerName:s,targetContainerName:a,isChild:r}=e,o=tf(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?_f.PAGE:n||(!Qh(s)&&!Qh(a)||r?_f.PAGE:_f.FORM)},mN=(e,t,n,s,a)=>{if(cf(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=OI(t);let s=null;return n&&(s=II(t,n)),s?.key===e&&FI(t)})(s.key,n))s.context=vI(n),s.containerItemID=s.context,e.push(yA(fA,s));else if((a?.isChild||a?.isRemote)&&a?.isMultiDoc){const t=HI(a.context);s.target=t,s.context=a.context,s.containerItemID=a.context,e.push(yA(fA,s))}else{const t=HI(s.context),n=SI(t,s.key);n?(s.target=t,s.context=n,s.containerItemID=n,e.push(yA(fA,s))):e.push(yA(eA,s))}},IN=(e,t,n,s,a,r,o)=>{UI(t)&&jI(t)?((e,t,n,s,a)=>{fN(e,t)===_f.FORM?(n.caseViewMode=s||Ws.PERFORM_MODE,a.push(yA(oA,n))):a.push(yA(fA,n))})(s,a,e,r,n):mN(n,o,t,e,s)},EN=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:s,context:a,isGetNextWork:r,doNotMergeMessagesForStatusCode:o})=>{const i=gm.appendExcludeQueryParamToUrl(e);return td(i,{method:t,headers:{"if-match":n&&n.etag,...n,...s&&{...Gu.addDebugHeaders(s)}}},a,{doNotMergeHttpMessagesForStatusCode:r?o:""})},yN=(e,t)=>{const n=fN(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?jA("getNextWork",{viewType:n}):c?jA("openStage",{caseID:u,stageID:l}):jA(Ja,{assignmentID:r,viewType:n}));const{removeActionPayload:f}=t,m=NE.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=Tf(t,e.remoteClassName)),t})(e);return ql(EN({restUrl:I,reqType:h,requestHeaders:y,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe($p((e=>{if(NE.isCoexistenceAppOfType(Ws.APP_TYPE.UIKIT)&&!p){return fm(e.data.data.caseInfo)?e:(I=E?I.replaceAll(E,ks.getDefaultQualifiedName("pyDetails")):I,NE.setDefaultCasePage(ks.getDefaultQualifiedName("pyDetails")),{isReloadWithDifferentViewTypeRequired:!0,restUrl:I})}return e})),Wp((e=>e?.isReloadWithDifferentViewTypeRequired?EN({restUrl:I,reqType:h,requestHeaders:y,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):qp(e))),$p((t=>{const{key:a,flowName:o}=bf(r);return Bs.analyseResponse(t),{response:{...t.data,key:a,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:Tf({...s,...t.headers})}})),ng("Error occurred during ajax call at openAssignment Epic : ",a))},{RESOURCE_TYPES:AN}=$s,CN=e=>{const t="Browser"===NE.getRuntime();let n=0,s=[];const a=[];let r=!1,o=!1;return e.pipe(Zp(vp),$p((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),Wp((e=>{r=e.isGetNextWork;const{context:t}=e;let s;s=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?_f.FORM:fN(e),e.viewType=s;const a=Yh(Ja,e),i=jr(a,t),{activate:c,activateContainerActionPayload:l}=Vf(AN.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return qp({type:Va,activateContainerActionPayload:l,actionInPayload:e});const u=OI(i);let d;d=l?.isParallelAssignment?{continueExecution:!0,removeActionPayload:{}}:u?Ff(i):{continueExecution:!0,removeActionPayload:{}};const{continueExecution:p,removeActionPayload:g}=d;return p?(o=gf(e.className),e.isTraditionalUICase=o,NE.isWSSPortal()&&(e.headers={...e.headers,[Ws.X_ORIGIN_CHANNEL]:"WSS"}),yN(e,{removeActionPayload:g})):(Ip.rejectActionByID(n),tg())})),Wp((async e=>{if(e?.type===Oa){if(r){const{payload:t}=e,{err:n}=t,s=n.response.status;a.push({status:Number(s)})}return s.push(xf(e)),s}const{type:t,actionInPayload:n,response:i,viewType:c,headers:l,removeActionPayload:u,activateContainerActionPayload:d}=e;if("openStage"===i?.redirectInfo?.jsAction){const e=i?.redirectInfo?.stageID,t=vp,a=i?.data?.caseInfo?.ID;n.isOpenStage=!0,n.stageID=e,n.jsActionQueryParams=i?.redirectInfo?.jsActionQueryParams;const r={type:t,payload:{...n,caseID:a,headers:l}};return s.push(r),s}const{context:p,caseViewMode:g,debugInfo:h}=n,f=i?.data?.caseInfo?.caseTypeID;o=gf(f),n.isTraditionalUICase=o;let m=((e,t)=>{const n=tf(e);let s;s=!NE.getDefaultCasePage()&&fm(n);const{isChild:a,containerName:r,isTraditionalUICase:o}=t,i=a&&s,c=s&&!t.isActionFromToDoList;return!i&&!c||o?r||Yh(Ja,t):Ws.MODAL})(i,n);o&&(m=n.containerName??m);const I=jr(m,p);if(t===Va)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=bI(a);await Pf({directUrlUpdation:!l,semanticURL:s},c,{acName:i,target:i,context:u}),e.push(yA(uA,{containerItemID:a,target:i,isParallelAssignment:r,insKey:o,resourceType:hN.CASE,context:u,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(s,d,{actionInPayload:n,target:I}),Bf(s),s;const E=i?.data?.caseInfo?.content,y=i?.data?.caseInfo?.ID,A=i?.uiResources?.root?.config?.name,C=i?.uiResources?.root?.config?.context;E&&!E[ks.getDefaultQualifiedName("pyViewName")]&&A&&"page"!==n.viewType&&(Ly.setIn(E,ks.getDefaultQualifiedName("pyViewName"),A),Ly.setIn(E,ks.getDefaultQualifiedName("pyViewContext"),C));const S=xh(i);((e,t)=>{const n=tf(e),s=rf(e),a=fm(n),{skipBrowserSemanticUrlUpdate:r=!1,viewType:o,isTraditionalUICase:i}=t,c=i&&!hf(),l=o===_f.PAGE&&(!a||c)&&!r,{caseTypeID:u}=n;if(l){const t=UA(Qa,{caseClassName:u}).replace(/{.+?}/,String(nf(s)));e.semanticURL=t,e.directUrlUpdation=!0}})(S,n);const _=Mf(I,m,p),N={...n.debugInfo,debugId:n.debugInfo?.debugId??Gu.getCoreHeadersFromContext(p)?.debugInfo?.[Ws.COREHEADER_APP_DEBUG_ID]};N.debugId&&fp.setComponentCache(y,Gu.addDebugHeaders(N));const T={acName:I,target:I,context:_};await Pf(S,n,T);const D={target:I,context:_,containerItemID:_,headers:l,parentContext:Ks(n?.context),isMinimizable:fm(Ly.getIn(S,"data.caseInfo")),doDeleteCaseSummary:n.doDeleteCaseSummary,acTertiary:n.acTertiary,resourceType:$s.ASSIGNMENT,debugInfo:h,shouldUpdateCaseActionsInParentContext:!0,caseID:y};uf(D,S,{skipFlowNameUpdate:n?.caseViewMode===Ws.REVIEW_MODE});const O=Of(S,D);return n.isProcessAction&&(O.data.isProcessAction=n.isProcessAction),o&&(O.data.caseInfo.content.coexistenceAction="openAssignment"),gm.setTraditionalGadgetId(O.data),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(n,O),IN(O,I,s,n,i,g,u),((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||Ip.setRemoteCaseHeaderByContext(t,s),qs.isTraditionalRemoteCase(e)){t.assignmentID=t.assignments?.[0]?.ID;const s={className:e,name:a,action:Rr,remoteClassName:n};Ip.setTraditionalRemoteCaseParams(t,s)}}})(f,O.data.caseInfo),c===_f.FORM&&lf(O.containerItemID)&&(O.skipMergeAssignmentsAndActions=!1,Wf(O,s,C)),Bf(s),yf(S,D),(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,e)})({actionInContext:p,assignmentID:n.assignmentID,caseKey:O.key}),s})),$p((()=>{const e=n,t=hf(),r=fm(Ly.getIn(s[0]?.payload,"data.caseInfo"));return o&&t&&r?w_.postCreateCaseMessage(s[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,Ey,s):Ey(s),pf(s,e,a),s[0]?.payload?.isParallelAssignment&&Ey({type:vp,payload:{...s[0].payload,isParallelCall:!0}}),s=[],s})))},SN=(e,t)=>{const{insKey:n,headers:s,context:a,debugInfo:r,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:NE.getDefaultCasePage(),l=jA(Qa,{caseID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),u=gm.appendExcludeQueryParamToUrl(u),ql(td(u,{method:d,headers:{...s,...r&&{...Gu.addDebugHeaders(r)}}},a)).pipe($p((t=>(Bs.analyseResponse(t),{response:t.data,actionInPayload:e,headers:Tf({...s,...t.headers}),removeActionPayload:i}))),ng("Error occurred during ajax call at openWorkByHandle Epic : ",a))},_N="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:NN}=$s,TN=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=Yh(Qa,s),g=jr(p,l);if(Xh(r))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:s},actionInPayload:a,actionInPayload:{context:r,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=Yh(Qa,a),l=jr(c,r),u=bI(s);await Pf({directUrlUpdation:!o,semanticURL:n},a,{acName:l,containerName:c,target:l,context:u}),e.push(yA(uA,{containerItemID:s,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:a,actionInPayload:s});else{const a=Mf(g,p,l,{buildNew:!0}),r=xh(o),h=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:s}=t,a=rf(e),r=n?s:sf(e);let o=UA(Qa,{caseClassName:r},{id:t?.insKey});return o=o?.replace("{workID}",String(nf(a)))?.replace("{id}",t?.insKey),o})(r,s);r.semanticURL=h,r.directUrlUpdation=!u;const f={acName:g,context:a};await Pf(r,s,f);const m=Of(r,{target:g,context:a,containerItemID:a,semanticURL:h,headers:c,debugInfo:d});m.caseViewMode=Ws.REVIEW_MODE,m.resourceType=NN.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle",m.data.caseID=m.data.caseInfo.ID),gm.setTraditionalGadgetId(m.data),uf(m,r,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=Af(e?.actionInPayload?.context);const I=wf(g,m);i.containerItemID&&Lf(I)&&t.push(yA(pA,{containerItemID:i.containerItemID,target:g})),t.push(I),yf(r,m)}Bf(t);const h=s.insKey;oh({caseKey:h,actionInContext:l})},DN=e=>{let t=0,n=[],s=!1;return e.pipe(Zp(_N),$p((e=>(({actionMgrID:t,isAutoRedirection:s=!1}=e.payload),e.payload))),Wp((e=>{const{context:n,isChild:a,viewType:r}=e,o=Yh(Qa,e),i=jr(o,n);let c,l=!0;if("none"!==r){const e=Ff(i);l=e.continueExecution,c=e.removeActionPayload}if(!l)return Ip.rejectActionByID(t),tg();const{activate:u,activateContainerActionPayload:d}=Vf(NN.CASE,i,e);return u&&!a&&"none"!==r?(zf(d),qp({type:Va,activateContainerActionPayload:d,actionInPayload:e})):(s&&fp.setComponentCache("redirectionInProgress",!0),SN(e,{removeActionPayload:c}))})),Wp((async e=>{if(e&&Zh(e.type))return n.push(xf(e)),n;const t=yy(e?.actionInPayload?.context),s=gf(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=xh(e?.response),a={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:mr,payload:{context:a.context,doDeleteConfirmationDetails:!1}}),s&&a.data.caseInfo?.content&&(a.data.caseInfo.content.coexistenceAction="openWorkByHandle",a.data.caseID=a.data.caseInfo.ID),gm.setTraditionalGadgetId(a.data),n.push(yA(qy,a));const r=HI(e?.actionInPayload?.context),o=Kh(e?.actionInPayload?.context),i=Object.freeze({target:r,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(lf(e?.actionInPayload?.context)){const t=Of(e?.response,{...i});Wf({...t,isArrayDeepMerge:!0},n)}e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,e.actionInPayload.containerItemID=e?.actionInPayload?.context,e.actionInPayload.caseID=e?.actionInPayload?.insKey,yf(t,e?.actionInPayload)}}else await TN(e,n,s);return n})),$p((()=>(s&&fp.setComponentCache("redirectionInProgress",!1),Ey(n),pf(n,t),n=[],n))))},ON="FINISH_ASSIGNMENT",PN=(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?_f.PAGE:n||_f.FORM})(e),p=(e=>{const{isCaseWideAction:t,caseTypeID:n}=e;return gm.shouldUseUnifiedHandling()?t||gm.isObjectCaseType(n)?rr:Za:t?rr:Za})(e),g={assignmentID:n,actionID:s,caseID:a,viewType:d};let{restApi:h}=jA(p,g);const{reqType:f}=jA(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=Tm(c,h),h=gm.appendExcludeQueryParamToUrl(h),e.viewType=d;const{content:m}=Df(r),I=u.value.data[r]?.caseInfo?.headers||{},{etag:E}=I,y={"if-match":E,...l,...o};return ql(td(h,{method:f,body:m,headers:y},r)).pipe($p((t=>{const{data:n,headers:s}=t;return Bs.analyseResponse(n),{response:n,actionInPayload:e,headers:Tf({...y,...s})}})),ng("Error occurred during ajax call at finishAssignment Epic : ",r))},RN=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)},bN=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,e)},{RESOURCE_TYPES:vN}=$s,xN=e=>{const t=Iy()?.getState()?.data,n=t?Object.keys(t).find((e=>e.includes(Ws.WORKAREA))):void 0;return/^app\/primary(_\d+)?$/.test(e)&&!n},wN=(e,t)=>{let n=0,s=[],a={},r="",o={},i=!1,c=!1;return e.pipe(Zp(ON),Wp((e=>{let l,u;const d=NE.isCoexistenceAppOfType(Ws.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),r=e.payload.context,yu({context:r,stateObj:yy(r),clearContextMessages:!0}),!cm(r)||Nu(r)){const t={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Ip.rejectActionByID(n,!0,t),ch.handleDeferredActionCompletion(e.payload.context).then((()=>{bN({errorType:$s.ERROR_TYPE.CLIENT})})),qp([])}return qp(e.payload).pipe(Wp((e=>{fp.setComponentCache("lastActionID",e?.actionID),G_(s,e);const n={...e};return PN(n,{state$:t})})),Wp((async e=>{if(e&&e.type===Oa){Dm(e);const t=xf(e);return s.push(t),s}Jg.clearContextedCache(r);const{headers:t,actionInPayload:p,response:g}=e,{containerItemID:h,context:f=bI(h),isModalAction:m,isInCreateStage:I}=p;i=p.isCaseWideAction,c=p.isProcessAction;const E=HI(h);p.target=E;const y=Kh(h),A=Object.freeze({target:p.target,containerItemID:h,context:f,containerName:y});Ly.setIn(g.data,Ws.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),Ly.setIn(g.data,Ws.CASE_INFO_IS_LOCAL_ACTION,!1),g?.uiResources?.root?.config?.name&&"page"!==p.viewType&&Ly.setIn(g.data,Ws.CASE_INFO.VIEW_NAME,g?.uiResources?.root?.config?.name),RN({submitResponse:g});let C=xh(g,{[$s.STOPMERGEACTIONS]:!g.nextAssignmentInfo});const S=sf(C),_=Ks(p.context),N=wI(_)[0]?OI(wI(_)[0]):_,T=af(C),D=I&&!T;!m||I||Q_(p.context,N)||(C=kf(C,yy(h)));const O=Of(C,{headers:t,actionMgrID:n,directUrlUpdation:!1,isActiveWorkAreaPrimaryAndWorkareaAbsent:xN(N||"")});let P,R;df(O.data,p),O.caseClassName=S,O.resourceType=vN.ASSIGNMENT,O.headers=t;const b=C?.data?.caseInfo?.assignments?.some((e=>e.ID===p.assignmentID)),v=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(C,p),x=((e,t,n,s,a)=>{let r;const o=HI(t);return r=FI(o)?SI(o,n.data?.caseInfo?.ID):OI(o),s&&e&&_y(null,Ws.CASE_VIEW_MODE_PROP,r)===Ws.PERFORM_MODE&&a})(b,N,C,m,v),w=p?.actionID===$s.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(C?.data?.nextAssignmentInfo&&!w)O.caseViewMode=Ws.PERFORM_MODE,P=rf(C),R=!0;else if(x&&!w)C?.confirmationNote&&C?.uiResources?.root?.config?.name===Ws.PY_CONFIRM?O.caseViewMode=Ws.REVIEW_MODE:O.caseViewMode=Ws.PERFORM_MODE,P=rf(C),O.flowName=" ",O.deleteAssignmentSpecificResources=!1,R=!1;else{O.caseViewMode=Ws.REVIEW_MODE;const e=UI(HI(N));P=C?.confirmationNote&&C?.uiResources?.root?.config?.name===Ws.PY_CONFIRM&&!e?rf(C):"",R=!1}const M=rf(C);uf(O,C,{skipFlowNameUpdate:O?.caseViewMode===Ws.REVIEW_MODE||x});const L=UA("createWork",{caseClassName:S}).replace(/{.+?}/,String(nf(M)));if(C.semanticURL=L,O.semanticURL=L,m?(await nN(p,O,R,P,C,s,e,g,!1,o),D&&(a=J_(p))):I&&d&&!T?(NE.setDefaultCasePage(Ws.PY_DETAILS),await(async(e,t,n)=>{const s={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:gI.PRIMARY,targetContainerName:gI.PRIMARY,viewType:_f.PAGE,isLastStepInCreateStage:!0,context:n},a={type:Ca,payload:{...s}};t.push(a)})(g,s,Ks(f))):await tN(O,p,C,A,s),N?.includes(Ws.ACTIONAREA)&&f===N){const e=yy(N);s=[{type:Sa,payload:{actionID:e.caseInfo.activeActionID,context:N,containerItemID:h,target:HI(N),actionMgrID:Ip.getNextActionMgrId(),containerName:Ws.ACTIONAREA,localActionType:$s.LOCAL_ACTION_TYPE.CASE_WIDE,caseID:e.caseInfo.ID}}]}if(If(e,s),ch.handleDeferredActionCompletion(r).catch((()=>{})),sN(O,p,N),!C?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:s,actionID:a}=t;return{isCaseWideAction:n,caseID:rf(e),assignmentID:n?null:s,actionID:a||null}})(C,p);rh({...e,containerItemID:h})}return Y_(s,{transientItemID:h,target:E,isModalAction:m}),l=C,u=p,s})),$p((()=>{const t=s.find((e=>e.type===Oa));if(t?(ch.handleDeferredActionCompletion(r).then((()=>{bN({errorType:$s.ERROR_TYPE.SERVER})})).catch((()=>{})),aN(t),Ip.rejectActionByID(n)):Ip.resolveActionByID(n,a),o?.caseId&&(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)})(o),Gf(s),Ef()&&l&&u&&yf(l,u.__deferCaseActionsPayload??u),!t&&(i||c)){const t=e.payload.caseID;ih(t),(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0})}return s=[],a={},o={},s})))})))},MN="CANCEL_ASSIGNMENT",LN=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}=jA(i,{ID:a,caseID:a,viewType:_f.PAGE}),u=fp.getComponentCache(a),d=u&&"object"==typeof u?u:{},p=gm.appendExcludeQueryParamToUrl(c);return ql(td(p,{method:l,headers:{...t,...d}},r,{includeRemoteSystemIdIfPresent:!!o})).pipe($p((t=>(fp.resetComponentCache(a),s?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:Tf(t.headers)}))),ng(": Error occurred during ajax call at release lock request : ",r))},UN=(e,t)=>{const{isModalAction:n}=t;return LN({routeKey:"cancelAssignment",isModalAction:n,...e})},FN=e=>{let t=0,n=[];return e.pipe(Zp(MN),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>{const{isModalAction:n}=e;e.context||(e.context=bI(e.containerItemID));const{context:s}=e,a=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?gI.MODAL:Kh(n)})(e),r=jr(a,s),{continueExecution:o}=Ff(r);return o?(e.RemoteSystemID=qs.getRemoteHeaderByContext(e.context)??void 0,ql(UN(e,{isModalAction:n}))):(Ip.rejectActionByID(t),tg())})),Wp((e=>{if(e&&e.type===Oa)return n.push(xf(e)),ql([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=HI(r),l=bI(r),u={target:o?`${Ws.APP.APP}/${Ws.MODAL}`:c,containerItemID:r,caseViewMode:o?Ws.PERFORM_MODE:Ws.REVIEW_MODE,context:l,actionMgrID:t,key:rf(a),skipReleaseLockRequest:!1};return i&&n.push(yA(oA,u)),!o&&lf(r)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:s,referencedUsers:a,response:r}=t,o=Ks(n),i={context:bI(o),data:{...r.data,referencedUsers:a,context_data:{caseViewMode:s}}};r?.data?.caseInfo&&(r.data.caseInfo.assignments??=[]),e.push(yA(qy,i))})(n,{childContainerItemID:r,caseViewMode:Ws.REVIEW_MODE,referencedUsers:a?.data.referencedUsers,response:a}),u.skipReleaseLockRequest=!0,e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,yf(e?.response,e?.actionInPayload),n.push(yA(pA,u)),ql([n])})),$p((()=>(Ey(n),pf(n,t),n=[],n))))},jN="NAVIGATE_TO_STEP",VN=(e,t)=>{const{ID:n,stepID:s,containerItemID:a,context:r=bI(a),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:s,viewType:o?_f.PAGE:_f.FORM},{restApi:l,reqType:u}=jA("navigateToStep",c),{content:d}=Df(r),p=i.value.data[r].caseInfo.headers,g=gm.appendExcludeQueryParamToUrl(l);return ql(td(`${g}`,{method:u,body:d,headers:{"if-match":p&&p.etag}},r)).pipe($p((t=>({response:t.data,actionInPayload:e,headers:Tf({...p,...t.headers})}))),ng("Error occurred during ajax call at navigateToStep Epic : ",r))},{RESOURCE_TYPES:kN}=$s,BN=(e,t)=>{let n=0,s=[];return e.pipe(Zp(jN),Bp((e=>{let a,r;return({actionMgrID:n}=e.payload),qp(e.payload).pipe(Wp((e=>(_u(e.context),VN(e,{state$:t})))),Wp((async e=>{if(e&&Zh(e.type))return s.push(xf(e)),s;const{actionInPayload:t,response:n,headers:o}=e,{containerItemID:i,context:c=bI(i),isModalAction:l}=t;Jg.clearContextedCache(t.context);const u=HI(i),d=Kh(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&&(Ly.setIn(g,ks.getDefaultQualifiedName("pyViewName"),h),Ly.setIn(g,ks.getDefaultQualifiedName("pyViewContext"),f)),a=xh(n);const m={acName:u,...p};await Pf(a,t,m),r=Of(a,{...p,headers:o}),n?.nextAssignmentInfo||(r.caseViewMode=Ws.REVIEW_MODE),If(e,s),r.doDeleteCaseSummary=t.doDeleteCaseSummary,r.resourceType=kN.ASSIGNMENT,r.caseID=rf(a),uf(r,a),df(r.data,t);const I=a.data?.caseInfo?.stages,E=a.data?.caseInfo?.stageID;return ah({caseID:rf(a),isModalAction:l,stages:I,stageID:E}),lf(i)&&Wf(r,s),s.push(yA(oA,r)),r.shouldUpdateCaseActionsInParentContext=!0,Bf(s),s})),$p((()=>(Ey(s),a&&r&&yf(a,r),pf(s,n),s=[],s))))})))},$N=e=>{const{caseID:t,context:n}=e,{restApi:s,reqType:a}=jA(tr,{ID:t});return ql(td(s,{method:a},n)).pipe($p((t=>(Bs.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:Tf(t.headers)}))),ng(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},WN=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},GN=(e,t)=>{let n,s=0,a=[];return e.pipe(Zp(xp),$p((e=>(({actionMgrID:s,caseType:n}=e.payload),e.payload))),Wp((e=>e.ignoreCaseDeletion?qp({actionInPayload:e}):$N(e))),Wp((async e=>{if(e&&Zh(e.type)){const{payload:t}=e,n=xf({...e,...t,actionMgrID:s});return a.push(n),a}const{actionInPayload:n}=e,{context:r,isModalAction:o}=n,i=o?gI.MODAL:gI.PRIMARY,c=jr(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 Pf({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:Ws.PRIMARY,isChild:!0},t={type:Ia,payload:{...e}};a.push(t)}const l={target:c,containerItemID:r,context:r,caseDeleted:!0};return a.push(yA(pA,l)),a})),$p((()=>(Ey(a),pf(a,s)===Ws.PROMISE_VALUE.RESOLVE&&WN({caseType:n}),a=[],a))))};function HN(e,t){return el(t)?Wp(e,t,1):Wp(e,1)}const qN=(e,t)=>{const{assignmentID:n,actionID:s,context:a}=e,{restApi:r,reqType:o}=jA("save",{assignmentID:n,actionID:s}),{content:i}=Df(a),c=t.value.data[a]?.caseInfo?.headers,l=gm.appendExcludeQueryParamToUrl(r);return ql(td(l,{method:o,body:i,headers:{"if-match":c&&c.etag}},a)).pipe($p((t=>({response:t.data,actionInPayload:e,headers:Tf(t.headers)}))),ng(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",a))},zN=(e,t=!1)=>{const{action:n,state$:s,actionMgrID:a}=e;let r=[];return qp(n.payload).pipe(Wp((e=>qN(e,s))),HN((e=>{if(e&&Zh(e.type))return qp(e);const{containerItemID:t}=e&&e.actionInPayload,s=Ks(t),a=HI(s),o=mI(a),i=wI(s)[0];let c=i?OI(wI(s)[0]):s;if(!UI(HI(c))){const t=mI(i);t?.accessedOrder.forEach((n=>{e.actionInPayload.caseID===t.items[n].key&&(c=t.items[n].context)}))}const l=OI(a);n.payload.canUpdateAvailableActions&&vh(e.response);if(c&&r.push((t=>yA(qy,{context:t,data:{caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}}))(c)),o?.items?.[l]?.key===e?.actionInPayload?.caseID){const n={context:s,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},a=gm.getPropertiesToReplace(t);r.push(yA(qy,n,{propertiesToReplace:a}))}return r.push(yA(oA,{context:t})),If(e,r),LN({...e.actionInPayload,RemoteSystemID:qs.getRemoteHeaderByContext(e.actionInPayload.context)??void 0})})),Wp((async n=>{if(n&&Zh(n.type)){const{payload:t}=n,s=xf({...n,...t,actionMgrID:a});r.push(s);const o=e.action.payload.modalLoadingContainer;if(o){const e=o.context,{context_data:t}=yy(e)||{};t?.isLoading&&qI(e)}return r}const{actionInPayload:s,response:o}=n,{context:i,containerName:c}=s,l={target:jr(c,i),containerItemID:i,context:i};return s.shouldUpdateCaseActionsInParentContext=!0,yf(o,s),t||r.push(yA(pA,l)),r})),$p((()=>(Ey(r),pf(r,a),(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.SAVE_ASSIGNMENT_COMPLETE,e)})({context:n.payload.context,assignmentID:n.payload.assignmentID}),t||(r=[]),ch.isDeferredActionInProgress(n.payload.context)&&ch.handleDeferredActionCompletion(n.payload.context),r))))},YN=(e,t)=>{let n,s=0;return e.pipe(Zp(wp),Bp((e=>{const{saveOnly:a}=e.payload;({actionMgrID:s,caseType:n}=e.payload);return zN({action:e,state$:t,actionMgrID:s,caseType:n},a)})))},KN=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",Ru.unsubscribe(Ws.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,s="expressLocalActionSubmit",Ru.subscribe(Ws.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,s)}var n,s},{LOCAL_ACTION_TYPE:QN}=Ws,{RESOURCE_TYPES:JN}=$s,XN=(e,t)=>{const{actionID:n,assignmentID:s,caseID:a,context:r,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,u=l?sr:(e=>{const t=e.localActionType.toLowerCase();return t===QN.CASE_WIDE||t===QN.EXPRESS?ar:nr})(e),d=_f.FORM,{reqType:p}=jA(u,{caseID:a,ID:s,actionID:n,viewType:d});let{restApi:g}=jA(u,{caseID:a,ID:s,actionID:n,viewType:d});e.actionType=u===ar?Ws.CASE:Ws.ASSIGNMENT,g&&!g.includes("viewType=")&&(g=g.includes("?")?`${g}&viewType=${d}`:`${g}?viewType=${d}`),g=gm.appendExcludeQueryParamToUrl(g);const h=i?.context??r;return ql(td(g,{method:p,headers:c},h)).pipe($p((t=>({response:t.data,actionInPayload:e,headers:Tf(t.headers,"",e.headers)}))),ng(`: Error occurred during ajax call at ${o} Epic : `,h))},ZN=(e,t)=>{const{isProcessAction:n}=t,s=n?sr:nr;e.openActionType=s;let a;if("modal"===Yh(s,e)){if(!bu.isOnline()||e.isAppOffline)return Ip.rejectActionByID(e.actionMgrID),Promise.resolve();a=wI(e.contextName)[0]?wI(e.contextName)[0]:HI(e.contextName);const n=a?OI(a):e.contextName,s=bI(n),r=Yh(e.openActionType,e),o=jr(r,e.context),i=ea(e.context,Qs(r,e.context));if(Ey(eA({target:o,context:i,containerItemID:i,key:e.caseID,caseViewMode:Ws.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:Ws.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}},headers:{...e.headers}})),Ey(iA({context:i})),e.modalLoadingContainer={target:o,context:i},!wI(e.contextName)[0])return XN(e,t);if(!e.continueExecution)return XN(e,t);if(!rI(s))return XN(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return ql([Mp(e.saveActionPayload)]).pipe(Wp((e=>(e=>{let t,n=0;const s=[],a={value:Iy()?.getState()};return qp(e).pipe(Zp(wp),Bp((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 Ip.rejectActionByID(n,!0,e),qp([])}return zN({action:e,state$:a,actionMgrID:n,caseType:t,actionsOut:s},!0)})))})(e))),Wp((n=>{if(1===n.length&&Zh(n[0].type)){const{continueExecution:n}=Ff(a);if(!n)return Ip.rejectActionByID(e.actionMgrID),eg.pipe(zl((()=>tg()))).toPromise();if(n)return XN(e,t)}return XN(e,t)})),$p((e=>e)))}return XN(e,t)},eT=async(e,t,{headers:n,actionInPayload:s})=>{const{context:a,actionName:r,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c,skipMergeAssignmentsAndActions:l}=s,u=xh(e),d=Yh(o,s),p=c?.target??jr(d,a);let g,h,f=!1;!jI(p)||FI(p)&&!CI(p,e.data.caseInfo.ID)?(h=Qs(d,a),Jh(d)&&(h=ea(a,h)),g=h,f=!0):(g=FI(p)?SI(p,e.data.caseInfo.ID):OI(p),h=bI(g));const m={acName:p,target:p,containerName:d,context:h};await Pf(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?Ws.PERFORM_MODE:Ws.REVIEW_MODE;const y=Of(u,{target:p,context:h,containerItemID:g,caseViewMode:E,doDeleteCaseSummary:i,headers:n,actionName:r,isMinimizable:!1,isInCreateStage:Jh(d),resourceType:JN.ASSIGNMENT,isProcessAction:s.isProcessAction,showProgress:s.showProgress,progressMessage:s.progressMessage,assignmentID:s.assignmentID,actionType:s.actionType,skipMergeAssignmentsAndActions:l});let A;if(I&&uf(y,u),Jh(d)&&delete y.doDeleteCaseSummary,s.openActionType===or&&(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),A=f?eA:s.isProcessAction||(e=>e.containerItemID?.includes(Ws.ACTIONAREA)&&e.context?.includes(Ws.ACTIONAREA))(s)?fA:oA,y.data.context_data.isProcessAction=s.isProcessAction,t.push(yA(A,y)),f||t.push(yA(cA,y)),f){const a=wI(s.contextName),r=SI(a,e.data.caseInfo.ID);if(r){const e={data:{caseInfo:{headers:n}},context:r};t.push(yA(qy,e))}}return g!==OI(p)&&t.push(yA(uA,{target:p,containerItemID:g})),lf(g)&&!c?.context&&Wf(y,t),y.caseViewMode===Ws.REVIEW_MODE&&t.push(yA(pA,y)),y.shouldUpdateCaseActionsInParentContext=!0,yf(u,y),t},tT="OPEN_LOCAL_ACTION",nT=(e,t)=>ZN(e,t),sT=e=>{let t=0,n=[];return e.pipe(Zp(tT),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Jp((()=>!Cf(t))),Wp((e=>nT(e,{actionMgrID:t}))),Wp((async e=>{if(!e)return eg;if(Zh(e.type)){const t=xf(e);n.push(t);const{context_data:s}=yy(e.payload.context)||{};return s?.isLoading&&n.push(yA(cA,e.payload)),n}const{actionInPayload:t,headers:s,response:a}=e,{actionID:r}=t;Ly.setIn(a,"data.caseInfo.activeActionID",r);return(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,e)})(Ly.getIn(a,"data.caseInfo.ID")),Ly.setIn(a.data,Ws.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&Ly.setIn(a.data,Ws.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await eT(a,n,{headers:s,actionInPayload:t}),KN(t),n})),$p((()=>(Ey(n),pf(n,t),n=[],n))))},aT=e=>{const{actionID:t,context:n,openActionType:s,caseTypeID:a,bulkContextID:r="",bulkContextType:o=""}=e,i=or,{reqType:c,restApi:l}=jA(i,{caseTypeID:a,actionID:t,bulkContextID:r,bulkContextType:o});return ql(td(l,{method:c},n)).pipe($p((t=>({response:t.data,actionInPayload:e,headers:Tf(t.headers)}))),ng(`: Error occurred during ajax call at ${s} Epic : `,n))},rT=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",Ru.unsubscribe(Ws.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,s="bulkActionSubmit",Ru.subscribe(Ws.PUB_SUB_EVENTS.EVENT_BULKACTION,n,s)}var n,s},oT="OPEN_BULK_ACTION",iT=e=>{let t=0,n=[];return e.pipe(Zp(oT),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>((e,t)=>{const{context:n}=e,{actionMgrID:s}=t;e.openActionType=or;const a=Yh(or,e),r=jr(a,n),{continueExecution:o}=Ff(r);return o?aT(e):(Ip.rejectActionByID(s),tg())})(e,{actionMgrID:t}))),Wp((async e=>{if(e&&Zh(e.type)){const t=xf(e);return n.push(t),n}const{actionInPayload:t,headers:s,response:a}=e,{actionID:r}=t;return Ly.setIn(a,"data.caseInfo.activeActionID",r),await eT(a,n,{headers:s,actionInPayload:t}),rT(t),n})),$p((()=>(1===n.length&&Zh(n[0].type)?Ip.rejectActionByID(t):Ip.resolveActionByID(t),Ey(n),n=[],n))))};var cT=Array.isArray,lT=Object.getPrototypeOf,uT=Object.prototype,dT=Object.keys;function pT(e){if(1===e.length){var t=e[0];if(cT(t))return{args:t,keys:null};if((s=t)&&"object"==typeof s&&lT(s)===uT){var n=dT(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var s;return{args:e,keys:null}}var gT=Array.isArray;function hT(e){return $p((function(t){return function(e,t){return gT(t)?e.apply(void 0,Kc([],Yc(t))):e(t)}(e,t)}))}function fT(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return el(Hp(e))?e.pop():void 0}(e),s=pT(e),a=s.args,r=s.keys,o=new Ol((function(e){var t=a.length;if(t)for(var n=new Array(t),s=t,o=t,i=function(t){var i=!1;Ul(a[t]).subscribe(kl(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(hT(n)):o}const mT=e=>{const{actionID:t,context:n,cases:s,classID:a}=e,{content:r}=Df(n,{nonEmptyAndChangedData:!0});let o=5;try{const e=Eh.getSharedState(ks.getQualifiedNameForComplexRuleReferences("D_pySingleExecutionBulkActionsMeta.D_pySingleExecutionBulkActionsMeta.pxResults"));e?.find((e=>e[ks.getDefaultQualifiedName("pyClassName")]===a))?.pyList.split(",").includes(t)&&(o=1)}catch(e){console.error('Failed to fetch to "D_pySingleExecutionBulkActionsMeta" DP response',e)}const i=s.map((e=>({ID:e}))),c=i.length/o,l=ir,{reqType:u,restApi:d}=jA(l,{actionID:t}),p=[],g=i.length;for(let t=0;t<g;t+=c)r.cases=i.slice(t,t+c),r.cases.length&&p.push(ql(td(d,{method:u,body:r},n)).pipe($p((t=>{const{data:n,headers:s}=t;return{response:n,actionInPayload:e,headers:Tf({...s})}})),ng("Error occurred during ajax call at submitbulkaction Epic : ",n)));return fT(p)},IT=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},ET="SUBMIT_BULK_ACTION",yT=e=>{let t,n=0,s=[],a="";return e.pipe(Zp(ET),Bp((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:n}=e.payload),!r){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Ip.rejectActionByID(n,!0,e),qp([])}return qp(e.payload).pipe(Wp((e=>(t=e,mT(t)))),Wp((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`,IT({submitResponse:e}),t.target="HYBRID"===NE.getRenderingMode()?HI(i):`${Ws.APP.APP}/${gI.MODAL}`,s.push(yA(pA,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),r&&s.push(yA(dA,{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})),$p((()=>(Ip.resolveActionByID(n,a),Ey(s),s=[],s))))})))},AT=e=>{const{actionID:t,context:n,cases:s}=e,{content:a}=Df(n,{nonEmptyAndChangedData:!0});a.cases=s.map((e=>({ID:e})));const r=ir,{reqType:o,restApi:i}=jA(r,{actionID:t,runningMode:"async"});return ql(td(i,{method:o,body:a},n)).pipe($p((t=>{const{data:n,headers:s}=t;return{response:n,actionInPayload:e,headers:Tf({...s})}})),ng("Error occurred during ajax call at submitbulkactionasync Epic : ",n))},CT=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},ST="SUBMIT_BULK_ACTION_ASYNC",_T=e=>{let t,n=0,s=[],a={};return e.pipe(Zp(ST),Bp((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:n}=e.payload),!r){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Ip.rejectActionByID(n,!0,e),qp([])}return qp(e.payload).pipe(Bp((e=>(t=e,AT(t)))),$p((e=>{const{containerItemID:n,context:r}=t,{response:o}=e;return a={caseID:o.caseID,caseTypeID:"BackgroundJob"},CT({submitResponse:o}),t.target=`${Ws.APP.APP}/${gI.MODAL}`,s.push(yA(pA,{containerItemID:n,context:r,target:t.target,skipReleaseLockRequest:!0})),s})),$p((()=>(Ip.resolveActionByID(n,a),Ey(s),s=[],s))))})))},NT=(e,t)=>ZN(e,t),TT=e=>{let t=0,n=[];return e.pipe(Zp(bp),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>{const n=Yh(sr,e),s=jr(n,e.context),{continueExecution:a}=Ff(s);return a?(_u(e.context),NT(e,{actionMgrID:t,isProcessAction:!0})):(Ip.rejectActionByID(e.actionMgrID),eg)})),Wp((async e=>{if(e&&Zh(e.type)){const t=xf(e);return n.push(t),n}const{actionInPayload:t,headers:s,response:a}=e;return await eT(a,n,{headers:s,actionInPayload:t}),n})),$p((()=>(Gf(n),pf(n,t),n=[],n))))},DT=e=>{let t=0,n=[];return e.pipe(Zp(va,$a),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>{const{containerItemID:t,caseID:n,context:s,caseDeleted:a,skipReleaseLockRequest:r,currentCaseViewMode:o,isProcessAction:i,isInCreateStage:c}=e,l=o===Ws.PERFORM_MODE,u=n&&l;return i&&c?LN(e):t!==s||a||r||!u?t?.includes(Ws.MODAL)&&Af(pE(t))===Ws.REVIEW_MODE?LN(e):qp([]):LN(e)})),Wp((e=>(e&&Zh(e.type)&&n.push(xf(e)),n))),$p((()=>(Ey(n),pf(n,t),n=[],n))))};var OT=function(e){function t(t,n){return e.call(this)||this}return Gc(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(al),PT={setInterval:function(e,t){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];var a=PT.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,Kc([e,t],Yc(n))):setInterval.apply(void 0,Kc([e,t],Yc(n)))},clearInterval:function(e){var t=PT.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},RT=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 Gc(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),PT.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&&PT.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,sl(s,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(OT),bT={now:function(){return(bT.delegate||Date).now()},delegate:void 0},vT=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=bT.now,e}(),xT=new(function(e){function t(t,n){void 0===n&&(n=vT.now);var s=e.call(this,t,n)||this;return s.actions=[],s._active=!1,s}return Gc(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}(vT))(RT),wT=xT;function MT(e,t,n){void 0===e&&(e=0),void 0===n&&(n=wT);var s=-1;return null!=t&&(Gp(t)?n=t:s=t),new Ol((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 LT(e,t){return void 0===e&&(e=0),void 0===t&&(t=xT),e<0&&(e=0),MT(e,e,t)}function UT(e){return Vl((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(kl(n,(function(t){null==r||r.unsubscribe(),s=!0,a=t,r=kl(n,o,dl),Ul(e(t)).subscribe(r)}),(function(){o(),n.complete()}),void 0,(function(){a=r=null})))}))}const FT=(e,t,n,s,a)=>{if(a!==Ws.RESOURCE_STATUS.CREATE)return;Qf.isStateMachineExist(e,t,n)||Qf.setStateMachine(e,n,t,new Ad(n,t,e));Qf.getStateMachine(e,t,n).insert({},"string"==typeof s?s:s+1,!0,{isDefault:!0})},jT=(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)},VT=e=>{const t=!e.isLocalAction&&e.editType===Ws.ACTION;return{...t?{}:{activeActionID:e.actionID},assignments:[{ID:e.assignmentID,...t?{actions:[{ID:e.actionID}]}:{}}]}},kT=e=>{let t=0,n=[],s="";return e.pipe(Zp(Nr),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>C_(e))),Wp((async e=>{if(e&&e.type===Oa)return n.push(xf(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:a,headers:r}=e,o=t.containerName,i=jr(o,t.context);let c=Mf(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=xh(I);E.key=t.ID,E.data?.caseInfo?(E.data.caseInfo.ID=t.ID,jT(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=yy(t.context)?.context_data?.caseInfo,T=`${t.pageReference}${t.targetProperty}`,D=fu(N,T,t.index);E.uiResources.context_data.caseInfo={...E.uiResources.context_data.caseInfo,content:Ly.mergeDeep(E.uiResources.context_data.caseInfo?.content,D?.content)};const O=Vy.getProperty(Ws.CASE_INFO.REMOTESYSTEMID,"",t.context),P={acName:i,context:c};await Pf(E,t,P);const R={target:i,context:c,containerItemID:c,headers:r,index:d,subscriptFieldName:p,pageGroupName:g,isPageGroup:f};O&&(R.headers={...R.headers,RemoteSystemID:O});const b=Ly.deepClone(E.data?.caseInfo?.content);if(E.data?.caseInfo&&A===Ws.ACTION){Kn(E.data,`${l}${u}`,new Array(d+1).fill({}));const e=Ly.deepClone(Sy(`${u}[${d}]`,l,t.context)??{});((e,t,n,s,a)=>{if(!e[Ws.CLASSID]){const r=t===$s.CASE_INFO.CASE_INFO_CONTENT?`${n.replace(".","")}[${s}].${Ws.CLASSID}`:`${t.split($s.CASE_INFO.CASE_INFO_CONTENT)[1].replace(".","")}${n}[${s}].${Ws.CLASSID}`,o=Ly.getIn(a,r);o&&(e[Ws.CLASSID]=o)}})(e,l,u,d,b),Kn(E.data,`${l}${u}[${d}]`,e)}const v=Of(E,R);E.data?.caseInfo&&(E.data.caseInfo.content=b);const x=Of(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===Ws.ACTION&&(v.data.caseInfo={...v.data.caseInfo,...VT(t),isLocalAction:t.isLocalAction}),v.clearStateMachine=!1,x.skipValidation=!0;const w=wf(i,v);s=c,n.push(w),Bf(n);const M=yA(qy,x);return{actionsOut:n,actionInPayload:t,mergeAction:M}})),$p((({actionInPayload:e,mergeAction:a})=>{if(ef(n)?Ip.rejectActionByID(t):Ip.resolveActionByID(t),e.skipPageInstructions||FT(s,e.pageReference,e.targetProperty,e.index,e.actionType),Ey(n),n=[],e.editType===Ws.ACTION){Qf.registerForServerChanges(),Ey(a),Qf.unRegisterForServerChanges();const t=Ws.getProperty($s.CASE_INFO.CASE_INFO_CONTENT)+Ly.convertClipboardPageToPageRefNotation(e.interestPage);e.columns.forEach((n=>{const a=So.trimAnnotation(n.config.value),r=Sy(a,t,s),o=$E(a.startsWith(".")?a.split(".").pop():a,n.config.classID);pu.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})))},BT=e=>{let t,n="",s=[];return e.pipe(Zp(Tr),Bp((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 Ip.rejectActionByID(n,!0,t),ch.handleDeferredActionCompletion(e.payload.context),qp([])}return qp(e.payload).pipe(Wp((e=>(t=e,C_(t)))),Wp((async e=>((e,t)=>{if(e&&"action"===t.editType&&e.type!==Oa){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=xh(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=Of(c,a);l.skipValidation=!0;const u=yA(qy,l);Qf.registerForServerChangesSync(),Ey(u),Qf.unRegisterForServerChanges()}return e})(e,t))),Wp((async e=>{if(e&&e.type===Oa){const t=xf(e);return s.push(t),s}const{containerItemID:n,context:a,pageReference:r}=t;return((e,t,n,s)=>{Pd(e).forEach((e=>{const a=Ly.convertClipboardPageToPageRefNotation(e.target);Qf.isStateMachineExist(t,n,a)||Qf.setStateMachine(t,a,n,new Ad(a,n,t));const r=Qf.getStateMachine(t,n,a);switch(e.instruction.toLowerCase()){case"insert":r.insert(e.content,e.listIndex,s,{});break;case"update":r.update(e.content,e.listIndex??e.groupIndex,s,{});break;case"delete":e.listIndex?r.delete(e.listIndex,s):e.groupIndex?r.delete(e.groupIndex,s):r.deletePage();break;case"replace":r.replacePage(e.content);break;case"move":r.move(e.listIndex,e.listMoveToIndex);break;case"add":r.insert(e.content,e.groupIndex,s,{});break;case"delete all":r.deleteAll()}}))})(a,t.parentContext,r.startsWith($s.OBJECT_INFO.OBJECT_INFO_CONTENT)?Ws.getProperty($s.OBJECT_INFO.OBJECT_INFO_CONTENT):Ws.getProperty($s.CASE_INFO.CASE_INFO_CONTENT),!1),s.push(yA(pA,{containerItemID:n,context:a,target:t.target,skipReleaseLockRequest:!0})),s})),$p((()=>{if(ef(s))Ip.rejectActionByID(n),ch.handleDeferredActionCompletion(t.context);else{Ip.resolveActionByID(n),ch.handleDeferredActionCompletion(t.context);const{pageReference:s}=e.payload,a=Vy.getPropertyValue(Ws.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,s,t.parentContext);a?((e,t)=>{const{pageReference:n,isMultiRecordData:s}=t,a=Vy.getPropertyValue(Ws.getProperty($s.CASE_INFO.CASE_INFO_ID),n,e.parentContext),r=Vy.getPropertyValue(Ws.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,e.parentContext),o=Vy.getPropertyValue($s.CASE_INFO.ASSIGNMENT_ID,n,e.parentContext),i=Vy.getPropertyValue(Ws.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(Ws.getProperty(Ws.CASE_INFO.CASE_INFO_CONTENT),"");"action"===i.editType?vm(a,o,u,e.parentContext,c,l,d,s,i.editType):bm(a,r,e.parentContext,p,{})})(t,{isMultiRecordData:a,pageReference:s}):jm(t.parentContext,Ws.getProperty(Ws.CASE_INFO.CASE_INFO_CONTENT),{})}return Ey(s),s=[],s})))})))},$T=e=>{const{caseID:t,headers:n,debugInfo:s,context:a}=e,r=jA("getDescendants",{caseID:t}),{restApi:o}=r,{reqType:i}=r;return ql(td(o,{method:i,headers:{...n,...s&&{...Gu.addDebugHeaders(s)}}},a)).pipe($p((t=>({actionInPayload:e,response:t.data,headers:Tf({...n,...t.headers})}))),ng("Error ocurred during ajax call at getDescendants Epic : ",a))},WT=e=>{let t=0,n=[];return e.pipe(Zp(th),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>$T(e))),Wp((async e=>{if(e&&Zh(e.type))return n.push(xf(e)),n;const{actionInPayload:t,response:s}=e,a={};Ly.setIn(a,"caseInfo.childCases",s?.childCases??[]);const r={data:a,context:t?.context};return n.push(yA(qy,r)),n})),$p((()=>(Ey(n),pf(n,t),n=[],n))))},GT=e=>{let t,n="",s=[],a={};return e.pipe(Zp(Dr),Bp((e=>{t=e.payload;const{isFormValid:r}=e.payload;return({actionMgrID:n}=e.payload),r?qp(e.payload).pipe(Wp((e=>(t=e,qp({})))),Wp((async()=>{const{containerItemID:e}=t,r=yy(e),o=e,i=r?.dataInfo.content;delete i.classID;const c=Ks(o),l=wI(c).length,u=wI(c)[l-1]?OI(wI(c)[l-1]):c,d=HI(e),p=II(d,e)||{},g=p?.referenceList?.replaceAll(".",""),h=p?.subscriptName,f=yy(u),m={containerItemID:u,data:{...f,caseInfo:{content:{...i}}}};s.push(yA(oA,m)),((e,t,n)=>{rI(t)&&e.push(yA(pA,{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:Nr,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})),$p((()=>(Ip.resolveActionByID(n,a),Ey(s),s=[],s)))):(((e,t)=>{const n={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};Ip.rejectActionByID(e,!0,n),ch.handleDeferredActionCompletion(t)})(n,e.payload.context),qp([]))})))},HT=[$_,gN,CN,DN,sT,iT,yT,_T,TT,wN,BN,FN,DT,YN,GN,e=>e.pipe(Zp(er),UT((()=>LT(100))),$p((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:s,isProcessAction:a,isDataObject:r,skipReleaseLockRequest:o,isInCreateStage:i}=e.payload;return Ip.resolveActionByID(t),Ru.publish(Ws.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:s,hideDelete:!a&&n,isDataObject:r,skipReleaseLockRequest:o,isInCreateStage:i}),[]}))),e=>e.pipe(Zp(Wa),UT((()=>LT(100))),$p((e=>{const{actionMgrID:t,context:n,containerName:s,containerItemID:a}=e.payload,r=jr(s,n);return Ip.resolveActionByID(t),Ey(yA(uA,{containerItemID:a,target:r,doDeleteCaseSummary:!1})),[]}))),kT,BT,WT,GT],qT=HT;function zT(){return Vl((function(e,t){e.subscribe(kl(t,dl))}))}const{RESOURCE_TYPES:YT}=$s,KT=[e=>e.pipe(Zp(oa),$p((e=>e.payload)),Jp((e=>!Cf(e.actionMgrID))),Wp((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===gI.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=jr(gI.PREVIEW,e.context),n=Mf(t,gI.PREVIEW,e.context,{buildNew:!0}),s=decodeURI(e.caseId);Ey(eA({...e,context:n,target:t,containerItemID:n,key:s,caseViewMode:Ws.REVIEW_MODE,root:{type:"reference",config:{context:Ws.getProperty(Ws.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}let{restApi:s,reqType:a}=jA("loadView",t);return e.viewContext===YT.PAGE&&({restApi:s,reqType:a}=jA(qa,{page:e.viewName,pageClass:e.pageClass})),ql(td(gm.appendExcludeQueryParamToUrl(s),{method:a,headers:n},e.context)).pipe($p((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:Tf(t.headers),rootView:Ly.getIn(s,Ws.ROOT)}})),ng(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),Wp((async e=>{const t={};if(e?.type===Oa){if(t.actionsOut=xf(e),e?.payload?.context?.includes(gI.PREVIEW)){const n={...yy(e.payload.context),caseInfo:{progress:!1,error:!0}},s=jr(gI.PREVIEW,e.payload.context);t.actionsOut=yA(oA,{key:n.key,target:s,containerName:gI.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||yp.getTargetViewContainerName(qa),r=s?.target??jr(a,e.context);return{target:r,context:s?.context??(t===gI.PREVIEW&&n?e.context:Mf(r,a,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let u={};u=xh(s),u.directUrlUpdation=!1,await Pf(u,n,l);const d={...n,target:i,context:c,containerItemID:r||c,headers:a},p=Of(u,d);if(p.resourceType=YT.CASE,o&&!p.updateData){p.caseViewMode=Ws.REVIEW_MODE;const e=HI(p?.context);((e,t,n,s,a)=>{e&&a===gI.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,yf(n,n),s.actionsOut=yA(oA,{...n,containerName:a})):e?(s.actionsOut=[],s.actionsOut.push(yA(uA,{target:t,containerItemID:e}))):s.actionsOut=yA(eA,{...n,containerName:a})})(SI(e,p.key),e,p,t,o)}else{p.preserveClientChanges=!0,t.actionsOut=[],o===gI.PREVIEW&&t.actionsOut.push({type:mr,payload:{context:c}});const{viewName:e}=n;e===ks.getDefaultQualifiedName("pyCasePreview")&&yf(p,p),((e,t)=>{const n=gm.isObjectCaseType(e.caseClassName);if(e.key&&!n){const n=HI(e?.context);SI(n,e.key)&&t.actionsOut.push(yA(qy,e))}else t.actionsOut.push(yA(qy,e))})(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("pyCasePreview")&&(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:s}),t})),$p((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(Ip.resolveActionByID(n,e),Bs.setNeedsMapping(!1),t)))),e=>{let t=0,n=[];return e.pipe(Zp(ia),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>{Ru.publish($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:s,viewName:a,className:r,skipSemanticUrl:o=!1,containerName:i=yp.getTargetViewContainerName(qa)}=e,c=n&&{...Gu.addDebugHeaders(n)},l=jr(i,s);let u="",d={},p=!0;if(!o&&(u=UA(qa,{page:a,pageClass:r}),l&&u)){const{activate:t,activateContainerActionPayload:n}=Vf(YT.PAGE,l,{semanticURL:u});if(t)return zf(n),qp({type:Va,activateContainerActionPayload:n,actionConfig:e})}if(OI(l)&&({continueExecution:p,removeActionPayload:d}=Ff(l)),!p)return Ip.rejectActionByID(t),tg();const{restApi:g,reqType:h}=jA(qa,{page:a,pageClass:r});return ql(td(g,{method:h,headers:c},s)).pipe($p((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:u,semanticURL:u},actionConfig:e,headers:Tf(t.headers),removeActionPayload:d,skipSemanticUrl:o}})),ng(": Error ocurred during ajax call at showPage Epic : ",e.context))})),Wp((async e=>{const t={};if(t.actionManagerID=e?.actionConfig?.actionMgrID,e&&e.type===Oa)return n.push(xf(e)),t;let{type:s}=e;const{actionConfig:a,skipSemanticUrl:r}=e,o=a.containerName||yp.getTargetViewContainerName(ia),i=jr(o,a.context);Ru.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=SI(s,a.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},r=Va)}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=xh(s,{isCreateDataObject:c});u.directUrlUpdation=!r;const d={acName:i,context:l};await Pf(u,a,d);const p=Of(u,{containerItemID:l,target:i,headers:o,context:l});t.rootView=Ly.getIn(u,Ws.ROOT),n.push(yA(qy,p))}else if(s===Va){const{activateContainerActionPayload:{semanticURL:t,containerItemID:s}}=e,r={acName:i,context:bI(s)};a.isTraditionalRemoteCase||await Pf({directUrlUpdation:!0,semanticURL:t},a,r,!0),n.push(yA(uA,{target:i,containerItemID:s}))}else{const t=Mf(i,o,a.context),{response:s,headers:l={},removeActionPayload:u}=e,d=xh(s,{isCreateDataObject:a.isCreateDataObject});d.directUrlUpdation=!r;const p={acName:i,context:t},g=Af(t);await Pf(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=Of(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=gm.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:nf(gm.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=e.isTraditionalRemoteCase||!1,n.className=t.className)})(a,c,f),f.data??={},f.data.traditionalGadgetId=gm.getUniqueGadgetId();const m=wf(i,f);u.containerItemID&&Lf(m)&&n.push(yA(pA,{containerItemID:u.containerItemID,target:i})),n.push(m),Bf(n)}return Ru.publish($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:i,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),t})),$p((({actionManagerID:e=0,rootView:t})=>{Ip.resolveActionByID(e,t),Ey(n),n=[]})),zT())}],QT=KT,JT=(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}=jA(za,{pageName:s,dataContext:a,dataContextParameters:r}),g={};return g.RemoteSystemID=c,ql(td(u,{method:d,headers:g,body:p},n)).pipe($p((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:Tf(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),ng("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:XT}=$s,ZT=e=>{let t,n=0,s=[];return e.pipe(Zp(ca),HN((e=>(({actionMgrID:n}=e.payload),qp(e.payload).pipe(Wp((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=jr(u,n);let g="",h={},f=!1;if(!o){g=UA(za,{pageName:s,dataViewName:a},r);const{activate:n,activateContainerActionPayload:o}=Vf(XT.PAGE,p,{semanticURL:g});if(n)return qp({type:Va,activateContainerActionPayload:o,actionConfig:e});if(({continueExecution:f,removeActionPayload:h}=Ff(p)),!f)return Ip.rejectActionByID(t),tg()}return JT({context:n,pageName:s,dataContext:a,dataContextParameters:r,semanticURL:g,skipSemanticUrl:o,containerName:u,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:d},{removeActionPayload:h})})(e,n))),Wp((async e=>{if(e&&e.type===Oa)return s.push(xf(e)),s;const{type:n,actionConfig:a,headers:r,response:o,skipSemanticUrl:i}=e;t=Ly.getIn(o,Ws.ROOT);const{containerName:c,parentAction:l,resourceType:u}=a,d=jr(c,a.context);let p;const g=Af(a?.context);if(a.isDeferLoaded){p=xh(o),p.directUrlUpdation=!i;const t={acName:d,context:a.context};await Pf(p,a,t);const n={target:d,headers:r,context:a.context,containerItemID:e.containerItemID},c=Of(p,n);return s=yA(qy,c),s}if(n===Va){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,r={acName:d,context:bI(n)};await Pf({directUrlUpdation:!0,semanticURL:t},a,r,!0),s.push(yA(uA,{target:d,containerItemID:n,resourceType:XT.DATA}))}else if("DATA"===u&&l===_r){const{context:e}=a,t=o?.data,n={context:e,data:t};s.push(yA(qy,n))}else{const t=Mf(d,c,a.context),{removeActionPayload:n}=e;p=xh(o),p.directUrlUpdation=!i;const l={acName:d,context:t};await Pf(p,a,l);const u=Of(p,{target:d,context:t,containerItemID:t,headers:r,currentCaseViewMode:g});u.resourceType=XT.DATA;const h=wf(d,u);n.containerItemID&&Lf(h)&&s.push(yA(pA,{containerItemID:n.containerItemID,target:d})),Bf(s),s.push(h)}return s})),$p((()=>(Ip.resolveActionByID(n,t),Ey(s),s=[],s))))))))},eD=e=>{const{dataViewName:t,context:n,dataViewParameters:s}=e,a={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(s))},{restApi:r,reqType:o}=jA("deleteDataObject",a);return ql(td(r,{method:o},n)).pipe($p((t=>({response:t.data,actionInPayload:e}))),ng("Error occurred during ajax call at deleteDataObject Epic",n))},tD=e=>{let t=0,n=[];return e.pipe(Zp(yr),sg(100),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>eD(e))),Wp((async e=>{if(e&&e.type===Oa){const{payload:s}=e,a=xf({...e,...s,actionMgrID:t});return n.push(a),n}return[]})),$p((()=>(1===n.length&&Zh(n[0].type)?Ip.rejectActionByID(t):Ip.resolveActionByID(t),Ey(n),n=[],n))))},nD=e=>{const{dataViewID:t,dataViewParameters:n,context:s}=e,a={data_view_ID:t},{restApi:r,reqType:o}=jA("getDataObjectActions",a);return ql(td(r,{method:o,body:{dataViewParameters:n}},s)).pipe($p((e=>({...e.data}))),ng("Error occurred during ajax call at GET data object actions : ",e.context))},sD=e=>{let t=0,n=[];let s={};return e.pipe(Zp(Ta),sg(100),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>nD(e))),Wp((async e=>e&&e.type===Oa?(n.push(xf(e)),n):(s=e,[]))),$p((()=>(1===n.length&&Zh(n[0].type)?Ip.rejectActionByID(t):Ip.resolveActionByID(t,s),Ey(n),n=[],n))))},aD=[ZT,e=>{let t=0,n=[];return e.pipe(Zp(Er),sg(100),Bp((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:t}=e.payload),!s){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Ip.rejectActionByID(t,!0,e),qp([])}return qp(e.payload).pipe(Wp((e=>ag(e))),Wp((async e=>{if(e&&e.type===Oa){const{payload:s}=e,a=xf({...e,...s,actionMgrID:t});return n.push(a),{actionsOut:n,data:void 0}}const{actionInPayload:s}=e,{containerItemID:a,isModalAction:r}=s,o=r?gI.MODAL:gI.PRIMARY,i={target:jr(o,a),containerItemID:a,context:a};return n.push(yA(pA,i)),{actionsOut:n,data:e?.response}})),$p((({data:e})=>(1===n.length&&Zh(n[0].type)?Ip.rejectActionByID(t):Ip.resolveActionByID(t,e),Ey(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(Zp(Ar),sg(100),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>rg(e))),Wp((async e=>{if(e&&e.type===Oa){const{payload:s}=e,a=xf({...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=jr(o,s.context),u=Mf(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 Pf(a,s,d);const p=Of(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(yA(eA,p)),n})),$p((()=>(1===n.length&&Zh(n[0].type)?Ip.rejectActionByID(t):Ip.resolveActionByID(t),Ey(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Zp(Cr),sg(100),Bp((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:t}=e.payload),!s){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Ip.rejectActionByID(t,!0,e),qp([])}return qp(e.payload).pipe(Wp((e=>og(e))),Wp((async e=>{if(e&&e.type===Oa){const{payload:s}=e,a=xf({...e,...s,actionMgrID:t});return n.push(a),n}const{actionInPayload:s}=e,{containerItemID:a,isModalAction:r}=s,o=r?gI.MODAL:gI.PRIMARY,i={target:jr(o,a),containerItemID:a,context:a};return n.push(yA(pA,i)),n})),$p((()=>(1===n.length&&Zh(n[0].type)?Ip.rejectActionByID(t):Ip.resolveActionByID(t),Ey(n),n=[],n))))})))},tD,sD,e=>{let t=0,n=[];return e.pipe(Zp(Sr),sg(100),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>ig(e))),Wp((async e=>{if(e&&e.type===Oa){const{payload:s}=e,a=xf({...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=jr(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 Pf(a,s,g);const h=Of(a,p);return n.push(yA(eA,h)),n})),$p((()=>(1===n.length&&Zh(n[0].type)?Ip.rejectActionByID(t):Ip.resolveActionByID(t),Ey(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Zp(_r),sg(100),Bp((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 Ip.rejectActionByID(t,!0,e),qp([])}return yu({context:a,stateObj:yy(a),clearContextMessages:!0}),qp(e.payload).pipe(Wp((e=>cg(e))),Wp((async e=>{if(e&&e.type===Oa){Dm(e,"dataObject");const{payload:s}=e,a=xf({...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=jr(o,s.context),d={acName:u,context:s.context};await Pf(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=Of(n,t);i.resourceType=a||$s.RESOURCE_TYPES.DATA;const c=ta(o);e.push(yA(pA,i));const l=Sy(".dataContext","dataInfo",c),u=Sy(".dataContextParameters","dataInfo",c),d={context:c,skipSemanticUrl:!0,resourceType:a,parentAction:_r,dataContext:l,dataContextParameters:u},p=l&&u&&UA(za,{pageName:Ws.PY_DETAILS,dataViewName:l},u)||"";if(o?.includes(Ws.PREVIEW)){const t={type:ca,payload:{pageName:Ws.VIEW_NAMES.PY_DATA_PREVIEW,container:Ws.PREVIEW,containerName:Ws.PREVIEW,...d}};e.push(t)}else if(a!==Ws.PAGE&&r===p&&o?.includes(Ws.PRIMARY)){const t={type:ca,payload:{pageName:Ws.VIEW_NAMES.PY_DETAILS,containerName:"",...d}};e.push(t)}return e})(n,p,a,{key:l,resourceType:c,containerItemID:i}),n})),$p((()=>(1===n.length&&Zh(n[0].type)?Ip.rejectActionByID(t):Ip.resolveActionByID(t),Ey(n),n=[],n))))})))}],rD=aD;function oD(e,t){return void 0===t&&(t=xT),Vl((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(kl(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:iD,DATA:cD,OBJECT:lD}}=$s;let uD=[],dD=!1,pD=!1;const gD={},hD=[e=>e.pipe(Zp(Da),oD(200),$p((e=>e.payload)),Wp((e=>{pD=!1,Ru.subscribe($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{pD=!0}));const t=vu.getPreviewMode()&&Gu.addDebugHeaders({debugId:Ly.generateUniqueID()});gD.dataContext=e.payload.dataViewName,gD.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"'))),dD=a===Mr,dD&&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(NE.isWSSPortal()&&(l[Ws.X_ORIGIN_CHANNEL]="WSS"),"POST"===s){c=e.payload,r.indexOf("viewType=")<0&&(r=`${r}?viewType=page`);let i;switch($f(a)){case iD:case lD:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case cD:i=gD;break;default:i=c}return ql(td(o,{method:s,body:i,headers:{...l,...t}},n)).pipe($p((t=>({response:{...t.data},payload:e,headers:Tf(t.headers,"",l)}))),ng(": Error occurred during ajax call at historyEpic : ",e))}return ql(td(gm.appendExcludeQueryParamToUrl(o),{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe($p((n=>({response:n.data,payload:e,headers:{...Tf(n.headers),...t}}))),Yl((s=>{if(a===cr){const n={messages:[{type:"error",message:s.response.data.errorDetails[0].localizedValue}],category:"PAGE"};fp.setComponentCache("assignments-launchAssignment-Error",n);const a=pg(AE()),r=_E.getEndPointInfo(a.split("/assignments")[0]),o=un()+r.routeEndpoint;return e={...e,routeKey:Qa,resetSemanticURL:!0},ql(td(o,{method:r.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe($p((n=>({response:n.data,payload:e,headers:{...Tf(n.headers),...t}}))))}return qp(AA(": Error occurred during ajax call at historyEpic : ",s,n))})))})),Wp((async e=>{if(pD)return uD;if(Ru.subscribe($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{pD=!0})),e&&e.type===Oa)return xf(e);const{headers:t={},response:n,payload:s}=e,a=xh(n,{[$s.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),r=s.options.acName,o=UI(r)&&jI(r)?OI(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[Ws.COREHEADER_APP_DEBUG_ID]}};let l=s?.payload?.pageClass;const u=s?.payload?.page,d=dD?Mr:Qa,p=dD?s.payload.objectID:s.payload.workID,g=dD?"{objectID}":"{workID}";let h=dD?`objects/${p}`:"";s?.payload?.caseName&&p&&(h=UA(d,{caseName:e.payload.payload.caseName}),h=h?.replace(g,p)||"",l=s?.payload?.caseClassName),(s?.routeKey===cr||s?.resetSemanticURL)&&((e,t)=>{const n=rf(t);let s=UA(Qa,{caseClassName:sf(t)},{id:n});s=s?.replace("{workID}",String(nf(n))).replace("{id}",String(nf(n))),qA({directUrlUpdation:!0,semanticURL:s,options:{}})})(0,a),((e,t)=>{const n=t?.data?.caseInfo;e===cr&&n?.caseTypeID&&n?.content&&gf(n.caseTypeID)&&(n.content.coexistenceAction=Ja)})(s?.routeKey,a),Ru.publish($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:u,pageClass:l});const f=Ly.getIn(a,Ws.LOCALE_REFERENCES);await OE.loadLocaleResources(f);const m=Ly.getIn(a,Ws.COMPONENTS);m&&await hp(m),Xd(a,s.options.actionConfig,!0),Ru.publish($s.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:r,pageName:u,pageClass:l});let I=Of(a,c);return I=((e,t,n)=>{if(e===Sf.CASE||e===Sf.OBJECT||e===Sf.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:s}=bf(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===Sf.ASSIGNMENT?(n.caseViewMode=Ws.PERFORM_MODE,n.resourceType=Sf.CASE):n.caseViewMode=Ws.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})($f(e.payload.routeKey),{...n.data,semanticURL:h,caseViewMode:Ws.REVIEW_MODE},I),I.data.traditionalGadgetId=gm.getUniqueGadgetId(),uD.push(wf(r,I)),yf(a,c),((e,t)=>{let n=fp.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(yA(dA,n)),fp.resetComponentCache("assignments-launchAssignment-Error"))})(o,uD),Bf(uD),uD})),$p((()=>(pD||Ey(uD),uD=[],dD=!1,pD=!1,uD))),ng("Error occurred"))],fD=hD,mD=[e=>{let t=0;return e.pipe(Zp(dr),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),$p((()=>{const e=Iy()?.getState(),n=E_();return sn(e,n)&&t>0?Ip.resolveActionByID(t,{}):Ip.rejectActionByID(t),[]})),zT())}],ID=[e=>{let t=0,n=[];return e.pipe(Zp(la),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:s}=e;let a,r="";n||(r=UA(Ya,{insightID:"{insightID}"}),r=r.replace("{insightID}",s),a=_E.getEndPointInfo(r));const{restApi:o,reqType:i}=jA(Ya,{...a?.payload||[],insightID:s});return ql(td(o,{method:i},t)).pipe($p((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}})),ng(": Error occurred during ajax call at showPage Epic : ",e.context))})),Wp((async e=>{if(e&&e.type===Oa)return n.push(xf(e)),n;const{actionConfig:t,skipSemanticUrl:s}=e,a=yp.getTargetViewContainerName(ia),r=jr(a,t.context),o=Mf(r,a,t.context),{response:i}=e,c=xh(i);c.directUrlUpdation=!s;const l={acName:r,context:o},u=!s,d=s;await Pf(c,t,l,u,d);const p=Of(c,{target:r,context:o,containerItemID:o});p.resourceType=$s.PAGE;const g=wf(r,p);return n.push(g),Bf(n),n})),$p((()=>{Ip.resolveActionByID(t),Ey(n),n=[]})),zT())}],ED=ID,yD=[e=>{let t=0,n=[];return e.pipe(Zp(ua),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:s}=e;let a="";n||(a=UA(Ka,{dashboardID:s}),a=a.replace("{dashboardID}",s));const{restApi:r,reqType:o}=jA(Ka,{dashboardID:s});return ql(td(r,{method:o},t)).pipe($p((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}})),ng(": Error occurred during ajax call at showPage Epic : ",e.context))})),Wp((async e=>{if(e&&e.type===Oa)return n.push(xf(e)),n;const{actionConfig:t,skipSemanticUrl:s}=e,a=yp.getTargetViewContainerName(ia),r=jr(a,t.context),o=Mf(r,a,t.context),{response:i}=e,c=xh(i);c.directUrlUpdation=!s;const l={acName:r,context:o},u=!s,d=s;await Pf(c,t,l,u,d);const p=Of(c,{target:r,context:o,containerItemID:o});p.resourceType=$s.PAGE;const g=wf(r,p);return n.push(g)})),$p((()=>{Ip.resolveActionByID(t),Ey(n),n=[]})),zT())}],AD=yD,CD=(e,t)=>{const{class:n,context:s,viewType:a=_f.PAGE}=e,{removeActionPayload:r}=t,o=e?.pageName?e?.pageName:NE.getDefaultCasePage();return ql(ep.createCase(n,{...e,pageName:o,viewType:a,context:s})).pipe($p((({response:t,headers:n})=>(Bs.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:r}))),ng("Error occurred during ajax call at createObject Epic : ",s))},SD="CREATE_OBJECT",_D=e=>{let t,n=0,s=[],a={};return e.pipe(Zp(SD),sg(100),Bp((e=>{if(({actionMgrID:n}=e.payload),gm.isExternalObject(e.payload.class)&&!cm(e.payload.context)){const e={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Ip.rejectActionByID(n,!0,e),qp([])}return qp(e.payload).pipe(Wp((e=>{const{context:s}=e;t=e.class;const a=rN(e),r=jr(a,s),{continueExecution:o,removeActionPayload:i}=F_(r);return o?CD(e,{removeActionPayload:i}):(Ip.rejectActionByID(n),tg())})),Wp((async e=>{if(e&&e.type===Oa)return e.payload.context=((e,t)=>gm.isExternalObject(e)&&t?t:oE())(t,e.payload.context),s.push(xf(e)),s;const{actionInPayload:r,response:o,headers:i,removeActionPayload:c}=e,l=lN(r,o);Ly.setIn(o.data,Ws.getProperty(Ws.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const u=rN({...r,isInCreateStage:l}),d=jr(u,r.context),p=Mf(d,u,r.context);if(((e,t)=>{gm.isExternalObject(e.class)&&(e.containerItemID=e.context,H_(t,e))})(r,s),((e,t,n)=>!Jh(e)&&UI(t)&&!gm.isExternalObject(n))(u,d,t)){const{continueExecution:e}=Ff(d);if(!e)return Ip.rejectActionByID(n),tg()}if(((e,t)=>!e&&!t)(r?.openCaseViewAfterCreate??!0,l)){const{businessID:e,caseType:t,resolvedURL:n}=Pp(o);return a={id:e,label:t,href:n},k_(a),B_({caseId:e,caseType:t}),s}(e=>{gm.isExternalObject(e.class)&&k_({content:OE.getLocaleValue("Successfully submitted!","Assignment")})})(r);const g=xh(o),h=String(nf(Np(g)));let f=UA(wr,{caseClassName:_p(g)});f=f.replace(/{.+?}/,h),g.semanticURL=f,fp.setComponentCache(h,Gu.addDebugHeaders(r.debugInfo)),iN(g,r);const m={acName:d,context:p};await Pf(g,r,m);const I={target:d,context:p,headers:i,semanticURL:f,caseViewMode:cN(g),containerItemID:p,isInCreateStage:l,isMinimizable:l,assignmentContext:Ly.getIn(g,L_),nextAssignmentInfo:Ly.getIn(g,M_),resourceType:$s.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:r.openCaseViewAfterCreate,modalOptions:r.modalOptions,debugInfo:r.debugInfo};Tp(I,g);const E=Of(g,I),y=wf(d,E);return((e,t,n)=>{if(Lf(e)){const{removeActionPayload:e,target:s}=t;cf(n,{removeActionPayload:e,target:s})}})(y,{removeActionPayload:c,target:d},s),s.push(y),Bf(s),s})),$p((()=>(Gf(s),pf(s,n),setTimeout((()=>(e=>{gm.isExternalObject(e)&&Bs.setNeedsMapping(!1)})(t))),a={},s=[],s))))})))},ND=(e,t)=>{const{assignmentID:n,actionID:s,caseID:a,context:r,additionalHeaders:o={},jsActionQueryParams:i}=e,{state$:c}=t,l=_f.PAGE,u="executeObjectWideAction",d={assignmentID:n,actionID:s,viewType:l,objectID:a};let{restApi:p}=jA(u,d);const{reqType:g}=jA(u,d);l&&!p?.includes("viewType=")&&(p=p?.includes("?")?`${p}&viewType=${l}`:`${p}?viewType=${l}`),p=Tm(i,p),e.viewType=l;const{content:h}=Df(r,{isObjectWideAction:!0}),f=c.value.data[r]?.objectInfo?.headers||{},{etag:m}=f,I={"if-match":m,...o};return ql(td(p,{method:g,body:h,headers:I},r)).pipe($p((t=>{const{data:n,headers:s}=t;return Bs.analyseResponse(t.data),{actionInPayload:e,response:n,headers:Tf({...I,...s})}})),ng("Error occurred during ajax call at executeObjectWideAction Epic : ",r))},TD=(e,t)=>{const{isCaseWideAction:n}=t;return{isCaseWideAction:n,caseID:Np(e)}},{RESOURCE_TYPES:DD}=$s,OD=(e,t)=>{let n=0,s=[],a={},r="";return e.pipe(Zp(vr),Bp((e=>{if(({actionMgrID:n}=e.payload),r=e.payload.context,yu({context:r,stateObj:yy(r),clearContextMessages:!0}),!cm(r)){const t={type:$s.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Ip.rejectActionByID(n,!0,t),ch.handleDeferredActionCompletion(e.payload.context),qp([])}return qp(e.payload).pipe(Wp((e=>{G_(s,e);const n={...e};return ND(n,{state$:t})})),Wp((async e=>{if(e?.type===Oa){const t=xf(e);return s.push(t),s}Jg.clearContextedCache(r);const{headers:t,actionInPayload:o,response:i}=e,{containerItemID:c,isModalAction:l,isInCreateStage:u}=o,d=HI(c);o.target=d,Ly.setIn(i.data,Ws.OBJECT_INFO_IS_LOCAL_ACTION,!1),RN({submitResponse:i});let p=xh(i,{[$s.STOPMERGEACTIONS]:!i.nextAssignmentInfo});const g=_p(p),h=Ks(o.context),f=wI(h)[0]?OI(wI(h)[0]):h,m=(e=>{const t=Dp(e);return fm(t)&&mm(NE.getOperatorIdentifier(),t)})(p),I=u&&!m;!l||u||Q_(o.context,f)||(p=kf(p,yy(c)));const E=Of(p,{headers:t,actionMgrID:n,directUrlUpdation:!1});((e,t)=>{const{attachmentsExist:n}=t;n&&Ly.setIn(e,$s.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),Ly.setIn(e,$s.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())})(E.data,o),E.caseClassName=g,E.resourceType=DD.ASSIGNMENT,E.headers=t;const y=Np(p);Tp(E,p);const A=UA(wr,{caseClassName:g}).replace(/{.+?}/,String(nf(y)));p.semanticURL=A,E.semanticURL=A,await nN(o,E,!1,y,p,s,e,i,!0),I&&(a=J_(o),B_({caseId:o.caseID,caseType:o.caseTypeID,assignmentId:o.assignmentID})),((e,t)=>{const n=_p(e?.response),s=Dp(e?.response),{caseTypeID:a}=s,r=NE.getFeatureMap();(r?.deferUpdateCaseSummaryView??!Object.hasOwn(r,Ws.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&QE(Ws.CASESUMMARY_VIEW_NAME,a)&&ff(t,e?.actionInPayload,{caseClassName:n})})(e,s),ch.handleDeferredActionCompletion(r),sN(E,o,f);const C=TD(p,o);return rh({...C,containerItemID:c}),Y_(s,{transientItemID:c,target:d,isModalAction:l}),s})),$p((()=>{const e=s.find((e=>e.type===Oa));return e?(ch.handleDeferredActionCompletion(r),aN(e),Ip.rejectActionByID(n)):Ip.resolveActionByID(n,a),Gf(s),Bs.setNeedsMapping(!1),s=[],a={},s})))})))},PD=(e,t)=>{const{insKey:n,headers:s,context:a,debugInfo:r,viewType:o}=e,{removeActionPayload:i}=t,c=e.pageName?e.pageName:Ws.VIEW_NAMES.PY_DETAILS,l=jA(Mr,{objectID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),ql(td(u,{method:d,headers:{...s,...r&&{...Gu.addDebugHeaders(r)}}},a)).pipe($p((t=>(Bs.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:Tf({...s,...t.headers}),removeActionPayload:i}))),ng("Error occurred during ajax call at getObject Epic : ",a))},RD="GET_OBJECT",{RESOURCE_TYPES:bD}=$s,vD=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=Yh(Mr,n),p=jr(d,c);if(Xh(a))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:s},actionInPayload:a,actionInPayload:{context:r,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=Yh(Mr,a),l=jr(c,r),u=bI(s);await Pf({directUrlUpdation:!o,semanticURL:n},a,{acName:l,containerName:c,target:l,context:u}),e.push(yA(uA,{containerItemID:s,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:s,actionInPayload:n});else{const e=Mf(p,d,c,{buildNew:!0}),s=xh(r),a=(e=>{const t=Np(e),n=_p(e);let s=UA(Mr,{objectClassName:n});return s=s?.replace("{objectID}",String(nf(t))),s})(s);s.semanticURL=a,s.directUrlUpdation=!l;const g={acName:p,context:e};await Pf(s,n,g);const h=Of(s,{target:p,context:e,containerItemID:e,semanticURL:a,headers:i,debugInfo:u});h.caseViewMode=Ws.REVIEW_MODE,h.resourceType=bD.OBJECT,Tp(h,s);const f=wf(p,h);o.containerItemID&&Lf(f)&&t.push(yA(pA,{containerItemID:o.containerItemID,target:p})),t.push(f)}Bf(t);const g=n.insKey;oh({caseKey:g,actionInContext:c})},xD=e=>{let t=0,n=[];return e.pipe(Zp(RD),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>{const{context:n,isChild:s,viewType:a}=e,r=Yh(Mr,e),o=jr(r,n);let i,c=!0;if("none"!==a){const e=Ff(o);c=e.continueExecution,i=e.removeActionPayload}if(!c)return Ip.rejectActionByID(t),tg();const{activate:l,activateContainerActionPayload:u}=Vf(bD.OBJECT,o,e);return l&&!s&&"none"!==a?qp({type:Va,activateContainerActionPayload:u,actionInPayload:e}):PD(e,{removeActionPayload:i})})),Wp((async e=>{if(e&&Zh(e.type))return n.push(xf(e)),n;if("none"===e?.actionInPayload?.viewType){const t=yy(e?.actionInPayload?.context);if(t?.context_data?.caseViewMode!==Ws.PERFORM_MODE){const t=xh(e?.response),s={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:mr,payload:{context:s.context,doDeleteConfirmationDetails:!1}}),n.push(yA(qy,s));const a=HI(e?.actionInPayload?.context),r=Kh(e?.actionInPayload?.context),o=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:r});if(Op(e?.actionInPayload?.context)){const t=Of(e?.response,{...o});Wf({...t,isArrayDeepMerge:!0},n)}}}else await vD(e,n);return n})),$p((()=>(Ey(n),pf(n,t),n=[],n))))},wD="OPEN_OBJECT_ACTION",MD=e=>{const{actionID:t,caseID:n,context:s,openActionType:a,modalLoadingContainer:r}=e,o=_f.FORM,i=jA(Lr,{objectID:n,actionID:t,viewType:o}),{reqType:c}=i;let{restApi:l}=i;e.actionType=Ws.RESOURCE_TYPES.OBJECT,l&&!l.includes("viewType=")&&(l=l.includes("?")?`${l}&viewType=${o}`:`${l}?viewType=${o}`);const u=r?.context??s;return ql(td(l,{method:c,headers:{}},u)).pipe($p((t=>(Bs.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:Tf(t.headers)}))),ng(`: Error occurred during ajax call at ${a} Epic : `,u))},LD=async(e,t,{headers:n,actionInPayload:s})=>{const{context:a,actionName:r,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=s,l=xh(e,{info:$s.OBJECT_INFO.OBJECT_INFO}),u=Yh(o,s),d=c?.target??jr(u,a),{context:p,containerItemID:g,isNewContainerItem:h}=((e,t,n,s)=>{let a,r,o=!1;const i=FI(e);return!jI(e)||i&&!CI(e,s)?(r=Qs(t,n),Jh(t)&&(r=ea(n,r)),a=r,o=!0):(a=i?SI(e,s):OI(e),r=bI(a)),{context:r,containerItemID:a,isNewContainerItem:o}})(d,u,a,e.data.objectInfo.ID),f={acName:d,target:d,containerName:u,context:p};await Pf(l,s,f);const m=l.uiResources?.root,I=(e=>e?Ws.PERFORM_MODE:Ws.REVIEW_MODE)(m),E=Of(l,{target:d,context:p,containerItemID:g,caseViewMode:I,doDeleteCaseSummary:i,headers:n,actionName:r,isMinimizable:!1,isInCreateStage:Jh(u),resourceType:$s.RESOURCE_TYPES.OBJECT,isProcessAction:s.isProcessAction,showProgress:s.showProgress,progressMessage:s.progressMessage,actionType:s.actionType});if(m&&Tp(E,l),Jh(u)&&delete E.doDeleteCaseSummary,t.push(yA((e=>e?eA:oA)(h),E)),h||t.push(yA(cA,E)),h){const a=wI(s.contextName),r=SI(a,e.data.objectInfo.ID);if(r){const e={data:{objectInfo:{headers:n}},context:r};t.push(yA(qy,e))}}return g!==OI(d)&&t.push(yA(uA,{target:d,containerItemID:g})),Op(g)&&!c?.context&&Wf(E,t),t},UD=e=>{e.openActionType=Lr;if(Yh(e.openActionType,e)===Ws.MODAL){const t=Yh(e.openActionType,e),n=jr(t,e.context),s=ea(e.context,Qs(t,e.context));return Ey(eA({target:n,context:s,containerItemID:s,key:e.caseID,caseViewMode:Ws.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:Ws.getProperty(Ws.CASE_INFO.CASE_INFO_CONTENT),type:"view"}},data:{key:e.caseID,objectInfo:{ID:e.caseID}}})),Ey(iA({context:s})),e.modalLoadingContainer={target:n,context:s},MD(e)}return MD(e)},FD=e=>{let t=0,n=[];return e.pipe(Zp(wD),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>UD(e))),Wp((async e=>{if(Zh(e.type)){const t=xf(e);n.push(t);const s=yy(e.payload.context);return s?.context_data?.isLoading&&n.push(yA(cA,e.payload)),n}const{actionInPayload:t,headers:s,response:a}=e,{actionID:r}=t;return Ly.setIn(a,"data.objectInfo.activeActionID",r),Ly.setIn(a.data,Ws.getProperty(Ws.OBJECT_INFO_IS_LOCAL_ACTION),!0),t.refreshConditions&&Ly.setIn(a.data,Ws.getProperty(Ws.CASE_INFO_REFRESH_CONDITIONS),t.refreshConditions),await LD(a,n,{headers:s,actionInPayload:t}),KN(t),n})),$p((()=>(Ey(n),pf(n,t),n=[],n))))},jD=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Ws.MODAL:t||yp.getTargetViewContainerName(Ur)},VD=(e,t)=>{const{class:n,context:s,viewType:a=_f.PAGE}=e,{removeActionPayload:r}=t,o=e?.pageName?e?.pageName:NE.getDefaultCasePage();return ql(ep.createCase(n,{...e,pageName:o,viewType:a,context:s,retrieveActionViewForNewObject:!0})).pipe($p((({response:t,headers:n})=>(Bs.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:r}))),ng("Error occurred during ajax call at createObject Epic : ",s))},kD="CREATE_EXTERNAL_OBJECT",BD=e=>{let t=0,n=[];return e.pipe(Zp(kD),sg(100),$p((e=>(({actionMgrID:t}=e.payload),e.payload))),Wp((e=>{const{context:n}=e,s=jD(e),a=jr(s,n),{continueExecution:r,removeActionPayload:o}=F_(a);return r?VD(e,{removeActionPayload:o}):(Ip.rejectActionByID(t),tg())})),Wp((async e=>{if(e&&e.type===Oa)return e.payload.context=oE(),n.push(xf(e)),n;const{actionInPayload:s,response:a,headers:r,removeActionPayload:o}=e,i=lN(s,a);Ly.setIn(a.data,Ws.getProperty(Ws.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const c=jD({...s,isInCreateStage:i}),l=jr(c,s.context),u=Mf(l,c,s.context);if(!Jh(c)&&UI(l)){const{continueExecution:e}=Ff(l);if(!e)return Ip.rejectActionByID(t),tg()}const d=xh(a);let p=UA(Ur,{caseClassName:_p(d)});p=p.replace(/{.+?}/,String(nf(Np(d)))),d.semanticURL=p,iN(d,s);const g={acName:l,context:u};await Pf(d,s,g);const h={target:l,context:u,headers:r,semanticURL:p,caseViewMode:cN(d),containerItemID:u,isInCreateStage:i,isMinimizable:i,assignmentContext:Ly.getIn(d,L_),nextAssignmentInfo:Ly.getIn(d,M_),resourceType:$s.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:s.openCaseViewAfterCreate,modalOptions:s.modalOptions,debugInfo:s.debugInfo,isExternalObjectCreationFlow:!0};Tp(h,d);const f=Of(d,h),m=wf(l,f);return Lf(m)&&cf(n,{removeActionPayload:o,target:l}),n.push(m),Bf(n),n})),$p((()=>(Gf(n),pf(n,t),n=[],n))))},$D=e=>{const{workId:t,context:n,isExternalCase:s}=e,a=s?tr:"deleteWork",{restApi:r,reqType:o}=jA(a,{ID:t});return ql(td(r,{method:o},n)).pipe($p((t=>({response:t.data,actionInPayload:e,headers:Tf(t.headers)}))),ng("Error occurred during ajax call at deleteWork Epic : ",n))},WD=e=>{Ru.publish(Ws.PUB_SUB_EVENTS.WORK_EVENTS.WORK_DELETED,e)},GD=e=>{let t,n=0,s=[];return e.pipe(Zp(Lp),$p((e=>(({actionMgrID:n,caseTypeID:t}=e.payload),e.payload))),Wp((e=>e.ignoreWorkDeletion?qp({actionInPayload:e}):$D(e))),Wp((async e=>{if(e&&Zh(e.type)){const{payload:t}=e,a=xf({...e,...t,actionMgrID:n});return s.push(a),s}const{actionInPayload:t}=e,{context:a}=t;return k_({content:OE.getLocaleValue("Deleted successfully!","Messages")}),a?.includes(Ws.PREVIEW)&&s.push(yA(Zy,$I({context:Ws.APP.APP,name:Ws.PREVIEW}))),a?.includes(Ws.PRIMARY)&&window?.history?.back(),s})),$p((()=>(Ey(s),pf(s,n)===Ws.PROMISE_VALUE.RESOLVE&&WD({caseTypeID:t}),s=[],s))))},HD=((...e)=>(t,n)=>new Ol((s=>{const a=e.map((e=>e(t,n).subscribe(s)));return()=>{a.forEach((e=>e.unsubscribe()))}})))(...R_,...qT,...QT,...fD,...rD,...v_,...mD,...ED,...AD,...[_D,xD,OD,FD,BD,GD]),qD=()=>e=>t=>{const{type:n="",payload:s={}}=t||{},{category:a,context:r,transientItemID:o}=s;"HTTP"!==a&&[ba,ka,va,$a,wa,ja].includes(n)&&(Zf(r||o),pu.removeContextTreeNode(r||o),n!==ba&&n!==va||-1===s?.target?.indexOf("modal")||Ru.publish($s.PUB_SUB_EVENTS.PEGA_EMBED_CUSTOM,n)),e(t)},zD={},YD=e=>{const t=Ly.getIn(zD,[Ws.CONTEXT,e],[]),n=[];t.forEach((t=>{const s=t.substr(0,t.lastIndexOf("_")),a=Ly.getIn(zD,[s,t],[]),r=a&&a.length>0&&a.indexOf(e);if(r>-1&&a.splice(r,1),!a||a&&0===a.length){Ly.deleteIn(zD,[s,t]);const e=Ly.getIn(zD,[s]);e&&0===Object.keys(e).length&&Ly.deleteIn(zD,[s]),n.push({dataPageName:s,dataPageNameWithHash:t})}})),Ly.deleteIn(zD,[Ws.CONTEXT,e]);const s=Ly.getIn(zD,[Ws.CONTEXT]);(!s||s&&0===Object.keys(s).length)&&Ly.deleteIn(zD,[Ws.CONTEXT]),n.length>0&&Ey(SA({dataPagesToBeRemoved:n}))},KD=(e={},t)=>{Object.keys(e).forEach((n=>{const s=Ly.getIn(e,[n],{});Object.keys(s).forEach((e=>{((e,t,n)=>{const s=Ly.getIn(zD,[Ws.CONTEXT,n]);if(Ly.getIn(zD,[e])){const s=Ly.getIn(zD,[e,t],[]);Ly.setIn(zD,[e,t],[...new Set([...s,n])])}else Ly.setIn(zD,[e,t],[n]);s?Ly.setIn(zD,[Ws.CONTEXT,n],[...new Set([...s,t])]):Ly.setIn(zD,[Ws.CONTEXT,n],[t])})(n,e,t)}))}))},QD=()=>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===$a||e===va)&&t.forEach((e=>{YD(e)}))})(a,s),a===ba||a===_a||a===gr){const e=a===gr?t:t.shared;KD(e,n)}else a===$a?(YD(n),KD(t.shared,n)):a===va&&YD(n)})),e(t)},{PUB_SUB_EVENTS:JD}=$s,XD=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===va&&((e,t,n,s,a,r)=>{const{resourceType:o,key:i,context:c}=Ly.getIn(e.getState(),["containers",t,"items",n])||{},l={resourceType:o,key:i,context:c,containerItemID:n,...void 0!==s?{eventName:s}:{}};Ru.publish(JD.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,l),t===`${$s.APP.APP}/${Ws.PRIMARY}`&&r===Ws.CONTAINER_TYPE.MULTIPLE&&Ru.publish(JD.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===$a||e===va)&&t.forEach((e=>{e&&eh.cleanCaches(e)}))})(s,i),s!==$a&&s!==va||!o||eh.cleanCaches(o),t(n)},ZD=(e,t,n,s)=>{e&&t&&(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,e)})({caseId:e,caseClass:n,context:s||""})},eO=e=>{e&&(e=>{Ru.publish(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,e)})({caseId:e})},tO=()=>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===`${Ws.APP.APP}/${Ws.PRIMARY}`)(s)){const t=o?.caseInfo?.ID,n=r||"",s=Sy(Ws.CASE_INFO.CASE_INFO_ID,"",n)||"",i=o?.caseInfo?.caseTypeID||"";e!==$a&&e!==va||eO(s),e!==ba&&e!==$a||ZD(a,!!t,i,n)}}e(t)},nO=()=>e=>t=>{const{payload:{context:n=null,transientItemID:s=null,clearStateMachine:a=!0}={},type:r}=t;n&&(r===ba||r===ka||r===$a||r===va)&&a&&(Rd(n),Od(n)),s&&r===Ua&&(Rd(s),Od(s)),e(t)},sO=(()=>{const e=new Yp;let t=null,n=null;const s=s=>(n=s,t=new Xp(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})(),aO=e=>{if(null!==Iy())return void xy();const t=[lI.propertyChangeMiddleware,qD,QD,nO,sO,tO,XD],n=bS({reducer:y_(e),middleware:e=>e({serializableCheck:!1,thunk:!1}).concat(t),enhancers:e=>e().prepend(LS).concat(LS)});sO.run(HD),my(n)};class rO{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)=>{Ey({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===NE.getOperatorIdentifier())return;const r={ID:s,state:a},o=Sy(Ws.CASE_INFO.CASE_INFO_COLLABORATORS,"",e)||[],i=o.findIndex((e=>e.ID===s));if(-1!==i)"closed"===a?this.dispatchCollaboratorAction("DELETE",e,i,Ws.CASE_INFO.CASE_INFO_COLLABORATORS,null):this.dispatchCollaboratorAction("REPLACE",e,null,`${Ws.CASE_INFO.CASE_INFO_COLLABORATORS}[${i}]`,r);else{if("closed"===a)return;this.dispatchCollaboratorAction("INSERT",e,o.length,Ws.CASE_INFO.CASE_INFO_COLLABORATORS,r)}}static subscribeToCollaborators(e,t){const n=Ug.subscribe({matcher:"CASE_COLLABORATOR",criteria:{caseId:e}},(e=>this.handleCaseCollaboratorsUpdate(t,e)));this.caseCollabSubIds[e]=n}static unsubscribeToCollaborators(e){Ug.unsubscribe(this.caseCollabSubIds[e]),delete this.caseCollabSubIds[e]}static publishCaseEvent(e,t){Ug.publishMessage({filter:{matcher:"CASE_COLLABORATOR",criteria:{caseId:t}},message:e})}static subscribeToEvent(e,t,n){let s=null;if(e===Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN||e===Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE?s=e=>this.publishCaseEvent(t,e):e===Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?s=e=>{const{caseId:t,context:n}=e;this.caseCollabSubIds[t]||this.subscribeToCollaborators(t,n)}:e===Ws.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}`);Ru.subscribe(e,s,n)}static unsubscribeFromEvent(e,t){Ru.unsubscribe(e,t)}static subscribeToCaseEvents(){rO.collabConfig?.appEnabled&&rO.collabConfig?.portalEnabled&&(this.subscribeToEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,this.VIEW_OPEN,"case_view_open"),this.subscribeToEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,this.VIEW_CLOSE,"case_view_close"),this.subscribeToEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,this.EDIT_OPEN,"case_edit_open"),this.subscribeToEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,this.EDIT_CLOSE,"case_edit_close"))}static unsubscribeToCaseEvents(){rO.collabConfig?.appEnabled&&rO.collabConfig?.portalEnabled&&(this.unsubscribeFromEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_view_open"),this.unsubscribeFromEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_view_close"),this.unsubscribeFromEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,"case_edit_open"),this.unsubscribeFromEvent(Ws.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,"case_edit_close"))}}const oO=rO;const iO=new class{#E(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}#y(e,t,n){const s={},a={};let r=!1;return Array.isArray(e)&&e.forEach((e=>{const o=t[e.Key];this.#E(e,o,n,s,a)&&(r=!0)})),{urlParams:s,headerMap:a,isPortalChanged:r}}#A(e){const t=fp.getComponentCache("lastActionID");return Mg.truncateNamespace(e)===Mg.truncateNamespace("string"==typeof t?t:(t??"").toString())}#C({message:e}){const{RequestContext:t,ActionName:n}=e;if(!this.#A(n))return;const s=JSON.parse(t),a=NE.environmentInfoObject?.requestContext,r=new URL(window.location.href).searchParams.get("portal"),{urlParams:o,headerMap:i,isPortalChanged:c}=this.#y(a,s,r);fp.setURLParams(o),Object.entries(i).forEach((([e,t])=>{Gu.registerHeader(e,t.join("; "))})),fp.setComponentCache("lastActionID",""),c&&globalThis.location.reload()}subscribeToGlobalEvents(){const e=Ly.generateUniqueID(),t={matcher:"SWITCH_REQUEST_CONTEXT",criteria:{UserID:NE.getOperatorIdentifier()||""}};Ug.subscribe(t,this.#C.bind(this),void 0,e)}},cO={publishConstellationLoadedEvent:()=>{Ru.publish(Ws.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const lO=new class{activateContainerItemOnSwitch(e){const t=`${Ws.APP.APP}/${Ws.PRIMARY}`,n={target:t,containerItemID:SI(t,e)};Hh({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${Ws.APP.APP}/${Ws.PRIMARY}`,n={target:t,containerItemID:SI(t,e)};Hh({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=Hh({meta:{type:"PreviewViewContainer",config:{name:Ws.PREVIEW}},options:{context:Ws.APP.APP,target:"root/hybrid_preview"}});n.getPConnect().getContainerManager().resetContainers({name:Ws.PRIMARY,context:Ws.APP.APP}),TI(Ws.APP.APP,Ws.PREVIEW)||n.getPConnect().getContainerManager().initializeContainers({type:"multiple",name:Ws.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){Hh({}).getPConnect().getContainerManager().resetContainers({name:Ws.PREVIEW,context:Ws.APP.APP})}isFormDirty(e){const t=`${Ws.APP.APP}/${Ws.PRIMARY}`,n=lE(t,e);return Kf.isStateModified(n)}getEventUtils(){return cO}getBroadcastUtils(){return w_}isTraditionalUICase(e){return gf(e)}};const uO=class{static openCase(e,t=$s.APP.APP,n={}){return n.renderInline=!0,n.pageName?(NE.setDefaultCasePage(ks.getDefaultQualifiedName(n.pageName)),n.pageName=ks.getDefaultQualifiedName(n.pageName)):(NE.setDefaultCasePage(ks.getDefaultQualifiedName(Ws.PY_DETAILS)),n.pageName=ks.getDefaultQualifiedName(Ws.PY_DETAILS)),n?.disableAssignmentHeader?NE.disableAssignmentHeader(n.disableAssignmentHeader):NE.disableAssignmentHeader(!1),xg.openCase(e,t,Ws.PRIMARY,n)}static createCase(e,t=$s.APP.APP,n={}){return n.renderInline=!0,n.pageName?(NE.setDefaultCasePage(ks.getDefaultQualifiedName(n.pageName)),n.pageName=ks.getDefaultQualifiedName(n.pageName)):(NE.setDefaultCasePage(ks.getDefaultQualifiedName(Ws.PY_DETAILS)),n.pageName=ks.getDefaultQualifiedName(Ws.PY_DETAILS)),n?.disableAssignmentHeader?NE.disableAssignmentHeader(n.disableAssignmentHeader):NE.disableAssignmentHeader(!1),xg.createCase(e,t,Ws.PRIMARY,n)}static getNextWork(e=$s.APP.APP,t={}){return t.renderInline=!0,t.pageName?(NE.setDefaultCasePage(ks.getDefaultQualifiedName(t.pageName)),t.pageName=ks.getDefaultQualifiedName(t.pageName)):(NE.setDefaultCasePage(ks.getDefaultQualifiedName(Ws.PY_DETAILS)),t.pageName=ks.getDefaultQualifiedName(Ws.PY_DETAILS)),t?.disableAssignmentHeader?NE.disableAssignmentHeader(t.disableAssignmentHeader):NE.disableAssignmentHeader(!1),xg.getNextWork(e,Ws.PRIMARY,t)}static openAssignment(e,t=$s.APP.APP,n={}){return n.renderInline=!0,n.pageName?(NE.setDefaultCasePage(ks.getDefaultQualifiedName(n.pageName)),n.pageName=ks.getDefaultQualifiedName(n.pageName)):(NE.setDefaultCasePage(ks.getDefaultQualifiedName(Ws.PY_DETAILS)),n.pageName=ks.getDefaultQualifiedName(Ws.PY_DETAILS)),n?.disableAssignmentHeader?NE.disableAssignmentHeader(n.disableAssignmentHeader):NE.disableAssignmentHeader(!1),xg.openAssignment(e,t,Ws.PRIMARY,n)}static openPage(e,t,n=$s.APP.APP,s={}){const a=ia;s?.defaultCasePage?(NE.setDefaultCasePage(ks.getDefaultQualifiedName(s.defaultCasePage)),s.defaultCasePage=ks.getDefaultQualifiedName(s.defaultCasePage)):NE.setDefaultCasePage(ks.getDefaultQualifiedName(Ws.PY_DETAILS)),s?.disableAssignmentHeader?NE.disableAssignmentHeader(s.disableAssignmentHeader):NE.disableAssignmentHeader(!1);const r={viewName:e,className:t,acTargetName:Ws.PRIMARY,actionMgrID:Ip.getNextActionMgrId(),context:n},{promise:o}=Ip.actionManagerPromise(a,r.actionMgrID);return Ey({type:a,payload:{...r}}),o}static getCurrentContextAPI(e,t=$s.APP.APP){return Hh({meta:{config:{}},options:{context:t,pageReference:e,containerName:Ws.PRIMARY}}).getPConnect()}};function dO(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 pO=new class{gadgetName="";resize=!1;boundOnMessage=this.onMessage.bind(this);init(e){const{resizing:t}=e;this.gadgetName=window.name,this.resize="stretch"===t;const n=document.getElementsByTagName("app-root")[0];n.classList.add("mashup"),window.parent!==window&&this.resize&&this._registerResizeObserver(n)}send(e){const{action:t,message:n}=e,s=JSON.stringify({gadgetName:this.gadgetName,action:t,message:n});window.parent.postMessage(s,"*")}_registerResizeObserver(e){new ResizeObserver((e=>{for(const t of e){const e=dO(t);this.send({action:"resize",message:e})}})).observe(e)}_updateUrl(e){window.history.pushState({},"home",e),PCore.configureForBrowserBookmark({semanticURL:"",context:Ws.APP.ROOT,acName:"primary"})}onMessage(e){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",pO.getMessageHandler(),!1);const gO={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},hO={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary",contextName:"app"},children:[]}]},fO="portal-less-styles";const mO=new class{createC11nEnv=e=>Hh(e);getContextUtils=()=>o;getRoutingManager=()=>i;getComponentsRegistry=()=>Ao;getStateManager=()=>f;getActionCreators=()=>m;getStreamObservable=()=>u;getActionProcessor=()=>$y;getActionHandler=()=>By;renderApp=(e,t)=>{const n={context:Ws.APP.APP},s={...Ly.getIn(e,Ws.ROOT),options:n};aO(e),Xd(e,n,!0);const a=this.createC11nEnv({meta:s,isRoot:!0});Ru.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=Ly.getIn(a,Ws.CONTEXT_DATA),i=xh(e);await Pf(i,{},{},!1,!0);const c={...s,[Ws.CONTEXT_DATA]:o};zI(r,t,c,n)};fetchEndPointResource=(e,t,n)=>{td(e,{method:"GET"},Ws.APP.ROOT).then((e=>{200===e.status&&this.updateStoreWithUiRoot(e.data,t,n)}))};loadComponent=async(e,t,n)=>{await hp(n);const s=this.createC11nEnv({meta:e,isRoot:!0});Iy()||aO({}),Ru.publish($s.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:s,domContainerID:t})};setStaticServerUrl=(e,t,n)=>{dp.initServer(e,t,n)};loadView=async(e,t,n=[])=>{cn();const s=xh(e),a=Ly.getIn(s,Ws.VIEWS),r=Ly.getIn(s,Ws.NAVIGATIONS),o=Ly.getIn(s,Ws.COMPONENTS)||[];o.push(...n);const i=Ly.getIn(s,Ws.STATIC_SERVER_URL),c=Ly.getIn(s,Ws.APPLICATION_DATA);a&&qE(a),r&&zE(r),(e=>{e&&(xA=e.pyLabel)})(c),i&&dp.initServer(i),await hp(o,i),this.renderApp(s,t)};initAppShell=(e,t,n)=>{XA(e),yp.buildActionTargetMap(t),cn(n)};initRoutingTable=(e,t)=>{XA(e,!0),cn(t)};setAppAlias=e=>{dp.setAppAlias(e)};getHomeRestApi=e=>{const t=un(),{restApi:n}=FA("home",{portalName:e});return`${t}${n}`};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(QA()&&!t){const t=yE(),s=_E.processUrl(t,!0),a=_E._getMatchedRouteInRoutingTable(s)||"",r=_E.getRoutingInfo(),o=_E.processUrl(t,!1).split("/"),i=o[o.length-1],c=r?.routes?.[a]?.payload?.caseID?.replace("{workID}",i).replace("{id}",i);n=_E.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=_E.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(Iy()||aO({}),r){const e=`${Ws.APP.ROOT}/${i}`;sE(e),nE().deleteContainerItem(e)}(nE().getContainerItems()||[]).length>1&&!i?.startsWith("hybrid_")&&"authoring-preview"!==i&&xy(),Ey(qy({data:{},context:Ws.APP.ROOT}));const c=this.createC11nEnv({meta:t,options:{context:Ws.APP.ROOT,pageReference:"",target:`${Ws.APP.ROOT}/${i}`}}),l=c.getPConnect(),u=`${l.getContextName()}/${l.getContainerName()}`;OI(u)||"noPortal"===o?.renderingMode||l.getContainerManager().initializeContainers({type:"single"});const d=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference","URL",...n];await hp(d),Ru.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=>{JA(e)};checkIfSemanticURL=()=>QA();onPCoreReady=e=>{Ru.subscribe($s.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{Ru.subscribe($s.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{kd.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{pn(e)};setFetchDefaultHeaders=e=>{od(e)};setFetchAuthInfo=e=>{id(e)};getCaseApi=()=>xg;getMashupApi=()=>uO;enableAppRouting=e=>{MA(e)};initStore=()=>aO({});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 td(`${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=Hh({meta:gO,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(fO)){const e=document.createElement("style");e.id=fO,e.textContent="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",n.appendChild(e)}}await this.loadRootComponent(e,gO,[Ws.LOAD_VIEW_STRING,"ViewContainer"]),globalThis.parent!==globalThis&&pO.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)&&("OAuth2.0"===m.authType&&(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;const T=i||_.serviceConfig.staticContentServer;if(_.isSdk?(_.enableRouting=h,_.dynamicSemanticUrl=_.enableRouting,dp.initServer(i,"no-appstatic")):(_.serviceConfig.staticContentServer=T,_.serviceConfig.appStaticContentServer=_.serviceConfig.appStaticContentServer||"no-appstatic",dp.initServer(T,T)),"EMBED"===_.renderingMode&&m?.authentication_service&&"pega"!==m.authentication_service&&(_.routingInfo||(_.routingInfo={}),_.routingInfo.authServiceAlias=m.authentication_service),await NO.initCoreConfig(_),o&&Ru.subscribe($s.PUB_SUB_EVENTS.EVENT_RENDER_APP,o,"renderAppCallback"),"LAUNCHPAD"===_.envType&&"EMBED"===_.renderingMode&&NE.setIsWebEmbed(!0),m&&["OAuth2.0","custom"].includes(m?.authType)&&this.setFetchAuthInfo(m),!r){const e=NE.environmentInfoObject?.pyInfinityStaticService;let r=null;if(e){const e=await jg.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)};Ru.subscribe("component-map-loaded",t),"ReactRoot"in Ao.getLazyMap()&&e(!0)}catch(e){t(e)}}));await o,NO.initCoreContainers(),await this.loadRootContainerWithHybrid(t,n,s,a),r&&await Promise.all(r.map((({pyComponentMap:e,pxUpdateDateTime:t})=>dp.importCustomComponentMap(e,t))))}};loadRootContainerWithHybrid=(e,t=[],n,s)=>(t.push(Ws.CONTAINER_TYPE?.HYBRID||"HybridViewContainer",Ws.LOAD_VIEW_STRING),this.loadRootComponent(e,hO,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 Ao.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 dp.initServer(o,"no-appstatic"),await NO.init(f),c&&["OAuth2.0","custom"].includes(c?.authType)&&this.setFetchAuthInfo(c),this.getBootstrapConfigViaSB(t?`${a}/${t}`:`${a}`,n,s)}};const IO=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 EO=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 IO(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false",this.storePercentageAsDecimal=e.storeC11nPercentageAsDecimal??!1,this.collab=e.collab,this.requestContext=e.requestContext,this.pzencv1zzz=e.pzencv1zzz}},yO=new Set([200,201]),AO=async e=>{const t=((e,t,n)=>{if(e&&t?.includes(e))return[np("getLocalizationPack",{queryPayload:{locale:e}})];const s=n.length;if(0===s)return null;const a=[];for(let e=0;e<s;e+=1){const t=n[e];a[e]=np("getLocalizationPack",{queryPayload:{version:t.pyBundleVersion,bundle:t.pyBundleName}})}return a})(e,NE.getAvailableLocalePacks(),NE.getLocalizationBundles());if(!t)return;const n=await Promise.allSettled(t),s=NE.getLocale()??"en-US",a=WE(s),r=n.length;for(let e=0;e<r;e+=1){const t=n[e];if("fulfilled"===t.status){const e=t.value;if(yO.has(e.status)&&e.data){const t=e.data,n=Object.keys(t),s=n.length;for(let e=0;e<s;e+=1){const s=n[e],r=t[s];OE.setLocaleForRule(r,s),a.setLocaleForRule(r,s)}}}}},CO=async()=>{const e=NE.getLocale();try{await AO(e)}catch(e){console.warn(e)}},SO="@P .viewConfig";let _O=0;const NO=new class{async init(e){const t=new EO(e);MA(t.enableRouting),aO({}),kd.updateFieldDefaults(t.fieldDefaults),kd.setFieldDefault("Percentage","storePercentageAsDecimal",t.storePercentageAsDecimal),this.#S(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl});const{appAliasWithoutServlet:n,appAlias:s,googleMapKey:a,staticContentServer:r,appStaticContentServer:o}=t.serviceConfig;dp.setAppAlias(n||s),pn(a),dp.initServer(r,o,t.tokens.C11NB2S),OE.setTimezone(t.timezone),qs.setRemoteCaseMapping(t.remoteCaseMapping),oO.init(t.collab),oO.subscribeToCaseEvents(),Mg.subscribeToCaseEvents(),Ug.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),t.initBroadcast&&lO.getBroadcastUtils().init(),Gu.setDefaultHeaders(t.additionalHeaders),Gu.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=Ph(Dh,t))})),i.features?.isNamespaceEnabled&&(t.additionalHeaders.Prefer="namespaced",Gu.setDefaultHeaders(t.additionalHeaders)),t.theme){const e=t.theme,n=e.light,s=e.dark;void 0!==n&&void 0!==s?(this.#_(n),this.#_(s,{type:"dark"})):NE.setTheme(e)}NE.setCookieComplianceMethod(t.cookieComplianceMethod),NE.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),NE.setEnvironmentInfo(i),NE.setLocale(t.locale||navigator.language||"en-US"),fp.init(),"Infinity"!==t.envType&&iO.subscribeToGlobalEvents(),t.initBroadcast&&lO.getBroadcastUtils().init(),await CO()}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=Hh({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 mO.getComponentsRegistry().getComponent("ReactRoot")?.modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{await((e,t="true")=>new Promise(((n,s)=>{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;let i=null,c=null,l=null;if(e){const t=(e.startsWith("/")?e.substring(1):e).split("/");i=t[0]||null,c=t[1]||null,"assignments"===t[2]&&t[3]&&(l=t[3])}const u=[s];i&&u.push(i),c&&u.push(c),l&&u.push("assignments",l),o&&(r.has("noPortal")||r.append("noPortal","true"),c&&a&&r.append("view",a));const d=r.toString();return u.join("/")+(d?`?${d}`:"")};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,!0===d){const e=this.buildSemanticUrl(s,a,r,y,i);!o&&e&&window.history.pushState({},"home",e)}else if("HYBRID"!==p){const e=I.href,t=e.indexOf("?");t>0&&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.protocol}//${I.host}`;if("EMBED"===p)try{S=new URL(e.restServerConfig).origin}catch{}const _={...t,domain:S,searchParams:I.search};e.routingInfo=_,e.initBroadcast="true"===NE.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),h?.cspNonce&&(window.__webpack_nonce__=h.cspNonce),await this.init(e)};launchViewByName=async(e,t,n,s,a,r,o,i,c=[])=>{_O+=1;const l=i||`mashup${_O}`,u={type:"RootContainer",config:{viewConfig:SO,renderingMode:"view",name:l}};await mO.loadRootComponent(e,u,a,r,o),await this.loadCustomComponentLibrariesIfEnabled(c),mO.loadViewByName(t,n,s,l)};launchView=(e,t,n=[],s,a,r,o)=>{let i;_O+=1,i="hybrid"===o?`hybrid_${_O}`:o||`mashup${_O}`;const c={type:"RootContainer",config:{viewConfig:SO,renderingMode:"portal",name:i}};o===Ws.HYBRID&&sh.setRuntimeParam(Ws.HYRBID_ROOT_CONTAINERNAME,i),sh.setRuntimeParams(s),mO.loadRootComponent(e,c,n,a,r).then((()=>mO.updateStoreWithUiRoot(t,i,!1)))};launchPortal=async(e,t,n=`portal${_O+=1}`,s=[],a=[])=>{const r="LoadingComponent",o={type:"RootContainer",config:{viewConfig:SO,renderingMode:"portal",skeleton:r,name:n}},i=[...s,r];NE.isPortalLoaded=!0;try{return await mO.loadRootComponent(e,o,i),await this.loadCustomComponentLibrariesIfEnabled(a),mO.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 mO.loadRootComponent(e,s,[Ws.LOAD_VIEW_STRING,"ViewContainer"]),await this.loadCustomComponentLibrariesIfEnabled(n)})(),window.parent!==window){const e=dp.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)}))}),Ws.PRIORITY.TRIVIAL)}};loadDataPagesIntoEnvironmentInfo=async e=>{if(!e?.length)return;const t=NE.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 jg.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&&NE.setEnvironmentInfo(t)};#N(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.#N(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=NE.environmentInfoObject?.pyC11nDXCBDevURL,c="true"===r&&"other"!==o,l=async()=>{await this.importReactRoot();const e=[];i?e.push(dp.importCustomComponentMap("")):s&&e.push(dp.importCustomComponentMap(s)),c&&e.push(this.importDesignSystemComponentMap(n,a,o)),e.length&&await Promise.all(e),t?.()},u=mO.getComponentsRegistry();if("ReactRoot"in u.getLazyMap())return!0;return u.getComponent("ReactRoot")?(await l(),!0):new Promise((e=>{Ru.subscribeOnce("component-map-loaded",(async()=>{await l(),Ru.unsubscribe("component-map-loaded","component-map-loaded-id"),e(!0)}),"component-map-loaded-id")}))};registerForDebugInfo=e=>{if(NE.setPreviewMode(),!e)return;const t=({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];n&&e.postMessage({appDebugID:n})};Ru.subscribe("fetchSuccess",t,"fetchSuccess"),Ru.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;NE.setBrandingInfo(n),NE.setTheme(s)}catch{NE.setBrandingInfo({}),NE.setTheme({})}if(e.darkTheme&&!t){const t={type:"dark"};try{const n=JSON.parse(e.darkTheme.definition);NE.setBrandingInfo(n.Branding,t),NE.setTheme(n.Theme,t)}catch{NE.setBrandingInfo({},t),NE.setTheme(void 0,t)}}e.keyMapping&&NE.setKeyMapping(e.keyMapping),NE.setCookieComplianceMethod(e.cookieComplianceMethod??"none")};async loadCustomComponentLibrariesIfEnabled(e){e?.length>0&&NE.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?dp.importCustomComponentMap(e.pyComponentMap,e.pxUpdateDateTime):dp.importCustomComponentMap(e)}#S(e,t,n){XA(e),yp.buildActionTargetMap(t),cn(n)}#_(e,t){if(null===e)return;if("object"==typeof e)return void NE.setTheme(e,t);let n;try{n=JSON.parse(e)}catch{return void NE.setTheme("dark"===t?.type?void 0:{},t)}NE.setTheme(n,t)}},TO={createViewRule:(e,t)=>{const{restApi:n,reqType:s}=jA("createViewRuleByID");return td(n,{method:s,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:s}=jA("getViewRuleByID",{ID:e});return td(n,{method:s},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:s,reqType:a}=jA("updateViewRuleByID",{ID:e});return td(s,{method:a,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:s}=jA("deleteViewRuleByID",{ID:e});return td(n,{method:s},t).then((e=>e.data))},getCalculatedFields:(e,t,n)=>{const{restApi:s,reqType:a}=jA("getCalculatedFieldsInViewByID",{caseID:e,viewID:t});return td(s,{method:a,body:{calculations:{fields:n}}}).then((e=>e.data))}},DO={"Content-Type":"application/json"},OO={addCaseFollower:(e,t,n)=>{const s={caseID:e},a=JSON.stringify({users:t.map((e=>({ID:e})))});return np("addCaseFollower",{body:a,queryPayload:s,headers:DO},n)},deleteCaseFollower:(e,t,n)=>np("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>np("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},PO={addRelatedCases:(e,t,n)=>{const s={caseID:e},a=JSON.stringify({cases:t});return np("addRelatedCases",{body:a,queryPayload:s},n)},removeRelatedCase:(e,t,n)=>np("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>np("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},RO="operatorDetails",bO={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=jA(RO,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return np(RO,{queryPayload:t})}return t?np("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):np(RO,{body:{dataViewParameters:{ID:e}}})}},vO="postCustomFeedMessages",xO={"Content-Type":"application/json"};const wO=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: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=rp();return a.push(d),np("getFeedMessages",{queryPayload:u,cancelTokenSource:d},r.getContextName()).then((async t=>{if(200===t.status&&t.data){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 wh({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 s=r.getValue("pulse.messageIDs"),a=r.getValue("pulse.messages");s=[...s,...n],a={...a,...c},Object.values(a).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)}))})),r.updateState({pulse:{messages:a,messageIDs:s,nextPageFirstEntry:t?.data?.nextPageFirstEntry||"",pageLastEntry:t?.data?.pageLastEntry||"",hideAttachment:t?.data?.hideAttachment||!1,postTypes:u,pulseContext:e}})}else r.updateState({pulse:{messages:c,messageIDs:n,nextPageFirstEntry:t?.data?.nextPageFirstEntry||"",pageLastEntry:t?.data?.pageLastEntry||"",hideAttachment:t?.data?.hideAttachment||!1,postTypes:u,pulseContext:e}});const d=[...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:d}}return r.reportError(`getFeeds call failed ${t.status}`,t.data),""})).catch((e=>{op(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:xO}:{body:JSON.stringify(o),queryPayload:{type:"PegaSocial-Post-Private"},headers:xO};return np(r.length?vO:"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)=>np(vO,{body:t,queryPayload:{type:e},headers:xO},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};Mh(s.messageViewReference,n,t.context)||await wh({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 np("editFeedMessage",{queryPayload:{messageID:e},body:o,headers:xO},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});np(r,{body:o,queryPayload:{pulseContext:e},headers:xO},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);np("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)=>np("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=rp();return this.mentionsTagsCancelTokenSource.push(i),np("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=>{op(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>np("getMentionTypes",{},e.getContextName());getPostTypeView=(e,t)=>np("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=rp();return this.mentionsTagsCancelTokenSource.push(r),np("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=>{op(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},MO={getTaggedCases:(e,t)=>{const n={caseID:e,viewID:ks.getDefaultQualifiedName("pyTaggedCases")};return np("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)=>np("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 np("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)=>np("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 jg.getPageDataAsync(t,e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))}},LO=(e,t)=>{aE(t.getContextName(),e.etag),rE(t.getContextName(),e.etag)},UO={getParticipants:(e,t)=>np("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)=>np("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)=>np("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)=>np("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)=>{np("createParticipant",{body:o,queryPayload:r,headers:i},s.getContextName()).then((t=>{LO(t.headers,s),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=um(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)=>{np("updateParticipant",{body:n,queryPayload:r,headers:o},s.getContextName()).then((t=>{LO(t.headers,s),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=um(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)=>{np("deleteParticipant",{queryPayload:s,headers:a},n.getContextName()).then((t=>{LO(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function FO(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const jO="create",VO="update",kO="delete";function BO(e,t,n,s){const a=ZE(t);if(a){switch(e){case jO:case VO:{const{markAsDefault:e,...t}=s;Object.entries(t).length>0&&(a.allPersonalizations[n]=t),e&&(a.defaultPersonalization=n);break}case kO:delete a.allPersonalizations[n],a.defaultPersonalization===n&&(a.defaultPersonalization="");break;default:return null}return a}return null}const $O={},WO=async e=>{const t=ZE(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=FO(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:s}=jA("getUIListPersonalizations",{listID:e});return td(n,{method:s,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:FO(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},GO=async(e,t,n)=>{const{restApi:s,reqType:a}=jA("createListPersonalization",{listID:e});return BO(jO,e,t,n),td(s,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return $O[t]=n,e}))},HO=async(e,t,n)=>{const s=$O[t]||t;BO(VO,e,t,n);const{restApi:a,reqType:r}=jA("updateListPersonalization",{listID:e,personalizationID:s})||{};return td(a,{method:r,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},qO=async(e,t)=>{const n=$O[t]||t;BO(kO,e,t);const{restApi:s,reqType:a}=jA("deleteListPersonalization",{listID:e,personalizationID:n});return td(s,{method:a,body:{}}).then((e=>($O[t]&&delete $O[t],e)))};const zO=function(e){return e?{createPersonalization:GO.bind(null,e),updatePersonalization:HO.bind(null,e),deletePersonalization:qO.bind(null,e),fetchPersonalizations:WO.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},YO="getDataObjects",KO="getInsightByID",QO=["LocalList","RemoteList","PromptList","DataPage"];let JO=null;const XO=[];const ZO={},eP=e=>dg.getAppCacheKey(`PrimaryFields-${e}`);function tP(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 nP({data:e}){const t=(e,t)=>Ph("FIELD",e,t),n=Ph("CASE",e.classID);if(e.classNameLocaleReference=n,e.fields&&e.fields.length>0)for(let s=0;s<e.fields.length;s+=1){const a=e.fields[s],r={nameLocaleReference:"INSIGHTS",categoryLocaleReference:"INSIGHTS",parentCategoryLocaleReference:"INSIGHTS"};if(a.definedOnClassIDs){const e=a.definedOnClassIDs.split(":").reverse(),s=a.fieldID.split("!").pop()?.split(":").reverse()||[];e[0]&&s[0]&&(r.nameLocaleReference=t(s[0],e[0])),e[1]&&s[1]&&(r.categoryLocaleReference=t(s[1],e[1])),e[2]&&s[2]?r.parentCategoryLocaleReference=t(s[2],e[2]):a.parentCategory&&(r.parentCategoryLocaleReference=n)}Object.assign(a,r)}return{data:e}}const sP={getDataObjects:function(){const e=dg.getAppCacheKey(YO);if(window.sessionStorage.getItem(e))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(e)}`));const{restApi:t,reqType:n}=jA(YO,{}),s=td(t,{method:n});return s.then((t=>{window.sessionStorage.setItem(e,JSON.stringify(t))})),s},getDataPageObjects:function(e=!0){if(JO)return JO;const t=dg.getAppCacheKey("getDataPageObjects");if(e&&window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(t)}`));const{restApi:n,reqType:s}=jA("getDataPages",{datapageRequestType:"explorable"});return JO=td(n,{method:s,datapageRequestType:"explorable"}),JO.then((e=>{JO=null,window.sessionStorage.setItem(t,JSON.stringify(e))})),JO},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=XE(e);if(t&&t.classID){let e=ty(t.classID);const n=t.rdFields?.fields?.filter((e=>e.indexOf(".")>0));if(n&&!Ly.isEmpty(n)){const s=n.reduce(((e,n)=>{const s=HE(n,t.classID);return e[n]=s,e}),{});e={...e,...s}}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&&QO.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=nP({data:{...t,fields:Object.entries(n).map((e=>({...e[1],fieldID:e[0],fieldType:e[1].fieldType||(e[1].isUserReference?"User reference":void 0),category:tP(e),classID:e[1].associationClassID?e[1].associationClassID:e[1].classID})))}});return Promise.resolve(e)}}const s={dataSource:e,columns:[],parameters:{},associationFilter:n,matchPosition:"",ignoreCase:!1};return Jg.init(s).then((({dataSourceMetaData:e})=>{const t=nP({data:e});return Promise.resolve(t)}))},getDefaultColumns:function(e){const t=dg.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(t)}`));const n={dataViewName:ks.getDefaultQualifiedName("D_pzGetDefaultColumns")},{restApi:s,reqType:a}=jA("getListData",n),r=td(s,{method:a,body:{dataViewParameters:e}});return r.then((e=>{window.sessionStorage.setItem(t,JSON.stringify(e))})),r},getFieldsForDataSource:function(e,t,n){if(!t){const t=XE(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=dg.getAppCacheKey(`RDColumns-${e}`);if(window.sessionStorage.getItem(s))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(s)}`));const a=dg.getData(ks.getDefaultQualifiedName("D_pxFieldsForDataSource"),{dataViewParameters:{DataPageName:e}},n);return a.then((e=>{window.sessionStorage.setItem(s,JSON.stringify(e))})),a},getPrimaryFieldsForDataSource:function(e="",t=""){const n=dg.getAppCacheKey(`PFColumns-${e}${t}`);if(window.sessionStorage.getItem(n))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(n)}`));const s=dg.getData(ks.getDefaultQualifiedName("D_pxGetInitialFieldsForDataSource"),{dataViewParameters:{DataPageName:e,ClassName:t}});return s.then((e=>{window.sessionStorage.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=eP(t);window.sessionStorage.getItem(o)||(ZO[t]?s.push(ZO[t]):(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=dg.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=eP(e);window.sessionStorage.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete ZO[e]}))}));return e.forEach((e=>{ZO[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=eP(t);if(window.sessionStorage.getItem(n))try{e[t]=JSON.parse(`${window.sessionStorage.getItem(n)}`)}catch{}})),{data:e}}))},getInsightIDs:function(){const{restApi:e,reqType:t}=jA("getInsightIDs");return td(e,{method:t})},getInsightByID:function(e){const t=ey(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:s,reqType:a}=jA(KO,n);return td(s,{method:a})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:s}=jA(KO,t);return td(n,{method:s})},loadClassResources:async e=>{const t=e.filter((e=>!XO.includes(e)));if(0===t.length)return;const n={classIDs:e.join(",")},{restApi:s,reqType:a}=jA("getClassResources",n);return td(s,{method:a}).then((e=>{e.data.resources&&(XO.push(...t),Qd(e.data.resources))}))},createInsight:function(e){const{restApi:t,reqType:n}=jA("createInsight");return td(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:s,reqType:a}=jA("updateInsight",n);let r;return"UpdateDateTime"in t&&(r=t.UpdateDateTime),td(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}=jA("deleteInsight",t);return td(n,{method:s})},exportToExcel:function(e){const{restApi:t,reqType:n}=jA("exportToExcel");return td(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=jA("exportToCSV");return td(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:s,reqType:a}=jA("scheduleInsight",n);return td(s,{method:a,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const s={insightID:e,scheduleID:t},{restApi:a,reqType:r}=jA("updateScheduledInsight",s);return td(a,{method:r,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:s,reqType:a}=jA("deleteScheduledInsight",n);return td(s,{method:a})},translateStrings:function(e){const{restApi:t,reqType:n}=jA("translateStrings");return td(t,{method:n,body:JSON.stringify(e)})}};const aP=new class{addRoutes=e=>{return t=e,void _E.addRoutes(t);var t}};const rP=class{static registerModule(e,t,n){n[e]=()=>t}};const oP=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 iP=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},cP={setTokens:e=>{id({tokenInfo:e}),od(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>Ru.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Mu(),getAuthInstance:e=>wu.init(e),setAuthorizationHeader:e=>{od({Authorization:e}),setTimeout((()=>Ru.publish("updateSession",{updateStatus:"success"})),0)}};const lP=new class{getDebouncedSubject(e){return(new Yp).pipe(oD(e))}},uP=(()=>{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 dP=(()=>{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}`}$`)})();Kd.register("email",((e,{useRFC822Validation:t})=>{let n=null;const s=t?(a=e,uP.test(a)):function(e){return dP.test(e)}(e);var a;return e&&!s&&(n="Enter a valid email address"),n})),Kd.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t="Invalid number"),t})),Kd.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?"Cannot be blank":null)),Kd.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,57)).then((({parsePhoneNumberFromString:t})=>{Kd.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}))}))}),Ws.PRIORITY.TRIVIAL);const pP=(e,t)=>{switch(t){case"invalid":return`Incorrect ${e}`;case"incomplete":return`Incomplete ${e}`;default:return null}};Kd.register("datetime",(e=>pP("date and time",e))),Kd.register("date",(e=>pP("date",e))),Kd.register("time",(e=>pP("time",e)));const gP=e=>{for(const t of e)if(t?.error)return"Error with one or more files";return null};Kd.register("attachment",(e=>{let t=null;return e?("pyCount"in e&&Array.isArray(e.pxResults)?t=gP(e.pxResults):Array.isArray(e)?t=gP(e):"error"in e&&e.error&&(t="Error with one or more files"),t):t}));const hP="createConversation",fP="sendMessage",mP="getConversations",IP="getMessages",EP="sendMessageForAgent",yP="getCoach",AP=(e,t,n,s,a,r,o)=>{for(const e of o)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const i=rp();return o.push(i),np(e,{queryPayload:mP===e?{assistantID:t,contextID:n,pageSize:s,pageIndex:a}:{agentID:t,contextID:n,pageSize:s,pageIndex:a},cancelTokenSource:i},r).then((e=>(o.pop(),e)))},CP=(e,t,n,s,a)=>{for(const e of a)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const r=rp();return a.push(r),np(e,{queryPayload:IP===e?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n}},s).then((e=>(a.pop(),e)))},SP=(e,t,n,s,a)=>{for(const e of a)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const r=rp();return a.push(r),np(e,{body:JSON.stringify({contextID:t,executeStarterQuestion:!1}),cancelTokenSource:r,queryPayload:e===hP?{assistantID:n}:{agentID:n}},s).then((e=>(a.pop(),e)))},_P=(e,t,n,s,a,r,o)=>{const i={...s&&{request:s},...o&&o.isManualConfirmationSupported&&{capabilities:{tools:{isManualConfirmationSupported:!0}}},...o&&o.toolsReviewed&&o.toolsReviewed.length>0&&{toolsReviewed:o.toolsReviewed},...r&&r?.length>0&&{attachments:r}};return np(e,{body:JSON.stringify(i),queryPayload:e===fP?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n}},a)},NP=(e,t,n,s,a,r,o,i)=>{const c={...s&&{request:s},...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}}}},l=e===fP?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},{restApi:u,reqType:d}=jA(e,l),p={method:d,headers:{Accept:"text/event-stream"},body:JSON.stringify(c),responseType:"stream",adapter:"fetch",...i&&{signal:i.token}};return td(u,p,a)},TP=(e,t,n,s)=>{for(const e of s)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const a=rp();return s.push(a),np(e,{queryPayload:e===yP?{assistantID:t}:{agentID:t},cancelTokenSource:a},n).then((e=>(s.pop(),e))).catch((e=>{throw s.pop(),e}))},DP={createConversation:(e,t,n,s=[])=>SP(hP,e,t,n,s),sendMessage:(e,t,n,s,a)=>a?.enableStreaming?NP(fP,e,t,n,s):_P(fP,e,t,n,s),createConversationForAgent:(e,t,n,s=[])=>SP("createConversationForAgent",e,t,n,s),sendMessageForAgent:(e,t,n,s,a,r)=>r?.enableStreaming?NP(EP,e,t,n,s,a,r):_P(EP,e,t,n,s,a,r),getAgent:(e,t,n=[])=>TP("getAgent",e,t,n),getCoach:(e,t,n=[])=>TP(yP,e,t,n),likeAgentMessage:(e,t,n,s)=>np("likeAgentMessage",{queryPayload:{agentID:e,conversationID:t,messageID:n}},s),unLikeAgentMessage:(e,t,n,s,a="")=>{const r={queryPayload:{agentID:e,conversationID:t,messageID:n},body:JSON.stringify({feedbackText:a})};return np("dislikeAgentMessage",r,s)},getConversations:(e,t,n,s,a,r=[])=>AP(mP,e,t,n,s,a,r),getConversationsForAgent:(e,t,n,s,a,r=[])=>AP("getConversationsForAgent",e,t,n,s,a,r),getMessages:(e,t,n,s=[])=>CP(IP,e,t,n,s),getMessagesForAgent:(e,t,n,s=[])=>CP("getMessagesForAgent",e,t,n,s)};const OP=new class{async rewriteText(e){const{originalText:t,rewriteAction:n,additionalInstructions:s,context:a}=e,r=NE.isInfinityRuntime(),o=NE.getRewriteGenAIDP()??ks.getDefaultQualifiedName("D_RewriteWithAI"),i={OriginalText:t,RewriteAction:n,AdditionalInstructions:s||""};try{let e,t;if(r){const t=await jg.getPageDataAsync(o,a,i),n=Object.fromEntries(Object.entries(t)).pyResponseData;e="string"==typeof n?n:void 0}else{const n=(await jg.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 PP=class{classAccessMap=new Map;constructor(){const e=NE.getClassesAccessList();0!==e.length?this.classAccessMap=e.reduce(((e,t)=>(e.set(t.pyClassName,t.pyHasCreateAccess),e)),new Map):this.classAccessMap=NE.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}};class RP{static behaviorOverrides={};getPersonalizationUtils=zO;constructor(){RP.behaviorOverrides={}}getPCoreVersion=()=>"26.1.0";onPCoreReady=e=>mO.onPCoreReady(e);onPCoreCleanup=e=>mO.onPCoreCleanup(e);getComponentsRegistry=()=>mO.getComponentsRegistry();checkIfSemanticURL=()=>mO.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(QA()){const e=_E.processUrl(yE(),!0);return!!_E._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>aP;getViewResources=()=>p;configureForBrowserBookmark=e=>mO.configureForBrowserBookmark(e);getStore=()=>Iy();resetStore=()=>xy();getMessageManager=()=>Du;getCoexistenceManager=()=>lO;getStoreValue=(e,t,n)=>Sy(e,t,n);getContainerUtils=()=>g;getAnnotationUtils=()=>Fp;getFieldUtils=()=>dd;getFieldDefaultUtils=()=>kd;getAssetLoader=()=>dp;getAttachmentUtils=()=>zd;getViewRuleApi=()=>TO;getFeedUtils=()=>wO;getTagUtils=()=>MO;getGenAIAssistantUtils=()=>DP;getGenAIUtils=()=>OP;getStakeholderUtils=()=>UO;getUserApi=()=>bO;getCaseFollowerApi=()=>OO;getCaseUtils=()=>gm;getStateUtils=()=>Eh;getRelatedCasesApi=()=>PO;getDataApi=()=>Jg;getDataApiUtils=()=>dg;getAnalyticsUtils=()=>sP;getLocaleUtils=e=>{const t=e??NE.getLocale()??"en-US";return WE(t)};registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{RP.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{RP.behaviorOverrides[e]=t};getBehaviorOverrides=()=>RP.behaviorOverrides;getBehaviorOverride=e=>RP.behaviorOverrides[e];getAsynchronousUtils=()=>lP;createPConnect=e=>Hh(e);getPubSubUtils=()=>Ru;registerComponentCreator=e=>{qh(e)};getConstants=()=>Object.freeze($s);getResolvedConstantValue=e=>Ws.getProperty(e);getEvents=()=>oP;getRestClient=()=>d;getMashupApi=()=>uO;getEnvironmentInfo=()=>NE;getRuntimeParamsAPI=()=>sh;getSemanticUrlUtils=()=>Cp;getRemoteCaseUtils=()=>qs;getNavigationUtils=()=>fp;registerModule=(e,t)=>rP.registerModule(e,t,this);getErrorHandler=()=>iP;getFormUtils=()=>Kf;getMessagingServiceManager=()=>Ug;getMetadataUtils=()=>h;getDataPageUtils=()=>jg;getDataTypeUtils=()=>Up;getCascadeManager=()=>gy;isDeepEqual=(e,t)=>sn(e,t);getAuthUtils=()=>cP;getDebugger=()=>vu;getDeferLoadManager=()=>lg;getExpressionEngine=()=>c;getActionsSequencer=()=>ch;getRefreshManager=()=>Zg;getInitialiser=()=>NO;getBootstrapUtils=()=>mO;getContextTreeManager=()=>pu;getAccessPrivilege=()=>PP.getInstance();getObjectTransformer=()=>Bs;getAllStateMachines=(e,t,n)=>t&&n?Qf.getAllStateMachines(e,t,n):Qf.getAllStateMachinesByContext(e);isNamespaceEnabled=()=>ks.isNamespaceEnabled();getQualifiedName=(e,t)=>ks.getQualifiedName(e,t);getDefaultQualifiedName=e=>this.getQualifiedName(e,"PegaPlatform");getNameSpaceUtils=()=>ks;getNetworkUtils=()=>bu;getMashupBridge=()=>I}const bP=new RP;globalThis.PCore=bP;const vP=bP;var xP=r.A;export{xP as default};
2
+ //# sourceMappingURL=constellation-core.71753fb7.js.map