@pega/constellationjs 0.25.1 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/bootstrap-shell.js +1 -1
- package/dist/bootstrap-shell.js.br +0 -0
- package/dist/bootstrap-shell.js.gz +0 -0
- package/dist/constellation-core-react-native.js +2 -0
- package/dist/constellation-core-react-native.js.br +0 -0
- package/dist/constellation-core-react-native.js.gz +0 -0
- package/dist/constellation-core-react-native.js.map +1 -0
- package/dist/constellation-core-web.js +1 -1
- package/dist/constellation-core-web.js.LICENSE.txt +124 -0
- package/dist/constellation-core-web.js.br +0 -0
- package/dist/constellation-core-web.js.gz +0 -0
- package/dist/constellation-core-web.js.map +1 -1
- package/dist/constellation-core.c9cf42c5.js +2 -0
- package/dist/constellation-core.c9cf42c5.js.LICENSE.txt +124 -0
- package/dist/constellation-core.c9cf42c5.js.br +0 -0
- package/dist/constellation-core.c9cf42c5.js.gz +0 -0
- package/dist/constellation-core.c9cf42c5.js.map +1 -0
- package/dist/constellation-core.json +1 -1
- package/dist/js/libphonenumber-web.js +1 -1
- package/dist/js/libphonenumber-web.js.br +0 -0
- package/dist/js/libphonenumber-web.js.gz +0 -0
- package/dist/js/libphonenumber-web.js.map +1 -1
- package/dist/js/libphonenumber.a5a4a2d2.js +2 -0
- package/dist/js/libphonenumber.a5a4a2d2.js.br +0 -0
- package/dist/js/libphonenumber.a5a4a2d2.js.gz +0 -0
- package/dist/js/libphonenumber.a5a4a2d2.js.map +1 -0
- package/dist/lib_asset.json +1 -1
- package/package.json +1 -1
- package/dist/constellation-core.31733a3d.js +0 -2
- package/dist/constellation-core.31733a3d.js.br +0 -0
- package/dist/constellation-core.31733a3d.js.gz +0 -0
- package/dist/constellation-core.31733a3d.js.map +0 -1
- package/dist/js/libphonenumber.1e95a712.js +0 -2
- package/dist/js/libphonenumber.1e95a712.js.br +0 -0
- package/dist/js/libphonenumber.1e95a712.js.gz +0 -0
- package/dist/js/libphonenumber.1e95a712.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{var e={953:e=>{class t{constructor(e,t,n,r,a){this.converter=c(),this.width=e,this.poly=t,this.xor_in=n,this.reflected_xor_in=l(n,e),this.xor_out=r,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 s=this.gen_table();this.table=s,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=s[t^e[n]];return t})}calculate(e){let t;e=this.converter.validate_buffer(e);let{table:n,width:r,crc_shift:a,mask:s}=this;if(this.reflect){t=this.reflected_xor_in;for(let r=0;r<e.length;r++){t=(n[255&(t^e[r])]^t>>>8)&s}}else{t=this.shifted_xor_in;for(let o=0;o<e.length;o++)t=n[255&(t>>r-8+a^e[o])]<<a^t<<8-a&s<<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 r=e[n];this.reflect&&(r=l(r,8));for(let e=0;e<8;e++){let n=t&this.msb_mask;r&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,r=e.length>>n,a=1<<n,s="";for(let o=0;o<r;o++){let r="";for(let s=0;s<a;s++){let a=e[o<<n|s];a="000000000"+a.toString(16),a=a.substr(a.length-t),r+="0x"+a+", "}s+=" "+r+"\n"}return s="[\n"+s.slice(0,-3)+"\n]",s}}const n="undefined"!=typeof Buffer,r="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,a=void 0!==typeof BigInt&&BigInt(256);class s{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(r){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 s{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 s{fromByteArray=Uint8Array.from.bind(Uint8Array);fromString(e){return new TextEncoder("utf-8").encode(e)}}function c(e=!1){if(r&&(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 r=0;r<t;r++)n=n<<1|1&e,e>>=1;return n}const d={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 u(e){}e.exports={CRC:t,crc:function(e,n,r,a,s){let o=new t(e,n,r,a,s);return o.calculate.bind(o)},makeBufferConverter:c,models:d,crc1:u,crc6:u,crc8:u,crc10:u,crc16:u,crc24:u,crc32:u,crc32c:u};for(let t in d){let n=d[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},816:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AsYouType:()=>$a,AsYouTypeCustom:()=>Ra,DIGITS:()=>ee,DIGIT_PLACEHOLDER:()=>Fr,Metadata:()=>Fa,ParseError:()=>A,PhoneNumber:()=>Ga,PhoneNumberMatcher:()=>Rr,PhoneNumberSearch:()=>hs,PhoneNumberSearchCustom:()=>cs,default:()=>wt,findNumbers:()=>gr,findPhoneNumbers:()=>us,findPhoneNumbersCustom:()=>ls,findPhoneNumbersInText:()=>_r,format:()=>za,formatCustom:()=>qa,formatIncompletePhoneNumber:()=>Ba,formatNumber:()=>za,formatRFC3966:()=>Be,getCountries:()=>Ma,getCountryCallingCode:()=>La,getCountryCallingCodeCustom:()=>k,getExampleNumber:()=>ka,getExtPrefix:()=>Ua,getNumberType:()=>Qa,getNumberTypeCustom:()=>Ya,getPhoneCode:()=>La,getPhoneCodeCustom:()=>k,isPossibleNumber:()=>Xa,isPossiblePhoneNumber:()=>qt,isSupportedCountry:()=>xa,isValidNumber:()=>es,isValidNumberCustom:()=>Za,isValidNumberForRegion:()=>ns,isValidPhoneNumber:()=>kt,parse:()=>Ha,parseCustom:()=>Wa,parseDigits:()=>ne,parseIncompletePhoneNumber:()=>se,parseNumber:()=>Ha,parsePhoneNumber:()=>Pt,parsePhoneNumberCharacter:()=>oe,parsePhoneNumberFromString:()=>wt,parsePhoneNumberWithError:()=>Pt,parseRFC3966:()=>Ve,searchNumbers:()=>Ir,searchPhoneNumbers:()=>ps,searchPhoneNumbersCustom:()=>ds,searchPhoneNumbersInText:()=>vr,validatePhoneNumberLength:()=>Xt});const r={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-7]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]|50"]],["(\\d{8})","$1",["[5-7]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|9[2-9]"]],["(\\d)(\\d{7})","$1 $2",["[267]|904"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[346-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[0-79]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:274[27]|(?:472|983)[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1(?:2[02]|[89])"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[26]|6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function a(e,t){var n=Array.prototype.slice.call(t);return n.push(r),e.apply(this,n)}var s=2,o=17,i=3,c="0-90-9٠-٩۰-۹",l=" ",d="".concat("-‐-―−ー-").concat("//").concat("..").concat(l).concat("()()[]\\[\\]").concat("~⁓∼~"),u="++";function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function g(e){var t=function(e,t){if("object"!=p(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==p(t)?t:t+""}function f(e,t,n){return t=E(t),function(e,t){if(t&&("object"==p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,y()?Reflect.construct(t,n||[],E(e).constructor):t.apply(e,n))}function m(e){var t="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&I(a,n.prototype),a}(e,arguments,E(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),I(n,e)},m(e)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}var A=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=f(this,t,[e]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&I(e,t)}(t,e),n=t,r&&h(n.prototype,r),a&&h(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,a}(m(Error));function C(e,t){e=e.split("-"),t=t.split("-");for(var n=e[0].split("."),r=t[0].split("."),a=0;a<3;a++){var s=Number(n[a]),o=Number(r[a]);if(s>o)return 1;if(o>s)return-1;if(!isNaN(s)&&isNaN(o))return 1;if(isNaN(s)&&!isNaN(o))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}var S={}.constructor;function N(e){return null!=e&&e.constructor===S}var _=/^\d+$/;function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,D(r.key),r)}}function O(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function D(e){var t=function(e,t){if("object"!=b(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==b(t)?t:t+""}var v=" ext. ",R=function(){return O((function e(t){T(this,e),U(t),this.metadata=t,B.call(this,t)}),[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(e){return"001"!==e}))}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){var n,r,a;if(e&&(a=e,_.test(a)?r=e:n=e),t&&(r=t),n&&"001"!==n){var s=this.getCountryMetadata(n);if(!s)throw new Error("Unknown country: ".concat(n));this.numberingPlan=new $(s,this)}else if(r){if(!this.hasCallingCode(r))throw new Error("Unknown calling code: ".concat(r));this.numberingPlan=new $(this.getNumberingPlanMetadata(r),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var n=this.nonGeographic()[e];if(n)return n}else{var r=this.countryCallingCodes()[e];if(r&&1===r.length&&"001"===r[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}])}(),$=function(){return O((function e(t,n){T(this,e),this.globalMetadataObject=n,this.metadata=t,B.call(this,n.metadata)}),[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"_getDefaultCountryMetadataForThisCallingCode",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this._getDefaultCountryMetadataForThisCallingCode()}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this,t=this._getFormats(this.metadata)||this._getFormats(this._getDefaultCountryMetadataForThisCallingCode())||[];return t.map((function(t){return new x(t,e)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&L(this.types(),e))return new M(L(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?v:this.metadata[13]||v}}])}(),x=function(){return O((function e(t,n){T(this,e),this._format=t,this.metadata=n}),[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||w.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),w=/^\(?\$1\)?$/,M=function(){return O((function e(t,n){T(this,e),this.type=t,this.metadata=n}),[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])}();function L(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function U(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!N(e)||!N(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(N(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+F(e)+": "+e,"."))}var F=function(e){return b(e)};function j(e,t){var n=new R(t);return n.hasCountry(e)?n.selectNumberingPlan(e).ext():v}function k(e,t){var n=new R(t);if(n.hasCountry(e))return n.selectNumberingPlan(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function V(e,t){return t.countries.hasOwnProperty(e)}function B(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===C(t,"1.2.0")?this.v2=!0:-1===C(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var G=function(e){return"([".concat(c,"]{1,").concat(e,"})")};function W(e){var t="[ \\t,]*",n="[:\\..]?[ \\t,-]*",r="#?",a="[ \\t]*";return";ext="+G("20")+"|"+(t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+n+G("20")+r)+"|"+(t+"(?:[xx##~~]|int|int)"+n+G("9")+r)+"|"+("[- ]+"+G("6")+"#")+"|"+(a+"(?:,{2}|;)"+n+G("15")+r)+"|"+(a+"(?:,)+"+n+G("9")+r)}var H="["+c+"]{"+s+"}",q="[++]{0,1}(?:["+d+"]*["+c+"]){3,}["+d+c+"]*",z=new RegExp("^[++]{0,1}(?:["+d+"]*["+c+"]){1,2}$","i"),Y=q+"(?:"+W()+")?",K=new RegExp("^"+H+"$|^"+Y+"$","i");function Q(e){return e.length>=s&&K.test(e)}var J=new RegExp("(?:"+W()+")$","i");function X(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Z(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ee={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function te(e){return ee[e]}function ne(e){for(var t,n="",r=X(e.split(""));!(t=r()).done;){var a=te(t.value);a&&(n+=a)}return n}function re(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ae(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function se(e){for(var t,n="",r=re(e.split(""));!(t=r()).done;){n+=oe(t.value,n)||""}return n}function oe(e,t,n){return"+"===e?t?void("function"==typeof n&&n("end")):"+":te(e)}function ie(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ce(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function le(e,t,n){return de(e,void 0,t,n)}function de(e,t,n,r){n&&(r=new R(r.metadata)).selectNumberingPlan(n);var a=r.type(t),s=a&&a.possibleLengths()||r.possibleLengths();if(!s)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===t){if(!r.type("FIXED_LINE"))return de(e,"MOBILE",n,r);var o=r.type("MOBILE");o&&(s=function(e,t){for(var n,r=e.slice(),a=ie(t);!(n=a()).done;){var s=n.value;e.indexOf(s)<0&&r.push(s)}return r.sort((function(e,t){return e-t}))}(s,o.possibleLengths()))}else if(t&&!a)return"INVALID_LENGTH";var i=e.length,c=s[0];return c===i?"IS_POSSIBLE":c>i?"TOO_SHORT":s[s.length-1]<i?"TOO_LONG":s.indexOf(i,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function ue(e,t,n){void 0===t&&(t={});var r=new R(n);if(t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.country||e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return pe(e.phone||e.nationalNumber,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function pe(e,t){return"IS_POSSIBLE"===le(e,void 0,t)}function he(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function ge(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var me=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function ye(e,t,n){if(t=t||{},e.country||e.countryCallingCode){var r=new R(n);r.selectNumberingPlan(e.country||e.countryCallingCode);var a=t.v2?e.nationalNumber:e.phone;if(he(a,r.nationalNumberPattern())){if(Ie(a,"FIXED_LINE",r))return r.type("MOBILE")&&""===r.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":r.type("MOBILE")?Ie(a,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var s,o=ge(me);!(s=o()).done;){var i=s.value;if(Ie(a,i,r))return i}}}}function Ie(e,t,n){var r=n.type(t);return!(!r||!r.pattern())&&(!(r.possibleLengths()&&r.possibleLengths().indexOf(e.length)<0)&&he(e,r.pattern()))}function Ee(e,t,n){t=t||{};var r=new R(n);return r.selectNumberingPlan(e.country||e.countryCallingCode),r.hasTypes()?void 0!==ye(e,t,r.metadata):he(t.v2?e.nationalNumber:e.phone,r.nationalNumberPattern())}var Ae=/^[A-Z]{2}$/;function Ce(e,t){var n,r,a,s=new R(t);return a=e,Ae.test(a)?(n=e,s.selectNumberingPlan(n),r=s.countryCallingCode()):r=e,{country:n,callingCode:r}}function Se(e,t,n){var r=new R(n).getCountryCodesForCallingCode(e);return r?r.filter((function(e){return function(e,t,n){var r=new R(n);return r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(e.length)>=0}(t,e,n)})):[]}var Ne=new RegExp("(["+c+"])");function _e(e,t,n,r){if(t){var a=new R(r);a.selectNumberingPlan(t||n);var s=new RegExp(a.IDDPrefix());if(0===e.search(s)){var o=(e=e.slice(e.match(s)[0].length)).match(Ne);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return e}}}function be(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(e);if(r){var a,s,o,i=r.length-1,c=i>0&&r[i];if(t.nationalPrefixTransformRule()&&c)a=e.replace(n,t.nationalPrefixTransformRule()),i>1&&(s=r[1]);else{var l=r[0];a=e.slice(l.length),c&&(s=r[1])}if(c){var d=e.indexOf(r[1]);e.slice(0,d)===t.numberingPlan.nationalPrefix()&&(o=t.numberingPlan.nationalPrefix())}else o=r[0];return{nationalNumber:a,nationalPrefix:o,carrierCode:s}}}return{nationalNumber:e}}function Te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Pe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oe(e,t,n){for(var r,a=new R(n),s=Te(t);!(r=s()).done;){var o=r.value;if(a.selectNumberingPlan(o),a.leadingDigits()){if(e&&0===e.search(a.leadingDigits()))return o}else if(ye({phone:e,country:o},void 0,a.metadata))return o}}var De=!1;function ve(e,t){var n=t.nationalNumber,r=t.metadata;if(De&&r.isNonGeographicCallingCode(e))return"001";var a=r.getCountryCodesForCallingCode(e);return a?1===a.length?a[0]:Oe(n,a,r.metadata):void 0}function Re(e,t,n){var r=be(e,n),a=r.carrierCode,s=r.nationalNumber;if(s!==e){if(!function(e,t,n){if(he(e,n.nationalNumberPattern())&&!he(t,n.nationalNumberPattern()))return!1;return!0}(e,s,n))return{nationalNumber:e};if(n.numberingPlan.possibleLengths()&&(t||(t=ve(n.numberingPlan.callingCode(),{nationalNumber:s,metadata:n})),!function(e,t,n){switch(le(e,t,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(s,t,n)))return{nationalNumber:e}}return{nationalNumber:s,carrierCode:a}}function $e(e,t,n,r,a){if(!(t||n||r))return{number:e};var s=t||n?k(t||n,a):r;if(0===e.indexOf(s)){var o=new R(a);o.selectNumberingPlan(t||n||r);var i=e.slice(s.length),c=Re(i,void 0,o).nationalNumber,l=Re(e,void 0,o).nationalNumber;if(!he(l,o.nationalNumberPattern())&&he(c,o.nationalNumberPattern())||"TOO_LONG"===le(l,void 0,o))return{countryCallingCode:s,number:i}}return{number:e}}function xe(e,t,n,r,a){if(!e)return{};var s;if("+"!==e[0]){var o=_e(e,t||n,r,a);if(!o||o===e){if(t||n||r){var c=$e(e,t,n,r,a),l=c.countryCallingCode,d=c.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:d}}return{number:e}}s=!0,e="+"+o}if("0"===e[1])return{};for(var u=new R(a),p=2;p-1<=i&&p<=e.length;){var h=e.slice(1,p);if(u.hasCallingCode(h))return u.selectNumberingPlan(h),{countryCallingCodeSource:s?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:h,number:e.slice(p)};p++}return{}}function we(e){return e.replace(new RegExp("[".concat(d,"]+"),"g")," ").trim()}var Me=/(\$\d)/;function Le(e,t,n){var r=n.useInternationalFormat,a=n.withNationalPrefix,s=(n.carrierCode,n.metadata,e.replace(new RegExp(t.pattern()),r?t.internationalFormat():a&&t.nationalPrefixFormattingRule()?t.format().replace(Me,t.nationalPrefixFormattingRule()):t.format()));return r?we(s):s}var Ue=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||je(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e,t){if(e){if("string"==typeof e)return ke(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ke(e,t):void 0}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ve(e){for(var t,n,r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=je(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}((e=e.replace(/^tel:/,"tel=")).split(";"));!(r=a()).done;){var s=Fe(r.value.split("="),2),o=s[0],i=s[1];switch(o){case"tel":t=i;break;case"ext":n=i;break;case"phone-context":"+"===i[0]&&(t=i+t)}}if(!Q(t))return{};var c={number:t};return n&&(c.ext=n),c}function Be(e){var t=e.number,n=e.ext;if(!t)return"";if("+"!==t[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(n?";ext="+n:"")}var Ge={formatExtension:function(e,t,n){return"".concat(e).concat(n.ext()).concat(t)}};function We(e,t,n,r){n=n?function(){for(var e=1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(;e<n.length;){if(n[e])for(var a in n[e])n[0][a]=n[e][a];e++}return n[0]}({},Ge,n):Ge;var a=new R(r);if(e.country&&"001"!==e.country){if(!a.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));a.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)return e.phone||"";a.selectNumberingPlan(e.countryCallingCode)}var s,o=a.countryCallingCode(),i=n.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return i?ze(s=He(i,e.carrierCode,"NATIONAL",a,n),e.ext,a,n.formatExtension):"";case"INTERNATIONAL":return i?(s=He(i,null,"INTERNATIONAL",a,n),ze(s="+".concat(o," ").concat(s),e.ext,a,n.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(i);case"RFC3966":return Be({number:"+".concat(o).concat(i),ext:e.ext});case"IDD":if(!n.fromCountry)return;var c=function(e,t,n,r,a){var s=k(r,a.metadata);if(s===n){var o=He(e,t,"NATIONAL",a);return"1"===n?n+" "+o:o}var i=function(e,t,n){var r=new R(n);return r.selectNumberingPlan(e||t),r.defaultIDDPrefix()?r.defaultIDDPrefix():Ue.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,a.metadata);if(i)return"".concat(i," ").concat(n," ").concat(He(e,null,"INTERNATIONAL",a))}(i,e.carrierCode,o,n.fromCountry,a);if(!c)return;return ze(c,e.ext,a,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function He(e,t,n,r,a){var s=qe(r.formats(),e);return s?Le(e,s,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!a||!1!==a.nationalPrefix,carrierCode:t,metadata:r}):e}function qe(e,t){return function(e,t){var n=0;for(;n<e.length;){if(t(e[n]))return e[n];n++}}(e,(function(e){if(e.leadingDigitsPatterns().length>0){var n=e.leadingDigitsPatterns()[e.leadingDigitsPatterns().length-1];if(0!==t.search(n))return!1}return he(t,e.pattern())}))}function ze(e,t,n,r){return t?r(e,t,n):e}function Ye(e){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ye(e)}function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(n),!0).forEach((function(t){Je(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Je(e,t,n){return(t=Ze(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ze(r.key),r)}}function Ze(e){var t=function(e,t){if("object"!=Ye(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ye(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ye(t)?t:t+""}var et=function(){return e=function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new TypeError("First argument is required");if("string"!=typeof t)throw new TypeError("First argument must be a string");if("+"===t[0]&&!n)throw new TypeError("`metadata` argument not passed");if(N(n)&&N(n.countries)){r=n;var a=t;if(!tt.test(a))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var s=xe(a,void 0,void 0,void 0,r);if(t=s.countryCallingCode,!(n=s.number))throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if("string"!=typeof n)throw new TypeError("`nationalNumber` argument must be a string");U(r);var o=Ce(t,r),i=o.country,c=o.callingCode;this.country=i,this.countryCallingCode=c,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}},(t=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Se(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return ue(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Ee(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new R(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return ye(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return We(this,e,t?Qe(Qe({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}])&&Xe(e.prototype,t),n&&Xe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),tt=/^\+\d+$/,nt="+",rt="(["+c+"]|[\\-\\.\\(\\)]?)",at=new RegExp("^\\"+nt+rt+"*["+c+"]"+rt+"*$","g"),st=new RegExp("^("+("["+c+"]+((\\-)*["+c+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+c+"])*")+"\\.?$","g"),ot="tel:",it=";phone-context=",ct=";isub=";function lt(e,t){var n,r=t.extractFormattedPhoneNumber,a=function(e){var t=e.indexOf(it);if(t<0)return null;var n=t+it.length;if(n>=e.length)return"";var r=e.indexOf(";",n);return r>=0?e.substring(n,r):e.substring(n)}(e);if(!function(e){return null===e||0!==e.length&&(at.test(e)||st.test(e))}(a))throw new A("NOT_A_NUMBER");if(null===a)n=r(e)||"";else{n="",a.charAt(0)===nt&&(n+=a);var s,o=e.indexOf(ot);s=o>=0?o+ot.length:0;var i=e.indexOf(it);n+=e.substring(s,i)}var c=n.indexOf(ct);if(c>0&&(n=n.substring(0,c)),""!==n)return n}var dt=250,ut=new RegExp("[++"+c+"]"),pt=new RegExp("[^"+c+"#]+$"),ht=!1;function gt(e,t,n){t=t||{};var r=new R(n);if(t.defaultCountry&&!r.hasCountry(t.defaultCountry)){if(t.v2)throw new A("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var a=function(e,t,n){var r=lt(e,{extractFormattedPhoneNumber:function(e){return function(e,t,n){if(!e)return;if(e.length>dt){if(n)throw new A("TOO_LONG");return}if(!1===t)return e;var r=e.search(ut);if(r<0)return;return e.slice(r).replace(pt,"")}(e,n,t)}});if(!r)return{};if(!Q(r))return function(e){return z.test(e)}(r)?{error:"TOO_SHORT"}:{};var a=function(e){var t=e.search(J);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(J),a=1;a<r.length;){if(r[a])return{number:n,ext:r[a]};a++}}(r);if(a.ext)return a;return{number:r}}(e,t.v2,t.extract),i=a.number,c=a.ext,l=a.error;if(!i){if(t.v2){if("TOO_SHORT"===l)throw new A("TOO_SHORT");throw new A("NOT_A_NUMBER")}return{}}var d=function(e,t,n,r){var a,s=xe(se(e),void 0,t,n,r.metadata),o=s.countryCallingCodeSource,i=s.countryCallingCode,c=s.number;if(i)r.selectNumberingPlan(i);else{if(!c||!t&&!n)return{};t?(a=t,r.selectNumberingPlan(t),i=r.numberingPlan.callingCode()):(r.selectNumberingPlan(n),i=n,ht&&r.isNonGeographicCallingCode(i)&&(a="001"))}if(!c)return{countryCallingCodeSource:o,countryCallingCode:i};var l=Re(se(c),void 0,r),d=l.nationalNumber,u=l.carrierCode,p=ve(i,{nationalNumber:d,metadata:r});p&&(a=p,"001"===p||r.selectNumberingPlan(a));return{country:a,countryCallingCode:i,countryCallingCodeSource:o,nationalNumber:d,carrierCode:u}}(i,t.defaultCountry,t.defaultCallingCode,r),u=d.country,p=d.nationalNumber,h=d.countryCallingCode,g=d.countryCallingCodeSource,f=d.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new A("INVALID_COUNTRY");return{}}if(!p||p.length<s){if(t.v2)throw new A("TOO_SHORT");return{}}if(p.length>o){if(t.v2)throw new A("TOO_LONG");return{}}if(t.v2){var m=new et(h,p,r.metadata);return u&&(m.country=u),f&&(m.carrierCode=f),c&&(m.ext=c),m.__countryCallingCodeSource=g,m}var y=!!(t.extended?r.hasSelectedNumberingPlan():u)&&he(p,r.nationalNumberPattern());return t.extended?{country:u,countryCallingCode:h,carrierCode:f,valid:y,possible:!!y||!(!0!==t.extended||!r.possibleLengths()||!pe(p,r)),phone:p,ext:c}:y?function(e,t,n){var r={country:e,phone:t};n&&(r.ext=n);return r}(u,p,c):{}}function ft(e){return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ft(e)}function mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mt(Object(n),!0).forEach((function(t){It(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function It(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=ft(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ft(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ft(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Et(e,t,n){return gt(e,yt(yt({},t),{},{v2:!0}),n)}function At(e){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(e)}function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function St(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=At(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=At(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==At(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _t(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_t(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bt(e){var t,n,r,a=Nt(Array.prototype.slice.call(e),4),s=a[0],o=a[1],i=a[2],c=a[3];if("string"!=typeof s)throw new TypeError("A text for parsing must be a string.");if(t=s,o&&"string"!=typeof o){if(!N(o))throw new Error("Invalid second argument: ".concat(o));i?(n=o,r=i):r=o}else c?(n=i,r=c):(n=void 0,r=i),o&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ct(Object(n),!0).forEach((function(t){St(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({defaultCountry:o},n));return{text:t,options:n,metadata:r}}function Tt(){var e=bt(arguments);return Et(e.text,e.options,e.metadata)}function Pt(){return a(Tt,arguments)}function Ot(e){return Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ot(e)}function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(n),!0).forEach((function(t){Rt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Ot(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ot(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ot(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $t(e,t,n){t&&t.defaultCountry&&!V(t.defaultCountry,n)&&(t=vt(vt({},t),{},{defaultCountry:void 0}));try{return Et(e,t,n)}catch(e){if(!(e instanceof A))throw e}}function xt(){var e=bt(arguments);return $t(e.text,e.options,e.metadata)}function wt(){return a(xt,arguments)}function Mt(e){return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mt(e)}function Lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ut(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(n),!0).forEach((function(t){Ft(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ft(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Mt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Mt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Mt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jt(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=$t(t,n=Ut(Ut({},n),{},{extract:!1}),r);return a&&a.isValid()||!1}function kt(){return a(jt,arguments)}function Vt(e){return Vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vt(e)}function Bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bt(Object(n),!0).forEach((function(t){Wt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Vt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Vt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Vt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ht(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=$t(t,n=Gt(Gt({},n),{},{extract:!1}),r);return a&&a.isPossible()||!1}function qt(){return a(Ht,arguments)}function zt(e){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zt(e)}function Yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yt(Object(n),!0).forEach((function(t){Qt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=zt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jt(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata;n=Kt(Kt({},n),{},{extract:!1});try{var a=Et(t,n,r),s=new R(r);s.selectNumberingPlan(a.country||a.countryCallingCode);var o=le(a.nationalNumber,void 0,s);if("IS_POSSIBLE"!==o)return o}catch(e){if(e instanceof A)return e.message;throw e}}function Xt(){return a(Jt,arguments)}function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function en(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nn(r.key),r)}}function tn(e,t,n){return t&&en(e.prototype,t),n&&en(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nn(e){var t=function(e,t){if("object"!=Zt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Zt(t)?t:t+""}function rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var an=tn((function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;rn(this,e),this.key=t,this.value=n,this.next=r,this.prev=a})),sn=function(){return tn((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;rn(this,e),this.size=0,this.limit=t,this.head=null,this.tail=null,this.cache={}}),[{key:"put",value:function(e,t){if(this.ensureLimit(),this.head){var n=new an(e,t,this.head);this.head.prev=n,this.head=n}else this.head=this.tail=new an(e,t);this.cache[e]=this.head,this.size++}},{key:"get",value:function(e){if(this.cache[e]){var t=this.cache[e].value;return this.remove(e),this.put(e,t),t}console.log("Item not available in cache for key ".concat(e))}},{key:"ensureLimit",value:function(){this.size===this.limit&&this.remove(this.tail.key)}},{key:"remove",value:function(e){var t=this.cache[e];null!==t.prev?t.prev.next=t.next:this.head=t.next,null!==t.next?t.next.prev=t.prev:this.tail=t.prev,delete this.cache[e],this.size--}},{key:"clear",value:function(){this.head=null,this.tail=null,this.size=0,this.cache={}}}])}();function on(e){return on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},on(e)}function cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ln(r.key),r)}}function ln(e){var t=function(e,t){if("object"!=on(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=on(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==on(t)?t:t+""}var dn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cache=new sn(t)},(t=[{key:"getPatternForRegExp",value:function(e){var t=this.cache.get(e);return t||(t=new RegExp("^"+e),this.cache.put(e,t)),t}}])&&cn(e.prototype,t),n&&cn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function un(e,t){if(e<0||t<=0||t<e)throw new TypeError;return"{".concat(e,",").concat(t,"}")}function pn(e,t){var n=t.search(e);return n>=0?t.slice(0,n):t}var hn=" - \u2028\u2029 ",gn="[".concat(hn,"]"),fn="[^".concat(hn,"]"),mn="[".concat("0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9","]"),yn="A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",In="[".concat(yn,"]"),En=new RegExp(In),An="[".concat("$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩$¢£¥₩","]"),Cn=new RegExp(An),Sn="[".concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦","]"),Nn=new RegExp(Sn),_n=new RegExp("[\0--ÿĀ-ſḀ-ỿƀ-ɏ̀-ͯ]");function bn(e){return!(!En.test(e)&&!Nn.test(e))&&_n.test(e)}function Tn(e){return"%"===e||Cn.test(e)}function Pn(e,t,n){var r=!0,a=xt(e,n);if(a||(r=!1,a=xt(e,{defaultCallingCode:t.countryCallingCode},n)),!a)return"INVALID_NUMBER";if(t.ext){if(a.ext!==t.ext)return"NO_MATCH"}else if(a.ext)return"NO_MATCH";return r&&t.countryCallingCode!==a.countryCallingCode?"NO_MATCH":t.number===a.number?r?"EXACT_MATCH":"NSN_MATCH":0===t.nationalNumber.indexOf(a.nationalNumber)||0===a.nationalNumber.indexOf(t.nationalNumber)?"SHORT_NSN_MATCH":"NO_MATCH"}const On={POSSIBLE:function(e,t){t.candidate,t.metadata;return!0},VALID:function(e,t){var n=t.candidate,r=(t.defaultCountry,t.metadata);return!(!e.isValid()||!Dn(e,n,r))},STRICT_GROUPING:function(e,t){var n=t.candidate,r=t.defaultCountry,a=t.metadata,s=t.regExpCache;return!(!e.isValid()||!Dn(e,n,a)||Rn(e,n)||!vn(e,{defaultCountry:r,metadata:a}))&&$n(e,n,a,wn,s)},EXACT_GROUPING:function(e,t){var n=t.candidate,r=t.defaultCountry,a=t.metadata,s=t.regExpCache;return!(!e.isValid()||!Dn(e,n,a)||Rn(e,n)||!vn(e,{defaultCountry:r,metadata:a}))&&$n(e,n,a,xn,s)}};function Dn(e,t,n){for(var r=0;r<t.length-1;r++){var a=t.charAt(r);if("x"===a||"X"===a){var s=t.charAt(r+1);if("x"===s||"X"===s){if(r++,"NSN_MATCH"!==Pn(t.substring(r),e,n))return!1}else{var o=ne(t.substring(r));if(o){if(e.ext!==o)return!1}else if(e.ext)return!1}}}return!0}function vn(e,t){t.defaultCountry;var n=t.metadata;if("FROM_DEFAULT_COUNTRY"!==e.__countryCallingCodeSource)return!0;var r=new R(n);r.selectNumberingPlan(e.countryCallingCode);e.country||ve(e.countryCallingCode,{nationalNumber:e.nationalNumber,metadata:r});var a=e.nationalNumber,s=qe(r.numberingPlan.formats(),a);return!s.nationalPrefixFormattingRule()||(!!r.numberingPlan.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||(!s.usesNationalPrefix()||Boolean(e.nationalPrefix)))}function Rn(e,t){var n=t.indexOf("/");if(n<0)return!1;var r=t.indexOf("/",n+1);return!(r<0)&&(!("FROM_NUMBER_WITH_PLUS_SIGN"===e.__countryCallingCodeSource||"FROM_NUMBER_WITHOUT_PLUS_SIGN"===e.__countryCallingCodeSource)||ne(t.substring(0,n))!==e.countryCallingCode||t.slice(r+1).indexOf("/")>=0)}function $n(e,t,n,r,a){throw new Error("This part of code hasn't been ported")}function xn(e,t,n,r){throw new Error("This part of code hasn't been ported")}function wn(e,t,n,r){throw new Error("This part of code hasn't been ported")}var Mn=/[\\/] *x/;function Ln(e){return pn(Mn,e)}var Un=/(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/,Fn=/[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/,jn=/^:[0-5]\d/;function kn(e,t,n){if(Un.test(e))return!1;if(Fn.test(e)){var r=n.slice(t+e.length);if(jn.test(r))return!1}return!0}var Vn="(\\[([",Bn=")\\])]",Gn="[^".concat(Vn).concat(Bn,"]"),Wn="[".concat(Vn).concat(u,"]"),Hn=new RegExp("^"+Wn),qn=un(0,3),zn=new RegExp("^(?:[(\\[([])?(?:"+Gn+"+["+Bn+"])?"+Gn+"+(?:["+Vn+"]"+Gn+"+["+Bn+"])"+qn+Gn+"*$"),Yn=/\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;function Kn(e,t,n,r){if(zn.test(e)&&!Yn.test(e)){if("POSSIBLE"!==r){if(t>0&&!Hn.test(e)){var a=n[t-1];if(Tn(a)||bn(a))return!1}var s=t+e.length;if(s<n.length){var o=n[s];if(Tn(o)||bn(o))return!1}}return!0}}function Qn(e){return Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qn(e)}function Jn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Xn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,er(r.key),r)}}function er(e){var t=function(e,t){if("object"!=Qn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Qn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qn(t)?t:t+""}var tr=W(),nr=["/+(.*)","(\\([^(]*)","(?:".concat(gn,"-|-").concat(gn,")").concat(gn,"*(.+)"),"[‒-―-]".concat(gn,"*(.+)"),"\\.+".concat(gn,"*([^.]+)"),"".concat(gn,"+(").concat(fn,"+)")],rr=un(0,2),ar=un(0,4),sr=o+i,or=un(0,sr),ir="[".concat(d,"]")+ar,cr=mn+un(1,sr),lr="(?:"+Wn+ir+")"+rr+cr+"(?:"+ir+cr+")"+or+"(?:"+tr+")?",dr=new RegExp("[^".concat("0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9").concat(yn,"#]+$")),ur=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,pr=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n={v2:n.v2,defaultCallingCode:n.defaultCallingCode,defaultCountry:n.defaultCountry&&V(n.defaultCountry,r)?n.defaultCountry:void 0,leniency:n.leniency||(n.extended?"POSSIBLE":"VALID"),maxTries:n.maxTries||ur},!On[n.leniency])throw new TypeError('Unknown leniency: "'.concat(n.leniency,'"'));if("POSSIBLE"!==n.leniency&&"VALID"!==n.leniency)throw new TypeError('Invalid `leniency`: "'.concat(n.leniency,'". Supported values: "POSSIBLE", "VALID".'));if(n.maxTries<0)throw new TypeError("`maxTries` must be `>= 0`");this.text=t,this.options=n,this.metadata=r,this.leniency=On[n.leniency],this.maxTries=n.maxTries,this.PATTERN=new RegExp(lr,"ig"),this.INNER_MATCHES=nr.map((function(e){return new RegExp(e,"g")})),this.state="NOT_READY",this.searchIndex=0,this.regExpCache=new dn(32)},t=[{key:"find",value:function(e){var t;for(this.PATTERN.lastIndex=e;this.maxTries>0&&null!==(t=this.PATTERN.exec(this.text));){var n=t[0],r=t.index;if(kn(n=Ln(n),r,this.text)){var a=this.parseAndVerify(n,r,this.text)||this.extractInnerMatch(n,r,this.text);if(a){if(this.options.v2)return{startsAt:a.startsAt,endsAt:a.endsAt,number:a.phoneNumber};var s=a.phoneNumber,o={startsAt:a.startsAt,endsAt:a.endsAt,phone:s.nationalNumber};return s.country?o.country=s.country:o.countryCallingCode=s.countryCallingCode,s.ext&&(o.ext=s.ext),o}}this.maxTries--}}},{key:"extractInnerMatch",value:function(e,t,n){for(var r,a=Jn(this.INNER_MATCHES);!(r=a()).done;){var s=r.value;s.lastIndex=0;for(var o=!0,i=void 0;this.maxTries>0&&null!==(i=s.exec(e));){if(o){var c=pn(dr,e.slice(0,i.index)),l=this.parseAndVerify(c,t,n);if(l)return l;this.maxTries--,o=!1}var d=pn(dr,i[1]),u=e.indexOf(d,i.index),p=this.parseAndVerify(d,t+u,n);if(p)return p;this.maxTries--}}}},{key:"parseAndVerify",value:function(e,t,n){if(Kn(e,t,n,this.options.leniency)){var r=xt(e,{extended:!0,defaultCountry:this.options.defaultCountry,defaultCallingCode:this.options.defaultCallingCode},this.metadata);if(r&&r.isPossible())return this.leniency(r,{candidate:e,defaultCountry:this.options.defaultCountry,metadata:this.metadata,regExpCache:this.regExpCache})?{startsAt:t,endsAt:t+e.length,phoneNumber:r}:void 0}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.lastMatch=this.find(this.searchIndex),this.lastMatch?(this.searchIndex=this.lastMatch.endsAt,this.state="READY"):this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var e=this.lastMatch;return this.lastMatch=null,this.state="NOT_READY",e}}],t&&Zn(e.prototype,t),n&&Zn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function hr(){for(var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=new pr(t,n,r),s=[];a.hasNext();)s.push(a.next());return s}function gr(){return a(hr,arguments)}function fr(e){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fr(e)}function mr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=fr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=fr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fr(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yr(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=new pr(t,n,r);return mr({},Symbol.iterator,(function(){return{next:function(){return a.hasNext()?{done:!1,value:a.next()}:{done:!0}}}}))}function Ir(){return a(yr,arguments)}function Er(e){return Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Er(e)}function Ar(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ar(Object(n),!0).forEach((function(t){Sr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ar(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Er(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Er(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Er(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nr(){for(var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=new pr(t,Cr(Cr({},n),{},{v2:!0}),r),s=[];a.hasNext();)s.push(a.next());return s}function _r(){return a(Nr,arguments)}function br(e){return br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},br(e)}function Tr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tr(Object(n),!0).forEach((function(t){Or(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Or(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=br(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=br(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==br(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dr(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=new pr(t,Pr(Pr({},n),{},{v2:!0}),r);return Or({},Symbol.iterator,(function(){return{next:function(){return a.hasNext()?{done:!1,value:a.next()}:{done:!0}}}}))}function vr(){return a(Dr,arguments)}function Rr(e,t){return pr.call(this,e,t,r)}function $r(e){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$r(e)}function xr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wr(r.key),r)}}function wr(e){var t=function(e,t){if("object"!=$r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=$r(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$r(t)?t:t+""}Rr.prototype=Object.create(pr.prototype,{}),Rr.prototype.constructor=Rr;var Mr=function(){return e=function e(t){var n=t.onCountryChange,r=t.onCallingCodeChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onCountryChange=n,this.onCallingCodeChange=r},(t=[{key:"reset",value:function(e){var t=e.country,n=e.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(t,n)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(e){for(var t=0,n=Object.keys(e);t<n.length;t++){var r=n[t];this[r]=e[r]}}},{key:"initCountryAndCallingCode",value:function(e,t){this.setCountry(e),this.setCallingCode(t)}},{key:"setCountry",value:function(e){this.country=e,this.onCountryChange(e)}},{key:"setCallingCode",value:function(e){this.callingCode=e,this.onCallingCodeChange(e,this.country)}},{key:"startInternationalNumber",value:function(e,t){this.international=!0,this.initCountryAndCallingCode(e,t)}},{key:"appendDigits",value:function(e){this.digits+=e}},{key:"appendNationalSignificantNumberDigits",value:function(e){this.nationalSignificantNumber+=e}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])&&xr(e.prototype,t),n&&xr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function Lr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ur(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ur(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Fr="x",jr=new RegExp(Fr);function kr(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function Vr(e,t){return")"===e[t]&&t++,function(e){var t=[],n=0;for(;n<e.length;)"("===e[n]?t.push(n):")"===e[n]&&t.pop(),n++;var r=0,a="";t.push(e.length);for(var s=0,o=t;s<o.length;s++){var i=o[s];a+=e.slice(r,i),r=i+1}return a}(e.slice(0,t))}function Br(e,t,n){var r=n.metadata,a=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return function(e,t,n){var r=n.metadata,a=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix;e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode;if(a(t)){var o=Gr(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:s,metadata:r});if(o)return o}return Gr(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:s,metadata:r})}(e,t,{metadata:r,shouldTryNationalPrefixFormattingRule:a,getSeparatorAfterNationalPrefix:s})}function Gr(e,t,n){var r=n.metadata,a=n.useNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix,o=Le(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:a,metadata:r});if(a||(e.nationalPrefix?o=e.nationalPrefix+s(t)+o:e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(o=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+o)),function(e,t){return ne(e)===t.getNationalDigits()}(o,e))return o}function Wr(e){return Wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wr(e)}function Hr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qr(r.key),r)}}function qr(e){var t=function(e,t){if("object"!=Wr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Wr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wr(t)?t:t+""}var zr=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"parse",value:function(e){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(e),1!==this.context.length)throw new Error("Non-finalized contexts left when pattern parse ended");var t=this.context[0],n=t.branches,r=t.instructions;if(n)return{op:"|",args:n.concat([Jr(r)])};if(0===r.length)throw new Error("Pattern is required");return 1===r.length?r[0]:r}},{key:"startContext",value:function(e){this.context.push(e)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(e){if(!e)throw new Error("Pattern is required");var t=e.match(Qr);if(t){var n=t[1],r=e.slice(0,t.index),a=e.slice(t.index+n.length);switch(n){case"(?:":r&&this.parsePattern(r),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(r&&this.parsePattern(r),0===this.getContext().instructions.length)throw new Error('No instructions found after "|" operator in an "or" group');var s=this.getContext().branches;s.push(Jr(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:s});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(r&&this.parsePattern(r),!this.getContext().branches){if(1!==this.context.length)throw new Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(Jr(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":r&&this.parsePattern(r),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:Yr(r)});break;default:throw new Error("Unknown operator: ".concat(n))}a&&this.parsePattern(a)}else{if(Kr.test(e))throw new Error("Illegal characters found in a pattern: ".concat(e));this.getContext().instructions=this.getContext().instructions.concat(e.split(""))}}}])&&Hr(e.prototype,t),n&&Hr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function Yr(e){for(var t=[],n=0;n<e.length;){if("-"===e[n]){if(0===n||n===e.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(e));for(var r=e[n-1].charCodeAt(0)+1,a=e[n+1].charCodeAt(0)-1,s=r;s<=a;)t.push(String.fromCharCode(s)),s++}else t.push(e[n]);n++}return t}var Kr=/[\(\)\[\]\?\:\|]/,Qr=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function Jr(e){return 1===e.length?e[0]:e}function Xr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Zr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ea(e){return ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ea(e)}function ta(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,na(r.key),r)}}function na(e){var t=function(e,t){if("object"!=ea(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ea(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ea(t)?t:t+""}var ra=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.matchTree=(new zr).parse(t)},t=[{key:"match",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!e)throw new Error("String is required");var n=aa(e.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||t)return n}}],t&&ta(e.prototype,t),n&&ta(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function aa(e,t,n){if("string"==typeof t){var r=e.join("");return 0===t.indexOf(r)?e.length===t.length?{match:!0,matchedChars:e}:{partialMatch:!0}:0===r.indexOf(t)?n&&e.length>t.length?{overflow:!0}:{match:!0,matchedChars:e.slice(0,t.length)}:void 0}if(Array.isArray(t)){for(var a=e.slice(),s=0;s<t.length;){var o=aa(a,t[s],n&&s===t.length-1);if(!o)return;if(o.overflow)return o;if(!o.match){if(o.partialMatch)return{partialMatch:!0};throw new Error("Unsupported match result:\n".concat(JSON.stringify(o,null,2)))}if(0===(a=a.slice(o.matchedChars.length)).length)return s===t.length-1?{match:!0,matchedChars:e}:{partialMatch:!0};s++}return n?{overflow:!0}:{match:!0,matchedChars:e.slice(0,e.length-a.length)}}switch(t.op){case"|":for(var i,c,l=Xr(t.args);!(c=l()).done;){var d=aa(e,c.value,n);if(d){if(d.overflow)return d;if(d.match)return{match:!0,matchedChars:d.matchedChars};if(!d.partialMatch)throw new Error("Unsupported match result:\n".concat(JSON.stringify(d,null,2)));i=!0}}return i?{partialMatch:!0}:void 0;case"[]":for(var u,p=Xr(t.args);!(u=p()).done;){var h=u.value;if(e[0]===h)return 1===e.length?{match:!0,matchedChars:e}:n?{overflow:!0}:{match:!0,matchedChars:[h]}}return;default:throw new Error("Unsupported instruction tree: ".concat(t))}}function sa(e){return sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sa(e)}function oa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ia(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ia(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ca(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,la(r.key),r)}}function la(e){var t=function(e,t){if("object"!=sa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=sa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==sa(t)?t:t+""}var da=kr("9",15),ua=/[- ]/,pa=function(){return/\[([^\[\]])*\]/g},ha=function(){return/\d(?=[^,}][^,}])/g},ga=new RegExp("["+d+"]*\\$1["+d+"]*(\\$\\d["+d+"]*)*$"),fa=function(){return e=function e(t){t.state;var n=t.metadata;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metadata=n,this.resetFormat()},t=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(e,t){this.resetFormat(),e?(this.isNANP="1"===e.callingCode(),this.matchingFormats=e.formats(),t.nationalSignificantNumber&&this.narrowDownMatchingFormats(t)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(e,t){var n,r,a=this;if(n=t.nationalSignificantNumber,r=this.metadata,"IS_POSSIBLE"===le(n,void 0,r))for(var s,o=oa(this.matchingFormats);!(s=o()).done;){var i=s.value,c=Br(t,i,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(e){return a.shouldTryNationalPrefixFormattingRule(e,{international:t.international,nationalPrefix:t.nationalPrefix})},getSeparatorAfterNationalPrefix:function(e){return a.getSeparatorAfterNationalPrefix(e)}});if(c)return this.resetFormat(),this.chosenFormat=i,this.setNationalNumberTemplate(c.replace(/\d/g,Fr),t),this.populatedNationalNumberTemplate=c,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(Fr),c}return this.formatNationalNumberWithNextDigits(e,t)}},{key:"formatNationalNumberWithNextDigits",value:function(e,t){var n=this.chosenFormat,r=this.chooseFormat(t);if(r)return r===n?this.formatNextNationalNumberDigits(e):this.formatNextNationalNumberDigits(t.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(e){var t=this,n=e.nationalSignificantNumber,r=e.nationalPrefix,a=e.international,s=n,o=s.length-3;o<0&&(o=0),this.matchingFormats=this.matchingFormats.filter((function(e){return t.formatSuits(e,a,r)&&t.formatMatches(e,s,o)})),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(e,t,n){return!(n&&!e.usesNationalPrefix()&&!e.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!t&&!n&&e.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(e,t,n){var r=e.leadingDigitsPatterns().length;if(0===r)return!0;n=Math.min(n,r-1);var a=e.leadingDigitsPatterns()[n];if(t.length<3)try{return void 0!==new ra(a).match(t,{allowOverflow:!0})}catch(e){return console.error(e),!0}return new RegExp("^(".concat(a,")")).test(t)}},{key:"getFormatFormat",value:function(e,t){return t?e.internationalFormat():e.format()}},{key:"chooseFormat",value:function(e){for(var t,n=this,r=function(){var r=t.value;return n.chosenFormat===r?0:ga.test(n.getFormatFormat(r,e.international))?n.createTemplateForFormat(r,e)?(n.chosenFormat=r,0):(n.matchingFormats=n.matchingFormats.filter((function(e){return e!==r})),1):1},a=oa(this.matchingFormats.slice());!(t=a()).done&&0!==r(););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(e,t){if(!(e.pattern().indexOf("|")>=0)){var n=this.getTemplateForFormat(e,t);return n?(this.setNationalNumberTemplate(n,t),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&ua.test(e.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(e,t){var n=e.IDDPrefix,r=e.missingPlus;return n?t&&!1===t.spacing?n:n+" ":r?"":"+"}},{key:"getTemplate",value:function(e){if(this.template){for(var t=-1,n=0,r=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):"";n<r.length+e.getDigitsWithoutInternationalPrefix().length;)t=this.template.indexOf(Fr,t+1),n++;return Vr(this.template,t+1)}}},{key:"setNationalNumberTemplate",value:function(e,t){this.nationalNumberTemplate=e,this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=-1,t.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(t).replace(/[\d\+]/g,Fr)+kr(Fr,t.callingCode.length)+" "+e:this.template=e}},{key:"getTemplateForFormat",value:function(e,t){var n=t.nationalSignificantNumber,r=t.international,a=t.nationalPrefix,s=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,o=e.pattern();o=o.replace(pa(),"\\d").replace(ha(),"\\d");var i=da.match(o)[0];if(!(n.length>i.length)){var c=new RegExp("^"+o+"$"),l=n.replace(/\d/g,"9");c.test(l)&&(i=l);var d,u=this.getFormatFormat(e,r);if(this.shouldTryNationalPrefixFormattingRule(e,{international:r,nationalPrefix:a})){var p=u.replace(Me,e.nationalPrefixFormattingRule());if(ne(e.nationalPrefixFormattingRule())===(a||"")+ne("$1")&&(u=p,d=!0,a))for(var h=a.length;h>0;)u=u.replace(/\d/,Fr),h--}var g=i.replace(new RegExp(o),u).replace(new RegExp("9","g"),Fr);return d||(s?g=kr(Fr,s.length)+" "+g:a&&(g=kr(Fr,a.length)+this.getSeparatorAfterNationalPrefix(e)+g)),r&&(g=we(g)),g}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,n){for(var r,a=Lr(n.split(""));!(r=a()).done;){var s=r.value;if(e.slice(t+1).search(jr)<0)return;t=e.search(jr),e=e.replace(jr,s)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(t)return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],Vr(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(e,t){var n=t.international,r=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var a=e.usesNationalPrefix();if(a&&r||!a&&!n)return!0}}}],t&&ca(e.prototype,t),n&&ca(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function ma(e){return ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ma(e)}function ya(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ia(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ia(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ea(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Aa(r.key),r)}}function Aa(e){var t=function(e,t){if("object"!=ma(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ma(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ma(t)?t:t+""}var Ca=new RegExp("^"+("["+d+c+"]+")+"$","i"),Sa="(?:[++]["+d+c+"]*|["+d+c+"]+)",Na=new RegExp("[^"+d+c+"]+.*$"),_a=/[^\d\[\]]/,ba=function(){return e=function e(t){var n=t.defaultCountry,r=t.defaultCallingCode,a=t.metadata,s=t.onNationalSignificantNumberChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defaultCountry=n,this.defaultCallingCode=r,this.metadata=a,this.onNationalSignificantNumberChange=s},(t=[{key:"input",value:function(e,t){var n,r=function(e){var t=function(e){var t=function(e){var t,n=e.search(Sa);if(!(n<0))return"+"===(e=e.slice(n))[0]&&(t=!0,e=e.slice(1)),e=e.replace(Na,""),t&&(e="+"+e),e}(e)||"";return"+"===t[0]?[t.slice(1),!0]:[t]}(e),n=ya(t,2),r=n[0],a=n[1];return Ca.test(r)||(r=""),[r,a]}(e),a=ya(r,2),s=a[0],o=a[1],i=ne(s);return o&&(t.digits||(t.startInternationalNumber(void 0,void 0),i||(n=!0))),i&&this.inputDigits(i,t),{digits:i,justLeadingPlus:n}}},{key:"inputDigits",value:function(e,t){var n=t.digits,r=n.length<3&&n.length+e.length>=3;if(t.appendDigits(e),r&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),(function(e){return t.update(e)}))}},{key:"isWaitingForCountryCallingCode",value:function(e){var t=e.international,n=e.callingCode;return t&&!n}},{key:"extractCountryCallingCode",value:function(e){var t=xe("+"+e.getDigitsWithoutInternationalPrefix(),e.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=t.countryCallingCode,r=t.number;if(n)return e.setCallingCode(n),e.update({nationalSignificantNumber:r}),!0}},{key:"reset",value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&_a.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var n=be(e,this.metadata),r=n.nationalPrefix,a=n.nationalNumber,s=n.carrierCode;if(a!==e)return this.onExtractedNationalNumber(r,s,a,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,n){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,n);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var r=be(e,this.metadata),a=r.nationalPrefix,s=r.nationalNumber,o=r.carrierCode;if(s!==t)return this.onExtractedNationalNumber(a,o,s,e,n),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,n,r,a){var s,o=!1,i=r.lastIndexOf(n);if(i<0||i!==r.length-n.length)o=!0;else{var c=r.slice(0,i);c&&c!==e&&(s=c)}a({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:n,nationalSignificantNumberIsModified:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:s}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(e){return!!this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,(function(t){return e.update(t)}))||(this.extractIddPrefix(e)||this.fixMissingPlus(e)?(this.extractCallingCodeAndNationalSignificantNumber(e),!0):void 0)}},{key:"extractIddPrefix",value:function(e){var t=e.international,n=e.IDDPrefix,r=e.digits;if(e.nationalSignificantNumber,!t&&!n){var a=_e(r,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==a&&a!==r?(e.update({IDDPrefix:r.slice(0,r.length-a.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(e){if(!e.international){var t=$e(e.digits,e.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata).countryCallingCode;if(t)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:t}),!0}}},{key:"startInternationalNumber",value:function(e,t){var n=t.country,r=t.callingCode;e.startInternationalNumber(n,r),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),(function(t){return e.update(t)}))}}])&&Ea(e.prototype,t),n&&Ea(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function Ta(e){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ta(e)}function Pa(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Oa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oa(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Da(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,va(r.key),r)}}function va(e){var t=function(e,t){if("object"!=Ta(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ta(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ta(t)?t:t+""}var Ra=function(){return e=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metadata=new R(n);var r=Pa(this.getCountryAndCallingCode(t),2),a=r[0],s=r[1];this.defaultCountry=a,this.defaultCallingCode=s,this.reset()},t=[{key:"getCountryAndCallingCode",value:function(e){var t,n;return e&&(N(e)?(t=e.defaultCountry,n=e.defaultCallingCode):t=e),t&&!this.metadata.hasCountry(t)&&(t=void 0),[t,n]}},{key:"input",value:function(e){var t=this.parser.input(e,this.state),n=t.digits;if(t.justLeadingPlus)this.formattedOutput="+";else if(n){var r;if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(r=this.formatter.format(n,this.state)),void 0===r&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var a=this.state.getNationalDigits();a&&(r=this.formatter.format(a,this.state))}this.formattedOutput=r?this.getFullNumber(r):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var e=this;return this.state=new Mr({onCountryChange:function(t){e.country=t},onCallingCodeChange:function(t,n){e.metadata.selectNumberingPlan(n||t),e.formatter.reset(e.metadata.numberingPlan,e.state),e.parser.reset(e.metadata.numberingPlan)}}),this.formatter=new fa({state:this.state,metadata:this.metadata}),this.parser=new ba({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){e.determineTheCountryIfNeeded(),e.formatter.reset(e.metadata.numberingPlan,e.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){var e=this.state.country;return e}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(e){var t=this;if(this.isInternational()){var n=function(e){return t.formatter.getInternationalPrefixBeforeCountryCallingCode(t.state,{spacing:!!e})+e},r=this.state.callingCode;return n(r?e?"".concat(r," ").concat(e):r:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return e}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var e=this.state,t=e.nationalSignificantNumber,n=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,r=e.nationalPrefix,a=t,s=n||r;return s&&(a=s+a),a}},{key:"getNonFormattedNumber",value:function(){var e=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(e?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,Fr)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:"determineTheCountry",value:function(){var e=ve(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});e!==this.state.country&&(this.state.setCountry(e),e&&this.metadata.selectNumberingPlan(e))}},{key:"getNumberValue",value:function(){var e=this.state,t=e.digits,n=e.callingCode,r=e.country,a=e.nationalSignificantNumber;if(t)return this.isInternational()?n?"+"+n+a:"+"+t:r||n?"+"+(r?this.metadata.countryCallingCode():n)+a:void 0}},{key:"getNumber",value:function(){var e=this.state,t=e.nationalSignificantNumber,n=e.carrierCode,r=e.callingCode;if(t){var a=this._getCountry();if(a||r){if(a&&a===this.defaultCountry){var s=function(e,t,n){var r=n.getCountryCodesForCallingCode(e);if(r.length>1)return Oe(t,r,n.metadata)}(this.metadata.numberingPlan.callingCode(),t,this.metadata);s&&(a=s)}var o=new et(a||r,t,this.metadata.metadata);return n&&(o.carrierCode=n),o}}}},{key:"isPossible",value:function(){var e=this.getNumber();return!!e&&e.isPossible()}},{key:"isValid",value:function(){var e=this.getNumber();return!!e&&e.isValid()}},{key:"validateLength",value:function(){var e=this.state,t=e.digits,n=e.nationalSignificantNumber;if(!t)return"NOT_A_NUMBER";if(!this.metadata.numberingPlan)return"INVALID_COUNTRY";if(!n)return"TOO_SHORT";var r=le(n,void 0,this.metadata);return"IS_POSSIBLE"!==r?r:void 0}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}],t&&Da(e.prototype,t),n&&Da(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function $a(e){return Ra.call(this,e,r)}function xa(){return a(V,arguments)}function wa(e){return new R(e).getCountries()}function Ma(){return a(wa,arguments)}function La(){return a(k,arguments)}function Ua(){return a(j,arguments)}function Fa(){return R.call(this,r)}function ja(e,t,n){if(t[e])return new et(e,t[e],n)}function ka(){return a(ja,arguments)}function Va(e,t,n){return n||(n=t,t=void 0),new Ra(t,n).input(e)}function Ba(){return a(Va,arguments)}function Ga(e){return et.call(this,e,r)}function Wa(){var e=bt(arguments);return gt(e.text,e.options,e.metadata)}function Ha(){return a(Wa,arguments)}function qa(){var e=function(e){var t,n,r,a,s=e[0],o=e[1],i=e[2],c=e[3],l=e[4];if("string"==typeof s)if("string"==typeof i)n=i,l?(r=c,a=l):a=c,t=gt(s,{defaultCountry:o,extended:!0},a);else{if("string"!=typeof o)throw new Error("`format` argument not passed to `formatNumber(number, format)`");n=o,c?(r=i,a=c):a=i,t=gt(s,{extended:!0},a)}else{if(!N(s))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");t=s,n=o,c?(r=i,a=c):a=i}"International"===n?n="INTERNATIONAL":"National"===n&&(n="NATIONAL");return{input:t,format:n,options:r,metadata:a}}(arguments);return We(e.input,e.format,e.options,e.metadata)}function za(){return a(qa,arguments)}function Ya(){var e=Ka(arguments),t=e.input,n=e.options,r=e.metadata;if(t.phone)return ye(t,n,r)}function Ka(e){var t,n,r=e[0],a=e[1],s=e[2],o=e[3],i={};if("string"==typeof r)N(a)?(s?(i=a,n=s):n=a,t=Q(r)?gt(r,void 0,n):{}):(o?(i=s,n=o):n=s,t=Q(r)?gt(r,{defaultCountry:a},n):{});else{if(!N(r))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");t=r,s?(i=a,n=s):n=a}return{input:t,options:i,metadata:n}}function Qa(){return a(Ya,arguments)}function Ja(){var e=Ka(arguments),t=e.input,n=e.options,r=e.metadata;return!!(t.phone||n&&n.v2)&&ue(t,n,r)}function Xa(){return a(Ja,arguments)}function Za(){var e=Ka(arguments),t=e.input,n=e.options,r=e.metadata;return!!t.phone&&Ee(t,n,r)}function es(){return a(Za,arguments)}function ts(e,t,n){if("string"!=typeof e)throw new TypeError("number must be a string");if("string"!=typeof t)throw new TypeError("country must be a string");return function(e,t,n,r){return n=n||{},e.country===t&&Ee(e,n,r)}(Q(e)?gt(e,{defaultCountry:t},n):{},t,void 0,n)}function ns(){return a(ts,arguments)}function rs(e){return rs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rs(e)}function as(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ss(r.key),r)}}function ss(e){var t=function(e,t){if("object"!=rs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=rs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rs(t)?t:t+""}$a.prototype=Object.create(Ra.prototype,{}),$a.prototype.constructor=$a,Fa.prototype=Object.create(R.prototype,{}),Fa.prototype.constructor=Fa,Ga.prototype=et.prototype,Ga.prototype.constructor=Ga;var os=new RegExp("^["+l+"]+"),is=new RegExp("["+d+"]+$"),cs=function(){return e=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=t,this.options=n||{},this.metadata=r,this.state="NOT_READY",this.regexp=new RegExp(Y,"ig")},t=[{key:"find",value:function(){var e=this.regexp.exec(this.text);if(e){var t=e[0],n=e.index;t=t.replace(os,""),n+=e[0].length-t.length,t=Ln(t=t.replace(is,""));var r=this.parseCandidate(t,n);return r||this.find()}}},{key:"parseCandidate",value:function(e,t){if(kn(e,t,this.text)&&Kn(e,t,this.text,this.options.extended?"POSSIBLE":"VALID")){var n=gt(e,this.options,this.metadata);if(n.phone)return n.startsAt=t,n.endsAt=t+e.length,n}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.last_match=this.find(),this.last_match?this.state="READY":this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var e=this.last_match;return this.last_match=null,this.state="NOT_READY",e}}],t&&as(e.prototype,t),n&&as(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();W();function ls(){var e=bt(arguments);return function(e,t,n){void 0===t&&(t={});for(var r=new cs(e,t,n),a=[];r.hasNext();)a.push(r.next());return a}(e.text,e.options,e.metadata)}function ds(){var e=bt(arguments);return function(e,t,n){void 0===t&&(t={});var r=new cs(e,t,n),a={};return a[Symbol.iterator]=function(){return{next:function(){return r.hasNext()?{done:!1,value:r.next()}:{done:!0}}}},a}(e.text,e.options,e.metadata)}function us(){return a(ls,arguments)}function ps(){return a(ds,arguments)}function hs(e,t){cs.call(this,e,t,r)}hs.prototype=Object.create(cs.prototype,{}),hs.prototype.constructor=hs}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{buildContextName:()=>Hr,buildModalContext:()=>Kr,buildTransientContextName:()=>qr,getContainerIdFromContext:()=>Jr,getParentContext:()=>Qr,getParentContextName:()=>Wr,getTargetFromContext:()=>Yr,getTransientContext:()=>zr});var t={};n.r(t),n.d(t,{getResolvedTargetName:()=>js,getRoutingInfo:()=>ks,getSemanticURLFromRoutingInfo:()=>Vs});var r={};n.r(r),n.d(r,{evaluate:()=>Eo,handleChange:()=>yo,hasDeclareExpression:()=>mo,updateDeclareExpressions:()=>Io});var a={};n.r(a),n.d(a,{hasBrowserEnv:()=>Gi,hasStandardBrowserEnv:()=>Hi,hasStandardBrowserWebWorkerEnv:()=>qi,navigator:()=>Wi,origin:()=>zi});var s={};n.r(s),n.d(s,{publishExpressions:()=>dp,publishMetadata:()=>lp,publishResponse:()=>up});var o={};n.r(o),n.d(o,{doesRestApiExist:()=>yp,getCancelTokenSource:()=>Ip,getCaseApi:()=>Cp,getHeaderProcessor:()=>gp,invokeCustomRestApi:()=>mp,invokeRestApi:()=>fp,isRequestCanceled:()=>Ep,registerInterceptor:()=>Ap});var i={};n.r(i),n.d(i,{fetchViewResources:()=>yf,refreshViewByName:()=>Af,updateViewResources:()=>mf});var c={};n.r(c),n.d(c,{CONTAINER_NAMES:()=>bI,CONTAINER_TYPES:()=>_I,addRootContainerItem:()=>iE,areContainerItemsPresent:()=>xI,cleanupTransientContainer:()=>fE,clearContainerItems:()=>yE,clearTransientData:()=>hE,closeContainerItem:()=>oE,getActiveContainerItemContext:()=>HI,getActiveContainerItemIDFromRoutingInfo:()=>PE,getActiveContainerItemName:()=>VI,getActiveContext:()=>NE,getChildContainerItemId:()=>DI,getChildContainerItems:()=>qI,getChildContainers:()=>zI,getChildContainersContexts:()=>YI,getContainerAPI:()=>IE,getContainerAccessOrder:()=>$I,getContainerData:()=>OI,getContainerItemByKey:()=>FI,getContainerItemData:()=>vI,getContainerItemName:()=>LI,getContainerItems:()=>RI,getContainerLimit:()=>ZI,getContainerParentContext:()=>TE,getContainerType:()=>kI,getContextByTargetAndKey:()=>bE,getDataContextName:()=>WI,getFlowContainer:()=>DE,getLeastRecentlyUsedNonDirtyContainerItemID:()=>aE,getParentContainerItem:()=>OE,getRootContainerName:()=>SE,getSuggestionContexts:()=>KI,getTargetFromContainerItemID:()=>sE,getTransientItems:()=>dE,hasContainerItems:()=>XI,isContainerDirty:()=>rE,isContainerInitialized:()=>jI,isContainerItemActive:()=>BI,isContainerItemContextBeingUsedInOtherContainers:()=>lE,isContainerItemExists:()=>wI,isContainerItemExistsWithoutKey:()=>MI,isContainerLimitReached:()=>tE,isContainerMultipleMode:()=>JI,isContainerSingleMode:()=>QI,purgeTransientData:()=>gE,removeContainer:()=>EE,replaceTransientData:()=>pE,resetContainersPayload:()=>nE,setContainerLimit:()=>eE,updateCaseContextEtag:()=>CE,updateParentLastUpdateTime:()=>_E,updateRelatedContextEtag:()=>AE,updateTransientData:()=>uE});var l={};n.r(l),n.d(l,{beginDesignerRefresh:()=>CA,endDesignerRefresh:()=>SA,getAIAgent:()=>LA,getAdditionalInfo:()=>VA,getDataPageKeys:()=>FA,getDataPageMetadata:()=>OA,getDesignerViewStoreVersion:()=>AA,getEditableFieldConfigUtil:()=>GA,getEmbeddedPropertyMetadata:()=>IA,getFieldParameters:()=>$A,getFieldsByClassName:()=>RA,getFormat:()=>wA,getGenAICoach:()=>MA,getInsight:()=>vA,getLocaleUtilsForLanguage:()=>mA,getLocalizationServiceFromStore:()=>yA,getLookUpDataPage:()=>jA,getLookUpDataPageInfo:()=>kA,getParagraph:()=>xA,getPersonalizationMetadata:()=>DA,getPropertyMetadata:()=>fA,getResolvedFieldMetadata:()=>BA,getSavableDataPage:()=>UA,isViewExists:()=>TA,mergeStore:()=>gA,resolveNavigation:()=>PA,resolveView:()=>bA,updateNavigationStore:()=>NA,updateStores:()=>_A,updateViewStore:()=>EA});var d={};n.r(d),n.d(d,{dispatch:()=>QA,doesContextExist:()=>uC,getActionType:()=>rC,getContextValue:()=>tC,getDataObject:()=>JA,getReferenceTokens:()=>zA,getSharedDataObject:()=>XA,getStore:()=>KA,getValue:()=>eC,isMergeable:()=>sC,lookupContextValue:()=>nC,mergeDeep:()=>iC,performReplaceAndRearrange:()=>oC,removeItem:()=>aC,replaceValue:()=>lC,resetStore:()=>dC,setStore:()=>YA,updateValue:()=>cC});var u={};n.r(u),n.d(u,{activateContainerItem:()=>BC,addContainerItem:()=>$C,addMessages:()=>GC,addSharedData:()=>ZC,addTransientItem:()=>xC,addWork:()=>OC,clearTransientData:()=>MC,createWork:()=>SC,error:()=>XC,finishAssignment:()=>YC,initContainers:()=>vC,listAction:()=>tS,loadView:()=>TC,mergeData:()=>_C,openAssignment:()=>KC,openWorkByHandle:()=>DC,postProcess:()=>JC,purgeTransientData:()=>UC,removeAllTransientItems:()=>HC,removeContainerItem:()=>WC,removeSharedData:()=>eS,removeTransientItem:()=>qC,replaceContainerItem:()=>zC,replaceTransientData:()=>LC,resetContainers:()=>RC,resetLoading:()=>kC,setLoading:()=>jC,setSharedProperty:()=>rS,setStateProperty:()=>aS,showCasePreview:()=>nS,showHarness:()=>bC,showHistory:()=>QC,showPage:()=>PC,upMergeAndRemoveContainerItem:()=>VC,updateContainerItem:()=>FC,updateTransientData:()=>wC});var p={};n.r(p),n.d(p,{buildResizeMessage:()=>ZO,mashup:()=>eD});const h=function(){this.__data__=[],this.size=0};const g=function(e,t){return e===t||e!=e&&t!=t};const f=function(e,t){for(var n=e.length;n--;)if(g(e[n][0],t))return n;return-1};var m=Array.prototype.splice;const y=function(e){var t=this.__data__,n=f(t,e);return!(n<0)&&(n==t.length-1?t.pop():m.call(t,n,1),--this.size,!0)};const I=function(e){var t=this.__data__,n=f(t,e);return n<0?void 0:t[n][1]};const E=function(e){return f(this.__data__,e)>-1};const A=function(e,t){var n=this.__data__,r=f(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function C(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}C.prototype.clear=h,C.prototype.delete=y,C.prototype.get=I,C.prototype.has=E,C.prototype.set=A;const S=C;const N=function(){this.__data__=new S,this.size=0};const _=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 T=function(e){return this.__data__.has(e)};const P="object"==typeof global&&global&&global.Object===Object&&global;var O="object"==typeof self&&self&&self.Object===Object&&self;const D=P||O||Function("return this")();const v=D.Symbol;var R=Object.prototype,$=R.hasOwnProperty,x=R.toString,w=v?v.toStringTag:void 0;const M=function(e){var t=$.call(e,w),n=e[w];try{e[w]=void 0;var r=!0}catch(e){}var a=x.call(e);return r&&(t?e[w]=n:delete e[w]),a};var L=Object.prototype.toString;const U=function(e){return L.call(e)};var F=v?v.toStringTag:void 0;const j=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?M(e):U(e)};const k=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const V=function(e){if(!k(e))return!1;var t=j(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const B=D["__core-js_shared__"];var G,W=(G=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"";const H=function(e){return!!W&&W in e};var q=Function.prototype.toString;const z=function(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Y=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,J=K.toString,X=Q.hasOwnProperty,Z=RegExp("^"+J.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const ee=function(e){return!(!k(e)||H(e))&&(V(e)?Z:Y).test(z(e))};const te=function(e,t){return null==e?void 0:e[t]};const ne=function(e,t){var n=te(e,t);return ee(n)?n:void 0};const re=ne(D,"Map");const ae=ne(Object,"create");const se=function(){this.__data__=ae?ae(null):{},this.size=0};const oe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var ie=Object.prototype.hasOwnProperty;const ce=function(e){var t=this.__data__;if(ae){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ie.call(t,e)?t[e]:void 0};var le=Object.prototype.hasOwnProperty;const de=function(e){var t=this.__data__;return ae?void 0!==t[e]:le.call(t,e)};const ue=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ae&&void 0===t?"__lodash_hash_undefined__":t,this};function pe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pe.prototype.clear=se,pe.prototype.delete=oe,pe.prototype.get=ce,pe.prototype.has=de,pe.prototype.set=ue;const he=pe;const ge=function(){this.size=0,this.__data__={hash:new he,map:new(re||S),string:new he}};const fe=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const me=function(e,t){var n=e.__data__;return fe(t)?n["string"==typeof t?"string":"hash"]:n.map};const ye=function(e){var t=me(this,e).delete(e);return this.size-=t?1:0,t};const Ie=function(e){return me(this,e).get(e)};const Ee=function(e){return me(this,e).has(e)};const Ae=function(e,t){var n=me(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ce.prototype.clear=ge,Ce.prototype.delete=ye,Ce.prototype.get=Ie,Ce.prototype.has=Ee,Ce.prototype.set=Ae;const Se=Ce;const Ne=function(e,t){var n=this.__data__;if(n instanceof S){var r=n.__data__;if(!re||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Se(r)}return n.set(e,t),this.size=n.size,this};function _e(e){var t=this.__data__=new S(e);this.size=t.size}_e.prototype.clear=N,_e.prototype.delete=_,_e.prototype.get=b,_e.prototype.has=T,_e.prototype.set=Ne;const be=_e;const Te=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Pe=function(e){return this.__data__.has(e)};function Oe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Se;++t<n;)this.add(e[t])}Oe.prototype.add=Oe.prototype.push=Te,Oe.prototype.has=Pe;const De=Oe;const ve=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const Re=function(e,t){return e.has(t)};const $e=function(e,t,n,r,a,s){var o=1&n,i=e.length,c=t.length;if(i!=c&&!(o&&c>i))return!1;var l=s.get(e),d=s.get(t);if(l&&d)return l==t&&d==e;var u=-1,p=!0,h=2&n?new De:void 0;for(s.set(e,t),s.set(t,e);++u<i;){var g=e[u],f=t[u];if(r)var m=o?r(f,g,u,t,e,s):r(g,f,u,e,t,s);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!ve(t,(function(e,t){if(!Re(h,t)&&(g===e||a(g,e,n,r,s)))return h.push(t)}))){p=!1;break}}else if(g!==f&&!a(g,f,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p};const xe=D.Uint8Array;const we=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const Me=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Le=v?v.prototype:void 0,Ue=Le?Le.valueOf:void 0;const Fe=function(e,t,n,r,a,s,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||!s(new xe(e),new xe(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return g(+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=we;case"[object Set]":var c=1&r;if(i||(i=Me),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var d=$e(i(e),i(t),r,a,s,o);return o.delete(e),d;case"[object Symbol]":if(Ue)return Ue.call(e)==Ue.call(t)}return!1};const je=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e};const ke=Array.isArray;const Ve=function(e,t,n){var r=t(e);return ke(e)?r:je(r,n(e))};const Be=function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[a++]=o)}return s};const Ge=function(){return[]};var We=Object.prototype.propertyIsEnumerable,He=Object.getOwnPropertySymbols;const qe=He?function(e){return null==e?[]:(e=Object(e),Be(He(e),(function(t){return We.call(e,t)})))}:Ge;const ze=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const Ye=function(e){return null!=e&&"object"==typeof e};const Ke=function(e){return Ye(e)&&"[object Arguments]"==j(e)};var Qe=Object.prototype,Je=Qe.hasOwnProperty,Xe=Qe.propertyIsEnumerable;const Ze=Ke(function(){return arguments}())?Ke:function(e){return Ye(e)&&Je.call(e,"callee")&&!Xe.call(e,"callee")};const et=function(){return!1};var tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,nt=tt&&"object"==typeof module&&module&&!module.nodeType&&module,rt=nt&&nt.exports===tt?D.Buffer:void 0;const at=(rt?rt.isBuffer:void 0)||et;var st=/^(?:0|[1-9]\d*)$/;const ot=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&st.test(e))&&e>-1&&e%1==0&&e<t};const it=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object Boolean]"]=ct["[object DataView]"]=ct["[object Date]"]=ct["[object Error]"]=ct["[object Function]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object WeakMap]"]=!1;const lt=function(e){return Ye(e)&&it(e.length)&&!!ct[j(e)]};const dt=function(e){return function(t){return e(t)}};var ut="object"==typeof exports&&exports&&!exports.nodeType&&exports,pt=ut&&"object"==typeof module&&module&&!module.nodeType&&module,ht=pt&&pt.exports===ut&&P.process,gt=function(){try{var e=pt&&pt.require&&pt.require("util").types;return e||ht&&ht.binding&&ht.binding("util")}catch(e){}}();var ft=gt&>.isTypedArray;const mt=ft?dt(ft):lt;var yt=Object.prototype.hasOwnProperty;const It=function(e,t){var n=ke(e),r=!n&&Ze(e),a=!n&&!r&&at(e),s=!n&&!r&&!a&&mt(e),o=n||r||a||s,i=o?ze(e.length,String):[],c=i.length;for(var l in e)!t&&!yt.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ot(l,c))||i.push(l);return i};var Et=Object.prototype;const At=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Et)};const Ct=function(e,t){return function(n){return e(t(n))}};const St=Ct(Object.keys,Object);var Nt=Object.prototype.hasOwnProperty;const _t=function(e){if(!At(e))return St(e);var t=[];for(var n in Object(e))Nt.call(e,n)&&"constructor"!=n&&t.push(n);return t};const bt=function(e){return null!=e&&it(e.length)&&!V(e)};const Tt=function(e){return bt(e)?It(e):_t(e)};const Pt=function(e){return Ve(e,Tt,qe)};var Ot=Object.prototype.hasOwnProperty;const Dt=function(e,t,n,r,a,s){var o=1&n,i=Pt(e),c=i.length;if(c!=Pt(t).length&&!o)return!1;for(var l=c;l--;){var d=i[l];if(!(o?d in t:Ot.call(t,d)))return!1}var u=s.get(e),p=s.get(t);if(u&&p)return u==t&&p==e;var h=!0;s.set(e,t),s.set(t,e);for(var g=o;++l<c;){var f=e[d=i[l]],m=t[d];if(r)var y=o?r(m,f,d,t,e,s):r(f,m,d,e,t,s);if(!(void 0===y?f===m||a(f,m,n,r,s):y)){h=!1;break}g||(g="constructor"==d)}if(h&&!g){var I=e.constructor,E=t.constructor;I==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof I&&I instanceof I&&"function"==typeof E&&E instanceof E||(h=!1)}return s.delete(e),s.delete(t),h};const vt=ne(D,"DataView");const Rt=ne(D,"Promise");const $t=ne(D,"Set");const xt=ne(D,"WeakMap");var wt="[object Map]",Mt="[object Promise]",Lt="[object Set]",Ut="[object WeakMap]",Ft="[object DataView]",jt=z(vt),kt=z(re),Vt=z(Rt),Bt=z($t),Gt=z(xt),Wt=j;(vt&&Wt(new vt(new ArrayBuffer(1)))!=Ft||re&&Wt(new re)!=wt||Rt&&Wt(Rt.resolve())!=Mt||$t&&Wt(new $t)!=Lt||xt&&Wt(new xt)!=Ut)&&(Wt=function(e){var t=j(e),n="[object Object]"==t?e.constructor:void 0,r=n?z(n):"";if(r)switch(r){case jt:return Ft;case kt:return wt;case Vt:return Mt;case Bt:return Lt;case Gt:return Ut}return t});const Ht=Wt;var qt="[object Arguments]",zt="[object Array]",Yt="[object Object]",Kt=Object.prototype.hasOwnProperty;const Qt=function(e,t,n,r,a,s){var o=ke(e),i=ke(t),c=o?zt:Ht(e),l=i?zt:Ht(t),d=(c=c==qt?Yt:c)==Yt,u=(l=l==qt?Yt:l)==Yt,p=c==l;if(p&&at(e)){if(!at(t))return!1;o=!0,d=!1}if(p&&!d)return s||(s=new be),o||mt(e)?$e(e,t,n,r,a,s):Fe(e,t,c,n,r,a,s);if(!(1&n)){var h=d&&Kt.call(e,"__wrapped__"),g=u&&Kt.call(t,"__wrapped__");if(h||g){var f=h?e.value():e,m=g?t.value():t;return s||(s=new be),a(f,m,n,r,s)}}return!!p&&(s||(s=new be),Dt(e,t,n,r,a,s))};const Jt=function e(t,n,r,a,s){return t===n||(null==t||null==n||!Ye(t)&&!Ye(n)?t!=t&&n!=n:Qt(t,n,r,a,e,s))};const Xt=function(e,t){return Jt(e,t)};let Zt,en,tn;const nn=e=>{e&&(Zt=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},Zt.BASEURL=e.server,Zt.ACTIONURL=e["action-end-point"],Zt.DATAURL=e["data-end-point"],tn=e.reAuthUrl)},rn=()=>tn,an=()=>Zt.BASEURL,sn=e=>fetch(`${Zt.BASEURL}${Zt.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),on=e=>{en=e},cn=()=>en;var ln=n(953);const dn=function(e){return"symbol"==typeof e||Ye(e)&&"[object Symbol]"==j(e)};var un=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pn=/^\w*$/;const hn=function(e,t){if(ke(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!dn(e))||(pn.test(e)||!un.test(e)||null!=t&&e in Object(t))};function gn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],s=n.cache;if(s.has(a))return s.get(a);var o=e.apply(this,r);return n.cache=s.set(a,o)||s,o};return n.cache=new(gn.Cache||Se),n}gn.Cache=Se;const fn=gn;const mn=function(e){var t=fn(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t};var yn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,In=/\\(\\)?/g;const En=mn((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(yn,(function(e,n,r,a){t.push(r?a.replace(In,"$1"):n||e)})),t}));const An=function(e,t){for(var n=-1,r=null==e?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a};var Cn=v?v.prototype:void 0,Sn=Cn?Cn.toString:void 0;const Nn=function e(t){if("string"==typeof t)return t;if(ke(t))return An(t,e)+"";if(dn(t))return Sn?Sn.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};const _n=function(e){return null==e?"":Nn(e)};const bn=function(e,t){return ke(e)?e:hn(e,t)?[e]:En(_n(e))};const Tn=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const Pn=function(e){if("string"==typeof e||dn(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};const On=function(e,t){for(var n=0,r=(t=bn(t,e)).length;null!=e&&n<r;)e=e[Pn(t[n++])];return n&&n==r?e:void 0};const Dn=function(e,t,n){var r=-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 s=Array(a);++r<a;)s[r]=e[r+t];return s};const vn=function(e,t){return t.length<2?e:On(e,Dn(t,0,-1))};var Rn=Object.prototype.hasOwnProperty;const $n=function(e,t){var n=-1,r=(t=bn(t,e)).length;if(!r)return!0;for(;++n<r;){var a=Pn(t[n]);if("__proto__"===a&&!Rn.call(e,"__proto__"))return!1;if(("constructor"===a||"prototype"===a)&&n<r-1)return!1}var s=vn(e,t);return null==s||delete s[Pn(Tn(t))]};const xn=function(e,t){return null==e||$n(e,t)};var wn=Object.prototype.hasOwnProperty;const Mn=function(e,t){return null!=e&&wn.call(e,t)};const Ln=function(e,t,n){for(var r=-1,a=(t=bn(t,e)).length,s=!1;++r<a;){var o=Pn(t[r]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++r!=a?s:!!(a=null==e?0:e.length)&&it(a)&&ot(o,a)&&(ke(e)||Ze(e))};const Un=function(e,t){return null!=e&&Ln(e,t,Mn)};const Fn=function(e,t,n){var r=null==e?void 0:On(e,t);return void 0===r?n:r};const jn=function(){try{var e=ne(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const kn=function(e,t,n){"__proto__"==t&&jn?jn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var Vn=Object.prototype.hasOwnProperty;const Bn=function(e,t,n){var r=e[t];Vn.call(e,t)&&g(r,n)&&(void 0!==n||t in e)||kn(e,t,n)};const Gn=function(e,t,n,r){if(!k(e))return e;for(var a=-1,s=(t=bn(t,e)).length,o=s-1,i=e;null!=i&&++a<s;){var c=Pn(t[a]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(a!=o){var d=i[c];void 0===(l=r?r(d,c,i):void 0)&&(l=k(d)?d:ot(t[a+1])?[]:{})}Bn(i,c,l),i=i[c]}return e};const Wn=function(e,t,n){return null==e?e:Gn(e,t,n)};const Hn=function(e,t,n){(void 0!==n&&!g(e[t],n)||void 0===n&&!(t in e))&&kn(e,t,n)};const qn=function(e){return function(t,n,r){for(var a=-1,s=Object(t),o=r(t),i=o.length;i--;){var c=o[e?i:++a];if(!1===n(s[c],c,s))break}return t}}();var zn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Yn=zn&&"object"==typeof module&&module&&!module.nodeType&&module,Kn=Yn&&Yn.exports===zn?D.Buffer:void 0,Qn=Kn?Kn.allocUnsafe:void 0;const Jn=function(e,t){if(t)return e.slice();var n=e.length,r=Qn?Qn(n):new e.constructor(n);return e.copy(r),r};const Xn=function(e){var t=new e.constructor(e.byteLength);return new xe(t).set(new xe(e)),t};const Zn=function(e,t){var n=t?Xn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const er=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var tr=Object.create;const nr=function(){function e(){}return function(t){if(!k(t))return{};if(tr)return tr(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const rr=Ct(Object.getPrototypeOf,Object);const ar=function(e){return"function"!=typeof e.constructor||At(e)?{}:nr(rr(e))};const sr=function(e){return Ye(e)&&bt(e)};var or=Function.prototype,ir=Object.prototype,cr=or.toString,lr=ir.hasOwnProperty,dr=cr.call(Object);const ur=function(e){if(!Ye(e)||"[object Object]"!=j(e))return!1;var t=rr(e);if(null===t)return!0;var n=lr.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&cr.call(n)==dr};const pr=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};const hr=function(e,t,n,r){var a=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var i=t[s],c=r?r(n[i],e[i],i,n,e):void 0;void 0===c&&(c=e[i]),a?kn(n,i,c):Bn(n,i,c)}return n};const gr=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var fr=Object.prototype.hasOwnProperty;const mr=function(e){if(!k(e))return gr(e);var t=At(e),n=[];for(var r in e)("constructor"!=r||!t&&fr.call(e,r))&&n.push(r);return n};const yr=function(e){return bt(e)?It(e,!0):mr(e)};const Ir=function(e){return hr(e,yr(e))};const Er=function(e,t,n,r,a,s,o){var i=pr(e,n),c=pr(t,n),l=o.get(c);if(l)Hn(e,n,l);else{var d=s?s(i,c,n+"",e,t,o):void 0,u=void 0===d;if(u){var p=ke(c),h=!p&&at(c),g=!p&&!h&&mt(c);d=c,p||h||g?ke(i)?d=i:sr(i)?d=er(i):h?(u=!1,d=Jn(c,!0)):g?(u=!1,d=Zn(c,!0)):d=[]:ur(c)||Ze(c)?(d=i,Ze(i)?d=Ir(i):k(i)&&!V(i)||(d=ar(c))):u=!1}u&&(o.set(c,d),a(d,c,r,s,o),o.delete(c)),Hn(e,n,d)}};const Ar=function e(t,n,r,a,s){t!==n&&qn(n,(function(o,i){if(s||(s=new be),k(o))Er(t,n,i,r,e,a,s);else{var c=a?a(pr(t,i),o,i+"",t,n,s):void 0;void 0===c&&(c=o),Hn(t,i,c)}}),yr)};const Cr=function(e){return e};const Sr=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 Nr=Math.max;const _r=function(e,t,n){return t=Nr(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=Nr(r.length-t,0),o=Array(s);++a<s;)o[a]=r[t+a];a=-1;for(var i=Array(t+1);++a<t;)i[a]=r[a];return i[t]=n(o),Sr(e,this,i)}};const br=function(e){return function(){return e}};const Tr=jn?function(e,t){return jn(e,"toString",{configurable:!0,enumerable:!1,value:br(t),writable:!0})}:Cr;var Pr=Date.now;const Or=function(e){var t=0,n=0;return function(){var r=Pr(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Tr);const Dr=function(e,t){return Or(_r(e,t,Cr),e+"")};const vr=function(e,t,n){if(!k(n))return!1;var r=typeof t;return!!("number"==r?bt(n)&&ot(t,n.length):"string"==r&&t in n)&&g(n[t],e)};const Rr=function(e){return Dr((function(t,n){var r=-1,a=n.length,s=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(a--,s):void 0,o&&vr(n[0],n[1],o)&&(s=a<3?void 0:s,a=1),t=Object(t);++r<a;){var i=n[r];i&&e(t,i,r,s)}return t}))}((function(e,t,n,r){Ar(e,t,n,r)}));var $r=Object.prototype.hasOwnProperty;const xr=function(e){if(null==e)return!0;if(bt(e)&&(ke(e)||"string"==typeof e||"function"==typeof e.splice||at(e)||mt(e)||Ze(e)))return!e.length;var t=Ht(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(At(e))return!_t(e).length;for(var n in e)if($r.call(e,n))return!1;return!0};class wr{static setNamespaceSupport=(e=!1)=>{wr.namespaceEnabled=e};static isNamespaceEnabled=()=>wr.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(!wr.isNamespaceEnabled())return e;const n=wr.getNamespaceList();if(Array.isArray(n)){if(n.some((t=>{const n=`${t}__`;return e.startsWith(n)})))return e}return`${t}__${e}`};static getDefaultQualifiedName=e=>wr.getQualifiedName(e,"PegaPlatform");static namespacePrefixedRuleName(e,t){return t?wr.getQualifiedName(e,t):wr.getDefaultQualifiedName(e)}static getQualifiedNameForComplexRuleReferences(e,t){const{namespace:n,marker:r}=t??{},a=`${r??"caseInfo.content"}.`,s=e.lastIndexOf(a);if(-1!==s){return e.slice(0,s+a.length)+e.slice(s+a.length).split(".").map((e=>wr.namespacePrefixedRuleName(e,n))).join(".")}if(e.includes(".")){const t=e.startsWith("."),r=(t?e.slice(1):e).split(".").filter(Boolean).map((e=>wr.namespacePrefixedRuleName(e,n))).join(".");return t?`.${r}`:r}return wr.namespacePrefixedRuleName(e,n)}}const Mr=wr;const Lr=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")}},Ur={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:Mr.getDefaultQualifiedName("pyCaseTab"),DATA_OBJECT_CREATE_VIEW:Mr.getDefaultQualifiedName("Create"),DATA_OBJECT_EDIT_VIEW:Mr.getDefaultQualifiedName("pyEdit"),PY_DATA_PREVIEW:Mr.getDefaultQualifiedName("pyDataPreview"),PY_DETAILS:Mr.getDefaultQualifiedName("pyDetails"),OBJECT_CREATE_VIEW:"Create",SUBSCRIPT_CREATE_VIEW:Mr.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:Mr.getDefaultQualifiedName("D_pyGetUserWorkListByUserId"),D__WORK_BASKET:Mr.getDefaultQualifiedName("D_WorkBasket"),D__PY_MY_WORK_LIST:Mr.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:Mr.getDefaultQualifiedName("pzCreateDetails"),PREVIEW_VIEW_NAME:Mr.getDefaultQualifiedName("pyCasePreview"),CASESUMMARY_VIEW_NAME:"pyCaseSummary",APPSHELL_ACTIVE_CASES:"appshell-activecases",TRACE_ID:"x-b3-traceid",LOAD_VIEW_STRING:"View",PRIMARY:"primary",DEFER_UPDATE_CASESUMMARY_VIEW:"deferUpdateCaseSummaryView",NEXT_ASSIGNMENT_INFO_ID:"nextAssignmentInfo.ID",WORKCLASS:"Work-",DATA_INFO:{DATA_INFO:"dataInfo",DATA_INFO_CONTENT:"dataInfo.content",DATA_INFO_CONTEXT_KEY:"dataInfo.contextKey"},OBJECT_INFO:{OBJECT_INFO:"objectInfo",OBJECT_INFO_ID:"objectInfo.ID",OBJECT_INFO_CONTENT:"objectInfo.content",ACTIVE_ACTION_ID:"objectInfo.activeActionID",OBJECT_INFO_CONTENT_CLASS_ID:"objectInfo.content.classID"},CASE_INFO:{CASE_INFO:"caseInfo",CASE_INFO_COLLABORATORS:"caseInfo.collaborators",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_ENCRYPTED_CONTENT:"caseInfo.encryptedContent",CASE_INFO_NAME:"caseInfo.name",CASE_INFO_ID:"caseInfo.ID",CASE_INFO_CLASSID:"caseInfo.content.classID",CASE_INFO_CLASSNAME:"caseInfo.className",CASE_TYPE_ID:"caseInfo.caseTypeID",CASE_TYPE_NAME:"caseInfo.caseTypeName",CASE_INFO_PZINSKEY:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pzInsKey"),CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:Mr.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:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyApprovalResult"),DUPLICATECASEFLAG:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateCaseActions"),DUPLICATECASEID:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateID"),DUPLICATECASEINSKEY:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateCaseReference.pzInsKey"),HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",IS_ASSIGNMENT:"caseInfo.isAssignment",GETNEXTWORK:"caseInfo.confirmationLinks.getNextWork",ACTION_REFRESH_CONDITIONS:"caseInfo.assignments[0].actions[0].refreshConditions",IS_LOCAL_ACTION:"caseInfo.isLocalAction",BUSINESS_ID:"caseInfo.businessID",IS_FIRST_ASSIGNMENT:"caseInfo.isFirstAssignment",CASE_INFO_ATTACHMENTS:"caseInfo.attachments"},ACTIONS:{ACTION_ID:"actionID",ACTIONS:"availableActions",DELETEAVIALACTIONS:"deleteAvailActions",FLOWACTION:"FlowAction",DATA_PAGES:{D_PY_ADDITIONAL_CASE_ACTIONS:Mr.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:Mr.getDefaultQualifiedName("pyTransferAssignment")},CONTENT:"content",MODAL:"modal",ACTIONAREA:"actionarea",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:Mr.getQualifiedNameForComplexRuleReferences("context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime"),SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:Mr.getQualifiedNameForComplexRuleReferences("context_data.caseInfo.content.summary_of_attachments__.lastRefreshTime"),CONTEXT_DATA_ASSIGNMENTID:"context_data.assignmentID",BANNER_VARIANT_SUCCESS:"success",BANNER_VARIANT_WARNING:"warning",BANNER_VARIANT_URGENT:"urgent",BANNER_VARIANT_INFO:"info",INVALID_INPUTS:"Invalid inputs",VALIDATION_FAIL:"Validation fail",MESSAGES:{MESSAGES_TYPE_SUCCESS:"success",MESSAGES_TYPE_INFO:"info",MESSAGES_TYPE_ERROR:"error"},PUB_SUB_EVENTS:{EVENT_RENDER_APP:"renderApp",EVENT_UNMOUNT_APP:"unmountApp",EVENT_REAUTH:"reAuth",EVENT_FULL_REAUTH:"fullReAuth",EVENT_CUSTOM_REAUTH:"customReAuth",EVENT_CANCEL:"cancel",EVENT_MINIMIZE:"minimize",EVENT_EXPRESS_LOCALACTION:"expressLocalActionSubmit",EVENT_BULKACTION:"bulkActionSubmit",EVENT_SHOW_CANCEL_ALERT:"showCancelAlert",EVENT_SHOW_DELETE_ALERT:"showDeleteAlert",EVENT_DASHBOARD_FILTER_CHANGE:"dashboardFilterChange",EVENT_DASHBOARD_FILTER_CLEAR_ALL:"dashboardFilterClearAll",EVENT_PROMOTED_FILTERS_CHANGE:"promotedFiltersChange",EVENT_LOCALACTION_SUBMISSION:"localActionSubmit",EVENT_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{INSPECTOR:"inspector",INSPECTOR_SHOW_ALL:"inspectorShowAll",UI_DESIGNER:"uiDesigner",UI_DESIGNER_TOOLBAR_EXPANDED:"uiDesignerToolbarExpanded",SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted",THEME_CHANGE:"themeChange",THEME_MODE_CHANGE:"themeModeChange",NAV_ORIENTATION_CHANGE:"navOrientationChange",CASE_VIEW_TEMPLATE_CHANGE:"caseViewTemplateChange"},CASE_EVENTS:{CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW:"caseAttachmentsUpdateFromCaseview",CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW:"caseFollowerUpdateByOperatorFromCaseview",CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET:"caseFollowerUpdateByOperatorFromWidget",CASE_CREATED:"caseCreated",CREATE_STAGE_DONE:"caseCreatedDone",CREATE_STAGE_CANCELLED:"caseCancelled",CREATE_STAGE_SAVED:"caseSaved",CREATE_STAGE_DELETED:"caseDeleted",ASSIGNMENT_SUBMISSION:"assignmentSubmission",END_OF_ASSIGNMENT_PROCESSING:"endOfAssignmentProcessing",CLOSE_CONFIRM_VIEW:"closeConfirmView",CASE_OPENED:"caseOpened",CASE_VIEW_OPENED_AFTER_CREATE:"caseViewOpenedAfterCreate",CASE_CLOSED:"caseClosed",ASSIGNMENT_OPENED:"assignmentOpened",CASE_PREVIEW:"casePreview",CURRENT_ASSIGNMENT_UPDATED:"currentAssignmentUpdated",CASE_LOCK_EVENT:"caseLockEvent",GET_NEXT_WORK:"getNextWork",SAVE_ASSIGNMENT_COMPLETE:"saveAssignmentComplete",CASE_LOAD:"caseLoad",CASE_UNLOAD:"caseUnload",CASE_EDIT_OPEN:"caseEditOpen",CASE_EDIT_CLOSE:"caseEditClose"},ASSIGNMENT_EVENTS:{ASSIGNMENT_LOAD:"assignmentLoad",ASSIGNMENT_UNLOAD:"assignmentUnload"},WORK_EVENTS:{WORK_DELETED:"workDeleted"},BOOTSTRAP_SHELL_EVENTS:{CONSTELLATION_LOADED:"CONSTELLATION_LOADED"},CONTAINER_EVENTS:{CLOSE_CONTAINER_ITEM:"CLOSE_CONTAINER_ITEM",CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM:"CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM"},DISPLAY_CASE_CREATED_TOASTER:"displayCaseCreatedToaster",DISPLAY_CASE_SUBMITTED_TOASTER:"displayCaseSubmittedToaster",DATA_EVENTS:{DATA_OBJECT_CREATED:"dataObjectCreated",DATA_OBJECT_DELETED:"dataObjectDeleted",DATA_OBJECT_UPDATED:"dataObjectUpdated"},FETCH_SUCCESS:"fetchSuccess",FETCH_FAILURE:"fetchFailure",REVERSE_COEXISTENCE_EVENTS:{HANDLE_DISCARD:"handleDiscard",CHECK_IS_FORM_DIRTY:"checkIsFormDirty"},TIMEOUT_REMINDER:"sessionAboutToTimeout",RESET_TIMER:"resetInactivityTimer",PEGA_EMBED_CUSTOM:"pegaEmbedCustom",SUGGESTION_PROCESSED:"suggestion_processed",ERROR_ON_FINISH_ASSIGNMENT:"errorOnFinishAssignment",URL_NAVIGATION:"urlNavigation",ON_REFRESH_START:"onRefreshStart",ON_REFRESH_COMPLETE:"onRefreshComplete",EVENT_LOCALE_CHANGED:"localeChanged"},ERROR_TYPE:{CLIENT:"client",SERVER:"server"},CONTAINER_TYPE:{MULTIPLE:"multiple",SINGLE:"single",HYBRID:"HybridViewContainer"},REMOTE_SYSTEM_ID:"RemoteSystemID",LIST_SELECTION_MODE:{MULTI:"multi",SINGLE:"single",MULTI_ON_HOVER:"multi_on_hover"},SUBMISSION_FAILURE_TYPE:{FORM_VALIDATION_ERROR:"formValidationError"},USER_SETTINGS:{UTILITY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.utilityPanelExpanded",SUMMARY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.summaryPanelExpanded",ASSIGNMENT_COLLAPSED_STATE_PATH:"presentation.templates.CaseView.assignmentWidgetCollapsed",CASE_VIEW_PATH:"presentation.templates.CaseView",PORTAL_AGENT_SPLIT_VIEW_PATH:"presentation.templates.GenAICoach",PORTAL_AGENT_WIDTH_PATH:"presentation.templates.GenAICoach.agentPanelWidth"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},PORTAL_TYPE:{WSS:"wss"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:Mr.getDefaultQualifiedName("pyEmbedAssignment"),PY_DETAILS:Mr.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:Mr.getDefaultQualifiedName("messageViewReference"),PARENT_MESSAGE_ID:Mr.getDefaultQualifiedName("parentMessageID"),PX_RESULTS:Mr.getDefaultQualifiedName("pxResults"),NAME:Mr.getDefaultQualifiedName("name"),POSTED_BY_USER:Mr.getDefaultQualifiedName("postedByUser"),UPDATED_TIME:Mr.getDefaultQualifiedName("updatedTime"),POST_MESSAGE:Mr.getDefaultQualifiedName("PostMessage"),PZ_INS_KEY:Mr.getDefaultQualifiedName("pzInsKey"),PZ_PRIVATE_POST_DETAILS:Mr.getDefaultQualifiedName("pzPrivatePostDetails"),PY_SELECTED:Mr.getDefaultQualifiedName("pySelected"),PY_LABEL:Mr.getDefaultQualifiedName("pyLabel"),PY_RECIPIENTS:Mr.getDefaultQualifiedName("pyRecipients"),MENTIONS:Mr.getDefaultQualifiedName("mentions"),PY_IS_DELETE_ENABLED:Mr.getDefaultQualifiedName("pyIsDeleteEnabled"),TAGS:Mr.getDefaultQualifiedName("tags"),PZ_POST_DETAILS:Mr.getDefaultQualifiedName("pzPostDetails"),PY_FEED_SOURCE_REFERENCE:Mr.getDefaultQualifiedName("pyFeedSourceReference"),IS_EDITED:Mr.getDefaultQualifiedName("isEdited"),PY_LIKES:Mr.getDefaultQualifiedName("pyLikes"),PY_POST_TYPE:Mr.getDefaultQualifiedName("pyPostType"),POSTED_TIME:Mr.getDefaultQualifiedName("postedTime"),PY_MESSAGE_VIEW_REFERENCE:Mr.getDefaultQualifiedName("pyMessageViewReference"),ID:Mr.getDefaultQualifiedName("ID"),PY_COMMENT_CONTEXT:Mr.getDefaultQualifiedName("pyCommentContext"),PX_LIKE_COUNT:Mr.getDefaultQualifiedName("pxLikeCount"),MESSAGE:Mr.getDefaultQualifiedName("message")},CASE_VIEW_MODE:{PERFORM:"perform",REVIEW:"review",CONFIRM:"confirm"}},Fr={CONTEXT:"context",AJAXCONTAINER:"primary",VIEW_CONTAINER:"ViewContainer",APP_SHELL:"AppShell",ROOT_CONTAINER:"RootContainer",HYBRID:"hybrid",HYBRID_VIEW_CONTAINER:"HybridViewContainer",HYRBID_ROOT_CONTAINERNAME:"hybridRootContainerName",MODAL_VIEW_CONTAINER:"ModalViewContainer",FLOW_CONTAINER:"FlowContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",OBJECT_PAGE:"ObjectPage",CASE_CREATE_STAGE:"CaseCreateStage",CASE_VIEW:"CaseView",RULE_VIEW:"RuleView",SELF_SERVICE_CASE_VIEW:"SelfServiceCaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",RULE_PREVIEW:"RulePreview",CASE_STAGES:"Stages",CASEMESSAGES:"caseMessages",SUGGESTION:"suggestion",PREVIEW:"preview",TERTIARY:"tertiary",DEFAULT:"default",ACPRIMARY:"primary",ACTERTIARY:"tertiary",PERFORM_MODE:"perform",CASE_VIEW_MODE_PROP:".caseViewMode",REVIEW_MODE:"review",WORKAREA:"workarea",OBJECTACTIONCONTAINER:"ObjectActionContainer",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",UNDERSCORE_STRING:"_",DOUBLE_UNDERSCORE_STRING:"__",WORK_ID:"WORK_ID",EMPTY_STRING:"",PROPERTY_MESSAGES:"propertyMessages__",CONTEXT_MESSAGES:"contextMessages__",HTTP_MESSAGES:"httpMessages__",PAGE_MESSAGES:"pageMessages__",SUMMARY_OF_LISTS:"summary_of_lists__",SUMMARY_OF_GROUPS:"summary_of_groups__",SUMMARY_OF_MESSAGES:"summary_of_messages__",SUMMARY_OF_FIELD_VALUES:"summary_of_field_values__",SUMMARY_OF_WHEN_CONDITIONS:"summary_of_when_conditions__",SUMMARY_OF_DYNAMIC_WHENS:"summary_of_dynamic_whens__",SUMMARY_OF_EXPRESSIONS:"summary_of_expressions__",SUMMARY_OF_ASSOCIATED_LISTS:"summary_of_associated_lists__",CONTEXT_DATA:"context_data",TABLE:e=>`Table[${e}]`,HTTP:"HTTP",PROPERTY:"PROPERTY",PAGE_ERRORS:"page_level_errors",CUSTOM_ERROR:"custom error",NO_MESSAGES:"No messages existing",PULSE_REFERENCE:"pulse.messages",IS_LOADING:"isLoading",APPROVED:"Approved",REJECTED:"Rejected",DUPLICATE:"Duplicate",IGNORE:"Ignore",PARAGRAPH:"PARAGRAPH",X_ORIGIN_CHANNEL:"x-origin-channel",AUTHORING_PREVIEW_CONTAINER:"root/authoring-preview",EMBED:"EMBED",ERROR_FIELD_IN_PAGE:"erroneousInputOutputFieldInPage",ERROR_IN_PAGE_IDENTIFIER:"erroneousInputOutputIdentifier",ON_REFRESH_ERROR:"onRefreshError",UI_RESOURCES:"uiResources",UI_RESOURCES_CONTEXT_DATA:"uiResources.context_data",ACTION_BUTTONS:"uiResources.actionButtons",RESOURCES:"uiResources.resources",ROOT:"uiResources.root",CASE_INFO_IS_LOCAL_ACTION:"caseInfo.isLocalAction",OBJECT_INFO_IS_LOCAL_ACTION:"objectInfo.isObjectWideAction",DATA:"data",OPTIONS:"options",VIEWS:"uiResources.resources.views",NAVIGATIONS:"uiResources.resources.navigations",COMPONENTS:"uiResources.components",UI_RESOURCES_ROOT_CONTEXT:"uiResources.root.config.context",LOCALE_REFERENCES:"uiResources.localeReferences",STATIC_SERVER_URL:"staticServer",APPLICATION_DATA:"data.Application",REFERENCED_USERS:"referencedUsers",CASE_INFO_REFRESH_CONDITIONS:"caseInfo.refreshConditions",FIELD_LEVEL_SUCCESS:"success",FIELD_LEVEL_WARNING:"warning",FIELD_LEVEL_ERROR:"error",HASH_DELIMITER:"~^|^~",NULL_STRING:"null",DATA_PAGE:"DataPage",DECISION:"Decision",RULE_REFERENCE:"RuleReference",GET_PAGE_DATA:"getPageData",PROPERTY_ANNOTATION:"@P",FIELD_LABEL_ANNOTATION:"@FL",ATTACHMENT_ANNOTATION:"@ATTACHMENT",PARAGRAPH_ANNOTATION:"@PARAGRAPH",FORMAT_ANNOTATION:"@FORMAT",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",CLASS_ASSOCIATION_ANNOTATION:"@CA",FILTERED_LIST_ANNOTATION:"@FILTERED_LIST",CLASS_ANNOTATION:"@CLASS",ASSOCIATED:"associated",CLASS_ID:".classID",CLASSID:"classID",READONLY:"readonly",SHARED:"shared",RELOAD_IF_OLDER_THAN:"reloadIfOlderThan",RELOAD_ONCE_PER_INTERACTION:"reloadOncePerInteraction",PY_DETAILS:Mr.getDefaultQualifiedName("pyDetails"),PY_CONFIRM:Mr.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},...Ur,getProperty:e=>Lr.map(e),getDefaultQualifiedName:e=>Mr.getDefaultQualifiedName(e)},jr=Mr.getDefaultQualifiedName("pyRemoteCaseDetails");class kr{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=>yC.getProperty(".RemoteSystemID",Fr.CASE_INFO.HEADERS,e);static getRemoteHeader=e=>this.remoteCaseMapping[e]?.RemoteSystemID;static injectRemoteCaseHeader=(e,t,n)=>{if(e&&e.RemoteSystemID)return;const r=this.getRemoteHeaderByContext(n);r?e.RemoteSystemID=r:t&&this.isRemoteCase(t.caseTypeID)&&(e.RemoteSystemID=this.getRemoteHeader(t.caseTypeID))};static isTraditionalRemoteCase=(e="")=>"Traditional"===kr.getRemoteCase(e)?.RemoteApplicationType;static setAdditionalParameters=()=>{const e=LE.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteAppPlatformVersion=e=>{if(!e)return;const t=LE.environmentInfoObject?.pyRemoteAppPlatformVersion;if(t){return JSON.parse(t)[e]}};static isRemoteCaseVersionDifferent=e=>{if(!this.isRemoteCase(e))return!1;const t=this.getRemoteHeader(e);if(!t)return!1;const n=this.getRemoteAppPlatformVersion(t);return Boolean(n)};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID};static getRemoteCaseClassBySourceClass=e=>{if(e)for(const[t,n]of Object.entries(this.remoteCaseMapping))if(n.RemoteClassName===e)return t}}const Vr=kr,Br={},Gr=new Map,Wr=e=>{let t=Fr.EMPTY_STRING;return t=e&&e.includes(Fr.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},Hr=(e,t,n=!1)=>{let r=Fr.EMPTY_STRING;if(t&&e){let a=`${t}${Fr.FORWARD_SLASH_STRING}${e}`;const s=OI(a);if(s||t!==Fr.APP.APP&&t!==Fr.APP.ROOT)if(s){if(n&&Br[a])return r=`${a}${Fr.UNDERSCORE_STRING}${Br[a]}`,r;Br[a]?Br[a]+=1:Br[a]=1,r=`${a}${Fr.UNDERSCORE_STRING}${Br[a]}`}else r=Hr(e,Wr(t));else a=`${t}${Fr.FORWARD_SLASH_STRING}${Fr.PRIMARY}`,Br[a]?Br[a]+=1:Br[a]=1,r=`${a}${Fr.UNDERSCORE_STRING}${Br[a]}`}return r},qr=(e,t)=>{if(e&&t){const n=(Gr[t]?.[e]??0)+1;return Gr[t]||(Gr[t]={}),Gr[t][e]=n,`${t}${Fr.FORWARD_SLASH_STRING}${e}_${n}`}return""},zr=(e,t)=>{if(e&&t){const n=Gr[t]?.[e];return n?`${t}${Fr.FORWARD_SLASH_STRING}${e}_${n}`:qr(e,t)}return""},Yr=e=>{let t=Fr.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},Kr=(e,t)=>{if(null===e)return t;const[,n]=t.split(Fr.FORWARD_SLASH_STRING);return e+Fr.FORWARD_SLASH_STRING+n},Qr=e=>{const t=e.indexOf(Fr.FORWARD_SLASH_STRING),n=e.lastIndexOf(Fr.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},Jr=e=>{const t=e.split(Fr.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+Fr.FORWARD_SLASH_STRING+t[2]},Xr="SET_PROPERTY",Zr="REPLACE_PROPERTY",ea="FIELD_CHANGE",ta="LOAD_VIEW",na="SHOW_PAGE",ra="SHOW_DATA",aa="SHOW_INSIGHT",sa="SHOW_DASHBOARD",oa="SET_LOADING",ia="RESET_LOADING",ca="APP_OFFLINE",la="APP_ONLINE",da="SET_SHARED_PROPERTY",ua="CREATE_WORK",pa="OPEN_WORK_BY_HANDLE",ha="UPDATE_DOCUMENT",ga="FINISH_ASSIGNMENT",fa="SAVE_AND_CLOSE",ma="CANCEL_ASSIGNMENT",ya="OPEN_ASSIGNMENT",Ia="NAVIGATE_TO_STEP",Ea="OPEN_LOCAL_ACTION",Aa="OPEN_PROCESS_ACTION",Ca="MERGE_DATA",Sa="REMOVE_ITEM",Na="GET_DATAOBJECT_ACTIONS",_a="SHOW_HISTORY",ba="ERROR",Ta="INIT_CONTAINERS",Pa="RESET_CONTAINERS",Oa="ADD_CONTAINER_ITEM",Da="REMOVE_CONTAINER_ITEM",va="ADD_TRANSIENT_ITEM",Ra="UPDATE_TRANSIENT_DATA",$a="REMOVE_TRANSIENT_ITEM",xa="REMOVE_ALL_TRANSIENT_ITEMS",wa="CLEAR_TRANSIENT_DATA",Ma="PURGE_TRANSIENT_DATA",La="REPLACE_TRANSIENT_DATA",Ua="ACTIVATE_CONTAINER_ITEM",Fa="UPDATE_CONTAINER_ITEM",ja="UPMERGE_AND_REMOVE_CONTAINER_ITEM",ka="REPLACE_CONTAINER_ITEM",Va="ACTIVATE_MODAL_CONTAINER_ITEM",Ba="REMOVE_CONTAINER",Ga="ADD_SUGGESTION_CONTEXT",Wa="showView",Ha="showData",qa="showInsight",za="showDashboard",Ya="openWorkByHandle",Ka="openAssignment",Qa="createNewWork",Ja="finishAssignment",Xa="SHOW_CANCEL_ALERT",Za="deleteCaseInCreateStage",es="openLocalAction",ts="openProcessAction",ns="caseWideActions",rs="executeCaseWideActions",as="openBulkAction",ss="performBulkAction",os="launchAssignment",is="ADD_MESSAGES",cs="CLEAR_MESSAGES",ls="RESET_STORE",ds="FETCH_DATAPAGE",us="ADD_SHARED_DATA",ps="REMOVE_SHARED_DATA",hs="LIST_ACTION",gs="DELETE_CASE_SUMMARY",fs="ALTER_BLOCKING_ACTION_COUNT",ms="SET_APP_LOCALE",ys="CREATE_DATA_OBJECT",Is="DELETE_DATA_OBJECT",Es="VIEW_DATA_OBJECT",As="UPDATE_DATA_OBJECT",Cs="OPEN_DATA_OBJECT_ACTION",Ss="SUBMIT_DATA_OBJECT_ACTION",Ns="OPEN_EMBEDDED_DATA_MODAL",_s="GET_EMBEDDED_DATA_VIEW",bs="SUBMIT_EMBEDDED_DATA_MODAL",Ts="SUBMIT_SUBSCRIPT",Ps="FILL_FORM_WITH_AI",Os="createWork",Ds="openAssignment",vs="openCase",Rs="EXECUTE_OBJECT_WIDE_ACTION",$s="CREATE_EXTERNAL_CASE",xs="DELETE_WORK",ws="createObject",Ms="getObject",Ls="getObjectWideAction",Us="createExternalObject",Fs="retrieveActionViewForNewCase",js=(e,t)=>{if(!e||!t)return null;let n,r=Fr.EMPTY_STRING;return t&&(r=`${t}${Fr.FORWARD_SLASH_STRING}${e}`,n=OI(r),n||t.includes("/")?n||(r=js(e,Wr(t))):r=`${t}${Fr.FORWARD_SLASH_STRING}${e}`),r},ks=(e,t)=>{const n=js(e,t);return n&&OI(n)?OI(n):{}},Vs=(e,t)=>wE.getSemanticURL(Wa,{page:e},t);class Bs{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=Js[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],r=Qs[e.tokenType];r&&r.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}=Js[this._state];this._subParser=new Bs(this._grammar,e,t)}_endSubExpression(){Js[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,Bs._setParent(e,this._position)):this._tree=e,this._position=e}}const Gs=Bs,Ws="identifier",Hs={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&(e&&t)},qs={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&(e||t)},zs=(e,t,n)=>{const r=""===e,a=""===t||null==t;if(r&&a)return n;if("boolean"==typeof t){const a=!!(!r&&"false"!==e&&"0"!==e)&&Boolean(e);return n?a===t:a!==t}return r!==a?!n:n?e===t:e!==t},Ys={">":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>t},">=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>=t},"<":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<t},"<=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<=t},"==":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&zs(e,t,!0)},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>"object"==typeof e||"object"==typeof t||zs(e,t,!1)},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{const t="object"==typeof e?e.value:e;return"true"===t||"false"===t?"true"!==t:!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":Hs,AND:Hs,and:Hs,"||":qs,OR:qs,or:qs,CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).includes(String(t))},NOT_CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).includes(String(t))},STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).startsWith(String(t))},NOT_STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).startsWith(String(t))},ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).endsWith(String(t))},NOT_ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).endsWith(String(t))},IS_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!e},IS_NOT_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!!e},IS_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(t).split(",").includes(String(e))},IS_NOT_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(t).split(",").includes(String(e))}},Ks={BinaryExpression:function(e){const t=[],n=e.right,r=e.operator??"",a=e.left;if(!a)return!1;let s="boolean"==typeof a.value?"True-False":"";t[0]=this.evaluateAST(a),s||a.operationType!==Ws||(s=((e,t,n)=>{if("string"!=typeof e.value)return"";const r=e.value.substring(1),a=t?.getFieldMetadata(r)?.type??"";if(a)return a;const{pageReference:s,context:o}=n??{};if(!s||!o)return"";const i=yC.resolveClassID(e.value,s,o),c=fA(r,i);return c&&!Array.isArray(c)?c.type??"":""})(a,this._context,this._contextTreeNodeContext)),t[1]=n?this.evaluateAST(n,s):"";const o=this._grammar[r];return!!o?.evaluate&&o.evaluate(t[0],t[1])},identifier:function(e){const t="string"==typeof e.value?e.value:"";if(this._localDataObject)return hC.getIn(this._localDataObject,t?t.substring(1).split("."):[])??"";if(this._contextTreeNodeContext)return yC.getLitePropertyValue(this._contextTreeNodeContext,t)??"";if(!this._context)return"";const n=this._context.getFieldMetadata(t)?.type??"",r=this._context.getValue(t)??"";if("Decimal"===n&&"string"==typeof r){const e=parseFloat(r);return Number.isNaN(e)?"":e}return r},literal:function(e,t){return!(void 0===t||""===t||"True-False"===t)||"true"!==e.value&&"false"!==e.value?e.value??"":"true"===e.value},UnaryExpression:function(e){const t=e.operator,n=e.right;if(!t||!n)return!1;const r=this._grammar[t];return!!r?.evaluate&&r.evaluate(n)}},Qs={unaryOperator:function(e){this.setPositionInAST({operationType:"UnaryExpression",operator:String(e.value)})},binaryOperator:function(e){const t=String(e.value),{precedence:n}=this._grammar[t];let r=this._position._parent;const a=r?r.operator:null,s=a?this._grammar[a]:null,o=s?s.precedence:null;if(o&&n)for(;r?.operator&&o>=n;)this._position=r,r=r._parent;const i={operationType:"BinaryExpression",operator:t,left:this._position};Gs._setParent(this._position,i),r?(this._position=r,this.setPositionInAST(i)):(this._tree=i,this._position=i)},identifier:function(e){const t={operationType:Ws,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){var t;"object"==typeof(t=e)&&null!==t&&"operationType"in t&&this.setPositionInAST(e)}},Js={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:Ws},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Qs.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},Xs=["binaryOperator","unaryOperator","openParenthesis"],Zs=/^\s*$/,eo=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,to=/\\\\/,no=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],ro=["[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]+)"],ao=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class so{constructor(e){this._grammar=e}static _isNegative(e){return Xs.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(Zs)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(eo)&&(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(to,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>so._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[no.join("|"),e.join("|"),ro.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=so._unquote(e):e.match(ao)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(eo)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let r=0;r<e.length;r+=1)so._isWhitespace(e[r])?t.length&&(t[t.length-1].element+=e[r]):"-"===e[r]&&so._isNegative(t)?n=!0:(n&&(e[r]=`-${e[r]}`,n=!1),t.push(this._createToken(e[r])));return t}tokenize(e){const t=this._splitExpression(e);return this._getTokens(t)}}const oo=so;const io=class{constructor(e,t){this._grammar={...Ys},this._expression=e,this._ast=null,this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new oo(this._grammar).tokenize(this._expression),t=new Gs(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 ho(e.operationType,Ks)&&Ks[e.operationType].call(this,e,t)}},co=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new io(n,t)},lo=e=>!e||e.buildAST(),uo=(e,t,n)=>!e||e.evaluate(t,n),po=(e,t,n)=>{const r=co(e,t),a=lo(r);return uo(a,n)},ho=(e,t)=>e in t;const go=class{static handleExpression(e,t,n,r){const a=this.getContext(e,r);sn({actionObject:{action:"decexp",params:{source:e,value:t,targets:n},context:a}}).then((e=>e.json())).then((e=>{this.updateState(e,r)})).catch((e=>window.console.log(e)))}static getContext(e,t){const n=e.substring(0,e.indexOf("."));return{name:n,class:yC.getPropertyValue(`${n}.${Mr.getDefaultQualifiedName("pxObjClass")}`,null,t)||yC.getPropertyValue(`${n}.${Mr.getDefaultQualifiedName("pyClassName")}`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>QA({type:Xr,payload:{context:t,reference:n,value:e[n]}})))}},fo={},mo=(e,t)=>fo[t]&&Object.hasOwn(fo[t],e),yo=e=>{const{context:t}=e;mo(e.reference,t)&&go.handleExpression(e.reference,e.value,fo[t][e.reference],t)},Io=(e={})=>{hC.copy(e,fo)},Eo=(e,t,n)=>po(e,t,n?.pConnect.getPConnect());const Ao=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 r=this.getContextObjectByName(e);if(r)if(Array.isArray(n))r[t]=n;else{const e=r[t];r[t]=[...new Set([...e,n])]}}else{const r={};Array.isArray(n)?r[t]=n:r[t]=[n],this.addContextName(e,r)}}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),r=new Set(n);return n.forEach((e=>{r.add(e)})),[...r]}};const Co=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={}){hC.copy(e,this.componentMap)}mergeOverrideMap(e={}){hC.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const So=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}},No=/^@\w+\s+(.+)$/s;const _o=class{static handleAnnotation(e,t,n){const r=e.indexOf(" "),a=-1===r?e:e.substring(0,r),s=So.getHandler(a);if(!s)return e;const o=e.match(No);return s((o?o[1]:"").trim(),t,n)}static trimAnnotation(e){if("string"!=typeof e)return e;const t=e.indexOf(" "),n=e.substring(0,t),r=e.substring(t+1);return So.getHandler(n)?r:e}static handleComponentMapping(e,t,n){const r=Co.getComponent(t.type);if(!r?.mapping)return;const a=r.mapping(t.config);if(a&&a["@map"]){const t=a["@map"],{source:r}=t;if(!r)return;const s=n.getValue(r);if("function"==typeof t.advanced)t.advanced(e,s);else{const n=t.inputs_map;e[t.output_property]=[];const r=e[t.output_property];s.forEach((e=>{const t={};Object.keys(n).forEach((r=>{let a=n[r];a?.startsWith(".")?(a=a.substring(1),t[r]=e[a]):t[r]=a})),r.push(t)}))}}}static getPropertyName(e=""){if(e&&hC.isString(e)){const t=e.startsWith(Fr.PROPERTY_ANNOTATION)||e.startsWith(Fr.ATTACHMENT_ANNOTATION)||e.startsWith(Fr.ASSOCIATED_PROPERTY_ANNOTATION)||e.startsWith(Fr.CLASS_ASSOCIATION_ANNOTATION)||e.startsWith(Fr.FILTERED_LIST_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(hC.isString(e)&&!!e?.startsWith(Fr.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return hC.isString(e)&&!!e?.startsWith(Fr.PROPERTY_ANNOTATION)}};function bo(e,t){return function(){return e.apply(t,arguments)}}const{toString:To}=Object.prototype,{getPrototypeOf:Po}=Object,{iterator:Oo,toStringTag:Do}=Symbol,vo=(Ro=Object.create(null),e=>{const t=To.call(e);return Ro[t]||(Ro[t]=t.slice(8,-1).toLowerCase())});var Ro;const $o=e=>(e=e.toLowerCase(),t=>vo(t)===e),xo=e=>t=>typeof t===e,{isArray:wo}=Array,Mo=xo("undefined");function Lo(e){return null!==e&&!Mo(e)&&null!==e.constructor&&!Mo(e.constructor)&&jo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Uo=$o("ArrayBuffer");const Fo=xo("string"),jo=xo("function"),ko=xo("number"),Vo=e=>null!==e&&"object"==typeof e,Bo=e=>{if("object"!==vo(e))return!1;const t=Po(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Do in e||Oo in e)},Go=$o("Date"),Wo=$o("File"),Ho=$o("Blob"),qo=$o("FileList");const zo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Yo=void 0!==zo.FormData?zo.FormData:void 0,Ko=$o("URLSearchParams"),[Qo,Jo,Xo,Zo]=["ReadableStream","Request","Response","Headers"].map($o);function ei(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,a;if("object"!=typeof e&&(e=[e]),wo(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(Lo(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),s=a.length;let o;for(r=0;r<s;r++)o=a[r],t.call(null,e[o],o,e)}}function ti(e,t){if(Lo(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,a=n.length;for(;a-- >0;)if(r=n[a],t===r.toLowerCase())return r;return null}const ni="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ri=e=>!Mo(e)&&e!==ni;const ai=(si="undefined"!=typeof Uint8Array&&Po(Uint8Array),e=>si&&e instanceof si);var si;const oi=$o("HTMLFormElement"),ii=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ci=$o("RegExp"),li=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ei(n,((n,a)=>{let s;!1!==(s=t(n,a,e))&&(r[a]=s||n)})),Object.defineProperties(e,r)};const di=$o("AsyncFunction"),ui=(pi="function"==typeof setImmediate,hi=jo(ni.postMessage),pi?setImmediate:hi?(gi=`axios@${Math.random()}`,fi=[],ni.addEventListener("message",(({source:e,data:t})=>{e===ni&&t===gi&&fi.length&&fi.shift()()}),!1),e=>{fi.push(e),ni.postMessage(gi,"*")}):e=>setTimeout(e));var pi,hi,gi,fi;const mi="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ni):"undefined"!=typeof process&&process.nextTick||ui,yi={isArray:wo,isArrayBuffer:Uo,isBuffer:Lo,isFormData:e=>{if(!e)return!1;if(Yo&&e instanceof Yo)return!0;const t=Po(e);if(!t||t===Object.prototype)return!1;if(!jo(e.append))return!1;const n=vo(e);return"formdata"===n||"object"===n&&jo(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Uo(e.buffer),t},isString:Fo,isNumber:ko,isBoolean:e=>!0===e||!1===e,isObject:Vo,isPlainObject:Bo,isEmptyObject:e=>{if(!Vo(e)||Lo(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Qo,isRequest:Jo,isResponse:Xo,isHeaders:Zo,isUndefined:Mo,isDate:Go,isFile:Wo,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:Ho,isRegExp:ci,isFunction:jo,isStream:e=>Vo(e)&&jo(e.pipe),isURLSearchParams:Ko,isTypedArray:ai,isFileList:qo,forEach:ei,merge:function e(...t){const{caseless:n,skipUndefined:r}=ri(this)&&this||{},a={},s=(t,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const o=n&&ti(a,s)||s,i=ii(a,o)?a[o]:void 0;Bo(i)&&Bo(t)?a[o]=e(i,t):Bo(t)?a[o]=e({},t):wo(t)?a[o]=t.slice():r&&Mo(t)||(a[o]=t)};for(let e=0,n=t.length;e<n;e++)t[e]&&ei(t[e],s);return a},extend:(e,t,n,{allOwnKeys:r}={})=>(ei(t,((t,r)=>{n&&jo(t)?Object.defineProperty(e,r,{__proto__:null,value:bo(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:r}),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,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let a,s,o;const i={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),s=a.length;s-- >0;)o=a[s],r&&!r(o,e,t)||i[o]||(t[o]=e[o],i[o]=!0);e=!1!==n&&Po(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:vo,kindOfTest:$o,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(wo(e))return e;let t=e.length;if(!ko(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Oo]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:oi,hasOwnProperty:ii,hasOwnProp:ii,reduceDescriptors:li,freezeMethods:e=>{li(e,((t,n)=>{if(jo(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];jo(r)&&(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={},r=e=>{e.forEach((e=>{n[e]=!0}))};return wo(e)?r(e):r(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:ti,global:ni,isContextDefined:ri,isSpecCompliantForm:function(e){return!!(e&&jo(e.append)&&"FormData"===e[Do]&&e[Oo])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Vo(e)){if(t.indexOf(e)>=0)return;if(Lo(e))return e;if(!("toJSON"in e)){t[r]=e;const a=wo(e)?[]:{};return ei(e,((e,t)=>{const s=n(e,r+1);!Mo(s)&&(a[t]=s)})),t[r]=void 0,a}}return e};return n(e,0)},isAsyncFn:di,isThenable:e=>e&&(Vo(e)||jo(e))&&jo(e.then)&&jo(e.catch),setImmediate:ui,asap:mi,isIterable:e=>null!=e&&jo(e[Oo])},Ii=yi.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"]),Ei=Symbol("internals"),Ai=/[^\x09\x20-\x7E\x80-\xFF]/g;function Ci(e){return e&&String(e).trim().toLowerCase()}function Si(e){return!1===e||null==e?e:yi.isArray(e)?e.map(Si):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(Ai,""))}function Ni(e,t,n,r,a){return yi.isFunction(r)?r.call(this,t,n):(a&&(t=n),yi.isString(t)?yi.isString(r)?-1!==t.indexOf(r):yi.isRegExp(r)?r.test(t):void 0:void 0)}class _i{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=Ci(t);if(!a)throw new Error("header name must be a non-empty string");const s=yi.findKey(r,a);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Si(e))}const s=(e,t)=>yi.forEach(e,((e,n)=>a(e,n,t)));if(yi.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(yi.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim(),!n||t[n]&&Ii[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(yi.isObject(e)&&yi.isIterable(e)){let n,r,a={};for(const t of e){if(!yi.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[r=t[0]]=(n=a[r])?yi.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(a,t)}else null!=e&&a(t,e,n);return this}get(e,t){if(e=Ci(e)){const n=yi.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 r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(yi.isFunction(t))return t.call(this,e,n);if(yi.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ci(e)){const n=yi.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ni(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=Ci(e)){const a=yi.findKey(n,e);!a||t&&!Ni(0,n[a],a,t)||(delete n[a],r=!0)}}return yi.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const a=t[n];e&&!Ni(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return yi.forEach(this,((r,a)=>{const s=yi.findKey(n,a);if(s)return t[s]=Si(r),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]=Si(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return yi.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&yi.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[Ei]=this[Ei]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ci(e);t[r]||(!function(e,t){const n=yi.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,a){return this[r].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[r]=!0)}return yi.isArray(e)?e.forEach(r):r(e),this}}_i.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),yi.reduceDescriptors(_i.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),yi.freezeMethods(_i);const bi=_i;function Ti(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),r=[],a=e=>{if(null===e||"object"!=typeof e)return e;if(yi.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof bi&&(e=e.toJSON()),r.push(e),yi.isArray(e))t=[],e.forEach(((e,n)=>{const r=a(e);yi.isUndefined(r)||(t[n]=r)}));else{if(!yi.isPlainObject(e)&&function(e){if(yi.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(yi.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,s]of Object.entries(e)){const e=n.has(r.toLowerCase())?"[REDACTED ****]":a(s);yi.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return a(e)}class Pi extends Error{static from(e,t,n,r,a,s){const o=new Pi(e.message,t||e.code,n,r,a);return o.cause=e,o.name=e.name,null!=e.status&&null==o.status&&(o.status=e.status),s&&Object.assign(o,s),o}constructor(e,t,n,r,a){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status)}toJSON(){const e=this.config,t=e&&yi.hasOwnProp(e,"redact")?e.redact:void 0,n=yi.isArray(t)&&t.length>0?Ti(e,t):yi.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}Pi.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Pi.ERR_BAD_OPTION="ERR_BAD_OPTION",Pi.ECONNABORTED="ECONNABORTED",Pi.ETIMEDOUT="ETIMEDOUT",Pi.ECONNREFUSED="ECONNREFUSED",Pi.ERR_NETWORK="ERR_NETWORK",Pi.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Pi.ERR_DEPRECATED="ERR_DEPRECATED",Pi.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Pi.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Pi.ERR_CANCELED="ERR_CANCELED",Pi.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Pi.ERR_INVALID_URL="ERR_INVALID_URL",Pi.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Oi=Pi;function Di(e){return yi.isPlainObject(e)||yi.isArray(e)}function vi(e){return yi.endsWith(e,"[]")?e.slice(0,-2):e}function Ri(e,t,n){return e?e.concat(t).map((function(e,t){return e=vi(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const $i=yi.toFlatObject(yi,{},null,(function(e){return/^is[A-Z]/.test(e)}));const xi=function(e,t,n){if(!yi.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=yi.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!yi.isUndefined(t[e])}))).metaTokens,a=n.visitor||u,s=n.dots,o=n.indexes,i=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,l=i&&yi.isSpecCompliantForm(t);if(!yi.isFunction(a))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(yi.isDate(e))return e.toISOString();if(yi.isBoolean(e))return e.toString();if(!l&&yi.isBlob(e))throw new Oi("Blob is not supported. Use a Buffer instead.");return yi.isArrayBuffer(e)||yi.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,a){let i=e;if(yi.isReactNative(t)&&yi.isReactNativeBlob(e))return t.append(Ri(a,n,s),d(e)),!1;if(e&&!a&&"object"==typeof e)if(yi.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(yi.isArray(e)&&function(e){return yi.isArray(e)&&!e.some(Di)}(e)||(yi.isFileList(e)||yi.endsWith(n,"[]"))&&(i=yi.toArray(e)))return n=vi(n),i.forEach((function(e,r){!yi.isUndefined(e)&&null!==e&&t.append(!0===o?Ri([n],r,s):null===o?n:n+"[]",d(e))})),!1;return!!Di(e)||(t.append(Ri(a,n,s),d(e)),!1)}const p=[],h=Object.assign($i,{defaultVisitor:u,convertValue:d,isVisitable:Di});if(!yi.isObject(e))throw new TypeError("data must be an object");return function e(n,r,s=0){if(!yi.isUndefined(n)){if(s>c)throw new Oi("Object is too deeply nested ("+s+" levels). Max depth: "+c,Oi.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(n))throw Error("Circular reference detected in "+r.join("."));p.push(n),yi.forEach(n,(function(n,o){!0===(!(yi.isUndefined(n)||null===n)&&a.call(t,n,yi.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o],s+1)})),p.pop()}}(e),t};function wi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function Mi(e,t){this._pairs=[],e&&xi(e,this,t)}const Li=Mi.prototype;Li.append=function(e,t){this._pairs.push([e,t])},Li.toString=function(e){const t=e?function(t){return e.call(this,t,wi)}:wi;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ui=Mi;function Fi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ji(e,t,n){if(!t)return e;const r=n&&n.encode||Fi,a=yi.isFunction(n)?{serialize:n}:n,s=a&&a.serialize;let o;if(o=s?s(t,a):yi.isURLSearchParams(t)?t.toString():new Ui(t,a).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const ki=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){yi.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Vi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Bi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ui,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Gi="undefined"!=typeof window&&"undefined"!=typeof document,Wi="object"==typeof navigator&&navigator||void 0,Hi=Gi&&(!Wi||["ReactNative","NativeScript","NS"].indexOf(Wi.product)<0),qi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,zi=Gi&&window.location.href||"http://localhost",Yi={...a,...Bi};const Ki=function(e){function t(e,n,r,a){let s=e[a++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),i=a>=e.length;if(s=!s&&yi.isArray(r)?r.length:s,i)return yi.hasOwnProp(r,s)?r[s]=yi.isArray(r[s])?r[s].concat(n):[r[s],n]:r[s]=n,!o;r[s]&&yi.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],a)&&yi.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const a=n.length;let s;for(r=0;r<a;r++)s=n[r],t[s]=e[s];return t}(r[s])),!o}if(yi.isFormData(e)&&yi.isFunction(e.entries)){const n={};return yi.forEachEntry(e,((e,r)=>{t(function(e){return yi.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},Qi=(e,t)=>null!=e&&yi.hasOwnProp(e,t)?e[t]:void 0;const Ji={transitional:Vi,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=yi.isObject(e);a&&yi.isHTMLForm(e)&&(e=new FormData(e));if(yi.isFormData(e))return r?JSON.stringify(Ki(e)):e;if(yi.isArrayBuffer(e)||yi.isBuffer(e)||yi.isStream(e)||yi.isFile(e)||yi.isBlob(e)||yi.isReadableStream(e))return e;if(yi.isArrayBufferView(e))return e.buffer;if(yi.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){const t=Qi(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return xi(e,new Yi.classes.URLSearchParams,{visitor:function(e,t,n,r){return Yi.isNode&&yi.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=yi.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Qi(this,"env"),r=n&&n.FormData;return xi(s?{"files[]":e}:e,r&&new r,t)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(yi.isString(e))try{return(t||JSON.parse)(e),yi.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Qi(this,"transitional")||Ji.transitional,n=t&&t.forcedJSONParsing,r=Qi(this,"responseType"),a="json"===r;if(yi.isResponse(e)||yi.isReadableStream(e))return e;if(e&&yi.isString(e)&&(n&&!r||a)){const n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,Qi(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Oi.from(e,Oi.ERR_BAD_RESPONSE,this,null,Qi(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yi.classes.FormData,Blob:Yi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};yi.forEach(["delete","get","head","post","put","patch","query"],(e=>{Ji.headers[e]={}}));const Xi=Ji;function Zi(e,t){const n=this||Xi,r=t||n,a=bi.from(r.headers);let s=r.data;return yi.forEach(e,(function(e){s=e.call(n,s,a.normalize(),t?t.status:void 0)})),a.normalize(),s}function ec(e){return!(!e||!e.__CANCEL__)}const tc=class extends Oi{constructor(e,t,n){super(null==e?"canceled":e,Oi.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function nc(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Oi("Request failed with status code "+n.status,n.status>=400&&n.status<500?Oi.ERR_BAD_REQUEST:Oi.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const rc=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a,s=0,o=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=r[o];a||(a=c),n[s]=i,r[s]=c;let d=o,u=0;for(;d!==s;)u+=n[d++],d%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-a<t)return;const p=l&&c-l;return p?Math.round(1e3*u/p):void 0}};const ac=function(e,t){let n,r,a=0,s=1e3/t;const o=(t,s=Date.now())=>{a=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-a;i>=s?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),s-i)))},()=>n&&o(n)]},sc=(e,t,n=3)=>{let r=0;const a=rc(50,250);return ac((n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,i=null!=o?Math.min(s,o):s,c=Math.max(0,i-r),l=a(c);r=Math.max(r,i);e({loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-i)/l:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},oc=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ic=e=>(...t)=>yi.asap((()=>e(...t))),cc=Yi.hasStandardBrowserEnv?(lc=new URL(Yi.origin),dc=Yi.navigator&&/(msie|trident)/i.test(Yi.navigator.userAgent),e=>(e=new URL(e,Yi.origin),lc.protocol===e.protocol&&lc.host===e.host&&(dc||lc.port===e.port))):()=>!0;var lc,dc;const uc=Yi.hasStandardBrowserEnv?{write(e,t,n,r,a,s,o){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];yi.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),yi.isString(r)&&i.push(`path=${r}`),yi.isString(a)&&i.push(`domain=${a}`),!0===s&&i.push("secure"),yi.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),a=r.indexOf("=");if(-1!==a&&r.slice(0,a)===e)return decodeURIComponent(r.slice(a+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function pc(e,t,n){let r=!("string"==typeof(a=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a));var a;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const hc=e=>e instanceof bi?{...e}:e;function gc(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return yi.isPlainObject(e)&&yi.isPlainObject(t)?yi.merge.call({caseless:r},e,t):yi.isPlainObject(t)?yi.merge({},t):yi.isArray(t)?t.slice():t}function a(e,t,n,a){return yi.isUndefined(t)?yi.isUndefined(e)?void 0:r(void 0,e,0,a):r(e,t,0,a)}function s(e,t){if(!yi.isUndefined(t))return r(void 0,t)}function o(e,t){return yi.isUndefined(t)?yi.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(n,a,s){return yi.hasOwnProp(t,s)?r(n,a):yi.hasOwnProp(e,s)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>a(hc(e),hc(t),0,!0)};return yi.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=yi.hasOwnProp(c,r)?c[r]:a,o=s(yi.hasOwnProp(e,r)?e[r]:void 0,yi.hasOwnProp(t,r)?t[r]:void 0,r);yi.isUndefined(o)&&s!==i||(n[r]=o)})),n}const fc=["content-type","content-length"];const mc=e=>{const t=gc({},e),n=e=>yi.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let a=n("withXSRFToken");const s=n("xsrfHeaderName"),o=n("xsrfCookieName");let i=n("headers");const c=n("auth"),l=n("baseURL"),d=n("allowAbsoluteUrls"),u=n("url");var p;if(t.headers=i=bi.from(i),t.url=ji(pc(l,u,d),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?(p=c.password,encodeURIComponent(p).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))):""))),yi.isFormData(r)&&(Yi.hasStandardBrowserEnv||Yi.hasStandardBrowserWebWorkerEnv?i.setContentType(void 0):yi.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t).forEach((([t,n])=>{fc.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(i,r.getHeaders(),n("formDataHeaderPolicy"))),Yi.hasStandardBrowserEnv){yi.isFunction(a)&&(a=a(t));if(!0===a||null==a&&cc(t.url)){const e=s&&o&&uc.read(o);e&&i.set(s,e)}}return t},yc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=mc(e);let a=r.data;const s=bi.from(r.headers).normalize();let o,i,c,l,d,{responseType:u,onUploadProgress:p,onDownloadProgress:h}=r;function g(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let f=new XMLHttpRequest;function m(){if(!f)return;const r=bi.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());nc((function(e){t(e),g()}),(function(e){n(e),g()}),{data:u&&"text"!==u&&"json"!==u?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f}),f=null}f.open(r.method.toUpperCase(),r.url,!0),f.timeout=r.timeout,"onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&f.responseURL.startsWith("file:"))&&setTimeout(m)},f.onabort=function(){f&&(n(new Oi("Request aborted",Oi.ECONNABORTED,e,f)),g(),f=null)},f.onerror=function(t){const r=t&&t.message?t.message:"Network Error",a=new Oi(r,Oi.ERR_NETWORK,e,f);a.event=t||null,n(a),g(),f=null},f.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||Vi;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Oi(t,a.clarifyTimeoutError?Oi.ETIMEDOUT:Oi.ECONNABORTED,e,f)),g(),f=null},void 0===a&&s.setContentType(null),"setRequestHeader"in f&&yi.forEach(s.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),yi.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),u&&"json"!==u&&(f.responseType=r.responseType),h&&([c,d]=sc(h,!0),f.addEventListener("progress",c)),p&&f.upload&&([i,l]=sc(p),f.upload.addEventListener("progress",i),f.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{f&&(n(!t||t.type?new tc(null,e,f):t),f.abort(),g(),f=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const y=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(r.url);!y||Yi.protocols.includes(y)?f.send(a||null):n(new Oi("Unsupported protocol "+y+":",Oi.ERR_BAD_REQUEST,e))}))},Ic=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const a=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Oi?t:new tc(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,a(new Oi(`timeout of ${t}ms exceeded`,Oi.ETIMEDOUT))}),t);const o=()=>{e&&(s&&clearTimeout(s),s=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}=r;return i.unsubscribe=()=>yi.asap(o),i}},Ec=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,a=0;for(;a<n;)r=a+t,yield e.slice(a,r),a=r},Ac=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()}},Cc=(e,t,n,r)=>{const a=async function*(e,t){for await(const n of Ac(e))yield*Ec(n,t)}(e,t);let s,o=0,i=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await a.next();if(t)return i(),void e.close();let s=r.byteLength;if(n){let e=o+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw i(e),e}},cancel:e=>(i(e),a.return())},{highWaterMark:2})};const Sc="1.16.0",{isFunction:Nc}=yi,_c=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},bc=e=>{const t=yi.global??globalThis,{ReadableStream:n,TextEncoder:r}=t;e=yi.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:s,Response:o}=e,i=a?Nc(a):"function"==typeof fetch,c=Nc(s),l=Nc(o);if(!i)return!1;const d=i&&Nc(n),u=i&&("function"==typeof r?(p=new r,e=>p.encode(e)):async e=>new Uint8Array(await new s(e).arrayBuffer()));var p;const h=c&&d&&_c((()=>{let e=!1;const t=new s(Yi.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),g=l&&d&&_c((()=>yi.isReadableStream(new o("").body))),f={stream:g&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Oi(`Response type '${e}' is not supported`,Oi.ERR_NOT_SUPPORT,n)})}));const m=async(e,t)=>{const n=yi.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(yi.isBlob(e))return e.size;if(yi.isSpecCompliantForm(e)){const t=new s(Yi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return yi.isArrayBufferView(e)||yi.isArrayBuffer(e)?e.byteLength:(yi.isURLSearchParams(e)&&(e+=""),yi.isString(e)?(await u(e)).byteLength:void 0)})(t):n};return async e=>{let{url:t,method:n,data:i,signal:l,cancelToken:d,timeout:u,onDownloadProgress:p,onUploadProgress:y,responseType:I,headers:E,withCredentials:A="same-origin",fetchOptions:C,maxContentLength:S,maxBodyLength:N}=mc(e);const _=yi.isNumber(S)&&S>-1,b=yi.isNumber(N)&&N>-1;let T=a||fetch;I=I?(I+"").toLowerCase():"text";let P=Ic([l,d&&d.toAbortSignal()],u),O=null;const D=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let v;try{if(_&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length;const t=r.length;for(let n=0;n<t;n++)if(37===r.charCodeAt(n)&&n+2<t){const t=r.charCodeAt(n+1),a=r.charCodeAt(n+2);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102)&&(e-=2,n+=2)}let n=0,a=t-1;const s=e=>e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e));a>=0&&(61===r.charCodeAt(a)?(n++,a--):s(a)&&(n++,a-=3)),1===n&&a>=0&&(61===r.charCodeAt(a)||s(a))&&n++;const o=3*Math.floor(e/4)-(n||0);return o>0?o:0}if("undefined"!=typeof Buffer&&"function"==typeof Buffer.byteLength)return Buffer.byteLength(r,"utf8");let a=0;for(let e=0,t=r.length;e<t;e++){const n=r.charCodeAt(e);if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=r.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a}(t);if(n>S)throw new Oi("maxContentLength size of "+S+" exceeded",Oi.ERR_BAD_RESPONSE,e,O)}if(b&&"get"!==n&&"head"!==n){const t=await m(E,i);if("number"==typeof t&&isFinite(t)&&t>N)throw new Oi("Request body larger than maxBodyLength limit",Oi.ERR_BAD_REQUEST,e,O)}if(y&&h&&"get"!==n&&"head"!==n&&0!==(v=await m(E,i))){let e,n=new s(t,{method:"POST",body:i,duplex:"half"});if(yi.isFormData(i)&&(e=n.headers.get("content-type"))&&E.setContentType(e),n.body){const[e,t]=oc(v,sc(ic(y)));i=Cc(n.body,65536,e,t)}}yi.isString(A)||(A=A?"include":"omit");const a=c&&"credentials"in s.prototype;if(yi.isFormData(i)){const e=E.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&E.delete("content-type")}E.set("User-Agent","axios/"+Sc,!1);const l={...C,signal:P,method:n.toUpperCase(),headers:E.normalize().toJSON(),body:i,duplex:"half",credentials:a?A:void 0};O=c&&new s(t,l);let d=await(c?T(O,C):T(t,l));if(_){const t=yi.toFiniteNumber(d.headers.get("content-length"));if(null!=t&&t>S)throw new Oi("maxContentLength size of "+S+" exceeded",Oi.ERR_BAD_RESPONSE,e,O)}const u=g&&("stream"===I||"response"===I);if(g&&d.body&&(p||_||u&&D)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=d[e]}));const n=yi.toFiniteNumber(d.headers.get("content-length")),[r,a]=p&&oc(n,sc(ic(p),!0))||[];let s=0;const i=t=>{if(_&&(s=t,s>S))throw new Oi("maxContentLength size of "+S+" exceeded",Oi.ERR_BAD_RESPONSE,e,O);r&&r(t)};d=new o(Cc(d.body,65536,i,(()=>{a&&a(),D&&D()})),t)}I=I||"text";let R=await f[yi.findKey(f,I)||"text"](d,e);if(_&&!g&&!u){let t;if(null!=R&&("number"==typeof R.byteLength?t=R.byteLength:"number"==typeof R.size?t=R.size:"string"==typeof R&&(t="function"==typeof r?(new r).encode(R).byteLength:R.length)),"number"==typeof t&&t>S)throw new Oi("maxContentLength size of "+S+" exceeded",Oi.ERR_BAD_RESPONSE,e,O)}return!u&&D&&D(),await new Promise(((t,n)=>{nc(t,n,{data:R,headers:bi.from(d.headers),status:d.status,statusText:d.statusText,config:e,request:O})}))}catch(t){if(D&&D(),P&&P.aborted&&P.reason instanceof Oi){const n=P.reason;throw n.config=e,O&&(n.request=O),t!==n&&(n.cause=t),n}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Oi("Network Error",Oi.ERR_NETWORK,e,O,t&&t.response),{cause:t.cause||t});throw Oi.from(t,t&&t.code,e,O,t&&t.response)}}},Tc=new Map,Pc=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,s=[r,a,n];let o,i,c=s.length,l=Tc;for(;c--;)o=s[c],i=l.get(o),void 0===i&&l.set(o,i=c?new Map:bc(t)),l=i;return i},Oc=(Pc(),{http:null,xhr:yc,fetch:{get:Pc}});yi.forEach(Oc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const Dc=e=>`- ${e}`,vc=e=>yi.isFunction(e)||null===e||!1===e;const Rc={getAdapter:function(e,t){e=yi.isArray(e)?e:[e];const{length:n}=e;let r,a;const s={};for(let o=0;o<n;o++){let n;if(r=e[o],a=r,!vc(r)&&(a=Oc[(n=String(r)).toLowerCase()],void 0===a))throw new Oi(`Unknown adapter '${n}'`);if(a&&(yi.isFunction(a)||(a=a.get(t))))break;s[n||"#"+o]=a}if(!a){const e=Object.entries(s).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(Dc).join("\n"):" "+Dc(e[0]):"as no adapter specified";throw new Oi("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return a},adapters:Oc};function $c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tc(null,e)}function xc(e){$c(e),e.headers=bi.from(e.headers),e.data=Zi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Rc.getAdapter(e.adapter||Xi.adapter,e)(e).then((function(t){$c(e),e.response=t;try{t.data=Zi.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=bi.from(t.headers),t}),(function(t){if(!ec(t)&&($c(e),t&&t.response)){e.response=t.response;try{t.response.data=Zi.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=bi.from(t.response.headers)}return Promise.reject(t)}))}const wc={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{wc[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Mc={};wc.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Sc+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,s)=>{if(!1===e)throw new Oi(r(a," has been removed"+(t?" in "+t:"")),Oi.ERR_DEPRECATED);return t&&!Mc[a]&&(Mc[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,s)}},wc.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Lc={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Oi("options must be an object",Oi.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const s=r[a],o=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(o){const t=e[s],n=void 0===t||o(t,s,e);if(!0!==n)throw new Oi("option "+s+" must be "+n,Oi.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Oi("Unknown option "+s,Oi.ERR_BAD_OPTION)}},validators:wc},Uc=Lc.validators;class Fc{constructor(e){this.defaults=e||{},this.interceptors={request:new ki,response:new ki}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),a=-1===r?"":n.slice(r+1);String(e.stack).endsWith(a)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=gc(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&Lc.assertOptions(n,{silentJSONParsing:Uc.transitional(Uc.boolean),forcedJSONParsing:Uc.transitional(Uc.boolean),clarifyTimeoutError:Uc.transitional(Uc.boolean),legacyInterceptorReqResOrdering:Uc.transitional(Uc.boolean)},!1),null!=r&&(yi.isFunction(r)?t.paramsSerializer={serialize:r}:Lc.assertOptions(r,{encode:Uc.function,serialize:Uc.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Lc.assertOptions(t,{baseUrl:Uc.spelling("baseURL"),withXsrfToken:Uc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&yi.merge(a.common,a[t.method]);a&&yi.forEach(["delete","get","head","post","put","patch","query","common"],(e=>{delete a[e]})),t.headers=bi.concat(s,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||Vi;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 d,u=0;if(!i){const e=[xc.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let p=t;for(;u<d;){const e=o[u++],t=o[u++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=xc.call(this,p)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return ji(pc((e=gc(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}yi.forEach(["delete","get","head","options"],(function(e){Fc.prototype[e]=function(t,n){return this.request(gc(n||{},{method:e,url:t,data:(n||{}).data}))}})),yi.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,a){return this.request(gc(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Fc.prototype[e]=t(),"query"!==e&&(Fc.prototype[e+"Form"]=t(!0))}));const jc=Fc;class kc{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 r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,a){n.reason||(n.reason=new tc(e,r,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 kc((function(t){e=t})),cancel:e}}}const Vc=kc;const Bc={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(Bc).forEach((([e,t])=>{Bc[t]=e}));const Gc=Bc;const Wc=function e(t){const n=new jc(t),r=bo(jc.prototype.request,n);return yi.extend(r,jc.prototype,n,{allOwnKeys:!0}),yi.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(gc(t,n))},r}(Xi);Wc.Axios=jc,Wc.CanceledError=tc,Wc.CancelToken=Vc,Wc.isCancel=ec,Wc.VERSION=Sc,Wc.toFormData=xi,Wc.AxiosError=Oi,Wc.Cancel=Wc.CanceledError,Wc.all=function(e){return Promise.all(e)},Wc.spread=function(e){return function(t){return e.apply(null,t)}},Wc.isAxiosError=function(e){return yi.isObject(e)&&!0===e.isAxiosError},Wc.mergeConfig=gc,Wc.AxiosHeaders=bi,Wc.formToJSON=e=>Ki(yi.isHTMLForm(e)?new FormData(e):e),Wc.getAdapter=Rc.getAdapter,Wc.HttpStatusCode=Gc,Wc.default=Wc;const Hc=Wc;function qc(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 zc=qc((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var Yc=function(e,t){return Yc=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])},Yc(e,t)};function Kc(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}Yc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Qc(e,t,n,r){return new(n||(n=Promise))((function(a,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function i(e){try{c(r.throw(e))}catch(e){s(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((r=r.apply(e,t||[])).next())}))}function Jc(e,t){var n,r,a,s={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]&&(s=0)),s;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){s.label=i[1];break}if(6===i[0]&&s.label<a[1]){s.label=a[1],a=i;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(i);break}a[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=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 Xc(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Zc(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(a)throw a.error}}return o}function el(e,t,n){if(n||2===arguments.length)for(var r,a=0,s=t.length;a<s;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}function tl(e){return this instanceof tl?(this.v=e,this):new tl(e)}function nl(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),s=[];return r=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)}})),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){a[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||i(e,t)}))},t&&(r[e]=t(r[e])))}function i(e,t){try{(n=a[e](t)).value instanceof tl?Promise.resolve(n.value.v).then(c,l):d(s[0][2],n)}catch(e){d(s[0][3],e)}var n}function c(e){i("next",e)}function l(e){i("throw",e)}function d(e,t){e(t),s.shift(),s.length&&i(s[0][0],s[0][1])}}function rl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Xc(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,a){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,a,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError;var al=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function sl(e){return"function"==typeof e}function ol(e){return sl(null==e?void 0:e.then)}var il=qc((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 cl(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var ll=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,r,a;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var o=Xc(s),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 s.remove(this);var c=this.initialTeardown;if(sl(c))try{c()}catch(e){a=e instanceof il?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var d=Xc(l),u=d.next();!u.done;u=d.next()){var p=u.value;try{pl(p)}catch(e){a=null!=a?a:[],e instanceof il?a=el(el([],Zc(a)),Zc(e.errors)):a.push(e)}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}if(a)throw new il(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)pl(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)&&cl(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&cl(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),dl=ll.EMPTY;function ul(e){return e instanceof ll||e&&"closed"in e&&sl(e.remove)&&sl(e.add)&&sl(e.unsubscribe)}function pl(e){sl(e)?e():e.unsubscribe()}var hl={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},gl={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=gl.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,el([e,t],Zc(n))):setTimeout.apply(void 0,el([e,t],Zc(n)))},clearTimeout:function(e){var t=gl.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function fl(e){gl.setTimeout((function(){var t=hl.onUnhandledError;if(!t)throw e;t(e)}))}function ml(){}var yl=Il("C",void 0,void 0);function Il(e,t,n){return{kind:e,value:t,error:n}}var El=null;function Al(e){if(hl.useDeprecatedSynchronousErrorHandling){var t=!El;if(t&&(El={errorThrown:!1,error:null}),e(),t){var n=El,r=n.errorThrown,a=n.error;if(El=null,r)throw a}}else e()}var Cl=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,ul(t)&&t.add(n)):n.destination=Ol,n}return Kc(t,e),t.create=function(e,t,n){return new bl(e,t,n)},t.prototype.next=function(e){this.isStopped?Pl(function(e){return Il("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Pl(Il("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Pl(yl,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}(ll),Sl=Function.prototype.bind;function Nl(e,t){return Sl.call(e,t)}var _l=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){Tl(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Tl(e)}else Tl(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Tl(e)}},e}(),bl=function(e){function t(t,n,r){var a,s,o=e.call(this)||this;sl(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&hl.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},a={next:t.next&&Nl(t.next,s),error:t.error&&Nl(t.error,s),complete:t.complete&&Nl(t.complete,s)}):a=t;return o.destination=new _l(a),o}return Kc(t,e),t}(Cl);function Tl(e){var t;hl.useDeprecatedSynchronousErrorHandling?(t=e,hl.useDeprecatedSynchronousErrorHandling&&El&&(El.errorThrown=!0,El.error=t)):fl(e)}function Pl(e,t){var n=hl.onStoppedNotification;n&&gl.setTimeout((function(){return n(e,t)}))}var Ol={closed:!0,next:ml,error:function(e){throw e},complete:ml},Dl="function"==typeof Symbol&&Symbol.observable||"@@observable";function vl(e){return e}function Rl(e){return 0===e.length?vl:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var $l=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 r,a=this,s=(r=e)&&r instanceof Cl||function(e){return e&&sl(e.next)&&sl(e.error)&&sl(e.complete)}(r)&&ul(r)?e:new bl(e,t,n);return Al((function(){var e=a,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?a._subscribe(s):a._trySubscribe(s))})),s},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=xl(t))((function(t,r){var a=new bl({next:function(t){try{e(t)}catch(e){r(e),a.unsubscribe()}},error:r,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[Dl]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Rl(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=xl(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function xl(e){var t;return null!==(t=null!=e?e:hl.Promise)&&void 0!==t?t:Promise}function wl(e){return sl(e[Dl])}function Ml(e){return Symbol.asyncIterator&&sl(null==e?void 0:e[Symbol.asyncIterator])}function Ll(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 Ul="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Fl(e){return sl(null==e?void 0:e[Ul])}function jl(e){return nl(this,arguments,(function(){var t,n,r;return Jc(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,tl(t.read())];case 3:return n=a.sent(),r=n.value,n.done?[4,tl(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,tl(r)];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 kl(e){return sl(null==e?void 0:e.getReader)}function Vl(e){if(e instanceof $l)return e;if(null!=e){if(wl(e))return a=e,new $l((function(e){var t=a[Dl]();if(sl(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(al(e))return r=e,new $l((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(ol(e))return n=e,new $l((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,fl)}));if(Ml(e))return Bl(e);if(Fl(e))return t=e,new $l((function(e){var n,r;try{for(var a=Xc(t),s=a.next();!s.done;s=a.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}e.complete()}));if(kl(e))return Bl(jl(e))}var t,n,r,a;throw Ll(e)}function Bl(e){return new $l((function(t){(function(e,t){var n,r,a,s;return Qc(this,void 0,void 0,(function(){var o,i;return Jc(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=rl(e),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(o=r.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]),r&&!r.done&&(s=n.return)?[4,s.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 Gl(e,t,n,r,a){void 0===r&&(r=0),void 0===a&&(a=!1);var s=t.schedule((function(){n(),a?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(s),!a)return s}function Wl(e){return function(t){if(function(e){return sl(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 Hl(e,t,n,r,a){return new ql(e,t,n,r,a)}var ql=function(e){function t(t,n,r,a,s,o){var i=e.call(this,t)||this;return i.onFinalize=s,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=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,i}return Kc(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}(Cl);function zl(e,t){return void 0===t&&(t=0),Wl((function(n,r){n.subscribe(Hl(r,(function(n){return Gl(r,e,(function(){return r.next(n)}),t)}),(function(){return Gl(r,e,(function(){return r.complete()}),t)}),(function(n){return Gl(r,e,(function(){return r.error(n)}),t)})))}))}function Yl(e,t){return void 0===t&&(t=0),Wl((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function Kl(e,t){if(!e)throw new Error("Iterable cannot be null");return new $l((function(n){Gl(n,t,(function(){var r=e[Symbol.asyncIterator]();Gl(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function Ql(e,t){if(null!=e){if(wl(e))return function(e,t){return Vl(e).pipe(Yl(t),zl(t))}(e,t);if(al(e))return function(e,t){return new $l((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if(ol(e))return function(e,t){return Vl(e).pipe(Yl(t),zl(t))}(e,t);if(Ml(e))return Kl(e,t);if(Fl(e))return function(e,t){return new $l((function(n){var r;return Gl(n,t,(function(){r=e[Ul](),Gl(n,t,(function(){var e,t,a;try{t=(e=r.next()).value,a=e.done}catch(e){return void n.error(e)}a?n.complete():n.next(t)}),0,!0)})),function(){return sl(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(kl(e))return function(e,t){return Kl(jl(e),t)}(e,t)}throw Ll(e)}function Jl(e,t){return t?Ql(e,t):Vl(e)}function Xl(e){return Wl((function(t,n){var r,a=null,s=!1;a=t.subscribe(Hl(n,void 0,void 0,(function(o){r=Vl(e(o,Xl(e)(t))),a?(a.unsubscribe(),a=null,r.subscribe(n)):s=!0}))),s&&(a.unsubscribe(),a=null,r.subscribe(n))}))}class Zl{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((r=>r.type===e&&r.name===t&&r.props.index===n))}addNode(e,t,n={}){let r=this.getNode(e,t,n.index);return r?r.props=n:(r=new Zl(e,t,n),r.parent=this,this.children.push(r)),r}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 r=this.children[n];if(r.props.index===t&&r.name===e){this.children.splice(n,1);break}}}}const ed=Zl;const td=class{constructor(e,t,n,r={}){this.type=Ur.CONTEXT_TREE_NODE_TYPES.WHEN,this.subType=e,this.referenceName=t,this.name=n,this.props=r}},nd=/(([^.]+)\[\d+\])/g,rd=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(nd);if(!t)return[e];let n,r=t[t.length-1];return e=e?.split(r)[0],e=e?.substring(0,e.length-1),[r,n]=r.split("["),n=n?.split("]")[0],[e,r,n]},ad=(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:sd,WHEN:od,DECLARATIVE_TARGET:id,PAGELIST:cd}=Fr.CONTEXT_TREE_NODE_TYPES;let ld;const dd=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[sd,new Map],[od,new Map],[id,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===cd){const n=this.references.get(sd);n.set(e,t),this.references.set(sd,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const r=ad(n.name,e);return-1!==r&&+r>=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),r=t?.parent;r?.removeChildNode(e)}const r=this.references.get(sd),a=this.references.get(id);[...r.keys(),...a.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=rd(e);return+n>=t})).forEach((e=>{const t=r.get(e),n=t?.parent;n?.removeChildren(),r.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((r=>r.type===e&&r.name===t&&r.props.index===n))}addNode(e,t,n={}){let r=this.getNode(e,t,n.index);return r?r.props=n:(r=new ed(e,t,n),r.parent=this,this.children.push(r)),r}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e){this.eventSubscribers.forEach((t=>{t(e)}))}removeReference(e,t,n){const r=this.references.get(t),a=r?.get(e);if(a?.props?.index===n){const n=a?.props?.context;r.delete(e),t===sd&&n&&ld?.(n,e)}}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const r=this.children[n];if(r.props.index===t&&r.name===e){this.children.splice(n,1);break}}}addWhen(e,t,n,r,a){if(!(n&&r&&e&&t))return;n.startsWith(".")&&(n=n.substring(1));const s=`${e}.${n}.${r}`,o=new td(t,n,r,a),i=this.references.get("WHEN");i?.set(s,o)}},{VIEW:ud,FIELD:pd,CONTEXT:hd,DECLARATIVE_TARGET:gd,WHEN:fd}=Ur.CONTEXT_TREE_NODE_TYPES;const md=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new dd(hd,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 r=this.addContextNode(e).addNode("PAGE",t);let a=r.getReference(n);return a||(a=r.addNode("VIEW",n),r.addReference(n,a)),a}pushChildPageNodeToParentView(e,t,n){const r=e.children;let a=!1;if(r)for(let e=0;e<r.length;e+=1)if(r[e].name===n){a=!0;break}a||r.push(t),t.parent=e}addViewNode(e,t,n,r,a={}){const s=this.addContextNode(e).addNode("PAGE",t);let o=null;if(r&&n!==r){o=this._addParentViewNode(e,t,r).addNode("VIEW",n,a)}else o=s.addNode("VIEW",n,a);s.addReference(n,o);const i=t.split(".");for(;i.length>0;){i.pop();const n=i.join("."),a=this.getContextNode(e)?.getNode("PAGE",n),o=a?.getReference(r);if(o){this.pushChildPageNodeToParentView(o,s,t);break}}return o}getViewNode(e,t,n){return this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n)}addPageListNode(e,t,n,r,a){if(!r)return;r.startsWith(".")&&(r=r.substring(1));const s=this.addContextNode(e),o=s.addNode("PAGE",t)?.getReference(n)?.addNode("PAGELIST",`${t}.${r}`,a);return o&&s.addReference(`${t}.${r}`,o),o}updatePageListNode(e,t,n,r){if(!n)return;n.startsWith(".")&&(n=n.substring(1));this.addContextNode(e).removePageListNodes(`${t}.${n}`,r)}removeFieldNode(e,t,n,r,a){const s=this.getContextNode(e);s?.getNode("PAGE",t)?.getReference(n)?.removeNode(`${t}${r}`,a),s?.removeReference(`${t}${r}`,pd,a),s?.removeReference(`${t}${r}`,gd,a)}removeViewNode(e,t,n,r,a={}){const s=this.getContextNode(e),o=s?.getNode("PAGE",t),i=o?.getReference(n);if("visibility"in a&&i?.props&&"visibility"in i.props&&a.visibility!==i.props.visibility)return;this.removeChildViewNodes(e,t,n,r);const c=i?.parent?.children?.findIndex((e=>e.name===n))??-1;c>-1&&i?.parent?.children.splice(c,1)}removeChildViewNodes(e,t,n,r){const a=this.getContextNode(e),s=a?.getNode("PAGE",t),o=s?.getReference(n);o?.children.forEach((s=>{"PAGE"===s.type?this.removeViewNode(e,s.name,n,r):s.type===ud?this.removeChildViewNodes(e,t,s.name,r):(a.removeReference(s.name,pd,s.props.index),a.removeReference(s.name,gd,s.props.index),"PAGELIST"!==s.type&&"Address"!==s.props?.componentName||this.deleteAllListNodes(e,s.name))})),s?.references.delete(n)}deleteAllListNodes(e,t,n=!0){const r=r=>{const a=this.getContextNode(e),s=a?.references?.get(r);if(s)for(const[e]of s)(n&&e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&a?.references?.get(r)?.delete(e)};r(pd),r(gd)}deleteListNode(e,t,n){const r=r=>{const a=this.getContextNode(e),s=a?.references?.get(r);if(s)for(const[e]of s)e.includes(`${t.join(".")}[${n}]`)&&a?.references?.get(r)?.delete(e)};r(pd),r(gd)}getPageListNode(e,t,n,r){const a=this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n);return a?.children.find((e=>"PAGELIST"===e.type&&e.name===`${t}.${r}`))}getFieldNode(e,t,n,r){return this.getViewNode(e,t,n)?.getNode(pd,r)}_findViewNode(e,t,n,r){let a=r.addNode("PAGE",t)?.getReference(n);if(a)return a;const s=t.split(".");for(;s.length>0;){s.pop();const e=s.join(".");if(a=r.addNode("PAGE",e)?.getReference(n),a)return a}return this.addViewNode(e,t,n)}addFieldNode(e,t,n,r,a,s={}){const o=this.addContextNode(e),i=this._findViewNode(e,t,n,o),c=this.createFieldNode(i,t,r,s);return c&&this.updateFieldNode(o,i,c,e,t,r,a),c}createFieldNode(e,t,n,r){const{isDeclarativeTarget:a}=r;return a?e.addNode(gd,`${t}${n}`,r):e.addNode(pd,`${t}${n}`,r)}updateFieldNode(e,t,n,r,a,s,o){const i=`${a}${s}`;"Address"===n.props?.componentName&&this.deleteAllListNodes(r,n.name),e.addReference(i,n),n.value=o,n.setPreviousDefaultValue(),n.props.isInsideList&&this.handleFieldInsideList(e,t,r,a,s)}handleFieldInsideList(e,t,n,r,a){const s=sE(n),o=vI(s,n)||{},i=`${r}${a}`;let c=null;if(o?.subscriptFieldName||o?.isPageGroup)c=r.substring(0,r.lastIndexOf(`.${o?.index??""}`))||i.substring(0,i.lastIndexOf(`.${o?.index}`)),this.createListNodeIfNotExist(e,t,c);else{const n=r.substring(0,r.lastIndexOf("["))||i.substring(0,i.lastIndexOf("["));this.createListNodeIfNotExist(e,t,n)}}createListNodeIfNotExist(e,t,n){let r=e.getReference(n,pd);r||(r=t.addNode(pd,n,{}),e.addReference(n,r))}removeContextTreeNode(e){delete this.rootNodes[e]}onViewMutate(e,t,n,r){this.getViewNode(e,t,n)?.addEventListener(r)}mutateField(e,t,n,r){const a=this.getContextNode(e),[s,o,i]=rd(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,s,o,{...r,rowIndex:i});const c=a?.getReference(`${t}.${n}`,pd);c&&c instanceof ed&&c.triggerEvent(r)}onPageListMutate(e,t,n,r,a){this.getPageListNode(e,t,n,r)?.addEventListener(a)}mutatePageList(e,t,n,r,a=!1){const s=this.getContextNode(e),o=s?.getReference(`${t}.${n}`,pd);o&&o instanceof ed&&o.triggerEvent(r,a)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(pd)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(pd)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(gd)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(pd)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(gd)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const r=this.getContextNode(e)?.references?.get(pd)?.get(t);r instanceof ed&&r&&(r.previousValue=r.value,void 0===r.value&&(r.previousValue=n),r.value=n)}getContextReferences(e){if(!this.getContextNode(e))return;const t=this.getContextReferencesByType(e,pd),n=this.getContextReferencesByType(e,gd);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,pd)?.get(t)||!!this.getContextReferencesByType(e,gd)?.get(t)}addWhenNode(e,t,n,r,a,s){const o=this.getContextNode(e);o?.addWhen(t,n,r,a,s)}getDeclarativeTargets(e){const t=this.getContextNode(e),n=t?.references?.get(gd)||new Map,r=[];return n.forEach((e=>{const t=e?.props||{},{propertyName:n=""}=t,a=t.pageReference??Ur.CASE_INFO.CASE_INFO_CONTENT;r.push({pageReference:a,name:n})})),r}getWhens(e){const t=this.getContextNode(e),n=t?.references?.get(fd)||new Map,r=[];return n.forEach((e=>{const t=e.subType,n=e.referenceName,a=e.name,s=e?.props?.pageReference??Ur.CASE_INFO.CASE_INFO_CONTENT;r.push({name:a,pageReference:s,referenceName:n,type:t})})),r}},yd={CONTENT_FIELDS_PATH:[Fr.CONTEXT_DATA,Fr.CASE_INFO.CASE_INFO,Fr.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[Fr.CONTEXT_DATA,Fr.DATA_INFO.DATA_INFO,Fr.CONTENT],OBJECT_CONTENT_FIELDS_PATH:[Fr.CONTEXT_DATA,Fr.OBJECT_INFO.OBJECT_INFO,Fr.CONTENT],FIELD_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.CASE_INFO.CASE_INFO,Fr.CONTENT,Fr.SUMMARY_OF_MESSAGES,Fr.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.DATA_INFO.DATA_INFO,Fr.CONTENT,Fr.SUMMARY_OF_MESSAGES,Fr.PROPERTY_MESSAGES],OBJECT_FIELD_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.OBJECT_INFO.OBJECT_INFO,Fr.CONTENT,Fr.SUMMARY_OF_MESSAGES,Fr.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.SUMMARY_OF_MESSAGES,Fr.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.SUMMARY_OF_MESSAGES,Fr.HTTP_MESSAGES],CASE_MESSAGE_PATH:[Fr.CASEMESSAGES]},Id=(e="",t="",n,r)=>{let a=[],s=[];null!==e&&(s=(e=>e?.startsWith(".")?e.substring(1).split("."):e.split("."))(e));const o=t&&t.startsWith(".")?t.substr(1):t;if(n===Fr.PROPERTY&&e||e){a=[Fr.CONTEXT_DATA,...o.split(".")];for(let e=0;e<s.length-1;e+=1)a.push(s[e]);a.push(Fr.SUMMARY_OF_MESSAGES,Fr.PROPERTY_MESSAGES,s[s.length-1])}else n===Ur.PAGE?a=[...yd.PAGE_MESSAGES_PATH]:n===Fr.HTTP?a=[...yd.HTTP_MESSAGES_PATH]:n===Fr.CASEMESSAGES?a=[...yd.CASE_MESSAGE_PATH]:r&&(a=[Fr.CONTEXT_DATA,...o.split(".")]);return a.filter(Boolean)},Ed=(e,t,n)=>{const r={content:{}},a=`${t.split(".").slice(2).join(".")}[${n}]`,s=hC.getIn(e?.content,a.split("."));return s&&hC.setIn(r.content,a.split("."),{...s}),r},Ad=(e,t,n,r,a,s,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,r,a),c=r>a?"up":"down";i&&i?.length>0&&i?.forEach((n=>{const r=parseInt(n.match(/\d+/)?.[0],10),a=`${s}[${r}]`;o[`${s}[${r+("up"===c?1:-1)}]`]=hC.getIn(e[t],[Fr.CONTEXT_DATA,...a.split(".")]),hC.deleteIn(e[t],[Fr.CONTEXT_DATA,...a.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{hC.setIn(e[t],[Fr.CONTEXT_DATA,...n.split(".")],o[n])}))},Cd=(e,t,n,r,a)=>{const s=hC.deepClone(hC.getIn(e,[`${t}`])),o=hC.getIn(s,[Fr.CONTEXT_DATA,Fr.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 r=hC.getIn(e,[Fr.CONTEXT_DATA,...n.split(".")],{});return Object.keys(r).filter((e=>e.includes(`${t}[`)))})(s,i.substring(i.lastIndexOf(".")+1),c);if(0===l.length)return;const d=Ed(o,i,r).content;if(d&&Object.keys(d).length>0){const n={},o=`${i}[${r}]`,c=hC.getIn(s,[Fr.CONTEXT_DATA,...o.split(".")]);n[`${i}[${a}]`]=c,hC.deleteIn(e[t],[Fr.CONTEXT_DATA,...o.split(".")]),Ad(e,t,l,r,a,i,n)}else Ad(e,t,l,r,a,i)},Sd=e=>{const{type:t,property:n,category:r,context:a,pageReference:s}=e;let o;n&&(o=n.slice(1));const i=JA(a);let c=[];const l=hC.getIn(i,Id(o,s,r));return t&&"all"!==t?(l&&Array.isArray(l)&&l.length>0&&(c=l.filter((e=>e.type===t))),t===Ur.MESSAGES.MESSAGES_TYPE_ERROR&&c.length>0&&n&&md.mutateField(a,s,n,{messages:[...c],type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},Nd=e=>{const{property:t,pageReference:n,category:r,context:a,type:s,subType:o,isListEntry:i,clearContextMessages:c,deletingIndex:l}=e,d={context:a,type:s,subType:o};t&&!i?(md.mutateField(a,n,t,{type:cs,fieldName:t}),d.property=t,d.pageReference=n):i?(d.pageReference=n,d.isListEntry=i,d.deletingIndex=l):d.category=r,QA(c?{type:cs,payload:{stateObj:e.stateObj,context:a}}:{type:cs,payload:d})},_d=e=>{const{messages:t,property:n,pageReference:r,category:a,context:s}=e,o={messages:t,context:s};n?(o.property=n,o.pageReference=r):o.category=a,QA({type:is,payload:o})},bd=(e,t,n)=>{for(const r of Object.keys(e)){if(t.push(r),r===Fr.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[r]&&bd(e[r],t,n)}t.pop()}return n},Td=(e,t)=>{let n=Sd({context:Fr.APP.ROOT,category:"HTTP"});if(LE.getRenderingMode()===Fr.EMBED){const e=Sd({context:Fr.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=Sd({context:t,category:"HTTP"});n?e&&(n=n.concat(Sd({context:t,category:"HTTP"}))):n=Sd({context:t,category:"HTTP"})}return n},Pd=e=>{let t=null;t=zI(e)[0]?VI(zI(e)[0]):e,t&&Nd({context:t,stateObj:JA(t),clearContextMessages:!0})},Od=e=>(hC.getIn(JA(e),yd.PAGE_MESSAGES_PATH)??[]).some((e=>e.subType===Fr.CUSTOM_ERROR)),Dd={addMessages:_d,getValidationErrorMessages:(e,t)=>{const n=JA(e),r=(e=>{let t=yd.CONTENT_FIELDS_PATH;e?.objectInfo?t=ry.isObjectCaseType(e?.objectInfo?.objectTypeID)?yd.OBJECT_CONTENT_FIELDS_PATH:t:e?.dataInfo?.content&&(t=yd.DATA_OBJECT_CONTENT_FIELDS_PATH);return t})(n),a=hC.getIn(n,[...r])||{},s=[];return bd(a,[],[]).forEach((e=>{const n=hC.getIn(a,[...e,Fr.PROPERTY_MESSAGES]);n&&Object.keys(n).forEach((e=>{n[e].forEach((e=>{if(e.type===Fr.MESSAGES.MESSAGES_TYPE_ERROR){const n=t?.getLocalizedMessage(e.message)??e.message;e.fieldLabel?s.push({label:`${e.fieldLabel}:`,description:n}):s.push(n)}}))}))})),s},getMessages:Sd,clearMessages:Nd,getRootContainerHttpMessages:Td,clearContextMessagesInActiveWorkArea:Pd,clearContextMessages:e=>{const{context:t}=e;QA({type:cs,payload:{clearAll:!0,context:t}})},isCustomPageErrorExist:Od};const vd=class{constructor(e,t,n,r){this.eventType=e,this.callback=n,this.contextName=r,this.id=t}};const Rd=new class{constructor(){this.subscribers={}}publish(e,t){(this.subscribers[e]||[]).slice().forEach((e=>{e.callback(t)}))}unsubscribe(e,t,n){const r=this.subscribers[e]||[];let a=0,s=-1;r.forEach((e=>{e.id===t&&e.contextName===n&&(s=a),a+=1})),-1!==s&&r.splice(s,1)}unsubscribeAllWithEventType(e){this.subscribers[e]=[]}subscribe(e,t,n,r,a){this.subscribers[e]=this.subscribers[e]||[];let s=!1;if(a&&this.subscribers[e].forEach((e=>{s=e.id===t&&e.contextName===r})),!s){const a=new vd(e,t,n,r);this.subscribers[e].push(a)}}clearContext(e){const t=this.subscribers;Object.keys(t).forEach((t=>{const n=this.subscribers[t],r=[];n.forEach((t=>{t.contextName!==e&&r.push(t)})),this.subscribers[t]=r}))}};const $d=class{static subscribe(e,t,n,r=!1,a="app"){Rd.subscribe(e,n,t,a,r)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){Rd.publish(e,t)}static unsubscribe(e,t,n="app"){Rd.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){Rd.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){Rd.clearContext(e)}};const xd=new class{override=null;discoveredOffline=!1;subscribers=new Set;constructor(){"function"==typeof globalThis.addEventListener&&(globalThis.addEventListener("online",this.handleOnline),globalThis.addEventListener("offline",this.handleOffline))}isOnline(){return null!==this.override?this.override:!this.discoveredOffline&&("undefined"==typeof navigator||!("onLine"in navigator)||navigator.onLine)}setOnlineOverride(e){const t=this.isOnline();this.override=e;const n=this.isOnline();n!==t&&this.notifyAll(n)}onStatusChange(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}reportNetworkFailure(){null===this.override&&(this.discoveredOffline||(this.discoveredOffline=!0,this.notifyAll(!1)))}reportNetworkRecovery(){null===this.override&&this.discoveredOffline&&(this.discoveredOffline=!1,this.notifyAll(!0))}handleOnline=()=>{null===this.override&&(this.discoveredOffline=!1,this.notifyAll(!0))};handleOffline=()=>{null===this.override&&this.notifyAll(!1)};notifyAll(e){QA({type:e?la:ca,payload:{context:"app"}}),this.subscribers.forEach((t=>{t(e)}))}};const wd=new class{#e;#t;#n;#r;constructor(){this.#e="undefined"!=typeof localStorage&&"true"===localStorage.getItem("inspectorFlag"),this.#t=!1,this.#n=!1,this.#r=!1,this.isPreview=!1,this.debugLevels="vcv=1;tracer=0;log=0;metric=1"}#a(){return this.#n&&this.#r}toggleXRay(e){console.warn("The toggleXRay method is deprecated. Please use the toggleInspector method going forward."),e&&!this.inspectorEnabled&&this.toggleInspector(),!e&&this.inspectorEnabled&&this.toggleInspector()}get inspectorEnabled(){return this.#e}get inspectorShowAll(){return this.#t}toggleInspector(){const e="undefined"!=typeof localStorage?localStorage:null,t="true"===e?.getItem("inspectorFlag");!t&&this.#a()||(this.#e=!t,e?.setItem("inspectorFlag",this.#e.toString()),$d.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e))}disableInspectorIfEnabled(){if(!this.#e)return;this.#e=!1;const e="undefined"!=typeof localStorage?localStorage:null;e?.setItem("inspectorFlag",this.#e.toString()),$d.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e)}toggleInspectorShowAll(){this.#t=!this.#t,$d.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR_SHOW_ALL,this.#t)}get uiDesignerEnabled(){return this.#n}setDesignerToolbarExpanded(e){this.#r=e,$d.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER_TOOLBAR_EXPANDED,e)}get uiDesignerToolbarExpanded(){return this.#r}toggleUIDesigner(){this.#n=!this.#n,this.#n||(this.#r=!1),$d.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER,this.#n),$d.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER_TOOLBAR_EXPANDED,this.#r)}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 Md{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new Md(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):uu(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=pu()}async buildAuthorizeUrl(e){e=e||window.btoa(window.location.origin);let{sessionIndex:t}=this.config;const{password:n}=this.config,r=this.config.clientId?this.config.clientId:this.config.client_id,a=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,s=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:wE.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 d=new Uint8Array(64);window.crypto?.getRandomValues(d),this.config.codeVerifier=this.base64UrlSafeEncode(d),this.updateConfig(this.config,!1);const u=i?`+app.alias.${i.replace(/^app\//,"")}`:"";return this.getCodeChallenge(this.config.codeVerifier)?.then((t=>`${s}?client_id=${r}&response_type=code&redirect_uri=${a}&scope=openid${u}&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,r=this.config.clientSecret?this.config.clientSecret:this.config.client_secret,a=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,s=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"),d=new URLSearchParams;return n&&d.append("client_id",n),r&&d.append("client_secret",r),d.append("grant_type","authorization_code"),d.append("code",l),a&&d.append("redirect_uri",a),o&&d.append("code_verifier",o),this.config?.secureCookie&&d.append("send_token_as_cookie","true"),au(s,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:d.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?lu({pzCTkn:e?.csrf}):(du({tokenInfo:e}),lu({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 Ld=Md,Ud=async()=>new Promise((async(e,t)=>{const n=hu();if(!("tokenInfo"in n)||!n?.tokenInfo)return void t(new Error("Missing token information."));const{access_token:r,refresh_token:a=null}=n.tokenInfo,s=n.endPoints?.revoke,{client_id:o="",client_secret:i="",secureCookie:c,serverType:l}=n,d="launchpad"===l,u={"content-type":"application/x-www-form-urlencoded"};i&&!d&&(u.authorization=`Basic ${window.btoa(`${o}:${i}`)}`);const p=new URLSearchParams;i?d&&(p.append("client_id",o),p.append("client_secret",i)):p.append("client_id",o),c&&p.append("send_token_as_cookie","true");const h=a?"refresh_token":"access_token",g="access_token"===h?r:a;!c&&g&&p.append("token",g),p.append("token_type_hint",h),s&&await au(s,{method:"POST",headers:u,withCredentials:c,body:p.toString(),withoutDefaultHeaders:!0}),lu({Authorization:null}),du({tokenInfo:null}),e()})),Fd=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new Ld(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=an()+(rn()?`${rn()}`:"/?reAuth=true");return t},jd=(e,t)=>{Fd(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};$d.publish(Ur.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},kd=e=>{let t="",n={},r={},a=!0;if("OAuth2.0"===e?.authType){t=e.endPoints.token;const s=new URLSearchParams;(!e.tokenInfo.refresh_token||e.tokenInfo.refresh_token&&e.tokenInfo.refresh_token.length<=0)&&(a=!1),s.append("client_id",e.client_id),s.append("grant_type","refresh_token"),e.client_secret&&s.append("client_secret",e.client_secret),e.secureCookie&&s.append("send_token_as_cookie","true"),e.tokenInfo?.refresh_token&&s.append("refresh_token",e.tokenInfo.refresh_token),n={method:"POST",body:s.toString(),headers:{"content-type":"application/x-www-form-urlencoded"}},r={success:t=>{const{data:n}=t,r={access_token:n?.access_token,refresh_token:n?.refresh_token};du({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?lu({pzCTkn:n?.csrf}):lu({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:a}=e;a&&"function"==typeof a&&a(n)},failure:t=>{if(e.popupReauth)return jd(t,e);$d.publish(Ur.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${an()}/updateSession`,n={method:"GET",headers:{}},r={failure:jd};return{url:t,config:n,callback:r,isRefreshTokenPresent:a}},Vd=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Bd=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}},Gd=e=>{const{url:t,config:n,callback:r}=kd(e);return au(t,n).then((e=>{r?.success?.(e),$d.publish("updateSession",{updateStatus:"success"}),$d.publish("OnUpdateSession",{})})).catch((e=>{throw e}))},Wd=(e,t,n)=>{const{config:r}=e,{url:a,config:s,callback:o,isRefreshTokenPresent:i}=kd(n),c=r?.headers&&r.headers.context;r?.data&&(r.body=r.data);const l=su(r.url,r,c,t);return i?au(a,s).then((e=>new Promise(((n,a)=>{setTimeout((()=>{t.setUpdateSessionStatus(!1),t.latestUpdateSessionTimeStamp=Date.now(),o?.success?.(e,r),$d.publish("updateSession",{updateStatus:"success"}),$d.publish("OnUpdateSession",{}),l.then((e=>{n(e)})).catch((e=>{a(e)}))}),0)})))).catch((e=>e&&e.config&&Vd(e.config.url,n)?(o?.failure?.(r.url,n),l):Promise.reject(e))):(o?.failure?.(r.url,n),l)},Hd=e=>"object"==typeof e&&null!==e,qd=(e,t,n,r)=>{if(e.config&&Vd(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($d.unsubscribeAllWithEventType(Kd),t.setUpdateSessionStatus(!0),"custom"===n?.authType){$d.publish(Ur.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:a}=Bd(e);return su(n,r,a,t)}return Wd(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&!e.config.isExternalUrl&&t.getUpdateSessionStatus()){const{url:t,config:n,context:r}=Bd(e);return au(t,n,r)}const a=(e=>{if(e instanceof ArrayBuffer)try{const t=(new TextDecoder).decode(e),n=JSON.parse(t);return Hd(n)?n:{}}catch{return{}}return Hd(e)?e:{}})(e.response?.data);if(e.response&&e.response.status&&422!==e.response.status&&424!==e.response.status&&(400!==e.response.status||a.errorClassification!==Ur.INVALID_INPUTS)&&e.config.headers.context&&e.response.data&&!r){const t=a.errorDetails&&a.errorDetails.map((t=>((e,t)=>t[Ur.TRACE_ID]?{type:"error",message:e.localizedValue||e.message,correlationID:t[Ur.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"))),_d({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const zd=class{constructor(){this.updateSessionInProgress=!1,this.latestUpdateSessionTimeStamp=Date.now()}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const Yd=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((r=>{const a=r.Value,s=t.get(e.Key);s&&(n[a]||(n[a]=[]),n[a].push(`${e.Key}=${s}`))}))})),n}registerHeadersFromMap(e){Object.entries(e).forEach((([e,t])=>{t.length>0&&this.registerHeader(e,t.join("; "))}))}getDefaultHeaders(){return this.defaultHeaders}addDebugHeaders(e={}){return{[Fr.COREHEADER_APP_DEBUG_ID]:e.debugId,[Fr.COREHEADER_APP_DEBUG_LEVELS]:wd.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=yC.getProperty(Fr.COREHEADERS,"",e);return t?{...t,debugInfo:wd.getPreviewMode()&&{...t.debugInfo,[Fr.COREHEADER_APP_DEBUG_LEVELS]:wd.getDebugLevels()}}:(e=e.substr(0,e.lastIndexOf(this.SPECIAL_CHARS.SLASH)),this.getCoreHeadersFromContext(e))}processCoreHeaders(e,t,n){const r=this.getCoreHeadersFromContext(n);if(r){const t=Object.keys(e);if(t.includes(Fr.SKIPCOREHEADERS))return void delete e[Fr.SKIPCOREHEADERS];const n=Object.assign({},...Object.values(r));Object.keys({...n}).forEach((r=>{t.includes(r)||(e[r]=n[r])}))}}injectCoreAdditionalHeaders(e,t,n,r){r?.includeRemoteSystemIdIfPresent&&Vr.injectRemoteCaseHeader(e,t,n),this.processCoreHeaders(e,t,n)}};const Kd="updateSession",Qd={},Jd=new zd,Xd=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&&($d.unsubscribe(Ur.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((()=>{$d.publish(Ur.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),$d.subscribe(Ur.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let Zd={},eu={},tu={},nu="";const ru=e=>{if("OAuth2.0"===e?.authType&&e.secureCookie||"custom"===e?.authType&&e.customCookies)return!0},au=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:a=null,cancelContext:s=n,includeRemoteSystemIdIfPresent:o=!0}=r;nu=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:d,withoutDefaultHeaders:u=!1,...p}=t,{Authorization:h,pzCTkn:g,...f}=t.headers||{};u||Yd.injectCoreAdditionalHeaders(f,t.body,n,{includeRemoteSystemIdIfPresent:o}),s&&Qd[s]>=0?Qd[s]+=1:s&&void 0===Qd[s]&&(Qd[s]=1);let m=u?{...f}:{...Yd.getDefaultHeaders(),...Yd.getRegisteredHeaders(),...f,context:n};if(p.isExternalUrl=(e=>!e?.startsWith(an()||""))(e||""),p.fetchTimeStamp=Date.now(),e&&Vd(e,eu)&&Jd.getUpdateSessionStatus()||!Jd.getUpdateSessionStatus()||p.isExternalUrl){Vd(e,eu)&&"OAuth2.0"===eu?.authType&&(m={...f});const{restApi:t}=wE.doesRestApiExist("Logout")&&wE.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&Xd.setTimerID(Xd.resetInactiveTimeout(Xd.getTimerID())),function(e,t){var n="object"==typeof t;return new Promise((function(r,a){var s,o=!1;e.subscribe({next:function(e){s=e,o=!0},error:a,complete:function(){o?r(s):n?r(t.defaultValue):a(new zc)}})}))}(Jl(Hc({context:n,...p,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},responseType:l,adapter:d,headers:m,withCredentials:ru(eu)})).pipe((A=sl(y=()=>{const e=Yd.getCoreHeadersFromContext(m.context);var t;e&&(t={...e},$d.publish(Fr.PUB_SUB_EVENTS.FETCH_SUCCESS,t))})||I||E?{next:y,error:I,complete:E}:y)?Wl((function(e,t){var n;null===(n=A.subscribe)||void 0===n||n.call(A);var r=!0;e.subscribe(Hl(t,(function(e){var n;null===(n=A.next)||void 0===n||n.call(A,e),t.next(e)}),(function(){var e;r=!1,null===(e=A.complete)||void 0===e||e.call(A),t.complete()}),(function(e){var n;r=!1,null===(n=A.error)||void 0===n||n.call(A,e),t.error(e)}),(function(){var e,t;r&&(null===(e=A.unsubscribe)||void 0===e||e.call(A)),null===(t=A.finalize)||void 0===t||t.call(A)})))})):vl,Xl((e=>{const t=m,n=!!t?.[Fr.COREHEADER_APP_DEBUG_ID]?{debugInfo:{[Fr.COREHEADER_APP_DEBUG_ID]:t?.[Fr.COREHEADER_APP_DEBUG_ID],[Fr.COREHEADER_APP_DEBUG_LEVELS]:wd.getDebugLevels()}}:Yd.getCoreHeadersFromContext(m.context);var r;throw n&&(r={...n,error:e},$d.publish(Fr.PUB_SUB_EVENTS.FETCH_FAILURE,r)),e}))))}var y,I,E,A;return su(e,t,n,Jd)},su=(e,t,n,r)=>new Promise(((a,s)=>{$d.subscribe(Kd,(o=>{r.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?au(e,t,n).then((e=>a(e))).catch((e=>s(e))):s(o.updateStatus.error)}),Kd)})),ou=e=>{Qd[e]>0&&(Qd[e]-=1,0===Qd[e]&&delete Qd[e])};Hc.interceptors.request.use((e=>xd.isOnline()?(Zd?.request&&(e=Zd.request(e)),e):(JA(e.context)?.isLoading&&QA({type:ia,payload:{context:e.context}}),QA({type:ca,payload:{context:"app"}}),Promise.reject(new Error("Network Offline")))),(e=>Promise.reject(e))),Hc.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"))),_d({messages:t,category:"HTTP",context:n}),Promise.reject(e)}if(e.config.headers&&e.config.headers.context){if(!e.config.skipClearErrorMessages){Sd({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&Nd({type:"error",category:"HTTP",context:e.config.headers.context}),Sd({type:"error",category:e.config.headers.context===Fr.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&Nd({type:"error",category:"PAGE",context:e.config.headers.context});e.config.headers.context.slice(e.config.headers.context.lastIndexOf("/")+1).startsWith("primary")&&(Sd({type:"error",category:"HTTP",context:Fr.APP.APP}).length>0&&Nd({type:"error",category:"HTTP",context:Fr.APP.APP}),Sd({type:"error",category:"PAGE",context:Fr.APP.APP}).length>0&&Nd({type:"error",category:"PAGE",context:Fr.APP.APP}))}ou(e.config.headers.context)}return Zd?.response&&(e=Zd.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&ou(e.config.headers.context),"ERR_NETWORK"===e.code||"ECONNABORTED"===e.code||"Network Offline"===e.message||!0===e.isOffline?(JA(e.config?.headers?.context)?.isLoading&&QA({type:ia,payload:{context:e.config?.headers?.context}}),xd.reportNetworkFailure(),Promise.reject(new Error("Network Offline"))):("Network Offline"!==e.message&&JA(Fr.APP.APP)?.context_data?.isOffline&&xd.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&&Vd(e.config.url,eu)||$d.subscribe(Kd,(e=>{Jd.setUpdateSessionStatus(!e.updateStatus)}),Kd),qd(e,Jd,eu,e.response&&e.response.status&&e.response.status===Number(nu)?nu:null)))));const iu=()=>Hc.CancelToken.source(),cu=e=>Hc.isCancel(e),lu=e=>{Yd.setDefaultHeaders(e)},du=e=>{eu={...eu,...e}},uu=e=>{tu={...tu,...e}},pu=()=>({...tu}),hu=()=>({...eu});const gu=class{static formatPageReference(e){const t=e?.split(".").map((e=>{if(e.includes("[")){const t=e.indexOf("["),n=e.indexOf("]"),r=e.substring(t+1,n),a=Number(r)+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(")"),r=e.substring(t+1,n),a=Number(r);if(!Number.isNaN(a)){const r=a-1;return`${e.substring(0,t)}[${r}]${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 fu=class{static execute(e,t,n,r){const a=!LE.isInfinityRuntime(),s={};Object.hasOwn(n,"nonFormProperties")&&(n.nonFormProperties.forEach((e=>{s[e]=n[e],delete n[e]})),delete n.nonFormProperties);const o={instruction:"string"==typeof t?"ADD":"INSERT",content:{...hC.unflatten(n)}},i=JSON.parse(JSON.stringify(o)),c=i.content.classID||i.content["@class"];delete i.content.classID;return{instruction:{target:hC.buildInstructionPageReference(r,e),content:{...a&&c?{"@class":c}:{},...i.content},["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"string"==typeof t?"ADD":"INSERT"},actionPayload:o,displayPropertPayload:s}}};const mu=class{static execute(e,t,n,r,a,s,o,i){const c=!LE.isInfinityRuntime(),l="string"==typeof n?`${t}(${n})`:`${t}[${n-1}]`,d=eC(".classID",`${a}${l}`,e)||eC(".@class",`${a}${l}`,e),u={instruction:"UPDATE",content:{...hC.unflatten(r)},isDefault:i},p={content:{...c&&d?{"@class":d}:{},...u.content},target:hC.buildInstructionPageReference(a,t),["string"==typeof n?"groupIndex":"listIndex"]:n,instruction:"UPDATE"};return s||QA(tS({...u,["string"==typeof n?"groupIndex":"listIndex"]:"string"==typeof n?n:n-1,context:e,referenceList:`${a}${t}`,skipDirtyValidation:o})),p}};const yu=class{static execute(e,t,n){return{target:hC.buildInstructionPageReference(n,e),["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"DELETE"}}};const Iu=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:hC.buildInstructionPageReference(e,t)}}static execute(e,t,n,r){r||QA(tS({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const Eu=class{static execute(e,t,n,r){return{target:hC.buildInstructionPageReference(r,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const Au=class{static execute(e,t,n){const r=!LE.isInfinityRuntime(),a={instruction:"REPLACE",content:{...hC.unflatten(t)}},s=a.content.classID||a.content["@class"];delete a.content.classID;return{instruction:{target:hC.buildInstructionPageReference(n,e),content:{...r&&s?{"@class":s}:{},...a.content},instruction:"REPLACE"},actionPayload:a}}};const Cu=class{static execute(e,t){return{target:hC.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const Su=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const Nu=class{constructor(e,t,n){this.target=e,this.pageReference=t,this.contextName=n,this.root=null,this.current=null,this.changeList={},this.hasEncryptedContent=!1,this.targetPageReference=t+e,this.children=[],this.visibility=!0}addChild(e){null===this.current&&this.insertNode({}),this.current.childrenStateMachines.push(e)}insertNode(e){const t=new Su(e);null===this.root&&(this.root=t),null!==this.current&&(t.previous=this.current,this.current.next=t),this.current=t}applyEncryptedContent(e){void 0!==e&&(this.current.instruction.encryptedContent=e)}buildChildSumbitPageInstructions(e,t){let n=[];return e.childrenStateMachines.forEach((e=>{e.visibility&&(n=n.concat(e.buildSubmitPageInstructions(t)))})),n}buildSubmitPageInstructions(e=!1){let t=this.root,n=[];for(;t;)!t.instruction.instruction||e&&t.automatic||n.push(t.instruction),n=[...n,...this.buildChildSumbitPageInstructions(t,e)],t=t.next;return n}initPageInstructions(e,t,n){const r=e.getValue(this.target)||[];if(Array.isArray(r)){if(t)return void r.forEach(((e,r)=>{t.forEach((t=>{const a=Bm(t),s={};let o=!0;n&&(s[Bm(n)]=crypto.randomUUID(),o=!1);const i={[a]:hC.getIn(e,a),...s};this.update(i,r+1,o,{isDefault:!0,skipDirtyValidation:!0})}))}));r.forEach(((e,t)=>{if(n&&!e[Bm(n)]){const e={};e[Bm(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{isDefault:!0,skipDirtyValidation:!0})}}))}t&&r&&"object"==typeof r&&!Array.isArray(r)&&Object.keys(r).length>0&&this.processObjectRows(r,t,n)}processObjectRows(e,t,n){Object.keys(e).forEach((r=>{const a=e[r];t.forEach((e=>{const t=Bm(e),s={};let o=!0;n&&(s[Bm(n)]=crypto.randomUUID(),o=!1);const i={[`${t}`]:hC.getIn(a,t),...s};this.update(i,r,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,r){const{isDefault:a=!1,skipPageinstruction:s,skipDirtyValidation:o=!1,encryptedContent:i}=r,c=mu.execute(this.contextName,this.target,t,e,this.pageReference,n,o,a);if(!s){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]=iC(hC.deepClone(n),e,r)}if(this.current?.automatic===a&&(this.current?.instruction?.groupIndex===t||this.current?.instruction?.listIndex===t)&&"UPDATE"===this.current?.instruction.instruction){const t=this.current.instruction.content;return this.current.instruction.content=iC(hC.deepClone(t),hC.unflatten(e),r),void this.applyEncryptedContent(i)}this.insertNode(c),this.applyEncryptedContent(i),a&&(this.current.automatic=!0)}}delete(e,t){const n=yu.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||QA(tS({instruction:"DELETE",listIndex:"string"==typeof e?e:e-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}insert(e,t,n,r){const{instruction:a,actionPayload:s={content:{}},displayPropertPayload:o={}}=fu.execute(this.target,t,e,this.pageReference),{isDefault:i=!1,encryptedContent:c,skipDirtyValidation:l=!1}=r;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]=iC(hC.deepClone(n),e,r)}this.root&&!this.root.instruction?.instruction&&this.current&&!this.current.instruction?.instruction?this.root.instruction=a:this.insertNode(a),this.applyEncryptedContent(c),n||(s.content={...s.content,...o},QA(tS({...s,["string"==typeof t?"groupIndex":"listIndex"]:"string"==typeof t?t:t-1,c11nEnv:r.c11nEnv,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,skipDirtyValidation:l}))),i&&(this.current.automatic=!0)}replacePage(e,t,n,r,a){const s=r??this.pageReference,o=n??this.target,{instruction:i,actionPayload:c}=Au.execute(o,e,s);this.insertNode(i),this.applyEncryptedContent(a),t||QA(tS({...c,context:this.contextName,referenceList:`${s}${hC.convertClipboardPageToPageRefNotation(o)}`}))}deletePage(e){const t=Cu.execute(this.target,this.pageReference);this.insertNode(t),e||QA(tS({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 r=Eu.execute(this.target,e,t,this.pageReference);this.insertNode(r),QA(tS({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=Iu.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),Iu.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=iC(hC.deepClone(t),e)}},_u={},bu={},Tu={},Pu=(e,t,n)=>{_u[e]||(_u[e]={}),_u[e][t]||(_u[e][t]={content:[]}),bu[e]||(bu[e]=[],Tu[e]=[]),km.isStateMachineExist(e,n,t)||km.setStateMachine(e,t,n,new Nu(t,n,e))},Ou=e=>gu.formatPageReference(e),Du=(e,t)=>{const n=bu[e],r=Tu[e],a=Bm(t),s=a?.substring(0,a.indexOf("["));r?.indexOf(s)<0&&Tu[e].push(s),n?.indexOf(a)<0&&bu[e].push(a)},vu=e=>{delete bu[e]},Ru=e=>km.buildPageInstructionsByContext(e),$u=e=>{km.clearStateMachines(e),delete _u[e]},xu=(e,t,n,r)=>{let[,a]=t.split(`${e}[${r}]`);""!==a&&void 0!==a&&(a=a.startsWith(".")?a.substring(1):a,Object.keys(n).forEach((e=>{n[`${a}.${e}`]=n[e],delete n[e]})))},wu=(e,t,n,r,a)=>{const{skipStateUpdate:s=!1,insertIfEmpty:o=!1,skipDirtyValidation:i=!1}=a||{},c=n.getContextName(),l=n.getReferenceList(),d=r||n.getPageReference(),u=Ou(l);Pu(c,u,d),Du(c,`${l}[${t}]`),xu(l,d,e,t);const p={instruction:Fr.LIST_ACTIONS.INSERT,content:{...hC.unflatten(e)}};delete JSON.parse(JSON.stringify(p)).content.classID;const h=km.getStateMachine(c,d,u);o&&h?.root||h.insert(e,t+1,s,{c11nEnv:n,skipDirtyValidation:i})},Mu=(e,t,n=0,r={})=>{const{skipStateUpdate:a=!0,pageRef:s}=r,o=t.getContextName();let i=t.getReferenceList();const c=s||t.getPageReference();i||(i=((e,t)=>{const n=e.indexOf(Ur.CONTENT)+Ur.CONTENT.length,r=e.lastIndexOf(`[${t}]`);return e.substring(n,r)})(c,n));const l=Ou(i);Pu(o,l,c),Du(o,`${i}[${n}]`),xu(i,c,e,n);km.getStateMachine(o,c,l).update(e,n+1,a,r)},Lu=(e,t)=>{const[,n]=e.split("."),r=t?.split(".").pop();return n===r},Uu=e=>{const t=hC.getPropertyName(e),n=t.indexOf(".");return n>=0?t.slice(n+1):t},Fu=(e,t,n)=>{const r={};return Object.values(e).forEach((e=>{if(Lu(e,n)){const n=Uu(e).split(".");if(n.length>1){let e=hC.getIn(t,n)??"";if(!e){const r=`!P!${n.join(":")}`;e=hC.getIn(t,r)??""}hC.setIn(r,n,e)}else{const e=hC.getIn(t,n)??"";r[n[n.length-1]]=e}}})),r},ju=(e,t,n,r,a)=>{const s=e.getValue(t)||{};n&&Object.keys(s).length>0&&e.clearErrorMessages({property:r?a:e.getStateProps().value})},ku=(e,t,n)=>new Promise((r=>{const{skipPageInstructions:a=!1}=n,{selectionMode:s,selectionList:o,required:i}=t.getConfigProps(),c=s===Fr.LIST_SELECTION_MODE.MULTI,l=t.getContextName();let d=t.getPageReference(),u=((e,t,n)=>e?n.substring(1):t.substring(t.lastIndexOf(".")+1))(c,d,o);const p=t.getRawMetadata();let h=null;const g=(e=>e?.config?.dataRelationshipContext&&"SimpleTableSelect"===e.type&&"single"===e.config?.selectionMode)(p);g&&(u=p?.config?.dataRelationshipContext,h=d.concat(".").concat(u),d=h);const f=((e,t,n)=>e?`${t}${n}`:t)(c,d,o),m=((e,t,n,r)=>t?e.getFieldMetadata(`${n}`):e.getCurrentPageFieldMetadata(r))(t,c,u,h),{datasource:{parameters:y={}}}=m,I={...y};if(((e,t,n)=>{t?.descriptors?.length&&!n&&t.descriptors.forEach((t=>{e[Uu(t)]=t}))})(I,m,c),c){let n=o;n=Ou(n);const r=t.getValue(f)||[];Pu(t.getContextName(),n,d);const s=[];let i=r.length;e.forEach((e=>{const t=Fu(y,e,u),o={};if(Object.hasOwn(e,"displayProperty")){const t=e.displayProperty;o[t]=e[t]}const c=Object.entries(t);let p=r.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 r=km.getStateMachine(l,d,n);e.$selected?r.insert(t,p+1,!0,{}):r.delete(p+1,!0)}s.push({instruction:e.$selected?Fr.LIST_ACTIONS.SELECT:Fr.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...o}})})),QA(tS({instruction:Fr.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${d}.${u}`,actions:s}))}else{const n=Fu(I,e[0],u),r=p?.config?.compositeKeys||[];if(t.getRawConfigProps().onlyAllowRefreshOnCompositeKeys&&r.length){const a=r?.reduce(((e,t)=>(e[Uu(t)]=t,e)),{})||{},s=Fu(a,e[0],u);Object.keys(s).forEach((e=>{delete n[e],t.getActionsApi().updateFieldValue(`.${e}`,s[e],g?{contextPageReference:d}:{}),t.getActionsApi().triggerFieldChange(`.${u}.${e}`,s[e])}));const o=(e=>e.length>1&&e.pop()||"")(d.split(/\[\d+\]/gm));t.getActionsApi().updateFieldValue(o,n,g?{contextPageReference:d}:{}),t.getActionsApi().triggerFieldChange(o,n)}else Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],g?{contextPageReference:d}:{}),t.getActionsApi().triggerFieldChange(`.${u}.${e}`,n[e])}))}ju(t,f,i,c,u),r()})),Vu=e=>{if(!e)return!1;const t=(n=e,km.buildPageInstructionsByContext(n,!0));var n;return Array.isArray(t)&&t.length>0};const Bu=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,a=e.getPageReference(),s=Ou(t);Pu(e.getContextName(),t,a);km.getStateMachine(e.getContextName(),a,s).deleteAll(r);const o=km.getUnConnectedStateMachines(e.getContextName())||{};Object.keys(o).forEach((e=>{e.includes(`${a}${s}`)&&e!==`${a}${s}`&&(o[e]=null)}))},Gu=e=>({insert:(t,n,r,a)=>wu(t,n,e,r,a),update:(t,n,r)=>Mu(t,e,n,r),updateProperty:(t,n,r)=>((e,t,n,r={})=>{const a=n.getPageReference(),{stateMachineTarget:s}=km.getStateMachineObjByPath(`${a}${e}`,n.getContextName(),`${a}${e}`.endsWith("]"));if(!s){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&&Pu(n.getContextName(),t,e)}km.executeStateMachine(n.getContextName(),`${a}${e}`,t,!0,r)})(t,n,e,r),deleteEntry:(t,n,r)=>((e,t,n,r)=>{const{skipStateUpdate:a=!1}=r||{},s=t.getContextName(),o=t.getReferenceList(),i=n||t.getPageReference(),c=`${i+o}[${e}]`,l=Ou(o);Nd({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:c,context:s,isListEntry:!0,deletingIndex:e}),Pu(s,l,i),Du(s,`${o}[${e}]`);const d=km.getStateMachine(s,i,l);"string"==typeof e?d.delete(e,a):d.delete(e+1,a);const u=km.getUnConnectedStateMachines(s)||{};Object.keys(u).forEach((e=>{e.includes(`${i}${l}`)&&e!==`${i}${l}`&&(u[e]=null)}))})(t,e,n,r),reorder:(t,n)=>((e,t,n)=>{const r=n.getContextName(),a=n.getReferenceList(),s=n.getPageReference(),o=Ou(a);Pu(r,o,s),md.deleteAllListNodes(r,`${s}${o}`,!1),Du(r,`${a}[${t}]`),km.getStateMachine(r,s,o).move(e+1,t+1);const i=km.getUnConnectedStateMachines(r)||{};Object.keys(i)?.forEach((e=>{e.includes(`${s}${o}`)&&e!==`${s}${o}`&&delete i[e]}))})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>ku(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:r}=t.getConfigProps(),a=[];let s=t.getPageReference();const o=n===Fr.LIST_SELECTION_MODE.MULTI;let i=o?r.substring(1):s.substring(s.lastIndexOf(".")+1);const c=t.getRawMetadata();let l=null;c?.config?.dataRelationshipContext&&"SimpleTableSelect"===c.type&&"single"===c.config?.selectionMode&&(i=c.config.dataRelationshipContext,l=s.concat(".").concat(i),s=l);const d=o?`${s}${r}`:s;let u=t.getValue(d)||[];if(Array.isArray(u)||(u=[u]),e)return Promise.resolve(u);const{datasource:{parameters:p={}}={}}=o?t.getFieldMetadata(`${i}`):t.getCurrentPageFieldMetadata(l);return u.forEach((e=>{const t=Object.values(p).reduce(((t,n)=>{const r=n.substring(n.lastIndexOf(".")+1);return Lu(n,i)&&e[r]?`${t}${e[r]}`:t}),"");t.trim()&&a.push(t.trim())})),Promise.resolve(a)})(t,e),clearSelectedRows:()=>function(e){const{selectionList:t,required:n}=e.getConfigProps(),r=e.getContextName(),a=e.getPageReference(),s=t,o=`${a}${t}`;return new Promise((t=>{let i=s;i=Ou(i),Pu(r,i,a),km.getStateMachine(r,a,i).deleteAll(),ju(e,o,n,!0,s),t()}))}(e),setVisibility:t=>((e,t=!0)=>{const n=e.getContextName(),{selectionMode:r,selectionList:a,renderMode:s,referenceList:o}=e.getComponentConfig();let i;if(r===Fr.LIST_SELECTION_MODE.MULTI&&a?i=a:"Editable"===s&&o&&(i=e.getStateProps().referenceList),i){i=Ou(i);const r=km.getStateMachine(n,"",`${e.getPageReference()}${i}`);r&&(r.visibility=t)}})(e,t),initDefaultPageInstructions:(t,n,r)=>((e,t,n,r)=>{const a=e.getContextName(),s=e.getPageReference(),o=Ou(t);Pu(a,o,s),km.getStateMachine(a,s,o).initPageInstructions(e,n,r)})(e,t,n,r),deleteAll:(t,n)=>Bu(e,t,n),replacePage:(t,n,r)=>((e,t,n,r)=>{const{skipStateUpdate:a=!1}=r||{},s=e.getPageReference(),o=e.getContextName();Pu(o,t,s),Du(o,hC.buildInstructionPageReference(s,t)),km.getStateMachine(o,s,t).replacePage(n,a)})(e,t,n,r),deletePage:(t,n)=>((e,t,n)=>{const{skipStateUpdate:r=!1}=n||{},a=e.getPageReference(),s=e.getContextName();Pu(s,t,a),Du(s,hC.buildInstructionPageReference(a,t)),km.getStateMachine(s,a,t).deletePage(r)})(e,t,n)});const Wu=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?hC.mergeDeep(e,this.fieldDefaults):hC.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]}},Hu="downloadAttachment",qu={};function zu(e,t){const n=Mr.getDefaultQualifiedName(t);return n!==t&&n in e?e[n]:e[t]}const Yu=e=>{const t=iu();return qu[e]=t,t};function Ku(e){const t=new URL(e,window.location.origin),n=LE.environmentInfoObject?.encCSRFToken;return n&&t.searchParams.set("pzencv1zzz",n),t.searchParams.set("mode","stream"),t.toString()}async function Qu(e){const t=function(){if("undefined"!=typeof window&&"showSaveFilePicker"in window)return window.showSaveFilePicker}();if(!t)return null;try{const n=await t({suggestedName:e}),r=await n.createWritable();return{fh:n,writable:r}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return null;throw e}}async function Ju(e,t,n){const r=await Qu(t);if(r)try{const t=await async function(e,t){let n;await au(e,{method:"GET",adapter:async e=>(n=e,{data:null,status:204,statusText:"No Content",headers:{},config:e}),withoutDefaultHeaders:!1},t,{includeRemoteSystemIdIfPresent:!0});const r={};return Object.entries(n?.headers??{}).forEach((([e,t])=>{"string"==typeof t&&(r[e]=t)})),r}(e,n),a=await fetch(e,{method:"GET",headers:t});if(!a.ok)throw new Error(`Download failed: ${a.status}`);if(!a.body)throw new Error("Download response has no body");await a.body.pipeTo(r.writable)}catch(e){throw await r.writable.abort().catch((()=>{})),e}}const Xu=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("/"),r=e=>e.some((e=>n.includes(e)));r(["excel","spreadsheet"])?t="document-xls":r(["zip","compressed","gzip","rar","tar"])&&(t="document-compress")}return t},Zu=e=>{const t=zu(e,"pyCategoryLabel"),n=zu(e,"pyCategoryName"),r=zu(e,"Category"),a=zu(e,"pxCreateOpName"),s=zu(e,"pxCreateOperator"),o=e.CreateUser,i=zu(e,"pyFileName"),c=zu(e,"FileName"),l=zu(e,"FileExtension"),d=zu(e,"pyAttachName"),u=zu(e,"pyMimeFileExtension"),p=zu(e,"MimeType"),h=zu(e,"pzInsKey"),g=zu(e,"ID"),f=zu(e,"pyAttachmentLink"),m=zu(e,"AttachmentURL"),y=zu(e,"pxAttachmentCreateTime"),I=zu(e,"pxCreateDateTime"),E=zu(e,"CreateDateTime"),A=zu(e,"pxStorageType"),C=zu(e,"pyFileSize"),S=zu(e,"error"),N=zu(e,"thumbnail"),_=zu(e,"pyIsLargeAttachment"),b=zu(e,"IsLargeAttachment");let T,P,O,D;return T=t?`${t},`:n?`${n},`:r,P=a||(s||o?.Name||""),O=i||(l&&""!==l&&c?.endsWith(l)?c.substring(0,c.lastIndexOf(l)-1):c),D=d&&i?d.startsWith(i)&&d.split(".").length-1===i.split(".").length?d.split(".").pop():"":l??"",{props:{meta:`${T} ${P}`,name:d??c??"",icon:Xu(u??p??""),error:S??null,thumbnail:N??null},responseProps:{fileName:d??c??"",name:O??"",category:n??r??"",extension:D,ID:h??g??"",mimeType:u??p??"",attachmentURL:f??m??"",createUser:P??"",createDateTime:y??I??E??"",responseType:e.responseType??(g?"binary":null),localAttachment:!!e.localAttachment,storageType:A??void 0,fileSize:C??void 0,isLargeAttachment:void 0!==_?"true"===_:b}}},ep=e=>{let t=[],n=!1;if(e&&Object.hasOwn(e,Mr.getDefaultQualifiedName("pyCount"))){n=!0;const r=zu(e,"pxResults");t=Array.isArray(r)?r.filter((e=>!!zu(e,"pzInsKey"))).map((e=>Zu(e))):[]}else if(e&&"object"==typeof e){let n;n=Array.isArray(e)?e:[e],t=n?.filter((e=>zu(e,"ID")&&zu(e,"FileName")||zu(e,"pzInsKey"))).map(Zu)}else t=[];const r=e?zu(e,"pyCategoryName"):void 0;return{hasUploadedFiles:t.length>0,categoryName:("string"==typeof r?r:"")||t?.[0]?.responseProps?.category||"",attachments:t,isOldAttachment:n}},tp={uploadAttachment:(e,t,n,r,a,s)=>{const o=new FormData;o.append("appendUniqueIdToFileName","true"),o.append("file",e),a&&o.append("contextID",a),s&&o.append("category",s);const{restApi:i,reqType:c}=mS("uploadAttachment",{}),l={"Content-Type":"multipart/form-data"};return Boolean(LE?.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories)&&(l["x-pega-stream-support"]="repository-stream"),au(i,{method:c,headers:l,body:o,onUploadProgress:t,signal:Yu(e.ID).token},r).then((t=>({type:"File",category:e.category||"File",ID:t.data.ID,clientFileID:e.ID,filename:e.name}))).catch(n?n(cu,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete qu[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const a={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,n&&(a.signal=Yu(n).token)}const{restApi:s,reqType:o}=mS("linkCaseAttachment",{caseID:e});return au(s,{...a,body:{attachments:t},method:o},r)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:r,reqType:a}=mS("getCaseAttachments",{caseID:e,includeThumbnail:n});return au(r,{method:a},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:r,reqType:a}=mS("getAttachmentCategories",{caseID:e,type:t});return au(r,{method:a},n).then((e=>e.data))},downloadAttachment:(e,t,n,r,a)=>{e=e.replace(/\//g,"_");const{restApi:s,reqType:o}=mS(Hu,{attachmentID:e}),i=a&&s?(()=>{const e=new URL(s,window.location.origin);return e.searchParams.set("encoding",a),e.toString()})():s;return function(e){const t=LE.environmentInfoObject;return!(!t?.pyFeatures?.pyEnableStreamingForRepositories||"repository"!==e?.toLowerCase()||"EMBED"===t?.renderingMode&&!LE.isPegaMobile())}(r)&&s?async function(e){return await Gd(hu()),{data:Ku(e)}}(s):au(i,{method:o,..."binary"===n&&!a&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:a}=mS("editAttachment",{attachmentID:e});return au(r,{method:a,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=mS("deleteAttachment",{attachmentID:e});return au(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=mS("downloadDocument",{documentID:e});return au(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:a}=mS("deleteDocument",{caseID:e,documentID:t});return au(r,{method:a},n)},getDocumentURL:e=>{const t=PCore.getEnvironmentInfo().getDocumentUrlDP()||Mr.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=>{qu[e]&&(qu[e].cancel(),delete qu[e])},buildFilePropsFromResponse:Zu,getAttachmentURL:e=>{const{restApi:t}=mS(Hu,{attachmentID:e});return t},prepareAttachmentData:ep,validateAttachments:(e,t)=>{let n=e;if((e=>null!==e&&"object"==typeof e&&"hasUploadedFiles"in e&&"boolean"==typeof e.hasUploadedFiles)(t)){const{attachments:e}=t;0===e.length&&(n="")}else{const{attachments:e}=ep(t);0===e.length&&(n="")}return n},streamDownloadAttachment:async(e,t,n)=>{if(!LE.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories)return;e=e.replace(/\//g,"_");const{restApi:r}=mS(Hu,{attachmentID:e});r&&(await Gd(hu()),await Ju(Ku(r),t,n))}};let np=!1;const rp=e=>{np=e},ap=new Map,sp=(e,t)=>{ap.set(e,t)},op=e=>{ap.delete(e)};class ip{constructor(){this.validators={}}static messageDispatcher(e,t,n,r,a,s){if(r){const o=[];o.push({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,fieldLabel:a,message:r,...s??{}}),_d({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,r,a,s){const{required:o,value:i}=s;let c=null;if(!("true"!==o&&!0!==o)){let o=r;switch(e){case"radiobuttons":o=i;break;case"attachment":o=tp.validateAttachments(r,i);break;case"checkbox":o&&"false"!==o||(o="");break;default:"string"==typeof o&&(o=o.trim())}c=this.getValidator("required")(o),ip.messageDispatcher(t,n,a,c,gu.getFieldLabel(s),{subType:"required"})}return c}validateType(e,t,n,r,a,s){let o=null;const i={pageReference:n,context:a,property:t,...s};let c=Wu.getDefaultsforType(s?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(r,i),(""!==r||Wu.getDefaultsforType(s?.componentName||"")?.showErrorWhenEmpty)&&ip.messageDispatcher(t,n,a,o,s?.label));const l=s?.validationType;return c=l&&Wu.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(r,i),ip.messageDispatcher(t,n,a,o,s?.label)),o}validate(e,t,n,r={}){const{context:a,disabled:s,readOnly:o,pageReference:i,skipRequiredValidation:c}=r;let l=null;return s||o||(c||np||(l=this.validateRequired(e,t,i,n,a,r)),l||(l=this.validateType(e,t,i,n,a,r))),{message:l}}isValidatorExist(e){return!!e.validatetype}}const cp=new ip,lp=e=>{e&&_A(e)},dp=(e,t)=>{e.DeclareExpressions&&t.context&&Io({[t.context]:e.DeclareExpressions})},up=(e,t,n=!1)=>{const r=hC.getIn(e,Fr.RESOURCES);r&&(lp(r),dp(r,t)),n||_S({...e,options:t})};class pp{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:a,viewType:s=um.PAGE,pageName:o,context:i=Fr.APP.APP,debugInfo:c,headers:l,theType:d,retrieveActionViewForNewObject:u=!1}=t;let p={};n&&n.content&&(p=n.content);const{content:h={},pageInstructions:g}=pp.getExternalCaseOrObjectContent(e,u,i);let f={[pp.getKeyBasedOnWorkType(e)]:e,content:{...p,...r,...h}};if(f={...f,...g&&{pageInstructions:g},...!ry.isObjectCaseType(e)&&{processID:a}},"CREATE_EXTERNAL_CASE"===d){const e=JA(i)?.caseInfo?.content;if(e){const t=hC.pruneKeys(e,new Set(["pxObjClass",Mr.getDefaultQualifiedName("pxObjClass"),"EmbedListUUID__",Mr.getDefaultQualifiedName("EmbedListUUID__")]),!1);f.content[Fr.getDefaultQualifiedName("pyAddCaseContextPage")]=t}}const m=pp.getObjectTypeViewPayload(u,e);return fp(ry.getRouteKeyForCreateWork(e,u),{body:f,queryPayload:{...m,...ry.isExternalCaseType(e)?{casetypeID:e}:{caseClassName:e},viewType:s,params:{pageName:o}},headers:{...l,...c&&{...Yd.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:f,headers:hm(t.headers,e,l)})))}static getObjectTypeViewPayload=(e,t)=>e?ry.shouldUseUnifiedHandling()?{casetypeID:t,actionID:Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{objectTypeID:t,actionID:Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{};static getExternalCaseOrObjectContent=(e,t,n)=>{const r=ry.isExternalObject(e),a=ry.isExternalCaseType(e);if((a||r)&&!t){const e=gm(n,{isExternalObject:Boolean(!a&&r)}),{content:t,pageInstructions:s}=e.content;return{content:t,pageInstructions:s}}return{}};static getKeyBasedOnWorkType=e=>ry.shouldUseUnifiedHandling()?"caseTypeID":ry.isObjectCaseType(e)?"objectTypeID":"caseTypeID"}const hp=pp,gp=()=>({registerHeader:(...e)=>Yd.registerHeader(...e),unRegisterHeader:(...e)=>Yd.unRegisterHeader(...e),getRegisteredHeaders:()=>Yd.getRegisteredHeaders()}),fp=(e,{body:t={},queryPayload:n={},cancelTokenSource:r,headers:a={},responseType:s},o,i)=>{const{restApi:c,reqType:l}=mS(e,n),d={method:l,headers:a,body:t,...s&&{responseType:s}};r&&(d.signal=r.token);const u="createWork"===e?ry.appendExcludeQueryParamToUrl(c):c;return au(u,d,o,i??{})},mp=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:a=!1},s)=>{e.startsWith("http:")||e.startsWith("https:")||(e=an()+e);return au(e,{method:t,headers:r,body:n,withoutDefaultHeaders:a},s)},yp=e=>wE.doesRestApiExist(e),Ip=()=>iu(),Ep=e=>cu(e),Ap=e=>{Zd=e},Cp=()=>hp,Sp=new Set;function Np(e){try{const t=new URL(e);"https:"!==t.protocol&&"http:"!==t.protocol||Sp.add(t.origin)}catch{}}function _p(e){let t,n;try{t=new URL(e,window.location.href).origin}catch{throw new Error("Blocked: malformed URL")}try{n=window.location.origin??new URL(window.location.href).origin}catch{n=""}if(t!==n&&!Sp.has(t))throw new Error(`Blocked: untrusted script origin "${t}"`)}const bp="getCustomComponent",Tp="text/javascript";function Pp(e){return"localhost"===e||"127.0.0.1"===e}function Op(e){let t;try{t=new URL(e).hostname}catch{throw new Error("Component fetch blocked: malformed dev server URL")}if(Pp(t)){if(!function(){try{return Pp(new URL(window.location.href).hostname)}catch{return!1}}())throw new Error("Component fetch blocked: localhost dev server is only allowed from loopback pages")}else _p(e)}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="",r=0;return e.forEach((e=>{n+=`${0===r?"?":"&"}field${r}=${e.field}&value${r}=${e.value}`,r+=1})),this.pegaOnlyUrl?this.getSvcComponentsConfigSeparatedUrls(e,n,t):this.getSvcComponentsConfigCombinedUrl(e,n,t)}async getSvcComponentsConfigSeparatedUrls(e,t,n){const r=LE.getBuiltOnAppNames(),a=this.loadAndFilterPegaComponentsConfig(e,r);let s=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(s=this.loadAndCustomerComponentsConfig(t,e));const o=[],i=LE.environmentInfoObject?.pyInfinityStaticService;if(i){const e=[],t=await Promise.all([a,s]),[n,r]=t,i=[];for(const t of r)!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,s,e]).then((e=>{const t=this.mergeComponentList(e);o.push(...t)}))}if(n.alternateDesignSystemURL&&1===o.length){const r=await this.getSvcComponentsConfigADS(e,t,n);o[0].alternateDesignSystemConfig=r}return{data:{components:o}}}mergeComponentList=e=>{const[t=[],n=[],r=[]]=e,a=[...t,...n];return this.appStaticUrl?a.map((e=>{const{name:t,type:n,subtype:a}=e,s=r.reduce(((e,r)=>(t===r.name&&n===r.type&&a===r.subtype&&(e=r),e)),{});return Object.keys(s).length>0?{...e,alternateDesignSystemConfig:{...s}}: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((r=>{let a=!0;e.forEach((e=>{Array.isArray(r[e.field])?r[e.field].includes(e.value)||(a=!1):r[e.field]!==e.value&&(a=!1)})),a&&this.checkForBuiltOnSupport(t,r.allowedApplications)&&n.push(r)})),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 r=LE.environmentInfoObject?.pyInfinityStaticService;if(r){const e={};t.forEach(((t,n)=>{e[`field${n}`]=t.field,e[`value${n}`]=t.value})),n=PCore.getDataPageUtils().getDataAsync(Mr.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 r=`${this.staticServerURL}v102/${this.appAlias}/componentslist${t}`,a=await fetch(r,{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 r=await this.getSvcComponentsConfigADS(e,t,n);a.data.components[0].alternateDesignSystemConfig=r}return a}getSvcComponentsConfigADS(e,t,n){const r=`${n.alternateDesignSystemURL}${n.alternateDesignSystemURL?.endsWith("/")?"":"/"}components/${e[0].value}/config-ext.json`;return fetch(r,{method:"GET"}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})).catch((e=>({error:e.message})))}getSvcImage(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).catch()}getSvcImageUrl(e){try{const t=LE.environmentInfoObject?.pyInfinityStaticService,{callUrlKey:n,queryPayload:r,callUrl:a}=this.buildImageRequest(e,t);return this.imageBlobUrlCache[a]||(this.imageBlobUrlCache[a]=this.fetchImage(n,r,a,t)),this.imageBlobUrlCache[a]}catch(e){return Promise.resolve(null)}}buildImageRequest(e,t){let n,r="getBinaryFile",a=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;if(t){const t=/DATA-CONTENT-IMAGE\s([^!]*)!.*\/OPERATORIMAGES\//i,s=e.match(t);if(s){const e=s[1]?.trim();if(!e)throw console.warn("AssetLoader.buildImageRequest: operator image key is missing user id"),new Error("AssetLoader.buildImageRequest: operator image key is missing user id");r="getOperatorImage",n={user_ID:e.toLowerCase()}}else n={fileID:e};a=mS(r,n)?.restApi||a}return{callUrlKey:r,queryPayload:n,callUrl:a}}fetchImage(e,t,n,r){return r?fp(e,{queryPayload:t}).then((e=>{const n=this.decodeBase64ToByteArray(e.data),r=this.getMimeTypeFromKey(t?.fileID||t?.user_ID||""),a=new Blob([n],{type:r});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,r=new Uint8Array(n);for(let e=0;e<n;e+=1)r[e]=t.charCodeAt(e);return r}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=LE.environmentInfoObject?.pyInfinityStaticService;if(t){const t=LE.environmentInfoObject?.pxApplication?.pxUpdateDateTime,n=t?hC.parsePegaDateTimeToTimestamp(t):null,r=`${e}${n?`?v=${n}`:""}`;return(await fp(bp,{queryPayload:{componentName:r}})).data}const n=LE.environmentInfoObject?.pyC11nDXCBDevURL;n&&Op(n);const r=n?`${n}/index.js`:`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`,a=await fetch(r,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=LE.environmentInfoObject?.pyInfinityStaticService,r=LE.environmentInfoObject?.pyC11nDXCBDevURL;let a=`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`;if(r){const e=r.replace(/\/+$/,"");Op(e),a=`${e}/index.js`}if(n&&!r){const n=LE.environmentInfoObject?.pxApplication?.pxUpdateDateTime,r=hC.parsePegaDateTimeToTimestamp(n),a=hC.parsePegaDateTimeToTimestamp(t),s=[];r&&s.push(`v=${r}`),a&&s.push(`libV=${a}`);const o=s.length?`${e}?${s.join("&")}`:e,i=await fp(bp,{queryPayload:{componentName:o}});return void this.appendCustomScriptToHead(i.data)}if(n||r){if("undefined"==typeof document)return;const e=document.createElement("script");return e.src=a,e.type="text/javascript",e.onerror=()=>console.error("Error while appending custom component map"),void document.head.appendChild(e)}const s=await fetch(a,{headers:{Authorization:`Bearer ${this.b2sJWT}`}});s.ok||console.error("Error while fetching custom component map");const o=await s.text();this.setCCV2LibId(e),this.appendCustomScriptToHead(o)}catch(e){console.error("Exception while appending custom component map (or load blocked):",e)}}async appendCustomScriptToHead(e){if("undefined"!=typeof document)try{const t=document.createElement("script");t.src=window.URL.createObjectURL(new Blob([e],{type:Tp})),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((r=>{if("undefined"==typeof document)return void n(e);const a=document.createElement("script");a.src=window.URL.createObjectURL(new Blob([r],{type:Tp})),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,Sp.clear(),e&&t&&"no-appstatic"!==t&&"no-cdn"!==t?(this.appStaticUrl=t.endsWith("/")?t:`${t}/`,this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.pegaOnlyUrl=!0,Np(this.staticServerURL),Np(this.appStaticUrl)):e&&t&&"no-appstatic"===t?(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,this.pegaOnlyUrl=!0,Np(this.staticServerURL)):e&&t&&"no-cdn"===t&&(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,Np(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,r)=>{if("undefined"==typeof document)return void r(e);const a=document.createElement(t);if("script"===t){const t=a;t.onload=()=>{n(e)},t.onerror=()=>{r(e)},t.type=Tp,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 r=[];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")?r.push(this.getLoader()(a+t,this.getTypes.SCRIPT)):t.includes(".css")&&this.getLoader()(a+t,this.getTypes.STYLE),this.loadedAssets[t]=!0)})),Promise.all(r)}getAssetsFromIsolations(e){const t=this.b2sJWT?.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")||"",r=decodeURIComponent(n.g.atob(t).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")),a=JSON.parse(r),s=a?.tenant_id,{restApi:o,reqType:i}=fS("getAssetsFromIsolations",{isolationID:s,assetPath:e})||{},c=`${this.appStaticUrl}${o}`;return fetch(c,{method:i,credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob()))}},vp="component-loader",Rp={},$p=async(e,t)=>{if(!e?.length||!1===window.PCore?.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();const n=Dp.getLoader(),r=t||Dp.staticServerURL;if(Dp.getLoader(vp))return Dp.getLoader(vp)(e,r);const a=new Set(Object.keys(Rp)),s=e.flatMap((e=>{if(a.has(e))return[];const t=Co.getComponent(e);if(!t){const t=`${Dp.getConstellationServiceUrl()}/v860/${Dp.getAppAlias()}/component/${e}.js`;return a.add(e),[n(t,Dp.getTypes.SCRIPT)]}const s=(t.scripts||[]).map((e=>n(e.startsWith("http")?e:`${r}${e}`,Dp.getTypes.SCRIPT))),o=(t.styles||[]).map((e=>n(`${r}${e}`,Dp.getTypes.STYLE)));return a.add(e),[...s,...o]}));return Promise.all(s.map((e=>e.catch((e=>console.error("Error loading asset:",e))))))},xp="component-state-lru-index";function wp(e){return"object"==typeof e&&null!==e&&"key"in e&&"accessedAt"in e&&"string"==typeof e.key&&"number"==typeof e.accessedAt}function Mp(){try{const e=sessionStorage.getItem(xp);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(wp):[]}catch{return[]}}function Lp(e){try{sessionStorage.setItem(xp,JSON.stringify(e))}catch{}}function Up(e){const t=Mp().filter((t=>t.key!==e));t.unshift({key:e,accessedAt:Date.now()}),Lp(t)}const Fp=()=>"undefined"!=typeof sessionStorage?sessionStorage:null;const jp=new class{#s;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#s=!1}getNormalizedKey(e){return e?.toString().trim().replace(/\s/g,"-").toLowerCase()}setComponentState=(e,t,n)=>{Fp()?n?.managed&&"FULL_PORTAL"!==LE.getRenderingMode()||(Fp()?.setItem(this.getNormalizedKey(e),JSON.stringify(t)),n?.managed&&(Up(this.getNormalizedKey(e)),function(e){const t=Mp();if(t.length<=100)return[];const n=[],r=t.slice(0,100),a=t.slice(100);for(const t of a){try{e(t.key)}catch{}n.push(t.key)}Lp(r)}((e=>{Fp()?.removeItem(e)})))):console.error("Session Storage not found")};getComponentState=(e,t)=>{if(t?.managed&&"FULL_PORTAL"!==LE.getRenderingMode())return;const n=Fp()?.getItem(this.getNormalizedKey(e))??null,r=n?hC.isValidJson(n):void 0;return t?.managed&&null!=(r??n)&&Up(this.getNormalizedKey(e)),r||n};removeComponentState=(e,t)=>{t?.managed&&"FULL_PORTAL"!==LE.getRenderingMode()||(Fp()?.removeItem(this.getNormalizedKey(e)),t?.managed&&function(e){const t=Mp(),n=t.filter((t=>t.key!==e));n.length!==t.length&&Lp(n)}(this.getNormalizedKey(e)))};fetchUserSettings=async()=>{if(yp("getUserSettings")){const{restApi:e,reqType:t}=mS("getUserSettings");au(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=()=>{LE.getUserSettings()?this.userSettings=LE.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 hC.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(!yp("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=mS("updateUserSettings");const{restApi:r,reqType:a}=n;return au(r,{method:a,body:hC.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 r=n.clearOnCancelForContext;if(r&&(Object.hasOwn(this.contextMapToClearOnCancel,r)?this.contextMapToClearOnCancel[r].add(this.getNormalizedKey(e)):this.contextMapToClearOnCancel[r]=new Set([this.getNormalizedKey(e)])),this.componentCache[this.getNormalizedKey(e)]=t,!this.#s){this.#s=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};$d.subscribe(Fr.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(!LE.shouldUseURLParams())return;const r=new URL(globalThis.location.href);if(t=n?btoa(t):t,r.searchParams.get(e)===t)return;r.searchParams.set(e,t);globalThis.history.pushState({type:"ui-navigation"},"",r)}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 kp=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=>{xd.isOnline()&&t&&void 0!==this.contextArray[e]&&this.contextArray[e]>0&&QA({type:oa,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]&&QA({type:ia,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 Vp=new class{constructor(){this.counterActionMgrId=0,this.actionMgrActions={}}getNextActionMgrId(){return this.counterActionMgrId+=1,this.counterActionMgrId.toString()}register(e,t,n,r,a="unknown",s,o=!0){if(void 0!==this.actionMgrActions[e])return null;const i={actionType:a,promise:t,resolve:n,reject:r,actionPayload:s};return this.actionMgrActions[e]=i,o&&kp.enableLoadingIndicator(i.actionPayload),e}actionManagerPromise=(e,t="")=>{let n,r;""===t&&(t=this.getNextActionMgrId());const a=new Promise(((e,t)=>{n=e,r=t}));if(!n||!r)throw new Error("resolveFn or rejectFn is not defined.");return this.register(t,a,n,r,e),{actionMgrID:t,promise:a}};resolveActionByID(e,t,n=!0){const r=this.actionMgrActions[e];let a=e;return r?(setTimeout((()=>{r.resolve(t)}),0),kp.disableLoadingIndicator(r.actionPayload,n)):a=null,a}rejectActionByID(e,t=!0,n){const r=this.actionMgrActions[e];let a=e;return r?(r.reject(n),kp.disableLoadingIndicator(r.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=Vr.isTraditionalRemoteCase(t.className),e.remoteClassName=t.remoteClassName,e.action=t.action,e.viewName=jr,e.gadgetId=t.gadgetId??ry.getUniqueGadgetId(),e.name=t.name,e.isRemoteCase=!0,e.skipSemanticUrl=!0,na}};class Bp{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 Gp=Bp,Wp=(e,t,n,r)=>wE.getResolvedSemanticURL(e,t,n,r),Hp={getResolvedSemanticURL:Wp,getActions:()=>({ACTION_OPENWORKBYHANDLE:Ya,ACTION_SHOWDATA:Ha,ACTION_SHOWVIEW:Wa,ACTION_GETOBJECT:Ms,ACTION_SHOWINSIGHT:qa,ACTION_SHOWDASHBOARD:za}),updateSemanticURLAndDocumentTitle:(e,t)=>wE.updateSemanticURLAndDocumentTitle(e,t),getSemanticURLForToaster:(e,t,n=!1,r)=>Wp(n?Ms:Ya,{caseClassName:e},{[n?"objectID":"workID"]:t},r)},qp={CASE_INFO:`${Fr.DATA}.${Fr.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${Fr.DATA}.${Fr.CASE_INFO.CASE_TYPE_ID}`,CASE_INFO_ID:`${Fr.DATA}.${Fr.CASE_INFO.CASE_INFO_ID}`,BUSINESS_ID:`${Fr.DATA}.${Fr.CASE_INFO.BUSINESS_ID}`},zp=e=>hC.getIn(e,Fr.getProperty(qp.CASE_CLASS_NAME),Fr.EMPTY_STRING),Yp=e=>hC.getIn(e,Fr.getProperty(qp.CASE_INFO_ID),Fr.EMPTY_STRING),Kp=(e,t)=>{const n=Yp(t);hC.setIn(e,"key",n)},Qp=e=>hC.getIn(e,Fr.getProperty(qp.CASE_INFO),{}),Jp=e=>{const t=KA();if(!e)return!1;const n=Wr(e),r=sE(n),a=sE(e);if(!r||!a)return!1;const s=vI(r,n),o=vI(a,e);if(!s||!o)return!1;const{key:i}=s;let{key:c}=o;return c||(c=t?.getState().data?.[e]?.objectInfo?.ID),i&&c&&i===c},Xp=e=>{const t=Yp(e),n=hC.getIn(e,Fr.getProperty(qp.BUSINESS_ID),Fr.EMPTY_STRING),r=t.toLowerCase().includes(n.toLowerCase())?n:t,a=zp(e);return{businessID:n,caseType:a,resolvedURL:Hp.getSemanticURLForToaster(a,r,ry.isObjectCaseType(a))}};const Zp=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 r=Jm(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:a}=cp.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,r);return a?{status:!1,message:a}:{status:!0}}validateEmail(e,t={}){const n=cp.getValidator("email");if(!n)return{status:"success"};const r=n(e,t);return r?{status:"failure",message:r}:{status:"success"}}},eh="OPEN_PROCESS_ACTION",th="OPEN_ASSIGNMENT",nh="DELETE_CASE_IN_CREATE_STAGE",rh="SAVE_AND_CLOSE",ah=e=>({type:rh,payload:e}),sh="DELETE_WORK",oh=e=>({type:sh,payload:e});const ih=class{static getSavableDataPage(e){return UA(e)}static getLookUpDataPage(e){return jA(e)}static getLookUpDataPageInfo(e){return kA(e)}static getDataPageKeys(e){return FA(e)}};const ch=class{static getPropertyName(e){return _o.getPropertyName(e)}static isProperty(e){return _o.isProperty(e)}static getLeafPropertyName(e){return _o.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};class lh{static createContainerPConnect(e,t,n,r=!1){const{accessedOrder:a,items:s}=e;if(a&&s){const e=a[a.length-1];if(s[e]?.view&&Object.keys(s[e].view).length>0){const a=s[e],o=e.substring(0,e.lastIndexOf("_")),{view:i,context:c}=a,{viewName:l,viewContext:d}=this.processRootViewDetails(i,a,t);if(!l)return null;return Rf({meta:i,options:{context:c,pageReference:d||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===bI.WORKAREA||n===bI.MODAL||l===Fr.CREATE_DETAILS_VIEW_NAME,target:o}}).getPConnect}}return null}static processRootViewDetails(e,t,n){const{config:{context:r,name:a}={}}=e,{context:s}=t;let o=a,i=r;const c=ch.isProperty(a),l=ch.isProperty(r);if(l){const e=ch.getPropertyName(r);i=eC(`.${e}`,e.startsWith(".")?n:"",s)}if(i||(i=n),c){const e=ch.getPropertyName(a);o=eC(`.${e}`,i,s)}return c&&l&&""!==o&&(o=a,i=r),{viewName:o,viewContext:i}}static addFlowContainerItem(e){const t=e.getContainerManager(),n=e.getContextName();let r,a;if("review"!==e.getValue("context_data.caseViewMode")){const e=n.substring(0,n.lastIndexOf("_")),t=VI(e),s=vI(e,t);s&&({key:r,flowName:a}=s)}t.addContainerItem({semanticURL:"",key:r,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(Fr.CASE_INFO.GETNEXTWORK);static getActiveCaseActionName=e=>{const t=e.getValue(Fr.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(Fr.CASE_INFO.ACTIVE_ACTION_ID),r=t.find((e=>e.ID===n));return r?.name||""};static getFirstCaseActionName=e=>{const t=e.getValue(Fr.CASE_INFO.CASE_INFO_ACTIONS);return t[0]?.name||""};static hasNotificationMessages=e=>!!e.getValue("caseMessages");static isCaseWideLocalAction=e=>{const t=e.getValue(Fr.CASE_INFO.ACTIVE_ACTION_ID),n=e.getValue(Fr.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(Fr.CASE_INFO.CHILD_ASSIGNMENTS);let n=[];return t&&t.length>0&&t.forEach((({assignments:e=[],Name:t,caseTypeID:r})=>{const a=e.map((e=>({...e,caseName:t,caseTypeID:r})));n=n.concat(a)})),n};static hasAssignments=e=>{const t=e.getValue(Fr.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),n=lh.getChildCaseAssignments(e);return!!(Array.isArray(n)&&n.length>0||Array.isArray(t)&&t.length>0||lh.isCaseWideLocalAction(e))};static showBanner=e=>{const t=e();return lh.hasNotificationMessages(t)||!lh.hasAssignments(t)};static showTodo=e=>"perform"!==e.getValue("context_data.caseViewMode");static isRenderWithToDoWrapper=(e,t)=>{const n=e(),{showWithToDo:r}=t;return r&&(!lh.isCaseWideLocalAction(n)||lh.showTodo(n))};static getToDoAssignments=e=>{const t=e.getValue(Fr.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(Fr.CASE_INFO.ASSIGNMENT_LABEL),r=e.getValue(Fr.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)||[],a=lh.getChildCaseAssignments(e)||[];let s=JSON.parse(JSON.stringify(a));s=s.map((e=>(e.isChild=!0,e)));const o=[...r,...s];let i=JSON.parse(JSON.stringify(o));return t&&!lh.showTodo(e)&&(i=i.map((t=>(t.name=lh.getActiveCaseActionName(e)||t?.name||n,t)))),i}}const dh=lh;const uh=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=Vp.getNextActionMgrId();let n,r;const a=new Promise(((e,t)=>{n=e,r=t}));if(!n||!r)throw new Error("resolveFn or rejectFn is not defined.");return Vp.register(t,a,n,r,e),{actionMgrID:t,promise:a}};initializeContainers(e){const t=Ta,n=this.c11nEnv,r={context:n.getContextName(),name:n.getContainerName(),type:Fr.CONTAINER_TYPE.SINGLE},{actionMgrID:a,promise:s}=this.containerManagerPromise(t),o={...r,...e,actionMgrID:a};return QA(vC(o)),s}addContainerItem(e){const t=Oa,n=this.c11nEnv,r=n.getMetadata(),{children:a}=r||{};let s;Array.isArray(a)&&a.length>0&&([s]=a);const o=n.getContextName(),i=n.getContainerName(),c=Hr(i,o,e?.containerType===Fr.CONTAINER_TYPE.SINGLE),l=js(i,o),d={root:{...s,config:{...s?.config,context:s?.config?.context||n.getPageReference?.()}},containerItemID:c,context:c,target:l,containerName:i};e=JSON.parse(JSON.stringify(e)),[Fr.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:u,promise:p}=this.containerManagerPromise(t),h={...d,...e,actionMgrID:u};return QA($C(h)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=Fa,n={context:WI(e.containerItemID),target:sE(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return QA(FC(s)),a}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=Ua,n={target:sE(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return QA(BC(s)),a}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Da,n={context:WI(e.containerItemID),target:sE(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return QA(WC(s)),a}resetContainers(e){if(!e?.context||!e?.name)return Promise.reject(new Error("resetContainers : context and name are required in containerInfo object"));const t=Pa,n=nE(e),{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return QA(RC(s)),a}addTransientItem(e){const{id:t,data:n,sourceContainerItemId:r}=e,a=this.c11nEnv.getContextName(),s=zr(t,a),o=dE(a);if(s&&o.includes(s))return s;let i=n;if(r){const e=JA(r);if(!e)throw new Error(`addTransientItem: source container item "${r}" not found in store`);i=hC.deepClone(e)}return QA(xC({transientItemID:s,contextName:a,target:sE(a),data:i})),s}updateTransientData(e){const{transientItemID:t,data:n}=e,r=this.c11nEnv.getContextName();if(t){if(!dE(r).includes(t))return;QA(wC({transientItemID:t,data:n}))}}removeTransientItem(e){const t=this.c11nEnv.getContextName(),{target:n=this.c11nEnv.getTarget(),containerItemID:r,transientItemID:a}=e;if(a&&r){if(!dE(t).includes(a))return;QA(qC({target:n,containerItemID:r,transientItemID:a}))}}createContainerPConnect(e,t,n,r=!1){dh.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return XI(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return jI(e,t)}};function ph(e,t){return Wl((function(n,r){var a=null,s=0,o=!1,i=function(){return o&&!a&&r.complete()};n.subscribe(Hl(r,(function(n){null==a||a.unsubscribe();var o=0,c=s++;Vl(e(n,c)).subscribe(a=Hl(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){a=null,i()})))}),(function(){o=!0,i()})))}))}function hh(e,t){return Wl((function(n,r){var a=0;n.subscribe(Hl(r,(function(n){r.next(e.call(t,n,a++))})))}))}function gh(e,t,n){return void 0===n&&(n=1/0),sl(t)?gh((function(n,r){return hh((function(e,a){return t(n,e,r,a)}))(Vl(e(n,r)))}),n):("number"==typeof t&&(n=t),Wl((function(t,r){return function(e,t,n,r,a,s,o,i){var c=[],l=0,d=0,u=!1,p=function(){!u||c.length||l||t.complete()},h=function(e){return l<r?g(e):c.push(e)},g=function(e){s&&t.next(e),l++;var i=!1;Vl(n(e,d++)).subscribe(Hl(t,(function(e){null==a||a(e),s?h(e):t.next(e)}),(function(){i=!0}),void 0,(function(){if(i)try{l--;for(var e=function(){var e=c.shift();o?Gl(t,o,(function(){return g(e)})):g(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(Hl(t,h,(function(){u=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function fh(e){return e&&sl(e.schedule)}function mh(e){return e[e.length-1]}function yh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return fh(mh(e))?e.pop():void 0}(e);return Jl(e,n)}var Ih=qc((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Eh=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 Kc(t,e),t.prototype.lift=function(e){var t=new Ah(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ih},t.prototype.next=function(e){var t=this;Al((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=Xc(t.currentObservers),s=a.next();!s.done;s=a.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;Al((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;Al((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,r=n.hasError,a=n.isStopped,s=n.observers;return r||a?dl:(this.currentObservers=null,s.push(e),new ll((function(){t.currentObservers=null,cl(s,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,a=t.isStopped;n?e.error(r):a&&e.complete()},t.prototype.asObservable=function(){var e=new $l;return e.source=this,e},t.create=function(e,t){return new Ah(e,t)},t}($l),Ah=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return Kc(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:dl},t}(Eh),Ch=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return Kc(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,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Eh);function Sh(e,t){return Wl((function(n,r){var a=0;n.subscribe(Hl(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}class Nh extends Ch{constructor(e,t){super(t)}}const _h=(...e)=>Sh((t=>e.includes(t.type)));var bh=new $l((function(e){return e.complete()}));function Th(e){return e?function(e){return new $l((function(t){return e.schedule((function(){return t.complete()}))}))}(e):bh}const Ph=(e,t,n)=>Xl((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),yh(XC(e,r,t,null,n))))),Oh=(e,t)=>n=>new $l((r=>{let a={},s=0;return n.pipe(gh((n=>{const r=Date.now();let o;return o=t||Xt,o&&o(n,a)&&r-s<e?Th():(a=n,s=r,yh(n))}))).subscribe(r)})),Dh=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:a}=e,s={data_view_ID:t},{restApi:o,reqType:i}=mS("createDataObject",s),{content:c}=gm(a);return Jl(au(o,{method:i,headers:r,body:{data:c.content,pageInstructions:c?.pageInstructions}},a)).pipe(hh((t=>({response:t.data,actionInPayload:e}))),Ph("Error occurred during ajax call at createDataObject Epic",n))},vh=e=>{const{dataLookUp:t,context:n,headers:r,viewName:a,requestPayload:s}=e,o={data_view_ID:t,view_ID:a},{restApi:i,reqType:c}=mS("readDataObject",o);return Jl(au(i,{method:c,headers:r,body:{dataViewParameters:s}},n)).pipe(hh((t=>({response:t.data,headers:hm(t.headers),actionInPayload:e}))),Ph("Error occurred during ajax call at getDataObjectView Epic",n))},Rh=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:a,key:s}=e,o={data_view_ID:t},{restApi:i,reqType:c}=mS("updateDataObject",o),{content:l}=gm(a);return Jl(au(i,{method:c,headers:{...r,"if-match":e?.etag},body:{data:{...l.content,...s},pageInstructions:l.pageInstructions||[]}},a)).pipe(hh((t=>({response:t.data,actionInPayload:e}))),Ph("Error occurred during ajax call at updateDataObject Epic",n))},$h=e=>{const{lookupDatapage:t,context:n,headers:r,actionID:a,dataViewParameters:s}=e,o={data_view_ID:t,action_ID:a},{restApi:i,reqType:c}=mS("openDataObjectAction",o);return Jl(au(i,{method:c,headers:r,body:{dataViewParameters:s}},n)).pipe(hh((t=>({response:t.data,headers:hm(t.headers),actionInPayload:e}))),Ph("Error occurred during ajax call at getDataObjectView Epic",n))},xh=e=>{const{savableDatapage:t,context:n,headers:r,actionID:a,keys:s,containerItemID:o,jsActionQueryParams:i}=e,c={data_view_ID:t,action_ID:a};let{restApi:l}=mS("submitDataObjectAction",c);const{reqType:d}=mS("submitDataObjectAction",c),{content:u}=gm(o);return l=fy(i,l),Jl(au(l,{method:d,headers:{...r,"if-match":e?.etag},body:{data:{...u?.content,...s},pageInstructions:u?.pageInstructions||[]}},n)).pipe(hh((t=>({response:t.data,actionInPayload:e}))),Ph("Error occurred during ajax call at getDataObjectView Epic",n))};const wh=new class{constructor(){this.components={}}_checkComponent(e,t){return!!this.components[t]?.[e]}start(e,t,n,r,a){const s={viewName:e,pageReference:n,contextName:r,isInProgress:!0,active:!0,caseKey:t};this.components[r]=this.components[r]||{},this.components[r][a]=s}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:r,pageReference:a}=n;Ay(e,r,t,a,{})}}},Mh="postDataViewMetadata",Lh={getData:(e,t,n,r)=>((e,t,n,r={})=>{const a={dataViewName:e},{skipClearErrorMessages:s,signal:o,doNotMergeMessagesForStatusCode:i}=r,{restApi:c,reqType:l}=mS("getListData",a);return au(c,{method:l,body:t,...o&&{signal:o},...s&&{skipClearErrorMessages:s}},n,i)})(e,t,n,r),getListCount:(e,t,n)=>{const r={dataViewName:e},{restApi:a,reqType:s}=mS("getListDataCount",r);return au(a,{method:s,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const a=!!n,s=!!r,o=wE.doesRestApiExist(Mh),i=(a||s)&&o?Mh:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:d}=mS(i,c);if(o){if(a)return au(l,{method:d,body:{associationFilter:n}},t);if(s)return au(l,{method:d,body:{propertyFilter:r}},t)}return au(l,{method:d},t)},getDataObjectView:(e,t,n,r,a={})=>{const{skipClearErrorMessages:s,signal:o,doNotMergeMessagesForStatusCode:i}=a,c={data_view_ID:e,view_ID:t},l={dataViewParameters:n},{restApi:d,reqType:u}=mS("readDataObject",c);return au(d,{method:u,body:l,...o&&{signal:o},...s&&{skipClearErrorMessages:s}},r,i)},getCaseEditMetadata:(e,t)=>ry.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>ry.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>ry.updateCaseEditFieldsData(e,t,n,r),moveListRecords:(e,t)=>{const{sourceID:n,destinationID:r,context:a,listClass:s,viewName:o,viewClassName:i}=e,c={viewName:o,viewClassName:i},{restApi:l,reqType:d}=mS("moveListRecords",c);return au(l,{method:d,body:{content:{sourceID:n,destinationID:r,context:a,listClass:s}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===Fr.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===Fr.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==zI("root").find((e=>e.includes("authoring-preview")))?`${Fr.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${Dp.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=LE.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}},Uh=/{(.*?)}/i,Fh=/{(.*?)}/g,jh=e=>null!==e.match(Uh),kh=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),Vh=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`}},Bh=e=>e.replaceAll("+","%20"),Gh=["portal","noPortal","debug","activeTab","contextParam","lang"],Wh=e=>{if(e.indexOf("?")>0){const[t,n]=e.split("?"),r=new URLSearchParams(n),a=new Map;for(const[e,t]of r)Gh.includes(e)||a.set(e,t);const s=Bh(new URLSearchParams(Array.from(a.entries())).toString());return s?`${t}?${s}`:t}return e},Hh=(e,t)=>e.includes("/assignments")?((e,t)=>{const n=e.split("/"),r=n.indexOf("assignments"),a=n.slice(r-2).join("/"),s=n[n.length-1],o=fS(Ka,{assignmentID:s});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:s},options:t,routeKey:os,urlPath:a}})(e,t):wE.getEndPointInfo(e),qh=()=>{const e=LE.environmentInfoObject?.pyExecutionRuntimeName;return"Infinity"===e};const zh=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const Yh=class{constructor(){this.users={},this.connected=!1,this.connectionsCount=1}_handleUserPresence({message:e}){const{state:t,updateById:n}=e,r=this.users[n];r&&(r.state=t,Object.keys(r.subscribers).forEach((e=>{r.subscribers[e]?.callback({state:r.state})})))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t,n){const r=this._getAutoGenId(),a=this.users[e];if(a)return a.subscribers[r]={callback:t,contextName:n},r;this.users[e]={subscribers:{[r]:{callback:t,contextName:n}}};const s={matcher:"PRESENCE",criteria:{userId:e}};return gg.subscribe(s,this._handleUserPresence.bind(this)),r}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],gg.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 Kh=function(e,t,n,r){for(var a=e.length,s=n+(r?1:-1);r?s--:++s<a;)if(t(e[s],s,e))return s;return-1};const Qh=function(e){return e!=e};const Jh=function(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1};const Xh=function(e,t,n){return t==t?Jh(e,t,n):Kh(e,Qh,n)};const Zh=function(e,t){return!!(null==e?0:e.length)&&Xh(e,t,0)>-1};const eg=function(e,t,n){for(var r=-1,a=null==e?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1};const tg=function(e,t,n,r){var a=-1,s=Zh,o=!0,i=e.length,c=[],l=t.length;if(!i)return c;n&&(t=An(t,dt(n))),r?(s=eg,o=!1):t.length>=200&&(s=Re,o=!1,t=new De(t));e:for(;++a<i;){var d=e[a],u=null==n?d:n(d);if(d=r||0!==d?d:0,o&&u==u){for(var p=l;p--;)if(t[p]===u)continue e;c.push(d)}else s(t,u,r)||c.push(d)}return c};var ng=v?v.isConcatSpreadable:void 0;const rg=function(e){return ke(e)||Ze(e)||!!(ng&&e&&e[ng])};const ag=function e(t,n,r,a,s){var o=-1,i=t.length;for(r||(r=rg),s||(s=[]);++o<i;){var c=t[o];n>0&&r(c)?n>1?e(c,n-1,r,a,s):je(s,c):a||(s[s.length]=c)}return s};const sg=Dr((function(e,t){return sr(e)?tg(e,ag(t,1,sr,!0)):[]}));const og=class{constructor(e,t){this.atomicSubscribers={},this.connectionsCount=0,this.connected=!1,this.matcher=e,this.criteria=t,this.messagingServiceSubscriptionID=""}_handleAtomicMessage({message:e}){Object.keys(this.atomicSubscribers).forEach((t=>{const n=this.atomicSubscribers[t];if(!n)return;const r=Object.keys(n.criteria),a=Object.keys(e);0===sg(r,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=gg.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&&(gg.unsubscribe(this.messagingServiceSubscriptionID),this.messagingServiceSubscriptionID=""))}};const ig=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new og("CASE",t)}return this.subscriptions[e]}};const cg=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:HI(`${e}/workarea`)||""}static publishCaseValuesUpdate(e,t){const n=this.getContextPath(t.actionInContext);Object.entries(e.message).forEach((([e,t])=>{const r=this.transformReference(e),{pageReference:a,propertyName:s}=this.extractReferenceParts(r);e.match(/\.\w+\[\d+\]\.\w+/)&&km.executeStateMachine(n,r,t,!0,{skipStateUpdate:!0});QA([{type:Xr,payload:{reference:r,value:t,context:n}},{type:ea,payload:{reference:r,value:t,context:n,pageReference:a,propertyName:s}}])}))}},{RESOURCE_TYPES:lg}=Ur;const dg=class{static openCase(e,t,n,r={}){const a={insKey:e,acTargetName:n,actionMgrID:Vp.getNextActionMgrId(),context:t,...r},s=pa;r&&r.channelName?a.headers={[Fr.X_ORIGIN_CHANNEL]:r.channelName}:LE.isWSSPortal()&&(a.headers={[Fr.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Vp.actionManagerPromise(s,a.actionMgrID);return QA({type:s,payload:a}),o}static openAssignment(e,t,n,r={}){const a={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:Vp.getNextActionMgrId(),context:t,...r},s=ya;r&&r.channelName?a.headers={[Fr.X_ORIGIN_CHANNEL]:r.channelName}:LE.isWSSPortal()&&(a.headers={[Fr.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Vp.actionManagerPromise(s,a.actionMgrID);return QA({type:s,payload:{...a}}),o}static createCase(e,t,n,r={}){const a=ua,s={class:e,acTargetName:n,actionMgrID:Vp.getNextActionMgrId(),context:t,...r};r&&r.channelName?s.headers={[Fr.X_ORIGIN_CHANNEL]:r.channelName}:LE.isWSSPortal()&&(s.headers={[Fr.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Vp.actionManagerPromise(a,s.actionMgrID);return QA({type:a,payload:{...s}}),o}static getNextWork(e,t,n={}){const r=ya,a={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:Vp.getNextActionMgrId(),context:e,...n},{promise:s}=Vp.actionManagerPromise(r,a.actionMgrID);return QA({type:r,payload:{...a}}),s}static getOpenedCaseItems(e){const t=[],n=OI(e);if(n){const{items:r={}}=n,a=Object.keys(r),s=VI(e);a.forEach((n=>{if(r[n]&&(r[n].resourceType===lg.CASE||r[n].resourceType===lg.ASSIGNMENT||r[n].resourceType===lg.OBJECT)){const{key:a="",context:o}=r[n],i=r[n],c=a.substring(a.indexOf(" ")+1),l=eC(".caseTypeID",Fr.CASE_INFO.CASE_INFO,o),d=s===n;t.push({...i,key:a,workID:a,caseID:c,className:l,context:o,containerItemID:n,target:e,active:d})}}))}return t}static getCaseDetails=(e,t)=>{if(!e)return Promise.reject(new Error("Case ID is required"));const n={caseID:e},{restApi:r,reqType:a}=mS(Ya,n),s={},o=Vr.getRemoteHeaderFromSourceClass(t??"");return o&&(s.RemoteSystemID=o),au(r,{method:a,headers:s})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=mS("getBulkActions"),r=e.map((e=>({ID:e}))),a=r.length,s=a/5,o={},i=[];for(let e=0;e<a;e+=s)o.cases=r.slice(e,e+s),o.cases.length&&i.push(au(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:r}=mS("getCaseBulkActions",t),a=await au(n,{method:r});let s=[];return a.data?.availableActions?.length&&(s=a.data.availableActions),s};static getAssignmentBulkActions=async e=>{const{restApi:t,reqType:n}=mS("getAssignmentBulkActions"),r={assignments:e.map((e=>({ID:e})))},a=await au(t,{method:n,body:r});return a.data?.availableActions??[]}};class ug{static CLOSE_CONTAINER_ITEM_EVENT=Ur.PUB_SUB_EVENTS.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM;static objectRedirectionSubIds={};static truncateNamespace(e){let t=e;return!Mr.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 r=jp.getComponentCache("lastActionID")||"";if("string"==typeof r&&r?.toLowerCase()!==n?.toLowerCase())return;let a=!1;const s=VI("app/modal");s&&(a=vI("app/modal",s)?.isMinimizable??!1),!s||a?dg.openCase(t,Fr.APP.APP,Fr.PRIMARY,{isAutoRedirection:!0}):$d.subscribe(this.CLOSE_CONTAINER_ITEM_EVENT,(e=>{e?.containerItemID===s&&($d.unsubscribe(this.CLOSE_CONTAINER_ITEM_EVENT,"closeContainerItemForRedirection"),dg.openCase(t,Fr.APP.APP,Fr.PRIMARY,{isAutoRedirection:!0}))}),"closeContainerItemForRedirection",!0)}static handleRefreshObject(e){dg.openCase(e,Fr.APP.APP,Fr.PRIMARY,{forceRefresh:!0})}static handleObjectRedirection(e,t){const{message:n,filter:r}=e,{caseId:a,currUserID:s}=t;if(r?.criteria?.CurrentObjectID!==a||r?.criteria?.UserID?.toLowerCase()!==s?.toLowerCase())return;const{RedirectionType:o}=n||{};switch(o){case"OpenObject":this.handleOpenObject(n);break;case"RefreshObject":this.handleRefreshObject(a)}}static subscribeToRedirection(e){const t=LE.getOperatorIdentifier()||"",n={matcher:"REDIRECTION",criteria:{CurrentObjectID:e,UserID:t?.toLowerCase()}},r=gg.subscribe(n,(n=>{this.handleObjectRedirection(n,{caseId:e,currUserID:t})}));this.objectRedirectionSubIds[e]=r}static unsubscribeToRedirection(e){gg.unsubscribe(this.objectRedirectionSubIds[e]),delete this.objectRedirectionSubIds[e]}static subscribeToEvent(e,t){let n=null;if(e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?n=e=>{const{caseId:t}=e;this.objectRedirectionSubIds[t]||this.subscribeToRedirection(t)}:e===Fr.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}`);$d.subscribe(e,n,t)}static unsubscribeToEvent(e,t){$d.unsubscribe(e,t)}static subscribeToCaseEvents(){this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}static unsubscribeToCaseEvents(){this.unsubscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.unsubscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}}const pg=ug;class hg{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new Yh;static refreshB2SOffset=10;static agentSubscribeIdMap=new Map;static filterKeyToSubscriberIdMap=new Map;static get offlineEnabled(){return"undefined"!=typeof navigator&&(navigator.userAgent||"").includes("pxUsesOffline")}static isAuthenticated=!1;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=Dp.b2sJWT;if(!n||n.length<4)return;this.webSocket&&(this.webSocket.close(),this.cleanSocketListeners());const r=t.endsWith("/")?t+"ws":t+"/ws";try{const e=new WebSocket(`${r}`);this.webSocket=e,this.boundHandleOnOpen=this.handleOnOpen.bind(this),this.boundHandleOnMessage=this.handleOnMessage.bind(this),this.boundHandleOnError=this.handleOnError.bind(this),this.boundHandleOnClose=this.handleOnClose.bind(this),e.addEventListener("open",this.boundHandleOnOpen),e.addEventListener("message",this.boundHandleOnMessage),e.addEventListener("error",this.boundHandleOnError),e.addEventListener("close",this.boundHandleOnClose)}catch(e){console.log(e)}}static handleOnError(e){this.getTokenExpiryTime()<=0&&(clearInterval(this.reInitInterval),this.reInitInterval=void 0,this.isAuthenticated=!1),console.error("web socket error - readyState:",this.webSocket?.readyState,"| isTrusted:",e?.isTrusted)}static handleOnClose(e){null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),this.isAuthenticated=!1,console.debug("web socket closed - code:",e?.code,"| wasClean:",e?.wasClean),e&&4001===e.code||this.connectionConfig?.disableReInit||this.reInitInterval||this.getTokenExpiryTime()<=0||this.reInitialization()}static handleOnOpen(){if(clearInterval(this.reInitInterval),this.reInitInterval=void 0,null!==this.webSocket&&1===this.webSocket.readyState){const e=Dp.b2sJWT;if(!e||e.length<4)return;this.publishMessage({token:e})}}static unsubscribeAgentMessageCaseValues(e){if(e.assignmentID){const t=hg.agentSubscribeIdMap.get(e.assignmentID);hg.unsubscribe(t??""),hg.agentSubscribeIdMap.delete(e.assignmentID)}}static subscribeAgentMessageCaseValues(e){const t={matcher:"COACH_UPDATE",criteria:{caseId:e.caseKey,assignmentId:e.assignmentID}},n=hg.subscribe(t,(t=>{cg.publishCaseValuesUpdate(t,e)}));hg.agentSubscribeIdMap.set(e.assignmentID,n)}static handleOnMessage(e){if(null!==e&&"ALIVE"===e.data)null===this.isServiceAlive&&this.checkLiveliness(Fr.PRIORITY.PING),this.isServiceAlive=!0;else{let t=null;try{t=JSON.parse(e.data)}catch(t){console.error("Invalid data received from messaging service",e.data)}if(t&&t.msgId&&this.webSocket?.send(`{"ack":"${t.msgId}"}`),t&&t.filter){const{matcher:e,criteria:n}=t.filter;delete n.environmentID,n.productionLevel&&delete n.productionLevel,this.dispatchToSubscribers(e,n,t)}else if(t?.tokenExpiryTime){$d.subscribe(Fr.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_LOAD,hg.subscribeAgentMessageCaseValues),$d.subscribe(Fr.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_UNLOAD,hg.unsubscribeAgentMessageCaseValues),this.isAuthenticated=!0,this.setTokenExpiryTime({tokenExpiryTime:t.tokenExpiryTime});const e=1e3*(this.getTokenExpiryTime()-this.refreshB2SOffset);setTimeout((()=>this.refreshB2STokenReInit()),e),this.inProgressSubscriptions.forEach((({messageSubscriber:e,id:t})=>{this.subscribeToSocket(e,t)})),this.inProgressSubscriptions=[],this.inProgressMessages.forEach((e=>{this.publishMessage(e)})),this.inProgressMessages=[]}else console.error("filter missing from received data from messaging service",e.data)}}static dispatchToSubscribers(e,t,n){Object.keys(this.subscribers).forEach((r=>{const a=this.subscribers[r];a?.filter&&a.filter.matcher===e&&hC.isEqual(a.filter.criteria,t)&&a.messageHandler(n)}))}static reInitialization(e){this.reInitInterval||(Object.keys(this.subscribers).forEach((e=>{this.unsubscribe(e,!0)})),Object.keys(this.subscribers).forEach((e=>{this.inProgressSubscriptions.push({messageSubscriber:this.subscribers[e],id:e})})),e?this.initConnection(this.connectionConfig):this.reInitInterval=setInterval((()=>{this.initConnection(this.connectionConfig)}),5500))}static checkLiveliness(e){!1===this.isServiceAlive?this.reInitialization(!0):this.isServiceAlive=!1,null!==this.serviceAliveHandler&&clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=setTimeout((()=>{this.checkLiveliness(e)}),e)}static setConnectionConfig(e){this.connectionConfig=e}static cleanSocketListeners(){null!==this.webSocket&&(this.webSocket.removeEventListener("open",this.boundHandleOnOpen),this.webSocket.removeEventListener("message",this.boundHandleOnMessage),this.webSocket.removeEventListener("error",this.boundHandleOnError),this.webSocket.removeEventListener("close",this.boundHandleOnClose))}static disconnect(){null!==this.webSocket&&(this.cleanSocketListeners(),this.webSocket.close(),this.webSocket=null)}static getFilterKey(e){return`${e.matcher}:${JSON.stringify(e.criteria)}`}static findExistingSubscriberId(e){return this.filterKeyToSubscriberIdMap.get(this.getFilterKey(e))}static subscribe(e,t,n,r){this.connectionsCount+=1;const a=r||`${Date.now()}_${this.connectionsCount}`;if("COACH_UPDATE"===e.matcher){const t=this.findExistingSubscriberId(e);if(t)return t}const s=new zh(e,t,n);return null!==this.webSocket&&1===this.webSocket.readyState&&this.isAuthenticated?(this.subscribeToSocket(s,a),a):(this.inProgressSubscriptions.push({messageSubscriber:s,id:a}),e&&this.filterKeyToSubscriberIdMap.set(this.getFilterKey(e),a),this.offlineEnabled&&(this.subscribers[a]=s),null===this.webSocket&&this.initConnection(this.connectionConfig),a)}static subscribeToSocket(e,t){this.subscribers[t]=e,e.filter&&this.filterKeyToSubscriberIdMap.set(this.getFilterKey(e.filter),t);if(Object.keys(this.subscribers).filter((t=>this.subscribers[t]===e)).length>1)return;const n={filter:e.filter,subscribe:{id:t}};this.webSocket?.send(JSON.stringify(n))}static unsubscribe(e,t){if(this.subscribers[e]){if(!t){const t=this.subscribers[e].filter;t&&this.filterKeyToSubscriberIdMap.delete(this.getFilterKey(t)),delete this.subscribers[e]}const n={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(n))}this.offlineEnabled&&!t&&this.removeFromInProgressSubscriptions(e)}static removeFromInProgressSubscriptions(e){const t=this.inProgressSubscriptions.findIndex((t=>t.id===e));if(-1!==t){const e=this.inProgressSubscriptions[t].messageSubscriber.filter;e&&this.filterKeyToSubscriberIdMap.delete(this.getFilterKey(e)),this.inProgressSubscriptions.splice(t,1)}}static publishMessage(e){null!==this.webSocket?null===this.webSocket||1!==this.webSocket.readyState?this.inProgressMessages.push(e):this.webSocket.send(JSON.stringify(e)):console.error("Web socket not initialized.")}static getUserPresence=()=>this.userPresence;static dispatchLocalMessage(e){const{matcher:t,criteria:n,message:r={}}=e,{environmentID:a,productionLevel:s,...o}=n,i={msgId:`local_${Date.now()}`,filter:{matcher:t,criteria:o},message:r};this.dispatchToSubscribers(t,o,i)}static getCaseSubscription=e=>ig.getOrCreateSubscription(e);static initObjectRedirectionSubscription=()=>pg.subscribeToCaseEvents();static refreshB2STokenReInit=async()=>{if(qh()){const e={body:{B2SToken:Dp.b2sJWT}};fp("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}),this.webSocket?.close()):console.log("refreshB2S: invalid b2s length")})).catch((e=>{console.log(`refreshB2S: error occurred while fetching: ${e}`)}))}else if(!yp("refreshB2S")){mp("/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}),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 gg=hg;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:r}=e,a=n*r;let s=a-r;for(;s<a;s+=1){if(!this.records[s])return this.maxRecords===s?t:[];t.push(this.records[s])}return t}return this.records}mergeRecords(e,t){if(Number.isInteger(t?.pageNumber)&&Number.isInteger(t?.pageSize)){const{pageNumber:n,pageSize:r}=t,a=n*r;let s=0;for(let t=a-r+1-1;t<a;t+=1)this.records[t]=e[s],s+=1;if(e.length<r){const t=(n-1)*r+e.length;this.setMaxRecordsCount(t)}}else e||(e=[]),Array.isArray(this.records)&&Array.isArray(e)&&(this.records=iC(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const mg=new class{SUBSCRIPTION_STATUS_FAILED="FAILED";SUBSCRIPTION_STATUS_SUCCESS="SUCCESS";DATAPAGE_NOT_CACHED="Data Page Not Cached";DUPLICATE_SUBSCRIPTION_ID="Duplicate Subscription Id";MISSING_MANDATORY_FIELD="Missing Mandatory Field(s)";constructor(){this.dataStore={},this.dataStoreMeta={},this.subscribers={},this.dataPageSubscribers={},this.isCacheEnabled=!0,this.subscribedDataPageNames=new Map}getDataViewParameters(e,t){if(!e||!t)return e;if(!t.parameters)return{};const n=Array.isArray(t.parameters)?t.parameters:[t.parameters],r=new Set(n.map((e=>e.name))),a={};return Object.keys(e).forEach((t=>{r.has(t)&&(a[t]=e[t])})),a}resolveParameterValue(e,t,n,r,a){return hC.resolveParameterValue(e,t,n,r,a)}formatParameterValue(e,t,n,r,a){return hC.formatParameterValue(e,t,n,r,a)}resolveAndFormatParameters(e,t,n,r,a){return hC.resolveAndFormatParameters(e,t,n,r,a)}getData(e,t,n,r){const a=this.generateHash(e,t,r);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={},r,a,s={}){const o=OA(e),i=this.getDataViewParameters(n,o);s.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e));const c={skipClearErrorMessages:!0,...s};if(!this.isCacheable(e,a)||s.invalidateCache){const n=await this.fetchData(e,i,r,a,t,c);return{...n.data,data:this.isCacheable(e,a)?this.mergeDataStore(e,i,r,a,n):n.data?.data??[],pageNumber:n?.data?.pageNumber,pageSize:n?.data?.pageSize,queryStats:n?.data?.queryStats,status:n?.status}}const l=this.getData(e,i,r,a);if(l.length>0)return Promise.resolve({data:l});const d=await this.fetchData(e,i,r,a,t,c);return{...d.data,data:this.mergeDataStore(e,i,r,a,d),pageNumber:d?.data?.pageNumber,pageSize:d?.data?.pageSize,queryStats:d?.data?.queryStats,status:d?.status}}async getPageDataAsync(e,t,n={},r={}){const a=this.generateHash(e,n,null);if(r.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),this.isCacheable(e)&&this.dataStore[e]&&this.dataStore[e][a]){if(!r?.invalidateCache)return Promise.resolve(this.dataStore[e][a]);delete this.dataStore[e][a],this._removeDataStoreMetaEntry(e,n,a)}const{restApi:s,reqType:o}=mS(Fr.GET_PAGE_DATA,{dataViewName:e,dataViewParameters:encodeURIComponent(JSON.stringify(n))}),i={method:o,...r.skipClearErrorMessages&&{skipClearErrorMessages:r.skipClearErrorMessages}};if(r.enableStreaming){const e=r.streamOptions||{};Object.assign(i,{responseType:"stream",adapter:"fetch",headers:{Accept:"text/event-stream"},...e})}const c=s&&n&&0===Object.keys(n).length?s.split("?")[0]:s;return au(c,i,t).then((t=>(this.isCacheable(e)&&(this.dataStore[e]={...this.dataStore[e],[a]:t.data},this._addDataStoreMetaEntry(e,n,a)),r.enableStreaming?t:t.data)))}subscribeToDataPageUpdates(e,t,n,r={}){if(!e||!t||!n)return!1;const a=this.generateHash(n,r,null);this.dataPageSubscribers[n]??={};const s=this.dataPageSubscribers[n];s[a]??={};const o=s[a];return this.subscribeToMessageService(n,e),!o[e]&&(o[e]??=t,!0)}unsubscribeToDataPageUpdates(e,t,n={}){if(!e||!t)return!1;const r=this.generateHash(t,n,null);delete this.dataPageSubscribers[t]?.[r]?.[e];const a=this.subscribedDataPageNames.get(t)??0;return a<=1?(this.subscribedDataPageNames.delete(t),e&&gg.unsubscribe(e)):this.subscribedDataPageNames.set(t,a-1),!0}unsubscribeToDatapageUpdates(e,t,n={}){return this.unsubscribeToDataPageUpdates(e,t??"",n)}_isDataPageCached(e,t){if(t&&hC.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],r=Mr.getDefaultQualifiedName("pxResults");Object.keys(n).forEach((n=>{if(this.dataStore[t][n]){this.dataStore[t][n].mergeRecords(e[t][n][r])}else{const a=new fg;this.dataStore[t][n]=a,a.mergeRecords(e[t][n][r]||[])}}))}))}_addDataStoreMetaEntry(e,t,n){const r=this.generateHash(e,t,null);this.dataStoreMeta[e]??={};const a=this.dataStoreMeta[e];a[r]??=[];const s=a[r];s.includes(n)||s.push(n)}_removeDataStoreMetaEntry(e,t,n){if(!e||t||n||(this.dataStoreMeta[e]={}),e&&t&&n){const r=this.generateHash(e,t,null);this.dataStoreMeta[e][r]=this.dataStoreMeta[e][r].filter((e=>e!==n))}}mergeDataStore(e,t,n,r,a){const s=this.generateHash(e,t,r),o=a?.data?.data;if(!o||0===o.length)return[];this.dataStore[e]||(this.dataStore[e]={}),this.dataStore[e][s]||(this.dataStore[e][s]=new fg);const i=this.dataStore[e][s];return i.mergeRecords(o,n),i.isDirty=!1,this._addDataStoreMetaEntry(e,t,s),i.getRecords(n)}isDataPage(e=""){return e.startsWith("D_")||e.startsWith("Declare_")||e.startsWith(Mr.getDefaultQualifiedName("D_"))||e.startsWith(Mr.getDefaultQualifiedName("Declare_"))}subscribeToUpdate(e,t,n,r,a,s){this.subscribers[e]=this.subscribers[e]||{},this.subscribers[e].callback=this.subscribers[e].callback||{},s&&!this.subscribers[e].callback?.[s]&&(this.subscribers[e].callback[s]=a),this.subscribeToCascadeUpdates(e,t,n,r,s)}unsubscribe(e,t,n,r,a){delete this.subscribers[e]?.callback?.[a],t&&t.length>0&&HA.unRegisterFields(n,r,t,a)}handleMessage(e){const{msgId:t,message:n}=e,{datapage:r,parameters:a=""}=n,s=this.subscribers[r];this.markDataInstanceDirty(r,""===a?null:JSON.parse(a)),t&&this._executeDataPageSubscriptions(e),!t&&s?.callback&&Object.keys(s.callback).forEach((t=>{s.callback?.[t](e.message)}))}markDataInstanceDirty(e,t){let n,r;if((!t||(n=this.generateHash(e,t,null),r=this.dataStoreMeta[e]?.[n],r?.push(this.generateHash(e,null)),r))&&this.dataStore[e]){Object.keys(this.dataStore[e]).filter((e=>!t||!r||r.includes(e))).forEach((t=>{this.dataStore[e][t].isDirty=!0}))}}_executeDataPageSubscriptions(e){const{message:t}=e,{datapage:n,parameters:r}=t,a=r?JSON.parse(r):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 r=this.dataPageSubscribers[n]?.[t]??{};Object.keys(r).forEach((t=>{r[t](e.message)}))}))}else{const t=this.dataPageSubscribers[n];Object.keys(t).forEach((n=>{const r=t[n];Object.keys(r).forEach((r=>{t[n][r](e.message)}))}))}}isPerInteraction(e){const t=OA(e);return!t||"reloadOncePerInteraction"===t.refreshStrategy?.type}disableCache(e){this.isCacheEnabled=!e}generateHash(e,t,n){const r=OA(e);let a=[];r||(a=Object.keys(t||{}).map((e=>({name:e}))));const s=r?.parameters||a;let o="",i=e;const c=[];return Array.isArray(s)&&s.forEach((e=>{t?.[e.name]?c.push(t[e.name]):c.push(e.defaultValue??Fr.NULL_STRING)})),n&&c.push(JSON.stringify(n)),c.join(Fr.HASH_DELIMITER)&&(o=hC.getHashedString(c.join(Fr.HASH_DELIMITER)),i=e+Fr.UNDERSCORE_STRING+o),i}async fetchData(e,t,n,r,a,s){const{additionalApiParams:{useExtendedTimeout:o=!1,includeTotalCount:i=!1}={},...c}=s,l={dataViewParameters:t};return i&&(l.includeTotalCount=!0),o&&(l.useExtendedTimeout=!0),n&&(l.paging=n),r&&(l.query=r),Lh.getData(e,l,a,c)}handleCascadeUpdate(){const{dataPageName:e,scope:t}=this;t.handleMessage({message:{datapage:e,parameters:""}})}subscribeToCascadeUpdates(e,t,n,r,a){t&&t.length>0&&HA.registerFields(n,r,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}};gg.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 yg=class{constructor(e,t,n,r,a=100,s=500){this.finalDataViewCall=e,this.combiner=t,this.comparator=n,this.separator=r,this.maxtime=a,this.maxsize=s,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,r,a=this.findCombinableDataViewCall(e);return n=new Promise((e=>{r=e})),a&&!a.dataViewCallMap[t]?(this.combiner(a,e),a.dataViewCallMap[t]={promise:n,resolve:r}):a?n=a.dataViewCallMap[t].promise:(a={...e,dataViewCallMap:{[t]:{promise:n,resolve:r}}},this.groupedDataViewArray.push({...e,dataViewCallMap:{[t]:{promise:n,resolve:r}}})),Object.keys(a.dataViewCallMap).length===this.maxsize?this.dequeueDataViewCallOnSizeExceed(a):(clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>this.dequeueAllDataViewCalls()),this.maxtime)),n}};const Ig=class{constructor(){this.bufferedDataQueues={}}getBufferedDataQueueForDataPage(e){return this.bufferedDataQueues[e]}addBufferedDataQueueForDataPage(e,t,n,r,a,s,o){return this.getBufferedDataQueueForDataPage(e)||(this.bufferedDataQueues[e]=new yg(t,n,a,r,s,o)),this.bufferedDataQueues[e]}},Eg=(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,Ag=e=>e.map((e=>e.field)),Cg=(e,t)=>{const n=(e.query?.filter).filterConditions,r=(t.query?.filter).filterConditions;let a=(t.query?.filter).logic;const s=Object.keys(n).length;Eg(n,r)?("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(r.F0.rhs?.value)):(Object.keys(r).forEach(((e,t)=>{const o=`F${s+t}`;n[o]=r[e],a=a.replace(e,o)})),(e.query?.filter).logic+=` OR ${a}`);const o=Ag(e.query?.select);Ag(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},Sg=(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]:!hC.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),Ng=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:a}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:a(e,n)})}))},_g=e=>({combiner:Cg,comparator:Sg,separator:Ng,...e}),bg=(e,t)=>{if("undefined"!=typeof window)try{window.sessionStorage.setItem(e,t)}catch(e){}},Tg=(e,t="",n="IS_NULL")=>({comparator:n,lhs:{field:e},...t&&{rhs:{value:t}}}),Pg=e=>null!=e&&"object"==typeof e&&!("then"in e);class Og{constructor(e,t){this.isInitialised=!1,this.isQueryable=!0,this.dataSourceMetaData={},this.nonQueryableData=[],this.fetchedNQData=!1,this.previousSearchText=null,this.totalRecordCount=0,this.fetchedRecordCount=0,this.cache=new Map,this.keyCache=new Map,this.pageNumber=0,this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null,this.dataSource="",this.bufferInitialized=!1,e&&(this.listType=e.listType,this.dataSource=e.dataSource,e.enablePagination?(this.enablePagination=e.enablePagination,this.pageSize=e.pageSize):this.maxResultsDisplay=e.maxResultsDisplay,this.parameters=e.parameters,this.columns=e.columns,this.matchPosition=e.matchPosition,this.ignoreCase=!1!==e.ignoreCase,this.dataSourceMetaData=e.dataSourceMetaData,this.context=t)}static searchResultsCache={};static init(e,t){return new Promise(((n,r)=>{const a=[...e.columns.map((e=>e.value)),...Object.entries(e.parameters).map((([e,t])=>`${e}+${t}`)),e.matchPosition,e.maxResultsDisplay].join(Fr.HASH_DELIMITER),s=hC.getHashedString(a),o=`${e.dataSource}_${s}`,i=`__dataviewmetadata__${e.dataSource}`,c=Lh.getAppCacheKey(i);if("undefined"!=typeof window&&window.sessionStorage.getItem(c)){const a=JSON.parse(`${window.sessionStorage.getItem(c)}`);if(t&&Og.searchResultsCache?.[t]?.[o])n(Og.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Og.searchResultsCache?.persisted?.[o])n(Og.searchResultsCache.persisted[o]);else{const s=new Og(e,t);JSON.stringify(a.associationFilter)===JSON.stringify(e.associationFilter)?(s.dataSourceMetaData=a.dataSourceMetaData,s.isQueryable=a.isQueryable,s.isInitialised=a.isInitialised,s.associationFilter=a.associationFilter,Og.initializeCache(t,e,o,s),n(s)):(s.associationFilter=e.associationFilter,s.propertyFilter=e.propertyFilter,s.fetchMetaData(t).then((r=>{bg(c,JSON.stringify({isQueryable:r.data.isQueryable,dataSourceMetaData:r.data,isInitialised:!0,associationFilter:e.associationFilter})),s.isQueryable=r.data.isQueryable,s.dataSourceMetaData=r.data,s.isInitialised=!0,Og.initializeCache(t,e,o,s),n(s)})).catch((e=>{s.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&OA(e.dataSource)){const r=new Og(e,t),a=OA(e.dataSource);r.isQueryable=!!a?.isQueryable,r.isInitialised=!0,r.dataSourceMetaData=a,bg(c,JSON.stringify({isQueryable:a?.isQueryable,dataSourceMetaData:a,isInitialised:!0})),r.context=t,Og.initializeCache(t,e,o,r),n(r)}else{const a=new Og(e,t);a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((r=>{bg(c,JSON.stringify({isQueryable:r.data.isQueryable,dataSourceMetaData:r.data,isInitialised:!0,associationFilter:e.associationFilter})),a.isQueryable=r.data.isQueryable,a.dataSourceMetaData=r.data,a.isInitialised=!0,Og.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new Ig;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(_g(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Og.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Og.searchResultsCache[e]&&(Og.searchResultsCache[e]={}),Og.searchResultsCache[e][n]=r):(void 0===Og.searchResultsCache.persisted&&(Og.searchResultsCache.persisted={}),Og.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return Lh.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Og.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>mg.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 r=this.buildSelect(n),a=((e=[],t={},n="")=>{if(!e.length||!Object.keys(t))return;const r={};return e.forEach(((e,n)=>{const a=t[e];let s;s=a?Tg(e,a,"EQ"):Tg(e),r[`T${n+1}`]=s})),{logic:Object.keys(r).join(` ${n} `),filterConditions:r}})(e,t,"AND");return{select:r,...a&&{filter:a},...Lh.isDistinctResultsOnly(r)&&{distinctResultsOnly:"true"}}};buildSchemaForQueryableDPWithKeys=(e,t,n)=>({dataViewParameters:this.parameters,query:this.buildQueryWithKeys(e,t,n),paging:this.buildPageOptions()});getRowDataByKeys=async(e,t,n)=>this.memoizedGetRowDataByKeys(e,t,n);buildKeyCacheKey(e,t,n){const r=e.map((e=>[e,t[e]??""])),a=n?.columns?.map((e=>e.value));return JSON.stringify({filterEntries:r,columns:a,pageNumber:this.pageNumber})}memoizedGetRowDataByKeys(e,t,n){const r=this.buildKeyCacheKey(e,t,n);(n?.invalidateCache||n?.purgeDataPageCache)&&this.keyCache.delete(r);const a=this.keyCache.get(r);if(a)return a;const s=this.isQueryable?this.buildSchemaForQueryableDPWithKeys(e,t,n):this.buildSchemaForNonQueryableDP(),o=mg.getDataAsync(this.dataSource,this.context,s.dataViewParameters,this.isQueryable?s.paging:void 0,this.isQueryable?s.query:void 0,{...n}).catch((e=>(this.keyCache.delete(r),Promise.reject(e))));return this.keyCache.set(r,o),o}getData(e,t){if(this.isQueryable){if(this.bufferInitialized)try{const t=this.buildSchemaForQueryableBufferDP(e);return Og.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return mg.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return mg.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query,{...t})}return this.fetchNonQueryableResults(e,t)}getCachedResult(e,t){if(this.enablePagination&&Pg(t)&&t.has(this.pageNumber))return t.get(this.pageNumber);const n=this.cache.get(e);return this.enablePagination||!n||Pg(n)?void 0:n}handleCacheError(e,t){if(this.enablePagination){const t=this.cache.get(e);t&&Pg(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&&Pg(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&&!uC(this.context))return!1;const t=e.toLowerCase(),n=this.cache.get(t);return!!n&&(!this.enablePagination||Pg(n)&&n.has(this.pageNumber))}memoizedGetData(e,t){const n=e?.toLowerCase(),r=this.cache.get(n);if(this.isResultCached(e)&&r){const e=this.getCachedResult(n,r);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&&!uC(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=mg.getDataAsync(this.dataSource,this.context,n.dataViewParameters,void 0,void 0,t),this.isNQDataFetchInProgress=!0,new Promise(((n,r)=>{this.fetchNQDataPromise?.then((r=>(this.nonQueryableData=[...r.data],this.fetchedNQData=!0,n({data:this.filterDataOnClient(e,this.nonQueryableData,t)})))).catch((e=>r(e))).finally((()=>{this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null}))}))}return Promise.resolve(null)}filterDataOnClient(e,t,n){const r=(n?.columns??this.columns)?.filter((e=>e.useForSearch)).map((e=>e.value));return t.reduce(((t,a)=>{const s=r?.some((t=>{const r=Og.resolveEmbeddedPath(t),s=hC.getIn(a,r);return null!=s&&this.positionMatches(`${s}`,e,n)}));return s&&t.push({...a}),t}),[])}static resolveEmbeddedPath(e){return e.startsWith("!P!")||e.startsWith("!PL!")?e.substring(e.lastIndexOf("!")+1).replace(/:/g,"."):e}positionMatches(e,t,n){const r=n?.ignoreCase??this.ignoreCase,a=r?e.toLowerCase():e,s=r?t.toLowerCase():t;switch(n?.matchPosition??this.matchPosition){case"start":return a.startsWith(s);case"contains":return a.includes(s);case"equals":return a===s;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 r={field:e.value};t.push(r)}})),t}buildFilters(e,t){const n=t?.matchPosition??this.matchPosition,r=t?.ignoreCase??this.ignoreCase,a={};let s=0;(t?.columns??this.columns)?.forEach((t=>{if(t.useForSearch){const o=`F${s}`;s+=1;const i={field:t.value},c={value:e};let l="CONTAINS";"start"===n?l="STARTS_WITH":"equals"===n&&(l="EQ");const d={...`${parseFloat(e)}`!==e==!0&&{ignoreCase:r?"true":"false"},lhs:i,rhs:c,comparator:l};a[o]=d}}));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),...Lh.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...Lh.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 Dg=Og;class vg{constructor(){this.refreshMap={},this.propChangeRefreshMap={}}static initializeRefreshCache(e,t,n,r,a){void 0===e[t]&&(e[t]={}),e[t][n]=[{uniqueHash:r,callback:a}]}registerForRefresh(e,t,n,r,a){n=hC.convertClipboardPageToPageRefNotation(n);const s=r.split("/").join(Fr.HASH_DELIMITER),o=hC.getHashedString(s);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 vg.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 vg.initializeRefreshCache(this.refreshMap,a,`${e}-${n}`,o,t)}triggerPropChangeRefresh(e,t){const n=this.propChangeRefreshMap?.[t];if(!n)return!1;const r=yC.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,e,t),{interestPage:a=""}=r||{},s=e=>hC.convertPageRefToClipboardPageNotation(e).replace(`${Fr.CASE_INFO?.CASE_INFO_CONTENT}${a}`,"");if(n[e]){const t=s(e);return n[e].forEach((e=>e.callback(t))),!0}const o=md.getContextReferences(t)?.get(e),i=o&&yC.resolveContextTreeNodeProps(o.props)||{},{contextPageRef:c}=i;if(c&&n[c]){const e=s(c);return n[c].forEach((t=>t.callback(e))),!0}for(const t of Object.keys(n)){let r;if(hC.segmentsMatch(t,e)?r=e:c&&hC.segmentsMatch(t,c)&&(r=c),r){const e=s(r);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 Rg=new vg;const $g=class{static cleanCaches(e){HA.purgeCascadeFields(e),wh.removeContext(e),Dg.clearContextedCache(e),$d.cleanContextSubscribers(e),Gm(e),md.removeContextTreeNode(e),gg.clearContext(e),Rg.deRegisterForRefresh(e)}},xg="GET_DESCENDANTS",wg={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 Mg=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]}},Lg=e=>{$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},Ug=e=>{$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)},Fg=e=>{$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e)},jg=e=>{$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,e)},kg=e=>{$d.publish(Fr.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_LOAD,e)},Vg=e=>{$d.publish(Fr.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_UNLOAD,e)};const Bg=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=[],r=t.context_data?.blocking_action_counter??0,a=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let s=t.context_data?.is_deferred_action_in_progress??!1;if(r<=0){if(s)n.push({type:Ca,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}});else{if(!(a.length>0))return;{const t=a.shift();s=!s,n.push({type:Ca,payload:{context:e,data:{context_data:{deferred_action_queue:a,blocking_action_counter:r,is_deferred_action_in_progress:s}}}}),t&&n.push(t)}}QA(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=JA(e?.payload?.context);if(t){const n=[],r=t.context_data?.blocking_action_counter??0,a=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let s=t.context_data?.is_deferred_action_in_progress??!1;return a.length<=0&&!s&&(r<=0?(n.push(e),s=!s):a.push(e),n.unshift({type:Ca,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:a,blocking_action_counter:r,is_deferred_action_in_progress:s}}}}),QA(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=JA(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(QA({type:Ca,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 JA(e)?(QA({type:fs,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={...JA(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(QA({type:fs,payload:{context:e,isInitiateBlockingAction:!1}}),t.context_data.blocking_action_counter-=1,this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_OPERATION))}cancelDeferredActionsOnError(e){if(!e)return;const t=JA(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&hC.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),QA({type:Ca,payload:{context:e,data:{...n}}}),kp.disableLoadingIndicator({context:e})}}isDeferredActionInProgress(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=JA(e);return!(!t||!0!==t.context_data?.is_deferred_action_in_progress)}},Gg=(e,t)=>{const n={},r=ih.getLookUpDataPage(e),a=ih.getDataPageKeys(r);if(a)for(const e of a)n[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];return{dataViewParameters:n,dataPageID:r,dataPageKeys:a}},Wg=(e,t)=>{const n=ih.getSavableDataPage(e),r=ih.getDataPageKeys(n);return r?.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:r}},Hg=e=>{$d.publish(Ur.PUB_SUB_EVENTS.EVENT_CANCEL,e)},qg=(e,t,n)=>ry.shouldUseUnifiedHandling()||(e=>{if(e.includes(Fr.ACTIONAREA))return!0;const t=OE(e),n=VI(`${t}/${Fr.ACTIONAREA}`);return Boolean(n?.includes(Fr.ACTIONAREA))})(e)?ga:hy(t,n??!1),zg=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))},Yg=(e,t,n)=>n||t!==Fr.ACTION?e.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID):e.getValue(Ur.CASE_INFO.ASSIGNMENTACTION_ID);const Kg=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(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID))||e?.links?.open?.href?.split("/")?.[2];getSaveActionPayload=(e,t=!1,n=!1)=>{const r=e,a=r&&r.includes(Fr.MODAL),s=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_INFO_ID),o=this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),i=this.c11nEnv.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID)?this.c11nEnv.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID):this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENTACTION_ID),c=this.c11nEnv.getContainerName(),l=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_TYPE_ID),d=t?void 0:Xm(this.c11nEnv.getContextName()),u=this.c11nEnv.getValue("isProcessAction","isProcessAction");return AC.buildActionObject({context:r,containerItemID:e,assignmentID:o,actionID:i,caseID:s,containerName:c,caseType:l,isModalAction:a,isFormValid:d,isProcessAction:u,saveOnly:t,autosave:n},this.c11nEnv)};actionsApiPromise=(e,t,n=!0)=>{let r,a,s="";s=t&&null!==t.actionMgrID?t.actionMgrID||"":Vp.getNextActionMgrId();const o=new Promise(((e,t)=>{r=e,a=t}));if(!r||!a)throw new Error("resolveFn or rejectFn is not defined.");return Vp.register(s,o,r,a,e,t,n),{actionMgrID:s,promise:o}};showDataObjectCreateView(e,t=Ur.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=AC.buildActionObject({viewName:t,className:e},this.c11nEnv),r=na,{promise:a}=this.actionsApiPromise(r,n);return QA({type:r,payload:{...n,containerName:Ur.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(!yI(t)){return new uh(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=Xa,r=AC.buildActionObject({containerItemID:e,context:t},this.c11nEnv),a=t&&t.includes(Fr.MODAL);QA({type:n,payload:{...r,isModalAction:a,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:s}=this.actionsApiPromise(n,r);return s.then((()=>{Hg({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=KA()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(Fr.DATA_CLASS_NOT_FOUND));if(bA(Ur.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW)){const t=this.handleSubscript.call(this,e,this.c11nEnv);if(t)return t}const r=ih.getSavableDataPage(n),a=ys,s=!!e&&e.includes(Fr.MODAL),o=AC.buildActionObject({containerItemID:e,dataPageID:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(a,o);return QA({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:s,isFormValid:Xm(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=Is,r=ih.getSavableDataPage(e),a=ih.getDataPageKeys(r),s={};if(a)for(const e of a)s[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=AC.buildActionObject({dataViewName:r,dataViewParameters:s},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return QA({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 r=Es,{dataPageID:a,dataViewParameters:s}=Gg(e,t),o=AC.buildActionObject({dataLookUp:a,keyProperties:t,requestPayload:s,viewName:n.viewName||Ur.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:Fr.MODAL,readOnly:n.readOnly,actionName:n.actionName},this.c11nEnv),{promise:i}=this.actionsApiPromise(r,o);return QA({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}=KA()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(Fr.DATA_CLASS_NOT_FOUND));const{dataPageID:a,keys:s}=Wg(r,t),o=As,i=e&&e.includes(Fr.MODAL),c=AC.buildActionObject({containerItemID:e,dataPageID:a,key:s},this.c11nEnv),l=n[e]?.caseInfo?.headers?.etag,{promise:d}=this.actionsApiPromise(o,c);return QA({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:Xm(e),etag:l}}),d}openDataObjectAction(e,t,n,r){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(!r)return Promise.reject(new Error(this.MSG_ACTION_NAME_REQUIRED));const a=Cs,{dataViewParameters:s,dataPageID:o,dataPageKeys:i}=Gg(e,t),c=AC.buildActionObject({actionID:n,actionName:r,dataViewParameters:s,lookupDatapage:o,containerName:Fr.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(a,c);return QA({type:a,payload:{...c}}),l}submitDataObjectAction(e,t,n,r){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}=KA()?.getState()||{},s=a[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(Fr.DATA_CLASS_NOT_FOUND));const o=r?.jsActionQueryParams,i=OE(e),c=sE(i),l=vI(c,i)||{},{resourceType:d="",key:u=""}=l,p=Ss,{dataPageID:h,keys:g}=Wg(s,t),f=AC.buildActionObject({containerItemID:e,actionID:n,resourceType:d,key:u,keys:g,savableDatapage:h,containerName:Fr.MODAL,context:e,jsActionQueryParams:o},this.c11nEnv);f.context=e;const m=a[e]?.caseInfo?.headers?.etag,{promise:y}=this.actionsApiPromise(p,f);return QA({type:p,payload:{...f,isFormValid:Xm(e),etag:m}}),y}createWork(e,t={flowType:"",containerName:"",openCaseViewAfterCreate:!1,modalOptions:{dockable:!1},startingFields:Object,remoteCaseMeta:{},channelName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(e=Vr.getRemoteCaseClassBySourceClass(e)??e,window.pms?.plugins?.c11n?.createWork)return window.pms.plugins.c11n.createWork(e,Mr.getDefaultQualifiedName("pyStartCase"),t);const{dockable:n=!1}=t?.modalOptions||{};let r=t.theType?t.theType:(e=>{const t=ry.shouldUseUnifiedHandling();return ry.isExternalCaseType(e)?$s:ry.isExternalObject(e)?t?$s:"CREATE_EXTERNAL_OBJECT":t?ua:ry.isObjectCaseType(e)?"CREATE_OBJECT":ua})(e);const a=AC.buildActionObject({class:e,flowType:Mr.getDefaultQualifiedName("pyStartCase"),containerName:Fr.PRIMARY,openCaseViewAfterCreate:!0,...t,theType:r,modalOptions:{isDockable:n}},this.c11nEnv),{promise:s}=this.actionsApiPromise(r,a);if(a.headers={...a.headers},t.channelName?a.headers[Fr.X_ORIGIN_CHANNEL]=t.channelName:LE.isWSSPortal()&&(a.headers[Fr.X_ORIGIN_CHANNEL]="WSS"),r=this.handleRemoteCaseForCreateWork(e,a,r),wd.getPreviewMode()){a.debugInfo={debugId:hC.generateUniqueID()};const e=Yd.getCoreHeadersFromContext(a?.context||""),t=String(e?.debugInfo?.[Fr.COREHEADER_APP_DEBUG_ID]||"");t&&r!==ua&&(a.debugInfo={debugId:t})}return QA({type:r,payload:{...a}}),s}handleRemoteCaseForCreateWork(e,t,n){if(Vr.isRemoteCase(e)){const{RemoteClassName:n,RemoteSystemID:r,name:a}=Vr.getRemoteCase(e);if(t.className=e,t.class=n,Vp.setRemoteCaseHeaderByContext(t,r),Vr.isTraditionalRemoteCase(e)||Vr.isRemoteCaseVersionDifferent(e)){const r={className:e,name:a,action:Os,remoteClassName:n};return Vp.setTraditionalRemoteCaseParams(t,r)}}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=Na,r=AC.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:a}=this.actionsApiPromise(n,r);return QA({type:n,payload:{...r}}),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(),r=AC.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:a}=this.actionsApiPromise("GET_DESCENDANTS",r),s=(o={...r,context:n},{type:xg,payload:o});var o;return QA(s),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=Vr.getRemoteCaseClassBySourceClass(t)??t,window.pms?.plugins?.c11n?.openWorkByHandle)return window.pms.plugins.c11n.openWorkByHandle(e,t);const r={insKey:e,acTargetName:n.targetContainer||Fr.PRIMARY,containerName:n.targetContainer||Fr.PRIMARY};let a=ry.shouldUseUnifiedHandling()||!ry.isObjectCaseType(t)?pa:"GET_OBJECT";const s=AC.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(a,s);return s.headers={...s.headers},n.channelName?s.headers[Fr.X_ORIGIN_CHANNEL]=n.channelName:LE.isWSSPortal()&&(s.headers[Fr.X_ORIGIN_CHANNEL]="WSS"),s.className=t,Vr.isRemoteCase(t)&&(a=this.setRemoteCaseParamsForOpenCase(s,t,a,n.remoteCaseMeta)),wd.getPreviewMode()&&n.targetContainer!==Fr.WORKAREA&&(s.debugInfo={debugId:hC.generateUniqueID()}),QA({type:a,payload:{...n,...s}}),o}setRemoteCaseParamsForOpenCase(e,t,n,r={}){const{RemoteSystemID:a,RemoteClassName:s,name:o}=Vr.getRemoteCase(t);if(Vp.setRemoteCaseHeaderByContext(e,a),e.isRemoteCase=!0,e.remoteCaseClass=t,e.remoteCaseMeta=r,Vr.isTraditionalRemoteCase(t)||Vr.getRemoteAppPlatformVersion(a??"")){const n={className:t,name:o,action:vs,remoteClassName:s};return Vp.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=Vr.getRemoteCaseClassBySourceClass(t)??t,window.pms?.plugins?.c11n?.openAssignment)return window.pms.plugins.c11n.openAssignment(e,t);const r={assignmentID:e,doDeleteCaseSummary:!0,containerName:n.containerName,isActionFromToDoList:n.isActionFromToDoList,isChild:!1,...void 0!==n.renderInline&&{renderInline:n.renderInline},...void 0!==n.pageName&&{pageName:n.pageName}};n.isChild&&(r.containerName=Fr.PRIMARY,r.isChild=n.isChild);let a=th;const s=AC.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(a,s);if(s.headers=s.headers||{},n.channelName?s.headers[Fr.X_ORIGIN_CHANNEL]=n.channelName:LE.isWSSPortal()&&(s.headers[Fr.X_ORIGIN_CHANNEL]="WSS"),Vr.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:r,name:o}=Vr.getRemoteCase(t);if(Vp.setRemoteCaseHeaderByContext(s,r),s.remoteCaseMeta=n.remoteCaseMeta,Vr.isTraditionalRemoteCase(t)||Vr.getRemoteAppPlatformVersion(r??"")){const n={className:t,name:o,action:Ds,remoteClassName:e};a=Vp.setTraditionalRemoteCaseParams(s,n)}}s.className=t,s.activeItemCaseViewMode=this.c11nEnv.getValue("context_data.caseViewMode"),wd.getPreviewMode()&&![Fr.WORKAREA].includes(n.containerName)&&(s.debugInfo={debugId:hC.generateUniqueID()});const i={context:s.context||n.context,containerName:s.containerName||n.containerName,targetContainerName:s.containerName||n.containerName,viewType:s.viewType||n.viewType,skipBrowserSemanticUrlUpdate:n.skipBrowserSemanticUrlUpdate};return QA({type:a,payload:{...s,...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(Fr.ACTIONAREA)&&(e=VI(e)||e);const n=WI(e);let r=n;if(n?.includes(`/${Fr.WORKAREA}`)&&(r=n.substring(0,r?.lastIndexOf(`/${Fr.WORKAREA}`))),Zm(n)){const e=[{type:"error",message:this.c11nEnv.getLocalizationService().getLocalizedMessage(this.MSG_ACTIVE_SUGGESTION_UNATTENDED)}];return _d({messages:e,context:r,category:Ur.PAGE}),Promise.reject({type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR})}const a=t?.isTriggeredFromDifferentContext,{caseID:s,assignments:o,localActionID:i,caseActions:c,caseInfo:l,businessID:d,caseTypeID:u,caseTypeName:p}=gy(e,this.c11nEnv,{isTriggeredFromDifferentContext:a}),h=sy(l);let g,f=!1;const m=c?.find((e=>e.ID===i));m?f="Case"===m?.type:g=JA(n);let{assignmentID:y}=gy(e,this.c11nEnv,{isTriggeredFromDifferentContext:a});g?.context_data?.actionType&&(f=g.context_data.actionType===Fr.CASE,y=y||g.context_data.assignmentID);const I=py(o,y,i,l?.activeActionID),[E,A]=s.split(" "),C={class:E,actionID:I,assignmentID:y,caseID:s,workID:A,containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:f,doDeleteCaseSummary:!0,isInCreateStage:h,businessID:d,caseTypeID:u,caseTypeName:p};e?.includes(Fr.MODAL)&&(C.containerName=Fr.MODAL,C.isModalAction=!0),C.outcome=t.outcomeID,C.jsActionQueryParams=t.jsActionQueryParams,l?.isLocalAction&&(C.viewType=um.FORM);const S=qg(e,u,l?.isObjectWideAction),N=AC.buildActionObject(C,this.c11nEnv),{promise:_}=this.actionsApiPromise(S,N);return N.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||JA(n).context_data.isProcessAction,N.headers??={},LE.isWSSPortal()&&(N.headers[Fr.X_ORIGIN_CHANNEL]="WSS"),Bg.executeOrQueueDeferredAction({type:S,payload:{...N,context:n}}),_}getNextWork(){if("HYBRID"===LE.getRenderingMode())return $d.publish(Ur.PUB_SUB_EVENTS.CASE_EVENTS.GET_NEXT_WORK,{userIdentifier:LE.getOperatorIdentifier()}),Promise.resolve();const e=th,t=AC.buildActionObject({containerName:Fr.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return QA({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=th,n=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getCaseSummary().headers,a=AC.buildActionObject({containerName:this.c11nEnv.getContainerName(),isOpenStage:!0,stageID:e},this.c11nEnv),{promise:s}=this.actionsApiPromise(t,a),o={type:t,payload:{...a,caseID:n,headers:r}};return QA(o),s}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(Ur.CASE_INFO.CASES),r=this.c11nEnv.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID),a=this.c11nEnv.getValue(Ur.CASE_INFO.IS_ASSIGNMENT),s={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(Fr.MODAL)&&(s.containerName=Fr.MODAL,s.isModalAction=!0);const o=AC.buildActionObject(s,this.c11nEnv),{promise:i}=this.actionsApiPromise(t,o),c=WI(e);return QA({type:t,payload:{...o,context:c,cases:n,actionID:r,isAssignment:a,isFormValid:Xm(c),classID:this.c11nEnv.getCurrentClassID()}}),i}submitBulkActionAsync(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION_ASYNC",n=this.c11nEnv.getValue(Ur.CASE_INFO.CASES),r=this.c11nEnv.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID),a={containerName:e.includes(Fr.MODAL)?Fr.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(Fr.MODAL)},s=AC.buildActionObject(a,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,s),i=WI(e);return QA({type:t,payload:{...s,context:i,cases:n,actionID:r,isFormValid:Xm(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:r}=t,a=t.type,s={selectedList:n,vcName:t.target,actionName:t?.name,actionID:e,doDeleteCaseSummary:!0,localActionType:a,runningMode:r,...t},o="OPEN_BULK_ACTION",i=AC.buildActionObject(s,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return QA({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 uh(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(QA({type:Xr,payload:{reference:Ur.CASE_INFO.APPROVALFLAG,value:Fr.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)):(QA({type:Xr,payload:{reference:Ur.CASE_INFO.APPROVALFLAG,value:Fr.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(Ur.CASE_INFO.DUPLICATECASEINSKEY).split(" "),n={type:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEFLAG,value:Fr.DUPLICATE,context:e}},r={type:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return QA([n,r]),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:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEFLAG,value:Fr.IGNORE,context:e}},n={type:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEID,value:"",context:e}},r={type:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEINSKEY,value:"",context:e}};return QA([t,n,r]),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,zg(window.pms.plugins.c11n.openLocalAction,e,t);const r=t.assignKey||this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),a=t.type,s={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,localActionType:a,...t},o=t.containerName===Fr.ACTIONAREA?Ea:(e=>ry.shouldUseUnifiedHandling()||"Object"!==e.type&&!ry.isObjectCaseType(e?.caseClassName||"")&&!window.location.href.includes("/objects/")?Ea:"OPEN_OBJECT_ACTION")(t),i=AC.buildActionObject(s,this.c11nEnv);t.containerName!==Fr.ACTIONAREA&&t.containerName!==Fr.WORKAREA||(i.skipMergeAssignmentsAndActions=!1);const{promise:c}=this.actionsApiPromise(o,i),l=this.c11nEnv.getContextName(),d=zI(l)[0];let u;if(u=VI(d),u?.includes("actionarea")&&o===Ea)return QA({type:o,payload:{...i}}),c;if("Object"===t.type)return QA({type:o,payload:{...i}}),c;const p=VI(d),h=n!==this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID))&&p&&Vr.getRemoteHeaderByContext(p)||Vr.getRemoteHeaderByContext(l);if(Vp.setRemoteCaseHeaderByContext(i,h),!d)return u=l,QA({type:o,payload:{...i,contextName:l,continueExecution:!1}}),c;const{continueExecution:g,containerItemID:f}=DI(l,n,d);if(u=f,!g||u&&"review"===KA()?.getState()?.data[u]?.context_data?.caseViewMode)return QA({type:o,payload:{...i,contextName:l,continueExecution:g}}),c;const m=u,y=m&&m.includes(Fr.MODAL),I=t.assignKey||this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),E=JA(u),A=E?.caseInfo?.assignments?E.caseInfo.assignments[0]?.actions[0]?.ID:void 0,C=this.c11nEnv.getContainerName(),S=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_TYPE_ID),N=this.c11nEnv.getValue("isProcessAction","isProcessAction"),_=AC.buildActionObject({context:m,containerItemID:u,assignmentID:I,actionID:A,caseID:n,containerName:C,caseType:S,isModalAction:y,isFormValid:!0,isProcessAction:N},this.c11nEnv);_.context=u;const b=WI(u),T=this.c11nEnv.getCaseSummary(),P=sy(T),O=AC.buildActionObject({caseID:n,containerItemID:u,cancelContext:b},this.c11nEnv);let D={};return y?(O.acTargetName=Fr.MODAL,O.isInCreateStage=P,O.isModalAction=y,D={...O}):D={...O,acName:js(this.c11nEnv.getContainerName(),O.context)},QA({type:o,payload:{...i,contextName:l,saveActionPayload:_,cancelActionPayload:D,continueExecution:g}}),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(Ur.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,zg(window.pms.plugins.c11n.openProcessAction,e,t);const r=this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID)||t.assignKey,a=t.type,s={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,processActionType:a,isProcessAction:!0,...t},o=eh,i=AC.buildActionObject(s,this.c11nEnv),c=this.c11nEnv.getContextName(),l=zI(c)[0];let d=Vr.getRemoteHeaderByContext(c);if(!d&&l){const e=OI(l);e?.accessedOrder.forEach((r=>{(t.caseID||n)===e.items[r].key&&(d=Vr.getRemoteHeaderByContext(e.items[r].context))}))}Vp.setRemoteCaseHeaderByContext(i,d);const{promise:u}=this.actionsApiPromise(o,i),{containerItemID:p}=DI(c,n,l);return QA({type:o,payload:{...i,saveContainerItemID:p}}),u}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=Ia,r=this.c11nEnv.getValue(Ur.NEXT_ASSIGNMENT_INFO_ID)?this.c11nEnv.getValue(Ur.NEXT_ASSIGNMENT_INFO_ID):this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),a=sy(this.c11nEnv.getCaseSummary()),s=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_INFO_ID),o={ID:r,stepID:e,acTargetName:this.c11nEnv.getContainerName(),targetContainerName:this.c11nEnv.getContainerName(),containerItemID:t,doDeleteCaseSummary:!0,isInCreateStage:a,caseID:s};t&&t.includes(Fr.MODAL)&&(o.acTargetName=Fr.MODAL);const i=AC.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=WI(t);return QA({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}=Ur,r=ma,a=WI(e),s=e&&e.includes(Fr.MODAL),o=this.c11nEnv.getCaseSummary(),i=sy(o),c=this.c11nEnv.getValue(Fr.getProperty(n.CASE_INFO_ID)),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),d=AC.buildActionObject({caseID:c,containerItemID:e,context:a},this.c11nEnv);let u={};s?(d.acTargetName=Fr.MODAL,d.isInCreateStage=i,d.isModalAction=s,u={...d}):u={...d,acName:js(this.c11nEnv.getContainerName(),d.context)};const{promise:p}=this.actionsApiPromise(r,d);return QA({type:r,payload:u}),p.then((()=>{t||Hg({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}=Ur,n=e,r=Xa,a=e&&e.includes(Fr.MODAL),s=this.c11nEnv.getValue(t.CASE_INFO_ID),o=AC.buildActionObject({caseID:s,containerItemID:e,context:n},this.c11nEnv);if(!yI(n)){return new uh(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{jg(s),Hg({caseID:s,context:this.c11nEnv.getContextName()})}))}QA({type:r,payload:{...o,isModalAction:a}});const{promise:i}=this.actionsApiPromise(r,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}=Ur,n=Xa,r=e,a=r&&r.includes(Fr.MODAL),s=this.c11nEnv.getCaseSummary(),o=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_TYPE_ID)),i=sy(s),c=this.c11nEnv.getValue(Fr.getProperty(t.CASE_INFO_ID)),l=AC.buildActionObject({caseID:c,containerItemID:e,context:r},this.c11nEnv),d=this.c11nEnv.getValue("isProcessAction","isProcessAction"),u=LE.isCoexistenceAppOfType(Fr.APP_TYPE.UIKIT);l.isProcessAction=d;const p=LE.getRenderingMode();if(i&&(a||u||"EMBED"===p)&&!ay(s)){const t=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.IS_FIRST_ASSIGNMENT)),c=yI(r);if(this.shouldDeleteCaseInCreateStage(c,t,u)){const t=!0===Boolean(ry.isExternalObject(o));return this.deleteCaseInCreateStage(e,t)}QA({type:n,payload:{...l,isModalAction:a,isChildCase:dy(s),isInCreateStage:i}})}const{promise:h}=this.actionsApiPromise(n,l);return h.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=rh,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return Bg.executeOrQueueDeferredAction(ah(n)),r}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=rh,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return QA(ah(n)),r}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=nh,r=e,a=r&&r.includes(Fr.MODAL),s=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID)),o=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_TYPE_ID)),i=AC.buildActionObject({caseID:s,caseType:o,containerItemID:e,context:r,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.PARENTCASEINFO));i.isProcessAction=c,i.parentCaseInfo=l;const d=`${Fr.APP.APP}/${bI.PRIMARY}`,u=Sm(d,bI.PRIMARY);i.parentContext=u,a&&(i.targetName=Fr.MODAL,i.containerName=bI.MODAL,i.isModalAction=a),QA((e=>({type:nh,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Hg({caseID:s,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}=wE.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=an()+t;return au(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:a}=wE.getRestEndPoint("updateRecents")||{},s=`${an()}${a}`;return au(s,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=wE.getRestEndPoint("Logout")||{},t=`${an()}${e}`;return au(t,{method:"GET",headers:{}}).then((e=>(Object.keys(md.rootNodes).forEach((e=>{$g.cleanCaches(e)})),md.rootNodes={},sessionStorage.clear(),dC(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return au(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,Mr.getDefaultQualifiedName("pyCasePreview"),{container:bI.PREVIEW,containerName:bI.PREVIEW,context:Ur.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(Mr.getDefaultQualifiedName("pyDataPreview"),e,t,{container:bI.PREVIEW,containerName:bI.PREVIEW,context:Ur.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 r=AC.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_TYPE_ID)),RemoteSystemID:Vr.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),r={...r,...n}):r={...r,containerName:this.c11nEnv.getContainerName()};const a=ta,{promise:s}=this.actionsApiPromise(a,r,!1);return QA({type:a,payload:{...r}}),s}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 r=AC.buildActionObject({viewName:e,className:t},this.c11nEnv),a=na,{promise:s}=this.actionsApiPromise(a,r);return wd.getPreviewMode()&&(r.debugInfo={debugId:hC.generateUniqueID()}),QA({type:a,payload:{...r,...n,containerName:n.containerName||this.c11nEnv.getContainerName(),skipSemanticUrl:n.skipSemanticUrl}}),s}showInsight(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_INSIGHTID_REQUIRED));const n=AC.buildActionObject({},this.c11nEnv),r=aa,{promise:a}=this.actionsApiPromise(r,n);return QA({type:r,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=AC.buildActionObject({},this.c11nEnv),r=sa,{promise:a}=this.actionsApiPromise(r,n);return QA({type:r,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,dashboardID:e}}),a}showData(e,t,n,r={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=AC.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:Vr.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),s=ra;r?.containerName||(r.containerName="HYBRID"===LE.getRenderingMode()?Mg.getRuntimeParam(Fr.HYRBID_ROOT_CONTAINERNAME):Gp.getTargetViewContainerName(s));const{promise:o}=this.actionsApiPromise(s,a);return QA({type:s,payload:{...a,...r,skipSemanticUrl:Boolean(r.skipSemanticUrl)}}),o}changeHandler(e,t){AC.changeHandler(e,t)}eventHandler(e,t){AC.eventHandler(e,t)}triggerFieldChange(e,t,n=!1,r={skipDirtyValidation:!1,skipPageInstructionGeneration:!1}){const a=this.c11nEnv.getContextName(),s=this.c11nEnv.getPageReference(),o=yC.getContextPath(s,e);n||this.c11nEnv.getValidationApi().validate(t),this.c11nEnv.isInsideList()&&!r.skipPageInstructionGeneration&&this.c11nEnv.getListActions().updateProperty(e,t,r);let i=this.c11nEnv.getValue(Fr.CLASS_ID);const c=e?e.split(".").filter((e=>!!e)):[];c.length>1&&(c.pop(),i=eC(`.${c.join(".")}.classID`,s,a)),e=hC.trimDotForProperty(e),QA({type:ea,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:r=!1,isArrayDeepMerge:a=!0,contextPageReference:s="",isListEntry:o=!1,skipDirtyValidation:i=!1,associatedProperty:c,skipPageInstructionGeneration:l=!1}=n,d=this.c11nEnv.getContextName();let u=this.c11nEnv.getPageReference();const p=s?.startsWith(u)?s.replace(u,""):s;u=s||u;const h=yC.getContextPath(u,e);let g=!1;this.c11nEnv.isInsideList()&&!l&&this.c11nEnv.getListActions().updateProperty(p?`${p}${e}`:e,t,{isArrayDeepMerge:a,skipDirtyValidation:i}),this.c11nEnv.isBulkAction()&&(g=!0),e||(e=this.c11nEnv.getStateProps().value),Nd({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:u,context:d,isListEntry:o}),QA({type:Xr,payload:{reference:h,value:t,context:d,isArrayDeepMerge:a,skipDirtyValidation:i,...g&&{isStrictTracking:g},...r&&{removePropertyFromChangedList:r},...c&&{associatedProperty:`${u}${c}`}}})}activateModalContainerItem(e){const t=Va,{context:n}=e,r=n&&n.includes(Fr.MODAL),a=AC.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);r&&(a.containerName=Fr.MODAL,a.isModalAction=r),QA({type:t,payload:a});const{promise:s}=this.actionsApiPromise(t,a);return s}refreshCaseView(e,t,n,r={}){const{promise:a,actionMgrID:s}=this.actionsApiPromise("REFRESH_DATA"),{autoDetectRefresh:o,propertyName:i,preserveClientChanges:c,classID:l,context:d,optionalPayload:u,isArrayDeepMerge:p}=r,h={actionMgrID:s,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,isArrayDeepMerge:p,optionalPayload:u};r.refreshFor&&(h.refreshFor=r?.refreshFor),r.resetForm&&(h.resetForm=r?.resetForm),r.skipPayloadGeneration&&(h.skipPayloadGeneration=r?.skipPayloadGeneration);const g=d||this.c11nEnv.getContextName(),f=this.c11nEnv.getPageReference(),m=this.c11nEnv.getValue(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW),{isMultiRecordData:y,editType:I}=m||{};if(o&&y&&I===Fr.ACTION){const t=this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),{actionID:n,interestPage:r,interestPageActionID:a,isLocalAction:s}=m;Cy(e,t,n,g,r,a,s,y,I,h)}else!y&&o&&(ly(g,f)||iy(g,f))?Oy(g,n,h):Ay(e,t,g,n,h);return a}refreshEmbeddedDataWithAction(e,t,n,r,a,s,o,i,c={}){const{promise:l}=this.actionsApiPromise(wg.REFRESH_DATA),d=this.c11nEnv.getContextName();return Cy(e,t,n,d,r||this.c11nEnv.getPageReference(),a,s,o,i,c),l}openEmbeddedDataModal(e,t,n,r,a,s,o,i,c=!1,l=Ur.MODAL){const d=Ns;let u=t.getCaseInfo().getKey();const p=t.getValue(Ur.CASE_INFO.IS_LOCAL_ACTION),h=t.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),g=Yg(t,o,p),f=t.getPageReference();let m="string"==typeof r?`${t.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${r}`:`${t.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"")}${n}[${r}]`;f.startsWith(Ur.OBJECT_INFO.OBJECT_INFO)&&!u&&(u=t.getCaseInfo().getObjectKey(),m=`${t.getPageReference().replace(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT,"")}${n}[${r}]`);const y=t.getMetadata(),I=Array.isArray(y?.config?.children)&&y.config.children[0]?.children||[],E={readOnly:c,targetProperty:n,index:r,viewID:e,ID:u,actionType:a,interestPage:hC.convertPageRefToClipboardPageNotation(m),heading:s,editType:o,interestPageActionID:o===Fr.ACTION?i:void 0,actionID:g,isLocalAction:p,operationFlag:Fr.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof r,assignmentID:p||o!==Fr.ACTION?void 0:h,columns:I},A=AC.buildActionObject(E,this.c11nEnv);if(o===Fr.ACTION){const e=hC.getETag(A.context);A.headers={"If-Match":e}}const{promise:C}=this.actionsApiPromise(d,A);return LE.getFeatureMap().granularUIRefresh&&I.forEach((e=>{const n=_o.trimAnnotation(e.config.value),r=fA(n.startsWith(".")?n.replace(".",""):n,e.config.classID);r&&!Array.isArray(r)&&r.isDeclarativeTarget&&md.addFieldNode(t.getContextName(),f+m,t.viewName??"",n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:f+m})})),QA({type:d,payload:{...A,containerName:l,skipSemanticUrl:!0}}),C}getEmbeddedDataView(e,t,n,r,a,s="",o="",i=!1,c=""){const l=_s;let d=t.getCaseInfo().getKey();const u=t.getValue(Ur.CASE_INFO.IS_LOCAL_ACTION),p=t.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),h=Yg(t,s,u),g=t.getPageReference();let f="string"==typeof r?`${t.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${r}`:`${t.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"")}${n}[${r}]`;g.startsWith(Ur.OBJECT_INFO.OBJECT_INFO)&&!d&&(d=t.getCaseInfo().getObjectKey(),f=`${t.getPageReference().replace(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT,"")}${n}[${r}]`);const m={readOnly:i,targetProperty:n,index:r,viewID:e,ID:d,actionType:a,interestPage:hC.convertPageRefToClipboardPageNotation(f),editType:s,interestPageActionID:s===Fr.ACTION?o:void 0,actionID:h,isLocalAction:u,operationFlag:Fr.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof r,assignmentID:u||s!==Fr.ACTION?void 0:p,containerName:c},y=AC.buildActionObject(m,this.c11nEnv);if(s===Fr.ACTION){const e=hC.getETag(y.context);y.headers={"If-Match":e}}const{promise:I}=this.actionsApiPromise(l,y);return QA({type:l,payload:{...y,skipSemanticUrl:!0}}),I}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=bs;let n=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID));const r=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.ASSIGNMENT_ID));let a=this.c11nEnv.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"");const s=WI(e),o=this.c11nEnv.getValue(Fr.getProperty(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW)),{interestPageActionID:i,editType:c,isLocalAction:l,actionID:d,viewName:u,parentContext:p}=o;a.startsWith(Ur.OBJECT_INFO.OBJECT_INFO)&&!n&&(n=this.c11nEnv.getValue(Ur.OBJECT_INFO.OBJECT_INFO_ID),a=this.c11nEnv.getPageReference().replace(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT,"")),Nd({context:s,stateObj:JA(s),clearContextMessages:!0});const h={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:n,viewID:u,isFormValid:Xm(s),interestPage:hC.convertPageRefToClipboardPageNotation(a),parentContext:p,isModalAction:!1,target:this.c11nEnv.getTarget(),editType:c,actionID:d,operationFlag:Fr.EMBEDDED_DATA_MODAL.SUBMIT_ROW,interestPageActionID:i,isLocalAction:l,assignmentID:r};e&&e.includes(Fr.MODAL)&&(h.containerName=Fr.MODAL,h.isModalAction=!0);const g=AC.buildActionObject(h,this.c11nEnv);if(c===Fr.ACTION){const e=hC.getETag(g.context);g.headers={"If-Match":e}}const{promise:f}=this.actionsApiPromise(t,g);if(yI(s)){const[e,t,n]=rd(this.c11nEnv.getPageReference());md.mutatePageList(p,e,t,{type:cs,rowIndex:n}),QA({type:cs,payload:{pageReference:this.c11nEnv.getPageReference(),context:p,isListEntry:!0}})}return Bg.executeOrQueueDeferredAction({type:t,payload:{...g,context:s}}),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=WI(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:a}=this.actionsApiPromise(Ps);return Oy(t,n,{actionMgrID:a,isFillFormWithAI:!0,preserveClientChanges:!1}),r}handleSubscript(e,t){if(!bA(Ur.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW))return Promise.reject(new Error(this.MSG_SUBSCRIPT_VIEW_REQUIRED));const n=Ts,r=AC.buildActionObject({containerItemID:e},t);QA({type:n,payload:{...r,isDataObject:!0,skipReleaseLockRequest:!0,isFormValid:Xm(e),context:e}});const{promise:a}=this.actionsApiPromise(n,r);return a}showSubscriptCreateView(e,t,n,r=Ur.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW){const a=AC.buildActionObject({viewName:r,className:e,referenceListStr:t,subscriptName:n},this.c11nEnv),s=na,{promise:o}=this.actionsApiPromise(s,a);return QA({type:s,payload:{...a,containerName:Ur.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),o}deleteWork(e,t,n){if(!e)return Promise.reject(new Error("workId is required parameter"));const r=xs,a=ry.isExternalCaseType(t),s=AC.buildActionObject({workId:e,caseTypeID:t,isExternalCase:a,...n?.skipDeleteConfirmation&&{skipDeleteConfirmation:!0},...n?.enableBackNavigation&&{enableBackNavigation:!0}},this.c11nEnv),{promise:o}=this.actionsApiPromise(r,s);return QA(oh({...s})),o}deleteDataRecord(e,t){if(!e)return Promise.reject(new Error("className is required parameter"));if(!t)return Promise.reject(new Error("keys is required parameter"));const n=xs,r=AC.buildActionObject({className:e,keys:t},this.c11nEnv),{promise:a}=this.actionsApiPromise(n,r);return QA(oh({...r})),a}};const Qg=class{constructor(e){this.c11nEnv=e}buildRemoteCaseHeaders(e,t){const n={};if(e){const r=Vr.getRemoteCaseClassBySourceClass(e)??e;Vr.injectRemoteCaseHeader(n,{caseTypeID:r},t)}return n}async getCaseStages(e,t,n){const r={caseID:e},{restApi:a,reqType:s}=mS("getCaseStages",r),{caseTypeID:o}=n||{},i=this.buildRemoteCaseHeaders(o,t);return(await au(a,{method:s,headers:i},t)).data.stages}async getCaseActions(e,t,n){const r={caseID:e},{restApi:a,reqType:s}=mS("getActions",r),{caseTypeID:o}=n||{},i=this.buildRemoteCaseHeaders(o,t);return(await au(a,{method:s,headers:i},t)).data}getCaseTypeName(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_TYPE_NAME))}getName(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_NAME))}getClassName(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_TYPE_ID))}getAvailableProcesses(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.AVAILABLEPROCESSES))}getKey(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ID))}getObjectKey(){return this.c11nEnv.getValue(Fr.OBJECT_INFO.OBJECT_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ASSIGNMENT_ID))}getActions(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTION_BUTTONS))}getActiveFlowActionID(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTIVE_ACTION_ID))||this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ASSIGNMENTACTION_ID))}getParentCaseInfo(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.PARENTCASEINFO))}isPerform(){return this.c11nEnv.getValue(`${Fr.CONTEXT_DATA}${Fr.CASE_VIEW_MODE_PROP}`)===Fr.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${Fr.CONTEXT_DATA}${Fr.CASE_VIEW_MODE_PROP}`)===Fr.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO));return sy(e)}isReviewAfterCreateStage(){if(!this.isReview())return!1;const e=this.c11nEnv.getContextName(),t=YI(e)[0];if(!t)return!1;const n=KA()?.getState().data[t]?.caseInfo?.stages;if(!Array.isArray(n))return!1;const r=[...n].reverse().find((e=>"object"==typeof e&&null!==e&&"visited_status"in e&&"transitionType"in e&&"completed"===e.visited_status));return"create"===r?.transitionType}isLocalAction(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO));return ay(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===Fr.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),r=vI(t,n),{config:a}=t&&n?r&&r.view:this.c11nEnv.getMetadata();e=a?.type===Fr.VIEW?a?.name:null}(e&&e.startsWith(Fr.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(Mr.getQualifiedNameForComplexRuleReferences(Fr.getProperty(Fr.CASE_INFO.VIEW_NAME))))}return e}getValueByPath(e,t){let n=e;if((t=t.replace("@P ","").trim()).includes(Mr.getDefaultQualifiedName("pyViewContext"))){const t=e.caseInfo?.content??{},r=t[Mr.getDefaultQualifiedName("pyViewContext")];if(!r)return n.caseInfo.content;if("string"==typeof r&&r.includes("(")&&r.includes(")")){const e=r.substring(1,r.indexOf("(")),n=parseInt(r.substring(r.indexOf("(")+1,r.indexOf(")")),10)-1;if(Array.isArray(t[e]))return t[e][n]}}const r=t.split(/[.[\]]/).filter((e=>e));for(const e of r)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=vI(e,t),{config:r}=e&&t&&n?n.view:this.c11nEnv.getMetadata(),a=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO)),s=r?.type===Fr.VIEW?r.context:null;if(s){const e=this.getValueByPath({caseInfo:a},s);if("object"==typeof e&&null!==e&&"classID"in e)return e.classID}return null}getActionRefreshConditions(){if(this.c11nEnv.getValue(Fr.getProperty(Fr.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)))return this.c11nEnv.getValue(Fr.getProperty(Fr.EMBEDDED_DATA_MODAL.REFRESH_CONDITIONS));const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTIVE_ACTION_ID)),t=Wr(this.c11nEnv.getContextName());let n;t&&(n=JA(t));const r=n?.caseInfo?.availableActions,a=JA(this.c11nEnv.getContextName()),s=a?.caseInfo?.refreshConditions;if(e){if(r){const t=r.find((t=>t.ID===e));return t?t.refreshConditions:s}return s}return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTION_REFRESH_CONDITIONS))}getBusinessID(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.BUSINESS_ID))}getAssignments(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO))?.assignments}getChildAssignments(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO))?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTIVE_ACTION_ID)),t=this.c11nEnv.getValue(Fr.getProperty(Fr.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(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ASSIGNMENT_LABEL)),n=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS))||[],r=this.getChildAssignments()||[];let a=JSON.parse(JSON.stringify(r));a=a.map((e=>(e.isChild=!0,e)));const s=[...n,...a];let o=JSON.parse(JSON.stringify(s));return e&&!this.isPerform()&&(o=o.map((e=>(e.name=this.getActiveCaseActionName()||e?.name||t,e)))),o}getActiveCaseActionName(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTIVE_ACTION_ID)),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ACTIONS));return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.GETNEXTWORK))}isObjectWideAction(){const e=this.c11nEnv.getValue(Fr.OBJECT_INFO.OBJECT_INFO);return ay(e)}getCaseCollaborators=(e=!0)=>{const t=this.c11nEnv.getValue(Fr.CASE_INFO.CASE_INFO_COLLABORATORS)||[];if(e){const e=LE.getOperatorIdentifier();return t.filter((t=>t.ID!==e))}return t}};const Jg=class{constructor(e){this.c11nEnv=e}getContextKey(){return this.c11nEnv.getValue(Fr.getProperty(Fr.DATA_INFO.DATA_INFO_CONTEXT_KEY))}};class Xg{constructor(e){Xg._instance=this,this.context=`${e}/${Fr.SUGGESTION}`,KA()?.getState().data?.[this.context]||QA({type:Ga,payload:{context:this.context,data:{}}})}getField(e){return eC(e,"",this.context)}setField(e,t){QA({type:Xr,payload:{reference:e,value:t,context:this.context}})}removeField(e,t={}){QA({type:Sa,payload:{reference:e,context:this.context,...t}}),$d.publish(Fr.PUB_SUB_EVENTS.SUGGESTION_PROCESSED,{reference:e,context:this.context,...t})}setState(e){QA(_C({context:this.context,data:e,isArrayDeepMerge:!0}))}}const Zg=Xg;const ef=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=XA();return n?hC.getIn(n,t):null}static setSharedState(e,t){e&&QA(rS({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:a=!0,pageReference:s,removePropertyFromChangedList:o=!1,skipDirtyValidation:i=!1}=r;if(!e||!t)return;QA(aS({context:e,reference:s?`${s}.${t}`:t,value:n,isArrayDeepMerge:a,removePropertyFromChangedList:o,skipDirtyValidation:i}))}static getSuggestionsContext(e){return new Zg(e)}static triggerRefresh(e,t){Dy({context:e,pageReference:t})}};class tf{static getParagraphStream(e,t,n){return((e,t,n)=>{if(!e)return e;const r=(new DOMParser).parseFromString(e,"text/html"),a=r.querySelectorAll("pega-reference");for(const e of a){const n=e.getAttribute("data-rule-id");if(n){const a=t.getValue(n),s=r.createTextNode(a??"");e.replaceWith(s),t.registerAdditionalProps({[n]:`@P ${n}`})}else e.replaceWith("")}let s;return s="simple"===n?r?.body?.textContent||"":r?.body?.innerHTML||"",/^(<p>)\s*(<\/p>)$/.test(s)?null:s})(e,t,n)}static isDecisionParagraph(e,t){const n=xA(e,t);return!!n?.useDecision}static processParagraph(e,t){const n=t.getCurrentClassID(),r=xA(e,n);let a;if(r?.useDecision){const n=r.dynamicContents.length;for(let s=0;s<n-1;s+=1)if(yC.resolveWhen(r.dynamicContents[s].when,t)){a=r.dynamicContents[s],e=`${e}#${a.when}`;break}a||(a=r.dynamicContents.pop())}else a=r;const s=r?.definedOnClassID,o=VE().getParagraphLocaleValue(s||n,e);return o?tf.getParagraphStream(o.content,t,o?.category):a?.content?tf.getParagraphStream(a.content,t,a?.category):null}static processBannerDecisionParagraph(e,t){const n=t.getCurrentClassID(),r=xA(e,n);let a;if(r?.useDecision){const n=r.dynamicContents.length;for(let s=0;s<n-1;s+=1)if(yC.resolveWhen(r.dynamicContents[s].when,t)){a=r.dynamicContents[s],e=`${e}#${a.when}`;break}a||(a=r.dynamicContents.pop())}else a=r;const s=r?.definedOnClassID,o=VE().getParagraphLocaleValue(s||n,e);let i=null;return o?i=tf.getParagraphStream(o.content,t,o.category):a?.content&&(i=tf.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(),r=xA(e,n);return{useDecision:r?.useDecision,isBanner:r?.isBanner,messageType:r?.messageType,dismissBanner:r?.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(),r=xA(e,n);return!(!r?.useDecision||!r?.dynamicContents)&&r.dynamicContents.some((e=>e.isBanner))}}const nf=tf;class rf{constructor(e){this.fieldType=e}applyFallback(e){const t=Wu.getDefaultsforType(this.fieldType);e.currencyISOCode=e.currencyISOCode||t?.currencyISOCode||"USD"}}class af{static getStrategy(e){switch(e){case"Currency":case"Decimal":case"Integer":case"Percentage":return new rf(e);default:return}}}const sf="DATAPAGE",of="VIEW",cf="FIELD",lf="CASE",df="PARAGRAPH",uf=(e,t,n,r)=>{const a=[of,cf,df],s=[sf,df].includes(e)&&r?`#${r}`:"",o=e===sf?"@BASECLASS":n;return e===sf||a.includes(e)?`${o}!${e}!${t}${s}`.toUpperCase():`${e}!${t}${s}`.toUpperCase()};class pf{static COMMON_LABELS="COMMONLABELS";static MESSAGES="MESSAGES";static COMPONENT_FIELDS="COMPONENTFIELDS";lookupList=[];constructor(e,t){this.localeReference=t,this.locale=e}getLocalizedText(e,t){const n=[...this.localeReference?[this.localeReference.toUpperCase()]:[],...this.lookupList,pf.COMPONENT_FIELDS,pf.COMMON_LABELS],r=this.#o(e,n)||e;return(t?this.#i(r,t):r)||e}getLocalizedMessage(e,t){const n=this.#o(e,[pf.MESSAGES,pf.COMMON_LABELS])??e;return(t?this.#i(n,t):n)||e}getLocalizedDataPage(e,t,n,r){if(!t||!n||!e)return e;const a=[uf(sf,t,void 0,n),pf.COMMON_LABELS,...this.lookupList],s=this.#o(e,a)??e;return(r?this.#i(s,r):s)||e}#i(e,t){return 0===t.length?e:e.replace(/\{(\d+)\}/g,((e,n)=>t[""+(Number(n)-1)]??e))}#o(e,t=this.lookupList){if(0===t.length)return;const n=mA(this.locale);for(const r of t){const t=this.#c(e,n.localeStore[r]);if(t)return t}}#c(e,t={}){const n=t[e];if("string"==typeof n)return n}setLookupList(e){Array.isArray(e)&&(this.lookupList=e)}}const hf=e=>Lr.getNeedsMapping()||e?.info===Ur.OBJECT_INFO.OBJECT_INFO?Ur.OBJECT_INFO.OBJECT_INFO:Ur.CASE_INFO.CASE_INFO,gf=(e,t)=>{const n=hf(t);e.data=e.data??{};const{assignments:r,availableActions:a=[]}=e.data[n]??{};if(r&&Array.isArray(r)&&r.length>0&&r[0].actions&&Array.isArray(r[0].actions)&&!t?.stopMergeActions){r[0].actions.forEach((e=>{"Assignment"!==e.type&&"LocalAction"!==e.type||a.push(e)})),e.data[n]=e.data[n]??{},e.data[n].availableActions=a}},ff=(e,t)=>{const n=hf(t),r=am();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===r||r||gf(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:s,navigation:o,settings:i},nextAssignmentInfo:c}=a;if(s&&s.main&&(s.main=s.main.map((e=>"createWork"===e.jsAction?{...e,jsAction:"createCase"}:e))),a.data&&a.data[n]&&(s&&(a.data[n].actionButtons=s),o&&(a.data[n].navigation=o),i&&(a.data[n].settings=i),t&&t[Ur.ACTIONS.DELETEAVIALACTIONS]&&delete a.data[n].availableActions,void 0===r||r||gf(a,t),e.confirmationNote)){const{confirmationNote:e}=a,t=[e];a.data.caseMessages=t}return t&&t.isCreateDataObject&&(a.data=a.data??{},a.data.dataInfo={},a.data.dataInfo.content=a.data.pyPortal,a.uiResources.root.config.context="dataInfo.content",a.uiResources.context_data.dataInfo=a.uiResources.context_data.dataInfo??{},a.uiResources.context_data.dataInfo.content=a.uiResources.context_data.dataInfo.content??{},a.uiResources.context_data.dataInfo.content=a.uiResources.context_data?.pyPortal,delete a.data.pyPortal,delete a.key),c&&(a.data=a.data??{},a.data.nextAssignmentInfo=c),a},mf=async e=>{const t=ff(e),n=hC.getIn(t,Fr.COMPONENTS);up(t,{},!0),await $p(n)},yf=(e,t,n)=>yC.resolveView(e,t,n),If=(e,t,n,r)=>{const a=e[t];if(!a)return!1;const s=hC.getIn(a,Ur.CASE_INFO.CASE_INFO_CLASSID);return hC.getIn(a,Fr.CASE_INFO.VIEW_NAME)===n&&(!r||s===r)},Ef=e=>{const{accessedOrder:t,items:n}=e;if(!t||!n)return null;const r=t[t.length-1];return r?n[r]?.context??null:null},Af=(e,t="",n="")=>{let r=n||null;if(!r){const n=`${Ur.APP.APP}/primary`;r=((e,t)=>{const n=KA();if(!n)return null;const r=n.getState(),{data:a,containers:s}=r;if(!s||!a)return null;const o=`${Ur.APP.APP}/primary`;if(s[o]){const n=Ef(s[o]);if(n&&If(a,n,e,t))return n}for(const n of Object.keys(s)){if(n===o)continue;const r=Ef(s[n]);if(r&&If(a,r,e,t))return r}return null})(e,t),r||(r=HI(n))}if(!r)return Promise.reject(new Error(`Unable to find an active context for view "${e}".`));const a=JA(r);if(!a)return Promise.reject(new Error(`No data found for context "${r}".`));const s=hC.getIn(a,Ur.CASE_INFO.CASE_INFO_ID)||"",o=Rf({options:{context:r,pageReference:Ur.CASE_INFO.CASE_INFO_CONTENT}});return CA(),o.getPConnect().getActionsApi().refreshCaseView(s,e,"",{autoDetectRefresh:!0,preserveClientChanges:!1}).finally((()=>{SA()}))};let Cf=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 Sf=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=yC.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=yC.getContextPath(this.datasource,this.index);return this.index+=1,Rf({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class Nf{constructor(e,t){this.children=e,this.index=0,this.options=t}hasNext(){return this.index<this.children.length}next(){if(!this.hasNext())throw new Error("No Children");const e=this.index,t=this.children[e];this.index+=1;const n=t?._relativePath??`${this.options?.relativePath??""}.children[${e}]`;return Rf({meta:t,index:this.index,options:{...this.options,relativePath:n}})}resetIndex(){this.index=0}}const _f=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new Sf(e,e.context||"",t);if(n){const n=nC(`${t.context}.${Fr.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new Sf(e.children[0],n||e.context,t)}return e?.children?new Nf(e.children,t):void 0};class bf{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:r}=e;if(t&&r){const e=t[t.length-1];r[e]&&r[e].view&&Object.keys(r[e].view).length>0&&n.push(r[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=>ch.isProperty(e))).map((e=>ch.getPropertyName(e)))}}const Tf=new bf;let Pf;Object.freeze(Tf);const Of=(e,t,n)=>{e&&(Object.keys(e).forEach((r=>{if("children"!==r){const a=e[r],s=_o.trimAnnotation(a);if("string"!=typeof s&&"string"!=typeof a||!(hC.isValidAnnotation(a)&&hC.isPropertyRef(s)||a.startsWith("@W ")||a.startsWith("@DW ")||a.startsWith("@E ")||a.startsWith("@ATTACHMENT "))){if(Array.isArray(s))s.forEach(((e,n)=>{const a={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||[],t[r][n]=Object.create({}),Of(e,t[r][n],a)}));else if(s&&"object"==typeof s&&"exp"!==s.type){const e={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||{},Of(s,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[r]=s}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},Df=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...hC.deepClone(t.inheritedProps)]};class vf{constructor(e){const{meta:t,isRoot:n,options:r={},useCustomContext:a}=e;this.meta=t,this._isRoot=n,this.options=r,this.useCustomContext=a,this._rawConfig=t?.config,this._isExpressionExist=!1,this._isWhenExist=!1,this._isValidatorExist=!1,this._pageReference="",this._referenceContext="",this._contextName="",this._stateProps={},this._actions={},this._children="",this._additionalRegisteredProps={},this._caseInfo=null,this._dataInfo=null,this.viewName=r.viewName,this.parentViewName=r.viewName??"",this._referenceList=r.referenceList||"",this._isInsideList=r.isInsideList||!1,this._inheritedConfig={},this._localeRuleName=r.localeReference,this._containerTarget=r.target,this._readOnly=t?.config?.readOnly||r.readOnly,this._hasSuggestions=!1,this._actionsApi=null,this._classID=null,this.index=e.index,this.categoryName=r.categoryName||"",this._relativePath=r.relativePath??"",r.inheritedConfig&&(this._inheritedConfig=hC.deepClone(r.inheritedConfig)),t?.config?.inheritedProps&&Df(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=gu.formatePageReferenceToArrayIndex(this.meta.config.value)),Of(this._rawConfig,this._stateProps),this._isState=!hC.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=hC.isExpressionExist(this._rawConfig.config),this._isWhenExist=hC.isWhenExist(this._rawConfig.config),this._isValidatorExist=cp.isValidatorExist(this._rawConfig.config)),this._isRoot?this._contextName=Ur.APP.APP:this._contextName=this.meta?.config?.contextName||this.options.context||"",this._type=this.meta?.type;let s=this.options.pageReference;this.options.pageReference&&(s=_o.handleAnnotation(this.options.pageReference,this)),this._pageReference=yC.getContextPath(s||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t);const o="reference"===this._type&&hC.isWhenExist({visibility:this.meta?.config?.visibility}),i=this._checkAndSetDecisionParagraph("instructions",this._rawConfig?.instructions);let c=!1;if("reference"!==this._type&&t&&(this._rawConfig=yC.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=_o.trimAnnotation(e.localeReference)||r.localeReference,this._isExpressionExist=hC.isExpressionExist(e),this._isWhenExist=hC.isWhenExist(e),this._isValidatorExist=cp.isValidatorExist(e),c=this._checkAndSetDecisionParagraph("label",e?.label)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===Fr.VIEW&&this._rawConfig.name&&(this.viewName=_o.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&Ty(this)}(o||i||c)&&Sy(this.viewName,this._contextName,this._pageReference)}_checkAndSetDecisionParagraph(e,t){let n=!1;if(t&&t.startsWith(Fr.PARAGRAPH_ANNOTATION)){const r=_o.trimAnnotation(t);n=nf.isDecisionParagraph(r,this.getCurrentClassID()),n&&this.setStateProps({[e]:t})}return n}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=_o.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=_o.trimAnnotation(this.getPropertyName());return""===this._pageReference&&e.startsWith(".")?e.substring(1,e.length):e}addFieldNode(){const e=this._getPropertyName(),{value:t,contextPage:n,label:r,required:a,readOnly:s,disabled:o,visibility:i,validationType:c,caption:l,allowMultiple:d,useRFC822Validation:u}=this.getRawConfigProps();if(this.getValue(this._pageReference)||""===this._pageReference){const p="Address"===this._type&&this._rawConfig?.config?.associatedView?_o.trimAnnotation(this._rawConfig.config.associatedView):"",h=r||l,g=this._rawConfig?.type,f={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:_o.trimAnnotation(t),label:h?.startsWith("@")?_o.handleAnnotation(h,this,void 0):h,required:a,readOnly:s,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}${_o.trimAnnotation(n)}`},componentName:g,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),index:this.index,allowMultiple:d,isDeclarativeTarget:this.isDeclarativeTarget(),...this._type===Cf.EMAIL&&{useRFC822Validation:u}};md.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)md.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",_o.trimAnnotation(this.getPropertyName()),this.index);else if("Address"===this._type&&this._rawConfig?.config?.associatedView)md.removeViewNode(this._contextName,this._pageReference,_o.trimAnnotation(this._rawConfig.config.associatedView),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference,t={visibility:this.options?.visibility??this._rawConfig?.config?.visibility??this._rawConfig?.config?.referenceVisibility};md.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index,t)}}addViewNode(){if(!this.isReadOnly()){if(this._rawConfig?.type?.toLowerCase()===Fr.VIEW&&this._rawConfig.name&&this.viewName){const e={visibility:this.options?.visibility??this._rawConfig.config?.visibility??this._rawConfig.config?.referenceVisibility};md.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName,e)}"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&md.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&md.addViewNode(this._contextName,this._pageReference,_o.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&md.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}}addWhenNode(){let e="",t="";const n=hC.getWhenNames(this._rawConfig?.config),r=this.getRawConfigProps();if(r?.type&&r?.type?.toLowerCase()===Fr.VIEW)t=Fr.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=Fr.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=_o.isProperty(n)?_o.trimAnnotation(n):""}e&&n.forEach((n=>{md.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()!==Fr.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,contextPage:r,readOnly:a,disabled:s,visibility:o,validationType:i,selectionMode:c,selectionList:l,selectionKey:d,referenceList:u,renderMode:p,caption:h,uniqueField:g}=this.getRawConfigProps(),f=t||h;let m=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(m=this.getSelfReferencingDatapageKeys()),md.addPageListNode(this._contextName,this._pageReference,this.viewName??"",_o.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:_o.trimAnnotation(this.getPropertyName()),label:f?.startsWith("@")?_o.handleAnnotation(f,this,void 0):f,required:n,readOnly:a,disabled:s,...r&&{contextPageRef:`${this._pageReference}${_o.trimAnnotation(r)}`},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:u,selectionKey:d,index:this.index,uniqueField:g,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?m:void 0});const y=this.getValue(_o.trimAnnotation(this.getPropertyName()),this._pageReference)||[];md.updatePageListNode(this._contextName,this._pageReference,_o.trimAnnotation(this.getPropertyName()),y.length)}this.isWhenExist()&&this.addWhenNode(),this.isVisible()||this.removeNode()}getStateProps(){return this._stateProps}setStateProps(e){hC.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getSharedDataPageForReferenceList(){const e=this.getCaseInfo().getClassName(),t=this.getCurrentView();if(!t||!e)return;const n=yf(t,this,e);if(!n)return;const r=this.getRawMetadata()?.config?.referenceList;if(!r)return;let a={};"object"==typeof n.config?.parameters&&null!==n.config.parameters&&(a=n.config.parameters);const s=hC.generateDataPageHashWithParameters(a,r,this),o=XA(),i=o?o[r]?.[s]:{};return Array.isArray(i?.[Mr.getDefaultQualifiedName("pxResults")])?i[Mr.getDefaultQualifiedName("pxResults")]:void 0}getCaseInfo(){return this._caseInfo||(this._caseInfo=new Qg(this)),this._caseInfo}getDataInfo(){return this._dataInfo||(this._dataInfo=new Jg(this)),this._dataInfo}getCaseLocaleReference(e){const t=this.getRawConfigProps(),n=e||this.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_TYPE_ID))||this.getValue(Fr.CLASS_ID,Fr.getProperty(Fr.DATA_INFO.DATA_INFO_CONTENT))||t?.referenceClass||t?.className;return n?uf(lf,n):null}getListActions(){return Gu(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 yC.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[Fr.CONTAINERS.ROOT_CONTAINER,Fr.CONTAINERS.VIEW_CONTAINER,Fr.CONTAINERS.FLOW_CONTAINER,Fr.CONTAINERS.MODAL_VIEW_CONTAINER,Fr.CONTAINERS.PREVIEW_VIEW_CONTAINER,Fr.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=bI.PRIMARY,name:r,routingInfo:a}=this.getComponentConfig();return(e&&t.includes(e)||"@ROUTING_INFO"===a)&&r?r: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=d?.getStore()?.getState()?.data[`${this.getContextName()}/${Fr.SUGGESTION}`],n=this.getStateProps()?.value,r=yC.getContextPath(this.getPageReference(),n),a=t?ef.getSuggestionsContext(this.getContextName()).getField(r):void 0;this._hasSuggestions=!!a,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...Wu.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig},n=af.getStrategy(this._type);return n?.applyFallback(t),this.populateSuggestionProps(t),this.resolveConfigProps(t,e),hC.resolveStringBooleans(e)}getLocalizationService(e){const t=this.getComponentName(),n=e||("View"===t?this._rawConfig?.config?.template:t),r=LE.getLocale()??"en-US",a=new pf(r,n),s=this.getCaseLocaleReference();return a.setLookupList(["APP!APPLICATION"]),s&&a.setLookupList([s]),a}getRawConfigProps(){const e={...Wu.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(yC.resolveProps(e,t,this),_o.handleComponentMapping(t,{type:this.getComponentName()||"",config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),Of(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(),r=this.getComponentConfig(),a=n===Fr.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(n===Fr.MODAL_VIEW_CONTAINER||n===Fr.CASE_CREATE_STAGE||n===Fr.OBJECTACTIONCONTAINER){const n=VI(`${Fr.APP.APP}/${this.getContainerName()}`),r=Sd({context:n,category:Ur.PAGE});e.pageMessages=t(r),this._stateProps.pageMessages=e.pageMessages}if(this.isEditable()){let{value:t}=this.getStateProps();void 0===t&&"multi"===this.getComponentConfig()?.selectionMode?t=this.getStateProps().selectionList||_o.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=Sd({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:Ur.MESSAGES.MESSAGES_TYPE_ERROR}),r=Sd({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:Ur.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=Fr.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status;const r=n?.find((e=>"error"===e.type&&"required"===e.subType));r&&!e.required&&this.isVisible()&&this.clearErrorMessages({property:t,subType:"required"})}r&&r[0]&&(e.infoMessage=r[0].message,e.status=Fr.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(n===Fr.ROOT_CONTAINER){const n=Td(a,VI(`${Fr.APP.APP}/${this.getContainerName()}`));e.httpMessages=Array.isArray(n)?t(n):n,this._stateProps.httpMessages=e.httpMessages;const r=ef.getSharedState("isLoggedOut");e.isLoggedOut=r,this._stateProps.isLoggedOut=r;const s=Sd({context:Fr.APP.ROOT,category:"PAGE"});e.pageMessages=t(s),this._stateProps.pageMessages=e.pageMessages}if(n===Fr.HYBRID_VIEW_CONTAINER){const n=Sd({context:Fr.APP.APP,category:Fr.HTTP});e.httpMessages=t(n),this._stateProps.httpMessages=n}if(n===Fr.APP_SHELL&&e.portalDocMode===Fr.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=dg.getOpenedCaseItems(`${Ur.APP.APP}/${Fr.PRIMARY}`),this._stateProps.activeCases=e.activeCases),n===Fr.APP_SHELL){const n=Fr.APP.APP,r=VI(`${n}/${this.getContainerName()}`),a=[...Sd({context:n,category:"PAGE"})||[],...Sd({context:r,category:"PAGE"})||[]],s=a.length>0?a:void 0;e.pageMessages=s&&t(s),this._stateProps.pageMessages=e.pageMessages}if(e.value&&n===Fr.SCALARLIST&&(this._stateProps.value=e.value),n===Fr.APP_SHELL||n===Fr.MODAL_VIEW_CONTAINER||n===Fr.CASE_CREATE_STAGE||r.template===Fr.CASE_PREVIEW||r.template===Fr.RULE_PREVIEW){let t=Sd({context:Fr.APP.APP,category:"HTTP"});const n="HYBRID"===LE.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${Fr.APP.APP}/${this.getContainerName()}`,r=Sd({context:VI(n),category:"HTTP"});t?r&&(t=t.concat(Sd({context:VI(n),category:"HTTP"}))):t=Sd({context:VI(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===Fr.VIEW_CONTAINER||n===Fr.FLOW_CONTAINER||n===Fr.MODAL_VIEW_CONTAINER||n===Fr.PREVIEW_VIEW_CONTAINER||n===Fr.ROOT_CONTAINER||n===Fr.OBJECTACTIONCONTAINER){if(e.routingInfo=ks(this.getContainerName(),this._contextName),n===Fr.ROOT_CONTAINER&&(e.rootConfig=bf.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,n===Fr.FLOW_CONTAINER||n===Fr.OBJECTACTIONCONTAINER){const n=Sd({context:this.getContextName(),category:Fr.CASEMESSAGES}),r=this.getContextName();e.caseMessages=n,this._stateProps.caseMessages=e.caseMessages,e.caseViewMode=this.getValue("context_data.caseViewMode"),this._stateProps.caseViewMode=e.caseViewMode;const a=zI(r)[0];if(a){const n=VI(a),r=d?.getStore()?.getState()?.data;r&&n&&(e.lastUpdateTime=r[n]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=r[n]?.caseInfo?.lastUpdateTime);const s=Sd({context:n,category:Ur.PAGE}),o=Sd({context:n,category:"HTTP"});e.httpMessages=t(o),e.pageMessages=t(s),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=JA(Fr.APP.APP).context_data?.isOffline,e.assignmentNames=this.getCaseInfo().getAssignments()?.map((e=>e.name)),e.childAssignmentNames=this.getCaseInfo().getChildAssignments()?.map((e=>e.name)),n===Fr.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 r.template===Fr.CASE_VIEW||r.template===Fr.RULE_VIEW||r.template===Fr.SELF_SERVICE_CASE_VIEW||r.template===Fr.CASE_PREVIEW||r.template===Fr.RULE_PREVIEW||r.template===Fr.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):n===Fr.CASE_STAGES&&(e.stages=this.getCaseStages(),e.stageID=this.getStageID(),this._stateProps.stages=e.stages,this._stateProps.stageID=e.stageID);const s=this.getInheritedProps()?.shouldAutoRefresh;s&&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:r}=this.getComponentConfig(),{propertyValue:a,propertyAnnotation:s}=this.getPropertyDetails(r,n,t);if(a&&"string"==typeof a&&(a.includes(s)||a.includes(Fr.ATTACHMENT_ANNOTATION))){const t=_o.getPropertyName(a),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=VA(`${this._pageReference}.${t}`,this._contextName);if(e?.additionalInformation&&this.setStateProps({additionalInformation:n}),!Array.isArray(e)){e.additionalInformation=n;const{inputFormat:t}=e;if("string"==typeof t&&t.startsWith("@")){const n=_o.handleAnnotation(t,this);"object"==typeof n&&null!==n&&"pattern"in n&&"string"==typeof n.pattern?e.inputFormat={pattern:n.pattern}:e.inputFormat=null}}return e}getFieldMetadata(e){if(!e)return null;const t=e.split(".");if(t.length<2){let t=this.getValue(Fr.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata(fA(e,t),e)}const n=t.pop(),r=t.join(".")?".":"";let a=this.getValue(`${r}${t.join(".")}${Fr.CLASS_ID}`);return a||(a=hC.resolvePageClass(e,this.getCurrentClassID())),this.resolvePropertyMetadata(fA(n,a),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata(fA(n,this.getValue(`${t.join(".")}${Fr.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(Fr.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[Fr.getProperty(Ur.CASE_INFO.CASE_INFO)]};return e.CaseID=e.CaseID||this.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_PZINSKEY)),{...e,isCaseWideAction:()=>iy(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()[Ur.CASE_INFO.CASE_INFO].stages}getStageID(){return this.getDataObject()[Ur.CASE_INFO.CASE_INFO].stageID}getActions(){return this._actions}isRoot(){return this._isRoot}getRelativePath(){return this._relativePath}resolveContextProps(e){const{value:t}=this.getStateProps();t&&(e.error=this.getContextDataValue(`${this.getPageReference()+t}.error`),e.validatemessage=this.getContextDataValue(`${this.getPageReference()+t}.validatemessage`))}isValidatorExist(){return!!this._isValidatorExist}getValidationApi(){return new Zp(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?_o.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||_o.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&!0===_o.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 r=n.getConfigProps(),a={includeTypes:["Group","Region","View"],excludeTemplates:["ListView","SimpleTable","StudioTable"]};let s=n._type&&a.includeTypes.includes(n._type)&&!a.excludeTemplates.includes(r.template);if(!!r.highlightedData&&r.highlightedData.length&&r.showHighlightedData&&(s=!1),!s)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 JA(e||this.getContextName())}getImagePath(e){return`${Dp.getConstellationServiceUrl()}/v860/${Dp.getAppAlias()}/image/${e}?org=${wE.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=_f(this._rawConfig,{pageReference:this._pageReference,context:this._contextName,localeReference:this._localeRuleName,hasForm:this.options.hasForm,isBulkAction:this.options.isBulkAction,containerName:this.getContainerName(),containerItemName:this.options.containerItemName,viewName:this.viewName,inheritedConfig:this._inheritedConfig,target:this._containerTarget,readOnly:this._readOnly,categoryName:"Group"===this._type?this._rawConfig?.config?.id:null,relativePath:this._relativePath}),n=[];for(;t?.hasNext();){const e=t.next();this.isBulkAction()&&this.#l(e)||n.push(e)}return t?.resetIndex(),n}return[]}setInheritedProp(e,t){this._inheritedConfig[e]=t}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const r=n||this.getLocaleRuleName(),a=r&&t?`${r}#${t}`:r,s=this.getLocalizationService(a).getLocalizedText(e);return s===e?this.getLocalizationService().getLocalizedText(e):s}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?yC.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${Fr.SUGGESTION}`):yC.getPropertyValue(e,t||this.getPageReference(),this._contextName)}setInheritedConfig(e){if(!e)return;const{readOnly:t,displayMode:n,referenceType:r,hideLabel:a}=e;a&&(this._inheritedConfig.hideLabel=a),r&&(this._inheritedConfig.referenceType=r),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)})),Df(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),yC.resolveProps(t,e,this),e}setValue(e,t,n,r=!1,a={}){if(!hC.isValidPropertyReference(e))return;let s,o;const{isArrayDeepMerge:i}=a;this.isInsideList()&&this.getListActions().updateProperty(e,t),this.isBulkAction()&&(s=!0,t||(o=!0)),QA({type:"SET_PROPERTY",payload:{reference:yC.getContextPath(this.getPageReference(),e),value:t,initialValue:n,isImplicit:r,context:this.getContextName(),...void 0!==i&&{isArrayDeepMerge:i},...s&&{isStrictTracking:s},...o&&{removePropertyFromChangedList:o}}})}updateDirtyCheckChangeList(e,t){const n={reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()};mI(n)}getContextDataValue(e,t){return tC(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(Fr.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let r=Fr.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(r=n>0?this._pageReference.substring(n):this._pageReference),QA(_C({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){if(!hC.isValidPropertyReference(e))return;const{skipDirtyValidation:r=!1}=n;QA({type:"REPLACE_PROPERTY",payload:{reference:yC.getContextPath(this.getPageReference(),e),value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){QA(XC(e,t||{},n,t?.formFields))}getComponent(){return Pf({getPConnect:()=>this})}createComponent(e,t,n,r){let a=this._pageReference;if(t){const e=nC(`${this.getPageReference()}.${Fr.SUMMARY_OF_LISTS}`,t,this._contextName);a=yC.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=_o.handleAnnotation(e,this),a=yC.getContextPath(this._pageReference,e)||""}return Pf(Rf({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}),r)}getReferencedView(){if(this.meta)return yC.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(Fr.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,Rf({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 uh(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new Kg(this)),this._actionsApi}getActionManager(){return Vp}doesContextExist(e){return uC(e??this.getContextName())}getGoogleMapsAPIKey(){return cn()}getServerURL(){return an()}getLoadingStatus(e){let t=null;return e?(t=JA(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?Nd({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName(),...e.subType&&{subType:e.subType}}):e?.context?Nd({type:"error",...e}):(Nd({type:"error",...e,context:Fr.APP.APP}),Nd({type:"error",...e,context:VI(`${Fr.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return nC(`${this.getPageReference()}.${Fr.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 r=(e,t)=>{Object.entries(e).forEach((([e,a])=>{if(Array.isArray(a)){const r=PCore.createPConnect({options:{pageReference:n.getPageReference(),context:n.getContextName(),referenceList:`${t}.${e}`}}).getPConnect();Bu(r,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<a.length;e+=1)wu(a[e],e,r,void 0,{})}else"object"==typeof a&&r(a,`${t}.${e}`)}))};r(e,t)})(e,t,this):Wm(this.getContextName(),`${this.getPageReference()}${t}`,this.getStateProps()?.value??"")}acceptSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=ef.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=yC.getContextPath(this.getPageReference(),n),a=t.getField(r);this._hasSuggestions=!1,this.getActionsApi().updateFieldValue(n,a),this.getActionsApi().triggerFieldChange(n,a),t.removeField(r,{actionPerformed:"accepted"})}}ignoreSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=this.getStateProps()?.value||e,n=yC.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,ef.getSuggestionsContext(this.getContextName()).removeField(n,{actionPerformed:"ignored"});const r=Ao.getDependencies(this._contextName,n);r?.forEach((e=>{ef.getSuggestionsContext(this.getContextName()).removeField(e,{actionPerformed:"ignored"})}))}}getSelfReferencingDatapageKeys(){const e=[],t=this.getPropertyName(),n=this.getFieldMetadata(t),{datasource:{parameters:r={}}={}}=n||{};return Object.values(r).forEach((n=>{const[,r]=n.split("."),a=t?.split(".").pop();r===a&&e.push(n.substring(n.lastIndexOf(".")+1))})),e}isReadOnlyField(){const{value:e,datasource:t,listType:n}=this.getComponentConfig(),{propertyValue:r,propertyAnnotation:a}=this.getPropertyDetails(n,t,e);if(!r||"string"!=typeof r||!r.includes(a)&&!r.includes(Fr.ATTACHMENT_ANNOTATION))return!1;const s=_o.getPropertyName(r),o=this.getFieldMetadata(s);if(!o)return!1;const i={...this.getComponentConfig(),fieldMetadata:o,template:this._rawConfig?.config?.template};return this.#d(i,s)}#d(e,t){const n=ch.isPropertyInternal(t),r=e.datasource,a=this.getComponentConfig().isSearchField,{isClassKey:s,isSpecial:o,isDeclarativeTarget:i}=e.fieldMetadata??{},c="DataReference"===e.template||"ObjectReference"===this.meta?.type,l=e.listType!==Fr.ASSOCIATED;return!a&&!!(i||n||!r&&(s&&!c||o)&&l)}getPropertyDetails(e,t,n){return e===Fr.ASSOCIATED?{propertyValue:t,propertyAnnotation:Fr.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:Fr.PROPERTY_ANNOTATION}}updateConfigData(e,t,n){e.fieldMetadata=t,t.additionalInformation&&(e.additionalInformation=t?.additionalInformation),t.inputFormat&&"string"!=typeof t.inputFormat&&(e.inputFormat=t.inputFormat),this.#d(e,n)&&(e.readOnly=!0,this._stateProps.readOnly=e.readOnly,e.fieldMetadata.isDeclarativeTarget&&this.registerAdditionalProps({readOnly:!0})),e.fieldMetadata?.isReadOnly&&(e.readOnly=!0,this.registerAdditionalProps({readOnly:!0}))}#l(e){const t=e.getPConnect().getComponentName(),n=e.getPConnect().getConfigProps().template;return!(!0===bf.allowedComponetsForBulkProcessing[t]||!0===bf.allowedComponetsForBulkProcessing[t]?.[n])}}function Rf(e){const t=new vf(e);return{getPConnect:()=>t}}function $f(e){Pf=e}const xf={CASE_INFO:`${Fr.DATA}.${Fr.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${Fr.DATA}.${Fr.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${Fr.DATA}.${Fr.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${Fr.DATA}.${Fr.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${Fr.DATA}.${Fr.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${Fr.DATA}.${Fr.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${Fr.DATA}.${Fr.CASE_INFO.ASSIGNMENT_ID}`},wf=(e,t)=>{const{vcName:n,containerName:r}=t;return r||n||Gp.getTargetViewContainerName(e)},Mf=e=>{const t=e.lastIndexOf(Fr.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(Fr.UNDERSCORE_STRING);return e.substring(t,n)},Lf=e=>e===bI.WORKAREA,Uf=e=>e===bI.MODAL,Ff=e=>e===Ua,jf=e=>e===ba,kf=e=>e&&e.find((e=>e.type===ba)),Vf=e=>hC.getIn(e,xf.CASE_INFO,{}),Bf=e=>e?e.split(" ").pop():void 0,Gf=e=>hC.getIn(e,xf.CASE_CLASS_NAME,Fr.EMPTY_STRING),Wf=(e,t=!1)=>{const n=t?Qp(e):Vf(e);return sy(n)&&oy(LE.getOperatorIdentifier(),n)},Hf=e=>hC.getIn(e,xf.CASE_INFO_ID,Fr.EMPTY_STRING),qf=e=>hC.getIn(e,xf.CASE_FIRST_ASSIGNMENT_ID,Fr.EMPTY_STRING),zf=(e,t)=>{const{removeActionPayload:n,target:r}=t;if(n&&n.containerItemID){const{containerItemID:t,context:a}=n;e.push(JC(WC,{containerItemID:t,context:a||WI(t),target:r}))}},Yf=e=>{const t=e.context;if(ry.shouldUseUnifiedHandling()){const e=sE(t),{accessedOrder:n=[],type:r}=OI(e),a=n.filter((e=>e!==t));QA(WC({containerItemID:t,context:t,target:e,containerInfo:{newAccessedOrder:a,containerType:r}}))}else oE(t,{skipDirtyCheck:!0})},Kf=e=>{const t=KA();if(!e)return!1;const n=Wr(e),r=sE(n),a=sE(e);if(!r||!a)return!1;const s=vI(r,n),o=vI(a,e);if(!s||!o)return!1;const{key:i}=s||{};let{key:c}=o||{};return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),i&&c&&i===c},Qf=(e,t,n={})=>{const{skipFlowNameUpdate:r}=n,a=Hf(t);hC.setIn(e,"key",a);const s=sy(Vf(t));if(!r&&(e=>{const t=hC.getIn(e,xf.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=qf(t),[,r]=n.split("!");o={assignmentID:n,isInCreateStage:s},$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,o),hC.setIn(e,"flowName",r)}var o},Jf=(e,t)=>{const{attachmentsExist:n}=t;n&&hC.setIn(e,Ur.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),hC.setIn(e,Ur.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},Xf=(e,t,n)=>{let r=Fr.PROMISE_VALUE.RESOLVE;return kf(e)?(r=Fr.PROMISE_VALUE.REJECT,n?Vp.rejectActionByID(t,!0,n):Vp.rejectActionByID(t)):Vp.resolveActionByID(t),r},Zf=e=>{if(!e)return!1;const t=LE.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},em=()=>"true"===LE?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,tm=(e,t,n,r)=>{const{containerItemID:a}=t;if(a){const{caseClassName:s,skipAssignmentsUpdate:o}=r,i=Wr(a),c=sE(i),l=c&&OI(c),d=c&&VI(c),u=Yr(i),p=n?.data?.caseInfo?.ID;d&&l?.items?.[d]?.key===t?.caseID&&e.push(JC(TC,{containerItemID:i,context:i,container:u,containerName:u,caseId:p,viewName:Fr.getDefaultQualifiedName(Ur.CASESUMMARY_VIEW_NAME),updateData:!0,viewLoadingContainer:{context:i},caseClassName:s,...void 0!==o&&{skipAssignmentsUpdate:o}}))}},nm=async(e,t)=>{const{context:n,containerItemID:r,shouldUpdateCaseActionsInParentContext:a}=e,s=t?.data?.caseInfo?.ID?Hf(t):void 0;if(!n||!s)return;const o=s?`${s}_actionsLoading`:"actionsLoading";try{const i=new vf({}),c=new Qg(i);jp.setComponentCache(o,!0);const l=t?.data?.caseInfo?.caseTypeID?Gf(t):void 0,d=await c.getCaseActions(s,n,{caseTypeID:l});gf(t);const u=hC.getIn(t.data,Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ACTIONS)),p=Array.isArray(d.availableProcesses)&&d.availableProcesses.length>0?{availableProcesses:d.availableProcesses}:[],h=d?.availableActions,g=["pyUpdateCaseDetails"],f=Array.isArray(h)&&h.find((e=>g.includes(e.ID))),m={data:{caseInfo:{availableActions:[...d.availableActions,...void 0!==u?u:[]],...p,editActions:f?[f]:[]}}};jp.setComponentCache(o,!1),QA(JC(_C,{context:n,...m})),!0===a&&r&&(async(e,t)=>{const{containerItemID:n,caseID:r}=t;if(n){const t=Wr(n),a=sE(t),s=a&&OI(a),o=a&&VI(a);o&&s?.items?.[o]?.key===r&&QA(JC(_C,{context:t,...e}))}})(m,e)}catch(e){jp.setComponentCache(o,!1),console.error("Error fetching case actions:",e)}},rm=(e,t)=>{const n=Gf(e?.response),r=Vf(e?.response),{caseTypeID:a}=r,s=LE.getFeatureMap();(s?.deferUpdateCaseSummaryView??!Object.hasOwn(s,Fr.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&tm(t,e?.actionInPayload,e?.response,{caseClassName:n,skipAssignmentsUpdate:!e?.actionInPayload?.context?.includes(Fr.PREVIEW)})},am=()=>LE.isOptimizedCaseLoadingEnabled(),sm=(e,t)=>{am()&&nm(t,e)},om=e=>JA(e)?.context_data?.caseViewMode,im=e=>!(!jp.getComponentCache("redirectionInProgress")||!e)&&(Xf([],e),!0);const cm=new class{confirmHandler=null;registerConfirmHandler(e){this.confirmHandler=e||null}confirm(e){return this.confirmHandler?this.confirmHandler(e):Promise.resolve(window.confirm(e))}},lm=cm,{RESOURCE_TYPES:dm}=Ur,um={PAGE:"page",FORM:"form"},pm={[dm.CASE]:[Qa,Ya,Ka],[dm.OBJECT]:[ws,Ms,Us],[dm.PAGE]:[Wa,qa],[dm.DATA]:[Ha],ASSIGNMENT:[os]},hm=(e,t,n={})=>{if(!e)return{};const r={etag:e.etag},{RemoteSystemID:a}=n;return e[Ur.REMOTE_SYSTEM_ID]||e[Ur.REMOTE_SYSTEM_ID.toLowerCase()]||a?r.RemoteSystemID=e[Ur.REMOTE_SYSTEM_ID]||e[Ur.REMOTE_SYSTEM_ID.toLowerCase()]||a:t&&Vr.isRemoteCase(t)&&(r.RemoteSystemID=Vr.getRemoteHeader(t)),r},gm=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:a=!0,isTransientContext:s=!1,includeDisabledFields:o=!1,isObjectWideAction:i,isExternalObject:c}=t;let l={};l=Qm(e,{isTransientContext:s,includeDisabledFields:o,isObjectWideAction:i,isExternalObject:c}),n&&(delete l?.caseInfo?.content,s&&(l={}));const d=dI(e,!1),u=JA(e),p=Fn(u,Fr.CASE_INFO.CASE_INFO_ENCRYPTED_CONTENT),h=void 0!==p;!s&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const a=JA(t),s=Fn(a,Ur.CASE_INFO.CASE_INFO_CLASSID),o=fA(n,s);("True-False"===o?.type&&!r||""===r)&&delete e.caseInfo.content[n]}))})(l,e);const g=Rr(d,l);let f={};({content:f}=((e,t,n=!1,r=!1)=>{let a={};const s=ry.shouldUseUnifiedHandling()||!n&&!r?t?.caseInfo:t?.objectInfo;return(e||s)&&(a=e?{...t}:{...s}),{content:a}})(s,g,i,c));const m=[...Ru(e)];if(a){const e=Mr.getDefaultQualifiedName("EmbedListUUID__");m.forEach((t=>{delete t.content?.EmbedListUUID__,delete t.content?.[e]}))}f.pageInstructions=m;if((bu[e]||[]).forEach((e=>{if(f?.content){const t=e?.replace(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),"");hC.deleteIn(f.content,(e=>{if(!e)return"";const t=e.split(".");let n,r="";for(n of t)if(n){if(n.includes("[")&&n.includes("]"))return r+=`['${n.substring(0,n.lastIndexOf("["))}']`,r;r+=`['${n}']`}return r})(t))}})),h&&(f.encryptedContent=p),!s&&g?.dataInfo)return f={...g.dataInfo,pageInstructions:f.pageInstructions},{content:f};const y=eC(Mr.getQualifiedNameForComplexRuleReferences(".pzAdditionalPayload"),Fr.CASE_INFO.CASE_INFO_CONTENT,e);return f.content&&y&&(f.content[Mr.getDefaultQualifiedName("pzAdditionalPayload")]=y),{content:f}},fm=(e,t)=>{let n,r,a={};const s=hC.getIn(e,Fr.UI_RESOURCES),o=hC.getIn(e,"confirmationNote");s?(n=hC.getIn(e,Fr.UI_RESOURCES_CONTEXT_DATA),r=hC.getIn(e,Fr.ROOT),a=hC.getIn(e,Fr.ACTION_BUTTONS)):o&&!t.isActiveWorkAreaPrimaryAndWorkareaAbsent&&(r={});const{data:i={},Errors:c,flowName:l}=e;let{semanticURL:d,key:u}=e;const p=i?.objectInfo?.ID;p&&(u=u||p,d=d||`objects/${p}`);const h=hC.getIn(e,"nextAssignmentInfo",null),g=hC.getIn(e,"nextAssignmentInfo.context",""),f=hC.getIn(e,"confirmationLinks",null),{isInCreateStage:m,openCaseViewAfterCreate:y,debugInfo:I,isExternalObjectCreationFlow:E,isExternalCaseCreationFlow:A}=t;return{data:{...i,key:u,flowName:l,coreHeaders:I&&{debugInfo:{[Fr.COREHEADER_APP_DEBUG_ID]:I.debugId}},[Fr.getProperty(Fr.CASE_INFO.CASE_INFO)]:{...i[Fr.getProperty(Fr.CASE_INFO.CASE_INFO)],actionButtons:a,headers:t.headers},[Fr.CONTEXT_DATA]:m?{...i[Fr.CONTEXT_DATA],...n,openCaseViewAfterCreate:y,errors:c,...E&&{isExternalObjectCreationFlow:E},...A&&{isExternalCaseCreationFlow:A}}:{...i[Fr.CONTEXT_DATA],...n,errors:c}},semanticURL:d,nextAssignmentInfo:h,assignmentContext:g,confirmationLinks:f,key:u,root:r,...t}},mm=async(e,t,n,r=!1,a=!1)=>{const s=hC.getIn(e,Fr.COMPONENTS);if(s)try{await $p(s)}catch(e){console.error(e)}const o={actionConfig:t,...n};r?_S({...e,options:o,directUrlUpdation:!0}):up(e,o,a)},ym=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},Im=e=>{if(e){const[,t]=e.split("!");return{key:ym(e),flowName:t}}return{}},Em=(e,t,n,r)=>{switch(!0){case Boolean(e[Fr.ERROR_IN_PAGE_IDENTIFIER]&&e[Fr.ERROR_FIELD_IN_PAGE]):{const a=`${e[Fr.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),s=`${a}${e[Fr.ERROR_IN_PAGE_IDENTIFIER]}`,o=hC.deepClone(e);o[Fr.ERROR_FIELD_IN_PAGE]=a,t.includes(s.slice(1))||t.includes(s.substring(s.indexOf(".")+1,s.indexOf("[")))||t.includes(s.substring(s.indexOf(".")+1,s.indexOf("(")))?r.push(o):n.push(e);break}case Boolean(e[Fr.ERROR_IN_PAGE_IDENTIFIER]&&!e[Fr.ERROR_FIELD_IN_PAGE]):{const a=e[Fr.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(a)?r.push(e):n.push(e);break}default:n.push(e)}},Am=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:a}=t,s=n&&n.response?n.response.data:"",o=ey(r);return a&&Vp.rejectActionByID(a,!0,n),JC(XC,"Error action triggered",s,r,o)},Cm=(e,t)=>QI(e)&&XI(e)?JC(zC,t):JC($C,t),Sm=(e,t,n=Fr.APP.APP,r={})=>{let a=null;const{buildNew:s=!0}=r;return QI(e)?a=XI(e)?VI(e):Hr(t,n):JI(e)&&(XI(e)&&!s?a=HI(e):XI(e)&&!s||(a=Hr(t,n))),a},Nm=e=>e&&e.type===Oa,_m=e=>{let t=!1;const n=YI(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&yI(r)){t=!0;break}}return t},bm=async(e,t={})=>{let n=!1,r=!1,a={},s=!0,o=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:d=!1,loadingContext:u}=t,p=VE();if(QI(e)){const t=VI(e);if(!t)return{continueExecution:s,removeActionPayload:a};const r=WI(t);yI(r)&&(n=!0),d||n||(n=_m(t))}else if(JI(e)&&tE(e)){let t=aE(e);t||(t=VI(e),r=!0),a.containerItemID=t,a.context=WI(t)}if(n){const t={context:u||e};kp.disableLoadingIndicator(t);const n=l||cI;o=await lm.confirm(p.getLocaleValue(n,"Messages")),kp.enableLoadingIndicator(t)}if(!o&&n&&(a={},s=!1),r){const t={context:u||e};kp.disableLoadingIndicator(t);const n=p.getLocaleValue(lI,"Messages");c?i=await lm.confirm(n):(await lm.confirm(n),s=!1),kp.enableLoadingIndicator(t)}return!i&&r&&(a={},s=!1),{continueExecution:s,removeActionPayload:a}},Tm=(e,t)=>{let n=!1;const r=LE.isCoexistenceAppOfType(Fr.APP_TYPE.UIKIT),{insKey:a,isParallelCall:s,skipFlowNameCheck:o}=t;if(!a)return{};const[,i]=a.split("!")||"",c=o?a:ym(a),l=LI(e,c);let d={},u=!1;if(l&&!r&&((e,t)=>{const n=vI(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,d=vI(e,l),!o)){let e=d?.flowName;const t=Mf(l),r=qI(l);if(r.length){const n=((e,t)=>e?.includes(Fr.WORKAREA)?Fr.WORKAREA:t)(r[0],t),a=js(n,r[0]);e=vI(a,r[0])?.flowName}else n=e===i;(e!==i||s)&&(u=!0)}return n=((e,t)=>!t&&e)(n,t.forceRefresh),{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:u,containerItemID:l,semanticURL:d.semanticURL,insKey:a}}},Pm=(e,t,n)=>e===dm.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,a=LI(e,r);return a&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:a,semanticURL:r}}})(t,n):e===dm.ASSIGNMENT?Tm(t,{...n,type:e}):e===dm.CASE||e===dm.OBJECT?Tm(t,{...n,skipFlowNameCheck:!0,type:e}):{},Om=e=>{if(e){const t=(e=>{const t=RI(e);if(!t)return null;for(const[e,n]of Object.entries(t))if(!n.key&&n.resourceType===Ur.PAGE)return e;return null})(e);if(t)return{activate:!0,activateContainerActionPayload:{target:e,containerItemID:t,semanticURL:""}}}return{activate:!1}},Dm=(e,t,n)=>{const{semanticURL:r,isDefaultNavPage:a}=((e,t)=>{const n=gS(Wa,{page:e,pageClass:t}),r=KA()?.getState()?.data?.app?.pyPortal?.pyPrimaryNavPages,a=Array.isArray(r)?r[0]:void 0;return{semanticURL:n,isDefaultNavPage:!(a?.pyRuleName!==e||a?.pyClassName!==t)}})(e,t);if(n&&r&&!a){const e=Pm(dm.PAGE,n,{semanticURL:r});if(e.activate)return{semanticURL:r,activate:!0,activateContainerActionPayload:e.activateContainerActionPayload}}if(a){const e=Om(n);return e.activate?{semanticURL:r,...e}:{semanticURL:"",activate:!1}}return{semanticURL:r,activate:!1}},vm=(e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e),Rm=(e=[])=>{XI(`${Fr.APP.APP}/${Fr.PREVIEW}`)&&e.push(JC(RC,nE({context:Ur.APP.APP,name:Fr.PREVIEW})))},$m=e=>{let t;for(const n of Object.keys(pm))if(pm[n].includes(e)){t=n;break}return t},xm=(e,t,n="",r={})=>{const{data:a={},context:s,caseViewMode:o,skipMergeAssignmentsAndActions:i=!0}=e,c={data:{...a},caseViewMode:o,context:Wr(s)};hC.deleteIn(c.data,"shared"),hC.setIn(c.data,["context_data","caseViewMode"],o),t.push({type:gs,payload:{context:c.context,skipMergeAssignmentsAndActions:i}});const l=n&&![Ur.CASE_INFO.CASE_INFO_CONTENT,Ur.DATA_INFO.DATA_INFO_CONTENT].includes(n),{propertiesToReplace:d=[]}=r;t.push(JC(_C,{...c,...l&&{uiRootReference:n}},...d.length>0?[{propertiesToReplace:d}]:[]))},wm=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=hC.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const r=hC.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:hC.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:hC.getIn(t,["payload","context"]),context:hC.getIn(t,["payload","context"])},r={type:ma,payload:{...n}};e.push(r),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),QA(e),e=e.filter((e=>e.type!==ma))}const a=((e,t,n)=>({assignmentID:e,vcName:Fr.PRIMARY,targetContainerName:hC.getIn(t,["payload","target"]),context:hC.getIn(t,["payload","context"]),..."other"===n&&{isChild:!0},isProcessAction:t?.payload?.isProcessAction,..."remote"===n&&{isRemote:!0},..."remote"===n&&{remoteClassName:t.payload.nextAssignmentInfo.className}}))(r,t,n);QI(a.targetContainerName)||t?.payload?.containerName!==Fr.WORKAREA||(a.isMultiDoc=!0,e=[]);const s={type:ya,payload:{...a}};e.push(s),QA(e)}else QA(e)}},Mm=(e,t)=>Rr(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),Lm=e=>{let t={},n=TE(e);for(;n;){const e=gm(n);t=Mm(e.content,t),n=TE(n)}return t},Um=e=>{e?.containerItemID&&ef.updateState(e.containerItemID,"traditionalGadgetId",ry.getUniqueGadgetId(),{skipDirtyValidation:!0})};class Fm{static getChanges(e){return{...dI(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1,onlyChangedData:a=!1}=t||{},{content:s}=gm(e,{isTransientContext:n,includeDisabledFields:r,onlyChangedData:a});return s}static isStateModified(e){return yI(e)}static hasUnsavedChanges(e){return yI(e)||Vu(e??null)}static resetComplexObjectDirtyStatus(e){return hI(e)}static isFormValid(e,t){return Xm(e,t)}static clearChangedProperties(e){return $u(e),vu(e),EI(e)}static getEditableFields(e){return ty(e)}static setCustomValidator(e,t){cp.register(e,t)}static isPropertyEditable(e,t){return Fm.getEditableFields(e).some((e=>e.name===t))}}const jm=Fm;const km=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,r){const a=`${n}${t}`,{stateMachine:s}=this.getStateMachineObjByPath(a,e,!0,!0),o=(t,n,r=!1)=>{const a=r?this.states:this.unConnectedStates;a[e]||(a[e]={}),a[e][t]||(a[e][t]={}),a[e][t]=n};if(s&&s.targetPageReference!==r.targetPageReference)return s.addChild(r),void o(a,r);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],r.addChild(n),o(t,n)})),this.states[e][a]=r):o(a,r,!0)}buildPageInstructionsByContext(e,t){const n=this.getStateMachinesByContext(e)||{},r=[];return Object.keys(n).sort().forEach((a=>{const s=md.getContextReferences(e)?.get(a),o=s&&yC.resolveContextTreeNodeProps(s.props)||{},i=n[a];if(s&&!0!==o.readOnly){const e=i.buildSubmitPageInstructions(t);r.push(...e)}else if(i.hasEncryptedContent){const e=i.buildSubmitPageInstructions(t).filter((e=>void 0!==e.encryptedContent));r.push(...e)}else s||this.setStateMachineEmpty(e,a)})),r}buildClientChangeList(e){const t=this.getStateMachinesByContext(e)||{};let n={};const r={};return Object.keys(t).forEach((e=>{const r=t[e].getChangeList();n={...n,...r}})),hC.flatten(n,"",r),r}getStateMachinesByContext(e){return e?this.states?.[e]:void 0}clearStateMachines(e){this.states[e]={},this.unConnectedStates[e]={}}setStateMachineEmpty(e,t){const n=this.getStateMachine(e,t,"");n.root=null,n.current=null,n.hasEncryptedContent=!1;const r=this.getUnConnectedStateMachines(e)||{};Object.keys(r).forEach((e=>{e.includes(t)&&delete r[e]}))}removeStateMachine(e,t){delete this.states[e]?.[t]}createStateMachine(e,t){let n=e.substring(0,e.lastIndexOf("["));const r=n.substring(n.lastIndexOf("."));n=n.substring(0,n.lastIndexOf(".")),n&&r&&Pu(t,r,n)}getStateMachineObjByPath(e,t,n,r=!1){const a=/\[\d+\]$/gm,s=e;let o;for(;e&&!this.isStateMachineExist(t,"",e);){const i=sE(t),c=vI(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),!r&&!this.isStateMachineExist(t,"",e)){this.createStateMachine(s,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,r=!0,a={}){const{stateMachineTarget:s,index:o}=this.getStateMachineObjByPath(t,e,r);if(!s)return!1;const i=sE(e),c=vI(i,e)||{};let[,l]=t.split(s);if(!l)return!1;const d=c?.subscriptFieldName&&t.includes(c?.index)||c?.isPageGroup;null!==o&&([,l]=d?l.split(/(?=\.\w+)/):l.split(/^\[\d+\]/gm));const u={[Bm(l)]:n},p=this.getStateMachine(e,"",s);if(null!==o)if(d){const t=Ru(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(u,o,a.skipStateUpdate??!0,a)}else p?.update(u,Number(o)+1,a.skipStateUpdate??!0,a);else p?.updatePage(hC.unflatten(u));return!0}setUniqueField(e,t,n){const r=md.getContextReferences(e)?.get(n)?.props?.uniqueField;r&&(t.content||(t.content={}),t.content[Bm(r)]=crypto.randomUUID())}getBasePageReference(e){return eC(Ur.DATA_INFO.DATA_INFO_CONTENT,"",e)?Ur.DATA_INFO.DATA_INFO_CONTENT:Ur.CASE_INFO.CASE_INFO_CONTENT}mergeServerPageInstructions(e,t){t.forEach((t=>{if(t.target){const n=hC.convertClipboardPageToPageRefNotation(t.target),r=`${this.getBasePageReference(e)}${n}`;if(!this.isStateMachineExist(e,r,"")){const t=r.substring(r.lastIndexOf(".")),n=r.substring(0,r.lastIndexOf("."));Pu(e,t,n)}const a=this.getStateMachine(e,r,"");"INSERT"===t.instruction&&this.setUniqueField(e,t,r),void 0!==t.encryptedContent&&a&&(a.hasEncryptedContent=!0),a?.insertNode(t)}}))}registerForServerChanges(){HA.registerForListChanges(((e,t,n)=>{setTimeout((()=>{this.generatePageInstructions(e,t,n)}),0)}))}registerForServerChangesSync(){HA.registerForListChanges(((e,t,n)=>{this.generatePageInstructions(e,t,n)}))}generatePageInstructions(e,t,n){const r="].";if(!t.includes(".classID")&&jm.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(r)){const a=t.substring(0,t.lastIndexOf("[")),s=jm.getEditableFields(e);if(["multiselect","checkbox"].includes(s.find((e=>e.name===a))?.type)){const s=md.getContextReferences(e),o=s?.get(a),i=t.substring(t.lastIndexOf(r)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}unRegisterForServerChanges(){HA.unRegisterForListChanges()}},Vm={},Bm=e=>e.startsWith(".")?e.substring(1):e,Gm=e=>{delete Vm[e]},Wm=(e,t,n)=>{const r=Bm(t);Vm[e]?Vm[e].fieldOrder[r]=n:Vm[e]={fieldOrder:{[r]:n}}},Hm=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=yC.resolveContextTreeNodeProps(e),a=!0!==r.readOnly&&!1!==r.visibility&&(n||!0!==r.disabled),s="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)&&!s&&a},qm=(e,t,n,r,a)=>(km.executeStateMachine(e,r,yC.getLitePropertyValue(n,t))||a.push(r),a),zm=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:a=!0}=n;return(!r||r&&!a)&&!Array.isArray(yC.getLitePropertyValue(t,e))&&!(t.componentName&&["Address","Attachment"].includes(t.componentName))},Ym=(e,t={})=>{let n=[];const r=[],a=md.getContextReferences(e);return a?(({editableFormFieldsReferenceList:n}=((e,t,n)=>{const{includeDisabledFields:r=!1}=n;let a=[];for(const[s,o]of e){const e=yC.resolveContextTreeNodeProps(o.props),i=e.propertyName;Hm(o.props,{includeDisabledFields:r})&&zm(s,e,n)&&(a=qm(t,i,e,s,a))}return{editableFormFieldsReferenceList:a}})(a,e,t)),Vm[e]&&r.push(...Object.keys(Vm[e].fieldOrder??{})),{formInputs:n,formPageFields:r}):{formInputs:n,formPageFields:r}},Km=e=>{let t=[];const n=md.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(Hm(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},Qm=(e,t={})=>{const n={},r=JA(e),{ignoreFieldsInsideList:a=!0,isTransientContext:s=!1,includeDisabledFields:o=!1,isObjectWideAction:i=!1,isExternalObject:c=!1}=t,l=((e,t,n)=>ry.shouldUseUnifiedHandling()||!e&&!t?n?.caseInfo:n?.objectInfo)(i,c,r);if(s||l){const{formInputs:t,formPageFields:i}=Ym(e,{ignoreFieldsInsideList:a,includeDisabledFields:o});((e,t,n)=>{e.forEach((e=>{let r=hC.getIn(t,e);"object"==typeof r&&(r=hC.deepClone(r),delete r?.classID),hC.buildObject(e,n,r)}))})(i,r,n),t&&t.length>0?t.forEach((e=>{hC.buildObject(e,n,hC.getIn(r,e))})):s||hC.buildObject(Ur.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!s&&r?.dataInfo?.content){const{formInputs:t}=Ym(e,{ignoreFieldsInsideList:a});t.forEach((e=>{hC.buildObject(e,n,hC.getIn(r,e))}))}return n},Jm=(e,t,n)=>{const r=""===t&&n?.startsWith(".")?n.substring(1,n.length):n,a=md.getContextReferences(e)?.get(`${t}${r}`)?.props;return a?yC.resolveContextTreeNodeProps(a):a},Xm=(e,t)=>{const n=md.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,a]of n){const n=yC.resolveContextTreeNodeProps(a.props);if(Hm(a.props)&&(!t||e.includes(t))){const e=cp.validate(n.componentName?.toLowerCase(),n.propertyName,yC.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},Zm=e=>{const t=md.getContextReferences(e);if(t)for(const[,e]of t){if(yC.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0}return!1},ey=(e,t=!1)=>{const n=md.getContextReferences(e),r=[];if(n)for(const[e,a]of n){if(!1!==yC.resolveContextTreeNodeProps(a.props).visibility){const n=8,a=t?e:e.substring(e.indexOf("content")+n);r.push(a)}}return r},ty=e=>{const t=[],n=md.getContextReferences(e);if(n)for(const[e,r]of n){const n=yC.resolveContextTreeNodeProps(r.props);Hm(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};class ny{static getCaseInlineEditAction(e){return e?LE.getInlineEditActions(e):[]}static isCaseActive(e,t){if(!e||!t)return!1;const n=OI(t);if(n){const r=VI(t),{items:a={}}=n;return!(!r||!a[r]||a[r].key!==e)}return!1}static getCaseEditMetadata=(e,t)=>{const n={caseID:e,viewID:Mr.getDefaultQualifiedName("pyEdit")},{restApi:r,reqType:a}=mS("loadView",n);return au(r,{method:a},t)};static isExternalCaseType=e=>{let t;return this.shouldUseUnifiedHandling()?(t=LE.getCaseTypeList()?.find((t=>t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t):(t=LE.getCaseTypeList()?.find((t=>"Case"===t.objectType&&t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t)};static getCaseEditLock=(e,t,n)=>{const r={caseID:e,actionID:this.getCaseInlineEditAction(n)[0]??Mr.getDefaultQualifiedName("pyUpdateCaseDetails")},{restApi:a,reqType:s}=mS(ns,r);return au(`${a}?viewType=page`,{method:s},t)};static updateCaseEditFieldsData=(e,t,n,r,a)=>{const s=this.getCaseInlineEditAction(a),o=s.length?s:[Mr.getDefaultQualifiedName("pyUpdateCaseDetails")],i=t[e],c=(t,n)=>{const[a,...s]=t;return((t,n)=>{const a={caseID:e,actionID:t},{restApi:s}=mS(ns,a);return au(`${s}?viewType=form`,{method:"PATCH",body:{content:{...i}},headers:{"if-match":n}},r)})(a,n).then((e=>s.length>0?c(s,e.headers.etag):e))};return c(o,n)};static getCaseMessages=e=>JA(e)?.caseMessages;static getPropertiesToReplace=e=>(Km(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getPropertiesToReArrange=e=>(Km(e)||[]).filter((e=>e.allowMultiple)).map((e=>e.fullPath));static getUniqueGadgetId=()=>hC.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>Vr.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>Vr.isTraditionalRemoteCase(e);static isRemoteCase=e=>Vr.isRemoteCase(e);static isRemoteCaseVersionDifferent=e=>Vr.isRemoteCaseVersionDifferent(e);static getRemoteCaseKey=(e,t)=>{let n=t;try{e&&(n=e.slice(e.indexOf(" ")+1,e.indexOf("!")))}catch{}return n};static isObjectCaseType=e=>{const t=LE.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e));return t&&t.length>0&&"Object"===t[0].objectType};static isExternalObject=e=>{const t=LE.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e)),{DisplayMandatoryInputsForObject:n,objectType:r}=t?.[0]||{};return t&&t.length>0&&n&&"Object"===r};static getRouteKeyForCreateWork=(e,t=!1)=>this.isExternalCaseType(e)&&t?Fs:this.isExternalObject(e)&&t?this.shouldUseUnifiedHandling()?Fs:"retrieveActionViewForNewObject":this.shouldUseUnifiedHandling()?Os:this.isObjectCaseType(e)?ws:Os;static shouldUseUnifiedHandling=()=>!0;static shouldAppendExcludeQueryParam=()=>LE.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=ny.getUniqueGadgetId()}}const ry=ny,ay=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},sy=e=>{if(ry.shouldUseUnifiedHandling()&&ry.isObjectCaseType(String(e?.caseTypeID))&&!ay(e))return!0;if(ry.isObjectCaseType(String(e?.objectTypeID))&&!ay(e))return!0;if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1){if(n[e].ID===t)return"create"===n[e].transitionType&&"active"===n[e].visited_status}}return!1},oy=(e,t)=>{if(e&&t){const n=hC.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:r,type:a}=n;return"worklist"===a?.toLowerCase()&&r===e}return!1},iy=(e,t)=>{const n=yC.getPropertyValue(Ur.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=yC.getPropertyValue(Ur.CASE_INFO.AVAILABLEACTIONS,t,e);let a=!1;if(r&&n){const e=r.find((e=>e.ID===n));e&&(a=e.type.toLowerCase()===Ur.LOCAL_ACTION_TYPE.CASE_WIDE.toLowerCase())}if(e&&!r){const t=JA(e);a=t?.context_data?.actionType===Fr.CASE}return a},cy=e=>tC(null,Fr.CASE_VIEW_MODE_PROP,e)===Fr.PERFORM_MODE&&(e.includes(Fr.WORKAREA)||e.includes(Fr.MODAL)||e.includes(Fr.ACTIONAREA)),ly=(e,t)=>cy(e)&&!iy(e,t),dy=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},uy=(e,t,n)=>{let r;const a=e?.find((e=>e.ID===t))?.actions,s=a?.filter((e=>e.ID===Fr.FIX_BROKEN_ASSIGNMENTS))||[];return r=n&&s?.length>0?s[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),r},py=(e,t,n,r)=>{let a;return a=e?uy(e,t,n):r||Mr.getDefaultQualifiedName("Create"),a},hy=(e,t)=>ry.shouldUseUnifiedHandling()?ga:ry.isObjectCaseType(e)||t?Rs:ga,gy=(e,t,n)=>{let r,a,s,o,i,c,l,d,u;const p=JA(e),h=p?.caseInfo?.caseTypeID||p?.objectInfo?.objectTypeID,g=ry.shouldUseUnifiedHandling();return n?.isTriggeredFromDifferentContext||e.includes(Fr.ACTIONAREA)?(r=e.includes(Fr.ACTIONAREA)?void 0:p.caseInfo?.assignments?.[0]?.ID,a=p.caseInfo.ID,s=p.caseInfo.assignments,o=p.caseInfo.activeActionID,i=p.caseInfo.availableActions,c=p.caseInfo,l=p.caseInfo.businessID,d=p.caseInfo.caseTypeID,u=p.caseInfo.caseTypeName):!g&&p?.objectInfo&&ry.isObjectCaseType(h)?(a=p.objectInfo.ID,o=p.objectInfo.activeActionID,i=p.objectInfo.availableActions,c=p.objectInfo,l=p.objectInfo.businessID,d=p.objectInfo.objectTypeID,u=p.objectInfo.objectTypeName):(r=t.getValue(Fr.getProperty(Ur.CASE_INFO.ASSIGNMENT_ID)),a=t.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID)),s=t.getValue(Fr.getProperty(Ur.CASE_INFO.ASSIGNMENTS)),o=t.getValue(Fr.getProperty(Ur.CASE_INFO.ACTIVE_ACTION_ID)),i=t.getValue(Fr.getProperty(Ur.CASE_INFO.AVAILABLEACTIONS)),c=t.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO)),l=t.getValue(Fr.getProperty(Ur.CASE_INFO.BUSINESS_ID)),d=t.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_TYPE_ID)),u=t.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_TYPE_NAME))),{assignmentID:r,caseID:a,assignments:s,localActionID:o,caseActions:i,caseInfo:c,businessID:l,caseTypeID:d,caseTypeName:u}},fy=(e,t)=>{if(Object.keys(e??{}).length>0&&t?.startsWith("http")){const n=new URL(t),r=new URLSearchParams(n.search);return Object.keys(e).forEach((t=>{r.append(t,String(e[t]))})),n.search=r.toString(),n.toString()}return t},my=(e,t="case")=>{const n=e?.payload?.err?.response?.data?.displayButtonsOnErrors||[],r=e?.payload?.err?.response?.status;if(Array.isArray(n)&&n.length>0&&424===r){n.forEach((e=>{e.isErrorButton=!0}));const r=e.payload.context,a=JA(r),s=((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?Ur.DATA_INFO.DATA_INFO:Ur.CASE_INFO.CASE_INFO]:{actionButtons:{secondary:s}}},target:sE(r),context:r};QA({type:Ca,payload:o})}},yy=e=>({type:wg.REFRESH_DATA,payload:e}),Iy={},Ey=(e,t,n,r,a,s,o,i,c,l)=>{if(!(e&&r&&t))return;const d=l.actionMgrID||Vp.getNextActionMgrId(),u={ID:e,actionID:t,objectTypeID:n,context:r,caseWideAction:a,isObjectType:s,isExternalObject:o,isExternalCase:i,casetypeID:c,options:{...l,actionMgrID:d}};l.isFillFormWithAI?QA((e=>({type:Ps,payload:e}))(u)):QA(yy(u))},Ay=(e,t,n,r,a)=>{if(!(e&&n&&t))return;r&&(r=hC.convertPageRefToClipboardPageNotation(r));QA(yy({ID:e,viewID:t,context:n,options:a,caseViewAction:!0,interestPage:r}))},Cy=(e,t,n,r,a,s,o,i,c,l={})=>{if(!((e||t)&&r&&n&&a))return;a&&(a=hC.convertPageRefToClipboardPageNotation(a));const d={ID:o||c!==Fr.ACTION?e:t,actionID:n,context:r,options:l,interestPage:a,interestPageActionID:s,isLocalAction:o,isMultiRecordData:i,editType:c};QA(yy(d))},Sy=(e,t,n)=>{Iy[t]||(Iy[t]={}),e&&!Iy[t][e]&&(Iy[t][e]={pageReference:n})},Ny=(e,t,n)=>{const r={pageName:(a=t.substring(t.lastIndexOf(" ")+1)).substring(0,a.lastIndexOf(".")),propertyName:a.substring(a.lastIndexOf(".")+1)};var a;const s=fA(r.propertyName,n||e.getValue(Fr.CLASS_ID,r.pageName));return!!s?.isDeclarativeTarget},_y=(e,t,n)=>{const r=n||e.getRawMetadata()?.config?.value;let a=!1;if(r){const n=_o.trimAnnotation(r);let s;s=t?hC.resolvePageClass(n,t):yC.resolveClassID(r,e.getPageReference(),e.getContextName());const o=fA(_o.getLeafPropertyName(r),s);if(a=!!o?.isDeclarativeTarget,!a&&o?.additionalInformation){const e=_o.trimAnnotation(o?.additionalInformation);a=nf.isDecisionParagraph(e,o.classID)}!a&&o?.datasource?.parameters&&(a=((e,t,n)=>{let r=!1;if(Array.isArray(t)){const a=t=>{const a=t.value;return a.startsWith("@P")&&(r=Ny(e,a,n)),r};t.some(a)}else if("object"==typeof t)for(const a of Object.keys(t))if(t[a].startsWith("@P")&&(r=Ny(e,t[a],n),r))break;return r})(e,o?.datasource?.parameters,t)),a||(a=o?.datasource?.tableType===Fr.DECISION)}return a},by=(e,t)=>{const n=n=>(e=>"string"==typeof e&&e.startsWith(Fr.PROPERTY_ANNOTATION))(n)&&_y(e,t,n),r=e=>!(!e||"object"!=typeof e)&&Object.values(e).some((e=>n(e)||r(e)));return r(e.getRawMetadata()?.config)},Ty=e=>{(e.isWhenExist()||by(e))&&Sy(e.getCurrentView(),e.getContextName(),e.getPageReference())},Py=e=>{if(!e)return!1;const t=KA()?.getState()?.data?.[e],n=t?.caseInfo?.caseTypeID||t?.objectInfo?.objectTypeID;return ry.isObjectCaseType(n)},Oy=(e,t,n)=>{const r=iy(e,t);let a,s,o="",i="";const c=n=>yC.getPropertyValue(n,t,e)||"",l=ry.shouldUseUnifiedHandling(),d=c(Ur.CASE_INFO.CASE_INFO_CLASSID)||c(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID)||n?.classID||"",u=ry.isObjectCaseType(d)||t.startsWith(Fr.OBJECT_INFO.OBJECT_INFO),p=ry.isExternalCaseType(c(Ur.CASE_INFO.CASE_INFO_CLASSID)),h=ry.isExternalObject(d),g=c(Fr.getProperty(Ur.CASE_INFO.BUSINESS_ID));if(u&&Py(e)&&!p)o=d,n.isObjectWideAction=!0,a=c(l?Ur.CASE_INFO.ACTIVE_ACTION_ID:Ur.OBJECT_INFO.ACTIVE_ACTION_ID),a||(a=Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW)),s=c(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID))||o;else if(p&&!g)a=Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW),s=c(Ur.CASE_INFO.CASE_INFO_CLASSID),i=c(Ur.CASE_INFO.CASE_TYPE_ID);else if(a=c(Ur.CASE_INFO.ACTIVE_ACTION_ID)||c(Ur.CASE_INFO.ASSIGNMENTACTION_ID),r)s=c(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID));else{s=c(Fr.getProperty(Ur.CASE_INFO.ASSIGNMENT_ID))||c(Fr.getProperty(Ur.CONTEXT_DATA_ASSIGNMENTID))}Ey(s,a,o,e,r,u,h,p,i,n)},Dy=e=>{const{context:t,pageReference:n}=e,r=(e=>Iy[e]&&Object.keys(Iy[e]).length>0&&cy(e))(t);if(!r)return;const a=yC.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,t),{isMultiRecordData:s,editType:o}=a||{};if(s){const e=yC.getPropertyValue(Ur.CASE_INFO.CASE_INFO_ID,n,t),r=yC.getPropertyValue(Ur.CASE_INFO.ASSIGNMENT_ID,n,t),{interestPage:i,interestPageActionID:c,actionID:l,isLocalAction:d,viewName:u}=a;o===Fr.ACTION?Cy(e,r,l,t,i,c,d,s,o):Ay(e,u,t,i,{})}else Oy(t,n,{})},vy=(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},Ry=(e,t)=>{const n=e.url===t.url,r=e.interestPage===t.interestPage;return n&&r},$y=(e,t)=>{const n=e.url?.includes("/refresh?refreshFor="),r=t.url?.includes("/refresh?refreshFor="),a=e.url?.endsWith("/refresh")&&!n,s=t.url?.endsWith("/refresh")&&!r;if(a&&s)return Ry(e,t);if(a&&r)return!0;if(n){if(s)return"CANCEL_REFRESH";if(r)return Ry(e,t)}return!1},xy=e=>{const t=(e=>{const t=[];return md.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const r=n.split(".");r.shift();let a=r.join(".");e&&a&&(a=hC.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a}))})),t})(e),n=(e=>{const t=[];return md.getWhens(e).forEach((({name:e,type:n,pageReference:r})=>{const a=r.split(".");a.shift();let s=a.join(".");e&&s&&(s=hC.convertPageRefToClipboardPageNotation(s),t.push({name:e,context:s,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}};const wy=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}},My={IDLE:"idle",SAVING:"saving",SKIPPED:"skipped",ERROR:"error"},Ly='input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], input[type="password"], input[type="date"], input[type="time"], input[type="month"], input[type="week"], input[type="datetime-local"], input:not([type])',Uy=`${Ly}, textarea, [contenteditable="true"]`,Fy=new Map,jy=new Map,ky=new Set,Vy=new Map,By=new Map,Gy=new Set,Wy=(e,t)=>{Vy.get(e)?.forEach((e=>e(t)))},Hy=(e,t)=>{const n=jy.get(e);void 0!==n&&clearTimeout(n),jy.set(e,setTimeout((()=>{jy.delete(e),t()}),(()=>{const e=Number(LE.getFeatureMap()?.pyAutoSaveDurationInMS);return e>0?e:5e3})()))},qy=e=>{const t=Wr(e),n=sE(t);return!n||!JI(n)||VI(n)===t},zy=async e=>{if(ky.has(e))return;if(Gy.has(e))return;const t=Fy.get(e);if(!t)return;if(!qy(e))return;const n="undefined"!=typeof document?document.activeElement:null;if(n&&n===(e=>ap.get(e)??null)(e)&&n.matches(Ly))return void Hy(e,(()=>zy(e).catch((()=>{}))));(e=>{const t=By.get(e);if(t&&0!==t.size){for(const[n,r]of t)km.executeStateMachine(e,n,r,!0,{skipStateUpdate:!1,skipDirtyValidation:!1})||QA(aS({reference:n,value:r,context:e,isImplicit:!1,skipDirtyValidation:!1}));By.delete(e)}})(e);let r=!1;rp(!0);try{if(!jm.hasUnsavedChanges(e))return;r=jm.isFormValid(e)}finally{rp(!1)}if(r){ky.add(e),Wy(e,My.SAVING);try{await((e,t)=>{const n=e,r=n.includes(Fr.MODAL),a=eC(Ur.CASE_INFO.CASE_INFO_ID,null,n),s=eC(Ur.CASE_INFO.ASSIGNMENT_ID,null,n),o=eC(Ur.CASE_INFO.ACTIVE_ACTION_ID,null,n)||eC(Ur.CASE_INFO.ASSIGNMENTACTION_ID,null,n),i=eC(Ur.CASE_INFO.CASE_TYPE_ID,null,n),c=eC("isProcessAction","isProcessAction",n),l=Vp.getNextActionMgrId(),d={context:n,containerItemID:e,assignmentID:s,actionID:o,caseID:a,containerName:t,caseType:i,isModalAction:r,isFormValid:void 0,isProcessAction:c,saveOnly:!0,autosave:!0,actionMgrID:l};let u,p;const h=new Promise(((e,t)=>{u=e,p=t}));if(!u||!p)throw new Error("Promise executor did not synchronously assign resolveFn/rejectFn.");return Vp.register(l,h,u,p,rh,d,!0),Bg.executeOrQueueDeferredAction(ah(d)),h})(e,t.containerName),jm.clearChangedProperties(e),Wy(e,My.IDLE)}catch{Wy(e,My.ERROR)}finally{ky.delete(e)}}else Wy(e,My.SKIPPED)},Yy=()=>{if("undefined"==typeof document)return;const e=document.activeElement;if(e?.matches(Uy))for(const e of Fy.keys())jy.has(e)&&qy(e)&&Hy(e,(()=>zy(e).catch((()=>{}))))},Ky=Yy,Qy=e=>{"Tab"===e.key&&Yy()},Jy=e=>{const{target:t}=e;if("undefined"!=typeof Element&&t instanceof Element&&t.matches(Ly))for(const e of Fy.keys())jy.has(e)&&qy(e)&&(sp(e,t),Hy(e,(()=>zy(e).catch((()=>{})))))},Xy=e=>Fy.has(e),Zy=e=>{const t=jy.get(e);void 0!==t&&clearTimeout(t),jy.delete(e),ky.delete(e),Fy.delete(e),Gy.delete(e),By.delete(e),op(e),0===Fy.size&&"undefined"!=typeof document&&(document.removeEventListener("pointerdown",Ky),document.removeEventListener("keydown",Qy),document.removeEventListener("input",Jy,{capture:!0}))},eI=e=>{const t=`${e}/`;for(const e of[...Fy.keys()])e.startsWith(t)&&Zy(e)},tI=e=>{const t=jy.get(e);void 0!==t&&(clearTimeout(t),jy.delete(e))},nI=e=>{Fy.has(e)&&(Gy.has(e)||Hy(e,(()=>zy(e).catch((()=>{})))))},rI=e=>{Gy.delete(e),jm.hasUnsavedChanges(e)&&nI(e)},{APP:aI}=Fr;let sI={},oI={},iI={};const cI="You will lose unsaved changes. Do you want to continue?",lI="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",dI=(e=aI.APP,t,n)=>{let r=[],a=[];t||(r=ey(e,!0)),n||(a=(e=>{const t=md.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===yC.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const s={};((e,t,n)=>{const r=oI[t]||{};Object.keys(r).forEach((t=>{const a=r[t].associatedProperty;Object.hasOwn(r,t)&&(void 0===a||n.includes(a))&&hC.buildObject(t,e,r[t].value)}))})(s,e,r);const o=sI[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&r.includes(e)||t;Object.hasOwn(o,e)&&n&&!a.includes(e)&&hC.buildObject(e,s,o[e].value)})),s},uI=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete sI[t]?.[n],delete oI[t]?.[n]};ld=(e,t)=>{uI({context:e,reference:t})};const pI=e=>e&&iI[e],hI=e=>{e&&iI[e]&&(iI[e]=!1)},gI=(e,t)=>{const{context:n,initialValue:r="",isStrictTracking:a,associatedProperty:s}=t,o=t.reference.startsWith(".")?t.reference.substr(1):t.reference;e[o]?e[o].previousValue=eC(t.reference,null,n):(e[o]={initialValue:r||eC(t.reference,null,n)},e[o].previousValue=e[o].initialValue),e[o].value=t.value,s&&(e[o].associatedProperty=s),a&&e[o].value===e[o].initialValue&&uI(t)},fI=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;md.isFieldExists(n,r)||(oI[n]=oI[n]||{},gI(oI[n],t)),sI[n]=sI[n]||{},gI(sI[n],t)},mI=({value:e,context:t,reference:n})=>{const r=sE(t),a=vI(r,t)||{};if(wy.isPageInstruction(n)||a?.subscriptFieldName)return;const s=n?.startsWith(".")?n?.substr(1):n;sI[t]=sI[t]||{};sI[t][s]||(sI[t][s]={initialValue:eC(s,null,t)}),sI[t][s].value=e},yI=e=>e&&sI[e]&&Object.keys(sI[e]).some((t=>sI[e][t].initialValue!==sI[e][t].value))||!!pI(e),II=(e,t)=>{if(!e||!t)return!1;const n=sI[e]&&sI[e][t];return!!n&&n.previousValue!==n.value},EI=e=>{e&&sI[e]?(sI[e]={},oI[e]={}):"all"===e&&(sI={},oI={},iI={}),iI[e]&&(iI[e]=!1),op(e)},AI=(e,t,n=new Set)=>{if(n.has(t))return;n.add(t);[...Ao.getDependencies(e,t),...HA.getResetDependencies(e,t)].forEach((t=>{const r=hC.getPropertyNameFromDependency(t);if("object"==typeof t&&"multiRecord"===t.mode){const t=r.split("."),n=`.${t.pop()}`,a=t.join(".");if(km.isStateMachineExist(e,a,n)){km.getStateMachine(e,a,n).deleteAll()}else if(Xy(e)){km.setStateMachine(e,n,a,new Nu(n,a,e));const t=km.getStateMachine(e,a,n);t?.deleteAll(!1)}}else wy.isPageInstruction(r)&&km.executeStateMachine(e,r,""),QA({type:Xr,payload:{reference:r,value:"",context:e,isArrayDeepMerge:!0,isImplicit:!0}});AI(e,r,n)}))},CI={propertyChangeMiddleware:()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ea&&(yo(r),(e=>{const{context:t,pageReference:n,value:r,reference:a}=e;HA.triggerCascade(t,a,r);const s=Ao.getDependencies(t,a),o={context:t,datapages:{}};AI(t,a),s.forEach((r=>{let a=n;r.startsWith(n)||(a="");const s=r.replace(`${a}`,"").split(".").filter((e=>!!e));s.pop();const i=s.join("."),c=eC(`.${i}`,a,t)?.classID||e.classID,l=fA(r.split(".").pop(),c),{datasource:d}=l,u={},p=[];d.parameters.forEach((e=>{e?.value?(u[e.name]=ch.isProperty(e.value)?eC(`.${hC.getFullPropertyReference([i,hC.getPropertyName(e.value)])}`,a,t):e.value,void 0===u[e.name]||null===u[e.name]||""===u[e.name]?(u[e.name]="",p.push(Fr.NULL_STRING)):p.push(u[e.name])):(u[e.name]="",p.push(Fr.NULL_STRING))}));const h=d.name.concat(Fr.UNDERSCORE_STRING,hC.getHashedString(p.join(Fr.HASH_DELIMITER))),{name:g}=d,f=OA(g);o.datapages[h]={mode:d.mode,propertyName:r,name:d.name,dataViewParameters:u,refreshStrategy:f?.refreshStrategy}})),s.length&&QA({type:ds,payload:o})})(r),Bg.registerBlockingAction(r.context).catch((()=>{})),setTimeout((()=>{(II(r.context,r.reference)||Vu(r.context))&&Dy(r),Rg.triggerRefreshForType("PROP_CHANGE",r.reference,r.context),Bg.deRegisterBlockingAction(r.context).catch((()=>{}))}),0)),n===hs&&!r?.isDefault){const{context:e,referenceList:t,c11nEnv:n,listIndex:a,instruction:s,skipDirtyValidation:o=!1}=r;0===a&&"INSERT"===s&&n&&(e=>{let t=!1;const n=e?.getRawMetadata()?.config;n?.type&&"multirecordlist"===n.type&&n?.contextClass&&(t=function e(t,n){for(const r of n){const n=Rf({meta:r}).getPConnect();if(n.isWhenExist()||by(n,t))return!0;if(r.children&&e(t,r.children))return!0}return!1}(n.contextClass,n.children??[])),t&&Sy(e.getCurrentView(),e.getContextName(),e.getPageReference())})(n),setTimeout((()=>{Rg.triggerRefreshForType("PROP_CHANGE",t,e)||Dy({context:e,pageReference:t})}),0),o||(iI[`${e}`]=!0)}if(n===Xr||n===Zr){const{reference:e,isImplicit:n,context:a,skipDirtyValidation:s=!1}=r;md.updateFieldNodeValue(a,e,r.value),wy.isPageInstruction(e)||s?s||(iI[`${a}`]=!0):fI(t),(r.removePropertyFromChangedList||n)&&uI(r)}if(n===wa||n===Ma){const{transientItemID:e,data:t}=r;hC.iterateLeafNodes(t,(t=>{uI({context:e,reference:t.join(".")})}))}if(n&&[Fa,Da,ka,xa].includes(n)){EI(r.context),HA.purgeResetDependencies(r.context),(a=r.context)&&Iy[a]&&delete Iy[a];(r.childContainersContexts||[]).forEach((e=>{EI(e)}));(r.transientItems||[]).forEach((e=>{EI(e)}))}var a;e(t)},getChanges:dI,recordChange:fI,isDirty:()=>Object.keys(sI).some((e=>yI(e))),isPropertyDirty:II,isContextDirty:yI,resetChangedProperties:EI,deleteRecordedChange:uI,isComplexObjectMerged:pI,resetComplexObjectDirtyStatus:hI};const SI=new class{getCoreheaders(e){const t=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Fr.PRIMARY}`,n=VI(t),r=WI(n),a=yC.getProperty(Fr.COREHEADERS,"",r);if(a&&e in a)return a[e]}},NI={defaultLimit:16},_I={SINGLE:"single",MULTIPLE:"multiple"},bI={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},TI=()=>KA()?.getState()?.containers;function PI(e){return"string"==typeof e&&""!==e.trim()}const OI=e=>PI(e)?KA()?.getState().containers[e]:null,DI=(e,t,n)=>{if(!n)return{continueExecution:!1,containerItemID:e};const r=OI(n);let a=!1,s=e;return r?.accessedOrder.forEach((e=>{t===r.items[e].key&&(a=!0,s=r.items[e].context)})),{continueExecution:a,containerItemID:s}},vI=(e,t)=>{if(!PI(e)||!PI(t))return null;const n=TI(),r=n?.[e];return r&&r.items&&r.items[t]||null},RI=e=>PI(e)?KA()?.getState().containers[e]?.items:null,$I=e=>PI(e)&&KA()?.getState().containers[e]?.accessedOrder||[],xI=e=>PI(e)&&$I(e)?.length>0||!1,wI=(e,t,n)=>{if(!PI(e)||!PI(t))return!1;const r=TI(),a=r?.[e],s=a&&a.items||null,o=n||((e,t)=>e===t);if(t&&s)for(const e of Object.keys(s))if(o(t,s[e].key))return!0;return!1},MI=e=>{const{containers:t}=KA()?.getState()||{};return!(!t||!PI(e))&&Object.keys(t).some((n=>t[n]?.accessedOrder?.includes(e)))},LI=(e,t,n)=>{if(!PI(e)||!PI(t))return null;const r=TI(),a=r?.[e],s=a&&a.items||null,o=n||((e,t)=>e?.toLowerCase()===t?.toLowerCase());if(t&&s)for(const e of Object.keys(s))if(o(t,s[e].key))return e;return null},UI=(e,t)=>{if(e&&t)for(const a of Object.keys(t))if(n=e,r=t[a].key,n?.toLowerCase()===r?.toLowerCase())return t[a];var n,r;return null},FI=e=>{if(!PI(e))return null;const t=TI()??{};for(const n of Object.keys(t))if(t[n]){const r=t[n].items??null,a=UI(e,r);if(a)return a}return null},jI=(e,t)=>{if(!PI(e)||!PI(t))return!1;const n=TI();return n&&Object.hasOwn(n,`${e}/${t}`)},kI=(e,t)=>{if(!PI(e)||!PI(t))return null;const n=TI(),r=n?.[`${e}/${t}`];return r&&r.type},VI=e=>{if(!PI(e))return null;let t=null;const n=TI();if(n&&n[e]){const r=n[e],{accessedOrder:a}=r;t=a&&a.length>0?a[a.length-1]:null}return t},BI=(e,t,n)=>{if(!PI(e)||!PI(t))return!1;const r=LI(e,t,n);return!!r&&r===VI(e)},GI=(e,t)=>{let n=null;const r=TI();if(!r)return null;for(const a of Object.keys(r))if(r[a].items){const s=r[a].items[e];if(n=s?s[t]:null,n)break}return n},WI=e=>PI(e)?GI(e,"context"):null,HI=e=>{if(!PI(e))return null;let t=null;const n=TI();if(n&&n[e]){const r=n[e],{accessedOrder:a}=r,s=a&&a.length>0?a[a.length-1]:null;t=WI(s)}return t},qI=e=>{if(!PI(e))return[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const a=TI();if(!a)return[];const s=n=>{const a=[];return Object.keys(n).forEach((n=>{n.startsWith(t)&&n!==t&&a.push(n),n===e&&(r=!0)})),a};for(const e of Object.keys(a))if(a[e].items){const t=s(a[e].items);t&&t.length>0&&(n=n.concat(t)),n=n.sort()}return r?n:[]},zI=e=>{if(!PI(e))return[];const t=[],n=TI();if(!n)return[];for(const r of Object.keys(n))r.startsWith(e)&&r!==e&&t.push(r);return t},YI=e=>{if(!PI(e))return[];const t=[],n=TI();if(!n)return[];for(const r of Object.keys(n))if(r.startsWith(e)&&r!==e){($I(r)||[]).forEach((n=>{WI(n)!==e&&t.push(WI(n))}))}return t},KI=e=>{const t=[...YI(e),e],n=[],r=KA()?.getState().data||{};return t.forEach((e=>{Object.hasOwn(r,`${e}/${Fr.SUGGESTION}`)&&n.push(`${e}/${Fr.SUGGESTION}`)})),n},QI=e=>PI(e)?e&&OI(e)&&OI(e).type===_I.SINGLE:null,JI=e=>PI(e)?e&&OI(e)&&OI(e).type===_I.MULTIPLE:null,XI=e=>PI(e)&&OI(e)&&OI(e).items&&Object.keys(OI(e)?.items).length>0||!1,ZI=e=>e&&NI[e]?NI[e]:NI.defaultLimit,eE=(e,t=NI.defaultLimit)=>{PI(e)&&(NI[e]=t)},tE=e=>{if(!PI(e))return!1;let t=!1;const n=OI(e),{items:r={}}=n,a=Object.keys(r),s=ZI(e);return a&&a.length>0&&a.length>=s&&(t=!0),t},nE=e=>{if(!e||!PI(e.name)||!PI(e.context))return null;const t=e?.name,n=OI(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],a=zI(`${Fr.APP.APP}/${Fr.PREVIEW}`),s=YI(`${Fr.APP.APP}/${Fr.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...s],childContainers:a}},rE=e=>{if(!PI(e))return!1;const t=WI(e);return yI(t)||_m(e)},aE=e=>{if(!PI(e))return null;let t;const n=OI(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!rE(n)){t=n;break}}return t},sE=e=>{if(!PI(e))return null;const{containers:t}=KA()?.getState()||{};if(t)for(const n of Object.keys(t))if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(Fr.UNDERSCORE_STRING);return e.slice(0,n)},oE=async(e,t={})=>{if(!PI(e))return Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=sE(e),r=WI(e),{skipDirtyCheck:a}=t;let s=!0,o=[];if(rE(e)&&!a&&(kp.disableLoadingIndicator({context:r}),s=await lm.confirm(VE().getLocaleValue(cI,"Messages")),kp.enableLoadingIndicator({context:r})),s){const{accessedOrder:a=[],items:s={},type:i}=OI(n);o=a.filter((t=>t!==e));const c=o[o.length-1],l=s[c]||{},{semanticURL:d=Fr.FORWARD_SLASH_STRING,context:u}=l;o.length>0&&d&&d!==Fr.FORWARD_SLASH_STRING?_S({directUrlUpdation:!0,semanticURL:d,options:{containerItemID:c,context:u}}):_S({directUrlUpdation:!0,semanticURL:Fr.FORWARD_SLASH_STRING,options:{}});QA(WC({containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:o,containerType:i},...void 0!==t.eventName?{eventName:t.eventName}:{}}))}return{newAccessedOrder:o,removeItem:s}},iE=(e,t,n,r)=>{const a="root",s=Hr(t,a,!0),o=js(t,a),i={data:n,context:r?"app":s},c=[$C({root:e,containerItemID:s,context:r?"app":s,target:o,containerName:t})];c.push(_C(i)),QA(c)},cE=(e,t,n)=>{let r=$I(e);r=r.filter((e=>e!==t));let a=!1;for(let e=0;e<r.length;e+=1){if(WI(r[e])===n){a=!0;break}}return a},lE=e=>{if(!PI(e))return!1;const t=TI(),n=WI(e),r=t?Object.keys(t):[];let a=!1;for(let t=0;t<r.length&&(a=cE(r[t],e,n),!a);t+=1);return a},dE=e=>{Array.isArray(e)||(e=[e]);const t=TI()||{};return e.map((e=>{const n=sE(e);return hC.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},uE=e=>{const{transientItemID:t,data:n,options:r}=e,a=hC.deepClone(KA()?.getState().data[t]);r?.reset&&hC.iterateLeafNodes(a,(e=>{"classID"!==e[e.length-1]&&hC.setIn(a,e,"")})),QA(wC({transientItemID:t,data:hC.mergeDeep(n,a)}))},pE=e=>{const{transientItemID:t,data:n}=e;QA(LC({transientItemID:t,data:n}))},hE=e=>{const t=hC.deepClone(KA()?.getState().data[e]);hC.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&hC.setIn(t,e,"")})),QA(MC({transientItemID:e,data:t}))},gE=e=>{const t=hC.deepClone(KA()?.getState().data[e]);hC.iterateLeafNodes(t,(e=>hC.setIn(t,e,""))),QA(UC({transientItemID:e,data:t}))},fE=e=>{KA()?.getState().data[e]&&gE(e);const t=e.lastIndexOf("/"),n=t>0?e.substring(0,t):e,r=sE(n);QA(qC({transientItemID:e,containerItemID:n,target:r}))};class mE{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 yE=(e,t={})=>{if(!PI(e))return;const n=OI(e),r=Array.isArray(n?.accessedOrder)?n.accessedOrder:[];if(0===r.length)return;const{remove:a,keep:s}=t;let o;if(void 0!==s){const e=new Set(s);o=r.filter((t=>!e.has(t)))}else if(void 0!==a){const e=new Set(a);o=r.filter((t=>e.has(t)))}else o=[...r];for(const t of o){const n=WI(t),r=dE(t);QA(WC({containerItemID:t,context:n,target:e,...r.length>0&&{transientItems:r}}))}},IE=()=>mE,EE=e=>{const t={containerName:e};t.childContainers=zI(e),QA({type:Ba,payload:t})},AE=(e,t)=>{const n=qI(e),{key:r}=vI(sE(e),e),a=[];n.forEach((e=>{const{key:n}=vI(sE(e),e);if(n===r){const n={data:{caseInfo:{headers:{etag:t}}},target:sE(e),context:e};a.push({type:Ca,payload:n})}})),a.length&&QA(a)},CE=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:sE(e),context:e};n.push({type:Ca,payload:r}),n.length&&QA(n)},SE=()=>LE.isPortalLoaded?"app":"root",NE=()=>SI,_E=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:sE(e),context:e};QA({type:Ca,payload:n})},bE=(e,t)=>{const n=LI(e,t),r=LI(`${n}/workarea`,t);return WI(r)},TE=e=>PI(e)?GI(e,"parentContext"):null,PE=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},OE=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},DE=()=>dh,vE=()=>"undefined"==typeof window?"":kh(window.location.pathname),RE=()=>"undefined"==typeof window?"":kh(window.location.pathname+window.location.search),$E=(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 xE=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=>{jh(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=()=>kh(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>kh(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("/")&&qh()&&"PREVIEW"!==LE.getRenderingMode()&&this.setDefaultClassName(""),kh(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="",r={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,r={...a.payload})})),!n&&this.appRoutes&&this.appRoutes[e]&&(n=this.appRoutes[e].routeKey,r={...this.appRoutes[e].payload}),{routeKey:n,payload:r}};transformRemoteCasePayload(e){const{caseClassName:t,caseID:n}=e;if(!Vr.isRemoteCase(t))return e;const{RemoteClassGroup:r,RemoteSystemID:a}=Vr.getRemoteCase(t??"");return{...e,caseID:n?.replace(t??"",r?.toUpperCase()),RemoteSystemID:a}}getEndPointInfo=e=>{e=this.stripIgnoredParams(e);const t=qh();let n=this.processUrl(e,!0),r=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0);r||(n=this.processUrl(this.defaultViewUrlPath,!t),r=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0)||"");const{routeKey:a,payload:s}=this.getRouteDetails(r,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(s)}};return this._resolveRoute(l,this.processUrl(e,!1),r)};getSemanticURL(e,t,n){return this.buildSemanticURL(e,t,n)}getResolvedSemanticURL(e,t,n={},r){const a=this.getSemanticURL(e,t,n);let s=a;if(jh(a)){const e=a.match(Fh);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(s=s.replace(e,String(n[t])))}))}const o=NS(s,r),i=new URL(o);return this.isDefaultPortal()||!this.getPortalName()||i.searchParams.toString().includes("portal=")||i.searchParams.append("portal",this.getPortalName()),r&&!i.searchParams.has("lang")&&i.searchParams.append("lang",r),Bh(i.toString())}buildDocumentTitle(e,t,n){const r=n??"";return LE.getCaseLabelFirstInTitle()?e&&t?`${e} (${t}) - ${r}`:r:e&&t?`${t}: ${e} - ${r}`:r}updateSemanticURLAndDocumentTitle(e,t){const{key:n,actionName:r,caseClassName:a,isRemoteCase:s,name:o}=e;if(s&&!a)return;const i=this.getSemanticURL(r,{caseClassName:a}).replace(/{.+?}/,String(Bf(n))),c=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Ur.PRIMARY}`,l={semanticURL:i,directUrlUpdation:!0,options:{acName:c,context:HI(c)}},d=vE();i&&!d.includes(i)&&SS(l,t);const u=n.substring(n.lastIndexOf(" ")+1),p=LE.environmentInfoObject?.pxApplication?.pyLabel,h=this.buildDocumentTitle(o,u,p);$S(h)}buildSemanticURL(e,t,n){const{urlPattern:r}=this.appRoutesMeta?.[e]||{},a=r?.split("/").length,s=r?.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 s?.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 r=this.appRoutes[e].payload,a={...n};delete a.dataViewName,delete a.dataContext;const s=r.dataViewKeys||r.dataContextParameters||{},o=Object.keys(t).every((e=>t[e]===r[e]));return!!o&&(hC.isEmpty(s)||hC.isEmpty(a)?o:Object.keys(a).every((e=>Object.hasOwn(s,e))))}));return i?this._getQueryParamsResolvedURL(i,n):o.includes("cases/{id}")&&n?.id?"cases/{id}":""}_getQueryParamsResolvedURL(e,t,n=!1){const[r,a]=e.includes("?")?e.split("?"):[e];if(a&&t&&Object.keys(t).length>0){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;const s=new URLSearchParams(a),o={};for(const[r,a]of s.entries())if("string"==typeof a&&jh(a)){const s=this._getDynamicKeyName(a),i=s.toLowerCase(),c=n?e:t,l=n?t[s]??c[i]:c[s];null!=l&&(o[r]=l)}else"string"==typeof a&&(o[r]=a);const i=new URLSearchParams(Object.entries(o).map((([e,t])=>[e,String(t??"")])));return`${r}?${Bh(i.toString())}`}return r}_getQueryParamsObject(e){const t={};if(!e)return t;for(const n of e.split("&")){const e=n.indexOf("=");if(-1!==e){const r=n.slice(0,e),a=n.slice(e+1);try{t[decodeURIComponent(r)]=decodeURIComponent(a)}catch{t[r]=a}}}return t}getRestEndPoint(e,t){try{return this._buildRestApi(e,t)}catch(e){return console.error(e),null}}_buildRestApi(e,t){if(e&&this.appRoutesMeta?.[e]){const{reqType:n,body:r}=this.appRoutesMeta[e].restApi;let{endPoint:a}=this.appRoutesMeta[e].restApi;t?.params&&t.params.pageName&&(a=`${a}&pageName=${t.params.pageName}`);const s=a.match(Fh);if(s)for(let e=0;e<s.length;e+=1){const n=s[e].replace("{","").replace("}",""),r=new RegExp(s[e],"g");a=a.replace(r,t?.[n])}if(r){let e={};return Object.keys(r).forEach((n=>{if(t&&this._isSpecialInstruction(n)){const a=r[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 r={};return"@COPY"===e&&t.forEach((e=>{r[e]=n?.[e]})),r}doesRestApiExist(e){return!(!this.appRoutesMeta||!this.appRoutesMeta[e])}_resolveMatchedRouteQueryParams=(e,t,n,r)=>{if(!e)return;const a=t.indexOf("?"),s=-1!==a?t.substring(a+1):void 0;if(s){const e=`${n.join("/")}?${s}`;return this._getQueryParamsResolvedURL(e,r,!0)}};_resolveRoute=(e,t,n)=>{const r=[],[a,s]=t.includes("?")?t.split("?"):[t],[o,i]=n.includes("?")?n.split("?"):[n],c=a.split("/"),l=o.split("/"),d={};for(let e=0;e<l.length;e+=1)if(r[e]=l[e],jh(l[e])){d[this._getDynamicKeyName(l[e])]=c[e],r[e]=c[e]}const u=this._getQueryParamsObject(i),p=this._getQueryParamsObject(s),h={};for(const[e,t]of Object.entries(p))h[e.toLowerCase()]=t;for(const e of Object.keys(u))jh(u[e])?d[e]=p[e]||h[e.toLowerCase()]:d[e]=u[e];const g=this._resolveMatchedRouteQueryParams(s,n,r,p),f=this._resolvePayload(e,d,n);return{...this._resolveRouteEndPoint(f,n),urlPath:g||r.join("/")}};_resolveRouteEndPoint=(e,t)=>{let{routeEndpoint:n}=e;if(!jh(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(Fh);for(let a=0;a<t.length;a+=1){const s=t[a],o=this._getDynamicKeyName(s);if(void 0!==e.payload[o]){const t=e.payload[o];n=n.replace(s,t)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${o}} in routeEndpoint- ${o} is missing in payload`,r)}}else this._sendWarningAndErrorMessages("Unable to resolve dynamic token(s) in routeEndpoint- payload is missing in routing table for-",r);return{...e,routeEndpoint:n}};_resolvePayload=(e,t,n)=>{if(void 0===e.payload)return e;const r={...e.payload,...this._resolvePayloadRecursive(e.payload,t)};return{...e,payload:r}};_resolvePayloadRecursive(e,t){if(Array.isArray(e))return e.map((e=>this._resolvePayloadRecursive(e,t))).flat();const n={};for(const r of Object.keys(e)){let a=e[r];if("string"==typeof a&&jh(a)){const e=a.match(Fh)??[];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[r]=a}else n[r]=a&&"object"==typeof a?this._resolvePayloadRecursive(a,t):a}return n}_getMatchedRouteInRoutingTable=(e,t)=>{const[n]=e.includes("?")?e.split("?"):[e];let r=this._findMatchedRouteInStaticList(n,t);return void 0!==r?r:(r=this._findMatchedRouteInDynamicList(e),void 0!==r?r:void 0)};_findMatchedRouteInStaticList=(e,t)=>{if(!this.staticRoutesList||!e)return;const n=e.toLowerCase(),r=t?.toLowerCase();if(qh()){const e=this._findMatchingRouteByClass(n,r);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,r])=>{if(!r)return!1;const a=r.payload?.page?.toLowerCase(),s=r.payload?.pageClass?.toLowerCase(),o=a===e||n.toLowerCase()===e;return t?o&&s===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],r=t.split("/");return this.dynamicRoutesList?.find((e=>{const[t,a]=e.includes("?")?e.split("?"):[e],s=t.split("/");if(s.length!==r.length)return!1;let o=0;for(o=0;o<s.length;o+=1){const e=s[o].toLowerCase();if(!jh(e)&&e!==r[o]&&Vh(e)!==r[o])return!1}if(a){const e=new URLSearchParams(n.toLowerCase()),t=new URLSearchParams(a.toLowerCase()),r=new Set,s=new Set,o=/\{[a-zA-Z]+\}/;for(const t of e.keys())r.add(t);for(const e of t.keys())s.add(e);if(s.size!==r.size)return!1;for(const n of r){if(!s.has(n))return!1;const r=t.get(n);if(e.get(n)!==r&&!o.test(r??""))return!1}}return!0}))};_sendWarningAndErrorMessages=(e,t)=>{$E(e,t,"warning"),$E("Error in Generated Routing Table",null,"error"),$E("Back | Forward for this page may NOT work as intended",null,"warning"),$E("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},wE=xE;const ME=new class{constructor(){this.languagePacks=[]}getLocalizationBundles(e=LE.getLocale()){return(this.languagePacks.find((t=>t.pyLangCode===e))?.pyBundles??this.languagePacks.find((e=>e.pyLangCode===Fr.DEFAULT.toUpperCase()))?.pyBundles??[]).sort(((e,t)=>e.pyOrder-t.pyOrder))}async loadLocaleBundle(e){const t=e.map((e=>mg.getPageDataAsync("D_pzBundlesForLocalization","",{locale:e,onlyApp:"false"},{invalidateCache:!0}))),n=(await Promise.allSettled(t)).filter((e=>"fulfilled"===e.status)).flatMap((e=>e.value.pyLanguagePacks));this.setLanguagePack(n)}setLanguagePack(e){e.forEach((e=>{const t=this.languagePacks.findIndex((t=>t.pyLangCode===e.pyLangCode));-1!==t?this.languagePacks[t]=e:this.languagePacks.push(e)}))}};const LE=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false",this.enablePriorityAndUrgencyImprovements=!1}setEnvironmentInfo(e){const t=e?.pxOperator?.pyUserName,n=t?hC.decodeHtmlEntities(t):void 0,r={...e,pxOperator:e.pxOperator?{...e.pxOperator,...n?{pyUserName:n}:{}}:e.pxOperator};this.environmentInfoObject=r;const a=this.environmentInfoObject?.features||hC.convertObjectWithStringToBoolean(this.environmentInfoObject?.pyFeatures)||{granularUIRefresh:!1};this.environmentInfoObject.features={...a,granularUIRefresh:a.granularUIRefresh||a.pyEnableGranularUIRefresh||!1},this.environmentInfoObject.pyGenAIEnabled=!!this.environmentInfoObject.pyGenAIEnabled,Mr.setNamespaceSupport(this.getFeatureMap()?.isNamespaceEnabled);const s=e.requestContext;if(Array.isArray(s)&&s.length>0){const e=s.filter((e=>e.IncludeInURL)).map((e=>e.Key));e.length>0&&xS(e)}ME.setLanguagePack(this.environmentInfoObject.pyLanguagePacks||[])}getOperatorName(){return this.environmentInfoObject?.pxOperator?.pyUserName}getOperatorWorkGroup(){return this.environmentInfoObject?.pxOperator?.pyWorkGroup}getOperatorIdentifier(){return this.environmentInfoObject?.pxOperator?.pyUserIdentifier}getOperatorImageInsKey(){return this.environmentInfoObject?.pxOperator?.pyImageInsKey}getApplicationLabel(){return this.environmentInfoObject?.pxApplication?.pyLabel}getPortalName(){return wE.getPortalName()}setCaseLabelFirstInTitle(e=!0){this.caseLabelFirstInTitle=e}getCaseLabelFirstInTitle(){return this.caseLabelFirstInTitle}getApplicationName(){return this.environmentInfoObject?.pxApplication?.pyRuleName}getUseLocale(){return this.environmentInfoObject?.pxLocale?.pyUseLocale}getAccessGroup(){return this.environmentInfoObject?.pxOperator?.pyAccessGroup}getApplicationID(){return this.environmentInfoObject?.pxApplication?.pyRuleId}getTimeZone(){return this.environmentInfoObject?.pxLocale?.pyTimeZone?.trim()||void 0}getTheme(e){return"dark"===e?.type?this.darkThemeOverrides:this.themeOverrides}setTheme(e,t){return"dark"===t?.type?this.darkThemeOverrides=e:this.themeOverrides=e,$d.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.THEME_CHANGE,e),"dark"===t?.type?this.darkThemeOverrides:this.themeOverrides}getNavOrientation(){return this.navOrientation??this.environmentInfoObject?.pyNavOrientation}setNavOrientation(e){return this.navOrientation=e,$d.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.NAV_ORIENTATION_CHANGE,e),this.navOrientation}setIsWebEmbed(e){return this.isWebEmbed=e,this.isWebEmbed}isWSSPortal(){return this.environmentInfoObject?.pyPortalTemplate===Fr.PORTAL_TYPE.WSS}isDefaultWSSPortal(){return this.isWSSPortal()&&!this.environmentInfoObject?.pyFullObjectDisplayTemplate}isInfinityRuntime(){return"Infinity"===this.environmentInfoObject?.pyExecutionRuntimeName}isGenAIEnabled(){return!!this.environmentInfoObject?.pyGenAIEnabled}getRewriteGenAIDP(){return this.environmentInfoObject?.pyRewriteGenAIDP}isBlueprintExperience(){return!!this.environmentInfoObject?.features?.fromBlueprintExperience}getBrandingInfo(e){return"dark"===e?.type?this.brandingInfoDark:this.brandingInfo}setBrandingInfo(e,t){return"dark"===t?.type?this.brandingInfoDark=e:this.brandingInfo=e,this.brandingInfo}getCookieComplianceMethod(){return this.cookieComplianceMethod}setCookieComplianceMethod(e){this.cookieComplianceMethod=e}setLocale(e){const t=e.replaceAll("-","_").split("_").slice(0,2);this.locale=t.join("-"),this.environmentInfoObject?.pxLocale&&(this.environmentInfoObject.pxLocale.pyUseLocale=this.locale)}getLocale=()=>this.locale;getEnvironmentKeys(){return Object.keys(Fr.ENV_INFO_KEYS)}getMaxAttachmentSize(){return this.environmentInfoObject?.pxApplication?.pyMaxAttachmentSize}getDefaultOperatorDP(){return this.environmentInfoObject?.pxApplication?.pyDefaultOperatorDP}getDocumentUrlDP(){return this.environmentInfoObject?.pxApplication?.pyDocumentUrlDP}getCaseInstanceListDP(){return this.environmentInfoObject?.pxApplication?.pyCaseInstanceListDP}getBaseLocale(){return this.environmentInfoObject?.pxApplication?.pyBaseLocale||"en-US"}getRenderingMode(){return this.environmentInfoObject?.renderingMode}isPegaMobile(){return!!window.pms?.plugins?.c11n_spa||!!window.pms?.plugins?.c11n}shouldUseURLParams(){return"FULL_PORTAL"===this.environmentInfoObject?.renderingMode&&this.getFeatureMap()?.pyUseURLParams}getBuiltOnAppNames(){return this.environmentInfoObject?.pxApplication?.pyBuiltOnApplications}setPreviewMode(){wd.setPreviewMode()}setDefaultCasePage(e){this.pageName=e}getDefaultCasePage(){return this.pageName}disableAssignmentHeader(e){this.isAssignmentHeaderHidden=e}isAssignmentHeaderDisabled(){return this.isAssignmentHeaderHidden}getDefaultPortal(){return this.environmentInfoObject?.pxOperator?.pyDefaultPortal}updateFeatureMap(e){const t=this.environmentInfoObject?.features;return this.environmentInfoObject&&e&&(this.environmentInfoObject?.features?this.environmentInfoObject.features={...t,...e}:this.environmentInfoObject.features={...e}),this.getFeatureMap()}getFeatureMap(){return this.environmentInfoObject?.features||{}}setKeyMapping(e){return this.KeyMapping=e,this.KeyMapping}getKeyMapping(e){const t=this.KeyMapping[e];return void 0!==t?t:null}setCoexistenceMeta(e){return e&&(this.coexistenceMeta=e),this.getCoexistenceMeta()}getCoexistenceMeta(){return this.coexistenceMeta}isCoexistenceAppOfType(e){return!(!this.coexistenceMeta.isCoexistence||this.coexistenceMeta.appType!==e)}isOptimizedCaseLoadingEnabled(){return this.getFeatureMap().pyEnableOptimizedCaseLoading||this.getFeatureMap().optimizedCaseLoading||!1}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getClassesAccessList(){return this.environmentInfoObject?.pyClassesAccessList?.pxResults??[]}getUserSettings(){return this.environmentInfoObject?.pyUserSettings||null}getLocalizationVersion(){const e=this.getFeatureMap().pyLocalizationVersion,t=this.getFeatureMap().localizationVersion;return void 0!==t?t:void 0!==e?parseInt(e,10):1}getLocalizationBundles(e=this.locale){return ME.getLocalizationBundles(e)}getAvailableLocalePacks(){return this.getFeatureMap()?.availableLanguagePacks||void 0}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getEnablePriorityAndUrgencyImprovements(){return this.enablePriorityAndUrgencyImprovements}setEnablePriorityAndUrgencyImprovements(e){this.enablePriorityAndUrgencyImprovements=e}getInactivityTimeout(){const e=this.environmentInfoObject?.pxOperator?.pyAuthenticationTimeout;return e?Number(e):e}isUnifiedObject(){return this.environmentInfoObject?.features?.isUnifiedObject||!1}getRuntime(){return"undefined"!=typeof window&&window.document?"Browser":"Native"}getInlineEditActions(e){return this.environmentInfoObject?.pyInlineEditActions?.filter((t=>t.pyClassName===e)).map((e=>e.pyActionName))??[]}getInlineEditActionViews(e){return this.environmentInfoObject?.pyInlineEditActions?.filter((t=>t.pyClassName===e)).map((e=>e.pyViewName))??[]}getFullObjectDisplayTemplate(){return this.environmentInfoObject?.pyFullObjectDisplayTemplate??void 0}setFullObjectDisplayTemplate(e){this.environmentInfoObject&&(this.environmentInfoObject.pyFullObjectDisplayTemplate=e),$d.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.CASE_VIEW_TEMPLATE_CHANGE,e)}},UE=e=>"fulfilled"===e.status,FE=async(e=LE.getLocale())=>{try{await(async e=>{const t=LE.getAvailableLocalePacks(),n=LE.getLocalizationBundles(e);let r;if(e&&t&&t.includes(e)?r=[fp("getLocalizationPack",{queryPayload:{locale:e}})]:n.length>0&&(r=n.map((e=>fp("getLocalizationPack",{queryPayload:{version:e.pyBundleVersion,bundle:e.pyBundleName}})))),!r||0===r.length)return;const a=200,s=201,o=await Promise.allSettled(r),i=mA(e??"en-US");o.filter(UE).forEach((({value:e})=>{if([a,s].includes(e.status)&&e.data){const t=e.data;Object.keys(t).forEach((e=>{i.setLocaleForRule(t[e],e)}))}}))})(e)}catch(e){console.warn(e)}};const jE=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 r=e.indexOf("{@P ",t);if(-1===r){n+=e.substring(t,e.length);break}n+=e.substring(t,r);const a=e.indexOf("}",t),s=e.substring(r,a+1),[o,i]=this.getKeyAndValue(s);this.addKeyToMap(o,i),n+=`${s.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 r=e.indexOf("{@P ",t);if(-1===r){n+=e.substring(t,e.length);break}n+=e.substring(t,r);const a=e.indexOf("}",t),s=e.substring(r,a+1);n+=this.keyMap[s],t=a+1}return n}};class kE{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,r=t.toUpperCase();r.startsWith("@BASECLASS!DATAPAGE!")&&r.split(/[!#]/).length<4?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&"fields"in t&&this.updateLocaleStore(t,`${r}#${e}`.toUpperCase())})):"GENERIC!GENERICFIELDS"===r?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&this.sanitizeLocaleField(t,e.toUpperCase())})):this.sanitizeLocaleField(n,r)};updateLocaleStore=(e,t)=>{const n=e.fields||e,r=this.localeStore[t];r?hC.mergeDeep(n,r):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,r){const a=this.#u(n,t),s=this.#p(e);s&&(e=jE.formatLocaleKey(e));const o=a?this.localeStore[a.toUpperCase()]??{}:{},i=r?this.localeStore[r.toUpperCase()]??{}:{};return"MESSAGES"===n?.toUpperCase()&&"string"==typeof e?this.getLocalizedErrorMessage(o,e)||e:s?jE.replaceWithValue(o[e]||i[e]||e):o[e]||i[e]||e}#u(e,t){return e?.toUpperCase().startsWith("@BASECLASS!DATAPAGE!")?t?`${e}#${t}`:e:e||t}getParagraphLocaleValue(e,t){const n=`${e}!${Fr.PARAGRAPH}!${t}`,r=this.localeStore[n.toUpperCase()];return r?{category:r.category,content:decodeURIComponent(atob(r.content).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join(""))}:null}getPortalLocaleReference(e){return 2!==LE.getLocalizationVersion()?"":e?`PORTAL!${e}`.toUpperCase():`PORTAL!${LE.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return 2}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=LE.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[e]))).map((e=>e.toUpperCase()))).length>0){const r=e.map((e=>({localeRuleKey:e,promise:Dp.getSvcLocale(t,`${e}.json`)}))),a=await Promise.allSettled(r.map((e=>e.promise)));await Promise.all(a.map((async(e,t)=>{if("fulfilled"===e.status){const a=r[t];let s;try{s=await e.value.json()}catch{s=null}s&&n.push({localeRuleKey:a.localeRuleKey,jsonData:s})}})))}return n}async loadLocaleResources(e){await ME.loadLocaleBundle(e),await Promise.all(e.map((e=>FE(e))))}setTimezone(e){this.timezone=e}getTimeZoneInUse(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return this.timezone||e}matchPatternWithText(e,t){let n=t;const r=[];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);r.push(t)}n=n.slice(e+a.length)}t+=1}return n&&r.push(n),r}getLocalizedErrorMessage(e,t){let n="";if(e[t])return e[t];for(const r of Object.keys(e)){const a=r.split(/\{\d+\}/),s=this.matchPatternWithText(a,t);if(s){const t=e[r];if(n=this.replacePlaceHolders(s,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=LE.getLocale();return this.availableLangPacks||(this.availableLangPacks=await Dp.getSvcAvailableLocales()),e&&this.availableLangPacks.includes(e)}getBaseComponentLabels=()=>this.getLocaleForRule("COSMOSFIELDS");#p(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}}const VE=e=>{const t=e??LE.getLocale()??"en-US";return mA(t)};So.registerHandler("@L",((e,t)=>t?t.getLocalizationService(t.getLocaleRuleName()).getLocalizedText(e):e)),So.registerHandler("@P",((e,t,n)=>n?yC.getLitePropertyValue(n):t.getValue(e))),So.registerHandler("@E",((e,t,n)=>{try{const r=co(e),a=lo(r);return uo(a,t,n)}catch(e){}return!0})),So.registerHandler("@W",((e,t,n)=>{let r;if(n){const{pageReference:t,context:a}=n;r=tC(t,`.${Fr.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,a)}else r=t.getContextDataValue(`.${Fr.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);return!0===r||"true"===r})),So.registerHandler("@ASSOCIATED",((e,t)=>{let n={};const r=[];let a="",s="";const o=t.getPageReference();if(e.startsWith(".")){a=`${o}.${e.substring(1)}`;const r=e.split(".").filter((e=>!!e));r.length>1&&(r.pop(),s=r.join(".")),n=t.getFieldMetadata(e.substring(1))}else n=t.getFieldMetadata(e),a=e;const i=n?.datasource?.tableType,c=n?.datasource?.mode===Fr.READONLY,l=n?.datasource?.name||"",d=t.getComponentConfig();if(d&&d.deferDatasource&&("object"==typeof d.datasourceMetadata&&null!==d.datasourceMetadata||(d.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:d.datasourceMetadata})),i===Fr.DATA_PAGE))return null;if(i===Fr.DECISION||i===Fr.RULE_REFERENCE)return function(e,t){const n=_o.getPropertyName(e?.propertyForDisplayText??""),r=_o.getPropertyName(e?.propertyForValue??""),a=t.getContextDataValue(`.${Fr.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return a?.map((e=>({key:e[r]||e[`.${r}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==Fr.DATA_PAGE){const e=t.getLocalizationService(n?.localeReference);return n?.datasource?.records?.map((t=>({key:t.key,value:e.getLocalizedText(t.value)})))}const u=_o.getPropertyName(n?.datasource?.propertyForDisplayText),p=_o.getPropertyName(n?.datasource?.propertyForValue),h=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],g=t.getContextName(),f=[];if(h.forEach((e=>{if(_o.isProperty(e?.value)){let t=eC(`.${hC.getFullPropertyReference([s,_o.getPropertyName(e.value)])}`,o,g);f.push(hC.getFullPropertyReference([o,s,_o.getPropertyName(e?.value)])),null!=t&&""!==t||(t=Fr.NULL_STRING),r.push(t)}else r.push(e?.value||Fr.NULL_STRING)})),g){const e=Ao.getContextObjectByName(g)||{};f.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,a])]}else e[t]=[a]})),Ao.addContextName(g,e)}const m=function(e,t,n,r){let a="",s=n;if(t.join(Fr.HASH_DELIMITER)&&(a=hC.getHashedString(t.join(Fr.HASH_DELIMITER)),s=n+Fr.UNDERSCORE_STRING+a),r){const e=XA(),t=e?e[n]?.[s]:{};return Array.isArray(t?.[Mr.getDefaultQualifiedName("pxResults")])?t[Mr.getDefaultQualifiedName("pxResults")]:[]}const o=e.getDataObject(),i=o?.[n]||{},c=i?.[s]||{};return Array.isArray(c?.[Mr.getDefaultQualifiedName("pxResults")])?c[Mr.getDefaultQualifiedName("pxResults")]:[]}(t,r,l,c),y=t.getLocalizationService();return m.map((e=>{let t=e[u]||e[`.${u}`];var n;return"string"==typeof t&&(n=t,t=y.getLocalizedDataPage(n,l,u)),{key:e[p]||e[`.${p}`],value:t}}))})),So.registerHandler("@ROUTING_INFO",((e,t)=>ks(t.getContainerName(),t.getContextName()))),So.registerHandler("@ENV",((e,t)=>{switch(e){case Fr.ENV_INFO_KEYS.APPLICATION_NAME:return LE.getApplicationName();case Fr.ENV_INFO_KEYS.ACCESS_GROUP:return LE.getAccessGroup();case Fr.ENV_INFO_KEYS.APPLICATION_ID:return LE.getApplicationID()||LE.getApplicationName();case Fr.ENV_INFO_KEYS.USER_NAME:return LE.getOperatorName();case Fr.ENV_INFO_KEYS.USER_ID:return LE.getOperatorIdentifier();case Fr.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizationService().getLocalizedText(LE.getApplicationLabel()||"");case Fr.ENV_INFO_KEYS.USER_IMAGE:return LE.getOperatorImageInsKey();case Fr.ENV_INFO_KEYS.LOCALE:return LE.getUseLocale();case Fr.ENV_INFO_KEYS.TIMEZONE:return LE.getTimeZone();case Fr.ENV_INFO_KEYS.WORK_GROUP:return LE.getOperatorWorkGroup();default:return e}})),So.registerHandler("@DATASOURCE",((e,t)=>{const n=t.getSharedDataPageForReferenceList()||t.getValue(e)||[],r=t.getComponentConfig(),a=Object.keys(r).find((t=>r[t]?.source?.includes(e)));if(a){const{fields:e,copyAll:t,filterDownloadedFields:s}=r[a],o=[];return n.forEach((n=>{const r={};t||s?Object.keys(n).forEach((e=>{const t=_o.getPropertyName(e);r[t]=n[t]})):Object.keys(e).forEach((t=>{const a=_o.getPropertyName(e[t]);r[t]=n[a]})),o.push(r)})),o}return[]})),So.registerHandler("@FIELD_META",((e,t)=>{let n,r={};if(r=e.startsWith(".")?t.getFieldMetadata(e.substring(1)):t.getFieldMetadata(e),r&&r.datasource&&r.datasource.parameters){let a="";const s=e.split(".").filter((e=>!!e));if(s.length>1&&(s.pop(),a=`.${s.join(".")}`),Array.isArray(r.datasource.parameters)){const e=[];r.datasource.parameters.forEach((n=>{const r={},{name:s,value:o}=n;r.name=s,"string"==typeof o&&o.startsWith("@P")?r.value=`@P ${a}${o.substring(3)}`:r.value=o,e.push(t.resolveConfigProps(r))})),n=e}else n=t.resolveConfigProps(r.datasource.parameters);r={...r,datasource:{...r.datasource,parameters:n}}}return r})),So.registerHandler("@USER",((e,t,n)=>{const r=n?yC.getLitePropertyValue(n,e):t.getValue(e),a=n?yC.getReferencedUser(r,n):t.getReferencedUser(r);return{userId:r,userName:a?a.UserName:null}})),So.registerHandler("@ACTIVE_CASES",((e,t)=>dg.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),So.registerHandler("@LR",(e=>e)),So.registerHandler("@CASE",((e,t)=>e===Fr.ID?t.getCaseInfo().getKey():e)),So.registerHandler("@SHARED",(e=>ef.getSharedState(e))),So.registerHandler("@PARAGRAPH",((e,t)=>{const{useDecision:n,isBanner:r,messageType:a,dismissBanner:s}=nf.getParagraphProperties(e,t),o=nf.hasDecisionBannerContent(e,t);return n&&o?nf.processBannerDecisionParagraph(e,t):r?{htmlContent:nf.processParagraph(e,t),messageType:a,dismissBanner:s}:nf.processParagraph(e,t)})),So.registerHandler("@FORMAT",((e,t)=>{const n=t.getCurrentClassID(),r=wA(e,n);if(!r?.dynamicContents?.length)return null;const{dynamicContents:a}=r;for(let e=0;e<a.length-1;e+=1)if(yC.resolveWhen(a[e].when,t))return{pattern:a[e].content};return{pattern:a[a.length-1].content}})),So.registerHandler("@FILTERED_LIST",((e,t)=>{const n=e.substring(1,e.indexOf("[")),r=e.substring(e.indexOf("]")+2),a=e.substring(e.indexOf("[")+1,e.indexOf("]"));if(!t)return null;const{useCustomContext:s}=t;let o;return hC.isEmpty(s)?o=t.getValue(`.${n}`):(o=s,o=hC.getIn(o,n)),o&&r.length>0?(a&&(o=o.filter((e=>po(a,e)))),o.map((e=>hC.getIn(e,r)))):null})),So.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.[Mr.getDefaultQualifiedName("pyCountry")];return n?`${PCore.getDefaultQualifiedName("pyAddressForm")}_${n}`:PCore.getDefaultQualifiedName("pyAddressForm")})),So.registerHandler("@DATATYPE",((e,t)=>t.getValue(e))),So.registerHandler("@ATTACHMENT",((e,t,n)=>{let r;return r=n?yC.getLitePropertyValue(n):t.getValue(e),tp.prepareAttachmentData(r)}));const BE=e=>{const t=e.lastIndexOf(".");return t<0?e:e.slice(t+1)};function GE(e,t){const n=e.authorContext;if("string"!=typeof n||!n)return!1;return(n.startsWith(".")?n.substring(1):n)===t}function WE(e,t){const n=e.config;if(!n?.name||"string"!=typeof n.name)return null;const r=t(n.name);return r?Array.isArray(r)?r.find((e=>e.classID===n.ruleClass))??null:r:null}function HE(e,t,n,r="root",a=[]){if(e.config&&function(e,t){const n="string"!=typeof(r=e.value)?null:r.startsWith("@")?r.replace(/^@\w+\s+\./,""):null;var r;return!!n&&n===t}(e.config,t)&&a.push({type:e?.type,config:e.config,path:r}),!e.children)return a;for(let s=0;s<e.children.length;s+=1){const o=e.children[s],i=`${r}.children[${s}]`,c="reference"===o.type?WE(o,n):o;c&&HE(c,t,n,i,a)}return a}So.registerHandler("@FL",((e,t)=>{const n=(e=>e.startsWith(".")?e.slice(1):e)(e),r=t.getFieldMetadata(n);return r&&r.label?t.getLocalizationService(r.localeReference).getLocalizedText(r.label):BE(n)})),So.registerHandler("@DEFERRED",((e,t)=>{const n=t.getFieldMetadata(e);return n?.isDeclarativeTarget?{isDeferred:!0,propertyName:e}:t.getValue(e)})),So.registerHandler("@GENAICOACH",((e,t)=>MA(e,t.getCurrentClassID()))),So.registerHandler("@AIAGENT",((e,t)=>{const n=LA(e,t.getCurrentClassID());if(n)return n;const r=t.getComponentConfig();if(r){const n=r?.coaches?.find((t=>t?.config?.coach?.substring(9)===e&&t?.config?.ruleNamespace))?.config;if(n?.label){const r={label:n.label};t.resolveConfigProps({label:n.label},r);const a=r.label;return{insName:LE.getFeatureMap()?.isNamespaceEnabled&&e.includes(Fr.DOUBLE_UNDERSCORE_STRING)?e:`${n.ruleNamespace}${Fr.DOUBLE_UNDERSCORE_STRING}${e}`,label:t.getLocalizedValue(a),type:"agent"}}}return null})),So.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),a=t.getPageReference();Rg.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}`,`${r}/${a}`,r)})),So.registerHandler("@DW",((e,t,n)=>{let r;const a=`${Fr.CONTEXT_DATA}.${Fr.SUMMARY_OF_DYNAMIC_WHENS}.${e}`;if(n){const{context:e}=n??{};r=eC(a,null,e)}else r=t.getValue(a);return!0===r||"true"===r})),So.registerHandler("@CA",((e,t,n)=>n?yC.getLitePropertyValue(n):t.getValue(e)));const qE=new Set(["autocomplete","dropdown"]),zE=["displayAs","hideLabel","linkReference","localeReference","matchPosition","referenceType","selectionMode"];function YE(e,t,n){const r=t.config,a=function(e){const t=e.config??{},n={};return zE.forEach((e=>{void 0!==t[e]&&(n[e]=t[e])})),void 0===t.contextClass&&void 0===t.targetObjectClass||(n.contextClass=t.contextClass??t.targetObjectClass),void 0!==t.referenceList&&(n.referenceList=t.referenceList),n.parameters=t.parameters,n}(e),s=function(e){const t=e.inheritedProps;return Array.isArray(t)?t.reduce(((e,t)=>("object"!=typeof t||null===t||Array.isArray(t)||"prop"in t&&"string"==typeof t.prop&&"value"in t&&(e[t.prop]=t.value),e)),{}):{}}(n),o={...r??{},...a,...s};return"AutoComplete"===t.type&&void 0!==a.referenceList&&(o.datasource=a.referenceList),o}function KE(e,t,n,r){try{if(!e.name||"string"!=typeof e.name)return null;const t=r(e.name);let a;if(Array.isArray(t))a=t;else{if(!t)return null;a=[t]}const s=a.find((t=>t.classID===e.ruleClass));if(!s||!function(e){const t=e.config;return!!t&&"DataReference"===t.template&&"string"==typeof t.displayAs&&qE.has(t.displayAs.toLowerCase())}(s))return null;const o=function(e){const t=e?.children;return Array.isArray(t)&&t.length>0?t[0]:null}(s);return o?{type:o.type,config:YE(s,o,e),path:n}:null}catch{return null}}function QE(e,t,n,r="root",a=[]){if(e.config&&GE(e.config,t)){const t=KE(e.config,e.type,r,n);t&&a.push(t)}if(!e.children)return a;for(let s=0;s<e.children.length;s+=1){const o=e.children[s],i=`${r}.children[${s}]`,c="reference"!==o.type||o.config&&GE(o.config,t)?o:WE(o,n);c&&QE(c,t,n,i,a)}return a}function JE(e,t,n){const r=LE.getInlineEditActionViews(t),a=function(e,t){if(!e||"object"!=typeof e)return null;if(Array.isArray(e))return e.find((e=>e.classID===t))??null;return e}(n(r&&r.length>0?r[0]:Mr.getDefaultQualifiedName("pyEdit")),t);if(!a)return[];const s=HE(a,e,n,"root");return s.length>0?s:QE(a,e,n)}const XE={},ZE={},eA={};let tA=0,nA=!1;const rA={},aA={},sA={},oA={},iA={},cA={},lA={},dA={},uA={},pA={},hA={},gA=(e={},t={})=>{0!==Object.keys(t).length?Object.keys(e).forEach((n=>{const r=e[n],a=t[n];a?((e,t,n,r)=>{const a=Array.isArray(n)?n:[n];(Array.isArray(r)?r:[r]).forEach((e=>{const t=a.findIndex((t=>t.classID===e.classID));if(-1===t)a.push(e);else{const n={isDeclarativeTarget:!1},r={...a[t],...n,...e};a[t]=r}})),t[e]=1===a.length?a[0]:a})(n,t,a,r):t[n]=r})):hC.copy(e,t)},fA=(e,t="")=>{if(!e)return null;const n=aA[e];if(!n)return null;if(!t)return hC.deepClone(n);let r;return r=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,r?hC.deepClone(r):null},mA=e=>(pA[e]||(pA[e]=new kE),pA[e]),yA=(e,t)=>(hA[e]||(hA[e]=t()),hA[e]),IA=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let a;const s=fA(e,t);return r.length&&(a=r.join(".")),{...s,embeddedType:n,category:a}}const[a,...s]=e.split("."),o=fA(a,t);return o&&r.push(o.label),IA(s.join("."),o?.pageClass,o?.type,r)},EA=e=>{0!==Object.keys(e).length&&(gA(e,eA),nA&&(tA+=1))},AA=()=>tA,CA=()=>{nA=!0},SA=()=>{nA=!1},NA=e=>{gA(e,rA)},_A=e=>{(e=>{e.views&&Object.keys(e.views).length>0&&(gA(e.views,eA),nA&&(tA+=1)),e.navigations&&gA(e.navigations,rA),e.personalizations&&gA(e.personalizations,oA),e.insights&&gA(e.insights,iA),e.paragraphs&&gA(e.paragraphs,XE),e.formats&&gA(e.formats,ZE),e.dataTypes&&gA(e.dataTypes,cA),e.datapages&&gA(e.datapages,lA),e.genAICoaches&&gA(e.genAICoaches,dA),e.AIAgents&&gA(e.AIAgents,uA)})(e),(e=>{const t=e.fields||{};Object.keys(t).forEach((n=>{const r=t[n];if(Array.isArray(r)){if(r.forEach((t=>{e.datapages&&t.datasource&&"DataPage"===t.datasource.tableType&&(t.datasource.mode=e.datapages?.[t.datasource.name].mode);const r=uf(cf,n,t.definedOnClassID??t.classID);t.localeReference=r})),1===r.length){const[e]=r;t[n]=e}}else e.datapages&&r?.datasource&&"DataPage"===r.datasource.tableType&&(r.datasource.mode=e.datapages[r.datasource.name].mode)}))})(e);const{datapages:t={}}=e;Object.keys(t).forEach((e=>{sA[e]=t[e]})),gA(e.fields,aA)},bA=e=>eA[e],TA=(e,t)=>{const n=eA[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},PA=e=>rA[e],OA=e=>e in sA?sA[e]:null,DA=e=>e in oA?oA[e]:null,vA=e=>e in iA?iA[e]:null,RA=e=>{const t={};return Object.keys(aA).forEach((n=>{const r=aA[n];let a;Array.isArray(r)?a=r.find((t=>e===t.classID)):e===r.classID&&(a=r),a&&(t[n]=hC.deepClone(a))})),t},$A=(e,t)=>{const n=fA(e,t),r=n?.datasource?.parameters;return r?hC.deepClone(r):null},xA=(e,t)=>{let n=null;const r=XE[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?hC.deepClone(n):null},wA=(e,t)=>{let n=null;const r=ZE[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?hC.deepClone(n):null},MA=(e,t)=>{let n=null;const r=dA[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?hC.deepClone(n):null},LA=(e,t)=>{let n=null;const r=uA[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?hC.deepClone(n):null},UA=e=>{if(e in cA){const{savableDataPage:t}=cA[e];return t}return null},FA=e=>{const t=lA[e];if(!t)return null;const{classID:n,isAlternateKeyStorage:r,parameters:a}=t;if(r)return a.map((e=>({keyName:e.name,isAlternateKeyStorage:r,linkedField:e.linkedField})));const s=cA[n];return s?s.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:r}))):[]},jA=e=>{if(e in cA){const{lookupDataPage:t}=cA[e];return t}return null},kA=e=>{if(Object.hasOwn(cA,e)){const{lookupDataPageInfo:t}=cA[e];return t}return null},VA=(e,t)=>{const n=e.split("."),r=n.pop(),a=new vf({options:{pageReference:`${n.join(".")}`,context:t}}),s=fA(r,a.getCurrentClassID())?.additionalInformation;if(!s?.includes("@PARAGRAPH"))return s;const o=_o.trimAnnotation(s);return nf.processParagraph(o,a)},BA=(e,t)=>{const n=e.split("."),r=n.pop(),a=new vf({options:{pageReference:`${n.join(".")}`,context:t}}),s=fA(r,a.getCurrentClassID()),o={};return a._classID=a.getCurrentClassID(),a.resolveConfigProps(s,o),o},GA=(e,t)=>JE(e,t,bA);class WA{constructor(){this.name="CascadeManager",this.cascadeSubscribers={},this.cascadeResetSubscribers={},this.listChangeSubscribers=[]}registerResetDependencies(e,t,n,r,a,s="singleRecord"){if(!e||!n||!r?.length)return;const o=n.startsWith(".")?`${t}.${n.substring(1)}`:n,i=this.cascadeResetSubscribers[e]||{},c=this._handlePageReference(t,n,a);r.forEach((e=>{if(!e)return;let t=e.startsWith(".")?e.substring(1):e;if(t=hC.getFullPropertyReference([c,t]),t in i){const e=i[t];e.find((e=>e.propertyName===o))||e.push({propertyName:o,mode:s})}else i[t]=[{propertyName:o,mode:s}]})),Object.keys(i).length>0&&(this.cascadeResetSubscribers[e]=i)}deregisterResetDependencies(e,t,n,r,a){if(!e||!n||!r?.length)return;const s=n.startsWith(".")?`${t}.${n.substring(1)}`:n,o=this.cascadeResetSubscribers[e]||{},i=this._handlePageReference(t,n,a);r.forEach((e=>{if(e){let t=e.startsWith(".")?e.substring(1):e;if(t=hC.getFullPropertyReference([i,t]),t in o){const e=o[t];hC.removeExistingDependentProperty(e,s)}}})),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,r,a){this.cascadeSubscribers[e]=this.cascadeSubscribers[e]||{},n?.forEach((n=>{this.cascadeSubscribers[e][`${t}${n}`]=this.cascadeSubscribers[e][`${t}${n}`]||{};const s=this.cascadeSubscribers[e][`${t}${n}`];if(!s[a]){s[a]=r;const o=eC(n,t,e);s.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,r,a){const s=WA._getFieldsForList(e,t,n);s.length>0&&(this.registerFields(e,t,s,r,a),wh.enableCascade(e))}unRegisterListField(e,t,n,r){const a=WA._getFieldsForList(e,t,n);a.length>0&&this.unRegisterFields(e,t,a,r)}static _getFieldsForList(e,t,n){const r=[],a=fA(n,eC("classID",t,e));return a&&!Array.isArray(a)&&a.datasource&&a.datasource.parameters&&Object.values(a.datasource.parameters).forEach((e=>{if(_o.isProperty(e)){const t=_o.trimAnnotation(e);r.push(t)}})),r}unRegisterFields(e,t,n,r){this.cascadeSubscribers[e]&&n?.forEach((n=>{if(!this.cascadeSubscribers[e][`${t}${n}`])return;const a=this.cascadeSubscribers[e][`${t}${n}`];a[r]&&delete a[r]}))}triggerCascade(e,t,n,r){let a=!1;this.cascadeSubscribers[e]&&this.cascadeSubscribers[e][t]&&(Object.keys(this.cascadeSubscribers[e][t]).forEach((s=>{const o=this.cascadeSubscribers[e][t];"previousValue"!==s&&o.previousValue!==n&&(a=!0,r?r.add(o[s]):o[s](t,n))})),a&&(this.cascadeSubscribers[e][t].previousValue=n))}purgeCascadeFields(e){delete this.cascadeSubscribers[e]}handleServerChanges(e,t=[],n=[]){if(!e)return;const r=new Set;n.forEach((t=>{const n=eC(t,"",e);this.triggerCascade(e,t,n,r)})),r.forEach((e=>{e()})),0!==this.listChangeSubscribers.length&&0!==t.length&&t.forEach((t=>{this.listChangeSubscribers.forEach((n=>{const r=eC(t,"",e);n(e,t,r)}))}))}_updateChangedProperties(e,t,n,r,a,s,o,i){const c=n&&i.some((e=>r.startsWith(e)));if(e!==t||c){const e=r.lastIndexOf("."),t=r.substring(0,e),i=r.substring(e),c=Dd.getMessages({type:"error",property:i,context:a,pageReference:t});if(c?.length>0&&o.push(r),!n)return;s.push(r)}}isChangedListPropertyExist(e){let t=!0;return 0!==this.listChangeSubscribers.length&&hC.isValidPageListProperty(e)||(t=!1),t}_getServerProperties(e,t,n,r,a,s,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=eC(n,"",t);if(void 0===c&&!e&&0!==e)return;return void this._updateChangedProperties(c,e,i,n,t,r,s,o)}const i=Object.keys(e??{});for(let c=0,l=i.length;c<l;c+=1){const l=i[c],d=`${n}.${l}`;if(Array.isArray(e[l])){const n=eC(d,"",t);n&&n?.length===e[l].length||o.push(d.replace(/\.(\d+)/g,"[$1]"))}this._getServerProperties(e[l],t,d,r,a,s,o)}}getServerProperties(e,t,n=Fr.CASE_INFO.CASE_INFO_CONTENT){const r=[],a=[],s=[],o=hC.getIn(e,n);return o&&t?(this._getServerProperties(o,t,n,r,s,a,[]),{changedListProperty:r,leafProperty:s,changedPropertyWithError:a}):{changedListProperty:r,leafProperty:s,changedPropertyWithError:a}}_handlePageReference(e,t,n){let r=e;if("Page"===n&&t.startsWith(".")&&t.slice(1).includes(".")){r=`${e}${t.substring(0,t.lastIndexOf("."))}`}return r}registerForListChanges(e=(()=>{})){this.listChangeSubscribers.push(e)}unRegisterForListChanges(){this.listChangeSubscribers=[]}}const HA=new WA;let qA=null;const zA=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),YA=e=>{qA=e},KA=()=>qA,QA=e=>{if(!e)return;let t=[],n=[],r=[];if(Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=HA.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),qA?.dispatch(e),!Array.isArray(e)&&"MERGE_DATA"===e.type){if(r.length&&!e.payload.skipValidation){r.map((e=>{const t=e.lastIndexOf(".");return{property:e.substring(t),pageReference:e.substring(0,t)}})).forEach((({property:t,pageReference:n})=>{Dd.clearMessages({type:"error",property:t,pageReference:n,context:e.payload.context});const r=md.getFieldReferenceForProperty(e.payload.context,`${n}${t}`);if(r){const e=yC.resolveContextTreeNodeProps(r.props);cp.validate(e.componentName?.toLowerCase(),e.propertyName,yC.getLitePropertyValue(e,e.propertyName),e)}}))}HA.handleServerChanges(e.payload.context,t,n)}},JA=e=>KA()?.getState().data?.[e],XA=()=>KA()?.getState().data[Fr.SHARED],ZA=(e,t,n)=>{if(!(r=e)||r.startsWith('"')||r.startsWith("'"))return(e=>e&&e.trim().substring(1,e.length-1))(e);var r;const a=e?.startsWith(".")?t+e:e,s=zA(a);return hC.getIn(n,s)},eC=(e,t,n)=>ZA(e,t,JA(n)),tC=(e,t,n)=>ZA(t,e?`${Fr.CONTEXT_DATA}.${e}`:`${Fr.CONTEXT_DATA}`,JA(n)),nC=(e,t,n)=>((e,t,n)=>{const r=zA(`${t}.${n}`);return hC.getIn(e,r)})(JA(n),`${Fr.CONTEXT_DATA}.${e}`,t),rC=e=>{const{context:t}=e,n=KA()?.getState().data[t];if(n)return ha;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?Oa:ha},aC=(e,t)=>{const n=zA(t);return hC.deleteIn(e,n)},sC=e=>!Array.isArray(e)&&"object"==typeof e,oC=(e,t=[],n=[])=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&!n.includes(t.path)&&hC.setIn(e,t.path,[]):hC.setIn(e,t.path,{})})),n.length>0&&hC.rearrangeProperties(n,e)},iC=(e,t,n={})=>{const{isArrayDeepMerge:r,propertiesToReplace:a=[],propertiesToReArrange:s=[]}=n;Array.isArray(e)&&!t&&(t=[]),oC(e,a,s);const o=(e,t)=>{if(sC(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return Array.isArray(t)?t:Rr(e,t,o);if(Array.isArray(e)&&null!==t&&Array.isArray(t)){if(r)return Rr(e,t,o);{const n=t.length;if(void 0===r&&n===e.length)return Rr(e,t,o)}}return""===t&&e&&"object"==typeof e?e:t};return o(e,t)},cC=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:a}=r,s=zA(t);if("object"==typeof n){const t=iC(hC.getIn(e,s),n,{isArrayDeepMerge:a});return hC.setIn(e,s,t)}return hC.setIn(e,s,n)},lC=(e,t,n)=>{const r=zA(t);return hC.setIn(e,r,n)},dC=()=>{const e=ls,{promise:t,actionMgrID:n}=Vp.actionManagerPromise(e);return QA({type:e,payload:{actionMgrID:n}}),t},uC=e=>{const t=KA()?.getState();return!!t?.data?.[e]};class pC{static mergeDeep(e,t){return Rr(t,e)}static hasIn(e,t){return Un(e,t)}static getIn(e,t,n){return Fn(e,t,n)}static setIn(e,t,n){return Wn(e,t,n)}static deleteIn(e,t){return xn(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return xr(e)}static deepClone(e={}){return JSON.parse(JSON.stringify(e))}static copy(e,t){Object.keys(e).forEach((n=>{t[n]=e[n]}))}static isPropertyRef(e){if(!e||!e.includes("."))return!1;for(let t=0;t<e.length;t+=1)if(" @#$%=!<>/\\".includes(e[t]))return!1;return!0}static isValidPropertyReference(e){return"string"==typeof e&&(""===e||""!==e.trim())}static isWhenExist(e){const t=["visibility","disabled","readOnly","required"];let n=!1;for(const r of Object.keys(e)){const a=e[r];a&&"object"==typeof a&&!Array.isArray(a)?n=n||pC.isWhenExist(a):t.includes(r)&&"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 r=new Set;if(e&&Object.keys(e).forEach((a=>{const s=e[a];t.includes(a)&&"string"==typeof s&&s.startsWith("@W ")&&(n=_o.trimAnnotation(s),r.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=_o.trimAnnotation(t[e]),r.add(n))}))}return[...r]}static isExpressionExist(e){const t=["disabled","visibility","readOnly","required"];let n=!1;for(const r of Object.keys(e))t.includes(r)&&"string"==typeof e[r]&&e[r]?.startsWith("@E ")&&(n=!0);return n}static buildDataObject(e,t){let n={};const r=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 r=t;t.startsWith(".")&&(r=t.substring(1)),n[r]=e[t]})),r}static buildObject=(e,t,n)=>{if(void 0===n)return;const r=e.split(".");let a=0;for(;a<r.length-1;a+=1){const e=r[a];e?.toString().length&&!t[e]&&(t[e]={}),t[e]&&(t=t[e])}"object"==typeof n?(t[r[a]]||(t[r[a]]=Array.isArray(n)?[]:{}),iC(t[r[a]],n,{isArrayDeepMerge:!0})):t[r[a]]=n};static getHashedString(e){return(0,ln.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 Xt(e,t)}static isContains(e,t){const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&pC.isEqual(e[n[r]],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,r=[])=>{Object.entries(e).forEach((([a,s])=>{r.push(Array.isArray(e)?Number(a):a),Array.isArray(s)?s.forEach(((e,t)=>{r.push(t),n(e,r),r.pop()})):"object"==typeof s?n(s,r):t(r.slice(),s),r.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 r=e.split(".");let a;r.reduce(((e,t,s)=>(a=e[t]?e[t]:Number.isNaN(Number(r[s+1]))?r.length-1===s?n:{}:[],e[t]=a,e[t])),t)})),t}static flatten(e,t,n){t||(t=""),Array.isArray(e)?e.forEach(((e,r)=>{pC.flatten(e,`${t}[${r}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((r=>{const a=t?`${t}.${r}`:r;pC.flatten(e[r],a,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=e.startsWith(Fr.OBJECT_INFO.OBJECT_INFO)?`${e}${t}`.replace(Fr.OBJECT_INFO.OBJECT_INFO_CONTENT,""):`${e}${t}`.replace(Fr.CASE_INFO.CASE_INFO_CONTENT,"").replace(Fr.DATA_INFO.DATA_INFO_CONTENT,"");return gu.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("."),r=t.split(".");return n.length===r.length&&n.every(((e,t)=>{if(e===r[t])return!0;if(e.endsWith("()")){const n=e.slice(0,-2),a=r[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&&Vp.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(" "),r=e.substring(0,n);return t.has(r)}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 r=e[t];"string"==typeof r?n="true"===r||"false"!==r&&r:"object"==typeof r?(n=r,pC.convertObjectWithStringToBoolean(r)):n=r,e[t]=n})),e}static rearrangeProperties(e,t){e.forEach((e=>{let n=pC.getIn(t,e);if(!n)return;const r=Object.hasOwn(n,Mr.getDefaultQualifiedName("pyCount"));if(r&&(n=n.pxResults),!n)return;const a=n.filter((e=>!e.error)),s=n.filter((e=>e.error));pC.setIn(t,r?`${e}.pxResults`:e,[...a,...s])}))}static getETag(e){if(!e)return;let t=e;const n=t?.split("/")||[],r=["workarea","modal","actionarea"],a=n.findIndex((e=>r.some((t=>e.startsWith(t)))));return-1!==a&&(t=n.slice(0,a+1).join("/")),KA()?.getState()?.data[t]?.caseInfo?.headers?.etag}static PAGELIST_PATH_REGEX=/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/;static isValidPageListProperty(e){return pC.PAGELIST_PATH_REGEX.test(e)}static generateDataPageHashWithParameters(e,t,n){const r=[];let a="";const s=n.getPageReference(),o=n.getContextName();Object.keys(e).forEach((t=>{const n=e[t];let a=_o.isProperty(n)?eC(`.${_o.getPropertyName(n)}`,s,o):n;null!=a&&""!==a||(a=Fr.NULL_STRING),r.push(a)}));let i=t;const c=r.join(Fr.HASH_DELIMITER);return c&&(a=pC.getHashedString(c),i=t+Fr.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,r,a,s,o,i,c]=t.map(Number);return new Date(n,r-1,a,s,o,i,c).getTime()}static formatToUTCDate(e,t){if(!e)return e;const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const r=(e,t=2)=>String(e).padStart(t,"0"),a=n.getUTCFullYear(),s=r(n.getUTCMonth()+1),o=r(n.getUTCDate());if("Date"===t)return`${a}${s}${o}`;return`${a}${s}${o}T${r(n.getUTCHours())}${r(n.getUTCMinutes())}${r(n.getUTCSeconds())}.${r(n.getUTCMilliseconds(),3)} GMT`}static isLeafProperty(e){return Boolean(e)&&!e.includes(".")}static getMetadataType(e,t,n){const r=pC.isLeafProperty(e)?fA(e,t):n.getFieldMetadata(e);return Array.isArray(r)?r[0]?.type:r?.type}static toStringParameterValue(e){return"string"==typeof e?e:e instanceof Date?e.toISOString():null}static resolveParameterValue(e,t,n,r,a){if(n&&Object.hasOwn(n,e))return n[e];if(!ch.isProperty(t))return t;const s=null!==a?ch.getPropertyName(t):ch.getLeafPropertyName(t);return r.getValue(`.${s}`)}static formatParameterValue(e,t,n,r,a){if(!ch.isProperty(t))return e;const s=null!==r?ch.getPropertyName(t):ch.getLeafPropertyName(t);if(!s)return e;const o=pC.getMetadataType(s,a,n);if(!o)return e;const i=pC.toStringParameterValue(e);return"Date"===o?i?i.includes("T")?pC.formatToUTCDate(i,"Date"):pC.formatToUTCDate(`${i}T00:00:00Z`,"Date"):e:"DateTime"===o&&i?pC.formatToUTCDate(i,"DateTime"):e}static resolveAndFormatParameters(e,t,n,r,a){const s={};for(const o of Object.keys(e)){const i=e[o];if("string"!=typeof i)s[o]=i;else{const e=pC.resolveParameterValue(o,i,a,t,n);s[o]=pC.formatParameterValue(e,i,t,n,r)}}return s}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 r;r=n.length>1?n.slice(0,-1):n;let a=t;for(const e of r){const t=fA(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 ur(e)&&!Array.isArray(e)}static pruneKeys=(e,t,n=!1)=>{if(!k(e))return e;const r=t instanceof Set?t:new Set(t);return n?(pC.isNestedObject(e)?Object.keys(e).forEach((t=>{const n=e[t];if(r.has(t)){const n=Object.getOwnPropertyDescriptor(e,t);n&&n.configurable?delete e[t]:Reflect.set(e,t,void 0)}else n&&(ur(n)||Array.isArray(n))&&pC.pruneKeys(n,r,!0)})):Array.isArray(e)&&e.forEach((e=>{(ur(e)||Array.isArray(e))&&pC.pruneKeys(e,r,!0)})),e):Array.isArray(e)?e.map((e=>ur(e)||Array.isArray(e)?pC.pruneKeys(e,r,!1):e)):pC.isNestedObject(e)?Object.keys(e).reduce(((t,n)=>{if(!r.has(n)){const a=e[n];t[n]=ur(a)||Array.isArray(a)?pC.pruneKeys(a,r,!1):a}return t}),{}):e}}const hC=pC,gC=Fr.SUMMARY_OF_LISTS,fC=Fr.SUMMARY_OF_WHEN_CONDITIONS;class mC{static updateData(e){Object.keys(e).forEach((t=>{QA(_C({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{QA(_C({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${fC}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){const n=this.resolveName(e,t);return PA("string"==typeof n?n:"")}static resolveView(e,t,n=""){const r=bA(this.resolveName(e,t));let a=[];if(Array.isArray(r)&&r.length>0){if(t&&r.length>1){if(n||(n=t.getValue(Fr.CLASS_ID)||""),!n)return;a=r.filter((e=>e[Fr.CLASSID]===n))}return 0===a.length?r[0]:a[0]}return r}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=_o.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=_o.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 r;if(t)r=t.startsWith(Fr.CLASS_ANNOTATION)?t.split(Fr.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName(),e.getValue(Fr.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;r=e&&n?t.pageClass:t.classID}r||(r=n.ruleClass)}return r}static resolveReference(e,t){const{type:n}=e;let r;if("reference"===n){const{config:n}=e,a=n?.type,{ref:s,name:o,context:i}=n||{},c=this.getRuleClass(t,i,n);return t&&(t._ruleClass=c),"navigation"===a?r=this.resolveNavigation(s||o,t):"view"===a?r=this.resolveView(s||o,t,c||""):"widget"===a&&(r={type:"Widget",config:{name:o,ruleClass:c}}),r}return e}static resolvePropertyReference(e,t,n){return eC(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const a=nC(`${t}.${gC}`,e,n);a&&(r=this.resolvePropertyReference(t,a,n))}return r}static getPropertyValue(e,t,n){return e=_o.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=mC.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:r,hasSuggestions:a,pageReference:s,context:o}=e;let i=t||r||"";return n?(i=i.startsWith(".")?i.substring(1):i,i.split(".").reduce(((e,t)=>e?.[t]??void 0),n)):a&&i===r?mC.getPropertyValue(i,s,o?`${o}/${Fr.SUGGESTION}`:void 0):mC.getPropertyValue(i,s,o||void 0)}static _handlePropString(e,t,n,r,a){n.startsWith("@")?e[t]=_o.handleAnnotation(n,r,a):e[t]=n}static _resolveProps(e,t,n){e&&Object.keys(e).forEach((r=>{const a=e[r];"string"==typeof a?this._handlePropString(e,r,a,t,n):Array.isArray(a)?a.forEach((r=>{this._resolveProps("object"==typeof r?r:e[r],t,n)})):"object"==typeof a&&this._resolveProps(e[r],t,n)}))}static resolveProps(e,t,n){return e&&t?(hC.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(hC.mergeDeep(e,t),this._resolveProps(t,void 0,e),hC.resolveStringBooleans(t)):t}static resolvePropertyPageClass(e,t){const n=hC.resolvePageClass(e,t),r=e.substring(e.lastIndexOf(".")+1),a=fA(r,n);let s;if(a)return s=Array.isArray(a)?a[0]?.pageClass:a.pageClass,s}static resolveClassID(e,t,n,r){const a=_o.trimAnnotation(e);let s=a.startsWith(".")?`${t}${a}`:a;for(;s;){const e=eC(Fr.CLASS_ID,s,n);if(e)return e;if(r){const e=this.resolvePropertyPageClass(a,r);if(e)return e}const t=s.lastIndexOf(".");if(-1===t)break;s=s.substring(0,t)}return null}}const yC=mC;const IC=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}},EC=IC;const AC=class{static#h=[];static#g=!1;static getActionHandlers=(e,t,n)=>{const r=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=EC.getHandler(e.action),{config:n}=e;r.push({handler:t,config:n})})),r};static isEditable=e=>{const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||"DATETIME"===t};static isNonKeyInput=e=>{const{tagName:t,type:n}=e;return"SELECT"===t||"checkbox"===n||"radio"===n};static#f=(e,t,n)=>{for(let r=0;r<e.length;r+=1){const a=e[r],s={actionHandler:a.handler,component:t,eventType:n,config:a.config};this.#h.push(s)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===LE.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=Vp.getNextActionMgrId(),n};static#m=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,a={};yC.resolveProps(r,a,n),t&&(t(e.eventType,a,n),this.#y())};static#y=()=>{if(!this.#g){if(0===this.#h.length)return;const e=this.#h.shift();if(!e)return;this.#m(e),e.config&&"true"===e.config.parallel&&this.#h.length>0&&this.#y()}};static#I=()=>{this.#y()};static#E=(e,t,n)=>{this.#f(e,t,n),this.#I()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return yC.getContextPath(t,n)};static#A(e,t){const n=e.getComponentConfig().behaviours||[];for(let r=0;r<n.length;r+=1){const{behaviour:a,actions:s}=n[r];if(s){const n=this.getActionHandlers(s,a,t);n&&n.length>0&&this.#E(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,r=e.getContextName();Nd({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:r});if(!("Browser"===LE.getRuntime()?"nativeEvent"in t&&t.nativeEvent instanceof Event||t instanceof Event:"nativeEvent"in t&&!!t.nativeEvent||t instanceof Event)&&"value"in t&&(null===t.value||"prop"in t&&void 0!==t.prop)){if("object"==typeof(a=t)&&null!==a){const n=e.getPageReference(),a=e.getStateProps();for(const e of Object.keys(t)){const s=a[e],o=t[e];QA({type:Xr,payload:{reference:yC.getContextPath(n,s),value:o,context:r}}),QA({type:ea,payload:{reference:yC.getContextPath(n,s),value:o,context:r}})}}}else{let n,{target:a}=t;null===a&&t&&"auxiliaryTarget"in t&&t.auxiliaryTarget&&(a=t.auxiliaryTarget),n=void 0===a?"value"in t?t.value:void 0:"value"in a?a.value:a.innerText;const s=this.getFullRef(e);QA({type:Xr,payload:{reference:s,value:n,context:r}}),void 0!==a&&this.isEditable(a)&&!this.isNonKeyInput(a)||QA({type:ea,payload:{reference:s,pageReference:e.getPageReference(),value:n,context:r,propertyName:e.getComponentConfig().value,classID:e.getValue(Fr.CLASS_ID)}})}var a};static blurHandler=(e,t)=>{let{target:n}=t;null===n&&t&&"auxiliaryTarget"in t&&(n=t.auxiliaryTarget);const{value:r,validationValue:a}=n,s=this.getFullRef(e),o=e.getContextName();n.clearMessages&&Nd({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,property:e.getStateProps().value,pageReference:e.getPageReference(),context:o}),this.isEditable(n)&&(e.getValidationApi().validate("validationValue"in n?a:r),e.isInsideList()&&e.getListActions().updateProperty(e.getStateProps().value,r),this.isNonKeyInput(n)||QA({type:ea,payload:{reference:s,pageReference:e.getPageReference(),value:r,context:o,propertyName:e.getComponentConfig().value,classID:e.getValue(Fr.CLASS_ID)}}))};static eventHandler=(e,t)=>{const{type:n}=t;switch(n){case"change":this.changeHandler(e,t);break;case"blur":this.blurHandler(e,t)}n&&this.#A(e,n)};static pause=()=>{this.#g=!0};static resume=()=>{this.#g=!1,this.#y()};static isQueueEmpty=()=>0===this.#h.length;static clearQueue=()=>{this.#h=[]};static getActionsQueue=()=>this.#h;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},CC="CREATE_WORK",SC=e=>({type:CC,payload:e});const NC=(e,t,n,r,a="")=>{const s=[];Object.keys(e).forEach((o=>{"object"==typeof e[o]&&o.includes("[")?function(e,t,n,r,a,s,o){const i=r.substring(0,r.indexOf("[")),c=r.substring(r.indexOf("[")+1,r.indexOf("]"));let l=t[i];const d=`${hC.trimDotForProperty(a)}.${i}`;o.includes(d)&&Object.hasOwn(l,Mr.getDefaultQualifiedName("pyCount"))&&(l=l.pxResults),Array.isArray(l)&&(l?.splice(+c,1,e[r]),s.push(i),n.add(`${a}.${r}`))}(e,t,n,o,a,s,r):e[o]&&"object"==typeof e[o]?(t[o]||(t[o]=Array.isArray(e[o])?[]:{}),NC(e[o],t[o],n,r,`${a}.${o}`)):t[o]=e[o]})),function(e,t,n){Object.keys(e).forEach((r=>{(Array.isArray(e[r])&&!n.includes(r)||!Array.isArray(e[r])&&!Object.hasOwn(t,r))&&delete e[r]}))}(t,e,s)},_C=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:r=[],propertiesToReArrange:a=[]}=t,{context:s,data:o,isArrayDeepMerge:i,preserveClientChanges:c=!1}=e,l=dI(s,!0),d=JA(s);let u={};if(d&&o){u=JSON.parse(JSON.stringify(d));const e=JSON.parse(JSON.stringify(o));a.length>0&&hC.rearrangeProperties(a,u);const t=new Set;NC(l,u,t,a),((e,t,n)=>{const r=new Set;e.forEach((e=>{e=hC.trimDotForProperty(e);const[a,s,o]=rd(e);if(a&&s&&o&&!r.has(`${a}.${s}`)){const e=hC.getIn(n,`${a}.${s}`)||[];Array.isArray(e)&&e.forEach(((e,n)=>{n!==+o&&hC.setIn(t,`${a}.${s}[${n}]`,e)})),r.add(`${a}.${s}`)}}))})(t,u,e)}!function(e,t){const n=hC.getIn(e,Fr.REFERENCED_USERS);let r;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return r=hC.getIn(t,Fr.REFERENCED_USERS,{}),void hC.setIn(e,Fr.REFERENCED_USERS,{...r,...n});r=hC.getIn(t,Fr.REFERENCED_USERS,[]);const a=new Map;for(const e of[...r,...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,d);const p=hC.getIn(e?.data,Fr.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID),h=ry.isExternalObject(p),g=h?{[Fr.OBJECT_INFO.OBJECT_INFO]:{[Fr.CONTENT]:{...u[Fr.OBJECT_INFO.OBJECT_INFO]?.[Fr.CONTENT]}}}:{[Fr.CASE_INFO.CASE_INFO]:{[Fr.CONTENT]:{...u[Fr.CASE_INFO.CASE_INFO]?.[Fr.CONTENT]}}},f=h?Fr.OBJECT_INFO.OBJECT_INFO_CONTENT:Fr.CASE_INFO.CASE_INFO_CONTENT;let m=o;return c?(n.forEach((e=>{const t=`${f}.${e}`;hC.deleteIn(g,t)})),m=iC(o,g,{isArrayDeepMerge:i??!0})):((e,t)=>{const n=sI[e]||{};Object.keys(n).forEach((e=>{hC.hasIn(t,e)&&(n[e].value=hC.getIn(t,e))}))})(s,o),{type:Ca,payload:{...e,data:m,...r.length>0?{propertiesToReplace:r}:null,...a.length>0?{propertiesToReArrange:a}:null}}},bC=e=>({type:"SHOW_HARNESS",payload:e}),TC=e=>({type:ta,payload:e}),PC=e=>({type:na,payload:e}),OC=e=>({type:"ADD_WORK",payload:e}),DC=e=>({type:pa,payload:e}),vC=e=>({type:Ta,payload:e}),RC=e=>({type:Pa,payload:e}),$C=e=>({type:Oa,payload:e}),xC=e=>({type:va,payload:e}),wC=e=>({type:Ra,payload:e}),MC=e=>({type:wa,payload:e}),LC=e=>({type:La,payload:e}),UC=e=>({type:Ma,payload:e}),FC=e=>{const{containerItemID:t}=e;e.suggestionContexts=KI(t);const n=e?.data?.caseInfo?.content,r=Object.keys(n||{}).length>0;return e.propertiesToReplace||(e.propertiesToReplace=r?ry.getPropertiesToReplace(t):[]),{type:Fa,payload:e}},jC=e=>{const{context:t}=e;return{type:oa,payload:{context:t}}},kC=e=>{const{context:t}=e;return{type:ia,payload:{context:t}}},VC=e=>({type:ja,payload:e}),BC=e=>({type:Ua,payload:e}),GC=e=>({type:is,payload:e}),WC=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=WI(n)),e.context=r,e.deleteContext=!lE(n),e.childContainers=zI(n),e.childContainersContexts=YI(n),e.transientItems=dE([...e.childContainersContexts,n]),e.suggestionContexts=KI(n),n===t&&(e.caseID=eC(Fr.CASE_INFO.CASE_INFO_ID,"",t)||eC(Fr.OBJECT_INFO.OBJECT_INFO_ID,"",t),e.RemoteSystemID=eC(Fr.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Da,payload:e}},HC=e=>{const{containerItemID:t}=e;return e.transientItems=dE([...YI(t),t]),{type:xa,payload:e}},qC=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:$a,payload:e}},zC=e=>{const{context:t,containerItemID:n}=e;let r=t;if(r||(r=WI(n)),e.context=r,e.childContainers=zI(n),e.childContainersContexts=YI(n),e.transientItems=dE([...e.childContainersContexts,n]),e.suggestionContexts=KI(n),n===t){e.caseID=eC(Fr.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=eC(Fr.CASE_INFO.REMOTESYSTEMID,"",t);const n=eC(Fr.CASE_INFO.CASE_INFO_CLASSNAME,"",t);Vr.isTraditionalRemoteCase(n)&&(e.skipReleaseLockRequest=!0)}return{type:ka,payload:e}},YC=e=>({type:ga,payload:e}),KC=e=>({type:ya,payload:e}),QC=e=>({type:_a,payload:e}),JC=(e,...t)=>(AC.resume(),e(...t)),XC=(e,t,n,r,a)=>({type:ba,payload:{msg:e,err:t,context:n,formFields:r,actionMgrID:a}}),ZC=e=>({type:us,payload:e}),eS=e=>({type:ps,payload:e}),tS=e=>({type:hs,payload:e}),nS=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),rS=e=>({type:da,payload:e}),aS=e=>({type:Xr,payload:e}),sS="add",oS="replace",iS=["portal","noPortal","preview","debug","devtool","activeTab","contextParam","lang"];let cS="",lS="Home",dS="",uS=!0;const pS=e=>(uS=e,uS),hS=()=>uS,gS=(e,t,n)=>wE.getSemanticURL(e,t,n),fS=(e,t)=>wE.getRestEndPoint(e,t),mS=(e,t)=>{let n=an();const r=fS(e,t);return r?(r.restApi?.startsWith("/")||(r.restApi=`/${r.restApi}`),n?.endsWith("/")&&(n=n.substring(0,n.length-1)),r.restApi=n+r.restApi,r):{}},yS=(e,t,n)=>{const{root:r,resources:a}=e,{views:s}=a,{config:o}=r,i=sS;let c="";if(n)c=n;else{const e=s[o.name];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);c=t.config.urlPath}const l=c.match(Fh);if(l){const e=hC.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},IS=(e,t)=>{const n=`${e}/${t}`;if(!("EMBED"===LE.getRenderingMode()))return n;const r=wE.getRoutingInfo()?.authServiceAlias;if(!r)return n;const a=encodeURIComponent(r);let s;try{s=new URL(n)}catch{return n}const o=s.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),s.pathname=`/${o.join("/")}`,s.toString().replace(/\/$/,"")},ES=(e,t,n,r)=>{let a,s;a=kh(t)?IS(e,t):e;const o=kh(n?.pxURLPath||"");o&&(a=`${a}/${o}`);try{s=new URL(a).searchParams,a=a.includes("?")?a.split("?")[0]:a}catch(e){return console.log("Invalid url",e),""}const i=a.split("/"),c=i[i.length-1],l=new URLSearchParams("undefined"==typeof window?"":window.location.search);if(qh()?(a=((e,t,n,r,a)=>{const s=wE.getStaticRoutePage(),o=lS?.toLowerCase(),i=s?.toLowerCase(),c=r?.toLowerCase();return i!==o&&c!==o||a.has("noPortal")?e:IS(t,n)})(a,e,t,c,l),wE.setStaticRoutePage("")):c.toLowerCase()!==lS.toLowerCase()||l.has("noPortal")||(a=IS(e,t)),!wE.isDefaultPortal()){const e=wE.getPortalName();l.has("portal")?l.set("portal",e):l.append("portal",e)}s=((e,t,n)=>{for(const[n,r]of t.entries())!e.has(n)&&iS.includes(n)&&e.append(n,r);n&&!e.has("lang")&&e.append("lang",n);const r=wE.getRoutingInfo()?.embedQueryParams;if(r)for(const[t,n]of Object.entries(r))e.has(t)||e.append(t,String(n));return e})(s,l,r);const d=Bh(s.toString());return d&&(a+=`?${d}`),a},AS=(e,{urlPathObjParam:t,infoParam:n,optionsParam:r,queryParam:a},s=!1,o)=>{let i,c,l;if(!1===window.PCore.getBehaviorOverride("dynamicSemanticUrl"))return;if(s)i=t,c=n,l=r;else{const{uiResources:n,data:r}=e;({options:l}=e),i=t&&t.pxURLPath&&jh(t.pxURLPath)?yS(n,r,t.pxURLPath):t||yS(n,r),c=wE.getEndPointInfo(i.pxURLPath),i.pxURLPath=c.urlPath}let d=ES(cS,wE.getApplicationPath(),i,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:wE.getApplicationName()),n===`${cS}/${t}/`)return{title:e};const r=new URL(n).pathname.replace(`${t}/`,""),a=r.split("/");return/\d/.test(r)?{title:`${e} - ${a[a.length-1]}`}:{title:`${e} - ${a[0]}`}})(dS,wE.getApplicationPath(),d),p=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(c,{...l,title:u});i?.historyAction===sS?((e,t,n)=>{if("undefined"!=typeof window)try{window.history.pushState(e,t,n),window.scrollTo(0,0)}catch(e){throw new Error("Error- Unable to Add to Browser History")}})(p,u,d):i?.historyAction===oS&&(a&&(d+=`?${a}`),((e,t,n)=>{if("undefined"!=typeof window)try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(p,u,d))},CS=(e,t)=>{let n=null;e.directUrlUpdation&&(n={historyAction:sS,pxURLPath:""},n.pxURLPath=e.semanticURL),AS(e,{urlPathObjParam:n,infoParam:null,optionsParam:null},!1,t)},SS=(e,t)=>{CS(e,t)},NS=(e,t)=>{const n={pxURLPath:e};return ES(cS,wE.getApplicationPath(),n,t)},_S=e=>{const{uiResources:t}=e;hS()&&(e.directUrlUpdation||(e=>{if(e&&e.root){const{root:t}=e,{resources:n}=e,{views:r}=n,a=t.config,s=a.type,o=a.name;if("VIEW"===s.toUpperCase()){const e=r[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))&&CS(e)},bS=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},TS=(e,t,n)=>{const{caseClassName:r,workID:a}=e.payload,{containerName:s,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=Vr.getRemoteCase(r),d={...e,headers:{RemoteSystemID:c},className:r,isTraditionalRemoteCase:Vr.isTraditionalRemoteCase(r),isRemoteCase:Vr.isRemoteCase(r),action:vs,viewName:jr,gadgetId:ry.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${a}`,containerName:s,name:l};QA(u.showPage(d))};let PS=!1;const OS=async e=>{if(PS)return void(PS=!1);const t=(e=>"ui-navigation"===e.state?.type?($d.publish(Ur.PUB_SUB_EVENTS.URL_NAVIGATION,e.state),null):e.state?e.state.stateObj:null)(e);if(t){const e=SE(),n=VI(`${e}/primary`);if(n&&rE(n)){const e=VE().getLocaleValue(cI,"Messages");if(!await lm.confirm(e))return PS=!0,void window.history.go(1)}Vr.isRemoteCase(t.payload?.caseClassName)?TS({...t},t.options):QA(u.showHistory(bS(t)))}},DS=()=>wE.getApplicationPath()!==vE(),vS=e=>{const{acName:t,context:n,defaultViewLabel:r,ruleName:a,className:s}=e,o=((e,t)=>{const n=wE.getRoutingInfo();if(qh()&&Object.values(n?.routes??{}).find((n=>n?.payload?.pageClass===t&&n?.payload?.page===e)))return e;const r=e.split(" ").join(""),a=e.split(" ").join("-").toLowerCase(),s=(e=>{const t=e.replace(/(?=[A-Z][a-z])/g,"-").toLowerCase();return t.startsWith("-")?t.substring(1):t})(e);return n?.routes?.[r]?r:n?.routes?.[a]?a:n?.routes?.[s]?s:e})(a||r,s);(e=>{lS=e})(o),wE.setDefaultRoute(o),wE.setDefaultClassName(s);const i=Hr(t,n),c=js(t,n),l=(()=>{const e=LE.getIsExtraCallRequiredForDefaultHome();return!0===e||"true"===e})(),d={historyAction:oS,pxURLPath:""};let p,h=null;const g={acName:c,context:i,actionConfig:{context:i}};if(l||!l&&DS()){const t=Wh(RE());LE.shouldUseURLParams()&&(h=t.includes("?")?t.split("?")[1]:null),p=Hh(t,g),d.pxURLPath=p.urlPath,void 0!==p.payload?.pageClass&&(p.payload.pageClass=KA()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",r={routeEndpoint:p.routeEndpoint,requestType:p.requestType,payload:p.payload,options:g,routeKey:p.routeKey};Vr.isRemoteCase(p?.payload?.caseClassName)?TS(r,e,g.context):QA(u[n](bS(r)))}else p=wE.getEndPointInfo(lS),d.pxURLPath="";AS(null,{urlPathObjParam:d,infoParam:p,optionsParam:g,queryParam:h},!0)},RS=(e,t=!1)=>{var n;cS=e.domain,!1===t&&hS()&&(n=OS,"undefined"!=typeof window&&window.addEventListener("popstate",(e=>n(e))),"undefined"!=typeof window&&(window.onbeforeunload=()=>null)),wE.init(e,lS)},$S=e=>{(e=>{"undefined"!=typeof window&&(window.document.title=e)})(e)},xS=e=>{for(const t of e)iS.includes(t)||iS.push(t)};var wS=Symbol.for("immer-nothing"),MS=Symbol.for("immer-draftable"),LS=Symbol.for("immer-state");function US(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var FS=Object,jS=FS.getPrototypeOf,kS="constructor",VS="prototype",BS="configurable",GS="enumerable",WS="writable",HS="value",qS=e=>!!e&&!!e[LS];function zS(e){return!!e&&(QS(e)||nN(e)||!!e[MS]||!!e[kS]?.[MS]||rN(e)||aN(e))}var YS=FS[VS][kS].toString(),KS=new WeakMap;function QS(e){if(!e||!sN(e))return!1;const t=jS(e);if(null===t||t===FS[VS])return!0;const n=FS.hasOwnProperty.call(t,kS)&&t[kS];if(n===Object)return!0;if(!oN(n))return!1;let r=KS.get(n);return void 0===r&&(r=Function.toString.call(n),KS.set(n,r)),r===YS}function JS(e,t,n=!0){if(0===XS(e)){(n?Reflect.ownKeys(e):FS.keys(e)).forEach((n=>{t(n,e[n],e)}))}else e.forEach(((n,r)=>t(r,n,e)))}function XS(e){const t=e[LS];return t?t.type_:nN(e)?1:rN(e)?2:aN(e)?3:0}var ZS=(e,t,n=XS(e))=>2===n?e.has(t):FS[VS].hasOwnProperty.call(e,t),eN=(e,t,n=XS(e))=>2===n?e.get(t):e[t],tN=(e,t,n,r=XS(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n};var nN=Array.isArray,rN=e=>e instanceof Map,aN=e=>e instanceof Set,sN=e=>"object"==typeof e,oN=e=>"function"==typeof e,iN=e=>"boolean"==typeof e;var cN=e=>e.copy_||e.base_,lN=e=>e.modified_?e.copy_:e.base_;function dN(e,t){if(rN(e))return new Map(e);if(aN(e))return new Set(e);if(nN(e))return Array[VS].slice.call(e);const n=QS(e);if(!0===t||"class_only"===t&&!n){const t=FS.getOwnPropertyDescriptors(e);delete t[LS];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const a=n[r],s=t[a];!1===s[WS]&&(s[WS]=!0,s[BS]=!0),(s.get||s.set)&&(t[a]={[BS]:!0,[WS]:!0,[GS]:s[GS],[HS]:e[a]})}return FS.create(jS(e),t)}{const t=jS(e);if(null!==t&&n)return{...e};const r=FS.create(t);return FS.assign(r,e)}}function uN(e,t=!1){return hN(e)||qS(e)||!zS(e)||(XS(e)>1&&FS.defineProperties(e,{set:pN,add:pN,clear:pN,delete:pN}),FS.freeze(e),t&&JS(e,((e,t)=>{uN(t,!0)}),!1)),e}var pN={[HS]:function(){US(2)}};function hN(e){return null===e||!sN(e)||FS.isFrozen(e)}var gN="MapSet",fN="Patches",mN="ArrayMethods",yN={};function IN(e){const t=yN[e];return t||US(0),t}var EN,AN=e=>!!yN[e];var CN=()=>EN;function SN(e,t){t&&(e.patchPlugin_=IN(fN),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function NN(e){_N(e),e.drafts_.forEach(TN),e.drafts_=null}function _N(e){e===EN&&(EN=e.parent_)}var bN=e=>EN={drafts_:[],parent_:EN,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:AN(gN)?IN(gN):void 0,arrayMethodsPlugin_:AN(mN)?IN(mN):void 0};function TN(e){const t=e[LS];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function PN(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[LS].modified_&&(NN(t),US(4)),zS(e)&&(e=ON(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[LS].base_,e,t)}else e=ON(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uN(t,n)}(t,e,!0),NN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==wS?e:void 0}function ON(e,t){if(hN(t))return t;const n=t[LS];if(!n){return MN(t,e.handledSet_,e)}if(!vN(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)}xN(n,e)}return n.copy_}function DN(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var vN=(e,t)=>e.scope_===t,RN=[];function $N(e,t,n,r){const a=cN(e),s=e.type_;if(void 0!==r){if(eN(a,r,s)===t)return void tN(a,r,n,s)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;JS(a,((e,n)=>{if(qS(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}}))}const o=e.draftLocations_.get(t)??RN;for(const e of o)tN(a,e,n,s)}function xN(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 r=n.getPath(e);r&&n.generatePatches_(e,r,t)}DN(e)}}function wN(e,t,n){const{scope_:r}=e;if(qS(n)){const a=n[LS];vN(a,r)&&a.callbacks_.push((function(){VN(e);const r=lN(a);$N(e,n,r,t)}))}else zS(n)&&e.callbacks_.push((function(){const a=cN(e);3===e.type_?a.has(n)&&MN(n,r.handledSet_,r):eN(a,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&MN(eN(e.copy_,t,e.type_),r.handledSet_,r)}))}function MN(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||qS(e)||t.has(e)||!zS(e)||hN(e)||(t.add(e),JS(e,((r,a)=>{if(qS(a)){const t=a[LS];if(vN(t,n)){const n=lN(t);tN(e,r,n,e.type_),DN(t)}}else zS(a)&&MN(a,t,n)}))),e}var LN={get(e,t){if(t===LS)return e;let n=e.scope_.arrayMethodsPlugin_;const r=1===e.type_&&"string"==typeof t;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const a=cN(e);if(!ZS(a,t,e.type_))return function(e,t,n){const r=jN(t,n);return r?HS in r?r[HS]:r.get?.call(e.draft_):void 0}(e,a,t);const s=a[t];if(e.finalized_||!zS(s))return s;if(r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return s;if(s===FN(e.base_,t)){VN(e);const n=1===e.type_?+t:t,r=BN(e.scope_,s,e,n);return e.copy_[n]=r}return s},has:(e,t)=>t in cN(e),ownKeys:e=>Reflect.ownKeys(cN(e)),set(e,t,n){const r=jN(cN(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=FN(cN(e),t),o=r?.[LS];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((a=n)===(s=r)?0!==a||1/a==1/s:a!=a&&s!=s)&&(void 0!==n||ZS(e.base_,t,e.type_)))return!0;VN(e),kN(e)}var a,s;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),wN(e,t,n)),!0},deleteProperty:(e,t)=>(VN(e),void 0!==FN(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),kN(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=cN(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[WS]:!0,[BS]:1!==e.type_||"length"!==t,[GS]:r[GS],[HS]:n[t]}:r},defineProperty(){US(11)},getPrototypeOf:e=>jS(e.base_),setPrototypeOf(){US(12)}},UN={};for(let e in LN){let t=LN[e];UN[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function FN(e,t){const n=e[LS];return(n?cN(n):e)[t]}function jN(e,t){if(!(t in e))return;let n=jS(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=jS(n)}}function kN(e){e.modified_||(e.modified_=!0,e.parent_&&kN(e.parent_))}function VN(e){e.copy_||(e.assigned_=new Map,e.copy_=dN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}UN.deleteProperty=function(e,t){return UN.set.call(this,e,t,void 0)},UN.set=function(e,t,n){return LN.set.call(this,e[0],t,n,e[0])};function BN(e,t,n,r){const[a,s]=rN(t)?IN(gN).proxyMap_(t,n):aN(t)?IN(gN).proxySet_(t,n):function(e,t){const n=nN(e),r={type_:n?1:0,scope_:t?t.scope_:CN(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=r,s=LN;n&&(a=[r],s=UN);const{revoke:o,proxy:i}=Proxy.revocable(a,s);return r.draft_=i,r.revoke_=o,[i,r]}(t,n);return(n?.scope_??CN()).drafts_.push(a),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push((function(r){const a=t;if(!a||!vN(a,r))return;r.mapSetPlugin_?.fixSetContents(a);const s=lN(a);$N(e,a.draft_??a,s,n),xN(a,r)}))}(n,s,r):s.callbacks_.push((function(e){e.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:t}=e;s.modified_&&t&&t.generatePatches_(s,[],e)})),a}function GN(e){if(!zS(e)||hN(e))return e;const t=e[LS];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=dN(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=dN(e,!0);return JS(n,((e,t)=>{tN(n,e,GN(t))}),r),t&&(t.finalized_=!1),n}var WN=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(oN(e)&&!oN(t)){const n=t;t=e;const r=this;return function(e=n,...a){return r.produce(e,(e=>t.call(this,e,...a)))}}let r;if(oN(t)||US(6),void 0===n||oN(n)||US(7),zS(e)){const a=bN(this),s=BN(a,e,void 0);let o=!0;try{r=t(s),o=!1}finally{o?NN(a):_N(a)}return SN(a,n),PN(r,a)}if(!e||!sN(e)){if(r=t(e),void 0===r&&(r=e),r===wS&&(r=void 0),this.autoFreeze_&&uN(r,!0),n){const t=[],a=[];IN(fN).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:a}),n(t,a)}return r}US(1)},this.produceWithPatches=(e,t)=>{if(oN(e))return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},iN(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),iN(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),iN(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){zS(e)||US(8),qS(e)&&(e=function(e){qS(e)||US(10);return GN(e)}(e));const t=bN(this),n=BN(t,e,void 0);return n[LS].isManual_=!0,_N(t),n}finishDraft(e,t){const n=e&&e[LS];n&&n.isManual_||US(9);const{scope_:r}=n;return SN(r,t),PN(void 0,r)}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 r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=IN(fN).applyPatches_;return qS(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},HN=WN.produce;function qN(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 zN=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),YN=()=>Math.random().toString(36).substring(7).split("").join("."),KN={INIT:`@@redux/INIT${YN()}`,REPLACE:`@@redux/REPLACE${YN()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${YN()}`};function QN(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 JN(e,t,n){if("function"!=typeof e)throw new Error(qN(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(qN(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(qN(1));return n(JN)(e,t)}let r=e,a=t,s=new Map,o=s,i=0,c=!1;function l(){o===s&&(o=new Map,s.forEach(((e,t)=>{o.set(t,e)})))}function d(){if(c)throw new Error(qN(3));return a}function u(e){if("function"!=typeof e)throw new Error(qN(4));if(c)throw new Error(qN(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(qN(6));t=!1,l(),o.delete(n),s=null}}}function p(e){if(!QN(e))throw new Error(qN(7));if(void 0===e.type)throw new Error(qN(8));if("string"!=typeof e.type)throw new Error(qN(17));if(c)throw new Error(qN(9));try{c=!0,a=r(a,e)}finally{c=!1}return(s=o).forEach((e=>{e()})),e}p({type:KN.INIT});return{dispatch:p,subscribe:u,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw new Error(qN(10));r=e,p({type:KN.REPLACE})},[zN]:function(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(qN(11));function n(){const e=t;e.next&&e.next(d())}n();return{unsubscribe:e(n)}},[zN](){return this}}}}}function XN(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const a=t[r];0,"function"==typeof e[a]&&(n[a]=e[a])}const r=Object.keys(n);let a;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:KN.INIT}))throw new Error(qN(12));if(void 0===n(void 0,{type:KN.PROBE_UNKNOWN_ACTION()}))throw new Error(qN(13))}))}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let s=!1;const o={};for(let a=0;a<r.length;a++){const i=r[a],c=n[i],l=e[i],d=c(l,t);if(void 0===d){t&&t.type;throw new Error(qN(14))}o[i]=d,s=s||d!==l}return s=s||r.length!==Object.keys(e).length,s?o:e}}function ZN(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function e_(e){return({dispatch:t,getState:n})=>r=>a=>"function"==typeof a?a(t,n,e):r(a)}var t_=e_(),n_=e_,r_="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?ZN:ZN.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function a_(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(g_(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return QN(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var s_=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 o_(e){return zS(e)?HN(e,(()=>{})):e}var i_="RTK_autoBatch",c_=e=>t=>{setTimeout(t,e)},l_=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let a=!0,s=!1,o=!1;const i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?(l=window.requestAnimationFrame,d=100,e=>{let t=!1;const n=()=>{t||(t=!0,cancelAnimationFrame(r),clearTimeout(a),e())},r=l(n),a=setTimeout(n,d)}):c_(10):"callback"===e.type?e.queueNotification:c_(e.timeout);var l,d;const u=()=>{o=!1,s&&(s=!1,i.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>a&&e()));return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return a=!e?.meta?.[i_],s=!a,s&&(o||(o=!0,c(u))),r.dispatch(e)}finally{a=!0}}})};function d_(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:a=!0}=e??{};let s=new s_;return t&&("boolean"==typeof t?s.push(t_):s.push(n_(t.extraArgument))),s},{reducer:n,middleware:r,devTools:a=!0,duplicateMiddlewareCheck:s=!0,preloadedState:o,enhancers:i}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!QN(n))throw new Error(g_(1));c=XN(n)}l="function"==typeof r?r(t):t();let d=ZN;a&&(d=r_({trace:!1,..."object"==typeof a&&a}));const u=function(...e){return t=>(n,r)=>{const a=t(n,r);let s=()=>{throw new Error(qN(15))};const o={getState:a.getState,dispatch:(e,...t)=>s(e,...t)},i=e.map((e=>e(o)));return s=ZN(...i)(a.dispatch),{...a,dispatch:s}}}(...l),p=(e=>function(t){const{autoBatch:n=!0}=t??{};let r=new s_(e);return n&&r.push(l_("object"==typeof n?n:void 0)),r})(u);return JN(c,o,d(..."function"==typeof i?i(p):p()))}function u_(e){const t={},n=[];let r;const a={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(g_(28));if(r in t)throw new Error(g_(29));return t[r]=n,a},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),a),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),a),addDefaultCase:e=>(r=e,a)};return e(a),[t,n,r]}function p_(e,t){let n,[r,a,s]=u_(t);if("function"==typeof e)n=()=>o_(e());else{const t=o_(e);n=()=>t}function o(e=n(),t){let o=[r[t.type],...a.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===o.filter((e=>!!e)).length&&(o=[s]),o.reduce(((e,n)=>{if(n){if(qS(e)){const r=n(e,t);return void 0===r?e:r}if(zS(e))return HN(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return o.getInitialState=n,o}var{assign:h_}=Object;function g_(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 f_=e=>{let t=new Set,n=t;const r=()=>{t===n&&(t=new Set(t))},a=e=>{let n=!0;return r(),t.add(e),()=>{n&&(r(),t.delete(e),n=!1)}},s=()=>{const e=Array.from(t);n=t,e.forEach((e=>e()))};return(...t)=>{const n=e(...t);let r=!1,o=!1;const i=e=>Array.isArray(e)?e.map(i):n.dispatch(e);return n.subscribe((()=>{o?r=!0:s()})),{...n,dispatch:e=>{const t=o;t||(r=!1,o=!0);const n=i(e),a=r&&!t;return t||(r=!1,o=!1),a&&s(),n},subscribe:a}}},m_=(e,t)=>{const{data:{shared:n={}}={},context:r}=t;((e,t)=>{mg.updateDataPageStore(t),Object.keys(t).forEach((n=>{hC.getIn(e,[Fr.SHARED,n])?Object.keys(t[n]).forEach((r=>{hC.setIn(e,[Fr.SHARED,n,r],t[n][r])})):hC.setIn(e,[Fr.SHARED,n],t[n])}))})(e,n),r&&hC.deleteIn(e,[r,"shared"])},y_=(e,t,n=!1)=>{const{context:r,caseViewMode:a=(n?void 0:Fr.PERFORM_MODE),containerName:s}=t;s!==bI.WORKAREA&&a&&hC.setIn(e,[r,"context_data","caseViewMode"],a)},I_=(e,t)=>{const{context:n}=t;hC.setIn(e,[n,"context_data","actionType"],t.actionType),hC.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},E_=e=>null!==e&&"object"==typeof e,A_=(e,t=[])=>{t.forEach((t=>hC.deleteIn(e,t)))},C_=(e,t=[])=>{t.forEach((t=>hC.deleteIn(e,t)))},S_=(e,t=[])=>{t.forEach((t=>{hC.deleteIn(e,t)}))},N_=(e,t,n={})=>{const{deleteAssignmentSpecificResources:r=!0,doDeleteConfirmationDetails:a=!0,skipMergeAssignmentsAndActions:s=!0}=n;hC.deleteIn(e,[t,"nextAssignmentInfo"]),s&&(hC.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"availableActions"]),hC.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"availableProcesses"]),hC.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"assignments"])),hC.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"activeActionID"]),hC.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"childCases"]),a&&(hC.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"confirmationLinks"]),hC.deleteIn(e,[t,"caseMessages"])),r&&(hC.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"actionButtons"]),hC.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"navigation"]))},__=p_({},(e=>{e.addCase(Oa,((e,t)=>{if(!t.payload.data||e[t.payload.context])return;t.payload.doDeleteCaseSummary&&N_(e,t.payload.context);const{target:n}=t.payload;n&&(n.includes(Fr.WORKAREA)||n.includes(Fr.MODAL))?e[t.payload.context]=t.payload.data:e[t.payload.containerItemID]=t.payload.data,y_(e,t.payload),I_(e,t.payload),m_(e,t.payload),((e,t)=>{const{context:n}=t;hC.deleteIn(e,[n,"context_data","blocking_action_counter"]),hC.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload)})).addCase(Fa,((e,t)=>{t.payload.doDeleteCaseSummary&&N_(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:r=[]}=t.payload;if(n&&(n.includes(Fr.WORKAREA)||n.includes(Fr.MODAL))){const n=e[t.payload.context];E_(n)&&(e[t.payload.context]=iC(n,t.payload.data,{propertiesToReplace:[...r]}))}else{const n=e[t.payload.containerItemID];E_(n)&&(e[t.payload.containerItemID]=iC(n,t.payload.data,{propertiesToReplace:[...r]}))}(t.payload.actionType||t.payload.assignmentID)&&I_(e,t.payload),y_(e,t.payload),m_(e,t.payload),C_(e,t.payload.suggestionContexts)})).addCase(Da,((e,t)=>{const{childContainersContexts:n=[]}=t.payload;((e,t)=>{const{containerItemID:n,context:r,deleteContext:a}=t;a&&hC.deleteIn(e,[r]),hC.deleteIn(e,[n])})(e,t.payload),S_(e,n),A_(e,t.payload.transientItems),C_(e,t.payload.suggestionContexts)})).addCase(Pa,((e,t)=>{const{containerItems:n}=t.payload;Array.isArray(n)?n.forEach((t=>{hC.deleteIn(e,[t])})):hC.deleteIn(e,[n])})).addCase(ja,((e,t)=>{const{context:n,contextToBeRemoved:r,data:a,childContainersContextsToBeRemoved:s}=t.payload;N_(e,t.payload.context),y_(e,t.payload);const o=e[n],i=e[r];if(!E_(o)||!E_(i))return;const c=iC(o,i);E_(c)&&(e[n]=iC(c,a),hC.deleteIn(e,[r]),S_(e,s),m_(e,t.payload))})).addCase(ka,((e,t)=>{const{context:n,pulseReplace:r=!0,childContainersContexts:a=[]}=t.payload;let{data:s}=t.payload;const o=hC.getIn(e[n],"pulse");let i=hC.getIn(e[n],"OperatorID"),c=hC.getIn(e[n],"pxRequestor");c&&s.pxRequestor&&(c=hC.mergeDeep(c,s.pxRequestor)),i&&s.OperatorID&&(i=hC.mergeDeep(i,s.OperatorID)),!r&&o&&(s=cC(s,"pulse",o),s=cC(s,"OperatorID",i),s=cC(s,"pxRequestor",c)),hC.setIn(e,n,s),y_(e,t.payload),m_(e,t.payload),S_(e,a),A_(e,t.payload.transientItems),C_(e,t.payload.suggestionContexts)})).addCase(gs,((e,t)=>{const{context:n,doDeleteConfirmationDetails:r=!0,skipMergeAssignmentsAndActions:a=!0}=t.payload;N_(e,n,{doDeleteConfirmationDetails:r,skipMergeAssignmentsAndActions:a})})).addCase(va,((e,t)=>{const{transientItemID:n,data:r}=t.payload;hC.setIn(e,n,r)})).addCase($a,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>hC.deleteIn(e,t)))})).addCase(xa,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>hC.deleteIn(e,t)))})).addCase(Ra,((e,t)=>{const{transientItemID:n,data:r}=t.payload;iC(hC.getIn(e,n),r)})).addCase(wa,((e,t)=>{const{transientItemID:n,data:r}=t.payload;iC(hC.getIn(e,n),r)})).addCase(Ma,((e,t)=>{const{transientItemID:n,data:r}=t.payload;Object.keys(r??{}).forEach((t=>{hC.deleteIn(e,[n,t])}))})).addCase(La,((e,t)=>{const{transientItemID:n,data:r}=t.payload;hC.deleteIn(e,n),hC.setIn(e,n,r)})).addCase(da,((e,t)=>{const{key:n,value:r}=t.payload;hC.setIn(e,`${Fr.SHARED}.${n}`,r)})).addCase(Ga,((e,t)=>{const{context:n,data:r}=t.payload;return hC.setIn(e,n,r)}))}));function b_(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 T_=a_(ms),P_=p_({},(e=>{e.addCase(Ca,((e,t)=>{const{propertiesToReplace:n=[],propertiesToReArrange:r=[],uiRootReference:a="",interestPath:s}=t.payload,o=a&&"string"==typeof t.payload.context?`${t.payload.context}.${a}`:t.payload.context,i="string"==typeof o?zA(o):[],c={isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n],propertiesToReArrange:[...r]};if(a&&i.length)hC.setIn(e,i,iC(hC.getIn(e,i),hC.getIn(t.payload.data,zA(a)),c));else if(s){const a=hC.getIn(e[t.payload.context],s),o=hC.getIn(t.payload.data,s),i=iC(a,o,{isArrayDeepMerge:!0}),c=hC.getIn(t.payload.data.context_data,s);oC(e[t.payload.context],[...n],[...r]),hC.setIn(e[t.payload.context],s,i),e[t.payload.context]&&c&&hC.setIn(e[t.payload.context].context_data,s,iC(hC.getIn(e[t.payload.context].context_data,s),c,{isArrayDeepMerge:!0}))}else e[t.payload.context]=iC(e[t.payload.context],t.payload.data,c);y_(e,t.payload,!0),m_(e,t.payload)})).addCase(Xr,((e,t)=>{const{context:n,reference:r,value:a,isArrayDeepMerge:s}=t.payload;cC(e[n],r,a,{isArrayDeepMerge:s})})).addCase(Zr,((e,t)=>{const{context:n,reference:r,value:a}=t.payload;lC(e[n],r,a)})).addCase(Sa,((e,t)=>{aC(e[t.payload.context],t.payload.reference)})).addCase(oa,((e,t)=>{hC.setIn(e[t.payload.context],"context_data.isLoading",!0)})).addCase(ia,((e,t)=>{hC.setIn(e[t.payload.context],"context_data.isLoading",!1)})).addCase(ca,((e,t)=>{const n=b_(t);n&&(e[n]||(e[n]={}),hC.setIn(e[n],"context_data.isOffline",!0))})).addCase(la,((e,t)=>{const n=b_(t);n&&(e[n]||(e[n]={}),hC.setIn(e[n],"context_data.isOffline",!1))})).addCase(us,((e,t)=>{const{data:n}=t.payload;m_(e,{data:{shared:n}})})).addCase(ps,((e,t)=>{const{dataPagesToBeRemoved:n=[]}=t.payload;n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:r}=t;hC.deleteIn(e.shared,[n,r]);const a=hC.getIn(e.shared,[n]);a&&0===Object.keys(a).length&&hC.deleteIn(e.shared,[n])}))})).addCase(fs,((e,t)=>{const n=hC.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);t.payload.isInitiateBlockingAction?hC.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):hC.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1)})).addCase(T_,((e,t)=>{e.locale=hC.getIn(t.payload,"locale","")}))})),O_=/\[(\d+)\]$/gi,D_=/(\d+)/gi,v_=/\[\d+\]$/,R_=(e,t,n,r=[Fr.CONTEXT_DATA,Fr.CASE_INFO.CASE_INFO,Fr.CONTENT])=>{const a=hC.getIn(t,r);if(a){const t=bd(a,[],[]);for(const a of t)hC.setIn(e[n],[...r,...a],{})}},$_=(e,t,n,r)=>{const{property:a,pageReference:s,category:o,type:i,subType:c}=r.payload,l=hC.getIn(e[t],n);if(l&&o===Fr.CASEMESSAGES)hC.setIn(e[t],Id(a,s,o),"");else if(l&&l.length>0&&Array.isArray(l)){let r;r=c?l.filter((e=>!(e.type===i&&e.subType===c))):l.filter((e=>e.type!==i)),n&&n.length>0&&hC.setIn(e[t],Id(a,s,o),r)}},x_=(e,t)=>{const{property:n,pageReference:r,category:a,isListEntry:s,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return R_(e,i,c),e;const l=Id(n,r,a,s);if(Number.isInteger(o)){hC.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=hC.getIn(e[c],t)||{};const r=(d=Object.keys(n),[...d].sort(((e,t)=>{const n=e.match(O_),r=t.match(O_);if(!n&&!r)return e.localeCompare(t);if(!n&&r)return-1;if(n?.length&&r?.length){const e=n[0].match(D_),t=r[0].match(D_);if(e?.length&&t?.length)return parseInt(e[0],10)-parseInt(t[0],10)}return 1})));n=r.map((e=>n[e])),n.forEach(((n,a)=>{const s=r[a].match(O_);if(s?.length){const i=parseInt(s[0].match(D_)[0],10);i>o&&(hC.deleteIn(e[c],t.concat(r[a])),hC.setIn(e[c],t.concat(r[a].replace(v_,`[${i-1}]`)),n))}}))}else hC.setIn(e[c],l,{});var d;return e};function w_(e,t){const n=hC.getIn(e,t);return void 0!==n?.dataInfo?.content}const M_=(e,t)=>{const n=hC.getIn(e,t);return!0===ry.isObjectCaseType(n?.objectInfo?.objectTypeID)};function L_(e,t){let n=yd.FIELD_MESSAGES_PATH;return w_(e,t)?n=yd.DATA_OBJECT_FIELD_MESSAGES_PATH:M_(e,t)&&(n=yd.OBJECT_FIELD_MESSAGES_PATH),n}const U_=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const r=hC.getIn(n,Fr.ERROR_FIELD_IN_PAGE).slice(1),a=hC.getIn(n,Fr.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(a){let s="caseInfo.content";w_(e,t)?s="dataInfo.content":M_(e,t)&&(s="objectInfo.content");let o=r?`${s}.${r}`:s;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=Id(a,o,Fr.PROPERTY),c=hC.getIn(e[t],`${o}.classID`),l=fA(a,c),d=LE.getLocale()??"en-US",u=new pf(d,l?.localeReference),p={type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:u.getLocalizedText(l.label)}},h=hC.getIn(e[t],i,[]);if(hC.isContains(h,p))return;hC.setIn(e[t],i,[...h,p])}})(e,t,n)}))};function F_(e,t){const{err:n,formFields:r}=t.payload;let{context:a}=t.payload;const{fieldErrors:s,pageErrors:o}=((e,t)=>{const n=new Map(t.map(((e,t)=>[e,t]))),r=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)=>r(e)-r(t))),s=[],o=[];for(const e of a)Em(e,t,s,o);return{fieldErrors:o,pageErrors:s}})(n.errorDetails,r),i=L_(e,a);if(hC.setIn(e,[a,...i],{}),hC.setIn(e,[a,...yd.PAGE_MESSAGES_PATH],[]),s.forEach((t=>{const n=hC.getIn(t,Fr.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 r=t.substring(t.lastIndexOf(".")+1),s=Id(r,n,Fr.PROPERTY);hC.setIn(e,[a,...s],[])}}})),s.length>0&&U_(e,a,s),o.length>0){const t=(e=>{const t=[];return e.forEach((e=>{t.push({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue})})),t})(o);e[a]||(a=Fr.APP.APP),hC.setIn(e,[a,...yd.PAGE_MESSAGES_PATH],t)}else a.includes&&a.includes(bI.WORKAREA)&&(a=Wr(a)),hC.deleteIn(e,[a,...yd.PAGE_MESSAGES_PATH]);return e}const j_=p_({},(e=>{e.addCase(ba,((e,t)=>t.payload.err.errorDetails&&(t.payload.err.errorClassification===Ur.VALIDATION_FAIL||t.payload.err.errorClassification===Ur.INVALID_INPUTS||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?F_(e,t):e)).addCase(Fa,((e,t)=>{const{context:n}=t.payload,r=[n,...L_(e,n)],a=[n,...yd.PAGE_MESSAGES_PATH];if(hC.setIn(e,r,{}),hC.setIn(e,a,[]),n&&n.includes(bI.WORKAREA)){const t=[Qr(n),...yd.PAGE_MESSAGES_PATH];hC.setIn(e,t,[])}})).addCase(cs,((e,t)=>{const{isListEntry:n,clearAll:r,context:a}=t.payload;return r?(hC.deleteIn(e,[a,Fr.CONTEXT_DATA]),e):n?x_(e,t):((e,t)=>{const{property:n,pageReference:r,category:a,isListEntry:s,stateObj:o}=t.payload,{context:i}=t.payload;let c=i;if(o)return R_(e,o,i),e;const l=Id(n,r,a,s);return a===Fr.PAGE&&i?.includes(bI.WORKAREA)&&(c=Wr(i)),$_(e,c,l,t),$_(e,i,l,t),e})(e,t)})).addCase(is,((e,t)=>{const{messages:n,property:r,pageReference:a,context:s,category:o}=t.payload,i=Id(r,a,o);n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&hC.setIn(e[s],Id(r,a,o),n)}))})),k_=(e,t,n,r,a)=>{hC.setIn(e[t],[...n,r],a)},V_=[P_,__,j_,p_({},(e=>{e.addCase(hs,((e,t)=>{const{instruction:n,actions:r,context:a,referenceList:s,listIndex:o,groupIndex:i,listMoveToIndex:c,content:l={}}=t.payload,d=zA(s);switch(n){case Fr.LIST_ACTIONS.ADD:k_(e,a,d,i,l);break;case Fr.LIST_ACTIONS.INSERT:k_(e,a,d,o,l);break;case Fr.LIST_ACTIONS.UPDATE:((e,t,n,r,a)=>{const s=iC(hC.getIn(e[t],[...n,r],{}),a);hC.setIn(e[t],[...n,r],s)})(e,a,d,o??i,l);break;case Fr.LIST_ACTIONS.DELETE:((e,t,n,r,a)=>{const s=hC.getIn(e[t],n,[]);"string"==typeof r?delete s[r]:s.splice(r,1),hC.setIn(e[t],n,s),md.deleteListNode(t,[a],s.length)})(e,a,d,o??i,s);break;case Fr.LIST_ACTIONS.MOVE:((e,t,n,r,a)=>{const s=hC.getIn(e[t],[...n,r],{}),o=hC.getIn(e[t],n,[]);o.splice(r,1),o.splice(a,0,s),hC.setIn(e[t],n,o),Cd(e,t,n?.join("."),r,a)})(e,a,d,o,c);break;case Fr.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,r)=>{const a=hC.getIn(e[t],n)||[];r.forEach((e=>{const{instruction:r,content:s,listIndex:o}=e;if(r===Fr.LIST_ACTIONS.SELECT){a[o]=s;const e=n?.join(".");Du(t,e)}else delete a[o]})),hC.setIn(e[t],n,a.filter(Boolean))})(e,a,d,r);break;case Fr.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{hC.setIn(e[t],n,[])})(e,a,d);break;case Fr.LIST_ACTIONS.REPLACE:((e,t,n,r)=>{hC.setIn(e[t],n,r)})(e,a,d,l);break;case Fr.LIST_ACTIONS.DELETEPAGE:((e,t,n)=>{hC.setIn(e[t],n,{})})(e,a,d)}}))}))],B_=(e,t)=>(e||(e=Y_().data),t.type===ls?Y_().data:(V_.forEach((n=>{e=n(e,t)})),e)),G_={},W_=(e,t=[])=>{t.forEach((t=>{hC.deleteIn(e,[t])}))},H_=(e,t)=>{const{type:n,payload:r}=t,a=n===Fa,{target:s,context:o,semanticURL:i="",root:c,containerItemID:l,childContainers:d,flowName:u,resourceType:p="",key:h="",clearView:g=!1}=r;return c?hC.setIn(e,[s,"items",l,"view"],c):g&&hC.deleteIn(e,[s,"items",l,"view"]),o&&hC.setIn(e,[s,"items",l,"context"],o),u&&hC.setIn(e,[s,"items",l,"flowName"],u),(!a||a&&h)&&hC.setIn(e,[s,"items",l,"key"],h.trim()),((e,t,n,r)=>{""===e&&hC.deleteIn(t,[n,"items",r,"key"])})(h,e,s,l),(!a||a&&i)&&hC.setIn(e,[s,"items",l,"semanticURL"],i),(!a||a&&p)&&hC.setIn(e,[s,"items",l,"resourceType"],p),W_(e,d),e},q_=p_(G_,(e=>{e.addCase(ls,(()=>G_)).addCase(Ta,((e,t)=>{const{context:n,name:r,type:a,actionMgrID:s}=t.payload,o=`${n}/${r}`;if(Vp.resolveActionByID(s,null,!1),e[o])return e;hC.setIn(e,[o],{type:a,accessedOrder:[],items:{}})})).addCase(Ba,((e,t)=>{const{containerName:n,childContainers:r=[]}=t.payload;hC.deleteIn(e,[n]),r.forEach((t=>{hC.deleteIn(e,[t])}))})).addCase(Pa,((e,t)=>{const{context:n,name:r,actionMgrID:a,childContainers:s}=t.payload,o=`${n}/${r}`;Vp.resolveActionByID(a,null,!1),hC.setIn(e,[o,"accessedOrder"],[]),hC.setIn(e,[o,"items"],{}),Array.isArray(s)&&s.forEach((t=>{hC.deleteIn(e,[t])}))})).addCase(Oa,((e,t)=>{const{target:n,context:r,isInCreateStage:a,isBulkAction:s,semanticURL:o,root:i,containerItemID:c,actionMgrID:l,key:d,flowName:u,resourceType:p,actionName:h,isMinimizable:g,showProgress:f,progressMessage:m,modalOptions:y,resourceStatus:I,actionID:E,isMultiRecordData:A,acTertiary:C,parentContext:S,heading:N,isTraditionalRemoteCase:_,readOnly:b,referenceList:T,subscriptName:P,subscriptFieldName:O,pageGroupName:D,isPageGroup:v,index:R,isDeleteConfirmation:$,workId:x,caseTypeID:w,className:M,keys:L,enableBackNavigation:U}=t.payload,F=e[n],j=F&&F.type,k=F&&F.accessedOrder||[],V=F&&F.items||{};if(e[n]&&"single"===j&&k.length>0)return H_(e,t);const B={accessedOrder:[...k,c],items:{...V,[c]:{view:i,semanticURL:o,key:d,flowName:u,readOnly:b,context:r,isInCreateStage:a,resourceType:p,actionName:h,isMinimizable:g,...s&&{isBulkAction:s},showProgress:f,progressMessage:m,modalOptions:y,isTraditionalRemoteCase:_,resourceStatus:I,referenceList:T,subscriptName:P,subscriptFieldName:O,pageGroupName:D,isPageGroup:v,index:R,...E&&{actionID:E},...C&&{acTertiary:C},...A&&{isMultiRecordData:A},...S&&{parentContext:S},...$&&{isDeleteConfirmation:$,workId:x,caseTypeID:w,className:M,keys:L,enableBackNavigation:U},heading:N}}};Vp.resolveActionByID(l,null,!1),e[n]=Rr(e[n],B)})).addCase(Fa,((e,t)=>{const{actionMgrID:n,data:r}=t.payload;try{H_(e,t),Vp.resolveActionByID(n,r,!1)}catch{Vp.rejectActionByID(n,!1)}})).addCase(ka,((e,t)=>((e,t)=>{const{actionMgrID:n,data:r,target:a,containerItemID:s}=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,s]:c.includes(s)?c:[...c,s],hC.setIn(e,[a,"items",s,"transientItems"],[]),hC.setIn(e,[a,"accessedOrder"],c),o=H_(e,t),Vp.resolveActionByID(n,r,!1)}catch{Vp.rejectActionByID(n,!1)}return o})(e,t))).addCase(Ua,((e,t)=>{const{target:n,containerItemID:r,actionMgrID:a}=t.payload;try{const t=hC.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));t.push(r),hC.setIn(e,[n,"accessedOrder"],t),Vp.resolveActionByID(a,null,!1)}catch{Vp.rejectActionByID(a,!1)}})).addCase(ja,((e,t)=>{const{target:n,containerItemID:r,actionMgrID:a,childContainers:s}=t.payload;try{const t=hC.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));hC.setIn(e,[n,"accessedOrder"],t),hC.deleteIn(e,[n,"items",r]),W_(e,s),Vp.resolveActionByID(a,null,!1)}catch{Vp.rejectActionByID(a,!1)}})).addCase(Da,((e,t)=>{const{target:n,containerItemID:r,actionMgrID:a,childContainers:s}=t.payload;try{const t=hC.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));hC.setIn(e,[n,"accessedOrder"],t),hC.deleteIn(e,[n,"items",r]),W_(e,s),Vp.resolveActionByID(a,null,!1)}catch{Vp.rejectActionByID(a,!1)}})).addCase(va,((e,t)=>{const{transientItemID:n,target:r,contextName:a}=t.payload,s=hC.getIn(e,[r,"items",a,"transientItems"])??[];hC.setIn(e,[r,"items",a,"transientItems"],[...s,n])})).addCase(xa,((e,t)=>{const{target:n,containerItemID:r}=t.payload;hC.deleteIn(e,[n,"items",r,"transientItems"])})).addCase($a,((e,t)=>{const{target:n,transientItemID:r,containerItemID:a}=t.payload,s=(hC.getIn(e,[n,"items",a,"transientItems"])??[]).filter((e=>e!==r));hC.setIn(e,[n,"items",a,"transientItems"],s)}))}));let z_={};const Y_=()=>z_,K_=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,r=n[Fr.CONTEXT_DATA]||e[Fr.CONTEXT_DATA];z_={data:{locale:LE.getLocale(),[Fr.APP.APP]:{...t,[Fr.CONTEXT_DATA]:r}},containers:{}}})(e),{data:B_,containers:q_}),Q_=(e,t=!1)=>e===Fr.ACTION?t?wg.REFRESH_CASE_DATA:wg.REFRESH_ASSIGNMENT_DATA:wg.REFRESH_CASE_VIEW,J_=e=>{const{context:t}=e;let n={...gm(t).content,contextData:!1};const r=Lm(t);hC.isEmpty(r)||(n=Mm(r,n));const a=Q_(e.editType,e.isLocalAction),{restApi:s,reqType:o}=mS(a,{ID:e.isLocalAction||e.editType!==Fr.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=s;return e.editType===Fr.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID),n.interestPage=e.interestPage,Jl(au(i,{method:o,body:n,headers:e.headers},t)).pipe(hh((t=>({actionInPayload:e,response:t.data,headers:hm(t.headers)}))),Ph(": Error occurred during ajax call : ",t))},X_={},{VIEW:Z_,FIELD:eb}=Fr.CONTEXT_TREE_NODE_TYPES,tb=(e,t,n)=>{const r=t.value.data[n]?.objectInfo?.headers,a=t.value.data[n]?.caseInfo?.headers;return!ry.shouldUseUnifiedHandling()&&e&&r?r:a},nb=e=>Qd[e]>0&&X_[e],rb=(e,t)=>{const{caseWideAction:n,caseViewAction:r,fieldsWithDeclarativeTargets:a,fieldsWithWhen:s,isViewsWithWhen:o,interestPage:i,options:c,isMultiRecordData:l,editType:d,isLocalAction:u,interestPageActionID:p}=e,{optionalPayload:h}=c;h&&(t.content={...h});let g={},f={...t},m=wg.REFRESH;if(r||l&&d===Fr.ACTION){const t=Q_(d,u);l&&d===Fr.ACTION&&(f.interestPageActionID=p),g=mS(t,e),f={...f,interestPage:i}}else o?g=((e,t)=>{const{isObjectType:n,isExternalObject:r,actionID:a,context:s,isExternalCase:o,casetypeID:i}=e,c=Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW);if(t||n&&Py(s)){let t=r&&a===c?wg.REFRESH_EXTERNAL_OBJECT:wg.REFRESH_CASE_DATA;const n=ry.shouldUseUnifiedHandling();return r&&a===c&&n&&(t=wg.REFRESH_EXTERNAL_CASE_DATA),mS(t,e)}return mS(o&&i&&a===c?wg.REFRESH_EXTERNAL_CASE_DATA:wg.REFRESH_ASSIGNMENT_DATA,e)})(e,n):(a.length>0||s.length>0)&&({restAPI:g,requestBody:f,requestType:m}=((e,t,n,r,a)=>(a={...a,calculations:{fields:t,whens:n}},{restAPI:mS(r?wg.RECALCULATE_CASE_DATA:wg.RECALCULATE_ASSIGNMENT_DATA,e),requestBody:a,requestType:wg.RECALCULATE}))(e,a,s,n,f));return{restAPI:g,requestBody:f,requestType:m}},ab=[(e,t)=>e.pipe(_h(wg.REFRESH_DATA,Ps),hh((e=>e.payload)),Sh((e=>!im(e?.options?.actionMgrID))),gh((e=>{const{context:n,contextData:r,options:a,isObjectType:s}=e,{propertyName:o="",classID:i="",isObjectWideAction:c,skipPayloadGeneration:l}=a,d=l?{content:{}}:gm(n,{skipUUID:!1,isObjectWideAction:c});let u=[],p=[],h=!1;LE.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:u=[],whens:p=[]}=xy(n)),h=p.some((e=>e.type===Z_))):h=!0;const g=p.filter((e=>e.type===eb)),f=hC.getPropertyName(o),m=f?f.split("."):[],y=m.pop(),I=m.join("."),E=[];I&&((e,t,n,r,a)=>{const s=fA(e,t);if(!s||"copy"!==s.dataRetrievalType)return;const o=hC.getIn(n,`content.content.${e}`);if(!o||"object"!=typeof o)return;const i=r?Object.keys(o).filter((e=>e!==r)):Object.keys(o);i.length>0&&(i.forEach((e=>delete o[e])),a.push(e))})(I,i,d,y,E),e.serverPrecedenceFields=E;let A={...d.content,contextData:r};const C=Lm(n);hC.isEmpty(C)||(A=Mm(C,A));const S=rb({...e,fieldsWithDeclarativeTargets:u,fieldsWithWhen:g,isViewsWithWhen:h},A);Bg.registerBlockingAction(n).catch((()=>{}));const{restAPI:N,requestBody:_,requestType:b}=S;(e={...e,requestType:b}).requestType=b;const{reqType:T,restApi:P}=N,O={...tb(s,t,n)};O&&!O.etag&&e.isMultiRecordData&&e.editType===Fr.ACTION&&(O.etag=hC.getETag(e.context));return Jl(((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 r=(e=>{const{ID:t,actionID:n,context:r}=e;return`${t}.${r}.${n}`})(t);if(t.interestPage&&(e.interestPage=t.interestPage),nb(r)){const t=[];for(let n=0;n<X_[r].length;){const a=X_[r][n],s=$y(a,e);if("CANCEL_REFRESH"===s){const e=new Error;return e.code="ERR_CANCELED",Promise.reject(e)}!0===s&&(t.push(n),a.cancelConfig?.cancel()),n+=1}t.forEach((e=>{X_[r].splice(e,1)}))}const a=iu();return e.signal=a.token,e.cancelConfig=a,X_[r]?X_[r].push(e):X_[r]=[e],$d.publish(Ur.PUB_SUB_EVENTS.ON_REFRESH_START,{context:n}),au(e.url,e,n,{cancelContext:r}).then((e=>(delete X_[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete X_[r],e}))})({reqHeaders:O,context:n,method:T,body:_,url:vy(e,P)},e)).pipe(hh((t=>{const r=((e,t,n)=>{const r=ry.shouldUseUnifiedHandling(),a=ry.isObjectCaseType(t)||n;if(r||!a)return e;const s=hC.getIn(e?.data,Ur.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID);return ry.isExternalObject(s)?e:Lr.transformCaseData(e)})(t?.data,a?.classID,s);return a?.resetForm&&md.removeContextTreeNode(n),{response:{...r},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:hm(t.headers)}})),Ph(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),gh((async e=>{if(e&&e.type===ba)return Bg.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),"ERR_CANCELED"===e.payload?.err?.code?[]:($d.publish(Fr.ON_REFRESH_ERROR,{context:e.payload?.context}),Am(e));const{actionConfig:t,response:n,actionMgrID:r}=e,{context:a,serverPrecedenceFields:s,requestType:o}=t,i=Gp.getTargetViewContainerName(Wa),c=js(i,a),l={acName:c,context:a},d=ff(n,{[Ur.STOPMERGEACTIONS]:!0,[Ur.ACTIONS.DELETEAVIALACTIONS]:!0});d.directUrlUpdation=!1,o===wg.REFRESH&&await mm(d,t,l);const u=fm(d,{target:c,context:a});t.interestPage&&(u.interestPath=`caseInfo.content${hC.convertClipboardPageToPageRefNotation(t.interestPage)}`),u.isArrayDeepMerge=t.options?.isArrayDeepMerge,u.preserveClientChanges=void 0===t.options?.preserveClientChanges||t.options.preserveClientChanges;const p=ry.getPropertiesToReArrange(a),h=JC(_C,u,{serverPrecedenceFields:s,propertiesToReArrange:p}),g=h.payload?.data?.pageInstructions;return g?.length>0&&(delete h.payload?.data?.pageInstructions,km.mergeServerPageInstructions(a,g)),QA(h),Vp.resolveActionByID(r,u),$d.publish(Ur.PUB_SUB_EVENTS.ON_REFRESH_COMPLETE,{context:a}),Bg.deRegisterBlockingAction(a).catch((()=>{})),[]})))],sb=[e=>e.pipe(_h(ds),gh((async e=>{const{context:t}=e.payload,n={},r={},a=Object.keys(e.payload.datapages).map((a=>{const s=e.payload.datapages[a];if(s.mode===Fr.READONLY&&s?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=s?.refreshStrategy||{},n=XA()[s.name];if(n&&a in n){const r=n[a],{loadTime:s}=r;if(!Lh.isTimeElapsed(s,e,t))return}}return Lh.getData(s.name,{dataViewParameters:s.dataViewParameters},t).then((e=>{const t=s.mode===Fr.READONLY?r:n;t[s.name]?t[s.name][a]={pxResults:e.data.data,parameters:s.dataViewParameters,loadTime:e.data?.fetchDateTime}:t[s.name]={[a]:{pxResults:e.data.data,parameters:s.dataViewParameters,loadTime:e.data?.fetchDateTime}}})).catch((()=>{}))}));await Promise.allSettled(a);const s=[];return Object.keys(n).length&&s.push(_C({context:t,data:n})),Object.keys(r).length&&s.push(ZC({data:r,context:t})),QA(s),[]})))];class ob{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=()=>n.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 ob.DISPLAY_DIRTY_POPUP:this.displayDirtyPopup(e);break;case ob.LOAD_PREVIEW:this.loadPreview(e);break;case ob.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case ob.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case ob.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case ob.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case ob.CLOSE_CONTAINER_ACTION:this.closeContainer(e);break;case ob.CANCEL_CASE:this.handleCaseCancel();break;case ob.CREATE_WORK:this.createWork(e)}}};displayDirtyPopup=e=>{this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?($d.publish(Fr.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this))};handleCaseCancel=()=>{const e=zI(Ur.APP.APP),t=e[e.length-1],n=VI(t),r=JA(n)?.caseInfo?.ID;if(r&&n&&Rf({}).getPConnect().getActionsApi().getDescendants(r,n),Kf(n)){const e=OE(n);e&&Rf({}).getPConnect().getActionsApi().getDescendants(r,e)}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){Rf({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=Mr.getDefaultQualifiedName("Data-Portal"),t=Mr.getDefaultQualifiedName("pyHome"),n=Rf({isRoot:!0}),r=PCore.getStore()?.getState().data.app?.pyPortal?.pyPrimaryNavPages;let a;Array.isArray(r)&&r[0]&&(a=r[0]);const s=a?.pyClassName||e,o=a?.pyRuleName||t;n.getPConnect().getActionsApi().showPage(o,s)};closeContainer=e=>{const{uniqueId:t}=e.data;t===this.getUniqueId()&&this.navigateToDefaultPage()};updateCoexistenceDrilldownCase=e=>{const{key:t,caseClassName:n,actionApi:r,caseLabel:a,uniqueId:s}=e.data;if(s!==this.getUniqueId())return;let o=r;r===ob.OPEN_WORK_ITEM&&(o=ob.OPEN_WORK_BY_HANDLE),wE.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:o,name:a});Rf({}).getPConnect().getActionsApi().updateRecents(n,t.substring(t.lastIndexOf(" ")+1),a,t)};openAssignment=e=>{const{pzInsKey:t,caseClassName:n,uniqueId:r}=e.data;if(r===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)){Rf({}).getPConnect().getActionsApi().openAssignment(t,n,{containerName:Ur.PRIMARY,context:Ur.APP.APP})}this.onCreateCallback=null,this.openAssignmentParams=null}};getNextWork=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId()){const e=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Ur.PRIMARY}`;Rf({meta:{},options:{context:HI(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){const e=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Ur.PRIMARY}`;Rf({meta:{},options:{context:HI(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};createWork=e=>{const{strClassName:t,uniqueId:n,strFlowParams:r,caseInitProperties:a}=e.data;if(n===this.getUniqueId()){const e=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Ur.PRIMARY}`,n=Rf({meta:{},options:{context:HI(e)}}),s=new URLSearchParams((a+r).slice(1)),o=this.setStartingFields(s);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),$d.subscribe(Ur.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),$d.subscribe(Ur.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{$d.unsubscribeAllWithEventType(Ur.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),$d.unsubscribeAllWithEventType(Ur.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:ob.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:ob.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:ob.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const ib=new ob,cb="nextAssignmentInfo",lb="nextAssignmentInfo.context",db=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Fr.MODAL:t||Gp.getTargetViewContainerName(Qa)},ub=async(e,t)=>{if(QI(e))return{continueExecution:!0,removeActionPayload:{},dirtyCheckPerformed:!1};return{...await bm(e,t),dirtyCheckPerformed:!0}},pb=e=>{if(ry.shouldUseUnifiedHandling())return e?.uiResources?.root?.config?.name===Mr.getDefaultQualifiedName("pzCreateDetails")||!1;const t=hC.getIn(e,[Fr.DATA,Fr.CASE_INFO.CASE_INFO]);return sy(t)&&oy(LE.getOperatorIdentifier(),t)},hb=(e,t)=>{const{class:n,context:r,viewType:a=um.PAGE}=e,{removeActionPayload:s}=t;let o=e?.pageName?e?.pageName:LE.getDefaultCasePage();return e.isTraditionalUICase&&(o=Mr.getDefaultQualifiedName("pyDetails")),Jl(hp.createCase(n,{...e,pageName:o,viewType:a,context:r})).pipe(hh((({response:t,headers:n})=>(Lr.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:s}))),Ph("Error occurred during ajax call at createWork Epic : ",r))},gb=e=>{$d.publish(Fr.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},fb=e=>{$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},mb=e=>{$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_VIEW_OPENED_AFTER_CREATE,e)},yb=e=>{let t,n=0,r=[],a={},s=!1,o=!1;return e.pipe(_h(CC),Oh(100),hh((e=>(({actionMgrID:n}=e.payload),e.payload))),gh((e=>{const{context:r}=e;if(t=e.class,o=!1,ry.isExternalCaseType(t)&&(Nd({context:r,stateObj:JA(r),clearContextMessages:!0}),!Xm(r))){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(n,!0,e),Th()}const a=db(e),i=js(a,r);return s=Zf(t),Jl(ub(i,{loadingContext:r})).pipe(gh((({continueExecution:t,removeActionPayload:r,dirtyCheckPerformed:a})=>t?(o=a,e.isTraditionalUICase=s,hb(e,{removeActionPayload:r})):(Vp.rejectActionByID(n),bh))))})),gh((async e=>{if(e?.type===ba)return e.payload.context=((e,t)=>ry.isExternalCaseType(e)&&t?t:SE())(t,e.payload.context),r.push(Am(e)),r;const{actionInPayload:i,response:c,headers:l,removeActionPayload:d}=e,u=ry.isExternalCaseType(i.class);let p=pb(c);(i.renderInline||LE.getDefaultCasePage()||s)&&(p=!1),hC.setIn(c.data,Ur.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const h=db({...i,isInCreateStage:p}),g=js(h,i.context),f=Sm(g,h,i.context),{openCaseViewAfterCreate:m}=i;if(!o&&((e,t,n)=>!Uf(e)&&QI(t)&&(n??!0))(h,g,m)){const{continueExecution:e}=await bm(g,{loadingContext:i.context});if(!e)return Vp.rejectActionByID(n),r}const y=i?.openCaseViewAfterCreate??!0,I=ff(c);if(!y&&!p){const e=qf(c),{businessID:t,caseType:n,resolvedURL:s}=Xp(c);return a={id:t,label:n,href:s},gb(a),fb({caseId:t,assignmentId:e,caseType:n,ID:Hf(I)}),u&&Yf(i),r}const E=String(Bf(Hf(I)));let A=gS("createWork",{caseClassName:Gf(I)});A=A.replace(/{.+?}/,E),I.semanticURL=A,jp.setComponentCache(E,Yd.addDebugHeaders(i.debugInfo)),((e,t)=>{const n=pb(e),{skipBrowserSemanticUrlUpdate:r=!1,isTraditionalUICase:a}=t,s=a&&!em();hC.setIn(e,["directUrlUpdation"],(!n||s)&&!r)})(I,i);const C={acName:g,context:f},S=om(f);await mm(I,i,C);const N={target:g,context:f,containerItemID:f,headers:l,semanticURL:A,isInCreateStage:p,isMinimizable:p,caseViewMode:I.confirmationNote?Fr.REVIEW_MODE:Fr.PERFORM_MODE,currentCaseViewMode:S,assignmentContext:hC.getIn(I,lb),nextAssignmentInfo:hC.getIn(I,cb),resourceType:Ur.CASE,openCaseViewAfterCreate:i.openCaseViewAfterCreate,modalOptions:i.modalOptions,debugInfo:i.debugInfo};Qf(N,I);const _=fm(I,N);s&&(_.data.caseInfo.content.coexistenceAction="openAssignment"),ry.setTraditionalGadgetId(_.data);const b=Cm(g,_);return Nm(b)&&zf(r,{removeActionPayload:d,target:g}),u&&Yf(i),r.push(b),sm(I,N),mb({caseId:E}),r})),hh((()=>{const e=em(),t=sy(hC.getIn(r[0]?.payload,"data.caseInfo"));return s&&e&&t?ib.postCreateCaseMessage(r[0]?.payload?.nextAssignmentInfo?.ID,wm,r):wm(r),Xf(r,n),a={},r=[],r})))},{RESOURCE_TYPES:Ib}=Ur,Eb=(e,t)=>{const{containerItemID:n,context:r,actionMgrID:a,isInCreateStage:s,isModalAction:o}=t;if(s&&o){const t=Mf(n),s=js(t,r);e.push(JC(BC,{containerItemID:n,target:s,actionMgrID:a}))}},Ab=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:a,isProcessAction:s}=t,o=WI(n),i=`${o?.includes("root")?Fr.APP.ROOT:Fr.APP.APP}/${bI.MODAL}`;e.push(JC(WC,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:r,isInCreateStage:a,isProcessAction:s}))},Cb=e=>eC(".openCaseViewAfterCreate",Fr.CONTEXT_DATA,e)??!0,Sb=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r,a,s)=>{const{caseID:o}=n,i=(c=t,hC.getIn(c,xf.NEXT_ASSIGNMENT_INFO_ID,Fr.EMPTY_STRING));var c;const l=a?zp(t):Gf(t),{caseViewMode:d,headers:u,semanticURL:p,actionMgrID:h,directUrlUpdation:g,key:f,flowName:m,resourceType:y}=r,I=sE(n?.context),E=vI(I,n?.context)?.acTertiary;Object.assign(s,{caseId:o,assignmentId:i,caseType:l,isSubmitFromBlendedUI:E}),Ab(e,{...n,skipReleaseLockRequest:!0});const A=`${n?.containerItemID.includes("root")?Fr.APP.ROOT:Fr.APP.APP}/${bI.PRIMARY}`,C=Sm(A,bI.PRIMARY),S=Yd.getCoreHeadersFromContext(n.context)||!1,N=fm(t,{target:A,context:C,containerItemID:C,caseViewMode:d,headers:u,semanticURL:p,key:f,flowName:m,resourceType:y,directUrlUpdation:g,debugInfo:S&&S.debugInfo&&{debugId:S.debugInfo[Fr.COREHEADER_APP_DEBUG_ID]},shouldUpdateCaseActionsInParentContext:!0});if(QI(A)){const t=JA(C),a=Hf({data:t}),[,s]=a?a.split(" "):[],o=`You will lose unsaved changes for ${s}. Do you want to continue?`;if(!Cb(n.context))return e;{const{continueExecution:t}=await bm(A,{dirtyMessage:o});if(!t)return r.directUrlUpdation=!1,Vp.rejectActionByID(h),Th();N.currentCaseViewMode=om(N?.context),e.push(JC(zC,N)),n.__deferCaseActionsPayload=N}}else e.push(JC($C,N));return t.directUrlUpdation=g,t.semanticURL=p,await mm(t,{...N,acName:A},{acName:A,context:C}),e},Nb=(e,{isModalAction:t,target:n,transientItemID:r})=>{if(t){const t=e.find((({type:e})=>e===ka));t?.payload&&(n=t.payload.target,r=t.payload.containerItemID)}const a=HC({target:n,containerItemID:r});a.payload.transientItems.length&&e.push(a)},_b=e=>/^app\/preview_[0-9]*/g.test(e),bb=(e,t)=>{const n=Wr(e);return!_b(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},Tb=e=>{if(!Cb(e.context)){let t;const n=e?.caseTypeID,r=e?.caseTypeName;return t=e.businessID?e.businessID:e.workID,{caseID:t,caseTypeID:n,caseTypeName:r}}return{}},Pb=(e,t,n,r)=>{const{data:a,caseViewMode:s}=t,o={data:a,caseViewMode:s,context:n};if(hC.setIn(o.data,["context_data","caseViewMode"],s),e.push({type:gs,payload:{context:n}}),r){const t={data:Lr.transformObjectToCase(a),caseViewMode:s,context:n};e.push(JC(_C,t))}e.push(JC(_C,o))},Ob=async(e,t,n,r,a,s,o,i,c,l)=>{const{headers:d}=c,u=l?Fr.OBJECT_INFO.OBJECT_INFO:Fr.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=JA(e),r=c?.response?.data?.caseInfo?.assignments??[],a=n?.caseInfo?.assignments??[],s=om(e)===Fr.PERFORM_MODE,o=r[0]?.ID!==a[0]?.ID,i=r.length>0&&a.length>0;s&&o&&i&&c?.response?.data?.caseInfo?.assignments&&(c.response.data.caseInfo.assignments=t(r,a[0]?.ID))}const p=QI(sE(e));let h=!1;const g=sE(n),f=OI(g),m=VI(g);m&&f?.items?.[m]?.key===c?.actionInPayload?.caseID&&(h=!0),Ab(a,{...r,skipReleaseLockRequest:!0});const y=Mf(e),I={target:sE(e),containerItemID:e,context:e,containerName:y};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const E=Qr(n),A=JA(E),C=JA(r.context),S=A[u]?.ID,N=C[u]?.ID,_=JA(e)?.caseInfo?.ID;if(p&&S===N||!p&&(""===o||I.containerItemID.includes(Fr.WORKAREA)&&t.caseViewMode===Fr.REVIEW_MODE&&_===t.data?.caseInfo?.ID||!s&&t.root&&0===Object.keys(t.root).length&&_===t.data?.caseInfo?.ID))(void 0===t?.data[u]?.content||void 0!==t.data[u].content&&"object"==typeof t.data[u].content&&0===Object.keys(t.data[u].content).length)&&(t.root=void 0,delete t.data?.caseMessages),e.includes(Fr.WORKAREA)&&t.caseViewMode===Fr.REVIEW_MODE&&((e,t)=>{const n=e?.assignmentID,r=t?.data?.caseInfo?.assignments??[],a=r[0]?.ID;return n!==a})(r,i)&&(t.flowName=" ",t.clearView=!0),e.includes(Fr.ACTIONAREA)?a.push(JC(_C,{...t,key:o,resourceType:"",...I})):a.push(JC(FC,{...t,key:o,resourceType:"",...I}));else if(s){const s=sE(e),i=LI(s,o);if(i)I.target=s,I.context=i,I.containerItemID=i,a.push(JC(FC,{...t,key:o,resourceType:"",...I}));else{const e=zI(n)[0];if(r.target=e,r.context=Sm(e,Fr.WORKAREA,n),r?.context){r.containerItemID=r.context,a.push(JC($C,{...r,...t}));const n=r.containerItemID;a.push(JC(BC,{parentContainerTarget:e,containerItemID:n}))}}}if(r.target=sE(e),r.containerName=Mf(e),r.context=e,r.containerItemID=e,r.shouldUpdateCaseActionsInParentContext=!0,hC.setIn(t,"acName",I.target),await mm(i,t),r.__deferCaseActionsPayload=r,h&&(n.includes(Fr.WORKAREA)&&Kf(n)&&(n=Qr(n)),Pb(a,t,n,l)),!s&&t.caseViewMode===Fr.PERFORM_MODE){const t=((e,t)=>{const n=sE(e);return LI(n,t)})(e,o),n={data:{[u]:{headers:d}},context:t};a.push(JC(_C,n)),a.push(yy(((e,t=!1,n=!1)=>{const r=Vp.getNextActionMgrId();return{ID:yC.getPropertyValue(Ur.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:yC.getPropertyValue(Ur.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{Ab(a,r);let e=!1;const o=sE(n),i=OI(o),d=VI(o);if(d&&i?.items?.[d]?.key===c?.actionInPayload?.caseID&&(e=!0),s){const e=zI(n)[0];r.target=e,r.context=Sm(e,Fr.WORKAREA,n),r.containerItemID=r.context,a.push(JC($C,{...r,...t}));const s=r.containerItemID;a.push(JC(BC,{parentContainerTarget:e,containerItemID:s}))}e&&Pb(a,t,n,l)}},Db=async(e,t,n,r,a,s,o)=>{const i=s?"objectInfo":"caseInfo";((e,t,n)=>{if(t.isProcessAction&&(Ab(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?Fr.APP.ROOT:Fr.APP.APP}/${bI.PRIMARY}`,a=Sm(r,bI.PRIMARY),s={insKey:e.ID,className:e.content.classID,context:a,acTargetName:Fr.PRIMARY,isChild:!0},o={type:pa,payload:{...s}};n.push(o)}})(e.data[i].parentCaseInfo,t,a);const c=e?.data[i]?.parentCaseInfo?.ID;if(c){const n=sE(t?.context),r=vI(n,t?.context)?.parentContext,a=sE(r);t?.isProcessAction&&wI(a,c)&&_E(r,e?.data[i]?.lastUpdateTime)}n.resourceType=Ib.CASE,n.directUrlUpdation=!0,t.isProcessAction||await Sb(a,{translatedDXAPIResponse:r,actionInPayload:t},n,s,o)},vb=async(e,t,n,r,a)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===Fr.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:s}=t;QI(sE(s))||hC.setIn(e.data,["context_data","caseViewMode"],e.caseViewMode);const o=ry.getPropertiesToReplace(s);a.push(JC(FC,{...e,...r,propertiesToReplace:o})),hC.setIn(e,"acName",r.target),await mm(n,e),((e,t,n)=>{const{containerItemID:r}=t,a=WI(r),{data:s,caseViewMode:o}=n;if(a&&Kf(r)){const n=Qr(a),i={data:s,caseViewMode:o,context:n};hC.setIn(i.data,["context_data","caseViewMode"],o),e.push({type:gs,payload:{context:n}});const c=ry.getPropertiesToReplace(r);e.push(JC(_C,i,{propertiesToReplace:c})),t.shouldUpdateCaseActionsInParentContext=!0,t.__deferCaseActionsPayload=t}})(a,t,e)},Rb=async(e,t,n,r,a,s,o,i,c,l={})=>{const{isCaseWideAction:d,isInCreateStage:u,containerItemID:p}=e,h=Wr(e.context),g=Wf(a,c),f=c?zp(a):Gf(a),m=u&&!g&&!d,y=zI(h)[0],I=y?VI(y):h,E=Mf(p),A=WI(p),C=Object.freeze({target:e.target,containerItemID:p,context:A,containerName:E});m&&!_b(e.context)?await Db(i,e,t,a,s,c,l):bb(e.context,I)?await Ob(I,t,h,e,s,n,r,a,o,c):!d&&!c||bb(e.context,I)?await vb(t,e,a,C,s):(Ab(s,e),((e,t,n)=>{const{containerItemID:r,caseID:a}=t;if(r&&/^app\/preview_[0-9]*/g.test(r)){const{caseClassName:t}=n,s=Wr(r),o=WI(s);e.push(JC(TC,{containerItemID:s,context:o,container:bI.PREVIEW,containerName:bI.PREVIEW,caseId:a,viewName:Ur.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(s,e,{caseClassName:f}))},$b=(e,t,n)=>{const{isModalAction:r,isCaseWideAction:a,caseID:s}=t,o=bb(t.context,n),i=e?.data?.caseInfo?.stages,c=e?.data?.caseInfo?.stageID;Lg({caseID:s,isModalAction:r,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:a,stages:i,stageID:c})},xb=e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[Fr.ERROR_FIELD_IN_PAGE]=e[Fr.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[Fr.ERROR_FIELD_IN_PAGE].slice(1),r=e[Fr.ERROR_IN_PAGE_IDENTIFIER],a=r.startsWith(".")?r.slice(1):r;if(a){let s=t?`caseInfo.content.${t}`:"caseInfo.content";s=Fr.getProperty(s.replace(/\(/g,"[").replace(/\)/g,"]"));const o=Id(a,s,Fr.PROPERTY),i={type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};md.mutateField(n,s,o[o.length-1],{messages:[i],type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:r})}}))},wb=e=>{const t=JA("app")?.pyPortal?.pyPrimaryNavPages,n=Array.isArray(t)?t[0]:null;return n?(jm.clearChangedProperties(e),[{type:na,payload:{className:n.pyClassName,containerName:Fr.PRIMARY,context:Fr.APP.APP,pageReference:"pyPortal",viewName:n.pyRuleName,skipSemanticUrl:""}}]):[]},Mb=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Fr.MODAL:t||Gp.getTargetViewContainerName(ws)},Lb=e=>e?.uiResources?.root?.config?.name===Mr.getDefaultQualifiedName("pzCreateDetails")||!1,Ub=(e,t)=>{const n=Lb(e),{skipBrowserSemanticUrlUpdate:r=!1}=t;hC.setIn(e,["directUrlUpdation"],!n&&!r)},Fb=e=>e.confirmationNote?Fr.REVIEW_MODE:Fr.PERFORM_MODE,jb=(e,t)=>{let n;return n=!e.renderInline&&!LE.getDefaultCasePage()&&Lb(t),n},kb=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Fr.MODAL:t||Gp.getTargetViewContainerName(Us)},Vb=(e,t)=>{const{class:n,context:r,viewType:a=um.PAGE}=e,{removeActionPayload:s}=t,o=e?.pageName?e?.pageName:LE.getDefaultCasePage();return Jl(hp.createCase(n,{...e,pageName:o,viewType:a,context:r,retrieveActionViewForNewObject:!0})).pipe(hh((({response:t,headers:n})=>(Lr.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:s}))),Ph("Error occurred during ajax call at createObject Epic : ",r))},Bb="CREATE_EXTERNAL_CASE",Gb=e=>{let t=0,n=[],r=!1;return e.pipe(_h(Bb),Oh(100),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>{const{context:n}=e,a=kb(e),s=js(a,n);return r=!1,Jl(ub(s,{loadingContext:n})).pipe(gh((({continueExecution:n,removeActionPayload:a,dirtyCheckPerformed:s})=>n?(r=s,Vb(e,{removeActionPayload:a})):(Vp.rejectActionByID(t),bh))))})),gh((async e=>{if(e&&e.type===ba)return e.payload.context=SE(),n.push(Am(e)),n;const{actionInPayload:a,response:s,headers:o,removeActionPayload:i}=e,c=jb(a,s);hC.setIn(s.data,Fr.getProperty(Fr.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const l=kb({...a,isInCreateStage:c}),d=js(l,a.context),u=Sm(d,l,a.context);if(!r&&!Uf(l)&&QI(d)){const{continueExecution:e}=await bm(d,{loadingContext:a.context});if(!e)return Vp.rejectActionByID(t),n}const p=ff(s);let h=gS(Os,{caseClassName:Gf(p)});h=h.replace(/{.+?}/,String(Bf(Hf(p)))),p.semanticURL=h,Ub(p,a);const g={acName:d,context:u};await mm(p,a,g);const f={target:d,context:u,headers:o,semanticURL:h,caseViewMode:Fb(p),containerItemID:u,isInCreateStage:c,isMinimizable:c,assignmentContext:hC.getIn(p,lb),nextAssignmentInfo:hC.getIn(p,cb),resourceType:Ur.RESOURCE_TYPES.CASE,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo,isExternalCaseCreationFlow:!0};Qf(f,p);const m=fm(p,f),y=Cm(d,m);return Nm(y)&&zf(n,{removeActionPayload:i,target:d}),n.push(y),Rm(n),n})),hh((()=>(wm(n),Xf(n,t),n=[],n))))},{RESOURCE_TYPES:Wb}=Ur,Hb=(e,t={})=>{const{viewType:n,containerName:r,targetContainerName:a,isChild:s}=e,o=Vf(t);return(e=>{if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1)if(n[e].ID===t)return"manual"===n[e].transitionType}return!1})(o)&&e?.stageID===o.stageID?um.PAGE:n||(!Lf(r)&&!Lf(a)||s?um.PAGE:um.FORM)},qb=(e,t,n,r,a)=>{if(zf(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=VI(t);let r=null;return n&&(r=vI(t,n)),r?.key===e&&JI(t)})(r.key,n))r.context=HI(n),r.containerItemID=r.context,e.push(JC(zC,r));else if((a?.isChild||a?.isRemote)&&a?.isMultiDoc){const t=sE(a.context);r.target=t,r.context=a.context,r.containerItemID=a.context,e.push(JC(zC,r))}else{const t=sE(r.context),n=LI(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(JC(zC,r))):e.push(JC($C,r))}},zb=(e,t,n,r,a,s,o)=>{QI(t)&&XI(t)?((e,t,n,r,a)=>{Hb(e,t)===um.FORM?(n.caseViewMode=r||Fr.PERFORM_MODE,a.push(JC(FC,n))):a.push(JC(zC,n))})(r,a,e,s,n):qb(n,o,t,e,r)},Yb=(e,t,n)=>{if(!(e&&t&&(e=>{const{inlineViewType:t,caseTypeID:n,RedirectURL:r}=e;if(t&&t.toLowerCase().includes("remote"))return!1;const a=Vr.getRemoteCaseClassBySourceClass(n)??n;return!Vr.isRemoteCase(a)&&!!r})(t)&&t.RedirectURL))return!1;try{const e=new URL(t.RedirectURL);if("https:"===e.protocol)return globalThis.open(e.href,"_blank","noopener,noreferrer"),Vp.resolveActionByID(n),!0}catch{}return!1},Kb=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:a,isGetNextWork:s,doNotMergeMessagesForStatusCode:o})=>{const i=ry.appendExcludeQueryParamToUrl(e);return au(i,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...Yd.addDebugHeaders(r)}}},a,{doNotMergeHttpMessagesForStatusCode:s?o:""})},Qb=(e,t)=>{const n=Hb(e),{headers:r,context:a,assignmentID:s,isGetNextWork:o,debugInfo:i,isOpenStage:c,stageID:l,caseID:d,jsActionQueryParams:u,isLastStepInCreateStage:p}=e;let h,g;({restApi:h,reqType:g}=o?mS("getNextWork",{viewType:n}):c?mS("openStage",{caseID:d,stageID:l}):mS(Ka,{assignmentID:s,viewType:n}));const{removeActionPayload:f}=t,m=LE.getDefaultCasePage();let y="",I=e.pageName;e.isTraditionalUICase&&(I=Mr.getDefaultQualifiedName("pyDetails")),y=m?`${h}?viewType=${n}&pageName=${m}`:I?`${h}?viewType=${n}&pageName=${I}`:`${h}?viewType=${n}`,u&&Object.keys(u).forEach((e=>{y+=`&${e}=${u[e]}`}));const E=(e=>{let t=e?.headers??{};return e?.isRemote&&(t=hm(t,e.remoteClassName)),t})(e);return Jl(Kb({restUrl:y,reqType:g,requestHeaders:E,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe(hh((e=>{if(LE.isCoexistenceAppOfType(Fr.APP_TYPE.UIKIT)&&!p){return sy(e.data.data.caseInfo)?e:(y=I?y.replaceAll(I,Mr.getDefaultQualifiedName("pyDetails")):y,LE.setDefaultCasePage(Mr.getDefaultQualifiedName("pyDetails")),{isReloadWithDifferentViewTypeRequired:!0,restUrl:y})}return e})),gh((e=>e?.isReloadWithDifferentViewTypeRequired?Kb({restUrl:y,reqType:g,requestHeaders:E,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):yh(e))),hh((t=>{const{key:a,flowName:o}=Im(s);return Lr.analyseResponse(t),{response:{...t.data,key:a,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:hm({...r,...t.headers})}})),Ph("Error occurred during ajax call at openAssignment Epic : ",a))},{RESOURCE_TYPES:Jb}=Ur,Xb=e=>{const t="Browser"===LE.getRuntime();let n=0,r=[];const a=[];let s=!1,o=!1;return e.pipe(_h(th),hh((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),gh((e=>{s=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?um.FORM:Hb(e),e.viewType=r;const a=wf(Ka,e),i=js(a,t),{activate:c,activateContainerActionPayload:l}=Pm(Jb.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return yh({type:Ua,activateContainerActionPayload:l,actionInPayload:e});const d=VI(i);let u;return u=l?.isParallelAssignment?Promise.resolve({continueExecution:!0,removeActionPayload:{}}):d?bm(i,{loadingContext:t}):Promise.resolve({continueExecution:!0,removeActionPayload:{}}),Jl(u).pipe(gh((({continueExecution:t,removeActionPayload:r})=>t?(o=Zf(e.className),e.isTraditionalUICase=o,LE.isWSSPortal()&&(e.headers={...e.headers,[Fr.X_ORIGIN_CHANNEL]:"WSS"}),Qb(e,{removeActionPayload:r})):(Vp.rejectActionByID(n),bh))))})),gh((async e=>{if(e?.type===ba){if(s){const{payload:t}=e,{err:n}=t,r=n.response.status;a.push({status:Number(r)})}return r.push(Am(e)),r}const{type:t,actionInPayload:i,response:c,viewType:l,headers:d,removeActionPayload:u,activateContainerActionPayload:p}=e;if("openStage"===c?.redirectInfo?.jsAction){const e=c?.redirectInfo?.stageID,t=th,n=c?.data?.caseInfo?.ID;i.isOpenStage=!0,i.stageID=e,i.jsActionQueryParams=c?.redirectInfo?.jsActionQueryParams;const a={type:t,payload:{...i,caseID:n,headers:d}};return r.push(a),r}if(Yb(s,c?.data?.caseInfo,n))return r;const{context:h,caseViewMode:g,debugInfo:f}=i,m=c?.data?.caseInfo?.assignments?.find((e=>e.ID===i.assignmentID));i.caseViewMode=((e,t)=>e&&"false"===String(e.canPerform)?Fr.REVIEW_MODE:t??Fr.PERFORM_MODE)(m,g);const y=c?.data?.caseInfo?.caseTypeID;o=Zf(y),i.isTraditionalUICase=o;let I=((e,t)=>{const n=Vf(e);let r;r=!LE.getDefaultCasePage()&&sy(n);const{isChild:a,containerName:s,isTraditionalUICase:o}=t,i=a&&r,c=r&&!t.isActionFromToDoList;return!i&&!c||o||t.renderInline?s||wf(Ka,t):Fr.MODAL})(c,i);o&&(I=i.containerName??I);const E=js(I,h);if(t===Ua)return await(async(e,t,n)=>{const{semanticURL:r,containerItemID:a,isParallelAssignment:s,insKey:o}=t,{target:i,actionInPayload:c}=n,{skipBrowserSemanticUrlUpdate:l=!1}=c,d=WI(a);await mm({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:d}),e.push(JC(BC,{containerItemID:a,target:i,isParallelAssignment:s,insKey:o,resourceType:Wb.CASE,context:d,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,p,{actionInPayload:i,target:E}),r;const A=c?.data?.caseInfo?.content,C=c?.data?.caseInfo?.ID,S=c?.uiResources?.root?.config?.name,N=c?.uiResources?.root?.config?.context;A&&!A[Mr.getDefaultQualifiedName("pyViewName")]&&S&&"page"!==i.viewType&&(hC.setIn(A,Mr.getDefaultQualifiedName("pyViewName"),S),hC.setIn(A,Mr.getDefaultQualifiedName("pyViewContext"),N));const _=ff(c);((e,t)=>{const n=Vf(e),r=Hf(e),a=sy(n),{skipBrowserSemanticUrlUpdate:s=!1,viewType:o,isTraditionalUICase:i}=t,c=i&&!em(),l=o===um.PAGE&&(!a||c)&&!s,{caseTypeID:d}=n;if(l){const t=gS(Ya,{caseClassName:d}).replace(/{.+?}/,String(Bf(r)));e.semanticURL=t,e.directUrlUpdation=!0}})(_,i);const b=Sm(E,I,h),T={...i.debugInfo,debugId:i.debugInfo?.debugId??Yd.getCoreHeadersFromContext(h)?.debugInfo?.[Fr.COREHEADER_APP_DEBUG_ID]};T.debugId&&jp.setComponentCache(C,Yd.addDebugHeaders(T));const P={acName:E,target:E,context:b};await mm(_,i,P);const O={target:E,context:b,containerItemID:b,headers:d,parentContext:Wr(i?.context),isMinimizable:sy(hC.getIn(_,"data.caseInfo")),doDeleteCaseSummary:i.doDeleteCaseSummary,acTertiary:i.acTertiary,resourceType:Ur.ASSIGNMENT,debugInfo:f,shouldUpdateCaseActionsInParentContext:!0,caseID:C};Qf(O,_,{skipFlowNameUpdate:i?.caseViewMode===Fr.REVIEW_MODE});const D=fm(_,O);var v;return i.isProcessAction&&(D.data.isProcessAction=i.isProcessAction),((e,t)=>{e&&(t.data.caseInfo.content.coexistenceAction="openAssignment")})(o,D),ry.setTraditionalGadgetId(D.data),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(i,D),D.caseViewMode=i.caseViewMode,zb(D,E,r,i,c,g,u),((e,t)=>{if(e=Vr.getRemoteCaseClassBySourceClass(e)??e,Vr.isRemoteCase(e)){const{RemoteClassName:n,RemoteSystemID:r,name:a}=Vr.getRemoteCase(e);if(t.headers?.RemoteSystemID||Vp.setRemoteCaseHeaderByContext(t,r),Vr.isTraditionalRemoteCase(e)||Vr.getRemoteAppPlatformVersion(r)){t.assignmentID=t.assignments?.[0]?.ID;const r={className:e,name:a,action:Ds,remoteClassName:n};Vp.setTraditionalRemoteCaseParams(t,r)}}})(y,D.data.caseInfo),l===um.FORM&&Kf(D.containerItemID)&&(D.skipMergeAssignmentsAndActions=!1,xm(D,r,N)),sm(_,O),v={actionInContext:h,assignmentID:i.assignmentID,caseKey:D.key},$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,v),r})),hh((()=>{const e=n,t=em(),s=sy(hC.getIn(r[0]?.payload,"data.caseInfo"));return o&&t&&s?ib.postCreateCaseMessage(r[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,QA,r):QA(r),Xf(r,e,a),r[0]?.payload?.isParallelAssignment&&QA({type:th,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))};const Zb=(e,t)=>{const{insKey:n,headers:r,context:a,debugInfo:s,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:LE.getDefaultCasePage(),l=mS(Ya,{caseID:n,params:{pageName:c}});let{restApi:d}=l;const{reqType:u}=l;return"none"===o&&(d=`${d?.split("viewType")[0]}viewType=none`),d=ry.appendExcludeQueryParamToUrl(d),Jl(au(d,{method:u,headers:{...r,...s&&{...Yd.addDebugHeaders(s)}}},a)).pipe(hh((t=>(Lr.analyseResponse(t),{response:t.data,actionInPayload:e,headers:hm({...r,...t.headers}),removeActionPayload:i}))),Ph("Error occurred during ajax call at openWorkByHandle Epic : ",a))},eT="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:tT}=Ur,nT=async(e,t,n)=>{const r=t?.containerItemID||null,a=r&&zI(r)[0]?VI(zI(r)[0]):r,s=a||r,o=WI(s)||s,i=sE(o)||sE(s),c=o?om(o):void 0,l=a?JA(a)?.caseInfo?.ID:void 0,d=e?.insKey;if(!(o&&s&&c===Fr.REVIEW_MODE&&a!==r&&l&&d&&l===d))return;let u;try{u=await(p=Zb({...e,context:o,viewType:"none"},{removeActionPayload:void 0}),g="object"==typeof h,new Promise((function(e,t){var n=new bl({next:function(t){e(t),n.unsubscribe()},error:t,complete:function(){g?e(h.defaultValue):t(new zc)}});p.subscribe(n)})))}catch(e){return}var p,h,g;if(!u||jf(u.type))return;const f=ff(u.response),m=[{path:Fr.CASE_INFO.ASSIGNMENTS,allowMultiple:!0}],y={...f?.data,caseInfo:{...f?.data?.caseInfo??{},assignments:f?.data?.caseInfo?.assignments??[]}};n.push(JC(zC,{containerItemID:s,target:i,context:o,data:y,isArrayDeepMerge:!0,propertiesToReplace:m}))},rT=async(e,t,n)=>{const{actionInPayload:r,activateContainerActionPayload:a,type:s,response:o,removeActionPayload:i,headers:c}=e,{context:l,skipBrowserSemanticUrlUpdate:d,debugInfo:u}=r,p=wf(Ya,r),h=js(p,l);if(Ff(s))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:a,actionInPayload:{context:s,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=wf(Ya,a),l=js(c,s),d=WI(r);await mm({directUrlUpdation:!o,semanticURL:n},a,{acName:l,containerName:c,target:l,context:d}),e.push(JC(BC,{containerItemID:r,target:l,context:d,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:a,actionInPayload:r}),await nT(r,a,t);else{const a=Sm(h,p,l,{buildNew:!0}),s=ff(o),g=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:r}=t,a=Hf(e),s=n?r:Gf(e);let o=gS(Ya,{caseClassName:s},{id:t?.insKey});return o=o?.replace("{workID}",String(Bf(a)))?.replace("{id}",t?.insKey),o})(s,r);s.semanticURL=g,s.directUrlUpdation=!d;const f={acName:h,context:a};await mm(s,r,f);const m=fm(s,{target:h,context:a,containerItemID:a,semanticURL:g,headers:c,debugInfo:u});m.caseViewMode=Fr.REVIEW_MODE,m.resourceType=tT.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle",m.data.caseID=m.data.caseInfo.ID),ry.setTraditionalGadgetId(m.data),Qf(m,s,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=om(e?.actionInPayload?.context);const y=Cm(h,m);i.containerItemID&&Nm(y)&&t.push(JC(WC,{containerItemID:i.containerItemID,target:h})),t.push(y),sm(s,m)}const g=r.insKey;Fg({caseKey:g,actionInContext:l})},aT=e=>{let t=0,n=[],r=!1;return e.pipe(_h(eT),hh((e=>(({actionMgrID:t,isAutoRedirection:r=!1}=e.payload),e.payload))),gh((e=>{const{context:n,isChild:a,viewType:s}=e,o=wf(Ya,e),i=js(o,n);return Jl("none"!==s?bm(i,{loadingContext:n}):Promise.resolve({continueExecution:!0,removeActionPayload:void 0})).pipe(gh((({continueExecution:n,removeActionPayload:o})=>{if(!n)return Vp.rejectActionByID(t),bh;let{activate:c,activateContainerActionPayload:l}=Pm(tT.CASE,i,e);const d=QI(i);if(!c&&!d&&e.insKey&&i){const t=((e,t)=>{const n=LI(e,t);if(!n)return null;const r=vI(e,n);if(r?.resourceType!==tT.ASSIGNMENT||"string"!=typeof r?.context||""===r.context)return null;const a="string"==typeof r.semanticURL?r.semanticURL.trim():"";return a?{target:e,containerItemID:n,semanticURL:a,insKey:t}:null})(i,e.insKey);t&&(c=!0,l=t)}return c&&!a&&"none"!==s?(Um(l),yh({type:Ua,activateContainerActionPayload:l,actionInPayload:e})):(r&&jp.setComponentCache("redirectionInProgress",!0),Zb(e,{removeActionPayload:o}))})))})),gh((async e=>{if(e&&jf(e.type))return n.push(Am(e)),n;const t=JA(e?.actionInPayload?.context),r=Zf(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=ff(e?.response),a={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:gs,payload:{context:a.context,doDeleteConfirmationDetails:!1}}),r&&a.data.caseInfo?.content&&(a.data.caseInfo.content.coexistenceAction="openWorkByHandle",a.data.caseID=a.data.caseInfo.ID),ry.setTraditionalGadgetId(a.data),n.push(JC(_C,a));const s=sE(e?.actionInPayload?.context),o=Mf(e?.actionInPayload?.context),i=Object.freeze({target:s,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(Kf(e?.actionInPayload?.context)){const t=fm(e?.response,{...i});xm({...t,isArrayDeepMerge:!0},n)}e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,e.actionInPayload.containerItemID=e?.actionInPayload?.context,e.actionInPayload.caseID=e?.actionInPayload?.insKey,sm(t,e?.actionInPayload)}}else await rT(e,n,r);return n})),hh((()=>(r&&jp.setComponentCache("redirectionInProgress",!1),QA(n),Xf(n,t),n=[],n))))},sT="FINISH_ASSIGNMENT",oT=(e,t)=>{const{assignmentID:n,actionID:r,caseID:a,context:s,additionalHeaders:o={},outcome:i,jsActionQueryParams:c,headers:l}=e,{state$:d}=t,u=(e=>{const{isModalAction:t,viewType:n,isInCreateStage:r,isCaseWideAction:a}=e;return t&&r&&!a?um.PAGE:n||um.FORM})(e),p=(e=>{const{isCaseWideAction:t,caseTypeID:n}=e;return ry.shouldUseUnifiedHandling()?t||ry.isObjectCaseType(n)?rs:Ja:t?rs:Ja})(e),h={assignmentID:n,actionID:r,caseID:a,viewType:u};let{restApi:g}=mS(p,h);const{reqType:f}=mS(p,h);u&&!g?.includes("viewType=")&&(g=g?.includes("?")?`${g}&viewType=${u}`:`${g}?viewType=${u}`),i&&!g?.includes("outcome")&&(g=g?.includes("?")?`${g}&outcome=${i}`:`${g}?outcome=${i}`),g=fy(c,g),g=ry.appendExcludeQueryParamToUrl(g),e.viewType=u;const{content:m}=gm(s),y=d.value.data[s]?.caseInfo?.headers||{},{etag:I}=y,E={"if-match":I,...l,...o};return Jl(au(g,{method:f,body:m,headers:E},s)).pipe(hh((t=>{const{data:n,headers:r}=t;return Lr.analyseResponse(n),{response:n,actionInPayload:e,headers:hm({...E,...r})}})),Ph("Error occurred during ajax call at finishAssignment Epic : ",s))},iT=e=>{$d.publish(Fr.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)},cT=e=>{$d.publish(Fr.PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,e)},{RESOURCE_TYPES:lT}=Ur,dT=e=>{const t=KA()?.getState()?.data,n=t?Object.keys(t).find((e=>e.includes(Fr.WORKAREA))):void 0;return/^app\/primary(_\d+)?$/.test(e)&&!n},uT=(e,t)=>{let n=0,r=[],a={},s="",o={},i=!1,c=!1;return e.pipe(_h(sT),gh((e=>{let l,d;const u=LE.isCoexistenceAppOfType(Fr.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),s=e.payload.context,Nd({context:s,stateObj:JA(s),clearContextMessages:!0}),!Xm(s)||Od(s)){const t={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(n,!0,t),Bg.handleDeferredActionCompletion(e.payload.context).then((()=>{cT({errorType:Ur.ERROR_TYPE.CLIENT})})),yh([])}return yh(e.payload).pipe(gh((e=>{jp.setComponentCache("lastActionID",e?.actionID),Eb(r,e);const n={...e};return oT(n,{state$:t})})),gh((async e=>{if(e&&e.type===ba){my(e);const t=Am(e);return r.push(t),r}Dg.clearContextedCache(s);const{headers:t,actionInPayload:p,response:h}=e,{containerItemID:g,context:f=WI(g),isModalAction:m,isInCreateStage:y}=p;i=p.isCaseWideAction,c=p.isProcessAction;const I=sE(g);p.target=I;const E=Mf(g),A=Object.freeze({target:p.target,containerItemID:g,context:f,containerName:E});hC.setIn(h.data,Fr.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),hC.setIn(h.data,Fr.CASE_INFO_IS_LOCAL_ACTION,!1),h?.uiResources?.root?.config?.name&&"page"!==p.viewType&&hC.setIn(h.data,Fr.CASE_INFO.VIEW_NAME,h?.uiResources?.root?.config?.name),iT({submitResponse:h});let C=ff(h,{[Ur.STOPMERGEACTIONS]:!h.nextAssignmentInfo});const S=Gf(C),N=Wr(p.context),_=zI(N)[0]?VI(zI(N)[0]):N,b=Wf(C),T=y&&!b;!m||y||bb(p.context,_)||(C=vm(C,JA(g)));const P=fm(C,{headers:t,actionMgrID:n,directUrlUpdation:!1,isActiveWorkAreaPrimaryAndWorkareaAbsent:dT(_||"")});Jf(P.data,p),P.caseClassName=S,P.resourceType=lT.ASSIGNMENT,P.headers=t;const O=C?.uiResources?.root;if("AutoClose"===O?.type){const e=KA()?.getState()?.data?.[A.context]?.caseInfo,{ID:t,name:n,content:a}=e;return r=await(async e=>{const{target:t,containerItemID:n,context:r}=e,a=HI("app/primary"),s=vI(t,n)?.parentContext,o=Boolean(t)&&JI(t),i=JI("app/primary");if(o&&s!==Fr.APP.APP){if(await oE(n,{skipDirtyCheck:!0}),0===$I(t).length)return wb(r)}else{if(!a||!i||s)return wb(r);await oE(a,{skipDirtyCheck:!0,eventName:"Dismiss case"})}return[]})(p),D={ID:t,caseName:n,content:a,status:Vf(C).status},$d.publish(Fr.PUB_SUB_EVENTS.DISPLAY_CASE_SUBMITTED_TOASTER,D),r}var D;let v,R;const $=C?.data?.caseInfo?.assignments?.some((e=>e.ID===p.assignmentID)),x=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(C,p),w=((e,t,n,r,a)=>{let s;const o=sE(t);s=JI(o)?LI(o,n.data?.caseInfo?.ID):VI(o);let i=!0;if(e&&s){const e=yC.getPropertyValue(Ur.CASE_INFO.ASSIGNMENTACTION_ID,"",s),t=yC.getPropertyValue(Ur.CASE_INFO.ASSIGNMENT_ID,"",s);if(e){const r=n?.data?.caseInfo?.assignments?.find((e=>e.ID===t)),a=r?.actions;a&&!a.some((t=>t?.ID===e))&&(i=!1)}}return r&&e&&i&&tC(null,Fr.CASE_VIEW_MODE_PROP,s)===Fr.PERFORM_MODE&&a})($,_,C,m,x),M=p?.actionID===Ur.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(C?.data?.nextAssignmentInfo&&!M)P.caseViewMode=Fr.PERFORM_MODE,v=Hf(C),R=!0;else if(w&&!M)C?.confirmationNote&&C?.uiResources?.root?.config?.name===Fr.PY_CONFIRM?P.caseViewMode=Fr.REVIEW_MODE:P.caseViewMode=Fr.PERFORM_MODE,v=Hf(C),P.flowName=" ",P.deleteAssignmentSpecificResources=!1,R=!1;else{P.caseViewMode=Fr.REVIEW_MODE;const e=QI(sE(_)),t=(e=>{if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1)if(n[e].ID===t)return"resolution"===n[e].transitionType}return!1})(C?.data?.caseInfo);v=!C?.confirmationNote||!t&&C?.uiResources?.root?.config?.name!==Fr.PY_CONFIRM||e?"":Hf(C),R=!1}const L=Hf(C);Qf(P,C,{skipFlowNameUpdate:P?.caseViewMode===Fr.REVIEW_MODE||w});const U=gS("createWork",{caseClassName:S}).replace(/{.+?}/,String(Bf(L)));if(C.semanticURL=U,P.semanticURL=U,m?(await Rb(p,P,R,v,C,r,e,h,!1,o),T&&(a=Tb(p))):y&&u&&!b?(LE.setDefaultCasePage(Fr.PY_DETAILS),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:bI.PRIMARY,targetContainerName:bI.PRIMARY,viewType:um.PAGE,isLastStepInCreateStage:!0,context:n},a={type:ya,payload:{...r}};t.push(a)})(h,r,Wr(f))):await vb(P,p,C,A,r),_?.includes(Fr.ACTIONAREA)&&f===_){EI(f);const e=JA(_);r=[{type:Ea,payload:{actionID:e.caseInfo.activeActionID,context:_,containerItemID:g,target:sE(_),actionMgrID:Vp.getNextActionMgrId(),containerName:Fr.ACTIONAREA,localActionType:Ur.LOCAL_ACTION_TYPE.CASE_WIDE,caseID:e.caseInfo.ID}}]}if(rm(e,r),Bg.handleDeferredActionCompletion(s).catch((()=>{})),$b(P,p,_),!C?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:r,actionID:a}=t;return{isCaseWideAction:n,caseID:Hf(e),assignmentID:n?null:r,actionID:a||null}})(C,p);Ug({...e,containerItemID:g})}return Nb(r,{transientItemID:g,target:I,isModalAction:m}),l=C,d=p,r})),hh((()=>{const t=r.find((e=>e.type===ba));var u;if(t?(Bg.handleDeferredActionCompletion(s).then((()=>{cT({errorType:Ur.ERROR_TYPE.SERVER})})).catch((()=>{})),xb(t),Vp.rejectActionByID(n)):Vp.resolveActionByID(n,a),o?.caseId&&(u=o,$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,u)),wm(r),am()&&l&&d&&sm(l,d.__deferCaseActionsPayload??d),!t&&(i||c)){const t=e.payload.caseID;jg(t),(e=>{$d.publish(Fr.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0})}return r=[],a={},o={},r})))})))},pT="CANCEL_ASSIGNMENT",hT=e=>{const t={},{routeKey:n,isModalAction:r,caseID:a,context:s,RemoteSystemID:o}=e;o&&(t.RemoteSystemID=o);const i=n||"releaseAssignmentLock",{restApi:c,reqType:l}=mS(i,{ID:a,caseID:a,viewType:um.PAGE}),d=jp.getComponentCache(a),u=d&&"object"==typeof d?d:{},p=ry.appendExcludeQueryParamToUrl(c);return Jl(au(p,{method:l,headers:{...t,...u}},s,{includeRemoteSystemIdIfPresent:!!o})).pipe(hh((t=>(jp.resetComponentCache(a),r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:hm(t.headers)}))),Ph(": Error occurred during ajax call at release lock request : ",s))},gT=(e,t)=>{const{isModalAction:n}=t;return hT({routeKey:"cancelAssignment",isModalAction:n,...e})},fT=e=>{let t=0,n=[];return e.pipe(_h(pT),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>{const{isModalAction:n}=e;e.context||(e.context=WI(e.containerItemID));const{context:r}=e,a=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?bI.MODAL:Mf(n)})(e),s=js(a,r);return Jl(bm(s,{loadingContext:r})).pipe(gh((({continueExecution:r})=>r?(e.RemoteSystemID=Vr.getRemoteHeaderByContext(e.context)??void 0,Jl(gT(e,{isModalAction:n}))):(Vp.rejectActionByID(t),bh))))})),gh((e=>{if(e&&e.type===ba)return n.push(Am(e)),Jl([n]);const{actionInPayload:r,response:a}=e,{containerItemID:s,isModalAction:o,isInCreateStage:i}=r;a?.data.caseInfo&&(a.data.caseInfo.availableProcesses=a.data.caseInfo.availableProcesses??[]);const c=sE(s),l=WI(s),d={target:o?`${Fr.APP.APP}/${Fr.MODAL}`:c,containerItemID:s,caseViewMode:o?Fr.PERFORM_MODE:Fr.REVIEW_MODE,context:l,actionMgrID:t,key:Hf(a),skipReleaseLockRequest:!1};return i&&n.push(JC(FC,d)),!o&&Kf(s)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:r,referencedUsers:a,response:s}=t,o=Wr(n),i=WI(o);let c=!1;const l=s?.data?.caseInfo;l&&(c=Object.prototype.hasOwnProperty.call(l,"assignments"),l.assignments??=[]);const d={context:i,data:{...s.data,referencedUsers:a,context_data:{caseViewMode:r}}},u=[];c&&u.push({path:Fr.CASE_INFO.ASSIGNMENTS,allowMultiple:!0}),u.length>0?e.push(JC(_C,d,{propertiesToReplace:u})):e.push(JC(_C,d))})(n,{childContainerItemID:s,caseViewMode:Fr.REVIEW_MODE,referencedUsers:a?.data.referencedUsers,response:a}),d.skipReleaseLockRequest=!0,e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,sm(e?.response,e?.actionInPayload),n.push(JC(WC,d)),Jl([n])})),hh((()=>(QA(n),Xf(n,t),n=[],n))))},mT="NAVIGATE_TO_STEP",yT=(e,t)=>{const{ID:n,stepID:r,containerItemID:a,context:s=WI(a),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:o?um.PAGE:um.FORM},{restApi:l,reqType:d}=mS("navigateToStep",c),{content:u}=gm(s),p=i.value.data[s].caseInfo.headers,h=ry.appendExcludeQueryParamToUrl(l);return Jl(au(`${h}`,{method:d,body:u,headers:{"if-match":p&&p.etag}},s)).pipe(hh((t=>({response:t.data,actionInPayload:e,headers:hm({...p,...t.headers})}))),Ph("Error occurred during ajax call at navigateToStep Epic : ",s))},{RESOURCE_TYPES:IT}=Ur,ET=(e,t)=>{let n=0,r=[];return e.pipe(_h(mT),ph((e=>{let a,s;return({actionMgrID:n}=e.payload),yh(e.payload).pipe(gh((e=>(Pd(e.context),yT(e,{state$:t})))),gh((async e=>{if(e&&jf(e.type))return r.push(Am(e)),r;const{actionInPayload:t,response:n,headers:o}=e,{containerItemID:i,context:c=WI(i),isModalAction:l}=t;Dg.clearContextedCache(t.context);const d=sE(i),u=Mf(i),p=Object.freeze({target:d,containerItemID:i,context:c,containerName:u}),h=n?.data?.caseInfo?.content,g=n?.uiResources?.root?.config?.name,f=n?.uiResources?.root?.config?.context;h&&!h[Mr.getDefaultQualifiedName("pyViewName")]&&g&&"page"!==t.viewType&&(hC.setIn(h,Mr.getDefaultQualifiedName("pyViewName"),g),hC.setIn(h,Mr.getDefaultQualifiedName("pyViewContext"),f)),a=ff(n);const m={acName:d,...p};await mm(a,t,m),s=fm(a,{...p,headers:o}),n?.nextAssignmentInfo||(s.caseViewMode=Fr.REVIEW_MODE),rm(e,r),s.doDeleteCaseSummary=t.doDeleteCaseSummary,s.resourceType=IT.ASSIGNMENT,s.caseID=Hf(a),Qf(s,a),Jf(s.data,t);const y=a.data?.caseInfo?.stages,I=a.data?.caseInfo?.stageID;if(Lg({caseID:Hf(a),isModalAction:l,stages:y,stageID:I}),Kf(i)){const e=ry.getPropertiesToReplace(i);xm(s,r,"",{propertiesToReplace:e})}return r.push(JC(FC,s)),s.shouldUpdateCaseActionsInParentContext=!0,r})),hh((()=>(QA(r),a&&s&&sm(a,s),Xf(r,n),r=[],r))))})))},AT=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:a}=mS(Za,{ID:t});return Jl(au(r,{method:a},n)).pipe(hh((t=>(Lr.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:hm(t.headers)}))),Ph(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},CT=e=>{$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},ST=(e,t)=>{let n,r=0,a=[];return e.pipe(_h(nh),hh((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),gh((e=>e.ignoreCaseDeletion?yh({actionInPayload:e}):AT(e))),gh((async e=>{if(e&&jf(e.type)){const{payload:t}=e,n=Am({...e,...t,actionMgrID:r});return a.push(n),a}const{actionInPayload:n}=e,{context:s,isModalAction:o}=n,i=o?bI.MODAL:bI.PRIMARY,c=js(i,s);if(!o&&c){const e={acName:c,target:c,context:s},r=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:r}=e;if(r)return e}return{semanticURL:""}})(r);await mm({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:Fr.PRIMARY,isChild:!0},t={type:pa,payload:{...e}};a.push(t)}const l={target:c,containerItemID:s,context:s,caseDeleted:!0};return a.push(JC(WC,l)),a})),hh((()=>(QA(a),Xf(a,r)===Fr.PROMISE_VALUE.RESOLVE&&CT({caseType:n}),a=[],a))))};function NT(e,t){return sl(t)?gh(e,t,1):gh(e,1)}const _T=(e,t)=>{const{assignmentID:n,actionID:r,context:a}=e,{restApi:s,reqType:o}=mS("save",{assignmentID:n,actionID:r}),{content:i}=gm(a),c=t.value.data[a]?.caseInfo?.headers,l=ry.appendExcludeQueryParamToUrl(s);return Jl(au(l,{method:o,body:i,headers:{"if-match":c&&c.etag}},a)).pipe(hh((t=>({response:t.data,actionInPayload:e,headers:hm(t.headers)}))),Ph(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",a))},bT=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:a}=e,s=!0===n.payload.autosave;let o=[];return yh(n.payload).pipe(gh((e=>_T(e,r))),NT((e=>{if(e&&jf(e.type))return yh(e);const{containerItemID:t}=e&&e.actionInPayload,r=Wr(t),a=sE(r),i=OI(a),c=zI(r)[0];let l=c?VI(c):r;!QI(sE(l))&&({containerItemID:l}=DI(l,e.actionInPayload.caseID,c));const d=VI(a);n.payload.canUpdateAvailableActions&&gf(e.response);const u=Vr.getRemoteHeaderByContext(e.actionInPayload.context),p={...e.actionInPayload,RemoteSystemID:null===u?void 0:u};if(l&&o.push(JC(_C,{context:l,data:{caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}})),i?.items?.[d]?.key===e?.actionInPayload?.caseID){const n={context:r,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},a=ry.getPropertiesToReplace(t);o.push(JC(_C,n,{propertiesToReplace:a}))}return s||o.push(JC(FC,{context:t})),rm(e,o),hT(p)})),gh((async n=>{if(n&&jf(n.type)){const{payload:t}=n,r=Am({...n,...t,actionMgrID:a});o.push(r);const s=e.action.payload.modalLoadingContainer;if(s){const e=s.context,{context_data:t}=JA(e)||{};t?.isLoading&&oE(e)}return o}const{actionInPayload:r,response:i}=n,{context:c,containerName:l}=r,d={target:js(l,c),containerItemID:c,context:c};return r.shouldUpdateCaseActionsInParentContext=!0,sm(i,r),t||s||o.push(JC(WC,d)),o})),hh((()=>{var e;return QA(o),Xf(o,a),s||(e={context:n.payload.context,assignmentID:n.payload.assignmentID},$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.SAVE_ASSIGNMENT_COMPLETE,e)),t||(o=[]),Bg.isDeferredActionInProgress(n.payload.context)&&Bg.handleDeferredActionCompletion(n.payload.context),o})))},TT=(e,t)=>{let n,r=0;return e.pipe(_h(rh),ph((e=>{const{saveOnly:a}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return bT({action:e,state$:t,actionMgrID:r,caseType:n},a)})))},PT=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",$d.unsubscribe(Fr.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,r="expressLocalActionSubmit",$d.subscribe(Fr.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,r)}var n,r},{LOCAL_ACTION_TYPE:OT}=Fr,{RESOURCE_TYPES:DT}=Ur,vT=(e,t)=>{const{actionID:n,assignmentID:r,caseID:a,context:s,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,d=l?ts:(e=>{const t=e.localActionType?.toLowerCase();return t===OT.CASE_WIDE||t===OT.EXPRESS||t&&e.isPromotedAction?ns:es})(e),u=um.FORM,{reqType:p}=mS(d,{caseID:a,ID:r,actionID:n,viewType:u});let{restApi:h}=mS(d,{caseID:a,ID:r,actionID:n,viewType:u});e.actionType=d===ns?Fr.CASE:Fr.ASSIGNMENT,h&&!h.includes("viewType=")&&(h=h.includes("?")?`${h}&viewType=${u}`:`${h}?viewType=${u}`),h=ry.appendExcludeQueryParamToUrl(h);const g=i?.context??s;return Jl(au(h,{method:p,headers:c},g)).pipe(hh((t=>({response:t.data,actionInPayload:e,headers:hm(t.headers,"",e.headers)}))),Ph(`: Error occurred during ajax call at ${o} Epic : `,g))},RT=(e,t)=>{const{isProcessAction:n}=t,r=n?ts:es;e.openActionType=r;let a;if("modal"===wf(r,e)){if(!xd.isOnline()||e.isAppOffline)return Vp.rejectActionByID(e.actionMgrID),Promise.resolve();a=zI(e.contextName)[0]?zI(e.contextName)[0]:sE(e.contextName);const n=a?VI(a):e.contextName,r=WI(n),s=wf(e.openActionType,e),o=js(s,e.context),i=Kr(e.context,Hr(s,e.context));if(QA($C({target:o,context:i,containerItemID:i,key:e.caseID,caseViewMode:Fr.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:Fr.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}},headers:{...e.headers}})),QA(jC({context:i})),e.modalLoadingContainer={target:o,context:i},!zI(e.contextName)[0])return vT(e,t);if(!e.continueExecution)return vT(e,t);if(!yI(r))return vT(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return Jl([ah(e.saveActionPayload)]).pipe(gh((e=>(e=>{let t,n=0;const r=[],a={value:KA()?.getState()};return yh(e).pipe(_h(rh),ph((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!s){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(n,!0,e),yh([])}return bT({action:e,state$:a,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),gh((n=>1===n.length&&jf(n[0].type)?Jl(bm(a,{loadingContext:e.context})).pipe(gh((({continueExecution:n})=>n?vT(e,t):(Vp.rejectActionByID(e.actionMgrID),bh)))):vT(e,t))),hh((e=>e)))}return vT(e,t)},$T=async(e,t,{headers:n,actionInPayload:r})=>{const{context:a,actionName:s,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c,skipMergeAssignmentsAndActions:l}=r,d=ff(e),u=wf(o,r),p=c?.target??js(u,a);let h,g,f=!1;!XI(p)||JI(p)&&!wI(p,e.data.caseInfo.ID)?(g=Hr(u,a),Uf(u)&&(g=Kr(a,g)),h=g,f=!0):(h=JI(p)?LI(p,e.data.caseInfo.ID):VI(p),g=WI(h));const m={acName:p,target:p,containerName:u,context:g};await mm(d,r,m),(void 0===d?.data?.caseInfo?.content||void 0!==d.data.caseInfo.content&&"object"==typeof d.data.caseInfo.content&&0===Object.keys(d.data.caseInfo.content).length)&&delete d.data?.caseMessages;const y=d.uiResources?.root;let I;I=y?Fr.PERFORM_MODE:Fr.REVIEW_MODE;const E=fm(d,{target:p,context:g,containerItemID:h,caseViewMode:I,doDeleteCaseSummary:i,headers:n,actionName:s,isMinimizable:!1,isInCreateStage:Uf(u),resourceType:DT.ASSIGNMENT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,assignmentID:r.assignmentID,actionType:r.actionType,skipMergeAssignmentsAndActions:l});let A;if(y&&Qf(E,d),Uf(u)&&delete E.doDeleteCaseSummary,r.openActionType===as&&(E.isBulkAction=!0,E.data.caseInfo.actionButtons.main[0].jsAction="async"===r.runningMode?"submitBulkActionAsync":"submitBulkAction",E.data.caseInfo.actionButtons.secondary[0].jsAction="cancelBulkAction",E.data.caseInfo.cases=r.selectedList,E.data.caseInfo.isAssignment=r.isAssignment),A=f?$C:r.isProcessAction||(e=>e.containerItemID?.includes(Fr.ACTIONAREA)&&e.context?.includes(Fr.ACTIONAREA))(r)?zC:FC,E.data.context_data.isProcessAction=r.isProcessAction,t.push(JC(A,E)),f||t.push(JC(kC,E)),f){const a=zI(r.contextName),s=LI(a,e.data.caseInfo.ID);if(s){const e={data:{caseInfo:{headers:n}},context:s};t.push(JC(_C,e))}}h!==VI(p)&&t.push(JC(BC,{target:p,containerItemID:h})),Kf(h)&&!c?.context&&xm(E,t),r.isProcessAction&&!Zf(E.nextAssignmentInfo?.className)&&rm({response:d,actionInPayload:{...r,containerItemID:h}},t),E.caseViewMode===Fr.REVIEW_MODE&&t.push(JC(WC,E)),E.shouldUpdateCaseActionsInParentContext=!0;return hC.getIn(e.data,["caseInfo","isLocalAction"])||sm(d,E),t},xT="OPEN_LOCAL_ACTION",wT=(e,t)=>RT(e,t),MT=e=>{let t=0,n=[];return e.pipe(_h(xT),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),Sh((()=>!im(t))),gh((e=>wT(e,{actionMgrID:t}))),gh((async e=>{if(!e)return bh;if(jf(e.type)){const t=Am(e);n.push(t);const{context_data:r}=JA(e.payload.context)||{};return r?.isLoading&&n.push(JC(kC,e.payload)),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:s}=t;hC.setIn(a,"data.caseInfo.activeActionID",s);return(e=>{$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,e)})(hC.getIn(a,"data.caseInfo.ID")),hC.setIn(a.data,Fr.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&hC.setIn(a.data,Fr.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await $T(a,n,{headers:r,actionInPayload:t}),PT(t),n})),hh((()=>(QA(n),Xf(n,t),n=[],n))))},LT=e=>{const{actionID:t,context:n,openActionType:r,caseTypeID:a,bulkContextID:s="",bulkContextType:o=""}=e,i=as,{reqType:c,restApi:l}=mS(i,{caseTypeID:a,actionID:t,bulkContextID:s,bulkContextType:o});return Jl(au(l,{method:c},n)).pipe(hh((t=>({response:t.data,actionInPayload:e,headers:hm(t.headers)}))),Ph(`: Error occurred during ajax call at ${r} Epic : `,n))},UT=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",$d.unsubscribe(Fr.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,r="bulkActionSubmit",$d.subscribe(Fr.PUB_SUB_EVENTS.EVENT_BULKACTION,n,r)}var n,r},FT="OPEN_BULK_ACTION",jT=e=>{let t=0,n=[];return e.pipe(_h(FT),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=as;const a=wf(as,e),s=js(a,n);return Jl(bm(s,{loadingContext:n})).pipe(gh((({continueExecution:t})=>t?LT(e):(Vp.rejectActionByID(r),bh))))})(e,{actionMgrID:t}))),gh((async e=>{if(e&&jf(e.type??"")){const t=Am(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:s}=t;return hC.setIn(a,"data.caseInfo.activeActionID",s),await $T(a,n,{headers:r,actionInPayload:t}),UT(t),n})),hh((()=>(1===n.length&&jf(n[0].type)?Vp.rejectActionByID(t):Vp.resolveActionByID(t),QA(n),n=[],n))))};var kT=Array.isArray,VT=Object.getPrototypeOf,BT=Object.prototype,GT=Object.keys;function WT(e){if(1===e.length){var t=e[0];if(kT(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&VT(r)===BT){var n=GT(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var HT=Array.isArray;function qT(e){return hh((function(t){return function(e,t){return HT(t)?e.apply(void 0,el([],Zc(t))):e(t)}(e,t)}))}function zT(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return sl(mh(e))?e.pop():void 0}(e),r=WT(e),a=r.args,s=r.keys,o=new $l((function(e){var t=a.length;if(t)for(var n=new Array(t),r=t,o=t,i=function(t){var i=!1;Vl(a[t]).subscribe(Hl(e,(function(e){i||(i=!0,o--),n[t]=e}),(function(){return r--}),void 0,(function(){r&&i||(o||e.next(s?function(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}(s,n):n),e.complete())})))},c=0;c<t;c++)i(c);else e.complete()}));return n?o.pipe(qT(n)):o}const YT=e=>{const{actionID:t,context:n,cases:r,classID:a,isAssignment:s}=e,{content:o}=gm(n,{nonEmptyAndChangedData:!0});let i=5;try{const e=ef.getSharedState(Mr.getQualifiedNameForComplexRuleReferences("D_pySingleExecutionBulkActionsMeta.D_pySingleExecutionBulkActionsMeta.pxResults"));e?.find((e=>e[Mr.getDefaultQualifiedName("pyClassName")]===a))?.pyList.split(",").includes(t)&&(i=1)}catch(e){console.error('Failed to fetch to "D_pySingleExecutionBulkActionsMeta" DP response',e)}const c=r.map((e=>({ID:e}))),l=c.length/i,d=s?"performAssignmentBulkAction":ss,{reqType:u,restApi:p}=mS(d,{actionID:t}),h=[],g=c.length;for(let t=0;t<g;t+=l){const r=c.slice(t,t+l);s?o.assignments=r:o.cases=r,r.length&&h.push(Jl(au(p,{method:u,body:o},n)).pipe(hh((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:hm({...r})}})),Ph("Error occurred during ajax call at submitbulkaction Epic : ",n)))}return zT(h)},KT=e=>{$d.publish(Fr.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},QT="SUBMIT_BULK_ACTION",JT=e=>{let t,n=0,r=[],a="";return e.pipe(_h(QT),ph((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(n,!0,e),yh([])}return yh(e.payload).pipe(gh((e=>(t=e,YT(t)))),gh((e=>{let n=0,s=0;const o=[],{containerItemID:i,context:c}=t;return e.forEach((e=>{const{response:t}=e;n+=Number(t.successCount),s+=Number(t.failureCount),s&&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`,KT({submitResponse:e}),t.target="HYBRID"===LE.getRenderingMode()?sE(i):`${Fr.APP.APP}/${bI.MODAL}`,r.push(JC(WC,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),s&&r.push(JC(GC,{messages:[{type:"error",message:1===s?"1 record failed to update":`${s} records failed to update`,errorDetails:o,showHeader:!1}],context:Wr(c)||c,category:"HTTP",showHeader:!1})),r})),hh((()=>(Vp.resolveActionByID(n,a),QA(r),r=[],r))))})))},XT=e=>{const{actionID:t,context:n,cases:r}=e,{content:a}=gm(n,{nonEmptyAndChangedData:!0});a.cases=r.map((e=>({ID:e})));const s=ss,{reqType:o,restApi:i}=mS(s,{actionID:t,runningMode:"async"});return Jl(au(i,{method:o,body:a},n)).pipe(hh((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:hm({...r})}})),Ph("Error occurred during ajax call at submitbulkactionasync Epic : ",n))},ZT=e=>{$d.publish(Fr.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},eP="SUBMIT_BULK_ACTION_ASYNC",tP=e=>{let t,n=0,r=[],a={};return e.pipe(_h(eP),ph((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(n,!0,e),yh([])}return yh(e.payload).pipe(ph((e=>(t=e,XT(t)))),hh((e=>{const{containerItemID:n,context:s}=t,{response:o}=e;return a={caseID:o.caseID,caseTypeID:"BackgroundJob"},ZT({submitResponse:o}),t.target=`${Fr.APP.APP}/${bI.MODAL}`,r.push(JC(WC,{containerItemID:n,context:s,target:t.target,skipReleaseLockRequest:!0})),r})),hh((()=>(Vp.resolveActionByID(n,a),QA(r),r=[],r))))})))},nP=(e,t)=>RT(e,t),rP=e=>{let t=0,n=[];return e.pipe(_h(eh),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>{const n=wf(ts,e),r=js(n,e.context);return Jl(bm(r,{loadingContext:e.context})).pipe(gh((({continueExecution:n})=>n?(Pd(e.context),nP(e,{actionMgrID:t,isProcessAction:!0})):(Vp.rejectActionByID(e.actionMgrID),bh))))})),gh((async e=>{if(e&&jf(e.type)){const t=Am(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:a}=e;return await $T(a,n,{headers:r,actionInPayload:t}),n})),hh((()=>(wm(n),Xf(n,t),n=[],n))))},aP=e=>{let t=0,n=[];return e.pipe(_h(Da,ka),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>{const{containerItemID:t,caseID:n,context:r,caseDeleted:a,skipReleaseLockRequest:s,currentCaseViewMode:o,isProcessAction:i,isInCreateStage:c,deleteWork:l}=e,d=o===Fr.PERFORM_MODE,u=n&&d;return l?yh([]):i&&c?hT(e):t!==r||a||s||!u?t?.includes(Fr.MODAL)&&om(OE(t))===Fr.REVIEW_MODE?hT(e):yh([]):hT(e)})),gh((e=>(e&&jf(e.type)&&n.push(Am(e)),n))),hh((()=>(QA(n),Xf(n,t),n=[],n))))};var sP=function(e){function t(t,n){return e.call(this)||this}return Kc(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(ll),oP={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=oP.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,el([e,t],Zc(n))):setInterval.apply(void 0,el([e,t],Zc(n)))},clearInterval:function(e){var t=oP.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},iP=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return Kc(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,a=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(a,r,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),oP.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&&oP.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,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,cl(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(sP),cP={now:function(){return(cP.delegate||Date).now()},delegate:void 0},lP=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=cP.now,e}(),dP=new(function(e){function t(t,n){void 0===n&&(n=lP.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return Kc(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}(lP))(iP),uP=dP;function pP(e,t,n){void 0===e&&(e=0),void 0===n&&(n=uP);var r=-1;return null!=t&&(fh(t)?n=t:r=t),new $l((function(t){var a,s=(a=e)instanceof Date&&!isNaN(a)?+e-n.now():e;s<0&&(s=0);var o=0;return n.schedule((function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())}),s)}))}function hP(e,t){return void 0===e&&(e=0),void 0===t&&(t=dP),e<0&&(e=0),pP(e,e,t)}function gP(e){return Wl((function(t,n){var r=!1,a=null,s=null,o=function(){if(null==s||s.unsubscribe(),s=null,r){r=!1;var e=a;a=null,n.next(e)}};t.subscribe(Hl(n,(function(t){null==s||s.unsubscribe(),r=!0,a=t,s=Hl(n,o,ml),Vl(e(t)).subscribe(s)}),(function(){o(),n.complete()}),void 0,(function(){a=s=null})))}))}const fP=(e,t,n,r,a)=>{if(a!==Fr.RESOURCE_STATUS.CREATE)return;km.isStateMachineExist(e,t,n)||km.setStateMachine(e,n,t,new Nu(n,t,e));km.getStateMachine(e,t,n).insert({},"string"==typeof r?r:r+1,!0,{isDefault:!0})},mP=(e,t,n,r,a)=>{"string"==typeof t&&e.data?.caseInfo?.content&&n&&("CREATE"===r||"UPDATE"===r)&&(e.data.caseInfo.content[a][t][n]=t)},yP=e=>{const t=!e.isLocalAction&&e.editType===Fr.ACTION;return{...t?{}:{activeActionID:e.actionID},assignments:[{ID:e.assignmentID,...t?{actions:[{ID:e.actionID}]}:{}}]}},IP=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),EP=e=>{const t={};return Object.keys(e).forEach((n=>{const r=e[n];if(n===Fr.CLASSID)t[n]=r;else if(Array.isArray(r)){const e=r.filter(IP).map(EP);e.length>0&&(t[n]=e)}else if(IP(r)){const e=EP(r);Object.keys(e).length>0&&(t[n]=e)}})),t},AP=e=>{let t=0,n=[],r="";return e.pipe(_h(Ns),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>J_(e))),gh((async e=>{if(e&&e.type===ba)return n.push(Am(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:a,headers:s}=e,o=t.containerName,i=js(o,t.context);let c=Sm(i,o,t.context);c=Kr(t.context,c);const{pageReference:l,targetProperty:d,index:u,subscriptFieldName:p,pageGroupName:h,actionType:g,isPageGroup:f}=t,m=l?.startsWith(Ur.OBJECT_INFO.OBJECT_INFO);let y=null;m?(y=Lr.transformCaseData(a),y.uiResources.root.config.context=`${l}${d}[${u}]`):y=a;const I=ff(y);I.key=t.ID,I.data?.caseInfo?(I.data.caseInfo.ID=t.ID,mP(I,u,p,g,h)):I.data?.objectInfo&&(I.data.objectInfo.ID=t.ID);const{interestPageActionID:E,editType:A,isLocalAction:C,actionID:S}=t,N={isMultiRecordData:!0,viewName:t.viewID,parentContext:t.context,interestPage:t.interestPage,interestPageActionID:E,editType:A,isLocalAction:C,actionID:S};I.uiResources.context_data.modalView=N;const _=JA(t.context)?.context_data?.caseInfo,b=`${t.pageReference}${t.targetProperty}`,T=Ed(_,b,t.index);I.uiResources.context_data.caseInfo={...I.uiResources.context_data.caseInfo,content:hC.mergeDeep(I.uiResources.context_data.caseInfo?.content,T?.content)};const P=yC.getProperty(Fr.CASE_INFO.REMOTESYSTEMID,"",t.context),O={acName:i,context:c};await mm(I,t,O);const D={target:i,context:c,containerItemID:c,headers:s,index:u,subscriptFieldName:p,pageGroupName:h,isPageGroup:f};P&&(D.headers={...D.headers,RemoteSystemID:P});const v=hC.deepClone(I.data?.caseInfo?.content);if(I.data?.caseInfo&&A===Fr.ACTION){Wn(I.data,`${l}${d}`,new Array(u+1).fill({}));const e=hC.deepClone(eC(`${d}[${u}]`,l,t.context)??{});((e,t,n,r,a)=>{const s=t===Ur.CASE_INFO.CASE_INFO_CONTENT?`${n.replace(".","")}[${r}]`:`${(t.split(Ur.CASE_INFO.CASE_INFO_CONTENT)[1]??"").replace(".","")}${n}[${r}]`,o=hC.getIn(a,s);IP(o)&&hC.mergeDeep(EP(o),e)})(e,l,d,u,v),Wn(I.data,`${l}${d}[${u}]`,e)}const R=fm(I,D);I.data?.caseInfo&&(I.data.caseInfo.content=v);const $=fm(I,D);R.resourceStatus=t.actionType,R.isMultiRecordData=!0,R.readOnly=t.readOnly,R.parentContext=t.context,R.heading=t.heading,R.data.caseInfo&&A===Fr.ACTION&&(R.data.caseInfo={...R.data.caseInfo,...yP(t),isLocalAction:t.isLocalAction}),R.clearStateMachine=!1,$.skipValidation=!0,$.isArrayDeepMerge=!0;const x=Cm(i,R);r=c,n.push(x);const w=JC(_C,$);return{actionsOut:n,actionInPayload:t,mergeAction:w}})),hh((({actionInPayload:e,mergeAction:a})=>{if(kf(n)?Vp.rejectActionByID(t):Vp.resolveActionByID(t),e.skipPageInstructions||fP(r,e.pageReference,e.targetProperty,e.index,e.actionType),QA(n),n=[],e.editType===Fr.ACTION){km.registerForServerChanges(),QA(a),km.unRegisterForServerChanges();const t=Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT)+hC.convertClipboardPageToPageRefNotation(e.interestPage);e.columns.forEach((n=>{const a=_o.trimAnnotation(n.config.value),s=eC(a,t,r),o=fA(a.startsWith(".")?a.split(".").pop():a,n.config.classID);md.addFieldNode(r,t,e.viewID,a,s,{isDeclarativeTarget:!!o?.isDeclarativeTarget,context:r,propertyName:a,pageReference:t,value:n.config.value,isInsideList:/\[\d+\]/.test(t)||/\[\d+\]/.test(a)})}))}return n})))},CP=e=>{const{context:t}=e;let n={...gm(t).content,contextData:!1};const r=Lm(t);hC.isEmpty(r)||(n=Mm(r,n));const a=((e,t=!1)=>e===Fr.ACTION?t?wg.REFRESH_CASE_DATA:wg.REFRESH_ASSIGNMENT_DATA:wg.REFRESH_CASE_VIEW)(e.editType,e.isLocalAction),{restApi:s,reqType:o}=mS(a,{ID:e.isLocalAction||e.editType!==Fr.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=s;return e.editType===Fr.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID),n.interestPage=e.interestPage,Jl(au(i,{method:o,body:n,headers:e.headers},t)).pipe(hh((t=>({actionInPayload:e,response:t.data,headers:hm(t.headers)}))),Ph(": Error occurred during getEmbeddedDataView request : ",t))},SP=(e,t,n)=>"string"==typeof n?`${e}${t}.${n}`:`${e}${t}[${n}]`,NP=(e,t,n,r,a)=>{const s=e.data?.caseInfo?.content;if(s){const e=((e,t,n)=>{const r=(e,t)=>{if((e=>"object"==typeof e&&null!==e)(e))return e[t]},a=t.replace(/^\./,"").split(".");let s=e;for(const e of a)s=r(s,e);return"string"==typeof n?r(s,n)??null:Array.isArray(s)?s[n]??null:null})(s,r,a);e&&QA(aS({context:t,reference:n,value:e}))}const o=e.uiResources?.context_data;o&&QA(aS({context:t,reference:Fr.CONTEXT_DATA,value:o}))},_P=e=>{let t=0,n=[];return e.pipe(_h(_s),hh((e=>{const{payload:n}=e;return({actionMgrID:t}=n),n})),gh((e=>CP(e))),NT((async e=>{const t={rootView:null,data:null,uiResources:null,containerContext:null};if(e?.type===ba)return n.push(Am(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0},responseData:t};const{actionInPayload:r,response:a,headers:s}=e,{pageReference:o,targetProperty:i,index:c,containerName:l}=r,d=o?.startsWith(Ur.OBJECT_INFO.OBJECT_INFO),{context:u,containerContext:p,target:h}=(e=>{const{containerName:t,context:n}=e;if(!t)return{context:n,containerContext:null,target:null};const r=js(t,n),a=Sm(r,t,n)||t,s=Kr(n,a);return{context:s,containerContext:s,target:r}})(r),g=((e,t,n,r,a)=>{if(a){const a=Lr.transformCaseData(e);return a.uiResources.root.config.context=SP(t,n,r),a}return e})(a,o,i,c,d),f=ff(g);f.key=r.ID;const m=SP(o,i,c),y=l?{acName:h,context:u}:{context:u};if(await mm(f,r,y),l&&h){const e=fm(f,{target:h,context:u,containerItemID:u,headers:s,index:c});e.resourceStatus=r.actionType,e.isMultiRecordData=!0,e.readOnly=r.readOnly,e.parentContext=r.context,e.clearStateMachine=!1;const t=Cm(h,e);n.push(t)}else NP(f,u,m,i,c);const I=f.uiResources?.root||null;return I?.config&&(I.config.context=m),t.rootView=I,t.data=f.data,t.uiResources=f.uiResources,t.containerContext=p,{actionsOut:n,actionInPayload:r,responseData:t}})),hh((({actionsOut:e,responseData:r})=>{kf(e)?Vp.rejectActionByID(t):Vp.resolveActionByID(t,r);return n=[],e})))},bP=e=>{let t,n="",r=[];return e.pipe(_h(bs),ph((e=>{t=e.payload;const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const t={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(n,!0,t),Bg.handleDeferredActionCompletion(e.payload.context),yh([])}return yh(e.payload).pipe(gh((e=>(t=e,J_(t)))),gh((async e=>((e,t)=>{if(e&&"action"===t.editType&&e.type!==ba){const{context:n,pageReference:r}=t,a={context:n},{response:s}=e,o=r?.startsWith(Ur.OBJECT_INFO.OBJECT_INFO);let i=null;o?(i=Lr.transformCaseData(s),i.uiResources.root.config.context=r):i=s;const c=ff(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=fm(c,a);l.skipValidation=!0;const d=JC(_C,l);km.registerForServerChangesSync(),QA(d),km.unRegisterForServerChanges()}return e})(e,t))),gh((async e=>{if(e&&e.type===ba){const t=Am(e);return r.push(t),r}const{containerItemID:n,context:a,pageReference:s,interestPage:o}=t,i=o?.replace(/\(\d+\)$/,"");return((e,t,n,r,a)=>{Ru(e).forEach((e=>{const s=a&&"replace"===e.instruction.toLowerCase()?hC.convertClipboardPageToPageRefNotation(a):hC.convertClipboardPageToPageRefNotation(e.target);km.isStateMachineExist(t,n,s)||km.setStateMachine(t,s,n,new Nu(s,n,t));const o=km.getStateMachine(t,n,s);switch(e.instruction.toLowerCase()){case"insert":o.insert(e.content,e.listIndex,r,{encryptedContent:e.encryptedContent});break;case"update":o.update(e.content,e.listIndex??e.groupIndex,r,{encryptedContent:e.encryptedContent});break;case"delete":e.listIndex?o.delete(e.listIndex,r):e.groupIndex?o.delete(e.groupIndex,r):o.deletePage();break;case"replace":o.replacePage(e.content,r,a?e.target:void 0,a?n:void 0,e.encryptedContent);break;case"move":o.move(e.listIndex,e.listMoveToIndex);break;case"add":o.insert(e.content,e.groupIndex,r,{encryptedContent:e.encryptedContent});break;case"delete all":o.deleteAll()}}))})(a,t.parentContext,s.startsWith(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT)?Fr.getProperty(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT):Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),!1,i),r.push(JC(WC,{containerItemID:n,context:a,target:t.target,skipReleaseLockRequest:!0})),r})),hh((()=>{if(kf(r))Vp.rejectActionByID(n),Bg.handleDeferredActionCompletion(t.context);else{Vp.resolveActionByID(n),Bg.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload,a=yC.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext);a?((e,t)=>{const{pageReference:n,isMultiRecordData:r}=t,a=yC.getPropertyValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID),n,e.parentContext),s=yC.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,e.parentContext),o=yC.getPropertyValue(Ur.CASE_INFO.ASSIGNMENT_ID,n,e.parentContext),i=yC.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,e.parentContext),{interestPage:c,interestPageActionID:l,actionID:d,isLocalAction:u}=i,p=e.pageReference.substring(0,e.pageReference?.lastIndexOf(".")).replace(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),"");"action"===i.editType?Cy(a,o,d,e.parentContext,c,l,u,r,i.editType):Ay(a,s,e.parentContext,p,{})})(t,{isMultiRecordData:a,pageReference:r}):Oy(t.parentContext,Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),{})}return QA(r),r=[],r})))})))},TP=e=>{const{caseID:t,headers:n,debugInfo:r,context:a}=e,s=mS("getDescendants",{caseID:t}),{restApi:o}=s,{reqType:i}=s;return Jl(au(o,{method:i,headers:{...n,...r&&{...Yd.addDebugHeaders(r)}}},a)).pipe(hh((t=>({actionInPayload:e,response:t.data,headers:hm({...n,...t.headers})}))),Ph("Error ocurred during ajax call at getDescendants Epic : ",a))},PP=e=>{let t=0,n=[];return e.pipe(_h(xg),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>TP(e))),gh((async e=>{if(e&&jf(e.type))return n.push(Am(e)),n;const{actionInPayload:t,response:r}=e,a={};hC.setIn(a,"caseInfo.childCases",r?.childCases??[]);const s={data:a,context:t?.context};return n.push(JC(_C,s)),n})),hh((()=>(QA(n),Xf(n,t),n=[],n))))},OP=e=>{let t,n="",r=[],a={};return e.pipe(_h(Ts),ph((e=>{t=e.payload;const{isFormValid:s}=e.payload;return({actionMgrID:n}=e.payload),s?yh(e.payload).pipe(gh((e=>(t=e,yh({})))),gh((async()=>{const{containerItemID:e}=t,s=JA(e),o=e,i=s?.dataInfo.content;delete i.classID;const c=Wr(o),l=zI(c).length,d=zI(c)[l-1]?VI(zI(c)[l-1]):c,u=sE(e),p=vI(u,e)||{},h=p?.referenceList?.replaceAll(".",""),g=p?.subscriptName,f=JA(d),m={containerItemID:d,data:{...f,caseInfo:{content:{...i}}}};r.push(JC(FC,m)),((e,t,n)=>{yI(t)&&e.push(JC(WC,{containerItemID:n,skipReleaseLockRequest:!0}))})(r,o,e);const y=(({itemData:e,workareaContainerData:t,subscriptData:n,pageGroupName:r,activeWorkArea:a,subscriptFieldName:s,actionMgrID:o,containerItemID:i})=>{const c={referenceList:e?.referenceList,ID:t?.caseInfo?.ID,index:n[s],containerName:Ur.MODAL,pageReference:Ur.CASE_INFO.CASE_INFO_CONTENT,viewID:Ur.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW,skipSemanticUrl:!0,actionType:Ur.RESOURCE_STATUS.CREATE,interestPage:`.${r}.${n[s]??""}`,targetProperty:`.${r??""}`,pageGroupName:r,context:a??"",subscriptFieldName:s};return{type:Ns,payload:{isInCreateStage:!1,isModalAction:!0,parentContext:"",target:"",...c,actionMgrID:o,containerItemID:i,doDeleteCaseSummary:!1,isFormValid:!0}}})({itemData:p,workareaContainerData:f,subscriptData:i,pageGroupName:h,activeWorkArea:d,subscriptFieldName:g,actionMgrID:n,containerItemID:e});return r.push(y),a=i,r})),hh((()=>(Vp.resolveActionByID(n,a),QA(r),r=[],r)))):(((e,t)=>{const n={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};Vp.rejectActionByID(e,!0,n),Bg.handleDeferredActionCompletion(t)})(n,e.payload.context),yh([]))})))},DP=[yb,Gb,Xb,aT,MT,jT,JT,tP,rP,uT,ET,fT,aP,TT,ST,e=>e.pipe(_h(Xa),gP((()=>hP(100))),hh((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:r,isProcessAction:a,isDataObject:s,skipReleaseLockRequest:o,isInCreateStage:i,containerItemID:c,context:l}=e.payload;return Vp.resolveActionByID(t),$d.publish(Fr.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:r,hideDelete:!a&&n,isDataObject:s,skipReleaseLockRequest:o,isInCreateStage:i,containerItemID:l||c}),[]}))),e=>e.pipe(_h(Va),gP((()=>hP(100))),hh((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:a}=e.payload,s=js(r,n);return Vp.resolveActionByID(t),QA(JC(BC,{containerItemID:a,target:s,doDeleteCaseSummary:!1})),[]}))),AP,_P,bP,PP,OP];function vP(){return Wl((function(e,t){e.subscribe(Hl(t,ml))}))}const{RESOURCE_TYPES:RP}=Ur,$P="pyCasePreview",xP=(e,t)=>{const n=ry.isObjectCaseType(e.caseClassName);if(e.key&&!n){const n=sE(e?.context),r=LI(n,e.key),a=e?.context;(r||e.updateData||(e=>{const t=KA();if(!e)return!1;const n=Wr(e),r=sE(n),a=sE(e);if(!r||!a)return!1;const s=vI(r,n),o=vI(a,e);if(!s||!o)return!1;const{key:i}=s;let{key:c}=o;return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),!(!i||!c||i===c)})(a))&&t.actionsOut.push(JC(_C,e))}else t.actionsOut.push(JC(_C,e))},wP=[e=>e.pipe(_h(ta),hh((e=>e.payload)),Sh((e=>!im(e.actionMgrID))),gh((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===bI.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=js(bI.PREVIEW,e.context),n=Sm(t,bI.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);QA($C({...e,context:n,target:t,containerItemID:n,key:r,caseViewMode:Fr.REVIEW_MODE,root:{type:"reference",config:{context:Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),name:e.viewName,type:"view"}},data:{key:r,caseInfo:{ID:r,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(Vr.isRemoteCase(t.caseClassName)){const{RemoteSystemID:e}=Vr.getRemoteCase(t.caseClassName);n.RemoteSystemID=e}const{restApi:r,reqType:a}=((e,t)=>{let n=mS("loadView",t);e.viewContext===RP.PAGE&&(n=mS(Wa,{page:e.viewName,pageClass:e.pageClass}));const r=Mr.getDefaultQualifiedName($P);return e.containerName===bI.PREVIEW&&Boolean(e.caseId)&&e.viewContext!==RP.PAGE&&(e.viewName===r||e.viewName===$P)&&(n=mS(Ya,{caseID:e.caseId,params:{pageName:r}})),n})(e,t);return Jl(au(ry.appendExcludeQueryParamToUrl(r),{method:a,headers:n},e.context)).pipe(hh((t=>{const n=decodeURI(e.caseId);let r="";return"string"==typeof t.data?t.data?r=JSON.parse(t.data):(console.error("response data is empty!!"),r={}):r=t.data,{response:{...r,key:n},actionConfig:e,headers:hm(t.headers),rootView:hC.getIn(r,Fr.ROOT)}})),Ph(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),gh((async e=>{const t={};if(e?.type===ba){if(t.actionsOut=Am(e),e?.payload?.context?.includes(bI.PREVIEW)){const n={...JA(e.payload.context),caseInfo:{progress:!1,error:!0}},r=js(bI.PREVIEW,e.payload.context);t.actionsOut=JC(FC,{key:n.key,target:r,containerName:bI.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:r,headers:a}=e;e?.actionConfig?.skipAssignmentsUpdate&&(delete r?.data?.caseInfo?.assignments,delete r?.data?.caseInfo?.availableActions,delete r?.data?.caseInfo?.availableProcesses);const{containerItemID:s,containerName:o}=n,{target:i,context:c}=(e=>{const{containerName:t,updateData:n,viewLoadingContainer:r}=e,a=t||Gp.getTargetViewContainerName(Wa),s=r?.target??js(a,e.context);return{target:s,context:r?.context??(t===bI.PREVIEW&&n?e.context:Sm(s,a,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let d={};d=ff(r),d.directUrlUpdation=!1,await mm(d,n,l);const u={...n,target:i,context:c,containerItemID:s||c,headers:a},p=fm(d,u);if(p.resourceType=RP.CASE,o&&!p.updateData){p.caseViewMode=Fr.REVIEW_MODE,hC.setIn(p.data,["context_data","caseViewMode"],p.caseViewMode);const e=sE(p?.context);((e,t,n,r,a)=>{e&&a===bI.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,sm(n,n),r.actionsOut=JC(FC,{...n,containerName:a})):e?(r.actionsOut=[],r.actionsOut.push(JC(BC,{target:t,containerItemID:e}))):r.actionsOut=JC($C,{...n,containerName:a})})(LI(e,p.key),e,p,t,o)}else{p.preserveClientChanges=!0,t.actionsOut=[],o===bI.PREVIEW&&t.actionsOut.push({type:gs,payload:{context:c}});const{viewName:e}=n;e===Mr.getDefaultQualifiedName($P)&&sm(p,p),xP(p,t)}}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:r,viewName:a}=e.actionConfig;return a===Mr.getDefaultQualifiedName($P)&&(e=>{$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:r}),t})),hh((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(Vp.resolveActionByID(n,e),Lr.setNeedsMapping(!1),t)))),e=>{let t=0,n=[];return e.pipe(_h(na),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>{$d.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:r,viewName:a,className:s,skipSemanticUrl:o=!1,containerName:i=Gp.getTargetViewContainerName(Wa)}=e,c=n&&{...Yd.addDebugHeaders(n)},l=js(i,r);let d="";if(!o){const{semanticURL:t,activate:n,activateContainerActionPayload:r}=Dm(a,s,l);if(d=t,n)return Um(r),yh({type:Ua,activateContainerActionPayload:r,actionConfig:e})}return Jl(VI(l)?bm(l,{loadingContext:r}):Promise.resolve({continueExecution:!0,removeActionPayload:{}})).pipe(gh((({continueExecution:n,removeActionPayload:i})=>{if(!n)return Vp.rejectActionByID(t),bh;const{restApi:l,reqType:u}=mS(Wa,{page:a,pageClass:s});return Jl(au(l,{method:u,headers:c},r)).pipe(hh((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:d,semanticURL:d},actionConfig:e,headers:hm(t.headers),removeActionPayload:i,skipSemanticUrl:o}})),Ph(": Error ocurred during ajax call at showPage Epic : ",e.context))})))})),gh((async e=>{const t={};if(t.actionManagerID=e?.actionConfig?.actionMgrID,e&&e.type===ba)return n.push(Am(e)),t;let{type:r}=e;const{actionConfig:a,skipSemanticUrl:s}=e,o=a.containerName||Gp.getTargetViewContainerName(na),i=js(o,a.context);$d.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className});const{remoteCasePayload:c,updatedType:l}=((e,t,n,r)=>{let a={},s=e;if(n.isRemoteCase){a={...n};const e=LI(r,a.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},s=Ua)}return{remoteCasePayload:a,updatedType:s}})(r,e,a,i);if(r=l??r,a.isDeferLoaded){const{response:r,headers:o={}}=e,{isCreateDataObject:c,context:l}=a,d=ff(r,{isCreateDataObject:c});d.directUrlUpdation=!s;const u={acName:i,context:l};await mm(d,a,u);const p=fm(d,{containerItemID:l,target:i,headers:o,context:l});t.rootView=hC.getIn(d,Fr.ROOT),n.push(JC(_C,p))}else if(r===Ua){const{activateContainerActionPayload:{semanticURL:t,containerItemID:r}}=e,s={acName:i,context:WI(r)};a.isTraditionalRemoteCase||await mm({directUrlUpdation:!0,semanticURL:t},a,s,!0),n.push(JC(BC,{target:i,containerItemID:r}))}else{const t=Sm(i,o,a.context),{response:r,headers:l={},removeActionPayload:d}=e,u=ff(r,{isCreateDataObject:a.isCreateDataObject});u.directUrlUpdation=!s;const p={acName:i,context:t},h=om(t);await mm(u,a,p);const g={target:i,context:t,containerItemID:t,headers:l,debugInfo:a.debugInfo,currentCaseViewMode:h,referenceList:a?.referenceListStr,subscriptName:a?.subscriptName},f=fm(u,g);f.resourceType=Ur.PAGE,a.isCreateDataObject&&(f.resourceType=Ur.RESOURCE_TYPES.DATA,f.resourceStatus=Ur.RESOURCE_STATUS.CREATE,delete f.data.caseInfo,f.referenceList=a.referenceListStr,f.subscriptName=a.subscriptName),((e,t,n)=>{e.isRemoteCase&&(n.resourceType=Ur.CASE,n.key=ry.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:Bf(ry.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=e.isTraditionalRemoteCase||!1,n.className=t.className)})(a,c,f),f.data??={},f.data.traditionalGadgetId=ry.getUniqueGadgetId();const m=Cm(i,f);d.containerItemID&&Nm(m)&&n.push(JC(WC,{containerItemID:d.containerItemID,target:i})),n.push(m)}return $d.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:i,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),t})),hh((({actionManagerID:e=0,rootView:t})=>{Vp.resolveActionByID(e,t),QA(n),n=[]})),vP())}],MP=(e,t)=>{const{context:n,pageName:r,dataContext:a,dataContextParameters:s,semanticURL:o,skipSemanticUrl:i,RemoteSystemID:c}=e,{removeActionPayload:l}=t,{restApi:d,reqType:u,body:p}=mS(Ha,{pageName:r,dataContext:a,dataContextParameters:s}),h={};return h.RemoteSystemID=c,Jl(au(d,{method:u,headers:h,body:p},n)).pipe(hh((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:hm(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),Ph("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:LP}=Ur,UP=e=>{const{dataViewName:t,context:n,dataViewParameters:r}=e,a={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(r))},{restApi:s,reqType:o}=mS("deleteDataObject",a);return Jl(au(s,{method:o},n)).pipe(hh((t=>({response:t.data,actionInPayload:e}))),Ph("Error occurred during ajax call at deleteDataObject Epic",n))},FP=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,a={data_view_ID:t},{restApi:s,reqType:o}=mS("getDataObjectActions",a);return Jl(au(s,{method:o,body:{dataViewParameters:n}},r)).pipe(hh((e=>({...e.data}))),Ph("Error occurred during ajax call at GET data object actions : ",e.context))},jP=[e=>{let t,n=0,r=[];return e.pipe(_h(ra),NT((e=>(({actionMgrID:n}=e.payload),yh(e.payload).pipe(gh((e=>((e,t)=>{const{context:n,pageName:r,dataContext:a,dataContextParameters:s,skipSemanticUrl:o=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l,containerName:d,RemoteSystemID:u}=e,p=js(d,n);let h="";const g={context:n,pageName:r,dataContext:a,dataContextParameters:s,semanticURL:h,skipSemanticUrl:o,containerName:d,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:u};if(!o){h=gS(Ha,{pageName:r,dataViewName:a},s),g.semanticURL=h;const{activate:o,activateContainerActionPayload:i}=Pm(LP.PAGE,p,{semanticURL:h});return o?yh({type:Ua,activateContainerActionPayload:i,actionConfig:e}):Jl(bm(p,{loadingContext:n})).pipe(gh((({continueExecution:e,removeActionPayload:n})=>e?MP(g,{removeActionPayload:n}):(Vp.rejectActionByID(t),bh))))}return MP(g,{removeActionPayload:{}})})(e,n))),gh((async e=>{if(e&&e.type===ba)return r.push(Am(e)),r;const{type:n,actionConfig:a,headers:s,response:o,skipSemanticUrl:i}=e;t=hC.getIn(o,Fr.ROOT);const{containerName:c,parentAction:l,resourceType:d}=a,u=js(c,a.context);let p;const h=om(a?.context);if(a.isDeferLoaded){p=ff(o),p.directUrlUpdation=!i;const t={acName:u,context:a.context};await mm(p,a,t);const n={target:u,headers:s,context:a.context,containerItemID:e.containerItemID},c=fm(p,n);return r=JC(_C,c),r}if(n===Ua){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,s={acName:u,context:WI(n)};await mm({directUrlUpdation:!0,semanticURL:t},a,s,!0),r.push(JC(BC,{target:u,containerItemID:n,resourceType:LP.DATA}))}else if("DATA"===d&&l===Ss){const{context:e}=a,t=o?.data,n={context:e,data:t};r.push(JC(_C,n))}else{const t=Sm(u,c,a.context),{removeActionPayload:n}=e;p=ff(o),p.directUrlUpdation=!i;const l={acName:u,context:t};await mm(p,a,l);const d=fm(p,{target:u,context:t,containerItemID:t,headers:s,currentCaseViewMode:h});d.resourceType=LP.DATA;const g=Cm(u,d);n.containerItemID&&Nm(g)&&r.push(JC(WC,{containerItemID:n.containerItemID,target:u})),Rm(r),r.push(g)}return r})),hh((()=>(Vp.resolveActionByID(n,t),QA(r),r=[],r))))))))},e=>{let t=0,n=[];return e.pipe(_h(ys),Oh(100),ph((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(t,!0,e),yh([])}return yh(e.payload).pipe(gh((e=>Dh(e))),gh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=Am({...e,...r,actionMgrID:t});return n.push(a),{actionsOut:n,data:void 0}}const{actionInPayload:r}=e,{containerItemID:a,isModalAction:s}=r,o=s?bI.MODAL:bI.PRIMARY,i={target:js(o,a),containerItemID:a,context:a};return n.push(JC(WC,i)),{actionsOut:n,data:e?.response}})),hh((({data:e})=>(1===n.length&&jf(n[0].type)?Vp.rejectActionByID(t):Vp.resolveActionByID(t,e),QA(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(_h(Es),Oh(100),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>vh(e))),gh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=Am({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:s={}}=e,{containerName:o,readOnly:i,actionName:c}=r,l=js(o,r.context),d=Sm(l,o,r.context),u={acName:l,context:d};if(a?.data?.dataInfo){const{dataInfo:e}=a.data;e.dataContext||=r.dataLookUp,e.dataContextParameters||=r.requestPayload}await mm(a,r,u);const p=fm(a,{target:l,context:d,containerItemID:d,headers:s});return p.resourceType=Ur.RESOURCE_TYPES.DATA,p.resourceStatus=Ur.RESOURCE_STATUS.UPDATE,p.readOnly=i,p.actionName=c,p.key=JSON.stringify(r.requestPayload),n.push(JC($C,p)),n})),hh((()=>(1===n.length&&jf(n[0].type)?Vp.rejectActionByID(t):Vp.resolveActionByID(t),QA(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(_h(As),Oh(100),ph((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(t,!0,e),yh([])}return yh(e.payload).pipe(gh((e=>Rh(e))),gh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=Am({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r}=e,{containerItemID:a,isModalAction:s}=r,o=s?bI.MODAL:bI.PRIMARY,i={target:js(o,a),containerItemID:a,context:a};return n.push(JC(WC,i)),n})),hh((()=>(1===n.length&&jf(n[0].type)?Vp.rejectActionByID(t):Vp.resolveActionByID(t),QA(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(_h(Is),Oh(100),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>UP(e))),gh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=Am({...e,...r,actionMgrID:t});return n.push(a),n}return[]})),hh((()=>(1===n.length&&jf(n[0].type)?Vp.rejectActionByID(t):Vp.resolveActionByID(t),QA(n),n=[],n))))},e=>{let t=0,n=[];let r={};return e.pipe(_h(Na),Oh(100),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>FP(e))),gh((async e=>e&&e.type===ba?(n.push(Am(e)),n):(r=e,[]))),hh((()=>(1===n.length&&jf(n[0].type)?Vp.rejectActionByID(t):Vp.resolveActionByID(t,r),QA(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(_h(Cs),Oh(100),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>$h(e))),gh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=Am({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:s={}}=e,{containerName:o,actionID:i,context:c,actionName:l}=r,d=js(o,r.context);let u=Hr(o,c);u=Kr(c,u);const p={target:d,context:u,containerItemID:u,headers:s,resourceType:Ur.RESOURCE_TYPES.DATA,resourceStatus:Ur.RESOURCE_STATUS.OPEN_FLOW_ACTION,key:JSON.stringify(r.dataViewParameters),actionID:i,actionName:l};if(a?.data?.dataInfo){const{dataInfo:e}=a.data;e.dataContext||=r.lookupDatapage,e.dataContextParameters||=r.dataViewParameters}const h={acName:d,context:c};await mm(a,r,h);const g=fm(a,p);return n.push(JC($C,g)),n})),hh((()=>(1===n.length&&jf(n[0].type)?Vp.rejectActionByID(t):Vp.resolveActionByID(t),QA(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(_h(Ss),Oh(100),ph((e=>{const{isFormValid:r}=e.payload;({actionMgrID:t}=e.payload);const a=e.payload.context;if(!r){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(t,!0,e),yh([])}return Nd({context:a,stateObj:JA(a),clearContextMessages:!0}),yh(e.payload).pipe(gh((e=>xh(e))),gh((async e=>{if(e&&e.type===ba){my(e,"dataObject");const{payload:r}=e,a=Am({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:s={}}=e,{containerName:o,containerItemID:i,resourceType:c,key:l}=r,d=js(o,r.context),u={acName:d,context:r.context};await mm(a,r,u);const p={key:l,target:d,resourceType:c,containerItemID:i,headers:s,context:r.context};return n=((e,t,n,r)=>{const{resourceType:a,key:s,containerItemID:o}=r,i=fm(n,t);i.resourceType=a||Ur.RESOURCE_TYPES.DATA;const c=Qr(o);e.push(JC(WC,i));const l=eC(".dataContext","dataInfo",c),d=eC(".dataContextParameters","dataInfo",c),u={context:c,skipSemanticUrl:!0,resourceType:a,parentAction:Ss,dataContext:l,dataContextParameters:d},p=l&&d&&gS(Ha,{pageName:Fr.PY_DETAILS,dataViewName:l},d)||"";if(o?.includes(Fr.PREVIEW)){const t={type:ra,payload:{pageName:Fr.VIEW_NAMES.PY_DATA_PREVIEW,container:Fr.PREVIEW,containerName:Fr.PREVIEW,...u}};e.push(t)}else if(a!==Fr.PAGE&&s===p&&o?.includes(Fr.PRIMARY)){const t={type:ra,payload:{pageName:Fr.VIEW_NAMES.PY_DETAILS,containerName:"",...u}};e.push(t)}return e})(n,p,a,{key:l,resourceType:c,containerItemID:i}),n})),hh((()=>(1===n.length&&jf(n[0].type)?Vp.rejectActionByID(t):Vp.resolveActionByID(t),QA(n),n=[],n))))})))}];function kP(e,t){return void 0===t&&(t=dP),Wl((function(n,r){var a=null,s=null,o=null,i=function(){if(a){a.unsubscribe(),a=null;var e=s;s=null,r.next(e)}};function c(){var n=o+e,s=t.now();if(s<n)return a=this.schedule(void 0,n-s),void r.add(a);i()}n.subscribe(Hl(r,(function(n){s=n,o=t.now(),a||(a=t.schedule(c,e),r.add(a))}),(function(){i(),r.complete()}),void 0,(function(){s=a=null})))}))}const{RESOURCE_TYPES:{CASE:VP,DATA:BP,OBJECT:GP}}=Ur;let WP=[],HP=!1,qP=!1;const zP={},YP=[e=>e.pipe(_h(_a),kP(200),hh((e=>e.payload)),gh((e=>{qP=!1,$d.subscribe(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{qP=!0}));const t=wd.getPreviewMode()&&Yd.addDebugHeaders({debugId:hC.generateUniqueID()});zP.dataContext=e.payload.dataViewName,zP.dataContextParameters=e.payload.dataViewKeys;const{context:n,requestType:r,routeKey:a}=e;let{routeEndpoint:s}=e;s&&(s.indexOf("viewType={viewType}")>0?s=s.replace("{viewType}","page"):s.indexOf('viewType=""')>0&&(s=s.replace('viewType=""','viewType="page"'))),HP=a===Ms,HP&&Lr.setNeedsMapping(!0);const o=an()+s,i=e.options.context;let c;const l={},d=e?.payload?.caseClassName;if(Vr.isRemoteCase(d)){const{RemoteSystemID:e}=Vr.getRemoteCase(d);l.RemoteSystemID=e}if(LE.isWSSPortal()&&(l[Fr.X_ORIGIN_CHANNEL]="WSS"),"POST"===r){c=e.payload,s.indexOf("viewType=")<0&&(s=`${s}?viewType=page`);let i;switch($m(a)){case VP:case GP:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case BP:i=zP;break;default:i=c}return Jl(au(o,{method:r,body:i,headers:{...l,...t}},n)).pipe(hh((t=>({response:{...t.data},payload:e,headers:hm(t.headers,"",l)}))),Ph(": Error occurred during ajax call at historyEpic : ",e))}return Jl(au(ry.appendExcludeQueryParamToUrl(o),{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(hh((n=>({response:n.data,payload:e,headers:{...hm(n.headers),...t}}))),Xl((r=>{if(a===os){const n={messages:[{type:"error",message:r.response.data.errorDetails[0].localizedValue}],category:"PAGE"};jp.setComponentCache("assignments-launchAssignment-Error",n);const a=Wh(RE()),s=wE.getEndPointInfo(a.split("/assignments")[0]),o=an()+s.routeEndpoint;return e={...e,routeKey:Ya,resetSemanticURL:!0},Jl(au(o,{method:s.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(hh((n=>({response:n.data,payload:e,headers:{...hm(n.headers),...t}}))))}return yh(XC(": Error occurred during ajax call at historyEpic : ",r,n))})))})),gh((async e=>{if(qP)return WP;if($d.subscribe(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{qP=!0})),e&&e.type===ba)return Am(e);const{headers:t={},response:n,payload:r}=e,a=ff(n,{[Ur.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),s=r.options.acName,o=QI(s)&&XI(s)?VI(s):e.payload.options.context,i=o;t.RemoteSystemID=r?.payload?.RemoteSystemID;const c={target:s,context:o,containerItemID:i,headers:t,debugInfo:{debugId:t[Fr.COREHEADER_APP_DEBUG_ID]}};let l=r?.payload?.pageClass;const d=r?.payload?.page,u=HP?Ms:Ya,p=HP?r.payload.objectID:r.payload.workID,h=HP?"{objectID}":"{workID}";let g=HP?`objects/${p}`:"";r?.payload?.caseName&&p&&(g=gS(u,{caseName:e.payload.payload.caseName}),g=g?.replace(h,p)||"",l=r?.payload?.caseClassName),(r?.routeKey===os||r?.resetSemanticURL)&&((e,t)=>{const n=Hf(t);let r=gS(Ya,{caseClassName:Gf(t)},{id:n});r=r?.replace("{workID}",String(Bf(n))).replace("{id}",String(Bf(n))),_S({directUrlUpdation:!0,semanticURL:r,options:{}})})(0,a),((e,t)=>{const n=t?.data?.caseInfo;e===os&&n?.caseTypeID&&n?.content&&Zf(n.caseTypeID)&&(n.content.coexistenceAction=Ka)})(r?.routeKey,a),(e=>{const t=e?.data?.caseInfo;if(!t)return;const{ID:n,caseTypeID:r}=t;n&&r&&Zf(r)&&(e.data.caseID=n)})(a),$d.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:d,pageClass:l});const f=hC.getIn(a,Fr.COMPONENTS);f&&await $p(f),up(a,r.options.actionConfig,!0),$d.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:s,pageName:d,pageClass:l});let m=fm(a,c);return m=((e,t,n)=>{if(e===dm.CASE||e===dm.OBJECT||e===dm.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=Im(t.caseInfo.assignments[0].ID);n.key=e||t.caseInfo.ID,n.flowName=r}else n.flowName="",n.key=t?.caseInfo?.ID||t?.objectInfo?.ID||t.semanticURL;n.resourceType=e,n.semanticURL=t.semanticURL,e===dm.ASSIGNMENT?(n.caseViewMode=Fr.PERFORM_MODE,n.resourceType=dm.CASE):n.caseViewMode=Fr.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})($m(e.payload.routeKey),{...n.data,semanticURL:g,caseViewMode:Fr.REVIEW_MODE},m),m.data.traditionalGadgetId=ry.getUniqueGadgetId(),WP.push(Cm(s,m)),sm(a,c),((e,t)=>{let n=jp.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(JC(GC,n)),jp.resetComponentCache("assignments-launchAssignment-Error"))})(o,WP),WP})),hh((()=>(qP||QA(WP),WP=[],HP=!1,qP=!1,WP))),Ph("Error occurred"))],KP=[e=>{let t=0;return e.pipe(_h(ls),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),hh((()=>{const e=KA()?.getState(),n=Y_();return Xt(e,n)&&t>0?Vp.resolveActionByID(t,{}):Vp.rejectActionByID(t),[]})),vP())}],QP=[e=>{let t=0,n=[];return e.pipe(_h(aa),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:r}=e;let a,s="";n||(s=gS(qa,{insightID:"{insightID}"}),s=s.replace("{insightID}",r),a=wE.getEndPointInfo(s));const{restApi:o,reqType:i}=mS(qa,{...a?.payload||[],insightID:r});return Jl(au(o,{method:i},t)).pipe(hh((t=>{let r={};return r="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...r,key:s,semanticURL:s},actionConfig:e,skipSemanticUrl:n}})),Ph(": Error occurred during ajax call at showPage Epic : ",e.context))})),gh((async e=>{if(e&&e.type===ba)return n.push(Am(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,a=Gp.getTargetViewContainerName(na),s=js(a,t.context),o=Sm(s,a,t.context),{response:i}=e,c=ff(i);c.directUrlUpdation=!r;const l={acName:s,context:o},d=!r,u=r;await mm(c,t,l,d,u);const p=fm(c,{target:s,context:o,containerItemID:o});p.resourceType=Ur.PAGE;const h=Cm(s,p);return n.push(h),n})),hh((()=>{Vp.resolveActionByID(t),QA(n),n=[]})),vP())}],JP=[e=>{let t=0,n=[];return e.pipe(_h(sa),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:r}=e;let a="";n||(a=gS(za,{dashboardID:r}),a=a.replace("{dashboardID}",r));const{restApi:s,reqType:o}=mS(za,{dashboardID:r});return Jl(au(s,{method:o},t)).pipe(hh((t=>{let r={};return r="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...r,key:a,semanticURL:a},actionConfig:e,skipSemanticUrl:n}})),Ph(": Error occurred during ajax call at showPage Epic : ",e.context))})),gh((async e=>{if(e&&e.type===ba)return n.push(Am(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,a=Gp.getTargetViewContainerName(na),s=js(a,t.context),o=Sm(s,a,t.context),{response:i}=e,c=ff(i);c.directUrlUpdation=!r;const l={acName:s,context:o},d=!r,u=r;await mm(c,t,l,d,u);const p=fm(c,{target:s,context:o,containerItemID:o});p.resourceType=Ur.PAGE;const h=Cm(s,p);return n.push(h)})),hh((()=>{Vp.resolveActionByID(t),QA(n),n=[]})),vP())}],XP=(e,t)=>{const{class:n,context:r,viewType:a=um.PAGE}=e,{removeActionPayload:s}=t,o=e?.pageName?e?.pageName:LE.getDefaultCasePage();return Jl(hp.createCase(n,{...e,pageName:o,viewType:a,context:r})).pipe(hh((({response:t,headers:n})=>(Lr.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:s}))),Ph("Error occurred during ajax call at createObject Epic : ",r))},ZP="CREATE_OBJECT",eO=e=>{let t,n=0,r=[],a={};let s=!1;return e.pipe(_h(ZP),Oh(100),ph((e=>{if(({actionMgrID:n}=e.payload),ry.isExternalObject(e.payload.class)&&!Xm(e.payload.context)){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(n,!0,e),yh([])}return yh(e.payload).pipe(gh((e=>{const{context:r}=e;t=e.class;const a=Mb(e),o=js(a,r);return s=!1,Jl(ub(o,{loadingContext:r})).pipe(gh((({continueExecution:t,removeActionPayload:r,dirtyCheckPerformed:a})=>t?(s=a,XP(e,{removeActionPayload:r})):(Vp.rejectActionByID(n),bh))))})),gh((async e=>{if(e&&e.type===ba)return e.payload.context=((e,t)=>ry.isExternalObject(e)&&t?t:SE())(t,e.payload.context),r.push(Am(e)),r;const{actionInPayload:o,response:i,headers:c,removeActionPayload:l}=e,d=jb(o,i);hC.setIn(i.data,Fr.getProperty(Fr.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const u=Mb({...o,isInCreateStage:d}),p=js(u,o.context),h=Sm(p,u,o.context);if(((e,t)=>{ry.isExternalObject(e.class)&&(e.containerItemID=e.context,Ab(t,e))})(o,r),!s&&((e,t,n)=>!Uf(e)&&QI(t)&&!ry.isExternalObject(n))(u,p,t)){const{continueExecution:e}=await bm(p,{loadingContext:o.context});if(!e)return Vp.rejectActionByID(n),r}if(((e,t)=>!e&&!t)(o?.openCaseViewAfterCreate??!0,d)){const{businessID:e,caseType:t,resolvedURL:n}=Xp(i);return a={id:e,label:t,href:n},gb(a),fb({caseId:e,caseType:t}),r}(e=>{ry.isExternalObject(e.class)&&gb({content:VE().getLocaleValue("Successfully submitted!","Assignment")})})(o);const g=ff(i),f=String(Bf(Yp(g)));let m=gS(ws,{caseClassName:zp(g)});m=m.replace(/{.+?}/,f),g.semanticURL=m,jp.setComponentCache(f,Yd.addDebugHeaders(o.debugInfo)),Ub(g,o);const y={acName:p,context:h};await mm(g,o,y);const I={target:p,context:h,headers:c,semanticURL:m,caseViewMode:Fb(g),containerItemID:h,isInCreateStage:d,isMinimizable:d,assignmentContext:hC.getIn(g,lb),nextAssignmentInfo:hC.getIn(g,cb),resourceType:Ur.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:o.openCaseViewAfterCreate,modalOptions:o.modalOptions,debugInfo:o.debugInfo};Kp(I,g);const E=fm(g,I),A=Cm(p,E);return((e,t,n)=>{if(Nm(e)){const{removeActionPayload:e,target:r}=t;zf(n,{removeActionPayload:e,target:r})}})(A,{removeActionPayload:l,target:p},r),r.push(A),r})),hh((()=>(wm(r),Xf(r,n),setTimeout((()=>(e=>{ry.isExternalObject(e)&&Lr.setNeedsMapping(!1)})(t))),a={},r=[],r))))})))},tO=(e,t)=>{const{assignmentID:n,actionID:r,caseID:a,context:s,additionalHeaders:o={},jsActionQueryParams:i}=e,{state$:c}=t,l=um.PAGE,d="executeObjectWideAction",u={assignmentID:n,actionID:r,viewType:l,objectID:a};let{restApi:p}=mS(d,u);const{reqType:h}=mS(d,u);l&&!p?.includes("viewType=")&&(p=p?.includes("?")?`${p}&viewType=${l}`:`${p}?viewType=${l}`),p=fy(i,p),e.viewType=l;const{content:g}=gm(s,{isObjectWideAction:!0}),f=c.value.data[s]?.objectInfo?.headers||{},{etag:m}=f,y={"if-match":m,...o};return Jl(au(p,{method:h,body:g,headers:y},s)).pipe(hh((t=>{const{data:n,headers:r}=t;return Lr.analyseResponse(t.data),{actionInPayload:e,response:n,headers:hm({...y,...r})}})),Ph("Error occurred during ajax call at executeObjectWideAction Epic : ",s))},nO=(e,t)=>{const{isCaseWideAction:n}=t;return{isCaseWideAction:n,caseID:Yp(e)}},{RESOURCE_TYPES:rO}=Ur,aO=(e,t)=>{let n=0,r=[],a={},s="";return e.pipe(_h(Rs),ph((e=>{if(({actionMgrID:n}=e.payload),s=e.payload.context,Nd({context:s,stateObj:JA(s),clearContextMessages:!0}),!Xm(s)){const t={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Vp.rejectActionByID(n,!0,t),Bg.handleDeferredActionCompletion(e.payload.context),yh([])}return yh(e.payload).pipe(gh((e=>{Eb(r,e);const n={...e};return tO(n,{state$:t})})),gh((async e=>{if(e?.type===ba){const t=Am(e);return r.push(t),r}Dg.clearContextedCache(s);const{headers:t,actionInPayload:o,response:i}=e,{containerItemID:c,isModalAction:l,isInCreateStage:d}=o,u=sE(c);o.target=u,hC.setIn(i.data,Fr.OBJECT_INFO_IS_LOCAL_ACTION,!1),iT({submitResponse:i});let p=ff(i,{[Ur.STOPMERGEACTIONS]:!i.nextAssignmentInfo});const h=zp(p),g=Wr(o.context),f=zI(g)[0]?VI(zI(g)[0]):g,m=(e=>{const t=Qp(e);return sy(t)&&oy(LE.getOperatorIdentifier(),t)})(p),y=d&&!m;!l||d||bb(o.context,f)||(p=vm(p,JA(c)));const I=fm(p,{headers:t,actionMgrID:n,directUrlUpdation:!1});((e,t)=>{const{attachmentsExist:n}=t;n&&hC.setIn(e,Ur.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),hC.setIn(e,Ur.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())})(I.data,o),I.caseClassName=h,I.resourceType=rO.ASSIGNMENT,I.headers=t;const E=Yp(p);Kp(I,p);const A=gS(ws,{caseClassName:h}).replace(/{.+?}/,String(Bf(E)));p.semanticURL=A,I.semanticURL=A,await Rb(o,I,!1,E,p,r,e,i,!0),y&&(a=Tb(o),fb({caseId:o.caseID,caseType:o.caseTypeID,assignmentId:o.assignmentID})),((e,t)=>{const n=zp(e?.response),r=Qp(e?.response),{caseTypeID:a}=r,s=LE.getFeatureMap();(s?.deferUpdateCaseSummaryView??!Object.hasOwn(s,Fr.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&TA(Fr.CASESUMMARY_VIEW_NAME,a)&&tm(t,e?.actionInPayload,e?.response,{caseClassName:n})})(e,r),Bg.handleDeferredActionCompletion(s),$b(I,o,f);const C=nO(p,o);return Ug({...C,containerItemID:c}),Nb(r,{transientItemID:c,target:u,isModalAction:l}),r})),hh((()=>{const e=r.find((e=>e.type===ba));return e?(Bg.handleDeferredActionCompletion(s),xb(e),Vp.rejectActionByID(n)):Vp.resolveActionByID(n,a),wm(r),Lr.setNeedsMapping(!1),r=[],a={},r})))})))},sO=(e,t)=>{const{insKey:n,headers:r,context:a,debugInfo:s,viewType:o}=e,{removeActionPayload:i}=t,c=e.pageName?e.pageName:Fr.VIEW_NAMES.PY_DETAILS,l=mS(Ms,{objectID:n,params:{pageName:c}});let{restApi:d}=l;const{reqType:u}=l;return"none"===o&&(d=`${d?.split("viewType")[0]}viewType=none`),Jl(au(d,{method:u,headers:{...r,...s&&{...Yd.addDebugHeaders(s)}}},a)).pipe(hh((t=>(Lr.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:hm({...r,...t.headers}),removeActionPayload:i}))),Ph("Error occurred during ajax call at getObject Epic : ",a))},oO="GET_OBJECT",{RESOURCE_TYPES:iO}=Ur,cO=async(e,t)=>{const{actionInPayload:n,activateContainerActionPayload:r,type:a,response:s,removeActionPayload:o,headers:i}=e,{context:c,skipBrowserSemanticUrlUpdate:l,debugInfo:d}=n,u=wf(Ms,n),p=js(u,c);if(Ff(a))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:a,actionInPayload:{context:s,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=wf(Ms,a),l=js(c,s),d=WI(r);await mm({directUrlUpdation:!o,semanticURL:n},a,{acName:l,containerName:c,target:l,context:d}),e.push(JC(BC,{containerItemID:r,target:l,context:d,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:r,actionInPayload:n});else{const e=Sm(p,u,c,{buildNew:!0}),r=ff(s),a=(e=>{const t=Yp(e),n=zp(e);let r=gS(Ms,{objectClassName:n});return r=r?.replace("{objectID}",String(Bf(t))),r})(r);r.semanticURL=a,r.directUrlUpdation=!l;const h={acName:p,context:e};await mm(r,n,h);const g=fm(r,{target:p,context:e,containerItemID:e,semanticURL:a,headers:i,debugInfo:d});g.caseViewMode=Fr.REVIEW_MODE,g.resourceType=iO.OBJECT,Kp(g,r);const f=Cm(p,g);o.containerItemID&&Nm(f)&&t.push(JC(WC,{containerItemID:o.containerItemID,target:p})),t.push(f)}const h=n.insKey;Fg({caseKey:h,actionInContext:c})},lO="OPEN_OBJECT_ACTION",dO=e=>{const{actionID:t,caseID:n,context:r,openActionType:a,modalLoadingContainer:s}=e,o=um.FORM,i=mS(Ls,{objectID:n,actionID:t,viewType:o}),{reqType:c}=i;let{restApi:l}=i;e.actionType=Fr.RESOURCE_TYPES.OBJECT,l&&!l.includes("viewType=")&&(l=l.includes("?")?`${l}&viewType=${o}`:`${l}?viewType=${o}`);const d=s?.context??r;return Jl(au(l,{method:c,headers:{}},d)).pipe(hh((t=>(Lr.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:hm(t.headers)}))),Ph(`: Error occurred during ajax call at ${a} Epic : `,d))},uO=async(e,t,{headers:n,actionInPayload:r})=>{const{context:a,actionName:s,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=ff(e,{info:Ur.OBJECT_INFO.OBJECT_INFO}),d=wf(o,r),u=c?.target??js(d,a),{context:p,containerItemID:h,isNewContainerItem:g}=((e,t,n,r)=>{let a,s,o=!1;const i=JI(e);return!XI(e)||i&&!wI(e,r)?(s=Hr(t,n),Uf(t)&&(s=Kr(n,s)),a=s,o=!0):(a=i?LI(e,r):VI(e),s=WI(a)),{context:s,containerItemID:a,isNewContainerItem:o}})(u,d,a,e.data.objectInfo.ID),f={acName:u,target:u,containerName:d,context:p};await mm(l,r,f);const m=l.uiResources?.root,y=(e=>e?Fr.PERFORM_MODE:Fr.REVIEW_MODE)(m),I=fm(l,{target:u,context:p,containerItemID:h,caseViewMode:y,doDeleteCaseSummary:i,headers:n,actionName:s,isMinimizable:!1,isInCreateStage:Uf(d),resourceType:Ur.RESOURCE_TYPES.OBJECT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,actionType:r.actionType});if(m&&Kp(I,l),Uf(d)&&delete I.doDeleteCaseSummary,t.push(JC((e=>e?$C:FC)(g),I)),g||t.push(JC(kC,I)),g){const a=zI(r.contextName),s=LI(a,e.data.objectInfo.ID);if(s){const e={data:{objectInfo:{headers:n}},context:s};t.push(JC(_C,e))}}return h!==VI(u)&&t.push(JC(BC,{target:u,containerItemID:h})),Jp(h)&&!c?.context&&xm(I,t),t},pO=e=>{e.openActionType=Ls;if(wf(e.openActionType,e)===Fr.MODAL){const t=wf(e.openActionType,e),n=js(t,e.context),r=Kr(e.context,Hr(t,e.context));return QA($C({target:n,context:r,containerItemID:r,key:e.caseID,caseViewMode:Fr.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),type:"view"}},data:{key:e.caseID,objectInfo:{ID:e.caseID}}})),QA(jC({context:r})),e.modalLoadingContainer={target:n,context:r},dO(e)}return dO(e)},hO=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Fr.MODAL:t||Gp.getTargetViewContainerName(Us)},gO=(e,t)=>{const{class:n,context:r,viewType:a=um.PAGE}=e,{removeActionPayload:s}=t,o=e?.pageName?e?.pageName:LE.getDefaultCasePage();return Jl(hp.createCase(n,{...e,pageName:o,viewType:a,context:r,retrieveActionViewForNewObject:!0})).pipe(hh((({response:t,headers:n})=>(Lr.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:s}))),Ph("Error occurred during ajax call at createObject Epic : ",r))},fO="CREATE_EXTERNAL_OBJECT",mO=e=>{const{workId:t,context:n,isExternalCase:r}=e,a=r?Za:"deleteWork",{restApi:s,reqType:o}=mS(a,{ID:t});return Jl(au(s,{method:o},n)).pipe(hh((t=>({response:t.data,actionInPayload:e,headers:hm(t.headers)}))),Ph("Error occurred during ajax call at deleteWork Epic : ",n))},yO=e=>{$d.publish(Fr.PUB_SUB_EVENTS.WORK_EVENTS.WORK_DELETED,e)},IO=((...e)=>(t,n)=>new $l((r=>{const a=e.map((e=>e(t,n).subscribe(r)));return()=>{a.forEach((e=>e.unsubscribe()))}})))(...ab,...DP,...wP,...YP,...jP,...sb,...KP,...QP,...JP,...[eO,e=>{let t=0,n=[];return e.pipe(_h(oO),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>{const{context:n,isChild:r,viewType:a}=e,s=wf(Ms,e),o=js(s,n);return Jl("none"!==a?bm(o,{loadingContext:n}):Promise.resolve({continueExecution:!0,removeActionPayload:void 0})).pipe(gh((({continueExecution:n,removeActionPayload:s})=>{if(!n)return Vp.rejectActionByID(t),bh;const{activate:i,activateContainerActionPayload:c}=Pm(iO.OBJECT,o,e);return i&&!r&&"none"!==a?yh({type:Ua,activateContainerActionPayload:c,actionInPayload:e}):sO(e,{removeActionPayload:s})})))})),gh((async e=>{if(e&&jf(e.type))return n.push(Am(e)),n;if("none"===e?.actionInPayload?.viewType){const t=JA(e?.actionInPayload?.context);if(t?.context_data?.caseViewMode!==Fr.PERFORM_MODE){const t=ff(e?.response),r={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:gs,payload:{context:r.context,doDeleteConfirmationDetails:!1}}),n.push(JC(_C,r));const a=sE(e?.actionInPayload?.context),s=Mf(e?.actionInPayload?.context),o=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:s});if(Jp(e?.actionInPayload?.context)){const t=fm(e?.response,{...o});xm({...t,isArrayDeepMerge:!0},n)}}}else await cO(e,n);return n})),hh((()=>(QA(n),Xf(n,t),n=[],n))))},aO,e=>{let t=0,n=[];return e.pipe(_h(lO),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>pO(e))),gh((async e=>{if(jf(e.type)){const t=Am(e);n.push(t);const r=JA(e.payload.context);return r?.context_data?.isLoading&&n.push(JC(kC,e.payload)),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:s}=t;return hC.setIn(a,"data.objectInfo.activeActionID",s),hC.setIn(a.data,Fr.getProperty(Fr.OBJECT_INFO_IS_LOCAL_ACTION),!0),t.refreshConditions&&hC.setIn(a.data,Fr.getProperty(Fr.CASE_INFO_REFRESH_CONDITIONS),t.refreshConditions),await uO(a,n,{headers:r,actionInPayload:t}),PT(t),n})),hh((()=>(QA(n),Xf(n,t),n=[],n))))},e=>{let t=0,n=[],r=!1;return e.pipe(_h(fO),Oh(100),hh((e=>(({actionMgrID:t}=e.payload),e.payload))),gh((e=>{const{context:n}=e,a=hO(e),s=js(a,n);return r=!1,Jl(ub(s,{loadingContext:n})).pipe(gh((({continueExecution:n,removeActionPayload:a,dirtyCheckPerformed:s})=>n?(r=s,gO(e,{removeActionPayload:a})):(Vp.rejectActionByID(t),bh))))})),gh((async e=>{if(e&&e.type===ba)return e.payload.context=SE(),n.push(Am(e)),n;const{actionInPayload:a,response:s,headers:o,removeActionPayload:i}=e,c=jb(a,s);hC.setIn(s.data,Fr.getProperty(Fr.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const l=hO({...a,isInCreateStage:c}),d=js(l,a.context),u=Sm(d,l,a.context);if(!r&&!Uf(l)&&QI(d)){const{continueExecution:e}=await bm(d,{loadingContext:a.context});if(!e)return Vp.rejectActionByID(t),n}const p=ff(s);let h=gS(Us,{caseClassName:zp(p)});h=h.replace(/{.+?}/,String(Bf(Yp(p)))),p.semanticURL=h,Ub(p,a);const g={acName:d,context:u};await mm(p,a,g);const f={target:d,context:u,headers:o,semanticURL:h,caseViewMode:Fb(p),containerItemID:u,isInCreateStage:c,isMinimizable:c,assignmentContext:hC.getIn(p,lb),nextAssignmentInfo:hC.getIn(p,cb),resourceType:Ur.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo,isExternalObjectCreationFlow:!0};Kp(f,p);const m=fm(p,f),y=Cm(d,m);return Nm(y)&&zf(n,{removeActionPayload:i,target:d}),n.push(y),n})),hh((()=>(wm(n),Xf(n,t),n=[],n))))},e=>{let t,n=0,r=[];return e.pipe(_h(sh),hh((e=>(({actionMgrID:n,caseTypeID:t}=e.payload),e.payload))),gh((e=>{if(!e.skipDeleteConfirmation&&!e.ignoreWorkDeletion){const r=bI.MODAL,a=js(r,e.context),s=Kr(e.context,Hr(r,e.context));return QA([JC($C,{target:a,context:s,containerItemID:s,containerName:r,isDeleteConfirmation:!0,actionName:"Delete",workId:e.workId,caseTypeID:t,className:e.className,keys:e.keys,...e.enableBackNavigation&&{enableBackNavigation:!0},data:{caseInfo:{caseTypeID:t}}})]),Vp.resolveActionByID(n),bh}return e.ignoreWorkDeletion?yh({actionInPayload:e}):mO(e)})),gh((async e=>{if(e&&jf(e.type)){const{payload:t}=e;return r.push(Am({...e,...t,actionMgrID:n})),r}const{actionInPayload:t}=e,{context:a}=t;if(gb({content:VE().getLocaleValue("Deleted successfully!","Messages")}),a?.includes(Fr.PREVIEW)&&r.push(JC(RC,nE({context:Fr.APP.APP,name:Fr.PREVIEW}))),a?.includes(Fr.MODAL)){const e=bI.MODAL,t=js(e,a),n=vI(t,a);n?.enableBackNavigation&&window?.history?.back()}return r})),hh((()=>(QA(r),Xf(r,n)===Fr.PROMISE_VALUE.RESOLVE&&yO({caseTypeID:t}),r=[],r))))}]),EO=()=>e=>t=>{const{type:n="",payload:r={}}=t||{},{category:a,context:s,transientItemID:o}=r;"HTTP"!==a&&[Oa,Fa,Da,ka,Ra,La].includes(n)&&(Gm(s||o),md.removeContextTreeNode(s||o),n!==Oa&&n!==Da||-1===r?.target?.indexOf("modal")||$d.publish(Ur.PUB_SUB_EVENTS.PEGA_EMBED_CUSTOM,n)),e(t)},AO={},CO=e=>{const t=hC.getIn(AO,[Fr.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),a=hC.getIn(AO,[r,t],[]),s=a&&a.length>0&&a.indexOf(e);if(s>-1&&a.splice(s,1),!a||a&&0===a.length){hC.deleteIn(AO,[r,t]);const e=hC.getIn(AO,[r]);e&&0===Object.keys(e).length&&hC.deleteIn(AO,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),hC.deleteIn(AO,[Fr.CONTEXT,e]);const r=hC.getIn(AO,[Fr.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&hC.deleteIn(AO,[Fr.CONTEXT]),n.length>0&&QA(eS({dataPagesToBeRemoved:n}))},SO=(e={},t)=>{Object.keys(e).forEach((n=>{const r=hC.getIn(e,[n],{});Object.keys(r).forEach((e=>{((e,t,n)=>{const r=hC.getIn(AO,[Fr.CONTEXT,n]);if(hC.getIn(AO,[e])){const r=hC.getIn(AO,[e,t],[]);hC.setIn(AO,[e,t],[...new Set([...r,n])])}else hC.setIn(AO,[e,t],[n]);r?hC.setIn(AO,[Fr.CONTEXT,n],[...new Set([...r,t])]):hC.setIn(AO,[Fr.CONTEXT,n],[t])})(n,e,t)}))}))},NO=()=>e=>t=>{(Array.isArray(t)?t:[t]).forEach((e=>{const{payload:{data:t={},context:n=null,childContainersContexts:r=[]}={},type:a}=e;if(((e,t)=>{t&&t.length>0&&(e===ka||e===Da)&&t.forEach((e=>{CO(e)}))})(a,r),a===Oa||a===Ca||a===us){const e=a===us?t:t.shared;SO(e,n)}else a===ka?(CO(n),SO(t.shared,n)):a===Da&&CO(n)})),e(t)},{PUB_SUB_EVENTS:_O}=Ur,bO=e=>t=>n=>{const{type:r,payload:{target:a,containerItemID:s,context:o,childContainersContexts:i=[],containerInfo:{newAccessedOrder:c,containerType:l}={newAccessedOrder:new Array,containerType:""},eventName:d}={}}=n;r===Da&&((e,t,n,r,a,s)=>{const{resourceType:o,key:i,context:c}=hC.getIn(e.getState(),["containers",t,"items",n])||{},l={resourceType:o,key:i,context:c,containerItemID:n,...void 0!==r?{eventName:r}:{}};$d.publish(_O.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,l),t===`${Ur.APP.APP}/${Fr.PRIMARY}`&&s===Fr.CONTAINER_TYPE.MULTIPLE&&$d.publish(_O.CONTAINER_EVENTS.CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM,{key:i,newAccessedOrder:a})})(e,a,s,d,c,l),((e,t)=>{t&&t.length>0&&(e===ka||e===Da)&&t.forEach((e=>{e&&$g.cleanCaches(e)}))})(r,i),r!==ka&&r!==Da||!o||$g.cleanCaches(o),t(n)},TO=(e,t,n,r)=>{var a;e&&t&&(a={caseId:e,caseClass:n,context:r||""},$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,a))},PO=e=>{var t;e&&(t={caseId:e},$d.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,t))},OO=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t){const{type:e,payload:n}=t,{target:r,key:a,context:s,data:o}=n||{};if((e=>e===`${Fr.APP.APP}/${Fr.PRIMARY}`)(r)){const t=o?.caseInfo?.ID,n=s||"",r=eC(Fr.CASE_INFO.CASE_INFO_ID,"",n)||"",i=o?.caseInfo?.caseTypeID||"";e!==ka&&e!==Da||PO(r),e!==Oa&&e!==ka||TO(a,!!t,i,n)}}e(t)},DO=()=>e=>t=>{const{payload:{context:n=null,transientItemID:r=null,clearStateMachine:a=!0}={},type:s}=t;n&&(s===Oa||s===Fa||s===ka||s===Da)&&a&&($u(n),vu(n)),r&&s===wa&&($u(r),vu(r)),e(t)},vO=e=>hC.getIn(e,Fr.CASE_INFO.ASSIGNMENT_ID),RO=e=>{Object.keys(gg.subscribers).forEach((t=>{"COACH_UPDATE"===gg.subscribers[t].filter.matcher&&gg.subscribers[t].filter.criteria?.caseId===e&&gg.unsubscribe(t)}))},$O=(e,t)=>{if(n=t.target,n?.toString().includes(Fr.MODAL))return;var n;const{context:r,data:a,resourceType:s,caseID:o}=t;e===Oa?((e,t,n)=>{if(n===Fr.RESOURCE_TYPES.ASSIGNMENT){const n=vO(t),r=hC.getIn(t,["caseInfo","ID"]);n&&r&&kg({actionInContext:e,assignmentID:n,caseKey:r})}else if(n===Fr.RESOURCE_TYPES.CASE&&e?.includes("workarea")){const n=hC.getIn(t,["caseInfo","ID"]),r=vO(t);n&&r&&kg({actionInContext:e,assignmentID:r,caseKey:n})}})(r,a,s):e===Fa?((e,t,n)=>{if(n!==Fr.RESOURCE_TYPES.ASSIGNMENT)return;const r=vO(JA(e)),a=vO(t),s=hC.getIn(t,["caseInfo","ID"]);r&&r!==a&&Vg({actionInContext:e,assignmentID:r,caseKey:s}),a&&s&&kg({actionInContext:e,assignmentID:a,caseKey:s})})(r,a,s):e===Da&&o?((e,t)=>{if(e?.includes("workarea")){const n=vO(JA(e));n&&Vg({actionInContext:e,assignmentID:n,caseKey:t})}else RO(t)})(r,o):e===ka&&o&&((e,t,n,r)=>{if(e?.includes("workarea")){const t=vO(JA(e));t&&Vg({actionInContext:e,assignmentID:t,caseKey:r})}else RO(r);if(n===Fr.RESOURCE_TYPES.ASSIGNMENT){const n=vO(t);n&&kg({actionInContext:e,assignmentID:n,caseKey:r})}})(r,a,s,o)},xO=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t){const{type:e,payload:r}=t;"object"==typeof(n=r)&&null!==n&&$O(e,r)}var n;e(t)},wO=[ga,ma,Ia,"DELETE_CASE_IN_CREATE_STAGE",Ea,Aa],MO=new Set([Oa,ka,Fa,Da,fa,Ns,ea,hs,...wO]),LO=(e,t)=>{if(!(e=>{const t=e?.data?.caseInfo?.settings?.autoSave;if(null!=t)return Boolean(t);const n=e?.containerItemID??e?.context;if(n){const e=eC("caseInfo.settings.autoSave",null,n);if(null!=e)return Boolean(e)}return!1})(t))return!1;const n=t.containerItemID||e,r=t.target||sE(n),a=vI(r,n),s=t.resourceType||a?.resourceType,o=t.key||a?.key;return s===Fr.RESOURCE_TYPES.ASSIGNMENT&&Boolean(o)},UO=(e,t,n)=>{e===Oa||e===ka||e===Fa&&t.data?(Xy(n)&&Zy(n),e===ka&&eI(n),LO(n,t)&&((e,t)=>{0===Fy.size&&"undefined"!=typeof document&&(document.addEventListener("pointerdown",Ky,{passive:!0}),document.addEventListener("keydown",Qy,{passive:!0}),document.addEventListener("input",Jy,{capture:!0,passive:!0})),Fy.set(e,t)})(n,{containerName:t.containerName??""})):e===Da&&(Xy(n)&&Zy(n),eI(n))},FO=(e,t)=>{if(e!==Da||!t.includes(Fr.MODAL))return;const n=Qr(t),r=`${n}/`;for(const e of Gy)(e===n||e.startsWith(r))&&rI(e)},jO=(e,t,n)=>{e!==fa?e!==Ns?wO.includes(e)&&tI(n):(e=>{tI(e),Gy.add(e)})(n):t.autosave||tI(n)},kO=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t&&"string"==typeof t.type&&MO.has(t.type)&&("object"==typeof(n=t.payload)&&null!==n)){const{type:e,payload:n}=t,r=((e,t)=>e===Ea?t.saveActionPayload?.containerItemID:e===Aa?t.saveContainerItemID??t.context:t.containerItemID??t.context)(e,n);r&&(FO(e,r),UO(e,n,r),Xy(r)&&(((e,t)=>{if(t.context)e===ea?(sp(t.context,null),nI(t.context)):e!==hs||t?.isDefault||t?.skipDirtyValidation||nI(t.context)})(e,n),jO(e,n,r)))}var n;e(t)},VO=(()=>{const e=new Eh;let t=null,n=null;const r=r=>(n=r,t=new Nh(e.asObservable(),r.getState()),n=>a=>{const s=n(a);var o;return t?.next(r.getState()),"object"==typeof(o=a)&&null!==o&&"type"in o&&"string"==typeof o.type&&e.next(a),s});return r.run=r=>{if(!t||!n)throw new Error("Epic middleware must be added to the store before calling run().");return r(e.asObservable(),t).subscribe((e=>{n?.dispatch(e)}))},r})(),BO=e=>{if(null!==KA())return void dC();const t=[CI.propertyChangeMiddleware,EO,NO,DO,VO,xO,kO,OO,bO],n=d_({reducer:K_(e),middleware:e=>e({serializableCheck:!1,thunk:!1}).concat(t),enhancers:e=>e().prepend(f_).concat(f_)});VO.run(IO),YA(n)},GO=["ar","arc","ckb","dv","fa","ha","he","khw","ks","ps","ur","yi"],WO=e=>GO.includes(e.split("-")[0])?"rtl":"ltr";const HO=async function(e){if(!e)return;const t=LE.getLocale();LE.setLocale(e);const n=LE.getLocale();if(n&&n!==t){if(xS(["lang"]),"undefined"!=typeof window){const e=new URL(window.location.href);e.searchParams.set("lang",n),window.history.replaceState(window.history.state,"",e.toString())}LE.isInfinityRuntime()&&await ME.loadLocaleBundle([n]),await FE(n),"undefined"!=typeof document&&(document.documentElement.lang=n,document.documentElement.dir=WO(n)),QA({type:ms,payload:{locale:n}}),$d.publish(Fr.PUB_SUB_EVENTS.EVENT_LOCALE_CHANGED,{locale:n,previousLocale:t})}};class qO{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,r,a)=>{QA({type:"LIST_ACTION",payload:{instruction:e,context:t,referenceList:r,listIndex:n,content:a,skipDirtyValidation:!0}})};static handleCaseCollaboratorsUpdate(e,t){const n=t?.message??{},[r,a]=Object.entries(n)[0];if(r===LE.getOperatorIdentifier())return;const s={ID:r,state:a},o=eC(Fr.CASE_INFO.CASE_INFO_COLLABORATORS,"",e)||[],i=o.findIndex((e=>e.ID===r));if(-1!==i)"closed"===a?this.dispatchCollaboratorAction("DELETE",e,i,Fr.CASE_INFO.CASE_INFO_COLLABORATORS,null):this.dispatchCollaboratorAction("REPLACE",e,null,`${Fr.CASE_INFO.CASE_INFO_COLLABORATORS}[${i}]`,s);else{if("closed"===a)return;this.dispatchCollaboratorAction("INSERT",e,o.length,Fr.CASE_INFO.CASE_INFO_COLLABORATORS,s)}}static subscribeToCollaborators(e,t){const n=gg.subscribe({matcher:"CASE_COLLABORATOR",criteria:{caseId:e}},(e=>this.handleCaseCollaboratorsUpdate(t,e)));this.caseCollabSubIds[e]=n}static unsubscribeToCollaborators(e){gg.unsubscribe(this.caseCollabSubIds[e]),delete this.caseCollabSubIds[e]}static publishCaseEvent(e,t){gg.publishMessage({filter:{matcher:"CASE_COLLABORATOR",criteria:{caseId:t}},message:e})}static subscribeToEvent(e,t,n){let r=null;if(e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN||e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE?r=e=>this.publishCaseEvent(t,e):e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?r=e=>{const{caseId:t,context:n}=e;this.caseCollabSubIds[t]||this.subscribeToCollaborators(t,n)}:e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD&&(r=e=>{const{caseId:t}=e;this.caseCollabSubIds[t]&&this.unsubscribeToCollaborators(t)}),!r)throw new Error(`Unhandled eventKey: ${e}`);$d.subscribe(e,r,n)}static unsubscribeFromEvent(e,t){$d.unsubscribe(e,t)}static subscribeToCaseEvents(){qO.collabConfig?.appEnabled&&qO.collabConfig?.portalEnabled&&(this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,this.VIEW_OPEN,"case_view_open"),this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,this.VIEW_CLOSE,"case_view_close"),this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,this.EDIT_OPEN,"case_edit_open"),this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,this.EDIT_CLOSE,"case_edit_close"))}static unsubscribeToCaseEvents(){qO.collabConfig?.appEnabled&&qO.collabConfig?.portalEnabled&&(this.unsubscribeFromEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_view_open"),this.unsubscribeFromEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_view_close"),this.unsubscribeFromEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,"case_edit_open"),this.unsubscribeFromEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,"case_edit_close"))}}const zO=qO;const YO=new class{#C(e,t,n,r,a){let s=!1;return e.IncludeInURL&&void 0!==t&&(r[e.Key]=t,"portal"===e.Key&&t!==n&&(s=!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}`)})),s}#S(e,t,n){const r={},a={};let s=!1;return Array.isArray(e)&&e.forEach((e=>{const o=t[e.Key];this.#C(e,o,n,r,a)&&(s=!0)})),{urlParams:r,headerMap:a,isPortalChanged:s}}#N(e){const t=jp.getComponentCache("lastActionID");return pg.truncateNamespace(e)===pg.truncateNamespace("string"==typeof t?t:(t??"").toString())}#_({message:e}){const{RequestContext:t,ActionName:n}=e;if(!this.#N(n))return;const r=JSON.parse(t),a=LE.environmentInfoObject?.requestContext,s=new URL(window.location.href).searchParams.get("portal"),{urlParams:o,headerMap:i,isPortalChanged:c}=this.#S(a,r,s);jp.setURLParams(o),Object.entries(i).forEach((([e,t])=>{Yd.registerHeader(e,t.join("; "))})),jp.setComponentCache("lastActionID",""),c&&globalThis.location.reload()}subscribeToGlobalEvents(){const e=hC.generateUniqueID(),t={matcher:"SWITCH_REQUEST_CONTEXT",criteria:{UserID:LE.getOperatorIdentifier()||""}};gg.subscribe(t,this.#_.bind(this),void 0,e)}},KO={publishConstellationLoadedEvent:()=>{$d.publish(Fr.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const QO=new class{activateContainerItemOnSwitch(e){const t=`${Fr.APP.APP}/${Fr.PRIMARY}`,n={target:t,containerItemID:LI(t,e)};Rf({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${Fr.APP.APP}/${Fr.PRIMARY}`,n={target:t,containerItemID:LI(t,e)};Rf({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=Rf({meta:{type:"PreviewViewContainer",config:{name:Fr.PREVIEW}},options:{context:Fr.APP.APP,target:"root/hybrid_preview"}});n.getPConnect().getContainerManager().resetContainers({name:Fr.PRIMARY,context:Fr.APP.APP}),jI(Fr.APP.APP,Fr.PREVIEW)||n.getPConnect().getContainerManager().initializeContainers({type:"multiple",name:Fr.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){Rf({}).getPConnect().getContainerManager().resetContainers({name:Fr.PREVIEW,context:Fr.APP.APP})}isFormDirty(e){const t=`${Fr.APP.APP}/${Fr.PRIMARY}`,n=bE(t,e);return jm.isStateModified(n)}getEventUtils(){return KO}getBroadcastUtils(){return ib}isTraditionalUICase(e){return Zf(e)}};const JO=class{static openCase(e,t=Ur.APP.APP,n={}){return n.renderInline=!0,n.pageName?(LE.setDefaultCasePage(Mr.getDefaultQualifiedName(n.pageName)),n.pageName=Mr.getDefaultQualifiedName(n.pageName)):(LE.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n.pageName=Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n?.disableAssignmentHeader?LE.disableAssignmentHeader(n.disableAssignmentHeader):LE.disableAssignmentHeader(!1),dg.openCase(e,t,Fr.PRIMARY,n)}static createCase(e,t=Ur.APP.APP,n={}){return n.renderInline=!0,n.pageName?(LE.setDefaultCasePage(Mr.getDefaultQualifiedName(n.pageName)),n.pageName=Mr.getDefaultQualifiedName(n.pageName)):(LE.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n.pageName=Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n?.disableAssignmentHeader?LE.disableAssignmentHeader(n.disableAssignmentHeader):LE.disableAssignmentHeader(!1),dg.createCase(e,t,Fr.PRIMARY,n)}static getNextWork(e=Ur.APP.APP,t={}){return t.renderInline=!0,t.pageName?(LE.setDefaultCasePage(Mr.getDefaultQualifiedName(t.pageName)),t.pageName=Mr.getDefaultQualifiedName(t.pageName)):(LE.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),t.pageName=Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),t?.disableAssignmentHeader?LE.disableAssignmentHeader(t.disableAssignmentHeader):LE.disableAssignmentHeader(!1),dg.getNextWork(e,Fr.PRIMARY,t)}static openAssignment(e,t=Ur.APP.APP,n={}){return n.renderInline=!0,n.pageName?(LE.setDefaultCasePage(Mr.getDefaultQualifiedName(n.pageName)),n.pageName=Mr.getDefaultQualifiedName(n.pageName)):(LE.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n.pageName=Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n?.disableAssignmentHeader?LE.disableAssignmentHeader(n.disableAssignmentHeader):LE.disableAssignmentHeader(!1),dg.openAssignment(e,t,Fr.PRIMARY,n)}static openPage(e,t,n=Ur.APP.APP,r={}){const a=na;r?.defaultCasePage?(LE.setDefaultCasePage(Mr.getDefaultQualifiedName(r.defaultCasePage)),r.defaultCasePage=Mr.getDefaultQualifiedName(r.defaultCasePage)):LE.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),r?.disableAssignmentHeader?LE.disableAssignmentHeader(r.disableAssignmentHeader):LE.disableAssignmentHeader(!1);const s={viewName:e,className:t,acTargetName:Fr.PRIMARY,actionMgrID:Vp.getNextActionMgrId(),context:n},{promise:o}=Vp.actionManagerPromise(a,s.actionMgrID);return QA({type:a,payload:{...s}}),o}static getCurrentContextAPI(e,t=Ur.APP.APP){return Rf({meta:{config:{}},options:{context:t,pageReference:e,containerName:Fr.PRIMARY}}).getPConnect()}};function XO(e){if(!e||"*"===e||"null"===e)return"";try{const t=new URL(e);return"https:"!==t.protocol&&"http:"!==t.protocol||"null"===t.origin?"":t.origin}catch{return""}}function ZO(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 eD=new class{gadgetName="";resize=!1;parentOrigin="";boundOnMessage=this.onMessage.bind(this);init(e){if("undefined"==typeof window)return;const{resizing:t,parentOrigin:n}=e;this.gadgetName=window.name,this.resize="stretch"===t,this.parentOrigin="",n?this.parentOrigin=XO(n):document.referrer?this.parentOrigin=XO(document.referrer):this.parentOrigin=XO(function(){try{const{ancestorOrigins:e}=window.location;if(e&&e.length>0)return e[0]??""}catch{}return""}());const r=document.getElementsByTagName("app-root")[0];r.classList.add("mashup"),window.parent!==window&&this.resize&&this._registerResizeObserver(r)}send(e){const{action:t,message:n}=e,r=JSON.stringify({gadgetName:this.gadgetName,action:t,message:n});window.parent.postMessage(r,this.parentOrigin||window.location.origin)}_registerResizeObserver(e){new ResizeObserver((e=>{for(const t of e){const e=ZO(t);this.send({action:"resize",message:e})}})).observe(e)}_updateUrl(e){window.history.pushState({},"home",e),PCore.configureForBrowserBookmark({semanticURL:"",context:Fr.APP.ROOT,acName:"primary"})}onMessage(e){if(!this.parentOrigin||e.origin!==this.parentOrigin)return!1;if("string"!=typeof e.data)return!1;let t;try{t=JSON.parse(e.data)}catch{return!1}return"UpdateUrl"===t.action&&this._updateUrl(t.message.url),!0}getMessageHandler(){return this.boundOnMessage}};"undefined"!=typeof window&&window.addEventListener("message",eD.getMessageHandler(),!1);const tD={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},nD={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary",contextName:"app"},children:[]}]},rD="portal-less-styles";const aD=new class{createC11nEnv=e=>Rf(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>Co;getStateManager=()=>d;getActionCreators=()=>u;getStreamObservable=()=>s;getActionProcessor=()=>AC;getActionHandler=()=>EC;renderApp=(e,t)=>{const n={context:Fr.APP.APP},r={...hC.getIn(e,Fr.ROOT),options:n};BO(e),up(e,n,!0);const a=this.createC11nEnv({meta:r,isRoot:!0});$d.publish(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:a,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const{data:r,uiResources:a={}}=e,{root:s}=a,o=hC.getIn(a,Fr.CONTEXT_DATA),i=ff(e);await mm(i,{},{},!1,!0);const c={...r,[Fr.CONTEXT_DATA]:o};iE(s,t,c,n)};fetchEndPointResource=(e,t,n)=>{au(e,{method:"GET"},Fr.APP.ROOT).then((e=>{200===e.status&&this.updateStoreWithUiRoot(e.data,t,n)}))};loadComponent=async(e,t,n)=>{await $p(n);const r=this.createC11nEnv({meta:e,isRoot:!0});KA()||BO({}),$d.publish(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:r,domContainerID:t})};setStaticServerUrl=(e,t,n)=>{Dp.initServer(e,t,n)};loadView=async(e,t,n=[])=>{nn();const r=ff(e),a=hC.getIn(r,Fr.VIEWS),s=hC.getIn(r,Fr.NAVIGATIONS),o=hC.getIn(r,Fr.COMPONENTS)||[];o.push(...n);const i=hC.getIn(r,Fr.STATIC_SERVER_URL),c=hC.getIn(r,Fr.APPLICATION_DATA);a&&EA(a),s&&NA(s),(e=>{e&&(dS=e.pyLabel)})(c),i&&Dp.initServer(i),await $p(o,i),this.renderApp(r,t)};initAppShell=(e,t,n)=>{RS(e),Gp.buildActionTargetMap(t),nn(n)};initRoutingTable=(e,t)=>{RS(e,!0),nn(t)};setAppAlias=e=>{Dp.setAppAlias(e)};getHomeRestApi=e=>{const t=an(),{restApi:n}=fS("home",{portalName:e});return`${t}${n}`};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(DS()&&!t){const t=vE(),r=wE.processUrl(t,!0),a=wE._getMatchedRouteInRoutingTable(r)||"",s=wE.getRoutingInfo(),o=wE.processUrl(t,!1).split("/"),i=o[o.length-1],c=s?.routes?.[a]?.payload?.caseID?.replace("{workID}",i).replace("{id}",i);n=wE.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=wE.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return an()+n};loadRootComponent=async(e,t,n=[],r,a,s)=>{const{config:o}=t||{},i=o?.name;if(KA()||BO({}),s){const e=`${Fr.APP.ROOT}/${i}`;EE(e),IE().deleteContainerItem(e)}(IE().getContainerItems()||[]).length>1&&!i?.startsWith("hybrid_")&&"authoring-preview"!==i&&dC(),QA(_C({data:{},context:Fr.APP.ROOT}));const c=this.createC11nEnv({meta:t,options:{context:Fr.APP.ROOT,pageReference:"",target:`${Fr.APP.ROOT}/${i}`}}),l=c.getPConnect(),d=`${l.getContextName()}/${l.getContainerName()}`;VI(d)||"noPortal"===o?.renderingMode||l.getContainerManager().initializeContainers({type:"single"});const u=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference","URL",...n];await $p(u),$d.publish(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:c,domContainerID:e,componentName:"RootContainer",portalTarget:r,styleSheetTarget:a})};loadViewByName=(e,t,n,r)=>{let a=this.getViewRestApi(e,n);a===an()&&(a=this.getHomeRestApi(t)),this.fetchEndPointResource(a,r)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{vS(e)};checkIfSemanticURL=()=>DS();onPCoreReady=e=>{$d.subscribe(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{$d.subscribe(Ur.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{Wu.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{on(e)};setFetchDefaultHeaders=e=>{lu(e)};setFetchAuthInfo=e=>{du(e)};getCaseApi=()=>dg;getMashupApi=()=>JO;enableAppRouting=e=>{pS(e)};initStore=()=>BO({});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 r=n?`?dataViewParameters=${encodeURIComponent(JSON.stringify({themeID:n}))}`:"";return au(`${e}/api/application/v2/data_views/D_pxBootstrapConfig${r}`,{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=Rf({meta:tD,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(rD)){const e=document.createElement("style");e.id=rD,e.textContent="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",n.appendChild(e)}}await this.loadRootComponent(e,tD,[Fr.LOAD_VIEW_STRING,"ViewContainer"]),globalThis.parent!==globalThis&&eD.init({resizing:"stretch"})};bootstrapWithAuthHeader=async(e,t,n=[],r,a)=>{const{customRendering:s=!1,onPCoreReadyCallback:o,staticContentServerUrl:i,dynamicSetCookie:c=!1,renderingMode:l,locale:d,envType:u,themeID:p,customCookies:h,enableRouting:g}=e;let{restServerUrl:f,authInfo:m,authorizationHeader:y,appAlias:I,theme:E={}}=e,A=e.additionalHeaders?{...e.additionalHeaders}:{},C=null;const S=!y&&m&&!m.authType;if(m||(e.authInfo={},m=e.authInfo),(y&&0===Object.keys(m).length||h)&&(S||(m.authType="custom"),m.customCookies=h),!y&&m.tokenInfo?.access_token){const{tokenInfo:e}=m;y=`${e.token_type} ${e.access_token}`}if(m.tokenInfo?.csrf&&(A={...A,pzCTkn:m.tokenInfo.csrf}),I&&-1===I.indexOf("/")&&(I=`app/${I}`),"LAUNCHPAD"===u){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}`,y,A,h)),0===Object.keys(E).length&&C?.theme?.definition&&(E=JSON.parse(C.theme.definition).Theme)}else C=S?await this.preInitBootstrapConfig(e,I,A,p):await this.getBootstrapConfigExtended(I?`${f}/${I}`:`${f}`,y,A,p,h,d);const N=C?.pyConfigJSON?JSON.parse(C.pyConfigJSON):{...C};"LAUNCHPAD"===u&&await this.applyEnvironmentInfoResponse(N),N.restServerConfig=f,N.dynamicSemanticUrl=!1,N.dynamicSetCookie=c,N.enableRouting=!1,N.serviceConfig?Object.assign(N.serviceConfig,{contextPath:"",appAlias:I}):N.serviceConfig={contextPath:"",appAlias:I,staticContentServer:i,appStaticContentServer:"no-appstatic"},N.additionalHeaders={Authorization:y,...A},N.envType=u,N.dynamicLoadComponents=!s,N.dynamicSemanticUrl=!s,N.noHistory=!0,N.theme=E??{};const _=p&&N?.themeObject?N.themeObject:null;N.theme=_||E,N.renderingMode=l??N.renderingMode,N.locale=d||N.locale,e.semanticUrlArgs&&(N.semanticUrlArgs=e.semanticUrlArgs);const b=i||N.serviceConfig.staticContentServer;if(N.isSdk?(N.enableRouting=g,N.dynamicSemanticUrl=N.enableRouting,Dp.initServer(i,"no-appstatic")):(N.serviceConfig.staticContentServer=b,N.serviceConfig.appStaticContentServer=N.serviceConfig.appStaticContentServer||"no-appstatic",Dp.initServer(b,b)),"EMBED"===N.renderingMode&&m?.authentication_service&&"pega"!==m.authentication_service&&(N.routingInfo||(N.routingInfo={}),N.routingInfo.authServiceAlias=m.authentication_service),await lD.initCoreConfig(N),o&&$d.subscribe(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,o,"renderAppCallback"),"LAUNCHPAD"===N.envType&&"EMBED"===N.renderingMode&&LE.setIsWebEmbed(!0),m&&["OAuth2.0","custom"].includes(m?.authType)&&this.setFetchAuthInfo(m),!s){const e=LE.environmentInfoObject?.pyInfinityStaticService;let s=null;if(e){const e=await mg.getDataAsync("D_pxGetComponentLibraryListAndMap","",{});Array.isArray(e.data)&&e.data.length>0&&(s=e.data)}const o=new Promise((async(e,t)=>{try{const t=async()=>{await this.importReactRoot(),e(!0)};$d.subscribe("component-map-loaded",t),"ReactRoot"in Co.getLazyMap()&&e(!0)}catch(e){t(e)}}));await o,lD.initCoreContainers(),await this.loadRootContainerWithHybrid(t,n,r,a),s&&await Promise.all(s.map((({pyComponentMap:e,pxUpdateDateTime:t})=>Dp.importCustomComponentMap(e,t))))}};loadRootContainerWithHybrid=(e,t=[],n,r)=>(t.push(Fr.CONTAINER_TYPE?.HYBRID||"HybridViewContainer",Fr.LOAD_VIEW_STRING),this.loadRootComponent(e,nD,t,n,r));getBootstrapConfigExtended=async(e,t,n,r,a,s)=>{const o={};r&&(o.themeID=r),s&&(o.locale=s);const i=`${e}/api/application/v2/data_views/D_pxBootstrapConfig${r||s?`?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,r)=>{const a=new Headers({...n,...t&&{Authorization:t}}),s=await fetch(e,{method:"GET",headers:a,credentials:t&&!r?"same-origin":"include"});if(!s.ok)throw new Error("environmentInfo load failed.",{cause:s.status});return s.json()};applyEnvironmentInfoResponse=async e=>{const{environmentInfo:t,pyCaseTypeList:n,theme:r,keyMapping:a}=e,{pxApplication:s,features:o,pxLocale:i}=t,c={simpleTable:{pageInstructionUUIDGeneration:!1},...o},l=Intl.DateTimeFormat().resolvedOptions().timeZone.toUpperCase(),d="ETC/UNKNOWN"===l?"America/New_York":l;e.environmentInfo={...t,pxApplication:{...s},features:c,pyCaseTypeList:n,pxLocale:{...i,pyTimeZone:d}},e.timezone=d;const u=Object.keys(e.environmentInfo);return{isEnvInfoValid:["pxOperator","pxLocale","pxApplication"].every((e=>u.includes(e))),theme:r,keyMapping:a,features:c}};importReactRoot=async()=>{const e=[];return Co.getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};preInitBootstrapConfig=async(e,t,n,r)=>{const{restServerUrl:a,customRendering:s=!1,staticContentServerUrl:o,dynamicSetCookie:i=!1,authInfo:c,renderingMode:l,locale:d,timezone:u="America/New_York",envType:p,theme:h={}}=e,g=r??null,f={restServerUrl:a,restServerConfig:a,dynamicSetCookie:i,enableRouting:!1,serviceConfig:{contextPath:"",appAlias:t,staticContentServer:o,appStaticContentServer:"no-appstatic"},additionalHeaders:{...n},envType:p,dynamicLoadComponents:!s,dynamicSemanticUrl:!s,noHistory:!0,themeIDObj:g,theme:g||h,renderingMode:l,locale:d,timezone:u,tokens:{C11NB2S:""}};return Dp.initServer(o,"no-appstatic"),await lD.init(f),c&&["OAuth2.0","custom"].includes(c?.authType)&&this.setFetchAuthInfo(c),this.getBootstrapConfigViaSB(t?`${a}/${t}`:`${a}`,n,r)}};const sD=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 oD=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 sD(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false",this.enablePriorityAndUrgencyImprovements=e.enablePriorityAndUrgencyImprovements??!1,this.storePercentageAsDecimal=e.storeC11nPercentageAsDecimal??!1,this.collab=e.collab,this.requestContext=e.requestContext,this.pzencv1zzz=e.pzencv1zzz}},iD="@P .viewConfig";let cD=0;const lD=new class{async init(e){const t=new oD(e);pS(t.enableRouting),BO({}),Wu.updateFieldDefaults(t.fieldDefaults),Wu.setFieldDefault("Percentage","storePercentageAsDecimal",t.storePercentageAsDecimal),this.#b(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl});const{appAliasWithoutServlet:n,appAlias:r,googleMapKey:a,staticContentServer:s,appStaticContentServer:o}=t.serviceConfig;Dp.setAppAlias(n||r),on(a),Dp.initServer(s,o,t.tokens.C11NB2S),Vr.setRemoteCaseMapping(t.remoteCaseMapping),zO.init(t.collab),zO.subscribeToCaseEvents(),pg.subscribeToCaseEvents(),gg.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),t.initBroadcast&&QO.getBroadcastUtils().init(),Yd.setDefaultHeaders(t.additionalHeaders),Yd.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=uf(lf,t))})),i.features?.isNamespaceEnabled&&(t.additionalHeaders.Prefer="namespaced",Yd.setDefaultHeaders(t.additionalHeaders)),t.theme){const e=t.theme,n=e.light,r=e.dark;void 0!==n&&void 0!==r?(this.#T(n),this.#T(r,{type:"dark"})):LE.setTheme(e)}LE.setCookieComplianceMethod(t.cookieComplianceMethod),LE.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),LE.setEnablePriorityAndUrgencyImprovements(t.enablePriorityAndUrgencyImprovements),LE.setEnvironmentInfo(i);const c=new URLSearchParams(window.location.search).get("lang")||t.locale||navigator.language||"en-US";LE.setLocale(c),document.documentElement.lang=c,document.documentElement.dir=WO(c),VE().setTimezone(t.timezone),jp.init(),"Infinity"!==t.envType&&YO.subscribeToGlobalEvents(),t.initBroadcast&&QO.getBroadcastUtils().init(),await FE()}getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`,r=`${e}/api/application/v2/data_views/${Mr.getDefaultQualifiedName("D_pxBootstrapConfig")}`;return(await fetch(r,{method:"GET",headers:new Headers({Authorization:n})})).json()};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=Rf({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 aD.getComponentsRegistry().getComponent("ReactRoot")?.modules?.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{_p(e)}catch(e){return void console.error("Design system load blocked: untrusted or malformed URL",e)}try{await((e,t="true")=>new Promise(((n,r)=>{if("undefined"==typeof document)return void r(new Error("document is not available in this environment"));const a=document.createElement("script");a.type="text/javascript",a.src=e,a.async="true"===t,a.onload=()=>n(void 0),a.onerror=()=>r(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,r,a)=>{const s=new URLSearchParams(t),o="true"===n&&!!e,i=new URLSearchParams(window.location.search).get("lang");i&&!s.has("lang")&&s.set("lang",i);let c=null,l=null,d=null;if(e){const t=(e.startsWith("/")?e.substring(1):e).split("/");c=t[0]||null,l=t[1]||null,"assignments"===t[2]&&t[3]&&(d=t[3])}const u=[r];c&&u.push(c),l&&u.push(l),d&&u.push("assignments",d),o&&(s.has("noPortal")||s.append("noPortal","true"),l&&a&&s.append("view",a));const p=s.toString();return u.join("/")+(p?`?${p}`:"")};initCoreConfig=async e=>{const{routingInfo:t,serviceConfig:n,semanticUrl:r,queryParams:a,noPortal:s,noHistory:o,viewName:i,theme:c,restServerConfig:l,dynamicLoadComponents:d=!0,dynamicSemanticUrl:u=!0,renderingMode:p="FULL_PORTAL",envType:h,extras:g}=e,{appAlias:f,contextPath:m}=n,y=window.location,I=y.origin;let E=l??I;const A={};if(m&&(E+=m),f&&"LAUNCHPAD"!==h&&(E+=`/${f}`),e.restServerConfig=E,this.#P(),!0===u){const e=this.buildSemanticUrl(r,a,s,E,i);!o&&e&&"undefined"!=typeof window&&window.history.replaceState({},"home",e)}else if("HYBRID"!==p){const e=y.href,t=e.indexOf("?");t>0&&"undefined"!=typeof window&&window.history.pushState({},"home",e.substring(0,t)),A.dynamicSemanticUrl=!1}else console.log(`renderingMode :${p}`);!0!==d&&(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=y?`${y.protocol}//${y.host}`:t.domain;if("EMBED"===p)try{S=new URL(e.restServerConfig).origin}catch{}const N={...t,domain:S,searchParams:y?y.search:"",embedQueryParams:e.semanticUrlArgs};e.routingInfo=N,e.initBroadcast="true"===LE.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),g?.cspNonce&&(window.__webpack_nonce__=g.cspNonce),LE.setCaseLabelFirstInTitle(e.extras?.useDefaultBrowserTabTitle??!0),await this.init(e)};launchViewByName=async(e,t,n,r,a,s,o,i,c=[])=>{cD+=1;const l=i||`mashup${cD}`,d={type:"RootContainer",config:{viewConfig:iD,renderingMode:"view",name:l}};await aD.loadRootComponent(e,d,a,s,o),await this.loadCustomComponentLibrariesIfEnabled(c),aD.loadViewByName(t,n,r,l)};launchView=(e,t,n=[],r,a,s,o)=>{let i;cD+=1,i="hybrid"===o?`hybrid_${cD}`:o||`mashup${cD}`;const c={type:"RootContainer",config:{viewConfig:iD,renderingMode:"portal",name:i}};o===Fr.HYBRID&&Mg.setRuntimeParam(Fr.HYRBID_ROOT_CONTAINERNAME,i),Mg.setRuntimeParams(r),aD.loadRootComponent(e,c,n,a,s).then((()=>aD.updateStoreWithUiRoot(t,i,!1)))};launchPortal=async(e,t,n=`portal${cD+=1}`,r=[],a=[])=>{const s="LoadingComponent",o={type:"RootContainer",config:{viewConfig:iD,renderingMode:"portal",skeleton:s,name:n}},i=[...r,s];LE.isPortalLoaded=!0;try{return await aD.loadRootComponent(e,o,i),await this.loadCustomComponentLibrariesIfEnabled(a),aD.loadPortalView(t,n)}catch(e){throw console.error(`Failed to launch portal ${t}:`,e),e}};launchMashup=(e,t=!0,r=[])=>{const a={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 aD.loadRootComponent(e,a,[Fr.LOAD_VIEW_STRING,"ViewContainer"]),await this.loadCustomComponentLibrariesIfEnabled(r)})(),window.parent!==window){const e=Dp.getStaticServerUrl();n(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)}))}),Fr.PRIORITY.TRIVIAL)}};loadDataPagesIntoEnvironmentInfo=async e=>{if(!e?.length)return;const t=LE.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 r=await Promise.allSettled(n.map((async({pyName:e,pyPath:t})=>{try{return{pyPath:t,response:await mg.getPageDataAsync(e,"",{})}}catch(t){return console.error(`Failed to load data page ${e}:`,t),null}}))),a=r.length;let s=!1;for(let e=0;e<a;e+=1){const n=r[e];if("fulfilled"===n.status&&n.value){const{pyPath:e,response:r}=n.value;this.setNestedProperty(t,e,r),s=!0}}s&&LE.setEnvironmentInfo(t)};#O(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}setNestedProperty(e,t,n){const r=t.startsWith(".")?t.slice(1):t;if(!r)return void("object"==typeof n&&null!==n&&Object.assign(e,n));const a=r.split("."),s=a.length;let o=e;for(let e=0;e<s-1;e+=1){const t=a[e],n=o[t];if(this.#O(n))o=n;else{const e={};o[t]=e,o=e}}o[a[s-1]]=n}start=async(e,t)=>{const{serviceConfig:{appStaticContentServer:n},ccV2LibId:r,environmentId:a,isAlternateDesignSystemEnabled:s,alternateDesignSystemName:o}=e;await this.initCoreConfig(e);const i=LE.environmentInfoObject?.pyC11nDXCBDevURL,c="true"===s&&"other"!==o,l=async()=>{await this.importReactRoot();const e=[];i?e.push(Dp.importCustomComponentMap("")):r&&e.push(Dp.importCustomComponentMap(r)),c&&e.push(this.importDesignSystemComponentMap(n,a,o)),e.length&&await Promise.all(e),t?.()},d=aD.getComponentsRegistry();if("ReactRoot"in d.getLazyMap())return!0;return d.getComponent("ReactRoot")?(await l(),!0):new Promise((e=>{$d.subscribeOnce("component-map-loaded",(async()=>{await l(),$d.unsubscribe("component-map-loaded","component-map-loaded-id"),e(!0)}),"component-map-loaded-id")}))};registerForDebugInfo=e=>{if(LE.setPreviewMode(),!e)return;const t=({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];n&&e.postMessage({appDebugID:n})};$d.subscribe("fetchSuccess",t,"fetchSuccess"),$d.subscribe("fetchFailure",t,"fetchFailure")};toggleTracerHeaders=e=>{e.addEventListener("message",(e=>{const t=e?.data?.enableTracer;t?wd.enableTracer():wd.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,r=t.Theme;LE.setBrandingInfo(n),LE.setTheme(r)}catch{LE.setBrandingInfo({}),LE.setTheme({})}if(e.darkTheme&&!t){const t={type:"dark"};try{const n=JSON.parse(e.darkTheme.definition);LE.setBrandingInfo(n.Branding,t),LE.setTheme(n.Theme,t)}catch{LE.setBrandingInfo({},t),LE.setTheme(void 0,t)}}e.keyMapping&&LE.setKeyMapping(e.keyMapping),LE.setCookieComplianceMethod(e.cookieComplianceMethod??"none")};async loadCustomComponentLibrariesIfEnabled(e){e?.length>0&&LE.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)}#b(e,t,n){RS(e),Gp.buildActionTargetMap(t),nn(n)}#P(){document.querySelectorAll('head link[rel~="icon"], head link[rel~="apple-touch-icon"]').forEach((e=>{e.setAttribute("href",e.href)}))}#T(e,t){if(null===e)return;if("object"==typeof e)return void LE.setTheme(e,t);let n;try{n=JSON.parse(e)}catch{return void LE.setTheme("dark"===t?.type?void 0:{},t)}LE.setTheme(n,t)}},dD={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=mS("createViewRuleByID");return au(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=mS("getViewRuleByID",{ID:e});return au(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:a}=mS("updateViewRuleByID",{ID:e});return au(r,{method:a,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=mS("deleteViewRuleByID",{ID:e});return au(n,{method:r},t).then((e=>e.data))},getCalculatedFields:(e,t,n)=>{const{restApi:r,reqType:a}=mS("getCalculatedFieldsInViewByID",{caseID:e,viewID:t});return au(r,{method:a,body:{calculations:{fields:n}}}).then((e=>e.data))}},uD={"Content-Type":"application/json"},pD={addCaseFollower:(e,t,n)=>{const r={caseID:e},a=JSON.stringify({users:t.map((e=>({ID:e})))});return fp("addCaseFollower",{body:a,queryPayload:r,headers:uD},n)},deleteCaseFollower:(e,t,n)=>fp("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>fp("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},hD={addRelatedCases:(e,t,n)=>{const r={caseID:e},a=JSON.stringify({cases:t});return fp("addRelatedCases",{body:a,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>fp("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>fp("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},gD="operatorDetails",fD={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=mS(gD,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return fp(gD,{queryPayload:t})}return t?fp("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):fp(gD,{body:{dataViewParameters:{ID:e}}})}},mD="postCustomFeedMessages",yD={"Content-Type":"application/json"};const ID=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,a,s,o)=>{const i=s.getLocalizationService();o||(this.mentions=[]);let c="";r&&Array.isArray(r)&&r?.length>0&&(r.forEach((e=>{e.on&&(c=`${c}${e.id},`)})),""===c&&(c="ClearFilters"));let l="";o&&(l=s.getValue("pulse.pageLastEntry"));const d={filterForContext:"pyDataFeed"===t?encodeURIComponent(e):e,feedID:t,feedClass:n,filterBy:c,pageSize:10,olderThan:l};for(let e=0;e<a.length;e+=1)a[e].cancel();const u=Ip();return a.push(u),fp("getFeedMessages",{queryPayload:d,cancelTokenSource:u},s.getContextName()).then((async t=>{if(200!==t.status||!t.data)return s.reportError(`getFeeds call failed ${t.status}`,t.data),{feedFilters:[],caseMentions:[]};{a.pop();const n=[],c={};let l=!1,d=[];if(t?.data){if(d=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 mf({uiResources:t.data.uiResources}),!r&&(r=[{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),r.push(t)}));const t=r.find((e=>"All"===e.id));t&&(t.on=n)}}}if(o&&s.getValue("pulse.messageIDs")){let e=s.getValue("pulse.messages");e={...e,...c},Object.values(e).forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(...e.mentions)}))}))}if(MI(s.getContextName())){s.updateState({pulse:{messages:o&&s.getValue("pulse.messageIDs")?{...s.getValue("pulse.messages"),...c}:c,messageIDs:o&&s.getValue("pulse.messageIDs")?[...s.getValue("pulse.messageIDs"),...n]:n,nextPageFirstEntry:t?.data?.nextPageFirstEntry||"",pageLastEntry:t?.data?.pageLastEntry||"",hideAttachment:t?.data?.hideAttachment||!1,postTypes:d,pulseContext:e}});const a=[...new Map(this.mentions.flat()?.map((e=>[e.mentionsID,e]))).values()].filter((e=>Object.hasOwn(e,"mentionsType"))).filter((e=>!e?.mentionsType?.toLowerCase().includes("user")));return{feedFilters:r,caseMentions:a}}}})).catch((e=>{Ep(e)||s.reportError(": Error occurred during ajax call at getFeeds API : ",e.response)}))};postMessage=(e,t,n,r=[],a=!1,s=[])=>{const o={message:t,context:e,parentMessageId:a?e:"",attachments:r,pyRecipients:s.length?s:void 0},i=0===s.length?{body:JSON.stringify(o),headers:yD}:{body:JSON.stringify(o),queryPayload:{type:"PegaSocial-Post-Private"},headers:yD};return fp(s.length?mD:"postFeedMessages",i,n.getContextName()).then((t=>{if((201===t.status||200===t.status)&&t.data){const s=t?.data;if(a){s.parentMessageID=e;const{pxResults:t,caseMentions:o}=this.buildMessageObject(s,a,n,r.length>0);return n.updateState({pulse:{messages:{[e]:{pxResults:t}}}}),o}const{messages:o,messageIDs:i,caseMentions:c}=this.buildMessageObject(s,a,n,r.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)=>fp(mD,{body:t,queryPayload:{type:e},headers:yD},n.getContextName()).then((async e=>{if(201===e.status&&e.data){const r=e.data.data,a={ID:r.ID,pzInsKey:r.ID,classID:r.classID,pyPostType:r.pyPostType,postedByUser:r.postedByUser,pyIsDeleteEnabled:r.pyIsDeleteEnabled,pyMessageViewReference:r.messageViewReference,pyFeed:{pyIconType:"user",pyCommentContext:r.pyCommentContext,pyPostedOn:r.postedTime,pyFeedTitle:r.postedByUser.name,pyIconReference:r.postedByUser.ID},...r.PostMessage};yf(r.messageViewReference,n,t.context)||await mf({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:r,isReply:a=!1,recipients:s=[]})=>{const o=JSON.stringify({message:n,...s.length&&{pyRecipients:s}});return fp("editFeedMessage",{queryPayload:{messageID:e},body:o,headers:yD},r.getContextName()).then((e=>{if(200===e?.status&&e?.data){const n=e?.data;if(a){n.parentMessageID=t;const{pxResults:e,caseMentions:s}=this.buildMessageObject(n,a,r,!1);return r.updateState({pulse:{messages:{[t]:{pxResults:e}}}}),s}const{messages:s,caseMentions:o}=this.buildMessageObject(n,a,r,!1);return r.updateState({pulse:{messages:s}}),o}return r.reportError(`editMessage call failed with status ${e.status}`,e),""})).catch((e=>{throw r.reportError(": Error occurred during ajax call at editMessage API : ",e.response),e.response}))};buildMessageObject=(e,t,n,r=!1)=>{const a={ID:e?.ID||"",classID:e?.classID||"PegaSocial-Message",tags:e?.tags||[],pyHasAttachment:r,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},s=n.getValue("pulse.messages");if(t){let{pxResults:e=[]}=Object.values(s)?.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)?{...s[a.ID],...a}:a,t={...s,[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:r,pConnectObj:a})=>{const s=t?"unlikeFeedMessages":"likeFeedMessages",o=JSON.stringify({ContextClass:e});fp(s,{body:o,queryPayload:{pulseContext:e},headers:yD},a.getContextName()).then((s=>{if(200===s.status)if(r){const r=a.getValue(`pulse.messages.${n}`),s=r?.pxResults&&Array.isArray(r?.pxResults)&&r.pxResults?.length>0&&r.pxResults?.map((n=>{if((n={...n}).pzInsKey===e){let e=0,r=!1;const a=n.pyLikes?n?.pyLikes?.pxLikeCount:0;t?(e=a-1,r=!1):(e=a+1,r=!0),n.pyLikes={pxLikeCount:e,pxIsLiked:r}}return n}));a.updateState({pulse:{messages:{[n]:{pxResults:s}}}})}else{const r={...a.getValue(`pulse.messages.${n}`)},s=r.pyLikes?r.pyLikes.pxLikeCount:0;let o=0,i=!1;t?(o=s-1,i=!1):(o=s+1,i=!0),r.pyLikes={pxLikeCount:o,pxIsLiked:i},a.updateState({pulse:{messages:{[e]:r}}})}else a.reportError(`likeMessage call failed with status ${s.status}`,s)})).catch((e=>{a.reportError(": Error occurred during ajax call at likeMessage API : ",e.response.data)}))};deleteMessage=(e,t,n,r)=>{let a=e;t&&(a=n);fp("deleteFeedMessage",{queryPayload:{messageID:a}},r.getContextName()).then((a=>{if(200===a.status)if(t){const t=r.getValue(`pulse.messages.${e}`),a=t?.pxResults&&Array.isArray(t?.pxResults)&&t.pxResults?.length>0&&t.pxResults?.filter((e=>e.pzInsKey!==n));r.updateState({pulse:{messages:{[e]:{pxResults:a}}}})}else{const t=r.getValue("pulse.messageIDs"),n=t&&Array.isArray(t)&&t?.length>0&&t?.filter((t=>t!==e)),a={...r.getValue("pulse.messages")};delete a[e],r.updateState({pulse:{messageIDs:n,messages:a}})}else r.reportError(`deleteMessage call failed with status ${a.status}`,a)})).catch((e=>{r.reportError(": Error occurred during ajax call at deleteMessage API : ",e.response)}))};getLikedUsers=(e,t)=>fp("getFeedMessageLikes",{queryPayload:{messageID:e}},t.getContextName());getMentionSuggestions=(e,t)=>{const{pulseContext:n,searchFor:r,mentionsType:a,listSize:s=5}=e,o={pulseContext:n,searchFor:r,mentionsType:a,listSize:s};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const i=Ip();return this.mentionsTagsCancelTokenSource.push(i),fp("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=>{Ep(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>fp("getMentionTypes",{},e.getContextName());getPostTypeView=(e,t)=>fp("getViewRuleByMessageType",{queryPayload:{type:e}},t.getContextName());getTagSuggestions=(e,t)=>{const{searchFor:n,listSize:r=5}=e,a={searchFor:n,listSize:r};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const s=Ip();return this.mentionsTagsCancelTokenSource.push(s),fp("getTagSuggestions",{queryPayload:a,cancelTokenSource:s},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=>{Ep(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},ED={getTaggedCases:(e,t)=>{const n={caseID:e,viewID:Mr.getDefaultQualifiedName("pyTaggedCases")};return fp("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)=>fp("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 r={caseID:e},a=JSON.stringify({tags:t});return fp("addTagsToCase",{body:a,queryPayload:r},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)=>fp("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=Mr.getDefaultQualifiedName("D_pxGetTagsLandingPageURL");return mg.getPageDataAsync(t,e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))}},AD=(e,t)=>{AE(t.getContextName(),e.etag),CE(t.getContextName(),e.etag)},CD={getParticipants:(e,t)=>fp("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)=>fp("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)=>fp("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)=>fp("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,r,a)=>{const s={caseID:e},o={...n,participantRoleID:t},i={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{fp("createParticipant",{body:o,queryPayload:s,headers:i},r.getContextName()).then((t=>{AD(t.headers,r),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=ey(a||r.getContextName());r.reportError(": Error occurred during ajax call at createParticipant API : ",{...e.response.data,formFields:n},a),t(e.response)}))}))},updateParticipant:async(e,t,n,r,a)=>{const s={caseID:e,participantID:t},o={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{fp("updateParticipant",{body:n,queryPayload:s,headers:o},r.getContextName()).then((t=>{AD(t.headers,r),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=ey(a||r.getContextName());r.reportError(": Error occurred during ajax call at updateParticipant API : ",{...e.response.data,formFields:n},a),t(e.response)}))}))},deleteParticipant:(e,t,n)=>{const r={caseID:e,participantID:t},a={"if-match":n.getCaseSummary().headers.etag};return new Promise(((e,t)=>{fp("deleteParticipant",{queryPayload:r,headers:a},n.getContextName()).then((t=>{AD(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function SD(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const ND="create",_D="update",bD="delete";function TD(e,t,n,r){const a=DA(t);if(a){switch(e){case ND:case _D:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(a.allPersonalizations[n]=t),e&&(a.defaultPersonalization=n);break}case bD:delete a.allPersonalizations[n],a.defaultPersonalization===n&&(a.defaultPersonalization="");break;default:return null}return a}return null}const PD={},OD=async e=>{const t=DA(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=SD(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=mS("getUIListPersonalizations",{listID:e});return au(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:SD(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},DD=async(e,t,n)=>{const{restApi:r,reqType:a}=mS("createListPersonalization",{listID:e});return TD(ND,e,t,n),au(r,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return PD[t]=n,e}))},vD=async(e,t,n)=>{const r=PD[t]||t;TD(_D,e,t,n);const{restApi:a,reqType:s}=mS("updateListPersonalization",{listID:e,personalizationID:r})||{};return au(a,{method:s,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},RD=async(e,t)=>{const n=PD[t]||t;TD(bD,e,t);const{restApi:r,reqType:a}=mS("deleteListPersonalization",{listID:e,personalizationID:n});return au(r,{method:a,body:{}}).then((e=>(PD[t]&&delete PD[t],e)))};const $D=function(e){return e?{createPersonalization:DD.bind(null,e),updatePersonalization:vD.bind(null,e),deletePersonalization:RD.bind(null,e),fetchPersonalizations:OD.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},xD="undefined"!=typeof window?window.sessionStorage:{getItem:()=>null,setItem:()=>{}},wD="getDataObjects",MD="getInsightByID",LD=["LocalList","RemoteList","PromptList","DataPage"];let UD=null;const FD=[];const jD={},kD=e=>Lh.getAppCacheKey(`PrimaryFields-${e}`);function VD(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 BD(e){return"object"==typeof e&&null!==e}function GD(e){return{...e[1],fieldID:e[0],fieldType:e[1].fieldType||(e[1].isUserReference?"User reference":void 0),category:VD(e),classID:e[1].associationClassID?e[1].associationClassID:e[1].classID}}function WD({data:e}){const t=(e,t)=>uf("FIELD",e,t),n="string"==typeof e.classID?e.classID:"",r=uf("CASE",n);e.classNameLocaleReference=r;const a=Array.isArray(e.fields)?e.fields:[];for(let e=0;e<a.length;e+=1){const n=a[e];if(BD(n)){const e={nameLocaleReference:"INSIGHTS",categoryLocaleReference:"INSIGHTS",parentCategoryLocaleReference:"INSIGHTS"},a=n.definedOnClassIDs;if("string"==typeof a){const s=a.split(":").reverse(),o="string"==typeof n.fieldID?n.fieldID:"",i=o.split("!").pop()?.split(":").reverse()||[];s[0]&&i[0]&&(e.nameLocaleReference=t(i[0],s[0])),s[1]&&i[1]&&(e.categoryLocaleReference=t(i[1],s[1])),s[2]&&i[2]?e.parentCategoryLocaleReference=t(i[2],s[2]):n.parentCategory&&(e.parentCategoryLocaleReference=r)}Object.assign(n,e)}}return{data:e}}const HD={getDataObjects:function(){const e=Lh.getAppCacheKey(wD);if(xD.getItem(e))return Promise.resolve(JSON.parse(`${xD.getItem(e)}`));const{restApi:t,reqType:n}=mS(wD,{}),r=au(t,{method:n});return r.then((t=>{xD.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(UD)return UD;const t=Lh.getAppCacheKey("getDataPageObjects");if(e&&xD.getItem(t))return Promise.resolve(JSON.parse(`${xD.getItem(t)}`));const{restApi:n,reqType:r}=mS("getDataPages",{datapageRequestType:"explorable"});return UD=au(n,{method:r,datapageRequestType:"explorable"}),UD.then((e=>{UD=null,xD.setItem(t,JSON.stringify(e))})),UD},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=OA(e);if(t&&t.classID){let e=RA(t.classID);const n=t.rdFields,r=(n&&!Array.isArray(n)?n.fields:void 0)?.filter((e=>e.indexOf(".")>0));if(r&&!hC.isEmpty(r)){const n=r.reduce(((e,n)=>{const r=IA(n,t.classID);var a;return r&&"type"in(a=r)&&"classID"in a&&(e[n]=r),e}),{});e={...e,...n}}if(e&&Object.keys(e).length>0){for(const t of Object.keys(e))e[t].type.startsWith("Page")?delete e[t]:e[t]?.datasource&&LD.includes(e[t].datasource.tableType)&&(e[t].fieldType="Picklist");return{sourceFields:e,sourceMetadata:t}}}return{}}(e);if(t&&n&&Object.keys(n).length>0){const e={...t,fields:Object.entries(n).map(GD)};if(BD(r=e)&&"string"==typeof r.classID&&Array.isArray(r.fields)){const t=WD({data:e});return Promise.resolve(t)}}}var r;const a={dataSource:e,columns:[],parameters:{},associationFilter:n,matchPosition:"",ignoreCase:!1};return Dg.init(a).then((({dataSourceMetaData:e})=>e?WD({data:e}):{data:{classID:"",className:"",isQueryable:!1,fields:[]}}))},getDefaultColumns:function(e){const t=Lh.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(xD.getItem(t))return Promise.resolve(JSON.parse(`${xD.getItem(t)}`));const n={dataViewName:Mr.getDefaultQualifiedName("D_pzGetDefaultColumns")},{restApi:r,reqType:a}=mS("getListData",n),s=au(r,{method:a,body:{dataViewParameters:e}});return s.then((e=>{xD.setItem(t,JSON.stringify(e))})),s},getFieldsForDataSource:function(e,t,n){if(!t){const t=OA(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 r=Lh.getAppCacheKey(`RDColumns-${e}`);if(xD.getItem(r))return Promise.resolve(JSON.parse(`${xD.getItem(r)}`));const a=Lh.getData(Mr.getDefaultQualifiedName("D_pxFieldsForDataSource"),{dataViewParameters:{DataPageName:e}},n);return a.then((e=>{xD.setItem(r,JSON.stringify(e))})),a},getPrimaryFieldsForDataSource:function(e="",t=""){const n=Lh.getAppCacheKey(`PFColumns-${e}${t}`);if(xD.getItem(n))return Promise.resolve(JSON.parse(`${xD.getItem(n)}`));const r=Lh.getData(Mr.getDefaultQualifiedName("D_pxGetInitialFieldsForDataSource"),{dataViewParameters:{DataPageName:e,ClassName:t}});return r.then((e=>{xD.setItem(n,JSON.stringify(e))})),r},getPrimaryFieldsForInsights:async function(e,t,n,r){const{allClasses:a,promisesToAwait:s,classesToFetch:o,isTopLevelClassPresent:i,joinedClassesToFetch:c}=function(e,t){const n=[],r=[];let a=!1;const s=[],o=[];return e&&o.push(e),t&&t.length>0&&o.push(...t),o.forEach((t=>{const o=kD(t);if(xD.getItem(o))return;const i=jD[t];i?r.push(i):(n.push(t),t===e?a=!0:s.push(t))})),{allClasses:o,promisesToAwait:r,classesToFetch:n,isTopLevelClassPresent:a,joinedClassesToFetch:s}}(e,n);return o.length&&s.push((async(e,t,n,r,a)=>{const s=Lh.getData(Mr.getDefaultQualifiedName("D_pxGetPrimaryFieldsForInsights"),{dataViewParameters:{...t&&{topLevelClassID:t},...r&&{joinedClassIDs:r.join(",")},...n&&{topLevelDataPageID:n}}},a).then((t=>{const n=t.data?.data||[],r={};e.forEach((e=>{r[e]=[]})),n.forEach((e=>{const t=e.classID,n=e[Mr.getDefaultQualifiedName("pyFieldName")];r[t].push(n)})),Object.entries(r).forEach((([e,t])=>{const n=kD(e);xD.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete jD[e]}))}));return e.forEach((e=>{jD[e]=s})),s})(o,i?e:void 0,i?t:void 0,c.length>0?c:void 0,r)),Promise.allSettled(s).then((()=>{const e={};return a.forEach((t=>{const n=kD(t);if(xD.getItem(n))try{e[t]=JSON.parse(`${xD.getItem(n)}`)}catch{}})),{data:e}}))},getInsightIDs:function(){const{restApi:e,reqType:t}=mS("getInsightIDs");return au(e,{method:t})},getInsightByID:function(e){const t=vA(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:a}=mS(MD,n);return au(r,{method:a})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=mS(MD,t);return au(n,{method:r})},loadClassResources:async e=>{const t=e.filter((e=>!FD.includes(e)));if(0===t.length)return;const n={classIDs:e.join(",")},{restApi:r,reqType:a}=mS("getClassResources",n);return au(r,{method:a}).then((e=>{e.data.resources&&(FD.push(...t),lp(e.data.resources))}))},createInsight:function(e){const{restApi:t,reqType:n}=mS("createInsight");return au(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:r,reqType:a}=mS("updateInsight",n);let s;return"UpdateDateTime"in t&&(s=t.UpdateDateTime),au(r,{method:a,body:JSON.stringify(t),headers:{"if-match":s,"Content-Type":"application/json"}})},deleteInsight:function(e){const t={insightID:e},{restApi:n,reqType:r}=mS("deleteInsight",t);return au(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=mS("exportToExcel");return au(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=mS("exportToCSV");return au(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:a}=mS("scheduleInsight",n);return au(r,{method:a,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const r={insightID:e,scheduleID:t},{restApi:a,reqType:s}=mS("updateScheduledInsight",r);return au(a,{method:s,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:a}=mS("deleteScheduledInsight",n);return au(r,{method:a})},translateStrings:function(e){const{restApi:t,reqType:n}=mS("translateStrings");return au(t,{method:n,body:JSON.stringify(e)})}};const qD=new class{addRoutes=e=>{return t=e,void wE.addRoutes(t);var t}};const zD=class{static registerModule(e,t,n){n[e]=()=>t}};const YD=class{static getCaseEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.CASE_EVENTS);static getDataEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.DATA_EVENTS);static getTransientEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.EVENT_TRANSIENT_ITEMS);static getBootstrapShellEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS);static getBulkProcessEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.EVENT_BULKACTION);static getLocalActionProcessEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION)};const KD=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},QD={setTokens:e=>{du({tokenInfo:e}),lu(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>$d.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Ud(),getAuthInstance:e=>Ld.init(e),setAuthorizationHeader:e=>{lu({Authorization:e}),setTimeout((()=>$d.publish("updateSession",{updateStatus:"success"})),0)}};const JD=new class{getDebouncedSubject(e){return(new Eh).pipe(kP(e))}},XD=(()=>{const e="[!#-'*+/0-9=?A-Z\\^_`a-z{|}~\\-]+",t="\\\\[\\x00-\\x7f]",n=`(?:${e}|${`"(?:[^\\r"\\\\\\x80-\\xff]|${t})*"`})`,r=`(?:${e}|${`\\[(?:[^\\r\\[\\]\\\\\\x80-\\xff]|${t})*\\]`})`;return new RegExp(`^${`${n}(?:\\.${n})*`}@${`${r}(?:\\.${r})*`}$`)})();const ZD=(()=>{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}`}$`)})();cp.register("email",((e,{useRFC822Validation:t})=>{let n=null;const r=t?(a=e,XD.test(a)):function(e){return ZD.test(e)}(e);var a;return e&&!r&&(n="Enter a valid email address"),n})),cp.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t="Invalid number"),t})),cp.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?"Cannot be blank":null)),cp.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";Promise.resolve().then(n.bind(n,816)).then((({parsePhoneNumberFromString:t})=>{cp.register("phone",(n=>{let r=null;n&&!/^\+?\d+$/.test(n)&&(r=e);const a=n?.startsWith("+");if(n&&a){const a=t(n);a&&a.isPossible()&&n===a.number||(r=e)}return r}))}))}),Fr.PRIORITY.TRIVIAL);const ev=(e,t)=>{switch(t){case"invalid":return`Incorrect ${e}`;case"incomplete":return`Incomplete ${e}`;default:return null}};cp.register("datetime",(e=>ev("date and time",e))),cp.register("date",(e=>ev("date",e))),cp.register("time",(e=>ev("time",e)));const tv=e=>{for(const t of e)if(t?.error)return"Error with one or more files";return null};cp.register("attachment",(e=>{let t=null;return e?("pyCount"in e&&Array.isArray(e.pxResults)?t=tv(e.pxResults):Array.isArray(e)?t=tv(e):"error"in e&&e.error&&(t="Error with one or more files"),t):t}));const nv=()=>{const e={},t="undefined"!=typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0;t&&(e["user-timezone"]=t);const n="undefined"!=typeof navigator?navigator.language:void 0;return n&&(e["user-locale"]=n),e},rv="createConversation",av="sendMessage",sv="getConversations",ov="getMessages",iv="sendMessageForAgent",cv="getCoach",lv=(e,t,n,r,a,s,o)=>{for(const e of o)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const i=Ip();return o.push(i),fp(e,{queryPayload:sv===e?{assistantID:t,contextID:n,pageSize:r,pageIndex:a}:{agentID:t,contextID:n,pageSize:r,pageIndex:a},cancelTokenSource:i,headers:nv()},s).then((e=>(o.pop(),e)))},dv=(e,t,n,r,a)=>{for(const e of a)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const s=Ip();return a.push(s),fp(e,{queryPayload:ov===e?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},cancelTokenSource:s,headers:nv()},r).then((e=>(a.pop(),e)))},uv=(e,t,n,r,a,s)=>{for(const e of a)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const o=Ip();return a.push(o),fp(e,{body:JSON.stringify({contextID:t,executeStarterQuestion:!1,...s&&s.isManualConfirmationSupported&&{capabilities:{tools:{isManualConfirmationSupported:!0}}}}),cancelTokenSource:o,queryPayload:e===rv?{assistantID:n}:{agentID:n},headers:nv()},r).then((e=>(a.pop(),e)))},pv=(e,t,n,r,a,s,o)=>{const i={...r&&{request:r},...o&&o.additionalInstruction&&{additionalInstruction:o.additionalInstruction},...o&&o.isManualConfirmationSupported&&{capabilities:{tools:{isManualConfirmationSupported:!0}}},...o&&o.toolsReviewed&&o.toolsReviewed.length>0&&{toolsReviewed:o.toolsReviewed},...s&&s?.length>0&&{attachments:s}};return fp(e,{body:JSON.stringify(i),queryPayload:e===av?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},headers:nv()},a)},hv=(e,t,n,r,a,s,o,i)=>{const c={...r&&{request:r},...o&&o.additionalInstruction&&{additionalInstruction:o.additionalInstruction},...s&&s.length>0&&{attachments:s},...o&&o.toolsReviewed&&o.toolsReviewed.length>0&&{toolsReviewed:o.toolsReviewed},capabilities:{stream:{isEnabled:!0},...o&&o.isManualConfirmationSupported&&{tools:{isManualConfirmationSupported:!0}}},...o&&o.questionnaire&&{questionnaire:o.questionnaire}},l=e===av?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},{restApi:d,reqType:u}=mS(e,l),p={method:u,headers:{Accept:"text/event-stream",...nv()},body:JSON.stringify(c),responseType:"stream",adapter:"fetch",...i&&{signal:i.token}};return au(d,p,a)},gv=(e,t,n,r,a)=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const s=Ip();return r.push(s),fp(e,{queryPayload:e===cv?{assistantID:t,...a&&{contextID:a}}:{agentID:t,...a&&{contextID:a}},cancelTokenSource:s},n).then((e=>(r.pop(),e))).catch((e=>{throw r.pop(),e}))},fv={createConversation:(e,t,n,r=[])=>uv(rv,e,t,n,r),sendMessage:(e,t,n,r,a)=>a?.enableStreaming?hv(av,e,t,n,r,void 0,a):pv(av,e,t,n,r),createConversationForAgent:(e,t,n,r=[],a)=>uv("createConversationForAgent",e,t,n,r,a),sendMessageForAgent:(e,t,n,r,a,s)=>s?.enableStreaming?hv(iv,e,t,n,r,a,s,s.cancelTokenSource):pv(iv,e,t,n,r,a,s),getAgent:(e,t,n,r=[])=>gv("getAgent",e,t,r,n),getCoach:(e,t,n,r=[])=>gv(cv,e,t,r,n),likeAgentMessage:(e,t,n,r)=>{const a={queryPayload:{agentID:e,conversationID:t,messageID:n},headers:nv()};return fp("likeAgentMessage",a,r)},unLikeAgentMessage:(e,t,n,r,a="")=>{const s={queryPayload:{agentID:e,conversationID:t,messageID:n},body:JSON.stringify({feedbackText:a}),headers:nv()};return fp("dislikeAgentMessage",s,r)},getConversations:(e,t,n,r,a,s=[])=>lv(sv,e,t,n,r,a,s),getConversationsForAgent:(e,t,n,r,a,s=[])=>lv("getConversationsForAgent",e,t,n,r,a,s),getMessages:(e,t,n,r=[])=>dv(ov,e,t,n,r),getMessagesForAgent:(e,t,n,r=[])=>dv("getMessagesForAgent",e,t,n,r)};const mv=new class{async rewriteText(e){const{originalText:t,rewriteAction:n,additionalInstructions:r,context:a}=e,s=LE.isInfinityRuntime(),o=LE.getRewriteGenAIDP()??Mr.getDefaultQualifiedName("D_RewriteWithAI"),i={OriginalText:t,RewriteAction:n,AdditionalInstructions:r||""};try{let e,t;if(s){const t=await mg.getPageDataAsync(o,a,i),n=Object.fromEntries(Object.entries(t)).pyResponseData;e="string"==typeof n?n:void 0}else{const n=(await mg.getDataAsync(o,a,i)).data[0],r=n[Mr.getDefaultQualifiedName("Content")];e="string"==typeof r?r:void 0;const s=n[Mr.getDefaultQualifiedName("ErrorMessage")];t="string"==typeof s?s: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 yv=class{classAccessMap=new Map;constructor(){const e=LE.getClassesAccessList();0!==e.length?this.classAccessMap=e.reduce(((e,t)=>(e.set(t.pyClassName,t.pyHasCreateAccess),e)),new Map):this.classAccessMap=LE.getCaseTypeList().reduce(((e,t)=>(e.set(t.pyWorkTypeImplementationClassName,t.hasCreateAccess??!0),e)),new Map)}hasCreateAccess(e){return this.classAccessMap.get(e)}static getInstance(){return this.instance||(this.instance=new this),this.instance}};const Iv=class{static AUTOSAVE_SAVE_STATUS=My;static isAutosaveEnabledForContext(e){return Xy(e)}static subscribeAutosaveStatus(e,t){return((e,t)=>{let n=Vy.get(e);return n||(n=new Set,Vy.set(e,n)),n.add(t),()=>{const n=Vy.get(e);n&&(n.delete(t),0===n.size&&Vy.delete(e))}})(e,t)}static notifyChange(e,t,n){Xy(e)&&(((e,t,n)=>{let r=By.get(e);r||(r=new Map,By.set(e,r)),r.set(t,n)})(e,t,n),nI(e))}};class Ev{static behaviorOverrides={};getPersonalizationUtils=$D;constructor(){Ev.behaviorOverrides={}}getPCoreVersion=()=>"26.1.0";onPCoreReady=e=>aD.onPCoreReady(e);onPCoreCleanup=e=>aD.onPCoreCleanup(e);getComponentsRegistry=()=>aD.getComponentsRegistry();checkIfSemanticURL=()=>aD.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(DS()){const e=wE.processUrl(vE(),!0);return!!wE._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>qD;getViewResources=()=>i;configureForBrowserBookmark=e=>aD.configureForBrowserBookmark(e);getStore=()=>KA();resetStore=()=>dC();getMessageManager=()=>Dd;getCoexistenceManager=()=>QO;getStoreValue=(e,t,n)=>eC(e,t,n);getContainerUtils=()=>c;getAnnotationUtils=()=>ch;getFieldUtils=()=>gu;getFieldDefaultUtils=()=>Wu;getAssetLoader=()=>Dp;getAttachmentUtils=()=>tp;getViewRuleApi=()=>dD;getFeedUtils=()=>ID;getTagUtils=()=>ED;getGenAIAssistantUtils=()=>fv;getGenAIUtils=()=>mv;getStakeholderUtils=()=>CD;getUserApi=()=>fD;getCaseFollowerApi=()=>pD;getCaseUtils=()=>ry;getStateUtils=()=>ef;getRelatedCasesApi=()=>hD;getDataApi=()=>Dg;getDataApiUtils=()=>Lh;getAnalyticsUtils=()=>HD;getLocaleUtils=e=>{const t=e??LE.getLocale()??"en-US";return mA(t)};registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{Ev.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{Ev.behaviorOverrides[e]=t};getBehaviorOverrides=()=>Ev.behaviorOverrides;getBehaviorOverride=e=>Ev.behaviorOverrides[e];getAsynchronousUtils=()=>JD;createPConnect=e=>Rf(e);getPubSubUtils=()=>$d;registerComponentCreator=e=>{$f(e)};getConstants=()=>Object.freeze(Ur);getResolvedConstantValue=e=>Fr.getProperty(e);getEvents=()=>YD;getRestClient=()=>o;getMashupApi=()=>JO;getEnvironmentInfo=()=>LE;switchLocale=e=>HO(e);getRuntimeParamsAPI=()=>Mg;getSemanticUrlUtils=()=>Hp;getRemoteCaseUtils=()=>Vr;getNavigationUtils=()=>jp;registerModule=(e,t)=>zD.registerModule(e,t,this);getErrorHandler=()=>KD;getFormUtils=()=>jm;getAutosaveUtils=()=>Iv;getMessagingServiceManager=()=>gg;getMetadataUtils=()=>l;getDataPageUtils=()=>mg;getDataTypeUtils=()=>ih;getCascadeManager=()=>HA;isDeepEqual=(e,t)=>Xt(e,t);getAuthUtils=()=>QD;getDebugger=()=>wd;getDeferLoadManager=()=>wh;getExpressionEngine=()=>r;getActionsSequencer=()=>Bg;getRefreshManager=()=>Rg;getInitialiser=()=>lD;getBootstrapUtils=()=>aD;getContextTreeManager=()=>md;getAccessPrivilege=()=>yv.getInstance();getObjectTransformer=()=>Lr;getAllStateMachines=(e,t,n)=>t&&n?km.getAllStateMachines(e,t,n):km.getAllStateMachinesByContext(e);isNamespaceEnabled=()=>Mr.isNamespaceEnabled();getQualifiedName=(e,t)=>Mr.getQualifiedName(e,t);getDefaultQualifiedName=e=>this.getQualifiedName(e,"PegaPlatform");getNameSpaceUtils=()=>Mr;getNetworkUtils=()=>xd;getMashupBridge=()=>p;getConfirmDialogService=()=>lm}const Av=new Ev;globalThis.PCore=Av})()})();
|
|
2
|
+
//# sourceMappingURL=constellation-core-react-native.js.map
|