@pega/constellationjs 24.2.3-1 → 24.2.3-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.
@@ -1,2 +1,2 @@
1
- (()=>{var e={851:(e,t,n)=>{"use strict";var r=n(681);Object.defineProperty(t,"reduxBatch",{enumerable:!0,get:function(){return r.reduxBatch}})},681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduxBatch=function(e){var t=[],n=void 0;function r(){t===n&&(t=t.slice())}function a(e){if("function"!=typeof e)throw new Error("Invalid listener, expected a function");var n=!0;return r(),t.push(e),function(){n&&(r(),t.splice(t.indexOf(e),1),n=!1)}}function s(){for(var e=t,r=0;r<e.length;++r)n=e,e[r]()}return function(){var t=e.apply(void 0,arguments),n=!1,r=!1;function o(e){return Array.isArray(e)?e.map((function(e){return o(e)})):t.dispatch(e)}return t.subscribe((function(){r?n=!0:s()})),Object.assign({},t,{dispatch:function(e){var t=r;t||(n=!1,r=!0);var a=o(e),i=n&&!t;return t||(n=!1,r=!1),i&&s(),a},subscribe:a})}}},52:(e,t,n)=>{e.exports=n(851)},631:(e,t,n)=>{var r="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,u=l||d||Function("return this")();function p(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var a=e.length,s=n+(r?1:-1);for(;r?s--:++s<a;)if(t(e[s],s,e))return s;return-1}(e,g,n);var r=n-1,a=e.length;for(;++r<a;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function h(e,t,n){for(var r=-1,a=e?e.length:0;++r<a;)if(n(t,e[r]))return!0;return!1}function f(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}function g(e){return e!=e}function m(e,t){return e.has(t)}var y,I=Array.prototype,E=Function.prototype,A=Object.prototype,C=u["__core-js_shared__"],_=(y=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=E.toString,b=A.hasOwnProperty,N=A.toString,v=RegExp("^"+S.call(b).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=u.Symbol,T=A.propertyIsEnumerable,$=I.splice,O=P?P.isConcatSpreadable:void 0,R=Math.max,D=G(u,"Map"),x=G(Object,"create");function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.__data__=new L;++t<n;)this.add(e[t])}function j(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!=n&&r!=r)return a;return-1}function U(e,t,n,r){var a,s=-1,o=p,i=!0,c=e.length,l=[],d=t.length;if(!c)return l;n&&(t=function(e,t){for(var n=-1,r=e?e.length:0,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}(t,(a=n,function(e){return a(e)}))),r?(o=h,i=!1):t.length>=200&&(o=m,i=!1,t=new F(t));e:for(;++s<c;){var u=e[s],f=n?n(u):u;if(u=r||0!==u?u:0,i&&f==f){for(var g=d;g--;)if(t[g]===f)continue e;l.push(u)}else o(t,f,r)||l.push(u)}return l}function k(e,t,n,r,a){var s=-1,o=e.length;for(n||(n=W),a||(a=[]);++s<o;){var i=e[s];t>0&&n(i)?t>1?k(i,t-1,n,r,a):f(a,i):r||(a[a.length]=i)}return a}function V(e){if(!Q(e)||(t=e,_&&_ in t))return!1;var t,n=J(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?v:c;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return V(n)?n:void 0}function W(e){return K(e)||function(e){return X(e)&&b.call(e,"callee")&&(!T.call(e,"callee")||N.call(e)==s)}(e)||!!(O&&e&&e[O])}w.prototype.clear=function(){this.__data__=x?x(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(x){var n=t[e];return n===r?void 0:n}return b.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return x?void 0!==t[e]:b.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=x&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=j(t,e);return!(n<0)&&(n==t.length-1?t.pop():$.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=j(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return j(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=j(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(D||M),string:new w}},L.prototype.delete=function(e){return B(this,e).delete(e)},L.prototype.get=function(e){return B(this,e).get(e)},L.prototype.has=function(e){return B(this,e).has(e)},L.prototype.set=function(e,t){return B(this,e).set(e,t),this},F.prototype.add=F.prototype.push=function(e){return this.__data__.set(e,r),this},F.prototype.has=function(e){return this.__data__.has(e)};var H,q,Y=(H=function(e,t){return X(e)?U(e,k(t,1,X,!0)):[]},q=R(void 0===q?H.length-1:q,0),function(){for(var e=arguments,t=-1,n=R(e.length-q,0),r=Array(n);++t<n;)r[t]=e[q+t];t=-1;for(var a=Array(q+1);++t<q;)a[t]=e[t];return a[q]=r,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)}(H,this,a)});var K=Array.isArray;function z(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}(e.length)&&!J(e)}function X(e){return function(e){return!!e&&"object"==typeof e}(e)&&z(e)}function J(e){var t=Q(e)?N.call(e):"";return t==o||t==i}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=Y},188:(e,t,n)=>{var r="__lodash_hash_undefined__",a=1/0,s="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,d=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,g="object"==typeof self&&self&&self.Object===Object&&self,m=f||g||Function("return this")();var y,I=Array.prototype,E=Function.prototype,A=Object.prototype,C=m["__core-js_shared__"],_=(y=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=E.toString,b=A.hasOwnProperty,N=A.toString,v=RegExp("^"+S.call(b).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m.Symbol,T=I.splice,$=k(m,"Map"),O=k(Object,"create"),R=P?P.prototype:void 0,D=R?R.toString:void 0;function x(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!=n&&r!=r)return a;return-1}function F(e,t){var n;t=function(e,t){if(W(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||q(e))return!0;return l.test(e)||!c.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:W(n=t)?n:V(n);for(var r=0,a=t.length;null!=e&&r<a;)e=e[B(t[r++])];return r&&r==a?e:void 0}function j(e){if(!H(e)||(t=e,_&&_ in t))return!1;var t,n=function(e){var t=H(e)?N.call(e):"";return t==s||t==o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?v:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function U(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function k(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return j(n)?n:void 0}x.prototype.clear=function(){this.__data__=O?O(null):{}},x.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},x.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return n===r?void 0:n}return b.call(t,e)?t[e]:void 0},x.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:b.call(t,e)},x.prototype.set=function(e,t){return this.__data__[e]=O&&void 0===t?r:t,this},w.prototype.clear=function(){this.__data__=[]},w.prototype.delete=function(e){var t=this.__data__,n=L(t,e);return!(n<0)&&(n==t.length-1?t.pop():T.call(t,n,1),!0)},w.prototype.get=function(e){var t=this.__data__,n=L(t,e);return n<0?void 0:t[n][1]},w.prototype.has=function(e){return L(this.__data__,e)>-1},w.prototype.set=function(e,t){var n=this.__data__,r=L(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},M.prototype.clear=function(){this.__data__={hash:new x,map:new($||w),string:new x}},M.prototype.delete=function(e){return U(this,e).delete(e)},M.prototype.get=function(e){return U(this,e).get(e)},M.prototype.has=function(e){return U(this,e).has(e)},M.prototype.set=function(e,t){return U(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(q(e))return D?D.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(u,(function(e,t,r,a){n.push(r?a.replace(p,"$1"):t||e)})),n}));function B(e){if("string"==typeof e||q(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function G(e,t){if("function"!=typeof e||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),o};return n.cache=new(G.Cache||M),n}G.Cache=M;var W=Array.isArray;function H(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function q(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t,n){var r=null==e?void 0:F(e,t);return void 0===r?n:r}},928:(e,t,n)=>{var r="__lodash_hash_undefined__",a=1/0,s=9007199254740991,o="[object Arguments]",i="[object Function]",c="[object GeneratorFunction]",l="[object Symbol]",d=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,p=/^\./,h=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,m=/^(?:0|[1-9]\d*)$/,y="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,I="object"==typeof self&&self&&self.Object===Object&&self,E=y||I||Function("return this")();var A,C=Array.prototype,_=Function.prototype,S=Object.prototype,b=E["__core-js_shared__"],N=(A=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",v=_.toString,P=S.hasOwnProperty,T=S.toString,$=RegExp("^"+v.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=E.Symbol,R=S.propertyIsEnumerable,D=C.splice,x=W(E,"Map"),w=W(Object,"create"),M=O?O.prototype:void 0,L=M?M.toString:void 0;function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function k(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!=n&&r!=r)return a;return-1}function V(e,t){return null!=e&&P.call(e,t)}function B(e){if(!Q(e)||(t=e,N&&N in t))return!1;var t,n=X(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?$:g;return n.test(function(e){if(null!=e){try{return v.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function G(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function W(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B(n)?n:void 0}function H(e,t,n){var r;t=function(e,t){if(z(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||ee(e))return!0;return u.test(e)||!d.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:z(r=t)?r:q(r);for(var a,i=-1,c=t.length;++i<c;){var l=Y(t[i]);if(!(a=null!=e&&n(e,l)))break;e=e[l]}return a||!!(c=e?e.length:0)&&J(c)&&function(e,t){return t=null==t?s:t,!!t&&("number"==typeof e||m.test(e))&&e>-1&&e%1==0&&e<t}(l,c)&&(z(e)||function(e){return function(e){return Z(e)&&function(e){return null!=e&&J(e.length)&&!X(e)}(e)}(e)&&P.call(e,"callee")&&(!R.call(e,"callee")||T.call(e)==o)}(e))}F.prototype.clear=function(){this.__data__=w?w(null):{}},F.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},F.prototype.get=function(e){var t=this.__data__;if(w){var n=t[e];return n===r?void 0:n}return P.call(t,e)?t[e]:void 0},F.prototype.has=function(e){var t=this.__data__;return w?void 0!==t[e]:P.call(t,e)},F.prototype.set=function(e,t){return this.__data__[e]=w&&void 0===t?r:t,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(e){var t=this.__data__,n=k(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},j.prototype.get=function(e){var t=this.__data__,n=k(t,e);return n<0?void 0:t[n][1]},j.prototype.has=function(e){return k(this.__data__,e)>-1},j.prototype.set=function(e,t){var n=this.__data__,r=k(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},U.prototype.clear=function(){this.__data__={hash:new F,map:new(x||j),string:new F}},U.prototype.delete=function(e){return G(this,e).delete(e)},U.prototype.get=function(e){return G(this,e).get(e)},U.prototype.has=function(e){return G(this,e).has(e)},U.prototype.set=function(e,t){return G(this,e).set(e,t),this};var q=K((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ee(e))return L?L.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var n=[];return p.test(e)&&n.push(""),e.replace(h,(function(e,t,r,a){n.push(r?a.replace(f,"$1"):t||e)})),n}));function Y(e){if("string"==typeof e||ee(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function K(e,t){if("function"!=typeof e||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),o};return n.cache=new(K.Cache||U),n}K.Cache=U;var z=Array.isArray;function X(e){var t=Q(e)?T.call(e):"";return t==i||t==c}function J(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return!!e&&"object"==typeof e}function ee(e){return"symbol"==typeof e||Z(e)&&T.call(e)==l}e.exports=function(e,t){return null!=e&&H(e,t,V)}},529:(e,t,n)=>{e=n.nmd(e);var r=9007199254740991,a="[object Arguments]",s="[object Function]",o="[object GeneratorFunction]",i="[object Map]",c="[object Promise]",l="[object Set]",d="[object WeakMap]",u="[object DataView]",p=/^\[object .+?Constructor\]$/,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,g=h||f||Function("return this")(),m=t&&!t.nodeType&&t,y=m&&e&&!e.nodeType&&e,I=y&&y.exports===m;var E,A,C,_=Function.prototype,S=Object.prototype,b=g["__core-js_shared__"],N=(E=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",v=_.toString,P=S.hasOwnProperty,T=S.toString,$=RegExp("^"+v.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=I?g.Buffer:void 0,R=S.propertyIsEnumerable,D=O?O.isBuffer:void 0,x=(A=Object.keys,C=Object,function(e){return A(C(e))}),w=q(g,"DataView"),M=q(g,"Map"),L=q(g,"Promise"),F=q(g,"Set"),j=q(g,"WeakMap"),U=!R.call({valueOf:1},"valueOf"),k=K(w),V=K(M),B=K(L),G=K(F),W=K(j);function H(e){if(!ee(e)||function(e){return!!N&&N in e}(e))return!1;var t=Z(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?$:p;return t.test(K(e))}function q(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return H(n)?n:void 0}var Y=function(e){return T.call(e)};function K(e){if(null!=e){try{return v.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function z(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&J(e)}(e)&&P.call(e,"callee")&&(!R.call(e,"callee")||T.call(e)==a)}(w&&Y(new w(new ArrayBuffer(1)))!=u||M&&Y(new M)!=i||L&&Y(L.resolve())!=c||F&&Y(new F)!=l||j&&Y(new j)!=d)&&(Y=function(e){var t=T.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?K(n):void 0;if(r)switch(r){case k:return u;case V:return i;case B:return c;case G:return l;case W:return d}return t});var X=Array.isArray;function J(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Z(e)}var Q=D||function(){return!1};function Z(e){var t=ee(e)?T.call(e):"";return t==s||t==o}function ee(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){if(J(e)&&(X(e)||"string"==typeof e||"function"==typeof e.splice||Q(e)||z(e)))return!e.length;var t=Y(e);if(t==i||t==l)return!e.size;if(U||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||S)}(e))return!x(e).length;for(var n in e)if(P.call(e,n))return!1;return!0}},216:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",a=1,s=2,o=9007199254740991,i="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",d="[object Boolean]",u="[object Date]",p="[object Error]",h="[object Function]",f="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Null]",I="[object Object]",E="[object Promise]",A="[object Proxy]",C="[object RegExp]",_="[object Set]",S="[object String]",b="[object Symbol]",N="[object Undefined]",v="[object WeakMap]",P="[object ArrayBuffer]",T="[object DataView]",$=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[i]=R[c]=R[P]=R[d]=R[T]=R[u]=R[p]=R[h]=R[g]=R[m]=R[I]=R[C]=R[_]=R[S]=R[v]=!1;var D="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,x="object"==typeof self&&self&&self.Object===Object&&self,w=D||x||Function("return this")(),M=t&&!t.nodeType&&t,L=M&&e&&!e.nodeType&&e,F=L&&L.exports===M,j=F&&D.process,U=function(){try{return j&&j.binding&&j.binding("util")}catch(e){}}(),k=U&&U.isTypedArray;function V(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function B(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function G(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var W,H,q,Y=Array.prototype,K=Function.prototype,z=Object.prototype,X=w["__core-js_shared__"],J=K.toString,Q=z.hasOwnProperty,Z=(W=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",ee=z.toString,te=RegExp("^"+J.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=F?w.Buffer:void 0,re=w.Symbol,ae=w.Uint8Array,se=z.propertyIsEnumerable,oe=Y.splice,ie=re?re.toStringTag:void 0,ce=Object.getOwnPropertySymbols,le=ne?ne.isBuffer:void 0,de=(H=Object.keys,q=Object,function(e){return H(q(e))}),ue=Ue(w,"DataView"),pe=Ue(w,"Map"),he=Ue(w,"Promise"),fe=Ue(w,"Set"),ge=Ue(w,"WeakMap"),me=Ue(Object,"create"),ye=Ge(ue),Ie=Ge(pe),Ee=Ge(he),Ae=Ge(fe),Ce=Ge(ge),_e=re?re.prototype:void 0,Se=_e?_e.valueOf:void 0;function be(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])}}function Ne(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])}}function ve(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])}}function Pe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ve;++t<n;)this.add(e[t])}function Te(e){var t=this.__data__=new Ne(e);this.size=t.size}function $e(e,t){var n=qe(e),r=!n&&He(e),a=!n&&!r&&Ye(e),s=!n&&!r&&!a&&Qe(e),o=n||r||a||s,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!Q.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Be(l,c))||i.push(l);return i}function Oe(e,t){for(var n=e.length;n--;)if(We(e[n][0],t))return n;return-1}function Re(e){return null==e?void 0===e?N:y:ie&&ie in Object(e)?function(e){var t=Q.call(e,ie),n=e[ie];try{e[ie]=void 0;var r=!0}catch(e){}var a=ee.call(e);r&&(t?e[ie]=n:delete e[ie]);return a}(e):function(e){return ee.call(e)}(e)}function De(e){return Je(e)&&Re(e)==i}function xe(e,t,n,r,o){return e===t||(null==e||null==t||!Je(e)&&!Je(t)?e!=e&&t!=t:function(e,t,n,r,o,l){var h=qe(e),f=qe(t),y=h?c:Ve(e),E=f?c:Ve(t),A=(y=y==i?I:y)==I,N=(E=E==i?I:E)==I,v=y==E;if(v&&Ye(e)){if(!Ye(t))return!1;h=!0,A=!1}if(v&&!A)return l||(l=new Te),h||Qe(e)?Le(e,t,n,r,o,l):function(e,t,n,r,o,i,c){switch(n){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!i(new ae(e),new ae(t)));case d:case u:case m:return We(+e,+t);case p:return e.name==t.name&&e.message==t.message;case C:case S:return e==t+"";case g:var l=B;case _:var h=r&a;if(l||(l=G),e.size!=t.size&&!h)return!1;var f=c.get(e);if(f)return f==t;r|=s,c.set(e,t);var y=Le(l(e),l(t),r,o,i,c);return c.delete(e),y;case b:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,y,n,r,o,l);if(!(n&a)){var $=A&&Q.call(e,"__wrapped__"),O=N&&Q.call(t,"__wrapped__");if($||O){var R=$?e.value():e,D=O?t.value():t;return l||(l=new Te),o(R,D,n,r,l)}}if(!v)return!1;return l||(l=new Te),function(e,t,n,r,s,o){var i=n&a,c=Fe(e),l=c.length,d=Fe(t),u=d.length;if(l!=u&&!i)return!1;var p=l;for(;p--;){var h=c[p];if(!(i?h in t:Q.call(t,h)))return!1}var f=o.get(e);if(f&&o.get(t))return f==t;var g=!0;o.set(e,t),o.set(t,e);var m=i;for(;++p<l;){var y=e[h=c[p]],I=t[h];if(r)var E=i?r(I,y,h,t,e,o):r(y,I,h,e,t,o);if(!(void 0===E?y===I||s(y,I,n,r,o):E)){g=!1;break}m||(m="constructor"==h)}if(g&&!m){var A=e.constructor,C=t.constructor;A==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof C&&C instanceof C||(g=!1)}return o.delete(e),o.delete(t),g}(e,t,n,r,o,l)}(e,t,n,r,xe,o))}function we(e){return!(!Xe(e)||function(e){return!!Z&&Z in e}(e))&&(Ke(e)?te:$).test(Ge(e))}function Me(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||z,t!==r)return de(e);var t,n,r,a=[];for(var s in Object(e))Q.call(e,s)&&"constructor"!=s&&a.push(s);return a}function Le(e,t,n,r,o,i){var c=n&a,l=e.length,d=t.length;if(l!=d&&!(c&&d>l))return!1;var u=i.get(e);if(u&&i.get(t))return u==t;var p=-1,h=!0,f=n&s?new Pe:void 0;for(i.set(e,t),i.set(t,e);++p<l;){var g=e[p],m=t[p];if(r)var y=c?r(m,g,p,t,e,i):r(g,m,p,e,t,i);if(void 0!==y){if(y)continue;h=!1;break}if(f){if(!V(t,(function(e,t){if(a=t,!f.has(a)&&(g===e||o(g,e,n,r,i)))return f.push(t);var a}))){h=!1;break}}else if(g!==m&&!o(g,m,n,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h}function Fe(e){return function(e,t,n){var r=t(e);return qe(e)?r:function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}(r,n(e))}(e,Ze,ke)}function je(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function Ue(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return we(n)?n:void 0}be.prototype.clear=function(){this.__data__=me?me(null):{},this.size=0},be.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},be.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===r?void 0:n}return Q.call(t,e)?t[e]:void 0},be.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:Q.call(t,e)},be.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=me&&void 0===t?r:t,this},Ne.prototype.clear=function(){this.__data__=[],this.size=0},Ne.prototype.delete=function(e){var t=this.__data__,n=Oe(t,e);return!(n<0)&&(n==t.length-1?t.pop():oe.call(t,n,1),--this.size,!0)},Ne.prototype.get=function(e){var t=this.__data__,n=Oe(t,e);return n<0?void 0:t[n][1]},Ne.prototype.has=function(e){return Oe(this.__data__,e)>-1},Ne.prototype.set=function(e,t){var n=this.__data__,r=Oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ve.prototype.clear=function(){this.size=0,this.__data__={hash:new be,map:new(pe||Ne),string:new be}},ve.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},ve.prototype.get=function(e){return je(this,e).get(e)},ve.prototype.has=function(e){return je(this,e).has(e)},ve.prototype.set=function(e,t){var n=je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,r),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.clear=function(){this.__data__=new Ne,this.size=0},Te.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ne){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ve(r)}return n.set(e,t),this.size=n.size,this};var ke=ce?function(e){return null==e?[]:(e=Object(e),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}(ce(e),(function(t){return se.call(e,t)})))}:function(){return[]},Ve=Re;function Be(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||O.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function We(e,t){return e===t||e!=e&&t!=t}(ue&&Ve(new ue(new ArrayBuffer(1)))!=T||pe&&Ve(new pe)!=g||he&&Ve(he.resolve())!=E||fe&&Ve(new fe)!=_||ge&&Ve(new ge)!=v)&&(Ve=function(e){var t=Re(e),n=t==I?e.constructor:void 0,r=n?Ge(n):"";if(r)switch(r){case ye:return T;case Ie:return g;case Ee:return E;case Ae:return _;case Ce:return v}return t});var He=De(function(){return arguments}())?De:function(e){return Je(e)&&Q.call(e,"callee")&&!se.call(e,"callee")},qe=Array.isArray;var Ye=le||function(){return!1};function Ke(e){if(!Xe(e))return!1;var t=Re(e);return t==h||t==f||t==l||t==A}function ze(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Qe=k?function(e){return function(t){return e(t)}}(k):function(e){return Je(e)&&ze(e.length)&&!!R[Re(e)]};function Ze(e){return null!=(t=e)&&ze(t.length)&&!Ke(t)?$e(e):Me(e);var t}e.exports=function(e,t){return xe(e,t)}},692:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",o="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",l="[object Null]",d="[object Object]",u="[object Proxy]",p="[object Undefined]",h=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[s]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[i]=g["[object Map]"]=g["[object Number]"]=g[d]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,I=m||y||Function("return this")(),E=t&&!t.nodeType&&t,A=E&&e&&!e.nodeType&&e,C=A&&A.exports===E,_=C&&m.process,S=function(){try{var e=A&&A.require&&A.require("util").types;return e||_&&_.binding&&_.binding("util")}catch(e){}}(),b=S&&S.isTypedArray;var N,v,P,T=Array.prototype,$=Function.prototype,O=Object.prototype,R=I["__core-js_shared__"],D=$.toString,x=O.hasOwnProperty,w=(N=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",M=O.toString,L=D.call(Object),F=RegExp("^"+D.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=C?I.Buffer:void 0,U=I.Symbol,k=I.Uint8Array,V=j?j.allocUnsafe:void 0,B=(v=Object.getPrototypeOf,P=Object,function(e){return v(P(e))}),G=Object.create,W=O.propertyIsEnumerable,H=T.splice,q=U?U.toStringTag:void 0,Y=function(){try{var e=Ee(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),K=j?j.isBuffer:void 0,z=Math.max,X=Date.now,J=Ee(I,"Map"),Q=Ee(Object,"create"),Z=function(){function e(){}return function(t){if(!Re(t))return{};if(G)return G(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ee(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])}}function te(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])}}function ne(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])}}function re(e){var t=this.__data__=new te(e);this.size=t.size}function ae(e,t){var n=ve(e),r=!n&&Ne(e),a=!n&&!r&&Te(e),s=!n&&!r&&!a&&xe(e),o=n||r||a||s,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!x.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ae(l,c))||i.push(l);return i}function se(e,t,n){(void 0!==n&&!be(e[t],n)||void 0===n&&!(t in e))&&ce(e,t,n)}function oe(e,t,n){var r=e[t];x.call(e,t)&&be(r,n)&&(void 0!==n||t in e)||ce(e,t,n)}function ie(e,t){for(var n=e.length;n--;)if(be(e[n][0],t))return n;return-1}function ce(e,t,n){"__proto__"==t&&Y?Y(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}ee.prototype.clear=function(){this.__data__=Q?Q(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return n===r?void 0:n}return x.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:x.call(t,e)},ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Q&&void 0===t?r:t,this},te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=ie(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),--this.size,!0)},te.prototype.get=function(e){var t=this.__data__,n=ie(t,e);return n<0?void 0:t[n][1]},te.prototype.has=function(e){return ie(this.__data__,e)>-1},te.prototype.set=function(e,t){var n=this.__data__,r=ie(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(J||te),string:new ee}},ne.prototype.delete=function(e){var t=Ie(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return Ie(this,e).get(e)},ne.prototype.has=function(e){return Ie(this,e).has(e)},ne.prototype.set=function(e,t){var n=Ie(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},re.prototype.clear=function(){this.__data__=new te,this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,t){var n=this.__data__;if(n instanceof te){var r=n.__data__;if(!J||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ne(r)}return n.set(e,t),this.size=n.size,this};var le,de=function(e,t,n){for(var r=-1,a=Object(e),s=n(e),o=s.length;o--;){var i=s[le?o:++r];if(!1===t(a[i],i,a))break}return e};function ue(e){return null==e?void 0===e?p:l:q&&q in Object(e)?function(e){var t=x.call(e,q),n=e[q];try{e[q]=void 0;var r=!0}catch(e){}var a=M.call(e);r&&(t?e[q]=n:delete e[q]);return a}(e):function(e){return M.call(e)}(e)}function pe(e){return De(e)&&ue(e)==s}function he(e){return!(!Re(e)||function(e){return!!w&&w in e}(e))&&($e(e)?F:h).test(function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function fe(e){if(!Re(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ce(e),n=[];for(var r in e)("constructor"!=r||!t&&x.call(e,r))&&n.push(r);return n}function ge(e,t,n,r,a){e!==t&&de(t,(function(s,o){if(a||(a=new re),Re(s))!function(e,t,n,r,a,s,o){var i=_e(e,n),c=_e(t,n),l=o.get(c);if(l)return void se(e,n,l);var u=s?s(i,c,n+"",e,t,o):void 0,p=void 0===u;if(p){var h=ve(c),f=!h&&Te(c),g=!h&&!f&&xe(c);u=c,h||f||g?ve(i)?u=i:De(A=i)&&Pe(A)?u=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(i):f?(p=!1,u=function(e,t){if(t)return e.slice();var n=e.length,r=V?V(n):new e.constructor(n);return e.copy(r),r}(c,!0)):g?(p=!1,m=c,y=!0?(I=m.buffer,E=new I.constructor(I.byteLength),new k(E).set(new k(I)),E):m.buffer,u=new m.constructor(y,m.byteOffset,m.length)):u=[]:function(e){if(!De(e)||ue(e)!=d)return!1;var t=B(e);if(null===t)return!0;var n=x.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&D.call(n)==L}(c)||Ne(c)?(u=i,Ne(i)?u=function(e){return function(e,t,n,r){var a=!n;n||(n={});var s=-1,o=t.length;for(;++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?ce(n,i,c):oe(n,i,c)}return n}(e,we(e))}(i):Re(i)&&!$e(i)||(u=function(e){return"function"!=typeof e.constructor||Ce(e)?{}:Z(B(e))}(c))):p=!1}var m,y,I,E;var A;p&&(o.set(c,u),a(u,c,r,s,o),o.delete(c));se(e,n,u)}(e,t,o,n,ge,r,a);else{var i=r?r(_e(e,o),s,o+"",e,t,a):void 0;void 0===i&&(i=s),se(e,o,i)}}),we)}function me(e,t){return Se(function(e,t,n){return t=z(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=z(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),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)}(e,this,i)}}(e,t,Fe),e+"")}var ye=Y?function(e,t){return Y(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Fe;function Ie(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function Ee(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return he(n)?n:void 0}function Ae(e,t){var n=typeof e;return!!(t=null==t?a:t)&&("number"==n||"symbol"!=n&&f.test(e))&&e>-1&&e%1==0&&e<t}function Ce(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||O)}function _e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Se=function(e){var t=0,n=0;return function(){var r=X(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ye);function be(e,t){return e===t||e!=e&&t!=t}var Ne=pe(function(){return arguments}())?pe:function(e){return De(e)&&x.call(e,"callee")&&!W.call(e,"callee")},ve=Array.isArray;function Pe(e){return null!=e&&Oe(e.length)&&!$e(e)}var Te=K||function(){return!1};function $e(e){if(!Re(e))return!1;var t=ue(e);return t==i||t==c||t==o||t==u}function Oe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Re(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function De(e){return null!=e&&"object"==typeof e}var xe=b?function(e){return function(t){return e(t)}}(b):function(e){return De(e)&&Oe(e.length)&&!!g[ue(e)]};function we(e){return Pe(e)?ae(e,!0):fe(e)}var Me,Le=(Me=function(e,t,n,r){ge(e,t,n,r)},me((function(e,t){var n=-1,r=t.length,a=r>1?t[r-1]:void 0,s=r>2?t[2]:void 0;for(a=Me.length>3&&"function"==typeof a?(r--,a):void 0,s&&function(e,t,n){if(!Re(n))return!1;var r=typeof t;return!!("number"==r?Pe(n)&&Ae(t,n.length):"string"==r&&t in n)&&be(n[t],e)}(t[0],t[1],s)&&(a=r<3?void 0:a,r=1),e=Object(e);++n<r;){var o=t[n];o&&Me(e,o,n,a)}return e})));function Fe(e){return e}e.exports=Le},835:(e,t,n)=>{var r="__lodash_hash_undefined__",a=1/0,s=9007199254740991,o="[object Function]",i="[object GeneratorFunction]",c="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d=/^\w*$/,u=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,I=m||y||Function("return this")();var E,A=Array.prototype,C=Function.prototype,_=Object.prototype,S=I["__core-js_shared__"],b=(E=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",N=C.toString,v=_.hasOwnProperty,P=_.toString,T=RegExp("^"+N.call(v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=I.Symbol,O=A.splice,R=G(I,"Map"),D=G(Object,"create"),x=$?$.prototype:void 0,w=x?x.toString:void 0;function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e,t,n){var r=e[t];v.call(e,t)&&K(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function U(e,t){for(var n=e.length;n--;)if(K(e[n][0],t))return n;return-1}function k(e){if(!X(e)||(t=e,b&&b in t))return!1;var t,n=function(e){var t=X(e)?P.call(e):"";return t==o||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?T:f;return n.test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function V(e,t,n,r){if(!X(e))return e;t=function(e,t){if(z(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||J(e))return!0;return d.test(e)||!l.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return z(e)?e:H(e)}(t);for(var a=-1,s=t.length,o=s-1,i=e;null!=i&&++a<s;){var c=q(t[a]),u=n;if(a!=o){var p=i[c];void 0===(u=r?r(p,c,i):void 0)&&(u=X(p)?p:W(t[a+1])?[]:{})}j(i,c,u),i=i[c]}return e}function B(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return k(n)?n:void 0}function W(e,t){return!!(t=null==t?s:t)&&("number"==typeof e||g.test(e))&&e>-1&&e%1==0&&e<t}M.prototype.clear=function(){this.__data__=D?D(null):{}},M.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},M.prototype.get=function(e){var t=this.__data__;if(D){var n=t[e];return n===r?void 0:n}return v.call(t,e)?t[e]:void 0},M.prototype.has=function(e){var t=this.__data__;return D?void 0!==t[e]:v.call(t,e)},M.prototype.set=function(e,t){return this.__data__[e]=D&&void 0===t?r:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():O.call(t,n,1),!0)},L.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},L.prototype.has=function(e){return U(this.__data__,e)>-1},L.prototype.set=function(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},F.prototype.clear=function(){this.__data__={hash:new M,map:new(R||L),string:new M}},F.prototype.delete=function(e){return B(this,e).delete(e)},F.prototype.get=function(e){return B(this,e).get(e)},F.prototype.has=function(e){return B(this,e).has(e)},F.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=Y((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(J(e))return w?w.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(p,(function(e,t,r,a){n.push(r?a.replace(h,"$1"):t||e)})),n}));function q(e){if("string"==typeof e||J(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function Y(e,t){if("function"!=typeof e||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),o};return n.cache=new(Y.Cache||F),n}function K(e,t){return e===t||e!=e&&t!=t}Y.Cache=F;var z=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function J(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&P.call(e)==c}e.exports=function(e,t,n){return null==e?e:V(e,t,n)}},521:(e,t,n)=>{var r="__lodash_hash_undefined__",a=1/0,s="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,d=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,g="object"==typeof self&&self&&self.Object===Object&&self,m=f||g||Function("return this")();var y,I=Array.prototype,E=Function.prototype,A=Object.prototype,C=m["__core-js_shared__"],_=(y=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=E.toString,b=A.hasOwnProperty,N=A.toString,v=RegExp("^"+S.call(b).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m.Symbol,T=I.splice,$=V(m,"Map"),O=V(Object,"create"),R=P?P.prototype:void 0,D=R?R.toString:void 0;function x(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!=n&&r!=r)return a;return-1}function F(e){if(!Y(e)||(t=e,_&&_ in t))return!1;var t,n=function(e){var t=Y(e)?N.call(e):"";return t==s||t==o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?v:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function j(e,t){e=function(e,t){return 1==t.length?e:function(e,t){for(var n=0,r=(t=B(t,e)?[t]:U(t)).length;null!=e&&n<r;)e=e[W(t[n++])];return n&&n==r?e:void 0}(e,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}(t,0,-1))}(e,t=B(t,e)?[t]:U(t));var n,r,a=W((r=(n=t)?n.length:0)?n[r-1]:void 0);return!(null!=e&&b.call(e,a))||delete e[a]}function U(e){return q(e)?e:G(e)}function k(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function V(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return F(n)?n:void 0}function B(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!K(e))||(l.test(e)||!c.test(e)||null!=t&&e in Object(t))}x.prototype.clear=function(){this.__data__=O?O(null):{}},x.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},x.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return n===r?void 0:n}return b.call(t,e)?t[e]:void 0},x.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:b.call(t,e)},x.prototype.set=function(e,t){return this.__data__[e]=O&&void 0===t?r:t,this},w.prototype.clear=function(){this.__data__=[]},w.prototype.delete=function(e){var t=this.__data__,n=L(t,e);return!(n<0)&&(n==t.length-1?t.pop():T.call(t,n,1),!0)},w.prototype.get=function(e){var t=this.__data__,n=L(t,e);return n<0?void 0:t[n][1]},w.prototype.has=function(e){return L(this.__data__,e)>-1},w.prototype.set=function(e,t){var n=this.__data__,r=L(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},M.prototype.clear=function(){this.__data__={hash:new x,map:new($||w),string:new x}},M.prototype.delete=function(e){return k(this,e).delete(e)},M.prototype.get=function(e){return k(this,e).get(e)},M.prototype.has=function(e){return k(this,e).has(e)},M.prototype.set=function(e,t){return k(this,e).set(e,t),this};var G=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(K(e))return D?D.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(u,(function(e,t,r,a){n.push(r?a.replace(p,"$1"):t||e)})),n}));function W(e){if("string"==typeof e||K(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function H(e,t){if("function"!=typeof e||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),o};return n.cache=new(H.Cache||M),n}H.Cache=M;var q=Array.isArray;function Y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function K(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t){return null==e||j(e,t)}},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},654:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AsYouType:()=>oa,AsYouTypeCustom:()=>sa,DIGITS:()=>ee,DIGIT_PLACEHOLDER:()=>_r,Metadata:()=>pa,ParseError:()=>C,PhoneNumber:()=>ya,PhoneNumberMatcher:()=>yr,PhoneNumberSearch:()=>Wa,PhoneNumberSearchCustom:()=>Ua,default:()=>xt,findNumbers:()=>ar,findPhoneNumbers:()=>Ba,findPhoneNumbersCustom:()=>ka,findPhoneNumbersInText:()=>ur,format:()=>Sa,formatCustom:()=>_a,formatIncompletePhoneNumber:()=>ma,formatNumber:()=>Sa,formatRFC3966:()=>Me,getCountries:()=>la,getCountryCallingCode:()=>da,getCountryCallingCodeCustom:()=>k,getExampleNumber:()=>fa,getExtPrefix:()=>ua,getNumberType:()=>Ta,getNumberTypeCustom:()=>va,getPhoneCode:()=>da,getPhoneCodeCustom:()=>k,isPossibleNumber:()=>Oa,isPossiblePhoneNumber:()=>Gt,isSupportedCountry:()=>ia,isValidNumber:()=>Da,isValidNumberCustom:()=>Ra,isValidNumberForRegion:()=>wa,isValidPhoneNumber:()=>jt,parse:()=>Ea,parseCustom:()=>Ia,parseDigits:()=>ne,parseIncompletePhoneNumber:()=>se,parseNumber:()=>Ea,parsePhoneNumber:()=>Pt,parsePhoneNumberCharacter:()=>oe,parsePhoneNumberFromString:()=>xt,parsePhoneNumberWithError:()=>Pt,parseRFC3966:()=>we,searchNumbers:()=>or,searchPhoneNumbers:()=>Ga,searchPhoneNumbersCustom:()=>Va,searchPhoneNumbersInText:()=>mr,validatePhoneNumberLength:()=>Kt});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(?: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,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\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])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[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}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-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","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-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|[24-689])\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,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)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\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-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\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","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],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|50|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]|33|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-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-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","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],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{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[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[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]|91"]],["(\\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-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-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]|31)"],"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,"528[89]"],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-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"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,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\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","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|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","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{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"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","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,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","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,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-489]\\d|55)\\d{6}",[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","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]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[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(?:(?:2[14]|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|4[47])|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(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|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]|28|3[129]|4[1-35689]|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[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|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|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|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",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[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,10}|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",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|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[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}",[6,7,8,9,10,11]],["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","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|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",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-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",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"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",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{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","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|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",["30[0135-9]"],"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-7]|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","(?:[245]\\d|33|77|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",["2(?:[0367]|4[3-8])"]],["(\\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",["2(?:[0367]|4[3-8])"]],["(\\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]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|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{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-467]|5[0-3]|8[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}"]]],MC:["377","00","(?:[3489]|6\\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",["6"],"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","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,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",["[12]1"],"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","(?:596\\d|7091)\\d{5}|(?:69|[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","38\\d{6}|[78]\\d{9,13}|(?:20|9\\d)\\d{8}",[8,10,11,12,13,14],[["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["3"],"0$1"],["(\\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","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],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",["(?: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","(?: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","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"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","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,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",["[26]1|3[289]|4[1246-8]|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[16]|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,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[013]|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,"3[04-689]|[489]",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","92\\d{7}|(?:[15]|8\\d)\\d{8}",[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{3,4})","$1 $2 $3",["81"],"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)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\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-8]"]]]],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","[267]\\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",["[267]"]],["(\\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|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-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{8}",[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",["[0-57-9]"]]],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-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"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{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?: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,[["(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[0-468]))\\d{4}|(?:2742|305[3-9]|472[247-9]|505[2-57-9]|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-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|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-47-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-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|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-389]|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]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\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"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["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","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?: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|51"]],["(\\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})|50\\d{3})\\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,r.key,r)}}function f(e){var t=I();return function(){var n,r=A(e);if(t){var a=A(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return 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 g(e)}(this,n)}}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){var t="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;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,r)}function r(){return y(e,arguments,A(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),E(r,e)},m(e)}function y(e,t,n){return y=I()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&E(a,n.prototype),a},y.apply(null,arguments)}function I(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function E(e,t){return E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},E(e,t)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}var C=function(e){!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&&E(e,t)}(s,e);var t,n,r,a=f(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=a.call(this,e),Object.setPrototypeOf(g(t),s.prototype),t.name=t.constructor.name,t}return t=s,n&&h(t.prototype,n),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(m(Error));function _(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 b(e){return null!=e&&e.constructor===S}function N(e){return N="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},N(e)}function v(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,r.key,r)}}function T(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var $=" ext. ",O=/^\d+$/,R=function(){function e(t){v(this,e),F(t),this.metadata=t,B.call(this,t)}return T(e,[{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){if(e&&O.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new D(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw new Error("Unknown calling code: ".concat(t));this.numberingPlan=new D(this.getNumberingPlanMetadata(t),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}}]),e}(),D=function(){function e(t,n){v(this,e),this.globalMetadataObject=n,this.metadata=t,B.call(this,n.metadata)}return T(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{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.getDefaultCountryMetadataForRegion())||[];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.getDefaultCountryMetadataForRegion())}},{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.getDefaultCountryMetadataForRegion())}},{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?$:this.metadata[13]||$}}]),e}(),x=function(){function e(t,n){v(this,e),this._format=t,this.metadata=n}return T(e,[{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()}}]),e}(),w=/^\(?\$1\)?$/,M=function(){function e(t,n){v(this,e),this.type=t,this.metadata=n}return T(e,[{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()}}]),e}();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 F(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!b(e)||!b(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(b(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+j(e)+": "+e,"."))}var j=function(e){return N(e)};function U(e,t){return(t=new R(t)).hasCountry(e)?t.country(e).ext():$}function k(e,t){if((t=new R(t)).hasCountry(e))return t.country(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===_(t,"1.2.0")?this.v2=!0:-1===_(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+"]*",Y=new RegExp("^[++]{0,1}(?:["+d+"]*["+c+"]){1,2}$","i"),K=q+"(?:"+W()+")?",z=new RegExp("^"+H+"$|^"+K+"$","i");function X(e){return e.length>=s&&z.test(e)}var J=new RegExp("(?:"+W()+")$","i");function Q(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)return;if("string"==typeof e)return Z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(e,t)}(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=new 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=Q(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)return;if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ae(e,t)}(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=new 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)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(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=new Array(t);n<t;n++)r[n]=e[n];return r}function le(e,t){return de(e,void 0,t)}function de(e,t,n){var r=n.type(t),a=r&&r.possibleLengths()||n.possibleLengths();if(!a)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===t){if(!n.type("FIXED_LINE"))return de(e,"MOBILE",n);var s=n.type("MOBILE");s&&(a=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}))}(a,s.possibleLengths()))}else if(t&&!r)return"INVALID_LENGTH";var o=e.length,i=a[0];return i===o?"IS_POSSIBLE":i>o?"TOO_SHORT":a[a.length-1]<o?"TOO_LONG":a.indexOf(o,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function ue(e,t,n){if(void 0===t&&(t={}),n=new R(n),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.country(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}}if(n.possibleLengths())return pe(e.phone||e.nationalNumber,n);if(e.countryCallingCode&&n.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,t)}function he(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function fe(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)return;if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ge(e,t)}(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 ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new 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){(n=new R(n)).selectNumberingPlan(e.country,e.countryCallingCode);var r=t.v2?e.nationalNumber:e.phone;if(he(r,n.nationalNumberPattern())){if(Ie(r,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?Ie(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var a,s=fe(me);!(a=s()).done;){var o=a.value;if(Ie(r,o,n))return o}}}}function Ie(e,t,n){return!(!(t=n.type(t))||!t.pattern())&&(!(t.possibleLengths()&&t.possibleLengths().indexOf(e.length)<0)&&he(e,t.pattern()))}function Ee(e,t,n){return t=t||{},(n=new R(n)).selectNumberingPlan(e.country,e.countryCallingCode),n.hasTypes()?void 0!==ye(e,t,n.metadata):he(t.v2?e.nationalNumber:e.phone,n.nationalNumberPattern())}function Ae(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);if(r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(e.length)>=0)return!0;return!1}(t,e,n)})):[]}var Ce=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(Ce);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return e}}}function Se(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 be(e,t){var n=Se(e,t),r=n.carrierCode,a=n.nationalNumber;if(a!==e){if(!function(e,t,n){if(he(e,n.nationalNumberPattern())&&!he(t,n.nationalNumberPattern()))return!1;return!0}(e,a,t))return{nationalNumber:e};if(t.possibleLengths()&&!function(e,t){switch(le(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(a,t))return{nationalNumber:e}}return{nationalNumber:a,carrierCode:r}}function Ne(e,t,n,r){var a=t?k(t,r):n;if(0===e.indexOf(a)){(r=new R(r)).selectNumberingPlan(t,n);var s=e.slice(a.length),o=be(s,r).nationalNumber,i=be(e,r).nationalNumber;if(!he(i,r.nationalNumberPattern())&&he(o,r.nationalNumberPattern())||"TOO_LONG"===le(i,r))return{countryCallingCode:a,number:s}}return{number:e}}function ve(e,t,n,r){if(!e)return{};var a;if("+"!==e[0]){var s=_e(e,t,n,r);if(!s||s===e){if(t||n){var o=Ne(e,t,n,r),c=o.countryCallingCode,l=o.number;if(c)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:c,number:l}}return{number:e}}a=!0,e="+"+s}if("0"===e[1])return{};r=new R(r);for(var d=2;d-1<=i&&d<=e.length;){var u=e.slice(1,d);if(r.hasCallingCode(u))return r.selectNumberingPlan(u),{countryCallingCodeSource:a?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:u,number:e.slice(d)};d++}return{}}function Pe(e){return e.replace(new RegExp("[".concat(d,"]+"),"g")," ").trim()}var Te=/(\$\d)/;function $e(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(Te,t.nationalPrefixFormattingRule()):t.format()));return r?Pe(s):s}var Oe=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Re(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)return;var r,a,s=[],o=!0,i=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(i)throw a}}return s}(e,t)||De(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 De(e,t){if(e){if("string"==typeof e)return xe(e,t);var n=Object.prototype.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)?xe(e,t):void 0}}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function we(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=De(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=Re(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(!X(t))return{};var c={number:t};return n&&(c.ext=n),c}function Me(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:"")}function Le(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)return;if("string"==typeof e)return Fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fe(e,t)}(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=new Array(t);n<t;n++)r[n]=e[n];return r}function je(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 Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(Object(n),!0).forEach((function(t){ke(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ve={formatExtension:function(e,t,n){return"".concat(e).concat(n.ext()).concat(t)}};function Be(e,t,n,r){if(n=n?Ue(Ue({},Ve),n):Ve,r=new R(r),e.country&&"001"!==e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)return e.phone||"";r.selectNumberingPlan(e.countryCallingCode)}var a,s=r.countryCallingCode(),o=n.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return o?He(a=Ge(o,e.carrierCode,"NATIONAL",r,n),e.ext,r,n.formatExtension):"";case"INTERNATIONAL":return o?(a=Ge(o,null,"INTERNATIONAL",r,n),He(a="+".concat(s," ").concat(a),e.ext,r,n.formatExtension)):"+".concat(s);case"E.164":return"+".concat(s).concat(o);case"RFC3966":return Me({number:"+".concat(s).concat(o),ext:e.ext});case"IDD":if(!n.fromCountry)return;var i=function(e,t,n,r,a){var s=k(r,a.metadata);if(s===n){var o=Ge(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():Oe.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,a.metadata);if(i)return"".concat(i," ").concat(n," ").concat(Ge(e,null,"INTERNATIONAL",a))}(o,e.carrierCode,s,n.fromCountry,r);return He(i,e.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function Ge(e,t,n,r,a){var s=We(r.formats(),e);return s?$e(e,s,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!a||!1!==a.nationalPrefix,carrierCode:t,metadata:r}):e}function We(e,t){for(var n,r=Le(e);!(n=r()).done;){var a=n.value;if(a.leadingDigitsPatterns().length>0){var s=a.leadingDigitsPatterns()[a.leadingDigitsPatterns().length-1];if(0!==t.search(s))continue}if(he(t,a.pattern()))return a}}function He(e,t,n,r){return t?r(e,t,n):e}function qe(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 Ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(n),!0).forEach((function(t){Ke(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ze(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,r.key,r)}}var Xe=function(){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("string"==typeof t){if("+"===t[0]&&!n)throw new TypeError("`metadata` argument not passed");if(b(n)&&b(n.countries)){r=n;var a=t;if(!Qe.test(a))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var s=ve(a,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");F(r);var o=function(e,t){var n,r,a=new R(t);Je(e)?(n=e,a.selectNumberingPlan(n),r=a.countryCallingCode()):r=e;return{country:n,countryCallingCode:r}}(t,r),i=o.country,c=o.countryCallingCode;this.country=i,this.countryCallingCode=c,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}var t,n,r;return t=e,(n=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Ae(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 Be(this,e,t?Ye(Ye({},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)}}])&&ze(t.prototype,n),r&&ze(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Je=function(e){return/^[A-Z]{2}$/.test(e)};var Qe=/^\+\d+$/;function Ze(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)return;if("string"==typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return et(e,t)}(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 et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tt(e,t){var n=t.countries,r=(t.defaultCountry,t.metadata);r=new R(r);for(var a,s=Ze(n);!(a=s()).done;){var o=a.value;if(r.country(o),r.leadingDigits()){if(e&&0===e.search(r.leadingDigits()))return o}else if(ye({phone:e,country:o},void 0,r.metadata))return o}}var nt=!1;function rt(e,t){var n=t.nationalNumber,r=t.defaultCountry,a=t.metadata;if(nt&&a.isNonGeographicCallingCode(e))return"001";var s=a.getCountryCodesForCallingCode(e);return s?1===s.length?s[0]:tt(n,{countries:s,defaultCountry:r,metadata:a.metadata}):void 0}var at="+",st="(["+c+"]|[\\-\\.\\(\\)]?)",ot=new RegExp("^\\"+at+st+"*["+c+"]"+st+"*$","g"),it=new RegExp("^("+("["+c+"]+((\\-)*["+c+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+c+"])*")+"\\.?$","g"),ct="tel:",lt=";phone-context=",dt=";isub=";function ut(e,t){var n,r=t.extractFormattedPhoneNumber,a=function(e){var t=e.indexOf(lt);if(t<0)return null;var n=t+lt.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&&(ot.test(e)||it.test(e))}(a))throw new C("NOT_A_NUMBER");if(null===a)n=r(e)||"";else{n="",a.charAt(0)===at&&(n+=a);var s,o=e.indexOf(ct);s=o>=0?o+ct.length:0;var i=e.indexOf(lt);n+=e.substring(s,i)}var c=n.indexOf(dt);if(c>0&&(n=n.substring(0,c)),""!==n)return n}var pt=250,ht=new RegExp("[++"+c+"]"),ft=new RegExp("[^"+c+"#]+$"),gt=!1;function mt(e,t,n){if(t=t||{},n=new R(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry)){if(t.v2)throw new C("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var r=function(e,t,n){var r=ut(e,{extractFormattedPhoneNumber:function(e){return function(e,t,n){if(!e)return;if(e.length>pt){if(n)throw new C("TOO_LONG");return}if(!1===t)return e;var r=e.search(ht);if(r<0)return;return e.slice(r).replace(ft,"")}(e,n,t)}});if(!r)return{};if(!X(r))return function(e){return Y.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),a=r.number,i=r.ext,c=r.error;if(!a){if(t.v2){if("TOO_SHORT"===c)throw new C("TOO_SHORT");throw new C("NOT_A_NUMBER")}return{}}var l=function(e,t,n,r){var a,s=ve(se(e),t,n,r.metadata),o=s.countryCallingCodeSource,i=s.countryCallingCode,c=s.number;if(i)r.selectNumberingPlan(i);else{if(!c||!t&&!n)return{};r.selectNumberingPlan(t,n),t?a=t:gt&&r.isNonGeographicCallingCode(n)&&(a="001"),i=n||k(t,r.metadata)}if(!c)return{countryCallingCodeSource:o,countryCallingCode:i};var l=be(se(c),r),d=l.nationalNumber,u=l.carrierCode,p=rt(i,{nationalNumber:d,defaultCountry:t,metadata:r});p&&(a=p,"001"===p||r.country(a));return{country:a,countryCallingCode:i,countryCallingCodeSource:o,nationalNumber:d,carrierCode:u}}(a,t.defaultCountry,t.defaultCallingCode,n),d=l.country,u=l.nationalNumber,p=l.countryCallingCode,h=l.countryCallingCodeSource,f=l.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new C("INVALID_COUNTRY");return{}}if(!u||u.length<s){if(t.v2)throw new C("TOO_SHORT");return{}}if(u.length>o){if(t.v2)throw new C("TOO_LONG");return{}}if(t.v2){var g=new Xe(p,u,n.metadata);return d&&(g.country=d),f&&(g.carrierCode=f),i&&(g.ext=i),g.__countryCallingCodeSource=h,g}var m=!!(t.extended?n.hasSelectedNumberingPlan():d)&&he(u,n.nationalNumberPattern());return t.extended?{country:d,countryCallingCode:p,carrierCode:f,valid:m,possible:!!m||!(!0!==t.extended||!n.possibleLengths()||!pe(u,n)),phone:u,ext:i}:m?function(e,t,n){var r={country:e,phone:t};n&&(r.ext=n);return r}(d,u,i):{}}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 It(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){Et(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 Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function At(e,t,n){return mt(e,It(It({},t),{},{v2:!0}),n)}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 _t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function St(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)return;var r,a,s=[],o=!0,i=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(i)throw a}}return s}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bt(e,t)}(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 bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nt(e){var t,n,r,a=St(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(!b(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){_t(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 vt(){var e=Nt(arguments);return At(e.text,e.options,e.metadata)}function Pt(){return a(vt,arguments)}function Tt(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 $t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(n),!0).forEach((function(t){Ot(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rt(e,t,n){t&&t.defaultCountry&&!V(t.defaultCountry,n)&&(t=$t($t({},t),{},{defaultCountry:void 0}));try{return At(e,t,n)}catch(e){if(!(e instanceof C))throw e}}function Dt(){var e=Nt(arguments);return Rt(e.text,e.options,e.metadata)}function xt(){return a(Dt,arguments)}function wt(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 Mt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(n),!0).forEach((function(t){Lt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ft(){var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=Rt(t,n=Mt(Mt({},n),{},{extract:!1}),r);return a&&a.isValid()||!1}function jt(){return a(Ft,arguments)}function Ut(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?Ut(Object(n),!0).forEach((function(t){Vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bt(){var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=Rt(t,n=kt(kt({},n),{},{extract:!1}),r);return a&&a.isPossible()||!1}function Gt(){return a(Bt,arguments)}function Wt(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 Ht(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){qt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yt(){var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata;n=Ht(Ht({},n),{},{extract:!1});try{var a=At(t,n,r);(r=new R(r)).selectNumberingPlan(a.countryCallingCode);var s=le(a.nationalNumber,r);if("IS_POSSIBLE"!==s)return s}catch(e){if(e instanceof C)return e.message;throw e}}function Kt(){return a(Yt,arguments)}function zt(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,r.key,r)}}function Xt(e,t,n){return t&&zt(e.prototype,t),n&&zt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Qt=Xt((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;Jt(this,e),this.key=t,this.value=n,this.next=r,this.prev=a})),Zt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;Jt(this,e),this.size=0,this.limit=t,this.head=null,this.tail=null,this.cache={}}return Xt(e,[{key:"put",value:function(e,t){if(this.ensureLimit(),this.head){var n=new Qt(e,t,this.head);this.head.prev=n,this.head=n}else this.head=this.tail=new Qt(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={}}}]),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,r.key,r)}}var tn=function(){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 Zt(t)}var t,n,r;return t=e,(n=[{key:"getPatternForRegExp",value:function(e){var t=this.cache.get(e);return t||(t=new RegExp("^"+e),this.cache.put(e,t)),t}}])&&en(t.prototype,n),r&&en(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function nn(e,t){if(e<0||t<=0||t<e)throw new TypeError;return"{".concat(e,",").concat(t,"}")}function rn(e,t){var n=t.search(e);return n>=0?t.slice(0,n):t}var an="   ᠎ - \u2028\u2029   ",sn="[".concat(an,"]"),on="[^".concat(an,"]"),cn="[".concat("0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9","]"),ln="A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",dn="[".concat(ln,"]"),un=new RegExp(dn),pn="[".concat("$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩$¢£¥₩","]"),hn=new RegExp(pn),fn="[".concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦","]"),gn=new RegExp(fn),mn=new RegExp("[\0-€-ÿĀ-ſḀ-ỿƀ-ɏ̀-ͯ]");function yn(e){return!(!un.test(e)&&!gn.test(e))&&mn.test(e)}function In(e){return"%"===e||hn.test(e)}function En(e,t,n){var r=!0,a=Dt(e,n);if(a||(r=!1,a=Dt(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 An={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()||!Cn(e,n,r))},STRICT_GROUPING:function(e,t){var n=t.candidate,r=t.defaultCountry,a=t.metadata,s=t.regExpCache;return!(!e.isValid()||!Cn(e,n,a)||Sn(e,n)||!_n(e,{defaultCountry:r,metadata:a}))&&bn(e,n,a,vn,s)},EXACT_GROUPING:function(e,t){var n=t.candidate,r=t.defaultCountry,a=t.metadata,s=t.regExpCache;return!(!e.isValid()||!Cn(e,n,a)||Sn(e,n)||!_n(e,{defaultCountry:r,metadata:a}))&&bn(e,n,a,Nn,s)}};function Cn(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"!==En(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 _n(e,t){var n=t.defaultCountry,r=t.metadata;if("FROM_DEFAULT_COUNTRY"!==e.__countryCallingCodeSource)return!0;var a=new R(r);a.selectNumberingPlan(e.countryCallingCode);e.country||rt(e.countryCallingCode,{nationalNumber:e.nationalNumber,defaultCountry:n,metadata:a});var s=e.nationalNumber,o=We(a.numberingPlan.formats(),s);return!o.nationalPrefixFormattingRule()||(!!a.numberingPlan.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||(!o.usesNationalPrefix()||Boolean(e.nationalPrefix)))}function Sn(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 bn(e,t,n,r,a){throw new Error("This part of code hasn't been ported")}function Nn(e,t,n,r){throw new Error("This part of code hasn't been ported")}function vn(e,t,n,r){throw new Error("This part of code hasn't been ported")}var Pn=/[\\/] *x/;function Tn(e){return rn(Pn,e)}var $n=/(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/,On=/[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/,Rn=/^:[0-5]\d/;function Dn(e,t,n){if($n.test(e))return!1;if(On.test(e)){var r=n.slice(t+e.length);if(Rn.test(r))return!1}return!0}var xn="(\\[([",wn=")\\])]",Mn="[^".concat(xn).concat(wn,"]"),Ln="[".concat(xn).concat(u,"]"),Fn=new RegExp("^"+Ln),jn=nn(0,3),Un=new RegExp("^(?:[(\\[([])?(?:"+Mn+"+["+wn+"])?"+Mn+"+(?:["+xn+"]"+Mn+"+["+wn+"])"+jn+Mn+"*$"),kn=/\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;function Vn(e,t,n,r){if(Un.test(e)&&!kn.test(e)){if("POSSIBLE"!==r){if(t>0&&!Fn.test(e)){var a=n[t-1];if(In(a)||yn(a))return!1}var s=t+e.length;if(s<n.length){var o=n[s];if(In(o)||yn(o))return!1}}return!0}}function Bn(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)return;if("string"==typeof e)return Gn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gn(e,t)}(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 Gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wn(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,r.key,r)}}var Hn=W(),qn=["\\/+(.*)/","(\\([^(]*)","(?:".concat(sn,"-|-").concat(sn,")").concat(sn,"*(.+)"),"[‒-―-]".concat(sn,"*(.+)"),"\\.+".concat(sn,"*([^.]+)"),"".concat(sn,"+(").concat(on,"+)")],Yn=nn(0,2),Kn=nn(0,4),zn=o+i,Xn=nn(0,zn),Jn="[".concat(d,"]")+Kn,Qn=cn+nn(1,zn),Zn="(?:"+Ln+Jn+")"+Yn+Qn+"(?:"+Jn+Qn+")"+Xn+"(?:"+Hn+")?",er=new RegExp("[^".concat("0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9").concat(ln,"#]+$")),tr=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,nr=function(){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||tr}).leniency)throw new TypeError("`leniency` is required");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`");if(this.text=t,this.options=n,this.metadata=r,this.leniency=An[n.leniency],!this.leniency)throw new TypeError('Unknown leniency: "'.concat(n.leniency,'"'));this.maxTries=n.maxTries,this.PATTERN=new RegExp(Zn,"ig"),this.state="NOT_READY",this.searchIndex=0,this.regExpCache=new tn(32)}var t,n,r;return t=e,n=[{key:"find",value:function(){for(var e;this.maxTries>0&&null!==(e=this.PATTERN.exec(this.text));){var t=e[0],n=e.index;if(Dn(t=Tn(t),n,this.text)){var r=this.parseAndVerify(t,n,this.text)||this.extractInnerMatch(t,n,this.text);if(r){if(this.options.v2)return{startsAt:r.startsAt,endsAt:r.endsAt,number:r.phoneNumber};var a=r.phoneNumber,s={startsAt:r.startsAt,endsAt:r.endsAt,phone:a.nationalNumber};return a.country?s.country=a.country:s.countryCallingCode=a.countryCallingCode,a.ext&&(s.ext=a.ext),s}}this.maxTries--}}},{key:"extractInnerMatch",value:function(e,t,n){for(var r,a=Bn(qn);!(r=a()).done;)for(var s=r.value,o=!0,i=void 0,c=new RegExp(s,"g");this.maxTries>0&&null!==(i=c.exec(e));){if(o){var l=rn(er,e.slice(0,i.index)),d=this.parseAndVerify(l,t,n);if(d)return d;this.maxTries--,o=!1}var u=rn(er,i[1]),p=e.indexOf(u,i.index),h=this.parseAndVerify(u,t+p,n);if(h)return h;this.maxTries--}}},{key:"parseAndVerify",value:function(e,t,n){if(Vn(e,t,n,this.options.leniency)){var r=Dt(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.lastMatch?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}}],n&&Wn(t.prototype,n),r&&Wn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function rr(){for(var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=new nr(t,n,r),s=[];a.hasNext();)s.push(a.next());return s}function ar(){return a(rr,arguments)}function sr(){var e,t,n,r=Nt(arguments),a=r.text,s=r.options,o=r.metadata,i=new nr(a,s,o);return e={},t=Symbol.iterator,n=function(){return{next:function(){return i.hasNext()?{done:!1,value:i.next()}:{done:!0}}}},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function or(){return a(sr,arguments)}function ir(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?ir(Object(n),!0).forEach((function(t){lr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ir(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dr(){for(var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=new nr(t,cr(cr({},n),{},{v2:!0}),r),s=[];a.hasNext();)s.push(a.next());return s}function ur(){return a(dr,arguments)}function pr(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 hr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pr(Object(n),!0).forEach((function(t){fr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gr(){var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=new nr(t,hr(hr({},n),{},{v2:!0}),r);return fr({},Symbol.iterator,(function(){return{next:function(){return a.hasNext()?{done:!1,value:a.next()}:{done:!0}}}}))}function mr(){return a(gr,arguments)}function yr(e,t){return nr.call(this,e,t,r)}function Ir(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,r.key,r)}}yr.prototype=Object.create(nr.prototype,{}),yr.prototype.constructor=yr;var Er=function(){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}var t,n,r;return t=e,(n=[{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.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=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}}])&&Ir(t.prototype,n),r&&Ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ar(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)return;if("string"==typeof e)return Cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cr(e,t)}(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 Cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _r="x",Sr=new RegExp(_r);function br(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function Nr(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 vr(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=Pr(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:s,metadata:r});if(o)return o}return Pr(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:s,metadata:r})}(e,t,{metadata:r,shouldTryNationalPrefixFormattingRule:a,getSeparatorAfterNationalPrefix:s})}function Pr(e,t,n){var r=n.metadata,a=n.useNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix,o=$e(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:a,metadata:r});if(a||(e.nationalPrefix?o=e.nationalPrefix+s(t)+o:e.complexPrefixBeforeNationalSignificantNumber&&(o=e.complexPrefixBeforeNationalSignificantNumber+" "+o)),function(e,t){return ne(e)===t.getNationalDigits()}(o,e))return o}function Tr(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,r.key,r)}}var $r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,(n=[{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([xr(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(Dr);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(xr(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(xr(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:Or(r)});break;default:throw new Error("Unknown operator: ".concat(n))}a&&this.parsePattern(a)}else{if(Rr.test(e))throw new Error("Illegal characters found in a pattern: ".concat(e));this.getContext().instructions=this.getContext().instructions.concat(e.split(""))}}}])&&Tr(t.prototype,n),r&&Tr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Or(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 Rr=/[\(\)\[\]\?\:\|]/,Dr=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function xr(e){return 1===e.length?e[0]:e}function wr(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)return;if("string"==typeof e)return Mr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mr(e,t)}(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 Mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lr(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,r.key,r)}}var Fr=function(){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 $r).parse(t)}var t,n,r;return t=e,n=[{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=jr(e.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||t)return n}}],n&&Lr(t.prototype,n),r&&Lr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function jr(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=jr(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=wr(t.args);!(c=l()).done;){var d=jr(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=wr(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 Ur(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)return;if("string"==typeof e)return kr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kr(e,t)}(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 kr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vr(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,r.key,r)}}var Br=br("9",15),Gr=/[- ]/,Wr=function(){return/\[([^\[\]])*\]/g},Hr=function(){return/\d(?=[^,}][^,}])/g},qr=new RegExp("["+d+"]*\\$1["+d+"]*(\\$\\d["+d+"]*)*$"),Yr=function(){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()}var t,n,r;return t=e,n=[{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,r))for(var s,o=Ur(this.matchingFormats);!(s=o()).done;){var i=s.value,c=vr(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,_r),t),this.populatedNationalNumberTemplate=c,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(_r),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 Fr(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?"break":qr.test(n.getFormatFormat(r,e.international))?n.createTemplateForFormat(r,e)?(n.chosenFormat=r,"break"):(n.matchingFormats=n.matchingFormats.filter((function(e){return e!==r})),"continue"):"continue"},a=Ur(this.matchingFormats.slice());!(t=a()).done;){var s=r();if("break"===s)break}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()&&Gr.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(_r,t+1),n++;return Nr(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,_r)+br(_r,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.complexPrefixBeforeNationalSignificantNumber,o=e.pattern();o=o.replace(Wr(),"\\d").replace(Hr(),"\\d");var i=Br.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(Te,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/,_r),h--}var f=i.replace(new RegExp(o),u).replace(new RegExp("9","g"),_r);return d||(s?f=br(_r,s.length)+" "+f:a&&(f=br(_r,a.length)+this.getSeparatorAfterNationalPrefix(e)+f)),r&&(f=Pe(f)),f}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,n){for(var r,a=Ar(n.split(""));!(r=a()).done;){var s=r.value;if(e.slice(t+1).search(Sr)<0)return;t=e.search(Sr),e=e.replace(Sr,s)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(t)return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],Nr(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}}}],n&&Vr(t.prototype,n),r&&Vr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kr(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)return;var r,a,s=[],o=!0,i=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(i)throw a}}return s}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zr(e,t)}(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 zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}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,r.key,r)}}var Jr=new RegExp("^"+("["+d+c+"]+")+"$","i"),Qr="(?:[++]["+d+c+"]*|["+d+c+"]+)",Zr=new RegExp("[^"+d+c+"]+.*$"),ea=/[^\d\[\]]/,ta=function(){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}var t,n,r;return t=e,(n=[{key:"input",value:function(e,t){var n,r=function(e){var t=function(e){var t=function(e){var t,n=e.search(Qr);if(!(n<0))return"+"===(e=e.slice(n))[0]&&(t=!0,e=e.slice(1)),e=e.replace(Zr,""),t&&(e="+"+e),e}(e)||"";return"+"===t[0]?[t.slice(1),!0]:[t]}(e),n=Kr(t,2),r=n[0],a=n[1];return Jr.test(r)||(r=""),[r,a]}(e),a=Kr(r,2),s=a[0],o=a[1],i=ne(s);return o&&(t.digits||(t.startInternationalNumber(),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=ve("+"+e.getDigitsWithoutInternationalPrefix(),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&&ea.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var n=Se(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=Se(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,i=r.lastIndexOf(n);if(i>=0&&i===r.length-n.length){o=!0;var c=r.slice(0,i);c!==e&&(s=c)}a({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:n,nationalSignificantNumberMatchesInput:o,complexPrefixBeforeNationalSignificantNumber: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=Ne(e.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=t.countryCallingCode;if(t.number,n)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:n}),!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)}))}}])&&Xr(t.prototype,n),r&&Xr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function na(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)return;var r,a,s=[],o=!0,i=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(i)throw a}}return s}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ra(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ra(e,t)}(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 ra(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aa(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,r.key,r)}}var sa=function(){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=na(this.getCountryAndCallingCode(t),2),a=r[0],s=r[1];this.defaultCountry=a,this.defaultCallingCode=s,this.reset()}var t,n,r;return t=e,(n=[{key:"getCountryAndCallingCode",value:function(e){var t,n;return e&&(b(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 Er({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 Yr({state:this.state,metadata:this.metadata}),this.parser=new ta({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.complexPrefixBeforeNationalSignificantNumber,r=e.nationalPrefix,a=t,s=n||r;return s&&(a=s+a),a}},{key:"getNonFormattedNumber",value:function(){var e=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(e?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,_r)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(rt(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{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,a=this._getCountry();if(t&&(a||r)){if(a&&a===this.defaultCountry){var s=new R(this.metadata.metadata);s.selectNumberingPlan(a);var o=s.numberingPlan.callingCode(),i=this.metadata.getCountryCodesForCallingCode(o);if(i.length>1){var c=tt(t,{countries:i,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});c&&(a=c)}}var l=new Xe(a||r,t,this.metadata.metadata);return n&&(l.carrierCode=n),l}}},{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:"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()||""}}])&&aa(t.prototype,n),r&&aa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function oa(e){return sa.call(this,e,r)}function ia(){return a(V,arguments)}function ca(e){return new R(e).getCountries()}function la(){return a(ca,arguments)}function da(){return a(k,arguments)}function ua(){return a(U,arguments)}function pa(){return R.call(this,r)}function ha(e,t,n){if(t[e])return new Xe(e,t[e],n)}function fa(){return a(ha,arguments)}function ga(e,t,n){return n||(n=t,t=void 0),new sa(t,n).input(e)}function ma(){return a(ga,arguments)}function ya(e){return Xe.call(this,e,r)}function Ia(){var e=Nt(arguments);return mt(e.text,e.options,e.metadata)}function Ea(){return a(Ia,arguments)}function Aa(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)return;var r,a,s=[],o=!0,i=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(i)throw a}}return s}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ca(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ca(e,t)}(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 Ca(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _a(){var e=function(e){var t,n,r,a,s=Aa(Array.prototype.slice.call(e),5),o=s[0],i=s[1],c=s[2],l=s[3],d=s[4];if("string"==typeof o)if("string"==typeof c)n=c,d?(r=l,a=d):a=l,t=mt(o,{defaultCountry:i,extended:!0},a);else{if("string"!=typeof i)throw new Error("`format` argument not passed to `formatNumber(number, format)`");n=i,l?(r=c,a=l):a=c,t=mt(o,{extended:!0},a)}else{if(!b(o))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");t=o,n=i,l?(r=c,a=l):a=c}"International"===n?n="INTERNATIONAL":"National"===n&&(n="NATIONAL");return{input:t,format:n,options:r,metadata:a}}(arguments);return Be(e.input,e.format,e.options,e.metadata)}function Sa(){return a(_a,arguments)}function ba(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)return;var r,a,s=[],o=!0,i=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(i)throw a}}return s}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Na(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Na(e,t)}(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 Na(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function va(){var e=Pa(arguments),t=e.input,n=e.options,r=e.metadata;if(t.phone)return ye(t,n,r)}function Pa(e){var t,n,r=ba(Array.prototype.slice.call(e),4),a=r[0],s=r[1],o=r[2],i=r[3],c={};if("string"==typeof a)b(s)?(o?(c=s,n=o):n=s,t=X(a)?mt(a,void 0,n):{}):(i?(c=o,n=i):n=o,t=X(a)?mt(a,{defaultCountry:s},n):{});else{if(!b(a))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");t=a,o?(c=s,n=o):n=s}return{input:t,options:c,metadata:n}}function Ta(){return a(va,arguments)}function $a(){var e=Pa(arguments),t=e.input,n=e.options,r=e.metadata;return!!(t.phone||n&&n.v2)&&ue(t,n,r)}function Oa(){return a($a,arguments)}function Ra(){var e=Pa(arguments),t=e.input,n=e.options,r=e.metadata;return!!t.phone&&Ee(t,n,r)}function Da(){return a(Ra,arguments)}function xa(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)}(X(e)?mt(e,{defaultCountry:t},n):{},t,void 0,n)}function wa(){return a(xa,arguments)}function Ma(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,r.key,r)}}oa.prototype=Object.create(sa.prototype,{}),oa.prototype.constructor=oa,pa.prototype=Object.create(R.prototype,{}),pa.prototype.constructor=pa,ya.prototype=Object.create(Xe.prototype,{}),ya.prototype.constructor=ya;W();var La=new RegExp("^["+l+"]+"),Fa=new RegExp("["+d+"]+$");function ja(e,t,n){void 0===t&&(t={});var r,a,s,o=new Ua(e,t,n);return r={},a=Symbol.iterator,s=function(){return{next:function(){return o.hasNext()?{done:!1,value:o.next()}:{done:!0}}}},a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}var Ua=function(){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(K,"ig")}var t,n,r;return t=e,n=[{key:"find",value:function(){var e=this.regexp.exec(this.text);if(e){var t=e[0],n=e.index;t=t.replace(La,""),n+=e[0].length-t.length,t=Tn(t=t.replace(Fa,""));var r=this.parseCandidate(t,n);return r||this.find()}}},{key:"parseCandidate",value:function(e,t){if(Dn(e,t,this.text)&&Vn(e,t,this.text,this.options.extended?"POSSIBLE":"VALID")){var n=mt(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}}],n&&Ma(t.prototype,n),r&&Ma(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ka(){var e=Nt(arguments);return function(e,t,n){void 0===t&&(t={});for(var r=new Ua(e,t,n),a=[];r.hasNext();)a.push(r.next());return a}(e.text,e.options,e.metadata)}function Va(){var e=Nt(arguments);return ja(e.text,e.options,e.metadata)}function Ba(){return a(ka,arguments)}function Ga(){return a(Va,arguments)}function Wa(e,t){Ua.call(this,e,t,r)}Wa.prototype=Object.create(Ua.prototype,{}),Wa.prototype.constructor=Wa}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},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})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e={};n.r(e),n.d(e,{buildContextName:()=>H,buildModalContext:()=>z,buildTransientContextName:()=>q,getContainerIdFromContext:()=>J,getParentContext:()=>X,getParentContextName:()=>W,getTargetFromContext:()=>K,getTransientContext:()=>Y});var t={};n.r(t),n.d(t,{getResolvedTargetName:()=>yt,getRoutingInfo:()=>It,getSemanticURLFromRoutingInfo:()=>Et});var r={};n.r(r),n.d(r,{evaluate:()=>zt,handleChange:()=>Yt,hasDeclareExpression:()=>qt,updateDeclareExpressions:()=>Kt});var a={};n.r(a),n.d(a,{publishExpressions:()=>xr,publishResponse:()=>wr});var s={};n.r(s),n.d(s,{hasBrowserEnv:()=>za,hasStandardBrowserEnv:()=>Ja,hasStandardBrowserWebWorkerEnv:()=>Qa,navigator:()=>Xa,origin:()=>Za});var o={};n.r(o),n.d(o,{doesRestApiExist:()=>Zi,getCancelTokenSource:()=>ec,getCaseApi:()=>rc,getHeaderProcessor:()=>Xi,invokeCustomRestApi:()=>Qi,invokeRestApi:()=>Ji,isRequestCanceled:()=>tc,registerInterceptor:()=>nc});var i={};n.r(i),n.d(i,{CONTAINER_NAMES:()=>lu,CONTAINER_TYPES:()=>cu,addRootContainerItem:()=>Bu,areContainerItemsPresent:()=>gu,clearTransientData:()=>Ku,closeContainerItem:()=>Vu,getActiveContainerItemContext:()=>vu,getActiveContainerItemIDFromRoutingInfo:()=>op,getActiveContainerItemName:()=>_u,getActiveContext:()=>np,getChildContainerItems:()=>Pu,getChildContainers:()=>Tu,getChildContainersContexts:()=>$u,getContainerAPI:()=>Ju,getContainerAccessOrder:()=>fu,getContainerData:()=>uu,getContainerItemByKey:()=>Eu,getContainerItemData:()=>pu,getContainerItemName:()=>yu,getContainerItems:()=>hu,getContainerLimit:()=>wu,getContainerParentContext:()=>sp,getContainerType:()=>Cu,getContextByTargetAndKey:()=>ap,getDataContextName:()=>Nu,getFlowContainer:()=>cp,getLeastRecentlyUsedNonDirtyContainerItemID:()=>Uu,getParentContainerItem:()=>ip,getRootContainerName:()=>tp,getSuggestionContexts:()=>Ou,getTargetFromContainerItemID:()=>ku,getTransientItems:()=>Hu,hasContainerItems:()=>xu,isContainerDirty:()=>ju,isContainerInitialized:()=>Au,isContainerItemActive:()=>Su,isContainerItemContextBeingUsedInOtherContainers:()=>Wu,isContainerItemExists:()=>mu,isContainerLimitReached:()=>Lu,isContainerMultipleMode:()=>Du,isContainerSingleMode:()=>Ru,purgeTransientData:()=>zu,removeContainer:()=>Qu,replaceTransientData:()=>Yu,resetContainersPayload:()=>Fu,setContainerLimit:()=>Mu,updateCaseContextEtag:()=>ep,updateParentLastUpdateTime:()=>rp,updateRelatedContextEtag:()=>Zu,updateTransientData:()=>qu});var c={};n.r(c),n.d(c,{getAdditionalInfo:()=>oh,getDataPageKeys:()=>rh,getDataPageMetadata:()=>zp,getEmbeddedPropertyMetadata:()=>Bp,getFieldParameters:()=>Zp,getFieldsByClassName:()=>Qp,getGenAICoach:()=>th,getInsight:()=>Jp,getLookUpDataPage:()=>ah,getLookUpDataPageInfo:()=>sh,getParagraph:()=>eh,getPersonalizationMetadata:()=>Xp,getPropertyMetadata:()=>Vp,getResolvedFieldMetadata:()=>ih,getSavableDataPage:()=>nh,isViewExists:()=>Yp,mergeStore:()=>kp,resolveNavigation:()=>Kp,resolveView:()=>qp,updateNavigationStore:()=>Wp,updateStores:()=>Hp,updateViewStore:()=>Gp});var l={};n.r(l),n.d(l,{dispatch:()=>fh,doesContextExist:()=>$h,getActionType:()=>Ch,getContextValue:()=>Eh,getDataObject:()=>gh,getReferenceTokens:()=>uh,getSharedDataObject:()=>mh,getStore:()=>hh,getValue:()=>Ih,isMergeable:()=>Sh,lookupContextValue:()=>Ah,mergeDeep:()=>Nh,performReplace:()=>bh,removeItem:()=>_h,replaceValue:()=>Ph,resetStore:()=>Th,setStore:()=>ph,updateValue:()=>vh});var d={};n.r(d),n.d(d,{activateContainerItem:()=>sf,addContainerItem:()=>zh,addMessages:()=>of,addSharedData:()=>yf,addTransientItem:()=>Xh,addWork:()=>Hh,clearTransientData:()=>Qh,createWork:()=>Uh,error:()=>mf,finishAssignment:()=>pf,initContainers:()=>Yh,listAction:()=>Ef,loadView:()=>Gh,mergeData:()=>Vh,openAssignment:()=>hf,openWorkByHandle:()=>qh,postProcess:()=>gf,purgeTransientData:()=>ef,removeAllTransientItems:()=>lf,removeContainerItem:()=>cf,removeSharedData:()=>If,removeTransientItem:()=>df,replaceContainerItem:()=>uf,replaceTransientData:()=>Zh,resetContainers:()=>Kh,resetLoading:()=>rf,setLoading:()=>nf,setSharedProperty:()=>Cf,setStateProperty:()=>_f,showCasePreview:()=>Af,showHarness:()=>Bh,showHistory:()=>ff,showPage:()=>Wh,upMergeAndRemoveContainerItem:()=>af,updateContainerItem:()=>tf,updateTransientData:()=>Jh});var u={};n.r(u),n.d(u,{fetchViewResources:()=>mE,updateViewResources:()=>gE});var p=n(216),h=n.n(p);let f,g,m;const y=e=>{e&&(f=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},f.BASEURL=e.server,f.ACTIONURL=e["action-end-point"],f.DATAURL=e["data-end-point"],m=e.reAuthUrl)},I=()=>m,E=()=>f.BASEURL,A=e=>fetch(`${f.BASEURL}${f.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),C=e=>{g=e},_=()=>g;var S=n(953),b=n(521),N=n.n(b),v=n(928),P=n.n(v),T=n(188),$=n.n(T),O=n(835),R=n.n(O),D=n(692),x=n.n(D),w=n(529),M=n.n(w);const L=new class{constructor(){this.needsMapping=!1}getNeedsMapping(){return this.needsMapping}setNeedsMapping(e){this.needsMapping=e}map(e){return this.needsMapping?this.replacer(e):e}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}},F={APP:{APP:"app",ROOT:"root",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"},RESOURCE_STATUS:{CREATE:"CREATE",UPDATE:"UPDATE",OPEN_FLOW_ACTION:"OPEN_FLOW_ACTION"},VIEW_NAMES:{PY_CASE_TAB:"pyCaseTab",DATA_OBJECT_CREATE_VIEW:"Create",DATA_OBJECT_EDIT_VIEW:"pyEdit",PY_DATA_PREVIEW:"pyDataPreview",PY_DETAILS:"pyDetails"},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:"D_pyGetUserWorkListByUserId",D__WORK_BASKET:"D_WorkBasket",D__PY_MY_WORK_LIST:"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:"pzCreateDetails",PREVIEW_VIEW_NAME:"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"},CASE_INFO:{CASE_INFO:"caseInfo",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_NAME:"caseInfo.name",CASE_INFO_ID:"caseInfo.ID",CASE_INFO_CLASSID:"caseInfo.content.classID",CASE_TYPE_ID:"caseInfo.caseTypeID",CASE_TYPE_NAME:"caseInfo.caseTypeName",CASE_INFO_PZINSKEY:"caseInfo.content.pzInsKey",CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:"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:"caseInfo.content.pyApprovalResult",DUPLICATECASEFLAG:"caseInfo.content.pyDuplicateCaseActions",DUPLICATECASEID:"caseInfo.content.pyDuplicateID",DUPLICATECASEINSKEY:"caseInfo.content.pyDuplicateCaseReference.pzInsKey",HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",GETNEXTWORK:"caseInfo.confirmationLinks.getNextWork",ACTION_REFRESH_CONDITIONS:"caseInfo.assignments[0].actions[0].refreshConditions",IS_LOCAL_ACTION:"caseInfo.isLocalAction",BUSINESS_ID:"caseInfo.businessID",IS_FIRST_ASSIGNMENT:"caseInfo.isFirstAssignment"},ACTIONS:{ACTION_ID:"actionID",ACTIONS:"availableActions",DELETEAVIALACTIONS:"deleteAvailActions",FLOWACTION:"FlowAction",DATA_PAGES:{D_PY_ADDITIONAL_CASE_ACTIONS:"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:"pyTransferAssignment"},CONTENT:"content",MODAL:"modal",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:"context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime",SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:"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",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_LOCALACTION_SUBMISSION:"localActionSubmit",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_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted"},CASE_EVENTS:{CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW:"caseAttachmentsUpdateFromCaseview",CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW:"caseFollowerUpdateByOperatorFromCaseview",CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET:"caseFollowerUpdateByOperatorFromWidget",CASE_CREATED:"caseCreated",CREATE_STAGE_DONE:"caseCreatedDone",CREATE_STAGE_CANCELLED:"caseCancelled",CREATE_STAGE_SAVED:"caseSaved",CREATE_STAGE_DELETED:"caseDeleted",ASSIGNMENT_SUBMISSION:"assignmentSubmission",END_OF_ASSIGNMENT_PROCESSING:"endOfAssignmentProcessing",CLOSE_CONFIRM_VIEW:"closeConfirmView",CASE_OPENED:"caseOpened",CASE_CLOSED:"caseClosed",ASSIGNMENT_OPENED:"assignmentOpened",CASE_PREVIEW:"casePreview",CURRENT_ASSIGNMENT_UPDATED:"currentAssignmentUpdated",CASE_LOCK_EVENT:"caseLockEvent",NOTIFICATION_UPDATED:"notificationUpdated"},BOOTSTRAP_SHELL_EVENTS:{CONSTELLATION_LOADED:"CONSTELLATION_LOADED"},CONTAINER_EVENTS:{CLOSE_CONTAINER_ITEM:"CLOSE_CONTAINER_ITEM",CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM:"CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM"},DISPLAY_CASE_CREATED_TOASTER:"displayCaseCreatedToaster",DATA_EVENTS:{DATA_OBJECT_CREATED:"dataObjectCreated",DATA_OBJECT_DELETED:"dataObjectDeleted",DATA_OBJECT_UPDATED:"dataObjectUpdated"},FETCH_SUCCESS:"fetchSuccess",REVERSE_COEXISTENCE_EVENTS:{HANDLE_DISCARD:"handleDiscard",CHECK_IS_FORM_DIRTY:"checkIsFormDirty"},TIMEOUT_REMINDER:"sessionAboutToTimeout",RESET_TIMER:"resetInactivityTimer"},CONTAINER_TYPE:{MULTIPLE:"multiple",SINGLE:"single",HYBRID:"HybridViewContainer"},REMOTE_SYSTEM_ID:"RemoteSystemID",LIST_SELECTION_MODE:{MULTI:"multi",SINGLE:"single",MULTI_ON_HOVER:"multi_on_hover"},SUBMISSION_FAILURE_TYPE:{FORM_VALIDATION_ERROR:"formValidationError"},USER_SETTINGS:{UTILITY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.utilityPanelExpanded",SUMMARY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.summaryPanelExpanded",ASSIGNMENT_COLLAPSED_STATE_PATH:"presentation.templates.CaseView.assignmentWidgetCollapsed",CASE_VIEW_PATH:"presentation.templates.CaseView"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:"pyEmbedAssignment",PY_DETAILS:"pyDetails"}},j={CONTEXT:"context",AJAXCONTAINER:"primary",VIEW_CONTAINER:"ViewContainer",APP_SHELL:"AppShell",ROOT_CONTAINER:"RootContainer",HYBRID:"hybrid",HYBRID_VIEW_CONTAINER:"HybridViewContainer",HYBRID_ROOT_CONTAINERNAME:"hybridRootContainerName",MODAL_VIEW_CONTAINER:"ModalViewContainer",FLOW_CONTAINER:"FlowContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",OBJECT_PAGE:"ObjectPage",CASE_CREATE_STAGE:"CaseCreateStage",CASE_VIEW:"CaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",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",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",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_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",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",ERROR_FIELD_IN_PAGE:"erroneousInputOutputFieldInPage",ERROR_IN_PAGE_IDENTIFIER:"erroneousInputOutputIdentifier",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",DATA:"data",OPTIONS:"options",VIEWS:"uiResources.resources.views",NAVIGATIONS:"uiResources.resources.navigations",COMPONENTS:"uiResources.components",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",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",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:"pyDetails",PY_CONFIRM:"pyConfirm",LIST_ACTIONS:{INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE",DELETE_ALL:"DELETE ALL",MOVE:"MOVE",SELECT:"SELECT",DESELECT:"DESELECT"},LIST_ACTIONS_TYPE:{SELECT_DESELECT:"SELECT_DESELECT",DESELECT_ALL:"DESELECT_ALL"},ENV_INFO_KEYS:{APPLICATION_NAME:"APPLICATION_NAME",APPLICATION_DESC:"APPLICATION_DESC",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",CONTEXT_DATA_MODAL_VIEW:{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"},DATA_CLASS_NOT_FOUND:"Data object class not found",PRIORITY:{CRITICAL:100,HIGH:500,MEDIUM:1e3,LOW:2e3,TRIVIAL:3e3},...F,EMBED:"EMBED",getProperty:e=>L.map(e)},U="pyRemoteCaseDetails";class k{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=>Mh.getProperty(".RemoteSystemID",j.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"===k.getRemoteCase(e)?.RemoteApplicationType;static setAdditionalParameters=()=>{const e=Ep.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID}}const V=k,B={},G=new Map,W=e=>{let t=j.EMPTY_STRING;return t=e&&e.includes(j.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},H=(e,t,n=!1)=>{let r=j.EMPTY_STRING;if(t&&e){let a=`${t}${j.FORWARD_SLASH_STRING}${e}`;const s=uu(a);if(s||t!==j.APP.APP&&t!==j.APP.ROOT)if(s){if(n&&B[a])return r=`${a}${j.UNDERSCORE_STRING}${B[a]}`,r;B[a]?B[a]+=1:B[a]=1,r=`${a}${j.UNDERSCORE_STRING}${B[a]}`}else r=H(e,W(t));else a=`${t}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,B[a]?B[a]+=1:B[a]=1,r=`${a}${j.UNDERSCORE_STRING}${B[a]}`}return r},q=(e,t)=>{if(e&&t){const n=(G[t]?.[e]??0)+1;return G[t]||(G[t]={}),G[t][e]=n,`${t}${j.FORWARD_SLASH_STRING}${e}_${n}`}return""},Y=(e,t)=>{if(e&&t){const n=G[t]?.[e];return n?`${t}${j.FORWARD_SLASH_STRING}${e}_${n}`:q(e,t)}return""},K=e=>{let t=j.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},z=(e,t)=>{if(null===e)return t;const[,n]=t.split(j.FORWARD_SLASH_STRING);return e+j.FORWARD_SLASH_STRING+n},X=e=>{const t=e.indexOf(j.FORWARD_SLASH_STRING),n=e.lastIndexOf(j.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},J=e=>{const t=e.split(j.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+j.FORWARD_SLASH_STRING+t[2]},Q="SET_PROPERTY",Z="REPLACE_PROPERTY",ee="FIELD_CHANGE",te="LOAD_VIEW",ne="SHOW_PAGE",re="SHOW_DATA",ae="SHOW_INSIGHT",se="SHOW_DASHBOARD",oe="SET_LOADING",ie="RESET_LOADING",ce="SET_SHARED_PROPERTY",le="CREATE_WORK",de="OPEN_WORK_BY_HANDLE",ue="UPDATE_DOCUMENT",pe="FINISH_ASSIGNMENT",he="CANCEL_ASSIGNMENT",fe="OPEN_ASSIGNMENT",ge="MERGE_DATA",me="REMOVE_ITEM",ye="GET_DATAOBJECT_ACTIONS",Ie="SHOW_HISTORY",Ee="ERROR",Ae="INIT_CONTAINERS",Ce="RESET_CONTAINERS",_e="ADD_CONTAINER_ITEM",Se="REMOVE_CONTAINER_ITEM",be="ADD_TRANSIENT_ITEM",Ne="UPDATE_TRANSIENT_DATA",ve="REMOVE_TRANSIENT_ITEM",Pe="REMOVE_ALL_TRANSIENT_ITEMS",Te="CLEAR_TRANSIENT_DATA",$e="PURGE_TRANSIENT_DATA",Oe="REPLACE_TRANSIENT_DATA",Re="ACTIVATE_CONTAINER_ITEM",De="UPDATE_CONTAINER_ITEM",xe="UPMERGE_AND_REMOVE_CONTAINER_ITEM",we="REPLACE_CONTAINER_ITEM",Me="ACTIVATE_MODAL_CONTAINER_ITEM",Le="REMOVE_CONTAINER",Fe="ADD_SUGGESTION_CONTEXT",je="showView",Ue="showData",ke="showInsight",Ve="showDashboard",Be="openWorkByHandle",Ge="openAssignment",We="createNewWork",He="SHOW_CANCEL_ALERT",qe="openLocalAction",Ye="openProcessAction",Ke="caseWideActions",ze="openBulkAction",Xe="performBulkAction",Je="launchAssignment",Qe="ADD_MESSAGES",Ze="CLEAR_MESSAGES",et="RESET_STORE",tt="FETCH_DATAPAGE",nt="ADD_SHARED_DATA",rt="REMOVE_SHARED_DATA",at="LIST_ACTION",st="DELETE_CASE_SUMMARY",ot="ALTER_BLOCKING_ACTION_COUNT",it="CREATE_DATA_OBJECT",ct="DELETE_DATA_OBJECT",lt="VIEW_DATA_OBJECT",dt="UPDATE_DATA_OBJECT",ut="OPEN_DATA_OBJECT_ACTION",pt="SUBMIT_DATA_OBJECT_ACTION",ht="OPEN_EMBEDDED_DATA_MODAL",ft="SUBMIT_EMBEDDED_DATA_MODAL",gt="FILL_FORM_WITH_AI",mt="openCase",yt=(e,t)=>{if(!e||!t)return null;let n,r=j.EMPTY_STRING;return t&&(r=`${t}${j.FORWARD_SLASH_STRING}${e}`,n=uu(r),n||t.includes("/")?n||(r=yt(e,W(t))):r=`${t}${j.FORWARD_SLASH_STRING}${e}`),r},It=(e,t)=>{const n=yt(e,t);return n&&uu(n)?uu(n):{}},Et=(e,t)=>Ip.getSemanticURL(je,{page:e},t);const At=new class{error=e=>{console.error(e)}};class Ct{constructor(e,t,n){this._grammar=e,this._state="expectOperand",this._tree=null,this._exprStr=t||"",this._endState=n||{}}static _setParent(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}_addToken(e){const t=$t[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=Tt[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}=$t[this._state];this._subParser=new Ct(this._grammar,e,t)}_endSubExpression(){$t[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,Ct._setParent(e,this._position)):this._tree=e,this._position=e}}const _t=Ct,St="identifier",bt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e&&t},Nt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e||t},vt={">":{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)=>e===t},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e!==t},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{let{value:t}=e;return"true"!==t&&"false"!==t||(t="true"===t),!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":bt,AND:bt,and:bt,"||":Nt,OR:Nt,or:Nt,CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.includes(t)},NOT_CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.includes(t)},STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.startsWith(t)},NOT_STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.startsWith(t)},ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.endsWith(t)},NOT_ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.endsWith(t)},IS_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!e},IS_NOT_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!!e},IS_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>t.split(",").includes(e)},IS_NOT_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!t.split(",").includes(e)}},Pt={BinaryExpression:function(e){const t=[];let n="";return t[0]=this.evaluateAST(e.left),e.left.operationType===St&&this._context&&(n=this._context.getFieldMetadata(e.left.value.substring(1))?.type??""),t[1]=e.right?this.evaluateAST(e.right,n):"",this._grammar[e.operator].evaluate(t[0],t[1])},identifier:function(e){return this._localDataObject?this._localDataObject[e.value.substring(1)]??"":this._contextTreeNodeContext?Mh.getLitePropertyValue(this._contextTreeNodeContext,e.value):this._context.getValue(e.value)??""},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){return this._grammar[e.operator].evaluate(e.right)}},Tt={unaryOperator:function(e){this.setPositionInAST({operationType:"UnaryExpression",operator:e.value})},binaryOperator:function(e){const{precedence:t}=this._grammar[e.value];let n=this._position._parent;for(;n&&n.operator&&this._grammar[n.operator].precedence>=t;)this._position=n,n=n._parent;const r={operationType:"BinaryExpression",operator:e.value,left:this._position};_t._setParent(this._position,r),this._position=n,this.setPositionInAST(r)},identifier:function(e){const t={operationType:St,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){this.setPositionInAST(e)}},$t={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:St},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Tt.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},Ot=["binaryOperator","unaryOperator","openParenthesis"],Rt=/^\s*$/,Dt=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,xt=/\\\\/,wt=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Mt=["[a-zA-Z_.\\$][(0-9)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]+)"],Lt=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class Ft{constructor(e){this._grammar=e}static _isNegative(e){return Ot.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(Rt)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(Dt)&&(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(xt,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>Ft._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[wt.join("|"),e.join("|"),Mt.join("|")].join("|")})`)}return this._splitRegex}_splitExpression(e){const t=this._getSplitRegex();return e.split(t).filter((e=>e))}_createToken(e){const t={tokenType:"literal",value:e,element:e};return'"'===e[0]||"'"===e[0]?t.value=Ft._unquote(e):e.match(Lt)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(Dt)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let r=0;r<e.length;r+=1)Ft._isWhitespace(e[r])?t.length&&(t[t.length-1].element+=e[r]):"-"===e[r]&&Ft._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 jt=Ft;const Ut=class{constructor(e,t){this._grammar={...vt},this._expression=e,this._ast=null,this._context={},this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new jt(this._grammar).tokenize(this._expression),t=new _t(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 Pt[e.operationType].call(this,e,t)}},kt=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new Ut(n,t)},Vt=e=>!e||e.buildAST(),Bt=(e,t,n)=>!e||e.evaluate(t,n),Gt=(e,t,n)=>{const r=kt(e,t),a=Vt(r);return Bt(a,n)};const Wt=class{static handleExpression(e,t,n,r){const a=this.getContext(e,r);A({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:Mh.getPropertyValue(`${n}.pxObjClass`,null,t)||Mh.getPropertyValue(`${n}.pyClassName`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>fh({type:Q,payload:{context:t,reference:n,value:e[n]}})))}},Ht={},qt=(e,t)=>Ht[t]&&Object.prototype.hasOwnProperty.call(Ht[t],e),Yt=e=>{const{context:t}=e;qt(e.reference,t)&&Wt.handleExpression(e.reference,e.value,Ht[t][e.reference],t)},Kt=(e={})=>{Rh.copy(e,Ht)},zt=(e,t,n)=>Gt(e,t,n?.pConnect.getPConnect());const Xt=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=>{t&&void 0!==this.contextArray[e]&&this.contextArray[e]>0&&fh({type:oe,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]&&fh({type:ie,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 Jt=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:ge,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:ge,payload:{context:e,data:{context_data:{deferred_action_queue:a,blocking_action_counter:r,is_deferred_action_in_progress:s}}}}),n.push(t)}}fh(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=gh(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:ge,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:a,blocking_action_counter:r,is_deferred_action_in_progress:s}}}}),fh(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=gh(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(fh({type:ge,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 gh(e)?(fh({type:ot,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={...gh(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(fh({type:ot,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=gh(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&Rh.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),fh({type:ge,payload:{context:e,data:{...n}}}),Xt.disableLoadingIndicator({context:e})}}};const Qt=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 Zt=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={}){Rh.copy(e,this.componentMap)}mergeOverrideMap(e={}){Rh.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const en=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}};const tn=class{static handleAnnotation(e,t,n){const r=e.indexOf(" "),a=-1===r?e:e.substring(0,r),s=en.getHandler(a);return s?s(e.substring(r+1),t,n):e}static trimAnnotation(e){if("string"!=typeof e)return e;const t=e.indexOf(" "),n=e.substring(0,t),r=e.substring(t+1);return en.getHandler(n)?r:e}static handleComponentMapping(e,t,n){const r=Zt.getComponent(t.type);if(!r||!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&&0===a.indexOf(".")?(a=a.substring(1),t[r]=e[a]):t[r]=a})),r.push(t)}))}}}static getPropertyName(e=""){if(e&&Rh.isString(e)){const t=e.startsWith(j.PROPERTY_ANNOTATION)||e.startsWith(j.ATTACHMENT_ANNOTATION)||e.startsWith(j.ASSOCIATED_PROPERTY_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(Rh.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return Rh.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)}},nn=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"create"===n[e].transitionType&&"active"===n[e].visited_status}}return!1},rn=(e,t)=>{if(e&&t){const n=Rh.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:r,type:a}=n;return"worklist"===a?.toLowerCase()&&r===e}return!1},an=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},sn=(e,t)=>{const n=Mh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=Mh.getPropertyValue(F.CASE_INFO.AVAILABLEACTIONS,t,e);let a=!1;if(r&&n){const e=r.find((e=>e.ID===n));e&&(a=e.type.toLowerCase()===F.LOCAL_ACTION_TYPE.CASE_WIDE.toLowerCase())}if(e&&!r){const t=gh(e);a=t?.context_data?.actionType===j.CASE}return a},on=e=>Eh(null,j.CASE_VIEW_MODE_PROP,e)===j.PERFORM_MODE&&(e.includes(j.WORKAREA)||e.includes(j.MODAL)),cn=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},ln=(e,t,n)=>{let r;const a=e?.find((e=>e.ID===t))?.actions,s=a?.filter((e=>e.ID===j.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},dn=(e,t,n)=>{let r,a,s,o,i,c,l,d,u;const p=gh(e);return n?.isTriggeredFromDifferentContext?(r=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):(r=t.getValue(F.CASE_INFO.ASSIGNMENT_ID),a=t.getValue(F.CASE_INFO.CASE_INFO_ID),s=t.getValue(F.CASE_INFO.ASSIGNMENTS),o=t.getValue(F.CASE_INFO.ACTIVE_ACTION_ID),i=t.getValue(F.CASE_INFO.AVAILABLEACTIONS),c=t.getValue(F.CASE_INFO.CASE_INFO),l=t.getValue(F.CASE_INFO.BUSINESS_ID),d=t.getValue(F.CASE_INFO.CASE_TYPE_ID),u=t.getValue(F.CASE_INFO.CASE_TYPE_NAME)),{assignmentID:r,caseID:a,assignments:s,localActionID:o,caseActions:i,caseInfo:c,businessID:l,caseTypeID:d,caseTypeName:u}};const un=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&&Xt.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),Xt.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),Xt.disableLoadingIndicator(r.actionPayload,t)):a=null,a}};class pn{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 pn(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 hn=pn;const fn=class{constructor(e,t,n,r={}){this.type=F.CONTEXT_TREE_NODE_TYPES.WHEN,this.subType=e,this.referenceName=t,this.name=n,this.props=r}},gn=/(([^.]+)\[\d+\])/g,mn=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(gn);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]},yn=(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:In,WHEN:En,DECLARATIVE_TARGET:An,PAGELIST:Cn}=j.CONTEXT_TREE_NODE_TYPES;const _n=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[In,new Map],[En,new Map],[An,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===Cn){const n=this.references.get(In);n.set(e,t),this.references.set(In,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const r=yn(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(In),a=this.references.get(An);[...r.keys(),...a.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=mn(e);return+n>=t})).forEach((e=>{const t=r.get(e).parent;t?.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 hn(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);a?.props?.index===n&&r.delete(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 fn(t,n,r,a),i=this.references.get("WHEN");i?.set(s,o)}},{VIEW:Sn,FIELD:bn,CONTEXT:Nn,DECLARATIVE_TARGET:vn,WHEN:Pn}=F.CONTEXT_TREE_NODE_TYPES;const Tn=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new _n(Nn,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){const a=this.addContextNode(e).addNode("PAGE",t);let s=null;if(r&&n!==r){s=this._addParentViewNode(e,t,r).addNode("VIEW",n)}else s=a.addNode("VIEW",n);a.addReference(n,s);const o=t.split(".");for(;o.length>0;){o.pop();const n=o.join("."),s=this.getContextNode(e)?.getNode("PAGE",n),i=s?.getReference(r);if(i){this.pushChildPageNodeToParentView(i,a,t);break}}return s}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}`,bn,a),s?.removeReference(`${t}${r}`,vn,a)}removeViewNode(e,t,n,r){const a=this.getContextNode(e),s=a?.getNode("PAGE",t),o=s?.getReference(n);this.removeChildViewNodes(e,t,n,r);const i=o?.parent?.children?.findIndex((e=>e.name===n))??-1;i>-1&&o?.parent?.children.splice(i,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===Sn?this.removeChildViewNodes(e,t,s.name,r):(a.removeReference(s.name,bn,s.props.index),a.removeReference(s.name,vn,s.props.index),"PAGELIST"!==s.type&&"Address"!==s.props?.componentName||this.deleteAllListNodes(e,s.name))})),s?.references.delete(n)}deleteAllListNodes(e,t){const n=n=>{const r=this.getContextNode(e),a=r?.references?.get(n);if(a)for(const[e]of a)(e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&r?.references?.get(n)?.delete(e)};n(bn),n(vn)}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(bn),r(vn)}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(bn,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),{isDeclarativeTarget:c}=s;let l;if(l=c?i.addNode(vn,`${t}${r}`,s):i.addNode(bn,`${t}${r}`,s),l){const n=`${t}${r}`;if("Address"===l.props?.componentName&&this.deleteAllListNodes(e,l.name),o.addReference(n,l),l.value=a,l.setPreviousDefaultValue(),l.props.isInsideList){const e=`${t}${r}`,n=t.substring(0,t.lastIndexOf("["))||e.substring(0,e.lastIndexOf("["));let a=o.getReference(n,bn);a||(a=i.addNode(bn,n,{}),o.addReference(n,a))}}return l}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]=mn(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,s,o,{...r,rowIndex:i},!0);const c=a?.getReference(`${t}.${n}`,bn);c&&c instanceof hn&&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}`,bn);o&&o instanceof hn&&o.triggerEvent(r,a)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(bn)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(bn)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(vn)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(bn)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(vn)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const r=this.getContextNode(e)?.references?.get(bn)?.get(t);r instanceof hn&&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,bn),n=this.getContextReferencesByType(e,vn);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,bn)?.get(t)||!!this.getContextReferencesByType(e,vn)?.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(vn)||new Map,r=[];return n.forEach((e=>{const t=e?.props||{},{propertyName:n=""}=t,a=t.pageReference??F.CASE_INFO.CASE_INFO_CONTENT;r.push({pageReference:a,name:n})})),r}getWhens(e){const t=this.getContextNode(e),n=t?.references?.get(Pn)||new Map,r=[];return n.forEach((e=>{const t=e.subType,n=e.referenceName,a=e.name,s=e?.props?.pageReference??F.CASE_INFO.CASE_INFO_CONTENT;r.push({name:a,pageReference:s,referenceName:n,type:t})})),r}},$n={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"},On=e=>({type:$n.REFRESH_DATA,payload:e}),Rn={},Dn=(e,t,n,r,a)=>{if(!(e&&n&&t))return;const s=a.actionMgrID||un.getNextActionMgrId(),o={ID:e,actionID:t,context:n,caseWideAction:r,options:{...a,actionMgrID:s}};a.isFillFormWithAI?fh((e=>({type:gt,payload:e}))(o)):fh(On(o))},xn=(e,t,n,r,a)=>{if(!(e&&n&&t))return;r&&(r=Rh.convertPageRefToClipboardPageNotation(r));fh(On({ID:e,viewID:t,context:n,options:a,caseViewAction:!0,interestPage:r}))},wn=(e,t,n)=>{Rn[t]||(Rn[t]={}),e&&!Rn[t][e]&&(Rn[t][e]={pageReference:n})},Mn=(e,t)=>{const n={pageName:(r=t.substring(t.lastIndexOf(" ")+1)).substring(0,r.lastIndexOf(".")),propertyName:r.substring(r.lastIndexOf(".")+1)};var r;const a=Vp(n.propertyName,e.getValue(j.CLASS_ID,n.pageName));return!!a?.isDeclarativeTarget},Ln=e=>{let t=!1;if(e.isWhenExist())t=!0;else{const n=e.getRawMetadata()?.config?.value;if(n){const r=Vp(tn.getLeafPropertyName(n),Mh.resolveClassID(n,e.getPageReference(),e.getContextName()));t=!!r?.isDeclarativeTarget,!t&&r?.datasource?.parameters&&(t=((e,t)=>{let n=!1;if(Array.isArray(t)){const r=t=>{const r=t.value;return r.startsWith("@P")&&(n=Mn(e,r)),n};t.some(r)}else if("object"==typeof t)for(const r in t)if(t[r].startsWith("@P")&&(n=Mn(e,t[r]),n))break;return n})(e,r?.datasource?.parameters)),t||(t=r?.datasource?.tableType===j.DECISION)}}t&&wn(e.getCurrentView(),e.getContextName(),e.getPageReference())},Fn=(e,t,n)=>{const r=sn(e,t),a=Mh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e)?Mh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e):Mh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,t,e);let s;s=r?Mh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,t,e):Mh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e)?Mh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e):Mh.getPropertyValue(F.CONTEXT_DATA_ASSIGNMENTID,t,e),Dn(s,a,e,r,n)},jn=e=>{const{context:t,pageReference:n}=e,r=(e=>Rn[e]&&Object.keys(Rn[e]).length>0&&on(e))(t);if(!r)return;if(Mh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,n,t)){const e=Mh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,n,t),r=Mh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,t),a=Mh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.INTERESTPAGE,n,t);xn(e,r,t,a,{})}else Fn(t,n,{})},Un=(e,t)=>{const{requestType:n}=e;return e?.options?.refreshFor&&"refresh"===n&&(t+=`?refreshFor=${e?.options?.refreshFor}`),e?.options?.isFillFormWithAI&&"refresh"===n&&(t+="?fillFormWithAI=true"),t},kn=e=>{const t=(e=>{const t=[];return Tn.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const r=n.split(".");r.shift();let a=r.join(".");e&&a&&(a=Rh.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a}))})),t})(e),n=(e=>{const t=[];return Tn.getWhens(e).forEach((({name:e,type:n,pageReference:r})=>{const a=r.split(".");a.shift();let s=a.join(".");e&&s&&(s=Rh.convertPageRefToClipboardPageNotation(s),t.push({name:e,context:s,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}},Vn=(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((e,t)=>{const n=e.url===t.url,r=e.interestPage===t.interestPage;return n&&r})(e,t);if(a&&r)return!0;if(n){if(s)return"CANCEL_REFRESH";if(r)return!1}return!1};const Bn=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 getFieldLabel(e){let t=e?.label;if(!t&&e?.inheritedProps){const n=e?.inheritedProps;(n.showLabel??1)&&(t=n.label)}return t}},Gn={CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT],FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[j.CONTEXT_DATA,j.SUMMARY_OF_MESSAGES,j.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[j.CONTEXT_DATA,j.SUMMARY_OF_MESSAGES,j.HTTP_MESSAGES],CASE_MESSAGE_PATH:[j.CASEMESSAGES]},Wn=(e="",t="",n,r)=>{let a,s=[];null!==e&&(a=(e=>e?.startsWith(".")?e.substring(1).split("."):e.split("."))(e));const o=t&&t.startsWith(".")?t.substr(1):t;if(n===j.PROPERTY&&e||e){s=[j.CONTEXT_DATA,...o.split(".")];for(let e=0;e<a.length-1;e+=1)s.push(a[e]);s.push(j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES,a[a.length-1])}else n===F.PAGE?s=[...Gn.PAGE_MESSAGES_PATH]:n===j.HTTP?s=[...Gn.HTTP_MESSAGES_PATH]:n===j.CASEMESSAGES?s=[...Gn.CASE_MESSAGE_PATH]:r&&(s=[j.CONTEXT_DATA,...o.split(".")]);return s.filter(Boolean)},Hn=(e,t,n)=>{const r={content:{}},a=`${t}[${n}]`,s=Rh.getIn(e?.content,a.split("."));return s&&Rh.setIn(r.content,a.split("."),{...s}),r},qn=(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)}]`]=Rh.getIn(e[t],[j.CONTEXT_DATA,...a.split(".")]),Rh.deleteIn(e[t],[j.CONTEXT_DATA,...a.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{Rh.setIn(e[t],[j.CONTEXT_DATA,...n.split(".")],o[n])}))},Yn=(e,t,n,r,a)=>{const s=Rh.deepClone(Rh.getIn(e,[`${t}`])),o=Rh.getIn(s,[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO]);if(!o)return;const i=n.substring(0,n.lastIndexOf(".")),c=n.substring(n.lastIndexOf(".")+1),l=((e,t,n)=>{const r=Rh.getIn(e,[j.CONTEXT_DATA,...n.split(".")],{});return Object.keys(r).filter((e=>e.includes(`${t}[`)))})(s,c,i);if(0===l.length)return;if(Hn(o,c,r).content[`${c}[${r}]`]){const o={},i=`${n}[${r}]`,c=Rh.getIn(s,[j.CONTEXT_DATA,...i.split(".")]);o[`${n}[${a}]`]=c,Rh.deleteIn(e[t],[j.CONTEXT_DATA,...i.split(".")]),qn(e,t,l,r,a,n,o)}else qn(e,t,l,r,a,n)},Kn=e=>{const{type:t,property:n,category:r,context:a,pageReference:s}=e;let o;n&&(o=n.slice(1));const i=gh(a);let c=[];const l=Rh.getIn(i,Wn(o,s,r));return t&&"all"!==t?(l&&Array.isArray(l)&&l.length>0&&(c=l.filter((e=>e.type===t))),t===F.MESSAGES.MESSAGES_TYPE_ERROR&&c.length>0&&n&&Tn.mutateField(a,s,n,{messages:[...c],type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},zn=e=>{const{property:t,pageReference:n,category:r,context:a,type:s,isListEntry:o,clearContextMessages:i,deletingIndex:c}=e,l={context:a,type:s};t&&!o?(Tn.mutateField(a,n,t,{type:Ze,fieldName:t}),l.property=t,l.pageReference=n):o?(l.pageReference=n,l.isListEntry=o,l.deletingIndex=c):l.category=r,fh(i?{type:Ze,payload:{stateObj:e.stateObj,context:a}}:{type:Ze,payload:l})},Xn=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,fh({type:Qe,payload:o})},Jn=(e,t,n)=>{for(const r of Object.keys(e)){if(t.push(r),r===j.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[r]&&Jn(e[r],t,n)}t.pop()}return n},Qn=(e,t)=>{let n=Kn({context:j.APP.ROOT,category:"HTTP"});if(Ep.getRenderingMode()===j.EMBED){const e=Kn({context:j.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=Kn({context:t,category:"HTTP"});n?e&&(n=n.concat(Kn({context:t,category:"HTTP"}))):n=Kn({context:t,category:"HTTP"})}return n},Zn=e=>{let t=null;t=Tu(e)[0]?_u(Tu(e)[0]):e,t&&zn({context:t,stateObj:gh(t),clearContextMessages:!0})},er={addMessages:Xn,getValidationErrorMessages:e=>{const t=gh(e),n=[],r=(e=>{let t=Gn.CONTENT_FIELDS_PATH;return e?.dataInfo?.content&&(t=Gn.DATA_OBJECT_CONTENT_FIELDS_PATH),t})(t),a=Rh.getIn(t,[...r])||{};return Jn(a,[],[]).forEach((e=>{const t=Rh.getIn(a,[...e,j.PROPERTY_MESSAGES]);t&&Object.keys(t).forEach((e=>{t[e].forEach((e=>{e.type===j.MESSAGES.MESSAGES_TYPE_ERROR&&(e.fieldLabel?n.push({label:`${e.fieldLabel}:`,description:_p.getLocaleValue(e.message,"Messages")}):n.push(_p.getLocaleValue(e.message,"Messages")))}))}))})),n},getMessages:Kn,clearMessages:zn,getRootContainerHttpMessages:Qn,clearContextMessagesInActiveWorkArea:Zn};const tr=class{static execute(e,t,n,r){const a={};Object.prototype.hasOwnProperty.call(n,"nonFormProperties")&&(n.nonFormProperties.forEach((e=>{a[e]=n[e],delete n[e]})),delete n.nonFormProperties);const s={instruction:"INSERT",content:{...Rh.unflatten(n)}},o=JSON.parse(JSON.stringify(s));delete o.content.classID;return{instruction:{target:Rh.buildInstructionPageReference(r,e),content:{...o.content},listIndex:t,instruction:"INSERT"},actionPayload:s,displayPropertPayload:a}}};const nr=class{static execute(e,t,n,r,a,s,o){const i={instruction:"UPDATE",content:{...Rh.unflatten(r)},isDefault:o},c={content:{...i.content},target:Rh.buildInstructionPageReference(a,t),listIndex:n,instruction:"UPDATE"};return s||fh(Ef({...i,listIndex:n-1,context:e,referenceList:`${a}${t}`})),c}};const rr=class{static execute(e,t,n){return{target:Rh.buildInstructionPageReference(n,e),listIndex:t,instruction:"DELETE"}}};const ar=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:Rh.buildInstructionPageReference(e,t)}}static execute(e,t,n,r){r||fh(Ef({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const sr=class{static execute(e,t,n,r){return{target:Rh.buildInstructionPageReference(r,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const or=class{static execute(e,t,n,r){return{content:{...{...Rh.unflatten(n)}},target:Rh.buildInstructionPageReference(r,t),instruction:"REPLACE"}}};const ir=class{static execute(e,t){return{target:Rh.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const cr=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const lr=class{constructor(e,t,n){this.target=e,this.pageReference=t,this.contextName=n,this.root=null,this.current=null,this.changeList={},this.targetPageReference=t+e,this.children=[],this.visibility=!0}addChild(e){null===this.current&&this.insertNode({}),this.current.childrenStateMachines.push(e)}insertNode(e){const t=new cr(e);null===this.root&&(this.root=t),null!==this.current&&(t.previous=this.current,this.current.next=t),this.current=t}buildChildSumbitPageInstructions(e,t){let n=[];return e.childrenStateMachines.forEach((e=>{e.visibility&&(n=n.concat(e.buildSubmitPageInstructions(t)))})),n}buildSubmitPageInstructions(e=!1){let t=this.root,n=[];for(;t;)!t.instruction.instruction||e&&t.automatic||n.push(t.instruction),n=[...n,...this.buildChildSumbitPageInstructions(t,e)],t=t.next;return n}initPageInstructions(e,t,n){const r=e.getValue(this.target)||[];t?r.forEach(((e,r)=>{t.forEach((t=>{const a=cl(t),s={};let o=!0;n&&(s[cl(n)]=crypto.randomUUID(),o=!1);const i={[a]:Rh.getIn(e,a),...s};this.update(i,r+1,o,{isDefault:!0})}))})):r.forEach(((e,t)=>{if(n&&!e[cl(n)]){const e={};e[cl(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{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}=r,o=nr.execute(this.contextName,this.target,t,e,this.pageReference,n,a);if(!s){if(this.initChangeList(t-1),!a){const n=this.changeList?.[this.targetPageReference]?.[t-1].content;this.changeList[this.targetPageReference][t-1]=Nh(Rh.deepClone(n),e,r)}if(this.current?.automatic!==a||this.current?.instruction?.listIndex!==t||"UPDATE"!==this.current?.instruction.instruction)this.insertNode(o),a&&(this.current.automatic=!0);else{const t=this.current.instruction.content;this.current.instruction.content=Nh(Rh.deepClone(t),Rh.unflatten(e),r)}}}delete(e,t){const n=rr.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||fh(Ef({instruction:"DELETE",listIndex:e-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}insert(e,t,n,r){const{instruction:a,actionPayload:s={content:{}},displayPropertPayload:o={}}=tr.execute(this.target,t,e,this.pageReference),{isDefault:i=!1}=r;if(this.initChangeList(t-1),!i){const n=this.changeList?.[this.targetPageReference]?.[t-1].content;this.changeList[this.targetPageReference][t-1]=Nh(Rh.deepClone(n),e,r)}this.root&&!this.root.instruction?.instruction&&this.current&&!this.current.instruction?.instruction?this.root.instruction=a:this.insertNode(a),n||(s.content={...s.content,...o},fh(Ef({...s,listIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))),i&&(this.current.automatic=!0)}replacePage(e){const t=or.execute(this.contextName,this.target,e,this.pageReference);this.insertNode(t)}deletePage(){const e=ir.execute(this.target,this.pageReference);this.insertNode(e)}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=sr.execute(this.target,e,t,this.pageReference);this.insertNode(r),fh(Ef({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=ar.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),ar.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){const t=this.current.instruction.content;this.current.instruction.content=Nh(Rh.deepClone(t),e)}},dr={},ur={},pr={},hr=(e,t,n)=>{dr[e]||(dr[e]={}),dr[e][t]||(dr[e][t]={content:[]}),ur[e]||(ur[e]=[],pr[e]=[]),ol.isStateMachineExist(e,n,t)||ol.setStateMachine(e,t,n,new lr(t,n,e))},fr=e=>Bn.formatPageReference(e),gr=(e,t)=>{const n=ur[e],r=pr[e],a=cl(t),s=a?.substring(0,a.indexOf("["));r?.indexOf(s)<0&&pr[e].push(s),n?.indexOf(a)<0&&ur[e].push(a)},mr=e=>{delete ur[e]},yr=e=>ol.buildPageInstructionsByContext(e),Ir=e=>ol.buildPageInstructionsByContext(e,!0),Er=e=>{ol.clearStateMachines(e),delete dr[e]},Ar=(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]})))},Cr=(e,t,n,r,a)=>{const{skipStateUpdate:s=!1}=a||{},o=n.getContextName(),i=n.getReferenceList(),c=r||n.getPageReference(),l=fr(i);hr(o,l,c),gr(o,`${i}[${t}]`),Ar(i,c,e,t);const d={instruction:j.LIST_ACTIONS.INSERT,content:{...Rh.unflatten(e)}};delete JSON.parse(JSON.stringify(d)).content.classID;ol.getStateMachine(o,c,l).insert(e,t+1,s,{})},_r=(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(F.CONTENT)+F.CONTENT.length,r=e.lastIndexOf(`[${t}]`);return e.substring(n,r)})(c,n));const l=fr(i);hr(o,l,c),gr(o,`${i}[${n}]`),Ar(i,c,e,n);ol.getStateMachine(o,c,l).update(e,n+1,a,r)},Sr=(e,t)=>{const[,n]=e.split("."),r=t?.split(".").pop();return n===r},br=(e,t,n)=>{const r={};return Object.values(e).forEach((e=>{if(Sr(e,n)){const n=Rh.getPropertyName(e),a=n.substr(n.indexOf(".")+1).split(".");if(a.length>1){let e=Rh.getIn(t,a)??"";if(!e){const n=`!P!${a.join(":")}`;e=Rh.getIn(t,n)??""}Rh.setIn(r,a,e)}else{const e=Rh.getIn(t,a)??"";r[a[a.length-1]]=e}}})),r},Nr=(e,t,n,r,a)=>{const s=e.getValue(t)||{};n&&Object.keys(s).length>0&&e.clearErrorMessages({property:r?a:e.getStateProps().value})},vr=(e,t,n)=>new Promise((r=>{const{skipPageInstructions:a=!1}=n,{selectionMode:s,selectionList:o,required:i}=t.getConfigProps(),c=s===j.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 f=(e=>e?.config?.dataRelationshipContext&&"SimpleTableSelect"===e.type&&"single"===e.config?.selectionMode)(p);f&&(u=p?.config?.dataRelationshipContext,h=d.concat(".").concat(u),d=h);const g=((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=>{const n=Rh.getPropertyName(t),r=n.substr(n.indexOf(".")+1).split(".");e[r.join(".")]=t}))})(I,m,c),c){let n=o;n=fr(n);const r=t.getValue(g)||[];hr(l,n,d);const s=[];let i=r.length;e.forEach((e=>{const t=br(y,e,u),o={};if(Object.prototype.hasOwnProperty.call(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=ol.getStateMachine(l,d,n);e.$selected?r.insert(t,p+1,!0,{}):r.delete(p+1,!0)}s.push({instruction:e.$selected?j.LIST_ACTIONS.SELECT:j.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...o}})})),fh(Ef({instruction:j.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${d}.${u}`,actions:s}))}else{const n=br(I,e[0],u);Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],f?{contextPageReference:d}:{}),t.getActionsApi().triggerFieldChange(`.${u}.${e}`,n[e])}))}Nr(t,g,i,c,u),r()})),Pr=e=>{if(!e)return!1;const t=Ir(e);return Array.isArray(t)&&t.length>0};const Tr=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,a=e.getPageReference(),s=fr(t);hr(e.getContextName(),t,a);ol.getStateMachine(e.getContextName(),a,s).deleteAll(r)},$r=e=>({insert:(t,n,r,a)=>Cr(t,n,e,r,a),update:(t,n,r)=>_r(t,e,n,r),updateProperty:(t,n,r)=>((e,t,n,r={})=>{const a=n.getPageReference(),{stateMachineTarget:s}=ol.getStateMachineObjByPath(`${a}${e}`,n.getContextName(),`${a}${e}`.endsWith("]"));if(!s){let e=a.substring(0,a.lastIndexOf("["));const t=e.substring(e.lastIndexOf("."));e=e.substring(0,e.lastIndexOf(".")),e&&t&&hr(n.getContextName(),t,e)}ol.executeStateMachine(n.getContextName(),`${a}${e}`,t,!0,r)})(t,n,e,r),deleteEntry:(t,n)=>((e,t,n)=>{const r=t.getContextName(),a=t.getReferenceList(),s=n||t.getPageReference(),o=`${s+a}[${e}]`,i=fr(a);zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:o,context:r,isListEntry:!0,deletingIndex:e}),hr(r,i,s),gr(r,`${a}[${e}]`),ol.getStateMachine(r,s,i).delete(e+1);const c=ol.getUnConnectedStateMachines(r)||{};Object.keys(c).forEach((e=>{e.includes(`${s}${i}`)&&e!==`${s}${i}`&&(c[e]=null)}))})(t,e,n),reorder:(t,n)=>((e,t,n)=>{const r=n.getContextName(),a=n.getReferenceList(),s=n.getPageReference(),o=fr(a);hr(r,o,s),gr(r,`${a}[${t}]`),ol.getStateMachine(r,s,o).move(e+1,t+1)})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>vr(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:r}=t.getConfigProps(),a=[];let s=t.getPageReference();const o=n===j.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 Sr(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=fr(i),hr(r,i,a),ol.getStateMachine(r,a,i).deleteAll(),Nr(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===j.LIST_SELECTION_MODE.MULTI&&a?i=a:"Editable"===s&&o&&(i=e.getStateProps().referenceList),i){i=fr(i);const r=ol.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=fr(t);hr(a,o,s),ol.getStateMachine(a,s,o).initPageInstructions(e,n,r)})(e,t,n,r),deleteAll:(t,n)=>Tr(e,t,n),replacePage:(t,n)=>((e,t,n)=>{const r=e.getPageReference(),a=e.getContextName();hr(a,t,r),gr(a,Rh.buildInstructionPageReference(r,t)),ol.getStateMachine(a,r,t).replacePage(n)})(e,t,n),deletePage:t=>((e,t)=>{const n=e.getPageReference(),r=e.getContextName();hr(r,t,n),gr(r,Rh.buildInstructionPageReference(n,t)),ol.getStateMachine(r,n,t).deletePage()})(e,t)});const Or=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?Rh.mergeDeep(e,this.fieldDefaults):Rh.copy(e,this.fieldDefaults))}setFieldDefault(e,t,n){e&&t&&(this.fieldDefaults[e]=this.fieldDefaults[e]||{},this.fieldDefaults[e][t]=n)}getDefaultsforType(e){return this.fieldDefaults[e]}};class Rr{constructor(){this.validators={}}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":{const e=n?.replace(F.CASE_INFO.CASE_INFO_CONTENT,"").replace(F.DATA_INFO.DATA_INFO_CONTENT,"");o=(Ih(`.attachmentsList${e}.${t?.replace(".","")}`,"context_data",a)||[]).filter((e=>!e.delete)),0===o?.length&&(o="");break}case"checkbox":o&&"false"!==o||(o="");break;default:"string"==typeof o&&(o=o.trim())}c=this.getValidator("required")(o),Rr.messageDispatcher(t,n,a,c,Bn.getFieldLabel(s))}return c}validateType(e,t,n,r,a,s){let o=null;const i={pageReference:n,context:a,property:t,target:s?.target,required:s?.required};let c=Or.getDefaultsforType(s?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(r,i),""!==r&&Rr.messageDispatcher(t,n,a,o,s?.label));const l=s?.validationType;return c=l&&Or.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(r,i),Rr.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||(l=this.validateRequired(e,t,i,n,a,r)),l||(l=this.validateType(e,t,i,n,a,r))),{message:l}}static messageDispatcher(e,t,n,r,a){if(r){const s=[];s.push({type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldLabel:a,message:r}),Xn({messages:s,property:e,pageReference:t,context:n})}}isValidatorExist(e){return!!e.validatetype}}const Dr=new Rr,xr=(e,t)=>{e.DeclareExpressions&&Kt({[t.context]:e.DeclareExpressions})},wr=(e,t,n=!1)=>{const r=Rh.getIn(e,j.RESOURCES);r&&((e=>{e&&Hp(e)})(r),xr(r,t)),n||Gf({...e,options:t})},Mr="text/javascript";const Lr=new class{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={},this.svcLocaleErrorCache=new Map}getTypes={SCRIPT:"script",STYLE:"link"};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=Ep.getBuiltOnAppNames(),a=this.loadAndFilterPegaComponentsConfig(e,r);let s=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(s=this.loadAndCustomerComponentsConfig(t));const o=this.fetchSDKComponent(t),i=[];if(await Promise.all([a,s,o]).then((e=>{const t=this.mergeComponentList(e);i.push(...t)})),n.alternateDesignSystemURL&&1===i.length){const r=await this.getSvcComponentsConfigADS(e,t,n);i[0].alternateDesignSystemConfig=r}return{data:{components:i}}}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){let t=null;if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const n=`${this.appStaticUrl}v103/${this.appAlias}/componentslist${e}`;t=fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}else t=Promise.resolve([]);return t}checkForBuiltOnSupport(e,t){if(!e||!t||0===e.length||0===t.length)return!0;const n=e.split(",");return 0===n.length||n.some((function(e){return-1!==t.indexOf(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))),a?.data?.components?.length>0&&Array.isArray(e)&&(a.data.components=a.data.components.filter((t=>{let n=!0;for(const r of e){const e=t[r.field];Array.isArray(e)?e.includes(r.value)||(n=!1):e!==r.value&&(n=!1)}return n}))),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){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return void 0===this.imageBlobUrlCache[t]&&(this.imageBlobUrlCache[t]=fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).then((e=>window.URL.createObjectURL(e))).catch()),this.imageBlobUrlCache[t]}getSvcLocale(e,t){const n=`${this.appStaticUrl}v102/${this.appAlias}/locales/${e}/${t}`,r=`${this.appStaticUrl}::${this.appAlias}::${e}::${t}`;return!0===this.svcLocaleErrorCache.get(r)?Promise.resolve(null):fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>400===e.status||404===e.status?(this.svcLocaleErrorCache.set(r,!0),null):e)).catch((()=>null))}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((()=>[]))}getSvcComponent(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw Error(e.statusText);return e})).then((e=>e.text())).then((e=>e)).catch()}async importCustomComponentMap(e){fetch(`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>(e.ok||console.error("Error while fetching custom component map"),e))).then((e=>e.text())).then((t=>{this.setCCV2LibId(e);const n=document.createElement("script");n.src=window.URL.createObjectURL(new Blob([t],{type:Mr})),n.onload=()=>console.log("Custom component lib map loaded"),n.onerror=()=>console.error("Error while appending custom component map"),document.head.appendChild(n)})).catch((e=>{console.error("Exception while appending custom component map : "),console.error(e)}))}loadSvcComponent(e){return new Promise(((t,n)=>{this.getSvcComponent(e).then((r=>{const a=document.createElement("script");a.src=window.URL.createObjectURL(new Blob([r],{type:Mr})),a.onload=()=>t(e),a.onerror=()=>n(e),document.head.appendChild(a)})).catch((()=>{n(e)}))}))}initServer(e,t,n){console.log(`asset-loader.initServer(${e}, ${t})`),this.appStaticUrl=null,this.staticServerURL=null,this.pegaOnlyUrl=!1,this.componentsConfig=null,e&&t&&"no-appstatic"!==t&&"no-cdn"!==t?(this.appStaticUrl=t.endsWith("/")?t:`${t}/`,this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.pegaOnlyUrl=!0):e&&t&&"no-appstatic"===t?(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,this.pegaOnlyUrl=!0):e&&t&&"no-cdn"===t&&(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL),console.log(`asset-loader.initServer() staticServerURL=${this.staticServerURL}, appStaticUrl=${this.appStaticUrl}, pegaOnlyUrl=${this.pegaOnlyUrl})`),this.b2sJWT=n}register(e,t){this.loaderObj[e]=t}getLoader(e){let t;const n=(e,t)=>new Promise(((n,r)=>{const a=document.createElement(t);"script"===t?(a.onload=()=>{n(e)},a.onerror=()=>{r(e)},a.type=Mr,a.charset="UTF-8",a.async=!1,a.src=e):(a.type="text/css",a.rel="stylesheet",a.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}=Mf("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()))}},Fr="component-loader",jr={},Ur=async(e,t)=>{const n=Lr.getLoader(),r=t||Lr.staticServerURL;if(!e||window.PCore&&!1===window.PCore.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();if(Lr.getLoader(Fr))return Lr.getLoader(Fr)(e,r);const a=[];return e.forEach((e=>{if(jr[e])return;const t=Zt.getComponent(e);if(!t){const t=`${Lr.getConstellationServiceUrl()}/v860/${Lr.getAppAlias()}/component/${e}.js`;return void a.push(n(t,Lr.getTypes.SCRIPT))}(t.scripts||[]).forEach((e=>{const t=e.startsWith("http")?e:r+e;a.push(n(t,Lr.getTypes.SCRIPT))}));(t.styles||[]).forEach((e=>{a.push(n(r+e,Lr.getTypes.STYLE))})),jr[e]=!0})),Promise.all(a)};function kr(e,t){return function(){return e.apply(t,arguments)}}const{toString:Vr}=Object.prototype,{getPrototypeOf:Br}=Object,{iterator:Gr,toStringTag:Wr}=Symbol,Hr=(qr=Object.create(null),e=>{const t=Vr.call(e);return qr[t]||(qr[t]=t.slice(8,-1).toLowerCase())});var qr;const Yr=e=>(e=e.toLowerCase(),t=>Hr(t)===e),Kr=e=>t=>typeof t===e,{isArray:zr}=Array,Xr=Kr("undefined");function Jr(e){return null!==e&&!Xr(e)&&null!==e.constructor&&!Xr(e.constructor)&&ea(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Qr=Yr("ArrayBuffer");const Zr=Kr("string"),ea=Kr("function"),ta=Kr("number"),na=e=>null!==e&&"object"==typeof e,ra=e=>{if("object"!==Hr(e))return!1;const t=Br(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Wr in e||Gr in e)},aa=Yr("Date"),sa=Yr("File"),oa=Yr("Blob"),ia=Yr("FileList");const ca="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},la=void 0!==ca.FormData?ca.FormData:void 0,da=Yr("URLSearchParams"),[ua,pa,ha,fa]=["ReadableStream","Request","Response","Headers"].map(Yr);function ga(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,a;if("object"!=typeof e&&(e=[e]),zr(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(Jr(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 ma(e,t){if(Jr(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 ya="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ia=e=>!Xr(e)&&e!==ya;const Ea=(Aa="undefined"!=typeof Uint8Array&&Br(Uint8Array),e=>Aa&&e instanceof Aa);var Aa;const Ca=Yr("HTMLFormElement"),_a=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Sa=Yr("RegExp"),ba=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ga(n,((n,a)=>{let s;!1!==(s=t(n,a,e))&&(r[a]=s||n)})),Object.defineProperties(e,r)};const Na=Yr("AsyncFunction"),va=(Pa="function"==typeof setImmediate,Ta=ea(ya.postMessage),Pa?setImmediate:Ta?($a=`axios@${Math.random()}`,Oa=[],ya.addEventListener("message",(({source:e,data:t})=>{e===ya&&t===$a&&Oa.length&&Oa.shift()()}),!1),e=>{Oa.push(e),ya.postMessage($a,"*")}):e=>setTimeout(e));var Pa,Ta,$a,Oa;const Ra="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ya):"undefined"!=typeof process&&process.nextTick||va,Da={isArray:zr,isArrayBuffer:Qr,isBuffer:Jr,isFormData:e=>{let t;return e&&(la&&e instanceof la||ea(e.append)&&("formdata"===(t=Hr(e))||"object"===t&&ea(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Qr(e.buffer),t},isString:Zr,isNumber:ta,isBoolean:e=>!0===e||!1===e,isObject:na,isPlainObject:ra,isEmptyObject:e=>{if(!na(e)||Jr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ua,isRequest:pa,isResponse:ha,isHeaders:fa,isUndefined:Xr,isDate:aa,isFile:sa,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:oa,isRegExp:Sa,isFunction:ea,isStream:e=>na(e)&&ea(e.pipe),isURLSearchParams:da,isTypedArray:Ea,isFileList:ia,forEach:ga,merge:function e(){const{caseless:t,skipUndefined:n}=Ia(this)&&this||{},r={},a=(a,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const o=t&&ma(r,s)||s;ra(r[o])&&ra(a)?r[o]=e(r[o],a):ra(a)?r[o]=e({},a):zr(a)?r[o]=a.slice():n&&Xr(a)||(r[o]=a)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ga(arguments[e],a);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(ga(t,((t,r)=>{n&&ea(t)?Object.defineProperty(e,r,{value:kr(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{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",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,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&&Br(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Hr,kindOfTest:Yr,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(zr(e))return e;let t=e.length;if(!ta(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Gr]).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:Ca,hasOwnProperty:_a,hasOwnProp:_a,reduceDescriptors:ba,freezeMethods:e=>{ba(e,((t,n)=>{if(ea(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];ea(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 zr(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:ma,global:ya,isContextDefined:Ia,isSpecCompliantForm:function(e){return!!(e&&ea(e.append)&&"FormData"===e[Wr]&&e[Gr])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(na(e)){if(t.indexOf(e)>=0)return;if(Jr(e))return e;if(!("toJSON"in e)){t[r]=e;const a=zr(e)?[]:{};return ga(e,((e,t)=>{const s=n(e,r+1);!Xr(s)&&(a[t]=s)})),t[r]=void 0,a}}return e};return n(e,0)},isAsyncFn:Na,isThenable:e=>e&&(na(e)||ea(e))&&ea(e.then)&&ea(e.catch),setImmediate:va,asap:Ra,isIterable:e=>null!=e&&ea(e[Gr])};class xa extends Error{static from(e,t,n,r,a,s){const o=new xa(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",{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(){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:Da.toJSONObject(this.config),code:this.code,status:this.status}}}xa.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",xa.ERR_BAD_OPTION="ERR_BAD_OPTION",xa.ECONNABORTED="ECONNABORTED",xa.ETIMEDOUT="ETIMEDOUT",xa.ERR_NETWORK="ERR_NETWORK",xa.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",xa.ERR_DEPRECATED="ERR_DEPRECATED",xa.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",xa.ERR_BAD_REQUEST="ERR_BAD_REQUEST",xa.ERR_CANCELED="ERR_CANCELED",xa.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",xa.ERR_INVALID_URL="ERR_INVALID_URL";const wa=xa;function Ma(e){return Da.isPlainObject(e)||Da.isArray(e)}function La(e){return Da.endsWith(e,"[]")?e.slice(0,-2):e}function Fa(e,t,n){return e?e.concat(t).map((function(e,t){return e=La(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ja=Da.toFlatObject(Da,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Ua=function(e,t,n){if(!Da.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Da.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Da.isUndefined(t[e])}))).metaTokens,a=n.visitor||l,s=n.dots,o=n.indexes,i=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Da.isSpecCompliantForm(t);if(!Da.isFunction(a))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Da.isDate(e))return e.toISOString();if(Da.isBoolean(e))return e.toString();if(!i&&Da.isBlob(e))throw new wa("Blob is not supported. Use a Buffer instead.");return Da.isArrayBuffer(e)||Da.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,a){let i=e;if(Da.isReactNative(t)&&Da.isReactNativeBlob(e))return t.append(Fa(a,n,s),c(e)),!1;if(e&&!a&&"object"==typeof e)if(Da.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Da.isArray(e)&&function(e){return Da.isArray(e)&&!e.some(Ma)}(e)||(Da.isFileList(e)||Da.endsWith(n,"[]"))&&(i=Da.toArray(e)))return n=La(n),i.forEach((function(e,r){!Da.isUndefined(e)&&null!==e&&t.append(!0===o?Fa([n],r,s):null===o?n:n+"[]",c(e))})),!1;return!!Ma(e)||(t.append(Fa(a,n,s),c(e)),!1)}const d=[],u=Object.assign(ja,{defaultVisitor:l,convertValue:c,isVisitable:Ma});if(!Da.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Da.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),Da.forEach(n,(function(n,s){!0===(!(Da.isUndefined(n)||null===n)&&a.call(t,n,Da.isString(s)?s.trim():s,r,u))&&e(n,r?r.concat(s):[s])})),d.pop()}}(e),t};function ka(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Va(e,t){this._pairs=[],e&&Ua(e,this,t)}const Ba=Va.prototype;Ba.append=function(e,t){this._pairs.push([e,t])},Ba.toString=function(e){const t=e?function(t){return e.call(this,t,ka)}:ka;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ga=Va;function Wa(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ha(e,t,n){if(!t)return e;const r=n&&n.encode||Wa,a=Da.isFunction(n)?{serialize:n}:n,s=a&&a.serialize;let o;if(o=s?s(t,a):Da.isURLSearchParams(t)?t.toString():new Ga(t,a).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const qa=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){Da.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ya={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ka={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ga,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},za="undefined"!=typeof window&&"undefined"!=typeof document,Xa="object"==typeof navigator&&navigator||void 0,Ja=za&&(!Xa||["ReactNative","NativeScript","NS"].indexOf(Xa.product)<0),Qa="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Za=za&&window.location.href||"http://localhost",es={...s,...Ka};const ts=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&&Da.isArray(r)?r.length:s,i)return Da.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!o;r[s]&&Da.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],a)&&Da.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(Da.isFormData(e)&&Da.isFunction(e.entries)){const n={};return Da.forEachEntry(e,((e,r)=>{t(function(e){return Da.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const ns={transitional:Ya,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=Da.isObject(e);a&&Da.isHTMLForm(e)&&(e=new FormData(e));if(Da.isFormData(e))return r?JSON.stringify(ts(e)):e;if(Da.isArrayBuffer(e)||Da.isBuffer(e)||Da.isStream(e)||Da.isFile(e)||Da.isBlob(e)||Da.isReadableStream(e))return e;if(Da.isArrayBufferView(e))return e.buffer;if(Da.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ua(e,new es.classes.URLSearchParams,{visitor:function(e,t,n,r){return es.isNode&&Da.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=Da.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ua(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(Da.isString(e))try{return(t||JSON.parse)(e),Da.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ns.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Da.isResponse(e)||Da.isReadableStream(e))return e;if(e&&Da.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw wa.from(e,wa.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:es.classes.FormData,Blob:es.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Da.forEach(["delete","get","head","post","put","patch"],(e=>{ns.headers[e]={}}));const rs=ns,as=Da.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"]),ss=Symbol("internals");function os(e){return e&&String(e).trim().toLowerCase()}function is(e){return!1===e||null==e?e:Da.isArray(e)?e.map(is):String(e)}function cs(e,t,n,r,a){return Da.isFunction(r)?r.call(this,t,n):(a&&(t=n),Da.isString(t)?Da.isString(r)?-1!==t.indexOf(r):Da.isRegExp(r)?r.test(t):void 0:void 0)}class ls{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=os(t);if(!a)throw new Error("header name must be a non-empty string");const s=Da.findKey(r,a);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=is(e))}const s=(e,t)=>Da.forEach(e,((e,n)=>a(e,n,t)));if(Da.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(Da.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]&&as[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(Da.isObject(e)&&Da.isIterable(e)){let n,r,a={};for(const t of e){if(!Da.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[r=t[0]]=(n=a[r])?Da.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=os(e)){const n=Da.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(Da.isFunction(t))return t.call(this,e,n);if(Da.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=os(e)){const n=Da.findKey(this,e);return!(!n||void 0===this[n]||t&&!cs(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=os(e)){const a=Da.findKey(n,e);!a||t&&!cs(0,n[a],a,t)||(delete n[a],r=!0)}}return Da.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&&!cs(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return Da.forEach(this,((r,a)=>{const s=Da.findKey(n,a);if(s)return t[s]=is(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]=is(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Da.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Da.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[ss]=this[ss]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=os(e);t[r]||(!function(e,t){const n=Da.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,a){return this[r].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[r]=!0)}return Da.isArray(e)?e.forEach(r):r(e),this}}ls.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Da.reduceDescriptors(ls.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Da.freezeMethods(ls);const ds=ls;function us(e,t){const n=this||rs,r=t||n,a=ds.from(r.headers);let s=r.data;return Da.forEach(e,(function(e){s=e.call(n,s,a.normalize(),t?t.status:void 0)})),a.normalize(),s}function ps(e){return!(!e||!e.__CANCEL__)}const hs=class extends wa{constructor(e,t,n){super(null==e?"canceled":e,wa.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function fs(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new wa("Request failed with status code "+n.status,[wa.ERR_BAD_REQUEST,wa.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const gs=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 ms=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)]},ys=(e,t,n=3)=>{let r=0;const a=gs(50,250);return ms((n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,i=s-r,c=a(i);r=s;e({loaded:s,total:o,progress:o?s/o:void 0,bytes:i,rate:c||void 0,estimated:c&&o&&s<=o?(o-s)/c:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},Is=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Es=e=>(...t)=>Da.asap((()=>e(...t))),As=es.hasStandardBrowserEnv?(Cs=new URL(es.origin),_s=es.navigator&&/(msie|trident)/i.test(es.navigator.userAgent),e=>(e=new URL(e,es.origin),Cs.protocol===e.protocol&&Cs.host===e.host&&(_s||Cs.port===e.port))):()=>!0;var Cs,_s;const Ss=es.hasStandardBrowserEnv?{write(e,t,n,r,a,s,o){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];Da.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),Da.isString(r)&&i.push(`path=${r}`),Da.isString(a)&&i.push(`domain=${a}`),!0===s&&i.push("secure"),Da.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function bs(e,t,n){let r=!("string"==typeof(a=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a));var a;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ns=e=>e instanceof ds?{...e}:e;function vs(e,t){t=t||{};const n={};function r(e,t,n,r){return Da.isPlainObject(e)&&Da.isPlainObject(t)?Da.merge.call({caseless:r},e,t):Da.isPlainObject(t)?Da.merge({},t):Da.isArray(t)?t.slice():t}function a(e,t,n,a){return Da.isUndefined(t)?Da.isUndefined(e)?void 0:r(void 0,e,0,a):r(e,t,0,a)}function s(e,t){if(!Da.isUndefined(t))return r(void 0,t)}function o(e,t){return Da.isUndefined(t)?Da.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(n,a,s){return s in t?r(n,a):s in e?r(void 0,n):void 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,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>a(Ns(e),Ns(t),0,!0)};return Da.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=Da.hasOwnProp(c,r)?c[r]:a,o=s(e[r],t[r],r);Da.isUndefined(o)&&s!==i||(n[r]=o)})),n}const Ps=e=>{const t=vs({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:s,headers:o,auth:i}=t;if(t.headers=o=ds.from(o),t.url=Ha(bs(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&o.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),Da.isFormData(n))if(es.hasStandardBrowserEnv||es.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(Da.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)}))}if(es.hasStandardBrowserEnv&&(r&&Da.isFunction(r)&&(r=r(t)),r||!1!==r&&As(t.url))){const e=a&&s&&Ss.read(s);e&&o.set(a,e)}return t},Ts="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ps(e);let a=r.data;const s=ds.from(r.headers).normalize();let o,i,c,l,d,{responseType:u,onUploadProgress:p,onDownloadProgress:h}=r;function f(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=ds.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());fs((function(e){t(e),f()}),(function(e){n(e),f()}),{data:u&&"text"!==u&&"json"!==u?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new wa("Request aborted",wa.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",a=new wa(r,wa.ERR_NETWORK,e,g);a.event=t||null,n(a),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||Ya;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new wa(t,a.clarifyTimeoutError?wa.ETIMEDOUT:wa.ECONNABORTED,e,g)),g=null},void 0===a&&s.setContentType(null),"setRequestHeader"in g&&Da.forEach(s.toJSON(),(function(e,t){g.setRequestHeader(t,e)})),Da.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),u&&"json"!==u&&(g.responseType=r.responseType),h&&([c,d]=ys(h,!0),g.addEventListener("progress",c)),p&&g.upload&&([i,l]=ys(p),g.upload.addEventListener("progress",i),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{g&&(n(!t||t.type?new hs(null,e,g):t),g.abort(),g=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&&-1===es.protocols.indexOf(y)?n(new wa("Unsupported protocol "+y+":",wa.ERR_BAD_REQUEST,e)):g.send(a||null)}))},$s=(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 wa?t:new hs(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,a(new wa(`timeout of ${t}ms exceeded`,wa.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=()=>Da.asap(o),i}},Os=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},Rs=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()}},Ds=(e,t,n,r)=>{const a=async function*(e,t){for await(const n of Rs(e))yield*Os(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})},{isFunction:xs}=Da,ws=(({Request:e,Response:t})=>({Request:e,Response:t}))(Da.global),{ReadableStream:Ms,TextEncoder:Ls}=Da.global,Fs=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},js=e=>{e=Da.merge.call({skipUndefined:!0},ws,e);const{fetch:t,Request:n,Response:r}=e,a=t?xs(t):"function"==typeof fetch,s=xs(n),o=xs(r);if(!a)return!1;const i=a&&xs(Ms),c=a&&("function"==typeof Ls?(l=new Ls,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const d=s&&i&&Fs((()=>{let e=!1;const t=new n(es.origin,{body:new Ms,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),u=o&&i&&Fs((()=>Da.isReadableStream(new r("").body))),p={stream:u&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!p[e]&&(p[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new wa(`Response type '${e}' is not supported`,wa.ERR_NOT_SUPPORT,n)})}));const h=async(e,t)=>{const r=Da.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Da.isBlob(e))return e.size;if(Da.isSpecCompliantForm(e)){const t=new n(es.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Da.isArrayBufferView(e)||Da.isArrayBuffer(e)?e.byteLength:(Da.isURLSearchParams(e)&&(e+=""),Da.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:a,method:o,data:i,signal:c,cancelToken:l,timeout:f,onDownloadProgress:g,onUploadProgress:m,responseType:y,headers:I,withCredentials:E="same-origin",fetchOptions:A}=Ps(e),C=t||fetch;y=y?(y+"").toLowerCase():"text";let _=$s([c,l&&l.toAbortSignal()],f),S=null;const b=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let N;try{if(m&&d&&"get"!==o&&"head"!==o&&0!==(N=await h(I,i))){let e,t=new n(a,{method:"POST",body:i,duplex:"half"});if(Da.isFormData(i)&&(e=t.headers.get("content-type"))&&I.setContentType(e),t.body){const[e,n]=Is(N,ys(Es(m)));i=Ds(t.body,65536,e,n)}}Da.isString(E)||(E=E?"include":"omit");const t=s&&"credentials"in n.prototype,c={...A,signal:_,method:o.toUpperCase(),headers:I.normalize().toJSON(),body:i,duplex:"half",credentials:t?E:void 0};S=s&&new n(a,c);let l=await(s?C(S,A):C(a,c));const f=u&&("stream"===y||"response"===y);if(u&&(g||f&&b)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=l[t]}));const t=Da.toFiniteNumber(l.headers.get("content-length")),[n,a]=g&&Is(t,ys(Es(g),!0))||[];l=new r(Ds(l.body,65536,n,(()=>{a&&a(),b&&b()})),e)}y=y||"text";let v=await p[Da.findKey(p,y)||"text"](l,e);return!f&&b&&b(),await new Promise(((t,n)=>{fs(t,n,{data:v,headers:ds.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:S})}))}catch(t){if(b&&b(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new wa("Network Error",wa.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw wa.from(t,t&&t.code,e,S,t&&t.response)}}},Us=new Map,ks=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=Us;for(;c--;)o=s[c],i=l.get(o),void 0===i&&l.set(o,i=c?new Map:js(t)),l=i;return i},Vs=(ks(),{http:null,xhr:Ts,fetch:{get:ks}});Da.forEach(Vs,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Bs=e=>`- ${e}`,Gs=e=>Da.isFunction(e)||null===e||!1===e;const Ws={getAdapter:function(e,t){e=Da.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,!Gs(r)&&(a=Vs[(n=String(r)).toLowerCase()],void 0===a))throw new wa(`Unknown adapter '${n}'`);if(a&&(Da.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(Bs).join("\n"):" "+Bs(e[0]):"as no adapter specified";throw new wa("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return a},adapters:Vs};function Hs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new hs(null,e)}function qs(e){Hs(e),e.headers=ds.from(e.headers),e.data=us.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ws.getAdapter(e.adapter||rs.adapter,e)(e).then((function(t){return Hs(e),t.data=us.call(e,e.transformResponse,t),t.headers=ds.from(t.headers),t}),(function(t){return ps(t)||(Hs(e),t&&t.response&&(t.response.data=us.call(e,e.transformResponse,t.response),t.response.headers=ds.from(t.response.headers))),Promise.reject(t)}))}const Ys="1.13.6",Ks={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ks[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const zs={};Ks.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Ys+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,s)=>{if(!1===e)throw new wa(r(a," has been removed"+(t?" in "+t:"")),wa.ERR_DEPRECATED);return t&&!zs[a]&&(zs[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)}},Ks.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Xs={assertOptions:function(e,t,n){if("object"!=typeof e)throw new wa("options must be an object",wa.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const s=r[a],o=t[s];if(o){const t=e[s],n=void 0===t||o(t,s,e);if(!0!==n)throw new wa("option "+s+" must be "+n,wa.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new wa("Unknown option "+s,wa.ERR_BAD_OPTION)}},validators:Ks},Js=Xs.validators;class Qs{constructor(e){this.defaults=e||{},this.interceptors={request:new qa,response:new qa}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=vs(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&Xs.assertOptions(n,{silentJSONParsing:Js.transitional(Js.boolean),forcedJSONParsing:Js.transitional(Js.boolean),clarifyTimeoutError:Js.transitional(Js.boolean),legacyInterceptorReqResOrdering:Js.transitional(Js.boolean)},!1),null!=r&&(Da.isFunction(r)?t.paramsSerializer={serialize:r}:Xs.assertOptions(r,{encode:Js.function,serialize:Js.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Xs.assertOptions(t,{baseUrl:Js.spelling("baseURL"),withXsrfToken:Js.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&Da.merge(a.common,a[t.method]);a&&Da.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),t.headers=ds.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||Ya;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=[qs.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=qs.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 Ha(bs((e=vs(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Da.forEach(["delete","get","head","options"],(function(e){Qs.prototype[e]=function(t,n){return this.request(vs(n||{},{method:e,url:t,data:(n||{}).data}))}})),Da.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,a){return this.request(vs(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Qs.prototype[e]=t(),Qs.prototype[e+"Form"]=t(!0)}));const Zs=Qs;class eo{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 hs(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 eo((function(t){e=t})),cancel:e}}}const to=eo;const no={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(no).forEach((([e,t])=>{no[t]=e}));const ro=no;const ao=function e(t){const n=new Zs(t),r=kr(Zs.prototype.request,n);return Da.extend(r,Zs.prototype,n,{allOwnKeys:!0}),Da.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(vs(t,n))},r}(rs);ao.Axios=Zs,ao.CanceledError=hs,ao.CancelToken=to,ao.isCancel=ps,ao.VERSION=Ys,ao.toFormData=Ua,ao.AxiosError=wa,ao.Cancel=ao.CanceledError,ao.all=function(e){return Promise.all(e)},ao.spread=function(e){return function(t){return e.apply(null,t)}},ao.isAxiosError=function(e){return Da.isObject(e)&&!0===e.isAxiosError},ao.mergeConfig=vs,ao.AxiosHeaders=ds,ao.formToJSON=e=>ts(Da.isHTMLForm(e)?new FormData(e):e),ao.getAdapter=Ws.getAdapter,ao.HttpStatusCode=ro,ao.default=ao;const so=ao;function oo(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 io=oo((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var co=function(e,t){return co=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])},co(e,t)};function lo(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}co(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function uo(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 po(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 ho(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 fo(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 go(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 mo(e){return this instanceof mo?(this.v=e,this):new mo(e)}function yo(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 mo?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 Io(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=ho(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 Eo=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Ao(e){return"function"==typeof e}function Co(e){return Ao(null==e?void 0:e.then)}var _o=oo((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 So(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var bo=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=ho(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(Ao(c))try{c()}catch(e){a=e instanceof _o?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var d=ho(l),u=d.next();!u.done;u=d.next()){var p=u.value;try{Po(p)}catch(e){a=null!=a?a:[],e instanceof _o?a=go(go([],fo(a)),fo(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 _o(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Po(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)&&So(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&So(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),No=bo.EMPTY;function vo(e){return e instanceof bo||e&&"closed"in e&&Ao(e.remove)&&Ao(e.add)&&Ao(e.unsubscribe)}function Po(e){Ao(e)?e():e.unsubscribe()}var To={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},$o={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=$o.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,go([e,t],fo(n))):setTimeout.apply(void 0,go([e,t],fo(n)))},clearTimeout:function(e){var t=$o.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Oo(e){$o.setTimeout((function(){var t=To.onUnhandledError;if(!t)throw e;t(e)}))}function Ro(){}var Do=xo("C",void 0,void 0);function xo(e,t,n){return{kind:e,value:t,error:n}}var wo=null;function Mo(e){if(To.useDeprecatedSynchronousErrorHandling){var t=!wo;if(t&&(wo={errorThrown:!1,error:null}),e(),t){var n=wo,r=n.errorThrown,a=n.error;if(wo=null,r)throw a}}else e()}var Lo=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,vo(t)&&t.add(n)):n.destination=Go,n}return lo(t,e),t.create=function(e,t,n){return new ko(e,t,n)},t.prototype.next=function(e){this.isStopped?Bo(function(e){return xo("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Bo(xo("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Bo(Do,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}(bo),Fo=Function.prototype.bind;function jo(e,t){return Fo.call(e,t)}var Uo=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){Vo(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Vo(e)}else Vo(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Vo(e)}},e}(),ko=function(e){function t(t,n,r){var a,s,o=e.call(this)||this;Ao(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&To.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},a={next:t.next&&jo(t.next,s),error:t.error&&jo(t.error,s),complete:t.complete&&jo(t.complete,s)}):a=t;return o.destination=new Uo(a),o}return lo(t,e),t}(Lo);function Vo(e){var t;To.useDeprecatedSynchronousErrorHandling?(t=e,To.useDeprecatedSynchronousErrorHandling&&wo&&(wo.errorThrown=!0,wo.error=t)):Oo(e)}function Bo(e,t){var n=To.onStoppedNotification;n&&$o.setTimeout((function(){return n(e,t)}))}var Go={closed:!0,next:Ro,error:function(e){throw e},complete:Ro},Wo="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ho(e){return e}function qo(e){return 0===e.length?Ho:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Yo=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 Lo||function(e){return e&&Ao(e.next)&&Ao(e.error)&&Ao(e.complete)}(r)&&vo(r)?e:new ko(e,t,n);return Mo((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=Ko(t))((function(t,r){var a=new ko({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[Wo]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return qo(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Ko(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 Ko(e){var t;return null!==(t=null!=e?e:To.Promise)&&void 0!==t?t:Promise}function zo(e){return Ao(e[Wo])}function Xo(e){return Symbol.asyncIterator&&Ao(null==e?void 0:e[Symbol.asyncIterator])}function Jo(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 Qo="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Zo(e){return Ao(null==e?void 0:e[Qo])}function ei(e){return yo(this,arguments,(function(){var t,n,r;return po(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,mo(t.read())];case 3:return n=a.sent(),r=n.value,n.done?[4,mo(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,mo(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 ti(e){return Ao(null==e?void 0:e.getReader)}function ni(e){if(e instanceof Yo)return e;if(null!=e){if(zo(e))return a=e,new Yo((function(e){var t=a[Wo]();if(Ao(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Eo(e))return r=e,new Yo((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(Co(e))return n=e,new Yo((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Oo)}));if(Xo(e))return ri(e);if(Zo(e))return t=e,new Yo((function(e){var n,r;try{for(var a=ho(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(ti(e))return ri(ei(e))}var t,n,r,a;throw Jo(e)}function ri(e){return new Yo((function(t){(function(e,t){var n,r,a,s;return uo(this,void 0,void 0,(function(){var o,i;return po(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Io(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 ai(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 si(e){return function(t){if(function(e){return Ao(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 oi(e,t,n,r,a){return new ii(e,t,n,r,a)}var ii=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 lo(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}(Lo);function ci(e,t){return void 0===t&&(t=0),si((function(n,r){n.subscribe(oi(r,(function(n){return ai(r,e,(function(){return r.next(n)}),t)}),(function(){return ai(r,e,(function(){return r.complete()}),t)}),(function(n){return ai(r,e,(function(){return r.error(n)}),t)})))}))}function li(e,t){return void 0===t&&(t=0),si((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function di(e,t){if(!e)throw new Error("Iterable cannot be null");return new Yo((function(n){ai(n,t,(function(){var r=e[Symbol.asyncIterator]();ai(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function ui(e,t){if(null!=e){if(zo(e))return function(e,t){return ni(e).pipe(li(t),ci(t))}(e,t);if(Eo(e))return function(e,t){return new Yo((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(Co(e))return function(e,t){return ni(e).pipe(li(t),ci(t))}(e,t);if(Xo(e))return di(e,t);if(Zo(e))return function(e,t){return new Yo((function(n){var r;return ai(n,t,(function(){r=e[Qo](),ai(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 Ao(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(ti(e))return function(e,t){return di(ei(e),t)}(e,t)}throw Jo(e)}function pi(e,t){return t?ui(e,t):ni(e)}function hi(e,t,n){var r=Ao(e)||t||n?{next:e,error:t,complete:n}:e;return r?si((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var a=!0;e.subscribe(oi(t,(function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)}),(function(){var e;a=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()}),(function(e){var n;a=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)}),(function(){var e,t;a&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)})))})):Ho}const fi=class{constructor(e,t,n,r){this.eventType=e,this.callback=n,this.contextName=r,this.id=t}};const gi=new class{constructor(){this.subscribers={}}publish(e,t){this.subscribers[e]?.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 fi(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 mi=class{static subscribe(e,t,n,r=!1,a="app"){gi.subscribe(e,n,t,a,r)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){gi.publish(e,t)}static unsubscribe(e,t,n="app"){gi.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){gi.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){gi.clearContext(e)}};class yi{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new yi(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):qi(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=Yi()}async buildAuthorizeUrl(e){e=e||window.btoa(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:Ip.getApplicationAlias(),c=this.config.userIdentifier?this.config.userIdentifier:this.config.user_identifier;t=t||this.config.tokenInfo.session_index;const l=t?`&session_index=${t}`:`${c}`?`&UserIdentifier=${c}`:`${n}`?`&Password=${window.atob(n)}`:"",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=-1!==t?e.indexOf("/",t+2):-1;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 d.append("client_id",n),r&&d.append("client_secret",r),d.append("grant_type","authorization_code"),d.append("code",l),d.append("redirect_uri",a),d.append("code_verifier",o),this.config?.secureCookie&&d.append("send_token_as_cookie","true"),Ui(s,{method:"POST",headers:new 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?Wi({pzCTkn:e?.csrf}):(Hi({tokenInfo:e}),Wi({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 Ii=yi,Ei=async()=>new Promise((async(e,t)=>{const n=Ki();if(!n?.tokenInfo)return void t(new Error("Missing token information."));const{access_token:r,refresh_token:a=null}=n.tokenInfo,{revoke:s}=n.endPoints,{client_id:o,client_secret:i,secureCookie:c}=n,l={"content-type":"application/x-www-form-urlencoded"};i&&(l.authorization=`Basic ${window.btoa(`${o}:${i}`)}`);const d=new URLSearchParams;i||d.append("client_id",o),c&&d.append("send_token_as_cookie","true");const u=a?"refresh_token":"access_token",p="access_token"===u?r:a;!c&&p&&d.append("token",p),d.append("token_type_hint",u),await Ui(s,{method:"POST",headers:new Headers(l),credentials:c?"include":"omit",body:d.toString(),withoutDefaultHeaders:!0}),Wi({Authorization:null}),Hi({tokenInfo:null}),e()})),Ai=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new Ii(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=E()+(I()?`${I()}`:"/?reAuth=true");return t},Ci=(e,t)=>{Ai(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};mi.publish(F.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},_i=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.clientSecret&&s.append("client_secret",e.clientSecret),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};Hi({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?Wi({pzCTkn:n?.csrf}):Wi({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:a}=e;a&&"function"==typeof a&&a(n)},failure:t=>{if(e.popupReauth)return Ci(t,e);mi.publish(F.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${E()}/updateSession`,n={method:"GET",headers:{}},r={failure:Ci};return{url:t,config:n,callback:r,isRefreshTokenPresent:a}},Si=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),bi=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}},Ni=(e,t,n)=>{const{config:r}=e,{url:a,config:s,callback:o,isRefreshTokenPresent:i}=_i(n),c=r.headers&&r.headers.context;r.data&&(r.body=r.data);const l=ki(r.url,r,c,t);return i?Ui(a,s).then((e=>(t.setUpdateSessionStatus(!1),o?.success?.(e,r),mi.publish("updateSession",{updateStatus:"success"}),l.then((e=>Promise.resolve(e))).catch((e=>Promise.reject(e)))))).catch((e=>e&&e.config&&Si(e.config.url,n)?(o?.failure?.(r.url,n),l):Promise.reject(e))):(o?.failure?.(r.url,n),l)},vi=(e,t,n,r)=>{if(e.config&&Si(e.config.url,n))return Promise.reject(e);if(e.response&&e.response.status&&401===e.response.status&&!t.getUpdateSessionStatus()){if(mi.unsubscribeAllWithEventType(Ri),t.setUpdateSessionStatus(!0),"custom"===n?.authType){mi.publish(F.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:a}=bi(e);return ki(n,r,a,t)}return Ni(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&t.getUpdateSessionStatus()){const{url:t,config:n,context:r}=bi(e);return Ui(t,n,r)}if(e.response&&e.response.status&&422!==e.response.status&&424!==e.response.status&&e.config.headers.context&&e.response.data&&!r){const t=e.response.data.errorDetails&&e.response.data.errorDetails.map((t=>((e,t)=>t[F.TRACE_ID]?{type:"error",message:e.localizedValue||e.message,correlationID:t[F.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"))),Xn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const Pi=class{constructor(){this.updateSessionInProgress=!1}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const Ti=class{constructor(e){this.xrayInfo={},this.xRayDebugger=e}startXRay(){if(!this.xRayDebugger.xray)return null;const e=`${Date.now()+Math.random()}`;return this.xrayInfo[e]={startTime:Date.now()/1e3},e}startXRayRestApi(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],restApisTime:{...this.xrayInfo[e]?this.xrayInfo[e].restApisTime:{},[t]:Date.now()}})}stopXRayRestApi(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],restApisTime:{...this.xrayInfo[e]?.restApisTime,[t]:(Date.now()-this.xrayInfo[e]?.restApisTime[t])/1e3}})}updateXRay(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],...t})}stopXRay(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],totalTime:Date.now()/1e3-this.xrayInfo[e].startTime},t().setXRayInfo(this.xrayInfo[e]),delete this.xrayInfo[e])}};const $i=new class{constructor(){this.xray=!1,this.onXRayCallback=null,this.xrayRuntime=new Ti(this),this.isPreview=!1,this.debugLevels="vcv=1;tracer=0;log=0"}onXRay(e){this.onXRayCallback=e}toggleXRay(e){this.xray=e,this.xrayRuntime.xrayInfo={},null!==this.onXRayCallback&&this.onXRayCallback(e)}enableXRay(){this.toggleXRay(!0)}disableXRay(){this.toggleXRay(!1)}toggle(){this.xray?this.toggleXRay(!1):this.toggleXRay(!0)}isXRayOn(){return this.xray}getXRayRuntime(){return this.xrayRuntime}setPreviewMode(){this.isPreview=!0}getPreviewMode(){return this.isPreview}enableTracer=()=>{this.debugLevels="vcv=1;tracer=1;log=0"};disableTracer=()=>{this.debugLevels="vcv=1;tracer=0;log=0"};getDebugLevels=()=>this.debugLevels};const Oi=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){this.defaultHeaders={...this.defaultHeaders,...e}}getDefaultHeaders(){return this.defaultHeaders}addDebugHeaders(e={}){return{[j.COREHEADER_APP_DEBUG_ID]:e.debugId,[j.COREHEADER_APP_DEBUG_LEVELS]:$i.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=Mh.getProperty(j.COREHEADERS,"",e);return t?{...t,debugInfo:$i.getPreviewMode()&&{...t.debugInfo,[j.COREHEADER_APP_DEBUG_LEVELS]:$i.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(j.SKIPCOREHEADERS))return void delete e[j.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&&V.injectRemoteCaseHeader(e,t,n),this.processCoreHeaders(e,t,n)}};const Ri="updateSession",Di={},xi=new Pi,wi=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&&(mi.unsubscribe(F.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((()=>{mi.publish(F.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),mi.subscribe(F.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let Mi={},Li={},Fi={},ji="";const Ui=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:a=null,cancelContext:s=n,includeRemoteSystemIdIfPresent:o=!0}=r;ji=a,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:i,signal:c,withoutDefaultHeaders:l=!1,...d}=t,{Authorization:u,pzCTkn:p,...h}=t.headers||{};l||Oi.injectCoreAdditionalHeaders(h,t.body,n,{includeRemoteSystemIdIfPresent:o}),s&&Di[s]>=0?Di[s]+=1:s&&void 0===Di[s]&&(Di[s]=1);let f=l?{...h}:{...Oi.getDefaultHeaders(),...Oi.getRegisteredHeaders(),...h,context:n};if(e&&Si(e,Li)&&xi.getUpdateSessionStatus()||!xi.getUpdateSessionStatus()){Si(e,Li)&&"OAuth2.0"===Li?.authType&&(f={...h});const{restApi:t}=Ip.doesRestApiExist("Logout")&&Ip.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&wi.setTimerID(wi.resetInactiveTimeout(wi.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 io)}})}))}(pi(so({context:n,...d,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},headers:f,withCredentials:(g=Li,!("OAuth2.0"!==g?.authType||!g.secureCookie)||!("custom"!==g?.authType||!g.customCookies)||void 0)})).pipe(hi((()=>{const e=Oi.getCoreHeadersFromContext(f.context);var t;e&&(t={...e},mi.publish(j.PUB_SUB_EVENTS.FETCH_SUCCESS,t))}))))}var g;return ki(e,t,n,xi)},ki=(e,t,n,r)=>new Promise(((a,s)=>{mi.subscribe(Ri,(o=>{r.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?Ui(e,t,n).then((e=>a(e))).catch((e=>s(e))):s(o.updateStatus.error)}),Ri)})),Vi=e=>{Di[e]>0&&(Di[e]-=1,0===Di[e]&&delete Di[e])};so.interceptors.request.use((e=>(Mi.request&&(e=Mi.request(e)),e)),(e=>Promise.reject(e))),so.interceptors.response.use((e=>{if(202===e.status&&e.config.headers.context&&e.data?.caseInfo?.errorMessage){const t=[{type:"error",message:e.data.caseInfo.errorMessage}];let n=e.config.headers.context;return n&&n.includes("/workarea")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),Xn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return e.config.headers&&e.config.headers.context&&(e.config.skipClearErrorMessages||(Kn({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&zn({type:"error",category:"HTTP",context:e.config.headers.context}),Kn({type:"error",category:e.config.headers.context===j.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&zn({type:"error",category:"PAGE",context:e.config.headers.context})),Vi(e.config.headers.context)),Mi.response&&(e=Mi.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&Vi(e.config.headers.context),!e.response||!e.response.status||401!==e.response.status||e.config&&Si(e.config.url,Li)||mi.subscribe(Ri,(e=>{xi.setUpdateSessionStatus(!e.updateStatus)}),Ri),vi(e,xi,Li,e.response&&e.response.status&&e.response.status===Number(ji)?ji:null))));const Bi=()=>so.CancelToken.source(),Gi=e=>so.isCancel(e),Wi=e=>{Oi.setDefaultHeaders(e)},Hi=e=>{Li={...Li,...e}},qi=e=>{Fi={...Fi,...e}},Yi=()=>({...Fi}),Ki=()=>({...Li});const zi=class{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:a,viewType:s=Mc.PAGE,pageName:o,context:i=j.APP.APP,debugInfo:c,headers:l}=t;let d={};n&&n.content&&(d=n.content);const u={caseTypeID:e,content:{...d,...r},processID:a};return Ji("createWork",{body:u,queryPayload:{caseClassName:e,viewType:s,params:{pageName:o}},headers:{...l,...c&&{...Oi.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:u,headers:Fc(t.headers,e,l)})))}},Xi=()=>({registerHeader:(...e)=>Oi.registerHeader(...e),unRegisterHeader:(...e)=>Oi.unRegisterHeader(...e),getRegisteredHeaders:()=>Oi.getRegisteredHeaders()}),Ji=(e,{body:t={},queryPayload:n={},cancelTokenSource:r,headers:a={},responseType:s},o,i)=>{const{restApi:c,reqType:l}=Lf(e,n),d={method:l,headers:a,body:t,...s&&{responseType:s}};return r&&(d.signal=r.token),Ui(c,d,o,i??{})},Qi=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:a=!1},s)=>{e.startsWith("http:")||e.startsWith("https:")||(e=E()+e);return Ui(e,{method:t,headers:r,body:n,withoutDefaultHeaders:a},s)},Zi=e=>Ip.doesRestApiExist(e),ec=()=>Bi(),tc=e=>Gi(e),nc=e=>{Mi=e},rc=()=>zi;const ac=new class{#e;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#e=!1}getNormalizedKey(e){return e?.toString().trim().replace(/\s/g,"-").toLowerCase()}setComponentState=(e,t)=>{sessionStorage?sessionStorage.setItem(this.getNormalizedKey(e),JSON.stringify(t)):console.error("Session Storage not found")};getComponentState=e=>{const t=sessionStorage.getItem(this.getNormalizedKey(e)),n=t?Rh.isValidJson(t):void 0;return n||t};removeComponentState=e=>{sessionStorage.removeItem(this.getNormalizedKey(e))};fetchUserSettings=async()=>{if(Zi("getUserSettings")){const{restApi:e,reqType:t}=Lf("getUserSettings");Ui(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=()=>{Ep.getUserSettings()?this.userSettings=Ep.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 Rh.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(!Zi("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=Lf("updateUserSettings");const{restApi:r,reqType:a}=n;return Ui(r,{method:a,body:Rh.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.#e){this.#e=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};mi.subscribe(j.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}resetComponentCache(e){return!("string"!=typeof e||!e?.trim())&&(!!Object.hasOwn(this.componentCache,this.getNormalizedKey(e))&&(delete this.componentCache[this.getNormalizedKey(e)],!0))}};class sc{constructor(e){sc._instance=this,this.context=`${e}/${j.SUGGESTION}`,hh()?.getState().data?.[this.context]||fh({type:Fe,payload:{context:this.context,data:{}}})}getField(e){return Ih(e,"",this.context)}setField(e,t){fh({type:Q,payload:{reference:e,value:t,context:this.context}})}removeField(e){fh({type:me,payload:{reference:e,context:this.context}})}setState(e){fh(Vh({context:this.context,data:e,isArrayDeepMerge:!0}))}}const oc=sc;const ic=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=mh();return n?Rh.getIn(n,t):null}static setSharedState(e,t){e&&fh(Cf({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:a=!0,pageReference:s,skipDirtyValidation:o=!1}=r;if(!e||!t)return;fh(_f({context:e,reference:s?`${s}.${t}`:t,value:n,isArrayDeepMerge:a,skipDirtyValidation:o}))}static getSuggestionsContext(e){return new oc(e)}};class cc{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 lc=cc,dc=e=>{mi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},uc={CASE_INFO:`${j.DATA}.${j.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${j.DATA}.${j.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${j.DATA}.${j.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${j.DATA}.${j.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${j.DATA}.${j.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${j.DATA}.${j.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${j.DATA}.${j.CASE_INFO.ASSIGNMENT_ID}`},pc=(e,t)=>{const{vcName:n,containerName:r}=t;return r||n||lc.getTargetViewContainerName(e)},hc=e=>{const t=e.lastIndexOf(j.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.substring(t,n)},fc=e=>e===lu.WORKAREA,gc=e=>e===lu.MODAL,mc=e=>e===Ee,yc=e=>e&&e.find((e=>e.type===Ee)),Ic=e=>Rh.getIn(e,uc.CASE_INFO,{}),Ec=e=>e?e.split(" ").pop():void 0,Ac=e=>Rh.getIn(e,uc.CASE_CLASS_NAME,j.EMPTY_STRING),Cc=e=>{const t=Ic(e);return nn(t)&&rn(Ep.getOperatorIdentifier(),t)},_c=e=>Rh.getIn(e,uc.CASE_INFO_ID,j.EMPTY_STRING),Sc=e=>Rh.getIn(e,uc.CASE_FIRST_ASSIGNMENT_ID,j.EMPTY_STRING),bc=(e,t)=>{const{removeActionPayload:n,target:r}=t;if(n&&n.containerItemID){const{containerItemID:t,context:a}=n;e.push(gf(cf,{containerItemID:t,context:a||Nu(t),target:r}))}},Nc=e=>{const t=hh();if(!e)return!1;const n=W(e),r=ku(n),a=ku(e);if(!r||!a)return!1;const s=pu(r,n),o=pu(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},vc=(e,t,n={})=>{const{skipFlowNameUpdate:r}=n,a=_c(t);Rh.setIn(e,"key",a);const s=nn(Ic(t));if(!r&&(e=>{const t=Rh.getIn(e,uc.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=Sc(t),[,r]=n.split("!");o={assignmentID:n,isInCreateStage:s},mi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,o),Rh.setIn(e,"flowName",r)}var o},Pc=(e,t)=>{const{attachmentsExist:n}=t;n&&Rh.setIn(e,F.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),Rh.setIn(e,F.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},Tc=(e,t,n)=>{let r=j.PROMISE_VALUE.RESOLVE;return yc(e)?(r=j.PROMISE_VALUE.REJECT,n?un.rejectActionByID(t,!0,n):un.rejectActionByID(t)):un.resolveActionByID(t),r},$c=e=>{const t=Ep.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},Oc=()=>"true"===Ep?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,Rc=(e,t)=>{const n=Ac(e?.response),r=Ic(e?.response),{caseTypeID:a}=r,s=Ep.getFeatureMap();(s?.deferUpdateCaseSummaryView??!Object.hasOwn(s,j.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&Yp(j.CASESUMMARY_VIEW_NAME,a)&&((e,t,n)=>{const{containerItemID:r,caseID:a}=t;if(r){const{caseClassName:s,skipAssignmentsUpdate:o}=n,i=W(r),c=ku(i),l=c&&uu(c),d=c&&_u(c),u=K(i);d&&l?.items?.[d]?.key===t?.caseID&&e.push(gf(Gh,{containerItemID:i,context:i,container:u,containerName:u,caseId:a,viewName:F.CASESUMMARY_VIEW_NAME,updateData:!0,viewLoadingContainer:{context:i},caseClassName:s,...void 0!==o&&{skipAssignmentsUpdate:o}}))}})(t,e?.actionInPayload,{caseClassName:n,skipAssignmentsUpdate:!0})},Dc=e=>gh(e)?.context_data?.caseViewMode;const xc=class{static isCaseActive(e,t){if(!e||!t)return!1;const n=uu(t);if(n){const r=_u(t),{items:a={}}=n;return!(!r||!a[r]||a[r].key!==e)}return!1}static getCaseEditMetadata=(e,t)=>{const n={caseID:e,viewID:"pyEdit"},{restApi:r,reqType:a}=Lf("loadView",n);return Ui(r,{method:a},t)};static getCaseEditLock=(e,t)=>{const n={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:r,reqType:a}=Lf(Ke,n);return Ui(`${r}?viewType=page`,{method:a},t)};static updateCaseEditFieldsData=(e,t,n,r)=>{const a={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:s}=Lf(Ke,a),o=t[e];return Ui(`${s}?viewType=form`,{method:"PATCH",body:{content:{...o}},headers:{"if-match":n}},r)};static getCaseMessages=e=>gh(e)?.caseMessages;static getPropertiesToReplace=e=>(ml(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getUniqueGadgetId=()=>Rh.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>V.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>V.isTraditionalRemoteCase(e);static getRemoteCaseKey=(e,t)=>{let n=t;try{e&&(n=e.slice(e.indexOf(" ")+1,e.indexOf("!")))}catch{}return n}},{RESOURCE_TYPES:wc}=F,Mc={PAGE:"page",FORM:"form"},Lc={[wc.CASE]:[We,Be,Ge],[wc.PAGE]:[je,ke],[wc.DATA]:[Ue],ASSIGNMENT:[Je]},Fc=(e,t,n={})=>{if(!e)return{};const r={etag:e.etag},{RemoteSystemID:a}=n;return e[F.REMOTE_SYSTEM_ID]||e[F.REMOTE_SYSTEM_ID.toLowerCase()]||a?r.RemoteSystemID=e[F.REMOTE_SYSTEM_ID]||e[F.REMOTE_SYSTEM_ID.toLowerCase()]||a:t&&V.isRemoteCase(t)&&(r.RemoteSystemID=V.getRemoteHeader(t)),r},jc=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:a=!0,isTransientContext:s=!1,includeDisabledFields:o=!1}=t;let i={};i=yl(e,{isTransientContext:s,includeDisabledFields:o}),n&&(delete i?.caseInfo?.content,s&&(i={}));const c=Rl(e,!1);!s&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const a=gh(t),s=$()(a,F.CASE_INFO.CASE_INFO_CLASSID),o=Vp(n,s);("True-False"===o?.type&&!r||""===r)&&delete e.caseInfo.content[n]}))})(i,e);const l=x()(c,i);let d={},u=!1;({content:d,attachmentsExist:u}=((e,t)=>{let n={},r=!1;return(e||t?.caseInfo)&&(n=e?{...t}:{...t?.caseInfo},t?.caseInfo?.attachments&&(r=!0)),{content:n,attachmentsExist:r}})(s,l));const p=[...yr(e)];a&&p.forEach((e=>{delete e.content?.EmbedListUUID__})),d.pageInstructions=p;return(ur[e]||[]).forEach((e=>{if(d?.content){const t=e?.replace(j.CASE_INFO.CASE_INFO_CONTENT,"");Rh.deleteIn(d.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))}})),!s&&l?.dataInfo?(d={...l.dataInfo,pageInstructions:d.pageInstructions},{content:d}):{content:d,attachmentsExist:u}},Uc=(e,t)=>{let n,r,a={};const s=Rh.getIn(e,j.UI_RESOURCES),o=Rh.getIn(e,"confirmationNote");s?(n=Rh.getIn(e,j.UI_RESOURCES_CONTEXT_DATA),r=Rh.getIn(e,j.ROOT),a=Rh.getIn(e,j.ACTION_BUTTONS)):o&&(r={});const{data:i={},Errors:c,semanticURL:l,key:d,flowName:u}=e,p=Rh.getIn(e,"nextAssignmentInfo",null),h=Rh.getIn(e,"nextAssignmentInfo.context",""),f=Rh.getIn(e,"confirmationLinks",null),{isInCreateStage:g,openCaseViewAfterCreate:m,debugInfo:y}=t;return{data:{...i,key:d,flowName:u,coreHeaders:y&&{debugInfo:{[j.COREHEADER_APP_DEBUG_ID]:y.debugId}},caseInfo:{...i.caseInfo,actionButtons:a,headers:t.headers},[j.CONTEXT_DATA]:g?{...i[j.CONTEXT_DATA],...n,openCaseViewAfterCreate:m,errors:c}:{...i[j.CONTEXT_DATA],...n,errors:c}},semanticURL:l,nextAssignmentInfo:p,assignmentContext:h,confirmationLinks:f,key:d,root:r,...t}},kc=async(e,t,n,r=!1,a=!1)=>{const s=Rh.getIn(e,j.LOCALE_REFERENCES);await _p.loadLocaleResources(s);const o=Rh.getIn(e,j.COMPONENTS);if(o)try{await Ur(o)}catch(e){console.error(e)}const i={actionConfig:t,...n};r?Gf({...e,options:i,directUrlUpdation:!0}):wr(e,i,a)},Vc=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},Bc=e=>{if(e){const[,t]=e.split("!");return{key:Vc(e),flowName:t}}return{}},Gc=(e,t)=>{const n=[],r=[];return e.forEach((e=>{((e,t,n,r)=>{switch(!0){case Boolean(e[j.ERROR_IN_PAGE_IDENTIFIER]&&e[j.ERROR_FIELD_IN_PAGE]):{const a=`${e[j.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),s=`${a}${e[j.ERROR_IN_PAGE_IDENTIFIER]}`,o=Rh.deepClone(e);o[j.ERROR_FIELD_IN_PAGE]=a,t.includes(s.slice(1))||t.includes(s.substring(s.indexOf(".")+1,s.indexOf("[")))?r.push(o):n.push(e);break}case Boolean(e[j.ERROR_IN_PAGE_IDENTIFIER]&&!e[j.ERROR_FIELD_IN_PAGE]):{const a=e[j.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(a)?r.push(e):n.push(e);break}default:n.push(e)}})(e,t,n,r)})),{fieldErrors:r,pageErrors:n}},Wc=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:a}=t,s=n&&n.response?n.response.data:"",o=El(r);return a&&un.rejectActionByID(a,!0,n),gf(mf,"Error action triggered",s,r,o)},Hc=(e,t)=>Ru(e)&&xu(e)?gf(uf,t):gf(zh,t),qc=(e,t,n=j.APP.APP,r={})=>{let a=null;const{buildNew:s=!0}=r;return Ru(e)?a=xu(e)?_u(e):H(t,n):Du(e)&&(xu(e)&&!s?a=vu(e):xu(e)&&!s||(a=H(t,n))),a},Yc=e=>e&&e.type===_e,Kc=e=>{let t=!1;const n=$u(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&Ll(r)){t=!0;break}}return t},zc=(e,t={})=>{let n=!1,r=!1,a={},s=!0,o=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:d=!1}=t;if(Ru(e)){const t=_u(e);if(!t)return{continueExecution:s,removeActionPayload:a};const r=Nu(t);Ll(r)&&(n=!0),d||n||(n=Kc(t))}else if(Du(e)&&Lu(e)){let t=Uu(e);t||(t=_u(e),r=!0),a.containerItemID=t,a.context=Nu(t)}if(n){const e=l||$l;o=window.confirm(_p.getLocaleValue(e,"Messages"))}if(!o&&n&&(a={},s=!1),r){const e=_p.getLocaleValue(Ol,"Messages");c?i=window.confirm(e):(window.alert(e),s=!1)}return!i&&r&&(a={},s=!1),{continueExecution:s,removeActionPayload:a}},Xc=(e,t)=>{let n=!1;const r=Ep.isCoexistenceAppOfType(j.APP_TYPE.UIKIT),{insKey:a,isParallelCall:s,skipFlowNameCheck:o}=t;if(!a)return{};const[,i]=a.split("!")||"",c=o?a:Vc(a),l=yu(e,c);let d={},u=!1;if(l&&!r&&((e,t)=>{const n=pu(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,d=pu(e,l),!o)){let e=d?.flowName;const t=hc(l),r=Pu(l);if(r.length){const n=yt(t,r[0]);e=pu(n,r[0])?.flowName}else n=e===i;(e!==i||s)&&(u=!0)}return{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:u,containerItemID:l,semanticURL:d.semanticURL,insKey:a}}},Jc=(e,t,n)=>e===wc.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,a=yu(e,r);return a&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:a,semanticURL:r}}})(t,n):e===wc.ASSIGNMENT?Xc(t,{...n,type:e}):e===wc.CASE?Xc(t,{...n,skipFlowNameCheck:!0,type:e}):{},Qc=(e=[])=>{xu(`${j.APP.APP}/${j.PREVIEW}`)&&e.push(gf(Kh,Fu({context:F.APP.APP,name:j.PREVIEW})))},Zc=e=>{let t;for(const n of Object.keys(Lc))if(Lc[n].includes(e)){t=n;break}return t},el=(e,t)=>{const{data:n={},context:r,caseViewMode:a}=e,s={data:{...n},caseViewMode:a,context:W(r)};Rh.deleteIn(s.data,"shared"),Rh.setIn(s.data,["context_data","caseViewMode"],a),t.push({type:st,payload:{context:s.context}}),t.push(gf(Vh,s))},tl=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=Rh.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const r=Rh.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:Rh.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:Rh.getIn(t,["payload","context"]),context:Rh.getIn(t,["payload","context"])},r={type:he,payload:{...n}};e.push(r),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),fh(e),e=e.filter((e=>e.type!==he))}const a=((e,t,n)=>({assignmentID:e,vcName:j.PRIMARY,targetContainerName:Rh.getIn(t,["payload","target"]),context:Rh.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);Ru(a.targetContainerName)||t?.payload?.containerName!==j.WORKAREA||(a.isMultiDoc=!0,e=[]);const s={type:fe,payload:{...a}};e.push(s),fh(e)}else fh(e)}},nl=(e,t)=>x()(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),rl=e=>{let t={},n=sp(e);for(;n;){const e=jc(n);t=nl(e.content,t),n=sp(n)}return t};class al{static getChanges(e){return{...Rl(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1}=t||{},{content:a}=jc(e,{isTransientContext:n,includeDisabledFields:r});return a}static isStateModified(e){return Ll(e)||Pr(e)||!(!e||!xl(e))}static isFormValid(e,t){return Il(e,t)}static clearChangedProperties(e){return Er(e),mr(e),jl(e)}static getEditableFields(e){return Al(e)}static setCustomValidator(e,t){Dr.register(e,t)}static isPropertyEditable(e,t){return al.getEditableFields(e).some((e=>e.name===t))}}const sl=al;const ol=new class{constructor(){this.states={},this.unConnectedStates={}}getStateMachine(e,t,n){return this.states?.[e]?.[`${t}${n}`]||this.unConnectedStates?.[e]?.[`${t}${n}`]}isStateMachineExist(e,t,n){return!!this.states?.[e]?.[`${t}${n}`]||!!this.unConnectedStates?.[e]?.[`${t}${n}`]}getUnConnectedStateMachines(e){return this.unConnectedStates?.[e]}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]}}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=Tn.getContextReferences(e)?.get(a),o=n[a];if(s){const e=o.buildSubmitPageInstructions(t);r.push(...e)}})),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}})),Rh.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,""),r=Tn.getFieldReferenceForProperty(e,t);if("Multiselect"===r?.props?.componentName&&n?.current?.instruction?.instruction===j.LIST_ACTIONS.DELETE_ALL)return;n.root=null,n.current=null;const a=this.getUnConnectedStateMachines(e)||{};Object.keys(a).forEach((e=>{e.includes(t)&&delete a[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&&hr(t,r,n)}getStateMachineObjByPath(e,t,n,r=!1){const a=/\[\d+\]$/gm,s=e;let o;for(;e&&!this.isStateMachineExist(t,"",e);)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 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;let[,i]=t.split(s);if(!i)return!1;null!==o&&([,i]=i.split(/^\[\d+\]/gm));const c={[cl(i)]:n},l=this.getStateMachine(e,"",s);return null!==o?l?.update(c,Number(o)+1,a.skipStateUpdate??!0,a):l?.updatePage(Rh.unflatten(c)),!0}registerForServerChanges(){lh.registerForListChanges(((e,t,n)=>{setTimeout((()=>{const r="].";if(!t.includes(".classID")&&sl.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(r)){const a=t.substring(0,t.lastIndexOf("[")),s=sl.getEditableFields(e);if(["multiselect","checkbox"].includes(s.find((e=>e.name===a))?.type)){const s=Tn.getContextReferences(e),o=s?.get(a),i=t.substring(t.lastIndexOf(r)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}),0)}))}unRegisterForServerChanges(){lh.unRegisterForListChanges()}},il={},cl=e=>e.startsWith(".")?e.substring(1):e,ll=e=>{delete il[e]},dl=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=Mh.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},ul=(e,t,n,r,a)=>{let s=(Ih(`.attachmentsList.${t?.replace(".","")}`,"context_data",n)||[]).filter((e=>`${r.pageReference}.${e.label}`===a));return s=Rh.buildAttachmentsFormData(s),s.length>0&&(e=[...e,...s]),e},pl=(e,t,n,r,a)=>(ol.executeStateMachine(e,r,Mh.getLitePropertyValue(n,t))||a.push(r),a),hl=e=>{const t=e.pageReference?.replace(F.CASE_INFO.CASE_INFO_CONTENT,"")?.replace(F.DATA_INFO.DATA_INFO_CONTENT,"");return"Attachment"===e.componentName&&""!==t},fl=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:a=!0}=n;return(!r||r&&!a)&&!Array.isArray(Mh.getLitePropertyValue(t,e))&&"Address"!==t.componentName},gl=(e,t={})=>{let n=[],r=[];const a=[],s=Tn.getContextReferences(e);if(!s)return{formInputs:n,attachments:r,formPageFields:a};if(({attachmentList:r,editableFormFieldsReferenceList:n}=((e,t,n)=>{const{includeDisabledFields:r=!1}=n;let a=[],s=[];for(const[o,i]of e){const e=Mh.resolveContextTreeNodeProps(i.props),c=e.propertyName;if(dl(i.props,{includeDisabledFields:r})){const r=hl(e);"Attachment"!==e.componentName||r?!r&&fl(o,e,n)&&(a=pl(t,c,e,o,a)):s=ul(s,c,t,e,o)}}return{attachmentList:s,editableFormFieldsReferenceList:a}})(s,e,t)),il[e])for(const t in il[e].fieldOrder)Object.hasOwn(il[e].fieldOrder,t)&&a.push(t);return{formInputs:n,attachments:r,formPageFields:a}},ml=e=>{let t=[];const n=Tn.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(dl(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},yl=(e,t={})=>{const n={},r=gh(e),{ignoreFieldsInsideList:a=!0,isTransientContext:s=!1,includeDisabledFields:o=!1}=t;if(s||r?.caseInfo?.content){const{formInputs:t,attachments:i,formPageFields:c}=gl(e,{ignoreFieldsInsideList:a,includeDisabledFields:o});i&&i.length>0&&Rh.buildObject("caseInfo.attachments",n,i),((e,t,n)=>{e.forEach((e=>{let r=Rh.getIn(t,e);"object"==typeof r&&(r=Rh.deepClone(r),delete r?.classID),Rh.buildObject(e,n,r)}))})(c,r,n),t&&t.length>0?t.forEach((e=>{Rh.buildObject(e,n,Rh.getIn(r,e))})):s||Rh.buildObject(F.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!s&&r?.dataInfo?.content){const{formInputs:t}=gl(e,{ignoreFieldsInsideList:a});t.forEach((e=>{Rh.buildObject(e,n,Rh.getIn(r,e))}))}return n},Il=(e,t)=>{const n=Tn.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,a]of n){const n=Mh.resolveContextTreeNodeProps(a.props);if(dl(a.props)&&(!t||e.includes(t))){const e=Dr.validate(n.componentName?.toLowerCase(),n.propertyName,Mh.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},El=(e,t=!1)=>{const n=Tn.getContextReferences(e),r=[];if(n)for(const[e,a]of n){if(!1!==Mh.resolveContextTreeNodeProps(a.props).visibility){const n=8,a=t?e:e.substring(e.indexOf("content")+n);r.push(a)}}return r},Al=e=>{const t=[],n=Tn.getContextReferences(e);if(n)for(const[e,r]of n){const n=Mh.resolveContextTreeNodeProps(r.props);dl(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};const Cl=class{static getPropertyName(e){return tn.getPropertyName(e)}static isProperty(e){return tn.isProperty(e)}static getLeafPropertyName(e){return tn.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};const _l=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}};class Sl{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){const s=r.split("/").join(j.HASH_DELIMITER),o=Rh.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 Sl.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 Sl.initializeRefreshCache(this.refreshMap,a,`${e}-${n}`,o,t)}triggerRefreshForType(e,t,n){"PROP_CHANGE"===e?this.propChangeRefreshMap?.[n]?.[t]&&this.propChangeRefreshMap[n][t].forEach((e=>e.callback())):this.refreshMap?.[n]?.[`${e}-${t}`]&&this.refreshMap[n][`${e}-${t}`].forEach((e=>e.callback()))}deRegisterForRefresh(e){delete this.propChangeRefreshMap[e],delete this.refreshMap[e]}}const bl=new Sl,{APP:Nl}=j;let vl={},Pl={},Tl={};const $l="You will lose unsaved changes. Do you want to continue?",Ol="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",Rl=(e=Nl.APP,t,n)=>{let r=[],a=[];t||(r=El(e,!0)),n||(a=(e=>{const t=Tn.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===Mh.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const s={};((e,t)=>{const n=Pl[t]||{};Object.keys(n).forEach((t=>{Object.hasOwn(n,t)&&Rh.buildObject(t,e,n[t].value)}))})(s,e);const o=vl[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&r.includes(e)||t;Object.prototype.hasOwnProperty.call(o,e)&&n&&!a.includes(e)&&Rh.buildObject(e,s,o[e].value)})),s},Dl=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete vl[t]?.[n],delete Pl[t]?.[n]},xl=e=>Tl[e],wl=(e,t)=>{const{context:n,initialValue:r="",isStrictTracking:a}=t,s=t.reference.startsWith(".")?t.reference.substr(1):t.reference;e[s]?e[s].previousValue=Ih(t.reference,null,n):(e[s]={initialValue:r||Ih(t.reference,null,n)},e[s].previousValue=e[s].initialValue),e[s].value=t.value,a&&e[s].value===e[s].initialValue&&Dl(t)},Ml=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;Tn.isFieldExists(n,r)||(Pl[n]=Pl[n]||{},wl(Pl[n],t)),vl[n]=vl[n]||{},wl(vl[n],t)},Ll=e=>{const t=Ir(e)||{};return e&&vl[e]&&Object.keys(vl[e]).some((t=>vl[e][t].initialValue!==vl[e][t].value))||Object.keys(t).length>0},Fl=(e,t)=>{if(!e||!t)return!1;const n=vl[e]&&vl[e][t];return!!n&&n.previousValue!==n.value},jl=e=>{e&&vl[e]?(vl[e]={},Pl[e]={}):"all"===e&&(vl={},Pl={},Tl={}),Tl[e]&&(Tl[e]=!1)},Ul=()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ee&&(Yt(r),(e=>{const{context:t,pageReference:n,value:r,reference:a}=e;lh.triggerCascade(t,a,r);const s=Qt.getDependencies(t,a),o=lh.getResetDependencies(t,a),i={context:t,datapages:{}};[...s,...o].forEach((e=>{const n=Rh.getPropertyNameFromDependency(e);if("multiRecord"===e.mode){const e=n.split("."),r=`.${e.pop()}`,a=e.join(".");ol.isStateMachineExist(t,a,r)&&ol.getStateMachine(t,a,r).deleteAll()}else _l.isPageInstruction(n)&&ol.executeStateMachine(t,n,""),fh({type:Q,payload:{reference:n,value:"",context:t,isArrayDeepMerge:!0,isImplicit:!0}})})),s.forEach((r=>{let a=n;r.startsWith(n)||(a="");const s=r.replace(`${a}`,"").split(".").filter((e=>!!e));s.pop();const o=s.join("."),c=Ih(`.${o}`,a,t)?.classID||e.classID,l=Vp(r.split(".").pop(),c),{datasource:d}=l,u={};let p=[];d.parameters.forEach((e=>{e?.value?(u[e.name]=Cl.isProperty(e.value)?Ih(`.${Rh.getFullPropertyReference([o,Rh.getPropertyName(e.value)])}`,a,t):e.value,void 0===u[e.name]||null===u[e.name]||""===u[e.name]?(u[e.name]="",p.push(j.NULL_STRING)):p.push(u[e.name])):(u[e.name]="",p.push(j.NULL_STRING))})),p=d.name.concat(j.UNDERSCORE_STRING,Rh.getHashedString(p.join(j.HASH_DELIMITER)));const{name:h}=d,f=zp(h);i.datapages[p]={mode:d.mode,propertyName:r,name:d.name,dataViewParameters:u,refreshStrategy:f?.refreshStrategy}})),s.length&&fh({type:tt,payload:i})})(r),Jt.registerBlockingAction(r.context).catch((()=>{})),setTimeout((()=>{(Fl(r.context,r.reference)||Pr(r.context))&&jn(r),bl.triggerRefreshForType("PROP_CHANGE",r.reference,r.context),Jt.deRegisterBlockingAction(r.context).catch((()=>{}))}),0)),n===at&&!r?.isDefault){const{context:e,referenceList:t}=r;jn({context:e,pageReference:t})}if(n===Q||n===Z){const{reference:e,isImplicit:n,context:a,skipDirtyValidation:s=!1}=r;Tn.updateFieldNodeValue(a,e,r.value),_l.isPageInstruction(e)||s?s||(Tl[`${a}`]=!0):Ml(t),(r.removePropertyFromChangedList||n)&&Dl(r)}if(n===Te||n===$e){const{transientItemID:e,data:t}=r;Rh.iterateLeafNodes(t,(t=>{Dl({context:e,value:"",reference:t.join(".")})}))}if(n&&[De,Se,we,Pe].includes(n)){jl(r.context),lh.purgeResetDependencies(r.context),(a=r.context)&&Rn[a]&&delete Rn[a];(r.childContainersContexts||[]).forEach((e=>{jl(e)}));(r.transientItems||[]).forEach((e=>{jl(e)}))}var a;e(t)};const kl=new class{getCoreheaders(e){const t=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,n=_u(t),r=Nu(n),a=Mh.getProperty(j.COREHEADERS,"",r);if(a&&e in a)return a[e]}};const Vl=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=((e,t,n)=>{const r=""===t&&n?.startsWith(".")?n.substring(1,n.length):n,a=Tn.getContextReferences(e)?.get(`${t}${r}`)?.props;return a?Mh.resolveContextTreeNodeProps(a):a})(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:a}=Dr.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,r);return a?{status:!1,message:a}:{status:!0}}},Bl="OPEN_PROCESS_ACTION",Gl="OPEN_ASSIGNMENT",Wl="DELETE_CASE_IN_CREATE_STAGE",Hl="SAVE_AND_CLOSE",ql=e=>({type:Hl,payload:e});const Yl=class{static getSavableDataPage(e){return nh(e)}static getLookUpDataPage(e){return ah(e)}static getLookUpDataPageInfo(e){return sh(e)}static getDataPageKeys(e){return rh(e)}};const Kl=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=un.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 un.register(t,a,n,r,e),{actionMgrID:t,promise:a}};initializeContainers(e){const t=Ae,n=this.c11nEnv,r={context:n.getContextName(),name:n.getContainerName(),type:j.CONTAINER_TYPE.SINGLE},{actionMgrID:a,promise:s}=this.containerManagerPromise(t),o={...r,...e,actionMgrID:a};return fh(Yh(o)),s}addContainerItem(e){const t=_e,n=this.c11nEnv,r=n.getMetadata(),{children:a}=r||{};let s;a&&([s]=a);const o=n.getContextName(),i=n.getContainerName(),c=H(i,o,e?.containerType===j.CONTAINER_TYPE.SINGLE),l=yt(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)),[j.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:u,promise:p}=this.containerManagerPromise(t),h={...d,...e,actionMgrID:u};return fh(zh(h)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=De,n={context:Nu(e.containerItemID),target:ku(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return fh(tf(s)),a}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=Re,n={target:ku(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return fh(sf(s)),a}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Se,n={context:Nu(e.containerItemID),target:ku(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return fh(cf(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=Ce,n=Fu(e),{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return fh(Kh(s)),a}addTransientItem(e){const{id:t,data:n}=e,r=this.c11nEnv.getContextName(),a=Y(t,r),s=Hu(r);return a&&s.includes(a)||fh(Xh({transientItemID:a,contextName:r,target:ku(r),data:n})),a}updateTransientData(e){const{transientItemID:t,data:n}=e,r=this.c11nEnv.getContextName();if(t){if(!Hu(r).includes(t))return;fh(Jh({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(!Hu(t).includes(a))return;fh(df({target:n,containerItemID:r,transientItemID:a}))}}createContainerPConnect(e,t,n,r=!1){ou.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return xu(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Au(e,t)}};var zl=function(e,t){return e===t||"function"==typeof t&&e===t.toString()};function Xl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,a=e.length;return n=1===a?function(t){return zl(t.type,e[0])}:function(t){for(var n=0;n<a;n++)if(zl(t.type,e[n]))return!0;return!1},si((function(e,t){var a=0;e.subscribe(oi(t,(function(e){return n.call(r,e,a++)&&t.next(e)})))}))}function Jl(e,t){return si((function(n,r){var a=null,s=0,o=!1,i=function(){return o&&!a&&r.complete()};n.subscribe(oi(r,(function(n){null==a||a.unsubscribe();var o=0,c=s++;ni(e(n,c)).subscribe(a=oi(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){a=null,i()})))}),(function(){o=!0,i()})))}))}function Ql(e,t){return si((function(n,r){var a=0;n.subscribe(oi(r,(function(n){r.next(e.call(t,n,a++))})))}))}function Zl(e,t,n){return void 0===n&&(n=1/0),Ao(t)?Zl((function(n,r){return Ql((function(e,a){return t(n,e,r,a)}))(ni(e(n,r)))}),n):("number"==typeof t&&(n=t),si((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?f(e):c.push(e)},f=function(e){s&&t.next(e),l++;var i=!1;ni(n(e,d++)).subscribe(oi(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?ai(t,o,(function(){return f(e)})):f(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(oi(t,h,(function(){u=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function ed(e){return e&&Ao(e.schedule)}function td(e){return e[e.length-1]}function nd(e){return ed(td(e))?e.pop():void 0}function rd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pi(e,nd(e))}function ad(e){return si((function(t,n){var r,a=null,s=!1;a=t.subscribe(oi(n,void 0,void 0,(function(o){r=ni(e(o,ad(e)(t))),a?(a.unsubscribe(),a=null,r.subscribe(n)):s=!0}))),s&&(a.unsubscribe(),a=null,r.subscribe(n))}))}var sd=new Yo((function(e){return e.complete()}));function od(e){return e?function(e){return new Yo((function(t){return e.schedule((function(){return t.complete()}))}))}(e):sd}const id=(e,t,n)=>ad((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),rd(mf(e,r,t,null,n))))),cd=(e,t)=>n=>new Yo((r=>{let a={},s=0;return n.pipe(Zl((n=>{const r=Date.now();let o;return o=t||h(),o&&o(n,a)&&r-s<e?od():(a=n,s=r,rd(n))}))).subscribe(r)})),ld=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:a}=e,s={data_view_ID:t},{restApi:o,reqType:i}=Lf("createDataObject",s),{content:c}=jc(a);return pi(Ui(o,{method:i,headers:r,body:{data:c.content}},a)).pipe(Ql((t=>({response:t.data,actionInPayload:e}))),id("Error occurred during ajax call at createDataObject Epic",n))},dd=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}=Lf("readDataObject",o);return pi(Ui(i,{method:c,headers:r,body:{dataViewParameters:s}},n)).pipe(Ql((t=>({response:t.data,actionInPayload:e}))),id("Error occurred during ajax call at getDataObjectView Epic",n))},ud=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:a,key:s}=e,o={data_view_ID:t},{restApi:i,reqType:c}=Lf("updateDataObject",o),{content:l}=jc(a);return pi(Ui(i,{method:c,headers:r,body:{data:{...l.content,...s},pageInstructions:l.pageInstructions||[]}},a)).pipe(Ql((t=>({response:t.data,actionInPayload:e}))),id("Error occurred during ajax call at updateDataObject Epic",n))},pd=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}=Lf("openDataObjectAction",o);return pi(Ui(i,{method:c,headers:r,body:{dataViewParameters:s}},n)).pipe(Ql((t=>({response:t.data,actionInPayload:e}))),id("Error occurred during ajax call at getDataObjectView Epic",n))},hd=e=>{const{savableDatapage:t,context:n,headers:r,actionID:a,keys:s,containerItemID:o}=e,i={data_view_ID:t,action_ID:a},{restApi:c,reqType:l}=Lf("submitDataObjectAction",i),{content:d}=jc(o);return pi(Ui(c,{method:l,headers:r,body:{data:{...d?.content,...s},pageInstructions:d?.pageInstructions||[]}},n)).pipe(Ql((t=>({response:t.data,actionInPayload:e}))),id("Error occurred during ajax call at getDataObjectView Epic",n))};const fd=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;xn(e,r,t,a,{})}}},gd="postDataViewMetadata",md={getData:(e,t,n,r)=>((e,t,n,r={})=>{const a={dataViewName:e},{skipClearErrorMessages:s,signal:o,doNotMergeMessagesForStatusCode:i}=r,{restApi:c,reqType:l}=Lf("getListData",a);return Ui(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}=Lf("getListDataCount",r);return Ui(a,{method:s,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const a=!!n,s=!!r,o=Ip.doesRestApiExist(gd),i=(a||s)&&o?gd:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:d}=Lf(i,c);if(o){if(a)return Ui(l,{method:d,body:{associationFilter:n}},t);if(s)return Ui(l,{method:d,body:{propertyFilter:r}},t)}return Ui(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}=Lf("readDataObject",c);return Ui(d,{method:u,body:l,...o&&{signal:o},...s&&{skipClearErrorMessages:s}},r,i)},getCaseEditMetadata:(e,t)=>xc.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>xc.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>xc.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}=Lf("moveListRecords",c);return Ui(l,{method:d,body:{content:{sourceID:n,destinationID:r,context:a,listClass:s}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===j.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===j.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==Tu("root").find((e=>e.includes("authoring-preview")))?`${j.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${Lr.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=Ep.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}};const yd=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const Id=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 bd.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],bd.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)}))}))}};var Ed=n(631),Ad=n.n(Ed);const Cd=class{constructor(e,t){this.atomicSubscribers={},this.connectionsCount=1,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],r=Object.keys(n.criteria),a=Object.keys(e);0===Ad()(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=bd.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&&(bd.unsubscribe(this.messagingServiceSubscriptionID),this.messagingServiceSubscriptionID=""))}};const _d=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new Cd("CASE",t)}return this.subscriptions[e]}};class Sd{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new Id;static refreshB2SOffset=10;static isAuthenticated=!1;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=Lr.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.log("web socket connection error event: ",e)}static handleOnClose(e){null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),this.isAuthenticated=!1,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=Lr.b2sJWT;if(!e||e.length<4)return;this.publishMessage({token:e})}}static handleOnMessage(e){if(null!==e&&"ALIVE"===e.data)null===this.isServiceAlive&&this.checkLiveliness(1e4),this.isServiceAlive=!0;else{let t=null;try{t=JSON.parse(e.data)}catch(t){console.error("Invalid data received from messaging service",e.data)}if(t&&t.msgId&&this.webSocket.send(`{"ack":"${t.msgId}"}`),t&&t.filter){const{matcher:e,criteria:n}=t.filter;delete n.environmentID,Object.keys(this.subscribers).forEach((r=>{const a=this.subscribers[r];a.filter.matcher===e&&Rh.isEqual(a.filter.criteria,n)&&a.messageHandler(t)}))}else if(t&&t.tokenExpiryTime){this.isAuthenticated=!0,this.setTokenExpiryTime(t);const e=1e3*(this.getTokenExpiryTime()-this.refreshB2SOffset);setTimeout((()=>this.refreshB2STokenReInit()),e);let n=[];this.inProgressSubscriptions.forEach((({messageSubscriber:e,id:t})=>{n?.includes(t)||(n?.push(t),this.subscribeToSocket(e,t))})),this.inProgressSubscriptions=[],this.inProgressMessages.forEach((e=>{this.publishMessage(e)})),this.inProgressMessages=[],n=null}else console.error("filter missing from received data from messaging service",e.data)}}static reInitialization(e){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 subscribe(e,t,n,r){this.connectionsCount+=1;const a=r||`${Date.now()}_${this.connectionsCount}`,s=new yd(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}),null===this.webSocket&&this.initConnection(this.connectionConfig),a)}static subscribeToSocket(e,t){this.subscribers[t]=e;const n={filter:e.filter,subscribe:{id:t}};this.webSocket.send(JSON.stringify(n))}static unsubscribe(e,t){if(this.subscribers[e]){t||delete this.subscribers[e];const n={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(n))}}static publishMessage(e){null!==this.webSocket?null===this.webSocket||1!==this.webSocket.readyState?this.inProgressMessages.push(e):this.webSocket.send(JSON.stringify(e)):console.error("Web socket not initialized.")}static getUserPresence=()=>this.userPresence;static getCaseSubscription=e=>_d.getOrCreateSubscription(e);static refreshB2STokenReInit=async()=>{const e={body:{B2SToken:Lr.b2sJWT}};PCore.getRestClient().invokeRestApi("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(Lr.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}`)}))};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 bd=Sd;const Nd=class{constructor(){this.records=[],this.maxRecords=0,this.isDirty=!1}getRecords(e){if(e){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(t){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=Nh(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const vd=new class{constructor(){this.dataStore={},this.dataStoreMeta={},this.subscribers={},this.dataPageSubscribers={},this.isCacheEnabled=!0,this.subscribedDataPageNames=new Map}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)";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[]}generateHash(e,t,n){const r=zp(e);let a=[];r||(a=Object.keys(t||{}).map((e=>({name:e}))));let s="",o=e;const i=[];return(r?.parameters||a).forEach((e=>{t?.[e.name]?i.push(t[e.name]):i.push(e.defaultValue??j.NULL_STRING)})),n&&i.push(JSON.stringify(n)),i.join(j.HASH_DELIMITER)&&(s=Rh.getHashedString(i.join(j.HASH_DELIMITER)),o=e+j.UNDERSCORE_STRING+s),o}async getDataAsync(e,t,n={},r,a,s={}){if(s.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),!this.isCacheable(e,a)||s.invalidateCache){const o=await this.fetchData(e,n,r,a,t,s),i=o?.data?.data??[];return{...o.data,data:i,pageNumber:o?.data?.pageNumber,pageSize:o?.data?.pageSize,queryStats:o?.data?.queryStats,status:o?.status}}const o=this.getData(e,n,r,a);if(o.length>0)return Promise.resolve({data:o});const i=await this.fetchData(e,n,r,a,t,s);return{...i.data,data:this.mergeDataStore(e,n,r,a,i),pageNumber:i?.data?.pageNumber,pageSize:i?.data?.pageSize,queryStats:i?.data?.queryStats,status:i?.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}=Lf(j.GET_PAGE_DATA,{dataViewName:e,dataViewParameters:encodeURIComponent(JSON.stringify(n))}),i={method:o},c=s&&n&&0===Object.keys(n).length?s.split("?")[0]:s;return Ui(c,i,t).then((t=>(this.isCacheable(e)&&(this.dataStore[e]={...this.dataStore[e],[a]:t.data},this._addDataStoreMetaEntry(e,n,a)),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!o[e]&&(o[e]??=t,this.subscribeToMessageService(n),!0)}getMessagingServiceSubscriptionId(e){return`DATAPAGE_UPDATED:${e}`}unsubscribeToDataPageUpdates(e,t,n={}){if(!e||!t)return!1;const r=this.generateHash(t,n,null),a=this.dataPageSubscribers[t],s=a?.[r];if(!s||!(e in s))return!1;delete s[e],Rh.isObjectEmpty(s)&&a&&delete a[r];const o=this.subscribedDataPageNames.get(t)??0;if(o<=0)return!0;if(1===o){this.subscribedDataPageNames.delete(t);const e=this.getMessagingServiceSubscriptionId(t);bd.unsubscribe(e)}else this.subscribedDataPageNames.set(t,o-1);return!0}unsubscribeToDatapageUpdates(e,t,n={}){return this.unsubscribeToDataPageUpdates(e,t??"",n)}_isDataPageCached(e,t){if(t&&Rh.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];Object.keys(n).forEach((n=>{if(this.dataStore[t][n]){this.dataStore[t][n].mergeRecords(e[t][n].pxResults)}else{const r=new Nd;this.dataStore[t][n]=r,r.mergeRecords(e[t][n].pxResults||[])}}))}))}_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 Nd);const i=this.dataStore[e][s];return i.mergeRecords(o,n),i.isDirty=!1,this._addDataStoreMetaEntry(e,t,s),i.getRecords(n)}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),md.getData(e,l,a,c)}isDataPage(e=""){return e.startsWith("D_")||e.startsWith("Declare_")}handleCascadeUpdate(){const{dataPageName:e,scope:t}=this;t.handleMessage({message:{datapage:e,parameters:""}})}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&&lh.unRegisterFields(n,r,t,a)}subscribeToCascadeUpdates(e,t,n,r,a){t&&t.length>0&&lh.registerFields(n,r,t,this.handleCascadeUpdate.bind({dataPageName:e,scope:this}),a)}subscribeToMessageService(e){if(e&&this.subscribedDataPageNames.has(e)){const t=this.subscribedDataPageNames.get(e)??0;return void this.subscribedDataPageNames.set(e,t+1)}const t={matcher:"DATAPAGE_UPDATED",criteria:{datapage:e}},n=this.getMessagingServiceSubscriptionId(e);bd.subscribe(t,this.handleMessage.bind(this),void 0,n),this.subscribedDataPageNames.set(e,1)}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))&&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=zp(e);return"reloadOncePerInteraction"===t?.refreshStrategy?.type}isCacheable(e,t){return!(this.isPerInteraction(e)||!this.isCacheEnabled)&&!(t&&Object.keys(t).length>1)}disableCache(e){this.isCacheEnabled=!e}};const Pd=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 Td=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 Pd(t,n,a,r,s,o)),this.bufferedDataQueues[e]}},$d=(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,Od=e=>e.map((e=>e.field)),Rd=(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;$d(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=Od(e.query?.select);Od(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},Dd=(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]:!Rh.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),xd=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:a}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:a(e,n)})}))},wd=e=>({combiner:Rd,comparator:Dd,separator:xd,...e}),Md=(e,t)=>{try{window.sessionStorage.setItem(e,t)}catch(e){}};class Ld{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={},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(j.HASH_DELIMITER),s=Rh.getHashedString(a),o=`${e.dataSource}_${s}`,i=md.getAppCacheKey(e.dataSource);if(window.sessionStorage.getItem(i)){const a=JSON.parse(window.sessionStorage.getItem(i));if(t&&Ld.searchResultsCache?.[t]?.[o])n(Ld.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Ld.searchResultsCache?.persisted?.[o])n(Ld.searchResultsCache.persisted[o]);else{const s=new Ld(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,Ld.initializeCache(t,e,o,s),n(s)):(s.associationFilter=e.associationFilter,s.propertyFilter=e.propertyFilter,s.fetchMetaData(t).then((r=>{Md(i,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,Ld.initializeCache(t,e,o,s),n(s)})).catch((e=>{s.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&zp(e.dataSource)){const r=new Ld(e,t),a=zp(e.dataSource);r.isQueryable=!!a?.isQueryable,r.isInitialised=!0,r.dataSourceMetaData=a,Md(i,JSON.stringify({isQueryable:a?.isQueryable,dataSourceMetaData:a,isInitialised:!0})),r.context=t,Ld.initializeCache(t,e,o,r),n(r)}else{const a=new Ld(e,t);a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((r=>{Md(i,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,Ld.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new Td;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(wd(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Ld.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Ld.searchResultsCache[e]&&(Ld.searchResultsCache[e]={}),Ld.searchResultsCache[e][n]=r):(void 0===Ld.searchResultsCache.persisted&&(Ld.searchResultsCache.persisted={}),Ld.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return md.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Ld.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>vd.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)}}getData(e,t){if(this.isQueryable){if(this.bufferInitialized)try{const t=this.buildSchemaForQueryableBufferDP(e);return Ld.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return vd.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return vd.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}return this.fetchNonQueryableResults(e,t)}memoizedGetData(e,t){const n=e?.toLowerCase();if(this.enablePagination?n in this.cache&&this.pageNumber in this.cache[n]:n in this.cache)return this.enablePagination?this.cache[n][this.pageNumber]:this.cache[n];const r=this.getData(e,t);return this.enablePagination?(this.cache[n]=this.cache[n]||{},this.cache[n][this.pageNumber]=r):this.cache[n]=r,r}fetchData(e,t=!1,n){return this.isValidDatasource()&&this.isInitialised?(this.pageNumber=t?this.pageNumber:1,this.memoizedGetData(e,n)):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)return this.fetchNQDataPromise?.then((()=>({data:this.filterDataOnClient(e,this.nonQueryableData,t)}))).catch((e=>Promise.reject(e)));if(this.dataSourceMetaData?.structure&&"list"===this.dataSourceMetaData.structure.toLowerCase()){const n=this.buildSchemaForNonQueryableDP();return this.fetchNQDataPromise=vd.getDataAsync(this.dataSource,this.context,n.dataViewParameters),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)=>(Object.keys(a).every((s=>!(r?.includes(s)&&a[s]&&this.positionMatches(`${a[s]}`,e,n))||(t.push({...a}),!1))),t)),[])}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),...md.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...md.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 Fd=Ld;const jd=class{static cleanCaches(e){lh.purgeCascadeFields(e),fd.removeContext(e),Fd.clearContextedCache(e),mi.cleanContextSubscribers(e),ll(e),Tn.removeContextTreeNode(e),bd.clearContext(e),bl.deRegisterForRefresh(e)}},Ud="GET_DESCENDANTS";const kd=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]}},Vd=(e,t)=>{const n={},r=Yl.getLookUpDataPage(e),a=Yl.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}},Bd=(e,t)=>{const n=Yl.getSavableDataPage(e),r=Yl.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}},Gd=e=>{mi.publish(F.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Wd=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))};const Hd=class{constructor(e){this.c11nEnv=e}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";shouldDeleteCaseInCreateStage=(e,t,n)=>!e&&t||n;getSaveActionPayload=(e,t=!1)=>{const n=e,r=n&&n.includes(j.MODAL),a=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),s=this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),o=this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID)?this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID):this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENTACTION_ID),i=this.c11nEnv.getContainerName(),c=this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),l=t?void 0:Il(this.c11nEnv.getContextName()),d=this.c11nEnv.getValue("isProcessAction","isProcessAction");return Fh.buildActionObject({context:n,containerItemID:e,assignmentID:s,actionID:o,caseID:a,containerName:i,caseType:c,isModalAction:r,isFormValid:l,isProcessAction:d,saveOnly:t},this.c11nEnv)};actionsApiPromise=(e,t,n=!0)=>{let r,a,s="";s=t&&null!==t.actionMgrID?t.actionMgrID||"":un.getNextActionMgrId();const o=new Promise(((e,t)=>{r=e,a=t}));if(!r||!a)throw new Error("resolveFn or rejectFn is not defined.");return un.register(s,o,r,a,e,t,n),{actionMgrID:s,promise:o}};showDataObjectCreateView(e,t=F.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=Fh.buildActionObject({viewName:t,className:e},this.c11nEnv),r=ne,{promise:a}=this.actionsApiPromise(r,n);return fh({type:r,payload:{...n,containerName:F.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(!Ll(t)){return new Kl(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=He,r=Fh.buildActionObject({containerItemID:e,context:t},this.c11nEnv),a=t&&t.includes(j.MODAL);fh({type:n,payload:{...r,isModalAction:a,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:s}=this.actionsApiPromise(n,r);return s.then((()=>{Gd({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=hh()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const r=Yl.getSavableDataPage(n),a=it,s=!!e&&e.includes(j.MODAL),o=Fh.buildActionObject({containerItemID:e,dataPageID:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(a,o);return fh({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:s,isFormValid:Il(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=ct,r=Yl.getSavableDataPage(e),a=Yl.getDataPageKeys(r),s={};if(a)for(const e of a)s[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=Fh.buildActionObject({dataViewName:r,dataViewParameters:s},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return fh({type:"DELETE_DATA_OBJECT",payload:{...o}}),i}getDataObjectView(e,t,n={viewName:""}){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=lt,{dataPageID:a,dataViewParameters:s}=Vd(e,t),o=Fh.buildActionObject({dataLookUp:a,keyProperties:t,requestPayload:s,viewName:n.viewName||F.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:j.MODAL},this.c11nEnv),{promise:i}=this.actionsApiPromise(r,o);return fh({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}=hh()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const{dataPageID:a,keys:s}=Bd(r,t),o=dt,i=e&&e.includes(j.MODAL),c=Fh.buildActionObject({containerItemID:e,dataPageID:a,key:s},this.c11nEnv),{promise:l}=this.actionsApiPromise(o,c);return fh({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:Il(e)}}),l}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=ut,{dataViewParameters:s,dataPageID:o,dataPageKeys:i}=Vd(e,t),c=Fh.buildActionObject({actionID:n,actionName:r,dataViewParameters:s,lookupDatapage:o,containerName:j.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(a,c);return fh({type:a,payload:{...c}}),l}submitDataObjectAction(e,t,n){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:r}=hh()?.getState()||{},a=r[e]?.dataInfo?.content?.classID;if(!a)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const s=ip(e),o=ku(s),i=pu(o,s)||{},{resourceType:c="",key:l=""}=i,d=pt,{dataPageID:u,keys:p}=Bd(a,t),h=Fh.buildActionObject({containerItemID:e,actionID:n,resourceType:c,key:l,keys:p,savableDatapage:u,containerName:j.MODAL,context:e},this.c11nEnv);h.context=e;const{promise:f}=this.actionsApiPromise(d,h);return fh({type:d,payload:{...h,isFormValid:Il(e)}}),f}createWork(e,t={flowType:"",containerName:"",openCaseViewAfterCreate:!1,modalOptions:{dockable:!1},startingFields:Object,remoteCaseMeta:{},channelName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.createWork)return window.pms.plugins.c11n.createWork(e,"pyStartCase",t);const{dockable:n=!1}=t?.modalOptions||{};let r=le;const a=Fh.buildActionObject({class:e,flowType:"pyStartCase",containerName:j.PRIMARY,openCaseViewAfterCreate:!0,...t,modalOptions:{isDockable:n}},this.c11nEnv),{promise:s}=this.actionsApiPromise(r,a);if(t.channelName&&(a.headers=a.headers||{},a.headers[j.X_ORIGIN_CHANNEL]=t.channelName),V.isRemoteCase(e)){const{RemoteClassName:t,RemoteSystemID:n,name:s}=V.getRemoteCase(e);if(a.className=e,a.class=t,a.headers=a.headers||{},a.headers.RemoteSystemID=n,V.isTraditionalRemoteCase(e)){const n={className:e,name:s,action:"createWork",remoteClassName:t};r=this.setTraditionalRemoteCaseParams(a,n)}}return $i.getPreviewMode()&&(a.debugInfo={debugId:Rh.generateUniqueID()}),fh({type:r,payload:{...a}}),s}setTraditionalRemoteCaseParams(e,t){return e.className=t.className,e.isTraditionalRemoteCase=V.isTraditionalRemoteCase(t.className),e.remoteClassName=t.remoteClassName,e.action=t.action,e.viewName=U,e.gadgetId=t.gadgetId??xc.getUniqueGadgetId(),e.name=t.name,e.skipSemanticUrl=!0,ne}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=ye,r=Fh.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:a}=this.actionsApiPromise(n,r);return fh({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=Fh.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:a}=this.actionsApiPromise("GET_DESCENDANTS",r),s=(o={...r,context:n},{type:Ud,payload:o});var o;return fh(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(window.pms?.plugins?.c11n?.openWorkByHandle)return window.pms.plugins.c11n.openWorkByHandle(e,t);const r={insKey:e,acTargetName:n.targetContainer||j.PRIMARY,containerName:n.targetContainer||j.PRIMARY};let a=de;const s=Fh.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(a,s);return n.channelName&&(s.headers=s.headers||{},s.headers[j.X_ORIGIN_CHANNEL]=n.channelName),s.className=t,V.isRemoteCase(t)&&(a=this.setRemoteCaseParamsForOpenCase(s,t,n.remoteCaseMeta)??a),$i.getPreviewMode()&&![j.WORKAREA].includes(n.targetContainer)&&(s.debugInfo={debugId:Rh.generateUniqueID()}),fh({type:a,payload:{...n,...s}}),o}setRemoteCaseParamsForOpenCase(e,t,n={}){const{RemoteSystemID:r,RemoteClassName:a,name:s}=V.getRemoteCase(t);if(e.headers=e.headers||{},e.headers.RemoteSystemID=r,e.isRemoteCase=!0,e.remoteCaseClass=t,V.isTraditionalRemoteCase(t)){e.remoteCaseMeta=n;const r={className:t,name:s,action:mt,remoteClassName:a};return this.setTraditionalRemoteCaseParams(e,r)}}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(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};n.isChild&&(r.containerName=j.PRIMARY,r.isChild=n.isChild);let a=Gl;const s=Fh.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(a,s);if(n.channelName&&(s.headers=s.headers||{},s.headers[j.X_ORIGIN_CHANNEL]=n.channelName),V.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:r,name:o}=V.getRemoteCase(t);if(s.headers=s.headers||{},s.headers.RemoteSystemID=r,V.isTraditionalRemoteCase(t)){s.remoteCaseMeta=n.remoteCaseMeta;const r={className:t,name:o,action:"openAssignment",remoteClassName:e};a=this.setTraditionalRemoteCaseParams(s,r)}}s.className=t,s.activeItemCaseViewMode=this.c11nEnv.getValue("context_data.caseViewMode"),$i.getPreviewMode()&&![j.WORKAREA].includes(n.containerName)&&(s.debugInfo={debugId:Rh.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 fh({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));const n=Nu(e);let r=n;if(n?.includes("/workarea")&&(r=n.substring(0,r?.lastIndexOf("/workarea"))),(e=>{const t=Tn.getContextReferences(e);if(t)for(const[,e]of t)if(Mh.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0;return!1})(n)){const e=[{type:"error",message:_p.getLocaleValue(this.MSG_ACTIVE_SUGGESTION_UNATTENDED,"Messages")}];return Xn({messages:e,context:r,category:F.PAGE}),Promise.reject({type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR})}const a=pe,s=t?.isTriggeredFromDifferentContext,{caseID:o,assignments:i,localActionID:c,caseActions:l,caseInfo:d,businessID:u,caseTypeID:p,caseTypeName:h}=dn(e,this.c11nEnv,{isTriggeredFromDifferentContext:s}),f=nn(d);let g,m=!1;if(l){const e=l.find((e=>e.ID===c));m="Case"===e?.type}else g=gh(n);let{assignmentID:y}=dn(e,this.c11nEnv,{isTriggeredFromDifferentContext:s});g?.context_data?.actionType&&(m=g.context_data.actionType===j.CASE,y=y||g.context_data.assignmentID);const I=ln(i,y,c),[E,A]=o.split(" "),C={class:E,actionID:I,assignmentID:y,caseID:o,workID:A,containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:m,doDeleteCaseSummary:!0,isInCreateStage:f,businessID:u,caseTypeID:p,caseTypeName:h};e?.includes(j.MODAL)&&(C.containerName=j.MODAL,C.isModalAction=!0),C.outcome=t.outcomeID,C.jsActionQueryParams=t.jsActionQueryParams,d?.isLocalAction&&(C.viewType=Mc.FORM);const _=Fh.buildActionObject(C,this.c11nEnv),{promise:S}=this.actionsApiPromise(a,_);return _.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||gh(n).context_data.isProcessAction,Jt.executeOrQueueDeferredAction({type:a,payload:{..._,context:n}}),S}getNextWork(){const e=Gl,t=Fh.buildActionObject({containerName:j.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return fh({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=Gl,n=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getCaseSummary().headers,a=Fh.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 fh(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(F.CASE_INFO.CASES),r=this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID),a={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(j.MODAL)&&(a.containerName=j.MODAL,a.isModalAction=!0);const s=Fh.buildActionObject(a,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,s),i=Nu(e);return fh({type:t,payload:{...s,context:i,cases:n,actionID:r,isFormValid:Il(i),classID:this.c11nEnv.getCurrentClassID()}}),o}submitBulkActionAsync(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION_ASYNC",n=this.c11nEnv.getValue(F.CASE_INFO.CASES),r=this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID),a={containerName:e.includes(j.MODAL)?j.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(j.MODAL)},s=Fh.buildActionObject(a,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,s),i=Nu(e);return fh({type:t,payload:{...s,context:i,cases:n,actionID:r,isFormValid:Il(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"));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=Fh.buildActionObject(s,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return fh({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 Kl(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(fh({type:Q,payload:{reference:F.CASE_INFO.APPROVALFLAG,value:j.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)):(fh({type:Q,payload:{reference:F.CASE_INFO.APPROVALFLAG,value:j.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(F.CASE_INFO.DUPLICATECASEINSKEY).split(" "),n={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEFLAG,value:j.DUPLICATE,context:e}},r={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return fh([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:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEFLAG,value:j.IGNORE,context:e}},n={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEID,value:"",context:e}},r={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEINSKEY,value:"",context:e}};return fh([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=t.caseID||this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID);if(window.pms?.plugins?.c11n?.openLocalAction)return t.caseID=n,Wd(window.pms.plugins.c11n.openLocalAction,e,t);const r=t.assignKey||this.c11nEnv.getValue(F.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="OPEN_LOCAL_ACTION",i=Fh.buildActionObject(s,this.c11nEnv),c=this.c11nEnv.getContextName(),{promise:l}=this.actionsApiPromise(o,i),d=Tu(c)[0];let u=!1;const p=V.getRemoteHeaderByContext(c);let h;if(p&&(i.headers={},i.headers.RemoteSystemID=p),!d)return h=c,fh({type:o,payload:{...i,contextName:c,continueExecution:u}}),l;h=_u(d);const f=uu(d);if(f?.accessedOrder.forEach((e=>{n===f.items[e].key&&(u=!0,h=f.items[e].context)})),!u||h&&"review"===hh()?.getState()?.data[h]?.context_data?.caseViewMode)return fh({type:o,payload:{...i,contextName:c,continueExecution:u}}),l;const g=h,m=g&&g.includes(j.MODAL),y=t.assignKey||this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),I=gh(h),E=I?.caseInfo?.assignments?I.caseInfo.assignments[0]?.actions[0]?.ID:void 0,A=this.c11nEnv.getContainerName(),C=this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),_=this.c11nEnv.getValue("isProcessAction","isProcessAction"),S=Fh.buildActionObject({context:g,containerItemID:h,assignmentID:y,actionID:E,caseID:n,containerName:A,caseType:C,isModalAction:m,isFormValid:!0,isProcessAction:_},this.c11nEnv);S.context=h;const b=Nu(h),N=this.c11nEnv.getCaseSummary(),v=nn(N),P=Fh.buildActionObject({caseID:n,containerItemID:h,cancelContext:b},this.c11nEnv);let T={};return m?(P.acTargetName=j.MODAL,P.isInCreateStage=v,P.isModalAction=m,T={...P}):T={...P,acName:yt(this.c11nEnv.getContainerName(),P.context)},fh({type:o,payload:{...i,contextName:c,saveActionPayload:S,cancelActionPayload:T,continueExecution:u}}),l}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(F.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,Wd(window.pms.plugins.c11n.openProcessAction,e,t);const r=this.c11nEnv.getValue(F.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=Bl,i=Fh.buildActionObject(s,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return fh({type:o,payload:{...i}}),c}navigateToStep(e,t){if(!e)return Promise.reject(new Error("stepID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("stepID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n="NAVIGATE_TO_STEP",r=this.c11nEnv.getValue(F.NEXT_ASSIGNMENT_INFO_ID)?this.c11nEnv.getValue(F.NEXT_ASSIGNMENT_INFO_ID):this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),a=nn(this.c11nEnv.getCaseSummary()),s=this.c11nEnv.getValue(F.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(j.MODAL)&&(o.acTargetName=j.MODAL);const i=Fh.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=Nu(t);return fh({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}=F,r=he,a=Nu(e),s=e&&e.includes(j.MODAL),o=this.c11nEnv.getCaseSummary(),i=nn(o),c=this.c11nEnv.getValue(n.CASE_INFO_ID),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),d=Fh.buildActionObject({caseID:c,containerItemID:e,context:a},this.c11nEnv);let u={};s?(d.acTargetName=j.MODAL,d.isInCreateStage=i,d.isModalAction=s,u={...d}):u={...d,acName:yt(this.c11nEnv.getContainerName(),d.context)};const{promise:p}=this.actionsApiPromise(r,d);return fh({type:r,payload:u}),p.then((()=>{t||Gd({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}=F,n=e,r=He,a=e&&e.includes(j.MODAL),s=this.c11nEnv.getValue(t.CASE_INFO_ID),o=Fh.buildActionObject({caseID:s,containerItemID:e,context:n},this.c11nEnv);if(!Ll(n)){return new Kl(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{Gd({caseID:s,context:this.c11nEnv.getContextName()})}))}fh({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}=F,n=He,r=e,a=r&&r.includes(j.MODAL),s=this.c11nEnv.getCaseSummary(),o=nn(s),i=this.c11nEnv.getValue(t.CASE_INFO_ID),c=Fh.buildActionObject({caseID:i,containerItemID:e,context:r},this.c11nEnv),l=this.c11nEnv.getValue("isProcessAction","isProcessAction"),d=Ep.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(c.isProcessAction=l,o&&(a||d)&&!an(s)){const t=this.c11nEnv.getValue(j.CASE_INFO.IS_FIRST_ASSIGNMENT),i=Ll(r);if(this.shouldDeleteCaseInCreateStage(i,t,d))return this.deleteCaseInCreateStage(e);fh({type:n,payload:{...c,isModalAction:a,isChildCase:cn(s),isInCreateStage:o}})}const{promise:u}=this.actionsApiPromise(n,c);return u.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=Hl,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return fh(ql(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=Hl,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return fh(ql(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=Wl,r=e,a=r&&r.includes(j.MODAL),s=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),o=this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),i=Fh.buildActionObject({caseID:s,caseType:o,containerItemID:e,context:r,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(F.CASE_INFO.PARENTCASEINFO);i.isProcessAction=c,i.parentCaseInfo=l;const d=`${j.APP.APP}/${lu.PRIMARY}`,u=qc(d,lu.PRIMARY);i.parentContext=u,a&&(i.targetName=j.MODAL,i.containerName=lu.MODAL,i.isModalAction=a),fh((e=>({type:Wl,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Gd({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}=Ip.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=E()+t;return Ui(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:a}=Ip.getRestEndPoint("updateRecents")||{},s=`${E()}${a}`;return Ui(s,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=Ip.getRestEndPoint("Logout")||{},t=`${E()}${e}`;return Ui(t,{method:"GET",headers:{}}).then((e=>(Object.keys(Tn.rootNodes).forEach((e=>{jd.cleanCaches(e)})),Tn.rootNodes={},sessionStorage.clear(),Th(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return Ui(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,"pyCasePreview",{container:lu.PREVIEW,containerName:lu.PREVIEW,context:F.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("pyDataPreview",e,t,{container:lu.PREVIEW,containerName:lu.PREVIEW,context:F.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=Fh.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),RemoteSystemID:V.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=te,{promise:s}=this.actionsApiPromise(a,r,!1);return fh({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=Fh.buildActionObject({viewName:e,className:t},this.c11nEnv),a=ne,{promise:s}=this.actionsApiPromise(a,r);return $i.getPreviewMode()&&(r.debugInfo={debugId:Rh.generateUniqueID()}),fh({type:a,payload:{...r,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=Fh.buildActionObject({},this.c11nEnv),r=ae,{promise:a}=this.actionsApiPromise(r,n);return fh({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=Fh.buildActionObject({},this.c11nEnv),r=se,{promise:a}=this.actionsApiPromise(r,n);return fh({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=Fh.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:V.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),s=re;r?.containerName||(r.containerName="HYBRID"===Ep.getRenderingMode()?kd.getRuntimeParam(j.HYBRID_ROOT_CONTAINERNAME):lc.getTargetViewContainerName(s));const{promise:o}=this.actionsApiPromise(s,a);return fh({type:s,payload:{...a,...r,skipSemanticUrl:Boolean(r.skipSemanticUrl)}}),o}changeHandler(e,t){Fh.changeHandler(e,t)}eventHandler(e,t){Fh.eventHandler(e,t)}triggerFieldChange(e,t,n=!1){const r=this.c11nEnv.getContextName(),a=this.c11nEnv.getPageReference(),s=Mh.getContextPath(a,e);n||this.c11nEnv.getValidationApi().validate(t),this.c11nEnv.isInsideList()&&this.c11nEnv.getListActions().updateProperty(e,t);let o=this.c11nEnv.getValue(j.CLASS_ID);const i=e?e.split(".").filter((e=>!!e)):[];i.length>1&&(i.pop(),o=Ih(`.${i.join(".")}.classID`,a,r)),e=Rh.trimDotForProperty(e),fh({type:ee,payload:{reference:s,value:t,context:r,pageReference:this.c11nEnv.getPageReference(),propertyName:e||this.c11nEnv.getComponentConfig().value,classID:o}})}updateFieldValue(e,t,n={}){const{removePropertyFromChangedList:r=!1,isArrayDeepMerge:a=!0,contextPageReference:s="",isListEntry:o=!1,skipDirtyValidation:i=!1}=n,c=this.c11nEnv.getContextName();let l=this.c11nEnv.getPageReference();const d=s?.startsWith(l)?s.replace(l,""):s;l=s||l;const u=Mh.getContextPath(l,e);let p=!1;this.c11nEnv.isInsideList()&&this.c11nEnv.getListActions().updateProperty(d?`${d}${e}`:e,t,{isArrayDeepMerge:a}),this.c11nEnv.isBulkAction()&&(p=!0),e||(e=this.c11nEnv.getStateProps().value),zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:l,context:c,isListEntry:o}),fh({type:Q,payload:{reference:u,value:t,context:c,isArrayDeepMerge:a,skipDirtyValidation:i,...p&&{isStrictTracking:p},...r&&{removePropertyFromChangedList:r}}})}activateModalContainerItem(e){const t=Me,{context:n}=e,r=n&&n.includes(j.MODAL),a=Fh.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);r&&(a.containerName=j.MODAL,a.isModalAction=r),fh({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}=r,p={actionMgrID:s,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,optionalPayload:u};r.refreshFor&&(p.refreshFor=r?.refreshFor),r.skipDataMerge&&(p.skipDataMerge=r?.skipDataMerge);const h=d||this.c11nEnv.getContextName(),f=this.c11nEnv.getPageReference();return!this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)&&o&&(((e,t)=>on(e)&&!sn(e,t))(h,f)||sn(h,f))?Fn(h,n,p):xn(e,t,h,n,p),a}openEmbeddedDataModal(e,t,n,r,a,s){const o=ht,i=t.getCaseInfo().getKey(),c=`${t.getPageReference().replace(F.CASE_INFO.CASE_INFO_CONTENT,"")}${n}[${r}]`,l={targetProperty:n,index:r,viewID:e,ID:i,actionType:a,interestPage:Rh.convertPageRefToClipboardPageNotation(c),heading:s},d=Fh.buildActionObject(l,this.c11nEnv),{promise:u}=this.actionsApiPromise(o,d);if(Ep.getFeatureMap().granularUIRefresh){(t.getMetadata().config.children[0].children||[]).forEach((e=>{const n=tn.trimAnnotation(e.config.value),r=Vp(n.startsWith(".")?n.replace(".",""):n,e.config.classID);if(r?.isDeclarativeTarget){const e=t.getPageReference();Tn.addFieldNode(t.getContextName(),e+c,t.viewName,n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:e+c})}}))}return fh({type:o,payload:{...d,containerName:F.MODAL,skipSemanticUrl:!0}}),u}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=ft,n=this.c11nEnv.getPageReference().replace(F.CASE_INFO.CASE_INFO_CONTENT,""),r=Nu(e),a={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),viewID:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME),isFormValid:Il(r),interestPage:Rh.convertPageRefToClipboardPageNotation(n),parentContext:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isModalAction:!1,target:this.c11nEnv.getTarget()};e&&e.includes(j.MODAL)&&(a.containerName=j.MODAL,a.isModalAction=!0);const s=Fh.buildActionObject(a,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,s);if(Ll(r)){const[e,t,n]=mn(this.c11nEnv.getPageReference());Tn.mutatePageList(this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),e,t,{type:Ze,rowIndex:n}),fh({type:Ze,payload:{pageReference:this.c11nEnv.getPageReference(),context:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isListEntry:!0}})}return Jt.executeOrQueueDeferredAction({type:t,payload:{...s,context:r}}),o}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=Nu(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:a}=this.actionsApiPromise(gt);return Fn(t,n,{actionMgrID:a,isFillFormWithAI:!0,preserveClientChanges:!1}),r}};const qd=class{constructor(e){this.c11nEnv=e}async getCaseStages(e,t){const n={caseID:e},{restApi:r,reqType:a}=Lf("getCaseStages",n);return(await Ui(r,{method:a},t)).data.stages}getCaseTypeName(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_TYPE_NAME)}getName(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_NAME)}getClassName(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_TYPE_ID)}getAvailableProcesses(){return this.c11nEnv.getValue(j.CASE_INFO.AVAILABLEPROCESSES)}getKey(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(j.CASE_INFO.ASSIGNMENT_ID)}getActions(){return this.c11nEnv.getValue(j.CASE_INFO.ACTION_BUTTONS)}getActiveFlowActionID(){return this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID)||this.c11nEnv.getValue(j.CASE_INFO.ASSIGNMENTACTION_ID)}getParentCaseInfo(){return this.c11nEnv.getValue(j.CASE_INFO.PARENTCASEINFO)}isPerform(){return this.c11nEnv.getValue(`${j.CONTEXT_DATA}${j.CASE_VIEW_MODE_PROP}`)===j.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${j.CONTEXT_DATA}${j.CASE_VIEW_MODE_PROP}`)===j.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO);return nn(e)}isLocalAction(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO);return an(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===j.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),r=pu(t,n),{config:a}=t&&n?r&&r.view:this.c11nEnv.getMetadata();e=a?.type===j.VIEW?a?.name:null}(e&&e.startsWith(j.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(j.CASE_INFO.VIEW_NAME))}return e}getActionRefreshConditions(){const e=this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),t=W(this.c11nEnv.getContextName());let n;t&&(n=gh(t));const r=n?.caseInfo?.availableActions,a=gh(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(j.CASE_INFO.ACTION_REFRESH_CONDITIONS)}getBusinessID(){return this.c11nEnv.getValue(j.CASE_INFO.BUSINESS_ID)}getAssignments(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO)?.assignments}getChildAssignments(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO)?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),t=this.c11nEnv.getValue(j.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(j.CASE_INFO.CASE_INFO_ACTIONS),t=this.c11nEnv.getValue(j.CASE_INFO.ASSIGNMENT_LABEL),n=this.c11nEnv.getValue(j.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(j.CASE_INFO.CASE_INFO_ACTIONS),t=this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ACTIONS);return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(j.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(j.CASE_INFO.GETNEXTWORK)}},{RESOURCE_TYPES:Yd}=F;const Kd=class{static openCase(e,t,n,r={}){const a={insKey:e,acTargetName:n,actionMgrID:un.getNextActionMgrId(),context:t,...r},s=de;r&&r.channelName&&(a.headers={},a.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=un.actionManagerPromise(s,a.actionMgrID);return fh({type:s,payload:a}),o}static openAssignment(e,t,n,r={}){const a={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:un.getNextActionMgrId(),context:t,...r},s=fe;r&&r.channelName&&(a.headers={},a.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=un.actionManagerPromise(s,a.actionMgrID);return fh({type:s,payload:{...a}}),o}static createCase(e,t,n,r={}){const a=le,s={class:e,acTargetName:n,actionMgrID:un.getNextActionMgrId(),context:t,...r};r&&r.channelName&&(s.headers={},s.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=un.actionManagerPromise(a,s.actionMgrID);return fh({type:a,payload:{...s}}),o}static getNextWork(e,t,n={}){const r=fe,a={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:un.getNextActionMgrId(),context:e,...n},{promise:s}=un.actionManagerPromise(r,a.actionMgrID);return fh({type:r,payload:{...a}}),s}static getOpenedCaseItems(e){const t=[],n=uu(e);if(n){const{items:r={}}=n,a=Object.keys(r),s=_u(e);a.forEach((n=>{if(r[n]&&(r[n].resourceType===Yd.CASE||r[n].resourceType===Yd.ASSIGNMENT)){const{key:a="",context:o}=r[n],i=r[n],c=a.substring(a.indexOf(" ")+1),l=Ih(".caseTypeID",j.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}=Lf(Be,n),s={},o=V.getRemoteHeaderFromSourceClass(t??"");return o&&(s.RemoteSystemID=o),Ui(r,{method:a,headers:s})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=Lf("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(Ui(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.length&&(l=l.filter((t=>c[e].data.availableActions.some((e=>t.ID===e.ID))))):l=c[e].data.availableActions;return l};static getCaseBulkActionsByCaseTypeID=async e=>{const t={casetypeID:e},{restApi:n,reqType:r}=Lf("getCaseBulkActions",t),a=await Ui(n,{method:r});let s=[];return a.data?.availableActions?.length&&(s=a.data.availableActions),s}};const zd=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=Mh.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=Mh.getContextPath(this.datasource,this.index);return this.index+=1,au({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class Xd{constructor(e,t){this.children=e,this.index=0,this.options=t}hasNext(){return this.index<this.children.length}next(){if(!this.hasNext())throw new Error("No Children");const e=this.children[this.index];return this.index+=1,au({meta:e,index:this.index,options:this.options})}resetIndex(){this.index=0}}const Jd=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new zd(e,e.context||"",t);if(n){const n=Ah(`${t.context}.${j.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new zd(e.children[0],n||e.context,t)}return e?.children?new Xd(e.children,t):void 0};class Qd{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=>Cl.isProperty(e))).map((e=>Cl.getPropertyName(e)))}}const Zd=new Qd;let eu;Object.freeze(Zd);const tu=(e,t,n)=>{e&&(Object.keys(e).forEach((r=>{if("children"!==r){const a=e[r],s=tn.trimAnnotation(a);if("string"!=typeof s&&"string"!=typeof a||!(Rh.isValidAnnotation(a)&&Rh.isPropertyRef(s)||a.startsWith("@W ")||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({}),tu(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]||{},tu(s,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[r]=s}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},nu=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...Rh.deepClone(t.inheritedProps)]};class ru{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.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.xrayInfo={},this._readOnly=t?.config?.readOnly||r.readOnly,this._hasSuggestions=!1,this._actionsApi=null,this._classID=null,this.index=e.index,this.categoryName=r.categoryName||"",r.inheritedConfig&&(this._inheritedConfig=Rh.deepClone(r.inheritedConfig)),t?.config?.inheritedProps&&nu(this._inheritedConfig,t?.config),tu(this._rawConfig,this._stateProps),this._isState=!Rh.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=Rh.isExpressionExist(this._rawConfig.config),this._isWhenExist=Rh.isWhenExist(this._rawConfig.config),this._isValidatorExist=Dr.isValidatorExist(this._rawConfig.config)),this._isRoot?this._contextName=F.APP.APP:this._contextName=this.meta?.config?.contextName||this.options.context,this._type=this.meta?.type;let s=this.options.pageReference;if(this.options.pageReference&&(s=tn.handleAnnotation(this.options.pageReference,this)),this._pageReference=Mh.getContextPath(s||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t),"reference"===this._type&&Rh.isWhenExist({visibility:this.meta?.config?.visibility})&&wn(this.viewName,this._contextName,this._pageReference),"reference"!==this._type&&t&&(this._rawConfig=Mh.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=tn.trimAnnotation(e.localeReference)||r.localeReference,this._isExpressionExist=Rh.isExpressionExist(e),this._isWhenExist=Rh.isWhenExist(e),this._isValidatorExist=Dr.isValidatorExist(e)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&(this.viewName=tn.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&Ln(this)}}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=tn.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=tn.trimAnnotation(this.getPropertyName());return""===this._pageReference&&e.startsWith(".")?e.substring(1,e.length):e}addFieldNode(){const e=this._getPropertyName(),{value:t,label:n,required:r,readOnly:a,disabled:s,visibility:o,validationType:i,caption:c,allowMultiple:l}=this.getRawConfigProps();if(this.getValue(this._pageReference)||""===this._pageReference){const d="Address"===this._type&&this._rawConfig?.config?.associatedView?tn.trimAnnotation(this._rawConfig.config.associatedView):"",u=n||c,p={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:tn.trimAnnotation(t),label:u?.startsWith("@")?tn.handleAnnotation(u,this,void 0):u,required:r,readOnly:a,disabled:s,visibility:o||this.options?.visibility,skipRequiredValidation:this.options?.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:t,validationType:i,componentName:this._rawConfig?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),index:this.index,allowMultiple:l,isDeclarativeTarget:this.isDeclarativeTarget()};Tn.addFieldNode(this._contextName,this._pageReference,(d||this.categoryName||this.viewName)??"",e,this.getValue(e),p)}}removeNode(){if(!this.isVisible())if(Object.hasOwn(this._rawConfig?.config??{},"value"))Tn.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",tn.trimAnnotation(this.getPropertyName()),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference;Tn.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index)}}addViewNode(){this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&this.viewName&&Tn.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName),"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&Tn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&Tn.addViewNode(this._contextName,this._pageReference,tn.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&Tn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}addWhenNode(){let e="",t="";const n=Rh.getWhenNames(this._rawConfig?.config),r=this.getRawConfigProps();if(r?.type&&r?.type?.toLowerCase()===j.VIEW)t=j.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=j.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=tn.isProperty(n)?tn.trimAnnotation(n):""}e&&n.forEach((n=>{Tn.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()!==j.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,readOnly:r,disabled:a,visibility:s,validationType:o,selectionMode:i,selectionList:c,selectionKey:l,referenceList:d,renderMode:u,caption:p}=this.getRawConfigProps(),h=t||p;let f=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(f=this.getSelfReferencingDatapageKeys()),Tn.addPageListNode(this._contextName,this._pageReference,this.viewName??"",tn.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:tn.trimAnnotation(this.getPropertyName()),label:h?.startsWith("@")?tn.handleAnnotation(h,this,void 0):h,required:n,readOnly:r,disabled:a,visibility:s||this.options.visibility,skipRequiredValidation:this.options.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:e,validationType:o,componentName:this._rawConfig.type,type:this._rawConfig.config?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),selectionMode:i,selectionList:c,renderMode:u,referenceList:d,selectionKey:l,index:this.index,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?f:void 0});const g=this.getValue(tn.trimAnnotation(this.getPropertyName()),this._pageReference)||[];Tn.updatePageListNode(this._contextName,this._pageReference,tn.trimAnnotation(this.getPropertyName()),g.length)}this.isWhenExist()&&this.addWhenNode(),this.removeNode()}setXRayInfo(e){Rh.mergeDeep(e,this.xrayInfo)}getXRayInfo(){return this.xrayInfo}getStateProps(){return this._stateProps}setStateProps(e){Rh.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getCaseInfo(){return this._caseInfo||(this._caseInfo=new qd(this)),this._caseInfo}getCaseLocaleReference(){const e=this.getCaseInfo().getClassName();return e?`CASE!${e}`.toUpperCase():null}getListActions(){return $r(this)}getReferenceList(){return this._referenceList}isInsideList(){return this._isInsideList||/\[\d+\]/g.test(this.getPageReference())}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 Mh.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[j.CONTAINERS.ROOT_CONTAINER,j.CONTAINERS.VIEW_CONTAINER,j.CONTAINERS.FLOW_CONTAINER,j.CONTAINERS.MODAL_VIEW_CONTAINER,j.CONTAINERS.PREVIEW_VIEW_CONTAINER,j.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=lu.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=l?.getStore()?.getState()?.data[`${this.getContextName()}/${j.SUGGESTION}`],n=this.getStateProps()?.value,r=Mh.getContextPath(this.getPageReference(),n),a=t?ic.getSuggestionsContext(this.getContextName()).getField(r):void 0;this._hasSuggestions=!!a,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...Or.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig&&this._rawConfig.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(t),this.resolveConfigProps(t,e),Rh.resolveStringBooleans(e)}getRawConfigProps(){const e={...Or.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(Mh.resolveProps(e,t,this),tn.handleComponentMapping(t,{type:this.getComponentName(),config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),tu(e,this._stateProps),this.resolveConfigProps(this._additionalRegisteredProps)}deRegisterAdditionalProps(e=[]){return e.forEach((e=>{delete this._additionalRegisteredProps[e]})),!0}populateAdditionalProps(e){const t=this.getComponentName(),n=this.getComponentConfig(),r=t===j.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(t===j.MODAL_VIEW_CONTAINER||t===j.CASE_CREATE_STAGE){const t=_u(`${j.APP.APP}/${this.getContainerName()}`),n=Kn({context:t,category:F.PAGE});e.pageMessages=n,this._stateProps.pageMessages=e.pageMessages}if(this.isEditable()){let{value:t}=this.getStateProps();void 0===t&&"multi"===this.getComponentConfig()?.selectionMode?t=this.getStateProps().selectionList||tn.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=Kn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_ERROR}),r=Kn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_INFO});n&&n[0]&&(e.validatemessage=n.map((e=>_p.getLocaleValue(e.message.replace(/\.$/,""),"Messages"))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=j.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status),r&&r[0]&&(e.infoMessage=r[0].message,e.status=j.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(t===j.ROOT_CONTAINER){const t=Qn(r,_u(`${j.APP.APP}/${this.getContainerName()}`));e.httpMessages=t,this._stateProps.httpMessages=e.httpMessages;const n=ic.getSharedState("isLoggedOut");e.isLoggedOut=n,this._stateProps.isLoggedOut=n;const a=Kn({context:j.APP.ROOT,category:"PAGE"});e.pageMessages=a,this._stateProps.pageMessages=e.pageMessages}if(t===j.HYBRID_VIEW_CONTAINER){const t=Kn({context:j.APP.APP,category:j.HTTP});e.httpMessages=t,this._stateProps.httpMessages=t}if(t===j.APP_SHELL&&e.portalDocMode===j.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=Kd.getOpenedCaseItems(`${F.APP.APP}/${j.PRIMARY}`),this._stateProps.activeCases=e.activeCases),t===j.APP_SHELL){const t=j.APP.APP,n=_u(`${t}/${this.getContainerName()}`),r=[...Kn({context:t,category:"PAGE"})||[],...Kn({context:n,category:"PAGE"})||[]],a=r.length>0?r:void 0;e.pageMessages=a,this._stateProps.pageMessages=e.pageMessages}if(e.value&&t===j.SCALARLIST&&(this._stateProps.value=e.value),t===j.APP_SHELL||t===j.MODAL_VIEW_CONTAINER||t===j.CASE_CREATE_STAGE||n.template===j.CASE_PREVIEW){let t=Kn({context:j.APP.APP,category:"HTTP"});const n="HYBRID"===Ep.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${j.APP.APP}/${this.getContainerName()}`,r=Kn({context:_u(n),category:"HTTP"});t?r&&(t=t.concat(Kn({context:_u(n),category:"HTTP"}))):t=Kn({context:_u(n),category:"HTTP"}),e.httpMessages=t?t.map((e=>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(t===j.VIEW_CONTAINER||t===j.FLOW_CONTAINER||t===j.MODAL_VIEW_CONTAINER||t===j.PREVIEW_VIEW_CONTAINER||t===j.ROOT_CONTAINER){if(e.routingInfo=It(this.getContainerName(),this._contextName),t===j.ROOT_CONTAINER&&(e.rootConfig=Qd.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,t===j.FLOW_CONTAINER){const t=Kn({context:this.getContextName(),category:j.CASEMESSAGES}),n=this.getContextName();e.caseMessages=t,this._stateProps.caseMessages=e.caseMessages,e.caseViewMode=this.getValue("context_data.caseViewMode"),this._stateProps.caseViewMode=e.caseViewMode;const r=Tu(n)[0];if(r){const t=_u(r),n=l?.getStore()?.getState()?.data;n&&t&&(e.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime);const a=Kn({context:t,category:F.PAGE}),s=Kn({context:t,category:"HTTP"});e.httpMessages=s,e.pageMessages=a,this._stateProps.pageMessages=e.pageMessages,this._stateProps.httpMessages=e.httpMessages,s?.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.assignmentNames=this.getCaseInfo().getAssignments()?.map((e=>e.name)),e.childAssignmentNames=this.getCaseInfo().getChildAssignments()?.map((e=>e.name)),t===j.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.assignmentNames=e.assignmentNames,this._stateProps.childAssignmentNames=e.childAssignmentNames}else n.template===j.CASE_VIEW||n.template===j.CASE_PREVIEW||n.template===j.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):t===j.CASE_STAGES&&(e.stages=this.getCaseStages(),e.stageID=this.getStageID(),this._stateProps.stages=e.stages,this._stateProps.stageID=e.stageID);this.populateFieldMetadata(e),this.updateContextTree()}isReadOnlyField(e,t){const n=Cl.isPropertyInternal(t),r=e.datasource,a=this.getComponentConfig().isSearchField,{isClassKey:s,isSpecial:o,isDeclarativeTarget:i}=e.fieldMetadata,c=e.listType!==j.ASSOCIATED;return!a&&(i||n||!r&&(s||o)&&c)}getPropertyDetails(e,t,n){return e===j.ASSOCIATED?{propertyValue:t,propertyAnnotation:j.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:j.PROPERTY_ANNOTATION}}updateConfigData(e,t,n){e.fieldMetadata=t,this.isReadOnlyField(e,n)&&(e.readOnly=!0,this._stateProps.readOnly=e.readOnly,e.fieldMetadata.isDeclarativeTarget&&this.registerAdditionalProps({readOnly:!0})),e.fieldMetadata?.isReadOnly&&(e.readOnly=!0,this.registerAdditionalProps({readOnly:!0}))}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(j.ATTACHMENT_ANNOTATION))){const t=tn.getPropertyName(a),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=oh(`${this._pageReference}.${t}`,this._contextName);return(n||null===n)&&(e.additionalInformation=n),e}getFieldMetadata(e){if(!e)return null;const t=e.split(".");if(t.length<2){let t=this.getValue(j.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata(Vp(e,t),e)}return this.resolvePropertyMetadata(Vp(t.pop(),this.getValue(`.${t.join(".")}${j.CLASS_ID}`)),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata(Vp(n,this.getValue(`${t.join(".")}${j.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(j.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[F.CASE_INFO.CASE_INFO]};return e.CaseID=e.CaseID||this.getValue(F.CASE_INFO.CASE_INFO_PZINSKEY),{...e,isCaseWideAction:()=>sn(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()[F.CASE_INFO.CASE_INFO].stages}getStageID(){return this.getDataObject()[F.CASE_INFO.CASE_INFO].stageID}getActions(){return this._actions}isRoot(){return this._isRoot}resolveContextProps(e){const{value:t}=this.getStateProps();t&&(e.error=this.getContextDataValue(`${this.getPageReference()+t}.error`),e.validatemessage=this.getContextDataValue(`${this.getPageReference()+t}.validatemessage`))}isValidatorExist(){return!!this._isValidatorExist}getValidationApi(){return new Vl(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?tn.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||tn.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&tn.handleAnnotation(this._readOnly,this))}hasChildren(){return!!this._children}getComputedVisibility(){const e="reference"===this._type&&!!this.getReferencedView()?this.getReferencedViewPConnect().getPConnect():this;if(!1===this.getConfigProps().visibility)return!1;if(!1===this.getConfigProps().requiresVisibleChildren)return!0;const t=e.getConfigProps(),n={includeTypes:["Group","Region","View"],excludeTemplates:["ListView","SimpleTable","StudioTable"]};let r=e._type&&n.includeTypes.includes(e._type)&&!n.excludeTemplates.includes(t.template);if(!!t.highlightedData&&t.highlightedData.length&&t.showHighlightedData&&(r=!1),!r)return!0;const a=e.getChildren();return!!a&&a.some((e=>e.getPConnect().getComputedVisibility()))}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 gh(e||this.getContextName())}getImagePath(e){return`${Lr.getConstellationServiceUrl()}/v860/${Lr.getAppAlias()}/image/${e}?org=${Ip.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=Jd(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}),t=[];for(;e?.hasNext();){const n=e.next();if(this.isBulkAction()){const e=n.getPConnect().getComponentName(),{template:t}=n.getPConnect().getConfigProps();if(!e||!0!==Qd.allowedComponetsForBulkProcessing[e]&&!0!==Qd.allowedComponetsForBulkProcessing[e]?.[t])continue}t.push(n)}return e?.resetIndex(),t}return[]}setInheritedProp(e,t){this._inheritedConfig[e]=t}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const r=n||this.getLocaleRuleName(),a=this?.getMetadata();let s=null;if(a){const e=a?.type;e&&!["View","Region"].includes(e)&&(s=e)}return _p.getLocaleValue(e,t,r,s)}isNonEnglishAndAnnotated=(e,t)=>!(!e||!t)&&("en-US"!==e&&t?.startsWith(j.FIELD_LABEL_ANNOTATION));isNonExcludedComponent=e=>!!e&&!["View","Region"].includes(e);getLocalizedValueForFieldLabel(e,t,n){e?.startsWith(".")&&(e=e.substring(1));const r=n||this.getLocaleRuleName(),a=this?.getMetadata();let s=null;const o=Ep.getLocale();if(a){const t=a?.type,n=a?.config?.label??a?.config?.caption;if(this.isNonEnglishAndAnnotated(o,n)){const t=n?.split(`${j.FIELD_LABEL_ANNOTATION} `).pop(),r=t?.split("."),a=r?.[r.length-1];let o=`${a}`;const i=this.getFieldMetadata(r?.slice(1).join(".")||""),c=i?.classID||this.getValue(`.${r?.join(".")}${j.CLASS_ID}`),l=i?.definedOnClassID;return o=`${l||c}.${o}`,_p.getLocaleValue(e,o,_p.FIELD_LABELS_BUNDLE_KEY,s)}this.isNonExcludedComponent(t)&&(s=t)}return _p.getLocaleValue(e,t,r,s)}getLocalizedParagraphValue(e){const t=eh(e,this.getCurrentClassID()),n=t?.definedOnClassID;return _p.getParagraphLocaleValue(n||this.getCurrentClassID(),e)||t?.content}getLocaleRuleNameFromKeys(e,t,n){return`${e}!${t}!${n}`}getValue(e,t){return 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?Mh.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${j.SUGGESTION}`):Mh.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)})),nu(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),Mh.resolveProps(t,e,this),e}setValue(e,t,n,r=!1,a={}){let s,o;const{isArrayDeepMerge:i}=a;this.isInsideList()&&this.getListActions().updateProperty(e,t),this.isBulkAction()&&(s=!0,t||(o=!0)),fh({type:"SET_PROPERTY",payload:{reference:`${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){(({value:e,context:t,reference:n})=>{if(_l.isPageInstruction(n))return;const r=n?.startsWith(".")?n?.substr(1):n;vl[t]=vl[t]||{},vl[t][r]||(vl[t][r]={initialValue:Ih(r,null,t)}),vl[t][r].value=e})({reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()})}getContextDataValue(e,t){return Eh(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(j.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let r=j.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(r=n>0?this._pageReference.substring(n):this._pageReference),fh(Vh({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){const{skipDirtyValidation:r=!1}=n;fh({type:"REPLACE_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){fh(mf(e,t||{},n))}getComponent(){return eu({getPConnect:()=>this})}createComponent(e,t,n,r){let a=this._pageReference;if(t){const e=Ah(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,t,this._contextName);a=Mh.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=tn.handleAnnotation(e,this),a=Mh.getContextPath(this._pageReference,e)||""}return eu(au({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}}),r)}getReferencedView(){if(this.meta)return Mh.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(j.CLASS_ANNOTATION)?this.getPageReference():`${this.getPageReference()}${e}`}getReferencedViewPConnect(e=!1){const t={...this.getComponentConfig()};return delete t?.name,delete t?.type,au({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 Kl(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new Hd(this)),this._actionsApi}getActionManager(){return un}doesContextExist(e){return $h(e??this.getContextName())}getGoogleMapsAPIKey(){return _()}getServerURL(){return E()}getLoadingStatus(e){let t=null;return e?(t=gh(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?zn({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName()}):e?.context?zn({type:"error",...e}):(zn({type:"error",...e,context:j.APP.APP}),zn({type:"error",...e,context:_u(`${j.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return Ah(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,e,this.getContextName())||e}removeFormField(){}addFormField(){}setPageValue(e,t,n){delete e?.classID,this.setValue(t,e,void 0,void 0,{isArrayDeepMerge:!1}),((e,t,n)=>{const r=cl(t);il[e]?il[e].fieldOrder[r]=n:il[e]={fieldOrder:{[r]:n}}})(this.getContextName(),`${this.getPageReference()}${t}`,this),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();Tr(r,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<a.length;e+=1)Cr(a[e],e,r,void 0,{})}else"object"==typeof a&&r(a,`${t}.${e}`)}))};r(e,t)})(e,t,this)}acceptSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=ic.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=Mh.getContextPath(this.getPageReference(),n),a=t.getField(r);this._hasSuggestions=!1,this.getActionsApi().updateFieldValue(n,a),this.getActionsApi().triggerFieldChange(n,a),t.removeField(r)}}ignoreSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=this.getStateProps()?.value||e,n=Mh.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,ic.getSuggestionsContext(this.getContextName()).removeField(n)}}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}}function au(e){const t=new ru(e);return{getPConnect:()=>t}}function su(e){eu=e}const ou=class{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 au({meta:i,options:{context:c,pageReference:d||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===lu.WORKAREA||n===lu.MODAL||l===j.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=Cl.isProperty(a),l=Cl.isProperty(r);if(l){const e=Cl.getPropertyName(r);i=Ih(`.${e}`,e.startsWith(".")?n:"",s)}if(i||(i=n),c){const e=Cl.getPropertyName(a);o=Ih(`.${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=_u(e),s=pu(e,t);s&&({key:r,flowName:a}=s)}t.addContainerItem({semanticURL:"",key:r,flowName:a,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}},iu={defaultLimit:16},cu={SINGLE:"single",MULTIPLE:"multiple"},lu={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},du=()=>hh()?.getState()?.containers,uu=e=>e?hh()?.getState().containers[e]:(At.error("getContainerData: target is the required parameter"),null),pu=(e,t)=>{if(!e||!t)return null;const n=du(),r=n?.[e];return r&&r.items&&r.items[t]||null},hu=e=>e?hh()?.getState().containers[e]?.items:(At.error("getContainerItems: target is the required parameter"),null),fu=e=>e?hh()?.getState().containers[e]?.accessedOrder||[]:(At.error("getContainerAccessOrder: target is the required parameter"),[]),gu=e=>e?fu(e)?.length>0||!1:(At.error("areContainerItemsPresent: target is the required parameter"),!1),mu=(e,t,n)=>{if(!e||!t)return At.error("isContainerItemExists: target and key are required parameters"),!1;const r=du(),a=r?.[e],s=a&&a.items||null,o=n||((e,t)=>e===t);if(t&&s)for(const e in s)if(o(t,s[e].key))return!0;return!1},yu=(e,t,n)=>{if(!e||!t)return At.error("getContainerItemName: target and key are required parameters"),null;const r=du(),a=r?.[e],s=a&&a.items||null,o=n||((e,t)=>e?.toLowerCase()===t?.toLowerCase());if(t&&s)for(const e in s)if(o(t,s[e].key))return e;return null},Iu=(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},Eu=e=>{if(!e)return At.error("getContainerItemByKey: key is required parameter"),null;const t=du()??{};for(const n of Object.keys(t))if(t[n]){const r=t[n].items??null,a=Iu(e,r);if(a)return a}return null},Au=(e,t)=>{if(!e||!t)return At.error("isContainerInitialized: context and name are required parameters"),!1;const n=du();return n&&Object.prototype.hasOwnProperty.call(n,`${e}/${t}`)},Cu=(e,t)=>{if(!e||!t)return At.error("getContainerType: context and name are required parameters"),null;const n=du(),r=n?.[`${e}/${t}`];return r&&r.type},_u=e=>{if(!e)return At.error("getActiveContainerItemName: target is the required parameter"),null;let t=null;const n=du();if(n&&n[e]){const r=n[e],{accessedOrder:a}=r;t=a&&a.length>0?a[a.length-1]:null}return t},Su=(e,t,n)=>{if(!e||!t)return At.error("isContainerItemActive: target and key are required parameters"),!1;const r=yu(e,t,n);return!!r&&r===_u(e)},bu=(e,t)=>{let n=null;const r=du();for(const a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&r[a].items){const s=r[a].items[e];if(n=s?s[t]:null,n)break}return n},Nu=e=>e?bu(e,"context"):(At.error("getDataContextName: containerItemName is required parameters"),null),vu=e=>{if(!e)return At.error("getActiveContainerItemContext: target is required parameters"),null;let t=null;const n=du();if(n&&n[e]){const r=n[e],{accessedOrder:a}=r,s=a&&a.length>0?a[a.length-1]:null;t=Nu(s)}return t},Pu=e=>{if(!e)return At.error("getChildContainerItems: containerItemName is required parameters"),[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const a=du(),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 in a)if(Object.prototype.hasOwnProperty.call(a,e)&&a[e].items){const t=s(a[e].items);t&&t.length>0&&(n=n.concat(t)),n=n.sort()}return r?n:[]},Tu=e=>{if(!e)return At.error("getChildContainers: containerItemName is required parameters"),[];const t=[],n=du();for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e&&t.push(r);return t},$u=e=>{if(!e)return At.error("getChildContainersContexts: parentContainerItemID is required parameters"),[];const t=[],n=du();for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e){(fu(r)||[]).forEach((n=>{Nu(n)!==e&&t.push(Nu(n))}))}return t},Ou=e=>{const t=[...$u(e),e],n=[],r=hh()?.getState().data||{};return t.forEach((e=>{Object.prototype.hasOwnProperty.call(r,`${e}/${j.SUGGESTION}`)&&n.push(`${e}/${j.SUGGESTION}`)})),n},Ru=e=>e?e&&uu(e)&&uu(e).type===cu.SINGLE:(At.error("isContainerSingleMode: target is required parameters"),null),Du=e=>e?e&&uu(e)&&uu(e).type===cu.MULTIPLE:(At.error("isContainerMultipleMode: target is required parameters"),null),xu=e=>e?uu(e)&&uu(e).items&&Object.keys(uu(e)?.items).length>0||!1:(At.error("hasContainerItems: target is required parameters"),!1),wu=e=>e&&iu[e]?iu[e]:iu.defaultLimit,Mu=(e,t=iu.defaultLimit)=>{e?iu[e]=t:At.error("setContainerLimit: target is required parameter")},Lu=e=>{if(!e)return At.error("isContainerLimitReached: target is required parameter"),!1;let t=!1;const n=uu(e),{items:r={}}=n,a=Object.keys(r),s=wu(e);return a&&a.length>0&&a.length>=s&&(t=!0),t},Fu=e=>{if(!e||!e.name||!e.context)return At.error("resetContainersPayload: containerInfo object should contain name and context"),null;const t=e?.name,n=uu(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],a=Tu(`${j.APP.APP}/${j.PREVIEW}`),s=$u(`${j.APP.APP}/${j.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...s],childContainers:a}},ju=e=>{if(!e)return At.error("isContainerDirty: containerItemID is the required parameter"),!1;const t=Nu(e);return Ll(t)||Kc(e)},Uu=e=>{if(!e)return At.error("getLeastRecentlyUsedNonDirtyContainerItemID: target is required parameter"),null;let t;const n=uu(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!ju(n)){t=n;break}}return t},ku=e=>{if(!e)return At.error("getTargetFromContainerItemID: containerItemID is the required parameter"),null;const{containers:t}=hh()?.getState()||{};for(const n in t)if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.substring(0,n)},Vu=(e,t={})=>{if(!e)return At.error("closeContainerItem: containerItemID is the required parameter"),Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=ku(e),r=Nu(e),{skipDirtyCheck:a}=t;let s=!0,o=[];if(ju(e)&&!a&&(s=window.confirm(_p.getLocaleValue($l,"Messages"))),s){const{accessedOrder:a=[],items:s={},type:i}=uu(n);o=a.filter((t=>t!==e));const c=o[o.length-1],l=s[c]||{},{semanticURL:d=j.FORWARD_SLASH_STRING,context:u}=l;o.length>0&&d&&d!==j.FORWARD_SLASH_STRING?Gf({directUrlUpdation:!0,semanticURL:d,options:{containerItemID:c,context:u}}):Gf({directUrlUpdation:!0,semanticURL:j.FORWARD_SLASH_STRING,options:{}});const p={containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:o,containerType:i}};void 0!==t.eventName&&(p.eventName=t.eventName),fh(cf(p))}return Promise.resolve({newAccessedOrder:o,removeItem:s})},Bu=(e,t,n,r)=>{const a="root",s=H(t,a,!0),o=yt(t,a),i={data:n,context:r?"app":s},c=[zh({root:e,containerItemID:s,context:r?"app":s,target:o,containerName:t})];c.push(Vh(i)),fh(c)},Gu=(e,t,n)=>{let r=fu(e);r=r.filter((e=>e!==t));let a=!1;for(let e=0;e<r.length;e+=1){if(Nu(r[e])===n){a=!0;break}}return a},Wu=e=>{if(!e)return At.error("isContainerItemContextBeingUsedInOtherContainers: containerItemID is the required parameter"),!1;const t=du(),n=Nu(e),r=t?Object.keys(t):[];let a=!1;for(let t=0;t<r.length&&(a=Gu(r[t],e,n),!a);t+=1);return a},Hu=e=>{Array.isArray(e)||(e=[e]);const t=du()||{};return e.map((e=>{const n=ku(e);return Rh.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},qu=e=>{const{transientItemID:t,data:n,options:r}=e,a=Rh.deepClone(hh()?.getState().data[t]);r?.reset&&Rh.iterateLeafNodes(a,(e=>{"classID"!==e[e.length-1]&&Rh.setIn(a,e,"")})),fh(Jh({transientItemID:t,data:Rh.mergeDeep(n,a)}))},Yu=e=>{const{transientItemID:t,data:n}=e;fh(Zh({transientItemID:t,data:n}))},Ku=e=>{const t=Rh.deepClone(hh()?.getState().data[e]);Rh.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&Rh.setIn(t,e,"")})),fh(Qh({transientItemID:e,data:t}))},zu=e=>{const t=Rh.deepClone(hh()?.getState().data[e]);Rh.iterateLeafNodes(t,(e=>Rh.setIn(t,e,""))),fh(ef({transientItemID:e,data:t}))};class Xu{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 Ju=()=>Xu,Qu=e=>{const t={containerName:e};t.childContainers=Tu(e),fh({type:Le,payload:t})},Zu=(e,t)=>{const n=Pu(e),{key:r}=pu(ku(e),e),a=[];n.forEach((e=>{const{key:n}=pu(ku(e),e);if(n===r){const n={data:{caseInfo:{headers:{etag:t}}},target:ku(e),context:e};a.push({type:ge,payload:n})}})),a.length&&fh(a)},ep=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:ku(e),context:e};n.push({type:ge,payload:r}),n.length&&fh(n)},tp=()=>Ep.isPortalLoaded?"app":"root",np=()=>kl,rp=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:ku(e),context:e};fh({type:ge,payload:n})},ap=(e,t)=>{const n=yu(e,t),r=yu(`${n}/workarea`,t);return Nu(r)},sp=e=>e?bu(e,"parentContext"):(At.error("getContainerParentContext: containerItemName is required parameters"),null),op=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},ip=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},cp=()=>ou,lp=/{(.*?)}/i,dp=/{(.*?)}/g,up=e=>null!==e.match(lp),pp=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),hp=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`}},fp=()=>pp(window.location.pathname),gp=()=>pp(window.location.pathname+window.location.search),mp=(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 yp=new class{constructor(){this.staticRoutesList=[],this.dynamicRoutesList=[],this.reqContextName="",this.defaultViewUrlPath="",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._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};_createStaticDynamicRoutesList=e=>{Object.keys(e).forEach((e=>{up(e)?this.dynamicRoutesList?.push(e):this.staticRoutesList?.push(e)}))};_getDynamicKeyName=e=>{const t=e.indexOf("{")+1,n=e.lastIndexOf("}");return e.slice(t,n)};isDefaultPortal=()=>"false"!=`${this.bDefaultPortal}`;getPortalName=()=>this.portalName;getApplicationPath=()=>pp(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>pp(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,""),pp(e)};getEndPointInfo=e=>{this.ignoreFromEndPoint?.forEach((t=>{e.includes(t)&&(e=e.substring(0,e.indexOf(t)))}));let t=this.processUrl(e,!0),n=this._getMatchedRouteInRoutingTable(t);void 0===n&&(t=this.processUrl(this.defaultViewUrlPath,!0),n=this._getMatchedRouteInRoutingTable(t)||"");const{routeKey:r,payload:a}=this.appRoutes[n],{reqType:s,endPoint:o,params:i}=this.appRoutesMeta?.[r].restApi||{},c={...a},{caseClassName:l,caseID:d}=c;if(V.isRemoteCase(l)){const{RemoteClassGroup:e,RemoteSystemID:t}=V.getRemoteCase(l);c.caseID=d?.replace(l,e?.toUpperCase()),c.RemoteSystemID=t}const u={routeKey:r,requestType:s,routeEndpoint:o,payload:{...i,...c}};return this._resolveRoute(u,this.processUrl(e,!1),n)};getSemanticURL(e,t,n){return this.buildSemanticURL(e,t,n)}getResolvedSemanticURL(e,t,n={}){const r=this.getSemanticURL(e,t,n);let a=r;if(up(r)){const e=r.match(dp);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(a=a.replace(e,n[t]))}))}const s=Bf(a),o=new URL(s);return this.isDefaultPortal()||this.getPortalName()&&!o.searchParams.toString().includes("portal=")&&o.searchParams.append("portal",this.getPortalName()),o.toString()}updateSemanticURLAndDocumentTitle(e){const{key:t,actionName:n,caseClassName:r,isRemoteCase:a}=e;if(a&&!r)return;const s=this.getSemanticURL(n,{caseClassName:r}).replace(/{.+?}/,String(Ec(t))),o=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`,i={semanticURL:s,directUrlUpdation:!0,options:{acName:o,context:vu(o)}};Vf(i);const c=r.substring(r.lastIndexOf("-")+1),l=t.substring(t.lastIndexOf(" ")+1),d=Ep.environmentInfoObject?.pxApplication?.pyLabel;Xf(`${c} (${l}) - ${d}`)}buildSemanticURL(e,t,n){const{urlPattern:r}=this.appRoutesMeta?.[e]||{},a=r?.split("/").length,s=r?.split("/"),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&&(Rh.isEmpty(s)||Rh.isEmpty(a)?o:Object.keys(a).every((e=>Object.prototype.hasOwnProperty.call(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){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&&up(a)){const s=this._getDynamicKeyName(a);o[r]=n?t[s]||e[s.toLowerCase()]:t[s]}else"string"==typeof a&&(o[r]=a);return`${r}?${new URLSearchParams(o).toString()}`}return r}_getQueryParamsObject(e){const t={},n=new URLSearchParams(e);for(const[e,r]of n.entries())t[e]=r;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(dp);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=>{this._isSpecialInstruction(n)&&(e={...e,...this._processInstruction(n,r[n],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])}_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],up(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 in u)up(u[e])?d[e]=p[e]||h[e.toLowerCase()]:d[e]=u[e];let f;s&&(f=this._getQueryParamsResolvedURL(n,p,!0));const g=this._resolvePayload(e,d,n);return{...this._resolveRouteEndPoint(g,n),urlPath:f||r.join("/")}};_resolveRouteEndPoint=(e,t)=>{let{routeEndpoint:n}=e;if(!up(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(dp);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){const n={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let a=e[r];if("string"==typeof a&&up(a)){const e=a.match(dp);for(let n=0;n<e.length;n+=1){const r=e[n],s=this._getDynamicKeyName(r);if(void 0!==t[s]){const e=t[s];a=a.replace(r,e)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${s}} in payload- {${s}} is missing in semantic url construct`)}n[r]=a}else"object"==typeof a&&(n[r]=this._resolvePayloadRecursive(a,t))}return n}_getMatchedRouteInRoutingTable=e=>{let t=this._findMatchedRouteInStaticList(e);return void 0!==t?t:(t=this._findMatchedRouteInDynamicList(e),void 0!==t?t:void 0)};_findMatchedRouteInStaticList=e=>this.staticRoutesList?.find((t=>t.toLowerCase()===e.toLowerCase()));_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(!up(e)&&e!==r[o]&&hp(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)=>{mp(e,t,"warning"),mp("Error in Generated Routing Table",null,"error"),mp("Back | Forward for this page may NOT work as intended",null,"warning"),mp("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},Ip=yp;const Ep=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false"}setEnvironmentInfo(e){this.environmentInfoObject=e;const t=this.environmentInfoObject?.features||Rh.convertObjectWithStringToBoolean(this.environmentInfoObject?.pyFeatures)||{granularUIRefresh:!1};this.environmentInfoObject.features={...t,granularUIRefresh:t.granularUIRefresh||t.pyEnableGranularUIRefresh||!1}}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 Ip.getPortalName()}getApplicationName(){return this.environmentInfoObject?.pxApplication?.pyRuleName}getUseLocale(){return this.environmentInfoObject?.pxLocale?.pyUseLocale}getAccessGroup(){return this.environmentInfoObject?.pxOperator?.pyAccessGroup}getTimeZone(){return this.environmentInfoObject?.pxLocale?.pyTimeZone}getTheme(){return this.themeOverrides}setTheme(e){return this.themeOverrides=e,this.themeOverrides}getBrandingInfo(){return this.brandingInfo}setBrandingInfo(e){return 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(j.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}getBuiltOnAppNames(){return this.environmentInfoObject?.pxApplication?.pyBuiltOnApplications}setPreviewMode(){$i.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)}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getUserSettings(){return this.environmentInfoObject?.pyUserSettings||null}getAvailableLocalePacks(){return this.environmentInfoObject?.pyAvailableLocalePacks?.map((e=>e.pyLabel))||[]}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getInactivityTimeout(){const e=this.environmentInfoObject?.pxOperator?.pyAuthenticationTimeout;return e?Number(e):e}isUnifiedObject(){return this.environmentInfoObject?.features?.isUnifiedObject||!1}getRuntime(){return"undefined"!=typeof window&&window.document?"Browser":"Native"}};const Ap=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 Cp{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||e;this.localeStore[Cp.#t(t)]=n};getLocaleForRule(e=this.#n()){return this.localeStore[Cp.#t(e)]}resetLocaleStore=()=>{this.localeStore={}};#r(e){return e?Cp.#t(e):this.#n()}#a(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}#s(e,t){return t!==this.FIELD_LABELS_BUNDLE_KEY?e?`${e}.fields`:"fields":e}getLocaleValue(e,t,n,r){n=this.#r(n);const a=this.#a(e);a&&(e=Ap.formatLocaleKey(e));const s=this.#o(e,n,t,r);return"Messages.fields"===(t=this.#s(t,n))&&"string"==typeof e?this.getLocalizedErrorMessage(s,e)||e:a?Ap.replaceWithValue(s[e]||e):s[e]||e}#o(e,t,n,r){t!==this.FIELD_LABELS_BUNDLE_KEY&&(n=n?`${n}.fields`:"fields");let a=this.localeStore[t.toUpperCase()],s=a?Rh.getIn(a,n,{}):{};return!s[e]&&r&&(a=this.localeStore[this.#n().toUpperCase()],s=a?Rh.getIn(a,`${r}.${n}`,{}):{}),s}#n(){return void 0===Ep.getFeatureMap()?.localizationVersion?this.GENERIC_BUNDLE_KEY:this.GENERIC_BUNDLE_KEY_LP}getParagraphLocaleValue(e,t){const n=`${e}!${j.PARAGRAPH}!${t}`,r=this.localeStore[n.toUpperCase()];return r?decodeURIComponent(atob(r.content).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")):null}getPortalLocaleReference(e){return e?`PORTAL!${e}`.toUpperCase():`PORTAL!${Ep.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return Ep.getFeatureMap().localizationVersion||1}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=Ep.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[Cp.#t(e)]))).map((e=>e.toUpperCase()))).length>0){const r=e.map((e=>({localeRuleKey:e,promise:Lr.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&&null!==e.value){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){const t=Ep.getUseLocale(),n=Ep.getBaseLocale();if(Ep&&t&&(t!==n||"en-US"!==n)&&e?.length>0)try{(await this.getLocaleJsons(e)).forEach((e=>{this.setLocaleForRule(e.jsonData,e.localeRuleKey)}))}catch(e){console.warn(e)}}setTimezone(e){this.timezone=e}getTimeZoneInUse(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return this.timezone||e}matchPatternWithText(e,t){let n=t;const 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=Ep.getLocale();return this.availableLangPacks?.length||(this.availableLangPacks=Ep.getAvailableLocalePacks()),e&&this.availableLangPacks.includes(e)}static#t(e){if(!e)return e;const t=e.indexOf("!CASE!");return-1===t?e:`CASE!${e.substring(0,t)}`}getCaseTypeLocaleReferences(){return Ep.getCaseTypeList().map((e=>`${e.pyWorkTypeImplementationClassName}!CASE!${e.pyWorkTypeName}`.toUpperCase()))}}const _p=new Cp;const Sp=class{static getParagraphStream(e,t){return((e,t)=>{if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html"),r=n.querySelectorAll("pega-reference");for(const e of r){const r=e.getAttribute("data-rule-id");if(r){const a=t.getValue(r),s=n.createTextNode(a??"");e.replaceWith(s),t.registerAdditionalProps({[r]:`@P ${r}`})}else e.replaceWith("")}const a=n?.body?.innerHTML||"";return/^(<p>)\s*(<\/p>)$/.test(a)?null:a})(e,t)}};en.registerHandler("@L",((e,t)=>t.getLocalizedValue(e))),en.registerHandler("@P",((e,t,n)=>t?t.getValue(e):Mh.getLitePropertyValue(n))),en.registerHandler("@E",((e,t,n)=>{try{const r=kt(e),a=Vt(r);return Bt(a,t,n)}catch(e){}return!0})),en.registerHandler("@W",((e,t,n)=>{let r;if(t)r=t.getContextDataValue(`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);else{const{pageReference:t,context:a}=n??{};r=Eh(t,`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,a)}return!0===r||"true"===r})),en.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===j.READONLY,l=n?.datasource?.name||"",d=t.getComponentConfig();if(d&&d.deferDatasource&&(d.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:d.datasourceMetadata}),i===j.DATA_PAGE))return null;if(i===j.DECISION||i===j.RULE_REFERENCE)return function(e,t){const n=tn.getPropertyName(e?.propertyForDisplayText??""),r=tn.getPropertyName(e?.propertyForValue??""),a=t.getContextDataValue(`.${j.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return a?.map((e=>({key:e[r]||e[`.${r}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==j.DATA_PAGE)return n?.datasource?.records;const u=tn.getPropertyName(n?.datasource?.propertyForDisplayText),p=tn.getPropertyName(n?.datasource?.propertyForValue),h=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],f=t.getContextName(),g=[];if(h.forEach((e=>{if(tn.isProperty(e?.value)){let t=Ih(`.${Rh.getFullPropertyReference([s,tn.getPropertyName(e.value)])}`,o,f);g.push(Rh.getFullPropertyReference([o,s,tn.getPropertyName(e?.value)])),null!=t&&""!==t||(t=j.NULL_STRING),r.push(t)}else r.push(e?.value||j.NULL_STRING)})),f){const e=Qt.getContextObjectByName(f)||{};g.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,a])]}else e[t]=[a]})),Qt.addContextName(f,e)}const m=function(e,t,n,r){let a="",s=n;if(t.join(j.HASH_DELIMITER)&&(a=Rh.getHashedString(t.join(j.HASH_DELIMITER)),s=n+j.UNDERSCORE_STRING+a),r){const e=mh(),t=e?e[n]?.[s]:{};return Array.isArray(t?.pxResults)?t.pxResults:[]}const o=e.getDataObject(),i=o?.[n]||{},c=i?.[s]||{};return Array.isArray(c?.pxResults)?c.pxResults:[]}(t,r,l,c);return m.map((e=>({key:e[p]||e[`.${p}`],value:e[u]||e[`.${u}`]})))})),en.registerHandler("@ROUTING_INFO",((e,t)=>It(t.getContainerName(),t.getContextName()))),en.registerHandler("@ENV",((e,t)=>{switch(e){case j.ENV_INFO_KEYS.APPLICATION_NAME:return Ep.getApplicationName();case j.ENV_INFO_KEYS.ACCESS_GROUP:return Ep.getAccessGroup();case j.ENV_INFO_KEYS.USER_NAME:return Ep.getOperatorName();case j.ENV_INFO_KEYS.USER_ID:return Ep.getOperatorIdentifier();case j.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizedValue(Ep.getApplicationLabel()||"");case j.ENV_INFO_KEYS.USER_IMAGE:return Ep.getOperatorImageInsKey();case j.ENV_INFO_KEYS.LOCALE:return Ep.getUseLocale();case j.ENV_INFO_KEYS.TIMEZONE:return Ep.getTimeZone();case j.ENV_INFO_KEYS.WORK_GROUP:return Ep.getOperatorWorkGroup();default:return e}})),en.registerHandler("@DATASOURCE",((e,t)=>{const n=t.getValue(e)||[],r=t.getComponentConfig(),a=Object.keys(r).find((t=>r[t]?.source?.includes(e)));if(a){const{fields:e,copyAll:t}=r[a],s=[];return n.forEach((n=>{const r={};t?Object.keys(n).forEach((e=>{const t=tn.getPropertyName(e);r[t]=n[t]})):Object.keys(e).forEach((t=>{const a=tn.getPropertyName(e[t]);r[t]=n[a]})),s.push(r)})),s}return[]})),en.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})),en.registerHandler("@USER",((e,t,n={})=>{const r=t?.getValue(e)||Mh.getLitePropertyValue(n,e),a=t?.getReferencedUser(r)||Mh.getReferencedUser(r,n);return{userId:r,userName:a?a.UserName:null}})),en.registerHandler("@ACTIVE_CASES",((e,t)=>Kd.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),en.registerHandler("@LR",(e=>e)),en.registerHandler("@CASE",((e,t)=>e===j.ID?t.getCaseInfo().getKey():e)),en.registerHandler("@SHARED",(e=>ic.getSharedState(e))),en.registerHandler("@PARAGRAPH",((e,t)=>{const n=t.getLocalizedParagraphValue(e);return n?Sp.getParagraphStream(n,t):null})),en.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 Rh.isEmpty(s)?o=t.getValue(`.${n}`):(o=s,o=Rh.getIn(o,n)),o&&r.length>0?(a&&(o=o.filter((e=>Gt(a,e)))),o.map((e=>Rh.getIn(e,r)))):null})),en.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.pyCountry;return n?`pyAddressForm_${n}`:"pyAddressForm"})),en.registerHandler("@DATATYPE",((e,t)=>t.getValue(e)));const bp="downloadAttachment",Np={},vp=e=>{const t=Bi();return Np[e]=t,t},Pp=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},Tp=e=>{let t,n,r,a;return t=e.pyCategoryLabel?`${e.pyCategoryLabel},`:e.pyCategoryName?`${e.pyCategoryName},`:e.Category,n=e.pxCreateOpName?e.pxCreateOpName:e.pxCreateOperator?e.pxCreateOperator:e.CreateUser?.Name||"",r=e.pyFileName?e.pyFileName:e.FileExtension&&""!==e.FileExtension&&e.FileName.endsWith(e.FileExtension)?e.FileName.substring(0,e.FileName.lastIndexOf(e.FileExtension)-1):e.FileName,a=e.pyAttachName&&e.pyFileName?e.pyAttachName.startsWith(e.pyFileName)&&e.pyAttachName.split(".").length-1===e.pyFileName.split(".").length?e.pyAttachName.split(".").pop():"":e.FileExtension,{props:{meta:`${t} ${n}`,name:e.pyAttachName?e.pyAttachName:e.FileName,icon:Pp(e.pyMimeFileExtension||e.MimeType)},responseProps:{fileName:e.pyAttachName?e.pyAttachName:e.FileName,name:r,category:e.pyCategoryName?e.pyCategoryName:e.Category,extension:a,ID:e.pzInsKey?e.pzInsKey:e.ID,mimeType:e.pyMimeFileExtension?e.pyMimeFileExtension:e.MimeType,attachmentURL:e.pyAttachmentLink?e.pyAttachmentLink:e.AttachmentURL,createUser:n,createDateTime:e.pxCreateDateTime?e.pxCreateDateTime:e.CreateDateTime,responseType:e.responseType??(e.ID?"binary":null)}}},$p={uploadAttachment:(e,t,n,r,a)=>{const s=new FormData;s.append("appendUniqueIdToFileName",!0),s.append("file",e),a&&s.append("contextID",a);const{restApi:o,reqType:i}=Lf("uploadAttachment",{});return Ui(o,{method:i,headers:{"Content-Type":"multipart/form-data"},body:s,onUploadProgress:t,signal:vp(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(Gi,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete Np[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const a={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,a.signal=vp(n).token}const{restApi:s,reqType:o}=Lf("linkCaseAttachment",{caseID:e});return Ui(s,{...a,body:{attachments:t},method:o},r)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:r,reqType:a}=Lf("getCaseAttachments",{caseID:e,includeThumbnail:n});return Ui(r,{method:a},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:r,reqType:a}=Lf("getAttachmentCategories",{caseID:e,type:t});return Ui(r,{method:a},n).then((e=>e.data))},downloadAttachment:(e,t,n)=>{const{restApi:r,reqType:a}=Lf(bp,{attachmentID:e});return Ui(r,{method:a,..."binary"===n&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:a}=Lf("editAttachment",{attachmentID:e});return Ui(r,{method:a,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=Lf("deleteAttachment",{attachmentID:e});return Ui(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=Lf("downloadDocument",{documentID:e});return Ui(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:a}=Lf("deleteDocument",{caseID:e,documentID:t});return Ui(r,{method:a},n)},getDocumentURL:e=>{const t=PCore.getEnvironmentInfo().getDocumentUrlDP()||"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=>{Np[e]&&(Np[e].cancel(),delete Np[e])},buildFilePropsFromResponse:Tp,getAttachmentURL:e=>{const{restApi:t}=Lf(bp,{attachmentID:e});return t},prepareAttachmentData:e=>{let t=[];if(e&&Object.hasOwn(e,"pyCount")&&e.pyCount>0)t=e?.pxResults?.filter((e=>!!e.pzInsKey)).map((e=>Tp(e)))||[];else if(e&&"object"==typeof e){let n;n=Array.isArray(e)?e:[e],t=n?.filter((e=>e.ID&&e.FileName||e.pzInsKey)).map(Tp)}else t=[];return{hasUploadedFiles:t.length>0,categoryName:e?.pyCategoryName||t?.[0]?.responseProps?.category||"",attachments:t}}};en.registerHandler("@ATTACHMENT",((e,t,n)=>{let r;return r=t?t.getValue(e):Mh.getLitePropertyValue(n),$p.prepareAttachmentData(r)})),en.registerHandler("@FL",((e,t)=>t.getLocalizedValueForFieldLabel(t.getFieldMetadata(e)?.label))),en.registerHandler("@GENAICOACH",((e,t)=>th(e,t.getCurrentClassID()))),en.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),a=t.getPageReference();bl.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",a,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:!0}),`${a}${e}`,`${r}/${a}`,r)}));const Op={},Rp={},Dp={},xp={},wp={},Mp={},Lp={},Fp={},jp={},Up={},kp=(e={},t={})=>{0!==Object.keys(t).length?Object.keys(e).forEach((n=>{const r=e[n],a=t[n];if(a){const e=Array.isArray(a)?a:[a];(Array.isArray(r)?r:[r]).forEach((t=>{const n=e.findIndex((e=>e.classID===t.classID));if(-1===n)e.push(t);else{const r={isDeclarativeTarget:!1},a={...e[n],...r,...t};e[n]=a}})),t[n]=1===e.length?e[0]:e}else t[n]=r})):Rh.copy(e,t)},Vp=(e,t="")=>{if(!e)return null;const n=xp[e];if(!n)return null;if(!t)return Rh.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?Rh.deepClone(r):null},Bp=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let a;const s=Vp(e,t);return r.length&&(a=r.join(".")),{...s,embeddedType:n,category:a}}const[a,...s]=e.split("."),o=Vp(a,t);return o&&r.push(o.label),Bp(s.join("."),o?.pageClass,o?.type,r)},Gp=e=>{kp(e,Rp)},Wp=e=>{kp(e,Dp)},Hp=e=>{if(e.views&&kp(e.views,Rp),e.navigations&&kp(e.navigations,Dp),e.personalizations&&kp(e.personalizations,Mp),e.insights&&kp(e.insights,Lp),e.paragraphs&&kp(e.paragraphs,Op),e.dataTypes&&kp(e.dataTypes,Fp),e.datapages&&kp(e.datapages,jp),e.genAICoaches&&kp(e.genAICoaches,Up),e.fields){Object.keys(e.fields).forEach((t=>{const n=e.fields[t];if(Array.isArray(n)){if(e.datapages&&n.forEach((t=>{t.datasource&&"DataPage"===t.datasource.tableType&&(t.datasource.mode=e.datapages[t.datasource.name].mode)})),1===n.length){const[r]=n;e.fields[t]=r}}else e.datapages&&n.datasource&&"DataPage"===n.datasource.tableType&&(n.datasource.mode=e.datapages[n.datasource.name].mode)}));const{datapages:t={}}=e;Object.keys(t).forEach((e=>{wp[e]=t[e]}))}kp(e.fields,xp)},qp=e=>Rp[e],Yp=(e,t)=>{const n=Rp[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},Kp=e=>Dp[e],zp=e=>e in wp?wp[e]:null,Xp=e=>e in Mp?Mp[e]:null,Jp=e=>e in Lp?Lp[e]:null,Qp=e=>{const t={};return Object.keys(xp).forEach((n=>{const r=xp[n];let a;Array.isArray(r)?a=r.find((t=>e===t.classID)):e===r.classID&&(a=r),a&&(t[n]=Rh.deepClone(a))})),t},Zp=(e,t)=>{const n=Vp(e,t)?.datasource?.parameters;return n?Rh.deepClone(n):null},eh=(e,t)=>{let n=null;const r=Op[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?Rh.deepClone(n):null},th=(e,t)=>{let n=null;const r=Up[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?Rh.deepClone(n):null},nh=e=>{if(e in Fp){const{savableDataPage:t}=Fp[e];return t}return null},rh=e=>{const t=jp[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=Fp[n];return s?s.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:r}))):[]},ah=e=>{if(e in Fp){const{lookupDataPage:t}=Fp[e];return t}return null},sh=e=>{if(Object.prototype.hasOwnProperty.call(Fp,e)){const{lookupDataPageInfo:t}=Fp[e];return t}return null},oh=(e,t)=>{const n=e.split("."),r=n.pop(),a=new ru({options:{pageReference:`${n.join(".")}`,context:t}}),s=Vp(r,a.getCurrentClassID())?.additionalInformation;if(!s?.includes("@PARAGRAPH"))return s;const o=tn.trimAnnotation(s),i=a.getCurrentClassID(),c=eh(o,i),l=c?.definedOnClassID,d=_p.getParagraphLocaleValue(l||i,o);return d?Sp.getParagraphStream(d,a):c?.content?Sp.getParagraphStream(c.content,a):null},ih=(e,t)=>{const n=e.split("."),r=n.pop(),a=new ru({options:{pageReference:`${n.join(".")}`,context:t}}),s=Vp(r,a.getCurrentClassID()),o={};return a._classID=a.getCurrentClassID(),a.resolveConfigProps(s,o),o};class ch{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=Rh.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=Rh.getFullPropertyReference([i,t]),t in o){const e=o[t];Rh.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=Ih(n,t,e);s.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,r,a){const s=ch._getFieldsForList(e,t,n);s.length>0&&(this.registerFields(e,t,s,r,a),fd.enableCascade(e))}unRegisterListField(e,t,n,r){const a=ch._getFieldsForList(e,t,n);a.length>0&&this.unRegisterFields(e,t,a,r)}static _getFieldsForList(e,t,n){const r=[],a=Vp(n,Ih("classID",t,e));return a&&!Array.isArray(a)&&a.datasource&&a.datasource.parameters&&Object.values(a.datasource.parameters).forEach((e=>{if(tn.isProperty(e)){const t=tn.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=Ih(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=Ih(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=er.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&&Rh.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=Ih(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=Ih(d,"",t);n&&n?.length===e[l].length||o.push(d)}this._getServerProperties(e[l],t,d,r,a,s,o)}}getServerProperties(e,t,n=j.CASE_INFO.CASE_INFO_CONTENT){const r=[],a=[],s=[],o=Rh.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 lh=new ch;let dh=null;const uh=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),ph=e=>{dh=e},hh=()=>dh,fh=e=>{if(!e)return;let t=[],n=[],r=[];Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=lh.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),hh()?.dispatch(e),Array.isArray(e)||"MERGE_DATA"!==e.type||(r.forEach((t=>{const n=t.lastIndexOf("."),r=t.substring(0,n),a=t.substring(n);er.clearMessages({type:"error",property:a,pageReference:r,context:e.payload.context});const s=Tn.getFieldReferenceForProperty(e.payload.context,t),o=Mh.resolveContextTreeNodeProps(s.props);Dr.validate(o.componentName?.toLowerCase(),o.propertyName,Mh.getLitePropertyValue(o,o.propertyName),o)})),lh.handleServerChanges(e.payload.context,t,n))},gh=e=>hh()?.getState().data?.[e],mh=()=>hh()?.getState().data[j.SHARED],yh=(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=uh(a);return Rh.getIn(n,s)},Ih=(e,t,n)=>yh(e,t,gh(n)),Eh=(e,t,n)=>yh(t,e?`${j.CONTEXT_DATA}.${e}`:`${j.CONTEXT_DATA}`,gh(n)),Ah=(e,t,n)=>((e,t,n)=>{const r=uh(`${t}.${n}`);return Rh.getIn(e,r)})(gh(n),`${j.CONTEXT_DATA}.${e}`,t),Ch=e=>{const{context:t}=e,n=hh()?.getState().data[t];if(n)return ue;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?_e:ue},_h=(e,t)=>{const n=uh(t);return Rh.deleteIn(e,n)},Sh=e=>!Array.isArray(e)&&"object"==typeof e,bh=(e,t=[])=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&Rh.setIn(e,t.path,[]):Rh.setIn(e,t.path,{})}))},Nh=(e,t,n={})=>{const{isArrayDeepMerge:r,propertiesToReplace:a=[]}=n;Array.isArray(e)&&!t&&(t=[]),bh(e,a);const s=(e,t)=>{if(Sh(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return x()(e,t,s);if(Array.isArray(e)&&null!==t&&Array.isArray(t)){if(r)return x()(e,t,s);{const n=t.length;if(void 0===r&&n===e.length)return x()(e,t,s)}}return""===t&&e&&"object"==typeof e?e:t};return s(e,t)},vh=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:a}=r,s=uh(t);if("object"==typeof n){const t=Nh(Rh.getIn(e,s),n,{isArrayDeepMerge:a});return Rh.setIn(e,s,t)}return Rh.setIn(e,s,n)},Ph=(e,t,n)=>{const r=uh(t);return Rh.setIn(e,r,n)},Th=()=>{const e=et,{promise:t,actionMgrID:n}=un.actionManagerPromise(e);return fh({type:e,payload:{actionMgrID:n}}),t},$h=e=>{const t=hh()?.getState();return!!t?.data?.[e]};class Oh{static mergeDeep(e,t){return x()(t,e)}static hasIn(e,t){return P()(e,t)}static getIn(e,t,n){return $()(e,t,n)}static setIn(e,t,n){return R()(e,t,n)}static deleteIn(e,t){return N()(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return M()(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||-1===e.indexOf("."))return!1;let t=0;const n=e.length;for(;t<n;t+=1)if(" @#$%=!<>/\\".includes(e[t]))return!1;return!0}static isWhenExist(e){const t=["visibility","disabled","readOnly","required"];let n=!1;for(const r in e)t.includes(r)&&"string"==typeof e[r]&&e[r]?.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;for(const a in e)t.includes(a)&&"string"==typeof e[a]&&e[a]?.startsWith("@W ")&&(n=tn.trimAnnotation(e[a]),r.add(n));return"multirecordlist"===e?.type&&"Editable"===e?.renderMode&&Object.keys(e?.allowActions??{}).forEach((t=>{"string"==typeof e?.allowActions[t]&&e.allowActions[t]?.startsWith("@W ")&&(n=tn.trimAnnotation(e.allowActions[t]),r.add(n))})),[...r]}static isExpressionExist(e){const t=["disabled","visibility","readOnly","required"];let n=!1;for(const r in 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)?[]:{}),Nh(t[r[a]],n,{isArrayDeepMerge:!0})):t[r[a]]=n};static getHashedString(e){return(0,S.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 h()(e,t)}static isContains(e,t){const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&Oh.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)=>{Oh.flatten(e,`${t}[${r}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((r=>{const a=t?`${t}.${r}`:r;Oh.flatten(e[r],a,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=`${e}${t}`.replace(j.CASE_INFO.CASE_INFO_CONTENT,"").replace(j.DATA_INFO.DATA_INFO_CONTENT,"");return Bn.formatPageReference(n)}static buildAttachmentsFormData(e){return e.map((e=>{if(e.delete){let t="";return t=e.responseProps.ID?e.responseProps.ID:e.responseProps.pzInsKey,{type:"File",attachmentFieldName:e.label,delete:!0,pzInsKey:t}}return{type:"File",attachmentFieldName:e.label,category:e.category,ID:e.handle,clientFileID:e.ID}}))}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 isString(e){return"string"==typeof e}static rejectPendingActions(e){return e.forEach((e=>e.payload.actionMgrID&&un.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"]),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 convertObjectWithStringToBoolean(e){if(e&&!Array.isArray(e)&&"object"==typeof e)return Object.keys(e).forEach((t=>{let n;const r=e[t];n="string"==typeof r?"true"===r||"false"!==r&&r:r,e[t]=n})),e}static isValidPageListProperty(e){return!!e&&/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/.test(e)}}const Rh=Oh,Dh=j.SUMMARY_OF_LISTS,xh=j.SUMMARY_OF_WHEN_CONDITIONS;class wh{static updateData(e){Object.keys(e).forEach((t=>{fh(Vh({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{fh(Vh({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${xh}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){return Kp([this.resolveName(e,t)])}static resolveView(e,t,n=""){const r=qp([this.resolveName(e,t)]);let a=[];if(Array.isArray(r)&&r.length>0){if(t&&r.length>1){if(n||(n=t.getValue(j.CLASS_ID)),!n)return;a=r.filter((e=>e[j.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=tn.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=tn.trimAnnotation(t))||"string"==typeof t)?"number"==typeof t&&parseInt(t,10)===t?`${e}[${t}]`:t.startsWith(".")?e+t:`${t}`:e}static getRuleClass(e,t,n){let r;if(t)r=t.startsWith(j.CLASS_ANNOTATION)?t.split(j.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName());else if(n?.authorContext){const t=e.getFieldMetadata(n.authorContext);if(t){r="manual"===t.dataRetrievalType?t.classID:t.pageClass}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"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 Ih(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const a=Ah(`${t}.${Dh}`,e,n);a&&(r=this.resolvePropertyReference(t,a,n))}return r}static getPropertyValue(e,t,n){return e=tn.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=wh.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?wh.getPropertyValue(i,s,`${o}/${j.SUGGESTION}`):wh.getPropertyValue(i,s,o)}static _handlePropString(e,t,n,r,a){n.startsWith("@")?e[t]=tn.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?(Rh.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(Rh.mergeDeep(e,t),this._resolveProps(t,void 0,e),Rh.resolveStringBooleans(t)):t}static resolveClassID(e,t,n){const r=tn.trimAnnotation(e);let a;for(a=r.startsWith(".")?`${t}${r}`:`${r}`;a;){const e=Ih(j.CLASS_ID,a,n);if(e)return e;a=a.substring(0,a.lastIndexOf("."))}return null}}const Mh=wh;const Lh=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}};const Fh=class{static#i=[];static#c=!1;static getActionHandlers=(e,t,n)=>{const r=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=Lh.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#l=(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.#i.push(s)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===Ep.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=un.getNextActionMgrId(),n};static#d=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,a={};Mh.resolveProps(r,a,n),t&&(t(e.eventType,a,n),this.#u())};static#u=()=>{if(!this.#c){if(0===this.#i.length)return;const e=this.#i.shift();this.#d(e),e.config&&"true"===e.config.parallel&&this.#i.length>0&&this.#u()}};static#p=()=>{this.#u()};static#h=(e,t,n)=>{this.#l(e,t,n),this.#p()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return Mh.getContextPath(t,n)};static#f(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.#h(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,r=e.getContextName();zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:r});if(("Browser"===Ep.getRuntime()?t?.nativeEvent instanceof Event||t instanceof Event:!!t?.nativeEvent)||null!==t.value&&void 0===t.prop){let{target:n}=t;null===n&&t&&t.auxiliaryTarget&&(n=t.auxiliaryTarget);const a=void 0===n?t.value:"value"in n?n.value:n.innerText,s=this.getFullRef(e);fh({type:Q,payload:{reference:s,value:a,context:r}}),void 0!==n&&this.isEditable(n)&&!this.isNonKeyInput(n)||fh({type:ee,payload:{reference:s,pageReference:e.getPageReference(),value:a,context:r,propertyName:e.getComponentConfig().value,classID:e.getValue(j.CLASS_ID)}})}else{const n=e.getPageReference(),a=e.getStateProps();for(const e of Object.keys(t)){const s=a[e],o=t[e];fh({type:Q,payload:{reference:Mh.getContextPath(n,s),value:o,context:r}}),fh({type:ee,payload:{reference:Mh.getContextPath(n,s),value:o,context:r}})}}};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&&zn({type:F.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)&&fh({type:ee,payload:{reference:s,pageReference:e.getPageReference(),value:r,context:o,propertyName:e.getComponentConfig().value,classID:e.getValue(j.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.#f(e,n)};static pause=()=>{this.#c=!0};static resume=()=>{this.#c=!1,this.#u()};static isQueueEmpty=()=>0===this.#i.length;static clearQueue=()=>{this.#i=[]};static getActionsQueue=()=>this.#i;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},jh="CREATE_WORK",Uh=e=>({type:jh,payload:e});const kh=(e,t,n,r="")=>{const a=[];Object.keys(e).forEach((s=>{"object"==typeof e[s]&&s.includes("[")?function(e,t,n,r,a,s){const o=r.substring(0,r.indexOf("[")),i=r.substring(r.indexOf("[")+1,r.indexOf("]"));Array.isArray(t[o])&&(t[o]?.splice(+i,1,e[r]),s.push(o),n.add(`${a}.${r}`))}(e,t,n,s,r,a):e[s]&&"object"==typeof e[s]?(t[s]||(t[s]=Array.isArray(e[s])?[]:{}),kh(e[s],t[s],n,`${r}.${s}`)):t[s]=e[s]})),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,a)},Vh=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:r=[]}=t,{context:a,data:s,isArrayDeepMerge:o,preserveClientChanges:i=!1}=e,c=Rl(a,!0),l=gh(a);let d={};if(l&&s){d=JSON.parse(JSON.stringify(l));const e=JSON.parse(JSON.stringify(s)),t=new Set;kh(c,d,t),((e,t,n)=>{const r=new Set;e.forEach((e=>{e=Rh.trimDotForProperty(e);const[a,s,o]=mn(e);a&&s&&o&&!r.has(`${a}.${s}`)&&((Rh.getIn(n,`${a}.${s}`)||[]).forEach(((e,n)=>{n!==+o&&Rh.setIn(t,`${a}.${s}[${n}]`,e)})),r.add(`${a}.${s}`))}))})(t,d,e)}!function(e,t){const n=Rh.getIn(e,j.REFERENCED_USERS);let r;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return r=Rh.getIn(t,j.REFERENCED_USERS,{}),void Rh.setIn(e,j.REFERENCED_USERS,{...r,...n});r=Rh.getIn(t,j.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)}}(s,l);const u={caseInfo:{content:{...d?.caseInfo?.content}}};let p=s;return i?(n.forEach((e=>{Rh.deleteIn(u,`caseInfo.content.${e}`)})),p=Nh(s,u,{isArrayDeepMerge:!o})):((e,t)=>{const n=vl[e]||{};Object.keys(n).forEach((e=>{Rh.hasIn(t,e)&&(n[e].value=Rh.getIn(t,e))}));let r=ol.getStateMachinesByContext(e)||{};r={...r,...ol.getUnConnectedStateMachines(e)||{}},Object.keys(r).forEach((n=>{if(Rh.hasIn(t,n)){const r=Rh.getIn(t,n);r&&Array.isArray(r)&&0===r.length&&ol.setStateMachineEmpty(e,n)}}))})(a,s),{type:ge,payload:{...e,data:p,...r.length>0?{propertiesToReplace:r}:null}}},Bh=e=>({type:"SHOW_HARNESS",payload:e}),Gh=e=>({type:te,payload:e}),Wh=e=>({type:ne,payload:e}),Hh=e=>({type:"ADD_WORK",payload:e}),qh=e=>({type:de,payload:e}),Yh=e=>({type:Ae,payload:e}),Kh=e=>({type:Ce,payload:e}),zh=e=>({type:_e,payload:e}),Xh=e=>({type:be,payload:e}),Jh=e=>({type:Ne,payload:e}),Qh=e=>({type:Te,payload:e}),Zh=e=>({type:Oe,payload:e}),ef=e=>({type:$e,payload:e}),tf=e=>{const{containerItemID:t}=e;e.suggestionContexts=Ou(t);const n=e?.data?.caseInfo?.content,r=Object.keys(n||{}).length>0;return e.propertiesToReplace=r?xc.getPropertiesToReplace(t):[],{type:De,payload:e}},nf=e=>{const{context:t}=e;return{type:oe,payload:{context:t}}},rf=e=>{const{context:t}=e;return{type:ie,payload:{context:t}}},af=e=>({type:xe,payload:e}),sf=e=>({type:Re,payload:e}),of=e=>({type:Qe,payload:e}),cf=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=Nu(n)),e.context=r,e.deleteContext=!Wu(n),e.childContainers=Tu(n),e.childContainersContexts=$u(n),e.transientItems=Hu([...e.childContainersContexts,n]),e.suggestionContexts=Ou(n),n===t&&(e.caseID=Ih(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Ih(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Se,payload:e}},lf=e=>{const{containerItemID:t}=e;return e.transientItems=Hu([...$u(t),t]),{type:Pe,payload:e}},df=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:ve,payload:e}},uf=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=Nu(n)),e.context=r,e.childContainers=Tu(n),e.childContainersContexts=$u(n),e.transientItems=Hu([...e.childContainersContexts,n]),e.suggestionContexts=Ou(n),n===t&&(e.caseID=Ih(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Ih(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:we,payload:e}},pf=e=>({type:pe,payload:e}),hf=e=>({type:fe,payload:e}),ff=e=>({type:Ie,payload:e}),gf=(e,...t)=>(Fh.resume(),e(...t)),mf=(e,t,n,r,a)=>({type:Ee,payload:{msg:e,err:t,context:n,formFields:r,actionMgrID:a}}),yf=e=>({type:nt,payload:e}),If=e=>({type:rt,payload:e}),Ef=e=>({type:at,payload:e}),Af=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),Cf=e=>({type:ce,payload:e}),_f=e=>({type:Q,payload:e}),Sf=e=>{if(e.indexOf("?")>0){const[t,n]=e.split("?"),r=new URLSearchParams(n),a=new Map;for(const[e,t]of r)"portal"!==e&&"noPortal"!==e&&"debug"!==e&&a.set(e,t);const s=new URLSearchParams(a).toString();return s?`${t}?${s}`:t}return e},bf=(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=Mf(Ge,{assignmentID:s});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:s},options:t,routeKey:Je,urlPath:a}})(e,t):Ip.getEndPointInfo(e),Nf="add",vf="replace",Pf=["portal","noPortal","preview","debug","devtool"];let Tf="",$f="Home",Of="",Rf=!0;const Df=e=>(Rf=e,Rf),xf=()=>Rf,wf=(e,t,n)=>Ip.getSemanticURL(e,t,n),Mf=(e,t)=>Ip.getRestEndPoint(e,t),Lf=(e,t)=>{let n=E();const r=Mf(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):{}},Ff=(e,t,n)=>{const{root:r,resources:a}=e,{views:s}=a,{config:o}=r,i=Nf;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(dp);if(l){const e=Rh.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},jf=(e,t,n)=>{let r,a;r=pp(t)?`${e}/${t}`:e;const s=pp(n.pxURLPath);s&&(r=`${r}/${s}`);try{a=new URL(r).searchParams,r=r.includes("?")?r.split("?")[0]:r}catch(e){return console.log("Invalid url",e),""}const o=r.split("/"),i=o[o.length-1],c=new URLSearchParams(window.location.search);if(i.toLowerCase()!==$f.toLowerCase()||c.has("noPortal")||(r=`${e}/${t}`),!Ip.isDefaultPortal()){const e=Ip.getPortalName();c.has("portal")?c.set("portal",e):c.append("portal",e)}return a=((e,t)=>{for(const[n,r]of t.entries())!e.has(n)&&Pf.includes(n)&&e.append(n,r);return e})(a,c),a.toString()&&(r+=`?${a.toString()}`),r},Uf=(e,{urlPathObjParam:t,infoParam:n,optionsParam:r},a=!1)=>{let s,o,i;if(!1===window.PCore.getBehaviorOverride("dynamicSemanticUrl"))return;if(a)s=t,o=n,i=r;else{const{uiResources:n,data:r}=e;({options:i}=e),s=t&&t.pxURLPath&&up(t.pxURLPath)?Ff(n,r,t.pxURLPath):t||Ff(n,r),o=Ip.getEndPointInfo(s.pxURLPath),s.pxURLPath=o.urlPath}const c=jf(Tf,Ip.getApplicationPath(),s),{title:l}=((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:Ip.getApplicationName()),n===`${Tf}/${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]}`}})(Of,Ip.getApplicationPath(),c),d=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(o,{...i,title:l});s.historyAction===Nf?((e,t,n)=>{try{window.history.pushState(e,t,n),window.scrollTo(0,0)}catch(e){throw new Error("Error- Unable to Add to Browser History")}})(d,l,c):s.historyAction===vf&&((e,t,n)=>{try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(d,l,c)},kf=e=>{let t=null;e.directUrlUpdation&&(t={historyAction:Nf,pxURLPath:""},t.pxURLPath=e.semanticURL),Uf(e,{urlPathObjParam:t,infoParam:null,optionsParam:null},!1)},Vf=e=>{kf(e)},Bf=e=>{const t={pxURLPath:e};return jf(Tf,Ip.getApplicationPath(),t)},Gf=e=>{const{uiResources:t}=e;xf()&&(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))&&kf(e)},Wf=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},Hf=(e,t,n)=>{const{caseClassName:r,workID:a}=e.payload,{containerName:s,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=V.getRemoteCase(r),u={...e,headers:{RemoteSystemID:c},className:r,isTraditionalRemoteCase:!0,action:mt,viewName:U,gadgetId:xc.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${a}`,containerName:s,name:l};fh(d.showPage(u))},qf=e=>{const t=(e=>e.state?e.state.stateObj:null)(e);t&&(V.isTraditionalRemoteCase(t.payload?.caseClassName)?Hf({...t},t.options):fh(d.showHistory(Wf(t))))},Yf=()=>Ip.getApplicationPath()!==fp(),Kf=e=>{const{acName:t,context:n,defaultViewLabel:r}=e,a=(e=>{const t=Ip.getRoutingInfo(),n=e.split(" ").join(""),r=e.split(" ").join("-").toLowerCase(),a=(e=>{const t=e.replace(/(?=[A-Z][a-z])/g,"-").toLowerCase();return t.startsWith("-")?t.substring(1):t})(e);return t?.routes[n]?n:t?.routes[r]?r:t?.routes[a]?a:e})(r);(e=>{$f=e})(a),Ip.setDefaultRoute(a);const s=H(t,n),o=yt(t,n),i="true"===Ep.getIsExtraCallRequiredForDefaultHome(),c={historyAction:vf,pxURLPath:""};let l;const u={acName:o,context:s,actionConfig:{context:s}};if(i||!i&&Yf()){const t=Sf(gp());l=bf(t,u),c.pxURLPath=l.urlPath,void 0!==l.payload?.pageClass&&(l.payload.pageClass=hh()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",r={routeEndpoint:l.routeEndpoint,requestType:l.requestType,payload:l.payload,options:u,routeKey:l.routeKey};V.isTraditionalRemoteCase(l?.payload?.caseClassName)?Hf(r,e,u.context):fh(d[n](Wf(r)))}else l=Ip.getEndPointInfo($f),c.pxURLPath="";Uf(null,{urlPathObjParam:c,infoParam:l,optionsParam:u},!0)},zf=(e,t=!1)=>{var n;Tf=e.domain,!1===t&&xf()&&(n=qf,window.addEventListener("popstate",(e=>n(e))),window.onbeforeunload=()=>null),Ip.init(e,$f)},Xf=e=>{(e=>{window.document.title=e})(e)};function Jf(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 Qf=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Zf=()=>Math.random().toString(36).substring(7).split("").join("."),eg={INIT:`@@redux/INIT${Zf()}`,REPLACE:`@@redux/REPLACE${Zf()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Zf()}`};function tg(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 ng(e,t,n){if("function"!=typeof e)throw new Error(Jf(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Jf(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Jf(1));return n(ng)(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(Jf(3));return a}function u(e){if("function"!=typeof e)throw new Error(Jf(4));if(c)throw new Error(Jf(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(Jf(6));t=!1,l(),o.delete(n),s=null}}}function p(e){if(!tg(e))throw new Error(Jf(7));if(void 0===e.type)throw new Error(Jf(8));if("string"!=typeof e.type)throw new Error(Jf(17));if(c)throw new Error(Jf(9));try{c=!0,a=r(a,e)}finally{c=!1}return(s=o).forEach((e=>{e()})),e}p({type:eg.INIT});return{dispatch:p,subscribe:u,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Jf(10));r=e,p({type:eg.REPLACE})},[Qf]:function(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Jf(11));function n(){const e=t;e.next&&e.next(d())}n();return{unsubscribe:e(n)}},[Qf](){return this}}}}}function rg(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:eg.INIT}))throw new Error(Jf(12));if(void 0===n(void 0,{type:eg.PROBE_UNKNOWN_ACTION()}))throw new Error(Jf(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(Jf(14))}o[i]=d,s=s||d!==l}return s=s||r.length!==Object.keys(e).length,s?o:e}}function ag(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}var sg=function(e){function t(t,n){return e.call(this)||this}return lo(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(bo),og={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=og.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,go([e,t],fo(n))):setInterval.apply(void 0,go([e,t],fo(n)))},clearInterval:function(e){var t=og.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},ig=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 lo(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),og.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&&og.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,So(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(sg),cg=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return lo(t,e),t.prototype.schedule=function(t,n){return void 0===n&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},t}(ig),lg={now:function(){return(lg.delegate||Date).now()},delegate:void 0},dg=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=lg.now,e}(),ug=function(e){function t(t,n){void 0===n&&(n=dg.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return lo(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}(dg),pg=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return lo(t,e),t}(ug))(cg),hg=oo((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),fg=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 lo(t,e),t.prototype.lift=function(e){var t=new gg(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new hg},t.prototype.next=function(e){var t=this;Mo((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=ho(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;Mo((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;Mo((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?No:(this.currentObservers=null,s.push(e),new bo((function(){t.currentObservers=null,So(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 Yo;return e.source=this,e},t.create=function(e,t){return new gg(e,t)},t}(Yo),gg=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return lo(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:No},t}(fg),mg=function(e,t){return mg=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])},mg(e,t)};Object.create;Object.create;var yg=function(e){function t(t,n){var r=e.call(this,(function(e){var t=r.__notifier.subscribe(e);return t&&!t.closed&&e.next(r.value),t}))||this;return r.__notifier=new fg,r.value=n,t.subscribe((function(e){e!==r.value&&(r.value=e,r.__notifier.next(e))})),r}return function(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}mg(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Yo);var Ig=n(52),Eg=Symbol.for("immer-nothing"),Ag=Symbol.for("immer-draftable"),Cg=Symbol.for("immer-state");function _g(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Sg=Object.getPrototypeOf;function bg(e){return!!e&&!!e[Cg]}function Ng(e){return!!e&&(Pg(e)||Array.isArray(e)||!!e[Ag]||!!e.constructor?.[Ag]||Dg(e)||xg(e))}var vg=Object.prototype.constructor.toString();function Pg(e){if(!e||"object"!=typeof e)return!1;const t=Sg(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===vg}function Tg(e,t){0===$g(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function $g(e){const t=e[Cg];return t?t.type_:Array.isArray(e)?1:Dg(e)?2:xg(e)?3:0}function Og(e,t){return 2===$g(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Rg(e,t,n){const r=$g(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Dg(e){return e instanceof Map}function xg(e){return e instanceof Set}function wg(e){return e.copy_||e.base_}function Mg(e,t){if(Dg(e))return new Map(e);if(xg(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Pg(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[Cg];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const a=n[r],s=t[a];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create(Sg(e),t)}{const t=Sg(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Lg(e,t=!1){return jg(e)||bg(e)||!Ng(e)||($g(e)>1&&(e.set=e.add=e.clear=e.delete=Fg),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Lg(t,!0)))),e}function Fg(){_g(2)}function jg(e){return Object.isFrozen(e)}var Ug,kg={};function Vg(e){const t=kg[e];return t||_g(0),t}function Bg(){return Ug}function Gg(e,t){t&&(Vg("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Wg(e){Hg(e),e.drafts_.forEach(Yg),e.drafts_=null}function Hg(e){e===Ug&&(Ug=e.parent_)}function qg(e){return Ug={drafts_:[],parent_:Ug,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Yg(e){const t=e[Cg];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Kg(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Cg].modified_&&(Wg(t),_g(4)),Ng(e)&&(e=zg(t,e),t.parent_||Jg(t,e)),t.patches_&&Vg("Patches").generateReplacementPatches_(n[Cg].base_,e,t.patches_,t.inversePatches_)):e=zg(t,n,[]),Wg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Eg?e:void 0}function zg(e,t,n){if(jg(t))return t;const r=t[Cg];if(!r)return Tg(t,((a,s)=>Xg(e,r,t,a,s,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Jg(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let a=t,s=!1;3===r.type_&&(a=new Set(t),t.clear(),s=!0),Tg(a,((a,o)=>Xg(e,r,t,a,o,n,s))),Jg(e,t,!1),n&&e.patches_&&Vg("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Xg(e,t,n,r,a,s,o){if(bg(a)){const o=zg(e,a,s&&t&&3!==t.type_&&!Og(t.assigned_,r)?s.concat(r):void 0);if(Rg(n,r,o),!bg(o))return;e.canAutoFreeze_=!1}else o&&n.add(a);if(Ng(a)&&!jg(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;zg(e,a),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||Jg(e,a)}}function Jg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Lg(t,n)}var Qg={get(e,t){if(t===Cg)return e;const n=wg(e);if(!Og(n,t))return function(e,t,n){const r=tm(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!Ng(r)?r:r===em(e.base_,t)?(rm(e),e.copy_[t]=am(r,e)):r},has:(e,t)=>t in wg(e),ownKeys:e=>Reflect.ownKeys(wg(e)),set(e,t,n){const r=tm(wg(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=em(wg(e),t),o=r?.[Cg];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((a=n)===(s=r)?0!==a||1/a==1/s:a!=a&&s!=s)&&(void 0!==n||Og(e.base_,t)))return!0;rm(e),nm(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_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==em(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,rm(e),nm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=wg(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){_g(11)},getPrototypeOf:e=>Sg(e.base_),setPrototypeOf(){_g(12)}},Zg={};function em(e,t){const n=e[Cg];return(n?wg(n):e)[t]}function tm(e,t){if(!(t in e))return;let n=Sg(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Sg(n)}}function nm(e){e.modified_||(e.modified_=!0,e.parent_&&nm(e.parent_))}function rm(e){e.copy_||(e.copy_=Mg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Tg(Qg,((e,t)=>{Zg[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Zg.deleteProperty=function(e,t){return Zg.set.call(this,e,t,void 0)},Zg.set=function(e,t,n){return Qg.set.call(this,e[0],t,n,e[0])};function am(e,t){const n=Dg(e)?Vg("MapSet").proxyMap_(e,t):xg(e)?Vg("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Bg(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,s=Qg;n&&(a=[r],s=Zg);const{revoke:o,proxy:i}=Proxy.revocable(a,s);return r.draft_=i,r.revoke_=o,i}(e,t);return(t?t.scope_:Bg()).drafts_.push(n),n}function sm(e){if(!Ng(e)||jg(e))return e;const t=e[Cg];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Mg(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Mg(e,!0);return Tg(n,((e,t)=>{Rg(n,e,sm(t))})),t&&(t.finalized_=!1),n}var om=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof 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("function"!=typeof t&&_g(6),void 0!==n&&"function"!=typeof n&&_g(7),Ng(e)){const a=qg(this),s=am(e,void 0);let o=!0;try{r=t(s),o=!1}finally{o?Wg(a):Hg(a)}return Gg(a,n),Kg(r,a)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Eg&&(r=void 0),this.autoFreeze_&&Lg(r,!0),n){const t=[],a=[];Vg("Patches").generateReplacementPatches_(e,r,t,a),n(t,a)}return r}_g(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof 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]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ng(e)||_g(8),bg(e)&&(e=function(e){bg(e)||_g(10);return sm(e)}(e));const t=qg(this),n=am(e,void 0);return n[Cg].isManual_=!0,Hg(t),n}finishDraft(e,t){const n=e&&e[Cg];n&&n.isManual_||_g(9);const{scope_:r}=n;return Gg(r,t),Kg(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}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=Vg("Patches").applyPatches_;return bg(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},im=om.produce;om.produceWithPatches.bind(om),om.setAutoFreeze.bind(om),om.setUseStrictShallowCopy.bind(om),om.applyPatches.bind(om),om.createDraft.bind(om),om.finishDraft.bind(om);const cm=(e,t)=>{const{data:{shared:n={}}={},context:r}=t;((e,t)=>{vd.updateDataPageStore(t),Object.keys(t).forEach((n=>{Rh.getIn(e,[j.SHARED,n])?Object.keys(t[n]).forEach((r=>{Rh.setIn(e,[j.SHARED,n,r],t[n][r])})):Rh.setIn(e,[j.SHARED,n],t[n])}))})(e,n),r&&Rh.deleteIn(e,[r,"shared"])},lm=(e,t,n=!1)=>{const{context:r,caseViewMode:a=(n?void 0:j.PERFORM_MODE),containerName:s}=t;s!==lu.WORKAREA&&a&&Rh.setIn(e,[r,"context_data","caseViewMode"],a)},dm=(e,t)=>{const{context:n}=t;Rh.setIn(e,[n,"context_data","actionType"],t.actionType),Rh.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},um=(e,t=[])=>{t.forEach((t=>Rh.deleteIn(e,t)))},pm=(e,t=[])=>{t.forEach((t=>Rh.deleteIn(e,t)))},hm=(e,t=[])=>{t.forEach((t=>{Rh.deleteIn(e,t)}))},fm=(e,t,n={})=>{const{deleteAssignmentSpecificResources:r=!0,doDeleteConfirmationDetails:a=!0}=n;Rh.deleteIn(e,[t,"nextAssignmentInfo"]),Rh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableActions"]),Rh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableProcesses"]),Rh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"activeActionID"]),Rh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"assignments"]),Rh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"childCases"]),a&&(Rh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"confirmationLinks"]),Rh.deleteIn(e,[t,"caseMessages"])),r&&(Rh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"actionButtons"]),Rh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"navigation"]))},gm=/\[(\d+)\]$/gi,mm=/(\d+)/gi,ym=/\[.\]$/gi,Im=(e,t,n,r=[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT])=>{const a=Rh.getIn(t,r);if(a){const t=Jn(a,[],[]);for(const a of t)Rh.setIn(e[n],[...r,...a],{})}},Em=(e,t,n,r)=>{const{property:a,pageReference:s,category:o,type:i}=r.payload,c=Rh.getIn(e[t],n);if(c&&o===j.CASEMESSAGES)Rh.setIn(e[t],Wn(a,s,o),"");else if(c&&c.length>0&&Array.isArray(c)){const r=c.filter((e=>e.type!==i));n&&n.length>0&&Rh.setIn(e[t],Wn(a,s,o),r)}},Am=(e,t)=>{const{property:n,pageReference:r,category:a,isListEntry:s,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return Im(e,i,c),e;const l=Wn(n,r,a,s);if(Number.isInteger(o)){Rh.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=Rh.getIn(e[c],t)||{};const r=(d=Object.keys(n),[...d].sort(((e,t)=>{const n=e.match(gm),r=t.match(gm);if(!n&&!r)return e.localeCompare(t);if(!n&&r)return-1;if(n?.length&&r?.length){const e=n[0].match(mm),t=r[0].match(mm);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(gm);if(s?.length){const i=parseInt(s[0].match(mm)[0],10);i>o&&(Rh.deleteIn(e[c],t.concat(r[a])),Rh.setIn(e[c],t.concat(r[a].replace(ym,`[${i-1}]`)),n))}}))}else Rh.setIn(e[c],l,{});var d;return e};function Cm(e,t){const n=Rh.getIn(e,t);return void 0!==n?.dataInfo?.content}function _m(e,t){let n=Gn.FIELD_MESSAGES_PATH;return Cm(e,t)&&(n=Gn.DATA_OBJECT_FIELD_MESSAGES_PATH),n}const Sm=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const r=Rh.getIn(n,j.ERROR_FIELD_IN_PAGE).slice(1),a=Rh.getIn(n,j.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(a){let s="caseInfo.content";Cm(e,t)&&(s="dataInfo.content");let o=r?`${s}.${r}`:s;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=Wn(a,o,j.PROPERTY),c=Rh.getIn(e[t],`${o}.classID`),l=Vp(a,c),d=PCore.getLocaleUtils(),u=`${l?.definedOnClassID||l?.classID}.${a}`,p={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:d.getLocaleValue(l.label,u,d.FIELD_LABELS_BUNDLE_KEY)}},h=Rh.getIn(e[t],i,[]);if(Rh.isContains(h,p))return;Rh.setIn(e[t],i,[...h,p])}})(e,t,n)}))};function bm(e,t){const{err:n,formFields:r}=t.payload;let{context:a}=t.payload;const{fieldErrors:s,pageErrors:o}=Gc(n.errorDetails,r),i=_m(e,a);if(Rh.setIn(e,[a,...i],{}),Rh.setIn(e,[a,...Gn.PAGE_MESSAGES_PATH],[]),s.forEach((t=>{if(t[j.ERROR_FIELD_IN_PAGE]){const n=t[j.ERROR_FIELD_IN_PAGE].slice(1);if(n){const t=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)}(n);if(!t)return!1;const r=n.substring(n.lastIndexOf(".")+1),s=Wn(r,t,j.PROPERTY);Rh.setIn(e,[a,...s],[])}}})),s.length>0&&Sm(e,a,s),o.length>0){const t=(e=>{const t=[];return e.forEach((e=>{t.push({type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue})})),t})(o);e[a]||(a=j.APP.APP),Rh.setIn(e,[a,...Gn.PAGE_MESSAGES_PATH],t)}else a.includes&&a.includes(lu.WORKAREA)&&(a=W(a)),Rh.deleteIn(e,[a,...Gn.PAGE_MESSAGES_PATH]);return e}const Nm=[(e,t)=>im(e,(e=>{switch(t.type){case ge:{const{propertiesToReplace:n=[],interestPath:r}=t.payload;if(r){const a=Rh.getIn(e[t.payload.context],r),s=Rh.getIn(t.payload.data,r),o=Nh(a,s,{isArrayDeepMerge:!0});bh(e[t.payload.context],[...n]),Rh.setIn(e[t.payload.context],r,o)}else e[t.payload.context]=Nh(e[t.payload.context],t.payload.data,{isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n]});return lm(e,t.payload,!0),cm(e,t.payload),e}case Q:{const{context:n,reference:r,value:a,isArrayDeepMerge:s}=t.payload;return vh(e[n],r,a,{isArrayDeepMerge:s}),e}case Z:{const{context:n,reference:r,value:a}=t.payload;return Ph(e[n],r,a),e}case me:return _h(e[t.payload.context],t.payload.reference),e;case oe:return Rh.setIn(e[t.payload.context],"context_data.isLoading",!0),e;case ie:return Rh.setIn(e[t.payload.context],"context_data.isLoading",!1),e;case nt:{const{data:n}=t.payload;return cm(e,{data:{shared:n}}),e}case rt:{const{dataPagesToBeRemoved:n=[]}=t.payload;return n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:r}=t;Rh.deleteIn(e.shared,[n,r]);const a=Rh.getIn(e.shared,[n]);a&&0===Object.keys(a).length&&Rh.deleteIn(e.shared,[n])})),e}case ot:{const n=Rh.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);return t.payload.isInitiateBlockingAction?Rh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):Rh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1),e}default:return e}})),(e,t)=>im(e||{},(e=>{switch(t.type){case _e:{if(!t.payload.data||e[t.payload.context])return e;t.payload.doDeleteCaseSummary&&fm(e,t.payload.context);const{target:n}=t.payload;return!n||-1===n.indexOf(j.WORKAREA)&&-1===n.indexOf(j.MODAL)?e[t.payload.containerItemID]=t.payload.data:e[t.payload.context]=t.payload.data,lm(e,t.payload),dm(e,t.payload),cm(e,t.payload),((e,t)=>{const{context:n}=t;Rh.deleteIn(e,[n,"context_data","blocking_action_counter"]),Rh.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload),e}case De:{t.payload.doDeleteCaseSummary&&fm(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:r=[]}=t.payload;return!n||-1===n.indexOf(j.WORKAREA)&&-1===n.indexOf(j.MODAL)?e[t.payload.containerItemID]=Nh(e[t.payload.containerItemID],t.payload.data,{propertiesToReplace:[...r]}):e[t.payload.context]=Nh(e[t.payload.context],t.payload.data,{propertiesToReplace:[...r]}),(t.payload.actionType||t.payload.assignmentID)&&dm(e,t.payload),lm(e,t.payload),cm(e,t.payload),pm(e,t.payload.suggestionContexts),e}case Se:{const{childContainersContexts:n=[]}=t.payload;return((e,t)=>{const{containerItemID:n,context:r,deleteContext:a}=t;a&&Rh.deleteIn(e,[r]),Rh.deleteIn(e,[n])})(e,t.payload),hm(e,n),um(e,t.payload.transientItems),pm(e,t.payload.suggestionContexts),e}case Ce:{const{containerItems:n}=t.payload;return Array.isArray(n)?n.forEach((t=>{Rh.deleteIn(e,[t])})):Rh.deleteIn(e,[n]),e}case xe:{const{context:n,contextToBeRemoved:r,data:a,childContainersContextsToBeRemoved:s}=t.payload;return fm(e,t.payload.context),lm(e,t.payload),e[n]=Nh(e[n],e[r]),e[n]=Nh(e[n],a),Rh.deleteIn(e,[r]),hm(e,s),cm(e,t.payload),e}case we:{const{payload:{context:n,pulseReplace:r=!0,childContainersContexts:a=[]}}=t;let{payload:{data:s}}=t;const o=Rh.getIn(e[n],"pulse");let i=Rh.getIn(e[n],"OperatorID"),c=Rh.getIn(e[n],"pxRequestor");return c&&s.pxRequestor&&(c=Rh.mergeDeep(c,s.pxRequestor)),i&&s.OperatorID&&(i=Rh.mergeDeep(i,s.OperatorID)),!r&&o&&(s=vh(s,"pulse",o),s=vh(s,"OperatorID",i),s=vh(s,"pxRequestor",c)),Rh.setIn(e,n,s),lm(e,t.payload),cm(e,t.payload),hm(e,a),um(e,t.payload.transientItems),pm(e,t.payload.suggestionContexts),e}case st:{const{context:n,doDeleteConfirmationDetails:r=!0}=t.payload;return fm(e,n,{doDeleteConfirmationDetails:r}),e}case be:{const{transientItemID:n,data:r}=t.payload;return Rh.setIn(e,n,r)}case ve:case Pe:{const{transientItems:n}=t.payload;return n.forEach((t=>Rh.deleteIn(e,t))),e}case Ne:case Te:{const{transientItemID:n,data:r}=t.payload;return Nh(Rh.getIn(e,n),r),e}case $e:{const{transientItemID:n,data:r}=t.payload;for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&Rh.deleteIn(e,[n,t]);return e}case Oe:{const{transientItemID:n,data:r}=t.payload;return Rh.deleteIn(e,n),Rh.setIn(e,n,r)}case ce:{const{key:n,value:r}=t.payload;return Rh.setIn(e,`${j.SHARED}.${n}`,r),e}case Fe:{const{context:n,data:r}=t.payload;return Rh.setIn(e,n,r)}default:return e}})),(e,t)=>im(e||Rm().data,(e=>{switch(t.type){case Ee:return t.payload.err.errorDetails&&("Validation fail"===t.payload.err.errorClassification||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?bm(e,t):e;case De:{const{context:n}=t.payload,r=[n,..._m(e,n)],a=[n,...Gn.PAGE_MESSAGES_PATH];if(Rh.setIn(e,r,{}),Rh.setIn(e,a,[]),n&&n.includes(lu.WORKAREA)){const t=[X(n),...Gn.PAGE_MESSAGES_PATH];Rh.setIn(e,t,[])}return e}case Ze:{const{isListEntry:n}=t.payload;return n?Am(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 Im(e,o,i),e;const l=Wn(n,r,a,s);return a===j.PAGE&&i?.includes(lu.WORKAREA)&&(c=W(i)),Em(e,c,l,t),Em(e,i,l,t),e})(e,t)}case Qe:{const{messages:n,property:r,pageReference:a,context:s,category:o}=t.payload,i=Wn(r,a,o);return n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&Rh.setIn(e[s],Wn(r,a,o),n),e}default:return e}})),(e,t)=>im(e,(e=>{if(t.type===at){const{instruction:n,actions:r,context:a,referenceList:s,listIndex:o,listMoveToIndex:i,content:c={}}=t.payload,l=uh(s);switch(n){case j.LIST_ACTIONS.INSERT:((e,t,n,r,a)=>{Rh.setIn(e[t],[...n,r],a)})(e,a,l,o,c);break;case j.LIST_ACTIONS.UPDATE:((e,t,n,r,a)=>{const s=Nh(Rh.getIn(e[t],[...n,r],{}),a);Rh.setIn(e[t],[...n,r],s)})(e,a,l,o,c);break;case j.LIST_ACTIONS.DELETE:((e,t,n,r)=>{const a=Rh.getIn(e[t],n,[]);a.splice(r,1),Rh.setIn(e[t],n,a),Tn.deleteListNode(t,n,a.length)})(e,a,l,o);break;case j.LIST_ACTIONS.MOVE:((e,t,n,r,a)=>{const s=Rh.getIn(e[t],[...n,r],{}),o=Rh.getIn(e[t],n,[]);o.splice(r,1),o.splice(a,0,s),Rh.setIn(e[t],n,o),Yn(e,t,n?.join("."),r,a)})(e,a,l,o,i);break;case j.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,r)=>{const a=Rh.getIn(e[t],n)||[];r.forEach((e=>{const{instruction:r,content:s,listIndex:o}=e;if(r===j.LIST_ACTIONS.SELECT){a[o]=s;const e=n?.join(".");gr(t,e)}else delete a[o]})),Rh.setIn(e[t],n,a.filter(Boolean))})(e,a,l,r);break;case j.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{Rh.setIn(e[t],n,[])})(e,a,l)}}return e}))],vm=(e,t)=>(e||(e=Rm().data),t.type===et?Rm().data:(Nm.forEach((n=>{e=n(e,t)})),e)),Pm=(e,t=[])=>{t.forEach((t=>{Rh.deleteIn(e,[t])}))},Tm=(e,t)=>{const{type:n,payload:r}=t,a=n===De,{target:s,context:o,semanticURL:i="",root:c,containerItemID:l,childContainers:d,flowName:u,resourceType:p="",key:h="",clearView:f=!1}=r;return c?Rh.setIn(e,[s,"items",l,"view"],c):f&&Rh.deleteIn(e,[s,"items",l,"view"]),o&&Rh.setIn(e,[s,"items",l,"context"],o),u&&Rh.setIn(e,[s,"items",l,"flowName"],u),(!a||a&&h)&&Rh.setIn(e,[s,"items",l,"key"],h.trim()),((e,t,n,r)=>{""===e&&Rh.deleteIn(t,[n,"items",r,"key"])})(h,e,s,l),(!a||a&&i)&&Rh.setIn(e,[s,"items",l,"semanticURL"],i),(!a||a&&p)&&Rh.setIn(e,[s,"items",l,"resourceType"],p),Pm(e,d),e},$m=(e,t)=>(e||(e=Rm().containers),t.type===et?Rm().containers:im(e,(e=>{switch(t.type){case Ae:{const{context:n,name:r,type:a,actionMgrID:s}=t.payload,o=`${n}/${r}`;let i=null;return un.resolveActionByID(s,null,!1),e[o]?e:(i={type:a,accessedOrder:[],items:{}},Rh.setIn(e,[o],i),e)}case Le:{const{containerName:n,childContainers:r=[]}=t.payload;return Rh.deleteIn(e,[n]),r.forEach((t=>{Rh.deleteIn(e,[t])})),e}case Ce:{const{context:n,name:r,actionMgrID:a,childContainers:s}=t.payload,o=`${n}/${r}`;return un.resolveActionByID(a,null,!1),Rh.setIn(e,[o,"accessedOrder"],[]),Rh.setIn(e,[o,"items"],{}),Array.isArray(s)&&s.forEach((t=>{Rh.deleteIn(e,[t])})),e}case _e:{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:f,showProgress:g,progressMessage:m,modalOptions:y,resourceStatus:I,actionID:E,isMultiRecordData:A,acTertiary:C,parentContext:_,heading:S,isTraditionalRemoteCase:b}=t.payload,N=e[n],v=N&&N.type,P=N&&N.accessedOrder||[],T=N&&N.items||{};let $=null;return e[n]&&"single"===v&&P.length>0?Tm(e,t):($={accessedOrder:[...P,c],items:{...T,[c]:{view:i,semanticURL:o,key:d,flowName:u,context:r,isInCreateStage:a,resourceType:p,actionName:h,isMinimizable:f,...s&&{isBulkAction:s},showProgress:g,progressMessage:m,modalOptions:y,isTraditionalRemoteCase:b,resourceStatus:I,...E&&{actionID:E},...C&&{acTertiary:C},...A&&{isMultiRecordData:A},..._&&{parentContext:_},heading:S}}},un.resolveActionByID(l,null,!1),e[n]=x()(e[n],$),e)}case De:{const{actionMgrID:n,data:r}=t.payload;let a=e;try{a=Tm(e,t),un.resolveActionByID(n,r,!1)}catch{un.rejectActionByID(n,!1)}return a}case we:return((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],Rh.setIn(e,[a,"items",s,"transientItems"],[]),Rh.setIn(e,[a,"accessedOrder"],c),o=Tm(e,t),un.resolveActionByID(n,r,!1)}catch{un.rejectActionByID(n,!1)}return o})(e,t);case Re:{const{target:n,containerItemID:r,actionMgrID:a}=t.payload;try{const t=Rh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));t.push(r),Rh.setIn(e,[n,"accessedOrder"],t),un.resolveActionByID(a,null,!1)}catch{un.rejectActionByID(a,!1)}return e}case xe:case Se:{const{target:n,containerItemID:r,actionMgrID:a,childContainers:s}=t.payload;try{const t=Rh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));Rh.setIn(e,[n,"accessedOrder"],t),Rh.deleteIn(e,[n,"items",r]),Pm(e,s),un.resolveActionByID(a,null,!1)}catch{un.rejectActionByID(a,!1)}return e}case be:{const{transientItemID:n,target:r,contextName:a}=t.payload,s=Rh.getIn(e,[r,"items",a,"transientItems"])??[];return Rh.setIn(e,[r,"items",a,"transientItems"],[...s,n])}case Pe:{const{target:n,containerItemID:r}=t.payload;return Rh.deleteIn(e,[n,"items",r,"transientItems"]),e}case ve:{const{target:n,transientItemID:r,containerItemID:a}=t.payload,s=(Rh.getIn(e,[n,"items",a,"transientItems"])??[]).filter((e=>e!==r));return Rh.setIn(e,[n,"items",a,"transientItems"],s)}default:return e}})));let Om={};const Rm=()=>Om,Dm=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,r=n[j.CONTEXT_DATA]||e[j.CONTEXT_DATA];Om={data:{[j.APP.APP]:{...t,[j.CONTEXT_DATA]:r}},containers:{}}})(e),rg({data:vm,containers:$m}));function xm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=nd(e),r=function(e,t){return"number"==typeof td(e)?e.pop():t}(e,1/0),a=e;return a.length?1===a.length?ni(a[0]):function(e){return void 0===e&&(e=1/0),Zl(Ho,e)}(r)(pi(a,n)):sd}const wm=(e,t)=>{e.data=e.data??{};const{assignments:n,availableActions:r=[]}=e.data.caseInfo??{};if(n&&Array.isArray(n)&&n.length>0&&n[0].actions&&Array.isArray(n[0].actions)&&!t?.stopMergeActions){n[0].actions.forEach((e=>{"Assignment"!==e.type&&"LocalAction"!==e.type||r.push(e)})),e.data.caseInfo=e.data.caseInfo??{},e.data.caseInfo.availableActions=r}},Mm=(e,t)=>{if(e.confirmationLinks&&(e.data=e.data??{},e.data.caseInfo=e.data.caseInfo??{},e.data.caseInfo.confirmationLinks=e.confirmationLinks),!e.uiResources&&e.confirmationNote){let t=e;const{confirmationNote:n}=t;return wm(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 n=e,{uiResources:{actionButtons:r,navigation:a},nextAssignmentInfo:s}=n;if(n.data&&n.data.caseInfo&&(r&&(n.data.caseInfo.actionButtons=r),a&&(n.data.caseInfo.navigation=a),t&&t[F.ACTIONS.DELETEAVIALACTIONS]&&delete n.data.caseInfo.availableActions,wm(n,t),e.confirmationNote)){const{confirmationNote:e}=n,t=[e];n.data.caseMessages=t}return t&&t.isCreateDataObject&&(n.data=n.data??{},n.data.dataInfo={},n.data.dataInfo.content=n.data.pyPortal,n.uiResources.root.config.context="dataInfo.content",n.uiResources.context_data.dataInfo=n.uiResources.context_data.dataInfo??{},n.uiResources.context_data.dataInfo.content=n.uiResources.context_data.dataInfo.content??{},n.uiResources.context_data.dataInfo.content=n.uiResources.context_data?.pyPortal,delete n.data.pyPortal,delete n.key),s&&(n.data=n.data??{},n.data.nextAssignmentInfo=s),n},Lm={},{VIEW:Fm,FIELD:jm}=j.CONTEXT_TREE_NODE_TYPES,Um=e=>Di[e]>0&&Lm[e],km=[(e,t)=>e.pipe(Xl($n.REFRESH_DATA,gt),Ql((e=>e.payload)),Zl((e=>{const{context:n,contextData:r,options:a}=e,{propertyName:s="",classID:o=""}=a,i=jc(n,{skipUUID:!1});let c=[],l=[],d=!1;Ep.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:c=[],whens:l=[]}=kn(n)),d=l.some((e=>e.type===Fm))):d=!0;const u=l.filter((e=>e.type===jm)),p=Rh.getPropertyName(s),h=p?p.split("."):[],f=h.pop(),g=h.join("."),m=[];if(g){const e=Vp(g,o);if(e&&"copy"===e.dataRetrievalType){const e=Rh.getIn(i,`content.content.${g}`)||{};if(Object.keys(e).length>0){Object.keys(e).filter((e=>e!==f)).forEach((t=>{delete e[t],m.push(`${g}`)}))}}}e.serverPrecedenceFields=m;let y={...i.content,contextData:r};const I=rl(n);Rh.isEmpty(I)||(y=nl(I,y));const E=((e,t)=>{const{caseWideAction:n,caseViewAction:r,fieldsWithDeclarativeTargets:a,fieldsWithWhen:s,isViewsWithWhen:o,interestPage:i,options:c}=e;let l={};const{optionalPayload:d}=c;d&&(t.content={...d});let u={...t},p=$n.REFRESH;return r?(l=Lf($n.REFRESH_CASE_VIEW,e),u={...u,interestPage:i}):o&&n?l=Lf($n.REFRESH_CASE_DATA,e):o&&!n?l=Lf($n.REFRESH_ASSIGNMENT_DATA,e):(a.length>0||s.length>0)&&(u={...u,calculations:{fields:a,whens:s}},l=Lf(n?$n.RECALCULATE_CASE_DATA:$n.RECALCULATE_ASSIGNMENT_DATA,e),p=$n.RECALCULATE),{restAPI:l,requestBody:u,requestType:p}})({...e,fieldsWithDeclarativeTargets:c,fieldsWithWhen:u,isViewsWithWhen:d},y);Jt.registerBlockingAction(n).catch((()=>{}));const{restAPI:A,requestBody:C,requestType:_}=E;(e={...e,requestType:_}).requestType=_;const{reqType:S,restApi:b}=A,N=t.value.data[n]?.caseInfo?.headers;return pi(((e,t)=>{const{context:n}=e;(e=>{e.reqHeaders&&e.reqHeaders.etag&&(e.headers={"if-match":e.reqHeaders.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),Um(r)){const t=[];for(let n=0;n<Lm[r].length;){const a=Lm[r][n],s=Vn(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=>{Lm[r].splice(e,1)}))}const a=Bi();return e.signal=a.token,e.cancelConfig=a,Lm[r]?Lm[r].push(e):Lm[r]=[e],Ui(e.url,e,n,{cancelContext:r}).then((e=>(delete Lm[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete Lm[r],e}))})({reqHeaders:N,context:n,method:S,body:C,url:Un(e,b)},e)).pipe(Ql((t=>({response:{...t.data||{}},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:Fc(t.headers)}))),id(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),Zl((async e=>{if(e&&e.type===Ee)return Jt.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),Wc(e);const{actionConfig:t,response:n,actionMgrID:r}=e,{context:a,serverPrecedenceFields:s,requestType:o}=t,i=lc.getTargetViewContainerName(je),c=yt(i,a),l={acName:c,context:a},d=Mm(n,{[F.STOPMERGEACTIONS]:!0,[F.ACTIONS.DELETEAVIALACTIONS]:!0});d.directUrlUpdation=!1,o===$n.REFRESH&&await kc(d,t,l);const u={target:c,context:a};let p=ol.getStateMachinesByContext(a)||{};const h=Uc(d,u);t.interestPage&&(h.interestPath=`caseInfo.content${Rh.convertClipboardPageToPageRefNotation(t.interestPage)}`),p={...p,...ol.getUnConnectedStateMachines(a)||{}},Object.keys(p).forEach((e=>{if(Rh.hasIn(h.data,e)){const t=Rh.getIn(h.data,e),n=Ih(e,void 0,a),r=Tn.getContextReferences(a)?.get(e);((e,t,n,r,a)=>Array.isArray(e)&&Array.isArray(t)&&t.length!==e.length&&"Multiselect"!==n&&(!r.interestPath||a.startsWith(r.interestPath)))(t,n,r?.props?.componentName,h,e)&&ol.setStateMachineEmpty(a,e)}})),t.options?.skipDataMerge&&h.data?.caseInfo?.content&&(h.data.caseInfo.content={}),h.preserveClientChanges=void 0===t.options.preserveClientChanges||t.options.preserveClientChanges;const f=xc.getPropertiesToReplace(a),g=gf(Vh,h,{serverPrecedenceFields:s,propertiesToReplace:f});return ol.registerForServerChanges(),fh(g),un.resolveActionByID(r,h),ol.unRegisterForServerChanges(),Jt.deRegisterBlockingAction(a).catch((()=>{})),[]})))],Vm=[e=>e.pipe(Xl(tt),Zl((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===j.READONLY&&s?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=s?.refreshStrategy||{},n=mh()[s.name];if(n&&a in n){const r=n[a],{loadTime:s}=r;if(!md.isTimeElapsed(s,e,t))return}}return md.getData(s.name,{dataViewParameters:s.dataViewParameters},t).then((e=>{const t=s.mode===j.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(Vh({context:t,data:n})),Object.keys(r).length&&s.push(yf({data:r,context:t})),fh(s),[]})))];class Bm{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";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=>{switch(e.data.action){case Bm.DISPLAY_DIRTY_POPUP:this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(mi.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this));break;case Bm.LOAD_PREVIEW:this.loadPreview(e);break;case Bm.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case Bm.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case Bm.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case Bm.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case Bm.CLOSE_CONTAINER_ACTION:this.closeContainer(e)}}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){au({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=au({isRoot:!0}),t=PCore.getStore()?.getState().data.app?.pyPortal?.pyPrimaryNavPages;let n;Array.isArray(t)&&t[0]&&(n=t[0]);const r=n?.pyClassName||"Data-Portal",a=n?.pyRuleName||"pyHome";e.getPConnect().getActionsApi().showPage(a,r)};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===Bm.OPEN_WORK_ITEM&&(o=Bm.OPEN_WORK_BY_HANDLE),Ip.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:o});au({}).getPConnect().getActionsApi().updateRecents(n,t.substring(t.lastIndexOf(" ")+1),a,t)};openAssignment=e=>{const{pzInsKey:t,uniqueId:n}=e.data;n===this.getUniqueId()&&(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"),this.onCreateCallback.call(this,this.openAssignmentParams)),this.onCreateCallback=null,this.openAssignmentParams=null)};getNextWork=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId()){const e=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`;au({meta:{},options:{context:vu(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){const e=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`;au({meta:{},options:{context:vu(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};destroyBroadcastChannel=()=>{this.getBroadCastChannel()?.close(),this.broadcastChannel=null};subscribeEvents=()=>{this.setReverseCoexistenceCaseLoaded(!0),mi.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),mi.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{mi.unsubscribeAllWithEventType(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),mi.unsubscribeAllWithEventType(F.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:Bm.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:Bm.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:Bm.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const Gm=new Bm,Wm="nextAssignmentInfo",Hm="nextAssignmentInfo.context",qm=e=>{const{containerName:t,isInCreateStage:n}=e;return n?j.MODAL:t||lc.getTargetViewContainerName(We)},Ym=e=>{const t=Rh.getIn(e,[j.DATA,j.CASE_INFO.CASE_INFO]);return nn(t)&&rn(Ep.getOperatorIdentifier(),t)},Km=(e,t)=>{const{class:n,context:r,viewType:a=Mc.PAGE}=e,{removeActionPayload:s}=t;let o=e?.pageName?e?.pageName:Ep.getDefaultCasePage();return e.isTraditionalUICase&&(o="pyDetails"),pi(zi.createCase(n,{...e,pageName:o,viewType:a,context:r})).pipe(Ql((({response:t,headers:n})=>({response:t,actionInPayload:e,headers:n,removeActionPayload:s}))),id("Error occurred during ajax call at createWork Epic : ",r))},zm=e=>{mi.publish(j.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},Xm=e=>{mi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},Jm=e=>{let t=0,n=[],r="",a=!1;return e.pipe(Xl(jh),cd(100),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>{const{context:n}=e,r=qm(e),s=yt(r,n),{continueExecution:o,removeActionPayload:i}=(e=>Ru(e)?{continueExecution:!0,removeActionPayload:{}}:zc(e))(s);return a=$c(e.class),o?(e.isTraditionalUICase=a,Km(e,{removeActionPayload:i})):(un.rejectActionByID(t),od())})),Zl((async e=>{if(e&&e.type===Ee)return e.payload.context=tp(),n.push(Wc(e)),n;const{actionInPayload:s,response:o,headers:i,removeActionPayload:c}=e;let l;l=!(s.renderInline||Ep.getDefaultCasePage()||a)&&Ym(o),Rh.setIn(o.data,F.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const d=qm({...s,isInCreateStage:l}),u=yt(d,s.context),p=qc(u,d,s.context);if(!gc(d)&&Ru(u)){const{continueExecution:e}=zc(u);if(!e)return un.rejectActionByID(t),od()}if(!(s?.openCaseViewAfterCreate??!0)&&!l){const e=Rh.getIn(o.data,F.CASE_INFO.CASE_INFO_CONTENT);r=`${e.pyID} ${_p.getLocaleValue("has been created.","Assignment")}`;const t=Sc(o),a=Ac(o);return zm({toastMessage:r}),Xm({caseId:`${e.pyID}`,assignmentId:t,caseType:a}),n}const h=Mm(o);let f=wf("createWork",{caseClassName:Ac(h)});f=f.replace(/{.+?}/,String(Ec(_c(h)))),h.semanticURL=f,((e,t)=>{const n=Ym(e),{skipBrowserSemanticUrlUpdate:r=!1,isTraditionalUICase:a}=t;Rh.setIn(e,["directUrlUpdation"],(!n||a)&&!r)})(h,s);const g={acName:u,context:p},m=Dc(p);await kc(h,s,g);const y={target:u,context:p,containerItemID:p,headers:i,semanticURL:f,isInCreateStage:l,isMinimizable:l,caseViewMode:h.confirmationNote?j.REVIEW_MODE:j.PERFORM_MODE,currentCaseViewMode:m,assignmentContext:Rh.getIn(h,Hm),nextAssignmentInfo:Rh.getIn(h,Wm),resourceType:F.CASE,openCaseViewAfterCreate:s.openCaseViewAfterCreate,modalOptions:s.modalOptions,debugInfo:s.debugInfo};vc(y,h);const I=Uc(h,y);a&&(I.data.caseInfo.content.coexistenceAction="openAssignment");const E=Hc(u,I);return Yc(E)&&bc(n,{removeActionPayload:c,target:u}),n.push(E),Qc(n),n})),Ql((()=>{const e=Oc(),s=nn(Rh.getIn(n[0]?.payload,"data.caseInfo"));return a&&e&&s?Gm.postCreateCaseMessage(n[0]?.payload?.nextAssignmentInfo?.ID,tl,n):tl(n),Tc(n,t),r="",n=[],n})))},{RESOURCE_TYPES:Qm}=F,Zm=(e,t=[])=>{const{viewType:n,containerName:r,targetContainerName:a,isChild:s}=e,o=Ic(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?Mc.PAGE:n||(!fc(r)&&!fc(a)||s?Mc.PAGE:Mc.FORM)},ey=(e,t,n,r,a)=>{if(bc(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=_u(t);let r=null;return n&&(r=pu(t,n)),r?.key===e&&Du(t)})(r.key,n))r.context=vu(n),r.containerItemID=r.context,e.push(gf(uf,r));else if((a?.isChild||a?.isRemote)&&a?.isMultiDoc){const t=ku(a.context);r.target=t,r.context=a.context,r.containerItemID=a.context,e.push(gf(uf,r))}else{const t=ku(r.context),n=yu(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(gf(uf,r))):e.push(gf(zh,r))}},ty=(e,t,n,r,a,s,o)=>{Ru(t)&&xu(t)?((e,t,n,r,a)=>{Zm(e,t)===Mc.FORM?(n.caseViewMode=r||j.PERFORM_MODE,a.push(gf(tf,n))):a.push(gf(uf,n))})(r,a,e,s,n):ey(n,o,t,e,r)},ny=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:a,isGetNextWork:s,doNotMergeMessagesForStatusCode:o})=>Ui(e,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...Oi.addDebugHeaders(r)}}},a,{doNotMergeHttpMessagesForStatusCode:s?o:""}),ry=(e,t)=>{const n=Zm(e),{headers:r,context:a,assignmentID:s,isGetNextWork:o,debugInfo:i,isOpenStage:c,stageID:l,caseID:d,jsActionQueryParams:u,isLastStepInCreateStage:p}=e,{restApi:h,reqType:f}=o?Lf("getNextWork",{viewType:n}):c?Lf("openStage",{caseID:d,stageID:l}):Lf(Ge,{assignmentID:s,viewType:n}),{removeActionPayload:g}=t,m=Ep.getDefaultCasePage();let y="",I=e.pageName;e.isTraditionalUICase&&(I="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=Fc(t,e.remoteClassName)),t})(e);return pi(ny({restUrl:y,reqType:f,requestHeaders:E,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe(Ql((e=>{if(Ep.isCoexistenceAppOfType(j.APP_TYPE.UIKIT)&&!p){return nn(e.data.data.caseInfo)?e:(y=y.replaceAll(I,"pyDetails"),Ep.setDefaultCasePage("pyDetails"),{isReloadWithDifferentViewTypeRequired:!0,restUrl:y})}return e})),Zl((e=>e?.isReloadWithDifferentViewTypeRequired?ny({restUrl:y,reqType:f,requestHeaders:E,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):rd(e))),Ql((t=>{const{key:a,flowName:o}=Bc(s);return{response:{...t.data,key:a,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:g,headers:Fc({...r,...t.headers})}})),id("Error occurred during ajax call at openAssignment Epic : ",a))},{RESOURCE_TYPES:ay}=F,sy=e=>{const t="Browser"===Ep.getRuntime();let n=0,r=[];const a=[];let s=!1,o=!1;return e.pipe(Xl(Gl),Ql((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),Zl((e=>{s=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?Mc.FORM:Zm(e),e.viewType=r;const a=pc(Ge,e),i=yt(a,t),{activate:c,activateContainerActionPayload:l}=Jc(ay.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return rd({type:Re,activateContainerActionPayload:l,actionInPayload:e});const d=_u(i);let u;u=l?.isParallelAssignment?{continueExecution:!0,removeActionPayload:{}}:d?zc(i):{continueExecution:!0,removeActionPayload:{}};const{continueExecution:p,removeActionPayload:h}=u;return p?(o=$c(e.className),e.isTraditionalUICase=o,ry(e,{removeActionPayload:h})):(un.rejectActionByID(n),od())})),Zl((async e=>{if(e?.type===Ee){if(s){const{payload:t}=e,{err:n}=t,r=n.response.status;a.push({status:Number(r)})}return r.push(Wc(e)),r}const{type:t,actionInPayload:n,response:i,viewType:c,headers:l,removeActionPayload:d,activateContainerActionPayload:u}=e;if("openStage"===i?.redirectInfo?.jsAction){const e=i?.redirectInfo?.stageID,t=Gl,a=i?.data?.caseInfo?.ID;n.isOpenStage=!0,n.stageID=e,n.jsActionQueryParams=i?.redirectInfo?.jsActionQueryParams;const s={type:t,payload:{...n,caseID:a,headers:l}};return r.push(s),r}const{context:p,caseViewMode:h,debugInfo:f}=n;let g=((e,t)=>{const n=Ic(e);let r;r=!Ep.getDefaultCasePage()&&nn(n);const{isChild:a,containerName:s}=t,o=a&&r,i=r&&!t.isActionFromToDoList;return o||i?j.MODAL:s||pc(Ge,t)})(i,n);o=$c(i?.data?.caseInfo?.caseTypeID),n.isTraditionalUICase=o,o&&(g=n.containerName);const m=yt(g,p);if(t===Re)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=Nu(a);await kc({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:d}),e.push(gf(sf,{containerItemID:a,target:i,isParallelAssignment:s,insKey:o,resourceType:Qm.CASE,context:d,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,u,{actionInPayload:n,target:m}),Qc(r),r;const y=i?.data?.caseInfo?.content,I=i?.uiResources?.root?.config?.name,E=i?.uiResources?.root?.config?.context;y&&!y.pyViewName&&I&&"page"!==n.viewType&&(Rh.setIn(y,"pyViewName",I),Rh.setIn(y,"pyViewContext",E));const A=Mm(i);((e,t)=>{const n=Ic(e),r=_c(e),a=nn(n),{skipBrowserSemanticUrlUpdate:s=!1,viewType:o,isTraditionalUICase:i}=t,c=o===Mc.PAGE&&(!a||i)&&!s,{caseTypeID:l}=n;if(c){const t=wf(Be,{caseClassName:l}).replace(/{.+?}/,String(Ec(r)));e.semanticURL=t,e.directUrlUpdation=!0}})(A,n);const C=qc(m,g,p),_={acName:m,target:m,context:C};await kc(A,n,_);const S={target:m,context:C,containerItemID:C,headers:l,parentContext:W(n?.context),isMinimizable:nn(Rh.getIn(A,"data.caseInfo")),doDeleteCaseSummary:n.doDeleteCaseSummary,acTertiary:n.acTertiary,resourceType:F.ASSIGNMENT,debugInfo:f};vc(S,A,{skipFlowNameUpdate:n?.caseViewMode===j.REVIEW_MODE});const b=Uc(A,S);var N;return n.isProcessAction&&(b.data.isProcessAction=n.isProcessAction),o&&(b.data.caseInfo.content.coexistenceAction="openAssignment"),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(n,b),ty(b,m,r,n,i,h,d),c===Mc.FORM&&Nc(b.containerItemID)&&el(b,r),Qc(r),N={actionInContext:p,assignmentID:n.assignmentID,caseKey:b.key},mi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,N),r})),Ql((()=>{const e=n,t=Oc(),s=nn(Rh.getIn(r[0]?.payload,"data.caseInfo"));return o&&t&&s?Gm.postCreateCaseMessage(r[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,fh,r):fh(r),Tc(r,e,a),r[0]?.payload?.isParallelAssignment&&fh({type:Gl,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))},oy=(e,t)=>{const{insKey:n,headers:r,context:a,debugInfo:s,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:Ep.getDefaultCasePage(),l=Lf(Be,{caseID:n,params:{pageName:c}});let{restApi:d}=l;const{reqType:u}=l;return"none"===o&&(d=`${d?.split("viewType")[0]}viewType=none`),pi(Ui(d,{method:u,headers:{...r,...s&&{...Oi.addDebugHeaders(s)}}},a)).pipe(Ql((t=>({response:t.data,actionInPayload:e,headers:Fc({...r,...t.headers}),removeActionPayload:i}))),id("Error occurred during ajax call at openWorkByHandle Epic : ",a))},iy="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:cy}=F,ly=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=pc(Be,r),h=yt(p,l);if(s===Re)await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:a,actionInPayload:{context:s,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=pc(Be,a),l=yt(c,s),d=Nu(r);await kc({directUrlUpdation:!o,semanticURL:n},a,{acName:l,containerName:c,target:l,context:d}),e.push(gf(sf,{containerItemID:r,target:l,context:d,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:a,actionInPayload:r});else{const a=qc(h,p,l,{buildNew:!0}),s=Mm(o),f=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:r}=t,a=_c(e),s=n?r:Ac(e);let o=wf(Be,{caseClassName:s},{id:t?.insKey});return o=o?.replace("{workID}",String(Ec(a)))?.replace("{id}",t?.insKey),o})(s,r);s.semanticURL=f,s.directUrlUpdation=!d;const g={acName:h,context:a};await kc(s,r,g);const m=Uc(s,{target:h,context:a,containerItemID:a,semanticURL:f,headers:c,debugInfo:u});m.caseViewMode=j.REVIEW_MODE,m.resourceType=cy.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle"),vc(m,s,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=Dc(e?.actionInPayload?.context);const y=Hc(h,m);i.containerItemID&&Yc(y)&&t.push(gf(cf,{containerItemID:i.containerItemID,target:h})),t.push(y)}Qc(t);const f=r.insKey;var g;g={caseKey:f,actionInContext:l},mi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,g)},dy=e=>{let t=0,n=[];return e.pipe(Xl(iy),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>{const{context:n,isChild:r,viewType:a}=e,s=pc(Be,e),o=yt(s,n);let i,c=!0;if("none"!==a){const e=zc(o);c=e.continueExecution,i=e.removeActionPayload}if(!c)return un.rejectActionByID(t),od();const{activate:l,activateContainerActionPayload:d}=Jc(cy.CASE,o,e);return l&&!r&&"none"!==a?rd({type:Re,activateContainerActionPayload:d,actionInPayload:e}):oy(e,{removeActionPayload:i})})),Zl((async e=>{if(e&&mc(e.type))return n.push(Wc(e)),n;const t=gh(e?.actionInPayload?.context),r=$c(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=Mm(e?.response),a={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:st,payload:{context:a.context,doDeleteConfirmationDetails:!1}}),r&&a.data.caseInfo?.content&&(a.data.caseInfo.content.coexistenceAction="openWorkByHandle"),n.push(gf(Vh,a));const s=ku(e?.actionInPayload?.context),o=hc(e?.actionInPayload?.context),i=Object.freeze({target:s,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(Nc(e?.actionInPayload?.context)){const t=Uc(e?.response,{...i});el({...t,isArrayDeepMerge:!0},n)}}}else await ly(e,n,r);return n})),Ql((()=>(fh(n),Tc(n,t),n=[],n))))},uy="FINISH_ASSIGNMENT",{RESOURCE_TYPES:py}=F,hy=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:a,isProcessAction:s}=t,o=Nu(n),i=`${o?.includes("root")?j.APP.ROOT:j.APP.APP}/${lu.MODAL}`;e.push(gf(cf,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:r,isInCreateStage:a,isProcessAction:s}))},fy=e=>Ih(".openCaseViewAfterCreate",j.CONTEXT_DATA,e)??!0,gy=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r,a)=>{const{caseID:s}=n,o=(i=t,Rh.getIn(i,uc.NEXT_ASSIGNMENT_INFO_ID,j.EMPTY_STRING));var i;const c=Ac(t),{caseViewMode:l,headers:d,semanticURL:u,actionMgrID:p,directUrlUpdation:h,key:f,flowName:g,resourceType:m}=r;a&&Object.assign(a,{caseId:s,assignmentId:o,caseType:c}),hy(e,{...n,skipReleaseLockRequest:!0});const y=`${n?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${lu.PRIMARY}`,I=qc(y,lu.PRIMARY),E=Oi.getCoreHeadersFromContext(n.context)||!1,A=Uc(t,{target:y,context:I,containerItemID:I,caseViewMode:l,headers:d,semanticURL:u,key:f,flowName:g,resourceType:m,directUrlUpdation:h,debugInfo:E&&E.debugInfo&&{debugId:E.debugInfo[j.COREHEADER_APP_DEBUG_ID]}});if(Ru(y)){const t=gh(I),a=_c({data:t}),[,s]=a?a.split(" "):[],o=`You will lose unsaved changes for ${s}. Do you want to continue?`;if(!fy(n.context))return e;{const{continueExecution:t}=zc(y,{dirtyMessage:o});if(!t)return r.directUrlUpdation=!1,un.rejectActionByID(p),od();A.currentCaseViewMode=Dc(A?.context),e.push(gf(uf,A))}}else e.push(gf(zh,A));return t.directUrlUpdation=h,t.semanticURL=u,await kc(t,{...A,acName:y},{acName:y,context:I}),e},my=e=>/^app\/preview_[0-9]*/g.test(e),yy=(e,t)=>{const n=W(e);return!my(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},Iy=async(e,t,n,r,a,s,o,i,c)=>{const{headers:l}=c;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=gh(e),r=c?.response?.data?.caseInfo?.assignments??[],a=n?.caseInfo?.assignments??[],s=Dc(e)===j.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 d=Ru(ku(e));let u=!1;const p=ku(n),h=uu(p),f=_u(p);f&&h?.items?.[f]?.key===c?.actionInPayload?.caseID&&(u=!0),hy(a,{...r,skipReleaseLockRequest:!0});const g=hc(e),m={target:ku(e),containerItemID:e,context:e,containerName:g};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const y=X(n),I=gh(y),E=gh(r.context),A=I?.caseInfo?.ID,C=E?.caseInfo?.ID,_=gh(e)?.caseInfo?.ID;if(d&&A===C||!d&&(""===o||m.containerItemID.includes(j.WORKAREA)&&"review"===t.caseViewMode||!s&&t.root&&0===Object.keys(t.root).length&&_===t.data?.caseInfo?.ID))(void 0===t?.data?.caseInfo?.content||void 0!==t.data.caseInfo.content&&"object"==typeof t.data.caseInfo.content&&0===Object.keys(t.data.caseInfo.content).length)&&(t.root=void 0,delete t.data?.caseMessages),e.includes(j.WORKAREA)&&t.caseViewMode===j.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),a.push(gf(tf,{...t,key:o,resourceType:"",...m}));else if(s){const s=ku(e),i=yu(s,o);if(i)m.target=s,m.context=i,m.containerItemID=i,a.push(gf(tf,{...t,key:o,resourceType:"",...m}));else{const e=Tu(n)[0];if(r.target=e,r.context=qc(e,j.WORKAREA,n),r?.context){r.containerItemID=r.context,a.push(gf(zh,{...r,...t}));const n=r.containerItemID;a.push(gf(sf,{parentContainerTarget:e,containerItemID:n}))}}}if(r.target=ku(e),r.containerName=hc(e),r.context=e,r.containerItemID=e,Rh.setIn(t,"acName",m.target),await kc(i,t),u){const{data:e,caseViewMode:r}=t;n.includes(j.WORKAREA)&&Nc(n)&&(n=X(n));const s={data:e,caseViewMode:r,context:n};Rh.setIn(s.data,["context_data","caseViewMode"],r),a.push({type:st,payload:{context:n}}),a.push(gf(Vh,s))}if(!s&&t.caseViewMode===j.PERFORM_MODE){const t=((e,t)=>{const n=ku(e);return yu(n,t)})(e,o),n={data:{caseInfo:{headers:l}},context:t};a.push(gf(Vh,n)),a.push(On(((e,t=!1,n=!1)=>{const r=un.getNextActionMgrId();return{ID:Mh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:Mh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{hy(a,r);let e=!1;const o=ku(n),i=uu(o),l=_u(o);if(l&&i?.items?.[l]?.key===c?.actionInPayload?.caseID&&(e=!0),s){const e=Tu(n)[0];r.target=e,r.context=qc(e,j.WORKAREA,n),r.containerItemID=r.context,a.push(gf(zh,{...r,...t}));const s=r.containerItemID;a.push(gf(sf,{parentContainerTarget:e,containerItemID:s}))}if(e){const{data:e,caseViewMode:r}=t,s={data:e,caseViewMode:r,context:n};Rh.setIn(s.data,["context_data","caseViewMode"],r),a.push({type:st,payload:{context:n}}),a.push(gf(Vh,s))}}},Ey=async(e,t,n,r,a,s)=>{((e,t,n)=>{if(t.isProcessAction&&(hy(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${lu.PRIMARY}`,a=qc(r,lu.PRIMARY),s={insKey:e.ID,className:e.content.classID,context:a,acTargetName:j.PRIMARY,isChild:!0},o={type:de,payload:{...s}};n.push(o)}})(e.data.caseInfo.parentCaseInfo,t,a);const o=e?.data?.caseInfo?.parentCaseInfo?.ID;if(o){const n=ku(t?.context),r=pu(n,t?.context)?.parentContext,a=ku(r);t?.isProcessAction&&mu(a,o)&&rp(r,e?.data?.caseInfo?.lastUpdateTime)}n.resourceType=py.CASE,n.directUrlUpdation=!0,t.isProcessAction||await gy(a,{translatedDXAPIResponse:r,actionInPayload:t},n,s)},Ay=async(e,t,n,r,a)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===j.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:s}=t,o=xc.getPropertiesToReplace(s);a.push(gf(tf,{...e,...r,propertiesToReplace:o})),Rh.setIn(e,"acName",r.target),await kc(n,e),((e,t,{data:n,caseViewMode:r})=>{const{containerItemID:a}=t,s=Nu(a);if(s&&Nc(a)){const t=X(s),o={data:n,caseViewMode:r,context:t};Rh.setIn(o.data,["context_data","caseViewMode"],r),e.push({type:st,payload:{context:t}});const i=xc.getPropertiesToReplace(a);e.push(gf(Vh,o,{propertiesToReplace:i}))}})(a,t,e)},Cy=async(e,t,n,r,a,s,o,i,c)=>{const{isCaseWideAction:l,isInCreateStage:d,containerItemID:u}=e,p=W(e.context),h=Cc(a),f=Ac(a),g=d&&!h&&!l,m=Tu(p)[0],y=m?_u(m):p,I=hc(u),E=Nu(u),A=Object.freeze({target:e.target,containerItemID:u,context:E,containerName:I});g&&!my(e.context)?await Ey(i,e,t,a,s,c):yy(e.context,y)?await Iy(y,t,p,e,s,n,r,a,o):l&&!yy(e.context,y)?(hy(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=W(r),o=Nu(s);e.push(gf(Gh,{containerItemID:s,context:o,container:lu.PREVIEW,containerName:lu.PREVIEW,caseId:a,viewName:F.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(s,e,{caseClassName:f})):await Ay(t,e,a,A,s)},_y=(e,t)=>{const{assignmentID:n,actionID:r,caseID:a,context:s,additionalHeaders:o={},isCaseWideAction:i,outcome:c,jsActionQueryParams:l}=e,{state$:d}=t,u=(e=>{const{isModalAction:t,viewType:n,isInCreateStage:r,isCaseWideAction:a}=e;return t&&r&&!a?Mc.PAGE:n||Mc.FORM})(e),p=(e=>{const{isCaseWideAction:t}=e;return t?Ke:"finishAssignment"})(e),h={assignmentID:n,actionID:r,caseID:a,viewType:u};let{restApi:f}=Lf(p,h),{reqType:g}=Lf(p,h);u&&!f?.includes("viewType=")&&(f=f?.includes("?")?`${f}&viewType=${u}`:`${f}?viewType=${u}`),c&&!f?.includes("outcome")&&(f=f?.includes("?")?`${f}&outcome=${c}`:`${f}?outcome=${c}`),f=((e,t)=>(e&&Object.keys(e).forEach((n=>{t+=`&${n}=${e[n]}`})),t))(l,f),i&&(g="PATCH"),e.viewType=u;const{content:m,attachmentsExist:y}=jc(s);e.attachmentsExist=y;const I=d.value.data[s]?.caseInfo?.headers||{},{etag:E}=I,A={"if-match":E,...o};return pi(Ui(f,{method:g,body:m,headers:A},s)).pipe(Ql((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Fc({...A,...r})}})),id("Error occurred during ajax call at finishAssignment Epic : ",s))},{RESOURCE_TYPES:Sy}=F,by=(e,t)=>{let n=0,r=[],a={},s="",o={},i=!1,c=!1;return e.pipe(Xl(uy),Jl((e=>{const l=Ep.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),s=e.payload.context,zn({context:s,stateObj:gh(s),clearContextMessages:!0}),!Il(s)){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,t),Jt.handleDeferredActionCompletion(e.payload.context),rd([])}return rd(e.payload).pipe(Zl((e=>{((e,t)=>{const{containerItemID:n,context:r,actionMgrID:a,isInCreateStage:s,isModalAction:o}=t;if(s&&o){const t=hc(n),s=yt(t,r);e.push(gf(sf,{containerItemID:n,target:s,actionMgrID:a}))}})(r,e);const n={...e};return _y(n,{state$:t})})),Zl((async e=>{if(e&&e.type===Ee){(e=>{const t=e?.payload?.err?.response?.data?.displayButtonsOnErrors||[],n=e?.payload?.err?.response?.status;if(Array.isArray(t)&&t.length>0&&424===n){t.forEach((e=>{e.isErrorButton=!0}));const n=e.payload.context,r=gh(n),a=((e,t)=>(e.forEach((e=>{!0!==e.isErrorButton||t.some((t=>t.actionID===e.actionID))||(t=[...t,e])})),t))(t,r?.caseInfo?.actionButtons?.secondary||[]),s={data:{caseInfo:{actionButtons:{secondary:a}}},target:ku(n),context:n};fh({type:ge,payload:s})}})(e);const t=Wc(e);return r.push(t),r}Fd.clearContextedCache(s);const{headers:t,actionInPayload:d,response:u}=e,{containerItemID:p,context:h=Nu(p),isModalAction:f,isInCreateStage:g}=d;i=d.isCaseWideAction,c=d.isProcessAction;const m=ku(p);d.target=m;const y=hc(p),I=Object.freeze({target:d.target,containerItemID:p,context:h,containerName:y});var E;Rh.setIn(u.data,j.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),Rh.setIn(u.data,j.CASE_INFO_IS_LOCAL_ACTION,!1),u?.uiResources?.root?.config?.name&&"page"!==d.viewType&&Rh.setIn(u.data,j.CASE_INFO.VIEW_NAME,u?.uiResources?.root?.config?.name),E={submitResponse:u},mi.publish(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,E);let A=Mm(u,{[F.STOPMERGEACTIONS]:!u.nextAssignmentInfo});const C=Ac(A),_=W(d.context),S=Tu(_)[0]?_u(Tu(_)[0]):_,b=Cc(A),N=g&&!b;!f||g||yy(d.context,S)||(A=((e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e))(A,gh(p)));const v=Uc(A,{headers:t,actionMgrID:n,directUrlUpdation:!1});let P,T;Pc(v.data,d),v.caseClassName=C,v.resourceType=Sy.ASSIGNMENT,v.headers=t;const $=A?.data?.caseInfo?.assignments?.some((e=>e.ID===d.assignmentID)),O=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(A,d),R=((e,t,n,r,a)=>{let s;const o=ku(t);return s=Du(o)?yu(o,n.data?.caseInfo?.ID):_u(o),r&&e&&Eh(null,j.CASE_VIEW_MODE_PROP,s)===j.PERFORM_MODE&&a})($,S,A,f,O),D=d?.actionID===F.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(A?.data?.nextAssignmentInfo&&!D)v.caseViewMode=j.PERFORM_MODE,P=_c(A),T=!0;else if(R&&!D)v.caseViewMode=j.PERFORM_MODE,P=_c(A),v.flowName=" ",v.deleteAssignmentSpecificResources=!1,T=!1;else{v.caseViewMode=j.REVIEW_MODE;const e=Ru(ku(S));P=A?.confirmationNote&&A?.uiResources?.root?.config?.name===j.PY_CONFIRM&&!e?_c(A):"",T=!1}const x=_c(A);vc(v,A,{skipFlowNameUpdate:v?.caseViewMode===j.REVIEW_MODE||R});const w=wf("createWork",{caseClassName:C}).replace(/{.+?}/,String(Ec(x)));if(A.semanticURL=w,v.semanticURL=w,f?(await Cy(d,v,T,P,A,r,e,u,o),N&&(a=(e=>{if(!fy(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{}})(d))):g&&l&&!b?(Ep.setDefaultCasePage("pyDetails"),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:lu.PRIMARY,targetContainerName:lu.PRIMARY,viewType:Mc.PAGE,isLastStepInCreateStage:!0,context:n},a={type:fe,payload:{...r}};t.push(a)})(u,r,W(h))):await Ay(v,d,A,I,r),Rc(e,r),Jt.handleDeferredActionCompletion(s).catch((()=>{})),((e,t,n)=>{const{isModalAction:r,isCaseWideAction:a,caseID:s}=t,o=yy(t.context,n),i=e?.data?.caseInfo?.stages||[],c=e?.data?.caseInfo?.stageID;dc({caseID:s,isModalAction:r,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:a,stages:i,stageID:c})})(v,d,S),!A?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:r,actionID:a}=t;return{isCaseWideAction:n,caseID:_c(e),assignmentID:n?null:r,actionID:n?a:null}})(A,d);(e=>{mi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)})({...e,containerItemID:p})}return((e,{isModalAction:t,target:n,transientItemID:r})=>{if(t){const t=e.find((({type:e})=>e===we));t?.payload&&(n=t.payload.target,r=t.payload.containerItemID)}const a=lf({target:n,containerItemID:r});a.payload.transientItems.length&&e.push(a)})(r,{transientItemID:p,target:m,isModalAction:f}),r})),Ql((()=>{const e=r.find((e=>e.type===Ee));var t;return e?(Jt.handleDeferredActionCompletion(s).catch((()=>{})),(e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[j.ERROR_FIELD_IN_PAGE]=e[j.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[j.ERROR_FIELD_IN_PAGE].slice(1),r=e[j.ERROR_IN_PAGE_IDENTIFIER],a=r.startsWith(".")?r.slice(1):r;if(a){let s=t?`caseInfo.content.${t}`:"caseInfo.content";s=s.replace(/\(/g,"[").replace(/\)/g,"]");const o=Wn(a,s,j.PROPERTY),i={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};Tn.mutateField(n,s,o[o.length-1],{messages:[i],type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:r})}}))})(e),un.rejectActionByID(n)):un.resolveActionByID(n,a),o?.caseId&&(t=o,mi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,t)),tl(r),(i||c)&&(e=>{mi.publish(j.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0}),r=[],a={},o={},r})))})))},Ny="CANCEL_ASSIGNMENT",vy=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}=Lf(i,{ID:a,caseID:a,viewType:Mc.PAGE});return $i.getPreviewMode()&&(t[j.SKIPCOREHEADERS]=!0),pi(Ui(c,{method:l,headers:t},s,{includeRemoteSystemIdIfPresent:!!o})).pipe(Ql((t=>r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:Fc(t.headers)})),id(": Error occurred during ajax call at release lock request : ",s))},Py=(e,t)=>{const{isModalAction:n}=t;return vy({routeKey:"cancelAssignment",isModalAction:n,...e})},Ty=e=>{let t=0,n=[];return e.pipe(Xl(Ny),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>{const{isModalAction:n}=e;e.context||(e.context=Nu(e.containerItemID));const{context:r}=e,a=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?lu.MODAL:hc(n)})(e),s=yt(a,r),{continueExecution:o}=zc(s);return o?(e.RemoteSystemID=V.getRemoteHeaderByContext(e.context)??void 0,Py(e,{isModalAction:n})):(un.rejectActionByID(t),od())})),Zl((async e=>{if(e&&e.type===Ee)return n.push(Wc(e)),n;const{actionInPayload:r,response:a}=e,{containerItemID:s,isModalAction:o,isInCreateStage:i}=r,c=ku(s),l=Nu(s),d={target:o?`${j.APP.APP}/${j.MODAL}`:c,containerItemID:s,caseViewMode:o?j.PERFORM_MODE:j.REVIEW_MODE,context:l,actionMgrID:t,key:_c(a),skipReleaseLockRequest:!1};return i&&n.push(gf(tf,d)),!o&&Nc(s)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:r,referencedUsers:a}=t,s=W(n),o={context:Nu(s),data:{referencedUsers:a,context_data:{caseViewMode:r}}};o.data={...t.response.data,...o.data},e.push(gf(Vh,o))})(n,{childContainerItemID:s,caseViewMode:j.REVIEW_MODE,referencedUsers:a?.data.referencedUsers,response:a}),d.skipReleaseLockRequest=!0,n.push(gf(cf,d)),n})),Ql((()=>(fh(n),Tc(n,t),n=[],n))))},$y="NAVIGATE_TO_STEP",Oy=(e,t)=>{const{ID:n,stepID:r,containerItemID:a,context:s=Nu(a),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:o?Mc.PAGE:Mc.FORM},{restApi:l,reqType:d}=Lf("navigateToStep",c),{content:u}=jc(s),p=i.value.data[s].caseInfo.headers;return pi(Ui(`${l}`,{method:d,body:u,headers:{"if-match":p&&p.etag}},s)).pipe(Ql((t=>({response:t.data,actionInPayload:e,headers:Fc({...p,...t.headers})}))),id("Error occurred during ajax call at navigateToStep Epic : ",s))},{RESOURCE_TYPES:Ry}=F,Dy=(e,t)=>{let n=0,r=[];return e.pipe(Xl($y),Jl((e=>(({actionMgrID:n}=e.payload),rd(e.payload).pipe(Zl((e=>(Zn(e.context),Oy(e,{state$:t})))),Zl((async e=>{if(e&&mc(e.type))return r.push(Wc(e)),r;const{actionInPayload:t,response:n,headers:a}=e,{containerItemID:s,context:o=Nu(s),isModalAction:i}=t;Fd.clearContextedCache(t.context);const c=ku(s),l=hc(s),d=Object.freeze({target:c,containerItemID:s,context:o,containerName:l}),u=n?.data?.caseInfo?.content,p=n?.uiResources?.root?.config?.name,h=n?.uiResources?.root?.config?.context;u&&!u.pyViewName&&p&&"page"!==t.viewType&&(Rh.setIn(u,"pyViewName",p),Rh.setIn(u,"pyViewContext",h));const f=Mm(n),g={acName:c,...d};await kc(f,t,g);const m=Uc(f,{...d,headers:a});n?.nextAssignmentInfo||(m.caseViewMode=j.REVIEW_MODE),Rc(e,r),m.doDeleteCaseSummary=t.doDeleteCaseSummary,m.resourceType=Ry.ASSIGNMENT,vc(m,f),Pc(m.data,t);const y=f.data?.caseInfo?.stages,I=f.data?.caseInfo?.stageID;return dc({caseID:_c(f),isModalAction:i,stages:y,stageID:I}),Nc(s)&&el(m,r),r.push(gf(tf,m)),Qc(r),r})),Ql((()=>(fh(r),Tc(r,n),r=[],r))))))))},xy=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:a}=Lf("deleteCaseInCreateStage",{ID:t});return pi(Ui(r,{method:a},n)).pipe(Ql((t=>({response:t.data,actionInPayload:e,headers:Fc(t.headers)}))),id(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},wy=e=>{mi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},My=(e,t)=>{let n,r=0,a=[];return e.pipe(Xl(Wl),Ql((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),Zl((e=>e.ignoreCaseDeletion?rd({actionInPayload:e}):xy(e))),Zl((async e=>{if(e&&mc(e.type)){const{payload:t}=e,n=Wc({...e,...t,actionMgrID:r});return a.push(n),a}const{actionInPayload:n}=e,{context:s,isModalAction:o}=n,i=o?lu.MODAL:lu.PRIMARY,c=yt(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 kc({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:j.PRIMARY,isChild:!0},t={type:de,payload:{...e}};a.push(t)}const l={target:c,containerItemID:s,context:s,caseDeleted:!0};return a.push(gf(cf,l)),a})),Ql((()=>(fh(a),Tc(a,r)===j.PROMISE_VALUE.RESOLVE&&wy({caseType:n}),a=[],a))))},Ly=(e,t)=>{const{assignmentID:n,actionID:r,context:a}=e,{restApi:s,reqType:o}=Lf("save",{assignmentID:n,actionID:r}),{content:i}=jc(a),c=t.value.data[a]?.caseInfo?.headers;return pi(Ui(s,{method:o,body:i,headers:{"if-match":c&&c.etag}},a)).pipe(Ql((t=>({response:t.data,actionInPayload:e,headers:Fc(t.headers)}))),id(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",a))},Fy=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:a}=e;let s=[];return rd(n.payload).pipe(Zl((e=>Ly(e,r))),Zl((e=>{if(e&&mc(e.type))return rd(e);const{containerItemID:t}=e&&e.actionInPayload,r=W(t),a=ku(r),o=uu(a),i=Tu(r)[0];let c=i?_u(Tu(r)[0]):r;if(!Ru(ku(c))){const t=uu(i);t?.accessedOrder.forEach((n=>{e.actionInPayload.caseID===t.items[n].key&&(c=t.items[n].context)}))}const l=_u(a);n.payload.canUpdateAvailableActions&&wm(e.response);if(c&&s.push(gf(Vh,{context:c,data:{caseInfo:{headers:e.headers}}})),o?.items?.[l]?.key===e?.actionInPayload?.caseID){const n={context:r,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},a=xc.getPropertiesToReplace(t);s.push(gf(Vh,n,{propertiesToReplace:a})),s.push(gf(tf,{context:t}))}return Rc(e,s),e.actionInPayload.RemoteSystemID=V.getRemoteHeaderByContext(e.actionInPayload.context)??void 0,vy(e.actionInPayload)})),Zl((async n=>{if(n&&mc(n.type)){const{payload:t}=n,r=Wc({...n,...t,actionMgrID:a});s.push(r);const o=e.action.payload.modalLoadingContainer;if(o){const e=o.context,{context_data:t}=gh(e)||{};t?.isLoading&&Vu(e)}return s}const{actionInPayload:r}=n,{context:o,containerName:i}=r,c={target:yt(i,o),containerItemID:o,context:o};return t||s.push(gf(cf,c)),s})),Ql((()=>(fh(s),Tc(s,a),t||(s=[]),s))))},jy=(e,t)=>{let n,r=0;return e.pipe(Xl(Hl),Jl((e=>{const{saveOnly:a}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return Fy({action:e,state$:t,actionMgrID:r,caseType:n},a)})))},Uy=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",mi.unsubscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,r="expressLocalActionSubmit",mi.subscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,r)}var n,r},{LOCAL_ACTION_TYPE:ky}=j,{RESOURCE_TYPES:Vy}=F,By=(e,t)=>{const{actionID:n,assignmentID:r,caseID:a,context:s,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,d=l?Ye:(e=>{const t=e.localActionType.toLowerCase();return t===ky.CASE_WIDE||t===ky.EXPRESS?Ke:qe})(e),u=Mc.FORM,{reqType:p}=Lf(d,{caseID:a,ID:r,actionID:n,viewType:u});let{restApi:h}=Lf(d,{caseID:a,ID:r,actionID:n,viewType:u});e.actionType=d===Ke?j.CASE:j.ASSIGNMENT,h&&!h.includes("viewType=")&&(h=h.includes("?")?`${h}&viewType=${u}`:`${h}?viewType=${u}`);const f=i?.context??s;return pi(Ui(h,{method:p,headers:c},f)).pipe(Ql((t=>({response:t.data,actionInPayload:e,headers:Fc(t.headers)}))),id(`: Error occurred during ajax call at ${o} Epic : `,f))},Gy=(e,t)=>{const{isProcessAction:n}=t,r=n?Ye:qe;e.openActionType=r;let a;if("modal"===pc(r,e)){a=Tu(e.contextName)[0]?Tu(e.contextName):ku(e.contextName);const n=a?_u(a):e.contextName,r=Nu(n),s=pc(e.openActionType,e),o=yt(s,e.context),i=z(e.context,H(s,e.context));if(fh(zh({target:o,context:i,containerItemID:i,key:e.caseID,caseViewMode:j.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:j.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}}})),fh(nf({context:i})),e.modalLoadingContainer={target:o,context:i},!Tu(e.contextName)[0])return By(e,t);if(!e.continueExecution)return By(e,t);if(!Ll(r))return By(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return pi([ql(e.saveActionPayload)]).pipe(Zl((e=>(e=>{let t,n=0;const r=[],a={value:hh()?.getState()};return rd(e).pipe(Xl(Hl),Jl((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!s){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,e),rd([])}return Fy({action:e,state$:a,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),Zl((n=>{if(1===n.length&&mc(n[0].type)){const{continueExecution:n}=zc(a);if(!n)return un.rejectActionByID(e.actionMgrID),sd.pipe(hi((()=>od()))).toPromise();if(n)return By(e,t)}return By(e,t)})),Ql((e=>e)))}return By(e,t)},Wy=async(e,t,{headers:n,actionInPayload:r})=>{const{context:a,actionName:s,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=Mm(e),d=pc(o,r),u=c?.target??yt(d,a);let p,h,f=!1;!xu(u)||Du(u)&&!mu(u,e.data.caseInfo.ID)?(h=H(d,a),gc(d)&&(h=z(a,h)),p=h,f=!0):(p=Du(u)?yu(u,e.data.caseInfo.ID):_u(u),h=Nu(p));const g={acName:u,target:u,containerName:d,context:h};await kc(l,r,g),(void 0===l?.data?.caseInfo?.content||void 0!==l.data.caseInfo.content&&"object"==typeof l.data.caseInfo.content&&0===Object.keys(l.data.caseInfo.content).length)&&delete l.data?.caseMessages;const m=l.uiResources?.root;let y;y=m?j.PERFORM_MODE:j.REVIEW_MODE;const I=Uc(l,{target:u,context:h,containerItemID:p,caseViewMode:y,doDeleteCaseSummary:i,headers:n,actionName:s,isMinimizable:!1,isInCreateStage:gc(d),resourceType:Vy.ASSIGNMENT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,assignmentID:r.assignmentID,actionType:r.actionType});m&&vc(I,l),gc(d)&&delete I.doDeleteCaseSummary,r.openActionType===ze&&(I.isBulkAction=!0,I.data.caseInfo.actionButtons.main[0].jsAction="async"===r.runningMode?"submitBulkActionAsync":"submitBulkAction",I.data.caseInfo.actionButtons.secondary[0].jsAction="cancelBulkAction",I.data.caseInfo.cases=r.selectedList);const E=f?zh:tf;if(I.data.context_data.isProcessAction=r.isProcessAction,t.push(gf(E,I)),f||t.push(gf(rf,I)),f){const a=Tu(r.contextName),s=yu(a,e.data.caseInfo.ID);if(s){const e={data:{caseInfo:{headers:n}},context:s};t.push(gf(Vh,e))}}return p!==_u(u)&&t.push(gf(sf,{target:u,containerItemID:p})),Nc(p)&&!c?.context&&el(I,t),I.caseViewMode===j.REVIEW_MODE&&t.push(gf(cf,I)),t},Hy="OPEN_LOCAL_ACTION",qy=(e,t)=>Gy(e,t),Yy=e=>{let t=0,n=[];return e.pipe(Xl(Hy),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>qy(e,{actionMgrID:t}))),Zl((async e=>{if(!e)return sd;if(mc(e.type)){const t=Wc(e);n.push(t);const{context_data:r}=gh(e.payload.context)||{};return r?.isLoading&&n.push(gf(rf,e.payload)),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:s}=t;return Rh.setIn(a,"data.caseInfo.activeActionID",s),Rh.setIn(a.data,j.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&Rh.setIn(a.data,j.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await Wy(a,n,{headers:r,actionInPayload:t}),Uy(t),n})),Ql((()=>(fh(n),Tc(n,t),n=[],n))))},Ky=e=>{const{actionID:t,context:n,openActionType:r,caseTypeID:a,bulkContextID:s="",bulkContextType:o=""}=e,i=ze,{reqType:c,restApi:l}=Lf(i,{caseTypeID:a,actionID:t,bulkContextID:s,bulkContextType:o});return pi(Ui(l,{method:c},n)).pipe(Ql((t=>({response:t.data,actionInPayload:e,headers:Fc(t.headers)}))),id(`: Error occurred during ajax call at ${r} Epic : `,n))},zy=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",mi.unsubscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,r="bulkActionSubmit",mi.subscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n,r)}var n,r},Xy="OPEN_BULK_ACTION",Jy=e=>{let t=0,n=[];return e.pipe(Xl(Xy),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=ze;const a=pc(ze,e),s=yt(a,n),{continueExecution:o}=zc(s);return o?Ky(e):(un.rejectActionByID(r),od())})(e,{actionMgrID:t}))),Zl((async e=>{if(e&&mc(e.type)){const t=Wc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:s}=t;return Rh.setIn(a,"data.caseInfo.activeActionID",s),await Wy(a,n,{headers:r,actionInPayload:t}),zy(t),n})),Ql((()=>(1===n.length&&mc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),fh(n),n=[],n))))};var Qy=Array.isArray,Zy=Object.getPrototypeOf,eI=Object.prototype,tI=Object.keys;function nI(e){if(1===e.length){var t=e[0];if(Qy(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&Zy(r)===eI){var n=tI(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var rI=Array.isArray;function aI(e){return Ql((function(t){return function(e,t){return rI(t)?e.apply(void 0,go([],fo(t))):e(t)}(e,t)}))}function sI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Ao(td(e))?e.pop():void 0}(e),r=nI(e),a=r.args,s=r.keys,o=new Yo((function(e){var t=a.length;if(t)for(var n=new Array(t),r=t,o=t,i=function(t){var i=!1;ni(a[t]).subscribe(oi(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(aI(n)):o}const oI=e=>{const{actionID:t,context:n,cases:r,classID:a}=e,{content:s}=jc(n,{nonEmptyAndChangedData:!0});let o=5;try{const e=ic.getSharedState("D_pySingleExecutionBulkActionsMeta.D_pySingleExecutionBulkActionsMeta.pxResults");e?.find((e=>e.pyClassName===a))?.pyList.split(",").includes(t)&&(o=1)}catch(e){console.error('Failed to fetch to "D_pySingleExecutionBulkActionsMeta" DP response',e)}const i=r.map((e=>({ID:e}))),c=i.length/o,l=Xe,{reqType:d,restApi:u}=Lf(l,{actionID:t}),p=[],h=i.length;for(let t=0;t<h;t+=c)s.cases=i.slice(t,t+c),s.cases.length&&p.push(pi(Ui(u,{method:d,body:s},n)).pipe(Ql((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Fc({...r})}})),id("Error occurred during ajax call at submitbulkaction Epic : ",n)));return sI(p)},iI=e=>{mi.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},cI="SUBMIT_BULK_ACTION",lI=e=>{let t,n=0,r=[],a="";return e.pipe(Xl(cI),Jl((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,e),rd([])}return rd(e.payload).pipe(Zl((e=>(t=e,oI(t)))),Zl((e=>{let n=0,s=0;const o=[],{containerItemID:i,context:c}=t;return e.map((e=>{const{response:t}=e;n+=Number(t.successCount),s+=Number(t.failureCount),s&&t.results.map((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`,iI({submitResponse:e}),t.target="HYBRID"===Ep.getRenderingMode()?ku(i):`${j.APP.APP}/${lu.MODAL}`,r.push(gf(cf,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),s&&r.push(gf(of,{messages:[{type:"error",message:1===s?"1 record failed to update":`${s} records failed to update`,errorDetails:o,showHeader:!1}],context:W(c)||c,category:"HTTP",showHeader:!1})),r})),Ql((()=>(un.resolveActionByID(n,a),fh(r),r=[],r))))})))},dI=e=>{const{actionID:t,context:n,cases:r}=e,{content:a}=jc(n,{nonEmptyAndChangedData:!0});a.cases=r.map((e=>({ID:e})));const s=Xe,{reqType:o,restApi:i}=Lf(s,{actionID:t,runningMode:"async"});return pi(Ui(i,{method:o,body:a},n)).pipe(Ql((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Fc({...r})}})),id("Error occurred during ajax call at submitbulkaction Epic : ",n))},uI=e=>{mi.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},pI="SUBMIT_BULK_ACTION_ASYNC",hI=e=>{let t,n=0,r=[],a="";return e.pipe(Xl(pI),Jl((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,e),rd([])}return rd(e.payload).pipe(Jl((e=>(t=e,dI(t)))),Ql((e=>{const n=[],{containerItemID:s,context:o}=t,{response:i}=e,c=Number(i.failureCount)||0;return c>0&&i.results.forEach((({status:e,error:t,BusinessID:r})=>{"200"!==e&&t&&t.errorDetails&&t.errorDetails.forEach((({localizedValue:e})=>{n.push({ID:r,message:e})}))})),a="Processing bulk actions",uI({submitResponse:i}),t.target=`${j.APP.APP}/${lu.MODAL}`,r.push(gf(cf,{containerItemID:s,context:o,target:t.target,skipReleaseLockRequest:!0})),c&&r.push(gf(of,{messages:[{type:"error",message:1===c?"1 record failed to update":`${c} records failed to update`,errorDetails:n,showHeader:!1}],context:W(o)||o,category:"HTTP",showHeader:!1})),r})),Ql((()=>(un.resolveActionByID(n,a),fh(r),r=[],r))))})))},fI=(e,t)=>Gy(e,t),gI=e=>{let t=0,n=[];return e.pipe(Xl(Bl),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>(Zn(e.context),fI(e,{actionMgrID:t,isProcessAction:!0})))),Zl((async e=>{if(e&&mc(e.type)){const t=Wc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:a}=e;return await Wy(a,n,{headers:r,actionInPayload:t}),n})),Ql((()=>(tl(n),Tc(n,t),n=[],n))))},mI=e=>{let t=0,n=[];return e.pipe(Xl(Se,we),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>{const{containerItemID:t,caseID:n,context:r,caseDeleted:a,skipReleaseLockRequest:s,currentCaseViewMode:o,isProcessAction:i,isInCreateStage:c}=e,l=o===j.PERFORM_MODE,d=n&&l;return i&&c?vy(e):t!==r||a||s||!d?t?.includes(j.MODAL)&&Dc(ip(t))===j.REVIEW_MODE?vy(e):rd([]):vy(e)})),Zl((e=>(e&&mc(e.type)&&n.push(Wc(e)),n))),Ql((()=>(fh(n),Tc(n,t),n=[],n))))};var yI=new ug(ig),II=yI;function EI(e,t,n){void 0===e&&(e=0),void 0===n&&(n=II);var r=-1;return null!=t&&(ed(t)?n=t:r=t),new Yo((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 AI(e,t){return void 0===e&&(e=0),void 0===t&&(t=yI),e<0&&(e=0),EI(e,e,t)}function CI(e){return si((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(oi(n,(function(t){null==s||s.unsubscribe(),r=!0,a=t,s=oi(n,o,Ro),ni(e(t)).subscribe(s)}),(function(){o(),n.complete()}),void 0,(function(){a=s=null})))}))}const _I=(e,t,n,r,a)=>{if(a!==j.RESOURCE_STATUS.CREATE)return;ol.isStateMachineExist(e,t,n)||ol.setStateMachine(e,n,t,new lr(n,t,e));ol.getStateMachine(e,t,n).insert({},r+1,!0,{isDefault:!0})},SI=e=>{const{context:t}=e;let n={...jc(t).content,contextData:!1};const r=rl(t);Rh.isEmpty(r)||(n=nl(r,n));const{restApi:a,reqType:s}=Lf("refreshCaseView",e);return n.interestPage=e.interestPage,pi(Ui(a,{method:s,body:n},t)).pipe(Ql((t=>({actionInPayload:e,response:t.data,headers:Fc(t.headers)}))),id(": Error occurred during ajax call : ",t))},bI=e=>{let t=0,n=[],r="";return e.pipe(Xl(ht),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>SI(e))),Zl((async e=>{if(e&&e.type===Ee)return n.push(Wc(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:a}=e,s=t.containerName,o=yt(s,t.context);let i=qc(o,s,t.context);i=z(t.context,i);const c=Mm(a);c.key=t.ID,c.data?.caseInfo&&(c.data.caseInfo.ID=t.ID);const l={isMultiRecordData:!0,viewName:t.viewID,parentContext:t.context,interestPage:t.interestPage};c.uiResources.context_data.modalView=l;const d=gh(t.context)?.context_data?.caseInfo,u=`${t.pageReference}${t.targetProperty}`,p=Hn(d,u.replace(j.CASE_INFO.CASE_INFO_CONTENT,"").slice(1),t.index);c.uiResources.context_data.caseInfo={...c.uiResources.context_data.caseInfo,content:Rh.mergeDeep(c.uiResources.context_data.caseInfo?.content,p?.content)};const h=Mh.getProperty(".RemoteSystemID",j.CASE_INFO.HEADERS,t.context),f={acName:o,context:i};await kc(c,t,f);const g={target:o,context:i,containerItemID:i};h&&(g.headers={RemoteSystemID:h});const m=Uc(c,g);m.resourceStatus=t.actionType,m.isMultiRecordData=!0,m.parentContext=t.context,m.heading=t.heading;const y=Hc(o,m);return r=i,n.push(y),Qc(n),{actionsOut:n,actionInPayload:t}})),Ql((({actionInPayload:e})=>(yc(n)?un.rejectActionByID(t):un.resolveActionByID(t),e.skipPageInstructions||_I(r,e.pageReference,e.targetProperty,e.index,e.actionType),fh(n),n=[],n))))},NI=e=>{let t,n="",r=[];return e.pipe(Xl(ft),Jl((e=>{t=e.payload;const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,t),Jt.handleDeferredActionCompletion(e.payload.context),rd([])}return rd(e.payload).pipe(Zl((e=>(t=e,SI(t)))),Zl((async e=>{if(e&&e.type===Ee){const t=Wc(e);return r.push(t),r}const{containerItemID:n,context:a}=t;var s,o,i,c;return s=a,o=t.parentContext,i=F.CASE_INFO.CASE_INFO_CONTENT,c=!1,yr(s).forEach((e=>{const t=Rh.convertClipboardPageToPageRefNotation(e.target);ol.isStateMachineExist(o,i,t)||ol.setStateMachine(o,t,i,new lr(t,i,o));const n=ol.getStateMachine(o,i,t);switch(e.instruction.toLowerCase()){case"insert":n.insert(e.content,e.listIndex,c,{});break;case"update":n.update(e.content,e.listIndex,c,{});break;case"delete":e.listIndex?n.delete(e.listIndex,c):n.deletePage();break;case"replace":n.replacePage(e.content);break;case"move":n.move(e.listIndex,e.listMoveToIndex);break;case"delete all":n.deleteAll()}})),r.push(gf(cf,{containerItemID:n,context:a,target:t.target,skipReleaseLockRequest:!0})),r})),Ql((()=>{if(yc(r))un.rejectActionByID(n),Jt.handleDeferredActionCompletion(t.context);else{un.resolveActionByID(n),Jt.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload;if(Mh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext)){const e=Mh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,r,t.parentContext),n=Mh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,r,t.parentContext),a=t.pageReference?.substring(0,t.pageReference?.lastIndexOf(".")),s=a.replace(j.CASE_INFO.CASE_INFO_CONTENT,"");xn(e,n,t.parentContext,s,{})}else Fn(t.parentContext,j.CASE_INFO.CASE_INFO_CONTENT,{})}return fh(r),r=[],r})))})))},vI=e=>{const{caseID:t,headers:n,debugInfo:r,context:a}=e,s=Lf("getDescendants",{caseID:t}),{restApi:o}=s,{reqType:i}=s;return pi(Ui(o,{method:i,headers:{...n,...r&&{...Oi.addDebugHeaders(r)}}},a)).pipe(Ql((t=>({actionInPayload:e,response:t.data,headers:Fc({...n,...t.headers})}))),id("Error ocurred during ajax call at getDescendants Epic : ",a))},PI=e=>{let t=0,n=[];return e.pipe(Xl(Ud),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>vI(e))),Zl((async e=>{if(e&&mc(e.type))return n.push(Wc(e)),n;const{actionInPayload:t,response:r}=e,a={};Rh.setIn(a,"caseInfo.childCases",r?.childCases??[]);const s={data:a,context:t?.context};return n.push(gf(Vh,s)),n})),Ql((()=>(fh(n),Tc(n,t),n=[],n))))},TI=[Jm,sy,dy,Yy,Jy,lI,hI,gI,by,Dy,Ty,mI,jy,My,e=>e.pipe(Xl(He),CI((()=>AI(100))),Ql((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:r,isProcessAction:a,isDataObject:s,skipReleaseLockRequest:o,isInCreateStage:i}=e.payload;return un.resolveActionByID(t),mi.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:r,hideDelete:!a&&n,isDataObject:s,skipReleaseLockRequest:o,isInCreateStage:i}),[]}))),e=>e.pipe(Xl(Me),CI((()=>AI(100))),Ql((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:a}=e.payload,s=yt(r,n);return un.resolveActionByID(t),fh(gf(sf,{containerItemID:a,target:s,doDeleteCaseSummary:!1})),[]}))),bI,NI,PI];function $I(){return si((function(e,t){e.subscribe(oi(t,Ro))}))}const{RESOURCE_TYPES:OI}=F,RI=[e=>e.pipe(Xl(te),Ql((e=>e.payload)),Zl((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===lu.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=yt(lu.PREVIEW,e.context),n=qc(t,lu.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);fh(zh({...e,context:n,target:t,containerItemID:n,key:r,caseViewMode:j.REVIEW_MODE,root:{type:"reference",config:{context:j.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(V.isRemoteCase(t.caseClassName)){const{RemoteSystemID:e}=V.getRemoteCase(t.caseClassName);n.RemoteSystemID=e}let{restApi:r,reqType:a}=Lf("loadView",t);return e.viewContext===OI.PAGE&&({restApi:r,reqType:a}=Lf(je,{page:e.viewName,pageClass:e.pageClass})),pi(Ui(r,{method:a,headers:n},e.context)).pipe(Ql((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:Fc(t.headers),rootView:Rh.getIn(r,j.ROOT)}})),id(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),Zl((async e=>{const t={};if(e?.type===Ee){if(t.actionsOut=Wc(e),e?.payload?.context?.includes(lu.PREVIEW)){const n={...gh(e.payload.context),caseInfo:{progress:!1,error:!0}},r=yt(lu.PREVIEW,e.payload.context);t.actionsOut=gf(tf,{key:n.key,target:r,containerName:lu.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||lc.getTargetViewContainerName(je),s=r?.target??yt(a,e.context);return{target:s,context:r?.context??(t===lu.PREVIEW&&n?e.context:qc(s,a,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let d={};d=Mm(r),d.directUrlUpdation=!1,await kc(d,n,l);const u={...n,target:i,context:c,containerItemID:s||c,headers:a},p=Uc(d,u);if(p.resourceType=OI.CASE,o&&!p.updateData){p.caseViewMode=j.REVIEW_MODE;const e=ku(p?.context);((e,t,n,r,a)=>{e&&a===lu.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,r.actionsOut=gf(tf,{...n,containerName:a})):e?(r.actionsOut=[],r.actionsOut.push(gf(sf,{target:t,containerItemID:e}))):r.actionsOut=gf(zh,{...n,containerName:a})})(yu(e,p.key),e,p,t,o)}else p.preserveClientChanges=!0,t.actionsOut=[],o===lu.PREVIEW&&t.actionsOut.push({type:st,payload:{context:c}}),((e,t)=>{if(e.key){const n=ku(e?.context);yu(n,e.key)&&t?.actionsOut?.push(gf(Vh,e))}else t?.actionsOut?.push(gf(Vh,e))})(p,t)}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:r,viewName:a}=e.actionConfig;return"pyCasePreview"===a&&(e=>{mi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:r}),t})),Ql((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(un.resolveActionByID(n,e),t)))),e=>{let t=0,n=[];return e.pipe(Xl(ne),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>{mi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:r,viewName:a,className:s,skipSemanticUrl:o=!1,containerName:i=lc.getTargetViewContainerName(je)}=e,c=n&&{...Oi.addDebugHeaders(n)},l=yt(i,r);let d="",u={},p=!0;if(!o){if(d=wf(je,{page:a,pageClass:s}),l&&d){const{activate:t,activateContainerActionPayload:n}=Jc(OI.PAGE,l,{semanticURL:d});if(t)return(e=>{e?.containerItemID&&ic.updateState(e.containerItemID,"traditionalGadgetId",xc.getUniqueGadgetId(),{skipDirtyValidation:!0})})(n),rd({type:Re,activateContainerActionPayload:n,actionConfig:e})}if(_u(l)&&({continueExecution:p,removeActionPayload:u}=zc(l)),!p)return un.rejectActionByID(t),od()}const{restApi:h,reqType:f}=Lf(je,{page:a,pageClass:s});return pi(Ui(h,{method:f,headers:c},r)).pipe(Ql((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:d,semanticURL:d},actionConfig:e,headers:Fc(t.headers),removeActionPayload:u,skipSemanticUrl:o}})),id(": Error ocurred during ajax call at showPage Epic : ",e.context))})),Zl((async e=>{if(e&&e.type===Ee)return n.push(Wc(e)),n;let{type:t}=e;const{actionConfig:r,skipSemanticUrl:a}=e,s=r.containerName||lc.getTargetViewContainerName(ne),o=yt(s,r.context);mi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className});const{remoteCasePayload:i,updatedType:c}=((e,t,n,r)=>{let a={},s=e;if(n.isTraditionalRemoteCase){a={...n};const e=yu(r,a.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},s=Re)}return{remoteCasePayload:a,updatedType:s}})(t,e,r,o);if(t=c??t,t===Re){const{activateContainerActionPayload:{semanticURL:t,containerItemID:a}}=e,s={acName:o,context:Nu(a)};r.isTraditionalRemoteCase||await kc({directUrlUpdation:!0,semanticURL:t},r,s,!0),n.push(gf(sf,{target:o,containerItemID:a}))}else{const t=qc(o,s,r.context),{response:c,headers:l={},removeActionPayload:d}=e,u=Mm(c,{isCreateDataObject:r.isCreateDataObject});u.directUrlUpdation=!a;const p={acName:o,context:t},h=Dc(t);await kc(u,r,p);const f={target:o,context:t,containerItemID:t,headers:l,debugInfo:r.debugInfo,currentCaseViewMode:h},g=Uc(u,f);g.resourceType=F.PAGE,r.isCreateDataObject&&(g.resourceType=F.RESOURCE_TYPES.DATA,g.resourceStatus=F.RESOURCE_STATUS.CREATE,delete g.data.caseInfo),((e,t,n)=>{e.isTraditionalRemoteCase&&(n.resourceType=F.CASE,n.key=xc.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:Ec(xc.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=!0,n.className=t.className)})(r,i,g),g.data??={},g.data.traditionalGadgetId=xc.getUniqueGadgetId();const m=Hc(o,g);d.containerItemID&&Yc(m)&&n.push(gf(cf,{containerItemID:d.containerItemID,target:o})),n.push(m),Qc(n)}return mi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:o,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),n})),Ql((()=>{un.resolveActionByID(t),fh(n),n=[]})),$I())}];const DI=(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}=Lf(Ue,{pageName:r,dataContext:a,dataContextParameters:s}),h={};return h.RemoteSystemID=c,pi(Ui(d,{method:u,headers:h,body:p},n)).pipe(Ql((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:Fc(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),id("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:xI}=F,wI=e=>{const{dataViewName:t,context:n,dataViewParameters:r}=e,a={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(r))},{restApi:s,reqType:o}=Lf("deleteDataObject",a);return pi(Ui(s,{method:o},n)).pipe(Ql((t=>({response:t.data,actionInPayload:e}))),id("Error occurred during ajax call at deleteDataObject Epic",n))},MI=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,a={data_view_ID:t},{restApi:s,reqType:o}=Lf("getDataObjectActions",a);return pi(Ui(s,{method:o,body:{dataViewParameters:n}},r)).pipe(Ql((e=>({...e.data}))),id("Error occurred during ajax call at GET data object actions : ",e.context))},LI=[e=>{let t,n=0,r=[];return e.pipe(Xl(re),(a=e=>(({actionMgrID:n}=e.payload),rd(e.payload).pipe(Zl((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=yt(d,n);let h="",f={},g=!1;if(!o){h=wf(Ue,{pageName:r,dataViewName:a},s);const{activate:n,activateContainerActionPayload:o}=Jc(xI.PAGE,p,{semanticURL:h});if(n)return rd({type:Re,activateContainerActionPayload:o,actionConfig:e});if(({continueExecution:g,removeActionPayload:f}=zc(p)),!g)return un.rejectActionByID(t),od()}return DI({context:n,pageName:r,dataContext:a,dataContextParameters:s,semanticURL:h,skipSemanticUrl:o,containerName:d,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:u},{removeActionPayload:f})})(e,n))),Zl((async e=>{if(e&&e.type===Ee)return r.push(Wc(e)),r;const{type:n,actionConfig:a,headers:s,response:o,skipSemanticUrl:i}=e;t=Rh.getIn(o,j.ROOT);const{containerName:c,parentAction:l,resourceType:d}=a,u=yt(c,a.context);let p;const h=Dc(a?.context);if(a.isDeferLoaded){p=Mm(o),p.directUrlUpdation=!i;const t={acName:u,context:a.context};await kc(p,a,t);const n={target:u,headers:s,context:a.context,containerItemID:e.containerItemID},c=Uc(p,n);return r=gf(Vh,c),r}if(n===Re){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,s={acName:u,context:Nu(n)};await kc({directUrlUpdation:!0,semanticURL:t},a,s,!0),r.push(gf(sf,{target:u,containerItemID:n,resourceType:xI.DATA}))}else if("DATA"===d&&l===pt){const{context:e}=a,t=o?.data,n={context:e,data:t};r.push(gf(Vh,n))}else{const t=qc(u,c,a.context),{removeActionPayload:n}=e;p=Mm(o),p.directUrlUpdation=!i;const l={acName:u,context:t};await kc(p,a,l);const d=Uc(p,{target:u,context:t,containerItemID:t,headers:s,currentCaseViewMode:h});d.resourceType=xI.DATA;const f=Hc(u,d);n.containerItemID&&Yc(f)&&r.push(gf(cf,{containerItemID:n.containerItemID,target:u})),Qc(r),r.push(f)}return r})),Ql((()=>(un.resolveActionByID(n,t),fh(r),r=[],r))))),Ao(s)?Zl(a,s,1):Zl(a,1)));var a,s},e=>{let t=0,n=[];return e.pipe(Xl(it),cd(100),Jl((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(t,!0,e),rd([])}return rd(e.payload).pipe(Zl((e=>ld(e))),Zl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,a=Wc({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r}=e,{containerItemID:a,isModalAction:s}=r,o=s?lu.MODAL:lu.PRIMARY,i={target:yt(o,a),containerItemID:a,context:a};return n.push(gf(cf,i)),n})),Ql((()=>(1===n.length&&mc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),fh(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(Xl(lt),cd(100),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>dd(e))),Zl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,a=Wc({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:s={}}=e,{containerName:o}=r,i=yt(o,r.context),c=qc(i,o,r.context),l={acName:i,context:c};await kc(a,r,l);const d=Uc(a,{target:i,context:c,containerItemID:c,headers:s});return d.resourceType=F.RESOURCE_TYPES.DATA,d.resourceStatus=F.RESOURCE_STATUS.UPDATE,d.key=JSON.stringify(r.requestPayload),n.push(gf(zh,d)),n})),Ql((()=>(1===n.length&&mc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),fh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Xl(dt),cd(100),Jl((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(t,!0,e),rd([])}return rd(e.payload).pipe(Zl((e=>ud(e))),Zl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,a=Wc({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r}=e,{containerItemID:a,isModalAction:s}=r,o=s?lu.MODAL:lu.PRIMARY,i={target:yt(o,a),containerItemID:a,context:a};return n.push(gf(cf,i)),n})),Ql((()=>(1===n.length&&mc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),fh(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(Xl(ct),cd(100),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>wI(e))),Zl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,a=Wc({...e,...r,actionMgrID:t});return n.push(a),n}return[]})),Ql((()=>(1===n.length&&mc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),fh(n),n=[],n))))},e=>{let t=0,n=[];let r={};return e.pipe(Xl(ye),cd(100),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>MI(e))),Zl((async e=>e&&e.type===Ee?(n.push(Wc(e)),n):(r=e,[]))),Ql((()=>(1===n.length&&mc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t,r),fh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Xl(ut),cd(100),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>pd(e))),Zl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,a=Wc({...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=yt(o,r.context);let u=H(o,c);u=z(c,u);const p={target:d,context:u,containerItemID:u,headers:s,resourceType:F.RESOURCE_TYPES.DATA,resourceStatus:F.RESOURCE_STATUS.OPEN_FLOW_ACTION,key:JSON.stringify(r.dataViewParameters),actionID:i,actionName:l},h={acName:d,context:c};await kc(a,r,h);const f=Uc(a,p);return n.push(gf(zh,f)),n})),Ql((()=>(1===n.length&&mc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),fh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Xl(pt),cd(100),Jl((e=>{const{isFormValid:r}=e.payload;({actionMgrID:t}=e.payload);const a=e.payload.context;if(!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(t,!0,e),rd([])}return zn({context:a,stateObj:gh(a),clearContextMessages:!0}),rd(e.payload).pipe(Zl((e=>hd(e))),Zl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,a=Wc({...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=yt(o,r.context),u={acName:d,context:r.context};await kc(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=Uc(n,t);i.resourceType=a||F.RESOURCE_TYPES.DATA;const c=X(o);e.push(gf(cf,i));const l=Ih(".dataContext","dataInfo",c),d=Ih(".dataContextParameters","dataInfo",c),u={context:c,skipSemanticUrl:!0,resourceType:a,parentAction:pt,dataContext:l,dataContextParameters:d},p=l&&d&&wf(Ue,{pageName:j.PY_DETAILS,dataViewName:l},d)||"";if(o?.includes(j.PREVIEW)){const t={type:re,payload:{pageName:j.VIEW_NAMES.PY_DATA_PREVIEW,container:j.PREVIEW,containerName:j.PREVIEW,...u}};e.push(t)}else if(a!==j.PAGE&&s===p&&o?.includes(j.PRIMARY)){const t={type:re,payload:{pageName:j.VIEW_NAMES.PY_DETAILS,containerName:"",...u}};e.push(t)}return e})(n,p,a,{key:l,resourceType:c,containerItemID:i}),n})),Ql((()=>(1===n.length&&mc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),fh(n),n=[],n))))})))}];function FI(e,t){return void 0===t&&(t=yI),si((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(oi(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:jI,DATA:UI}}=F;let kI=[],VI=!1;const BI={},GI=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return xm.apply(void 0,e.map((function(e){var n=e.apply(void 0,t);if(!n)throw new TypeError('combineEpics: one of the provided Epics "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})))};try{Object.defineProperty(n,"name",{value:"combineEpics("+e.map((function(e){return e.name||"<anonymous>"})).join(", ")+")"})}catch(e){}return n}(...km,...TI,...RI,...[e=>e.pipe(Xl(Ie),FI(200),Ql((e=>e.payload)),Zl((e=>{VI=!1,mi.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{VI=!0}));const t=$i.getPreviewMode()&&Oi.addDebugHeaders({debugId:Rh.generateUniqueID()});BI.dataContext=e.payload.dataViewName,BI.dataContextParameters=e.payload.dataViewKeys;const{context:n,requestType:r,routeKey:a}=e;let{routeEndpoint:s}=e;s=s&&s.indexOf("viewType={viewType}")>0?s.replace("{viewType}","page"):s&&s.indexOf('viewType=""')>0?s.replace('viewType=""','viewType="page"'):s;const o=E()+s,i=e.options.context;let c;const l={},d=e?.payload?.caseClassName;if(V.isRemoteCase(d)){const{RemoteSystemID:e}=V.getRemoteCase(d);l.RemoteSystemID=e}if("POST"===r){c=e.payload,s.indexOf("viewType=")<0&&(s=`${s}?viewType=page`);let i;switch(Zc(a)){case jI:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case UI:i=BI;break;default:i=c}return pi(Ui(o,{method:r,body:i,headers:{...l,...t}},n)).pipe(Ql((t=>({response:{...t.data},payload:e,headers:Fc(t.headers)}))),id(": Error occurred during ajax call at historyEpic : ",e))}return pi(Ui(o,{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Ql((n=>({response:n.data,payload:e,headers:{...Fc(n.headers),...t}}))),ad((r=>{if(a===Je){const n={messages:[{type:"error",message:r.response.data.errorDetails[0].localizedValue}],category:"PAGE"};ac.setComponentCache("assignments-launchAssignment-Error",n);const a=Sf(gp()),s=Ip.getEndPointInfo(a.split("/assignments")[0]),o=E()+s.routeEndpoint;return e={...e,routeKey:Be,resetSemanticURL:!0},pi(Ui(o,{method:s.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Ql((n=>({response:n.data,headers:{...Fc(n.headers),...t},payload:e}))))}return rd(mf(": Error occurred during ajax call at historyEpic : ",r,n))})))})),Zl((async e=>{if(VI)return kI;if(mi.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{VI=!0})),e&&e.type===Ee)return Wc(e);const{headers:t={},response:n,payload:r}=e,a=Mm(n,{[F.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),s=r.options.acName,o=Ru(s)&&xu(s)?_u(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[j.COREHEADER_APP_DEBUG_ID]}};let l="";const d=r?.payload?.page;let u=r?.payload?.pageClass;r.payload&&r.payload.caseName&&r.payload.workID&&(l=wf(Be,{caseName:e.payload.payload.caseName}),l=l&&l.replace("{workID}",e.payload.payload.workID)||"",u=r?.payload?.caseClassName),(r?.routeKey===Je||r?.resetSemanticURL)&&(e=>{const t=_c(e);let n=wf(Be,{caseClassName:Ac(e)},{id:t});n=n?.replace("{workID}",String(Ec(t))).replace("{id}",String(Ec(t))),Gf({semanticURL:n,directUrlUpdation:!0,options:{}})})(a),((e,t)=>{const n=t?.data?.caseInfo;e===Je&&n?.caseTypeID&&n?.content&&$c(n.caseTypeID)&&(n.content.coexistenceAction=Ge)})(r?.routeKey,a),mi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:d,pageClass:u});const p=Rh.getIn(a,j.LOCALE_REFERENCES);await _p.loadLocaleResources(p);const h=Rh.getIn(a,j.COMPONENTS);h&&await Ur(h),wr(a,r.options.actionConfig,!0),mi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:s,pageName:d,pageClass:u});let f=Uc(a,c);return f=((e,t,n)=>{if(e===wc.CASE||e===wc.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=Bc(t.caseInfo.assignments[0].ID);n.key=e||t.caseInfo.ID,n.flowName=r}else n.flowName="",n.key=t?.caseInfo?.ID||t.semanticURL;n.resourceType=e,n.semanticURL=t.semanticURL,e===wc.ASSIGNMENT?(n.caseViewMode=j.PERFORM_MODE,n.resourceType=wc.CASE):n.caseViewMode=j.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(Zc(e.payload.routeKey),{...n.data,semanticURL:l,caseViewMode:j.REVIEW_MODE},f),kI.push(Hc(s,f)),((e,t)=>{let n=ac.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(gf(of,n)),ac.resetComponentCache("assignments-launchAssignment-Error"))})(o,kI),Qc(kI),kI})),Ql((()=>(VI||fh(kI),kI=[],VI=!1,kI))),id("Error occurred"))],...LI,...Vm,...[e=>{let t=0;return e.pipe(Xl(et),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Ql((()=>{const e=hh()?.getState(),n=Rm();return h()(e,n)&&t>0?un.resolveActionByID(t,{}):un.rejectActionByID(t),[]})),$I())}],...[e=>{let t=0,n=[];return e.pipe(Xl(ae),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:r}=e;let a,s="";n||(s=wf(ke,{insightID:"{insightID}"}),s=s.replace("{insightID}",r),a=Ip.getEndPointInfo(s));const{restApi:o,reqType:i}=Lf(ke,{...a?.payload||[],insightID:r});return pi(Ui(o,{method:i},t)).pipe(Ql((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}})),id(": Error occurred during ajax call at showPage Epic : ",e.context))})),Zl((async e=>{if(e&&e.type===Ee)return n.push(Wc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,a=lc.getTargetViewContainerName(ne),s=yt(a,t.context),o=qc(s,a,t.context),{response:i}=e,c=Mm(i);c.directUrlUpdation=!r;const l={acName:s,context:o},d=!r,u=r;await kc(c,t,l,d,u);const p=Uc(c,{target:s,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Hc(s,p);return n.push(h),Qc(n),n})),Ql((()=>{un.resolveActionByID(t),fh(n),n=[]})),$I())}],...[e=>{let t=0,n=[];return e.pipe(Xl(se),Ql((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:r}=e;let a="";n||(a=wf(Ve,{dashboardID:r}),a=a.replace("{dashboardID}",r));const{restApi:s,reqType:o}=Lf(Ve,{dashboardID:r});return pi(Ui(s,{method:o},t)).pipe(Ql((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}})),id(": Error occurred during ajax call at showPage Epic : ",e.context))})),Zl((async e=>{if(e&&e.type===Ee)return n.push(Wc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,a=lc.getTargetViewContainerName(ne),s=yt(a,t.context),o=qc(s,a,t.context),{response:i}=e,c=Mm(i);c.directUrlUpdation=!r;const l={acName:s,context:o},d=!r,u=r;await kc(c,t,l,d,u);const p=Uc(c,{target:s,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Hc(s,p);return n.push(h)})),Ql((()=>{un.resolveActionByID(t),fh(n),n=[]})),$I())}]),WI=()=>e=>t=>{const{type:n="",payload:r={}}=t||{},{category:a,context:s,transientItemID:o}=r;"HTTP"!==a&&[_e,De,Se,we,Ne,Oe].includes(n)&&(ll(s||o),Tn.removeContextTreeNode(s||o)),e(t)},HI={},qI=e=>{const t=Rh.getIn(HI,[j.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),a=Rh.getIn(HI,[r,t],[]),s=a&&a.length>0&&a.indexOf(e);if(s>-1&&a.splice(s,1),!a||a&&0===a.length){Rh.deleteIn(HI,[r,t]);const e=Rh.getIn(HI,[r]);e&&0===Object.keys(e).length&&Rh.deleteIn(HI,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),Rh.deleteIn(HI,[j.CONTEXT,e]);const r=Rh.getIn(HI,[j.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&Rh.deleteIn(HI,[j.CONTEXT]),n.length>0&&fh(If({dataPagesToBeRemoved:n}))},YI=(e={},t)=>{Object.keys(e).forEach((n=>{const r=Rh.getIn(e,[n],{});Object.keys(r).forEach((e=>{((e,t,n)=>{const r=Rh.getIn(HI,[j.CONTEXT,n]);if(Rh.getIn(HI,[e])){const r=Rh.getIn(HI,[e,t],[]);Rh.setIn(HI,[e,t],[...new Set([...r,n])])}else Rh.setIn(HI,[e,t],[n]);r?Rh.setIn(HI,[j.CONTEXT,n],[...new Set([...r,t])]):Rh.setIn(HI,[j.CONTEXT,n],[t])})(n,e,t)}))}))},KI=()=>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===we||e===Se)&&t.forEach((e=>{qI(e)}))})(a,r),a===_e||a===ge||a===nt){const e=a===nt?t:t.shared;YI(e,n)}else a===we?(qI(n),YI(t.shared,n)):a===Se&&qI(n)})),e(t)},zI=e=>t=>n=>{const{type:r,payload:{target:a,containerItemID:s,context:o,childContainersContexts:i=[],containerInfo:{newAccessedOrder:c,containerType:l}={},eventName:d}={}}=n,{PUB_SUB_EVENTS:u}=F;if(r===Se){const{resourceType:t,key:n,context:r}=Rh.getIn(e.getState(),["containers",a,"items",s])||{},o={resourceType:t,key:n,context:r,containerItemID:s,...void 0!==d?{eventName:d}:{}};mi.publish(u.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,o),a===`${F.APP.APP}/${j.PRIMARY}`&&l===j.CONTAINER_TYPE.MULTIPLE&&mi.publish(u.CONTAINER_EVENTS.CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM,{key:n,newAccessedOrder:c})}i&&i.length>0&&(r===we||r===Se)&&i.forEach((e=>{jd.cleanCaches(e)})),r!==we&&r!==Se||jd.cleanCaches(o),t(n)},XI=()=>e=>t=>{const{payload:{context:n=null,transientItemID:r=null}={},type:a}=t;!n||a!==_e&&a!==De&&a!==we&&a!==Se||(Er(n),mr(n)),r&&a===Te&&(Er(r),mr(r)),e(t)},JI=function(e){void 0===e&&(e={});var t,n=new(0,pg.constructor)(pg.schedulerActionCtor),r=new fg,a=function(a){t=a;var s=new fg,o=new fg,i=s.asObservable().pipe(ci(n)),c=new yg(o.pipe(ci(n)),t.getState());return r.pipe(Ql((function(t){var n=t(i,c,e.dependencies);if(!n)throw new TypeError('Your root Epic "'+(t.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})),Zl((function(e){return pi(e).pipe(li(n),ci(n))}))).subscribe(t.dispatch),function(e){return function(n){var r=e(n);return o.next(t.getState()),s.next(n),r}}};return a.run=function(e){r.next(e)},a}(),QI=e=>{const t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||ag;if(null!==hh())Th();else{const n=ng(Dm(e),t(Ig.reduxBatch,function(...e){return t=>(n,r)=>{const a=t(n,r);let s=()=>{throw new Error(Jf(15))};const o={getState:a.getState,dispatch:(e,...t)=>s(e,...t)},i=e.map((e=>e(o)));return s=ag(...i)(a.dispatch),{...a,dispatch:s}}}(Ul,WI,KI,XI,JI,zI),Ig.reduxBatch));JI.run(GI),ph(n)}},ZI={publishConstellationLoadedEvent:()=>{mi.publish(j.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const eE=new class{activateContainerItemOnSwitch(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:yu(t,e)};au({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:yu(t,e)};au({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=au({meta:{type:"PreviewViewContainer",config:{name:j.PREVIEW}},options:{context:j.APP.APP,target:"root/hybrid_preview"}}),r=n.getPConnect().getContainerManager();r.resetContainers({name:j.PRIMARY,context:j.APP.APP}),Au(j.APP.APP,j.PREVIEW)||r.initializeContainers({type:"multiple",name:j.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){au({}).getPConnect().getContainerManager().resetContainers({name:j.PREVIEW,context:j.APP.APP})}isFormDirty(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n=ap(t,e);return sl.isStateModified(n)}getEventUtils(){return ZI}getBroadcastUtils(){return Gm}isTraditionalUICase(e){return $c(e)}};const tE=class{static openCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?Ep.setDefaultCasePage(n.pageName):(Ep.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Ep.disableAssignmentHeader(n.disableAssignmentHeader):Ep.disableAssignmentHeader(!1),Kd.openCase(e,t,j.PRIMARY,n)}static createCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?Ep.setDefaultCasePage(n.pageName):(Ep.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Ep.disableAssignmentHeader(n.disableAssignmentHeader):Ep.disableAssignmentHeader(!1),Kd.createCase(e,t,j.PRIMARY,n)}static getNextWork(e=F.APP.APP,t={}){return t.renderInline=!0,t.pageName?Ep.setDefaultCasePage(t.pageName):(Ep.setDefaultCasePage(j.PY_DETAILS),t.pageName=j.PY_DETAILS),t?.disableAssignmentHeader?Ep.disableAssignmentHeader(t.disableAssignmentHeader):Ep.disableAssignmentHeader(!1),Kd.getNextWork(e,j.PRIMARY,t)}static openAssignment(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?Ep.setDefaultCasePage(n.pageName):(Ep.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Ep.disableAssignmentHeader(n.disableAssignmentHeader):Ep.disableAssignmentHeader(!1),Kd.openAssignment(e,t,j.PRIMARY,n)}static openPage(e,t,n=F.APP.APP,r={}){const a=ne;r?.defaultCasePage?Ep.setDefaultCasePage(r.defaultCasePage):Ep.setDefaultCasePage(j.PY_DETAILS),r?.disableAssignmentHeader?Ep.disableAssignmentHeader(r.disableAssignmentHeader):Ep.disableAssignmentHeader(!1);const s={viewName:e,className:t,acTargetName:j.PRIMARY,actionMgrID:un.getNextActionMgrId(),context:n},{promise:o}=un.actionManagerPromise(a,s.actionMgrID);return fh({type:a,payload:{...s}}),o}static getCurrentContextAPI(e,t=F.APP.APP){return au({meta:{config:{}},options:{context:t,pageReference:e,containerName:j.PRIMARY}}).getPConnect()}};const nE=new class{createC11nEnv=e=>au(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>Zt;getStateManager=()=>l;getActionCreators=()=>d;getStreamObservable=()=>a;getActionProcessor=()=>Fh;getActionHandler=()=>Lh;renderApp=(e,t)=>{const n={context:j.APP.APP},r={...Rh.getIn(e,j.ROOT),options:n};QI(e),wr(e,n,!0);const a=this.createC11nEnv({meta:r,isRoot:!0});mi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:a,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const r=Mm(e),{data:a,uiResources:s={}}=e,o=Rh.getIn(s,j.CONTEXT_DATA);await kc(r,{},{},!1,!0);const i={...a,[j.CONTEXT_DATA]:o},{root:c}=s;Bu(c,t,i,n)};fetchEndPointResource=(e,t,n)=>{Ui(e,{method:"GET"},j.APP.ROOT).then((async e=>{const{data:r,status:a}=e;200===a&&this.updateStoreWithUiRoot(r,t,n)}))};loadComponent=async(e,t,n)=>Ur(n).then((()=>{const n=this.createC11nEnv({meta:e,isRoot:!0});hh()||QI({}),mi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:n,domContainerID:t})}));setStaticServerUrl=(e,t,n)=>{Lr.initServer(e,t,n)};loadView=async(e,t,n=[])=>{y();const r=Mm(e),a=Rh.getIn(r,j.VIEWS),s=Rh.getIn(r,j.NAVIGATIONS),o=Rh.getIn(r,j.COMPONENTS)||[];o.push(...n);const i=Rh.getIn(r,j.STATIC_SERVER_URL),c=Rh.getIn(r,j.APPLICATION_DATA);a&&Gp(a),s&&Wp(s),(e=>{e&&(Of=e.pyLabel)})(c),i&&Lr.initServer(i),await Ur(o,i).then((()=>this.renderApp(r,t)))};initAppShell=(e,t,n)=>{zf(e),lc.buildActionTargetMap(t),y(n)};initRoutingTable=(e,t)=>{zf(e,!0),y(t)};setAppAlias=e=>{Lr.setAppAlias(e)};getHomeRestApi=e=>{const{restApi:t}=Mf("home",{portalName:e});return E()+t};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(Yf()&&!t){const t=fp(),r=Ip.processUrl(t,!0),a=Ip._getMatchedRouteInRoutingTable(r)||"",s=Ip.getRoutingInfo(),o=Ip.processUrl(t,!1).split("/"),i=o[o.length-1];let{caseID:c}=s&&s.routes[a].payload;c=c.replace("{workID}",i),n=Ip.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=Ip.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return E()+n};loadRootComponent=async(e,t,n=[],r,a,s)=>{const{config:{name:o}={}}=t;hh()||QI({}),s&&(Qu(`${j.APP.ROOT}/${o}`),Ju().deleteContainerItem(`${j.APP.ROOT}/${o}`)),Ju().getContainerItems()?.length>1&&!o?.startsWith("hybrid_")&&"authoring-preview"!==o&&Th(),fh(Vh({data:{},context:j.APP.ROOT}));const i=this.createC11nEnv({meta:t,options:{context:j.APP.ROOT,pageReference:"",target:`${j.APP.ROOT}/${o}`}}),c=i.getPConnect(),l=c.getContextName(),d=c.getContainerName(),u=c.getContainerManager();_u(`${l}/${d}`)||"noPortal"===t.config?.renderingMode||u.initializeContainers({type:"single"});const p=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference",...n];return Ur(p).then((()=>{mi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:i,domContainerID:e,componentName:"RootContainer",portalTarget:r,styleSheetTarget:a})}))};loadViewByName=(e,t,n,r)=>{let a=this.getViewRestApi(e,n);a===E()&&(a=this.getHomeRestApi(t)),this.fetchEndPointResource(a,r)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{Kf(e)};checkIfSemanticURL=()=>Yf();onPCoreReady=e=>{mi.subscribe(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{mi.subscribe(F.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{Or.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{C(e)};setFetchDefaultHeaders=e=>{Wi(e)};setFetchAuthInfo=e=>{Hi(e)};getCaseApi=()=>Kd;getMashupApi=()=>tE;enableAppRouting=e=>{Df(e)};initStore=()=>QI({});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()))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=au({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}}}};const rE=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 aE=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.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=void 0===e.dynamicLoadComponents||e.dynamicLoadComponents,this.dynamicSemanticUrl=void 0===e.dynamicSemanticUrl||e.dynamicSemanticUrl,this.enableRouting=void 0===e.enableRouting||e.enableRouting,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 rE(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false"}},sE=async()=>{const e=Ep.getLocale(),t=Ep.getFeatureMap().localizationVersion||1;let n;if("en-US"!==e)try{let r;2===t?r=[e]:(r=[_p.GENERIC_BUNDLE_KEY,_p.MESSAGE_BUNDLE_KEY,_p.FIELD_LABELS_BUNDLE_KEY,..._p.getCaseTypeLocaleReferences()],n=await _p.isCurrentLocalePackAvailable());const a=r.map((async r=>{2===t?await(async e=>{const t=Ep.getFeatureMap().availableLanguagePacks||[];if(!e||!t.includes(e))return void console.warn(`current locale ${e} is not supported by application.`);const n={locale:e},r=await Ji("getLocalizationPack",{queryPayload:n});if((201===r.status||200===r.status)&&r.data){const e=r.data;Object.keys(e).forEach((t=>{_p.setLocaleForRule(e[t],t)}))}})(r):n&&await(async(e,t)=>{const n=await Lr.getSvcLocale(t,`${e}.json`);if(n?.ok&&e){const t=await n.json();_p.setLocaleForRule(t,e)}})(r,e)}));await Promise.allSettled(a)}catch(e){console.warn(e)}},oE="@P .viewConfig";let iE=0;const cE=new class{#g(e,t,n){zf(e),lc.buildActionTargetMap(t),y(n)}init(e){const t=new aE(e),n={...t.environmentInfo,renderingMode:t.renderingMode};Df(t.enableRouting),QI({}),Ep.setTheme(t.theme),Ep.setCookieComplianceMethod(t.cookieComplianceMethod),Ep.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),Or.updateFieldDefaults(t.fieldDefaults),Oi.setDefaultHeaders(t.additionalHeaders),this.#g(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl}),Lr.setAppAlias(t.serviceConfig.appAliasWithoutServlet||t.serviceConfig.appAlias),C(t.serviceConfig.googleMapKey),Lr.initServer(t.serviceConfig.staticContentServer,t.serviceConfig.appStaticContentServer,t.tokens.C11NB2S),_p.setTimezone(t.timezone),Ep.setEnvironmentInfo(n),Ep.setLocale(t.locale),V.setRemoteCaseMapping(t.remoteCaseMapping),bd.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),ac.init(),t.initBroadcast&&eE.getBroadcastUtils().init()}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()))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=au({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 nE.getComponentsRegistry().getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{await function(e,t="true"){return new Promise(((n,r)=>{const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("src",e),a.setAttribute("async",t),a.onload=n(),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);let o=!1;"true"===n&&(o=!0);let i=null,c=null,l=null;if(e){e.startsWith("/")&&(e=e.substring(1));const t=e.split("/");i=t[0],t.length>1&&t[1]&&(c=t[1]),t.length>1&&"assignments"===t[2]&&t[3]&&(l=t[3])}else o=!1;let d=r;i&&(d=`${d}/${i}`),c&&(d=`${d}/${c}`),l&&(d=`${d}/assignments/${l}`),o&&(s.has("noPortal")||s.append("noPortal","true"),c&&a&&s.append("view",a));const u=s.toString();return d+=u?`?${u}`:"",d};initCoreConfig=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:f}=e,{appAlias:g,contextPath:m}=n;let y=window.location.origin;const I={};if(void 0!==l&&(y=l),m&&(y=`${y}${m}`),g&&"LAUNCHPAD"!==h&&(y=`${y}/${g}`),e.restServerConfig=y,!0===u){const e=this.buildSemanticUrl(r,a,s,y,i);!o&&e&&window.history.pushState({},"home",e)}else if("HYBRID"!==p){let e=window.location.href;e.indexOf("?")>0&&(e=e.substring(0,e.indexOf("?")),window.history.pushState({},"home",e)),I.dynamicSemanticUrl=!1}else console.log(`renderingMode :${p}`);!0!==d&&(I.dynamicLoadComponents=!1);let E=null;if(g){const e=g.indexOf("/app/");E=e>=0?g.substring(e+1):g}if(Object.keys(I).length>0&&window.PCore.setBehaviorOverrides(I),e.appAlias=E,c){let t="object"==typeof c?c:null;if(null===t)try{t=JSON.parse(c)}catch{t={}}e.theme=t}const A={...t,domain:`${window.location.protocol}//${window.location.host}`,searchParams:window.location.search};e.routingInfo=A,e.initBroadcast="true"===Ep.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),f?.cspNonce&&(window.__webpack_nonce__=f.cspNonce),this.init(e)};launchViewByName=(e,t,n,r,a,s,o,i)=>{iE+=1;const c=i||`mashup${iE}`,l={type:"RootContainer",config:{viewConfig:oE,renderingMode:"view",name:c}};nE.loadRootComponent(e,l,a,s,o).then((()=>nE.loadViewByName(t,n,r,c)))};launchView=(e,t,n=[],r,a,s,o)=>{iE+=1;const i="hybrid"===o?`hybrid_${iE}`:o;iE+=1;const c=i||`mashup${iE}`,l={type:"RootContainer",config:{viewConfig:oE,renderingMode:"portal",name:c}};o===j.HYBRID&&kd.setRuntimeParam(j.HYBRID_ROOT_CONTAINERNAME,c),kd.setRuntimeParams(r),nE.loadRootComponent(e,l,n,a,s).then((()=>nE.updateStoreWithUiRoot(t,c)))};launchPortal=(e,t,n,r=[])=>{iE+=1;const a=n||`portal${iE}`,s={type:"RootContainer",config:{viewConfig:oE,renderingMode:"portal",skeleton:"LoadingComponent",name:a}};r.push(s.config.skeleton),Ep.isPortalLoaded=!0,nE.loadRootComponent(e,s,r).then((()=>nE.loadPortalView(t,a)))};launchMashup=(e,t=!0)=>{const r={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfoAnnotation:"@ROUTING_INFO",name:"primary"}}]};if(t){const t=document.getElementsByTagName(e)[0]?.parentNode;if(t){const e=document.createElement("style");e.setAttribute("id","portal-less-styles"),e.innerHTML="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",t.appendChild(e)}}nE.loadRootComponent(e,r,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),window.parent!==window&&n(754)(`${window.PCore.getAssetLoader().getStaticServerUrl()}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))};start=async(e,t)=>{const{appStaticContentServer:n}=e.serviceConfig,{ccV2LibId:r,environmentId:a,isAlternateDesignSystemEnabled:s,alternateDesignSystemName:o}=e;this.initCoreConfig(e);const i=async()=>(await this.importReactRoot(),r&&await Lr.importCustomComponentMap(r),"true"===s&&"other"!==o&&await this.importDesignSystemComponentMap(n,a,o),t&&t(),!0);return new Promise(((e,t)=>{sE().then((async()=>{const t=nE.getComponentsRegistry();"ReactRoot"in t.getLazyMap()?e(!0):t.getComponent("ReactRoot")?e(await i()):mi.subscribe("component-map-loaded",(async()=>{e(await i())}))})).catch((e=>{t(e)}))}))};registerForDebugInfo=e=>{PCore.getEnvironmentInfo().setPreviewMode(),e&&PCore.getPubSubUtils().subscribe("fetchSuccess",(({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];e.postMessage({appDebugID:n})}),"fetchSuccess")};toggleTracerHeaders=e=>{e.addEventListener("message",(async e=>{const t=e?.data?.enableTracer;t?PCore.getDebugger().enableTracer():PCore.getDebugger().disableTracer()}))};loadEnvironmentInfo=async e=>{if(e.theme&&(!window.pms||"Android"!==window.pms.device.systemName))try{const t=JSON.parse(e.theme.definition);PCore.getEnvironmentInfo().setBrandingInfo(t.Branding),PCore.getEnvironmentInfo().setTheme(t.Theme)}catch{PCore.getEnvironmentInfo().setBrandingInfo({}),PCore.getEnvironmentInfo().setTheme({})}e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),PCore.getEnvironmentInfo().setCookieComplianceMethod(e.cookieComplianceMethod??"none")}},lE={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=Lf("createViewRuleByID");return Ui(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=Lf("getViewRuleByID",{ID:e});return Ui(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:a}=Lf("updateViewRuleByID",{ID:e});return Ui(r,{method:a,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=Lf("deleteViewRuleByID",{ID:e});return Ui(n,{method:r},t).then((e=>e.data))}},dE={"Content-Type":"application/json"},uE={addCaseFollower:(e,t,n)=>{const r={caseID:e},a=JSON.stringify({users:t.map((e=>({ID:e})))});return Ji("addCaseFollower",{body:a,queryPayload:r,headers:dE},n)},deleteCaseFollower:(e,t,n)=>Ji("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>Ji("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},pE={addRelatedCases:(e,t,n)=>{const r={caseID:e},a=JSON.stringify({cases:t});return Ji("addRelatedCases",{body:a,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>Ji("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>Ji("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},hE="operatorDetails",fE={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=Lf(hE,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return Ji(hE,{queryPayload:t})}return t?Ji("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):Ji(hE,{body:{dataViewParameters:{ID:e}}})}},gE=async e=>{const t=Mm(e),n=Rh.getIn(t,j.COMPONENTS);wr(t,{},!0);const r=Rh.getIn(t,j.LOCALE_REFERENCES);await _p.loadLocaleResources(r||[]),await Ur(n)},mE=(e,t,n)=>Mh.resolveView(e,t,n),yE={"Content-Type":"application/json"};const IE=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,a,s,o)=>{const{getLocaleValue:i}=_p;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: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=ec();return a.push(u),Ji("getFeedMessages",{queryPayload:d,cancelTokenSource:u},s.getContextName()).then((async e=>{if(200===e.status&&e.data){a.pop();const t=[],n={};let c=!1;if(e?.data){if(e?.data?.data?.FeedList){const r=e.data.data.FeedList?.pxResults;Array.isArray(r)&&r?.length>0&&r.forEach(((e,r)=>{e.ID=""!==e.pzInsKey?e.pzInsKey:`message${r}`,t.push(e.ID),n[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)})),c||"pzPostDetails"===e.pyMessageViewReference||"pzPrivatePostDetails"===e.pyMessageViewReference||(c=!0)}))}if(c&&await gE({uiResources:e.data.uiResources}),!r&&(r=[{id:"All",label:i("All","Pulse"),on:!0,disabled:!1}],e?.data?.data?.FeedFilters)){const t=e.data.data.FeedFilters?.pxResults;let n=!0;t&&Array.isArray(t)&&t?.length>0&&(t.forEach((e=>{const t={id:e.pyFeedSourceReference,label:i(e.pyLabel,"Pulse"),disabled:!1,on:"true"===e.pySelected};t.on||(n=!1),r.push(t)})),r.find((e=>"All"===e.id)).on=n)}}if(o&&s.getValue("pulse.messageIDs")){let r=s.getValue("pulse.messageIDs"),a=s.getValue("pulse.messages");r=[...r,...t],a={...a,...n},Object.values(a).forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions)}))})),s.updateState({pulse:{messages:a,messageIDs:r,nextPageFirstEntry:e?.data?.nextPageFirstEntry||"",pageLastEntry:e?.data?.pageLastEntry||"",hideAttachment:e?.data?.hideAttachment||!1}})}else s.updateState({pulse:{messages:n,messageIDs:t,nextPageFirstEntry:e?.data?.nextPageFirstEntry||"",pageLastEntry:e?.data?.pageLastEntry||"",hideAttachment:e?.data?.hideAttachment||!1}});const l=[...new Map(this.mentions.flat()?.map((e=>[e.mentionsID,e]))).values()]?.filter((e=>Object.prototype.hasOwnProperty.call(e,"mentionsType")))?.filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))||[];return{feedFilters:r,caseMentions:l}}return s.reportError(`getFeeds call failed ${e.status}`,e.data),""})).catch((e=>{tc(e)||s.reportError(": Error occurred during ajax call at getFeeds API : ",e.response)}))};postMessage=(e,t,n=[],r=!1,a)=>{const s=JSON.stringify({context:e,parentMessageId:r?e:"",message:t,attachments:n});return Ji("postFeedMessages",{body:s,headers:yE},a.getContextName()).then((t=>{if((201===t.status||200===t.status)&&t.data){const s=t?.data;if(r){s.parentMessageID=e;const{pxResults:t,caseMentions:o}=this.buildMessageObject(s,r,a,n.length>0);return a.updateState({pulse:{messages:{[e]:{pxResults:t}}}}),o}const{messages:o,messageIDs:i,caseMentions:c}=this.buildMessageObject(s,r,a,n.length>0);return a.updateState({pulse:{messages:o,messageIDs:i}}),c}return a.reportError(`postMessage call failed with status ${t.status}`,t),""})).catch((e=>{a.reportError(": Error occurred during ajax call at postMessage API : ",e.response)}))};editMessage=({messageID:e,parentMessageID:t,message:n,c11nEnv:r,isReply:a=!1})=>{const s=JSON.stringify({message:n});return Ji("editFeedMessage",{queryPayload:{messageID:e},body:s,headers:yE},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=>{r.reportError(": Error occurred during ajax call at editMessage API : ",e.response)}))};buildMessageObject=(e,t,n,r=!1)=>{const a={ID:e?.ID||"",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||"",pyIsEdited:"string"==typeof e?.isEdited?"true"===e?.isEdited:e?.isEdited||!1,pyFeed:{pyPostedOn:e?.postedTime||"",pyFeedTitle:e?.postedByUser?.name||"",pyIconType:"user",pyCommentContext:"pzInsKey",pyIconReference:"pi pi-case"},pyContext:"",pxIcon:"globe",pyMessageViewReference:"pzPostDetails"},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.prototype.hasOwnProperty.call(e,"mentionsType")))?.filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))||[]};likeMessage=({pulseContext:e,likedBy:t,messageID:n,isReply:r,c11nEnv:a})=>{const s=t?"unlikeFeedMessages":"likeFeedMessages",o=JSON.stringify({ContextClass:e});Ji(s,{body:o,queryPayload:{pulseContext:e},headers:yE},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);Ji("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)=>Ji("getFeedMessageLikes",{queryPayload:{messageID:e}},t.getContextName()).then((e=>e?.data?.users)).catch((e=>{t.reportError(": Error occurred during ajax call at getLikedUsers API : ",e.response)}));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=ec();return this.mentionsTagsCancelTokenSource.push(i),Ji("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=>{tc(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>Ji("getMentionTypes",{},e.getContextName()).then((e=>e?.data)).catch((t=>{e.reportError(": Error occurred during ajax call at getMentionTypes API : ",t.response.data)}));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=ec();return this.mentionsTagsCancelTokenSource.push(s),Ji("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=>{tc(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},EE={getTaggedCases:(e,t)=>Ji("loadView",{queryPayload:{caseID:e,viewID:"pyTaggedCases"}},t.getContextName()).then((e=>e?.data)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)})),getTags:(e,t)=>Ji("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 Ji("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)=>Ji("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>vd.getPageDataAsync("D_pxGetTagsLandingPageURL",e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))},AE=(e,t)=>{Zu(t.getContextName(),e.etag),ep(t.getContextName(),e.etag)},CE={getParticipants:(e,t)=>Ji("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)=>Ji("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)=>Ji("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)=>Ji("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)=>{const a={caseID:e},s={...n,participantRoleID:t},o={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Ji("createParticipant",{body:s,queryPayload:a,headers:o},r.getContextName()).then((t=>{AE(t.headers,r),e()})).catch((e=>{r.reportError(": Error occurred during ajax call at createParticipant API : ",e.response),t(e.response)}))}))},updateParticipant:async(e,t,n,r)=>{const a={caseID:e,participantID:t},s={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Ji("updateParticipant",{body:n,queryPayload:a,headers:s},r.getContextName()).then((t=>{AE(t.headers,r),e()})).catch((e=>{r.reportError(": Error occurred during ajax call at updateParticipant API : ",e.response),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)=>{Ji("deleteParticipant",{queryPayload:r,headers:a},n.getContextName()).then((t=>{AE(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function _E(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const SE="create",bE="update",NE="delete";function vE(e,t,n,r){const a=Xp(t);if(a){switch(e){case SE:case bE:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(a.allPersonalizations[n]=t),e&&(a.defaultPersonalization=n);break}case NE:delete a.allPersonalizations[n],a.defaultPersonalization===n&&(a.defaultPersonalization="");break;default:return null}return a}return null}const PE={},TE=e=>{const t=Xp(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=_E(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=Lf("getUIListPersonalizations",{listID:e});return Ui(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:_E(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},$E=(e,t,n)=>{const{restApi:r,reqType:a}=Lf("createListPersonalization",{listID:e});return vE(SE,e,t,n),Ui(r,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return PE[t]=n,e}))},OE=(e,t,n)=>{const r=PE[t]||t;vE(bE,e,t,n);const{restApi:a,reqType:s}=Lf("updateListPersonalization",{listID:e,personalizationID:r})||{};return Ui(a,{method:s,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},RE=(e,t)=>{const n=PE[t]||t;vE(NE,e,t);const{restApi:r,reqType:a}=Lf("deleteListPersonalization",{listID:e,personalizationID:n});return Ui(r,{method:a,body:{}}).then((e=>(PE[t]&&delete PE[t],e)))};const DE=function(e){return e?{createPersonalization:$E.bind(null,e),updatePersonalization:OE.bind(null,e),deletePersonalization:RE.bind(null,e),fetchPersonalizations:TE.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},xE="getDataObjects",wE="getInsightByID",ME=["LocalList","RemoteList","PromptList","DataPage"];let LE=null;const FE={},jE=e=>md.getAppCacheKey(`PrimaryFields-${e}`);function UE(e){let t;return e[1].category?t=e[1].category:e[0].indexOf(":")>0&&(t=e[0].substring(0,e[0].indexOf(":"))),t}const kE={getDataObjects:function(){const e=md.getAppCacheKey(xE);if(window.sessionStorage.getItem(e))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(e)));const{restApi:t,reqType:n}=Lf(xE,{}),r=Ui(t,{method:n});return r.then((t=>{window.sessionStorage.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(LE)return LE;const t=md.getAppCacheKey("getDataPageObjects");if(e&&window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Lf("getDataPages",{datapageRequestType:"explorable"});return LE=Ui(n,{method:r,datapageRequestType:"explorable"}),LE.then((e=>{LE=null,window.sessionStorage.setItem(t,JSON.stringify(e))})),LE},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=zp(e);if(t&&t.classID){let e=Qp(t.classID);const n=new Set(t.primaryFields),r=t.rdFields?.fields?.filter((e=>e.indexOf(".")>0));if(r&&!Rh.isEmpty(r)){const n=r.reduce(((e,n)=>{const r=Bp(n,t.classID);return e[n]=r,e}),{});e={...e,...n}}if(e&&Object.keys(e).length>0){const r=new Set(Array.isArray(t?.rdFields)?t?.rdFields:t?.rdFields?.fields),a=r.size>0||n.size>0;for(const t in e)e[t].type.startsWith("Page")||a&&!(r.size>0&&r.has(t)||n.size>0&&n.has(t))?delete e[t]:e[t]?.datasource&&ME.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={data:{...t,fields:Object.entries(n).map((e=>({...e[1],fieldID:e[0],fieldType:e[1].fieldType?e[1].fieldType:e[1].isUserReference?"User reference":void 0,category:UE(e),classID:e[1].associationClassID?e[1].associationClassID:e[1].classID})))}};return Promise.resolve(e)}}const r={dataSource:e,columns:[],parameters:{},associationFilter:n,matchPosition:"",ignoreCase:!1};return Fd.init(r).then((({dataSourceMetaData:e})=>Promise.resolve({data:e})))},getDefaultColumns:function(e){const t=md.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Lf("getListData",{dataViewName:"D_pzGetDefaultColumns"}),a=Ui(n,{method:r,body:{dataViewParameters:e}});return a.then((e=>{window.sessionStorage.setItem(t,JSON.stringify(e))})),a},getFieldsForDataSource:function(e,t,n){if(!t){const t=zp(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=md.getAppCacheKey(`RDColumns-${e}`);if(window.sessionStorage.getItem(r))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(r)));const a=md.getData("D_pxFieldsForDataSource",{dataViewParameters:{DataPageName:e}},n);return a.then((e=>{window.sessionStorage.setItem(r,JSON.stringify(e))})),a},getPrimaryFieldsForDataSource:function(e="",t=""){const n=md.getAppCacheKey(`PFColumns-${e}${t}`);if(window.sessionStorage.getItem(n))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(n)));const r=md.getData("D_pxGetInitialFieldsForDataSource",{dataViewParameters:{DataPageName:e,ClassName:t}});return r.then((e=>{window.sessionStorage.setItem(n,JSON.stringify(e))})),r},getPrimaryFieldsForInsights:async function(e,t,n){const{allClasses:r,promisesToAwait:a,classesToFetch:s,isTopLevelClassPresent:o,joinedClassesToFetch:i}=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=jE(t);window.sessionStorage.getItem(o)||(FE[t]?r.push(FE[t]):(n.push(t),t===e?a=!0:s.push(t)))})),{allClasses:o,promisesToAwait:r,classesToFetch:n,isTopLevelClassPresent:a,joinedClassesToFetch:s}}(e,n);return s.length&&a.push((async(e,t,n,r)=>{const a=md.getData("D_pxGetPrimaryFieldsForInsights",{dataViewParameters:{...t&&{topLevelClassID:t},...r&&{joinedClassIDs:r.join(",")},...n&&{topLevelDataPageID:n}}}).then((t=>{const n=t.data?.data||[],r={};e.forEach((e=>{r[e]=[]})),n.forEach((({classID:e,pyFieldName:t})=>{r[e].push(t)})),Object.entries(r).forEach((([e,t])=>{const n=jE(e);window.sessionStorage.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete FE[e]}))}));return e.forEach((e=>{FE[e]=a})),a})(s,o?e:void 0,o?t:void 0,i.length>0?i:void 0)),Promise.allSettled(a).then((()=>{const e={};return r.forEach((t=>{const n=jE(t);if(window.sessionStorage.getItem(n))try{e[t]=JSON.parse(window.sessionStorage.getItem(n))}catch{}})),{data:e}}))},getInsightIDs:function(){const{restApi:e,reqType:t}=Lf("getInsightIDs");return Ui(e,{method:t})},getInsightByID:function(e){const t=Jp(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:a}=Lf(wE,n);return Ui(r,{method:a})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=Lf(wE,t);return Ui(n,{method:r})},createInsight:function(e){const{restApi:t,reqType:n}=Lf("createInsight");return Ui(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:r,reqType:a}=Lf("updateInsight",n),s=t.UpdateDateTime;return Ui(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}=Lf("deleteInsight",t);return Ui(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=Lf("exportToExcel");return Ui(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=Lf("exportToCSV");return Ui(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:a}=Lf("scheduleInsight",n);return Ui(r,{method:a,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const r={insightID:e,scheduleID:t},{restApi:a,reqType:s}=Lf("updateScheduledInsight",r);return Ui(a,{method:s,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:a}=Lf("deleteScheduledInsight",n);return Ui(r,{method:a})},translateStrings:function(e){const{restApi:t,reqType:n}=Lf("translateStrings");return Ui(t,{method:n,body:JSON.stringify(e)})}};const VE=new class{addRoutes=e=>{return t=e,void Ip.addRoutes(t);var t}};const BE=class{static registerModule(e,t,n){n[e]=()=>t}};const GE=class{static getCaseEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.CASE_EVENTS);static getDataEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.DATA_EVENTS);static getTransientEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.EVENT_TRANSIENT_ITEMS);static getBootstrapShellEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS)},WE={getResolvedSemanticURL:(e,t,n)=>Ip.getResolvedSemanticURL(e,t,n),getActions:()=>({ACTION_OPENWORKBYHANDLE:Be,ACTION_SHOWDATA:Ue,ACTION_SHOWVIEW:je}),updateSemanticURLAndDocumentTitle:e=>Ip.updateSemanticURLAndDocumentTitle(e)};const HE=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},qE={setTokens:e=>{Hi({tokenInfo:e}),Wi(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>mi.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Ei(),getAuthInstance:e=>Ii.init(e),setAuthorizationHeader:e=>{Wi({Authorization:e}),setTimeout((()=>mi.publish("updateSession",{updateStatus:"success"})),0)}};const YE=new class{getDebouncedSubject(e){return(new fg).pipe(FI(e))}};Dr.register("email",(e=>{let t=null;return e&&!function(e){const t="[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+",n="\\x5c[\\x00-\\x7f]",r=`(${t}|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|${n})*\\x5d)`,a=`(${t}|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|${n})*\\x22)`;return new RegExp(`^${a}(\\x2e${a})*\\x40${r}(\\x2e${r})*$`).test(e)}(e)&&(t=_p.getLocaleValue("Enter a valid email address","Messages")),t})),Dr.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t=_p.getLocaleValue("Invalid number","Messages")),t})),Dr.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?_p.getLocaleValue("Cannot be blank","Messages"):null)),Dr.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=_p.getLocaleValue("Enter a valid url","Messages")),t})),setTimeout((()=>{const e=_p.getLocaleValue("Enter a valid phone number","Messages");Promise.resolve().then(n.bind(n,654)).then((({parsePhoneNumberFromString:t})=>{Dr.register("phone",(n=>{let r=null;n&&!/^\+?\d+$/.test(n)&&(r=e);const a=n?.startsWith("+");if(n&&a){const a=t(n);a?.isPossible()&&n===a?.number||(r=e)}return r}))}))}),j.PRIORITY.TRIVIAL);const KE=(e,t)=>{switch(t){case"invalid":return _p.getLocaleValue(`Incorrect ${e}`,"Messages");case"incomplete":return _p.getLocaleValue(`Incomplete ${e}`,"Messages");default:return null}};Dr.register("datetime",(e=>KE("DateTime",e))),Dr.register("date",(e=>KE("Date",e))),Dr.register("time",(e=>KE("Time",e))),Dr.register("attachment",((e,t)=>(Ih(`.attachmentsList${t.pageReference?.replace("caseInfo.content","")}${t.property}`,"context_data",t.context)||[]).some((e=>e.props?.error))?_p.getLocaleValue("Error with one or more files"):null));const zE={createConversation:(e,t,n,r=[])=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const a=ec();r.push(a);const s={assistantID:t},o=JSON.stringify({contextID:e});return Ji("createConversation",{body:o,cancelTokenSource:a,queryPayload:s},n).then((e=>(r.pop(),e)))},sendMessage:(e,t,n,r)=>{const a={assistantID:e,conversationID:t},s=JSON.stringify({request:n});return Ji("sendMessage",{body:s,queryPayload:a},r)}};const XE=class{caseTypeAccessMap=new Map;constructor(){this.caseTypeAccessMap=Ep.getCaseTypeList().reduce(((e,t)=>(e.set(t.pyWorkTypeImplementationClassName,t.hasCreateAccess??!0),e)),new Map)}hasCreateAccess(e){return this.caseTypeAccessMap.get(e)}static getInstance(){return this.instance||(this.instance=new this),this.instance}};class JE{constructor(){JE.behaviorOverrides={}}static behaviorOverrides={};getPCoreVersion=()=>"24.2.3";onPCoreReady=e=>nE.onPCoreReady(e);onPCoreCleanup=e=>nE.onPCoreCleanup(e);getComponentsRegistry=()=>nE.getComponentsRegistry();checkIfSemanticURL=()=>nE.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(Yf()){const e=Ip.processUrl(fp(),!0);return!!Ip._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>VE;getViewResources=()=>u;configureForBrowserBookmark=e=>nE.configureForBrowserBookmark(e);getStore=()=>hh();resetStore=()=>Th();getMessageManager=()=>er;getCoexistenceManager=()=>eE;getStoreValue=(e,t,n)=>Ih(e,t,n);getContainerUtils=()=>i;getAnnotationUtils=()=>Cl;getFieldUtils=()=>Bn;getFieldDefaultUtils=()=>Or;getAssetLoader=()=>Lr;getAttachmentUtils=()=>$p;getViewRuleApi=()=>lE;getFeedUtils=()=>IE;getTagUtils=()=>EE;getGenAIAssistantUtils=()=>zE;getStakeholderUtils=()=>CE;getUserApi=()=>fE;getCaseFollowerApi=()=>uE;getCaseUtils=()=>xc;getStateUtils=()=>ic;getRelatedCasesApi=()=>pE;getPersonalizationUtils=DE;getDataApi=()=>Fd;getDataApiUtils=()=>md;getAnalyticsUtils=()=>kE;getLocaleUtils=()=>_p;registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{JE.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{JE.behaviorOverrides[e]=t};getBehaviorOverrides=()=>JE.behaviorOverrides;getBehaviorOverride=e=>JE.behaviorOverrides[e];getAsynchronousUtils=()=>YE;createPConnect=e=>au(e);getPubSubUtils=()=>mi;registerComponentCreator=e=>{su(e)};getConstants=()=>Object.freeze(F);getEvents=()=>GE;getRestClient=()=>o;getMashupApi=()=>tE;getEnvironmentInfo=()=>Ep;getRuntimeParamsAPI=()=>kd;getSemanticUrlUtils=()=>WE;getRemoteCaseUtils=()=>V;getNavigationUtils=()=>ac;registerModule=(e,t)=>BE.registerModule(e,t,this);getErrorHandler=()=>HE;getFormUtils=()=>sl;getMessagingServiceManager=()=>bd;getMetadataUtils=()=>c;getDataPageUtils=()=>vd;getDataTypeUtils=()=>Yl;getCascadeManager=()=>lh;isDeepEqual=(e,t)=>h()(e,t);getAuthUtils=()=>qE;getDebugger=()=>$i;getDeferLoadManager=()=>fd;getExpressionEngine=()=>r;getActionsSequencer=()=>Jt;getRefreshManager=()=>bl;getInitialiser=()=>cE;getAllStateMachines=(e,t,n)=>t&&n?ol.getAllStateMachines(e,t,n):ol.getAllStateMachinesByContext(e);getBootstrapUtils=()=>nE;getContextTreeManager=()=>Tn;getAccessPrivilege=()=>XE.getInstance()}const QE=new JE;n.g.PCore=QE})()})();
1
+ (()=>{var e={851:(e,t,n)=>{"use strict";var r=n(681);Object.defineProperty(t,"reduxBatch",{enumerable:!0,get:function(){return r.reduxBatch}})},681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduxBatch=function(e){var t=[],n=void 0;function r(){t===n&&(t=t.slice())}function a(e){if("function"!=typeof e)throw new Error("Invalid listener, expected a function");var n=!0;return r(),t.push(e),function(){n&&(r(),t.splice(t.indexOf(e),1),n=!1)}}function o(){for(var e=t,r=0;r<e.length;++r)n=e,e[r]()}return function(){var t=e.apply(void 0,arguments),n=!1,r=!1;function s(e){return Array.isArray(e)?e.map((function(e){return s(e)})):t.dispatch(e)}return t.subscribe((function(){r?n=!0:o()})),Object.assign({},t,{dispatch:function(e){var t=r;t||(n=!1,r=!0);var a=s(e),i=n&&!t;return t||(n=!1,r=!1),i&&o(),a},subscribe:a})}}},52:(e,t,n)=>{e.exports=n(851)},631:(e,t,n)=>{var r="__lodash_hash_undefined__",a=9007199254740991,o="[object Arguments]",s="[object Function]",i="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,u=l||d||Function("return this")();function p(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var a=e.length,o=n+(r?1:-1);for(;r?o--:++o<a;)if(t(e[o],o,e))return o;return-1}(e,g,n);var r=n-1,a=e.length;for(;++r<a;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function h(e,t,n){for(var r=-1,a=e?e.length:0;++r<a;)if(n(t,e[r]))return!0;return!1}function f(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}function g(e){return e!=e}function m(e,t){return e.has(t)}var y,E=Array.prototype,I=Function.prototype,A=Object.prototype,C=u["__core-js_shared__"],_=(y=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=I.toString,b=A.hasOwnProperty,N=A.toString,v=RegExp("^"+S.call(b).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=u.Symbol,T=A.propertyIsEnumerable,O=E.splice,$=P?P.isConcatSpreadable:void 0,R=Math.max,D=G(u,"Map"),x=G(Object,"create");function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.__data__=new L;++t<n;)this.add(e[t])}function j(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!=n&&r!=r)return a;return-1}function U(e,t,n,r){var a,o=-1,s=p,i=!0,c=e.length,l=[],d=t.length;if(!c)return l;n&&(t=function(e,t){for(var n=-1,r=e?e.length:0,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}(t,(a=n,function(e){return a(e)}))),r?(s=h,i=!1):t.length>=200&&(s=m,i=!1,t=new F(t));e:for(;++o<c;){var u=e[o],f=n?n(u):u;if(u=r||0!==u?u:0,i&&f==f){for(var g=d;g--;)if(t[g]===f)continue e;l.push(u)}else s(t,f,r)||l.push(u)}return l}function k(e,t,n,r,a){var o=-1,s=e.length;for(n||(n=W),a||(a=[]);++o<s;){var i=e[o];t>0&&n(i)?t>1?k(i,t-1,n,r,a):f(a,i):r||(a[a.length]=i)}return a}function V(e){if(!Q(e)||(t=e,_&&_ in t))return!1;var t,n=J(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?v:c;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return V(n)?n:void 0}function W(e){return K(e)||function(e){return X(e)&&b.call(e,"callee")&&(!T.call(e,"callee")||N.call(e)==o)}(e)||!!($&&e&&e[$])}w.prototype.clear=function(){this.__data__=x?x(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(x){var n=t[e];return n===r?void 0:n}return b.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return x?void 0!==t[e]:b.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=x&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=j(t,e);return!(n<0)&&(n==t.length-1?t.pop():O.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=j(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return j(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=j(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(D||M),string:new w}},L.prototype.delete=function(e){return B(this,e).delete(e)},L.prototype.get=function(e){return B(this,e).get(e)},L.prototype.has=function(e){return B(this,e).has(e)},L.prototype.set=function(e,t){return B(this,e).set(e,t),this},F.prototype.add=F.prototype.push=function(e){return this.__data__.set(e,r),this},F.prototype.has=function(e){return this.__data__.has(e)};var H,q,Y=(H=function(e,t){return X(e)?U(e,k(t,1,X,!0)):[]},q=R(void 0===q?H.length-1:q,0),function(){for(var e=arguments,t=-1,n=R(e.length-q,0),r=Array(n);++t<n;)r[t]=e[q+t];t=-1;for(var a=Array(q+1);++t<q;)a[t]=e[t];return a[q]=r,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)}(H,this,a)});var K=Array.isArray;function z(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}(e.length)&&!J(e)}function X(e){return function(e){return!!e&&"object"==typeof e}(e)&&z(e)}function J(e){var t=Q(e)?N.call(e):"";return t==s||t==i}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=Y},188:(e,t,n)=>{var r="__lodash_hash_undefined__",a=1/0,o="[object Function]",s="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,d=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,g="object"==typeof self&&self&&self.Object===Object&&self,m=f||g||Function("return this")();var y,E=Array.prototype,I=Function.prototype,A=Object.prototype,C=m["__core-js_shared__"],_=(y=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=I.toString,b=A.hasOwnProperty,N=A.toString,v=RegExp("^"+S.call(b).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m.Symbol,T=E.splice,O=k(m,"Map"),$=k(Object,"create"),R=P?P.prototype:void 0,D=R?R.toString:void 0;function x(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!=n&&r!=r)return a;return-1}function F(e,t){var n;t=function(e,t){if(W(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||q(e))return!0;return l.test(e)||!c.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:W(n=t)?n:V(n);for(var r=0,a=t.length;null!=e&&r<a;)e=e[B(t[r++])];return r&&r==a?e:void 0}function j(e){if(!H(e)||(t=e,_&&_ in t))return!1;var t,n=function(e){var t=H(e)?N.call(e):"";return t==o||t==s}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?v:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function U(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function k(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return j(n)?n:void 0}x.prototype.clear=function(){this.__data__=$?$(null):{}},x.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},x.prototype.get=function(e){var t=this.__data__;if($){var n=t[e];return n===r?void 0:n}return b.call(t,e)?t[e]:void 0},x.prototype.has=function(e){var t=this.__data__;return $?void 0!==t[e]:b.call(t,e)},x.prototype.set=function(e,t){return this.__data__[e]=$&&void 0===t?r:t,this},w.prototype.clear=function(){this.__data__=[]},w.prototype.delete=function(e){var t=this.__data__,n=L(t,e);return!(n<0)&&(n==t.length-1?t.pop():T.call(t,n,1),!0)},w.prototype.get=function(e){var t=this.__data__,n=L(t,e);return n<0?void 0:t[n][1]},w.prototype.has=function(e){return L(this.__data__,e)>-1},w.prototype.set=function(e,t){var n=this.__data__,r=L(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},M.prototype.clear=function(){this.__data__={hash:new x,map:new(O||w),string:new x}},M.prototype.delete=function(e){return U(this,e).delete(e)},M.prototype.get=function(e){return U(this,e).get(e)},M.prototype.has=function(e){return U(this,e).has(e)},M.prototype.set=function(e,t){return U(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(q(e))return D?D.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(u,(function(e,t,r,a){n.push(r?a.replace(p,"$1"):t||e)})),n}));function B(e){if("string"==typeof e||q(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var s=e.apply(this,r);return n.cache=o.set(a,s),s};return n.cache=new(G.Cache||M),n}G.Cache=M;var W=Array.isArray;function H(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function q(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t,n){var r=null==e?void 0:F(e,t);return void 0===r?n:r}},928:(e,t,n)=>{var r="__lodash_hash_undefined__",a=1/0,o=9007199254740991,s="[object Arguments]",i="[object Function]",c="[object GeneratorFunction]",l="[object Symbol]",d=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,p=/^\./,h=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,m=/^(?:0|[1-9]\d*)$/,y="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,E="object"==typeof self&&self&&self.Object===Object&&self,I=y||E||Function("return this")();var A,C=Array.prototype,_=Function.prototype,S=Object.prototype,b=I["__core-js_shared__"],N=(A=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",v=_.toString,P=S.hasOwnProperty,T=S.toString,O=RegExp("^"+v.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=I.Symbol,R=S.propertyIsEnumerable,D=C.splice,x=W(I,"Map"),w=W(Object,"create"),M=$?$.prototype:void 0,L=M?M.toString:void 0;function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function k(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!=n&&r!=r)return a;return-1}function V(e,t){return null!=e&&P.call(e,t)}function B(e){if(!Q(e)||(t=e,N&&N in t))return!1;var t,n=X(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?O:g;return n.test(function(e){if(null!=e){try{return v.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function G(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function W(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B(n)?n:void 0}function H(e,t,n){var r;t=function(e,t){if(z(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||ee(e))return!0;return u.test(e)||!d.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:z(r=t)?r:q(r);for(var a,i=-1,c=t.length;++i<c;){var l=Y(t[i]);if(!(a=null!=e&&n(e,l)))break;e=e[l]}return a||!!(c=e?e.length:0)&&J(c)&&function(e,t){return t=null==t?o:t,!!t&&("number"==typeof e||m.test(e))&&e>-1&&e%1==0&&e<t}(l,c)&&(z(e)||function(e){return function(e){return Z(e)&&function(e){return null!=e&&J(e.length)&&!X(e)}(e)}(e)&&P.call(e,"callee")&&(!R.call(e,"callee")||T.call(e)==s)}(e))}F.prototype.clear=function(){this.__data__=w?w(null):{}},F.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},F.prototype.get=function(e){var t=this.__data__;if(w){var n=t[e];return n===r?void 0:n}return P.call(t,e)?t[e]:void 0},F.prototype.has=function(e){var t=this.__data__;return w?void 0!==t[e]:P.call(t,e)},F.prototype.set=function(e,t){return this.__data__[e]=w&&void 0===t?r:t,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(e){var t=this.__data__,n=k(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},j.prototype.get=function(e){var t=this.__data__,n=k(t,e);return n<0?void 0:t[n][1]},j.prototype.has=function(e){return k(this.__data__,e)>-1},j.prototype.set=function(e,t){var n=this.__data__,r=k(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},U.prototype.clear=function(){this.__data__={hash:new F,map:new(x||j),string:new F}},U.prototype.delete=function(e){return G(this,e).delete(e)},U.prototype.get=function(e){return G(this,e).get(e)},U.prototype.has=function(e){return G(this,e).has(e)},U.prototype.set=function(e,t){return G(this,e).set(e,t),this};var q=K((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ee(e))return L?L.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var n=[];return p.test(e)&&n.push(""),e.replace(h,(function(e,t,r,a){n.push(r?a.replace(f,"$1"):t||e)})),n}));function Y(e){if("string"==typeof e||ee(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function K(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var s=e.apply(this,r);return n.cache=o.set(a,s),s};return n.cache=new(K.Cache||U),n}K.Cache=U;var z=Array.isArray;function X(e){var t=Q(e)?T.call(e):"";return t==i||t==c}function J(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return!!e&&"object"==typeof e}function ee(e){return"symbol"==typeof e||Z(e)&&T.call(e)==l}e.exports=function(e,t){return null!=e&&H(e,t,V)}},529:(e,t,n)=>{e=n.nmd(e);var r=9007199254740991,a="[object Arguments]",o="[object Function]",s="[object GeneratorFunction]",i="[object Map]",c="[object Promise]",l="[object Set]",d="[object WeakMap]",u="[object DataView]",p=/^\[object .+?Constructor\]$/,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,g=h||f||Function("return this")(),m=t&&!t.nodeType&&t,y=m&&e&&!e.nodeType&&e,E=y&&y.exports===m;var I,A,C,_=Function.prototype,S=Object.prototype,b=g["__core-js_shared__"],N=(I=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"",v=_.toString,P=S.hasOwnProperty,T=S.toString,O=RegExp("^"+v.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=E?g.Buffer:void 0,R=S.propertyIsEnumerable,D=$?$.isBuffer:void 0,x=(A=Object.keys,C=Object,function(e){return A(C(e))}),w=q(g,"DataView"),M=q(g,"Map"),L=q(g,"Promise"),F=q(g,"Set"),j=q(g,"WeakMap"),U=!R.call({valueOf:1},"valueOf"),k=K(w),V=K(M),B=K(L),G=K(F),W=K(j);function H(e){if(!ee(e)||function(e){return!!N&&N in e}(e))return!1;var t=Z(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?O:p;return t.test(K(e))}function q(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return H(n)?n:void 0}var Y=function(e){return T.call(e)};function K(e){if(null!=e){try{return v.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function z(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&J(e)}(e)&&P.call(e,"callee")&&(!R.call(e,"callee")||T.call(e)==a)}(w&&Y(new w(new ArrayBuffer(1)))!=u||M&&Y(new M)!=i||L&&Y(L.resolve())!=c||F&&Y(new F)!=l||j&&Y(new j)!=d)&&(Y=function(e){var t=T.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?K(n):void 0;if(r)switch(r){case k:return u;case V:return i;case B:return c;case G:return l;case W:return d}return t});var X=Array.isArray;function J(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Z(e)}var Q=D||function(){return!1};function Z(e){var t=ee(e)?T.call(e):"";return t==o||t==s}function ee(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){if(J(e)&&(X(e)||"string"==typeof e||"function"==typeof e.splice||Q(e)||z(e)))return!e.length;var t=Y(e);if(t==i||t==l)return!e.size;if(U||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||S)}(e))return!x(e).length;for(var n in e)if(P.call(e,n))return!1;return!0}},216:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",a=1,o=2,s=9007199254740991,i="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",d="[object Boolean]",u="[object Date]",p="[object Error]",h="[object Function]",f="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Null]",E="[object Object]",I="[object Promise]",A="[object Proxy]",C="[object RegExp]",_="[object Set]",S="[object String]",b="[object Symbol]",N="[object Undefined]",v="[object WeakMap]",P="[object ArrayBuffer]",T="[object DataView]",O=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[i]=R[c]=R[P]=R[d]=R[T]=R[u]=R[p]=R[h]=R[g]=R[m]=R[E]=R[C]=R[_]=R[S]=R[v]=!1;var D="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,x="object"==typeof self&&self&&self.Object===Object&&self,w=D||x||Function("return this")(),M=t&&!t.nodeType&&t,L=M&&e&&!e.nodeType&&e,F=L&&L.exports===M,j=F&&D.process,U=function(){try{return j&&j.binding&&j.binding("util")}catch(e){}}(),k=U&&U.isTypedArray;function V(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function B(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function G(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var W,H,q,Y=Array.prototype,K=Function.prototype,z=Object.prototype,X=w["__core-js_shared__"],J=K.toString,Q=z.hasOwnProperty,Z=(W=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",ee=z.toString,te=RegExp("^"+J.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=F?w.Buffer:void 0,re=w.Symbol,ae=w.Uint8Array,oe=z.propertyIsEnumerable,se=Y.splice,ie=re?re.toStringTag:void 0,ce=Object.getOwnPropertySymbols,le=ne?ne.isBuffer:void 0,de=(H=Object.keys,q=Object,function(e){return H(q(e))}),ue=Ue(w,"DataView"),pe=Ue(w,"Map"),he=Ue(w,"Promise"),fe=Ue(w,"Set"),ge=Ue(w,"WeakMap"),me=Ue(Object,"create"),ye=Ge(ue),Ee=Ge(pe),Ie=Ge(he),Ae=Ge(fe),Ce=Ge(ge),_e=re?re.prototype:void 0,Se=_e?_e.valueOf:void 0;function be(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])}}function Ne(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])}}function ve(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])}}function Pe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ve;++t<n;)this.add(e[t])}function Te(e){var t=this.__data__=new Ne(e);this.size=t.size}function Oe(e,t){var n=qe(e),r=!n&&He(e),a=!n&&!r&&Ye(e),o=!n&&!r&&!a&&Qe(e),s=n||r||a||o,i=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!Q.call(e,l)||s&&("length"==l||a&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Be(l,c))||i.push(l);return i}function $e(e,t){for(var n=e.length;n--;)if(We(e[n][0],t))return n;return-1}function Re(e){return null==e?void 0===e?N:y:ie&&ie in Object(e)?function(e){var t=Q.call(e,ie),n=e[ie];try{e[ie]=void 0;var r=!0}catch(e){}var a=ee.call(e);r&&(t?e[ie]=n:delete e[ie]);return a}(e):function(e){return ee.call(e)}(e)}function De(e){return Je(e)&&Re(e)==i}function xe(e,t,n,r,s){return e===t||(null==e||null==t||!Je(e)&&!Je(t)?e!=e&&t!=t:function(e,t,n,r,s,l){var h=qe(e),f=qe(t),y=h?c:Ve(e),I=f?c:Ve(t),A=(y=y==i?E:y)==E,N=(I=I==i?E:I)==E,v=y==I;if(v&&Ye(e)){if(!Ye(t))return!1;h=!0,A=!1}if(v&&!A)return l||(l=new Te),h||Qe(e)?Le(e,t,n,r,s,l):function(e,t,n,r,s,i,c){switch(n){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!i(new ae(e),new ae(t)));case d:case u:case m:return We(+e,+t);case p:return e.name==t.name&&e.message==t.message;case C:case S:return e==t+"";case g:var l=B;case _:var h=r&a;if(l||(l=G),e.size!=t.size&&!h)return!1;var f=c.get(e);if(f)return f==t;r|=o,c.set(e,t);var y=Le(l(e),l(t),r,s,i,c);return c.delete(e),y;case b:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,y,n,r,s,l);if(!(n&a)){var O=A&&Q.call(e,"__wrapped__"),$=N&&Q.call(t,"__wrapped__");if(O||$){var R=O?e.value():e,D=$?t.value():t;return l||(l=new Te),s(R,D,n,r,l)}}if(!v)return!1;return l||(l=new Te),function(e,t,n,r,o,s){var i=n&a,c=Fe(e),l=c.length,d=Fe(t),u=d.length;if(l!=u&&!i)return!1;var p=l;for(;p--;){var h=c[p];if(!(i?h in t:Q.call(t,h)))return!1}var f=s.get(e);if(f&&s.get(t))return f==t;var g=!0;s.set(e,t),s.set(t,e);var m=i;for(;++p<l;){var y=e[h=c[p]],E=t[h];if(r)var I=i?r(E,y,h,t,e,s):r(y,E,h,e,t,s);if(!(void 0===I?y===E||o(y,E,n,r,s):I)){g=!1;break}m||(m="constructor"==h)}if(g&&!m){var A=e.constructor,C=t.constructor;A==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof C&&C instanceof C||(g=!1)}return s.delete(e),s.delete(t),g}(e,t,n,r,s,l)}(e,t,n,r,xe,s))}function we(e){return!(!Xe(e)||function(e){return!!Z&&Z in e}(e))&&(Ke(e)?te:O).test(Ge(e))}function Me(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||z,t!==r)return de(e);var t,n,r,a=[];for(var o in Object(e))Q.call(e,o)&&"constructor"!=o&&a.push(o);return a}function Le(e,t,n,r,s,i){var c=n&a,l=e.length,d=t.length;if(l!=d&&!(c&&d>l))return!1;var u=i.get(e);if(u&&i.get(t))return u==t;var p=-1,h=!0,f=n&o?new Pe:void 0;for(i.set(e,t),i.set(t,e);++p<l;){var g=e[p],m=t[p];if(r)var y=c?r(m,g,p,t,e,i):r(g,m,p,e,t,i);if(void 0!==y){if(y)continue;h=!1;break}if(f){if(!V(t,(function(e,t){if(a=t,!f.has(a)&&(g===e||s(g,e,n,r,i)))return f.push(t);var a}))){h=!1;break}}else if(g!==m&&!s(g,m,n,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h}function Fe(e){return function(e,t,n){var r=t(e);return qe(e)?r:function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}(r,n(e))}(e,Ze,ke)}function je(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function Ue(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return we(n)?n:void 0}be.prototype.clear=function(){this.__data__=me?me(null):{},this.size=0},be.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},be.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===r?void 0:n}return Q.call(t,e)?t[e]:void 0},be.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:Q.call(t,e)},be.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=me&&void 0===t?r:t,this},Ne.prototype.clear=function(){this.__data__=[],this.size=0},Ne.prototype.delete=function(e){var t=this.__data__,n=$e(t,e);return!(n<0)&&(n==t.length-1?t.pop():se.call(t,n,1),--this.size,!0)},Ne.prototype.get=function(e){var t=this.__data__,n=$e(t,e);return n<0?void 0:t[n][1]},Ne.prototype.has=function(e){return $e(this.__data__,e)>-1},Ne.prototype.set=function(e,t){var n=this.__data__,r=$e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ve.prototype.clear=function(){this.size=0,this.__data__={hash:new be,map:new(pe||Ne),string:new be}},ve.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},ve.prototype.get=function(e){return je(this,e).get(e)},ve.prototype.has=function(e){return je(this,e).has(e)},ve.prototype.set=function(e,t){var n=je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,r),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.clear=function(){this.__data__=new Ne,this.size=0},Te.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ne){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ve(r)}return n.set(e,t),this.size=n.size,this};var ke=ce?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[a++]=s)}return o}(ce(e),(function(t){return oe.call(e,t)})))}:function(){return[]},Ve=Re;function Be(e,t){return!!(t=null==t?s:t)&&("number"==typeof e||$.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function We(e,t){return e===t||e!=e&&t!=t}(ue&&Ve(new ue(new ArrayBuffer(1)))!=T||pe&&Ve(new pe)!=g||he&&Ve(he.resolve())!=I||fe&&Ve(new fe)!=_||ge&&Ve(new ge)!=v)&&(Ve=function(e){var t=Re(e),n=t==E?e.constructor:void 0,r=n?Ge(n):"";if(r)switch(r){case ye:return T;case Ee:return g;case Ie:return I;case Ae:return _;case Ce:return v}return t});var He=De(function(){return arguments}())?De:function(e){return Je(e)&&Q.call(e,"callee")&&!oe.call(e,"callee")},qe=Array.isArray;var Ye=le||function(){return!1};function Ke(e){if(!Xe(e))return!1;var t=Re(e);return t==h||t==f||t==l||t==A}function ze(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Qe=k?function(e){return function(t){return e(t)}}(k):function(e){return Je(e)&&ze(e.length)&&!!R[Re(e)]};function Ze(e){return null!=(t=e)&&ze(t.length)&&!Ke(t)?Oe(e):Me(e);var t}e.exports=function(e,t){return xe(e,t)}},692:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",a=9007199254740991,o="[object Arguments]",s="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",l="[object Null]",d="[object Object]",u="[object Proxy]",p="[object Undefined]",h=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[o]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[i]=g["[object Map]"]=g["[object Number]"]=g[d]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,E=m||y||Function("return this")(),I=t&&!t.nodeType&&t,A=I&&e&&!e.nodeType&&e,C=A&&A.exports===I,_=C&&m.process,S=function(){try{var e=A&&A.require&&A.require("util").types;return e||_&&_.binding&&_.binding("util")}catch(e){}}(),b=S&&S.isTypedArray;var N,v,P,T=Array.prototype,O=Function.prototype,$=Object.prototype,R=E["__core-js_shared__"],D=O.toString,x=$.hasOwnProperty,w=(N=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",M=$.toString,L=D.call(Object),F=RegExp("^"+D.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=C?E.Buffer:void 0,U=E.Symbol,k=E.Uint8Array,V=j?j.allocUnsafe:void 0,B=(v=Object.getPrototypeOf,P=Object,function(e){return v(P(e))}),G=Object.create,W=$.propertyIsEnumerable,H=T.splice,q=U?U.toStringTag:void 0,Y=function(){try{var e=Ie(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),K=j?j.isBuffer:void 0,z=Math.max,X=Date.now,J=Ie(E,"Map"),Q=Ie(Object,"create"),Z=function(){function e(){}return function(t){if(!Re(t))return{};if(G)return G(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ee(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])}}function te(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])}}function ne(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])}}function re(e){var t=this.__data__=new te(e);this.size=t.size}function ae(e,t){var n=ve(e),r=!n&&Ne(e),a=!n&&!r&&Te(e),o=!n&&!r&&!a&&xe(e),s=n||r||a||o,i=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!x.call(e,l)||s&&("length"==l||a&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ae(l,c))||i.push(l);return i}function oe(e,t,n){(void 0!==n&&!be(e[t],n)||void 0===n&&!(t in e))&&ce(e,t,n)}function se(e,t,n){var r=e[t];x.call(e,t)&&be(r,n)&&(void 0!==n||t in e)||ce(e,t,n)}function ie(e,t){for(var n=e.length;n--;)if(be(e[n][0],t))return n;return-1}function ce(e,t,n){"__proto__"==t&&Y?Y(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}ee.prototype.clear=function(){this.__data__=Q?Q(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return n===r?void 0:n}return x.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:x.call(t,e)},ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Q&&void 0===t?r:t,this},te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=ie(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),--this.size,!0)},te.prototype.get=function(e){var t=this.__data__,n=ie(t,e);return n<0?void 0:t[n][1]},te.prototype.has=function(e){return ie(this.__data__,e)>-1},te.prototype.set=function(e,t){var n=this.__data__,r=ie(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(J||te),string:new ee}},ne.prototype.delete=function(e){var t=Ee(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return Ee(this,e).get(e)},ne.prototype.has=function(e){return Ee(this,e).has(e)},ne.prototype.set=function(e,t){var n=Ee(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},re.prototype.clear=function(){this.__data__=new te,this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,t){var n=this.__data__;if(n instanceof te){var r=n.__data__;if(!J||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ne(r)}return n.set(e,t),this.size=n.size,this};var le,de=function(e,t,n){for(var r=-1,a=Object(e),o=n(e),s=o.length;s--;){var i=o[le?s:++r];if(!1===t(a[i],i,a))break}return e};function ue(e){return null==e?void 0===e?p:l:q&&q in Object(e)?function(e){var t=x.call(e,q),n=e[q];try{e[q]=void 0;var r=!0}catch(e){}var a=M.call(e);r&&(t?e[q]=n:delete e[q]);return a}(e):function(e){return M.call(e)}(e)}function pe(e){return De(e)&&ue(e)==o}function he(e){return!(!Re(e)||function(e){return!!w&&w in e}(e))&&(Oe(e)?F:h).test(function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function fe(e){if(!Re(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ce(e),n=[];for(var r in e)("constructor"!=r||!t&&x.call(e,r))&&n.push(r);return n}function ge(e,t,n,r,a){e!==t&&de(t,(function(o,s){if(a||(a=new re),Re(o))!function(e,t,n,r,a,o,s){var i=_e(e,n),c=_e(t,n),l=s.get(c);if(l)return void oe(e,n,l);var u=o?o(i,c,n+"",e,t,s):void 0,p=void 0===u;if(p){var h=ve(c),f=!h&&Te(c),g=!h&&!f&&xe(c);u=c,h||f||g?ve(i)?u=i:De(A=i)&&Pe(A)?u=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(i):f?(p=!1,u=function(e,t){if(t)return e.slice();var n=e.length,r=V?V(n):new e.constructor(n);return e.copy(r),r}(c,!0)):g?(p=!1,m=c,y=!0?(E=m.buffer,I=new E.constructor(E.byteLength),new k(I).set(new k(E)),I):m.buffer,u=new m.constructor(y,m.byteOffset,m.length)):u=[]:function(e){if(!De(e)||ue(e)!=d)return!1;var t=B(e);if(null===t)return!0;var n=x.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&D.call(n)==L}(c)||Ne(c)?(u=i,Ne(i)?u=function(e){return function(e,t,n,r){var a=!n;n||(n={});var o=-1,s=t.length;for(;++o<s;){var i=t[o],c=r?r(n[i],e[i],i,n,e):void 0;void 0===c&&(c=e[i]),a?ce(n,i,c):se(n,i,c)}return n}(e,we(e))}(i):Re(i)&&!Oe(i)||(u=function(e){return"function"!=typeof e.constructor||Ce(e)?{}:Z(B(e))}(c))):p=!1}var m,y,E,I;var A;p&&(s.set(c,u),a(u,c,r,o,s),s.delete(c));oe(e,n,u)}(e,t,s,n,ge,r,a);else{var i=r?r(_e(e,s),o,s+"",e,t,a):void 0;void 0===i&&(i=o),oe(e,s,i)}}),we)}function me(e,t){return Se(function(e,t,n){return t=z(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=z(r.length-t,0),s=Array(o);++a<o;)s[a]=r[t+a];a=-1;for(var i=Array(t+1);++a<t;)i[a]=r[a];return i[t]=n(s),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)}(e,this,i)}}(e,t,Fe),e+"")}var ye=Y?function(e,t){return Y(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Fe;function Ee(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function Ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return he(n)?n:void 0}function Ae(e,t){var n=typeof e;return!!(t=null==t?a:t)&&("number"==n||"symbol"!=n&&f.test(e))&&e>-1&&e%1==0&&e<t}function Ce(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||$)}function _e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Se=function(e){var t=0,n=0;return function(){var r=X(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ye);function be(e,t){return e===t||e!=e&&t!=t}var Ne=pe(function(){return arguments}())?pe:function(e){return De(e)&&x.call(e,"callee")&&!W.call(e,"callee")},ve=Array.isArray;function Pe(e){return null!=e&&$e(e.length)&&!Oe(e)}var Te=K||function(){return!1};function Oe(e){if(!Re(e))return!1;var t=ue(e);return t==i||t==c||t==s||t==u}function $e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Re(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function De(e){return null!=e&&"object"==typeof e}var xe=b?function(e){return function(t){return e(t)}}(b):function(e){return De(e)&&$e(e.length)&&!!g[ue(e)]};function we(e){return Pe(e)?ae(e,!0):fe(e)}var Me,Le=(Me=function(e,t,n,r){ge(e,t,n,r)},me((function(e,t){var n=-1,r=t.length,a=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(a=Me.length>3&&"function"==typeof a?(r--,a):void 0,o&&function(e,t,n){if(!Re(n))return!1;var r=typeof t;return!!("number"==r?Pe(n)&&Ae(t,n.length):"string"==r&&t in n)&&be(n[t],e)}(t[0],t[1],o)&&(a=r<3?void 0:a,r=1),e=Object(e);++n<r;){var s=t[n];s&&Me(e,s,n,a)}return e})));function Fe(e){return e}e.exports=Le},835:(e,t,n)=>{var r="__lodash_hash_undefined__",a=1/0,o=9007199254740991,s="[object Function]",i="[object GeneratorFunction]",c="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d=/^\w*$/,u=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,E=m||y||Function("return this")();var I,A=Array.prototype,C=Function.prototype,_=Object.prototype,S=E["__core-js_shared__"],b=(I=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"",N=C.toString,v=_.hasOwnProperty,P=_.toString,T=RegExp("^"+N.call(v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=E.Symbol,$=A.splice,R=G(E,"Map"),D=G(Object,"create"),x=O?O.prototype:void 0,w=x?x.toString:void 0;function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e,t,n){var r=e[t];v.call(e,t)&&K(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function U(e,t){for(var n=e.length;n--;)if(K(e[n][0],t))return n;return-1}function k(e){if(!X(e)||(t=e,b&&b in t))return!1;var t,n=function(e){var t=X(e)?P.call(e):"";return t==s||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?T:f;return n.test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function V(e,t,n,r){if(!X(e))return e;t=function(e,t){if(z(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||J(e))return!0;return d.test(e)||!l.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return z(e)?e:H(e)}(t);for(var a=-1,o=t.length,s=o-1,i=e;null!=i&&++a<o;){var c=q(t[a]),u=n;if(a!=s){var p=i[c];void 0===(u=r?r(p,c,i):void 0)&&(u=X(p)?p:W(t[a+1])?[]:{})}j(i,c,u),i=i[c]}return e}function B(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return k(n)?n:void 0}function W(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||g.test(e))&&e>-1&&e%1==0&&e<t}M.prototype.clear=function(){this.__data__=D?D(null):{}},M.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},M.prototype.get=function(e){var t=this.__data__;if(D){var n=t[e];return n===r?void 0:n}return v.call(t,e)?t[e]:void 0},M.prototype.has=function(e){var t=this.__data__;return D?void 0!==t[e]:v.call(t,e)},M.prototype.set=function(e,t){return this.__data__[e]=D&&void 0===t?r:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():$.call(t,n,1),!0)},L.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},L.prototype.has=function(e){return U(this.__data__,e)>-1},L.prototype.set=function(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},F.prototype.clear=function(){this.__data__={hash:new M,map:new(R||L),string:new M}},F.prototype.delete=function(e){return B(this,e).delete(e)},F.prototype.get=function(e){return B(this,e).get(e)},F.prototype.has=function(e){return B(this,e).has(e)},F.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=Y((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(J(e))return w?w.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(p,(function(e,t,r,a){n.push(r?a.replace(h,"$1"):t||e)})),n}));function q(e){if("string"==typeof e||J(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function Y(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var s=e.apply(this,r);return n.cache=o.set(a,s),s};return n.cache=new(Y.Cache||F),n}function K(e,t){return e===t||e!=e&&t!=t}Y.Cache=F;var z=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function J(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&P.call(e)==c}e.exports=function(e,t,n){return null==e?e:V(e,t,n)}},521:(e,t,n)=>{var r="__lodash_hash_undefined__",a=1/0,o="[object Function]",s="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,d=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,g="object"==typeof self&&self&&self.Object===Object&&self,m=f||g||Function("return this")();var y,E=Array.prototype,I=Function.prototype,A=Object.prototype,C=m["__core-js_shared__"],_=(y=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=I.toString,b=A.hasOwnProperty,N=A.toString,v=RegExp("^"+S.call(b).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m.Symbol,T=E.splice,O=V(m,"Map"),$=V(Object,"create"),R=P?P.prototype:void 0,D=R?R.toString:void 0;function x(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!=n&&r!=r)return a;return-1}function F(e){if(!Y(e)||(t=e,_&&_ in t))return!1;var t,n=function(e){var t=Y(e)?N.call(e):"";return t==o||t==s}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?v:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function j(e,t){e=function(e,t){return 1==t.length?e:function(e,t){for(var n=0,r=(t=B(t,e)?[t]:U(t)).length;null!=e&&n<r;)e=e[W(t[n++])];return n&&n==r?e:void 0}(e,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 o=Array(a);++r<a;)o[r]=e[r+t];return o}(t,0,-1))}(e,t=B(t,e)?[t]:U(t));var n,r,a=W((r=(n=t)?n.length:0)?n[r-1]:void 0);return!(null!=e&&b.call(e,a))||delete e[a]}function U(e){return q(e)?e:G(e)}function k(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function V(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return F(n)?n:void 0}function B(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!K(e))||(l.test(e)||!c.test(e)||null!=t&&e in Object(t))}x.prototype.clear=function(){this.__data__=$?$(null):{}},x.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},x.prototype.get=function(e){var t=this.__data__;if($){var n=t[e];return n===r?void 0:n}return b.call(t,e)?t[e]:void 0},x.prototype.has=function(e){var t=this.__data__;return $?void 0!==t[e]:b.call(t,e)},x.prototype.set=function(e,t){return this.__data__[e]=$&&void 0===t?r:t,this},w.prototype.clear=function(){this.__data__=[]},w.prototype.delete=function(e){var t=this.__data__,n=L(t,e);return!(n<0)&&(n==t.length-1?t.pop():T.call(t,n,1),!0)},w.prototype.get=function(e){var t=this.__data__,n=L(t,e);return n<0?void 0:t[n][1]},w.prototype.has=function(e){return L(this.__data__,e)>-1},w.prototype.set=function(e,t){var n=this.__data__,r=L(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},M.prototype.clear=function(){this.__data__={hash:new x,map:new(O||w),string:new x}},M.prototype.delete=function(e){return k(this,e).delete(e)},M.prototype.get=function(e){return k(this,e).get(e)},M.prototype.has=function(e){return k(this,e).has(e)},M.prototype.set=function(e,t){return k(this,e).set(e,t),this};var G=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(K(e))return D?D.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(u,(function(e,t,r,a){n.push(r?a.replace(p,"$1"):t||e)})),n}));function W(e){if("string"==typeof e||K(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function H(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var s=e.apply(this,r);return n.cache=o.set(a,s),s};return n.cache=new(H.Cache||M),n}H.Cache=M;var q=Array.isArray;function Y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function K(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t){return null==e||j(e,t)}},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 o=this.gen_table();this.table=o,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=o[t^e[n]];return t})}calculate(e){let t;e=this.converter.validate_buffer(e);let{table:n,width:r,crc_shift:a,mask:o}=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)&o}}else{t=this.shifted_xor_in;for(let s=0;s<e.length;s++)t=n[255&(t>>r-8+a^e[s])]<<a^t<<8-a&o<<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,o="";for(let s=0;s<r;s++){let r="";for(let o=0;o<a;o++){let a=e[s<<n|o];a="000000000"+a.toString(16),a=a.substr(a.length-t),r+="0x"+a+", "}o+=" "+r+"\n"}return o="[\n"+o.slice(0,-3)+"\n]",o}}const n="undefined"!=typeof Buffer,r="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,a=void 0!==typeof BigInt&&BigInt(256);class o{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 s extends o{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 o{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 s;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,o){let s=new t(e,n,r,a,o);return s.calculate.bind(s)},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},654:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AsYouType:()=>sa,AsYouTypeCustom:()=>oa,DIGITS:()=>ee,DIGIT_PLACEHOLDER:()=>_r,Metadata:()=>pa,ParseError:()=>C,PhoneNumber:()=>ya,PhoneNumberMatcher:()=>yr,PhoneNumberSearch:()=>Wa,PhoneNumberSearchCustom:()=>Ua,default:()=>xt,findNumbers:()=>ar,findPhoneNumbers:()=>Ba,findPhoneNumbersCustom:()=>ka,findPhoneNumbersInText:()=>ur,format:()=>Sa,formatCustom:()=>_a,formatIncompletePhoneNumber:()=>ma,formatNumber:()=>Sa,formatRFC3966:()=>Me,getCountries:()=>la,getCountryCallingCode:()=>da,getCountryCallingCodeCustom:()=>k,getExampleNumber:()=>fa,getExtPrefix:()=>ua,getNumberType:()=>Ta,getNumberTypeCustom:()=>va,getPhoneCode:()=>da,getPhoneCodeCustom:()=>k,isPossibleNumber:()=>$a,isPossiblePhoneNumber:()=>Gt,isSupportedCountry:()=>ia,isValidNumber:()=>Da,isValidNumberCustom:()=>Ra,isValidNumberForRegion:()=>wa,isValidPhoneNumber:()=>jt,parse:()=>Ia,parseCustom:()=>Ea,parseDigits:()=>ne,parseIncompletePhoneNumber:()=>oe,parseNumber:()=>Ia,parsePhoneNumber:()=>Pt,parsePhoneNumberCharacter:()=>se,parsePhoneNumberFromString:()=>xt,parsePhoneNumberWithError:()=>Pt,parseRFC3966:()=>we,searchNumbers:()=>sr,searchPhoneNumbers:()=>Ga,searchPhoneNumbersCustom:()=>Va,searchPhoneNumbersInText:()=>mr,validatePhoneNumberLength:()=>Kt});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(?: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,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\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])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[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}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-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","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-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|[24-689])\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,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)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\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-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\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","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],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|50|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]|33|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-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-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","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],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{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[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[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]|91"]],["(\\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-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-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]|31)"],"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,"528[89]"],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-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"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,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\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","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|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","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{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"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","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,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","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,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-489]\\d|55)\\d{6}",[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","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]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[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(?:(?:2[14]|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|4[47])|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(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|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]|28|3[129]|4[1-35689]|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[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|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|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|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",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[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,10}|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",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|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[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}",[6,7,8,9,10,11]],["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","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|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",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-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",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"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",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{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","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|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",["30[0135-9]"],"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-7]|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","(?:[245]\\d|33|77|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",["2(?:[0367]|4[3-8])"]],["(\\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",["2(?:[0367]|4[3-8])"]],["(\\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]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|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{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-467]|5[0-3]|8[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}"]]],MC:["377","00","(?:[3489]|6\\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",["6"],"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","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,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",["[12]1"],"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","(?:596\\d|7091)\\d{5}|(?:69|[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","38\\d{6}|[78]\\d{9,13}|(?:20|9\\d)\\d{8}",[8,10,11,12,13,14],[["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["3"],"0$1"],["(\\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","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],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",["(?: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","(?: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","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"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","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,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",["[26]1|3[289]|4[1246-8]|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[16]|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,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[013]|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,"3[04-689]|[489]",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","92\\d{7}|(?:[15]|8\\d)\\d{8}",[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{3,4})","$1 $2 $3",["81"],"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)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\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-8]"]]]],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","[267]\\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",["[267]"]],["(\\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|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-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{8}",[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",["[0-57-9]"]]],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-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"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{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?: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,[["(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[0-468]))\\d{4}|(?:2742|305[3-9]|472[247-9]|505[2-57-9]|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-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|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-47-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-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|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-389]|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]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\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"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["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","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?: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|51"]],["(\\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})|50\\d{3})\\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 o=2,s=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,r.key,r)}}function f(e){var t=E();return function(){var n,r=A(e);if(t){var a=A(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return 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 g(e)}(this,n)}}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){var t="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;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,r)}function r(){return y(e,arguments,A(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),I(r,e)},m(e)}function y(e,t,n){return y=E()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&I(a,n.prototype),a},y.apply(null,arguments)}function E(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function I(e,t){return I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},I(e,t)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}var C=function(e){!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)}(o,e);var t,n,r,a=f(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=a.call(this,e),Object.setPrototypeOf(g(t),o.prototype),t.name=t.constructor.name,t}return t=o,n&&h(t.prototype,n),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(m(Error));function _(e,t){e=e.split("-"),t=t.split("-");for(var n=e[0].split("."),r=t[0].split("."),a=0;a<3;a++){var o=Number(n[a]),s=Number(r[a]);if(o>s)return 1;if(s>o)return-1;if(!isNaN(o)&&isNaN(s))return 1;if(isNaN(o)&&!isNaN(s))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 b(e){return null!=e&&e.constructor===S}function N(e){return N="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},N(e)}function v(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,r.key,r)}}function T(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var O=" ext. ",$=/^\d+$/,R=function(){function e(t){v(this,e),F(t),this.metadata=t,B.call(this,t)}return T(e,[{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){if(e&&$.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new D(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw new Error("Unknown calling code: ".concat(t));this.numberingPlan=new D(this.getNumberingPlanMetadata(t),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}}]),e}(),D=function(){function e(t,n){v(this,e),this.globalMetadataObject=n,this.metadata=t,B.call(this,n.metadata)}return T(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{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.getDefaultCountryMetadataForRegion())||[];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.getDefaultCountryMetadataForRegion())}},{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.getDefaultCountryMetadataForRegion())}},{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?O:this.metadata[13]||O}}]),e}(),x=function(){function e(t,n){v(this,e),this._format=t,this.metadata=n}return T(e,[{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()}}]),e}(),w=/^\(?\$1\)?$/,M=function(){function e(t,n){v(this,e),this.type=t,this.metadata=n}return T(e,[{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()}}]),e}();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 F(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!b(e)||!b(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(b(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+j(e)+": "+e,"."))}var j=function(e){return N(e)};function U(e,t){return(t=new R(t)).hasCountry(e)?t.country(e).ext():O}function k(e,t){if((t=new R(t)).hasCountry(e))return t.country(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===_(t,"1.2.0")?this.v2=!0:-1===_(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+"]{"+o+"}",q="[++]{0,1}(?:["+d+"]*["+c+"]){3,}["+d+c+"]*",Y=new RegExp("^[++]{0,1}(?:["+d+"]*["+c+"]){1,2}$","i"),K=q+"(?:"+W()+")?",z=new RegExp("^"+H+"$|^"+K+"$","i");function X(e){return e.length>=o&&z.test(e)}var J=new RegExp("(?:"+W()+")$","i");function Q(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)return;if("string"==typeof e)return Z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(e,t)}(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=new 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=Q(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)return;if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ae(e,t)}(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=new Array(t);n<t;n++)r[n]=e[n];return r}function oe(e){for(var t,n="",r=re(e.split(""));!(t=r()).done;){n+=se(t.value,n)||""}return n}function se(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)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(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=new Array(t);n<t;n++)r[n]=e[n];return r}function le(e,t){return de(e,void 0,t)}function de(e,t,n){var r=n.type(t),a=r&&r.possibleLengths()||n.possibleLengths();if(!a)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===t){if(!n.type("FIXED_LINE"))return de(e,"MOBILE",n);var o=n.type("MOBILE");o&&(a=function(e,t){for(var n,r=e.slice(),a=ie(t);!(n=a()).done;){var o=n.value;e.indexOf(o)<0&&r.push(o)}return r.sort((function(e,t){return e-t}))}(a,o.possibleLengths()))}else if(t&&!r)return"INVALID_LENGTH";var s=e.length,i=a[0];return i===s?"IS_POSSIBLE":i>s?"TOO_SHORT":a[a.length-1]<s?"TOO_LONG":a.indexOf(s,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function ue(e,t,n){if(void 0===t&&(t={}),n=new R(n),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.country(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}}if(n.possibleLengths())return pe(e.phone||e.nationalNumber,n);if(e.countryCallingCode&&n.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,t)}function he(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function fe(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)return;if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ge(e,t)}(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 ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new 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){(n=new R(n)).selectNumberingPlan(e.country,e.countryCallingCode);var r=t.v2?e.nationalNumber:e.phone;if(he(r,n.nationalNumberPattern())){if(Ee(r,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?Ee(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var a,o=fe(me);!(a=o()).done;){var s=a.value;if(Ee(r,s,n))return s}}}}function Ee(e,t,n){return!(!(t=n.type(t))||!t.pattern())&&(!(t.possibleLengths()&&t.possibleLengths().indexOf(e.length)<0)&&he(e,t.pattern()))}function Ie(e,t,n){return t=t||{},(n=new R(n)).selectNumberingPlan(e.country,e.countryCallingCode),n.hasTypes()?void 0!==ye(e,t,n.metadata):he(t.v2?e.nationalNumber:e.phone,n.nationalNumberPattern())}function Ae(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);if(r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(e.length)>=0)return!0;return!1}(t,e,n)})):[]}var Ce=new RegExp("(["+c+"])");function _e(e,t,n,r){if(t){var a=new R(r);a.selectNumberingPlan(t,n);var o=new RegExp(a.IDDPrefix());if(0===e.search(o)){var s=(e=e.slice(e.match(o)[0].length)).match(Ce);if(!(s&&null!=s[1]&&s[1].length>0&&"0"===s[1]))return e}}}function Se(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(e);if(r){var a,o,s,i=r.length-1,c=i>0&&r[i];if(t.nationalPrefixTransformRule()&&c)a=e.replace(n,t.nationalPrefixTransformRule()),i>1&&(o=r[1]);else{var l=r[0];a=e.slice(l.length),c&&(o=r[1])}if(c){var d=e.indexOf(r[1]);e.slice(0,d)===t.numberingPlan.nationalPrefix()&&(s=t.numberingPlan.nationalPrefix())}else s=r[0];return{nationalNumber:a,nationalPrefix:s,carrierCode:o}}}return{nationalNumber:e}}function be(e,t){var n=Se(e,t),r=n.carrierCode,a=n.nationalNumber;if(a!==e){if(!function(e,t,n){if(he(e,n.nationalNumberPattern())&&!he(t,n.nationalNumberPattern()))return!1;return!0}(e,a,t))return{nationalNumber:e};if(t.possibleLengths()&&!function(e,t){switch(le(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(a,t))return{nationalNumber:e}}return{nationalNumber:a,carrierCode:r}}function Ne(e,t,n,r){var a=t?k(t,r):n;if(0===e.indexOf(a)){(r=new R(r)).selectNumberingPlan(t,n);var o=e.slice(a.length),s=be(o,r).nationalNumber,i=be(e,r).nationalNumber;if(!he(i,r.nationalNumberPattern())&&he(s,r.nationalNumberPattern())||"TOO_LONG"===le(i,r))return{countryCallingCode:a,number:o}}return{number:e}}function ve(e,t,n,r){if(!e)return{};var a;if("+"!==e[0]){var o=_e(e,t,n,r);if(!o||o===e){if(t||n){var s=Ne(e,t,n,r),c=s.countryCallingCode,l=s.number;if(c)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:c,number:l}}return{number:e}}a=!0,e="+"+o}if("0"===e[1])return{};r=new R(r);for(var d=2;d-1<=i&&d<=e.length;){var u=e.slice(1,d);if(r.hasCallingCode(u))return r.selectNumberingPlan(u),{countryCallingCodeSource:a?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:u,number:e.slice(d)};d++}return{}}function Pe(e){return e.replace(new RegExp("[".concat(d,"]+"),"g")," ").trim()}var Te=/(\$\d)/;function Oe(e,t,n){var r=n.useInternationalFormat,a=n.withNationalPrefix,o=(n.carrierCode,n.metadata,e.replace(new RegExp(t.pattern()),r?t.internationalFormat():a&&t.nationalPrefixFormattingRule()?t.format().replace(Te,t.nationalPrefixFormattingRule()):t.format()));return r?Pe(o):o}var $e=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Re(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)return;var r,a,o=[],s=!0,i=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){i=!0,a=e}finally{try{s||null==n.return||n.return()}finally{if(i)throw a}}return o}(e,t)||De(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 De(e,t){if(e){if("string"==typeof e)return xe(e,t);var n=Object.prototype.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)?xe(e,t):void 0}}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function we(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=De(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 o=Re(r.value.split("="),2),s=o[0],i=o[1];switch(s){case"tel":t=i;break;case"ext":n=i;break;case"phone-context":"+"===i[0]&&(t=i+t)}}if(!X(t))return{};var c={number:t};return n&&(c.ext=n),c}function Me(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:"")}function Le(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)return;if("string"==typeof e)return Fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fe(e,t)}(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=new Array(t);n<t;n++)r[n]=e[n];return r}function je(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 Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(Object(n),!0).forEach((function(t){ke(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ve={formatExtension:function(e,t,n){return"".concat(e).concat(n.ext()).concat(t)}};function Be(e,t,n,r){if(n=n?Ue(Ue({},Ve),n):Ve,r=new R(r),e.country&&"001"!==e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)return e.phone||"";r.selectNumberingPlan(e.countryCallingCode)}var a,o=r.countryCallingCode(),s=n.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return s?He(a=Ge(s,e.carrierCode,"NATIONAL",r,n),e.ext,r,n.formatExtension):"";case"INTERNATIONAL":return s?(a=Ge(s,null,"INTERNATIONAL",r,n),He(a="+".concat(o," ").concat(a),e.ext,r,n.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(s);case"RFC3966":return Me({number:"+".concat(o).concat(s),ext:e.ext});case"IDD":if(!n.fromCountry)return;var i=function(e,t,n,r,a){var o=k(r,a.metadata);if(o===n){var s=Ge(e,t,"NATIONAL",a);return"1"===n?n+" "+s:s}var i=function(e,t,n){var r=new R(n);return r.selectNumberingPlan(e,t),r.defaultIDDPrefix()?r.defaultIDDPrefix():$e.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,a.metadata);if(i)return"".concat(i," ").concat(n," ").concat(Ge(e,null,"INTERNATIONAL",a))}(s,e.carrierCode,o,n.fromCountry,r);return He(i,e.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function Ge(e,t,n,r,a){var o=We(r.formats(),e);return o?Oe(e,o,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!o.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!a||!1!==a.nationalPrefix,carrierCode:t,metadata:r}):e}function We(e,t){for(var n,r=Le(e);!(n=r()).done;){var a=n.value;if(a.leadingDigitsPatterns().length>0){var o=a.leadingDigitsPatterns()[a.leadingDigitsPatterns().length-1];if(0!==t.search(o))continue}if(he(t,a.pattern()))return a}}function He(e,t,n,r){return t?r(e,t,n):e}function qe(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 Ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(n),!0).forEach((function(t){Ke(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ze(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,r.key,r)}}var Xe=function(){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("string"==typeof t){if("+"===t[0]&&!n)throw new TypeError("`metadata` argument not passed");if(b(n)&&b(n.countries)){r=n;var a=t;if(!Qe.test(a))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var o=ve(a,void 0,void 0,r);if(t=o.countryCallingCode,!(n=o.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");F(r);var s=function(e,t){var n,r,a=new R(t);Je(e)?(n=e,a.selectNumberingPlan(n),r=a.countryCallingCode()):r=e;return{country:n,countryCallingCode:r}}(t,r),i=s.country,c=s.countryCallingCode;this.country=i,this.countryCallingCode=c,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}var t,n,r;return t=e,(n=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Ae(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return ue(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Ie(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 Be(this,e,t?Ye(Ye({},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)}}])&&ze(t.prototype,n),r&&ze(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Je=function(e){return/^[A-Z]{2}$/.test(e)};var Qe=/^\+\d+$/;function Ze(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)return;if("string"==typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return et(e,t)}(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 et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tt(e,t){var n=t.countries,r=(t.defaultCountry,t.metadata);r=new R(r);for(var a,o=Ze(n);!(a=o()).done;){var s=a.value;if(r.country(s),r.leadingDigits()){if(e&&0===e.search(r.leadingDigits()))return s}else if(ye({phone:e,country:s},void 0,r.metadata))return s}}var nt=!1;function rt(e,t){var n=t.nationalNumber,r=t.defaultCountry,a=t.metadata;if(nt&&a.isNonGeographicCallingCode(e))return"001";var o=a.getCountryCodesForCallingCode(e);return o?1===o.length?o[0]:tt(n,{countries:o,defaultCountry:r,metadata:a.metadata}):void 0}var at="+",ot="(["+c+"]|[\\-\\.\\(\\)]?)",st=new RegExp("^\\"+at+ot+"*["+c+"]"+ot+"*$","g"),it=new RegExp("^("+("["+c+"]+((\\-)*["+c+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+c+"])*")+"\\.?$","g"),ct="tel:",lt=";phone-context=",dt=";isub=";function ut(e,t){var n,r=t.extractFormattedPhoneNumber,a=function(e){var t=e.indexOf(lt);if(t<0)return null;var n=t+lt.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&&(st.test(e)||it.test(e))}(a))throw new C("NOT_A_NUMBER");if(null===a)n=r(e)||"";else{n="",a.charAt(0)===at&&(n+=a);var o,s=e.indexOf(ct);o=s>=0?s+ct.length:0;var i=e.indexOf(lt);n+=e.substring(o,i)}var c=n.indexOf(dt);if(c>0&&(n=n.substring(0,c)),""!==n)return n}var pt=250,ht=new RegExp("[++"+c+"]"),ft=new RegExp("[^"+c+"#]+$"),gt=!1;function mt(e,t,n){if(t=t||{},n=new R(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry)){if(t.v2)throw new C("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var r=function(e,t,n){var r=ut(e,{extractFormattedPhoneNumber:function(e){return function(e,t,n){if(!e)return;if(e.length>pt){if(n)throw new C("TOO_LONG");return}if(!1===t)return e;var r=e.search(ht);if(r<0)return;return e.slice(r).replace(ft,"")}(e,n,t)}});if(!r)return{};if(!X(r))return function(e){return Y.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),a=r.number,i=r.ext,c=r.error;if(!a){if(t.v2){if("TOO_SHORT"===c)throw new C("TOO_SHORT");throw new C("NOT_A_NUMBER")}return{}}var l=function(e,t,n,r){var a,o=ve(oe(e),t,n,r.metadata),s=o.countryCallingCodeSource,i=o.countryCallingCode,c=o.number;if(i)r.selectNumberingPlan(i);else{if(!c||!t&&!n)return{};r.selectNumberingPlan(t,n),t?a=t:gt&&r.isNonGeographicCallingCode(n)&&(a="001"),i=n||k(t,r.metadata)}if(!c)return{countryCallingCodeSource:s,countryCallingCode:i};var l=be(oe(c),r),d=l.nationalNumber,u=l.carrierCode,p=rt(i,{nationalNumber:d,defaultCountry:t,metadata:r});p&&(a=p,"001"===p||r.country(a));return{country:a,countryCallingCode:i,countryCallingCodeSource:s,nationalNumber:d,carrierCode:u}}(a,t.defaultCountry,t.defaultCallingCode,n),d=l.country,u=l.nationalNumber,p=l.countryCallingCode,h=l.countryCallingCodeSource,f=l.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new C("INVALID_COUNTRY");return{}}if(!u||u.length<o){if(t.v2)throw new C("TOO_SHORT");return{}}if(u.length>s){if(t.v2)throw new C("TOO_LONG");return{}}if(t.v2){var g=new Xe(p,u,n.metadata);return d&&(g.country=d),f&&(g.carrierCode=f),i&&(g.ext=i),g.__countryCallingCodeSource=h,g}var m=!!(t.extended?n.hasSelectedNumberingPlan():d)&&he(u,n.nationalNumberPattern());return t.extended?{country:d,countryCallingCode:p,carrierCode:f,valid:m,possible:!!m||!(!0!==t.extended||!n.possibleLengths()||!pe(u,n)),phone:u,ext:i}:m?function(e,t,n){var r={country:e,phone:t};n&&(r.ext=n);return r}(d,u,i):{}}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 Et(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){It(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 It(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function At(e,t,n){return mt(e,Et(Et({},t),{},{v2:!0}),n)}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 _t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function St(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)return;var r,a,o=[],s=!0,i=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){i=!0,a=e}finally{try{s||null==n.return||n.return()}finally{if(i)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bt(e,t)}(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 bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nt(e){var t,n,r,a=St(Array.prototype.slice.call(e),4),o=a[0],s=a[1],i=a[2],c=a[3];if("string"!=typeof o)throw new TypeError("A text for parsing must be a string.");if(t=o,s&&"string"!=typeof s){if(!b(s))throw new Error("Invalid second argument: ".concat(s));i?(n=s,r=i):r=s}else c?(n=i,r=c):(n=void 0,r=i),s&&(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){_t(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:s},n));return{text:t,options:n,metadata:r}}function vt(){var e=Nt(arguments);return At(e.text,e.options,e.metadata)}function Pt(){return a(vt,arguments)}function Tt(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 Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(n),!0).forEach((function(t){$t(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rt(e,t,n){t&&t.defaultCountry&&!V(t.defaultCountry,n)&&(t=Ot(Ot({},t),{},{defaultCountry:void 0}));try{return At(e,t,n)}catch(e){if(!(e instanceof C))throw e}}function Dt(){var e=Nt(arguments);return Rt(e.text,e.options,e.metadata)}function xt(){return a(Dt,arguments)}function wt(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 Mt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(n),!0).forEach((function(t){Lt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ft(){var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=Rt(t,n=Mt(Mt({},n),{},{extract:!1}),r);return a&&a.isValid()||!1}function jt(){return a(Ft,arguments)}function Ut(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?Ut(Object(n),!0).forEach((function(t){Vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bt(){var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=Rt(t,n=kt(kt({},n),{},{extract:!1}),r);return a&&a.isPossible()||!1}function Gt(){return a(Bt,arguments)}function Wt(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 Ht(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){qt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yt(){var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata;n=Ht(Ht({},n),{},{extract:!1});try{var a=At(t,n,r);(r=new R(r)).selectNumberingPlan(a.countryCallingCode);var o=le(a.nationalNumber,r);if("IS_POSSIBLE"!==o)return o}catch(e){if(e instanceof C)return e.message;throw e}}function Kt(){return a(Yt,arguments)}function zt(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,r.key,r)}}function Xt(e,t,n){return t&&zt(e.prototype,t),n&&zt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Qt=Xt((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;Jt(this,e),this.key=t,this.value=n,this.next=r,this.prev=a})),Zt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;Jt(this,e),this.size=0,this.limit=t,this.head=null,this.tail=null,this.cache={}}return Xt(e,[{key:"put",value:function(e,t){if(this.ensureLimit(),this.head){var n=new Qt(e,t,this.head);this.head.prev=n,this.head=n}else this.head=this.tail=new Qt(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={}}}]),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,r.key,r)}}var tn=function(){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 Zt(t)}var t,n,r;return t=e,(n=[{key:"getPatternForRegExp",value:function(e){var t=this.cache.get(e);return t||(t=new RegExp("^"+e),this.cache.put(e,t)),t}}])&&en(t.prototype,n),r&&en(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function nn(e,t){if(e<0||t<=0||t<e)throw new TypeError;return"{".concat(e,",").concat(t,"}")}function rn(e,t){var n=t.search(e);return n>=0?t.slice(0,n):t}var an="   ᠎ - \u2028\u2029   ",on="[".concat(an,"]"),sn="[^".concat(an,"]"),cn="[".concat("0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9","]"),ln="A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",dn="[".concat(ln,"]"),un=new RegExp(dn),pn="[".concat("$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩$¢£¥₩","]"),hn=new RegExp(pn),fn="[".concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦","]"),gn=new RegExp(fn),mn=new RegExp("[\0-€-ÿĀ-ſḀ-ỿƀ-ɏ̀-ͯ]");function yn(e){return!(!un.test(e)&&!gn.test(e))&&mn.test(e)}function En(e){return"%"===e||hn.test(e)}function In(e,t,n){var r=!0,a=Dt(e,n);if(a||(r=!1,a=Dt(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 An={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()||!Cn(e,n,r))},STRICT_GROUPING:function(e,t){var n=t.candidate,r=t.defaultCountry,a=t.metadata,o=t.regExpCache;return!(!e.isValid()||!Cn(e,n,a)||Sn(e,n)||!_n(e,{defaultCountry:r,metadata:a}))&&bn(e,n,a,vn,o)},EXACT_GROUPING:function(e,t){var n=t.candidate,r=t.defaultCountry,a=t.metadata,o=t.regExpCache;return!(!e.isValid()||!Cn(e,n,a)||Sn(e,n)||!_n(e,{defaultCountry:r,metadata:a}))&&bn(e,n,a,Nn,o)}};function Cn(e,t,n){for(var r=0;r<t.length-1;r++){var a=t.charAt(r);if("x"===a||"X"===a){var o=t.charAt(r+1);if("x"===o||"X"===o){if(r++,"NSN_MATCH"!==In(t.substring(r),e,n))return!1}else{var s=ne(t.substring(r));if(s){if(e.ext!==s)return!1}else if(e.ext)return!1}}}return!0}function _n(e,t){var n=t.defaultCountry,r=t.metadata;if("FROM_DEFAULT_COUNTRY"!==e.__countryCallingCodeSource)return!0;var a=new R(r);a.selectNumberingPlan(e.countryCallingCode);e.country||rt(e.countryCallingCode,{nationalNumber:e.nationalNumber,defaultCountry:n,metadata:a});var o=e.nationalNumber,s=We(a.numberingPlan.formats(),o);return!s.nationalPrefixFormattingRule()||(!!a.numberingPlan.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||(!s.usesNationalPrefix()||Boolean(e.nationalPrefix)))}function Sn(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 bn(e,t,n,r,a){throw new Error("This part of code hasn't been ported")}function Nn(e,t,n,r){throw new Error("This part of code hasn't been ported")}function vn(e,t,n,r){throw new Error("This part of code hasn't been ported")}var Pn=/[\\/] *x/;function Tn(e){return rn(Pn,e)}var On=/(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/,$n=/[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/,Rn=/^:[0-5]\d/;function Dn(e,t,n){if(On.test(e))return!1;if($n.test(e)){var r=n.slice(t+e.length);if(Rn.test(r))return!1}return!0}var xn="(\\[([",wn=")\\])]",Mn="[^".concat(xn).concat(wn,"]"),Ln="[".concat(xn).concat(u,"]"),Fn=new RegExp("^"+Ln),jn=nn(0,3),Un=new RegExp("^(?:[(\\[([])?(?:"+Mn+"+["+wn+"])?"+Mn+"+(?:["+xn+"]"+Mn+"+["+wn+"])"+jn+Mn+"*$"),kn=/\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;function Vn(e,t,n,r){if(Un.test(e)&&!kn.test(e)){if("POSSIBLE"!==r){if(t>0&&!Fn.test(e)){var a=n[t-1];if(En(a)||yn(a))return!1}var o=t+e.length;if(o<n.length){var s=n[o];if(En(s)||yn(s))return!1}}return!0}}function Bn(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)return;if("string"==typeof e)return Gn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gn(e,t)}(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 Gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wn(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,r.key,r)}}var Hn=W(),qn=["\\/+(.*)/","(\\([^(]*)","(?:".concat(on,"-|-").concat(on,")").concat(on,"*(.+)"),"[‒-―-]".concat(on,"*(.+)"),"\\.+".concat(on,"*([^.]+)"),"".concat(on,"+(").concat(sn,"+)")],Yn=nn(0,2),Kn=nn(0,4),zn=s+i,Xn=nn(0,zn),Jn="[".concat(d,"]")+Kn,Qn=cn+nn(1,zn),Zn="(?:"+Ln+Jn+")"+Yn+Qn+"(?:"+Jn+Qn+")"+Xn+"(?:"+Hn+")?",er=new RegExp("[^".concat("0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9").concat(ln,"#]+$")),tr=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,nr=function(){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||tr}).leniency)throw new TypeError("`leniency` is required");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`");if(this.text=t,this.options=n,this.metadata=r,this.leniency=An[n.leniency],!this.leniency)throw new TypeError('Unknown leniency: "'.concat(n.leniency,'"'));this.maxTries=n.maxTries,this.PATTERN=new RegExp(Zn,"ig"),this.state="NOT_READY",this.searchIndex=0,this.regExpCache=new tn(32)}var t,n,r;return t=e,n=[{key:"find",value:function(){for(var e;this.maxTries>0&&null!==(e=this.PATTERN.exec(this.text));){var t=e[0],n=e.index;if(Dn(t=Tn(t),n,this.text)){var r=this.parseAndVerify(t,n,this.text)||this.extractInnerMatch(t,n,this.text);if(r){if(this.options.v2)return{startsAt:r.startsAt,endsAt:r.endsAt,number:r.phoneNumber};var a=r.phoneNumber,o={startsAt:r.startsAt,endsAt:r.endsAt,phone:a.nationalNumber};return a.country?o.country=a.country:o.countryCallingCode=a.countryCallingCode,a.ext&&(o.ext=a.ext),o}}this.maxTries--}}},{key:"extractInnerMatch",value:function(e,t,n){for(var r,a=Bn(qn);!(r=a()).done;)for(var o=r.value,s=!0,i=void 0,c=new RegExp(o,"g");this.maxTries>0&&null!==(i=c.exec(e));){if(s){var l=rn(er,e.slice(0,i.index)),d=this.parseAndVerify(l,t,n);if(d)return d;this.maxTries--,s=!1}var u=rn(er,i[1]),p=e.indexOf(u,i.index),h=this.parseAndVerify(u,t+p,n);if(h)return h;this.maxTries--}}},{key:"parseAndVerify",value:function(e,t,n){if(Vn(e,t,n,this.options.leniency)){var r=Dt(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.lastMatch?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}}],n&&Wn(t.prototype,n),r&&Wn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function rr(){for(var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=new nr(t,n,r),o=[];a.hasNext();)o.push(a.next());return o}function ar(){return a(rr,arguments)}function or(){var e,t,n,r=Nt(arguments),a=r.text,o=r.options,s=r.metadata,i=new nr(a,o,s);return e={},t=Symbol.iterator,n=function(){return{next:function(){return i.hasNext()?{done:!1,value:i.next()}:{done:!0}}}},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sr(){return a(or,arguments)}function ir(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?ir(Object(n),!0).forEach((function(t){lr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ir(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dr(){for(var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=new nr(t,cr(cr({},n),{},{v2:!0}),r),o=[];a.hasNext();)o.push(a.next());return o}function ur(){return a(dr,arguments)}function pr(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 hr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pr(Object(n),!0).forEach((function(t){fr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gr(){var e=Nt(arguments),t=e.text,n=e.options,r=e.metadata,a=new nr(t,hr(hr({},n),{},{v2:!0}),r);return fr({},Symbol.iterator,(function(){return{next:function(){return a.hasNext()?{done:!1,value:a.next()}:{done:!0}}}}))}function mr(){return a(gr,arguments)}function yr(e,t){return nr.call(this,e,t,r)}function Er(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,r.key,r)}}yr.prototype=Object.create(nr.prototype,{}),yr.prototype.constructor=yr;var Ir=function(){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}var t,n,r;return t=e,(n=[{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.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=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}}])&&Er(t.prototype,n),r&&Er(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ar(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)return;if("string"==typeof e)return Cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cr(e,t)}(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 Cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _r="x",Sr=new RegExp(_r);function br(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function Nr(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 o=0,s=t;o<s.length;o++){var i=s[o];a+=e.slice(r,i),r=i+1}return a}(e.slice(0,t))}function vr(e,t,n){var r=n.metadata,a=n.shouldTryNationalPrefixFormattingRule,o=n.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return function(e,t,n){var r=n.metadata,a=n.shouldTryNationalPrefixFormattingRule,o=n.getSeparatorAfterNationalPrefix;e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode;if(a(t)){var s=Pr(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:o,metadata:r});if(s)return s}return Pr(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:o,metadata:r})}(e,t,{metadata:r,shouldTryNationalPrefixFormattingRule:a,getSeparatorAfterNationalPrefix:o})}function Pr(e,t,n){var r=n.metadata,a=n.useNationalPrefixFormattingRule,o=n.getSeparatorAfterNationalPrefix,s=Oe(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:a,metadata:r});if(a||(e.nationalPrefix?s=e.nationalPrefix+o(t)+s:e.complexPrefixBeforeNationalSignificantNumber&&(s=e.complexPrefixBeforeNationalSignificantNumber+" "+s)),function(e,t){return ne(e)===t.getNationalDigits()}(s,e))return s}function Tr(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,r.key,r)}}var Or=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,(n=[{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([xr(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(Dr);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 o=this.getContext().branches;o.push(xr(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:o});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(xr(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:$r(r)});break;default:throw new Error("Unknown operator: ".concat(n))}a&&this.parsePattern(a)}else{if(Rr.test(e))throw new Error("Illegal characters found in a pattern: ".concat(e));this.getContext().instructions=this.getContext().instructions.concat(e.split(""))}}}])&&Tr(t.prototype,n),r&&Tr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function $r(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,o=r;o<=a;)t.push(String.fromCharCode(o)),o++}else t.push(e[n]);n++}return t}var Rr=/[\(\)\[\]\?\:\|]/,Dr=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function xr(e){return 1===e.length?e[0]:e}function wr(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)return;if("string"==typeof e)return Mr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mr(e,t)}(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 Mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lr(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,r.key,r)}}var Fr=function(){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 Or).parse(t)}var t,n,r;return t=e,n=[{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=jr(e.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||t)return n}}],n&&Lr(t.prototype,n),r&&Lr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function jr(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(),o=0;o<t.length;){var s=jr(a,t[o],n&&o===t.length-1);if(!s)return;if(s.overflow)return s;if(!s.match){if(s.partialMatch)return{partialMatch:!0};throw new Error("Unsupported match result:\n".concat(JSON.stringify(s,null,2)))}if(0===(a=a.slice(s.matchedChars.length)).length)return o===t.length-1?{match:!0,matchedChars:e}:{partialMatch:!0};o++}return n?{overflow:!0}:{match:!0,matchedChars:e.slice(0,e.length-a.length)}}switch(t.op){case"|":for(var i,c,l=wr(t.args);!(c=l()).done;){var d=jr(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=wr(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 Ur(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)return;if("string"==typeof e)return kr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kr(e,t)}(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 kr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vr(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,r.key,r)}}var Br=br("9",15),Gr=/[- ]/,Wr=function(){return/\[([^\[\]])*\]/g},Hr=function(){return/\d(?=[^,}][^,}])/g},qr=new RegExp("["+d+"]*\\$1["+d+"]*(\\$\\d["+d+"]*)*$"),Yr=function(){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()}var t,n,r;return t=e,n=[{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,r))for(var o,s=Ur(this.matchingFormats);!(o=s()).done;){var i=o.value,c=vr(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,_r),t),this.populatedNationalNumberTemplate=c,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(_r),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,o=n,s=o.length-3;s<0&&(s=0),this.matchingFormats=this.matchingFormats.filter((function(e){return t.formatSuits(e,a,r)&&t.formatMatches(e,o,s)})),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 Fr(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?"break":qr.test(n.getFormatFormat(r,e.international))?n.createTemplateForFormat(r,e)?(n.chosenFormat=r,"break"):(n.matchingFormats=n.matchingFormats.filter((function(e){return e!==r})),"continue"):"continue"},a=Ur(this.matchingFormats.slice());!(t=a()).done;){var o=r();if("break"===o)break}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()&&Gr.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(_r,t+1),n++;return Nr(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,_r)+br(_r,t.callingCode.length)+" "+e:this.template=e}},{key:"getTemplateForFormat",value:function(e,t){var n=t.nationalSignificantNumber,r=t.international,a=t.nationalPrefix,o=t.complexPrefixBeforeNationalSignificantNumber,s=e.pattern();s=s.replace(Wr(),"\\d").replace(Hr(),"\\d");var i=Br.match(s)[0];if(!(n.length>i.length)){var c=new RegExp("^"+s+"$"),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(Te,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/,_r),h--}var f=i.replace(new RegExp(s),u).replace(new RegExp("9","g"),_r);return d||(o?f=br(_r,o.length)+" "+f:a&&(f=br(_r,a.length)+this.getSeparatorAfterNationalPrefix(e)+f)),r&&(f=Pe(f)),f}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,n){for(var r,a=Ar(n.split(""));!(r=a()).done;){var o=r.value;if(e.slice(t+1).search(Sr)<0)return;t=e.search(Sr),e=e.replace(Sr,o)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(t)return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],Nr(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}}}],n&&Vr(t.prototype,n),r&&Vr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kr(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)return;var r,a,o=[],s=!0,i=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){i=!0,a=e}finally{try{s||null==n.return||n.return()}finally{if(i)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zr(e,t)}(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 zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}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,r.key,r)}}var Jr=new RegExp("^"+("["+d+c+"]+")+"$","i"),Qr="(?:[++]["+d+c+"]*|["+d+c+"]+)",Zr=new RegExp("[^"+d+c+"]+.*$"),ea=/[^\d\[\]]/,ta=function(){function e(t){var n=t.defaultCountry,r=t.defaultCallingCode,a=t.metadata,o=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=o}var t,n,r;return t=e,(n=[{key:"input",value:function(e,t){var n,r=function(e){var t=function(e){var t=function(e){var t,n=e.search(Qr);if(!(n<0))return"+"===(e=e.slice(n))[0]&&(t=!0,e=e.slice(1)),e=e.replace(Zr,""),t&&(e="+"+e),e}(e)||"";return"+"===t[0]?[t.slice(1),!0]:[t]}(e),n=Kr(t,2),r=n[0],a=n[1];return Jr.test(r)||(r=""),[r,a]}(e),a=Kr(r,2),o=a[0],s=a[1],i=ne(o);return s&&(t.digits||(t.startInternationalNumber(),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=ve("+"+e.getDigitsWithoutInternationalPrefix(),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&&ea.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var n=Se(e,this.metadata),r=n.nationalPrefix,a=n.nationalNumber,o=n.carrierCode;if(a!==e)return this.onExtractedNationalNumber(r,o,a,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,n){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,n);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var r=Se(e,this.metadata),a=r.nationalPrefix,o=r.nationalNumber,s=r.carrierCode;if(o!==t)return this.onExtractedNationalNumber(a,s,o,e,n),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,n,r,a){var o,s,i=r.lastIndexOf(n);if(i>=0&&i===r.length-n.length){s=!0;var c=r.slice(0,i);c!==e&&(o=c)}a({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:n,nationalSignificantNumberMatchesInput:s,complexPrefixBeforeNationalSignificantNumber:o}),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=Ne(e.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=t.countryCallingCode;if(t.number,n)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:n}),!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)}))}}])&&Xr(t.prototype,n),r&&Xr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function na(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)return;var r,a,o=[],s=!0,i=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){i=!0,a=e}finally{try{s||null==n.return||n.return()}finally{if(i)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ra(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ra(e,t)}(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 ra(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aa(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,r.key,r)}}var oa=function(){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=na(this.getCountryAndCallingCode(t),2),a=r[0],o=r[1];this.defaultCountry=a,this.defaultCallingCode=o,this.reset()}var t,n,r;return t=e,(n=[{key:"getCountryAndCallingCode",value:function(e){var t,n;return e&&(b(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 Ir({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 Yr({state:this.state,metadata:this.metadata}),this.parser=new ta({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.complexPrefixBeforeNationalSignificantNumber,r=e.nationalPrefix,a=t,o=n||r;return o&&(a=o+a),a}},{key:"getNonFormattedNumber",value:function(){var e=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(e?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,_r)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(rt(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{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,a=this._getCountry();if(t&&(a||r)){if(a&&a===this.defaultCountry){var o=new R(this.metadata.metadata);o.selectNumberingPlan(a);var s=o.numberingPlan.callingCode(),i=this.metadata.getCountryCodesForCallingCode(s);if(i.length>1){var c=tt(t,{countries:i,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});c&&(a=c)}}var l=new Xe(a||r,t,this.metadata.metadata);return n&&(l.carrierCode=n),l}}},{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:"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()||""}}])&&aa(t.prototype,n),r&&aa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function sa(e){return oa.call(this,e,r)}function ia(){return a(V,arguments)}function ca(e){return new R(e).getCountries()}function la(){return a(ca,arguments)}function da(){return a(k,arguments)}function ua(){return a(U,arguments)}function pa(){return R.call(this,r)}function ha(e,t,n){if(t[e])return new Xe(e,t[e],n)}function fa(){return a(ha,arguments)}function ga(e,t,n){return n||(n=t,t=void 0),new oa(t,n).input(e)}function ma(){return a(ga,arguments)}function ya(e){return Xe.call(this,e,r)}function Ea(){var e=Nt(arguments);return mt(e.text,e.options,e.metadata)}function Ia(){return a(Ea,arguments)}function Aa(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)return;var r,a,o=[],s=!0,i=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){i=!0,a=e}finally{try{s||null==n.return||n.return()}finally{if(i)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ca(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ca(e,t)}(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 Ca(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _a(){var e=function(e){var t,n,r,a,o=Aa(Array.prototype.slice.call(e),5),s=o[0],i=o[1],c=o[2],l=o[3],d=o[4];if("string"==typeof s)if("string"==typeof c)n=c,d?(r=l,a=d):a=l,t=mt(s,{defaultCountry:i,extended:!0},a);else{if("string"!=typeof i)throw new Error("`format` argument not passed to `formatNumber(number, format)`");n=i,l?(r=c,a=l):a=c,t=mt(s,{extended:!0},a)}else{if(!b(s))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");t=s,n=i,l?(r=c,a=l):a=c}"International"===n?n="INTERNATIONAL":"National"===n&&(n="NATIONAL");return{input:t,format:n,options:r,metadata:a}}(arguments);return Be(e.input,e.format,e.options,e.metadata)}function Sa(){return a(_a,arguments)}function ba(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)return;var r,a,o=[],s=!0,i=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){i=!0,a=e}finally{try{s||null==n.return||n.return()}finally{if(i)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Na(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Na(e,t)}(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 Na(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function va(){var e=Pa(arguments),t=e.input,n=e.options,r=e.metadata;if(t.phone)return ye(t,n,r)}function Pa(e){var t,n,r=ba(Array.prototype.slice.call(e),4),a=r[0],o=r[1],s=r[2],i=r[3],c={};if("string"==typeof a)b(o)?(s?(c=o,n=s):n=o,t=X(a)?mt(a,void 0,n):{}):(i?(c=s,n=i):n=s,t=X(a)?mt(a,{defaultCountry:o},n):{});else{if(!b(a))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");t=a,s?(c=o,n=s):n=o}return{input:t,options:c,metadata:n}}function Ta(){return a(va,arguments)}function Oa(){var e=Pa(arguments),t=e.input,n=e.options,r=e.metadata;return!!(t.phone||n&&n.v2)&&ue(t,n,r)}function $a(){return a(Oa,arguments)}function Ra(){var e=Pa(arguments),t=e.input,n=e.options,r=e.metadata;return!!t.phone&&Ie(t,n,r)}function Da(){return a(Ra,arguments)}function xa(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&&Ie(e,n,r)}(X(e)?mt(e,{defaultCountry:t},n):{},t,void 0,n)}function wa(){return a(xa,arguments)}function Ma(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,r.key,r)}}sa.prototype=Object.create(oa.prototype,{}),sa.prototype.constructor=sa,pa.prototype=Object.create(R.prototype,{}),pa.prototype.constructor=pa,ya.prototype=Object.create(Xe.prototype,{}),ya.prototype.constructor=ya;W();var La=new RegExp("^["+l+"]+"),Fa=new RegExp("["+d+"]+$");function ja(e,t,n){void 0===t&&(t={});var r,a,o,s=new Ua(e,t,n);return r={},a=Symbol.iterator,o=function(){return{next:function(){return s.hasNext()?{done:!1,value:s.next()}:{done:!0}}}},a in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o,r}var Ua=function(){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(K,"ig")}var t,n,r;return t=e,n=[{key:"find",value:function(){var e=this.regexp.exec(this.text);if(e){var t=e[0],n=e.index;t=t.replace(La,""),n+=e[0].length-t.length,t=Tn(t=t.replace(Fa,""));var r=this.parseCandidate(t,n);return r||this.find()}}},{key:"parseCandidate",value:function(e,t){if(Dn(e,t,this.text)&&Vn(e,t,this.text,this.options.extended?"POSSIBLE":"VALID")){var n=mt(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}}],n&&Ma(t.prototype,n),r&&Ma(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ka(){var e=Nt(arguments);return function(e,t,n){void 0===t&&(t={});for(var r=new Ua(e,t,n),a=[];r.hasNext();)a.push(r.next());return a}(e.text,e.options,e.metadata)}function Va(){var e=Nt(arguments);return ja(e.text,e.options,e.metadata)}function Ba(){return a(ka,arguments)}function Ga(){return a(Va,arguments)}function Wa(e,t){Ua.call(this,e,t,r)}Wa.prototype=Object.create(Ua.prototype,{}),Wa.prototype.constructor=Wa}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r](o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},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})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e={};n.r(e),n.d(e,{buildContextName:()=>H,buildModalContext:()=>z,buildTransientContextName:()=>q,getContainerIdFromContext:()=>J,getParentContext:()=>X,getParentContextName:()=>W,getTargetFromContext:()=>K,getTransientContext:()=>Y});var t={};n.r(t),n.d(t,{getResolvedTargetName:()=>yt,getRoutingInfo:()=>Et,getSemanticURLFromRoutingInfo:()=>It});var r={};n.r(r),n.d(r,{evaluate:()=>zt,handleChange:()=>Yt,hasDeclareExpression:()=>qt,updateDeclareExpressions:()=>Kt});var a={};n.r(a),n.d(a,{publishExpressions:()=>xr,publishResponse:()=>wr});var o={};n.r(o),n.d(o,{hasBrowserEnv:()=>ao,hasStandardBrowserEnv:()=>so,hasStandardBrowserWebWorkerEnv:()=>io,navigator:()=>oo,origin:()=>co});var s={};n.r(s),n.d(s,{doesRestApiExist:()=>ec,getCancelTokenSource:()=>tc,getCaseApi:()=>ac,getHeaderProcessor:()=>Ji,invokeCustomRestApi:()=>Zi,invokeRestApi:()=>Qi,isRequestCanceled:()=>nc,registerInterceptor:()=>rc});var i={};n.r(i),n.d(i,{CONTAINER_NAMES:()=>du,CONTAINER_TYPES:()=>lu,addRootContainerItem:()=>Gu,areContainerItemsPresent:()=>mu,clearTransientData:()=>zu,closeContainerItem:()=>Bu,getActiveContainerItemContext:()=>Pu,getActiveContainerItemIDFromRoutingInfo:()=>ip,getActiveContainerItemName:()=>Su,getActiveContext:()=>rp,getChildContainerItems:()=>Tu,getChildContainers:()=>Ou,getChildContainersContexts:()=>$u,getContainerAPI:()=>Qu,getContainerAccessOrder:()=>gu,getContainerData:()=>pu,getContainerItemByKey:()=>Au,getContainerItemData:()=>hu,getContainerItemName:()=>Eu,getContainerItems:()=>fu,getContainerLimit:()=>Mu,getContainerParentContext:()=>sp,getContainerType:()=>_u,getContextByTargetAndKey:()=>op,getDataContextName:()=>vu,getFlowContainer:()=>lp,getLeastRecentlyUsedNonDirtyContainerItemID:()=>ku,getParentContainerItem:()=>cp,getRootContainerName:()=>np,getSuggestionContexts:()=>Ru,getTargetFromContainerItemID:()=>Vu,getTransientItems:()=>qu,hasContainerItems:()=>wu,isContainerDirty:()=>Uu,isContainerInitialized:()=>Cu,isContainerItemActive:()=>bu,isContainerItemContextBeingUsedInOtherContainers:()=>Hu,isContainerItemExists:()=>yu,isContainerLimitReached:()=>Fu,isContainerMultipleMode:()=>xu,isContainerSingleMode:()=>Du,purgeTransientData:()=>Xu,removeContainer:()=>Zu,replaceTransientData:()=>Ku,resetContainersPayload:()=>ju,setContainerLimit:()=>Lu,updateCaseContextEtag:()=>tp,updateParentLastUpdateTime:()=>ap,updateRelatedContextEtag:()=>ep,updateTransientData:()=>Yu});var c={};n.r(c),n.d(c,{getAdditionalInfo:()=>ih,getDataPageKeys:()=>ah,getDataPageMetadata:()=>Xp,getEmbeddedPropertyMetadata:()=>Gp,getFieldParameters:()=>eh,getFieldsByClassName:()=>Zp,getGenAICoach:()=>nh,getInsight:()=>Qp,getLookUpDataPage:()=>oh,getLookUpDataPageInfo:()=>sh,getParagraph:()=>th,getPersonalizationMetadata:()=>Jp,getPropertyMetadata:()=>Bp,getResolvedFieldMetadata:()=>ch,getSavableDataPage:()=>rh,isViewExists:()=>Kp,mergeStore:()=>Vp,resolveNavigation:()=>zp,resolveView:()=>Yp,updateNavigationStore:()=>Hp,updateStores:()=>qp,updateViewStore:()=>Wp});var l={};n.r(l),n.d(l,{dispatch:()=>gh,doesContextExist:()=>$h,getActionType:()=>_h,getContextValue:()=>Ah,getDataObject:()=>mh,getReferenceTokens:()=>ph,getSharedDataObject:()=>yh,getStore:()=>fh,getValue:()=>Ih,isMergeable:()=>bh,lookupContextValue:()=>Ch,mergeDeep:()=>vh,performReplace:()=>Nh,removeItem:()=>Sh,replaceValue:()=>Th,resetStore:()=>Oh,setStore:()=>hh,updateValue:()=>Ph});var d={};n.r(d),n.d(d,{activateContainerItem:()=>sf,addContainerItem:()=>Xh,addMessages:()=>cf,addSharedData:()=>Ef,addTransientItem:()=>Jh,addWork:()=>qh,clearTransientData:()=>Zh,createWork:()=>kh,error:()=>yf,finishAssignment:()=>hf,initContainers:()=>Kh,listAction:()=>Af,loadView:()=>Wh,mergeData:()=>Bh,openAssignment:()=>ff,openWorkByHandle:()=>Yh,postProcess:()=>mf,purgeTransientData:()=>tf,removeAllTransientItems:()=>df,removeContainerItem:()=>lf,removeSharedData:()=>If,removeTransientItem:()=>uf,replaceContainerItem:()=>pf,replaceTransientData:()=>ef,resetContainers:()=>zh,resetLoading:()=>af,setLoading:()=>rf,setSharedProperty:()=>_f,setStateProperty:()=>Sf,showCasePreview:()=>Cf,showHarness:()=>Gh,showHistory:()=>gf,showPage:()=>Hh,upMergeAndRemoveContainerItem:()=>of,updateContainerItem:()=>nf,updateTransientData:()=>Qh});var u={};n.r(u),n.d(u,{fetchViewResources:()=>yI,updateViewResources:()=>mI});var p=n(216),h=n.n(p);let f,g,m;const y=e=>{e&&(f=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},f.BASEURL=e.server,f.ACTIONURL=e["action-end-point"],f.DATAURL=e["data-end-point"],m=e.reAuthUrl)},E=()=>m,I=()=>f.BASEURL,A=e=>fetch(`${f.BASEURL}${f.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),C=e=>{g=e},_=()=>g;var S=n(953),b=n(521),N=n.n(b),v=n(928),P=n.n(v),T=n(188),O=n.n(T),$=n(835),R=n.n($),D=n(692),x=n.n(D),w=n(529),M=n.n(w);const L=new class{constructor(){this.needsMapping=!1}getNeedsMapping(){return this.needsMapping}setNeedsMapping(e){this.needsMapping=e}map(e){return this.needsMapping?this.replacer(e):e}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}},F={APP:{APP:"app",ROOT:"root",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"},RESOURCE_STATUS:{CREATE:"CREATE",UPDATE:"UPDATE",OPEN_FLOW_ACTION:"OPEN_FLOW_ACTION"},VIEW_NAMES:{PY_CASE_TAB:"pyCaseTab",DATA_OBJECT_CREATE_VIEW:"Create",DATA_OBJECT_EDIT_VIEW:"pyEdit",PY_DATA_PREVIEW:"pyDataPreview",PY_DETAILS:"pyDetails"},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:"D_pyGetUserWorkListByUserId",D__WORK_BASKET:"D_WorkBasket",D__PY_MY_WORK_LIST:"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:"pzCreateDetails",PREVIEW_VIEW_NAME:"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"},CASE_INFO:{CASE_INFO:"caseInfo",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_NAME:"caseInfo.name",CASE_INFO_ID:"caseInfo.ID",CASE_INFO_CLASSID:"caseInfo.content.classID",CASE_TYPE_ID:"caseInfo.caseTypeID",CASE_TYPE_NAME:"caseInfo.caseTypeName",CASE_INFO_PZINSKEY:"caseInfo.content.pzInsKey",CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:"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:"caseInfo.content.pyApprovalResult",DUPLICATECASEFLAG:"caseInfo.content.pyDuplicateCaseActions",DUPLICATECASEID:"caseInfo.content.pyDuplicateID",DUPLICATECASEINSKEY:"caseInfo.content.pyDuplicateCaseReference.pzInsKey",HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",GETNEXTWORK:"caseInfo.confirmationLinks.getNextWork",ACTION_REFRESH_CONDITIONS:"caseInfo.assignments[0].actions[0].refreshConditions",IS_LOCAL_ACTION:"caseInfo.isLocalAction",BUSINESS_ID:"caseInfo.businessID",IS_FIRST_ASSIGNMENT:"caseInfo.isFirstAssignment"},ACTIONS:{ACTION_ID:"actionID",ACTIONS:"availableActions",DELETEAVIALACTIONS:"deleteAvailActions",FLOWACTION:"FlowAction",DATA_PAGES:{D_PY_ADDITIONAL_CASE_ACTIONS:"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:"pyTransferAssignment"},CONTENT:"content",MODAL:"modal",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:"context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime",SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:"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",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_LOCALACTION_SUBMISSION:"localActionSubmit",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_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted"},CASE_EVENTS:{CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW:"caseAttachmentsUpdateFromCaseview",CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW:"caseFollowerUpdateByOperatorFromCaseview",CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET:"caseFollowerUpdateByOperatorFromWidget",CASE_CREATED:"caseCreated",CREATE_STAGE_DONE:"caseCreatedDone",CREATE_STAGE_CANCELLED:"caseCancelled",CREATE_STAGE_SAVED:"caseSaved",CREATE_STAGE_DELETED:"caseDeleted",ASSIGNMENT_SUBMISSION:"assignmentSubmission",END_OF_ASSIGNMENT_PROCESSING:"endOfAssignmentProcessing",CLOSE_CONFIRM_VIEW:"closeConfirmView",CASE_OPENED:"caseOpened",CASE_CLOSED:"caseClosed",ASSIGNMENT_OPENED:"assignmentOpened",CASE_PREVIEW:"casePreview",CURRENT_ASSIGNMENT_UPDATED:"currentAssignmentUpdated",CASE_LOCK_EVENT:"caseLockEvent",NOTIFICATION_UPDATED:"notificationUpdated"},BOOTSTRAP_SHELL_EVENTS:{CONSTELLATION_LOADED:"CONSTELLATION_LOADED"},CONTAINER_EVENTS:{CLOSE_CONTAINER_ITEM:"CLOSE_CONTAINER_ITEM",CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM:"CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM"},DISPLAY_CASE_CREATED_TOASTER:"displayCaseCreatedToaster",DATA_EVENTS:{DATA_OBJECT_CREATED:"dataObjectCreated",DATA_OBJECT_DELETED:"dataObjectDeleted",DATA_OBJECT_UPDATED:"dataObjectUpdated"},FETCH_SUCCESS:"fetchSuccess",REVERSE_COEXISTENCE_EVENTS:{HANDLE_DISCARD:"handleDiscard",CHECK_IS_FORM_DIRTY:"checkIsFormDirty"},TIMEOUT_REMINDER:"sessionAboutToTimeout",RESET_TIMER:"resetInactivityTimer"},CONTAINER_TYPE:{MULTIPLE:"multiple",SINGLE:"single",HYBRID:"HybridViewContainer"},REMOTE_SYSTEM_ID:"RemoteSystemID",LIST_SELECTION_MODE:{MULTI:"multi",SINGLE:"single",MULTI_ON_HOVER:"multi_on_hover"},SUBMISSION_FAILURE_TYPE:{FORM_VALIDATION_ERROR:"formValidationError"},USER_SETTINGS:{UTILITY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.utilityPanelExpanded",SUMMARY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.summaryPanelExpanded",ASSIGNMENT_COLLAPSED_STATE_PATH:"presentation.templates.CaseView.assignmentWidgetCollapsed",CASE_VIEW_PATH:"presentation.templates.CaseView"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:"pyEmbedAssignment",PY_DETAILS:"pyDetails"}},j={CONTEXT:"context",AJAXCONTAINER:"primary",VIEW_CONTAINER:"ViewContainer",APP_SHELL:"AppShell",ROOT_CONTAINER:"RootContainer",HYBRID:"hybrid",HYBRID_VIEW_CONTAINER:"HybridViewContainer",HYBRID_ROOT_CONTAINERNAME:"hybridRootContainerName",MODAL_VIEW_CONTAINER:"ModalViewContainer",FLOW_CONTAINER:"FlowContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",OBJECT_PAGE:"ObjectPage",CASE_CREATE_STAGE:"CaseCreateStage",CASE_VIEW:"CaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",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",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",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_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",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",ERROR_FIELD_IN_PAGE:"erroneousInputOutputFieldInPage",ERROR_IN_PAGE_IDENTIFIER:"erroneousInputOutputIdentifier",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",DATA:"data",OPTIONS:"options",VIEWS:"uiResources.resources.views",NAVIGATIONS:"uiResources.resources.navigations",COMPONENTS:"uiResources.components",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",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",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:"pyDetails",PY_CONFIRM:"pyConfirm",LIST_ACTIONS:{INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE",DELETE_ALL:"DELETE ALL",MOVE:"MOVE",SELECT:"SELECT",DESELECT:"DESELECT"},LIST_ACTIONS_TYPE:{SELECT_DESELECT:"SELECT_DESELECT",DESELECT_ALL:"DESELECT_ALL"},ENV_INFO_KEYS:{APPLICATION_NAME:"APPLICATION_NAME",APPLICATION_DESC:"APPLICATION_DESC",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",CONTEXT_DATA_MODAL_VIEW:{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"},DATA_CLASS_NOT_FOUND:"Data object class not found",PRIORITY:{CRITICAL:100,HIGH:500,MEDIUM:1e3,LOW:2e3,TRIVIAL:3e3},...F,EMBED:"EMBED",getProperty:e=>L.map(e)},U="pyRemoteCaseDetails";class k{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=>Lh.getProperty(".RemoteSystemID",j.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"===k.getRemoteCase(e)?.RemoteApplicationType;static setAdditionalParameters=()=>{const e=Ap.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID}}const V=k,B={},G=new Map,W=e=>{let t=j.EMPTY_STRING;return t=e&&e.includes(j.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},H=(e,t,n=!1)=>{let r=j.EMPTY_STRING;if(t&&e){let a=`${t}${j.FORWARD_SLASH_STRING}${e}`;const o=pu(a);if(o||t!==j.APP.APP&&t!==j.APP.ROOT)if(o){if(n&&B[a])return r=`${a}${j.UNDERSCORE_STRING}${B[a]}`,r;B[a]?B[a]+=1:B[a]=1,r=`${a}${j.UNDERSCORE_STRING}${B[a]}`}else r=H(e,W(t));else a=`${t}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,B[a]?B[a]+=1:B[a]=1,r=`${a}${j.UNDERSCORE_STRING}${B[a]}`}return r},q=(e,t)=>{if(e&&t){const n=(G[t]?.[e]??0)+1;return G[t]||(G[t]={}),G[t][e]=n,`${t}${j.FORWARD_SLASH_STRING}${e}_${n}`}return""},Y=(e,t)=>{if(e&&t){const n=G[t]?.[e];return n?`${t}${j.FORWARD_SLASH_STRING}${e}_${n}`:q(e,t)}return""},K=e=>{let t=j.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},z=(e,t)=>{if(null===e)return t;const[,n]=t.split(j.FORWARD_SLASH_STRING);return e+j.FORWARD_SLASH_STRING+n},X=e=>{const t=e.indexOf(j.FORWARD_SLASH_STRING),n=e.lastIndexOf(j.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},J=e=>{const t=e.split(j.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+j.FORWARD_SLASH_STRING+t[2]},Q="SET_PROPERTY",Z="REPLACE_PROPERTY",ee="FIELD_CHANGE",te="LOAD_VIEW",ne="SHOW_PAGE",re="SHOW_DATA",ae="SHOW_INSIGHT",oe="SHOW_DASHBOARD",se="SET_LOADING",ie="RESET_LOADING",ce="SET_SHARED_PROPERTY",le="CREATE_WORK",de="OPEN_WORK_BY_HANDLE",ue="UPDATE_DOCUMENT",pe="FINISH_ASSIGNMENT",he="CANCEL_ASSIGNMENT",fe="OPEN_ASSIGNMENT",ge="MERGE_DATA",me="REMOVE_ITEM",ye="GET_DATAOBJECT_ACTIONS",Ee="SHOW_HISTORY",Ie="ERROR",Ae="INIT_CONTAINERS",Ce="RESET_CONTAINERS",_e="ADD_CONTAINER_ITEM",Se="REMOVE_CONTAINER_ITEM",be="ADD_TRANSIENT_ITEM",Ne="UPDATE_TRANSIENT_DATA",ve="REMOVE_TRANSIENT_ITEM",Pe="REMOVE_ALL_TRANSIENT_ITEMS",Te="CLEAR_TRANSIENT_DATA",Oe="PURGE_TRANSIENT_DATA",$e="REPLACE_TRANSIENT_DATA",Re="ACTIVATE_CONTAINER_ITEM",De="UPDATE_CONTAINER_ITEM",xe="UPMERGE_AND_REMOVE_CONTAINER_ITEM",we="REPLACE_CONTAINER_ITEM",Me="ACTIVATE_MODAL_CONTAINER_ITEM",Le="REMOVE_CONTAINER",Fe="ADD_SUGGESTION_CONTEXT",je="showView",Ue="showData",ke="showInsight",Ve="showDashboard",Be="openWorkByHandle",Ge="openAssignment",We="createNewWork",He="SHOW_CANCEL_ALERT",qe="openLocalAction",Ye="openProcessAction",Ke="caseWideActions",ze="openBulkAction",Xe="performBulkAction",Je="launchAssignment",Qe="ADD_MESSAGES",Ze="CLEAR_MESSAGES",et="RESET_STORE",tt="FETCH_DATAPAGE",nt="ADD_SHARED_DATA",rt="REMOVE_SHARED_DATA",at="LIST_ACTION",ot="DELETE_CASE_SUMMARY",st="ALTER_BLOCKING_ACTION_COUNT",it="CREATE_DATA_OBJECT",ct="DELETE_DATA_OBJECT",lt="VIEW_DATA_OBJECT",dt="UPDATE_DATA_OBJECT",ut="OPEN_DATA_OBJECT_ACTION",pt="SUBMIT_DATA_OBJECT_ACTION",ht="OPEN_EMBEDDED_DATA_MODAL",ft="SUBMIT_EMBEDDED_DATA_MODAL",gt="FILL_FORM_WITH_AI",mt="openCase",yt=(e,t)=>{if(!e||!t)return null;let n,r=j.EMPTY_STRING;return t&&(r=`${t}${j.FORWARD_SLASH_STRING}${e}`,n=pu(r),n||t.includes("/")?n||(r=yt(e,W(t))):r=`${t}${j.FORWARD_SLASH_STRING}${e}`),r},Et=(e,t)=>{const n=yt(e,t);return n&&pu(n)?pu(n):{}},It=(e,t)=>Ip.getSemanticURL(je,{page:e},t);const At=new class{error=e=>{console.error(e)}};class Ct{constructor(e,t,n){this._grammar=e,this._state="expectOperand",this._tree=null,this._exprStr=t||"",this._endState=n||{}}static _setParent(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}_addToken(e){const t=Ot[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=Tt[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}=Ot[this._state];this._subParser=new Ct(this._grammar,e,t)}_endSubExpression(){Ot[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,Ct._setParent(e,this._position)):this._tree=e,this._position=e}}const _t=Ct,St="identifier",bt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e&&t},Nt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e||t},vt={">":{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)=>e===t},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e!==t},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{let{value:t}=e;return"true"!==t&&"false"!==t||(t="true"===t),!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":bt,AND:bt,and:bt,"||":Nt,OR:Nt,or:Nt,CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.includes(t)},NOT_CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.includes(t)},STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.startsWith(t)},NOT_STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.startsWith(t)},ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.endsWith(t)},NOT_ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.endsWith(t)},IS_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!e},IS_NOT_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!!e},IS_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>t.split(",").includes(e)},IS_NOT_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!t.split(",").includes(e)}},Pt={BinaryExpression:function(e){const t=[];let n="";return t[0]=this.evaluateAST(e.left),e.left.operationType===St&&this._context&&(n=this._context.getFieldMetadata(e.left.value.substring(1))?.type??""),t[1]=e.right?this.evaluateAST(e.right,n):"",this._grammar[e.operator].evaluate(t[0],t[1])},identifier:function(e){return this._localDataObject?this._localDataObject[e.value.substring(1)]??"":this._contextTreeNodeContext?Lh.getLitePropertyValue(this._contextTreeNodeContext,e.value):this._context.getValue(e.value)??""},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){return this._grammar[e.operator].evaluate(e.right)}},Tt={unaryOperator:function(e){this.setPositionInAST({operationType:"UnaryExpression",operator:e.value})},binaryOperator:function(e){const{precedence:t}=this._grammar[e.value];let n=this._position._parent;for(;n&&n.operator&&this._grammar[n.operator].precedence>=t;)this._position=n,n=n._parent;const r={operationType:"BinaryExpression",operator:e.value,left:this._position};_t._setParent(this._position,r),this._position=n,this.setPositionInAST(r)},identifier:function(e){const t={operationType:St,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){this.setPositionInAST(e)}},Ot={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:St},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Tt.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},$t=["binaryOperator","unaryOperator","openParenthesis"],Rt=/^\s*$/,Dt=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,xt=/\\\\/,wt=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Mt=["[a-zA-Z_.\\$][(0-9)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]+)"],Lt=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class Ft{constructor(e){this._grammar=e}static _isNegative(e){return $t.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(Rt)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(Dt)&&(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(xt,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>Ft._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[wt.join("|"),e.join("|"),Mt.join("|")].join("|")})`)}return this._splitRegex}_splitExpression(e){const t=this._getSplitRegex();return e.split(t).filter((e=>e))}_createToken(e){const t={tokenType:"literal",value:e,element:e};return'"'===e[0]||"'"===e[0]?t.value=Ft._unquote(e):e.match(Lt)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(Dt)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let r=0;r<e.length;r+=1)Ft._isWhitespace(e[r])?t.length&&(t[t.length-1].element+=e[r]):"-"===e[r]&&Ft._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 jt=Ft;const Ut=class{constructor(e,t){this._grammar={...vt},this._expression=e,this._ast=null,this._context={},this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new jt(this._grammar).tokenize(this._expression),t=new _t(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 Pt[e.operationType].call(this,e,t)}},kt=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new Ut(n,t)},Vt=e=>!e||e.buildAST(),Bt=(e,t,n)=>!e||e.evaluate(t,n),Gt=(e,t,n)=>{const r=kt(e,t),a=Vt(r);return Bt(a,n)};const Wt=class{static handleExpression(e,t,n,r){const a=this.getContext(e,r);A({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:Lh.getPropertyValue(`${n}.pxObjClass`,null,t)||Lh.getPropertyValue(`${n}.pyClassName`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>gh({type:Q,payload:{context:t,reference:n,value:e[n]}})))}},Ht={},qt=(e,t)=>Ht[t]&&Object.prototype.hasOwnProperty.call(Ht[t],e),Yt=e=>{const{context:t}=e;qt(e.reference,t)&&Wt.handleExpression(e.reference,e.value,Ht[t][e.reference],t)},Kt=(e={})=>{Dh.copy(e,Ht)},zt=(e,t,n)=>Gt(e,t,n?.pConnect.getPConnect());const Xt=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=>{t&&void 0!==this.contextArray[e]&&this.contextArray[e]>0&&gh({type:se,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]&&gh({type:ie,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 Jt=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 o=t.context_data?.is_deferred_action_in_progress??!1;if(r<=0){if(o)n.push({type:ge,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}});else{if(!(a.length>0))return;{const t=a.shift();o=!o,n.push({type:ge,payload:{context:e,data:{context_data:{deferred_action_queue:a,blocking_action_counter:r,is_deferred_action_in_progress:o}}}}),n.push(t)}}gh(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=mh(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 o=t.context_data?.is_deferred_action_in_progress??!1;return a.length<=0&&!o&&(r<=0?(n.push(e),o=!o):a.push(e),n.unshift({type:ge,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:a,blocking_action_counter:r,is_deferred_action_in_progress:o}}}}),gh(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=mh(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(gh({type:ge,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 mh(e)?(gh({type:st,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={...mh(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(gh({type:st,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=mh(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&Dh.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),gh({type:ge,payload:{context:e,data:{...n}}}),Xt.disableLoadingIndicator({context:e})}}};const Qt=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 Zt=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={}){Dh.copy(e,this.componentMap)}mergeOverrideMap(e={}){Dh.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const en=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}};const tn=class{static handleAnnotation(e,t,n){const r=e.indexOf(" "),a=-1===r?e:e.substring(0,r),o=en.getHandler(a);return o?o(e.substring(r+1),t,n):e}static trimAnnotation(e){if("string"!=typeof e)return e;const t=e.indexOf(" "),n=e.substring(0,t),r=e.substring(t+1);return en.getHandler(n)?r:e}static handleComponentMapping(e,t,n){const r=Zt.getComponent(t.type);if(!r||!r.mapping)return;const a=r.mapping(t.config);if(a&&a["@map"]){const t=a["@map"],{source:r}=t;if(!r)return;const o=n.getValue(r);if("function"==typeof t.advanced)t.advanced(e,o);else{const n=t.inputs_map;e[t.output_property]=[];const r=e[t.output_property];o.forEach((e=>{const t={};Object.keys(n).forEach((r=>{let a=n[r];a&&0===a.indexOf(".")?(a=a.substring(1),t[r]=e[a]):t[r]=a})),r.push(t)}))}}}static getPropertyName(e=""){if(e&&Dh.isString(e)){const t=e.startsWith(j.PROPERTY_ANNOTATION)||e.startsWith(j.ATTACHMENT_ANNOTATION)||e.startsWith(j.ASSOCIATED_PROPERTY_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(Dh.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return Dh.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)}},nn=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"create"===n[e].transitionType&&"active"===n[e].visited_status}}return!1},rn=(e,t)=>{if(e&&t){const n=Dh.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:r,type:a}=n;return"worklist"===a?.toLowerCase()&&r===e}return!1},an=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},on=(e,t)=>{const n=Lh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=Lh.getPropertyValue(F.CASE_INFO.AVAILABLEACTIONS,t,e);let a=!1;if(r&&n){const e=r.find((e=>e.ID===n));e&&(a=e.type.toLowerCase()===F.LOCAL_ACTION_TYPE.CASE_WIDE.toLowerCase())}if(e&&!r){const t=mh(e);a=t?.context_data?.actionType===j.CASE}return a},sn=e=>Ah(null,j.CASE_VIEW_MODE_PROP,e)===j.PERFORM_MODE&&(e.includes(j.WORKAREA)||e.includes(j.MODAL)),cn=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},ln=(e,t,n)=>{let r;const a=e?.find((e=>e.ID===t))?.actions,o=a?.filter((e=>e.ID===j.FIX_BROKEN_ASSIGNMENTS))||[];return r=n&&o?.length>0?o[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},dn=(e,t,n)=>{let r,a,o,s,i,c,l,d,u;const p=mh(e);return n?.isTriggeredFromDifferentContext?(r=p.caseInfo.assignments[0].ID,a=p.caseInfo.ID,o=p.caseInfo.assignments,s=p.caseInfo.activeActionID,i=p.caseInfo.availableActions,c=p.caseInfo,l=p.caseInfo.businessID,d=p.caseInfo.caseTypeID,u=p.caseInfo.caseTypeName):(r=t.getValue(F.CASE_INFO.ASSIGNMENT_ID),a=t.getValue(F.CASE_INFO.CASE_INFO_ID),o=t.getValue(F.CASE_INFO.ASSIGNMENTS),s=t.getValue(F.CASE_INFO.ACTIVE_ACTION_ID),i=t.getValue(F.CASE_INFO.AVAILABLEACTIONS),c=t.getValue(F.CASE_INFO.CASE_INFO),l=t.getValue(F.CASE_INFO.BUSINESS_ID),d=t.getValue(F.CASE_INFO.CASE_TYPE_ID),u=t.getValue(F.CASE_INFO.CASE_TYPE_NAME)),{assignmentID:r,caseID:a,assignments:o,localActionID:s,caseActions:i,caseInfo:c,businessID:l,caseTypeID:d,caseTypeName:u}};const un=new class{constructor(){this.counterActionMgrId=0,this.actionMgrActions={}}getNextActionMgrId(){return this.counterActionMgrId+=1,this.counterActionMgrId.toString()}register(e,t,n,r,a="unknown",o,s=!0){if(void 0!==this.actionMgrActions[e])return null;const i={actionType:a,promise:t,resolve:n,reject:r,actionPayload:o};return this.actionMgrActions[e]=i,s&&Xt.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),Xt.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),Xt.disableLoadingIndicator(r.actionPayload,t)):a=null,a}};class pn{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 pn(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 hn=pn;const fn=class{constructor(e,t,n,r={}){this.type=F.CONTEXT_TREE_NODE_TYPES.WHEN,this.subType=e,this.referenceName=t,this.name=n,this.props=r}},gn=/(([^.]+)\[\d+\])/g,mn=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(gn);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]},yn=(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:En,WHEN:In,DECLARATIVE_TARGET:An,PAGELIST:Cn}=j.CONTEXT_TREE_NODE_TYPES;const _n=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[En,new Map],[In,new Map],[An,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===Cn){const n=this.references.get(En);n.set(e,t),this.references.set(En,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const r=yn(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(En),a=this.references.get(An);[...r.keys(),...a.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=mn(e);return+n>=t})).forEach((e=>{const t=r.get(e).parent;t?.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 hn(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);a?.props?.index===n&&r.delete(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 o=`${e}.${n}.${r}`,s=new fn(t,n,r,a),i=this.references.get("WHEN");i?.set(o,s)}},{VIEW:Sn,FIELD:bn,CONTEXT:Nn,DECLARATIVE_TARGET:vn,WHEN:Pn}=F.CONTEXT_TREE_NODE_TYPES;const Tn=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new _n(Nn,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){const a=this.addContextNode(e).addNode("PAGE",t);let o=null;if(r&&n!==r){o=this._addParentViewNode(e,t,r).addNode("VIEW",n)}else o=a.addNode("VIEW",n);a.addReference(n,o);const s=t.split(".");for(;s.length>0;){s.pop();const n=s.join("."),o=this.getContextNode(e)?.getNode("PAGE",n),i=o?.getReference(r);if(i){this.pushChildPageNodeToParentView(i,a,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 o=this.addContextNode(e),s=o.addNode("PAGE",t)?.getReference(n)?.addNode("PAGELIST",`${t}.${r}`,a);return s&&o.addReference(`${t}.${r}`,s),s}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 o=this.getContextNode(e);o?.getNode("PAGE",t)?.getReference(n)?.removeNode(`${t}${r}`,a),o?.removeReference(`${t}${r}`,bn,a),o?.removeReference(`${t}${r}`,vn,a)}removeViewNode(e,t,n,r){const a=this.getContextNode(e),o=a?.getNode("PAGE",t),s=o?.getReference(n);this.removeChildViewNodes(e,t,n,r);const i=s?.parent?.children?.findIndex((e=>e.name===n))??-1;i>-1&&s?.parent?.children.splice(i,1)}removeChildViewNodes(e,t,n,r){const a=this.getContextNode(e),o=a?.getNode("PAGE",t),s=o?.getReference(n);s?.children.forEach((o=>{"PAGE"===o.type?this.removeViewNode(e,o.name,n,r):o.type===Sn?this.removeChildViewNodes(e,t,o.name,r):(a.removeReference(o.name,bn,o.props.index),a.removeReference(o.name,vn,o.props.index),"PAGELIST"!==o.type&&"Address"!==o.props?.componentName||this.deleteAllListNodes(e,o.name))})),o?.references.delete(n)}deleteAllListNodes(e,t){const n=n=>{const r=this.getContextNode(e),a=r?.references?.get(n);if(a)for(const[e]of a)(e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&r?.references?.get(n)?.delete(e)};n(bn),n(vn)}deleteListNode(e,t,n){const r=r=>{const a=this.getContextNode(e),o=a?.references?.get(r);if(o)for(const[e]of o)e.includes(`${t.join(".")}[${n}]`)&&a?.references?.get(r)?.delete(e)};r(bn),r(vn)}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(bn,r)}_findViewNode(e,t,n,r){let a=r.addNode("PAGE",t)?.getReference(n);if(a)return a;const o=t.split(".");for(;o.length>0;){o.pop();const e=o.join(".");if(a=r.addNode("PAGE",e)?.getReference(n),a)return a}return this.addViewNode(e,t,n)}addFieldNode(e,t,n,r,a,o={}){const s=this.addContextNode(e),i=this._findViewNode(e,t,n,s),{isDeclarativeTarget:c}=o;let l;if(l=c?i.addNode(vn,`${t}${r}`,o):i.addNode(bn,`${t}${r}`,o),l){const n=`${t}${r}`;if("Address"===l.props?.componentName&&this.deleteAllListNodes(e,l.name),s.addReference(n,l),l.value=a,l.setPreviousDefaultValue(),l.props.isInsideList){const e=`${t}${r}`,n=t.substring(0,t.lastIndexOf("["))||e.substring(0,e.lastIndexOf("["));let a=s.getReference(n,bn);a||(a=i.addNode(bn,n,{}),s.addReference(n,a))}}return l}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),[o,s,i]=mn(t);n.startsWith(".")&&(n=n.substring(1)),s&&this.mutatePageList(e,o,s,{...r,rowIndex:i},!0);const c=a?.getReference(`${t}.${n}`,bn);c&&c instanceof hn&&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 o=this.getContextNode(e),s=o?.getReference(`${t}.${n}`,bn);s&&s instanceof hn&&s.triggerEvent(r,a)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(bn)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(bn)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(vn)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(bn)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(vn)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const r=this.getContextNode(e)?.references?.get(bn)?.get(t);r instanceof hn&&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,bn),n=this.getContextReferencesByType(e,vn);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,bn)?.get(t)||!!this.getContextReferencesByType(e,vn)?.get(t)}addWhenNode(e,t,n,r,a,o){const s=this.getContextNode(e);s?.addWhen(t,n,r,a,o)}getDeclarativeTargets(e){const t=this.getContextNode(e),n=t?.references?.get(vn)||new Map,r=[];return n.forEach((e=>{const t=e?.props||{},{propertyName:n=""}=t,a=t.pageReference??F.CASE_INFO.CASE_INFO_CONTENT;r.push({pageReference:a,name:n})})),r}getWhens(e){const t=this.getContextNode(e),n=t?.references?.get(Pn)||new Map,r=[];return n.forEach((e=>{const t=e.subType,n=e.referenceName,a=e.name,o=e?.props?.pageReference??F.CASE_INFO.CASE_INFO_CONTENT;r.push({name:a,pageReference:o,referenceName:n,type:t})})),r}},On={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"},$n=e=>({type:On.REFRESH_DATA,payload:e}),Rn={},Dn=(e,t,n,r,a)=>{if(!(e&&n&&t))return;const o=a.actionMgrID||un.getNextActionMgrId(),s={ID:e,actionID:t,context:n,caseWideAction:r,options:{...a,actionMgrID:o}};a.isFillFormWithAI?gh((e=>({type:gt,payload:e}))(s)):gh($n(s))},xn=(e,t,n,r,a)=>{if(!(e&&n&&t))return;r&&(r=Dh.convertPageRefToClipboardPageNotation(r));gh($n({ID:e,viewID:t,context:n,options:a,caseViewAction:!0,interestPage:r}))},wn=(e,t,n)=>{Rn[t]||(Rn[t]={}),e&&!Rn[t][e]&&(Rn[t][e]={pageReference:n})},Mn=(e,t)=>{const n={pageName:(r=t.substring(t.lastIndexOf(" ")+1)).substring(0,r.lastIndexOf(".")),propertyName:r.substring(r.lastIndexOf(".")+1)};var r;const a=Bp(n.propertyName,e.getValue(j.CLASS_ID,n.pageName));return!!a?.isDeclarativeTarget},Ln=e=>{let t=!1;if(e.isWhenExist())t=!0;else{const n=e.getRawMetadata()?.config?.value;if(n){const r=Bp(tn.getLeafPropertyName(n),Lh.resolveClassID(n,e.getPageReference(),e.getContextName()));t=!!r?.isDeclarativeTarget,!t&&r?.datasource?.parameters&&(t=((e,t)=>{let n=!1;if(Array.isArray(t)){const r=t=>{const r=t.value;return r.startsWith("@P")&&(n=Mn(e,r)),n};t.some(r)}else if("object"==typeof t)for(const r in t)if(t[r].startsWith("@P")&&(n=Mn(e,t[r]),n))break;return n})(e,r?.datasource?.parameters)),t||(t=r?.datasource?.tableType===j.DECISION)}}t&&wn(e.getCurrentView(),e.getContextName(),e.getPageReference())},Fn=(e,t,n)=>{const r=on(e,t),a=Lh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e)?Lh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e):Lh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,t,e);let o;o=r?Lh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,t,e):Lh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e)?Lh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e):Lh.getPropertyValue(F.CONTEXT_DATA_ASSIGNMENTID,t,e),Dn(o,a,e,r,n)},jn=e=>{const{context:t,pageReference:n}=e,r=(e=>Rn[e]&&Object.keys(Rn[e]).length>0&&sn(e))(t);if(!r)return;if(Lh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,n,t)){const e=Lh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,n,t),r=Lh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,t),a=Lh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.INTERESTPAGE,n,t);xn(e,r,t,a,{})}else Fn(t,n,{})},Un=(e,t)=>{const{requestType:n}=e;return e?.options?.refreshFor&&"refresh"===n&&(t+=`?refreshFor=${e?.options?.refreshFor}`),e?.options?.isFillFormWithAI&&"refresh"===n&&(t+="?fillFormWithAI=true"),t},kn=e=>{const t=(e=>{const t=[];return Tn.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const r=n.split(".");r.shift();let a=r.join(".");e&&a&&(a=Dh.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a}))})),t})(e),n=(e=>{const t=[];return Tn.getWhens(e).forEach((({name:e,type:n,pageReference:r})=>{const a=r.split(".");a.shift();let o=a.join(".");e&&o&&(o=Dh.convertPageRefToClipboardPageNotation(o),t.push({name:e,context:o,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}},Vn=(e,t)=>{const n=e.url?.includes("/refresh?refreshFor="),r=t.url?.includes("/refresh?refreshFor="),a=e.url?.endsWith("/refresh")&&!n,o=t.url?.endsWith("/refresh")&&!r;if(a&&o)return((e,t)=>{const n=e.url===t.url,r=e.interestPage===t.interestPage;return n&&r})(e,t);if(a&&r)return!0;if(n){if(o)return"CANCEL_REFRESH";if(r)return!1}return!1};const Bn=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 getFieldLabel(e){let t=e?.label;if(!t&&e?.inheritedProps){const n=e?.inheritedProps;(n.showLabel??1)&&(t=n.label)}return t}},Gn={CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT],FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[j.CONTEXT_DATA,j.SUMMARY_OF_MESSAGES,j.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[j.CONTEXT_DATA,j.SUMMARY_OF_MESSAGES,j.HTTP_MESSAGES],CASE_MESSAGE_PATH:[j.CASEMESSAGES]},Wn=(e="",t="",n,r)=>{let a,o=[];null!==e&&(a=(e=>e?.startsWith(".")?e.substring(1).split("."):e.split("."))(e));const s=t&&t.startsWith(".")?t.substr(1):t;if(n===j.PROPERTY&&e||e){o=[j.CONTEXT_DATA,...s.split(".")];for(let e=0;e<a.length-1;e+=1)o.push(a[e]);o.push(j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES,a[a.length-1])}else n===F.PAGE?o=[...Gn.PAGE_MESSAGES_PATH]:n===j.HTTP?o=[...Gn.HTTP_MESSAGES_PATH]:n===j.CASEMESSAGES?o=[...Gn.CASE_MESSAGE_PATH]:r&&(o=[j.CONTEXT_DATA,...s.split(".")]);return o.filter(Boolean)},Hn=(e,t,n)=>{const r={content:{}},a=`${t}[${n}]`,o=Dh.getIn(e?.content,a.split("."));return o&&Dh.setIn(r.content,a.split("."),{...o}),r},qn=(e,t,n,r,a,o,s={})=>{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=`${o}[${r}]`;s[`${o}[${r+("up"===c?1:-1)}]`]=Dh.getIn(e[t],[j.CONTEXT_DATA,...a.split(".")]),Dh.deleteIn(e[t],[j.CONTEXT_DATA,...a.split(".")])}));const l=Object.keys(s);l.length>0&&l.forEach((n=>{Dh.setIn(e[t],[j.CONTEXT_DATA,...n.split(".")],s[n])}))},Yn=(e,t,n,r,a)=>{const o=Dh.deepClone(Dh.getIn(e,[`${t}`])),s=Dh.getIn(o,[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO]);if(!s)return;const i=n.substring(0,n.lastIndexOf(".")),c=n.substring(n.lastIndexOf(".")+1),l=((e,t,n)=>{const r=Dh.getIn(e,[j.CONTEXT_DATA,...n.split(".")],{});return Object.keys(r).filter((e=>e.includes(`${t}[`)))})(o,c,i);if(0===l.length)return;if(Hn(s,c,r).content[`${c}[${r}]`]){const s={},i=`${n}[${r}]`,c=Dh.getIn(o,[j.CONTEXT_DATA,...i.split(".")]);s[`${n}[${a}]`]=c,Dh.deleteIn(e[t],[j.CONTEXT_DATA,...i.split(".")]),qn(e,t,l,r,a,n,s)}else qn(e,t,l,r,a,n)},Kn=e=>{const{type:t,property:n,category:r,context:a,pageReference:o}=e;let s;n&&(s=n.slice(1));const i=mh(a);let c=[];const l=Dh.getIn(i,Wn(s,o,r));return t&&"all"!==t?(l&&Array.isArray(l)&&l.length>0&&(c=l.filter((e=>e.type===t))),t===F.MESSAGES.MESSAGES_TYPE_ERROR&&c.length>0&&n&&Tn.mutateField(a,o,n,{messages:[...c],type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},zn=e=>{const{property:t,pageReference:n,category:r,context:a,type:o,isListEntry:s,clearContextMessages:i,deletingIndex:c}=e,l={context:a,type:o};t&&!s?(Tn.mutateField(a,n,t,{type:Ze,fieldName:t}),l.property=t,l.pageReference=n):s?(l.pageReference=n,l.isListEntry=s,l.deletingIndex=c):l.category=r,gh(i?{type:Ze,payload:{stateObj:e.stateObj,context:a}}:{type:Ze,payload:l})},Xn=e=>{const{messages:t,property:n,pageReference:r,category:a,context:o}=e,s={messages:t,context:o};n?(s.property=n,s.pageReference=r):s.category=a,gh({type:Qe,payload:s})},Jn=(e,t,n)=>{for(const r of Object.keys(e)){if(t.push(r),r===j.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[r]&&Jn(e[r],t,n)}t.pop()}return n},Qn=(e,t)=>{let n=Kn({context:j.APP.ROOT,category:"HTTP"});if(Ap.getRenderingMode()===j.EMBED){const e=Kn({context:j.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=Kn({context:t,category:"HTTP"});n?e&&(n=n.concat(Kn({context:t,category:"HTTP"}))):n=Kn({context:t,category:"HTTP"})}return n},Zn=e=>{let t=null;t=Ou(e)[0]?Su(Ou(e)[0]):e,t&&zn({context:t,stateObj:mh(t),clearContextMessages:!0})},er={addMessages:Xn,getValidationErrorMessages:e=>{const t=mh(e),n=[],r=(e=>{let t=Gn.CONTENT_FIELDS_PATH;return e?.dataInfo?.content&&(t=Gn.DATA_OBJECT_CONTENT_FIELDS_PATH),t})(t),a=Dh.getIn(t,[...r])||{};return Jn(a,[],[]).forEach((e=>{const t=Dh.getIn(a,[...e,j.PROPERTY_MESSAGES]);t&&Object.keys(t).forEach((e=>{t[e].forEach((e=>{e.type===j.MESSAGES.MESSAGES_TYPE_ERROR&&(e.fieldLabel?n.push({label:`${e.fieldLabel}:`,description:Sp.getLocaleValue(e.message,"Messages")}):n.push(Sp.getLocaleValue(e.message,"Messages")))}))}))})),n},getMessages:Kn,clearMessages:zn,getRootContainerHttpMessages:Qn,clearContextMessagesInActiveWorkArea:Zn};const tr=class{static execute(e,t,n,r){const a={};Object.prototype.hasOwnProperty.call(n,"nonFormProperties")&&(n.nonFormProperties.forEach((e=>{a[e]=n[e],delete n[e]})),delete n.nonFormProperties);const o={instruction:"INSERT",content:{...Dh.unflatten(n)}},s=JSON.parse(JSON.stringify(o));delete s.content.classID;return{instruction:{target:Dh.buildInstructionPageReference(r,e),content:{...s.content},listIndex:t,instruction:"INSERT"},actionPayload:o,displayPropertPayload:a}}};const nr=class{static execute(e,t,n,r,a,o,s){const i={instruction:"UPDATE",content:{...Dh.unflatten(r)},isDefault:s},c={content:{...i.content},target:Dh.buildInstructionPageReference(a,t),listIndex:n,instruction:"UPDATE"};return o||gh(Af({...i,listIndex:n-1,context:e,referenceList:`${a}${t}`})),c}};const rr=class{static execute(e,t,n){return{target:Dh.buildInstructionPageReference(n,e),listIndex:t,instruction:"DELETE"}}};const ar=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:Dh.buildInstructionPageReference(e,t)}}static execute(e,t,n,r){r||gh(Af({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const or=class{static execute(e,t,n,r){return{target:Dh.buildInstructionPageReference(r,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const sr=class{static execute(e,t,n,r){return{content:{...{...Dh.unflatten(n)}},target:Dh.buildInstructionPageReference(r,t),instruction:"REPLACE"}}};const ir=class{static execute(e,t){return{target:Dh.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const cr=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const lr=class{constructor(e,t,n){this.target=e,this.pageReference=t,this.contextName=n,this.root=null,this.current=null,this.changeList={},this.targetPageReference=t+e,this.children=[],this.visibility=!0}addChild(e){null===this.current&&this.insertNode({}),this.current.childrenStateMachines.push(e)}insertNode(e){const t=new cr(e);null===this.root&&(this.root=t),null!==this.current&&(t.previous=this.current,this.current.next=t),this.current=t}buildChildSumbitPageInstructions(e,t){let n=[];return e.childrenStateMachines.forEach((e=>{e.visibility&&(n=n.concat(e.buildSubmitPageInstructions(t)))})),n}buildSubmitPageInstructions(e=!1){let t=this.root,n=[];for(;t;)!t.instruction.instruction||e&&t.automatic||n.push(t.instruction),n=[...n,...this.buildChildSumbitPageInstructions(t,e)],t=t.next;return n}initPageInstructions(e,t,n){const r=e.getValue(this.target)||[];t?r.forEach(((e,r)=>{t.forEach((t=>{const a=ll(t),o={};let s=!0;n&&(o[ll(n)]=crypto.randomUUID(),s=!1);const i={[a]:Dh.getIn(e,a),...o};this.update(i,r+1,s,{isDefault:!0})}))})):r.forEach(((e,t)=>{if(n&&!e[ll(n)]){const e={};e[ll(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{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:o}=r,s=nr.execute(this.contextName,this.target,t,e,this.pageReference,n,a);if(!o){if(this.initChangeList(t-1),!a){const n=this.changeList?.[this.targetPageReference]?.[t-1].content;this.changeList[this.targetPageReference][t-1]=vh(Dh.deepClone(n),e,r)}if(this.current?.automatic!==a||this.current?.instruction?.listIndex!==t||"UPDATE"!==this.current?.instruction.instruction)this.insertNode(s),a&&(this.current.automatic=!0);else{const t=this.current.instruction.content;this.current.instruction.content=vh(Dh.deepClone(t),Dh.unflatten(e),r)}}}delete(e,t){const n=rr.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||gh(Af({instruction:"DELETE",listIndex:e-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}insert(e,t,n,r){const{instruction:a,actionPayload:o={content:{}},displayPropertPayload:s={}}=tr.execute(this.target,t,e,this.pageReference),{isDefault:i=!1}=r;if(this.initChangeList(t-1),!i){const n=this.changeList?.[this.targetPageReference]?.[t-1].content;this.changeList[this.targetPageReference][t-1]=vh(Dh.deepClone(n),e,r)}this.root&&!this.root.instruction?.instruction&&this.current&&!this.current.instruction?.instruction?this.root.instruction=a:this.insertNode(a),n||(o.content={...o.content,...s},gh(Af({...o,listIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))),i&&(this.current.automatic=!0)}replacePage(e){const t=sr.execute(this.contextName,this.target,e,this.pageReference);this.insertNode(t)}deletePage(){const e=ir.execute(this.target,this.pageReference);this.insertNode(e)}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=or.execute(this.target,e,t,this.pageReference);this.insertNode(r),gh(Af({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=ar.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),ar.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){const t=this.current.instruction.content;this.current.instruction.content=vh(Dh.deepClone(t),e)}},dr={},ur={},pr={},hr=(e,t,n)=>{dr[e]||(dr[e]={}),dr[e][t]||(dr[e][t]={content:[]}),ur[e]||(ur[e]=[],pr[e]=[]),il.isStateMachineExist(e,n,t)||il.setStateMachine(e,t,n,new lr(t,n,e))},fr=e=>Bn.formatPageReference(e),gr=(e,t)=>{const n=ur[e],r=pr[e],a=ll(t),o=a?.substring(0,a.indexOf("["));r?.indexOf(o)<0&&pr[e].push(o),n?.indexOf(a)<0&&ur[e].push(a)},mr=e=>{delete ur[e]},yr=e=>il.buildPageInstructionsByContext(e),Er=e=>il.buildPageInstructionsByContext(e,!0),Ir=e=>{il.clearStateMachines(e),delete dr[e]},Ar=(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]})))},Cr=(e,t,n,r,a)=>{const{skipStateUpdate:o=!1}=a||{},s=n.getContextName(),i=n.getReferenceList(),c=r||n.getPageReference(),l=fr(i);hr(s,l,c),gr(s,`${i}[${t}]`),Ar(i,c,e,t);const d={instruction:j.LIST_ACTIONS.INSERT,content:{...Dh.unflatten(e)}};delete JSON.parse(JSON.stringify(d)).content.classID;il.getStateMachine(s,c,l).insert(e,t+1,o,{})},_r=(e,t,n=0,r={})=>{const{skipStateUpdate:a=!0,pageRef:o}=r,s=t.getContextName();let i=t.getReferenceList();const c=o||t.getPageReference();i||(i=((e,t)=>{const n=e.indexOf(F.CONTENT)+F.CONTENT.length,r=e.lastIndexOf(`[${t}]`);return e.substring(n,r)})(c,n));const l=fr(i);hr(s,l,c),gr(s,`${i}[${n}]`),Ar(i,c,e,n);il.getStateMachine(s,c,l).update(e,n+1,a,r)},Sr=(e,t)=>{const[,n]=e.split("."),r=t?.split(".").pop();return n===r},br=(e,t,n)=>{const r={};return Object.values(e).forEach((e=>{if(Sr(e,n)){const n=Dh.getPropertyName(e),a=n.substr(n.indexOf(".")+1).split(".");if(a.length>1){let e=Dh.getIn(t,a)??"";if(!e){const n=`!P!${a.join(":")}`;e=Dh.getIn(t,n)??""}Dh.setIn(r,a,e)}else{const e=Dh.getIn(t,a)??"";r[a[a.length-1]]=e}}})),r},Nr=(e,t,n,r,a)=>{const o=e.getValue(t)||{};n&&Object.keys(o).length>0&&e.clearErrorMessages({property:r?a:e.getStateProps().value})},vr=(e,t,n)=>new Promise((r=>{const{skipPageInstructions:a=!1}=n,{selectionMode:o,selectionList:s,required:i}=t.getConfigProps(),c=o===j.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,s);const p=t.getRawMetadata();let h=null;const f=(e=>e?.config?.dataRelationshipContext&&"SimpleTableSelect"===e.type&&"single"===e.config?.selectionMode)(p);f&&(u=p?.config?.dataRelationshipContext,h=d.concat(".").concat(u),d=h);const g=((e,t,n)=>e?`${t}${n}`:t)(c,d,s),m=((e,t,n,r)=>t?e.getFieldMetadata(`${n}`):e.getCurrentPageFieldMetadata(r))(t,c,u,h),{datasource:{parameters:y={}}}=m,E={...y};if(((e,t,n)=>{t?.descriptors?.length&&!n&&t.descriptors.forEach((t=>{const n=Dh.getPropertyName(t),r=n.substr(n.indexOf(".")+1).split(".");e[r.join(".")]=t}))})(E,m,c),c){let n=s;n=fr(n);const r=t.getValue(g)||[];hr(l,n,d);const o=[];let i=r.length;e.forEach((e=>{const t=br(y,e,u),s={};if(Object.prototype.hasOwnProperty.call(e,"displayProperty")){const t=e.displayProperty;s[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=il.getStateMachine(l,d,n);e.$selected?r.insert(t,p+1,!0,{}):r.delete(p+1,!0)}o.push({instruction:e.$selected?j.LIST_ACTIONS.SELECT:j.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...s}})})),gh(Af({instruction:j.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${d}.${u}`,actions:o}))}else{const n=br(E,e[0],u);Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],f?{contextPageReference:d}:{}),t.getActionsApi().triggerFieldChange(`.${u}.${e}`,n[e])}))}Nr(t,g,i,c,u),r()})),Pr=e=>{if(!e)return!1;const t=Er(e);return Array.isArray(t)&&t.length>0};const Tr=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,a=e.getPageReference(),o=fr(t);hr(e.getContextName(),t,a);il.getStateMachine(e.getContextName(),a,o).deleteAll(r)},Or=e=>({insert:(t,n,r,a)=>Cr(t,n,e,r,a),update:(t,n,r)=>_r(t,e,n,r),updateProperty:(t,n,r)=>((e,t,n,r={})=>{const a=n.getPageReference(),{stateMachineTarget:o}=il.getStateMachineObjByPath(`${a}${e}`,n.getContextName(),`${a}${e}`.endsWith("]"));if(!o){let e=a.substring(0,a.lastIndexOf("["));const t=e.substring(e.lastIndexOf("."));e=e.substring(0,e.lastIndexOf(".")),e&&t&&hr(n.getContextName(),t,e)}il.executeStateMachine(n.getContextName(),`${a}${e}`,t,!0,r)})(t,n,e,r),deleteEntry:(t,n)=>((e,t,n)=>{const r=t.getContextName(),a=t.getReferenceList(),o=n||t.getPageReference(),s=`${o+a}[${e}]`,i=fr(a);zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:s,context:r,isListEntry:!0,deletingIndex:e}),hr(r,i,o),gr(r,`${a}[${e}]`),il.getStateMachine(r,o,i).delete(e+1);const c=il.getUnConnectedStateMachines(r)||{};Object.keys(c).forEach((e=>{e.includes(`${o}${i}`)&&e!==`${o}${i}`&&(c[e]=null)}))})(t,e,n),reorder:(t,n)=>((e,t,n)=>{const r=n.getContextName(),a=n.getReferenceList(),o=n.getPageReference(),s=fr(a);hr(r,s,o),gr(r,`${a}[${t}]`),il.getStateMachine(r,o,s).move(e+1,t+1)})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>vr(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:r}=t.getConfigProps(),a=[];let o=t.getPageReference();const s=n===j.LIST_SELECTION_MODE.MULTI;let i=s?r.substring(1):o.substring(o.lastIndexOf(".")+1);const c=t.getRawMetadata();let l=null;c?.config?.dataRelationshipContext&&"SimpleTableSelect"===c.type&&"single"===c.config?.selectionMode&&(i=c.config.dataRelationshipContext,l=o.concat(".").concat(i),o=l);const d=s?`${o}${r}`:o;let u=t.getValue(d)||[];if(Array.isArray(u)||(u=[u]),e)return Promise.resolve(u);const{datasource:{parameters:p={}}={}}=s?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 Sr(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(),o=t,s=`${a}${t}`;return new Promise((t=>{let i=o;i=fr(i),hr(r,i,a),il.getStateMachine(r,a,i).deleteAll(),Nr(e,s,n,!0,o),t()}))}(e),setVisibility:t=>((e,t=!0)=>{const n=e.getContextName(),{selectionMode:r,selectionList:a,renderMode:o,referenceList:s}=e.getComponentConfig();let i;if(r===j.LIST_SELECTION_MODE.MULTI&&a?i=a:"Editable"===o&&s&&(i=e.getStateProps().referenceList),i){i=fr(i);const r=il.getStateMachine(n,"",`${e.getPageReference()}${i}`);r&&(r.visibility=t)}})(e,t),initDefaultPageInstructions:(t,n,r)=>((e,t,n,r)=>{const a=e.getContextName(),o=e.getPageReference(),s=fr(t);hr(a,s,o),il.getStateMachine(a,o,s).initPageInstructions(e,n,r)})(e,t,n,r),deleteAll:(t,n)=>Tr(e,t,n),replacePage:(t,n)=>((e,t,n)=>{const r=e.getPageReference(),a=e.getContextName();hr(a,t,r),gr(a,Dh.buildInstructionPageReference(r,t)),il.getStateMachine(a,r,t).replacePage(n)})(e,t,n),deletePage:t=>((e,t)=>{const n=e.getPageReference(),r=e.getContextName();hr(r,t,n),gr(r,Dh.buildInstructionPageReference(n,t)),il.getStateMachine(r,n,t).deletePage()})(e,t)});const $r=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?Dh.mergeDeep(e,this.fieldDefaults):Dh.copy(e,this.fieldDefaults))}setFieldDefault(e,t,n){e&&t&&(this.fieldDefaults[e]=this.fieldDefaults[e]||{},this.fieldDefaults[e][t]=n)}getDefaultsforType(e){return this.fieldDefaults[e]}};class Rr{constructor(){this.validators={}}register(e,t){this.validators[e]=t}getValidator(e){return this.validators[e]}validateRequired(e,t,n,r,a,o){const{required:s,value:i}=o;let c=null;if(!("true"!==s&&!0!==s)){let s=r;switch(e){case"radiobuttons":s=i;break;case"attachment":{const e=n?.replace(F.CASE_INFO.CASE_INFO_CONTENT,"").replace(F.DATA_INFO.DATA_INFO_CONTENT,"");s=(Ih(`.attachmentsList${e}.${t?.replace(".","")}`,"context_data",a)||[]).filter((e=>!e.delete)),0===s?.length&&(s="");break}case"checkbox":s&&"false"!==s||(s="");break;default:"string"==typeof s&&(s=s.trim())}c=this.getValidator("required")(s),Rr.messageDispatcher(t,n,a,c,Bn.getFieldLabel(o))}return c}validateType(e,t,n,r,a,o){let s=null;const i={pageReference:n,context:a,property:t,target:o?.target,required:o?.required};let c=$r.getDefaultsforType(o?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(s=this.getValidator(e)(r,i),""!==r&&Rr.messageDispatcher(t,n,a,s,o?.label));const l=o?.validationType;return c=l&&$r.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(s=this.getValidator(l)(r,i),Rr.messageDispatcher(t,n,a,s,o?.label)),s}validate(e,t,n,r={}){const{context:a,disabled:o,readOnly:s,pageReference:i,skipRequiredValidation:c}=r;let l=null;return o||s||(c||(l=this.validateRequired(e,t,i,n,a,r)),l||(l=this.validateType(e,t,i,n,a,r))),{message:l}}static messageDispatcher(e,t,n,r,a){if(r){const o=[];o.push({type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldLabel:a,message:r}),Xn({messages:o,property:e,pageReference:t,context:n})}}isValidatorExist(e){return!!e.validatetype}}const Dr=new Rr,xr=(e,t)=>{e.DeclareExpressions&&Kt({[t.context]:e.DeclareExpressions})},wr=(e,t,n=!1)=>{const r=Dh.getIn(e,j.RESOURCES);r&&((e=>{e&&qp(e)})(r),xr(r,t)),n||Wf({...e,options:t})},Mr="text/javascript";const Lr=new class{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={},this.svcLocaleErrorCache=new Map}getTypes={SCRIPT:"script",STYLE:"link"};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=Ap.getBuiltOnAppNames(),a=this.loadAndFilterPegaComponentsConfig(e,r);let o=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(o=this.loadAndCustomerComponentsConfig(t));const s=this.fetchSDKComponent(t),i=[];if(await Promise.all([a,o,s]).then((e=>{const t=this.mergeComponentList(e);i.push(...t)})),n.alternateDesignSystemURL&&1===i.length){const r=await this.getSvcComponentsConfigADS(e,t,n);i[0].alternateDesignSystemConfig=r}return{data:{components:i}}}mergeComponentList=e=>{const[t=[],n=[],r=[]]=e,a=[...t,...n];return this.appStaticUrl?a.map((e=>{const{name:t,type:n,subtype:a}=e,o=r.reduce(((e,r)=>(t===r.name&&n===r.type&&a===r.subtype&&(e=r),e)),{});return Object.keys(o).length>0?{...e,alternateDesignSystemConfig:{...o}}: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){let t=null;if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const n=`${this.appStaticUrl}v103/${this.appAlias}/componentslist${e}`;t=fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}else t=Promise.resolve([]);return t}checkForBuiltOnSupport(e,t){if(!e||!t||0===e.length||0===t.length)return!0;const n=e.split(",");return 0===n.length||n.some((function(e){return-1!==t.indexOf(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))),a?.data?.components?.length>0&&Array.isArray(e)&&(a.data.components=a.data.components.filter((t=>{let n=!0;for(const r of e){const e=t[r.field];Array.isArray(e)?e.includes(r.value)||(n=!1):e!==r.value&&(n=!1)}return n}))),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){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return void 0===this.imageBlobUrlCache[t]&&(this.imageBlobUrlCache[t]=fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).then((e=>window.URL.createObjectURL(e))).catch()),this.imageBlobUrlCache[t]}getSvcLocale(e,t){const n=`${this.appStaticUrl}v102/${this.appAlias}/locales/${e}/${t}`,r=`${this.appStaticUrl}::${this.appAlias}::${e}::${t}`;return!0===this.svcLocaleErrorCache.get(r)?Promise.resolve(null):fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>400===e.status||404===e.status?(this.svcLocaleErrorCache.set(r,!0),null):e)).catch((()=>null))}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((()=>[]))}getSvcComponent(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw Error(e.statusText);return e})).then((e=>e.text())).then((e=>e)).catch()}async importCustomComponentMap(e){fetch(`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>(e.ok||console.error("Error while fetching custom component map"),e))).then((e=>e.text())).then((t=>{this.setCCV2LibId(e);const n=document.createElement("script");n.src=window.URL.createObjectURL(new Blob([t],{type:Mr})),n.onload=()=>console.log("Custom component lib map loaded"),n.onerror=()=>console.error("Error while appending custom component map"),document.head.appendChild(n)})).catch((e=>{console.error("Exception while appending custom component map : "),console.error(e)}))}loadSvcComponent(e){return new Promise(((t,n)=>{this.getSvcComponent(e).then((r=>{const a=document.createElement("script");a.src=window.URL.createObjectURL(new Blob([r],{type:Mr})),a.onload=()=>t(e),a.onerror=()=>n(e),document.head.appendChild(a)})).catch((()=>{n(e)}))}))}initServer(e,t,n){console.log(`asset-loader.initServer(${e}, ${t})`),this.appStaticUrl=null,this.staticServerURL=null,this.pegaOnlyUrl=!1,this.componentsConfig=null,e&&t&&"no-appstatic"!==t&&"no-cdn"!==t?(this.appStaticUrl=t.endsWith("/")?t:`${t}/`,this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.pegaOnlyUrl=!0):e&&t&&"no-appstatic"===t?(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,this.pegaOnlyUrl=!0):e&&t&&"no-cdn"===t&&(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL),console.log(`asset-loader.initServer() staticServerURL=${this.staticServerURL}, appStaticUrl=${this.appStaticUrl}, pegaOnlyUrl=${this.pegaOnlyUrl})`),this.b2sJWT=n}register(e,t){this.loaderObj[e]=t}getLoader(e){let t;const n=(e,t)=>new Promise(((n,r)=>{const a=document.createElement(t);"script"===t?(a.onload=()=>{n(e)},a.onerror=()=>{r(e)},a.type=Mr,a.charset="UTF-8",a.async=!1,a.src=e):(a.type="text/css",a.rel="stylesheet",a.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),o=a?.tenant_id,{restApi:s,reqType:i}=Lf("getAssetsFromIsolations",{isolationID:o,assetPath:e})||{},c=`${this.appStaticUrl}${s}`;return fetch(c,{method:i,credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob()))}},Fr="component-loader",jr={},Ur=async(e,t)=>{const n=Lr.getLoader(),r=t||Lr.staticServerURL;if(!e||window.PCore&&!1===window.PCore.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();if(Lr.getLoader(Fr))return Lr.getLoader(Fr)(e,r);const a=[];return e.forEach((e=>{if(jr[e])return;const t=Zt.getComponent(e);if(!t){const t=`${Lr.getConstellationServiceUrl()}/v860/${Lr.getAppAlias()}/component/${e}.js`;return void a.push(n(t,Lr.getTypes.SCRIPT))}(t.scripts||[]).forEach((e=>{const t=e.startsWith("http")?e:r+e;a.push(n(t,Lr.getTypes.SCRIPT))}));(t.styles||[]).forEach((e=>{a.push(n(r+e,Lr.getTypes.STYLE))})),jr[e]=!0})),Promise.all(a)};function kr(e,t){return function(){return e.apply(t,arguments)}}const{toString:Vr}=Object.prototype,{getPrototypeOf:Br}=Object,{iterator:Gr,toStringTag:Wr}=Symbol,Hr=(qr=Object.create(null),e=>{const t=Vr.call(e);return qr[t]||(qr[t]=t.slice(8,-1).toLowerCase())});var qr;const Yr=e=>(e=e.toLowerCase(),t=>Hr(t)===e),Kr=e=>t=>typeof t===e,{isArray:zr}=Array,Xr=Kr("undefined");function Jr(e){return null!==e&&!Xr(e)&&null!==e.constructor&&!Xr(e.constructor)&&ea(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Qr=Yr("ArrayBuffer");const Zr=Kr("string"),ea=Kr("function"),ta=Kr("number"),na=e=>null!==e&&"object"==typeof e,ra=e=>{if("object"!==Hr(e))return!1;const t=Br(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Wr in e||Gr in e)},aa=Yr("Date"),oa=Yr("File"),sa=Yr("Blob"),ia=Yr("FileList");const ca="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},la=void 0!==ca.FormData?ca.FormData:void 0,da=Yr("URLSearchParams"),[ua,pa,ha,fa]=["ReadableStream","Request","Response","Headers"].map(Yr);function ga(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,a;if("object"!=typeof e&&(e=[e]),zr(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(Jr(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(r=0;r<o;r++)s=a[r],t.call(null,e[s],s,e)}}function ma(e,t){if(Jr(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 ya="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ea=e=>!Xr(e)&&e!==ya;const Ia=(Aa="undefined"!=typeof Uint8Array&&Br(Uint8Array),e=>Aa&&e instanceof Aa);var Aa;const Ca=Yr("HTMLFormElement"),_a=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Sa=Yr("RegExp"),ba=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ga(n,((n,a)=>{let o;!1!==(o=t(n,a,e))&&(r[a]=o||n)})),Object.defineProperties(e,r)};const Na=Yr("AsyncFunction"),va=(Pa="function"==typeof setImmediate,Ta=ea(ya.postMessage),Pa?setImmediate:Ta?(Oa=`axios@${Math.random()}`,$a=[],ya.addEventListener("message",(({source:e,data:t})=>{e===ya&&t===Oa&&$a.length&&$a.shift()()}),!1),e=>{$a.push(e),ya.postMessage(Oa,"*")}):e=>setTimeout(e));var Pa,Ta,Oa,$a;const Ra="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ya):"undefined"!=typeof process&&process.nextTick||va,Da={isArray:zr,isArrayBuffer:Qr,isBuffer:Jr,isFormData:e=>{if(!e)return!1;if(la&&e instanceof la)return!0;const t=Br(e);if(!t||t===Object.prototype)return!1;if(!ea(e.append))return!1;const n=Hr(e);return"formdata"===n||"object"===n&&ea(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Qr(e.buffer),t},isString:Zr,isNumber:ta,isBoolean:e=>!0===e||!1===e,isObject:na,isPlainObject:ra,isEmptyObject:e=>{if(!na(e)||Jr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ua,isRequest:pa,isResponse:ha,isHeaders:fa,isUndefined:Xr,isDate:aa,isFile:oa,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:sa,isRegExp:Sa,isFunction:ea,isStream:e=>na(e)&&ea(e.pipe),isURLSearchParams:da,isTypedArray:Ia,isFileList:ia,forEach:ga,merge:function e(...t){const{caseless:n,skipUndefined:r}=Ea(this)&&this||{},a={},o=(t,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const s=n&&ma(a,o)||o,i=_a(a,s)?a[s]:void 0;ra(i)&&ra(t)?a[s]=e(i,t):ra(t)?a[s]=e({},t):zr(t)?a[s]=t.slice():r&&Xr(t)||(a[s]=t)};for(let e=0,n=t.length;e<n;e++)t[e]&&ga(t[e],o);return a},extend:(e,t,n,{allOwnKeys:r}={})=>(ga(t,((t,r)=>{n&&ea(t)?Object.defineProperty(e,r,{__proto__:null,value:kr(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,o,s;const i={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],r&&!r(s,e,t)||i[s]||(t[s]=e[s],i[s]=!0);e=!1!==n&&Br(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Hr,kindOfTest:Yr,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(zr(e))return e;let t=e.length;if(!ta(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Gr]).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:Ca,hasOwnProperty:_a,hasOwnProp:_a,reduceDescriptors:ba,freezeMethods:e=>{ba(e,((t,n)=>{if(ea(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];ea(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 zr(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:ma,global:ya,isContextDefined:Ea,isSpecCompliantForm:function(e){return!!(e&&ea(e.append)&&"FormData"===e[Wr]&&e[Gr])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(na(e)){if(t.indexOf(e)>=0)return;if(Jr(e))return e;if(!("toJSON"in e)){t[r]=e;const a=zr(e)?[]:{};return ga(e,((e,t)=>{const o=n(e,r+1);!Xr(o)&&(a[t]=o)})),t[r]=void 0,a}}return e};return n(e,0)},isAsyncFn:Na,isThenable:e=>e&&(na(e)||ea(e))&&ea(e.then)&&ea(e.catch),setImmediate:va,asap:Ra,isIterable:e=>null!=e&&ea(e[Gr])},xa=Da.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"]),wa=Symbol("internals"),Ma=/[^\x09\x20-\x7E\x80-\xFF]/g;function La(e){return e&&String(e).trim().toLowerCase()}function Fa(e){return!1===e||null==e?e:Da.isArray(e)?e.map(Fa):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(Ma,""))}function ja(e,t,n,r,a){return Da.isFunction(r)?r.call(this,t,n):(a&&(t=n),Da.isString(t)?Da.isString(r)?-1!==t.indexOf(r):Da.isRegExp(r)?r.test(t):void 0:void 0)}class Ua{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=La(t);if(!a)throw new Error("header name must be a non-empty string");const o=Da.findKey(r,a);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=Fa(e))}const o=(e,t)=>Da.forEach(e,((e,n)=>a(e,n,t)));if(Da.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Da.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((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]&&xa[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(Da.isObject(e)&&Da.isIterable(e)){let n,r,a={};for(const t of e){if(!Da.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[r=t[0]]=(n=a[r])?Da.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(a,t)}else null!=e&&a(t,e,n);return this}get(e,t){if(e=La(e)){const n=Da.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(Da.isFunction(t))return t.call(this,e,n);if(Da.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=La(e)){const n=Da.findKey(this,e);return!(!n||void 0===this[n]||t&&!ja(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=La(e)){const a=Da.findKey(n,e);!a||t&&!ja(0,n[a],a,t)||(delete n[a],r=!0)}}return Da.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&&!ja(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return Da.forEach(this,((r,a)=>{const o=Da.findKey(n,a);if(o)return t[o]=Fa(r),void delete t[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(a):String(a).trim();s!==a&&delete t[a],t[s]=Fa(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Da.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Da.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[wa]=this[wa]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=La(e);t[r]||(!function(e,t){const n=Da.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 Da.isArray(e)?e.forEach(r):r(e),this}}Ua.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Da.reduceDescriptors(Ua.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Da.freezeMethods(Ua);const ka=Ua;function Va(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),r=[],a=e=>{if(null===e||"object"!=typeof e)return e;if(Da.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ka&&(e=e.toJSON()),r.push(e),Da.isArray(e))t=[],e.forEach(((e,n)=>{const r=a(e);Da.isUndefined(r)||(t[n]=r)}));else{if(!Da.isPlainObject(e)&&function(e){if(Da.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Da.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,o]of Object.entries(e)){const e=n.has(r.toLowerCase())?"[REDACTED ****]":a(o);Da.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return a(e)}class Ba extends Error{static from(e,t,n,r,a,o){const s=new Ba(e.message,t||e.code,n,r,a);return s.cause=e,s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),o&&Object.assign(s,o),s}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&&Da.hasOwnProp(e,"redact")?e.redact:void 0,n=Da.isArray(t)&&t.length>0?Va(e,t):Da.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}}}Ba.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Ba.ERR_BAD_OPTION="ERR_BAD_OPTION",Ba.ECONNABORTED="ECONNABORTED",Ba.ETIMEDOUT="ETIMEDOUT",Ba.ECONNREFUSED="ECONNREFUSED",Ba.ERR_NETWORK="ERR_NETWORK",Ba.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Ba.ERR_DEPRECATED="ERR_DEPRECATED",Ba.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Ba.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Ba.ERR_CANCELED="ERR_CANCELED",Ba.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Ba.ERR_INVALID_URL="ERR_INVALID_URL",Ba.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Ga=Ba;function Wa(e){return Da.isPlainObject(e)||Da.isArray(e)}function Ha(e){return Da.endsWith(e,"[]")?e.slice(0,-2):e}function qa(e,t,n){return e?e.concat(t).map((function(e,t){return e=Ha(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Ya=Da.toFlatObject(Da,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Ka=function(e,t,n){if(!Da.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Da.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Da.isUndefined(t[e])}))).metaTokens,a=n.visitor||u,o=n.dots,s=n.indexes,i=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,l=i&&Da.isSpecCompliantForm(t);if(!Da.isFunction(a))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Da.isDate(e))return e.toISOString();if(Da.isBoolean(e))return e.toString();if(!l&&Da.isBlob(e))throw new Ga("Blob is not supported. Use a Buffer instead.");return Da.isArrayBuffer(e)||Da.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,a){let i=e;if(Da.isReactNative(t)&&Da.isReactNativeBlob(e))return t.append(qa(a,n,o),d(e)),!1;if(e&&!a&&"object"==typeof e)if(Da.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Da.isArray(e)&&function(e){return Da.isArray(e)&&!e.some(Wa)}(e)||(Da.isFileList(e)||Da.endsWith(n,"[]"))&&(i=Da.toArray(e)))return n=Ha(n),i.forEach((function(e,r){!Da.isUndefined(e)&&null!==e&&t.append(!0===s?qa([n],r,o):null===s?n:n+"[]",d(e))})),!1;return!!Wa(e)||(t.append(qa(a,n,o),d(e)),!1)}const p=[],h=Object.assign(Ya,{defaultVisitor:u,convertValue:d,isVisitable:Wa});if(!Da.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!Da.isUndefined(n)){if(o>c)throw new Ga("Object is too deeply nested ("+o+" levels). Max depth: "+c,Ga.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(n))throw Error("Circular reference detected in "+r.join("."));p.push(n),Da.forEach(n,(function(n,s){!0===(!(Da.isUndefined(n)||null===n)&&a.call(t,n,Da.isString(s)?s.trim():s,r,h))&&e(n,r?r.concat(s):[s],o+1)})),p.pop()}}(e),t};function za(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function Xa(e,t){this._pairs=[],e&&Ka(e,this,t)}const Ja=Xa.prototype;Ja.append=function(e,t){this._pairs.push([e,t])},Ja.toString=function(e){const t=e?function(t){return e.call(this,t,za)}:za;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Qa=Xa;function Za(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function eo(e,t,n){if(!t)return e;const r=n&&n.encode||Za,a=Da.isFunction(n)?{serialize:n}:n,o=a&&a.serialize;let s;if(s=o?o(t,a):Da.isURLSearchParams(t)?t.toString():new Qa(t,a).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const to=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){Da.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},no={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ro={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Qa,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ao="undefined"!=typeof window&&"undefined"!=typeof document,oo="object"==typeof navigator&&navigator||void 0,so=ao&&(!oo||["ReactNative","NativeScript","NS"].indexOf(oo.product)<0),io="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,co=ao&&window.location.href||"http://localhost",lo={...o,...ro};const uo=function(e){function t(e,n,r,a){let o=e[a++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),i=a>=e.length;if(o=!o&&Da.isArray(r)?r.length:o,i)return Da.hasOwnProp(r,o)?r[o]=Da.isArray(r[o])?r[o].concat(n):[r[o],n]:r[o]=n,!s;r[o]&&Da.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],a)&&Da.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r<a;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s}if(Da.isFormData(e)&&Da.isFunction(e.entries)){const n={};return Da.forEachEntry(e,((e,r)=>{t(function(e){return Da.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},po=(e,t)=>null!=e&&Da.hasOwnProp(e,t)?e[t]:void 0;const ho={transitional:no,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=Da.isObject(e);a&&Da.isHTMLForm(e)&&(e=new FormData(e));if(Da.isFormData(e))return r?JSON.stringify(uo(e)):e;if(Da.isArrayBuffer(e)||Da.isBuffer(e)||Da.isStream(e)||Da.isFile(e)||Da.isBlob(e)||Da.isReadableStream(e))return e;if(Da.isArrayBufferView(e))return e.buffer;if(Da.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){const t=po(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ka(e,new lo.classes.URLSearchParams,{visitor:function(e,t,n,r){return lo.isNode&&Da.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=Da.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=po(this,"env"),r=n&&n.FormData;return Ka(o?{"files[]":e}:e,r&&new r,t)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(Da.isString(e))try{return(t||JSON.parse)(e),Da.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=po(this,"transitional")||ho.transitional,n=t&&t.forcedJSONParsing,r=po(this,"responseType"),a="json"===r;if(Da.isResponse(e)||Da.isReadableStream(e))return e;if(e&&Da.isString(e)&&(n&&!r||a)){const n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,po(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Ga.from(e,Ga.ERR_BAD_RESPONSE,this,null,po(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:lo.classes.FormData,Blob:lo.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Da.forEach(["delete","get","head","post","put","patch","query"],(e=>{ho.headers[e]={}}));const fo=ho;function go(e,t){const n=this||fo,r=t||n,a=ka.from(r.headers);let o=r.data;return Da.forEach(e,(function(e){o=e.call(n,o,a.normalize(),t?t.status:void 0)})),a.normalize(),o}function mo(e){return!(!e||!e.__CANCEL__)}const yo=class extends Ga{constructor(e,t,n){super(null==e?"canceled":e,Ga.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Eo(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ga("Request failed with status code "+n.status,n.status>=400&&n.status<500?Ga.ERR_BAD_REQUEST:Ga.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Io=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a,o=0,s=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=r[s];a||(a=c),n[o]=i,r[o]=c;let d=s,u=0;for(;d!==o;)u+=n[d++],d%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-a<t)return;const p=l&&c-l;return p?Math.round(1e3*u/p):void 0}};const Ao=function(e,t){let n,r,a=0,o=1e3/t;const s=(t,o=Date.now())=>{a=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-a;i>=o?s(e,t):(n=e,r||(r=setTimeout((()=>{r=null,s(n)}),o-i)))},()=>n&&s(n)]},Co=(e,t,n=3)=>{let r=0;const a=Io(50,250);return Ao((n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,i=null!=s?Math.min(o,s):o,c=Math.max(0,i-r),l=a(c);r=Math.max(r,i);e({loaded:i,total:s,progress:s?i/s:void 0,bytes:c,rate:l||void 0,estimated:l&&s?(s-i)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},_o=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},So=e=>(...t)=>Da.asap((()=>e(...t))),bo=lo.hasStandardBrowserEnv?(No=new URL(lo.origin),vo=lo.navigator&&/(msie|trident)/i.test(lo.navigator.userAgent),e=>(e=new URL(e,lo.origin),No.protocol===e.protocol&&No.host===e.host&&(vo||No.port===e.port))):()=>!0;var No,vo;const Po=lo.hasStandardBrowserEnv?{write(e,t,n,r,a,o,s){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];Da.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),Da.isString(r)&&i.push(`path=${r}`),Da.isString(a)&&i.push(`domain=${a}`),!0===o&&i.push("secure"),Da.isString(s)&&i.push(`SameSite=${s}`),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 To(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 Oo=e=>e instanceof ka?{...e}:e;function $o(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return Da.isPlainObject(e)&&Da.isPlainObject(t)?Da.merge.call({caseless:r},e,t):Da.isPlainObject(t)?Da.merge({},t):Da.isArray(t)?t.slice():t}function a(e,t,n,a){return Da.isUndefined(t)?Da.isUndefined(e)?void 0:r(void 0,e,0,a):r(e,t,0,a)}function o(e,t){if(!Da.isUndefined(t))return r(void 0,t)}function s(e,t){return Da.isUndefined(t)?Da.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(n,a,o){return Da.hasOwnProp(t,o)?r(n,a):Da.hasOwnProp(e,o)?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:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:i,headers:(e,t,n)=>a(Oo(e),Oo(t),0,!0)};return Da.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=Da.hasOwnProp(c,r)?c[r]:a,s=o(Da.hasOwnProp(e,r)?e[r]:void 0,Da.hasOwnProp(t,r)?t[r]:void 0,r);Da.isUndefined(s)&&o!==i||(n[r]=s)})),n}const Ro=["content-type","content-length"];const Do=e=>{const t=$o({},e),n=e=>Da.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let a=n("withXSRFToken");const o=n("xsrfHeaderName"),s=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=ka.from(i),t.url=eo(To(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))))):""))),Da.isFormData(r)&&(lo.hasStandardBrowserEnv||lo.hasStandardBrowserWebWorkerEnv?i.setContentType(void 0):Da.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t).forEach((([t,n])=>{Ro.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(i,r.getHeaders(),n("formDataHeaderPolicy"))),lo.hasStandardBrowserEnv){Da.isFunction(a)&&(a=a(t));if(!0===a||null==a&&bo(t.url)){const e=o&&s&&Po.read(s);e&&i.set(o,e)}}return t},xo="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Do(e);let a=r.data;const o=ka.from(r.headers).normalize();let s,i,c,l,d,{responseType:u,onUploadProgress:p,onDownloadProgress:h}=r;function f(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=ka.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Eo((function(e){t(e),f()}),(function(e){n(e),f()}),{data:u&&"text"!==u&&"json"!==u?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new Ga("Request aborted",Ga.ECONNABORTED,e,g)),f(),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",a=new Ga(r,Ga.ERR_NETWORK,e,g);a.event=t||null,n(a),f(),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||no;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ga(t,a.clarifyTimeoutError?Ga.ETIMEDOUT:Ga.ECONNABORTED,e,g)),f(),g=null},void 0===a&&o.setContentType(null),"setRequestHeader"in g&&Da.forEach(o.toJSON(),(function(e,t){g.setRequestHeader(t,e)})),Da.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),u&&"json"!==u&&(g.responseType=r.responseType),h&&([c,d]=Co(h,!0),g.addEventListener("progress",c)),p&&g.upload&&([i,l]=Co(p),g.upload.addEventListener("progress",i),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new yo(null,e,g):t),g.abort(),f(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(r.url);!y||lo.protocols.includes(y)?g.send(a||null):n(new Ga("Unsupported protocol "+y+":",Ga.ERR_BAD_REQUEST,e))}))},wo=(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,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ga?t:new yo(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,a(new Ga(`timeout of ${t}ms exceeded`,Ga.ETIMEDOUT))}),t);const s=()=>{e&&(o&&clearTimeout(o),o=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=()=>Da.asap(s),i}},Mo=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},Lo=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()}},Fo=(e,t,n,r)=>{const a=async function*(e,t){for await(const n of Lo(e))yield*Mo(n,t)}(e,t);let o,s=0,i=e=>{o||(o=!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 o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw i(e),e}},cancel:e=>(i(e),a.return())},{highWaterMark:2})};const jo="1.16.0",{isFunction:Uo}=Da,ko=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Vo=e=>{const t=Da.global??globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Da.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:o,Response:s}=e,i=a?Uo(a):"function"==typeof fetch,c=Uo(o),l=Uo(s);if(!i)return!1;const d=i&&Uo(n),u=i&&("function"==typeof r?(p=new r,e=>p.encode(e)):async e=>new Uint8Array(await new o(e).arrayBuffer()));var p;const h=c&&d&&ko((()=>{let e=!1;const t=new o(lo.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})),f=l&&d&&ko((()=>Da.isReadableStream(new s("").body))),g={stream:f&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!g[e]&&(g[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Ga(`Response type '${e}' is not supported`,Ga.ERR_NOT_SUPPORT,n)})}));const m=async(e,t)=>{const n=Da.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Da.isBlob(e))return e.size;if(Da.isSpecCompliantForm(e)){const t=new o(lo.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Da.isArrayBufferView(e)||Da.isArrayBuffer(e)?e.byteLength:(Da.isURLSearchParams(e)&&(e+=""),Da.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:E,headers:I,withCredentials:A="same-origin",fetchOptions:C,maxContentLength:_,maxBodyLength:S}=Do(e);const b=Da.isNumber(_)&&_>-1,N=Da.isNumber(S)&&S>-1;let v=a||fetch;E=E?(E+"").toLowerCase():"text";let P=wo([l,d&&d.toAbortSignal()],u),T=null;const O=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let $;try{if(b&&"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 o=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--):o(a)&&(n++,a-=3)),1===n&&a>=0&&(61===r.charCodeAt(a)||o(a))&&n++;const s=3*Math.floor(e/4)-(n||0);return s>0?s: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>_)throw new Ga("maxContentLength size of "+_+" exceeded",Ga.ERR_BAD_RESPONSE,e,T)}if(N&&"get"!==n&&"head"!==n){const t=await m(I,i);if("number"==typeof t&&isFinite(t)&&t>S)throw new Ga("Request body larger than maxBodyLength limit",Ga.ERR_BAD_REQUEST,e,T)}if(y&&h&&"get"!==n&&"head"!==n&&0!==($=await m(I,i))){let e,n=new o(t,{method:"POST",body:i,duplex:"half"});if(Da.isFormData(i)&&(e=n.headers.get("content-type"))&&I.setContentType(e),n.body){const[e,t]=_o($,Co(So(y)));i=Fo(n.body,65536,e,t)}}Da.isString(A)||(A=A?"include":"omit");const a=c&&"credentials"in o.prototype;if(Da.isFormData(i)){const e=I.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&I.delete("content-type")}I.set("User-Agent","axios/"+jo,!1);const l={...C,signal:P,method:n.toUpperCase(),headers:I.normalize().toJSON(),body:i,duplex:"half",credentials:a?A:void 0};T=c&&new o(t,l);let d=await(c?v(T,C):v(t,l));if(b){const t=Da.toFiniteNumber(d.headers.get("content-length"));if(null!=t&&t>_)throw new Ga("maxContentLength size of "+_+" exceeded",Ga.ERR_BAD_RESPONSE,e,T)}const u=f&&("stream"===E||"response"===E);if(f&&d.body&&(p||b||u&&O)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=d[e]}));const n=Da.toFiniteNumber(d.headers.get("content-length")),[r,a]=p&&_o(n,Co(So(p),!0))||[];let o=0;const i=t=>{if(b&&(o=t,o>_))throw new Ga("maxContentLength size of "+_+" exceeded",Ga.ERR_BAD_RESPONSE,e,T);r&&r(t)};d=new s(Fo(d.body,65536,i,(()=>{a&&a(),O&&O()})),t)}E=E||"text";let R=await g[Da.findKey(g,E)||"text"](d,e);if(b&&!f&&!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>_)throw new Ga("maxContentLength size of "+_+" exceeded",Ga.ERR_BAD_RESPONSE,e,T)}return!u&&O&&O(),await new Promise(((t,n)=>{Eo(t,n,{data:R,headers:ka.from(d.headers),status:d.status,statusText:d.statusText,config:e,request:T})}))}catch(t){if(O&&O(),P&&P.aborted&&P.reason instanceof Ga){const n=P.reason;throw n.config=e,T&&(n.request=T),t!==n&&(n.cause=t),n}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Ga("Network Error",Ga.ERR_NETWORK,e,T,t&&t.response),{cause:t.cause||t});throw Ga.from(t,t&&t.code,e,T,t&&t.response)}}},Bo=new Map,Go=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let s,i,c=o.length,l=Bo;for(;c--;)s=o[c],i=l.get(s),void 0===i&&l.set(s,i=c?new Map:Vo(t)),l=i;return i},Wo=(Go(),{http:null,xhr:xo,fetch:{get:Go}});Da.forEach(Wo,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const Ho=e=>`- ${e}`,qo=e=>Da.isFunction(e)||null===e||!1===e;const Yo={getAdapter:function(e,t){e=Da.isArray(e)?e:[e];const{length:n}=e;let r,a;const o={};for(let s=0;s<n;s++){let n;if(r=e[s],a=r,!qo(r)&&(a=Wo[(n=String(r)).toLowerCase()],void 0===a))throw new Ga(`Unknown adapter '${n}'`);if(a&&(Da.isFunction(a)||(a=a.get(t))))break;o[n||"#"+s]=a}if(!a){const e=Object.entries(o).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(Ho).join("\n"):" "+Ho(e[0]):"as no adapter specified";throw new Ga("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return a},adapters:Wo};function Ko(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yo(null,e)}function zo(e){Ko(e),e.headers=ka.from(e.headers),e.data=go.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Yo.getAdapter(e.adapter||fo.adapter,e)(e).then((function(t){Ko(e),e.response=t;try{t.data=go.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=ka.from(t.headers),t}),(function(t){if(!mo(t)&&(Ko(e),t&&t.response)){e.response=t.response;try{t.response.data=go.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=ka.from(t.response.headers)}return Promise.reject(t)}))}const Xo={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Xo[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Jo={};Xo.transitional=function(e,t,n){function r(e,t){return"[Axios v"+jo+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,o)=>{if(!1===e)throw new Ga(r(a," has been removed"+(t?" in "+t:"")),Ga.ERR_DEPRECATED);return t&&!Jo[a]&&(Jo[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,o)}},Xo.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Qo={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ga("options must be an object",Ga.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new Ga("option "+o+" must be "+n,Ga.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ga("Unknown option "+o,Ga.ERR_BAD_OPTION)}},validators:Xo},Zo=Qo.validators;class es{constructor(e){this.defaults=e||{},this.interceptors={request:new to,response:new to}}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=$o(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&Qo.assertOptions(n,{silentJSONParsing:Zo.transitional(Zo.boolean),forcedJSONParsing:Zo.transitional(Zo.boolean),clarifyTimeoutError:Zo.transitional(Zo.boolean),legacyInterceptorReqResOrdering:Zo.transitional(Zo.boolean)},!1),null!=r&&(Da.isFunction(r)?t.paramsSerializer={serialize:r}:Qo.assertOptions(r,{encode:Zo.function,serialize:Zo.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Qo.assertOptions(t,{baseUrl:Zo.spelling("baseURL"),withXsrfToken:Zo.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&Da.merge(a.common,a[t.method]);a&&Da.forEach(["delete","get","head","post","put","patch","query","common"],(e=>{delete a[e]})),t.headers=ka.concat(o,a);const s=[];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||no;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.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=[zo.bind(this),void 0];for(e.unshift(...s),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=s.length;let p=t;for(;u<d;){const e=s[u++],t=s[u++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=zo.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 eo(To((e=$o(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Da.forEach(["delete","get","head","options"],(function(e){es.prototype[e]=function(t,n){return this.request($o(n||{},{method:e,url:t,data:(n||{}).data}))}})),Da.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,a){return this.request($o(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}es.prototype[e]=t(),"query"!==e&&(es.prototype[e+"Form"]=t(!0))}));const ts=es;class ns{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 yo(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 ns((function(t){e=t})),cancel:e}}}const rs=ns;const as={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(as).forEach((([e,t])=>{as[t]=e}));const os=as;const ss=function e(t){const n=new ts(t),r=kr(ts.prototype.request,n);return Da.extend(r,ts.prototype,n,{allOwnKeys:!0}),Da.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e($o(t,n))},r}(fo);ss.Axios=ts,ss.CanceledError=yo,ss.CancelToken=rs,ss.isCancel=mo,ss.VERSION=jo,ss.toFormData=Ka,ss.AxiosError=Ga,ss.Cancel=ss.CanceledError,ss.all=function(e){return Promise.all(e)},ss.spread=function(e){return function(t){return e.apply(null,t)}},ss.isAxiosError=function(e){return Da.isObject(e)&&!0===e.isAxiosError},ss.mergeConfig=$o,ss.AxiosHeaders=ka,ss.formToJSON=e=>uo(Da.isHTMLForm(e)?new FormData(e):e),ss.getAdapter=Yo.getAdapter,ss.HttpStatusCode=os,ss.default=ss;const is=ss;function cs(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 ls=cs((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var ds=function(e,t){return ds=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])},ds(e,t)};function us(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}ds(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function ps(e,t,n,r){return new(n||(n=Promise))((function(a,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function i(e){try{c(r.throw(e))}catch(e){o(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(s,i)}c((r=r.apply(e,t||[])).next())}))}function hs(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=i(0),s.throw=i(1),s.return=i(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,i[0]&&(o=0)),o;)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 o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}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 fs(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 gs(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return s}function ms(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;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 ys(e){return this instanceof ys?(this.v=e,this):new ys(e)}function Es(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),r[Symbol.asyncIterator]=function(){return this},r;function s(e,t){a[e]&&(r[e]=function(t){return new Promise((function(n,r){o.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 ys?Promise.resolve(n.value.v).then(c,l):d(o[0][2],n)}catch(e){d(o[0][3],e)}var n}function c(e){i("next",e)}function l(e){i("throw",e)}function d(e,t){e(t),o.shift(),o.length&&i(o[0][0],o[0][1])}}function Is(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=fs(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 As=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Cs(e){return"function"==typeof e}function _s(e){return Cs(null==e?void 0:e.then)}var Ss=cs((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 bs(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Ns=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 o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=fs(o),i=s.next();!i.done;i=s.next()){i.value.remove(this)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(Cs(c))try{c()}catch(e){a=e instanceof Ss?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var d=fs(l),u=d.next();!u.done;u=d.next()){var p=u.value;try{Ts(p)}catch(e){a=null!=a?a:[],e instanceof Ss?a=ms(ms([],gs(a)),gs(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 Ss(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Ts(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)&&bs(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&bs(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),vs=Ns.EMPTY;function Ps(e){return e instanceof Ns||e&&"closed"in e&&Cs(e.remove)&&Cs(e.add)&&Cs(e.unsubscribe)}function Ts(e){Cs(e)?e():e.unsubscribe()}var Os={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},$s={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=$s.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,ms([e,t],gs(n))):setTimeout.apply(void 0,ms([e,t],gs(n)))},clearTimeout:function(e){var t=$s.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Rs(e){$s.setTimeout((function(){var t=Os.onUnhandledError;if(!t)throw e;t(e)}))}function Ds(){}var xs=ws("C",void 0,void 0);function ws(e,t,n){return{kind:e,value:t,error:n}}var Ms=null;function Ls(e){if(Os.useDeprecatedSynchronousErrorHandling){var t=!Ms;if(t&&(Ms={errorThrown:!1,error:null}),e(),t){var n=Ms,r=n.errorThrown,a=n.error;if(Ms=null,r)throw a}}else e()}var Fs=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Ps(t)&&t.add(n)):n.destination=Ws,n}return us(t,e),t.create=function(e,t,n){return new Vs(e,t,n)},t.prototype.next=function(e){this.isStopped?Gs(function(e){return ws("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Gs(ws("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Gs(xs,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}(Ns),js=Function.prototype.bind;function Us(e,t){return js.call(e,t)}var ks=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){Bs(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Bs(e)}else Bs(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Bs(e)}},e}(),Vs=function(e){function t(t,n,r){var a,o,s=e.call(this)||this;Cs(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&Os.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},a={next:t.next&&Us(t.next,o),error:t.error&&Us(t.error,o),complete:t.complete&&Us(t.complete,o)}):a=t;return s.destination=new ks(a),s}return us(t,e),t}(Fs);function Bs(e){var t;Os.useDeprecatedSynchronousErrorHandling?(t=e,Os.useDeprecatedSynchronousErrorHandling&&Ms&&(Ms.errorThrown=!0,Ms.error=t)):Rs(e)}function Gs(e,t){var n=Os.onStoppedNotification;n&&$s.setTimeout((function(){return n(e,t)}))}var Ws={closed:!0,next:Ds,error:function(e){throw e},complete:Ds},Hs="function"==typeof Symbol&&Symbol.observable||"@@observable";function qs(e){return e}function Ys(e){return 0===e.length?qs:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Ks=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,o=(r=e)&&r instanceof Fs||function(e){return e&&Cs(e.next)&&Cs(e.error)&&Cs(e.complete)}(r)&&Ps(r)?e:new Vs(e,t,n);return Ls((function(){var e=a,t=e.operator,n=e.source;o.add(t?t.call(o,n):n?a._subscribe(o):a._trySubscribe(o))})),o},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=zs(t))((function(t,r){var a=new Vs({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[Hs]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ys(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=zs(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 zs(e){var t;return null!==(t=null!=e?e:Os.Promise)&&void 0!==t?t:Promise}function Xs(e){return Cs(e[Hs])}function Js(e){return Symbol.asyncIterator&&Cs(null==e?void 0:e[Symbol.asyncIterator])}function Qs(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 Zs="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function ei(e){return Cs(null==e?void 0:e[Zs])}function ti(e){return Es(this,arguments,(function(){var t,n,r;return hs(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,ys(t.read())];case 3:return n=a.sent(),r=n.value,n.done?[4,ys(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ys(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 ni(e){return Cs(null==e?void 0:e.getReader)}function ri(e){if(e instanceof Ks)return e;if(null!=e){if(Xs(e))return a=e,new Ks((function(e){var t=a[Hs]();if(Cs(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(As(e))return r=e,new Ks((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(_s(e))return n=e,new Ks((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Rs)}));if(Js(e))return ai(e);if(ei(e))return t=e,new Ks((function(e){var n,r;try{for(var a=fs(t),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}e.complete()}));if(ni(e))return ai(ti(e))}var t,n,r,a;throw Qs(e)}function ai(e){return new Ks((function(t){(function(e,t){var n,r,a,o;return ps(this,void 0,void 0,(function(){var s,i;return hs(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Is(e),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(s=r.value,t.next(s),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&&(o=n.return)?[4,o.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 oi(e,t,n,r,a){void 0===r&&(r=0),void 0===a&&(a=!1);var o=t.schedule((function(){n(),a?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(o),!a)return o}function si(e){return function(t){if(function(e){return Cs(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 ii(e,t,n,r,a){return new ci(e,t,n,r,a)}var ci=function(e){function t(t,n,r,a,o,s){var i=e.call(this,t)||this;return i.onFinalize=o,i.shouldUnsubscribe=s,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 us(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}(Fs);function li(e,t){return void 0===t&&(t=0),si((function(n,r){n.subscribe(ii(r,(function(n){return oi(r,e,(function(){return r.next(n)}),t)}),(function(){return oi(r,e,(function(){return r.complete()}),t)}),(function(n){return oi(r,e,(function(){return r.error(n)}),t)})))}))}function di(e,t){return void 0===t&&(t=0),si((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function ui(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ks((function(n){oi(n,t,(function(){var r=e[Symbol.asyncIterator]();oi(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function pi(e,t){if(null!=e){if(Xs(e))return function(e,t){return ri(e).pipe(di(t),li(t))}(e,t);if(As(e))return function(e,t){return new Ks((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(_s(e))return function(e,t){return ri(e).pipe(di(t),li(t))}(e,t);if(Js(e))return ui(e,t);if(ei(e))return function(e,t){return new Ks((function(n){var r;return oi(n,t,(function(){r=e[Zs](),oi(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 Cs(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(ni(e))return function(e,t){return ui(ti(e),t)}(e,t)}throw Qs(e)}function hi(e,t){return t?pi(e,t):ri(e)}function fi(e,t,n){var r=Cs(e)||t||n?{next:e,error:t,complete:n}:e;return r?si((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var a=!0;e.subscribe(ii(t,(function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)}),(function(){var e;a=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()}),(function(e){var n;a=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)}),(function(){var e,t;a&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)})))})):qs}const gi=class{constructor(e,t,n,r){this.eventType=e,this.callback=n,this.contextName=r,this.id=t}};const mi=new class{constructor(){this.subscribers={}}publish(e,t){this.subscribers[e]?.forEach((e=>{e.callback(t)}))}unsubscribe(e,t,n){const r=this.subscribers[e]||[];let a=0,o=-1;r.forEach((e=>{e.id===t&&e.contextName===n&&(o=a),a+=1})),-1!==o&&r.splice(o,1)}unsubscribeAllWithEventType(e){this.subscribers[e]=[]}subscribe(e,t,n,r,a){this.subscribers[e]=this.subscribers[e]||[];let o=!1;if(a&&this.subscribers[e].forEach((e=>{o=e.id===t&&e.contextName===r})),!o){const a=new gi(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 yi=class{static subscribe(e,t,n,r=!1,a="app"){mi.subscribe(e,n,t,a,r)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){mi.publish(e,t)}static unsubscribe(e,t,n="app"){mi.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){mi.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){mi.clearContext(e)}};class Ei{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new Ei(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):Yi(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=Ki()}async buildAuthorizeUrl(e){e=e||window.btoa(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,o=this.config.authorizeUri?this.config.authorizeUri:this.config.endPoints.authorize,s=this.config.authService?this.config.authService:this.config.authentication_service||"pega",i=this.config.appAlias?this.config.appAlias:Ip.getApplicationAlias(),c=this.config.userIdentifier?this.config.userIdentifier:this.config.user_identifier;t=t||this.config.tokenInfo.session_index;const l=t?`&session_index=${t}`:`${c}`?`&UserIdentifier=${c}`:`${n}`?`&Password=${window.atob(n)}`:"",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=>`${o}?client_id=${r}&response_type=code&redirect_uri=${a}&scope=openid${u}&state=${e}&code_challenge=${t}&code_challenge_method=S256&authentication_service=${s}&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=-1!==t?e.indexOf("/",t+2):-1;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,o=this.config.tokenUri?this.config.tokenUri:this.config.endPoints.token,{codeVerifier:s}=this.config,i=window.location.search,c=new URLSearchParams(i),l=e||c.get("code"),d=new URLSearchParams;return d.append("client_id",n),r&&d.append("client_secret",r),d.append("grant_type","authorization_code"),d.append("code",l),d.append("redirect_uri",a),d.append("code_verifier",s),this.config?.secureCookie&&d.append("send_token_as_cookie","true"),ki(o,{method:"POST",headers:new 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?Hi({pzCTkn:e?.csrf}):(qi({tokenInfo:e}),Hi({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 Ii=Ei,Ai=async()=>new Promise((async(e,t)=>{const n=zi();if(!n?.tokenInfo)return void t(new Error("Missing token information."));const{access_token:r,refresh_token:a=null}=n.tokenInfo,{revoke:o}=n.endPoints,{client_id:s,client_secret:i,secureCookie:c}=n,l={"content-type":"application/x-www-form-urlencoded"};i&&(l.authorization=`Basic ${window.btoa(`${s}:${i}`)}`);const d=new URLSearchParams;i||d.append("client_id",s),c&&d.append("send_token_as_cookie","true");const u=a?"refresh_token":"access_token",p="access_token"===u?r:a;!c&&p&&d.append("token",p),d.append("token_type_hint",u),await ki(o,{method:"POST",headers:new Headers(l),credentials:c?"include":"omit",body:d.toString(),withoutDefaultHeaders:!0}),Hi({Authorization:null}),qi({tokenInfo:null}),e()})),Ci=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new Ii(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=I()+(E()?`${E()}`:"/?reAuth=true");return t},_i=(e,t)=>{Ci(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};yi.publish(F.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},Si=e=>{let t="",n={},r={},a=!0;if("OAuth2.0"===e?.authType){t=e.endPoints.token;const o=new URLSearchParams;(!e.tokenInfo.refresh_token||e.tokenInfo.refresh_token&&e.tokenInfo.refresh_token.length<=0)&&(a=!1),o.append("client_id",e.client_id),o.append("grant_type","refresh_token"),e.clientSecret&&o.append("client_secret",e.clientSecret),e.secureCookie&&o.append("send_token_as_cookie","true"),e.tokenInfo?.refresh_token&&o.append("refresh_token",e.tokenInfo.refresh_token),n={method:"POST",body:o.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};qi({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?Hi({pzCTkn:n?.csrf}):Hi({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:a}=e;a&&"function"==typeof a&&a(n)},failure:t=>{if(e.popupReauth)return _i(t,e);yi.publish(F.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${I()}/updateSession`,n={method:"GET",headers:{}},r={failure:_i};return{url:t,config:n,callback:r,isRefreshTokenPresent:a}},bi=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Ni=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}},vi=(e,t,n)=>{const{config:r}=e,{url:a,config:o,callback:s,isRefreshTokenPresent:i}=Si(n),c=r.headers&&r.headers.context;r.data&&(r.body=r.data);const l=Vi(r.url,r,c,t);return i?ki(a,o).then((e=>(t.setUpdateSessionStatus(!1),s?.success?.(e,r),yi.publish("updateSession",{updateStatus:"success"}),l.then((e=>Promise.resolve(e))).catch((e=>Promise.reject(e)))))).catch((e=>e&&e.config&&bi(e.config.url,n)?(s?.failure?.(r.url,n),l):Promise.reject(e))):(s?.failure?.(r.url,n),l)},Pi=(e,t,n,r)=>{if(e.config&&bi(e.config.url,n))return Promise.reject(e);if(e.response&&e.response.status&&401===e.response.status&&!t.getUpdateSessionStatus()){if(yi.unsubscribeAllWithEventType(Di),t.setUpdateSessionStatus(!0),"custom"===n?.authType){yi.publish(F.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:a}=Ni(e);return Vi(n,r,a,t)}return vi(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&t.getUpdateSessionStatus()){const{url:t,config:n,context:r}=Ni(e);return ki(t,n,r)}if(e.response&&e.response.status&&422!==e.response.status&&424!==e.response.status&&e.config.headers.context&&e.response.data&&!r){const t=e.response.data.errorDetails&&e.response.data.errorDetails.map((t=>((e,t)=>t[F.TRACE_ID]?{type:"error",message:e.localizedValue||e.message,correlationID:t[F.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"))),Xn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const Ti=class{constructor(){this.updateSessionInProgress=!1}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const Oi=class{constructor(e){this.xrayInfo={},this.xRayDebugger=e}startXRay(){if(!this.xRayDebugger.xray)return null;const e=`${Date.now()+Math.random()}`;return this.xrayInfo[e]={startTime:Date.now()/1e3},e}startXRayRestApi(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],restApisTime:{...this.xrayInfo[e]?this.xrayInfo[e].restApisTime:{},[t]:Date.now()}})}stopXRayRestApi(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],restApisTime:{...this.xrayInfo[e]?.restApisTime,[t]:(Date.now()-this.xrayInfo[e]?.restApisTime[t])/1e3}})}updateXRay(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],...t})}stopXRay(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],totalTime:Date.now()/1e3-this.xrayInfo[e].startTime},t().setXRayInfo(this.xrayInfo[e]),delete this.xrayInfo[e])}};const $i=new class{constructor(){this.xray=!1,this.onXRayCallback=null,this.xrayRuntime=new Oi(this),this.isPreview=!1,this.debugLevels="vcv=1;tracer=0;log=0"}onXRay(e){this.onXRayCallback=e}toggleXRay(e){this.xray=e,this.xrayRuntime.xrayInfo={},null!==this.onXRayCallback&&this.onXRayCallback(e)}enableXRay(){this.toggleXRay(!0)}disableXRay(){this.toggleXRay(!1)}toggle(){this.xray?this.toggleXRay(!1):this.toggleXRay(!0)}isXRayOn(){return this.xray}getXRayRuntime(){return this.xrayRuntime}setPreviewMode(){this.isPreview=!0}getPreviewMode(){return this.isPreview}enableTracer=()=>{this.debugLevels="vcv=1;tracer=1;log=0"};disableTracer=()=>{this.debugLevels="vcv=1;tracer=0;log=0"};getDebugLevels=()=>this.debugLevels};const Ri=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){this.defaultHeaders={...this.defaultHeaders,...e}}getDefaultHeaders(){return this.defaultHeaders}addDebugHeaders(e={}){return{[j.COREHEADER_APP_DEBUG_ID]:e.debugId,[j.COREHEADER_APP_DEBUG_LEVELS]:$i.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=Lh.getProperty(j.COREHEADERS,"",e);return t?{...t,debugInfo:$i.getPreviewMode()&&{...t.debugInfo,[j.COREHEADER_APP_DEBUG_LEVELS]:$i.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(j.SKIPCOREHEADERS))return void delete e[j.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&&V.injectRemoteCaseHeader(e,t,n),this.processCoreHeaders(e,t,n)}};const Di="updateSession",xi={},wi=new Ti,Mi=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&&(yi.unsubscribe(F.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((()=>{yi.publish(F.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),yi.subscribe(F.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let Li={},Fi={},ji={},Ui="";const ki=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:a=null,cancelContext:o=n,includeRemoteSystemIdIfPresent:s=!0}=r;Ui=a,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:i,signal:c,withoutDefaultHeaders:l=!1,...d}=t,{Authorization:u,pzCTkn:p,...h}=t.headers||{};l||Ri.injectCoreAdditionalHeaders(h,t.body,n,{includeRemoteSystemIdIfPresent:s}),o&&xi[o]>=0?xi[o]+=1:o&&void 0===xi[o]&&(xi[o]=1);let f=l?{...h}:{...Ri.getDefaultHeaders(),...Ri.getRegisteredHeaders(),...h,context:n};if(e&&bi(e,Fi)&&wi.getUpdateSessionStatus()||!wi.getUpdateSessionStatus()){bi(e,Fi)&&"OAuth2.0"===Fi?.authType&&(f={...h});const{restApi:t}=Ip.doesRestApiExist("Logout")&&Ip.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&Mi.setTimerID(Mi.resetInactiveTimeout(Mi.getTimerID())),function(e,t){var n="object"==typeof t;return new Promise((function(r,a){var o,s=!1;e.subscribe({next:function(e){o=e,s=!0},error:a,complete:function(){s?r(o):n?r(t.defaultValue):a(new ls)}})}))}(hi(is({context:n,...d,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},headers:f,withCredentials:(g=Fi,!("OAuth2.0"!==g?.authType||!g.secureCookie)||!("custom"!==g?.authType||!g.customCookies)||void 0)})).pipe(fi((()=>{const e=Ri.getCoreHeadersFromContext(f.context);var t;e&&(t={...e},yi.publish(j.PUB_SUB_EVENTS.FETCH_SUCCESS,t))}))))}var g;return Vi(e,t,n,wi)},Vi=(e,t,n,r)=>new Promise(((a,o)=>{yi.subscribe(Di,(s=>{r.setUpdateSessionStatus(!s.updateStatus),"success"===s.updateStatus?ki(e,t,n).then((e=>a(e))).catch((e=>o(e))):o(s.updateStatus.error)}),Di)})),Bi=e=>{xi[e]>0&&(xi[e]-=1,0===xi[e]&&delete xi[e])};is.interceptors.request.use((e=>(Li.request&&(e=Li.request(e)),e)),(e=>Promise.reject(e))),is.interceptors.response.use((e=>{if(202===e.status&&e.config.headers.context&&e.data?.caseInfo?.errorMessage){const t=[{type:"error",message:e.data.caseInfo.errorMessage}];let n=e.config.headers.context;return n&&n.includes("/workarea")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),Xn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return e.config.headers&&e.config.headers.context&&(e.config.skipClearErrorMessages||(Kn({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&zn({type:"error",category:"HTTP",context:e.config.headers.context}),Kn({type:"error",category:e.config.headers.context===j.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&zn({type:"error",category:"PAGE",context:e.config.headers.context})),Bi(e.config.headers.context)),Li.response&&(e=Li.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&Bi(e.config.headers.context),!e.response||!e.response.status||401!==e.response.status||e.config&&bi(e.config.url,Fi)||yi.subscribe(Di,(e=>{wi.setUpdateSessionStatus(!e.updateStatus)}),Di),Pi(e,wi,Fi,e.response&&e.response.status&&e.response.status===Number(Ui)?Ui:null))));const Gi=()=>is.CancelToken.source(),Wi=e=>is.isCancel(e),Hi=e=>{Ri.setDefaultHeaders(e)},qi=e=>{Fi={...Fi,...e}},Yi=e=>{ji={...ji,...e}},Ki=()=>({...ji}),zi=()=>({...Fi});const Xi=class{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:a,viewType:o=Lc.PAGE,pageName:s,context:i=j.APP.APP,debugInfo:c,headers:l}=t;let d={};n&&n.content&&(d=n.content);const u={caseTypeID:e,content:{...d,...r},processID:a};return Qi("createWork",{body:u,queryPayload:{caseClassName:e,viewType:o,params:{pageName:s}},headers:{...l,...c&&{...Ri.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:u,headers:jc(t.headers,e,l)})))}},Ji=()=>({registerHeader:(...e)=>Ri.registerHeader(...e),unRegisterHeader:(...e)=>Ri.unRegisterHeader(...e),getRegisteredHeaders:()=>Ri.getRegisteredHeaders()}),Qi=(e,{body:t={},queryPayload:n={},cancelTokenSource:r,headers:a={},responseType:o},s,i)=>{const{restApi:c,reqType:l}=Ff(e,n),d={method:l,headers:a,body:t,...o&&{responseType:o}};return r&&(d.signal=r.token),ki(c,d,s,i??{})},Zi=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:a=!1},o)=>{e.startsWith("http:")||e.startsWith("https:")||(e=I()+e);return ki(e,{method:t,headers:r,body:n,withoutDefaultHeaders:a},o)},ec=e=>Ip.doesRestApiExist(e),tc=()=>Gi(),nc=e=>Wi(e),rc=e=>{Li=e},ac=()=>Xi;const oc=new class{#e;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#e=!1}getNormalizedKey(e){return e?.toString().trim().replace(/\s/g,"-").toLowerCase()}setComponentState=(e,t)=>{sessionStorage?sessionStorage.setItem(this.getNormalizedKey(e),JSON.stringify(t)):console.error("Session Storage not found")};getComponentState=e=>{const t=sessionStorage.getItem(this.getNormalizedKey(e)),n=t?Dh.isValidJson(t):void 0;return n||t};removeComponentState=e=>{sessionStorage.removeItem(this.getNormalizedKey(e))};fetchUserSettings=async()=>{if(ec("getUserSettings")){const{restApi:e,reqType:t}=Ff("getUserSettings");ki(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=()=>{Ap.getUserSettings()?this.userSettings=Ap.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 Dh.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(!ec("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=Ff("updateUserSettings");const{restApi:r,reqType:a}=n;return ki(r,{method:a,body:Dh.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.#e){this.#e=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};yi.subscribe(j.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}resetComponentCache(e){return!("string"!=typeof e||!e?.trim())&&(!!Object.hasOwn(this.componentCache,this.getNormalizedKey(e))&&(delete this.componentCache[this.getNormalizedKey(e)],!0))}};class sc{constructor(e){sc._instance=this,this.context=`${e}/${j.SUGGESTION}`,fh()?.getState().data?.[this.context]||gh({type:Fe,payload:{context:this.context,data:{}}})}getField(e){return Ih(e,"",this.context)}setField(e,t){gh({type:Q,payload:{reference:e,value:t,context:this.context}})}removeField(e){gh({type:me,payload:{reference:e,context:this.context}})}setState(e){gh(Bh({context:this.context,data:e,isArrayDeepMerge:!0}))}}const ic=sc;const cc=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=yh();return n?Dh.getIn(n,t):null}static setSharedState(e,t){e&&gh(_f({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:a=!0,pageReference:o,skipDirtyValidation:s=!1}=r;if(!e||!t)return;gh(Sf({context:e,reference:o?`${o}.${t}`:t,value:n,isArrayDeepMerge:a,skipDirtyValidation:s}))}static getSuggestionsContext(e){return new ic(e)}};class lc{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 dc=lc,uc=e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},pc={CASE_INFO:`${j.DATA}.${j.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${j.DATA}.${j.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${j.DATA}.${j.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${j.DATA}.${j.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${j.DATA}.${j.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${j.DATA}.${j.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${j.DATA}.${j.CASE_INFO.ASSIGNMENT_ID}`},hc=(e,t)=>{const{vcName:n,containerName:r}=t;return r||n||dc.getTargetViewContainerName(e)},fc=e=>{const t=e.lastIndexOf(j.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.substring(t,n)},gc=e=>e===du.WORKAREA,mc=e=>e===du.MODAL,yc=e=>e===Ie,Ec=e=>e&&e.find((e=>e.type===Ie)),Ic=e=>Dh.getIn(e,pc.CASE_INFO,{}),Ac=e=>e?e.split(" ").pop():void 0,Cc=e=>Dh.getIn(e,pc.CASE_CLASS_NAME,j.EMPTY_STRING),_c=e=>{const t=Ic(e);return nn(t)&&rn(Ap.getOperatorIdentifier(),t)},Sc=e=>Dh.getIn(e,pc.CASE_INFO_ID,j.EMPTY_STRING),bc=e=>Dh.getIn(e,pc.CASE_FIRST_ASSIGNMENT_ID,j.EMPTY_STRING),Nc=(e,t)=>{const{removeActionPayload:n,target:r}=t;if(n&&n.containerItemID){const{containerItemID:t,context:a}=n;e.push(mf(lf,{containerItemID:t,context:a||vu(t),target:r}))}},vc=e=>{const t=fh();if(!e)return!1;const n=W(e),r=Vu(n),a=Vu(e);if(!r||!a)return!1;const o=hu(r,n),s=hu(a,e);if(!o||!s)return!1;const{key:i}=o||{};let{key:c}=s||{};return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),i&&c&&i===c},Pc=(e,t,n={})=>{const{skipFlowNameUpdate:r}=n,a=Sc(t);Dh.setIn(e,"key",a);const o=nn(Ic(t));if(!r&&(e=>{const t=Dh.getIn(e,pc.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=bc(t),[,r]=n.split("!");s={assignmentID:n,isInCreateStage:o},yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,s),Dh.setIn(e,"flowName",r)}var s},Tc=(e,t)=>{const{attachmentsExist:n}=t;n&&Dh.setIn(e,F.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),Dh.setIn(e,F.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},Oc=(e,t,n)=>{let r=j.PROMISE_VALUE.RESOLVE;return Ec(e)?(r=j.PROMISE_VALUE.REJECT,n?un.rejectActionByID(t,!0,n):un.rejectActionByID(t)):un.resolveActionByID(t),r},$c=e=>{const t=Ap.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},Rc=()=>"true"===Ap?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,Dc=(e,t)=>{const n=Cc(e?.response),r=Ic(e?.response),{caseTypeID:a}=r,o=Ap.getFeatureMap();(o?.deferUpdateCaseSummaryView??!Object.hasOwn(o,j.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&Kp(j.CASESUMMARY_VIEW_NAME,a)&&((e,t,n)=>{const{containerItemID:r,caseID:a}=t;if(r){const{caseClassName:o,skipAssignmentsUpdate:s}=n,i=W(r),c=Vu(i),l=c&&pu(c),d=c&&Su(c),u=K(i);d&&l?.items?.[d]?.key===t?.caseID&&e.push(mf(Wh,{containerItemID:i,context:i,container:u,containerName:u,caseId:a,viewName:F.CASESUMMARY_VIEW_NAME,updateData:!0,viewLoadingContainer:{context:i},caseClassName:o,...void 0!==s&&{skipAssignmentsUpdate:s}}))}})(t,e?.actionInPayload,{caseClassName:n,skipAssignmentsUpdate:!0})},xc=e=>mh(e)?.context_data?.caseViewMode;const wc=class{static isCaseActive(e,t){if(!e||!t)return!1;const n=pu(t);if(n){const r=Su(t),{items:a={}}=n;return!(!r||!a[r]||a[r].key!==e)}return!1}static getCaseEditMetadata=(e,t)=>{const n={caseID:e,viewID:"pyEdit"},{restApi:r,reqType:a}=Ff("loadView",n);return ki(r,{method:a},t)};static getCaseEditLock=(e,t)=>{const n={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:r,reqType:a}=Ff(Ke,n);return ki(`${r}?viewType=page`,{method:a},t)};static updateCaseEditFieldsData=(e,t,n,r)=>{const a={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:o}=Ff(Ke,a),s=t[e];return ki(`${o}?viewType=form`,{method:"PATCH",body:{content:{...s}},headers:{"if-match":n}},r)};static getCaseMessages=e=>mh(e)?.caseMessages;static getPropertiesToReplace=e=>(yl(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getUniqueGadgetId=()=>Dh.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>V.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>V.isTraditionalRemoteCase(e);static getRemoteCaseKey=(e,t)=>{let n=t;try{e&&(n=e.slice(e.indexOf(" ")+1,e.indexOf("!")))}catch{}return n}},{RESOURCE_TYPES:Mc}=F,Lc={PAGE:"page",FORM:"form"},Fc={[Mc.CASE]:[We,Be,Ge],[Mc.PAGE]:[je,ke],[Mc.DATA]:[Ue],ASSIGNMENT:[Je]},jc=(e,t,n={})=>{if(!e)return{};const r={etag:e.etag},{RemoteSystemID:a}=n;return e[F.REMOTE_SYSTEM_ID]||e[F.REMOTE_SYSTEM_ID.toLowerCase()]||a?r.RemoteSystemID=e[F.REMOTE_SYSTEM_ID]||e[F.REMOTE_SYSTEM_ID.toLowerCase()]||a:t&&V.isRemoteCase(t)&&(r.RemoteSystemID=V.getRemoteHeader(t)),r},Uc=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:a=!0,isTransientContext:o=!1,includeDisabledFields:s=!1}=t;let i={};i=El(e,{isTransientContext:o,includeDisabledFields:s}),n&&(delete i?.caseInfo?.content,o&&(i={}));const c=Dl(e,!1);!o&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const a=mh(t),o=O()(a,F.CASE_INFO.CASE_INFO_CLASSID),s=Bp(n,o);("True-False"===s?.type&&!r||""===r)&&delete e.caseInfo.content[n]}))})(i,e);const l=x()(c,i);let d={},u=!1;({content:d,attachmentsExist:u}=((e,t)=>{let n={},r=!1;return(e||t?.caseInfo)&&(n=e?{...t}:{...t?.caseInfo},t?.caseInfo?.attachments&&(r=!0)),{content:n,attachmentsExist:r}})(o,l));const p=[...yr(e)];a&&p.forEach((e=>{delete e.content?.EmbedListUUID__})),d.pageInstructions=p;return(ur[e]||[]).forEach((e=>{if(d?.content){const t=e?.replace(j.CASE_INFO.CASE_INFO_CONTENT,"");Dh.deleteIn(d.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))}})),!o&&l?.dataInfo?(d={...l.dataInfo,pageInstructions:d.pageInstructions},{content:d}):{content:d,attachmentsExist:u}},kc=(e,t)=>{let n,r,a={};const o=Dh.getIn(e,j.UI_RESOURCES),s=Dh.getIn(e,"confirmationNote");o?(n=Dh.getIn(e,j.UI_RESOURCES_CONTEXT_DATA),r=Dh.getIn(e,j.ROOT),a=Dh.getIn(e,j.ACTION_BUTTONS)):s&&(r={});const{data:i={},Errors:c,semanticURL:l,key:d,flowName:u}=e,p=Dh.getIn(e,"nextAssignmentInfo",null),h=Dh.getIn(e,"nextAssignmentInfo.context",""),f=Dh.getIn(e,"confirmationLinks",null),{isInCreateStage:g,openCaseViewAfterCreate:m,debugInfo:y}=t;return{data:{...i,key:d,flowName:u,coreHeaders:y&&{debugInfo:{[j.COREHEADER_APP_DEBUG_ID]:y.debugId}},caseInfo:{...i.caseInfo,actionButtons:a,headers:t.headers},[j.CONTEXT_DATA]:g?{...i[j.CONTEXT_DATA],...n,openCaseViewAfterCreate:m,errors:c}:{...i[j.CONTEXT_DATA],...n,errors:c}},semanticURL:l,nextAssignmentInfo:p,assignmentContext:h,confirmationLinks:f,key:d,root:r,...t}},Vc=async(e,t,n,r=!1,a=!1)=>{const o=Dh.getIn(e,j.LOCALE_REFERENCES);await Sp.loadLocaleResources(o);const s=Dh.getIn(e,j.COMPONENTS);if(s)try{await Ur(s)}catch(e){console.error(e)}const i={actionConfig:t,...n};r?Wf({...e,options:i,directUrlUpdation:!0}):wr(e,i,a)},Bc=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},Gc=e=>{if(e){const[,t]=e.split("!");return{key:Bc(e),flowName:t}}return{}},Wc=(e,t)=>{const n=[],r=[];return e.forEach((e=>{((e,t,n,r)=>{switch(!0){case Boolean(e[j.ERROR_IN_PAGE_IDENTIFIER]&&e[j.ERROR_FIELD_IN_PAGE]):{const a=`${e[j.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),o=`${a}${e[j.ERROR_IN_PAGE_IDENTIFIER]}`,s=Dh.deepClone(e);s[j.ERROR_FIELD_IN_PAGE]=a,t.includes(o.slice(1))||t.includes(o.substring(o.indexOf(".")+1,o.indexOf("[")))?r.push(s):n.push(e);break}case Boolean(e[j.ERROR_IN_PAGE_IDENTIFIER]&&!e[j.ERROR_FIELD_IN_PAGE]):{const a=e[j.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(a)?r.push(e):n.push(e);break}default:n.push(e)}})(e,t,n,r)})),{fieldErrors:r,pageErrors:n}},Hc=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:a}=t,o=n&&n.response?n.response.data:"",s=Al(r);return a&&un.rejectActionByID(a,!0,n),mf(yf,"Error action triggered",o,r,s)},qc=(e,t)=>Du(e)&&wu(e)?mf(pf,t):mf(Xh,t),Yc=(e,t,n=j.APP.APP,r={})=>{let a=null;const{buildNew:o=!0}=r;return Du(e)?a=wu(e)?Su(e):H(t,n):xu(e)&&(wu(e)&&!o?a=Pu(e):wu(e)&&!o||(a=H(t,n))),a},Kc=e=>e&&e.type===_e,zc=e=>{let t=!1;const n=$u(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&Fl(r)){t=!0;break}}return t},Xc=(e,t={})=>{let n=!1,r=!1,a={},o=!0,s=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:d=!1}=t;if(Du(e)){const t=Su(e);if(!t)return{continueExecution:o,removeActionPayload:a};const r=vu(t);Fl(r)&&(n=!0),d||n||(n=zc(t))}else if(xu(e)&&Fu(e)){let t=ku(e);t||(t=Su(e),r=!0),a.containerItemID=t,a.context=vu(t)}if(n){const e=l||$l;s=window.confirm(Sp.getLocaleValue(e,"Messages"))}if(!s&&n&&(a={},o=!1),r){const e=Sp.getLocaleValue(Rl,"Messages");c?i=window.confirm(e):(window.alert(e),o=!1)}return!i&&r&&(a={},o=!1),{continueExecution:o,removeActionPayload:a}},Jc=(e,t)=>{let n=!1;const r=Ap.isCoexistenceAppOfType(j.APP_TYPE.UIKIT),{insKey:a,isParallelCall:o,skipFlowNameCheck:s}=t;if(!a)return{};const[,i]=a.split("!")||"",c=s?a:Bc(a),l=Eu(e,c);let d={},u=!1;if(l&&!r&&((e,t)=>{const n=hu(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,d=hu(e,l),!s)){let e=d?.flowName;const t=fc(l),r=Tu(l);if(r.length){const n=yt(t,r[0]);e=hu(n,r[0])?.flowName}else n=e===i;(e!==i||o)&&(u=!0)}return{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:u,containerItemID:l,semanticURL:d.semanticURL,insKey:a}}},Qc=(e,t,n)=>e===Mc.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,a=Eu(e,r);return a&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:a,semanticURL:r}}})(t,n):e===Mc.ASSIGNMENT?Jc(t,{...n,type:e}):e===Mc.CASE?Jc(t,{...n,skipFlowNameCheck:!0,type:e}):{},Zc=(e=[])=>{wu(`${j.APP.APP}/${j.PREVIEW}`)&&e.push(mf(zh,ju({context:F.APP.APP,name:j.PREVIEW})))},el=e=>{let t;for(const n of Object.keys(Fc))if(Fc[n].includes(e)){t=n;break}return t},tl=(e,t)=>{const{data:n={},context:r,caseViewMode:a}=e,o={data:{...n},caseViewMode:a,context:W(r)};Dh.deleteIn(o.data,"shared"),Dh.setIn(o.data,["context_data","caseViewMode"],a),t.push({type:ot,payload:{context:o.context}}),t.push(mf(Bh,o))},nl=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=Dh.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const r=Dh.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:Dh.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:Dh.getIn(t,["payload","context"]),context:Dh.getIn(t,["payload","context"])},r={type:he,payload:{...n}};e.push(r),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),gh(e),e=e.filter((e=>e.type!==he))}const a=((e,t,n)=>({assignmentID:e,vcName:j.PRIMARY,targetContainerName:Dh.getIn(t,["payload","target"]),context:Dh.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);Du(a.targetContainerName)||t?.payload?.containerName!==j.WORKAREA||(a.isMultiDoc=!0,e=[]);const o={type:fe,payload:{...a}};e.push(o),gh(e)}else gh(e)}},rl=(e,t)=>x()(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),al=e=>{let t={},n=sp(e);for(;n;){const e=Uc(n);t=rl(e.content,t),n=sp(n)}return t};class ol{static getChanges(e){return{...Dl(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1}=t||{},{content:a}=Uc(e,{isTransientContext:n,includeDisabledFields:r});return a}static isStateModified(e){return Fl(e)||Pr(e)||!(!e||!wl(e))}static isFormValid(e,t){return Il(e,t)}static clearChangedProperties(e){return Ir(e),mr(e),Ul(e)}static getEditableFields(e){return Cl(e)}static setCustomValidator(e,t){Dr.register(e,t)}static isPropertyEditable(e,t){return ol.getEditableFields(e).some((e=>e.name===t))}}const sl=ol;const il=new class{constructor(){this.states={},this.unConnectedStates={}}getStateMachine(e,t,n){return this.states?.[e]?.[`${t}${n}`]||this.unConnectedStates?.[e]?.[`${t}${n}`]}isStateMachineExist(e,t,n){return!!this.states?.[e]?.[`${t}${n}`]||!!this.unConnectedStates?.[e]?.[`${t}${n}`]}getUnConnectedStateMachines(e){return this.unConnectedStates?.[e]}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]}}setStateMachine(e,t,n,r){const a=`${n}${t}`,{stateMachine:o}=this.getStateMachineObjByPath(a,e,!0,!0),s=(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(o&&o.targetPageReference!==r.targetPageReference)return o.addChild(r),void s(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),s(t,n)})),this.states[e][a]=r):s(a,r,!0)}buildPageInstructionsByContext(e,t){const n=this.getStateMachinesByContext(e)||{},r=[];return Object.keys(n).sort().forEach((a=>{const o=Tn.getContextReferences(e)?.get(a),s=n[a];if(o){const e=s.buildSubmitPageInstructions(t);r.push(...e)}})),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}})),Dh.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,""),r=Tn.getFieldReferenceForProperty(e,t);if("Multiselect"===r?.props?.componentName&&n?.current?.instruction?.instruction===j.LIST_ACTIONS.DELETE_ALL)return;n.root=null,n.current=null;const a=this.getUnConnectedStateMachines(e)||{};Object.keys(a).forEach((e=>{e.includes(t)&&delete a[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&&hr(t,r,n)}getStateMachineObjByPath(e,t,n,r=!1){const a=/\[\d+\]$/gm,o=e;let s;for(;e&&!this.isStateMachineExist(t,"",e);)if(s=null,n&&e.endsWith("]")){if(s=e.match(a),s=s?.[s.length-1]?.substring(1,s[s.length-1].length-1),[e]=e.split(a),!r&&!this.isStateMachineExist(t,"",e)){this.createStateMachine(o,t);break}}else e=e.substring(0,e.lastIndexOf("."));return e?{stateMachineTarget:e,stateMachine:this.getStateMachine(t,"",e),index:s}:{}}executeStateMachine(e,t,n,r=!0,a={}){const{stateMachineTarget:o,index:s}=this.getStateMachineObjByPath(t,e,r);if(!o)return!1;let[,i]=t.split(o);if(!i)return!1;null!==s&&([,i]=i.split(/^\[\d+\]/gm));const c={[ll(i)]:n},l=this.getStateMachine(e,"",o);return null!==s?l?.update(c,Number(s)+1,a.skipStateUpdate??!0,a):l?.updatePage(Dh.unflatten(c)),!0}registerForServerChanges(){dh.registerForListChanges(((e,t,n)=>{setTimeout((()=>{const r="].";if(!t.includes(".classID")&&sl.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(r)){const a=t.substring(0,t.lastIndexOf("[")),o=sl.getEditableFields(e);if(["multiselect","checkbox"].includes(o.find((e=>e.name===a))?.type)){const o=Tn.getContextReferences(e),s=o?.get(a),i=t.substring(t.lastIndexOf(r)+2);s?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}),0)}))}unRegisterForServerChanges(){dh.unRegisterForListChanges()}},cl={},ll=e=>e.startsWith(".")?e.substring(1):e,dl=e=>{delete cl[e]},ul=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=Lh.resolveContextTreeNodeProps(e),a=!0!==r.readOnly&&!1!==r.visibility&&(n||!0!==r.disabled),o="string"==typeof e?.value&&e?.value.includes("@FILTERED_LIST"),s=(e=>e.selectionList||e.selectionKey||"Editable"===e.renderMode&&e.referenceList)(e);return(e?.value||s)&&!o&&a},pl=(e,t,n,r,a)=>{let o=(Ih(`.attachmentsList.${t?.replace(".","")}`,"context_data",n)||[]).filter((e=>`${r.pageReference}.${e.label}`===a));return o=Dh.buildAttachmentsFormData(o),o.length>0&&(e=[...e,...o]),e},hl=(e,t,n,r,a)=>(il.executeStateMachine(e,r,Lh.getLitePropertyValue(n,t))||a.push(r),a),fl=e=>{const t=e.pageReference?.replace(F.CASE_INFO.CASE_INFO_CONTENT,"")?.replace(F.DATA_INFO.DATA_INFO_CONTENT,"");return"Attachment"===e.componentName&&""!==t},gl=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:a=!0}=n;return(!r||r&&!a)&&!Array.isArray(Lh.getLitePropertyValue(t,e))&&"Address"!==t.componentName},ml=(e,t={})=>{let n=[],r=[];const a=[],o=Tn.getContextReferences(e);if(!o)return{formInputs:n,attachments:r,formPageFields:a};if(({attachmentList:r,editableFormFieldsReferenceList:n}=((e,t,n)=>{const{includeDisabledFields:r=!1}=n;let a=[],o=[];for(const[s,i]of e){const e=Lh.resolveContextTreeNodeProps(i.props),c=e.propertyName;if(ul(i.props,{includeDisabledFields:r})){const r=fl(e);"Attachment"!==e.componentName||r?!r&&gl(s,e,n)&&(a=hl(t,c,e,s,a)):o=pl(o,c,t,e,s)}}return{attachmentList:o,editableFormFieldsReferenceList:a}})(o,e,t)),cl[e])for(const t in cl[e].fieldOrder)Object.hasOwn(cl[e].fieldOrder,t)&&a.push(t);return{formInputs:n,attachments:r,formPageFields:a}},yl=e=>{let t=[];const n=Tn.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(ul(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},El=(e,t={})=>{const n={},r=mh(e),{ignoreFieldsInsideList:a=!0,isTransientContext:o=!1,includeDisabledFields:s=!1}=t;if(o||r?.caseInfo?.content){const{formInputs:t,attachments:i,formPageFields:c}=ml(e,{ignoreFieldsInsideList:a,includeDisabledFields:s});i&&i.length>0&&Dh.buildObject("caseInfo.attachments",n,i),((e,t,n)=>{e.forEach((e=>{let r=Dh.getIn(t,e);"object"==typeof r&&(r=Dh.deepClone(r),delete r?.classID),Dh.buildObject(e,n,r)}))})(c,r,n),t&&t.length>0?t.forEach((e=>{Dh.buildObject(e,n,Dh.getIn(r,e))})):o||Dh.buildObject(F.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!o&&r?.dataInfo?.content){const{formInputs:t}=ml(e,{ignoreFieldsInsideList:a});t.forEach((e=>{Dh.buildObject(e,n,Dh.getIn(r,e))}))}return n},Il=(e,t)=>{const n=Tn.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,a]of n){const n=Lh.resolveContextTreeNodeProps(a.props);if(ul(a.props)&&(!t||e.includes(t))){const e=Dr.validate(n.componentName?.toLowerCase(),n.propertyName,Lh.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},Al=(e,t=!1)=>{const n=Tn.getContextReferences(e),r=[];if(n)for(const[e,a]of n){if(!1!==Lh.resolveContextTreeNodeProps(a.props).visibility){const n=8,a=t?e:e.substring(e.indexOf("content")+n);r.push(a)}}return r},Cl=e=>{const t=[],n=Tn.getContextReferences(e);if(n)for(const[e,r]of n){const n=Lh.resolveContextTreeNodeProps(r.props);ul(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};const _l=class{static getPropertyName(e){return tn.getPropertyName(e)}static isProperty(e){return tn.isProperty(e)}static getLeafPropertyName(e){return tn.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};const Sl=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}};class bl{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){const o=r.split("/").join(j.HASH_DELIMITER),s=Dh.getHashedString(o);if("PROP_CHANGE"===e)if(this.propChangeRefreshMap?.[a]?.[n]){this.propChangeRefreshMap[a][n].some((e=>e.uniqueHash===s))||this.propChangeRefreshMap[a][n].push({uniqueHash:s,callback:t})}else bl.initializeRefreshCache(this.propChangeRefreshMap,a,n,s,t);else if(this.refreshMap?.[a]?.[`${e}-${n}`]){this.refreshMap[a][`${e}-${n}`].some((e=>e.uniqueHash===s))||this.refreshMap[a][`${e}-${n}`].push({uniqueHash:s,callback:t})}else bl.initializeRefreshCache(this.refreshMap,a,`${e}-${n}`,s,t)}triggerRefreshForType(e,t,n){"PROP_CHANGE"===e?this.propChangeRefreshMap?.[n]?.[t]&&this.propChangeRefreshMap[n][t].forEach((e=>e.callback())):this.refreshMap?.[n]?.[`${e}-${t}`]&&this.refreshMap[n][`${e}-${t}`].forEach((e=>e.callback()))}deRegisterForRefresh(e){delete this.propChangeRefreshMap[e],delete this.refreshMap[e]}}const Nl=new bl,{APP:vl}=j;let Pl={},Tl={},Ol={};const $l="You will lose unsaved changes. Do you want to continue?",Rl="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",Dl=(e=vl.APP,t,n)=>{let r=[],a=[];t||(r=Al(e,!0)),n||(a=(e=>{const t=Tn.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===Lh.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const o={};((e,t)=>{const n=Tl[t]||{};Object.keys(n).forEach((t=>{Object.hasOwn(n,t)&&Dh.buildObject(t,e,n[t].value)}))})(o,e);const s=Pl[e]||{};return Object.keys(s).forEach((e=>{const n=!t&&r.includes(e)||t;Object.prototype.hasOwnProperty.call(s,e)&&n&&!a.includes(e)&&Dh.buildObject(e,o,s[e].value)})),o},xl=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete Pl[t]?.[n],delete Tl[t]?.[n]},wl=e=>Ol[e],Ml=(e,t)=>{const{context:n,initialValue:r="",isStrictTracking:a}=t,o=t.reference.startsWith(".")?t.reference.substr(1):t.reference;e[o]?e[o].previousValue=Ih(t.reference,null,n):(e[o]={initialValue:r||Ih(t.reference,null,n)},e[o].previousValue=e[o].initialValue),e[o].value=t.value,a&&e[o].value===e[o].initialValue&&xl(t)},Ll=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;Tn.isFieldExists(n,r)||(Tl[n]=Tl[n]||{},Ml(Tl[n],t)),Pl[n]=Pl[n]||{},Ml(Pl[n],t)},Fl=e=>{const t=Er(e)||{};return e&&Pl[e]&&Object.keys(Pl[e]).some((t=>Pl[e][t].initialValue!==Pl[e][t].value))||Object.keys(t).length>0},jl=(e,t)=>{if(!e||!t)return!1;const n=Pl[e]&&Pl[e][t];return!!n&&n.previousValue!==n.value},Ul=e=>{e&&Pl[e]?(Pl[e]={},Tl[e]={}):"all"===e&&(Pl={},Tl={},Ol={}),Ol[e]&&(Ol[e]=!1)},kl=()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ee&&(Yt(r),(e=>{const{context:t,pageReference:n,value:r,reference:a}=e;dh.triggerCascade(t,a,r);const o=Qt.getDependencies(t,a),s=dh.getResetDependencies(t,a),i={context:t,datapages:{}};[...o,...s].forEach((e=>{const n=Dh.getPropertyNameFromDependency(e);if("multiRecord"===e.mode){const e=n.split("."),r=`.${e.pop()}`,a=e.join(".");il.isStateMachineExist(t,a,r)&&il.getStateMachine(t,a,r).deleteAll()}else Sl.isPageInstruction(n)&&il.executeStateMachine(t,n,""),gh({type:Q,payload:{reference:n,value:"",context:t,isArrayDeepMerge:!0,isImplicit:!0}})})),o.forEach((r=>{let a=n;r.startsWith(n)||(a="");const o=r.replace(`${a}`,"").split(".").filter((e=>!!e));o.pop();const s=o.join("."),c=Ih(`.${s}`,a,t)?.classID||e.classID,l=Bp(r.split(".").pop(),c),{datasource:d}=l,u={};let p=[];d.parameters.forEach((e=>{e?.value?(u[e.name]=_l.isProperty(e.value)?Ih(`.${Dh.getFullPropertyReference([s,Dh.getPropertyName(e.value)])}`,a,t):e.value,void 0===u[e.name]||null===u[e.name]||""===u[e.name]?(u[e.name]="",p.push(j.NULL_STRING)):p.push(u[e.name])):(u[e.name]="",p.push(j.NULL_STRING))})),p=d.name.concat(j.UNDERSCORE_STRING,Dh.getHashedString(p.join(j.HASH_DELIMITER)));const{name:h}=d,f=Xp(h);i.datapages[p]={mode:d.mode,propertyName:r,name:d.name,dataViewParameters:u,refreshStrategy:f?.refreshStrategy}})),o.length&&gh({type:tt,payload:i})})(r),Jt.registerBlockingAction(r.context).catch((()=>{})),setTimeout((()=>{(jl(r.context,r.reference)||Pr(r.context))&&jn(r),Nl.triggerRefreshForType("PROP_CHANGE",r.reference,r.context),Jt.deRegisterBlockingAction(r.context).catch((()=>{}))}),0)),n===at&&!r?.isDefault){const{context:e,referenceList:t}=r;jn({context:e,pageReference:t})}if(n===Q||n===Z){const{reference:e,isImplicit:n,context:a,skipDirtyValidation:o=!1}=r;Tn.updateFieldNodeValue(a,e,r.value),Sl.isPageInstruction(e)||o?o||(Ol[`${a}`]=!0):Ll(t),(r.removePropertyFromChangedList||n)&&xl(r)}if(n===Te||n===Oe){const{transientItemID:e,data:t}=r;Dh.iterateLeafNodes(t,(t=>{xl({context:e,value:"",reference:t.join(".")})}))}if(n&&[De,Se,we,Pe].includes(n)){Ul(r.context),dh.purgeResetDependencies(r.context),(a=r.context)&&Rn[a]&&delete Rn[a];(r.childContainersContexts||[]).forEach((e=>{Ul(e)}));(r.transientItems||[]).forEach((e=>{Ul(e)}))}var a;e(t)};const Vl=new class{getCoreheaders(e){const t=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,n=Su(t),r=vu(n),a=Lh.getProperty(j.COREHEADERS,"",r);if(a&&e in a)return a[e]}};const Bl=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=((e,t,n)=>{const r=""===t&&n?.startsWith(".")?n.substring(1,n.length):n,a=Tn.getContextReferences(e)?.get(`${t}${r}`)?.props;return a?Lh.resolveContextTreeNodeProps(a):a})(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:a}=Dr.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,r);return a?{status:!1,message:a}:{status:!0}}},Gl="OPEN_PROCESS_ACTION",Wl="OPEN_ASSIGNMENT",Hl="DELETE_CASE_IN_CREATE_STAGE",ql="SAVE_AND_CLOSE",Yl=e=>({type:ql,payload:e});const Kl=class{static getSavableDataPage(e){return rh(e)}static getLookUpDataPage(e){return oh(e)}static getLookUpDataPageInfo(e){return sh(e)}static getDataPageKeys(e){return ah(e)}};const zl=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=un.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 un.register(t,a,n,r,e),{actionMgrID:t,promise:a}};initializeContainers(e){const t=Ae,n=this.c11nEnv,r={context:n.getContextName(),name:n.getContainerName(),type:j.CONTAINER_TYPE.SINGLE},{actionMgrID:a,promise:o}=this.containerManagerPromise(t),s={...r,...e,actionMgrID:a};return gh(Kh(s)),o}addContainerItem(e){const t=_e,n=this.c11nEnv,r=n.getMetadata(),{children:a}=r||{};let o;a&&([o]=a);const s=n.getContextName(),i=n.getContainerName(),c=H(i,s,e?.containerType===j.CONTAINER_TYPE.SINGLE),l=yt(i,s),d={root:{...o,config:{...o?.config,context:o?.config?.context||n.getPageReference?.()}},containerItemID:c,context:c,target:l,containerName:i};e=JSON.parse(JSON.stringify(e)),[j.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:u,promise:p}=this.containerManagerPromise(t),h={...d,...e,actionMgrID:u};return gh(Xh(h)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=De,n={context:vu(e.containerItemID),target:Vu(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),o={...n,...e,actionMgrID:r};return gh(nf(o)),a}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=Re,n={target:Vu(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),o={...n,...e,actionMgrID:r};return gh(sf(o)),a}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Se,n={context:vu(e.containerItemID),target:Vu(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),o={...n,...e,actionMgrID:r};return gh(lf(o)),a}resetContainers(e){if(!e?.context||!e?.name)return Promise.reject(new Error("resetContainers : context and name are required in containerInfo object"));const t=Ce,n=ju(e),{actionMgrID:r,promise:a}=this.containerManagerPromise(t),o={...n,...e,actionMgrID:r};return gh(zh(o)),a}addTransientItem(e){const{id:t,data:n}=e,r=this.c11nEnv.getContextName(),a=Y(t,r),o=qu(r);return a&&o.includes(a)||gh(Jh({transientItemID:a,contextName:r,target:Vu(r),data:n})),a}updateTransientData(e){const{transientItemID:t,data:n}=e,r=this.c11nEnv.getContextName();if(t){if(!qu(r).includes(t))return;gh(Qh({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(!qu(t).includes(a))return;gh(uf({target:n,containerItemID:r,transientItemID:a}))}}createContainerPConnect(e,t,n,r=!1){iu.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return wu(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Cu(e,t)}};var Xl=function(e,t){return e===t||"function"==typeof t&&e===t.toString()};function Jl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,a=e.length;return n=1===a?function(t){return Xl(t.type,e[0])}:function(t){for(var n=0;n<a;n++)if(Xl(t.type,e[n]))return!0;return!1},si((function(e,t){var a=0;e.subscribe(ii(t,(function(e){return n.call(r,e,a++)&&t.next(e)})))}))}function Ql(e,t){return si((function(n,r){var a=null,o=0,s=!1,i=function(){return s&&!a&&r.complete()};n.subscribe(ii(r,(function(n){null==a||a.unsubscribe();var s=0,c=o++;ri(e(n,c)).subscribe(a=ii(r,(function(e){return r.next(t?t(n,e,c,s++):e)}),(function(){a=null,i()})))}),(function(){s=!0,i()})))}))}function Zl(e,t){return si((function(n,r){var a=0;n.subscribe(ii(r,(function(n){r.next(e.call(t,n,a++))})))}))}function ed(e,t,n){return void 0===n&&(n=1/0),Cs(t)?ed((function(n,r){return Zl((function(e,a){return t(n,e,r,a)}))(ri(e(n,r)))}),n):("number"==typeof t&&(n=t),si((function(t,r){return function(e,t,n,r,a,o,s,i){var c=[],l=0,d=0,u=!1,p=function(){!u||c.length||l||t.complete()},h=function(e){return l<r?f(e):c.push(e)},f=function(e){o&&t.next(e),l++;var i=!1;ri(n(e,d++)).subscribe(ii(t,(function(e){null==a||a(e),o?h(e):t.next(e)}),(function(){i=!0}),void 0,(function(){if(i)try{l--;for(var e=function(){var e=c.shift();s?oi(t,s,(function(){return f(e)})):f(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(ii(t,h,(function(){u=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function td(e){return e&&Cs(e.schedule)}function nd(e){return e[e.length-1]}function rd(e){return td(nd(e))?e.pop():void 0}function ad(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return hi(e,rd(e))}function od(e){return si((function(t,n){var r,a=null,o=!1;a=t.subscribe(ii(n,void 0,void 0,(function(s){r=ri(e(s,od(e)(t))),a?(a.unsubscribe(),a=null,r.subscribe(n)):o=!0}))),o&&(a.unsubscribe(),a=null,r.subscribe(n))}))}var sd=new Ks((function(e){return e.complete()}));function id(e){return e?function(e){return new Ks((function(t){return e.schedule((function(){return t.complete()}))}))}(e):sd}const cd=(e,t,n)=>od((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),ad(yf(e,r,t,null,n))))),ld=(e,t)=>n=>new Ks((r=>{let a={},o=0;return n.pipe(ed((n=>{const r=Date.now();let s;return s=t||h(),s&&s(n,a)&&r-o<e?id():(a=n,o=r,ad(n))}))).subscribe(r)})),dd=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:a}=e,o={data_view_ID:t},{restApi:s,reqType:i}=Ff("createDataObject",o),{content:c}=Uc(a);return hi(ki(s,{method:i,headers:r,body:{data:c.content}},a)).pipe(Zl((t=>({response:t.data,actionInPayload:e}))),cd("Error occurred during ajax call at createDataObject Epic",n))},ud=e=>{const{dataLookUp:t,context:n,headers:r,viewName:a,requestPayload:o}=e,s={data_view_ID:t,view_ID:a},{restApi:i,reqType:c}=Ff("readDataObject",s);return hi(ki(i,{method:c,headers:r,body:{dataViewParameters:o}},n)).pipe(Zl((t=>({response:t.data,actionInPayload:e}))),cd("Error occurred during ajax call at getDataObjectView Epic",n))},pd=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:a,key:o}=e,s={data_view_ID:t},{restApi:i,reqType:c}=Ff("updateDataObject",s),{content:l}=Uc(a);return hi(ki(i,{method:c,headers:r,body:{data:{...l.content,...o},pageInstructions:l.pageInstructions||[]}},a)).pipe(Zl((t=>({response:t.data,actionInPayload:e}))),cd("Error occurred during ajax call at updateDataObject Epic",n))},hd=e=>{const{lookupDatapage:t,context:n,headers:r,actionID:a,dataViewParameters:o}=e,s={data_view_ID:t,action_ID:a},{restApi:i,reqType:c}=Ff("openDataObjectAction",s);return hi(ki(i,{method:c,headers:r,body:{dataViewParameters:o}},n)).pipe(Zl((t=>({response:t.data,actionInPayload:e}))),cd("Error occurred during ajax call at getDataObjectView Epic",n))},fd=e=>{const{savableDatapage:t,context:n,headers:r,actionID:a,keys:o,containerItemID:s}=e,i={data_view_ID:t,action_ID:a},{restApi:c,reqType:l}=Ff("submitDataObjectAction",i),{content:d}=Uc(s);return hi(ki(c,{method:l,headers:r,body:{data:{...d?.content,...o},pageInstructions:d?.pageInstructions||[]}},n)).pipe(Zl((t=>({response:t.data,actionInPayload:e}))),cd("Error occurred during ajax call at getDataObjectView Epic",n))};const gd=new class{constructor(){this.components={}}_checkComponent(e,t){return!!this.components[t]?.[e]}start(e,t,n,r,a){const o={viewName:e,pageReference:n,contextName:r,isInProgress:!0,active:!0,caseKey:t};this.components[r]=this.components[r]||{},this.components[r][a]=o}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;xn(e,r,t,a,{})}}},md="postDataViewMetadata",yd={getData:(e,t,n,r)=>((e,t,n,r={})=>{const a={dataViewName:e},{skipClearErrorMessages:o,signal:s,doNotMergeMessagesForStatusCode:i}=r,{restApi:c,reqType:l}=Ff("getListData",a);return ki(c,{method:l,body:t,...s&&{signal:s},...o&&{skipClearErrorMessages:o}},n,i)})(e,t,n,r),getListCount:(e,t,n)=>{const r={dataViewName:e},{restApi:a,reqType:o}=Ff("getListDataCount",r);return ki(a,{method:o,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const a=!!n,o=!!r,s=Ip.doesRestApiExist(md),i=(a||o)&&s?md:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:d}=Ff(i,c);if(s){if(a)return ki(l,{method:d,body:{associationFilter:n}},t);if(o)return ki(l,{method:d,body:{propertyFilter:r}},t)}return ki(l,{method:d},t)},getDataObjectView:(e,t,n,r,a={})=>{const{skipClearErrorMessages:o,signal:s,doNotMergeMessagesForStatusCode:i}=a,c={data_view_ID:e,view_ID:t},l={dataViewParameters:n},{restApi:d,reqType:u}=Ff("readDataObject",c);return ki(d,{method:u,body:l,...s&&{signal:s},...o&&{skipClearErrorMessages:o}},r,i)},getCaseEditMetadata:(e,t)=>wc.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>wc.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>wc.updateCaseEditFieldsData(e,t,n,r),moveListRecords:(e,t)=>{const{sourceID:n,destinationID:r,context:a,listClass:o,viewName:s,viewClassName:i}=e,c={viewName:s,viewClassName:i},{restApi:l,reqType:d}=Ff("moveListRecords",c);return ki(l,{method:d,body:{content:{sourceID:n,destinationID:r,context:a,listClass:o}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===j.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===j.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==Ou("root").find((e=>e.includes("authoring-preview")))?`${j.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${Lr.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=Ap.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}};const Ed=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const Id=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 o={matcher:"PRESENCE",criteria:{userId:e}};return Nd.subscribe(o,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],Nd.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)}))}))}};var Ad=n(631),Cd=n.n(Ad);const _d=class{constructor(e,t){this.atomicSubscribers={},this.connectionsCount=1,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],r=Object.keys(n.criteria),a=Object.keys(e);0===Cd()(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=Nd.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&&(Nd.unsubscribe(this.messagingServiceSubscriptionID),this.messagingServiceSubscriptionID=""))}};const Sd=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new _d("CASE",t)}return this.subscriptions[e]}};class bd{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new Id;static refreshB2SOffset=10;static isAuthenticated=!1;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=Lr.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.log("web socket connection error event: ",e)}static handleOnClose(e){null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),this.isAuthenticated=!1,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=Lr.b2sJWT;if(!e||e.length<4)return;this.publishMessage({token:e})}}static handleOnMessage(e){if(null!==e&&"ALIVE"===e.data)null===this.isServiceAlive&&this.checkLiveliness(1e4),this.isServiceAlive=!0;else{let t=null;try{t=JSON.parse(e.data)}catch(t){console.error("Invalid data received from messaging service",e.data)}if(t&&t.msgId&&this.webSocket.send(`{"ack":"${t.msgId}"}`),t&&t.filter){const{matcher:e,criteria:n}=t.filter;delete n.environmentID,Object.keys(this.subscribers).forEach((r=>{const a=this.subscribers[r];a.filter.matcher===e&&Dh.isEqual(a.filter.criteria,n)&&a.messageHandler(t)}))}else if(t&&t.tokenExpiryTime){this.isAuthenticated=!0,this.setTokenExpiryTime(t);const e=1e3*(this.getTokenExpiryTime()-this.refreshB2SOffset);setTimeout((()=>this.refreshB2STokenReInit()),e);let n=[];this.inProgressSubscriptions.forEach((({messageSubscriber:e,id:t})=>{n?.includes(t)||(n?.push(t),this.subscribeToSocket(e,t))})),this.inProgressSubscriptions=[],this.inProgressMessages.forEach((e=>{this.publishMessage(e)})),this.inProgressMessages=[],n=null}else console.error("filter missing from received data from messaging service",e.data)}}static reInitialization(e){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 subscribe(e,t,n,r){this.connectionsCount+=1;const a=r||`${Date.now()}_${this.connectionsCount}`,o=new Ed(e,t,n);return null!==this.webSocket&&1===this.webSocket.readyState&&this.isAuthenticated?(this.subscribeToSocket(o,a),a):(this.inProgressSubscriptions.push({messageSubscriber:o,id:a}),null===this.webSocket&&this.initConnection(this.connectionConfig),a)}static subscribeToSocket(e,t){this.subscribers[t]=e;const n={filter:e.filter,subscribe:{id:t}};this.webSocket.send(JSON.stringify(n))}static unsubscribe(e,t){if(this.subscribers[e]){t||delete this.subscribers[e];const n={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(n))}}static publishMessage(e){null!==this.webSocket?null===this.webSocket||1!==this.webSocket.readyState?this.inProgressMessages.push(e):this.webSocket.send(JSON.stringify(e)):console.error("Web socket not initialized.")}static getUserPresence=()=>this.userPresence;static getCaseSubscription=e=>Sd.getOrCreateSubscription(e);static refreshB2STokenReInit=async()=>{const e={body:{B2SToken:Lr.b2sJWT}};PCore.getRestClient().invokeRestApi("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(Lr.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}`)}))};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 Nd=bd;const vd=class{constructor(){this.records=[],this.maxRecords=0,this.isDirty=!1}getRecords(e){if(e){const t=[],{pageNumber:n,pageSize:r}=e,a=n*r;let o=a-r;for(;o<a;o+=1){if(!this.records[o])return this.maxRecords===o?t:[];t.push(this.records[o])}return t}return this.records}mergeRecords(e,t){if(t){const{pageNumber:n,pageSize:r}=t,a=n*r;let o=0;for(let t=a-r+1-1;t<a;t+=1)this.records[t]=e[o],o+=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=vh(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const Pd=new class{constructor(){this.dataStore={},this.dataStoreMeta={},this.subscribers={},this.dataPageSubscribers={},this.isCacheEnabled=!0,this.subscribedDataPageNames=new Map}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)";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[]}generateHash(e,t,n){const r=Xp(e);let a=[];r||(a=Object.keys(t||{}).map((e=>({name:e}))));let o="",s=e;const i=[];return(r?.parameters||a).forEach((e=>{t?.[e.name]?i.push(t[e.name]):i.push(e.defaultValue??j.NULL_STRING)})),n&&i.push(JSON.stringify(n)),i.join(j.HASH_DELIMITER)&&(o=Dh.getHashedString(i.join(j.HASH_DELIMITER)),s=e+j.UNDERSCORE_STRING+o),s}async getDataAsync(e,t,n={},r,a,o={}){if(o.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),!this.isCacheable(e,a)||o.invalidateCache){const s=await this.fetchData(e,n,r,a,t,o),i=s?.data?.data??[];return{...s.data,data:i,pageNumber:s?.data?.pageNumber,pageSize:s?.data?.pageSize,queryStats:s?.data?.queryStats,status:s?.status}}const s=this.getData(e,n,r,a);if(s.length>0)return Promise.resolve({data:s});const i=await this.fetchData(e,n,r,a,t,o);return{...i.data,data:this.mergeDataStore(e,n,r,a,i),pageNumber:i?.data?.pageNumber,pageSize:i?.data?.pageSize,queryStats:i?.data?.queryStats,status:i?.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:o,reqType:s}=Ff(j.GET_PAGE_DATA,{dataViewName:e,dataViewParameters:encodeURIComponent(JSON.stringify(n))}),i={method:s},c=o&&n&&0===Object.keys(n).length?o.split("?")[0]:o;return ki(c,i,t).then((t=>(this.isCacheable(e)&&(this.dataStore[e]={...this.dataStore[e],[a]:t.data},this._addDataStoreMetaEntry(e,n,a)),t.data)))}subscribeToDataPageUpdates(e,t,n,r={}){if(!e||!t||!n)return!1;const a=this.generateHash(n,r,null);this.dataPageSubscribers[n]??={};const o=this.dataPageSubscribers[n];o[a]??={};const s=o[a];return!s[e]&&(s[e]??=t,this.subscribeToMessageService(n),!0)}getMessagingServiceSubscriptionId(e){return`DATAPAGE_UPDATED:${e}`}unsubscribeToDataPageUpdates(e,t,n={}){if(!e||!t)return!1;const r=this.generateHash(t,n,null),a=this.dataPageSubscribers[t],o=a?.[r];if(!o||!(e in o))return!1;delete o[e],Dh.isObjectEmpty(o)&&a&&delete a[r];const s=this.subscribedDataPageNames.get(t)??0;if(s<=0)return!0;if(1===s){this.subscribedDataPageNames.delete(t);const e=this.getMessagingServiceSubscriptionId(t);Nd.unsubscribe(e)}else this.subscribedDataPageNames.set(t,s-1);return!0}unsubscribeToDatapageUpdates(e,t,n={}){return this.unsubscribeToDataPageUpdates(e,t??"",n)}_isDataPageCached(e,t){if(t&&Dh.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];Object.keys(n).forEach((n=>{if(this.dataStore[t][n]){this.dataStore[t][n].mergeRecords(e[t][n].pxResults)}else{const r=new vd;this.dataStore[t][n]=r,r.mergeRecords(e[t][n].pxResults||[])}}))}))}_addDataStoreMetaEntry(e,t,n){const r=this.generateHash(e,t,null);this.dataStoreMeta[e]??={};const a=this.dataStoreMeta[e];a[r]??=[];const o=a[r];o.includes(n)||o.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 o=this.generateHash(e,t,r),s=a?.data?.data;if(!s||0===s.length)return[];this.dataStore[e]||(this.dataStore[e]={}),this.dataStore[e][o]||(this.dataStore[e][o]=new vd);const i=this.dataStore[e][o];return i.mergeRecords(s,n),i.isDirty=!1,this._addDataStoreMetaEntry(e,t,o),i.getRecords(n)}async fetchData(e,t,n,r,a,o){const{additionalApiParams:{useExtendedTimeout:s=!1,includeTotalCount:i=!1}={},...c}=o,l={dataViewParameters:t};return i&&(l.includeTotalCount=!0),s&&(l.useExtendedTimeout=!0),n&&(l.paging=n),r&&(l.query=r),yd.getData(e,l,a,c)}isDataPage(e=""){return e.startsWith("D_")||e.startsWith("Declare_")}handleCascadeUpdate(){const{dataPageName:e,scope:t}=this;t.handleMessage({message:{datapage:e,parameters:""}})}subscribeToUpdate(e,t,n,r,a,o){this.subscribers[e]=this.subscribers[e]||{},this.subscribers[e].callback=this.subscribers[e].callback||{},o&&!this.subscribers[e].callback?.[o]&&(this.subscribers[e].callback[o]=a),this.subscribeToCascadeUpdates(e,t,n,r,o)}unsubscribe(e,t,n,r,a){delete this.subscribers[e]?.callback?.[a],t&&t.length>0&&dh.unRegisterFields(n,r,t,a)}subscribeToCascadeUpdates(e,t,n,r,a){t&&t.length>0&&dh.registerFields(n,r,t,this.handleCascadeUpdate.bind({dataPageName:e,scope:this}),a)}subscribeToMessageService(e){if(e&&this.subscribedDataPageNames.has(e)){const t=this.subscribedDataPageNames.get(e)??0;return void this.subscribedDataPageNames.set(e,t+1)}const t={matcher:"DATAPAGE_UPDATED",criteria:{datapage:e}},n=this.getMessagingServiceSubscriptionId(e);Nd.subscribe(t,this.handleMessage.bind(this),void 0,n),this.subscribedDataPageNames.set(e,1)}handleMessage(e){const{msgId:t,message:n}=e,{datapage:r,parameters:a=""}=n,o=this.subscribers[r];this.markDataInstanceDirty(r,""===a?null:JSON.parse(a)),t&&this._executeDataPageSubscriptions(e),!t&&o?.callback&&Object.keys(o.callback).forEach((t=>{o.callback?.[t](e.message)}))}markDataInstanceDirty(e,t){let n,r;if((!t||(n=this.generateHash(e,t,null),r=this.dataStoreMeta[e]?.[n],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=Xp(e);return"reloadOncePerInteraction"===t?.refreshStrategy?.type}isCacheable(e,t){return!(this.isPerInteraction(e)||!this.isCacheEnabled)&&!(t&&Object.keys(t).length>1)}disableCache(e){this.isCacheEnabled=!e}};const Td=class{constructor(e,t,n,r,a=100,o=500){this.finalDataViewCall=e,this.combiner=t,this.comparator=n,this.separator=r,this.maxtime=a,this.maxsize=o,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 Od=class{constructor(){this.bufferedDataQueues={}}getBufferedDataQueueForDataPage(e){return this.bufferedDataQueues[e]}addBufferedDataQueueForDataPage(e,t,n,r,a,o,s){return this.getBufferedDataQueueForDataPage(e)||(this.bufferedDataQueues[e]=new Td(t,n,a,r,o,s)),this.bufferedDataQueues[e]}},$d=(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,Rd=e=>e.map((e=>e.field)),Dd=(e,t)=>{const n=(e.query?.filter).filterConditions,r=(t.query?.filter).filterConditions;let a=(t.query?.filter).logic;const o=Object.keys(n).length;$d(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 s=`F${o+t}`;n[s]=r[e],a=a.replace(e,s)})),(e.query?.filter).logic+=` OR ${a}`);const s=Rd(e.query?.select);Rd(t.query?.select).forEach((t=>{s.includes(t)||(e.query?.select).push({field:t})}))},xd=(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]:!Dh.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),wd=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:a}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:a(e,n)})}))},Md=e=>({combiner:Dd,comparator:xd,separator:wd,...e}),Ld=(e,t)=>{try{window.sessionStorage.setItem(e,t)}catch(e){}};class Fd{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={},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(j.HASH_DELIMITER),o=Dh.getHashedString(a),s=`${e.dataSource}_${o}`,i=yd.getAppCacheKey(e.dataSource);if(window.sessionStorage.getItem(i)){const a=JSON.parse(window.sessionStorage.getItem(i));if(t&&Fd.searchResultsCache?.[t]?.[s])n(Fd.searchResultsCache[t][s]);else if("form"!==e.cacheLifeSpan&&Fd.searchResultsCache?.persisted?.[s])n(Fd.searchResultsCache.persisted[s]);else{const o=new Fd(e,t);JSON.stringify(a.associationFilter)===JSON.stringify(e.associationFilter)?(o.dataSourceMetaData=a.dataSourceMetaData,o.isQueryable=a.isQueryable,o.isInitialised=a.isInitialised,o.associationFilter=a.associationFilter,Fd.initializeCache(t,e,s,o),n(o)):(o.associationFilter=e.associationFilter,o.propertyFilter=e.propertyFilter,o.fetchMetaData(t).then((r=>{Ld(i,JSON.stringify({isQueryable:r.data.isQueryable,dataSourceMetaData:r.data,isInitialised:!0,associationFilter:e.associationFilter})),o.isQueryable=r.data.isQueryable,o.dataSourceMetaData=r.data,o.isInitialised=!0,Fd.initializeCache(t,e,s,o),n(o)})).catch((e=>{o.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&Xp(e.dataSource)){const r=new Fd(e,t),a=Xp(e.dataSource);r.isQueryable=!!a?.isQueryable,r.isInitialised=!0,r.dataSourceMetaData=a,Ld(i,JSON.stringify({isQueryable:a?.isQueryable,dataSourceMetaData:a,isInitialised:!0})),r.context=t,Fd.initializeCache(t,e,s,r),n(r)}else{const a=new Fd(e,t);a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((r=>{Ld(i,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,Fd.initializeCache(t,e,s,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new Od;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(Md(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Fd.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Fd.searchResultsCache[e]&&(Fd.searchResultsCache[e]={}),Fd.searchResultsCache[e][n]=r):(void 0===Fd.searchResultsCache.persisted&&(Fd.searchResultsCache.persisted={}),Fd.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return yd.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Fd.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>Pd.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)}}getData(e,t){if(this.isQueryable){if(this.bufferInitialized)try{const t=this.buildSchemaForQueryableBufferDP(e);return Fd.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return Pd.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return Pd.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}return this.fetchNonQueryableResults(e,t)}memoizedGetData(e,t){const n=e?.toLowerCase();if(this.enablePagination?n in this.cache&&this.pageNumber in this.cache[n]:n in this.cache)return this.enablePagination?this.cache[n][this.pageNumber]:this.cache[n];const r=this.getData(e,t);return this.enablePagination?(this.cache[n]=this.cache[n]||{},this.cache[n][this.pageNumber]=r):this.cache[n]=r,r}fetchData(e,t=!1,n){return this.isValidDatasource()&&this.isInitialised?(this.pageNumber=t?this.pageNumber:1,this.memoizedGetData(e,n)):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)return this.fetchNQDataPromise?.then((()=>({data:this.filterDataOnClient(e,this.nonQueryableData,t)}))).catch((e=>Promise.reject(e)));if(this.dataSourceMetaData?.structure&&"list"===this.dataSourceMetaData.structure.toLowerCase()){const n=this.buildSchemaForNonQueryableDP();return this.fetchNQDataPromise=Pd.getDataAsync(this.dataSource,this.context,n.dataViewParameters),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)=>(Object.keys(a).every((o=>!(r?.includes(o)&&a[o]&&this.positionMatches(`${a[o]}`,e,n))||(t.push({...a}),!1))),t)),[])}positionMatches(e,t,n){const r=n?.ignoreCase??this.ignoreCase,a=r?e.toLowerCase():e,o=r?t.toLowerCase():t;switch(n?.matchPosition??this.matchPosition){case"start":return a.startsWith(o);case"contains":return a.includes(o);case"equals":return a===o;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 o=0;(t?.columns??this.columns)?.forEach((t=>{if(t.useForSearch){const s=`F${o}`;o+=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[s]=d}}));const s=Object.keys(a).join(" OR ");return{filterConditions:a,logic:s}}buildQuery(e,t){const n=this.buildSelect(t);return e?{select:n,filter:this.buildFilters(e,t),...yd.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...yd.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 jd=Fd;const Ud=class{static cleanCaches(e){dh.purgeCascadeFields(e),gd.removeContext(e),jd.clearContextedCache(e),yi.cleanContextSubscribers(e),dl(e),Tn.removeContextTreeNode(e),Nd.clearContext(e),Nl.deRegisterForRefresh(e)}},kd="GET_DESCENDANTS";const Vd=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]}},Bd=(e,t)=>{const n={},r=Kl.getLookUpDataPage(e),a=Kl.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}},Gd=(e,t)=>{const n=Kl.getSavableDataPage(e),r=Kl.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}},Wd=e=>{yi.publish(F.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Hd=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))};const qd=class{constructor(e){this.c11nEnv=e}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";shouldDeleteCaseInCreateStage=(e,t,n)=>!e&&t||n;getSaveActionPayload=(e,t=!1)=>{const n=e,r=n&&n.includes(j.MODAL),a=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),o=this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),s=this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID)?this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID):this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENTACTION_ID),i=this.c11nEnv.getContainerName(),c=this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),l=t?void 0:Il(this.c11nEnv.getContextName()),d=this.c11nEnv.getValue("isProcessAction","isProcessAction");return jh.buildActionObject({context:n,containerItemID:e,assignmentID:o,actionID:s,caseID:a,containerName:i,caseType:c,isModalAction:r,isFormValid:l,isProcessAction:d,saveOnly:t},this.c11nEnv)};actionsApiPromise=(e,t,n=!0)=>{let r,a,o="";o=t&&null!==t.actionMgrID?t.actionMgrID||"":un.getNextActionMgrId();const s=new Promise(((e,t)=>{r=e,a=t}));if(!r||!a)throw new Error("resolveFn or rejectFn is not defined.");return un.register(o,s,r,a,e,t,n),{actionMgrID:o,promise:s}};showDataObjectCreateView(e,t=F.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=jh.buildActionObject({viewName:t,className:e},this.c11nEnv),r=ne,{promise:a}=this.actionsApiPromise(r,n);return gh({type:r,payload:{...n,containerName:F.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(!Fl(t)){return new zl(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=He,r=jh.buildActionObject({containerItemID:e,context:t},this.c11nEnv),a=t&&t.includes(j.MODAL);gh({type:n,payload:{...r,isModalAction:a,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:o}=this.actionsApiPromise(n,r);return o.then((()=>{Wd({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=fh()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const r=Kl.getSavableDataPage(n),a=it,o=!!e&&e.includes(j.MODAL),s=jh.buildActionObject({containerItemID:e,dataPageID:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(a,s);return gh({type:"CREATE_DATA_OBJECT",payload:{...s,isModalAction:o,isFormValid:Il(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=ct,r=Kl.getSavableDataPage(e),a=Kl.getDataPageKeys(r),o={};if(a)for(const e of a)o[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const s=jh.buildActionObject({dataViewName:r,dataViewParameters:o},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,s);return gh({type:"DELETE_DATA_OBJECT",payload:{...s}}),i}getDataObjectView(e,t,n={viewName:""}){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=lt,{dataPageID:a,dataViewParameters:o}=Bd(e,t),s=jh.buildActionObject({dataLookUp:a,keyProperties:t,requestPayload:o,viewName:n.viewName||F.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:j.MODAL},this.c11nEnv),{promise:i}=this.actionsApiPromise(r,s);return gh({type:"VIEW_DATA_OBJECT",payload:{...s}}),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}=fh()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const{dataPageID:a,keys:o}=Gd(r,t),s=dt,i=e&&e.includes(j.MODAL),c=jh.buildActionObject({containerItemID:e,dataPageID:a,key:o},this.c11nEnv),{promise:l}=this.actionsApiPromise(s,c);return gh({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:Il(e)}}),l}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=ut,{dataViewParameters:o,dataPageID:s,dataPageKeys:i}=Bd(e,t),c=jh.buildActionObject({actionID:n,actionName:r,dataViewParameters:o,lookupDatapage:s,containerName:j.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(a,c);return gh({type:a,payload:{...c}}),l}submitDataObjectAction(e,t,n){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:r}=fh()?.getState()||{},a=r[e]?.dataInfo?.content?.classID;if(!a)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const o=cp(e),s=Vu(o),i=hu(s,o)||{},{resourceType:c="",key:l=""}=i,d=pt,{dataPageID:u,keys:p}=Gd(a,t),h=jh.buildActionObject({containerItemID:e,actionID:n,resourceType:c,key:l,keys:p,savableDatapage:u,containerName:j.MODAL,context:e},this.c11nEnv);h.context=e;const{promise:f}=this.actionsApiPromise(d,h);return gh({type:d,payload:{...h,isFormValid:Il(e)}}),f}createWork(e,t={flowType:"",containerName:"",openCaseViewAfterCreate:!1,modalOptions:{dockable:!1},startingFields:Object,remoteCaseMeta:{},channelName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.createWork)return window.pms.plugins.c11n.createWork(e,"pyStartCase",t);const{dockable:n=!1}=t?.modalOptions||{};let r=le;const a=jh.buildActionObject({class:e,flowType:"pyStartCase",containerName:j.PRIMARY,openCaseViewAfterCreate:!0,...t,modalOptions:{isDockable:n}},this.c11nEnv),{promise:o}=this.actionsApiPromise(r,a);if(t.channelName&&(a.headers=a.headers||{},a.headers[j.X_ORIGIN_CHANNEL]=t.channelName),V.isRemoteCase(e)){const{RemoteClassName:t,RemoteSystemID:n,name:o}=V.getRemoteCase(e);if(a.className=e,a.class=t,a.headers=a.headers||{},a.headers.RemoteSystemID=n,V.isTraditionalRemoteCase(e)){const n={className:e,name:o,action:"createWork",remoteClassName:t};r=this.setTraditionalRemoteCaseParams(a,n)}}return $i.getPreviewMode()&&(a.debugInfo={debugId:Dh.generateUniqueID()}),gh({type:r,payload:{...a}}),o}setTraditionalRemoteCaseParams(e,t){return e.className=t.className,e.isTraditionalRemoteCase=V.isTraditionalRemoteCase(t.className),e.remoteClassName=t.remoteClassName,e.action=t.action,e.viewName=U,e.gadgetId=t.gadgetId??wc.getUniqueGadgetId(),e.name=t.name,e.skipSemanticUrl=!0,ne}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=ye,r=jh.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:a}=this.actionsApiPromise(n,r);return gh({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=jh.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:a}=this.actionsApiPromise("GET_DESCENDANTS",r),o=(s={...r,context:n},{type:kd,payload:s});var s;return gh(o),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(window.pms?.plugins?.c11n?.openWorkByHandle)return window.pms.plugins.c11n.openWorkByHandle(e,t);const r={insKey:e,acTargetName:n.targetContainer||j.PRIMARY,containerName:n.targetContainer||j.PRIMARY};let a=de;const o=jh.buildActionObject(r,this.c11nEnv),{promise:s}=this.actionsApiPromise(a,o);return n.channelName&&(o.headers=o.headers||{},o.headers[j.X_ORIGIN_CHANNEL]=n.channelName),o.className=t,V.isRemoteCase(t)&&(a=this.setRemoteCaseParamsForOpenCase(o,t,n.remoteCaseMeta)??a),$i.getPreviewMode()&&![j.WORKAREA].includes(n.targetContainer)&&(o.debugInfo={debugId:Dh.generateUniqueID()}),gh({type:a,payload:{...n,...o}}),s}setRemoteCaseParamsForOpenCase(e,t,n={}){const{RemoteSystemID:r,RemoteClassName:a,name:o}=V.getRemoteCase(t);if(e.headers=e.headers||{},e.headers.RemoteSystemID=r,e.isRemoteCase=!0,e.remoteCaseClass=t,V.isTraditionalRemoteCase(t)){e.remoteCaseMeta=n;const r={className:t,name:o,action:mt,remoteClassName:a};return this.setTraditionalRemoteCaseParams(e,r)}}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(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};n.isChild&&(r.containerName=j.PRIMARY,r.isChild=n.isChild);let a=Wl;const o=jh.buildActionObject(r,this.c11nEnv),{promise:s}=this.actionsApiPromise(a,o);if(n.channelName&&(o.headers=o.headers||{},o.headers[j.X_ORIGIN_CHANNEL]=n.channelName),V.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:r,name:s}=V.getRemoteCase(t);if(o.headers=o.headers||{},o.headers.RemoteSystemID=r,V.isTraditionalRemoteCase(t)){o.remoteCaseMeta=n.remoteCaseMeta;const r={className:t,name:s,action:"openAssignment",remoteClassName:e};a=this.setTraditionalRemoteCaseParams(o,r)}}o.className=t,o.activeItemCaseViewMode=this.c11nEnv.getValue("context_data.caseViewMode"),$i.getPreviewMode()&&![j.WORKAREA].includes(n.containerName)&&(o.debugInfo={debugId:Dh.generateUniqueID()});const i={context:o.context||n.context,containerName:o.containerName||n.containerName,targetContainerName:o.containerName||n.containerName,viewType:o.viewType||n.viewType,skipBrowserSemanticUrlUpdate:n.skipBrowserSemanticUrlUpdate};return gh({type:a,payload:{...o,...i}}),s}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));const n=vu(e);let r=n;if(n?.includes("/workarea")&&(r=n.substring(0,r?.lastIndexOf("/workarea"))),(e=>{const t=Tn.getContextReferences(e);if(t)for(const[,e]of t)if(Lh.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0;return!1})(n)){const e=[{type:"error",message:Sp.getLocaleValue(this.MSG_ACTIVE_SUGGESTION_UNATTENDED,"Messages")}];return Xn({messages:e,context:r,category:F.PAGE}),Promise.reject({type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR})}const a=pe,o=t?.isTriggeredFromDifferentContext,{caseID:s,assignments:i,localActionID:c,caseActions:l,caseInfo:d,businessID:u,caseTypeID:p,caseTypeName:h}=dn(e,this.c11nEnv,{isTriggeredFromDifferentContext:o}),f=nn(d);let g,m=!1;if(l){const e=l.find((e=>e.ID===c));m="Case"===e?.type}else g=mh(n);let{assignmentID:y}=dn(e,this.c11nEnv,{isTriggeredFromDifferentContext:o});g?.context_data?.actionType&&(m=g.context_data.actionType===j.CASE,y=y||g.context_data.assignmentID);const E=ln(i,y,c),[I,A]=s.split(" "),C={class:I,actionID:E,assignmentID:y,caseID:s,workID:A,containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:m,doDeleteCaseSummary:!0,isInCreateStage:f,businessID:u,caseTypeID:p,caseTypeName:h};e?.includes(j.MODAL)&&(C.containerName=j.MODAL,C.isModalAction=!0),C.outcome=t.outcomeID,C.jsActionQueryParams=t.jsActionQueryParams,d?.isLocalAction&&(C.viewType=Lc.FORM);const _=jh.buildActionObject(C,this.c11nEnv),{promise:S}=this.actionsApiPromise(a,_);return _.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||mh(n).context_data.isProcessAction,Jt.executeOrQueueDeferredAction({type:a,payload:{..._,context:n}}),S}getNextWork(){const e=Wl,t=jh.buildActionObject({containerName:j.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return gh({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=Wl,n=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getCaseSummary().headers,a=jh.buildActionObject({containerName:this.c11nEnv.getContainerName(),isOpenStage:!0,stageID:e},this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),s={type:t,payload:{...a,caseID:n,headers:r}};return gh(s),o}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(F.CASE_INFO.CASES),r=this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID),a={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(j.MODAL)&&(a.containerName=j.MODAL,a.isModalAction=!0);const o=jh.buildActionObject(a,this.c11nEnv),{promise:s}=this.actionsApiPromise(t,o),i=vu(e);return gh({type:t,payload:{...o,context:i,cases:n,actionID:r,isFormValid:Il(i),classID:this.c11nEnv.getCurrentClassID()}}),s}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(F.CASE_INFO.CASES),r=this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID),a={containerName:e.includes(j.MODAL)?j.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(j.MODAL)},o=jh.buildActionObject(a,this.c11nEnv),{promise:s}=this.actionsApiPromise(t,o),i=vu(e);return gh({type:t,payload:{...o,context:i,cases:n,actionID:r,isFormValid:Il(i),classID:this.c11nEnv.getCurrentClassID()}}),s}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"));const{selectedList:n,runningMode:r}=t,a=t.type,o={selectedList:n,vcName:t.target,actionName:t?.name,actionID:e,doDeleteCaseSummary:!0,localActionType:a,runningMode:r,...t},s="OPEN_BULK_ACTION",i=jh.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(s,i);return gh({type:s,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 zl(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(gh({type:Q,payload:{reference:F.CASE_INFO.APPROVALFLAG,value:j.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)):(gh({type:Q,payload:{reference:F.CASE_INFO.APPROVALFLAG,value:j.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(F.CASE_INFO.DUPLICATECASEINSKEY).split(" "),n={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEFLAG,value:j.DUPLICATE,context:e}},r={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return gh([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:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEFLAG,value:j.IGNORE,context:e}},n={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEID,value:"",context:e}},r={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEINSKEY,value:"",context:e}};return gh([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=t.caseID||this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID);if(window.pms?.plugins?.c11n?.openLocalAction)return t.caseID=n,Hd(window.pms.plugins.c11n.openLocalAction,e,t);const r=t.assignKey||this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),a=t.type,o={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,localActionType:a,...t},s="OPEN_LOCAL_ACTION",i=jh.buildActionObject(o,this.c11nEnv),c=this.c11nEnv.getContextName(),{promise:l}=this.actionsApiPromise(s,i),d=Ou(c)[0];let u=!1;const p=V.getRemoteHeaderByContext(c);let h;if(p&&(i.headers={},i.headers.RemoteSystemID=p),!d)return h=c,gh({type:s,payload:{...i,contextName:c,continueExecution:u}}),l;h=Su(d);const f=pu(d);if(f?.accessedOrder.forEach((e=>{n===f.items[e].key&&(u=!0,h=f.items[e].context)})),!u||h&&"review"===fh()?.getState()?.data[h]?.context_data?.caseViewMode)return gh({type:s,payload:{...i,contextName:c,continueExecution:u}}),l;const g=h,m=g&&g.includes(j.MODAL),y=t.assignKey||this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),E=mh(h),I=E?.caseInfo?.assignments?E.caseInfo.assignments[0]?.actions[0]?.ID:void 0,A=this.c11nEnv.getContainerName(),C=this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),_=this.c11nEnv.getValue("isProcessAction","isProcessAction"),S=jh.buildActionObject({context:g,containerItemID:h,assignmentID:y,actionID:I,caseID:n,containerName:A,caseType:C,isModalAction:m,isFormValid:!0,isProcessAction:_},this.c11nEnv);S.context=h;const b=vu(h),N=this.c11nEnv.getCaseSummary(),v=nn(N),P=jh.buildActionObject({caseID:n,containerItemID:h,cancelContext:b},this.c11nEnv);let T={};return m?(P.acTargetName=j.MODAL,P.isInCreateStage=v,P.isModalAction=m,T={...P}):T={...P,acName:yt(this.c11nEnv.getContainerName(),P.context)},gh({type:s,payload:{...i,contextName:c,saveActionPayload:S,cancelActionPayload:T,continueExecution:u}}),l}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(F.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,Hd(window.pms.plugins.c11n.openProcessAction,e,t);const r=this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID)||t.assignKey,a=t.type,o={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,processActionType:a,isProcessAction:!0,...t},s=Gl,i=jh.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(s,i);return gh({type:s,payload:{...i}}),c}navigateToStep(e,t){if(!e)return Promise.reject(new Error("stepID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("stepID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n="NAVIGATE_TO_STEP",r=this.c11nEnv.getValue(F.NEXT_ASSIGNMENT_INFO_ID)?this.c11nEnv.getValue(F.NEXT_ASSIGNMENT_INFO_ID):this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),a=nn(this.c11nEnv.getCaseSummary()),o=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),s={ID:r,stepID:e,acTargetName:this.c11nEnv.getContainerName(),targetContainerName:this.c11nEnv.getContainerName(),containerItemID:t,doDeleteCaseSummary:!0,isInCreateStage:a,caseID:o};t&&t.includes(j.MODAL)&&(s.acTargetName=j.MODAL);const i=jh.buildActionObject(s,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=vu(t);return gh({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}=F,r=he,a=vu(e),o=e&&e.includes(j.MODAL),s=this.c11nEnv.getCaseSummary(),i=nn(s),c=this.c11nEnv.getValue(n.CASE_INFO_ID),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),d=jh.buildActionObject({caseID:c,containerItemID:e,context:a},this.c11nEnv);let u={};o?(d.acTargetName=j.MODAL,d.isInCreateStage=i,d.isModalAction=o,u={...d}):u={...d,acName:yt(this.c11nEnv.getContainerName(),d.context)};const{promise:p}=this.actionsApiPromise(r,d);return gh({type:r,payload:u}),p.then((()=>{t||Wd({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}=F,n=e,r=He,a=e&&e.includes(j.MODAL),o=this.c11nEnv.getValue(t.CASE_INFO_ID),s=jh.buildActionObject({caseID:o,containerItemID:e,context:n},this.c11nEnv);if(!Fl(n)){return new zl(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{Wd({caseID:o,context:this.c11nEnv.getContextName()})}))}gh({type:r,payload:{...s,isModalAction:a}});const{promise:i}=this.actionsApiPromise(r,s);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}=F,n=He,r=e,a=r&&r.includes(j.MODAL),o=this.c11nEnv.getCaseSummary(),s=nn(o),i=this.c11nEnv.getValue(t.CASE_INFO_ID),c=jh.buildActionObject({caseID:i,containerItemID:e,context:r},this.c11nEnv),l=this.c11nEnv.getValue("isProcessAction","isProcessAction"),d=Ap.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(c.isProcessAction=l,s&&(a||d)&&!an(o)){const t=this.c11nEnv.getValue(j.CASE_INFO.IS_FIRST_ASSIGNMENT),i=Fl(r);if(this.shouldDeleteCaseInCreateStage(i,t,d))return this.deleteCaseInCreateStage(e);gh({type:n,payload:{...c,isModalAction:a,isChildCase:cn(o),isInCreateStage:s}})}const{promise:u}=this.actionsApiPromise(n,c);return u.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=ql,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return gh(Yl(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=ql,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return gh(Yl(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=Hl,r=e,a=r&&r.includes(j.MODAL),o=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),s=this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),i=jh.buildActionObject({caseID:o,caseType:s,containerItemID:e,context:r,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(F.CASE_INFO.PARENTCASEINFO);i.isProcessAction=c,i.parentCaseInfo=l;const d=`${j.APP.APP}/${du.PRIMARY}`,u=Yc(d,du.PRIMARY);i.parentContext=u,a&&(i.targetName=j.MODAL,i.containerName=du.MODAL,i.isModalAction=a),gh((e=>({type:Hl,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Wd({caseID:o,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}=Ip.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=I()+t;return ki(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:a}=Ip.getRestEndPoint("updateRecents")||{},o=`${I()}${a}`;return ki(o,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=Ip.getRestEndPoint("Logout")||{},t=`${I()}${e}`;return ki(t,{method:"GET",headers:{}}).then((e=>(Object.keys(Tn.rootNodes).forEach((e=>{Ud.cleanCaches(e)})),Tn.rootNodes={},sessionStorage.clear(),Oh(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return ki(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,"pyCasePreview",{container:du.PREVIEW,containerName:du.PREVIEW,context:F.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("pyDataPreview",e,t,{container:du.PREVIEW,containerName:du.PREVIEW,context:F.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=jh.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),RemoteSystemID:V.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=te,{promise:o}=this.actionsApiPromise(a,r,!1);return gh({type:a,payload:{...r}}),o}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=jh.buildActionObject({viewName:e,className:t},this.c11nEnv),a=ne,{promise:o}=this.actionsApiPromise(a,r);return $i.getPreviewMode()&&(r.debugInfo={debugId:Dh.generateUniqueID()}),gh({type:a,payload:{...r,containerName:n.containerName||this.c11nEnv.getContainerName(),skipSemanticUrl:n.skipSemanticUrl}}),o}showInsight(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_INSIGHTID_REQUIRED));const n=jh.buildActionObject({},this.c11nEnv),r=ae,{promise:a}=this.actionsApiPromise(r,n);return gh({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=jh.buildActionObject({},this.c11nEnv),r=oe,{promise:a}=this.actionsApiPromise(r,n);return gh({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=jh.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:V.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),o=re;r?.containerName||(r.containerName="HYBRID"===Ap.getRenderingMode()?Vd.getRuntimeParam(j.HYBRID_ROOT_CONTAINERNAME):dc.getTargetViewContainerName(o));const{promise:s}=this.actionsApiPromise(o,a);return gh({type:o,payload:{...a,...r,skipSemanticUrl:Boolean(r.skipSemanticUrl)}}),s}changeHandler(e,t){jh.changeHandler(e,t)}eventHandler(e,t){jh.eventHandler(e,t)}triggerFieldChange(e,t,n=!1){const r=this.c11nEnv.getContextName(),a=this.c11nEnv.getPageReference(),o=Lh.getContextPath(a,e);n||this.c11nEnv.getValidationApi().validate(t),this.c11nEnv.isInsideList()&&this.c11nEnv.getListActions().updateProperty(e,t);let s=this.c11nEnv.getValue(j.CLASS_ID);const i=e?e.split(".").filter((e=>!!e)):[];i.length>1&&(i.pop(),s=Ih(`.${i.join(".")}.classID`,a,r)),e=Dh.trimDotForProperty(e),gh({type:ee,payload:{reference:o,value:t,context:r,pageReference:this.c11nEnv.getPageReference(),propertyName:e||this.c11nEnv.getComponentConfig().value,classID:s}})}updateFieldValue(e,t,n={}){const{removePropertyFromChangedList:r=!1,isArrayDeepMerge:a=!0,contextPageReference:o="",isListEntry:s=!1,skipDirtyValidation:i=!1}=n,c=this.c11nEnv.getContextName();let l=this.c11nEnv.getPageReference();const d=o?.startsWith(l)?o.replace(l,""):o;l=o||l;const u=Lh.getContextPath(l,e);let p=!1;this.c11nEnv.isInsideList()&&this.c11nEnv.getListActions().updateProperty(d?`${d}${e}`:e,t,{isArrayDeepMerge:a}),this.c11nEnv.isBulkAction()&&(p=!0),e||(e=this.c11nEnv.getStateProps().value),zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:l,context:c,isListEntry:s}),gh({type:Q,payload:{reference:u,value:t,context:c,isArrayDeepMerge:a,skipDirtyValidation:i,...p&&{isStrictTracking:p},...r&&{removePropertyFromChangedList:r}}})}activateModalContainerItem(e){const t=Me,{context:n}=e,r=n&&n.includes(j.MODAL),a=jh.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);r&&(a.containerName=j.MODAL,a.isModalAction=r),gh({type:t,payload:a});const{promise:o}=this.actionsApiPromise(t,a);return o}refreshCaseView(e,t,n,r={}){const{promise:a,actionMgrID:o}=this.actionsApiPromise("REFRESH_DATA"),{autoDetectRefresh:s,propertyName:i,preserveClientChanges:c,classID:l,context:d,optionalPayload:u}=r,p={actionMgrID:o,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,optionalPayload:u};r.refreshFor&&(p.refreshFor=r?.refreshFor),r.skipDataMerge&&(p.skipDataMerge=r?.skipDataMerge);const h=d||this.c11nEnv.getContextName(),f=this.c11nEnv.getPageReference();return!this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)&&s&&(((e,t)=>sn(e)&&!on(e,t))(h,f)||on(h,f))?Fn(h,n,p):xn(e,t,h,n,p),a}openEmbeddedDataModal(e,t,n,r,a,o){const s=ht,i=t.getCaseInfo().getKey(),c=`${t.getPageReference().replace(F.CASE_INFO.CASE_INFO_CONTENT,"")}${n}[${r}]`,l={targetProperty:n,index:r,viewID:e,ID:i,actionType:a,interestPage:Dh.convertPageRefToClipboardPageNotation(c),heading:o},d=jh.buildActionObject(l,this.c11nEnv),{promise:u}=this.actionsApiPromise(s,d);if(Ap.getFeatureMap().granularUIRefresh){(t.getMetadata().config.children[0].children||[]).forEach((e=>{const n=tn.trimAnnotation(e.config.value),r=Bp(n.startsWith(".")?n.replace(".",""):n,e.config.classID);if(r?.isDeclarativeTarget){const e=t.getPageReference();Tn.addFieldNode(t.getContextName(),e+c,t.viewName,n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:e+c})}}))}return gh({type:s,payload:{...d,containerName:F.MODAL,skipSemanticUrl:!0}}),u}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=ft,n=this.c11nEnv.getPageReference().replace(F.CASE_INFO.CASE_INFO_CONTENT,""),r=vu(e),a={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),viewID:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME),isFormValid:Il(r),interestPage:Dh.convertPageRefToClipboardPageNotation(n),parentContext:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isModalAction:!1,target:this.c11nEnv.getTarget()};e&&e.includes(j.MODAL)&&(a.containerName=j.MODAL,a.isModalAction=!0);const o=jh.buildActionObject(a,this.c11nEnv),{promise:s}=this.actionsApiPromise(t,o);if(Fl(r)){const[e,t,n]=mn(this.c11nEnv.getPageReference());Tn.mutatePageList(this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),e,t,{type:Ze,rowIndex:n}),gh({type:Ze,payload:{pageReference:this.c11nEnv.getPageReference(),context:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isListEntry:!0}})}return Jt.executeOrQueueDeferredAction({type:t,payload:{...o,context:r}}),s}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=vu(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:a}=this.actionsApiPromise(gt);return Fn(t,n,{actionMgrID:a,isFillFormWithAI:!0,preserveClientChanges:!1}),r}};const Yd=class{constructor(e){this.c11nEnv=e}async getCaseStages(e,t){const n={caseID:e},{restApi:r,reqType:a}=Ff("getCaseStages",n);return(await ki(r,{method:a},t)).data.stages}getCaseTypeName(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_TYPE_NAME)}getName(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_NAME)}getClassName(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_TYPE_ID)}getAvailableProcesses(){return this.c11nEnv.getValue(j.CASE_INFO.AVAILABLEPROCESSES)}getKey(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(j.CASE_INFO.ASSIGNMENT_ID)}getActions(){return this.c11nEnv.getValue(j.CASE_INFO.ACTION_BUTTONS)}getActiveFlowActionID(){return this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID)||this.c11nEnv.getValue(j.CASE_INFO.ASSIGNMENTACTION_ID)}getParentCaseInfo(){return this.c11nEnv.getValue(j.CASE_INFO.PARENTCASEINFO)}isPerform(){return this.c11nEnv.getValue(`${j.CONTEXT_DATA}${j.CASE_VIEW_MODE_PROP}`)===j.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${j.CONTEXT_DATA}${j.CASE_VIEW_MODE_PROP}`)===j.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO);return nn(e)}isLocalAction(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO);return an(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===j.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),r=hu(t,n),{config:a}=t&&n?r&&r.view:this.c11nEnv.getMetadata();e=a?.type===j.VIEW?a?.name:null}(e&&e.startsWith(j.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(j.CASE_INFO.VIEW_NAME))}return e}getActionRefreshConditions(){const e=this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),t=W(this.c11nEnv.getContextName());let n;t&&(n=mh(t));const r=n?.caseInfo?.availableActions,a=mh(this.c11nEnv.getContextName()),o=a?.caseInfo?.refreshConditions;if(e){if(r){const t=r.find((t=>t.ID===e));return t?t.refreshConditions:o}return o}return this.c11nEnv.getValue(j.CASE_INFO.ACTION_REFRESH_CONDITIONS)}getBusinessID(){return this.c11nEnv.getValue(j.CASE_INFO.BUSINESS_ID)}getAssignments(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO)?.assignments}getChildAssignments(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO)?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),t=this.c11nEnv.getValue(j.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(j.CASE_INFO.CASE_INFO_ACTIONS),t=this.c11nEnv.getValue(j.CASE_INFO.ASSIGNMENT_LABEL),n=this.c11nEnv.getValue(j.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 o=[...n,...a];let s=JSON.parse(JSON.stringify(o));return e&&!this.isPerform()&&(s=s.map((e=>(e.name=this.getActiveCaseActionName()||e?.name||t,e)))),s}getActiveCaseActionName(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ACTIONS),t=this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ACTIONS);return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(j.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(j.CASE_INFO.GETNEXTWORK)}},{RESOURCE_TYPES:Kd}=F;const zd=class{static openCase(e,t,n,r={}){const a={insKey:e,acTargetName:n,actionMgrID:un.getNextActionMgrId(),context:t,...r},o=de;r&&r.channelName&&(a.headers={},a.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:s}=un.actionManagerPromise(o,a.actionMgrID);return gh({type:o,payload:a}),s}static openAssignment(e,t,n,r={}){const a={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:un.getNextActionMgrId(),context:t,...r},o=fe;r&&r.channelName&&(a.headers={},a.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:s}=un.actionManagerPromise(o,a.actionMgrID);return gh({type:o,payload:{...a}}),s}static createCase(e,t,n,r={}){const a=le,o={class:e,acTargetName:n,actionMgrID:un.getNextActionMgrId(),context:t,...r};r&&r.channelName&&(o.headers={},o.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:s}=un.actionManagerPromise(a,o.actionMgrID);return gh({type:a,payload:{...o}}),s}static getNextWork(e,t,n={}){const r=fe,a={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:un.getNextActionMgrId(),context:e,...n},{promise:o}=un.actionManagerPromise(r,a.actionMgrID);return gh({type:r,payload:{...a}}),o}static getOpenedCaseItems(e){const t=[],n=pu(e);if(n){const{items:r={}}=n,a=Object.keys(r),o=Su(e);a.forEach((n=>{if(r[n]&&(r[n].resourceType===Kd.CASE||r[n].resourceType===Kd.ASSIGNMENT)){const{key:a="",context:s}=r[n],i=r[n],c=a.substring(a.indexOf(" ")+1),l=Ih(".caseTypeID",j.CASE_INFO.CASE_INFO,s),d=o===n;t.push({...i,key:a,workID:a,caseID:c,className:l,context:s,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}=Ff(Be,n),o={},s=V.getRemoteHeaderFromSourceClass(t??"");return s&&(o.RemoteSystemID=s),ki(r,{method:a,headers:o})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=Ff("getBulkActions"),r=e.map((e=>({ID:e}))),a=r.length,o=a/5,s={},i=[];for(let e=0;e<a;e+=o)s.cases=r.slice(e,e+o),s.cases.length&&i.push(ki(t,{method:n,body:s}));const c=await Promise.all(i);let l=[];for(let e=0;e<c.length;e+=1)0!==e?l.length&&(l=l.filter((t=>c[e].data.availableActions.some((e=>t.ID===e.ID))))):l=c[e].data.availableActions;return l};static getCaseBulkActionsByCaseTypeID=async e=>{const t={casetypeID:e},{restApi:n,reqType:r}=Ff("getCaseBulkActions",t),a=await ki(n,{method:r});let o=[];return a.data?.availableActions?.length&&(o=a.data.availableActions),o}};const Xd=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=Lh.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=Lh.getContextPath(this.datasource,this.index);return this.index+=1,ou({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class Jd{constructor(e,t){this.children=e,this.index=0,this.options=t}hasNext(){return this.index<this.children.length}next(){if(!this.hasNext())throw new Error("No Children");const e=this.children[this.index];return this.index+=1,ou({meta:e,index:this.index,options:this.options})}resetIndex(){this.index=0}}const Qd=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new Xd(e,e.context||"",t);if(n){const n=Ch(`${t.context}.${j.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new Xd(e.children[0],n||e.context,t)}return e?.children?new Jd(e.children,t):void 0};class Zd{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=>_l.isProperty(e))).map((e=>_l.getPropertyName(e)))}}const eu=new Zd;let tu;Object.freeze(eu);const nu=(e,t,n)=>{e&&(Object.keys(e).forEach((r=>{if("children"!==r){const a=e[r],o=tn.trimAnnotation(a);if("string"!=typeof o&&"string"!=typeof a||!(Dh.isValidAnnotation(a)&&Dh.isPropertyRef(o)||a.startsWith("@W ")||a.startsWith("@E ")||a.startsWith("@ATTACHMENT "))){if(Array.isArray(o))o.forEach(((e,n)=>{const a={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||[],t[r][n]=Object.create({}),nu(e,t[r][n],a)}));else if(o&&"object"==typeof o&&"exp"!==o.type){const e={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||{},nu(o,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[r]=o}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},ru=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...Dh.deepClone(t.inheritedProps)]};class au{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.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.xrayInfo={},this._readOnly=t?.config?.readOnly||r.readOnly,this._hasSuggestions=!1,this._actionsApi=null,this._classID=null,this.index=e.index,this.categoryName=r.categoryName||"",r.inheritedConfig&&(this._inheritedConfig=Dh.deepClone(r.inheritedConfig)),t?.config?.inheritedProps&&ru(this._inheritedConfig,t?.config),nu(this._rawConfig,this._stateProps),this._isState=!Dh.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=Dh.isExpressionExist(this._rawConfig.config),this._isWhenExist=Dh.isWhenExist(this._rawConfig.config),this._isValidatorExist=Dr.isValidatorExist(this._rawConfig.config)),this._isRoot?this._contextName=F.APP.APP:this._contextName=this.meta?.config?.contextName||this.options.context,this._type=this.meta?.type;let o=this.options.pageReference;if(this.options.pageReference&&(o=tn.handleAnnotation(this.options.pageReference,this)),this._pageReference=Lh.getContextPath(o||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t),"reference"===this._type&&Dh.isWhenExist({visibility:this.meta?.config?.visibility})&&wn(this.viewName,this._contextName,this._pageReference),"reference"!==this._type&&t&&(this._rawConfig=Lh.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=tn.trimAnnotation(e.localeReference)||r.localeReference,this._isExpressionExist=Dh.isExpressionExist(e),this._isWhenExist=Dh.isWhenExist(e),this._isValidatorExist=Dr.isValidatorExist(e)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&(this.viewName=tn.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&Ln(this)}}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=tn.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=tn.trimAnnotation(this.getPropertyName());return""===this._pageReference&&e.startsWith(".")?e.substring(1,e.length):e}addFieldNode(){const e=this._getPropertyName(),{value:t,label:n,required:r,readOnly:a,disabled:o,visibility:s,validationType:i,caption:c,allowMultiple:l}=this.getRawConfigProps();if(this.getValue(this._pageReference)||""===this._pageReference){const d="Address"===this._type&&this._rawConfig?.config?.associatedView?tn.trimAnnotation(this._rawConfig.config.associatedView):"",u=n||c,p={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:tn.trimAnnotation(t),label:u?.startsWith("@")?tn.handleAnnotation(u,this,void 0):u,required:r,readOnly:a,disabled:o,visibility:s||this.options?.visibility,skipRequiredValidation:this.options?.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:t,validationType:i,componentName:this._rawConfig?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),index:this.index,allowMultiple:l,isDeclarativeTarget:this.isDeclarativeTarget()};Tn.addFieldNode(this._contextName,this._pageReference,(d||this.categoryName||this.viewName)??"",e,this.getValue(e),p)}}removeNode(){if(!this.isVisible())if(Object.hasOwn(this._rawConfig?.config??{},"value"))Tn.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",tn.trimAnnotation(this.getPropertyName()),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference;Tn.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index)}}addViewNode(){this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&this.viewName&&Tn.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName),"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&Tn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&Tn.addViewNode(this._contextName,this._pageReference,tn.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&Tn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}addWhenNode(){let e="",t="";const n=Dh.getWhenNames(this._rawConfig?.config),r=this.getRawConfigProps();if(r?.type&&r?.type?.toLowerCase()===j.VIEW)t=j.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=j.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=tn.isProperty(n)?tn.trimAnnotation(n):""}e&&n.forEach((n=>{Tn.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()!==j.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,readOnly:r,disabled:a,visibility:o,validationType:s,selectionMode:i,selectionList:c,selectionKey:l,referenceList:d,renderMode:u,caption:p}=this.getRawConfigProps(),h=t||p;let f=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(f=this.getSelfReferencingDatapageKeys()),Tn.addPageListNode(this._contextName,this._pageReference,this.viewName??"",tn.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:tn.trimAnnotation(this.getPropertyName()),label:h?.startsWith("@")?tn.handleAnnotation(h,this,void 0):h,required:n,readOnly:r,disabled:a,visibility:o||this.options.visibility,skipRequiredValidation:this.options.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:e,validationType:s,componentName:this._rawConfig.type,type:this._rawConfig.config?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),selectionMode:i,selectionList:c,renderMode:u,referenceList:d,selectionKey:l,index:this.index,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?f:void 0});const g=this.getValue(tn.trimAnnotation(this.getPropertyName()),this._pageReference)||[];Tn.updatePageListNode(this._contextName,this._pageReference,tn.trimAnnotation(this.getPropertyName()),g.length)}this.isWhenExist()&&this.addWhenNode(),this.removeNode()}setXRayInfo(e){Dh.mergeDeep(e,this.xrayInfo)}getXRayInfo(){return this.xrayInfo}getStateProps(){return this._stateProps}setStateProps(e){Dh.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getCaseInfo(){return this._caseInfo||(this._caseInfo=new Yd(this)),this._caseInfo}getCaseLocaleReference(){const e=this.getCaseInfo().getClassName();return e?`CASE!${e}`.toUpperCase():null}getListActions(){return Or(this)}getReferenceList(){return this._referenceList}isInsideList(){return this._isInsideList||/\[\d+\]/g.test(this.getPageReference())}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 Lh.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[j.CONTAINERS.ROOT_CONTAINER,j.CONTAINERS.VIEW_CONTAINER,j.CONTAINERS.FLOW_CONTAINER,j.CONTAINERS.MODAL_VIEW_CONTAINER,j.CONTAINERS.PREVIEW_VIEW_CONTAINER,j.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=du.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=l?.getStore()?.getState()?.data[`${this.getContextName()}/${j.SUGGESTION}`],n=this.getStateProps()?.value,r=Lh.getContextPath(this.getPageReference(),n),a=t?cc.getSuggestionsContext(this.getContextName()).getField(r):void 0;this._hasSuggestions=!!a,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...$r.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig&&this._rawConfig.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(t),this.resolveConfigProps(t,e),Dh.resolveStringBooleans(e)}getRawConfigProps(){const e={...$r.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(Lh.resolveProps(e,t,this),tn.handleComponentMapping(t,{type:this.getComponentName(),config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),nu(e,this._stateProps),this.resolveConfigProps(this._additionalRegisteredProps)}deRegisterAdditionalProps(e=[]){return e.forEach((e=>{delete this._additionalRegisteredProps[e]})),!0}populateAdditionalProps(e){const t=this.getComponentName(),n=this.getComponentConfig(),r=t===j.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(t===j.MODAL_VIEW_CONTAINER||t===j.CASE_CREATE_STAGE){const t=Su(`${j.APP.APP}/${this.getContainerName()}`),n=Kn({context:t,category:F.PAGE});e.pageMessages=n,this._stateProps.pageMessages=e.pageMessages}if(this.isEditable()){let{value:t}=this.getStateProps();void 0===t&&"multi"===this.getComponentConfig()?.selectionMode?t=this.getStateProps().selectionList||tn.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=Kn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_ERROR}),r=Kn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_INFO});n&&n[0]&&(e.validatemessage=n.map((e=>Sp.getLocaleValue(e.message.replace(/\.$/,""),"Messages"))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=j.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status),r&&r[0]&&(e.infoMessage=r[0].message,e.status=j.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(t===j.ROOT_CONTAINER){const t=Qn(r,Su(`${j.APP.APP}/${this.getContainerName()}`));e.httpMessages=t,this._stateProps.httpMessages=e.httpMessages;const n=cc.getSharedState("isLoggedOut");e.isLoggedOut=n,this._stateProps.isLoggedOut=n;const a=Kn({context:j.APP.ROOT,category:"PAGE"});e.pageMessages=a,this._stateProps.pageMessages=e.pageMessages}if(t===j.HYBRID_VIEW_CONTAINER){const t=Kn({context:j.APP.APP,category:j.HTTP});e.httpMessages=t,this._stateProps.httpMessages=t}if(t===j.APP_SHELL&&e.portalDocMode===j.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=zd.getOpenedCaseItems(`${F.APP.APP}/${j.PRIMARY}`),this._stateProps.activeCases=e.activeCases),t===j.APP_SHELL){const t=j.APP.APP,n=Su(`${t}/${this.getContainerName()}`),r=[...Kn({context:t,category:"PAGE"})||[],...Kn({context:n,category:"PAGE"})||[]],a=r.length>0?r:void 0;e.pageMessages=a,this._stateProps.pageMessages=e.pageMessages}if(e.value&&t===j.SCALARLIST&&(this._stateProps.value=e.value),t===j.APP_SHELL||t===j.MODAL_VIEW_CONTAINER||t===j.CASE_CREATE_STAGE||n.template===j.CASE_PREVIEW){let t=Kn({context:j.APP.APP,category:"HTTP"});const n="HYBRID"===Ap.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${j.APP.APP}/${this.getContainerName()}`,r=Kn({context:Su(n),category:"HTTP"});t?r&&(t=t.concat(Kn({context:Su(n),category:"HTTP"}))):t=Kn({context:Su(n),category:"HTTP"}),e.httpMessages=t?t.map((e=>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(t===j.VIEW_CONTAINER||t===j.FLOW_CONTAINER||t===j.MODAL_VIEW_CONTAINER||t===j.PREVIEW_VIEW_CONTAINER||t===j.ROOT_CONTAINER){if(e.routingInfo=Et(this.getContainerName(),this._contextName),t===j.ROOT_CONTAINER&&(e.rootConfig=Zd.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,t===j.FLOW_CONTAINER){const t=Kn({context:this.getContextName(),category:j.CASEMESSAGES}),n=this.getContextName();e.caseMessages=t,this._stateProps.caseMessages=e.caseMessages,e.caseViewMode=this.getValue("context_data.caseViewMode"),this._stateProps.caseViewMode=e.caseViewMode;const r=Ou(n)[0];if(r){const t=Su(r),n=l?.getStore()?.getState()?.data;n&&t&&(e.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime);const a=Kn({context:t,category:F.PAGE}),o=Kn({context:t,category:"HTTP"});e.httpMessages=o,e.pageMessages=a,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.assignmentNames=this.getCaseInfo().getAssignments()?.map((e=>e.name)),e.childAssignmentNames=this.getCaseInfo().getChildAssignments()?.map((e=>e.name)),t===j.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.assignmentNames=e.assignmentNames,this._stateProps.childAssignmentNames=e.childAssignmentNames}else n.template===j.CASE_VIEW||n.template===j.CASE_PREVIEW||n.template===j.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):t===j.CASE_STAGES&&(e.stages=this.getCaseStages(),e.stageID=this.getStageID(),this._stateProps.stages=e.stages,this._stateProps.stageID=e.stageID);this.populateFieldMetadata(e),this.updateContextTree()}isReadOnlyField(e,t){const n=_l.isPropertyInternal(t),r=e.datasource,a=this.getComponentConfig().isSearchField,{isClassKey:o,isSpecial:s,isDeclarativeTarget:i}=e.fieldMetadata,c=e.listType!==j.ASSOCIATED;return!a&&(i||n||!r&&(o||s)&&c)}getPropertyDetails(e,t,n){return e===j.ASSOCIATED?{propertyValue:t,propertyAnnotation:j.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:j.PROPERTY_ANNOTATION}}updateConfigData(e,t,n){e.fieldMetadata=t,this.isReadOnlyField(e,n)&&(e.readOnly=!0,this._stateProps.readOnly=e.readOnly,e.fieldMetadata.isDeclarativeTarget&&this.registerAdditionalProps({readOnly:!0})),e.fieldMetadata?.isReadOnly&&(e.readOnly=!0,this.registerAdditionalProps({readOnly:!0}))}populateFieldMetadata(e){const{value:t,datasource:n,listType:r}=this.getComponentConfig(),{propertyValue:a,propertyAnnotation:o}=this.getPropertyDetails(r,n,t);if(a&&"string"==typeof a&&(a.includes(o)||a.includes(j.ATTACHMENT_ANNOTATION))){const t=tn.getPropertyName(a),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=ih(`${this._pageReference}.${t}`,this._contextName);return(n||null===n)&&(e.additionalInformation=n),e}getFieldMetadata(e){if(!e)return null;const t=e.split(".");if(t.length<2){let t=this.getValue(j.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata(Bp(e,t),e)}return this.resolvePropertyMetadata(Bp(t.pop(),this.getValue(`.${t.join(".")}${j.CLASS_ID}`)),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata(Bp(n,this.getValue(`${t.join(".")}${j.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(j.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[F.CASE_INFO.CASE_INFO]};return e.CaseID=e.CaseID||this.getValue(F.CASE_INFO.CASE_INFO_PZINSKEY),{...e,isCaseWideAction:()=>on(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()[F.CASE_INFO.CASE_INFO].stages}getStageID(){return this.getDataObject()[F.CASE_INFO.CASE_INFO].stageID}getActions(){return this._actions}isRoot(){return this._isRoot}resolveContextProps(e){const{value:t}=this.getStateProps();t&&(e.error=this.getContextDataValue(`${this.getPageReference()+t}.error`),e.validatemessage=this.getContextDataValue(`${this.getPageReference()+t}.validatemessage`))}isValidatorExist(){return!!this._isValidatorExist}getValidationApi(){return new Bl(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?tn.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||tn.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&tn.handleAnnotation(this._readOnly,this))}hasChildren(){return!!this._children}getComputedVisibility(){const e="reference"===this._type&&!!this.getReferencedView()?this.getReferencedViewPConnect().getPConnect():this;if(!1===this.getConfigProps().visibility)return!1;if(!1===this.getConfigProps().requiresVisibleChildren)return!0;const t=e.getConfigProps(),n={includeTypes:["Group","Region","View"],excludeTemplates:["ListView","SimpleTable","StudioTable"]};let r=e._type&&n.includeTypes.includes(e._type)&&!n.excludeTemplates.includes(t.template);if(!!t.highlightedData&&t.highlightedData.length&&t.showHighlightedData&&(r=!1),!r)return!0;const a=e.getChildren();return!!a&&a.some((e=>e.getPConnect().getComputedVisibility()))}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 mh(e||this.getContextName())}getImagePath(e){return`${Lr.getConstellationServiceUrl()}/v860/${Lr.getAppAlias()}/image/${e}?org=${Ip.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=Qd(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}),t=[];for(;e?.hasNext();){const n=e.next();if(this.isBulkAction()){const e=n.getPConnect().getComponentName(),{template:t}=n.getPConnect().getConfigProps();if(!e||!0!==Zd.allowedComponetsForBulkProcessing[e]&&!0!==Zd.allowedComponetsForBulkProcessing[e]?.[t])continue}t.push(n)}return e?.resetIndex(),t}return[]}setInheritedProp(e,t){this._inheritedConfig[e]=t}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const r=n||this.getLocaleRuleName(),a=this?.getMetadata();let o=null;if(a){const e=a?.type;e&&!["View","Region"].includes(e)&&(o=e)}return Sp.getLocaleValue(e,t,r,o)}isNonEnglishAndAnnotated=(e,t)=>!(!e||!t)&&("en-US"!==e&&t?.startsWith(j.FIELD_LABEL_ANNOTATION));isNonExcludedComponent=e=>!!e&&!["View","Region"].includes(e);getLocalizedValueForFieldLabel(e,t,n){e?.startsWith(".")&&(e=e.substring(1));const r=n||this.getLocaleRuleName(),a=this?.getMetadata();let o=null;const s=Ap.getLocale();if(a){const t=a?.type,n=a?.config?.label??a?.config?.caption;if(this.isNonEnglishAndAnnotated(s,n)){const t=n?.split(`${j.FIELD_LABEL_ANNOTATION} `).pop(),r=t?.split("."),a=r?.[r.length-1];let s=`${a}`;const i=this.getFieldMetadata(r?.slice(1).join(".")||""),c=i?.classID||this.getValue(`.${r?.join(".")}${j.CLASS_ID}`),l=i?.definedOnClassID;return s=`${l||c}.${s}`,Sp.getLocaleValue(e,s,Sp.FIELD_LABELS_BUNDLE_KEY,o)}this.isNonExcludedComponent(t)&&(o=t)}return Sp.getLocaleValue(e,t,r,o)}getLocalizedParagraphValue(e){const t=th(e,this.getCurrentClassID()),n=t?.definedOnClassID;return Sp.getParagraphLocaleValue(n||this.getCurrentClassID(),e)||t?.content}getLocaleRuleNameFromKeys(e,t,n){return`${e}!${t}!${n}`}getValue(e,t){return 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?Lh.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${j.SUGGESTION}`):Lh.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)})),ru(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),Lh.resolveProps(t,e,this),e}setValue(e,t,n,r=!1,a={}){let o,s;const{isArrayDeepMerge:i}=a;this.isInsideList()&&this.getListActions().updateProperty(e,t),this.isBulkAction()&&(o=!0,t||(s=!0)),gh({type:"SET_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,initialValue:n,isImplicit:r,context:this.getContextName(),...void 0!==i&&{isArrayDeepMerge:i},...o&&{isStrictTracking:o},...s&&{removePropertyFromChangedList:s}}})}updateDirtyCheckChangeList(e,t){(({value:e,context:t,reference:n})=>{if(Sl.isPageInstruction(n))return;const r=n?.startsWith(".")?n?.substr(1):n;Pl[t]=Pl[t]||{},Pl[t][r]||(Pl[t][r]={initialValue:Ih(r,null,t)}),Pl[t][r].value=e})({reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()})}getContextDataValue(e,t){return Ah(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(j.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let r=j.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(r=n>0?this._pageReference.substring(n):this._pageReference),gh(Bh({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){const{skipDirtyValidation:r=!1}=n;gh({type:"REPLACE_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){gh(yf(e,t||{},n))}getComponent(){return tu({getPConnect:()=>this})}createComponent(e,t,n,r){let a=this._pageReference;if(t){const e=Ch(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,t,this._contextName);a=Lh.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=tn.handleAnnotation(e,this),a=Lh.getContextPath(this._pageReference,e)||""}return tu(ou({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}}),r)}getReferencedView(){if(this.meta)return Lh.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(j.CLASS_ANNOTATION)?this.getPageReference():`${this.getPageReference()}${e}`}getReferencedViewPConnect(e=!1){const t={...this.getComponentConfig()};return delete t?.name,delete t?.type,ou({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 zl(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new qd(this)),this._actionsApi}getActionManager(){return un}doesContextExist(e){return $h(e??this.getContextName())}getGoogleMapsAPIKey(){return _()}getServerURL(){return I()}getLoadingStatus(e){let t=null;return e?(t=mh(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?zn({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName()}):e?.context?zn({type:"error",...e}):(zn({type:"error",...e,context:j.APP.APP}),zn({type:"error",...e,context:Su(`${j.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return Ch(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,e,this.getContextName())||e}removeFormField(){}addFormField(){}setPageValue(e,t,n){delete e?.classID,this.setValue(t,e,void 0,void 0,{isArrayDeepMerge:!1}),((e,t,n)=>{const r=ll(t);cl[e]?cl[e].fieldOrder[r]=n:cl[e]={fieldOrder:{[r]:n}}})(this.getContextName(),`${this.getPageReference()}${t}`,this),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();Tr(r,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<a.length;e+=1)Cr(a[e],e,r,void 0,{})}else"object"==typeof a&&r(a,`${t}.${e}`)}))};r(e,t)})(e,t,this)}acceptSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=cc.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=Lh.getContextPath(this.getPageReference(),n),a=t.getField(r);this._hasSuggestions=!1,this.getActionsApi().updateFieldValue(n,a),this.getActionsApi().triggerFieldChange(n,a),t.removeField(r)}}ignoreSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=this.getStateProps()?.value||e,n=Lh.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,cc.getSuggestionsContext(this.getContextName()).removeField(n)}}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}}function ou(e){const t=new au(e);return{getPConnect:()=>t}}function su(e){tu=e}const iu=class{static createContainerPConnect(e,t,n,r=!1){const{accessedOrder:a,items:o}=e;if(a&&o){const e=a[a.length-1];if(o[e]?.view&&Object.keys(o[e].view).length>0){const a=o[e],s=e.substring(0,e.lastIndexOf("_")),{view:i,context:c}=a,{viewName:l,viewContext:d}=this.processRootViewDetails(i,a,t);if(!l)return null;return ou({meta:i,options:{context:c,pageReference:d||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===du.WORKAREA||n===du.MODAL||l===j.CREATE_DETAILS_VIEW_NAME,target:s}}).getPConnect}}return null}static processRootViewDetails(e,t,n){const{config:{context:r,name:a}={}}=e,{context:o}=t;let s=a,i=r;const c=_l.isProperty(a),l=_l.isProperty(r);if(l){const e=_l.getPropertyName(r);i=Ih(`.${e}`,e.startsWith(".")?n:"",o)}if(i||(i=n),c){const e=_l.getPropertyName(a);s=Ih(`.${e}`,i,o)}return c&&l&&""!==s&&(s=a,i=r),{viewName:s,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=Su(e),o=hu(e,t);o&&({key:r,flowName:a}=o)}t.addContainerItem({semanticURL:"",key:r,flowName:a,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}},cu={defaultLimit:16},lu={SINGLE:"single",MULTIPLE:"multiple"},du={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},uu=()=>fh()?.getState()?.containers,pu=e=>e?fh()?.getState().containers[e]:(At.error("getContainerData: target is the required parameter"),null),hu=(e,t)=>{if(!e||!t)return null;const n=uu(),r=n?.[e];return r&&r.items&&r.items[t]||null},fu=e=>e?fh()?.getState().containers[e]?.items:(At.error("getContainerItems: target is the required parameter"),null),gu=e=>e?fh()?.getState().containers[e]?.accessedOrder||[]:(At.error("getContainerAccessOrder: target is the required parameter"),[]),mu=e=>e?gu(e)?.length>0||!1:(At.error("areContainerItemsPresent: target is the required parameter"),!1),yu=(e,t,n)=>{if(!e||!t)return At.error("isContainerItemExists: target and key are required parameters"),!1;const r=uu(),a=r?.[e],o=a&&a.items||null,s=n||((e,t)=>e===t);if(t&&o)for(const e in o)if(s(t,o[e].key))return!0;return!1},Eu=(e,t,n)=>{if(!e||!t)return At.error("getContainerItemName: target and key are required parameters"),null;const r=uu(),a=r?.[e],o=a&&a.items||null,s=n||((e,t)=>e?.toLowerCase()===t?.toLowerCase());if(t&&o)for(const e in o)if(s(t,o[e].key))return e;return null},Iu=(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},Au=e=>{if(!e)return At.error("getContainerItemByKey: key is required parameter"),null;const t=uu()??{};for(const n of Object.keys(t))if(t[n]){const r=t[n].items??null,a=Iu(e,r);if(a)return a}return null},Cu=(e,t)=>{if(!e||!t)return At.error("isContainerInitialized: context and name are required parameters"),!1;const n=uu();return n&&Object.prototype.hasOwnProperty.call(n,`${e}/${t}`)},_u=(e,t)=>{if(!e||!t)return At.error("getContainerType: context and name are required parameters"),null;const n=uu(),r=n?.[`${e}/${t}`];return r&&r.type},Su=e=>{if(!e)return At.error("getActiveContainerItemName: target is the required parameter"),null;let t=null;const n=uu();if(n&&n[e]){const r=n[e],{accessedOrder:a}=r;t=a&&a.length>0?a[a.length-1]:null}return t},bu=(e,t,n)=>{if(!e||!t)return At.error("isContainerItemActive: target and key are required parameters"),!1;const r=Eu(e,t,n);return!!r&&r===Su(e)},Nu=(e,t)=>{let n=null;const r=uu();for(const a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&r[a].items){const o=r[a].items[e];if(n=o?o[t]:null,n)break}return n},vu=e=>e?Nu(e,"context"):(At.error("getDataContextName: containerItemName is required parameters"),null),Pu=e=>{if(!e)return At.error("getActiveContainerItemContext: target is required parameters"),null;let t=null;const n=uu();if(n&&n[e]){const r=n[e],{accessedOrder:a}=r,o=a&&a.length>0?a[a.length-1]:null;t=vu(o)}return t},Tu=e=>{if(!e)return At.error("getChildContainerItems: containerItemName is required parameters"),[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const a=uu(),o=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 in a)if(Object.prototype.hasOwnProperty.call(a,e)&&a[e].items){const t=o(a[e].items);t&&t.length>0&&(n=n.concat(t)),n=n.sort()}return r?n:[]},Ou=e=>{if(!e)return At.error("getChildContainers: containerItemName is required parameters"),[];const t=[],n=uu();for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e&&t.push(r);return t},$u=e=>{if(!e)return At.error("getChildContainersContexts: parentContainerItemID is required parameters"),[];const t=[],n=uu();for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e){(gu(r)||[]).forEach((n=>{vu(n)!==e&&t.push(vu(n))}))}return t},Ru=e=>{const t=[...$u(e),e],n=[],r=fh()?.getState().data||{};return t.forEach((e=>{Object.prototype.hasOwnProperty.call(r,`${e}/${j.SUGGESTION}`)&&n.push(`${e}/${j.SUGGESTION}`)})),n},Du=e=>e?e&&pu(e)&&pu(e).type===lu.SINGLE:(At.error("isContainerSingleMode: target is required parameters"),null),xu=e=>e?e&&pu(e)&&pu(e).type===lu.MULTIPLE:(At.error("isContainerMultipleMode: target is required parameters"),null),wu=e=>e?pu(e)&&pu(e).items&&Object.keys(pu(e)?.items).length>0||!1:(At.error("hasContainerItems: target is required parameters"),!1),Mu=e=>e&&cu[e]?cu[e]:cu.defaultLimit,Lu=(e,t=cu.defaultLimit)=>{e?cu[e]=t:At.error("setContainerLimit: target is required parameter")},Fu=e=>{if(!e)return At.error("isContainerLimitReached: target is required parameter"),!1;let t=!1;const n=pu(e),{items:r={}}=n,a=Object.keys(r),o=Mu(e);return a&&a.length>0&&a.length>=o&&(t=!0),t},ju=e=>{if(!e||!e.name||!e.context)return At.error("resetContainersPayload: containerInfo object should contain name and context"),null;const t=e?.name,n=pu(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],a=Ou(`${j.APP.APP}/${j.PREVIEW}`),o=$u(`${j.APP.APP}/${j.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...o],childContainers:a}},Uu=e=>{if(!e)return At.error("isContainerDirty: containerItemID is the required parameter"),!1;const t=vu(e);return Fl(t)||zc(e)},ku=e=>{if(!e)return At.error("getLeastRecentlyUsedNonDirtyContainerItemID: target is required parameter"),null;let t;const n=pu(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!Uu(n)){t=n;break}}return t},Vu=e=>{if(!e)return At.error("getTargetFromContainerItemID: containerItemID is the required parameter"),null;const{containers:t}=fh()?.getState()||{};for(const n in t)if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.substring(0,n)},Bu=(e,t={})=>{if(!e)return At.error("closeContainerItem: containerItemID is the required parameter"),Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=Vu(e),r=vu(e),{skipDirtyCheck:a}=t;let o=!0,s=[];if(Uu(e)&&!a&&(o=window.confirm(Sp.getLocaleValue($l,"Messages"))),o){const{accessedOrder:a=[],items:o={},type:i}=pu(n);s=a.filter((t=>t!==e));const c=s[s.length-1],l=o[c]||{},{semanticURL:d=j.FORWARD_SLASH_STRING,context:u}=l;s.length>0&&d&&d!==j.FORWARD_SLASH_STRING?Wf({directUrlUpdation:!0,semanticURL:d,options:{containerItemID:c,context:u}}):Wf({directUrlUpdation:!0,semanticURL:j.FORWARD_SLASH_STRING,options:{}});const p={containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:s,containerType:i}};void 0!==t.eventName&&(p.eventName=t.eventName),gh(lf(p))}return Promise.resolve({newAccessedOrder:s,removeItem:o})},Gu=(e,t,n,r)=>{const a="root",o=H(t,a,!0),s=yt(t,a),i={data:n,context:r?"app":o},c=[Xh({root:e,containerItemID:o,context:r?"app":o,target:s,containerName:t})];c.push(Bh(i)),gh(c)},Wu=(e,t,n)=>{let r=gu(e);r=r.filter((e=>e!==t));let a=!1;for(let e=0;e<r.length;e+=1){if(vu(r[e])===n){a=!0;break}}return a},Hu=e=>{if(!e)return At.error("isContainerItemContextBeingUsedInOtherContainers: containerItemID is the required parameter"),!1;const t=uu(),n=vu(e),r=t?Object.keys(t):[];let a=!1;for(let t=0;t<r.length&&(a=Wu(r[t],e,n),!a);t+=1);return a},qu=e=>{Array.isArray(e)||(e=[e]);const t=uu()||{};return e.map((e=>{const n=Vu(e);return Dh.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},Yu=e=>{const{transientItemID:t,data:n,options:r}=e,a=Dh.deepClone(fh()?.getState().data[t]);r?.reset&&Dh.iterateLeafNodes(a,(e=>{"classID"!==e[e.length-1]&&Dh.setIn(a,e,"")})),gh(Qh({transientItemID:t,data:Dh.mergeDeep(n,a)}))},Ku=e=>{const{transientItemID:t,data:n}=e;gh(ef({transientItemID:t,data:n}))},zu=e=>{const t=Dh.deepClone(fh()?.getState().data[e]);Dh.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&Dh.setIn(t,e,"")})),gh(Zh({transientItemID:e,data:t}))},Xu=e=>{const t=Dh.deepClone(fh()?.getState().data[e]);Dh.iterateLeafNodes(t,(e=>Dh.setIn(t,e,""))),gh(tf({transientItemID:e,data:t}))};class Ju{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 Qu=()=>Ju,Zu=e=>{const t={containerName:e};t.childContainers=Ou(e),gh({type:Le,payload:t})},ep=(e,t)=>{const n=Tu(e),{key:r}=hu(Vu(e),e),a=[];n.forEach((e=>{const{key:n}=hu(Vu(e),e);if(n===r){const n={data:{caseInfo:{headers:{etag:t}}},target:Vu(e),context:e};a.push({type:ge,payload:n})}})),a.length&&gh(a)},tp=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:Vu(e),context:e};n.push({type:ge,payload:r}),n.length&&gh(n)},np=()=>Ap.isPortalLoaded?"app":"root",rp=()=>Vl,ap=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:Vu(e),context:e};gh({type:ge,payload:n})},op=(e,t)=>{const n=Eu(e,t),r=Eu(`${n}/workarea`,t);return vu(r)},sp=e=>e?Nu(e,"parentContext"):(At.error("getContainerParentContext: containerItemName is required parameters"),null),ip=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},cp=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},lp=()=>iu,dp=/{(.*?)}/i,up=/{(.*?)}/g,pp=e=>null!==e.match(dp),hp=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),fp=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`}},gp=()=>hp(window.location.pathname),mp=()=>hp(window.location.pathname+window.location.search),yp=(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 Ep=new class{constructor(){this.staticRoutesList=[],this.dynamicRoutesList=[],this.reqContextName="",this.defaultViewUrlPath="",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._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};_createStaticDynamicRoutesList=e=>{Object.keys(e).forEach((e=>{pp(e)?this.dynamicRoutesList?.push(e):this.staticRoutesList?.push(e)}))};_getDynamicKeyName=e=>{const t=e.indexOf("{")+1,n=e.lastIndexOf("}");return e.slice(t,n)};isDefaultPortal=()=>"false"!=`${this.bDefaultPortal}`;getPortalName=()=>this.portalName;getApplicationPath=()=>hp(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>hp(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,""),hp(e)};getEndPointInfo=e=>{this.ignoreFromEndPoint?.forEach((t=>{e.includes(t)&&(e=e.substring(0,e.indexOf(t)))}));let t=this.processUrl(e,!0),n=this._getMatchedRouteInRoutingTable(t);void 0===n&&(t=this.processUrl(this.defaultViewUrlPath,!0),n=this._getMatchedRouteInRoutingTable(t)||"");const{routeKey:r,payload:a}=this.appRoutes[n],{reqType:o,endPoint:s,params:i}=this.appRoutesMeta?.[r].restApi||{},c={...a},{caseClassName:l,caseID:d}=c;if(V.isRemoteCase(l)){const{RemoteClassGroup:e,RemoteSystemID:t}=V.getRemoteCase(l);c.caseID=d?.replace(l,e?.toUpperCase()),c.RemoteSystemID=t}const u={routeKey:r,requestType:o,routeEndpoint:s,payload:{...i,...c}};return this._resolveRoute(u,this.processUrl(e,!1),n)};getSemanticURL(e,t,n){return this.buildSemanticURL(e,t,n)}getResolvedSemanticURL(e,t,n={}){const r=this.getSemanticURL(e,t,n);let a=r;if(pp(r)){const e=r.match(up);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(a=a.replace(e,n[t]))}))}const o=Gf(a),s=new URL(o);return this.isDefaultPortal()||this.getPortalName()&&!s.searchParams.toString().includes("portal=")&&s.searchParams.append("portal",this.getPortalName()),s.toString()}updateSemanticURLAndDocumentTitle(e){const{key:t,actionName:n,caseClassName:r,isRemoteCase:a}=e;if(a&&!r)return;const o=this.getSemanticURL(n,{caseClassName:r}).replace(/{.+?}/,String(Ac(t))),s=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`,i={semanticURL:o,directUrlUpdation:!0,options:{acName:s,context:Pu(s)}};Bf(i);const c=r.substring(r.lastIndexOf("-")+1),l=t.substring(t.lastIndexOf(" ")+1),d=Ap.environmentInfoObject?.pxApplication?.pyLabel;Jf(`${c} (${l}) - ${d}`)}buildSemanticURL(e,t,n){const{urlPattern:r}=this.appRoutesMeta?.[e]||{},a=r?.split("/").length,o=r?.split("/"),s=Object.keys(this.appRoutes).filter((e=>a===e.split("/").length)).filter((e=>{const t=e.split("?")[0].split("/");return o?.every(((e,n)=>e.startsWith("{")||e===t[n]))}));if(1===s.length)return this._getQueryParamsResolvedURL(s[0],n);if(0===Object.keys(t).length)return"";const i=s.find((e=>{const r=this.appRoutes[e].payload,a={...n};delete a.dataViewName,delete a.dataContext;const o=r.dataViewKeys||r.dataContextParameters||{},s=Object.keys(t).every((e=>t[e]===r[e]));return!!s&&(Dh.isEmpty(o)||Dh.isEmpty(a)?s:Object.keys(a).every((e=>Object.prototype.hasOwnProperty.call(o,e))))}));return i?this._getQueryParamsResolvedURL(i,n):s.includes("cases/{id}")&&n?.id?"cases/{id}":""}_getQueryParamsResolvedURL(e,t,n=!1){const[r,a]=e.includes("?")?e.split("?"):[e];if(a){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;const o=new URLSearchParams(a),s={};for(const[r,a]of o.entries())if("string"==typeof a&&pp(a)){const o=this._getDynamicKeyName(a);s[r]=n?t[o]||e[o.toLowerCase()]:t[o]}else"string"==typeof a&&(s[r]=a);return`${r}?${new URLSearchParams(s).toString()}`}return r}_getQueryParamsObject(e){const t={},n=new URLSearchParams(e);for(const[e,r]of n.entries())t[e]=r;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 o=a.match(up);if(o)for(let e=0;e<o.length;e+=1){const n=o[e].replace("{","").replace("}",""),r=new RegExp(o[e],"g");a=a.replace(r,t?.[n])}if(r){let e={};return Object.keys(r).forEach((n=>{this._isSpecialInstruction(n)&&(e={...e,...this._processInstruction(n,r[n],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])}_resolveRoute=(e,t,n)=>{const r=[],[a,o]=t.includes("?")?t.split("?"):[t],[s,i]=n.includes("?")?n.split("?"):[n],c=a.split("/"),l=s.split("/"),d={};for(let e=0;e<l.length;e+=1)if(r[e]=l[e],pp(l[e])){d[this._getDynamicKeyName(l[e])]=c[e],r[e]=c[e]}const u=this._getQueryParamsObject(i),p=this._getQueryParamsObject(o),h={};for(const[e,t]of Object.entries(p))h[e.toLowerCase()]=t;for(const e in u)pp(u[e])?d[e]=p[e]||h[e.toLowerCase()]:d[e]=u[e];let f;o&&(f=this._getQueryParamsResolvedURL(n,p,!0));const g=this._resolvePayload(e,d,n);return{...this._resolveRouteEndPoint(g,n),urlPath:f||r.join("/")}};_resolveRouteEndPoint=(e,t)=>{let{routeEndpoint:n}=e;if(!pp(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(up);for(let a=0;a<t.length;a+=1){const o=t[a],s=this._getDynamicKeyName(o);if(void 0!==e.payload[s]){const t=e.payload[s];n=n.replace(o,t)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${s}} in routeEndpoint- ${s} 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){const n={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let a=e[r];if("string"==typeof a&&pp(a)){const e=a.match(up);for(let n=0;n<e.length;n+=1){const r=e[n],o=this._getDynamicKeyName(r);if(void 0!==t[o]){const e=t[o];a=a.replace(r,e)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${o}} in payload- {${o}} is missing in semantic url construct`)}n[r]=a}else"object"==typeof a&&(n[r]=this._resolvePayloadRecursive(a,t))}return n}_getMatchedRouteInRoutingTable=e=>{let t=this._findMatchedRouteInStaticList(e);return void 0!==t?t:(t=this._findMatchedRouteInDynamicList(e),void 0!==t?t:void 0)};_findMatchedRouteInStaticList=e=>this.staticRoutesList?.find((t=>t.toLowerCase()===e.toLowerCase()));_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],o=t.split("/");if(o.length!==r.length)return!1;let s=0;for(s=0;s<o.length;s+=1){const e=o[s].toLowerCase();if(!pp(e)&&e!==r[s]&&fp(e)!==r[s])return!1}if(a){const e=new URLSearchParams(n.toLowerCase()),t=new URLSearchParams(a.toLowerCase()),r=new Set,o=new Set,s=/\{[a-zA-Z]+\}/;for(const t of e.keys())r.add(t);for(const e of t.keys())o.add(e);if(o.size!==r.size)return!1;for(const n of r){if(!o.has(n))return!1;const r=t.get(n);if(e.get(n)!==r&&!s.test(r))return!1}}return!0}))};_sendWarningAndErrorMessages=(e,t)=>{yp(e,t,"warning"),yp("Error in Generated Routing Table",null,"error"),yp("Back | Forward for this page may NOT work as intended",null,"warning"),yp("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},Ip=Ep;const Ap=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false"}setEnvironmentInfo(e){this.environmentInfoObject=e;const t=this.environmentInfoObject?.features||Dh.convertObjectWithStringToBoolean(this.environmentInfoObject?.pyFeatures)||{granularUIRefresh:!1};this.environmentInfoObject.features={...t,granularUIRefresh:t.granularUIRefresh||t.pyEnableGranularUIRefresh||!1}}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 Ip.getPortalName()}getApplicationName(){return this.environmentInfoObject?.pxApplication?.pyRuleName}getUseLocale(){return this.environmentInfoObject?.pxLocale?.pyUseLocale}getAccessGroup(){return this.environmentInfoObject?.pxOperator?.pyAccessGroup}getTimeZone(){return this.environmentInfoObject?.pxLocale?.pyTimeZone}getTheme(){return this.themeOverrides}setTheme(e){return this.themeOverrides=e,this.themeOverrides}getBrandingInfo(){return this.brandingInfo}setBrandingInfo(e){return 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(j.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}getBuiltOnAppNames(){return this.environmentInfoObject?.pxApplication?.pyBuiltOnApplications}setPreviewMode(){$i.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)}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getUserSettings(){return this.environmentInfoObject?.pyUserSettings||null}getAvailableLocalePacks(){return this.environmentInfoObject?.pyAvailableLocalePacks?.map((e=>e.pyLabel))||[]}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getInactivityTimeout(){const e=this.environmentInfoObject?.pxOperator?.pyAuthenticationTimeout;return e?Number(e):e}isUnifiedObject(){return this.environmentInfoObject?.features?.isUnifiedObject||!1}getRuntime(){return"undefined"!=typeof window&&window.document?"Browser":"Native"}};const Cp=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),o=e.substring(r,a+1),[s,i]=this.getKeyAndValue(o);this.addKeyToMap(s,i),n+=`${o.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),o=e.substring(r,a+1);n+=this.keyMap[o],t=a+1}return n}};class _p{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||e;this.localeStore[_p.#t(t)]=n};getLocaleForRule(e=this.#n()){return this.localeStore[_p.#t(e)]}resetLocaleStore=()=>{this.localeStore={}};#r(e){return e?_p.#t(e):this.#n()}#a(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}#o(e,t){return t!==this.FIELD_LABELS_BUNDLE_KEY?e?`${e}.fields`:"fields":e}getLocaleValue(e,t,n,r){n=this.#r(n);const a=this.#a(e);a&&(e=Cp.formatLocaleKey(e));const o=this.#s(e,n,t,r);return"Messages.fields"===(t=this.#o(t,n))&&"string"==typeof e?this.getLocalizedErrorMessage(o,e)||e:a?Cp.replaceWithValue(o[e]||e):o[e]||e}#s(e,t,n,r){t!==this.FIELD_LABELS_BUNDLE_KEY&&(n=n?`${n}.fields`:"fields");let a=this.localeStore[t.toUpperCase()],o=a?Dh.getIn(a,n,{}):{};return!o[e]&&r&&(a=this.localeStore[this.#n().toUpperCase()],o=a?Dh.getIn(a,`${r}.${n}`,{}):{}),o}#n(){return void 0===Ap.getFeatureMap()?.localizationVersion?this.GENERIC_BUNDLE_KEY:this.GENERIC_BUNDLE_KEY_LP}getParagraphLocaleValue(e,t){const n=`${e}!${j.PARAGRAPH}!${t}`,r=this.localeStore[n.toUpperCase()];return r?decodeURIComponent(atob(r.content).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")):null}getPortalLocaleReference(e){return e?`PORTAL!${e}`.toUpperCase():`PORTAL!${Ap.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return Ap.getFeatureMap().localizationVersion||1}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=Ap.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[_p.#t(e)]))).map((e=>e.toUpperCase()))).length>0){const r=e.map((e=>({localeRuleKey:e,promise:Lr.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&&null!==e.value){const a=r[t];let o;try{o=await e.value.json()}catch{o=null}o&&n.push({localeRuleKey:a.localeRuleKey,jsonData:o})}})))}return n}async loadLocaleResources(e){const t=Ap.getUseLocale(),n=Ap.getBaseLocale();if(Ap&&t&&(t!==n||"en-US"!==n)&&e?.length>0)try{(await this.getLocaleJsons(e)).forEach((e=>{this.setLocaleForRule(e.jsonData,e.localeRuleKey)}))}catch(e){console.warn(e)}}setTimezone(e){this.timezone=e}getTimeZoneInUse(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return this.timezone||e}matchPatternWithText(e,t){let n=t;const 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+\}/),o=this.matchPatternWithText(a,t);if(o){const t=e[r];if(n=this.replacePlaceHolders(o,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=Ap.getLocale();return this.availableLangPacks?.length||(this.availableLangPacks=Ap.getAvailableLocalePacks()),e&&this.availableLangPacks.includes(e)}static#t(e){if(!e)return e;const t=e.indexOf("!CASE!");return-1===t?e:`CASE!${e.substring(0,t)}`}getCaseTypeLocaleReferences(){return Ap.getCaseTypeList().map((e=>`${e.pyWorkTypeImplementationClassName}!CASE!${e.pyWorkTypeName}`.toUpperCase()))}}const Sp=new _p;const bp=class{static getParagraphStream(e,t){return((e,t)=>{if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html"),r=n.querySelectorAll("pega-reference");for(const e of r){const r=e.getAttribute("data-rule-id");if(r){const a=t.getValue(r),o=n.createTextNode(a??"");e.replaceWith(o),t.registerAdditionalProps({[r]:`@P ${r}`})}else e.replaceWith("")}const a=n?.body?.innerHTML||"";return/^(<p>)\s*(<\/p>)$/.test(a)?null:a})(e,t)}};en.registerHandler("@L",((e,t)=>t.getLocalizedValue(e))),en.registerHandler("@P",((e,t,n)=>t?t.getValue(e):Lh.getLitePropertyValue(n))),en.registerHandler("@E",((e,t,n)=>{try{const r=kt(e),a=Vt(r);return Bt(a,t,n)}catch(e){}return!0})),en.registerHandler("@W",((e,t,n)=>{let r;if(t)r=t.getContextDataValue(`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);else{const{pageReference:t,context:a}=n??{};r=Ah(t,`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,a)}return!0===r||"true"===r})),en.registerHandler("@ASSOCIATED",((e,t)=>{let n={};const r=[];let a="",o="";const s=t.getPageReference();if(e.startsWith(".")){a=`${s}.${e.substring(1)}`;const r=e.split(".").filter((e=>!!e));r.length>1&&(r.pop(),o=r.join(".")),n=t.getFieldMetadata(e.substring(1))}else n=t.getFieldMetadata(e),a=e;const i=n?.datasource?.tableType,c=n?.datasource?.mode===j.READONLY,l=n?.datasource?.name||"",d=t.getComponentConfig();if(d&&d.deferDatasource&&(d.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:d.datasourceMetadata}),i===j.DATA_PAGE))return null;if(i===j.DECISION||i===j.RULE_REFERENCE)return function(e,t){const n=tn.getPropertyName(e?.propertyForDisplayText??""),r=tn.getPropertyName(e?.propertyForValue??""),a=t.getContextDataValue(`.${j.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return a?.map((e=>({key:e[r]||e[`.${r}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==j.DATA_PAGE)return n?.datasource?.records;const u=tn.getPropertyName(n?.datasource?.propertyForDisplayText),p=tn.getPropertyName(n?.datasource?.propertyForValue),h=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],f=t.getContextName(),g=[];if(h.forEach((e=>{if(tn.isProperty(e?.value)){let t=Ih(`.${Dh.getFullPropertyReference([o,tn.getPropertyName(e.value)])}`,s,f);g.push(Dh.getFullPropertyReference([s,o,tn.getPropertyName(e?.value)])),null!=t&&""!==t||(t=j.NULL_STRING),r.push(t)}else r.push(e?.value||j.NULL_STRING)})),f){const e=Qt.getContextObjectByName(f)||{};g.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,a])]}else e[t]=[a]})),Qt.addContextName(f,e)}const m=function(e,t,n,r){let a="",o=n;if(t.join(j.HASH_DELIMITER)&&(a=Dh.getHashedString(t.join(j.HASH_DELIMITER)),o=n+j.UNDERSCORE_STRING+a),r){const e=yh(),t=e?e[n]?.[o]:{};return Array.isArray(t?.pxResults)?t.pxResults:[]}const s=e.getDataObject(),i=s?.[n]||{},c=i?.[o]||{};return Array.isArray(c?.pxResults)?c.pxResults:[]}(t,r,l,c);return m.map((e=>({key:e[p]||e[`.${p}`],value:e[u]||e[`.${u}`]})))})),en.registerHandler("@ROUTING_INFO",((e,t)=>Et(t.getContainerName(),t.getContextName()))),en.registerHandler("@ENV",((e,t)=>{switch(e){case j.ENV_INFO_KEYS.APPLICATION_NAME:return Ap.getApplicationName();case j.ENV_INFO_KEYS.ACCESS_GROUP:return Ap.getAccessGroup();case j.ENV_INFO_KEYS.USER_NAME:return Ap.getOperatorName();case j.ENV_INFO_KEYS.USER_ID:return Ap.getOperatorIdentifier();case j.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizedValue(Ap.getApplicationLabel()||"");case j.ENV_INFO_KEYS.USER_IMAGE:return Ap.getOperatorImageInsKey();case j.ENV_INFO_KEYS.LOCALE:return Ap.getUseLocale();case j.ENV_INFO_KEYS.TIMEZONE:return Ap.getTimeZone();case j.ENV_INFO_KEYS.WORK_GROUP:return Ap.getOperatorWorkGroup();default:return e}})),en.registerHandler("@DATASOURCE",((e,t)=>{const n=t.getValue(e)||[],r=t.getComponentConfig(),a=Object.keys(r).find((t=>r[t]?.source?.includes(e)));if(a){const{fields:e,copyAll:t}=r[a],o=[];return n.forEach((n=>{const r={};t?Object.keys(n).forEach((e=>{const t=tn.getPropertyName(e);r[t]=n[t]})):Object.keys(e).forEach((t=>{const a=tn.getPropertyName(e[t]);r[t]=n[a]})),o.push(r)})),o}return[]})),en.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 o=e.split(".").filter((e=>!!e));if(o.length>1&&(o.pop(),a=`.${o.join(".")}`),Array.isArray(r.datasource.parameters)){const e=[];r.datasource.parameters.forEach((n=>{const r={},{name:o,value:s}=n;r.name=o,"string"==typeof s&&s.startsWith("@P")?r.value=`@P ${a}${s.substring(3)}`:r.value=s,e.push(t.resolveConfigProps(r))})),n=e}else n=t.resolveConfigProps(r.datasource.parameters);r={...r,datasource:{...r.datasource,parameters:n}}}return r})),en.registerHandler("@USER",((e,t,n={})=>{const r=t?.getValue(e)||Lh.getLitePropertyValue(n,e),a=t?.getReferencedUser(r)||Lh.getReferencedUser(r,n);return{userId:r,userName:a?a.UserName:null}})),en.registerHandler("@ACTIVE_CASES",((e,t)=>zd.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),en.registerHandler("@LR",(e=>e)),en.registerHandler("@CASE",((e,t)=>e===j.ID?t.getCaseInfo().getKey():e)),en.registerHandler("@SHARED",(e=>cc.getSharedState(e))),en.registerHandler("@PARAGRAPH",((e,t)=>{const n=t.getLocalizedParagraphValue(e);return n?bp.getParagraphStream(n,t):null})),en.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:o}=t;let s;return Dh.isEmpty(o)?s=t.getValue(`.${n}`):(s=o,s=Dh.getIn(s,n)),s&&r.length>0?(a&&(s=s.filter((e=>Gt(a,e)))),s.map((e=>Dh.getIn(e,r)))):null})),en.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.pyCountry;return n?`pyAddressForm_${n}`:"pyAddressForm"})),en.registerHandler("@DATATYPE",((e,t)=>t.getValue(e)));const Np="downloadAttachment",vp={},Pp=e=>{const t=Gi();return vp[e]=t,t},Tp=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},Op=e=>{let t,n,r,a;return t=e.pyCategoryLabel?`${e.pyCategoryLabel},`:e.pyCategoryName?`${e.pyCategoryName},`:e.Category,n=e.pxCreateOpName?e.pxCreateOpName:e.pxCreateOperator?e.pxCreateOperator:e.CreateUser?.Name||"",r=e.pyFileName?e.pyFileName:e.FileExtension&&""!==e.FileExtension&&e.FileName.endsWith(e.FileExtension)?e.FileName.substring(0,e.FileName.lastIndexOf(e.FileExtension)-1):e.FileName,a=e.pyAttachName&&e.pyFileName?e.pyAttachName.startsWith(e.pyFileName)&&e.pyAttachName.split(".").length-1===e.pyFileName.split(".").length?e.pyAttachName.split(".").pop():"":e.FileExtension,{props:{meta:`${t} ${n}`,name:e.pyAttachName?e.pyAttachName:e.FileName,icon:Tp(e.pyMimeFileExtension||e.MimeType)},responseProps:{fileName:e.pyAttachName?e.pyAttachName:e.FileName,name:r,category:e.pyCategoryName?e.pyCategoryName:e.Category,extension:a,ID:e.pzInsKey?e.pzInsKey:e.ID,mimeType:e.pyMimeFileExtension?e.pyMimeFileExtension:e.MimeType,attachmentURL:e.pyAttachmentLink?e.pyAttachmentLink:e.AttachmentURL,createUser:n,createDateTime:e.pxCreateDateTime?e.pxCreateDateTime:e.CreateDateTime,responseType:e.responseType??(e.ID?"binary":null)}}},$p={uploadAttachment:(e,t,n,r,a)=>{const o=new FormData;o.append("appendUniqueIdToFileName",!0),o.append("file",e),a&&o.append("contextID",a);const{restApi:s,reqType:i}=Ff("uploadAttachment",{});return ki(s,{method:i,headers:{"Content-Type":"multipart/form-data"},body:o,onUploadProgress:t,signal:Pp(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(Wi,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete vp[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const a={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,a.signal=Pp(n).token}const{restApi:o,reqType:s}=Ff("linkCaseAttachment",{caseID:e});return ki(o,{...a,body:{attachments:t},method:s},r)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:r,reqType:a}=Ff("getCaseAttachments",{caseID:e,includeThumbnail:n});return ki(r,{method:a},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:r,reqType:a}=Ff("getAttachmentCategories",{caseID:e,type:t});return ki(r,{method:a},n).then((e=>e.data))},downloadAttachment:(e,t,n)=>{const{restApi:r,reqType:a}=Ff(Np,{attachmentID:e});return ki(r,{method:a,..."binary"===n&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:a}=Ff("editAttachment",{attachmentID:e});return ki(r,{method:a,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=Ff("deleteAttachment",{attachmentID:e});return ki(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=Ff("downloadDocument",{documentID:e});return ki(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:a}=Ff("deleteDocument",{caseID:e,documentID:t});return ki(r,{method:a},n)},getDocumentURL:e=>{const t=PCore.getEnvironmentInfo().getDocumentUrlDP()||"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=>{vp[e]&&(vp[e].cancel(),delete vp[e])},buildFilePropsFromResponse:Op,getAttachmentURL:e=>{const{restApi:t}=Ff(Np,{attachmentID:e});return t},prepareAttachmentData:e=>{let t=[];if(e&&Object.hasOwn(e,"pyCount")&&e.pyCount>0)t=e?.pxResults?.filter((e=>!!e.pzInsKey)).map((e=>Op(e)))||[];else if(e&&"object"==typeof e){let n;n=Array.isArray(e)?e:[e],t=n?.filter((e=>e.ID&&e.FileName||e.pzInsKey)).map(Op)}else t=[];return{hasUploadedFiles:t.length>0,categoryName:e?.pyCategoryName||t?.[0]?.responseProps?.category||"",attachments:t}}};en.registerHandler("@ATTACHMENT",((e,t,n)=>{let r;return r=t?t.getValue(e):Lh.getLitePropertyValue(n),$p.prepareAttachmentData(r)})),en.registerHandler("@FL",((e,t)=>t.getLocalizedValueForFieldLabel(t.getFieldMetadata(e)?.label))),en.registerHandler("@GENAICOACH",((e,t)=>nh(e,t.getCurrentClassID()))),en.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),a=t.getPageReference();Nl.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",a,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:!0}),`${a}${e}`,`${r}/${a}`,r)}));const Rp={},Dp={},xp={},wp={},Mp={},Lp={},Fp={},jp={},Up={},kp={},Vp=(e={},t={})=>{0!==Object.keys(t).length?Object.keys(e).forEach((n=>{const r=e[n],a=t[n];if(a){const e=Array.isArray(a)?a:[a];(Array.isArray(r)?r:[r]).forEach((t=>{const n=e.findIndex((e=>e.classID===t.classID));if(-1===n)e.push(t);else{const r={isDeclarativeTarget:!1},a={...e[n],...r,...t};e[n]=a}})),t[n]=1===e.length?e[0]:e}else t[n]=r})):Dh.copy(e,t)},Bp=(e,t="")=>{if(!e)return null;const n=wp[e];if(!n)return null;if(!t)return Dh.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?Dh.deepClone(r):null},Gp=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let a;const o=Bp(e,t);return r.length&&(a=r.join(".")),{...o,embeddedType:n,category:a}}const[a,...o]=e.split("."),s=Bp(a,t);return s&&r.push(s.label),Gp(o.join("."),s?.pageClass,s?.type,r)},Wp=e=>{Vp(e,Dp)},Hp=e=>{Vp(e,xp)},qp=e=>{if(e.views&&Vp(e.views,Dp),e.navigations&&Vp(e.navigations,xp),e.personalizations&&Vp(e.personalizations,Lp),e.insights&&Vp(e.insights,Fp),e.paragraphs&&Vp(e.paragraphs,Rp),e.dataTypes&&Vp(e.dataTypes,jp),e.datapages&&Vp(e.datapages,Up),e.genAICoaches&&Vp(e.genAICoaches,kp),e.fields){Object.keys(e.fields).forEach((t=>{const n=e.fields[t];if(Array.isArray(n)){if(e.datapages&&n.forEach((t=>{t.datasource&&"DataPage"===t.datasource.tableType&&(t.datasource.mode=e.datapages[t.datasource.name].mode)})),1===n.length){const[r]=n;e.fields[t]=r}}else e.datapages&&n.datasource&&"DataPage"===n.datasource.tableType&&(n.datasource.mode=e.datapages[n.datasource.name].mode)}));const{datapages:t={}}=e;Object.keys(t).forEach((e=>{Mp[e]=t[e]}))}Vp(e.fields,wp)},Yp=e=>Dp[e],Kp=(e,t)=>{const n=Dp[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},zp=e=>xp[e],Xp=e=>e in Mp?Mp[e]:null,Jp=e=>e in Lp?Lp[e]:null,Qp=e=>e in Fp?Fp[e]:null,Zp=e=>{const t={};return Object.keys(wp).forEach((n=>{const r=wp[n];let a;Array.isArray(r)?a=r.find((t=>e===t.classID)):e===r.classID&&(a=r),a&&(t[n]=Dh.deepClone(a))})),t},eh=(e,t)=>{const n=Bp(e,t)?.datasource?.parameters;return n?Dh.deepClone(n):null},th=(e,t)=>{let n=null;const r=Rp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?Dh.deepClone(n):null},nh=(e,t)=>{let n=null;const r=kp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?Dh.deepClone(n):null},rh=e=>{if(e in jp){const{savableDataPage:t}=jp[e];return t}return null},ah=e=>{const t=Up[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 o=jp[n];return o?o.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:r}))):[]},oh=e=>{if(e in jp){const{lookupDataPage:t}=jp[e];return t}return null},sh=e=>{if(Object.prototype.hasOwnProperty.call(jp,e)){const{lookupDataPageInfo:t}=jp[e];return t}return null},ih=(e,t)=>{const n=e.split("."),r=n.pop(),a=new au({options:{pageReference:`${n.join(".")}`,context:t}}),o=Bp(r,a.getCurrentClassID())?.additionalInformation;if(!o?.includes("@PARAGRAPH"))return o;const s=tn.trimAnnotation(o),i=a.getCurrentClassID(),c=th(s,i),l=c?.definedOnClassID,d=Sp.getParagraphLocaleValue(l||i,s);return d?bp.getParagraphStream(d,a):c?.content?bp.getParagraphStream(c.content,a):null},ch=(e,t)=>{const n=e.split("."),r=n.pop(),a=new au({options:{pageReference:`${n.join(".")}`,context:t}}),o=Bp(r,a.getCurrentClassID()),s={};return a._classID=a.getCurrentClassID(),a.resolveConfigProps(o,s),s};class lh{constructor(){this.name="CascadeManager",this.cascadeSubscribers={},this.cascadeResetSubscribers={},this.listChangeSubscribers=[]}registerResetDependencies(e,t,n,r,a,o="singleRecord"){if(!e||!n||!r?.length)return;const s=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=Dh.getFullPropertyReference([c,t]),t in i){const e=i[t];e.find((e=>e.propertyName===s))||e.push({propertyName:s,mode:o})}else i[t]=[{propertyName:s,mode:o}]})),Object.keys(i).length>0&&(this.cascadeResetSubscribers[e]=i)}deregisterResetDependencies(e,t,n,r,a){if(!e||!n||!r?.length)return;const o=n.startsWith(".")?`${t}.${n.substring(1)}`:n,s=this.cascadeResetSubscribers[e]||{},i=this._handlePageReference(t,n,a);r.forEach((e=>{if(e){let t=e.startsWith(".")?e.substring(1):e;if(t=Dh.getFullPropertyReference([i,t]),t in s){const e=s[t];Dh.removeExistingDependentProperty(e,o)}}})),Object.keys(s).length>0&&(this.cascadeResetSubscribers[e]=s)}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 o=this.cascadeSubscribers[e][`${t}${n}`];if(!o[a]){o[a]=r;const s=Ih(n,t,e);o.previousValue="object"==typeof s?null:s}}))}registerListField(e,t,n,r,a){const o=lh._getFieldsForList(e,t,n);o.length>0&&(this.registerFields(e,t,o,r,a),gd.enableCascade(e))}unRegisterListField(e,t,n,r){const a=lh._getFieldsForList(e,t,n);a.length>0&&this.unRegisterFields(e,t,a,r)}static _getFieldsForList(e,t,n){const r=[],a=Bp(n,Ih("classID",t,e));return a&&!Array.isArray(a)&&a.datasource&&a.datasource.parameters&&Object.values(a.datasource.parameters).forEach((e=>{if(tn.isProperty(e)){const t=tn.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((o=>{const s=this.cascadeSubscribers[e][t];"previousValue"!==o&&s.previousValue!==n&&(a=!0,r?r.add(s[o]):s[o](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=Ih(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=Ih(t,"",e);n(e,t,r)}))}))}_updateChangedProperties(e,t,n,r,a,o,s,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=er.getMessages({type:"error",property:i,context:a,pageReference:t});if(c?.length>0&&s.push(r),!n)return;o.push(r)}}isChangedListPropertyExist(e){let t=!0;return 0!==this.listChangeSubscribers.length&&Dh.isValidPageListProperty(e)||(t=!1),t}_getServerProperties(e,t,n,r,a,o,s){if("object"!=typeof e){a.push(n.replace(/\.(\d+)/g,"[$1]"));const i=this.isChangedListPropertyExist(n);n=n.replace(/\.(\d+)/g,"[$1]");const c=Ih(n,"",t);if(void 0===c&&!e&&0!==e)return;return void this._updateChangedProperties(c,e,i,n,t,r,o,s)}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=Ih(d,"",t);n&&n?.length===e[l].length||s.push(d)}this._getServerProperties(e[l],t,d,r,a,o,s)}}getServerProperties(e,t,n=j.CASE_INFO.CASE_INFO_CONTENT){const r=[],a=[],o=[],s=Dh.getIn(e,n);return s&&t?(this._getServerProperties(s,t,n,r,o,a,[]),{changedListProperty:r,leafProperty:o,changedPropertyWithError:a}):{changedListProperty:r,leafProperty:o,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 dh=new lh;let uh=null;const ph=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),hh=e=>{uh=e},fh=()=>uh,gh=e=>{if(!e)return;let t=[],n=[],r=[];Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=dh.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),fh()?.dispatch(e),Array.isArray(e)||"MERGE_DATA"!==e.type||(r.forEach((t=>{const n=t.lastIndexOf("."),r=t.substring(0,n),a=t.substring(n);er.clearMessages({type:"error",property:a,pageReference:r,context:e.payload.context});const o=Tn.getFieldReferenceForProperty(e.payload.context,t),s=Lh.resolveContextTreeNodeProps(o.props);Dr.validate(s.componentName?.toLowerCase(),s.propertyName,Lh.getLitePropertyValue(s,s.propertyName),s)})),dh.handleServerChanges(e.payload.context,t,n))},mh=e=>fh()?.getState().data?.[e],yh=()=>fh()?.getState().data[j.SHARED],Eh=(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,o=ph(a);return Dh.getIn(n,o)},Ih=(e,t,n)=>Eh(e,t,mh(n)),Ah=(e,t,n)=>Eh(t,e?`${j.CONTEXT_DATA}.${e}`:`${j.CONTEXT_DATA}`,mh(n)),Ch=(e,t,n)=>((e,t,n)=>{const r=ph(`${t}.${n}`);return Dh.getIn(e,r)})(mh(n),`${j.CONTEXT_DATA}.${e}`,t),_h=e=>{const{context:t}=e,n=fh()?.getState().data[t];if(n)return ue;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?_e:ue},Sh=(e,t)=>{const n=ph(t);return Dh.deleteIn(e,n)},bh=e=>!Array.isArray(e)&&"object"==typeof e,Nh=(e,t=[])=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&Dh.setIn(e,t.path,[]):Dh.setIn(e,t.path,{})}))},vh=(e,t,n={})=>{const{isArrayDeepMerge:r,propertiesToReplace:a=[]}=n;Array.isArray(e)&&!t&&(t=[]),Nh(e,a);const o=(e,t)=>{if(bh(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return x()(e,t,o);if(Array.isArray(e)&&null!==t&&Array.isArray(t)){if(r)return x()(e,t,o);{const n=t.length;if(void 0===r&&n===e.length)return x()(e,t,o)}}return""===t&&e&&"object"==typeof e?e:t};return o(e,t)},Ph=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:a}=r,o=ph(t);if("object"==typeof n){const t=vh(Dh.getIn(e,o),n,{isArrayDeepMerge:a});return Dh.setIn(e,o,t)}return Dh.setIn(e,o,n)},Th=(e,t,n)=>{const r=ph(t);return Dh.setIn(e,r,n)},Oh=()=>{const e=et,{promise:t,actionMgrID:n}=un.actionManagerPromise(e);return gh({type:e,payload:{actionMgrID:n}}),t},$h=e=>{const t=fh()?.getState();return!!t?.data?.[e]};class Rh{static mergeDeep(e,t){return x()(t,e)}static hasIn(e,t){return P()(e,t)}static getIn(e,t,n){return O()(e,t,n)}static setIn(e,t,n){return R()(e,t,n)}static deleteIn(e,t){return N()(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return M()(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||-1===e.indexOf("."))return!1;let t=0;const n=e.length;for(;t<n;t+=1)if(" @#$%=!<>/\\".includes(e[t]))return!1;return!0}static isWhenExist(e){const t=["visibility","disabled","readOnly","required"];let n=!1;for(const r in e)t.includes(r)&&"string"==typeof e[r]&&e[r]?.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;for(const a in e)t.includes(a)&&"string"==typeof e[a]&&e[a]?.startsWith("@W ")&&(n=tn.trimAnnotation(e[a]),r.add(n));return"multirecordlist"===e?.type&&"Editable"===e?.renderMode&&Object.keys(e?.allowActions??{}).forEach((t=>{"string"==typeof e?.allowActions[t]&&e.allowActions[t]?.startsWith("@W ")&&(n=tn.trimAnnotation(e.allowActions[t]),r.add(n))})),[...r]}static isExpressionExist(e){const t=["disabled","visibility","readOnly","required"];let n=!1;for(const r in 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)?[]:{}),vh(t[r[a]],n,{isArrayDeepMerge:!0})):t[r[a]]=n};static getHashedString(e){return(0,S.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 h()(e,t)}static isContains(e,t){const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&Rh.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,o])=>{r.push(Array.isArray(e)?Number(a):a),Array.isArray(o)?o.forEach(((e,t)=>{r.push(t),n(e,r),r.pop()})):"object"==typeof o?n(o,r):t(r.slice(),o),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,o)=>(a=e[t]?e[t]:Number.isNaN(Number(r[o+1]))?r.length-1===o?n:{}:[],e[t]=a,e[t])),t)})),t}static flatten(e,t,n){t||(t=""),Array.isArray(e)?e.forEach(((e,r)=>{Rh.flatten(e,`${t}[${r}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((r=>{const a=t?`${t}.${r}`:r;Rh.flatten(e[r],a,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=`${e}${t}`.replace(j.CASE_INFO.CASE_INFO_CONTENT,"").replace(j.DATA_INFO.DATA_INFO_CONTENT,"");return Bn.formatPageReference(n)}static buildAttachmentsFormData(e){return e.map((e=>{if(e.delete){let t="";return t=e.responseProps.ID?e.responseProps.ID:e.responseProps.pzInsKey,{type:"File",attachmentFieldName:e.label,delete:!0,pzInsKey:t}}return{type:"File",attachmentFieldName:e.label,category:e.category,ID:e.handle,clientFileID:e.ID}}))}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 isString(e){return"string"==typeof e}static rejectPendingActions(e){return e.forEach((e=>e.payload.actionMgrID&&un.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"]),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 convertObjectWithStringToBoolean(e){if(e&&!Array.isArray(e)&&"object"==typeof e)return Object.keys(e).forEach((t=>{let n;const r=e[t];n="string"==typeof r?"true"===r||"false"!==r&&r:r,e[t]=n})),e}static isValidPageListProperty(e){return!!e&&/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/.test(e)}}const Dh=Rh,xh=j.SUMMARY_OF_LISTS,wh=j.SUMMARY_OF_WHEN_CONDITIONS;class Mh{static updateData(e){Object.keys(e).forEach((t=>{gh(Bh({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{gh(Bh({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${wh}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){return zp([this.resolveName(e,t)])}static resolveView(e,t,n=""){const r=Yp([this.resolveName(e,t)]);let a=[];if(Array.isArray(r)&&r.length>0){if(t&&r.length>1){if(n||(n=t.getValue(j.CLASS_ID)),!n)return;a=r.filter((e=>e[j.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=tn.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=tn.trimAnnotation(t))||"string"==typeof t)?"number"==typeof t&&parseInt(t,10)===t?`${e}[${t}]`:t.startsWith(".")?e+t:`${t}`:e}static getRuleClass(e,t,n){let r;if(t)r=t.startsWith(j.CLASS_ANNOTATION)?t.split(j.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName());else if(n?.authorContext){const t=e.getFieldMetadata(n.authorContext);if(t){r="manual"===t.dataRetrievalType?t.classID:t.pageClass}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:o,name:s,context:i}=n||{},c=this.getRuleClass(t,i,n);return"navigation"===a?r=this.resolveNavigation(o||s,t):"view"===a?r=this.resolveView(o||s,t,c||""):"widget"===a&&(r={type:"Widget",config:{name:s,ruleClass:c}}),r}return e}static resolvePropertyReference(e,t,n){return Ih(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const a=Ch(`${t}.${xh}`,e,n);a&&(r=this.resolvePropertyReference(t,a,n))}return r}static getPropertyValue(e,t,n){return e=tn.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=Mh.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:o,context:s}=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?Mh.getPropertyValue(i,o,`${s}/${j.SUGGESTION}`):Mh.getPropertyValue(i,o,s)}static _handlePropString(e,t,n,r,a){n.startsWith("@")?e[t]=tn.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?(Dh.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(Dh.mergeDeep(e,t),this._resolveProps(t,void 0,e),Dh.resolveStringBooleans(t)):t}static resolveClassID(e,t,n){const r=tn.trimAnnotation(e);let a;for(a=r.startsWith(".")?`${t}${r}`:`${r}`;a;){const e=Ih(j.CLASS_ID,a,n);if(e)return e;a=a.substring(0,a.lastIndexOf("."))}return null}}const Lh=Mh;const Fh=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}};const jh=class{static#i=[];static#c=!1;static getActionHandlers=(e,t,n)=>{const r=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=Fh.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#l=(e,t,n)=>{for(let r=0;r<e.length;r+=1){const a=e[r],o={actionHandler:a.handler,component:t,eventType:n,config:a.config};this.#i.push(o)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===Ap.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=un.getNextActionMgrId(),n};static#d=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,a={};Lh.resolveProps(r,a,n),t&&(t(e.eventType,a,n),this.#u())};static#u=()=>{if(!this.#c){if(0===this.#i.length)return;const e=this.#i.shift();this.#d(e),e.config&&"true"===e.config.parallel&&this.#i.length>0&&this.#u()}};static#p=()=>{this.#u()};static#h=(e,t,n)=>{this.#l(e,t,n),this.#p()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return Lh.getContextPath(t,n)};static#f(e,t){const n=e.getComponentConfig().behaviours||[];for(let r=0;r<n.length;r+=1){const{behaviour:a,actions:o}=n[r];if(o){const n=this.getActionHandlers(o,a,t);n&&n.length>0&&this.#h(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,r=e.getContextName();zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:r});if(("Browser"===Ap.getRuntime()?t?.nativeEvent instanceof Event||t instanceof Event:!!t?.nativeEvent)||null!==t.value&&void 0===t.prop){let{target:n}=t;null===n&&t&&t.auxiliaryTarget&&(n=t.auxiliaryTarget);const a=void 0===n?t.value:"value"in n?n.value:n.innerText,o=this.getFullRef(e);gh({type:Q,payload:{reference:o,value:a,context:r}}),void 0!==n&&this.isEditable(n)&&!this.isNonKeyInput(n)||gh({type:ee,payload:{reference:o,pageReference:e.getPageReference(),value:a,context:r,propertyName:e.getComponentConfig().value,classID:e.getValue(j.CLASS_ID)}})}else{const n=e.getPageReference(),a=e.getStateProps();for(const e of Object.keys(t)){const o=a[e],s=t[e];gh({type:Q,payload:{reference:Lh.getContextPath(n,o),value:s,context:r}}),gh({type:ee,payload:{reference:Lh.getContextPath(n,o),value:s,context:r}})}}};static blurHandler=(e,t)=>{let{target:n}=t;null===n&&t&&"auxiliaryTarget"in t&&(n=t.auxiliaryTarget);const{value:r,validationValue:a}=n,o=this.getFullRef(e),s=e.getContextName();n.clearMessages&&zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:e.getStateProps().value,pageReference:e.getPageReference(),context:s}),this.isEditable(n)&&(e.getValidationApi().validate("validationValue"in n?a:r),e.isInsideList()&&e.getListActions().updateProperty(e.getStateProps().value,r),!this.isNonKeyInput(n)&&gh({type:ee,payload:{reference:o,pageReference:e.getPageReference(),value:r,context:s,propertyName:e.getComponentConfig().value,classID:e.getValue(j.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.#f(e,n)};static pause=()=>{this.#c=!0};static resume=()=>{this.#c=!1,this.#u()};static isQueueEmpty=()=>0===this.#i.length;static clearQueue=()=>{this.#i=[]};static getActionsQueue=()=>this.#i;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},Uh="CREATE_WORK",kh=e=>({type:Uh,payload:e});const Vh=(e,t,n,r="")=>{const a=[];Object.keys(e).forEach((o=>{"object"==typeof e[o]&&o.includes("[")?function(e,t,n,r,a,o){const s=r.substring(0,r.indexOf("[")),i=r.substring(r.indexOf("[")+1,r.indexOf("]"));Array.isArray(t[s])&&(t[s]?.splice(+i,1,e[r]),o.push(s),n.add(`${a}.${r}`))}(e,t,n,o,r,a):e[o]&&"object"==typeof e[o]?(t[o]||(t[o]=Array.isArray(e[o])?[]:{}),Vh(e[o],t[o],n,`${r}.${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,a)},Bh=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:r=[]}=t,{context:a,data:o,isArrayDeepMerge:s,preserveClientChanges:i=!1}=e,c=Dl(a,!0),l=mh(a);let d={};if(l&&o){d=JSON.parse(JSON.stringify(l));const e=JSON.parse(JSON.stringify(o)),t=new Set;Vh(c,d,t),((e,t,n)=>{const r=new Set;e.forEach((e=>{e=Dh.trimDotForProperty(e);const[a,o,s]=mn(e);a&&o&&s&&!r.has(`${a}.${o}`)&&((Dh.getIn(n,`${a}.${o}`)||[]).forEach(((e,n)=>{n!==+s&&Dh.setIn(t,`${a}.${o}[${n}]`,e)})),r.add(`${a}.${o}`))}))})(t,d,e)}!function(e,t){const n=Dh.getIn(e,j.REFERENCED_USERS);let r;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return r=Dh.getIn(t,j.REFERENCED_USERS,{}),void Dh.setIn(e,j.REFERENCED_USERS,{...r,...n});r=Dh.getIn(t,j.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,l);const u={caseInfo:{content:{...d?.caseInfo?.content}}};let p=o;return i?(n.forEach((e=>{Dh.deleteIn(u,`caseInfo.content.${e}`)})),p=vh(o,u,{isArrayDeepMerge:!s})):((e,t)=>{const n=Pl[e]||{};Object.keys(n).forEach((e=>{Dh.hasIn(t,e)&&(n[e].value=Dh.getIn(t,e))}));let r=il.getStateMachinesByContext(e)||{};r={...r,...il.getUnConnectedStateMachines(e)||{}},Object.keys(r).forEach((n=>{if(Dh.hasIn(t,n)){const r=Dh.getIn(t,n);r&&Array.isArray(r)&&0===r.length&&il.setStateMachineEmpty(e,n)}}))})(a,o),{type:ge,payload:{...e,data:p,...r.length>0?{propertiesToReplace:r}:null}}},Gh=e=>({type:"SHOW_HARNESS",payload:e}),Wh=e=>({type:te,payload:e}),Hh=e=>({type:ne,payload:e}),qh=e=>({type:"ADD_WORK",payload:e}),Yh=e=>({type:de,payload:e}),Kh=e=>({type:Ae,payload:e}),zh=e=>({type:Ce,payload:e}),Xh=e=>({type:_e,payload:e}),Jh=e=>({type:be,payload:e}),Qh=e=>({type:Ne,payload:e}),Zh=e=>({type:Te,payload:e}),ef=e=>({type:$e,payload:e}),tf=e=>({type:Oe,payload:e}),nf=e=>{const{containerItemID:t}=e;e.suggestionContexts=Ru(t);const n=e?.data?.caseInfo?.content,r=Object.keys(n||{}).length>0;return e.propertiesToReplace=r?wc.getPropertiesToReplace(t):[],{type:De,payload:e}},rf=e=>{const{context:t}=e;return{type:se,payload:{context:t}}},af=e=>{const{context:t}=e;return{type:ie,payload:{context:t}}},of=e=>({type:xe,payload:e}),sf=e=>({type:Re,payload:e}),cf=e=>({type:Qe,payload:e}),lf=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=vu(n)),e.context=r,e.deleteContext=!Hu(n),e.childContainers=Ou(n),e.childContainersContexts=$u(n),e.transientItems=qu([...e.childContainersContexts,n]),e.suggestionContexts=Ru(n),n===t&&(e.caseID=Ih(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Ih(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Se,payload:e}},df=e=>{const{containerItemID:t}=e;return e.transientItems=qu([...$u(t),t]),{type:Pe,payload:e}},uf=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:ve,payload:e}},pf=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=vu(n)),e.context=r,e.childContainers=Ou(n),e.childContainersContexts=$u(n),e.transientItems=qu([...e.childContainersContexts,n]),e.suggestionContexts=Ru(n),n===t&&(e.caseID=Ih(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Ih(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:we,payload:e}},hf=e=>({type:pe,payload:e}),ff=e=>({type:fe,payload:e}),gf=e=>({type:Ee,payload:e}),mf=(e,...t)=>(jh.resume(),e(...t)),yf=(e,t,n,r,a)=>({type:Ie,payload:{msg:e,err:t,context:n,formFields:r,actionMgrID:a}}),Ef=e=>({type:nt,payload:e}),If=e=>({type:rt,payload:e}),Af=e=>({type:at,payload:e}),Cf=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),_f=e=>({type:ce,payload:e}),Sf=e=>({type:Q,payload:e}),bf=e=>{if(e.indexOf("?")>0){const[t,n]=e.split("?"),r=new URLSearchParams(n),a=new Map;for(const[e,t]of r)"portal"!==e&&"noPortal"!==e&&"debug"!==e&&a.set(e,t);const o=new URLSearchParams(a).toString();return o?`${t}?${o}`:t}return e},Nf=(e,t)=>e.includes("/assignments")?((e,t)=>{const n=e.split("/"),r=n.indexOf("assignments"),a=n.slice(r-2).join("/"),o=n[n.length-1],s=Lf(Ge,{assignmentID:o});return{routeEndpoint:s?.restApi,requestType:s?.reqType,payload:{assignmentID:o},options:t,routeKey:Je,urlPath:a}})(e,t):Ip.getEndPointInfo(e),vf="add",Pf="replace",Tf=["portal","noPortal","preview","debug","devtool"];let Of="",$f="Home",Rf="",Df=!0;const xf=e=>(Df=e,Df),wf=()=>Df,Mf=(e,t,n)=>Ip.getSemanticURL(e,t,n),Lf=(e,t)=>Ip.getRestEndPoint(e,t),Ff=(e,t)=>{let n=I();const r=Lf(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):{}},jf=(e,t,n)=>{const{root:r,resources:a}=e,{views:o}=a,{config:s}=r,i=vf;let c="";if(n)c=n;else{const e=o[s.name];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);c=t.config.urlPath}const l=c.match(up);if(l){const e=Dh.getIn(t,s.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},Uf=(e,t,n)=>{let r,a;r=hp(t)?`${e}/${t}`:e;const o=hp(n.pxURLPath);o&&(r=`${r}/${o}`);try{a=new URL(r).searchParams,r=r.includes("?")?r.split("?")[0]:r}catch(e){return console.log("Invalid url",e),""}const s=r.split("/"),i=s[s.length-1],c=new URLSearchParams(window.location.search);if(i.toLowerCase()!==$f.toLowerCase()||c.has("noPortal")||(r=`${e}/${t}`),!Ip.isDefaultPortal()){const e=Ip.getPortalName();c.has("portal")?c.set("portal",e):c.append("portal",e)}return a=((e,t)=>{for(const[n,r]of t.entries())!e.has(n)&&Tf.includes(n)&&e.append(n,r);return e})(a,c),a.toString()&&(r+=`?${a.toString()}`),r},kf=(e,{urlPathObjParam:t,infoParam:n,optionsParam:r},a=!1)=>{let o,s,i;if(!1===window.PCore.getBehaviorOverride("dynamicSemanticUrl"))return;if(a)o=t,s=n,i=r;else{const{uiResources:n,data:r}=e;({options:i}=e),o=t&&t.pxURLPath&&pp(t.pxURLPath)?jf(n,r,t.pxURLPath):t||jf(n,r),s=Ip.getEndPointInfo(o.pxURLPath),o.pxURLPath=s.urlPath}const c=Uf(Of,Ip.getApplicationPath(),o),{title:l}=((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:Ip.getApplicationName()),n===`${Of}/${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]}`}})(Rf,Ip.getApplicationPath(),c),d=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(s,{...i,title:l});o.historyAction===vf?((e,t,n)=>{try{window.history.pushState(e,t,n),window.scrollTo(0,0)}catch(e){throw new Error("Error- Unable to Add to Browser History")}})(d,l,c):o.historyAction===Pf&&((e,t,n)=>{try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(d,l,c)},Vf=e=>{let t=null;e.directUrlUpdation&&(t={historyAction:vf,pxURLPath:""},t.pxURLPath=e.semanticURL),kf(e,{urlPathObjParam:t,infoParam:null,optionsParam:null},!1)},Bf=e=>{Vf(e)},Gf=e=>{const t={pxURLPath:e};return Uf(Of,Ip.getApplicationPath(),t)},Wf=e=>{const{uiResources:t}=e;wf()&&(e.directUrlUpdation||(e=>{if(e&&e.root){const{root:t}=e,{resources:n}=e,{views:r}=n,a=t.config,o=a.type,s=a.name;if("VIEW"===o.toUpperCase()){const e=r[s];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))&&Vf(e)},Hf=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},qf=(e,t,n)=>{const{caseClassName:r,workID:a}=e.payload,{containerName:o,context:s}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=V.getRemoteCase(r),u={...e,headers:{RemoteSystemID:c},className:r,isTraditionalRemoteCase:!0,action:mt,viewName:U,gadgetId:wc.getUniqueGadgetId(),context:n??s,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${a}`,containerName:o,name:l};gh(d.showPage(u))},Yf=e=>{const t=(e=>e.state?e.state.stateObj:null)(e);t&&(V.isTraditionalRemoteCase(t.payload?.caseClassName)?qf({...t},t.options):gh(d.showHistory(Hf(t))))},Kf=()=>Ip.getApplicationPath()!==gp(),zf=e=>{const{acName:t,context:n,defaultViewLabel:r}=e,a=(e=>{const t=Ip.getRoutingInfo(),n=e.split(" ").join(""),r=e.split(" ").join("-").toLowerCase(),a=(e=>{const t=e.replace(/(?=[A-Z][a-z])/g,"-").toLowerCase();return t.startsWith("-")?t.substring(1):t})(e);return t?.routes[n]?n:t?.routes[r]?r:t?.routes[a]?a:e})(r);(e=>{$f=e})(a),Ip.setDefaultRoute(a);const o=H(t,n),s=yt(t,n),i="true"===Ap.getIsExtraCallRequiredForDefaultHome(),c={historyAction:Pf,pxURLPath:""};let l;const u={acName:s,context:o,actionConfig:{context:o}};if(i||!i&&Kf()){const t=bf(mp());l=Nf(t,u),c.pxURLPath=l.urlPath,void 0!==l.payload?.pageClass&&(l.payload.pageClass=fh()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",r={routeEndpoint:l.routeEndpoint,requestType:l.requestType,payload:l.payload,options:u,routeKey:l.routeKey};V.isTraditionalRemoteCase(l?.payload?.caseClassName)?qf(r,e,u.context):gh(d[n](Hf(r)))}else l=Ip.getEndPointInfo($f),c.pxURLPath="";kf(null,{urlPathObjParam:c,infoParam:l,optionsParam:u},!0)},Xf=(e,t=!1)=>{var n;Of=e.domain,!1===t&&wf()&&(n=Yf,window.addEventListener("popstate",(e=>n(e))),window.onbeforeunload=()=>null),Ip.init(e,$f)},Jf=e=>{(e=>{window.document.title=e})(e)};function Qf(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 Zf=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),eg=()=>Math.random().toString(36).substring(7).split("").join("."),tg={INIT:`@@redux/INIT${eg()}`,REPLACE:`@@redux/REPLACE${eg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${eg()}`};function ng(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 rg(e,t,n){if("function"!=typeof e)throw new Error(Qf(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Qf(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Qf(1));return n(rg)(e,t)}let r=e,a=t,o=new Map,s=o,i=0,c=!1;function l(){s===o&&(s=new Map,o.forEach(((e,t)=>{s.set(t,e)})))}function d(){if(c)throw new Error(Qf(3));return a}function u(e){if("function"!=typeof e)throw new Error(Qf(4));if(c)throw new Error(Qf(5));let t=!0;l();const n=i++;return s.set(n,e),function(){if(t){if(c)throw new Error(Qf(6));t=!1,l(),s.delete(n),o=null}}}function p(e){if(!ng(e))throw new Error(Qf(7));if(void 0===e.type)throw new Error(Qf(8));if("string"!=typeof e.type)throw new Error(Qf(17));if(c)throw new Error(Qf(9));try{c=!0,a=r(a,e)}finally{c=!1}return(o=s).forEach((e=>{e()})),e}p({type:tg.INIT});return{dispatch:p,subscribe:u,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Qf(10));r=e,p({type:tg.REPLACE})},[Zf]:function(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Qf(11));function n(){const e=t;e.next&&e.next(d())}n();return{unsubscribe:e(n)}},[Zf](){return this}}}}}function ag(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:tg.INIT}))throw new Error(Qf(12));if(void 0===n(void 0,{type:tg.PROBE_UNKNOWN_ACTION()}))throw new Error(Qf(13))}))}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let o=!1;const s={};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(Qf(14))}s[i]=d,o=o||d!==l}return o=o||r.length!==Object.keys(e).length,o?s:e}}function og(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}var sg=function(e){function t(t,n){return e.call(this)||this}return us(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(Ns),ig={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=ig.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,ms([e,t],gs(n))):setInterval.apply(void 0,ms([e,t],gs(n)))},clearInterval:function(e){var t=ig.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},cg=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 us(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),ig.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&&ig.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,bs(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(sg),lg=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return us(t,e),t.prototype.schedule=function(t,n){return void 0===n&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},t}(cg),dg={now:function(){return(dg.delegate||Date).now()},delegate:void 0},ug=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=dg.now,e}(),pg=function(e){function t(t,n){void 0===n&&(n=ug.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return us(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}(ug),hg=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return us(t,e),t}(pg))(lg),fg=cs((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),gg=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 us(t,e),t.prototype.lift=function(e){var t=new mg(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new fg},t.prototype.next=function(e){var t=this;Ls((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=fs(t.currentObservers),o=a.next();!o.done;o=a.next()){o.value.next(e)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;Ls((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;Ls((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,o=n.observers;return r||a?vs:(this.currentObservers=null,o.push(e),new Ns((function(){t.currentObservers=null,bs(o,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 Ks;return e.source=this,e},t.create=function(e,t){return new mg(e,t)},t}(Ks),mg=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return us(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:vs},t}(gg),yg=function(e,t){return yg=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])},yg(e,t)};Object.create;Object.create;var Eg=function(e){function t(t,n){var r=e.call(this,(function(e){var t=r.__notifier.subscribe(e);return t&&!t.closed&&e.next(r.value),t}))||this;return r.__notifier=new gg,r.value=n,t.subscribe((function(e){e!==r.value&&(r.value=e,r.__notifier.next(e))})),r}return function(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}yg(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Ks);var Ig=n(52),Ag=Symbol.for("immer-nothing"),Cg=Symbol.for("immer-draftable"),_g=Symbol.for("immer-state");function Sg(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var bg=Object.getPrototypeOf;function Ng(e){return!!e&&!!e[_g]}function vg(e){return!!e&&(Tg(e)||Array.isArray(e)||!!e[Cg]||!!e.constructor?.[Cg]||xg(e)||wg(e))}var Pg=Object.prototype.constructor.toString();function Tg(e){if(!e||"object"!=typeof e)return!1;const t=bg(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Pg}function Og(e,t){0===$g(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function $g(e){const t=e[_g];return t?t.type_:Array.isArray(e)?1:xg(e)?2:wg(e)?3:0}function Rg(e,t){return 2===$g(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Dg(e,t,n){const r=$g(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function xg(e){return e instanceof Map}function wg(e){return e instanceof Set}function Mg(e){return e.copy_||e.base_}function Lg(e,t){if(xg(e))return new Map(e);if(wg(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Tg(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[_g];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const a=n[r],o=t[a];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(bg(e),t)}{const t=bg(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Fg(e,t=!1){return Ug(e)||Ng(e)||!vg(e)||($g(e)>1&&(e.set=e.add=e.clear=e.delete=jg),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Fg(t,!0)))),e}function jg(){Sg(2)}function Ug(e){return Object.isFrozen(e)}var kg,Vg={};function Bg(e){const t=Vg[e];return t||Sg(0),t}function Gg(){return kg}function Wg(e,t){t&&(Bg("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Hg(e){qg(e),e.drafts_.forEach(Kg),e.drafts_=null}function qg(e){e===kg&&(kg=e.parent_)}function Yg(e){return kg={drafts_:[],parent_:kg,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Kg(e){const t=e[_g];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function zg(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[_g].modified_&&(Hg(t),Sg(4)),vg(e)&&(e=Xg(t,e),t.parent_||Qg(t,e)),t.patches_&&Bg("Patches").generateReplacementPatches_(n[_g].base_,e,t.patches_,t.inversePatches_)):e=Xg(t,n,[]),Hg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ag?e:void 0}function Xg(e,t,n){if(Ug(t))return t;const r=t[_g];if(!r)return Og(t,((a,o)=>Jg(e,r,t,a,o,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Qg(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let a=t,o=!1;3===r.type_&&(a=new Set(t),t.clear(),o=!0),Og(a,((a,s)=>Jg(e,r,t,a,s,n,o))),Qg(e,t,!1),n&&e.patches_&&Bg("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Jg(e,t,n,r,a,o,s){if(Ng(a)){const s=Xg(e,a,o&&t&&3!==t.type_&&!Rg(t.assigned_,r)?o.concat(r):void 0);if(Dg(n,r,s),!Ng(s))return;e.canAutoFreeze_=!1}else s&&n.add(a);if(vg(a)&&!Ug(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Xg(e,a),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||Qg(e,a)}}function Qg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Fg(t,n)}var Zg={get(e,t){if(t===_g)return e;const n=Mg(e);if(!Rg(n,t))return function(e,t,n){const r=nm(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!vg(r)?r:r===tm(e.base_,t)?(am(e),e.copy_[t]=om(r,e)):r},has:(e,t)=>t in Mg(e),ownKeys:e=>Reflect.ownKeys(Mg(e)),set(e,t,n){const r=nm(Mg(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=tm(Mg(e),t),s=r?.[_g];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((a=n)===(o=r)?0!==a||1/a==1/o:a!=a&&o!=o)&&(void 0!==n||Rg(e.base_,t)))return!0;am(e),rm(e)}var a,o;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_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==tm(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,am(e),rm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Mg(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Sg(11)},getPrototypeOf:e=>bg(e.base_),setPrototypeOf(){Sg(12)}},em={};function tm(e,t){const n=e[_g];return(n?Mg(n):e)[t]}function nm(e,t){if(!(t in e))return;let n=bg(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=bg(n)}}function rm(e){e.modified_||(e.modified_=!0,e.parent_&&rm(e.parent_))}function am(e){e.copy_||(e.copy_=Lg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Og(Zg,((e,t)=>{em[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),em.deleteProperty=function(e,t){return em.set.call(this,e,t,void 0)},em.set=function(e,t,n){return Zg.set.call(this,e[0],t,n,e[0])};function om(e,t){const n=xg(e)?Bg("MapSet").proxyMap_(e,t):wg(e)?Bg("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Gg(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,o=Zg;n&&(a=[r],o=em);const{revoke:s,proxy:i}=Proxy.revocable(a,o);return r.draft_=i,r.revoke_=s,i}(e,t);return(t?t.scope_:Gg()).drafts_.push(n),n}function sm(e){if(!vg(e)||Ug(e))return e;const t=e[_g];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Lg(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Lg(e,!0);return Og(n,((e,t)=>{Dg(n,e,sm(t))})),t&&(t.finalized_=!1),n}var im=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof 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("function"!=typeof t&&Sg(6),void 0!==n&&"function"!=typeof n&&Sg(7),vg(e)){const a=Yg(this),o=om(e,void 0);let s=!0;try{r=t(o),s=!1}finally{s?Hg(a):qg(a)}return Wg(a,n),zg(r,a)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Ag&&(r=void 0),this.autoFreeze_&&Fg(r,!0),n){const t=[],a=[];Bg("Patches").generateReplacementPatches_(e,r,t,a),n(t,a)}return r}Sg(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof 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]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){vg(e)||Sg(8),Ng(e)&&(e=function(e){Ng(e)||Sg(10);return sm(e)}(e));const t=Yg(this),n=om(e,void 0);return n[_g].isManual_=!0,qg(t),n}finishDraft(e,t){const n=e&&e[_g];n&&n.isManual_||Sg(9);const{scope_:r}=n;return Wg(r,t),zg(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}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=Bg("Patches").applyPatches_;return Ng(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},cm=im.produce;im.produceWithPatches.bind(im),im.setAutoFreeze.bind(im),im.setUseStrictShallowCopy.bind(im),im.applyPatches.bind(im),im.createDraft.bind(im),im.finishDraft.bind(im);const lm=(e,t)=>{const{data:{shared:n={}}={},context:r}=t;((e,t)=>{Pd.updateDataPageStore(t),Object.keys(t).forEach((n=>{Dh.getIn(e,[j.SHARED,n])?Object.keys(t[n]).forEach((r=>{Dh.setIn(e,[j.SHARED,n,r],t[n][r])})):Dh.setIn(e,[j.SHARED,n],t[n])}))})(e,n),r&&Dh.deleteIn(e,[r,"shared"])},dm=(e,t,n=!1)=>{const{context:r,caseViewMode:a=(n?void 0:j.PERFORM_MODE),containerName:o}=t;o!==du.WORKAREA&&a&&Dh.setIn(e,[r,"context_data","caseViewMode"],a)},um=(e,t)=>{const{context:n}=t;Dh.setIn(e,[n,"context_data","actionType"],t.actionType),Dh.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},pm=(e,t=[])=>{t.forEach((t=>Dh.deleteIn(e,t)))},hm=(e,t=[])=>{t.forEach((t=>Dh.deleteIn(e,t)))},fm=(e,t=[])=>{t.forEach((t=>{Dh.deleteIn(e,t)}))},gm=(e,t,n={})=>{const{deleteAssignmentSpecificResources:r=!0,doDeleteConfirmationDetails:a=!0}=n;Dh.deleteIn(e,[t,"nextAssignmentInfo"]),Dh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableActions"]),Dh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableProcesses"]),Dh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"activeActionID"]),Dh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"assignments"]),Dh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"childCases"]),a&&(Dh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"confirmationLinks"]),Dh.deleteIn(e,[t,"caseMessages"])),r&&(Dh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"actionButtons"]),Dh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"navigation"]))},mm=/\[(\d+)\]$/gi,ym=/(\d+)/gi,Em=/\[.\]$/gi,Im=(e,t,n,r=[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT])=>{const a=Dh.getIn(t,r);if(a){const t=Jn(a,[],[]);for(const a of t)Dh.setIn(e[n],[...r,...a],{})}},Am=(e,t,n,r)=>{const{property:a,pageReference:o,category:s,type:i}=r.payload,c=Dh.getIn(e[t],n);if(c&&s===j.CASEMESSAGES)Dh.setIn(e[t],Wn(a,o,s),"");else if(c&&c.length>0&&Array.isArray(c)){const r=c.filter((e=>e.type!==i));n&&n.length>0&&Dh.setIn(e[t],Wn(a,o,s),r)}},Cm=(e,t)=>{const{property:n,pageReference:r,category:a,isListEntry:o,deletingIndex:s,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return Im(e,i,c),e;const l=Wn(n,r,a,o);if(Number.isInteger(s)){Dh.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=Dh.getIn(e[c],t)||{};const r=(d=Object.keys(n),[...d].sort(((e,t)=>{const n=e.match(mm),r=t.match(mm);if(!n&&!r)return e.localeCompare(t);if(!n&&r)return-1;if(n?.length&&r?.length){const e=n[0].match(ym),t=r[0].match(ym);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 o=r[a].match(mm);if(o?.length){const i=parseInt(o[0].match(ym)[0],10);i>s&&(Dh.deleteIn(e[c],t.concat(r[a])),Dh.setIn(e[c],t.concat(r[a].replace(Em,`[${i-1}]`)),n))}}))}else Dh.setIn(e[c],l,{});var d;return e};function _m(e,t){const n=Dh.getIn(e,t);return void 0!==n?.dataInfo?.content}function Sm(e,t){let n=Gn.FIELD_MESSAGES_PATH;return _m(e,t)&&(n=Gn.DATA_OBJECT_FIELD_MESSAGES_PATH),n}const bm=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const r=Dh.getIn(n,j.ERROR_FIELD_IN_PAGE).slice(1),a=Dh.getIn(n,j.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(a){let o="caseInfo.content";_m(e,t)&&(o="dataInfo.content");let s=r?`${o}.${r}`:o;s=s.replace(/\(/g,"[").replace(/\)/g,"]");const i=Wn(a,s,j.PROPERTY),c=Dh.getIn(e[t],`${s}.classID`),l=Bp(a,c),d=PCore.getLocaleUtils(),u=`${l?.definedOnClassID||l?.classID}.${a}`,p={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:d.getLocaleValue(l.label,u,d.FIELD_LABELS_BUNDLE_KEY)}},h=Dh.getIn(e[t],i,[]);if(Dh.isContains(h,p))return;Dh.setIn(e[t],i,[...h,p])}})(e,t,n)}))};function Nm(e,t){const{err:n,formFields:r}=t.payload;let{context:a}=t.payload;const{fieldErrors:o,pageErrors:s}=Wc(n.errorDetails,r),i=Sm(e,a);if(Dh.setIn(e,[a,...i],{}),Dh.setIn(e,[a,...Gn.PAGE_MESSAGES_PATH],[]),o.forEach((t=>{if(t[j.ERROR_FIELD_IN_PAGE]){const n=t[j.ERROR_FIELD_IN_PAGE].slice(1);if(n){const t=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)}(n);if(!t)return!1;const r=n.substring(n.lastIndexOf(".")+1),o=Wn(r,t,j.PROPERTY);Dh.setIn(e,[a,...o],[])}}})),o.length>0&&bm(e,a,o),s.length>0){const t=(e=>{const t=[];return e.forEach((e=>{t.push({type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue})})),t})(s);e[a]||(a=j.APP.APP),Dh.setIn(e,[a,...Gn.PAGE_MESSAGES_PATH],t)}else a.includes&&a.includes(du.WORKAREA)&&(a=W(a)),Dh.deleteIn(e,[a,...Gn.PAGE_MESSAGES_PATH]);return e}const vm=[(e,t)=>cm(e,(e=>{switch(t.type){case ge:{const{propertiesToReplace:n=[],interestPath:r}=t.payload;if(r){const a=Dh.getIn(e[t.payload.context],r),o=Dh.getIn(t.payload.data,r),s=vh(a,o,{isArrayDeepMerge:!0});Nh(e[t.payload.context],[...n]),Dh.setIn(e[t.payload.context],r,s)}else e[t.payload.context]=vh(e[t.payload.context],t.payload.data,{isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n]});return dm(e,t.payload,!0),lm(e,t.payload),e}case Q:{const{context:n,reference:r,value:a,isArrayDeepMerge:o}=t.payload;return Ph(e[n],r,a,{isArrayDeepMerge:o}),e}case Z:{const{context:n,reference:r,value:a}=t.payload;return Th(e[n],r,a),e}case me:return Sh(e[t.payload.context],t.payload.reference),e;case se:return Dh.setIn(e[t.payload.context],"context_data.isLoading",!0),e;case ie:return Dh.setIn(e[t.payload.context],"context_data.isLoading",!1),e;case nt:{const{data:n}=t.payload;return lm(e,{data:{shared:n}}),e}case rt:{const{dataPagesToBeRemoved:n=[]}=t.payload;return n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:r}=t;Dh.deleteIn(e.shared,[n,r]);const a=Dh.getIn(e.shared,[n]);a&&0===Object.keys(a).length&&Dh.deleteIn(e.shared,[n])})),e}case st:{const n=Dh.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);return t.payload.isInitiateBlockingAction?Dh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):Dh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1),e}default:return e}})),(e,t)=>cm(e||{},(e=>{switch(t.type){case _e:{if(!t.payload.data||e[t.payload.context])return e;t.payload.doDeleteCaseSummary&&gm(e,t.payload.context);const{target:n}=t.payload;return!n||-1===n.indexOf(j.WORKAREA)&&-1===n.indexOf(j.MODAL)?e[t.payload.containerItemID]=t.payload.data:e[t.payload.context]=t.payload.data,dm(e,t.payload),um(e,t.payload),lm(e,t.payload),((e,t)=>{const{context:n}=t;Dh.deleteIn(e,[n,"context_data","blocking_action_counter"]),Dh.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload),e}case De:{t.payload.doDeleteCaseSummary&&gm(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:r=[]}=t.payload;return!n||-1===n.indexOf(j.WORKAREA)&&-1===n.indexOf(j.MODAL)?e[t.payload.containerItemID]=vh(e[t.payload.containerItemID],t.payload.data,{propertiesToReplace:[...r]}):e[t.payload.context]=vh(e[t.payload.context],t.payload.data,{propertiesToReplace:[...r]}),(t.payload.actionType||t.payload.assignmentID)&&um(e,t.payload),dm(e,t.payload),lm(e,t.payload),hm(e,t.payload.suggestionContexts),e}case Se:{const{childContainersContexts:n=[]}=t.payload;return((e,t)=>{const{containerItemID:n,context:r,deleteContext:a}=t;a&&Dh.deleteIn(e,[r]),Dh.deleteIn(e,[n])})(e,t.payload),fm(e,n),pm(e,t.payload.transientItems),hm(e,t.payload.suggestionContexts),e}case Ce:{const{containerItems:n}=t.payload;return Array.isArray(n)?n.forEach((t=>{Dh.deleteIn(e,[t])})):Dh.deleteIn(e,[n]),e}case xe:{const{context:n,contextToBeRemoved:r,data:a,childContainersContextsToBeRemoved:o}=t.payload;return gm(e,t.payload.context),dm(e,t.payload),e[n]=vh(e[n],e[r]),e[n]=vh(e[n],a),Dh.deleteIn(e,[r]),fm(e,o),lm(e,t.payload),e}case we:{const{payload:{context:n,pulseReplace:r=!0,childContainersContexts:a=[]}}=t;let{payload:{data:o}}=t;const s=Dh.getIn(e[n],"pulse");let i=Dh.getIn(e[n],"OperatorID"),c=Dh.getIn(e[n],"pxRequestor");return c&&o.pxRequestor&&(c=Dh.mergeDeep(c,o.pxRequestor)),i&&o.OperatorID&&(i=Dh.mergeDeep(i,o.OperatorID)),!r&&s&&(o=Ph(o,"pulse",s),o=Ph(o,"OperatorID",i),o=Ph(o,"pxRequestor",c)),Dh.setIn(e,n,o),dm(e,t.payload),lm(e,t.payload),fm(e,a),pm(e,t.payload.transientItems),hm(e,t.payload.suggestionContexts),e}case ot:{const{context:n,doDeleteConfirmationDetails:r=!0}=t.payload;return gm(e,n,{doDeleteConfirmationDetails:r}),e}case be:{const{transientItemID:n,data:r}=t.payload;return Dh.setIn(e,n,r)}case ve:case Pe:{const{transientItems:n}=t.payload;return n.forEach((t=>Dh.deleteIn(e,t))),e}case Ne:case Te:{const{transientItemID:n,data:r}=t.payload;return vh(Dh.getIn(e,n),r),e}case Oe:{const{transientItemID:n,data:r}=t.payload;for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&Dh.deleteIn(e,[n,t]);return e}case $e:{const{transientItemID:n,data:r}=t.payload;return Dh.deleteIn(e,n),Dh.setIn(e,n,r)}case ce:{const{key:n,value:r}=t.payload;return Dh.setIn(e,`${j.SHARED}.${n}`,r),e}case Fe:{const{context:n,data:r}=t.payload;return Dh.setIn(e,n,r)}default:return e}})),(e,t)=>cm(e||Dm().data,(e=>{switch(t.type){case Ie:return t.payload.err.errorDetails&&("Validation fail"===t.payload.err.errorClassification||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?Nm(e,t):e;case De:{const{context:n}=t.payload,r=[n,...Sm(e,n)],a=[n,...Gn.PAGE_MESSAGES_PATH];if(Dh.setIn(e,r,{}),Dh.setIn(e,a,[]),n&&n.includes(du.WORKAREA)){const t=[X(n),...Gn.PAGE_MESSAGES_PATH];Dh.setIn(e,t,[])}return e}case Ze:{const{isListEntry:n}=t.payload;return n?Cm(e,t):((e,t)=>{const{property:n,pageReference:r,category:a,isListEntry:o,stateObj:s}=t.payload,{context:i}=t.payload;let c=i;if(s)return Im(e,s,i),e;const l=Wn(n,r,a,o);return a===j.PAGE&&i?.includes(du.WORKAREA)&&(c=W(i)),Am(e,c,l,t),Am(e,i,l,t),e})(e,t)}case Qe:{const{messages:n,property:r,pageReference:a,context:o,category:s}=t.payload,i=Wn(r,a,s);return n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&Dh.setIn(e[o],Wn(r,a,s),n),e}default:return e}})),(e,t)=>cm(e,(e=>{if(t.type===at){const{instruction:n,actions:r,context:a,referenceList:o,listIndex:s,listMoveToIndex:i,content:c={}}=t.payload,l=ph(o);switch(n){case j.LIST_ACTIONS.INSERT:((e,t,n,r,a)=>{Dh.setIn(e[t],[...n,r],a)})(e,a,l,s,c);break;case j.LIST_ACTIONS.UPDATE:((e,t,n,r,a)=>{const o=vh(Dh.getIn(e[t],[...n,r],{}),a);Dh.setIn(e[t],[...n,r],o)})(e,a,l,s,c);break;case j.LIST_ACTIONS.DELETE:((e,t,n,r)=>{const a=Dh.getIn(e[t],n,[]);a.splice(r,1),Dh.setIn(e[t],n,a),Tn.deleteListNode(t,n,a.length)})(e,a,l,s);break;case j.LIST_ACTIONS.MOVE:((e,t,n,r,a)=>{const o=Dh.getIn(e[t],[...n,r],{}),s=Dh.getIn(e[t],n,[]);s.splice(r,1),s.splice(a,0,o),Dh.setIn(e[t],n,s),Yn(e,t,n?.join("."),r,a)})(e,a,l,s,i);break;case j.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,r)=>{const a=Dh.getIn(e[t],n)||[];r.forEach((e=>{const{instruction:r,content:o,listIndex:s}=e;if(r===j.LIST_ACTIONS.SELECT){a[s]=o;const e=n?.join(".");gr(t,e)}else delete a[s]})),Dh.setIn(e[t],n,a.filter(Boolean))})(e,a,l,r);break;case j.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{Dh.setIn(e[t],n,[])})(e,a,l)}}return e}))],Pm=(e,t)=>(e||(e=Dm().data),t.type===et?Dm().data:(vm.forEach((n=>{e=n(e,t)})),e)),Tm=(e,t=[])=>{t.forEach((t=>{Dh.deleteIn(e,[t])}))},Om=(e,t)=>{const{type:n,payload:r}=t,a=n===De,{target:o,context:s,semanticURL:i="",root:c,containerItemID:l,childContainers:d,flowName:u,resourceType:p="",key:h="",clearView:f=!1}=r;return c?Dh.setIn(e,[o,"items",l,"view"],c):f&&Dh.deleteIn(e,[o,"items",l,"view"]),s&&Dh.setIn(e,[o,"items",l,"context"],s),u&&Dh.setIn(e,[o,"items",l,"flowName"],u),(!a||a&&h)&&Dh.setIn(e,[o,"items",l,"key"],h.trim()),((e,t,n,r)=>{""===e&&Dh.deleteIn(t,[n,"items",r,"key"])})(h,e,o,l),(!a||a&&i)&&Dh.setIn(e,[o,"items",l,"semanticURL"],i),(!a||a&&p)&&Dh.setIn(e,[o,"items",l,"resourceType"],p),Tm(e,d),e},$m=(e,t)=>(e||(e=Dm().containers),t.type===et?Dm().containers:cm(e,(e=>{switch(t.type){case Ae:{const{context:n,name:r,type:a,actionMgrID:o}=t.payload,s=`${n}/${r}`;let i=null;return un.resolveActionByID(o,null,!1),e[s]?e:(i={type:a,accessedOrder:[],items:{}},Dh.setIn(e,[s],i),e)}case Le:{const{containerName:n,childContainers:r=[]}=t.payload;return Dh.deleteIn(e,[n]),r.forEach((t=>{Dh.deleteIn(e,[t])})),e}case Ce:{const{context:n,name:r,actionMgrID:a,childContainers:o}=t.payload,s=`${n}/${r}`;return un.resolveActionByID(a,null,!1),Dh.setIn(e,[s,"accessedOrder"],[]),Dh.setIn(e,[s,"items"],{}),Array.isArray(o)&&o.forEach((t=>{Dh.deleteIn(e,[t])})),e}case _e:{const{target:n,context:r,isInCreateStage:a,isBulkAction:o,semanticURL:s,root:i,containerItemID:c,actionMgrID:l,key:d,flowName:u,resourceType:p,actionName:h,isMinimizable:f,showProgress:g,progressMessage:m,modalOptions:y,resourceStatus:E,actionID:I,isMultiRecordData:A,acTertiary:C,parentContext:_,heading:S,isTraditionalRemoteCase:b}=t.payload,N=e[n],v=N&&N.type,P=N&&N.accessedOrder||[],T=N&&N.items||{};let O=null;return e[n]&&"single"===v&&P.length>0?Om(e,t):(O={accessedOrder:[...P,c],items:{...T,[c]:{view:i,semanticURL:s,key:d,flowName:u,context:r,isInCreateStage:a,resourceType:p,actionName:h,isMinimizable:f,...o&&{isBulkAction:o},showProgress:g,progressMessage:m,modalOptions:y,isTraditionalRemoteCase:b,resourceStatus:E,...I&&{actionID:I},...C&&{acTertiary:C},...A&&{isMultiRecordData:A},..._&&{parentContext:_},heading:S}}},un.resolveActionByID(l,null,!1),e[n]=x()(e[n],O),e)}case De:{const{actionMgrID:n,data:r}=t.payload;let a=e;try{a=Om(e,t),un.resolveActionByID(n,r,!1)}catch{un.rejectActionByID(n,!1)}return a}case we:return((e,t)=>{const{actionMgrID:n,data:r,target:a,containerItemID:o}=t.payload;let s=e;try{const i=e&&e[a]?.type;let c=e&&e[a]?.accessedOrder||[];c="single"===i?c.length>0?c:[...c,o]:c.includes(o)?c:[...c,o],Dh.setIn(e,[a,"items",o,"transientItems"],[]),Dh.setIn(e,[a,"accessedOrder"],c),s=Om(e,t),un.resolveActionByID(n,r,!1)}catch{un.rejectActionByID(n,!1)}return s})(e,t);case Re:{const{target:n,containerItemID:r,actionMgrID:a}=t.payload;try{const t=Dh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));t.push(r),Dh.setIn(e,[n,"accessedOrder"],t),un.resolveActionByID(a,null,!1)}catch{un.rejectActionByID(a,!1)}return e}case xe:case Se:{const{target:n,containerItemID:r,actionMgrID:a,childContainers:o}=t.payload;try{const t=Dh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));Dh.setIn(e,[n,"accessedOrder"],t),Dh.deleteIn(e,[n,"items",r]),Tm(e,o),un.resolveActionByID(a,null,!1)}catch{un.rejectActionByID(a,!1)}return e}case be:{const{transientItemID:n,target:r,contextName:a}=t.payload,o=Dh.getIn(e,[r,"items",a,"transientItems"])??[];return Dh.setIn(e,[r,"items",a,"transientItems"],[...o,n])}case Pe:{const{target:n,containerItemID:r}=t.payload;return Dh.deleteIn(e,[n,"items",r,"transientItems"]),e}case ve:{const{target:n,transientItemID:r,containerItemID:a}=t.payload,o=(Dh.getIn(e,[n,"items",a,"transientItems"])??[]).filter((e=>e!==r));return Dh.setIn(e,[n,"items",a,"transientItems"],o)}default:return e}})));let Rm={};const Dm=()=>Rm,xm=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,r=n[j.CONTEXT_DATA]||e[j.CONTEXT_DATA];Rm={data:{[j.APP.APP]:{...t,[j.CONTEXT_DATA]:r}},containers:{}}})(e),ag({data:Pm,containers:$m}));function wm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=rd(e),r=function(e,t){return"number"==typeof nd(e)?e.pop():t}(e,1/0),a=e;return a.length?1===a.length?ri(a[0]):function(e){return void 0===e&&(e=1/0),ed(qs,e)}(r)(hi(a,n)):sd}const Mm=(e,t)=>{e.data=e.data??{};const{assignments:n,availableActions:r=[]}=e.data.caseInfo??{};if(n&&Array.isArray(n)&&n.length>0&&n[0].actions&&Array.isArray(n[0].actions)&&!t?.stopMergeActions){n[0].actions.forEach((e=>{"Assignment"!==e.type&&"LocalAction"!==e.type||r.push(e)})),e.data.caseInfo=e.data.caseInfo??{},e.data.caseInfo.availableActions=r}},Lm=(e,t)=>{if(e.confirmationLinks&&(e.data=e.data??{},e.data.caseInfo=e.data.caseInfo??{},e.data.caseInfo.confirmationLinks=e.confirmationLinks),!e.uiResources&&e.confirmationNote){let t=e;const{confirmationNote:n}=t;return Mm(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 n=e,{uiResources:{actionButtons:r,navigation:a},nextAssignmentInfo:o}=n;if(n.data&&n.data.caseInfo&&(r&&(n.data.caseInfo.actionButtons=r),a&&(n.data.caseInfo.navigation=a),t&&t[F.ACTIONS.DELETEAVIALACTIONS]&&delete n.data.caseInfo.availableActions,Mm(n,t),e.confirmationNote)){const{confirmationNote:e}=n,t=[e];n.data.caseMessages=t}return t&&t.isCreateDataObject&&(n.data=n.data??{},n.data.dataInfo={},n.data.dataInfo.content=n.data.pyPortal,n.uiResources.root.config.context="dataInfo.content",n.uiResources.context_data.dataInfo=n.uiResources.context_data.dataInfo??{},n.uiResources.context_data.dataInfo.content=n.uiResources.context_data.dataInfo.content??{},n.uiResources.context_data.dataInfo.content=n.uiResources.context_data?.pyPortal,delete n.data.pyPortal,delete n.key),o&&(n.data=n.data??{},n.data.nextAssignmentInfo=o),n},Fm={},{VIEW:jm,FIELD:Um}=j.CONTEXT_TREE_NODE_TYPES,km=e=>xi[e]>0&&Fm[e],Vm=[(e,t)=>e.pipe(Jl(On.REFRESH_DATA,gt),Zl((e=>e.payload)),ed((e=>{const{context:n,contextData:r,options:a}=e,{propertyName:o="",classID:s=""}=a,i=Uc(n,{skipUUID:!1});let c=[],l=[],d=!1;Ap.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:c=[],whens:l=[]}=kn(n)),d=l.some((e=>e.type===jm))):d=!0;const u=l.filter((e=>e.type===Um)),p=Dh.getPropertyName(o),h=p?p.split("."):[],f=h.pop(),g=h.join("."),m=[];if(g){const e=Bp(g,s);if(e&&"copy"===e.dataRetrievalType){const e=Dh.getIn(i,`content.content.${g}`)||{};if(Object.keys(e).length>0){Object.keys(e).filter((e=>e!==f)).forEach((t=>{delete e[t],m.push(`${g}`)}))}}}e.serverPrecedenceFields=m;let y={...i.content,contextData:r};const E=al(n);Dh.isEmpty(E)||(y=rl(E,y));const I=((e,t)=>{const{caseWideAction:n,caseViewAction:r,fieldsWithDeclarativeTargets:a,fieldsWithWhen:o,isViewsWithWhen:s,interestPage:i,options:c}=e;let l={};const{optionalPayload:d}=c;d&&(t.content={...d});let u={...t},p=On.REFRESH;return r?(l=Ff(On.REFRESH_CASE_VIEW,e),u={...u,interestPage:i}):s&&n?l=Ff(On.REFRESH_CASE_DATA,e):s&&!n?l=Ff(On.REFRESH_ASSIGNMENT_DATA,e):(a.length>0||o.length>0)&&(u={...u,calculations:{fields:a,whens:o}},l=Ff(n?On.RECALCULATE_CASE_DATA:On.RECALCULATE_ASSIGNMENT_DATA,e),p=On.RECALCULATE),{restAPI:l,requestBody:u,requestType:p}})({...e,fieldsWithDeclarativeTargets:c,fieldsWithWhen:u,isViewsWithWhen:d},y);Jt.registerBlockingAction(n).catch((()=>{}));const{restAPI:A,requestBody:C,requestType:_}=I;(e={...e,requestType:_}).requestType=_;const{reqType:S,restApi:b}=A,N=t.value.data[n]?.caseInfo?.headers;return hi(((e,t)=>{const{context:n}=e;(e=>{e.reqHeaders&&e.reqHeaders.etag&&(e.headers={"if-match":e.reqHeaders.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),km(r)){const t=[];for(let n=0;n<Fm[r].length;){const a=Fm[r][n],o=Vn(a,e);if("CANCEL_REFRESH"===o){const e=new Error;return e.code="ERR_CANCELED",Promise.reject(e)}!0===o&&(t.push(n),a.cancelConfig?.cancel()),n+=1}t.forEach((e=>{Fm[r].splice(e,1)}))}const a=Gi();return e.signal=a.token,e.cancelConfig=a,Fm[r]?Fm[r].push(e):Fm[r]=[e],ki(e.url,e,n,{cancelContext:r}).then((e=>(delete Fm[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete Fm[r],e}))})({reqHeaders:N,context:n,method:S,body:C,url:Un(e,b)},e)).pipe(Zl((t=>({response:{...t.data||{}},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:jc(t.headers)}))),cd(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),ed((async e=>{if(e&&e.type===Ie)return Jt.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),Hc(e);const{actionConfig:t,response:n,actionMgrID:r}=e,{context:a,serverPrecedenceFields:o,requestType:s}=t,i=dc.getTargetViewContainerName(je),c=yt(i,a),l={acName:c,context:a},d=Lm(n,{[F.STOPMERGEACTIONS]:!0,[F.ACTIONS.DELETEAVIALACTIONS]:!0});d.directUrlUpdation=!1,s===On.REFRESH&&await Vc(d,t,l);const u={target:c,context:a};let p=il.getStateMachinesByContext(a)||{};const h=kc(d,u);t.interestPage&&(h.interestPath=`caseInfo.content${Dh.convertClipboardPageToPageRefNotation(t.interestPage)}`),p={...p,...il.getUnConnectedStateMachines(a)||{}},Object.keys(p).forEach((e=>{if(Dh.hasIn(h.data,e)){const t=Dh.getIn(h.data,e),n=Ih(e,void 0,a),r=Tn.getContextReferences(a)?.get(e);((e,t,n,r,a)=>Array.isArray(e)&&Array.isArray(t)&&t.length!==e.length&&"Multiselect"!==n&&(!r.interestPath||a.startsWith(r.interestPath)))(t,n,r?.props?.componentName,h,e)&&il.setStateMachineEmpty(a,e)}})),t.options?.skipDataMerge&&h.data?.caseInfo?.content&&(h.data.caseInfo.content={}),h.preserveClientChanges=void 0===t.options.preserveClientChanges||t.options.preserveClientChanges;const f=wc.getPropertiesToReplace(a),g=mf(Bh,h,{serverPrecedenceFields:o,propertiesToReplace:f});return il.registerForServerChanges(),gh(g),un.resolveActionByID(r,h),il.unRegisterForServerChanges(),Jt.deRegisterBlockingAction(a).catch((()=>{})),[]})))],Bm=[e=>e.pipe(Jl(tt),ed((async e=>{const{context:t}=e.payload,n={},r={},a=Object.keys(e.payload.datapages).map((a=>{const o=e.payload.datapages[a];if(o.mode===j.READONLY&&o?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=o?.refreshStrategy||{},n=yh()[o.name];if(n&&a in n){const r=n[a],{loadTime:o}=r;if(!yd.isTimeElapsed(o,e,t))return}}return yd.getData(o.name,{dataViewParameters:o.dataViewParameters},t).then((e=>{const t=o.mode===j.READONLY?r:n;t[o.name]?t[o.name][a]={pxResults:e.data.data,parameters:o.dataViewParameters,loadTime:e.data?.fetchDateTime}:t[o.name]={[a]:{pxResults:e.data.data,parameters:o.dataViewParameters,loadTime:e.data?.fetchDateTime}}})).catch((()=>{}))}));await Promise.allSettled(a);const o=[];return Object.keys(n).length&&o.push(Bh({context:t,data:n})),Object.keys(r).length&&o.push(Ef({data:r,context:t})),gh(o),[]})))];class Gm{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";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=>{switch(e.data.action){case Gm.DISPLAY_DIRTY_POPUP:this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(yi.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this));break;case Gm.LOAD_PREVIEW:this.loadPreview(e);break;case Gm.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case Gm.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case Gm.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case Gm.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case Gm.CLOSE_CONTAINER_ACTION:this.closeContainer(e)}}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){ou({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=ou({isRoot:!0}),t=PCore.getStore()?.getState().data.app?.pyPortal?.pyPrimaryNavPages;let n;Array.isArray(t)&&t[0]&&(n=t[0]);const r=n?.pyClassName||"Data-Portal",a=n?.pyRuleName||"pyHome";e.getPConnect().getActionsApi().showPage(a,r)};closeContainer=e=>{const{uniqueId:t}=e.data;t===this.getUniqueId()&&this.navigateToDefaultPage()};updateCoexistenceDrilldownCase=e=>{const{key:t,caseClassName:n,actionApi:r,caseLabel:a,uniqueId:o}=e.data;if(o!==this.getUniqueId())return;let s=r;r===Gm.OPEN_WORK_ITEM&&(s=Gm.OPEN_WORK_BY_HANDLE),Ip.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:s});ou({}).getPConnect().getActionsApi().updateRecents(n,t.substring(t.lastIndexOf(" ")+1),a,t)};openAssignment=e=>{const{pzInsKey:t,uniqueId:n}=e.data;n===this.getUniqueId()&&(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"),this.onCreateCallback.call(this,this.openAssignmentParams)),this.onCreateCallback=null,this.openAssignmentParams=null)};getNextWork=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId()){const e=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`;ou({meta:{},options:{context:Pu(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){const e=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`;ou({meta:{},options:{context:Pu(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};destroyBroadcastChannel=()=>{this.getBroadCastChannel()?.close(),this.broadcastChannel=null};subscribeEvents=()=>{this.setReverseCoexistenceCaseLoaded(!0),yi.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),yi.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{yi.unsubscribeAllWithEventType(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),yi.unsubscribeAllWithEventType(F.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:Gm.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:Gm.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:Gm.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const Wm=new Gm,Hm="nextAssignmentInfo",qm="nextAssignmentInfo.context",Ym=e=>{const{containerName:t,isInCreateStage:n}=e;return n?j.MODAL:t||dc.getTargetViewContainerName(We)},Km=e=>{const t=Dh.getIn(e,[j.DATA,j.CASE_INFO.CASE_INFO]);return nn(t)&&rn(Ap.getOperatorIdentifier(),t)},zm=(e,t)=>{const{class:n,context:r,viewType:a=Lc.PAGE}=e,{removeActionPayload:o}=t;let s=e?.pageName?e?.pageName:Ap.getDefaultCasePage();return e.isTraditionalUICase&&(s="pyDetails"),hi(Xi.createCase(n,{...e,pageName:s,viewType:a,context:r})).pipe(Zl((({response:t,headers:n})=>({response:t,actionInPayload:e,headers:n,removeActionPayload:o}))),cd("Error occurred during ajax call at createWork Epic : ",r))},Xm=e=>{yi.publish(j.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},Jm=e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},Qm=e=>{let t=0,n=[],r="",a=!1;return e.pipe(Jl(Uh),ld(100),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>{const{context:n}=e,r=Ym(e),o=yt(r,n),{continueExecution:s,removeActionPayload:i}=(e=>Du(e)?{continueExecution:!0,removeActionPayload:{}}:Xc(e))(o);return a=$c(e.class),s?(e.isTraditionalUICase=a,zm(e,{removeActionPayload:i})):(un.rejectActionByID(t),id())})),ed((async e=>{if(e&&e.type===Ie)return e.payload.context=np(),n.push(Hc(e)),n;const{actionInPayload:o,response:s,headers:i,removeActionPayload:c}=e;let l;l=!(o.renderInline||Ap.getDefaultCasePage()||a)&&Km(s),Dh.setIn(s.data,F.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const d=Ym({...o,isInCreateStage:l}),u=yt(d,o.context),p=Yc(u,d,o.context);if(!mc(d)&&Du(u)){const{continueExecution:e}=Xc(u);if(!e)return un.rejectActionByID(t),id()}if(!(o?.openCaseViewAfterCreate??!0)&&!l){const e=Dh.getIn(s.data,F.CASE_INFO.CASE_INFO_CONTENT);r=`${e.pyID} ${Sp.getLocaleValue("has been created.","Assignment")}`;const t=bc(s),a=Cc(s);return Xm({toastMessage:r}),Jm({caseId:`${e.pyID}`,assignmentId:t,caseType:a}),n}const h=Lm(s);let f=Mf("createWork",{caseClassName:Cc(h)});f=f.replace(/{.+?}/,String(Ac(Sc(h)))),h.semanticURL=f,((e,t)=>{const n=Km(e),{skipBrowserSemanticUrlUpdate:r=!1,isTraditionalUICase:a}=t;Dh.setIn(e,["directUrlUpdation"],(!n||a)&&!r)})(h,o);const g={acName:u,context:p},m=xc(p);await Vc(h,o,g);const y={target:u,context:p,containerItemID:p,headers:i,semanticURL:f,isInCreateStage:l,isMinimizable:l,caseViewMode:h.confirmationNote?j.REVIEW_MODE:j.PERFORM_MODE,currentCaseViewMode:m,assignmentContext:Dh.getIn(h,qm),nextAssignmentInfo:Dh.getIn(h,Hm),resourceType:F.CASE,openCaseViewAfterCreate:o.openCaseViewAfterCreate,modalOptions:o.modalOptions,debugInfo:o.debugInfo};Pc(y,h);const E=kc(h,y);a&&(E.data.caseInfo.content.coexistenceAction="openAssignment");const I=qc(u,E);return Kc(I)&&Nc(n,{removeActionPayload:c,target:u}),n.push(I),Zc(n),n})),Zl((()=>{const e=Rc(),o=nn(Dh.getIn(n[0]?.payload,"data.caseInfo"));return a&&e&&o?Wm.postCreateCaseMessage(n[0]?.payload?.nextAssignmentInfo?.ID,nl,n):nl(n),Oc(n,t),r="",n=[],n})))},{RESOURCE_TYPES:Zm}=F,ey=(e,t=[])=>{const{viewType:n,containerName:r,targetContainerName:a,isChild:o}=e,s=Ic(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})(s)&&e?.stageID===s.stageID?Lc.PAGE:n||(!gc(r)&&!gc(a)||o?Lc.PAGE:Lc.FORM)},ty=(e,t,n,r,a)=>{if(Nc(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=Su(t);let r=null;return n&&(r=hu(t,n)),r?.key===e&&xu(t)})(r.key,n))r.context=Pu(n),r.containerItemID=r.context,e.push(mf(pf,r));else if((a?.isChild||a?.isRemote)&&a?.isMultiDoc){const t=Vu(a.context);r.target=t,r.context=a.context,r.containerItemID=a.context,e.push(mf(pf,r))}else{const t=Vu(r.context),n=Eu(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(mf(pf,r))):e.push(mf(Xh,r))}},ny=(e,t,n,r,a,o,s)=>{Du(t)&&wu(t)?((e,t,n,r,a)=>{ey(e,t)===Lc.FORM?(n.caseViewMode=r||j.PERFORM_MODE,a.push(mf(nf,n))):a.push(mf(pf,n))})(r,a,e,o,n):ty(n,s,t,e,r)},ry=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:s})=>ki(e,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...Ri.addDebugHeaders(r)}}},a,{doNotMergeHttpMessagesForStatusCode:o?s:""}),ay=(e,t)=>{const n=ey(e),{headers:r,context:a,assignmentID:o,isGetNextWork:s,debugInfo:i,isOpenStage:c,stageID:l,caseID:d,jsActionQueryParams:u,isLastStepInCreateStage:p}=e,{restApi:h,reqType:f}=s?Ff("getNextWork",{viewType:n}):c?Ff("openStage",{caseID:d,stageID:l}):Ff(Ge,{assignmentID:o,viewType:n}),{removeActionPayload:g}=t,m=Ap.getDefaultCasePage();let y="",E=e.pageName;e.isTraditionalUICase&&(E="pyDetails"),y=m?`${h}?viewType=${n}&pageName=${m}`:E?`${h}?viewType=${n}&pageName=${E}`:`${h}?viewType=${n}`,u&&Object.keys(u).forEach((e=>{y+=`&${e}=${u[e]}`}));const I=(e=>{let t=e?.headers??{};return e?.isRemote&&(t=jc(t,e.remoteClassName)),t})(e);return hi(ry({restUrl:y,reqType:f,requestHeaders:I,debugInfo:i,context:a,isGetNextWork:s,doNotMergeMessagesForStatusCode:"404"})).pipe(Zl((e=>{if(Ap.isCoexistenceAppOfType(j.APP_TYPE.UIKIT)&&!p){return nn(e.data.data.caseInfo)?e:(y=y.replaceAll(E,"pyDetails"),Ap.setDefaultCasePage("pyDetails"),{isReloadWithDifferentViewTypeRequired:!0,restUrl:y})}return e})),ed((e=>e?.isReloadWithDifferentViewTypeRequired?ry({restUrl:y,reqType:f,requestHeaders:I,debugInfo:i,context:a,isGetNextWork:s,doNotMergeMessagesForStatusCode:"404"}):ad(e))),Zl((t=>{const{key:a,flowName:s}=Gc(o);return{response:{...t.data,key:a,flowName:s},actionInPayload:e,viewType:n,removeActionPayload:g,headers:jc({...r,...t.headers})}})),cd("Error occurred during ajax call at openAssignment Epic : ",a))},{RESOURCE_TYPES:oy}=F,sy=e=>{const t="Browser"===Ap.getRuntime();let n=0,r=[];const a=[];let o=!1,s=!1;return e.pipe(Jl(Wl),Zl((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),ed((e=>{o=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?Lc.FORM:ey(e),e.viewType=r;const a=hc(Ge,e),i=yt(a,t),{activate:c,activateContainerActionPayload:l}=Qc(oy.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return ad({type:Re,activateContainerActionPayload:l,actionInPayload:e});const d=Su(i);let u;u=l?.isParallelAssignment?{continueExecution:!0,removeActionPayload:{}}:d?Xc(i):{continueExecution:!0,removeActionPayload:{}};const{continueExecution:p,removeActionPayload:h}=u;return p?(s=$c(e.className),e.isTraditionalUICase=s,ay(e,{removeActionPayload:h})):(un.rejectActionByID(n),id())})),ed((async e=>{if(e?.type===Ie){if(o){const{payload:t}=e,{err:n}=t,r=n.response.status;a.push({status:Number(r)})}return r.push(Hc(e)),r}const{type:t,actionInPayload:n,response:i,viewType:c,headers:l,removeActionPayload:d,activateContainerActionPayload:u}=e;if("openStage"===i?.redirectInfo?.jsAction){const e=i?.redirectInfo?.stageID,t=Wl,a=i?.data?.caseInfo?.ID;n.isOpenStage=!0,n.stageID=e,n.jsActionQueryParams=i?.redirectInfo?.jsActionQueryParams;const o={type:t,payload:{...n,caseID:a,headers:l}};return r.push(o),r}const{context:p,caseViewMode:h,debugInfo:f}=n;let g=((e,t)=>{const n=Ic(e);let r;r=!Ap.getDefaultCasePage()&&nn(n);const{isChild:a,containerName:o}=t,s=a&&r,i=r&&!t.isActionFromToDoList;return s||i?j.MODAL:o||hc(Ge,t)})(i,n);s=$c(i?.data?.caseInfo?.caseTypeID),n.isTraditionalUICase=s,s&&(g=n.containerName);const m=yt(g,p);if(t===Re)return await(async(e,t,n)=>{const{semanticURL:r,containerItemID:a,isParallelAssignment:o,insKey:s}=t,{target:i,actionInPayload:c}=n,{skipBrowserSemanticUrlUpdate:l=!1}=c,d=vu(a);await Vc({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:d}),e.push(mf(sf,{containerItemID:a,target:i,isParallelAssignment:o,insKey:s,resourceType:Zm.CASE,context:d,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,u,{actionInPayload:n,target:m}),Zc(r),r;const y=i?.data?.caseInfo?.content,E=i?.uiResources?.root?.config?.name,I=i?.uiResources?.root?.config?.context;y&&!y.pyViewName&&E&&"page"!==n.viewType&&(Dh.setIn(y,"pyViewName",E),Dh.setIn(y,"pyViewContext",I));const A=Lm(i);((e,t)=>{const n=Ic(e),r=Sc(e),a=nn(n),{skipBrowserSemanticUrlUpdate:o=!1,viewType:s,isTraditionalUICase:i}=t,c=s===Lc.PAGE&&(!a||i)&&!o,{caseTypeID:l}=n;if(c){const t=Mf(Be,{caseClassName:l}).replace(/{.+?}/,String(Ac(r)));e.semanticURL=t,e.directUrlUpdation=!0}})(A,n);const C=Yc(m,g,p),_={acName:m,target:m,context:C};await Vc(A,n,_);const S={target:m,context:C,containerItemID:C,headers:l,parentContext:W(n?.context),isMinimizable:nn(Dh.getIn(A,"data.caseInfo")),doDeleteCaseSummary:n.doDeleteCaseSummary,acTertiary:n.acTertiary,resourceType:F.ASSIGNMENT,debugInfo:f};Pc(S,A,{skipFlowNameUpdate:n?.caseViewMode===j.REVIEW_MODE});const b=kc(A,S);var N;return n.isProcessAction&&(b.data.isProcessAction=n.isProcessAction),s&&(b.data.caseInfo.content.coexistenceAction="openAssignment"),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(n,b),ny(b,m,r,n,i,h,d),c===Lc.FORM&&vc(b.containerItemID)&&tl(b,r),Zc(r),N={actionInContext:p,assignmentID:n.assignmentID,caseKey:b.key},yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,N),r})),Zl((()=>{const e=n,t=Rc(),o=nn(Dh.getIn(r[0]?.payload,"data.caseInfo"));return s&&t&&o?Wm.postCreateCaseMessage(r[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,gh,r):gh(r),Oc(r,e,a),r[0]?.payload?.isParallelAssignment&&gh({type:Wl,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))},iy=(e,t)=>{const{insKey:n,headers:r,context:a,debugInfo:o,viewType:s}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:Ap.getDefaultCasePage(),l=Ff(Be,{caseID:n,params:{pageName:c}});let{restApi:d}=l;const{reqType:u}=l;return"none"===s&&(d=`${d?.split("viewType")[0]}viewType=none`),hi(ki(d,{method:u,headers:{...r,...o&&{...Ri.addDebugHeaders(o)}}},a)).pipe(Zl((t=>({response:t.data,actionInPayload:e,headers:jc({...r,...t.headers}),removeActionPayload:i}))),cd("Error occurred during ajax call at openWorkByHandle Epic : ",a))},cy="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:ly}=F,dy=async(e,t,n)=>{const{actionInPayload:r,activateContainerActionPayload:a,type:o,response:s,removeActionPayload:i,headers:c}=e,{context:l,skipBrowserSemanticUrlUpdate:d,debugInfo:u}=r,p=hc(Be,r),h=yt(p,l);if(o===Re)await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:a,actionInPayload:{context:o,skipBrowserSemanticUrlUpdate:s,doDeleteCaseSummary:i}}=t,c=hc(Be,a),l=yt(c,o),d=vu(r);await Vc({directUrlUpdation:!s,semanticURL:n},a,{acName:l,containerName:c,target:l,context:d}),e.push(mf(sf,{containerItemID:r,target:l,context:d,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:a,actionInPayload:r});else{const a=Yc(h,p,l,{buildNew:!0}),o=Lm(s),f=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:r}=t,a=Sc(e),o=n?r:Cc(e);let s=Mf(Be,{caseClassName:o},{id:t?.insKey});return s=s?.replace("{workID}",String(Ac(a)))?.replace("{id}",t?.insKey),s})(o,r);o.semanticURL=f,o.directUrlUpdation=!d;const g={acName:h,context:a};await Vc(o,r,g);const m=kc(o,{target:h,context:a,containerItemID:a,semanticURL:f,headers:c,debugInfo:u});m.caseViewMode=j.REVIEW_MODE,m.resourceType=ly.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle"),Pc(m,o,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=xc(e?.actionInPayload?.context);const y=qc(h,m);i.containerItemID&&Kc(y)&&t.push(mf(lf,{containerItemID:i.containerItemID,target:h})),t.push(y)}Zc(t);const f=r.insKey;var g;g={caseKey:f,actionInContext:l},yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,g)},uy=e=>{let t=0,n=[];return e.pipe(Jl(cy),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>{const{context:n,isChild:r,viewType:a}=e,o=hc(Be,e),s=yt(o,n);let i,c=!0;if("none"!==a){const e=Xc(s);c=e.continueExecution,i=e.removeActionPayload}if(!c)return un.rejectActionByID(t),id();const{activate:l,activateContainerActionPayload:d}=Qc(ly.CASE,s,e);return l&&!r&&"none"!==a?ad({type:Re,activateContainerActionPayload:d,actionInPayload:e}):iy(e,{removeActionPayload:i})})),ed((async e=>{if(e&&yc(e.type))return n.push(Hc(e)),n;const t=mh(e?.actionInPayload?.context),r=$c(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=Lm(e?.response),a={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:ot,payload:{context:a.context,doDeleteConfirmationDetails:!1}}),r&&a.data.caseInfo?.content&&(a.data.caseInfo.content.coexistenceAction="openWorkByHandle"),n.push(mf(Bh,a));const o=Vu(e?.actionInPayload?.context),s=fc(e?.actionInPayload?.context),i=Object.freeze({target:o,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:s});if(vc(e?.actionInPayload?.context)){const t=kc(e?.response,{...i});tl({...t,isArrayDeepMerge:!0},n)}}}else await dy(e,n,r);return n})),Zl((()=>(gh(n),Oc(n,t),n=[],n))))},py="FINISH_ASSIGNMENT",{RESOURCE_TYPES:hy}=F,fy=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:a,isProcessAction:o}=t,s=vu(n),i=`${s?.includes("root")?j.APP.ROOT:j.APP.APP}/${du.MODAL}`;e.push(mf(lf,{containerItemID:n,context:s,target:i,skipReleaseLockRequest:r,isInCreateStage:a,isProcessAction:o}))},gy=e=>Ih(".openCaseViewAfterCreate",j.CONTEXT_DATA,e)??!0,my=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r,a)=>{const{caseID:o}=n,s=(i=t,Dh.getIn(i,pc.NEXT_ASSIGNMENT_INFO_ID,j.EMPTY_STRING));var i;const c=Cc(t),{caseViewMode:l,headers:d,semanticURL:u,actionMgrID:p,directUrlUpdation:h,key:f,flowName:g,resourceType:m}=r;a&&Object.assign(a,{caseId:o,assignmentId:s,caseType:c}),fy(e,{...n,skipReleaseLockRequest:!0});const y=`${n?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${du.PRIMARY}`,E=Yc(y,du.PRIMARY),I=Ri.getCoreHeadersFromContext(n.context)||!1,A=kc(t,{target:y,context:E,containerItemID:E,caseViewMode:l,headers:d,semanticURL:u,key:f,flowName:g,resourceType:m,directUrlUpdation:h,debugInfo:I&&I.debugInfo&&{debugId:I.debugInfo[j.COREHEADER_APP_DEBUG_ID]}});if(Du(y)){const t=mh(E),a=Sc({data:t}),[,o]=a?a.split(" "):[],s=`You will lose unsaved changes for ${o}. Do you want to continue?`;if(!gy(n.context))return e;{const{continueExecution:t}=Xc(y,{dirtyMessage:s});if(!t)return r.directUrlUpdation=!1,un.rejectActionByID(p),id();A.currentCaseViewMode=xc(A?.context),e.push(mf(pf,A))}}else e.push(mf(Xh,A));return t.directUrlUpdation=h,t.semanticURL=u,await Vc(t,{...A,acName:y},{acName:y,context:E}),e},yy=e=>/^app\/preview_[0-9]*/g.test(e),Ey=(e,t)=>{const n=W(e);return!yy(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},Iy=async(e,t,n,r,a,o,s,i,c)=>{const{headers:l}=c;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=mh(e),r=c?.response?.data?.caseInfo?.assignments??[],a=n?.caseInfo?.assignments??[],o=xc(e)===j.PERFORM_MODE,s=r[0]?.ID!==a[0]?.ID,i=r.length>0&&a.length>0;o&&s&&i&&c?.response?.data?.caseInfo?.assignments&&(c.response.data.caseInfo.assignments=t(r,a[0]?.ID))}const d=Du(Vu(e));let u=!1;const p=Vu(n),h=pu(p),f=Su(p);f&&h?.items?.[f]?.key===c?.actionInPayload?.caseID&&(u=!0),fy(a,{...r,skipReleaseLockRequest:!0});const g=fc(e),m={target:Vu(e),containerItemID:e,context:e,containerName:g};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const y=X(n),E=mh(y),I=mh(r.context),A=E?.caseInfo?.ID,C=I?.caseInfo?.ID,_=mh(e)?.caseInfo?.ID;if(d&&A===C||!d&&(""===s||m.containerItemID.includes(j.WORKAREA)&&"review"===t.caseViewMode||!o&&t.root&&0===Object.keys(t.root).length&&_===t.data?.caseInfo?.ID))(void 0===t?.data?.caseInfo?.content||void 0!==t.data.caseInfo.content&&"object"==typeof t.data.caseInfo.content&&0===Object.keys(t.data.caseInfo.content).length)&&(t.root=void 0,delete t.data?.caseMessages),e.includes(j.WORKAREA)&&t.caseViewMode===j.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),a.push(mf(nf,{...t,key:s,resourceType:"",...m}));else if(o){const o=Vu(e),i=Eu(o,s);if(i)m.target=o,m.context=i,m.containerItemID=i,a.push(mf(nf,{...t,key:s,resourceType:"",...m}));else{const e=Ou(n)[0];if(r.target=e,r.context=Yc(e,j.WORKAREA,n),r?.context){r.containerItemID=r.context,a.push(mf(Xh,{...r,...t}));const n=r.containerItemID;a.push(mf(sf,{parentContainerTarget:e,containerItemID:n}))}}}if(r.target=Vu(e),r.containerName=fc(e),r.context=e,r.containerItemID=e,Dh.setIn(t,"acName",m.target),await Vc(i,t),u){const{data:e,caseViewMode:r}=t;n.includes(j.WORKAREA)&&vc(n)&&(n=X(n));const o={data:e,caseViewMode:r,context:n};Dh.setIn(o.data,["context_data","caseViewMode"],r),a.push({type:ot,payload:{context:n}}),a.push(mf(Bh,o))}if(!o&&t.caseViewMode===j.PERFORM_MODE){const t=((e,t)=>{const n=Vu(e);return Eu(n,t)})(e,s),n={data:{caseInfo:{headers:l}},context:t};a.push(mf(Bh,n)),a.push($n(((e,t=!1,n=!1)=>{const r=un.getNextActionMgrId();return{ID:Lh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:Lh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{fy(a,r);let e=!1;const s=Vu(n),i=pu(s),l=Su(s);if(l&&i?.items?.[l]?.key===c?.actionInPayload?.caseID&&(e=!0),o){const e=Ou(n)[0];r.target=e,r.context=Yc(e,j.WORKAREA,n),r.containerItemID=r.context,a.push(mf(Xh,{...r,...t}));const o=r.containerItemID;a.push(mf(sf,{parentContainerTarget:e,containerItemID:o}))}if(e){const{data:e,caseViewMode:r}=t,o={data:e,caseViewMode:r,context:n};Dh.setIn(o.data,["context_data","caseViewMode"],r),a.push({type:ot,payload:{context:n}}),a.push(mf(Bh,o))}}},Ay=async(e,t,n,r,a,o)=>{((e,t,n)=>{if(t.isProcessAction&&(fy(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${du.PRIMARY}`,a=Yc(r,du.PRIMARY),o={insKey:e.ID,className:e.content.classID,context:a,acTargetName:j.PRIMARY,isChild:!0},s={type:de,payload:{...o}};n.push(s)}})(e.data.caseInfo.parentCaseInfo,t,a);const s=e?.data?.caseInfo?.parentCaseInfo?.ID;if(s){const n=Vu(t?.context),r=hu(n,t?.context)?.parentContext,a=Vu(r);t?.isProcessAction&&yu(a,s)&&ap(r,e?.data?.caseInfo?.lastUpdateTime)}n.resourceType=hy.CASE,n.directUrlUpdation=!0,t.isProcessAction||await my(a,{translatedDXAPIResponse:r,actionInPayload:t},n,o)},Cy=async(e,t,n,r,a)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===j.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:o}=t,s=wc.getPropertiesToReplace(o);a.push(mf(nf,{...e,...r,propertiesToReplace:s})),Dh.setIn(e,"acName",r.target),await Vc(n,e),((e,t,{data:n,caseViewMode:r})=>{const{containerItemID:a}=t,o=vu(a);if(o&&vc(a)){const t=X(o),s={data:n,caseViewMode:r,context:t};Dh.setIn(s.data,["context_data","caseViewMode"],r),e.push({type:ot,payload:{context:t}});const i=wc.getPropertiesToReplace(a);e.push(mf(Bh,s,{propertiesToReplace:i}))}})(a,t,e)},_y=async(e,t,n,r,a,o,s,i,c)=>{const{isCaseWideAction:l,isInCreateStage:d,containerItemID:u}=e,p=W(e.context),h=_c(a),f=Cc(a),g=d&&!h&&!l,m=Ou(p)[0],y=m?Su(m):p,E=fc(u),I=vu(u),A=Object.freeze({target:e.target,containerItemID:u,context:I,containerName:E});g&&!yy(e.context)?await Ay(i,e,t,a,o,c):Ey(e.context,y)?await Iy(y,t,p,e,o,n,r,a,s):l&&!Ey(e.context,y)?(fy(o,e),((e,t,n)=>{const{containerItemID:r,caseID:a}=t;if(r&&/^app\/preview_[0-9]*/g.test(r)){const{caseClassName:t}=n,o=W(r),s=vu(o);e.push(mf(Wh,{containerItemID:o,context:s,container:du.PREVIEW,containerName:du.PREVIEW,caseId:a,viewName:F.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(o,e,{caseClassName:f})):await Cy(t,e,a,A,o)},Sy=(e,t)=>{const{assignmentID:n,actionID:r,caseID:a,context:o,additionalHeaders:s={},isCaseWideAction:i,outcome:c,jsActionQueryParams:l}=e,{state$:d}=t,u=(e=>{const{isModalAction:t,viewType:n,isInCreateStage:r,isCaseWideAction:a}=e;return t&&r&&!a?Lc.PAGE:n||Lc.FORM})(e),p=(e=>{const{isCaseWideAction:t}=e;return t?Ke:"finishAssignment"})(e),h={assignmentID:n,actionID:r,caseID:a,viewType:u};let{restApi:f}=Ff(p,h),{reqType:g}=Ff(p,h);u&&!f?.includes("viewType=")&&(f=f?.includes("?")?`${f}&viewType=${u}`:`${f}?viewType=${u}`),c&&!f?.includes("outcome")&&(f=f?.includes("?")?`${f}&outcome=${c}`:`${f}?outcome=${c}`),f=((e,t)=>(e&&Object.keys(e).forEach((n=>{t+=`&${n}=${e[n]}`})),t))(l,f),i&&(g="PATCH"),e.viewType=u;const{content:m,attachmentsExist:y}=Uc(o);e.attachmentsExist=y;const E=d.value.data[o]?.caseInfo?.headers||{},{etag:I}=E,A={"if-match":I,...s};return hi(ki(f,{method:g,body:m,headers:A},o)).pipe(Zl((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:jc({...A,...r})}})),cd("Error occurred during ajax call at finishAssignment Epic : ",o))},{RESOURCE_TYPES:by}=F,Ny=(e,t)=>{let n=0,r=[],a={},o="",s={},i=!1,c=!1;return e.pipe(Jl(py),Ql((e=>{const l=Ap.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),o=e.payload.context,zn({context:o,stateObj:mh(o),clearContextMessages:!0}),!Il(o)){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,t),Jt.handleDeferredActionCompletion(e.payload.context),ad([])}return ad(e.payload).pipe(ed((e=>{((e,t)=>{const{containerItemID:n,context:r,actionMgrID:a,isInCreateStage:o,isModalAction:s}=t;if(o&&s){const t=fc(n),o=yt(t,r);e.push(mf(sf,{containerItemID:n,target:o,actionMgrID:a}))}})(r,e);const n={...e};return Sy(n,{state$:t})})),ed((async e=>{if(e&&e.type===Ie){(e=>{const t=e?.payload?.err?.response?.data?.displayButtonsOnErrors||[],n=e?.payload?.err?.response?.status;if(Array.isArray(t)&&t.length>0&&424===n){t.forEach((e=>{e.isErrorButton=!0}));const n=e.payload.context,r=mh(n),a=((e,t)=>(e.forEach((e=>{!0!==e.isErrorButton||t.some((t=>t.actionID===e.actionID))||(t=[...t,e])})),t))(t,r?.caseInfo?.actionButtons?.secondary||[]),o={data:{caseInfo:{actionButtons:{secondary:a}}},target:Vu(n),context:n};gh({type:ge,payload:o})}})(e);const t=Hc(e);return r.push(t),r}jd.clearContextedCache(o);const{headers:t,actionInPayload:d,response:u}=e,{containerItemID:p,context:h=vu(p),isModalAction:f,isInCreateStage:g}=d;i=d.isCaseWideAction,c=d.isProcessAction;const m=Vu(p);d.target=m;const y=fc(p),E=Object.freeze({target:d.target,containerItemID:p,context:h,containerName:y});var I;Dh.setIn(u.data,j.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),Dh.setIn(u.data,j.CASE_INFO_IS_LOCAL_ACTION,!1),u?.uiResources?.root?.config?.name&&"page"!==d.viewType&&Dh.setIn(u.data,j.CASE_INFO.VIEW_NAME,u?.uiResources?.root?.config?.name),I={submitResponse:u},yi.publish(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,I);let A=Lm(u,{[F.STOPMERGEACTIONS]:!u.nextAssignmentInfo});const C=Cc(A),_=W(d.context),S=Ou(_)[0]?Su(Ou(_)[0]):_,b=_c(A),N=g&&!b;!f||g||Ey(d.context,S)||(A=((e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e))(A,mh(p)));const v=kc(A,{headers:t,actionMgrID:n,directUrlUpdation:!1});let P,T;Tc(v.data,d),v.caseClassName=C,v.resourceType=by.ASSIGNMENT,v.headers=t;const O=A?.data?.caseInfo?.assignments?.some((e=>e.ID===d.assignmentID)),$=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(A,d),R=((e,t,n,r,a)=>{let o;const s=Vu(t);return o=xu(s)?Eu(s,n.data?.caseInfo?.ID):Su(s),r&&e&&Ah(null,j.CASE_VIEW_MODE_PROP,o)===j.PERFORM_MODE&&a})(O,S,A,f,$),D=d?.actionID===F.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(A?.data?.nextAssignmentInfo&&!D)v.caseViewMode=j.PERFORM_MODE,P=Sc(A),T=!0;else if(R&&!D)v.caseViewMode=j.PERFORM_MODE,P=Sc(A),v.flowName=" ",v.deleteAssignmentSpecificResources=!1,T=!1;else{v.caseViewMode=j.REVIEW_MODE;const e=Du(Vu(S));P=A?.confirmationNote&&A?.uiResources?.root?.config?.name===j.PY_CONFIRM&&!e?Sc(A):"",T=!1}const x=Sc(A);Pc(v,A,{skipFlowNameUpdate:v?.caseViewMode===j.REVIEW_MODE||R});const w=Mf("createWork",{caseClassName:C}).replace(/{.+?}/,String(Ac(x)));if(A.semanticURL=w,v.semanticURL=w,f?(await _y(d,v,T,P,A,r,e,u,s),N&&(a=(e=>{if(!gy(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{}})(d))):g&&l&&!b?(Ap.setDefaultCasePage("pyDetails"),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:du.PRIMARY,targetContainerName:du.PRIMARY,viewType:Lc.PAGE,isLastStepInCreateStage:!0,context:n},a={type:fe,payload:{...r}};t.push(a)})(u,r,W(h))):await Cy(v,d,A,E,r),Dc(e,r),Jt.handleDeferredActionCompletion(o).catch((()=>{})),((e,t,n)=>{const{isModalAction:r,isCaseWideAction:a,caseID:o}=t,s=Ey(t.context,n),i=e?.data?.caseInfo?.stages||[],c=e?.data?.caseInfo?.stageID;uc({caseID:o,isModalAction:r,isModalLaunchedFromPrimaryValue:s,isCaseWideAction:a,stages:i,stageID:c})})(v,d,S),!A?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:r,actionID:a}=t;return{isCaseWideAction:n,caseID:Sc(e),assignmentID:n?null:r,actionID:n?a:null}})(A,d);(e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)})({...e,containerItemID:p})}return((e,{isModalAction:t,target:n,transientItemID:r})=>{if(t){const t=e.find((({type:e})=>e===we));t?.payload&&(n=t.payload.target,r=t.payload.containerItemID)}const a=df({target:n,containerItemID:r});a.payload.transientItems.length&&e.push(a)})(r,{transientItemID:p,target:m,isModalAction:f}),r})),Zl((()=>{const e=r.find((e=>e.type===Ie));var t;return e?(Jt.handleDeferredActionCompletion(o).catch((()=>{})),(e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[j.ERROR_FIELD_IN_PAGE]=e[j.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[j.ERROR_FIELD_IN_PAGE].slice(1),r=e[j.ERROR_IN_PAGE_IDENTIFIER],a=r.startsWith(".")?r.slice(1):r;if(a){let o=t?`caseInfo.content.${t}`:"caseInfo.content";o=o.replace(/\(/g,"[").replace(/\)/g,"]");const s=Wn(a,o,j.PROPERTY),i={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};Tn.mutateField(n,o,s[s.length-1],{messages:[i],type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:r})}}))})(e),un.rejectActionByID(n)):un.resolveActionByID(n,a),s?.caseId&&(t=s,yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,t)),nl(r),(i||c)&&(e=>{yi.publish(j.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0}),r=[],a={},s={},r})))})))},vy="CANCEL_ASSIGNMENT",Py=e=>{const t={},{routeKey:n,isModalAction:r,caseID:a,context:o,RemoteSystemID:s}=e;s&&(t.RemoteSystemID=s);const i=n||"releaseAssignmentLock",{restApi:c,reqType:l}=Ff(i,{ID:a,caseID:a,viewType:Lc.PAGE});return $i.getPreviewMode()&&(t[j.SKIPCOREHEADERS]=!0),hi(ki(c,{method:l,headers:t},o,{includeRemoteSystemIdIfPresent:!!s})).pipe(Zl((t=>r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:jc(t.headers)})),cd(": Error occurred during ajax call at release lock request : ",o))},Ty=(e,t)=>{const{isModalAction:n}=t;return Py({routeKey:"cancelAssignment",isModalAction:n,...e})},Oy=e=>{let t=0,n=[];return e.pipe(Jl(vy),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>{const{isModalAction:n}=e;e.context||(e.context=vu(e.containerItemID));const{context:r}=e,a=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?du.MODAL:fc(n)})(e),o=yt(a,r),{continueExecution:s}=Xc(o);return s?(e.RemoteSystemID=V.getRemoteHeaderByContext(e.context)??void 0,Ty(e,{isModalAction:n})):(un.rejectActionByID(t),id())})),ed((async e=>{if(e&&e.type===Ie)return n.push(Hc(e)),n;const{actionInPayload:r,response:a}=e,{containerItemID:o,isModalAction:s,isInCreateStage:i}=r,c=Vu(o),l=vu(o),d={target:s?`${j.APP.APP}/${j.MODAL}`:c,containerItemID:o,caseViewMode:s?j.PERFORM_MODE:j.REVIEW_MODE,context:l,actionMgrID:t,key:Sc(a),skipReleaseLockRequest:!1};return i&&n.push(mf(nf,d)),!s&&vc(o)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:r,referencedUsers:a}=t,o=W(n),s={context:vu(o),data:{referencedUsers:a,context_data:{caseViewMode:r}}};s.data={...t.response.data,...s.data},e.push(mf(Bh,s))})(n,{childContainerItemID:o,caseViewMode:j.REVIEW_MODE,referencedUsers:a?.data.referencedUsers,response:a}),d.skipReleaseLockRequest=!0,n.push(mf(lf,d)),n})),Zl((()=>(gh(n),Oc(n,t),n=[],n))))},$y="NAVIGATE_TO_STEP",Ry=(e,t)=>{const{ID:n,stepID:r,containerItemID:a,context:o=vu(a),isInCreateStage:s}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:s?Lc.PAGE:Lc.FORM},{restApi:l,reqType:d}=Ff("navigateToStep",c),{content:u}=Uc(o),p=i.value.data[o].caseInfo.headers;return hi(ki(`${l}`,{method:d,body:u,headers:{"if-match":p&&p.etag}},o)).pipe(Zl((t=>({response:t.data,actionInPayload:e,headers:jc({...p,...t.headers})}))),cd("Error occurred during ajax call at navigateToStep Epic : ",o))},{RESOURCE_TYPES:Dy}=F,xy=(e,t)=>{let n=0,r=[];return e.pipe(Jl($y),Ql((e=>(({actionMgrID:n}=e.payload),ad(e.payload).pipe(ed((e=>(Zn(e.context),Ry(e,{state$:t})))),ed((async e=>{if(e&&yc(e.type))return r.push(Hc(e)),r;const{actionInPayload:t,response:n,headers:a}=e,{containerItemID:o,context:s=vu(o),isModalAction:i}=t;jd.clearContextedCache(t.context);const c=Vu(o),l=fc(o),d=Object.freeze({target:c,containerItemID:o,context:s,containerName:l}),u=n?.data?.caseInfo?.content,p=n?.uiResources?.root?.config?.name,h=n?.uiResources?.root?.config?.context;u&&!u.pyViewName&&p&&"page"!==t.viewType&&(Dh.setIn(u,"pyViewName",p),Dh.setIn(u,"pyViewContext",h));const f=Lm(n),g={acName:c,...d};await Vc(f,t,g);const m=kc(f,{...d,headers:a});n?.nextAssignmentInfo||(m.caseViewMode=j.REVIEW_MODE),Dc(e,r),m.doDeleteCaseSummary=t.doDeleteCaseSummary,m.resourceType=Dy.ASSIGNMENT,Pc(m,f),Tc(m.data,t);const y=f.data?.caseInfo?.stages,E=f.data?.caseInfo?.stageID;return uc({caseID:Sc(f),isModalAction:i,stages:y,stageID:E}),vc(o)&&tl(m,r),r.push(mf(nf,m)),Zc(r),r})),Zl((()=>(gh(r),Oc(r,n),r=[],r))))))))},wy=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:a}=Ff("deleteCaseInCreateStage",{ID:t});return hi(ki(r,{method:a},n)).pipe(Zl((t=>({response:t.data,actionInPayload:e,headers:jc(t.headers)}))),cd(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},My=e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},Ly=(e,t)=>{let n,r=0,a=[];return e.pipe(Jl(Hl),Zl((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),ed((e=>e.ignoreCaseDeletion?ad({actionInPayload:e}):wy(e))),ed((async e=>{if(e&&yc(e.type)){const{payload:t}=e,n=Hc({...e,...t,actionMgrID:r});return a.push(n),a}const{actionInPayload:n}=e,{context:o,isModalAction:s}=n,i=s?du.MODAL:du.PRIMARY,c=yt(i,o);if(!s&&c){const e={acName:c,target:c,context:o},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 Vc({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:j.PRIMARY,isChild:!0},t={type:de,payload:{...e}};a.push(t)}const l={target:c,containerItemID:o,context:o,caseDeleted:!0};return a.push(mf(lf,l)),a})),Zl((()=>(gh(a),Oc(a,r)===j.PROMISE_VALUE.RESOLVE&&My({caseType:n}),a=[],a))))},Fy=(e,t)=>{const{assignmentID:n,actionID:r,context:a}=e,{restApi:o,reqType:s}=Ff("save",{assignmentID:n,actionID:r}),{content:i}=Uc(a),c=t.value.data[a]?.caseInfo?.headers;return hi(ki(o,{method:s,body:i,headers:{"if-match":c&&c.etag}},a)).pipe(Zl((t=>({response:t.data,actionInPayload:e,headers:jc(t.headers)}))),cd(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",a))},jy=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:a}=e;let o=[];return ad(n.payload).pipe(ed((e=>Fy(e,r))),ed((e=>{if(e&&yc(e.type))return ad(e);const{containerItemID:t}=e&&e.actionInPayload,r=W(t),a=Vu(r),s=pu(a),i=Ou(r)[0];let c=i?Su(Ou(r)[0]):r;if(!Du(Vu(c))){const t=pu(i);t?.accessedOrder.forEach((n=>{e.actionInPayload.caseID===t.items[n].key&&(c=t.items[n].context)}))}const l=Su(a);n.payload.canUpdateAvailableActions&&Mm(e.response);if(c&&o.push(mf(Bh,{context:c,data:{caseInfo:{headers:e.headers}}})),s?.items?.[l]?.key===e?.actionInPayload?.caseID){const n={context:r,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},a=wc.getPropertiesToReplace(t);o.push(mf(Bh,n,{propertiesToReplace:a})),o.push(mf(nf,{context:t}))}return Dc(e,o),e.actionInPayload.RemoteSystemID=V.getRemoteHeaderByContext(e.actionInPayload.context)??void 0,Py(e.actionInPayload)})),ed((async n=>{if(n&&yc(n.type)){const{payload:t}=n,r=Hc({...n,...t,actionMgrID:a});o.push(r);const s=e.action.payload.modalLoadingContainer;if(s){const e=s.context,{context_data:t}=mh(e)||{};t?.isLoading&&Bu(e)}return o}const{actionInPayload:r}=n,{context:s,containerName:i}=r,c={target:yt(i,s),containerItemID:s,context:s};return t||o.push(mf(lf,c)),o})),Zl((()=>(gh(o),Oc(o,a),t||(o=[]),o))))},Uy=(e,t)=>{let n,r=0;return e.pipe(Jl(ql),Ql((e=>{const{saveOnly:a}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return jy({action:e,state$:t,actionMgrID:r,caseType:n},a)})))},ky=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",yi.unsubscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,r="expressLocalActionSubmit",yi.subscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,r)}var n,r},{LOCAL_ACTION_TYPE:Vy}=j,{RESOURCE_TYPES:By}=F,Gy=(e,t)=>{const{actionID:n,assignmentID:r,caseID:a,context:o,openActionType:s,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,d=l?Ye:(e=>{const t=e.localActionType.toLowerCase();return t===Vy.CASE_WIDE||t===Vy.EXPRESS?Ke:qe})(e),u=Lc.FORM,{reqType:p}=Ff(d,{caseID:a,ID:r,actionID:n,viewType:u});let{restApi:h}=Ff(d,{caseID:a,ID:r,actionID:n,viewType:u});e.actionType=d===Ke?j.CASE:j.ASSIGNMENT,h&&!h.includes("viewType=")&&(h=h.includes("?")?`${h}&viewType=${u}`:`${h}?viewType=${u}`);const f=i?.context??o;return hi(ki(h,{method:p,headers:c},f)).pipe(Zl((t=>({response:t.data,actionInPayload:e,headers:jc(t.headers)}))),cd(`: Error occurred during ajax call at ${s} Epic : `,f))},Wy=(e,t)=>{const{isProcessAction:n}=t,r=n?Ye:qe;e.openActionType=r;let a;if("modal"===hc(r,e)){a=Ou(e.contextName)[0]?Ou(e.contextName):Vu(e.contextName);const n=a?Su(a):e.contextName,r=vu(n),o=hc(e.openActionType,e),s=yt(o,e.context),i=z(e.context,H(o,e.context));if(gh(Xh({target:s,context:i,containerItemID:i,key:e.caseID,caseViewMode:j.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:j.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}}})),gh(rf({context:i})),e.modalLoadingContainer={target:s,context:i},!Ou(e.contextName)[0])return Gy(e,t);if(!e.continueExecution)return Gy(e,t);if(!Fl(r))return Gy(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return hi([Yl(e.saveActionPayload)]).pipe(ed((e=>(e=>{let t,n=0;const r=[],a={value:fh()?.getState()};return ad(e).pipe(Jl(ql),Ql((e=>{const{isFormValid:o}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!o){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,e),ad([])}return jy({action:e,state$:a,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),ed((n=>{if(1===n.length&&yc(n[0].type)){const{continueExecution:n}=Xc(a);if(!n)return un.rejectActionByID(e.actionMgrID),sd.pipe(fi((()=>id()))).toPromise();if(n)return Gy(e,t)}return Gy(e,t)})),Zl((e=>e)))}return Gy(e,t)},Hy=async(e,t,{headers:n,actionInPayload:r})=>{const{context:a,actionName:o,openActionType:s,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=Lm(e),d=hc(s,r),u=c?.target??yt(d,a);let p,h,f=!1;!wu(u)||xu(u)&&!yu(u,e.data.caseInfo.ID)?(h=H(d,a),mc(d)&&(h=z(a,h)),p=h,f=!0):(p=xu(u)?Eu(u,e.data.caseInfo.ID):Su(u),h=vu(p));const g={acName:u,target:u,containerName:d,context:h};await Vc(l,r,g),(void 0===l?.data?.caseInfo?.content||void 0!==l.data.caseInfo.content&&"object"==typeof l.data.caseInfo.content&&0===Object.keys(l.data.caseInfo.content).length)&&delete l.data?.caseMessages;const m=l.uiResources?.root;let y;y=m?j.PERFORM_MODE:j.REVIEW_MODE;const E=kc(l,{target:u,context:h,containerItemID:p,caseViewMode:y,doDeleteCaseSummary:i,headers:n,actionName:o,isMinimizable:!1,isInCreateStage:mc(d),resourceType:By.ASSIGNMENT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,assignmentID:r.assignmentID,actionType:r.actionType});m&&Pc(E,l),mc(d)&&delete E.doDeleteCaseSummary,r.openActionType===ze&&(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);const I=f?Xh:nf;if(E.data.context_data.isProcessAction=r.isProcessAction,t.push(mf(I,E)),f||t.push(mf(af,E)),f){const a=Ou(r.contextName),o=Eu(a,e.data.caseInfo.ID);if(o){const e={data:{caseInfo:{headers:n}},context:o};t.push(mf(Bh,e))}}return p!==Su(u)&&t.push(mf(sf,{target:u,containerItemID:p})),vc(p)&&!c?.context&&tl(E,t),E.caseViewMode===j.REVIEW_MODE&&t.push(mf(lf,E)),t},qy="OPEN_LOCAL_ACTION",Yy=(e,t)=>Wy(e,t),Ky=e=>{let t=0,n=[];return e.pipe(Jl(qy),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>Yy(e,{actionMgrID:t}))),ed((async e=>{if(!e)return sd;if(yc(e.type)){const t=Hc(e);n.push(t);const{context_data:r}=mh(e.payload.context)||{};return r?.isLoading&&n.push(mf(af,e.payload)),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:o}=t;return Dh.setIn(a,"data.caseInfo.activeActionID",o),Dh.setIn(a.data,j.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&Dh.setIn(a.data,j.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await Hy(a,n,{headers:r,actionInPayload:t}),ky(t),n})),Zl((()=>(gh(n),Oc(n,t),n=[],n))))},zy=e=>{const{actionID:t,context:n,openActionType:r,caseTypeID:a,bulkContextID:o="",bulkContextType:s=""}=e,i=ze,{reqType:c,restApi:l}=Ff(i,{caseTypeID:a,actionID:t,bulkContextID:o,bulkContextType:s});return hi(ki(l,{method:c},n)).pipe(Zl((t=>({response:t.data,actionInPayload:e,headers:jc(t.headers)}))),cd(`: Error occurred during ajax call at ${r} Epic : `,n))},Xy=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",yi.unsubscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,r="bulkActionSubmit",yi.subscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n,r)}var n,r},Jy="OPEN_BULK_ACTION",Qy=e=>{let t=0,n=[];return e.pipe(Jl(Jy),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=ze;const a=hc(ze,e),o=yt(a,n),{continueExecution:s}=Xc(o);return s?zy(e):(un.rejectActionByID(r),id())})(e,{actionMgrID:t}))),ed((async e=>{if(e&&yc(e.type)){const t=Hc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:o}=t;return Dh.setIn(a,"data.caseInfo.activeActionID",o),await Hy(a,n,{headers:r,actionInPayload:t}),Xy(t),n})),Zl((()=>(1===n.length&&yc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),gh(n),n=[],n))))};var Zy=Array.isArray,eE=Object.getPrototypeOf,tE=Object.prototype,nE=Object.keys;function rE(e){if(1===e.length){var t=e[0];if(Zy(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&eE(r)===tE){var n=nE(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var aE=Array.isArray;function oE(e){return Zl((function(t){return function(e,t){return aE(t)?e.apply(void 0,ms([],gs(t))):e(t)}(e,t)}))}function sE(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Cs(nd(e))?e.pop():void 0}(e),r=rE(e),a=r.args,o=r.keys,s=new Ks((function(e){var t=a.length;if(t)for(var n=new Array(t),r=t,s=t,i=function(t){var i=!1;ri(a[t]).subscribe(ii(e,(function(e){i||(i=!0,s--),n[t]=e}),(function(){return r--}),void 0,(function(){r&&i||(s||e.next(o?function(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}(o,n):n),e.complete())})))},c=0;c<t;c++)i(c);else e.complete()}));return n?s.pipe(oE(n)):s}const iE=e=>{const{actionID:t,context:n,cases:r,classID:a}=e,{content:o}=Uc(n,{nonEmptyAndChangedData:!0});let s=5;try{const e=cc.getSharedState("D_pySingleExecutionBulkActionsMeta.D_pySingleExecutionBulkActionsMeta.pxResults");e?.find((e=>e.pyClassName===a))?.pyList.split(",").includes(t)&&(s=1)}catch(e){console.error('Failed to fetch to "D_pySingleExecutionBulkActionsMeta" DP response',e)}const i=r.map((e=>({ID:e}))),c=i.length/s,l=Xe,{reqType:d,restApi:u}=Ff(l,{actionID:t}),p=[],h=i.length;for(let t=0;t<h;t+=c)o.cases=i.slice(t,t+c),o.cases.length&&p.push(hi(ki(u,{method:d,body:o},n)).pipe(Zl((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:jc({...r})}})),cd("Error occurred during ajax call at submitbulkaction Epic : ",n)));return sE(p)},cE=e=>{yi.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},lE="SUBMIT_BULK_ACTION",dE=e=>{let t,n=0,r=[],a="";return e.pipe(Jl(lE),Ql((e=>{const{isFormValid:o}=e.payload;if(({actionMgrID:n}=e.payload),!o){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,e),ad([])}return ad(e.payload).pipe(ed((e=>(t=e,iE(t)))),ed((e=>{let n=0,o=0;const s=[],{containerItemID:i,context:c}=t;return e.map((e=>{const{response:t}=e;n+=Number(t.successCount),o+=Number(t.failureCount),o&&t.results.map((e=>{"200"!==e.status&&e.error&&e.error.errorDetails&&e.error.errorDetails.forEach((t=>{s.push({ID:e.BusinessID,message:t.localizedValue})}))}))})),a=`${n} record(s) updated`,cE({submitResponse:e}),t.target="HYBRID"===Ap.getRenderingMode()?Vu(i):`${j.APP.APP}/${du.MODAL}`,r.push(mf(lf,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),o&&r.push(mf(cf,{messages:[{type:"error",message:1===o?"1 record failed to update":`${o} records failed to update`,errorDetails:s,showHeader:!1}],context:W(c)||c,category:"HTTP",showHeader:!1})),r})),Zl((()=>(un.resolveActionByID(n,a),gh(r),r=[],r))))})))},uE=e=>{const{actionID:t,context:n,cases:r}=e,{content:a}=Uc(n,{nonEmptyAndChangedData:!0});a.cases=r.map((e=>({ID:e})));const o=Xe,{reqType:s,restApi:i}=Ff(o,{actionID:t,runningMode:"async"});return hi(ki(i,{method:s,body:a},n)).pipe(Zl((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:jc({...r})}})),cd("Error occurred during ajax call at submitbulkaction Epic : ",n))},pE=e=>{yi.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},hE="SUBMIT_BULK_ACTION_ASYNC",fE=e=>{let t,n=0,r=[],a="";return e.pipe(Jl(hE),Ql((e=>{const{isFormValid:o}=e.payload;if(({actionMgrID:n}=e.payload),!o){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,e),ad([])}return ad(e.payload).pipe(Ql((e=>(t=e,uE(t)))),Zl((e=>{const n=[],{containerItemID:o,context:s}=t,{response:i}=e,c=Number(i.failureCount)||0;return c>0&&i.results.forEach((({status:e,error:t,BusinessID:r})=>{"200"!==e&&t&&t.errorDetails&&t.errorDetails.forEach((({localizedValue:e})=>{n.push({ID:r,message:e})}))})),a="Processing bulk actions",pE({submitResponse:i}),t.target=`${j.APP.APP}/${du.MODAL}`,r.push(mf(lf,{containerItemID:o,context:s,target:t.target,skipReleaseLockRequest:!0})),c&&r.push(mf(cf,{messages:[{type:"error",message:1===c?"1 record failed to update":`${c} records failed to update`,errorDetails:n,showHeader:!1}],context:W(s)||s,category:"HTTP",showHeader:!1})),r})),Zl((()=>(un.resolveActionByID(n,a),gh(r),r=[],r))))})))},gE=(e,t)=>Wy(e,t),mE=e=>{let t=0,n=[];return e.pipe(Jl(Gl),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>(Zn(e.context),gE(e,{actionMgrID:t,isProcessAction:!0})))),ed((async e=>{if(e&&yc(e.type)){const t=Hc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:a}=e;return await Hy(a,n,{headers:r,actionInPayload:t}),n})),Zl((()=>(nl(n),Oc(n,t),n=[],n))))},yE=e=>{let t=0,n=[];return e.pipe(Jl(Se,we),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>{const{containerItemID:t,caseID:n,context:r,caseDeleted:a,skipReleaseLockRequest:o,currentCaseViewMode:s,isProcessAction:i,isInCreateStage:c}=e,l=s===j.PERFORM_MODE,d=n&&l;return i&&c?Py(e):t!==r||a||o||!d?t?.includes(j.MODAL)&&xc(cp(t))===j.REVIEW_MODE?Py(e):ad([]):Py(e)})),ed((e=>(e&&yc(e.type)&&n.push(Hc(e)),n))),Zl((()=>(gh(n),Oc(n,t),n=[],n))))};var EE=new pg(cg),IE=EE;function AE(e,t,n){void 0===e&&(e=0),void 0===n&&(n=IE);var r=-1;return null!=t&&(td(t)?n=t:r=t),new Ks((function(t){var a,o=(a=e)instanceof Date&&!isNaN(a)?+e-n.now():e;o<0&&(o=0);var s=0;return n.schedule((function(){t.closed||(t.next(s++),0<=r?this.schedule(void 0,r):t.complete())}),o)}))}function CE(e,t){return void 0===e&&(e=0),void 0===t&&(t=EE),e<0&&(e=0),AE(e,e,t)}function _E(e){return si((function(t,n){var r=!1,a=null,o=null,s=function(){if(null==o||o.unsubscribe(),o=null,r){r=!1;var e=a;a=null,n.next(e)}};t.subscribe(ii(n,(function(t){null==o||o.unsubscribe(),r=!0,a=t,o=ii(n,s,Ds),ri(e(t)).subscribe(o)}),(function(){s(),n.complete()}),void 0,(function(){a=o=null})))}))}const SE=(e,t,n,r,a)=>{if(a!==j.RESOURCE_STATUS.CREATE)return;il.isStateMachineExist(e,t,n)||il.setStateMachine(e,n,t,new lr(n,t,e));il.getStateMachine(e,t,n).insert({},r+1,!0,{isDefault:!0})},bE=e=>{const{context:t}=e;let n={...Uc(t).content,contextData:!1};const r=al(t);Dh.isEmpty(r)||(n=rl(r,n));const{restApi:a,reqType:o}=Ff("refreshCaseView",e);return n.interestPage=e.interestPage,hi(ki(a,{method:o,body:n},t)).pipe(Zl((t=>({actionInPayload:e,response:t.data,headers:jc(t.headers)}))),cd(": Error occurred during ajax call : ",t))},NE=e=>{let t=0,n=[],r="";return e.pipe(Jl(ht),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>bE(e))),ed((async e=>{if(e&&e.type===Ie)return n.push(Hc(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:a}=e,o=t.containerName,s=yt(o,t.context);let i=Yc(s,o,t.context);i=z(t.context,i);const c=Lm(a);c.key=t.ID,c.data?.caseInfo&&(c.data.caseInfo.ID=t.ID);const l={isMultiRecordData:!0,viewName:t.viewID,parentContext:t.context,interestPage:t.interestPage};c.uiResources.context_data.modalView=l;const d=mh(t.context)?.context_data?.caseInfo,u=`${t.pageReference}${t.targetProperty}`,p=Hn(d,u.replace(j.CASE_INFO.CASE_INFO_CONTENT,"").slice(1),t.index);c.uiResources.context_data.caseInfo={...c.uiResources.context_data.caseInfo,content:Dh.mergeDeep(c.uiResources.context_data.caseInfo?.content,p?.content)};const h=Lh.getProperty(".RemoteSystemID",j.CASE_INFO.HEADERS,t.context),f={acName:s,context:i};await Vc(c,t,f);const g={target:s,context:i,containerItemID:i};h&&(g.headers={RemoteSystemID:h});const m=kc(c,g);m.resourceStatus=t.actionType,m.isMultiRecordData=!0,m.parentContext=t.context,m.heading=t.heading;const y=qc(s,m);return r=i,n.push(y),Zc(n),{actionsOut:n,actionInPayload:t}})),Zl((({actionInPayload:e})=>(Ec(n)?un.rejectActionByID(t):un.resolveActionByID(t),e.skipPageInstructions||SE(r,e.pageReference,e.targetProperty,e.index,e.actionType),gh(n),n=[],n))))},vE=e=>{let t,n="",r=[];return e.pipe(Jl(ft),Ql((e=>{t=e.payload;const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,t),Jt.handleDeferredActionCompletion(e.payload.context),ad([])}return ad(e.payload).pipe(ed((e=>(t=e,bE(t)))),ed((async e=>{if(e&&e.type===Ie){const t=Hc(e);return r.push(t),r}const{containerItemID:n,context:a}=t;var o,s,i,c;return o=a,s=t.parentContext,i=F.CASE_INFO.CASE_INFO_CONTENT,c=!1,yr(o).forEach((e=>{const t=Dh.convertClipboardPageToPageRefNotation(e.target);il.isStateMachineExist(s,i,t)||il.setStateMachine(s,t,i,new lr(t,i,s));const n=il.getStateMachine(s,i,t);switch(e.instruction.toLowerCase()){case"insert":n.insert(e.content,e.listIndex,c,{});break;case"update":n.update(e.content,e.listIndex,c,{});break;case"delete":e.listIndex?n.delete(e.listIndex,c):n.deletePage();break;case"replace":n.replacePage(e.content);break;case"move":n.move(e.listIndex,e.listMoveToIndex);break;case"delete all":n.deleteAll()}})),r.push(mf(lf,{containerItemID:n,context:a,target:t.target,skipReleaseLockRequest:!0})),r})),Zl((()=>{if(Ec(r))un.rejectActionByID(n),Jt.handleDeferredActionCompletion(t.context);else{un.resolveActionByID(n),Jt.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload;if(Lh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext)){const e=Lh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,r,t.parentContext),n=Lh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,r,t.parentContext),a=t.pageReference?.substring(0,t.pageReference?.lastIndexOf(".")),o=a.replace(j.CASE_INFO.CASE_INFO_CONTENT,"");xn(e,n,t.parentContext,o,{})}else Fn(t.parentContext,j.CASE_INFO.CASE_INFO_CONTENT,{})}return gh(r),r=[],r})))})))},PE=e=>{const{caseID:t,headers:n,debugInfo:r,context:a}=e,o=Ff("getDescendants",{caseID:t}),{restApi:s}=o,{reqType:i}=o;return hi(ki(s,{method:i,headers:{...n,...r&&{...Ri.addDebugHeaders(r)}}},a)).pipe(Zl((t=>({actionInPayload:e,response:t.data,headers:jc({...n,...t.headers})}))),cd("Error ocurred during ajax call at getDescendants Epic : ",a))},TE=e=>{let t=0,n=[];return e.pipe(Jl(kd),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>PE(e))),ed((async e=>{if(e&&yc(e.type))return n.push(Hc(e)),n;const{actionInPayload:t,response:r}=e,a={};Dh.setIn(a,"caseInfo.childCases",r?.childCases??[]);const o={data:a,context:t?.context};return n.push(mf(Bh,o)),n})),Zl((()=>(gh(n),Oc(n,t),n=[],n))))},OE=[Qm,sy,uy,Ky,Qy,dE,fE,mE,Ny,xy,Oy,yE,Uy,Ly,e=>e.pipe(Jl(He),_E((()=>CE(100))),Zl((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:r,isProcessAction:a,isDataObject:o,skipReleaseLockRequest:s,isInCreateStage:i}=e.payload;return un.resolveActionByID(t),yi.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:r,hideDelete:!a&&n,isDataObject:o,skipReleaseLockRequest:s,isInCreateStage:i}),[]}))),e=>e.pipe(Jl(Me),_E((()=>CE(100))),Zl((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:a}=e.payload,o=yt(r,n);return un.resolveActionByID(t),gh(mf(sf,{containerItemID:a,target:o,doDeleteCaseSummary:!1})),[]}))),NE,vE,TE];function $E(){return si((function(e,t){e.subscribe(ii(t,Ds))}))}const{RESOURCE_TYPES:RE}=F,DE=[e=>e.pipe(Jl(te),Zl((e=>e.payload)),ed((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===du.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=yt(du.PREVIEW,e.context),n=Yc(t,du.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);gh(Xh({...e,context:n,target:t,containerItemID:n,key:r,caseViewMode:j.REVIEW_MODE,root:{type:"reference",config:{context:j.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(V.isRemoteCase(t.caseClassName)){const{RemoteSystemID:e}=V.getRemoteCase(t.caseClassName);n.RemoteSystemID=e}let{restApi:r,reqType:a}=Ff("loadView",t);return e.viewContext===RE.PAGE&&({restApi:r,reqType:a}=Ff(je,{page:e.viewName,pageClass:e.pageClass})),hi(ki(r,{method:a,headers:n},e.context)).pipe(Zl((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:jc(t.headers),rootView:Dh.getIn(r,j.ROOT)}})),cd(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),ed((async e=>{const t={};if(e?.type===Ie){if(t.actionsOut=Hc(e),e?.payload?.context?.includes(du.PREVIEW)){const n={...mh(e.payload.context),caseInfo:{progress:!1,error:!0}},r=yt(du.PREVIEW,e.payload.context);t.actionsOut=mf(nf,{key:n.key,target:r,containerName:du.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:o,containerName:s}=n,{target:i,context:c}=(e=>{const{containerName:t,updateData:n,viewLoadingContainer:r}=e,a=t||dc.getTargetViewContainerName(je),o=r?.target??yt(a,e.context);return{target:o,context:r?.context??(t===du.PREVIEW&&n?e.context:Yc(o,a,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let d={};d=Lm(r),d.directUrlUpdation=!1,await Vc(d,n,l);const u={...n,target:i,context:c,containerItemID:o||c,headers:a},p=kc(d,u);if(p.resourceType=RE.CASE,s&&!p.updateData){p.caseViewMode=j.REVIEW_MODE;const e=Vu(p?.context);((e,t,n,r,a)=>{e&&a===du.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,r.actionsOut=mf(nf,{...n,containerName:a})):e?(r.actionsOut=[],r.actionsOut.push(mf(sf,{target:t,containerItemID:e}))):r.actionsOut=mf(Xh,{...n,containerName:a})})(Eu(e,p.key),e,p,t,s)}else p.preserveClientChanges=!0,t.actionsOut=[],s===du.PREVIEW&&t.actionsOut.push({type:ot,payload:{context:c}}),((e,t)=>{if(e.key){const n=Vu(e?.context);Eu(n,e.key)&&t?.actionsOut?.push(mf(Bh,e))}else t?.actionsOut?.push(mf(Bh,e))})(p,t)}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:r,viewName:a}=e.actionConfig;return"pyCasePreview"===a&&(e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:r}),t})),Zl((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(un.resolveActionByID(n,e),t)))),e=>{let t=0,n=[];return e.pipe(Jl(ne),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>{yi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:r,viewName:a,className:o,skipSemanticUrl:s=!1,containerName:i=dc.getTargetViewContainerName(je)}=e,c=n&&{...Ri.addDebugHeaders(n)},l=yt(i,r);let d="",u={},p=!0;if(!s){if(d=Mf(je,{page:a,pageClass:o}),l&&d){const{activate:t,activateContainerActionPayload:n}=Qc(RE.PAGE,l,{semanticURL:d});if(t)return(e=>{e?.containerItemID&&cc.updateState(e.containerItemID,"traditionalGadgetId",wc.getUniqueGadgetId(),{skipDirtyValidation:!0})})(n),ad({type:Re,activateContainerActionPayload:n,actionConfig:e})}if(Su(l)&&({continueExecution:p,removeActionPayload:u}=Xc(l)),!p)return un.rejectActionByID(t),id()}const{restApi:h,reqType:f}=Ff(je,{page:a,pageClass:o});return hi(ki(h,{method:f,headers:c},r)).pipe(Zl((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:d,semanticURL:d},actionConfig:e,headers:jc(t.headers),removeActionPayload:u,skipSemanticUrl:s}})),cd(": Error ocurred during ajax call at showPage Epic : ",e.context))})),ed((async e=>{if(e&&e.type===Ie)return n.push(Hc(e)),n;let{type:t}=e;const{actionConfig:r,skipSemanticUrl:a}=e,o=r.containerName||dc.getTargetViewContainerName(ne),s=yt(o,r.context);yi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className});const{remoteCasePayload:i,updatedType:c}=((e,t,n,r)=>{let a={},o=e;if(n.isTraditionalRemoteCase){a={...n};const e=Eu(r,a.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},o=Re)}return{remoteCasePayload:a,updatedType:o}})(t,e,r,s);if(t=c??t,t===Re){const{activateContainerActionPayload:{semanticURL:t,containerItemID:a}}=e,o={acName:s,context:vu(a)};r.isTraditionalRemoteCase||await Vc({directUrlUpdation:!0,semanticURL:t},r,o,!0),n.push(mf(sf,{target:s,containerItemID:a}))}else{const t=Yc(s,o,r.context),{response:c,headers:l={},removeActionPayload:d}=e,u=Lm(c,{isCreateDataObject:r.isCreateDataObject});u.directUrlUpdation=!a;const p={acName:s,context:t},h=xc(t);await Vc(u,r,p);const f={target:s,context:t,containerItemID:t,headers:l,debugInfo:r.debugInfo,currentCaseViewMode:h},g=kc(u,f);g.resourceType=F.PAGE,r.isCreateDataObject&&(g.resourceType=F.RESOURCE_TYPES.DATA,g.resourceStatus=F.RESOURCE_STATUS.CREATE,delete g.data.caseInfo),((e,t,n)=>{e.isTraditionalRemoteCase&&(n.resourceType=F.CASE,n.key=wc.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:Ac(wc.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=!0,n.className=t.className)})(r,i,g),g.data??={},g.data.traditionalGadgetId=wc.getUniqueGadgetId();const m=qc(s,g);d.containerItemID&&Kc(m)&&n.push(mf(lf,{containerItemID:d.containerItemID,target:s})),n.push(m),Zc(n)}return yi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:s,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),n})),Zl((()=>{un.resolveActionByID(t),gh(n),n=[]})),$E())}];const xE=(e,t)=>{const{context:n,pageName:r,dataContext:a,dataContextParameters:o,semanticURL:s,skipSemanticUrl:i,RemoteSystemID:c}=e,{removeActionPayload:l}=t,{restApi:d,reqType:u,body:p}=Ff(Ue,{pageName:r,dataContext:a,dataContextParameters:o}),h={};return h.RemoteSystemID=c,hi(ki(d,{method:u,headers:h,body:p},n)).pipe(Zl((t=>({response:{...t.data,key:s,semanticURL:s},actionConfig:e,headers:jc(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),cd("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:wE}=F,ME=e=>{const{dataViewName:t,context:n,dataViewParameters:r}=e,a={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(r))},{restApi:o,reqType:s}=Ff("deleteDataObject",a);return hi(ki(o,{method:s},n)).pipe(Zl((t=>({response:t.data,actionInPayload:e}))),cd("Error occurred during ajax call at deleteDataObject Epic",n))},LE=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,a={data_view_ID:t},{restApi:o,reqType:s}=Ff("getDataObjectActions",a);return hi(ki(o,{method:s,body:{dataViewParameters:n}},r)).pipe(Zl((e=>({...e.data}))),cd("Error occurred during ajax call at GET data object actions : ",e.context))},FE=[e=>{let t,n=0,r=[];return e.pipe(Jl(re),(a=e=>(({actionMgrID:n}=e.payload),ad(e.payload).pipe(ed((e=>((e,t)=>{const{context:n,pageName:r,dataContext:a,dataContextParameters:o,skipSemanticUrl:s=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l,containerName:d,RemoteSystemID:u}=e,p=yt(d,n);let h="",f={},g=!1;if(!s){h=Mf(Ue,{pageName:r,dataViewName:a},o);const{activate:n,activateContainerActionPayload:s}=Qc(wE.PAGE,p,{semanticURL:h});if(n)return ad({type:Re,activateContainerActionPayload:s,actionConfig:e});if(({continueExecution:g,removeActionPayload:f}=Xc(p)),!g)return un.rejectActionByID(t),id()}return xE({context:n,pageName:r,dataContext:a,dataContextParameters:o,semanticURL:h,skipSemanticUrl:s,containerName:d,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:u},{removeActionPayload:f})})(e,n))),ed((async e=>{if(e&&e.type===Ie)return r.push(Hc(e)),r;const{type:n,actionConfig:a,headers:o,response:s,skipSemanticUrl:i}=e;t=Dh.getIn(s,j.ROOT);const{containerName:c,parentAction:l,resourceType:d}=a,u=yt(c,a.context);let p;const h=xc(a?.context);if(a.isDeferLoaded){p=Lm(s),p.directUrlUpdation=!i;const t={acName:u,context:a.context};await Vc(p,a,t);const n={target:u,headers:o,context:a.context,containerItemID:e.containerItemID},c=kc(p,n);return r=mf(Bh,c),r}if(n===Re){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,o={acName:u,context:vu(n)};await Vc({directUrlUpdation:!0,semanticURL:t},a,o,!0),r.push(mf(sf,{target:u,containerItemID:n,resourceType:wE.DATA}))}else if("DATA"===d&&l===pt){const{context:e}=a,t=s?.data,n={context:e,data:t};r.push(mf(Bh,n))}else{const t=Yc(u,c,a.context),{removeActionPayload:n}=e;p=Lm(s),p.directUrlUpdation=!i;const l={acName:u,context:t};await Vc(p,a,l);const d=kc(p,{target:u,context:t,containerItemID:t,headers:o,currentCaseViewMode:h});d.resourceType=wE.DATA;const f=qc(u,d);n.containerItemID&&Kc(f)&&r.push(mf(lf,{containerItemID:n.containerItemID,target:u})),Zc(r),r.push(f)}return r})),Zl((()=>(un.resolveActionByID(n,t),gh(r),r=[],r))))),Cs(o)?ed(a,o,1):ed(a,1)));var a,o},e=>{let t=0,n=[];return e.pipe(Jl(it),ld(100),Ql((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(t,!0,e),ad([])}return ad(e.payload).pipe(ed((e=>dd(e))),ed((async e=>{if(e&&e.type===Ie){const{payload:r}=e,a=Hc({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r}=e,{containerItemID:a,isModalAction:o}=r,s=o?du.MODAL:du.PRIMARY,i={target:yt(s,a),containerItemID:a,context:a};return n.push(mf(lf,i)),n})),Zl((()=>(1===n.length&&yc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),gh(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(Jl(lt),ld(100),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>ud(e))),ed((async e=>{if(e&&e.type===Ie){const{payload:r}=e,a=Hc({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:o={}}=e,{containerName:s}=r,i=yt(s,r.context),c=Yc(i,s,r.context),l={acName:i,context:c};await Vc(a,r,l);const d=kc(a,{target:i,context:c,containerItemID:c,headers:o});return d.resourceType=F.RESOURCE_TYPES.DATA,d.resourceStatus=F.RESOURCE_STATUS.UPDATE,d.key=JSON.stringify(r.requestPayload),n.push(mf(Xh,d)),n})),Zl((()=>(1===n.length&&yc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),gh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Jl(dt),ld(100),Ql((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(t,!0,e),ad([])}return ad(e.payload).pipe(ed((e=>pd(e))),ed((async e=>{if(e&&e.type===Ie){const{payload:r}=e,a=Hc({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r}=e,{containerItemID:a,isModalAction:o}=r,s=o?du.MODAL:du.PRIMARY,i={target:yt(s,a),containerItemID:a,context:a};return n.push(mf(lf,i)),n})),Zl((()=>(1===n.length&&yc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),gh(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(Jl(ct),ld(100),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>ME(e))),ed((async e=>{if(e&&e.type===Ie){const{payload:r}=e,a=Hc({...e,...r,actionMgrID:t});return n.push(a),n}return[]})),Zl((()=>(1===n.length&&yc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),gh(n),n=[],n))))},e=>{let t=0,n=[];let r={};return e.pipe(Jl(ye),ld(100),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>LE(e))),ed((async e=>e&&e.type===Ie?(n.push(Hc(e)),n):(r=e,[]))),Zl((()=>(1===n.length&&yc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t,r),gh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Jl(ut),ld(100),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>hd(e))),ed((async e=>{if(e&&e.type===Ie){const{payload:r}=e,a=Hc({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:o={}}=e,{containerName:s,actionID:i,context:c,actionName:l}=r,d=yt(s,r.context);let u=H(s,c);u=z(c,u);const p={target:d,context:u,containerItemID:u,headers:o,resourceType:F.RESOURCE_TYPES.DATA,resourceStatus:F.RESOURCE_STATUS.OPEN_FLOW_ACTION,key:JSON.stringify(r.dataViewParameters),actionID:i,actionName:l},h={acName:d,context:c};await Vc(a,r,h);const f=kc(a,p);return n.push(mf(Xh,f)),n})),Zl((()=>(1===n.length&&yc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),gh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Jl(pt),ld(100),Ql((e=>{const{isFormValid:r}=e.payload;({actionMgrID:t}=e.payload);const a=e.payload.context;if(!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(t,!0,e),ad([])}return zn({context:a,stateObj:mh(a),clearContextMessages:!0}),ad(e.payload).pipe(ed((e=>fd(e))),ed((async e=>{if(e&&e.type===Ie){const{payload:r}=e,a=Hc({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:o={}}=e,{containerName:s,containerItemID:i,resourceType:c,key:l}=r,d=yt(s,r.context),u={acName:d,context:r.context};await Vc(a,r,u);const p={key:l,target:d,resourceType:c,containerItemID:i,headers:o,context:r.context};return n=((e,t,n,r)=>{const{resourceType:a,key:o,containerItemID:s}=r,i=kc(n,t);i.resourceType=a||F.RESOURCE_TYPES.DATA;const c=X(s);e.push(mf(lf,i));const l=Ih(".dataContext","dataInfo",c),d=Ih(".dataContextParameters","dataInfo",c),u={context:c,skipSemanticUrl:!0,resourceType:a,parentAction:pt,dataContext:l,dataContextParameters:d},p=l&&d&&Mf(Ue,{pageName:j.PY_DETAILS,dataViewName:l},d)||"";if(s?.includes(j.PREVIEW)){const t={type:re,payload:{pageName:j.VIEW_NAMES.PY_DATA_PREVIEW,container:j.PREVIEW,containerName:j.PREVIEW,...u}};e.push(t)}else if(a!==j.PAGE&&o===p&&s?.includes(j.PRIMARY)){const t={type:re,payload:{pageName:j.VIEW_NAMES.PY_DETAILS,containerName:"",...u}};e.push(t)}return e})(n,p,a,{key:l,resourceType:c,containerItemID:i}),n})),Zl((()=>(1===n.length&&yc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),gh(n),n=[],n))))})))}];function jE(e,t){return void 0===t&&(t=EE),si((function(n,r){var a=null,o=null,s=null,i=function(){if(a){a.unsubscribe(),a=null;var e=o;o=null,r.next(e)}};function c(){var n=s+e,o=t.now();if(o<n)return a=this.schedule(void 0,n-o),void r.add(a);i()}n.subscribe(ii(r,(function(n){o=n,s=t.now(),a||(a=t.schedule(c,e),r.add(a))}),(function(){i(),r.complete()}),void 0,(function(){o=a=null})))}))}const{RESOURCE_TYPES:{CASE:UE,DATA:kE}}=F;let VE=[],BE=!1;const GE={},WE=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return wm.apply(void 0,e.map((function(e){var n=e.apply(void 0,t);if(!n)throw new TypeError('combineEpics: one of the provided Epics "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})))};try{Object.defineProperty(n,"name",{value:"combineEpics("+e.map((function(e){return e.name||"<anonymous>"})).join(", ")+")"})}catch(e){}return n}(...Vm,...OE,...DE,...[e=>e.pipe(Jl(Ee),jE(200),Zl((e=>e.payload)),ed((e=>{BE=!1,yi.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{BE=!0}));const t=$i.getPreviewMode()&&Ri.addDebugHeaders({debugId:Dh.generateUniqueID()});GE.dataContext=e.payload.dataViewName,GE.dataContextParameters=e.payload.dataViewKeys;const{context:n,requestType:r,routeKey:a}=e;let{routeEndpoint:o}=e;o=o&&o.indexOf("viewType={viewType}")>0?o.replace("{viewType}","page"):o&&o.indexOf('viewType=""')>0?o.replace('viewType=""','viewType="page"'):o;const s=I()+o,i=e.options.context;let c;const l={},d=e?.payload?.caseClassName;if(V.isRemoteCase(d)){const{RemoteSystemID:e}=V.getRemoteCase(d);l.RemoteSystemID=e}if("POST"===r){c=e.payload,o.indexOf("viewType=")<0&&(o=`${o}?viewType=page`);let i;switch(el(a)){case UE:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case kE:i=GE;break;default:i=c}return hi(ki(s,{method:r,body:i,headers:{...l,...t}},n)).pipe(Zl((t=>({response:{...t.data},payload:e,headers:jc(t.headers)}))),cd(": Error occurred during ajax call at historyEpic : ",e))}return hi(ki(s,{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Zl((n=>({response:n.data,payload:e,headers:{...jc(n.headers),...t}}))),od((r=>{if(a===Je){const n={messages:[{type:"error",message:r.response.data.errorDetails[0].localizedValue}],category:"PAGE"};oc.setComponentCache("assignments-launchAssignment-Error",n);const a=bf(mp()),o=Ip.getEndPointInfo(a.split("/assignments")[0]),s=I()+o.routeEndpoint;return e={...e,routeKey:Be,resetSemanticURL:!0},hi(ki(s,{method:o.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Zl((n=>({response:n.data,headers:{...jc(n.headers),...t},payload:e}))))}return ad(yf(": Error occurred during ajax call at historyEpic : ",r,n))})))})),ed((async e=>{if(BE)return VE;if(yi.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{BE=!0})),e&&e.type===Ie)return Hc(e);const{headers:t={},response:n,payload:r}=e,a=Lm(n,{[F.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),o=r.options.acName,s=Du(o)&&wu(o)?Su(o):e.payload.options.context,i=s;t.RemoteSystemID=r?.payload?.RemoteSystemID;const c={target:o,context:s,containerItemID:i,headers:t,debugInfo:{debugId:t[j.COREHEADER_APP_DEBUG_ID]}};let l="";const d=r?.payload?.page;let u=r?.payload?.pageClass;r.payload&&r.payload.caseName&&r.payload.workID&&(l=Mf(Be,{caseName:e.payload.payload.caseName}),l=l&&l.replace("{workID}",e.payload.payload.workID)||"",u=r?.payload?.caseClassName),(r?.routeKey===Je||r?.resetSemanticURL)&&(e=>{const t=Sc(e);let n=Mf(Be,{caseClassName:Cc(e)},{id:t});n=n?.replace("{workID}",String(Ac(t))).replace("{id}",String(Ac(t))),Wf({semanticURL:n,directUrlUpdation:!0,options:{}})})(a),((e,t)=>{const n=t?.data?.caseInfo;e===Je&&n?.caseTypeID&&n?.content&&$c(n.caseTypeID)&&(n.content.coexistenceAction=Ge)})(r?.routeKey,a),yi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:d,pageClass:u});const p=Dh.getIn(a,j.LOCALE_REFERENCES);await Sp.loadLocaleResources(p);const h=Dh.getIn(a,j.COMPONENTS);h&&await Ur(h),wr(a,r.options.actionConfig,!0),yi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:o,pageName:d,pageClass:u});let f=kc(a,c);return f=((e,t,n)=>{if(e===Mc.CASE||e===Mc.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=Gc(t.caseInfo.assignments[0].ID);n.key=e||t.caseInfo.ID,n.flowName=r}else n.flowName="",n.key=t?.caseInfo?.ID||t.semanticURL;n.resourceType=e,n.semanticURL=t.semanticURL,e===Mc.ASSIGNMENT?(n.caseViewMode=j.PERFORM_MODE,n.resourceType=Mc.CASE):n.caseViewMode=j.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(el(e.payload.routeKey),{...n.data,semanticURL:l,caseViewMode:j.REVIEW_MODE},f),VE.push(qc(o,f)),((e,t)=>{let n=oc.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(mf(cf,n)),oc.resetComponentCache("assignments-launchAssignment-Error"))})(s,VE),Zc(VE),VE})),Zl((()=>(BE||gh(VE),VE=[],BE=!1,VE))),cd("Error occurred"))],...FE,...Bm,...[e=>{let t=0;return e.pipe(Jl(et),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),Zl((()=>{const e=fh()?.getState(),n=Dm();return h()(e,n)&&t>0?un.resolveActionByID(t,{}):un.rejectActionByID(t),[]})),$E())}],...[e=>{let t=0,n=[];return e.pipe(Jl(ae),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:r}=e;let a,o="";n||(o=Mf(ke,{insightID:"{insightID}"}),o=o.replace("{insightID}",r),a=Ip.getEndPointInfo(o));const{restApi:s,reqType:i}=Ff(ke,{...a?.payload||[],insightID:r});return hi(ki(s,{method:i},t)).pipe(Zl((t=>{let r={};return r="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...r,key:o,semanticURL:o},actionConfig:e,skipSemanticUrl:n}})),cd(": Error occurred during ajax call at showPage Epic : ",e.context))})),ed((async e=>{if(e&&e.type===Ie)return n.push(Hc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,a=dc.getTargetViewContainerName(ne),o=yt(a,t.context),s=Yc(o,a,t.context),{response:i}=e,c=Lm(i);c.directUrlUpdation=!r;const l={acName:o,context:s},d=!r,u=r;await Vc(c,t,l,d,u);const p=kc(c,{target:o,context:s,containerItemID:s});p.resourceType=F.PAGE;const h=qc(o,p);return n.push(h),Zc(n),n})),Zl((()=>{un.resolveActionByID(t),gh(n),n=[]})),$E())}],...[e=>{let t=0,n=[];return e.pipe(Jl(oe),Zl((e=>(({actionMgrID:t}=e.payload),e.payload))),ed((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:r}=e;let a="";n||(a=Mf(Ve,{dashboardID:r}),a=a.replace("{dashboardID}",r));const{restApi:o,reqType:s}=Ff(Ve,{dashboardID:r});return hi(ki(o,{method:s},t)).pipe(Zl((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}})),cd(": Error occurred during ajax call at showPage Epic : ",e.context))})),ed((async e=>{if(e&&e.type===Ie)return n.push(Hc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,a=dc.getTargetViewContainerName(ne),o=yt(a,t.context),s=Yc(o,a,t.context),{response:i}=e,c=Lm(i);c.directUrlUpdation=!r;const l={acName:o,context:s},d=!r,u=r;await Vc(c,t,l,d,u);const p=kc(c,{target:o,context:s,containerItemID:s});p.resourceType=F.PAGE;const h=qc(o,p);return n.push(h)})),Zl((()=>{un.resolveActionByID(t),gh(n),n=[]})),$E())}]),HE=()=>e=>t=>{const{type:n="",payload:r={}}=t||{},{category:a,context:o,transientItemID:s}=r;"HTTP"!==a&&[_e,De,Se,we,Ne,$e].includes(n)&&(dl(o||s),Tn.removeContextTreeNode(o||s)),e(t)},qE={},YE=e=>{const t=Dh.getIn(qE,[j.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),a=Dh.getIn(qE,[r,t],[]),o=a&&a.length>0&&a.indexOf(e);if(o>-1&&a.splice(o,1),!a||a&&0===a.length){Dh.deleteIn(qE,[r,t]);const e=Dh.getIn(qE,[r]);e&&0===Object.keys(e).length&&Dh.deleteIn(qE,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),Dh.deleteIn(qE,[j.CONTEXT,e]);const r=Dh.getIn(qE,[j.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&Dh.deleteIn(qE,[j.CONTEXT]),n.length>0&&gh(If({dataPagesToBeRemoved:n}))},KE=(e={},t)=>{Object.keys(e).forEach((n=>{const r=Dh.getIn(e,[n],{});Object.keys(r).forEach((e=>{((e,t,n)=>{const r=Dh.getIn(qE,[j.CONTEXT,n]);if(Dh.getIn(qE,[e])){const r=Dh.getIn(qE,[e,t],[]);Dh.setIn(qE,[e,t],[...new Set([...r,n])])}else Dh.setIn(qE,[e,t],[n]);r?Dh.setIn(qE,[j.CONTEXT,n],[...new Set([...r,t])]):Dh.setIn(qE,[j.CONTEXT,n],[t])})(n,e,t)}))}))},zE=()=>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===we||e===Se)&&t.forEach((e=>{YE(e)}))})(a,r),a===_e||a===ge||a===nt){const e=a===nt?t:t.shared;KE(e,n)}else a===we?(YE(n),KE(t.shared,n)):a===Se&&YE(n)})),e(t)},XE=e=>t=>n=>{const{type:r,payload:{target:a,containerItemID:o,context:s,childContainersContexts:i=[],containerInfo:{newAccessedOrder:c,containerType:l}={},eventName:d}={}}=n,{PUB_SUB_EVENTS:u}=F;if(r===Se){const{resourceType:t,key:n,context:r}=Dh.getIn(e.getState(),["containers",a,"items",o])||{},s={resourceType:t,key:n,context:r,containerItemID:o,...void 0!==d?{eventName:d}:{}};yi.publish(u.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,s),a===`${F.APP.APP}/${j.PRIMARY}`&&l===j.CONTAINER_TYPE.MULTIPLE&&yi.publish(u.CONTAINER_EVENTS.CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM,{key:n,newAccessedOrder:c})}i&&i.length>0&&(r===we||r===Se)&&i.forEach((e=>{Ud.cleanCaches(e)})),r!==we&&r!==Se||Ud.cleanCaches(s),t(n)},JE=()=>e=>t=>{const{payload:{context:n=null,transientItemID:r=null}={},type:a}=t;!n||a!==_e&&a!==De&&a!==we&&a!==Se||(Ir(n),mr(n)),r&&a===Te&&(Ir(r),mr(r)),e(t)},QE=function(e){void 0===e&&(e={});var t,n=new(0,hg.constructor)(hg.schedulerActionCtor),r=new gg,a=function(a){t=a;var o=new gg,s=new gg,i=o.asObservable().pipe(li(n)),c=new Eg(s.pipe(li(n)),t.getState());return r.pipe(Zl((function(t){var n=t(i,c,e.dependencies);if(!n)throw new TypeError('Your root Epic "'+(t.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})),ed((function(e){return hi(e).pipe(di(n),li(n))}))).subscribe(t.dispatch),function(e){return function(n){var r=e(n);return s.next(t.getState()),o.next(n),r}}};return a.run=function(e){r.next(e)},a}(),ZE=e=>{const t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||og;if(null!==fh())Oh();else{const n=rg(xm(e),t(Ig.reduxBatch,function(...e){return t=>(n,r)=>{const a=t(n,r);let o=()=>{throw new Error(Qf(15))};const s={getState:a.getState,dispatch:(e,...t)=>o(e,...t)},i=e.map((e=>e(s)));return o=og(...i)(a.dispatch),{...a,dispatch:o}}}(kl,HE,zE,JE,QE,XE),Ig.reduxBatch));QE.run(WE),hh(n)}},eI={publishConstellationLoadedEvent:()=>{yi.publish(j.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const tI=new class{activateContainerItemOnSwitch(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:Eu(t,e)};ou({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:Eu(t,e)};ou({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=ou({meta:{type:"PreviewViewContainer",config:{name:j.PREVIEW}},options:{context:j.APP.APP,target:"root/hybrid_preview"}}),r=n.getPConnect().getContainerManager();r.resetContainers({name:j.PRIMARY,context:j.APP.APP}),Cu(j.APP.APP,j.PREVIEW)||r.initializeContainers({type:"multiple",name:j.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){ou({}).getPConnect().getContainerManager().resetContainers({name:j.PREVIEW,context:j.APP.APP})}isFormDirty(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n=op(t,e);return sl.isStateModified(n)}getEventUtils(){return eI}getBroadcastUtils(){return Wm}isTraditionalUICase(e){return $c(e)}};const nI=class{static openCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?Ap.setDefaultCasePage(n.pageName):(Ap.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Ap.disableAssignmentHeader(n.disableAssignmentHeader):Ap.disableAssignmentHeader(!1),zd.openCase(e,t,j.PRIMARY,n)}static createCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?Ap.setDefaultCasePage(n.pageName):(Ap.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Ap.disableAssignmentHeader(n.disableAssignmentHeader):Ap.disableAssignmentHeader(!1),zd.createCase(e,t,j.PRIMARY,n)}static getNextWork(e=F.APP.APP,t={}){return t.renderInline=!0,t.pageName?Ap.setDefaultCasePage(t.pageName):(Ap.setDefaultCasePage(j.PY_DETAILS),t.pageName=j.PY_DETAILS),t?.disableAssignmentHeader?Ap.disableAssignmentHeader(t.disableAssignmentHeader):Ap.disableAssignmentHeader(!1),zd.getNextWork(e,j.PRIMARY,t)}static openAssignment(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?Ap.setDefaultCasePage(n.pageName):(Ap.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Ap.disableAssignmentHeader(n.disableAssignmentHeader):Ap.disableAssignmentHeader(!1),zd.openAssignment(e,t,j.PRIMARY,n)}static openPage(e,t,n=F.APP.APP,r={}){const a=ne;r?.defaultCasePage?Ap.setDefaultCasePage(r.defaultCasePage):Ap.setDefaultCasePage(j.PY_DETAILS),r?.disableAssignmentHeader?Ap.disableAssignmentHeader(r.disableAssignmentHeader):Ap.disableAssignmentHeader(!1);const o={viewName:e,className:t,acTargetName:j.PRIMARY,actionMgrID:un.getNextActionMgrId(),context:n},{promise:s}=un.actionManagerPromise(a,o.actionMgrID);return gh({type:a,payload:{...o}}),s}static getCurrentContextAPI(e,t=F.APP.APP){return ou({meta:{config:{}},options:{context:t,pageReference:e,containerName:j.PRIMARY}}).getPConnect()}};const rI=new class{createC11nEnv=e=>ou(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>Zt;getStateManager=()=>l;getActionCreators=()=>d;getStreamObservable=()=>a;getActionProcessor=()=>jh;getActionHandler=()=>Fh;renderApp=(e,t)=>{const n={context:j.APP.APP},r={...Dh.getIn(e,j.ROOT),options:n};ZE(e),wr(e,n,!0);const a=this.createC11nEnv({meta:r,isRoot:!0});yi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:a,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const r=Lm(e),{data:a,uiResources:o={}}=e,s=Dh.getIn(o,j.CONTEXT_DATA);await Vc(r,{},{},!1,!0);const i={...a,[j.CONTEXT_DATA]:s},{root:c}=o;Gu(c,t,i,n)};fetchEndPointResource=(e,t,n)=>{ki(e,{method:"GET"},j.APP.ROOT).then((async e=>{const{data:r,status:a}=e;200===a&&this.updateStoreWithUiRoot(r,t,n)}))};loadComponent=async(e,t,n)=>Ur(n).then((()=>{const n=this.createC11nEnv({meta:e,isRoot:!0});fh()||ZE({}),yi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:n,domContainerID:t})}));setStaticServerUrl=(e,t,n)=>{Lr.initServer(e,t,n)};loadView=async(e,t,n=[])=>{y();const r=Lm(e),a=Dh.getIn(r,j.VIEWS),o=Dh.getIn(r,j.NAVIGATIONS),s=Dh.getIn(r,j.COMPONENTS)||[];s.push(...n);const i=Dh.getIn(r,j.STATIC_SERVER_URL),c=Dh.getIn(r,j.APPLICATION_DATA);a&&Wp(a),o&&Hp(o),(e=>{e&&(Rf=e.pyLabel)})(c),i&&Lr.initServer(i),await Ur(s,i).then((()=>this.renderApp(r,t)))};initAppShell=(e,t,n)=>{Xf(e),dc.buildActionTargetMap(t),y(n)};initRoutingTable=(e,t)=>{Xf(e,!0),y(t)};setAppAlias=e=>{Lr.setAppAlias(e)};getHomeRestApi=e=>{const{restApi:t}=Lf("home",{portalName:e});return I()+t};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(Kf()&&!t){const t=gp(),r=Ip.processUrl(t,!0),a=Ip._getMatchedRouteInRoutingTable(r)||"",o=Ip.getRoutingInfo(),s=Ip.processUrl(t,!1).split("/"),i=s[s.length-1];let{caseID:c}=o&&o.routes[a].payload;c=c.replace("{workID}",i),n=Ip.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=Ip.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return I()+n};loadRootComponent=async(e,t,n=[],r,a,o)=>{const{config:{name:s}={}}=t;fh()||ZE({}),o&&(Zu(`${j.APP.ROOT}/${s}`),Qu().deleteContainerItem(`${j.APP.ROOT}/${s}`)),Qu().getContainerItems()?.length>1&&!s?.startsWith("hybrid_")&&"authoring-preview"!==s&&Oh(),gh(Bh({data:{},context:j.APP.ROOT}));const i=this.createC11nEnv({meta:t,options:{context:j.APP.ROOT,pageReference:"",target:`${j.APP.ROOT}/${s}`}}),c=i.getPConnect(),l=c.getContextName(),d=c.getContainerName(),u=c.getContainerManager();Su(`${l}/${d}`)||"noPortal"===t.config?.renderingMode||u.initializeContainers({type:"single"});const p=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference",...n];return Ur(p).then((()=>{yi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:i,domContainerID:e,componentName:"RootContainer",portalTarget:r,styleSheetTarget:a})}))};loadViewByName=(e,t,n,r)=>{let a=this.getViewRestApi(e,n);a===I()&&(a=this.getHomeRestApi(t)),this.fetchEndPointResource(a,r)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{zf(e)};checkIfSemanticURL=()=>Kf();onPCoreReady=e=>{yi.subscribe(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{yi.subscribe(F.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{$r.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{C(e)};setFetchDefaultHeaders=e=>{Hi(e)};setFetchAuthInfo=e=>{qi(e)};getCaseApi=()=>zd;getMashupApi=()=>nI;enableAppRouting=e=>{xf(e)};initStore=()=>ZE({});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()))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=ou({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}}}};const aI=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 oI=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.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=void 0===e.dynamicLoadComponents||e.dynamicLoadComponents,this.dynamicSemanticUrl=void 0===e.dynamicSemanticUrl||e.dynamicSemanticUrl,this.enableRouting=void 0===e.enableRouting||e.enableRouting,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 aI(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false"}},sI=async()=>{const e=Ap.getLocale(),t=Ap.getFeatureMap().localizationVersion||1;let n;if("en-US"!==e)try{let r;2===t?r=[e]:(r=[Sp.GENERIC_BUNDLE_KEY,Sp.MESSAGE_BUNDLE_KEY,Sp.FIELD_LABELS_BUNDLE_KEY,...Sp.getCaseTypeLocaleReferences()],n=await Sp.isCurrentLocalePackAvailable());const a=r.map((async r=>{2===t?await(async e=>{const t=Ap.getFeatureMap().availableLanguagePacks||[];if(!e||!t.includes(e))return void console.warn(`current locale ${e} is not supported by application.`);const n={locale:e},r=await Qi("getLocalizationPack",{queryPayload:n});if((201===r.status||200===r.status)&&r.data){const e=r.data;Object.keys(e).forEach((t=>{Sp.setLocaleForRule(e[t],t)}))}})(r):n&&await(async(e,t)=>{const n=await Lr.getSvcLocale(t,`${e}.json`);if(n?.ok&&e){const t=await n.json();Sp.setLocaleForRule(t,e)}})(r,e)}));await Promise.allSettled(a)}catch(e){console.warn(e)}},iI="@P .viewConfig";let cI=0;const lI=new class{#g(e,t,n){Xf(e),dc.buildActionTargetMap(t),y(n)}init(e){const t=new oI(e),n={...t.environmentInfo,renderingMode:t.renderingMode};xf(t.enableRouting),ZE({}),Ap.setTheme(t.theme),Ap.setCookieComplianceMethod(t.cookieComplianceMethod),Ap.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),$r.updateFieldDefaults(t.fieldDefaults),Ri.setDefaultHeaders(t.additionalHeaders),this.#g(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl}),Lr.setAppAlias(t.serviceConfig.appAliasWithoutServlet||t.serviceConfig.appAlias),C(t.serviceConfig.googleMapKey),Lr.initServer(t.serviceConfig.staticContentServer,t.serviceConfig.appStaticContentServer,t.tokens.C11NB2S),Sp.setTimezone(t.timezone),Ap.setEnvironmentInfo(n),Ap.setLocale(t.locale),V.setRemoteCaseMapping(t.remoteCaseMapping),Nd.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),oc.init(),t.initBroadcast&&tI.getBroadcastUtils().init()}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()))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=ou({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 rI.getComponentsRegistry().getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{await function(e,t="true"){return new Promise(((n,r)=>{const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("src",e),a.setAttribute("async",t),a.onload=n(),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 o=new URLSearchParams(t);let s=!1;"true"===n&&(s=!0);let i=null,c=null,l=null;if(e){e.startsWith("/")&&(e=e.substring(1));const t=e.split("/");i=t[0],t.length>1&&t[1]&&(c=t[1]),t.length>1&&"assignments"===t[2]&&t[3]&&(l=t[3])}else s=!1;let d=r;i&&(d=`${d}/${i}`),c&&(d=`${d}/${c}`),l&&(d=`${d}/assignments/${l}`),s&&(o.has("noPortal")||o.append("noPortal","true"),c&&a&&o.append("view",a));const u=o.toString();return d+=u?`?${u}`:"",d};initCoreConfig=e=>{const{routingInfo:t,serviceConfig:n,semanticUrl:r,queryParams:a,noPortal:o,noHistory:s,viewName:i,theme:c,restServerConfig:l,dynamicLoadComponents:d=!0,dynamicSemanticUrl:u=!0,renderingMode:p="FULL_PORTAL",envType:h,extras:f}=e,{appAlias:g,contextPath:m}=n;let y=window.location.origin;const E={};if(void 0!==l&&(y=l),m&&(y=`${y}${m}`),g&&"LAUNCHPAD"!==h&&(y=`${y}/${g}`),e.restServerConfig=y,!0===u){const e=this.buildSemanticUrl(r,a,o,y,i);!s&&e&&window.history.pushState({},"home",e)}else if("HYBRID"!==p){let e=window.location.href;e.indexOf("?")>0&&(e=e.substring(0,e.indexOf("?")),window.history.pushState({},"home",e)),E.dynamicSemanticUrl=!1}else console.log(`renderingMode :${p}`);!0!==d&&(E.dynamicLoadComponents=!1);let I=null;if(g){const e=g.indexOf("/app/");I=e>=0?g.substring(e+1):g}if(Object.keys(E).length>0&&window.PCore.setBehaviorOverrides(E),e.appAlias=I,c){let t="object"==typeof c?c:null;if(null===t)try{t=JSON.parse(c)}catch{t={}}e.theme=t}const A={...t,domain:`${window.location.protocol}//${window.location.host}`,searchParams:window.location.search};e.routingInfo=A,e.initBroadcast="true"===Ap.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),f?.cspNonce&&(window.__webpack_nonce__=f.cspNonce),this.init(e)};launchViewByName=(e,t,n,r,a,o,s,i)=>{cI+=1;const c=i||`mashup${cI}`,l={type:"RootContainer",config:{viewConfig:iI,renderingMode:"view",name:c}};rI.loadRootComponent(e,l,a,o,s).then((()=>rI.loadViewByName(t,n,r,c)))};launchView=(e,t,n=[],r,a,o,s)=>{cI+=1;const i="hybrid"===s?`hybrid_${cI}`:s;cI+=1;const c=i||`mashup${cI}`,l={type:"RootContainer",config:{viewConfig:iI,renderingMode:"portal",name:c}};s===j.HYBRID&&Vd.setRuntimeParam(j.HYBRID_ROOT_CONTAINERNAME,c),Vd.setRuntimeParams(r),rI.loadRootComponent(e,l,n,a,o).then((()=>rI.updateStoreWithUiRoot(t,c)))};launchPortal=(e,t,n,r=[])=>{cI+=1;const a=n||`portal${cI}`,o={type:"RootContainer",config:{viewConfig:iI,renderingMode:"portal",skeleton:"LoadingComponent",name:a}};r.push(o.config.skeleton),Ap.isPortalLoaded=!0,rI.loadRootComponent(e,o,r).then((()=>rI.loadPortalView(t,a)))};launchMashup=(e,t=!0)=>{const r={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfoAnnotation:"@ROUTING_INFO",name:"primary"}}]};if(t){const t=document.getElementsByTagName(e)[0]?.parentNode;if(t){const e=document.createElement("style");e.setAttribute("id","portal-less-styles"),e.innerHTML="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",t.appendChild(e)}}rI.loadRootComponent(e,r,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),window.parent!==window&&n(754)(`${window.PCore.getAssetLoader().getStaticServerUrl()}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))};start=async(e,t)=>{const{appStaticContentServer:n}=e.serviceConfig,{ccV2LibId:r,environmentId:a,isAlternateDesignSystemEnabled:o,alternateDesignSystemName:s}=e;this.initCoreConfig(e);const i=async()=>(await this.importReactRoot(),r&&await Lr.importCustomComponentMap(r),"true"===o&&"other"!==s&&await this.importDesignSystemComponentMap(n,a,s),t&&t(),!0);return new Promise(((e,t)=>{sI().then((async()=>{const t=rI.getComponentsRegistry();"ReactRoot"in t.getLazyMap()?e(!0):t.getComponent("ReactRoot")?e(await i()):yi.subscribe("component-map-loaded",(async()=>{e(await i())}))})).catch((e=>{t(e)}))}))};registerForDebugInfo=e=>{PCore.getEnvironmentInfo().setPreviewMode(),e&&PCore.getPubSubUtils().subscribe("fetchSuccess",(({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];e.postMessage({appDebugID:n})}),"fetchSuccess")};toggleTracerHeaders=e=>{e.addEventListener("message",(async e=>{const t=e?.data?.enableTracer;t?PCore.getDebugger().enableTracer():PCore.getDebugger().disableTracer()}))};loadEnvironmentInfo=async e=>{if(e.theme&&(!window.pms||"Android"!==window.pms.device.systemName))try{const t=JSON.parse(e.theme.definition);PCore.getEnvironmentInfo().setBrandingInfo(t.Branding),PCore.getEnvironmentInfo().setTheme(t.Theme)}catch{PCore.getEnvironmentInfo().setBrandingInfo({}),PCore.getEnvironmentInfo().setTheme({})}e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),PCore.getEnvironmentInfo().setCookieComplianceMethod(e.cookieComplianceMethod??"none")}},dI={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=Ff("createViewRuleByID");return ki(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=Ff("getViewRuleByID",{ID:e});return ki(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:a}=Ff("updateViewRuleByID",{ID:e});return ki(r,{method:a,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=Ff("deleteViewRuleByID",{ID:e});return ki(n,{method:r},t).then((e=>e.data))}},uI={"Content-Type":"application/json"},pI={addCaseFollower:(e,t,n)=>{const r={caseID:e},a=JSON.stringify({users:t.map((e=>({ID:e})))});return Qi("addCaseFollower",{body:a,queryPayload:r,headers:uI},n)},deleteCaseFollower:(e,t,n)=>Qi("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>Qi("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},hI={addRelatedCases:(e,t,n)=>{const r={caseID:e},a=JSON.stringify({cases:t});return Qi("addRelatedCases",{body:a,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>Qi("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>Qi("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},fI="operatorDetails",gI={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=Ff(fI,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return Qi(fI,{queryPayload:t})}return t?Qi("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):Qi(fI,{body:{dataViewParameters:{ID:e}}})}},mI=async e=>{const t=Lm(e),n=Dh.getIn(t,j.COMPONENTS);wr(t,{},!0);const r=Dh.getIn(t,j.LOCALE_REFERENCES);await Sp.loadLocaleResources(r||[]),await Ur(n)},yI=(e,t,n)=>Lh.resolveView(e,t,n),EI={"Content-Type":"application/json"};const II=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,a,o,s)=>{const{getLocaleValue:i}=Sp;s||(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="";s&&(l=o.getValue("pulse.pageLastEntry"));const d={filterForContext:e,feedID:t,feedClass:n,filterBy:c,pageSize:10,olderThan:l};for(let e=0;e<a.length;e+=1)a[e].cancel();const u=tc();return a.push(u),Qi("getFeedMessages",{queryPayload:d,cancelTokenSource:u},o.getContextName()).then((async e=>{if(200===e.status&&e.data){a.pop();const t=[],n={};let c=!1;if(e?.data){if(e?.data?.data?.FeedList){const r=e.data.data.FeedList?.pxResults;Array.isArray(r)&&r?.length>0&&r.forEach(((e,r)=>{e.ID=""!==e.pzInsKey?e.pzInsKey:`message${r}`,t.push(e.ID),n[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)})),c||"pzPostDetails"===e.pyMessageViewReference||"pzPrivatePostDetails"===e.pyMessageViewReference||(c=!0)}))}if(c&&await mI({uiResources:e.data.uiResources}),!r&&(r=[{id:"All",label:i("All","Pulse"),on:!0,disabled:!1}],e?.data?.data?.FeedFilters)){const t=e.data.data.FeedFilters?.pxResults;let n=!0;t&&Array.isArray(t)&&t?.length>0&&(t.forEach((e=>{const t={id:e.pyFeedSourceReference,label:i(e.pyLabel,"Pulse"),disabled:!1,on:"true"===e.pySelected};t.on||(n=!1),r.push(t)})),r.find((e=>"All"===e.id)).on=n)}}if(s&&o.getValue("pulse.messageIDs")){let r=o.getValue("pulse.messageIDs"),a=o.getValue("pulse.messages");r=[...r,...t],a={...a,...n},Object.values(a).forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions)}))})),o.updateState({pulse:{messages:a,messageIDs:r,nextPageFirstEntry:e?.data?.nextPageFirstEntry||"",pageLastEntry:e?.data?.pageLastEntry||"",hideAttachment:e?.data?.hideAttachment||!1}})}else o.updateState({pulse:{messages:n,messageIDs:t,nextPageFirstEntry:e?.data?.nextPageFirstEntry||"",pageLastEntry:e?.data?.pageLastEntry||"",hideAttachment:e?.data?.hideAttachment||!1}});const l=[...new Map(this.mentions.flat()?.map((e=>[e.mentionsID,e]))).values()]?.filter((e=>Object.prototype.hasOwnProperty.call(e,"mentionsType")))?.filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))||[];return{feedFilters:r,caseMentions:l}}return o.reportError(`getFeeds call failed ${e.status}`,e.data),""})).catch((e=>{nc(e)||o.reportError(": Error occurred during ajax call at getFeeds API : ",e.response)}))};postMessage=(e,t,n=[],r=!1,a)=>{const o=JSON.stringify({context:e,parentMessageId:r?e:"",message:t,attachments:n});return Qi("postFeedMessages",{body:o,headers:EI},a.getContextName()).then((t=>{if((201===t.status||200===t.status)&&t.data){const o=t?.data;if(r){o.parentMessageID=e;const{pxResults:t,caseMentions:s}=this.buildMessageObject(o,r,a,n.length>0);return a.updateState({pulse:{messages:{[e]:{pxResults:t}}}}),s}const{messages:s,messageIDs:i,caseMentions:c}=this.buildMessageObject(o,r,a,n.length>0);return a.updateState({pulse:{messages:s,messageIDs:i}}),c}return a.reportError(`postMessage call failed with status ${t.status}`,t),""})).catch((e=>{a.reportError(": Error occurred during ajax call at postMessage API : ",e.response)}))};editMessage=({messageID:e,parentMessageID:t,message:n,c11nEnv:r,isReply:a=!1})=>{const o=JSON.stringify({message:n});return Qi("editFeedMessage",{queryPayload:{messageID:e},body:o,headers:EI},r.getContextName()).then((e=>{if(200===e?.status&&e?.data){const n=e?.data;if(a){n.parentMessageID=t;const{pxResults:e,caseMentions:o}=this.buildMessageObject(n,a,r,!1);return r.updateState({pulse:{messages:{[t]:{pxResults:e}}}}),o}const{messages:o,caseMentions:s}=this.buildMessageObject(n,a,r,!1);return r.updateState({pulse:{messages:o}}),s}return r.reportError(`editMessage call failed with status ${e.status}`,e),""})).catch((e=>{r.reportError(": Error occurred during ajax call at editMessage API : ",e.response)}))};buildMessageObject=(e,t,n,r=!1)=>{const a={ID:e?.ID||"",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||"",pyIsEdited:"string"==typeof e?.isEdited?"true"===e?.isEdited:e?.isEdited||!1,pyFeed:{pyPostedOn:e?.postedTime||"",pyFeedTitle:e?.postedByUser?.name||"",pyIconType:"user",pyCommentContext:"pzInsKey",pyIconReference:"pi pi-case"},pyContext:"",pxIcon:"globe",pyMessageViewReference:"pzPostDetails"},o=n.getValue("pulse.messages");if(t){let{pxResults:e=[]}=Object.values(o)?.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 s=n.getValue("pulse.messageIDs");if(s){const e=s.includes(a.ID)?{...o[a.ID],...a}:a,t={...o,[a.ID]:e};return{messages:t,messageIDs:s.includes(a.ID)?s:[a.ID,...s],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.prototype.hasOwnProperty.call(e,"mentionsType")))?.filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))||[]};likeMessage=({pulseContext:e,likedBy:t,messageID:n,isReply:r,c11nEnv:a})=>{const o=t?"unlikeFeedMessages":"likeFeedMessages",s=JSON.stringify({ContextClass:e});Qi(o,{body:s,queryPayload:{pulseContext:e},headers:EI},a.getContextName()).then((o=>{if(200===o.status)if(r){const r=a.getValue(`pulse.messages.${n}`),o=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:o}}}})}else{const r={...a.getValue(`pulse.messages.${n}`)},o=r.pyLikes?r.pyLikes.pxLikeCount:0;let s=0,i=!1;t?(s=o-1,i=!1):(s=o+1,i=!0),r.pyLikes={pxLikeCount:s,pxIsLiked:i},a.updateState({pulse:{messages:{[e]:r}}})}else a.reportError(`likeMessage call failed with status ${o.status}`,o)})).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);Qi("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)=>Qi("getFeedMessageLikes",{queryPayload:{messageID:e}},t.getContextName()).then((e=>e?.data?.users)).catch((e=>{t.reportError(": Error occurred during ajax call at getLikedUsers API : ",e.response)}));getMentionSuggestions=(e,t)=>{const{pulseContext:n,searchFor:r,mentionsType:a,listSize:o=5}=e,s={pulseContext:n,searchFor:r,mentionsType:a,listSize:o};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const i=tc();return this.mentionsTagsCancelTokenSource.push(i),Qi("getMentionSuggestions",{queryPayload:s,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=>{nc(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>Qi("getMentionTypes",{},e.getContextName()).then((e=>e?.data)).catch((t=>{e.reportError(": Error occurred during ajax call at getMentionTypes API : ",t.response.data)}));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 o=tc();return this.mentionsTagsCancelTokenSource.push(o),Qi("getTagSuggestions",{queryPayload:a,cancelTokenSource:o},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=>{nc(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},AI={getTaggedCases:(e,t)=>Qi("loadView",{queryPayload:{caseID:e,viewID:"pyTaggedCases"}},t.getContextName()).then((e=>e?.data)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)})),getTags:(e,t)=>Qi("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 Qi("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)=>Qi("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>Pd.getPageDataAsync("D_pxGetTagsLandingPageURL",e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))},CI=(e,t)=>{ep(t.getContextName(),e.etag),tp(t.getContextName(),e.etag)},_I={getParticipants:(e,t)=>Qi("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)=>Qi("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)=>Qi("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)=>Qi("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)=>{const a={caseID:e},o={...n,participantRoleID:t},s={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Qi("createParticipant",{body:o,queryPayload:a,headers:s},r.getContextName()).then((t=>{CI(t.headers,r),e()})).catch((e=>{r.reportError(": Error occurred during ajax call at createParticipant API : ",e.response),t(e.response)}))}))},updateParticipant:async(e,t,n,r)=>{const a={caseID:e,participantID:t},o={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Qi("updateParticipant",{body:n,queryPayload:a,headers:o},r.getContextName()).then((t=>{CI(t.headers,r),e()})).catch((e=>{r.reportError(": Error occurred during ajax call at updateParticipant API : ",e.response),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)=>{Qi("deleteParticipant",{queryPayload:r,headers:a},n.getContextName()).then((t=>{CI(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function SI(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const bI="create",NI="update",vI="delete";function PI(e,t,n,r){const a=Jp(t);if(a){switch(e){case bI:case NI:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(a.allPersonalizations[n]=t),e&&(a.defaultPersonalization=n);break}case vI:delete a.allPersonalizations[n],a.defaultPersonalization===n&&(a.defaultPersonalization="");break;default:return null}return a}return null}const TI={},OI=e=>{const t=Jp(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=SI(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=Ff("getUIListPersonalizations",{listID:e});return ki(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:SI(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},$I=(e,t,n)=>{const{restApi:r,reqType:a}=Ff("createListPersonalization",{listID:e});return PI(bI,e,t,n),ki(r,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return TI[t]=n,e}))},RI=(e,t,n)=>{const r=TI[t]||t;PI(NI,e,t,n);const{restApi:a,reqType:o}=Ff("updateListPersonalization",{listID:e,personalizationID:r})||{};return ki(a,{method:o,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},DI=(e,t)=>{const n=TI[t]||t;PI(vI,e,t);const{restApi:r,reqType:a}=Ff("deleteListPersonalization",{listID:e,personalizationID:n});return ki(r,{method:a,body:{}}).then((e=>(TI[t]&&delete TI[t],e)))};const xI=function(e){return e?{createPersonalization:$I.bind(null,e),updatePersonalization:RI.bind(null,e),deletePersonalization:DI.bind(null,e),fetchPersonalizations:OI.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},wI="getDataObjects",MI="getInsightByID",LI=["LocalList","RemoteList","PromptList","DataPage"];let FI=null;const jI={},UI=e=>yd.getAppCacheKey(`PrimaryFields-${e}`);function kI(e){let t;return e[1].category?t=e[1].category:e[0].indexOf(":")>0&&(t=e[0].substring(0,e[0].indexOf(":"))),t}const VI={getDataObjects:function(){const e=yd.getAppCacheKey(wI);if(window.sessionStorage.getItem(e))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(e)));const{restApi:t,reqType:n}=Ff(wI,{}),r=ki(t,{method:n});return r.then((t=>{window.sessionStorage.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(FI)return FI;const t=yd.getAppCacheKey("getDataPageObjects");if(e&&window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Ff("getDataPages",{datapageRequestType:"explorable"});return FI=ki(n,{method:r,datapageRequestType:"explorable"}),FI.then((e=>{FI=null,window.sessionStorage.setItem(t,JSON.stringify(e))})),FI},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=Xp(e);if(t&&t.classID){let e=Zp(t.classID);const n=new Set(t.primaryFields),r=t.rdFields?.fields?.filter((e=>e.indexOf(".")>0));if(r&&!Dh.isEmpty(r)){const n=r.reduce(((e,n)=>{const r=Gp(n,t.classID);return e[n]=r,e}),{});e={...e,...n}}if(e&&Object.keys(e).length>0){const r=new Set(Array.isArray(t?.rdFields)?t?.rdFields:t?.rdFields?.fields),a=r.size>0||n.size>0;for(const t in e)e[t].type.startsWith("Page")||a&&!(r.size>0&&r.has(t)||n.size>0&&n.has(t))?delete e[t]:e[t]?.datasource&&LI.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={data:{...t,fields:Object.entries(n).map((e=>({...e[1],fieldID:e[0],fieldType:e[1].fieldType?e[1].fieldType:e[1].isUserReference?"User reference":void 0,category:kI(e),classID:e[1].associationClassID?e[1].associationClassID:e[1].classID})))}};return Promise.resolve(e)}}const r={dataSource:e,columns:[],parameters:{},associationFilter:n,matchPosition:"",ignoreCase:!1};return jd.init(r).then((({dataSourceMetaData:e})=>Promise.resolve({data:e})))},getDefaultColumns:function(e){const t=yd.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Ff("getListData",{dataViewName:"D_pzGetDefaultColumns"}),a=ki(n,{method:r,body:{dataViewParameters:e}});return a.then((e=>{window.sessionStorage.setItem(t,JSON.stringify(e))})),a},getFieldsForDataSource:function(e,t,n){if(!t){const t=Xp(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=yd.getAppCacheKey(`RDColumns-${e}`);if(window.sessionStorage.getItem(r))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(r)));const a=yd.getData("D_pxFieldsForDataSource",{dataViewParameters:{DataPageName:e}},n);return a.then((e=>{window.sessionStorage.setItem(r,JSON.stringify(e))})),a},getPrimaryFieldsForDataSource:function(e="",t=""){const n=yd.getAppCacheKey(`PFColumns-${e}${t}`);if(window.sessionStorage.getItem(n))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(n)));const r=yd.getData("D_pxGetInitialFieldsForDataSource",{dataViewParameters:{DataPageName:e,ClassName:t}});return r.then((e=>{window.sessionStorage.setItem(n,JSON.stringify(e))})),r},getPrimaryFieldsForInsights:async function(e,t,n){const{allClasses:r,promisesToAwait:a,classesToFetch:o,isTopLevelClassPresent:s,joinedClassesToFetch:i}=function(e,t){const n=[],r=[];let a=!1;const o=[],s=[];return e&&s.push(e),t&&t.length>0&&s.push(...t),s.forEach((t=>{const s=UI(t);window.sessionStorage.getItem(s)||(jI[t]?r.push(jI[t]):(n.push(t),t===e?a=!0:o.push(t)))})),{allClasses:s,promisesToAwait:r,classesToFetch:n,isTopLevelClassPresent:a,joinedClassesToFetch:o}}(e,n);return o.length&&a.push((async(e,t,n,r)=>{const a=yd.getData("D_pxGetPrimaryFieldsForInsights",{dataViewParameters:{...t&&{topLevelClassID:t},...r&&{joinedClassIDs:r.join(",")},...n&&{topLevelDataPageID:n}}}).then((t=>{const n=t.data?.data||[],r={};e.forEach((e=>{r[e]=[]})),n.forEach((({classID:e,pyFieldName:t})=>{r[e].push(t)})),Object.entries(r).forEach((([e,t])=>{const n=UI(e);window.sessionStorage.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete jI[e]}))}));return e.forEach((e=>{jI[e]=a})),a})(o,s?e:void 0,s?t:void 0,i.length>0?i:void 0)),Promise.allSettled(a).then((()=>{const e={};return r.forEach((t=>{const n=UI(t);if(window.sessionStorage.getItem(n))try{e[t]=JSON.parse(window.sessionStorage.getItem(n))}catch{}})),{data:e}}))},getInsightIDs:function(){const{restApi:e,reqType:t}=Ff("getInsightIDs");return ki(e,{method:t})},getInsightByID:function(e){const t=Qp(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:a}=Ff(MI,n);return ki(r,{method:a})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=Ff(MI,t);return ki(n,{method:r})},createInsight:function(e){const{restApi:t,reqType:n}=Ff("createInsight");return ki(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:r,reqType:a}=Ff("updateInsight",n),o=t.UpdateDateTime;return ki(r,{method:a,body:JSON.stringify(t),headers:{"if-match":o,"Content-Type":"application/json"}})},deleteInsight:function(e){const t={insightID:e},{restApi:n,reqType:r}=Ff("deleteInsight",t);return ki(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=Ff("exportToExcel");return ki(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=Ff("exportToCSV");return ki(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:a}=Ff("scheduleInsight",n);return ki(r,{method:a,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const r={insightID:e,scheduleID:t},{restApi:a,reqType:o}=Ff("updateScheduledInsight",r);return ki(a,{method:o,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:a}=Ff("deleteScheduledInsight",n);return ki(r,{method:a})},translateStrings:function(e){const{restApi:t,reqType:n}=Ff("translateStrings");return ki(t,{method:n,body:JSON.stringify(e)})}};const BI=new class{addRoutes=e=>{return t=e,void Ip.addRoutes(t);var t}};const GI=class{static registerModule(e,t,n){n[e]=()=>t}};const WI=class{static getCaseEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.CASE_EVENTS);static getDataEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.DATA_EVENTS);static getTransientEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.EVENT_TRANSIENT_ITEMS);static getBootstrapShellEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS)},HI={getResolvedSemanticURL:(e,t,n)=>Ip.getResolvedSemanticURL(e,t,n),getActions:()=>({ACTION_OPENWORKBYHANDLE:Be,ACTION_SHOWDATA:Ue,ACTION_SHOWVIEW:je}),updateSemanticURLAndDocumentTitle:e=>Ip.updateSemanticURLAndDocumentTitle(e)};const qI=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},YI={setTokens:e=>{qi({tokenInfo:e}),Hi(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>yi.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Ai(),getAuthInstance:e=>Ii.init(e),setAuthorizationHeader:e=>{Hi({Authorization:e}),setTimeout((()=>yi.publish("updateSession",{updateStatus:"success"})),0)}};const KI=new class{getDebouncedSubject(e){return(new gg).pipe(jE(e))}};Dr.register("email",(e=>{let t=null;return e&&!function(e){const t="[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+",n="\\x5c[\\x00-\\x7f]",r=`(${t}|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|${n})*\\x5d)`,a=`(${t}|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|${n})*\\x22)`;return new RegExp(`^${a}(\\x2e${a})*\\x40${r}(\\x2e${r})*$`).test(e)}(e)&&(t=Sp.getLocaleValue("Enter a valid email address","Messages")),t})),Dr.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t=Sp.getLocaleValue("Invalid number","Messages")),t})),Dr.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?Sp.getLocaleValue("Cannot be blank","Messages"):null)),Dr.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=Sp.getLocaleValue("Enter a valid url","Messages")),t})),setTimeout((()=>{const e=Sp.getLocaleValue("Enter a valid phone number","Messages");Promise.resolve().then(n.bind(n,654)).then((({parsePhoneNumberFromString:t})=>{Dr.register("phone",(n=>{let r=null;n&&!/^\+?\d+$/.test(n)&&(r=e);const a=n?.startsWith("+");if(n&&a){const a=t(n);a?.isPossible()&&n===a?.number||(r=e)}return r}))}))}),j.PRIORITY.TRIVIAL);const zI=(e,t)=>{switch(t){case"invalid":return Sp.getLocaleValue(`Incorrect ${e}`,"Messages");case"incomplete":return Sp.getLocaleValue(`Incomplete ${e}`,"Messages");default:return null}};Dr.register("datetime",(e=>zI("DateTime",e))),Dr.register("date",(e=>zI("Date",e))),Dr.register("time",(e=>zI("Time",e))),Dr.register("attachment",((e,t)=>(Ih(`.attachmentsList${t.pageReference?.replace("caseInfo.content","")}${t.property}`,"context_data",t.context)||[]).some((e=>e.props?.error))?Sp.getLocaleValue("Error with one or more files"):null));const XI={createConversation:(e,t,n,r=[])=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const a=tc();r.push(a);const o={assistantID:t},s=JSON.stringify({contextID:e});return Qi("createConversation",{body:s,cancelTokenSource:a,queryPayload:o},n).then((e=>(r.pop(),e)))},sendMessage:(e,t,n,r)=>{const a={assistantID:e,conversationID:t},o=JSON.stringify({request:n});return Qi("sendMessage",{body:o,queryPayload:a},r)}};const JI=class{caseTypeAccessMap=new Map;constructor(){this.caseTypeAccessMap=Ap.getCaseTypeList().reduce(((e,t)=>(e.set(t.pyWorkTypeImplementationClassName,t.hasCreateAccess??!0),e)),new Map)}hasCreateAccess(e){return this.caseTypeAccessMap.get(e)}static getInstance(){return this.instance||(this.instance=new this),this.instance}};class QI{constructor(){QI.behaviorOverrides={}}static behaviorOverrides={};getPCoreVersion=()=>"24.2.3";onPCoreReady=e=>rI.onPCoreReady(e);onPCoreCleanup=e=>rI.onPCoreCleanup(e);getComponentsRegistry=()=>rI.getComponentsRegistry();checkIfSemanticURL=()=>rI.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(Kf()){const e=Ip.processUrl(gp(),!0);return!!Ip._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>BI;getViewResources=()=>u;configureForBrowserBookmark=e=>rI.configureForBrowserBookmark(e);getStore=()=>fh();resetStore=()=>Oh();getMessageManager=()=>er;getCoexistenceManager=()=>tI;getStoreValue=(e,t,n)=>Ih(e,t,n);getContainerUtils=()=>i;getAnnotationUtils=()=>_l;getFieldUtils=()=>Bn;getFieldDefaultUtils=()=>$r;getAssetLoader=()=>Lr;getAttachmentUtils=()=>$p;getViewRuleApi=()=>dI;getFeedUtils=()=>II;getTagUtils=()=>AI;getGenAIAssistantUtils=()=>XI;getStakeholderUtils=()=>_I;getUserApi=()=>gI;getCaseFollowerApi=()=>pI;getCaseUtils=()=>wc;getStateUtils=()=>cc;getRelatedCasesApi=()=>hI;getPersonalizationUtils=xI;getDataApi=()=>jd;getDataApiUtils=()=>yd;getAnalyticsUtils=()=>VI;getLocaleUtils=()=>Sp;registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{QI.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{QI.behaviorOverrides[e]=t};getBehaviorOverrides=()=>QI.behaviorOverrides;getBehaviorOverride=e=>QI.behaviorOverrides[e];getAsynchronousUtils=()=>KI;createPConnect=e=>ou(e);getPubSubUtils=()=>yi;registerComponentCreator=e=>{su(e)};getConstants=()=>Object.freeze(F);getEvents=()=>WI;getRestClient=()=>s;getMashupApi=()=>nI;getEnvironmentInfo=()=>Ap;getRuntimeParamsAPI=()=>Vd;getSemanticUrlUtils=()=>HI;getRemoteCaseUtils=()=>V;getNavigationUtils=()=>oc;registerModule=(e,t)=>GI.registerModule(e,t,this);getErrorHandler=()=>qI;getFormUtils=()=>sl;getMessagingServiceManager=()=>Nd;getMetadataUtils=()=>c;getDataPageUtils=()=>Pd;getDataTypeUtils=()=>Kl;getCascadeManager=()=>dh;isDeepEqual=(e,t)=>h()(e,t);getAuthUtils=()=>YI;getDebugger=()=>$i;getDeferLoadManager=()=>gd;getExpressionEngine=()=>r;getActionsSequencer=()=>Jt;getRefreshManager=()=>Nl;getInitialiser=()=>lI;getAllStateMachines=(e,t,n)=>t&&n?il.getAllStateMachines(e,t,n):il.getAllStateMachinesByContext(e);getBootstrapUtils=()=>rI;getContextTreeManager=()=>Tn;getAccessPrivilege=()=>JI.getInstance()}const ZI=new QI;n.g.PCore=ZI})()})();
2
2
  //# sourceMappingURL=constellation-core-react-native.js.map