@flarehr/superhero-salpac-profile-admin 1.0.587 → 1.0.588
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
(()=>{"use strict";var e,t,n,r,o,i,c,l={},a=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function _(e,t){for(var n in t)e[n]=t[n];return e}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function f(t,n,r){var o,i,c,l={};for(c in n)"key"==c?o=n[c]:"ref"==c?i=n[c]:l[c]=n[c];if(arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(c in t.defaultProps)void 0===l[c]&&(l[c]=t.defaultProps[c]);return p(t,l,o,i,null)}function p(e,r,o,i,c){var l={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==c?++n:c};return null==c&&null!=t.vnode&&t.vnode(l),l}function d(e){return e.children}function h(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?v(e):null}function y(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return y(e)}}function m(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!b.__r++||o!==t.debounceRendering)&&((o=t.debounceRendering)||i)(b)}function b(){var e,t,n,o,i,l,a,u;for(r.sort(c);e=r.shift();)e.__d&&(t=r.length,o=void 0,i=void 0,a=(l=(n=e).__v).__e,(u=n.__P)&&(o=[],(i=_({},l)).__v=l.__v+1,N(u,l,i,n.__n,void 0!==u.ownerSVGElement,null!=l.__h?[a]:null,o,null==a?v(l):a,l.__h),T(o,l),l.__e!=a&&y(l)),r.length>t&&r.sort(c));b.__r=0}function g(e,t,n,r,o,i,c,u,_,s){var f,h,y,m,b,g,k,C=r&&r.__k||a,E=C.length;for(n.__k=[],f=0;f<t.length;f++)if(null!=(m=n.__k[f]=null==(m=t[f])||"boolean"==typeof m||"function"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?p(null,m,null,null,m):Array.isArray(m)?p(d,{children:m},null,null,null):m.__b>0?p(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(y=C[f])||y&&m.key==y.key&&m.type===y.type)C[f]=void 0;else for(h=0;h<E;h++){if((y=C[h])&&m.key==y.key&&m.type===y.type){C[h]=void 0;break}y=null}N(e,m,y=y||l,o,i,c,u,_,s),b=m.__e,(h=m.ref)&&y.ref!=h&&(k||(k=[]),y.ref&&k.push(y.ref,null,m),k.push(h,m.__c||b,m)),null!=b?(null==g&&(g=b),"function"==typeof m.type&&m.__k===y.__k?m.__d=_=w(m,_,e):_=x(e,m,y,C,b,_),"function"==typeof n.type&&(n.__d=_)):_&&y.__e==_&&_.parentNode!=e&&(_=v(y))}for(n.__e=g,f=E;f--;)null!=C[f]&&("function"==typeof n.type&&null!=C[f].__e&&C[f].__e==n.__d&&(n.__d=S(r).nextSibling),H(C[f],C[f]));if(k)for(f=0;f<k.length;f++)U(k[f],k[++f],k[++f])}function w(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t="function"==typeof r.type?w(r,t,n):x(n,r,r,o,r.__e,t));return t}function k(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){k(e,t)})):t.push(e)),t}function x(e,t,n,r,o,i){var c,l,a;if(void 0!==t.__d)c=t.__d,t.__d=void 0;else if(null==n||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),c=null;else{for(l=i,a=0;(l=l.nextSibling)&&a<r.length;a+=1)if(l==o)break e;e.insertBefore(o,i),c=i}return void 0!==c?c:o.nextSibling}function S(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=S(n)))return r;return null}function C(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||u.test(t)?n:n+"px"}function E(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||C(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||C(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?P:O,i):e.removeEventListener(t,i?P:O,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function O(e){return this.l[e.type+!1](t.event?t.event(e):e)}function P(e){return this.l[e.type+!0](t.event?t.event(e):e)}function N(e,n,r,o,i,c,l,a,u){var s,f,p,v,y,m,b,w,k,x,S,C,E,O,P,N=n.type;if(void 0!==n.constructor)return null;null!=r.__h&&(u=r.__h,a=n.__e=r.__e,n.__h=null,c=[a]),(s=t.__b)&&s(n);try{e:if("function"==typeof N){if(w=n.props,k=(s=N.contextType)&&o[s.__c],x=s?k?k.props.value:s.__:o,r.__c?b=(f=n.__c=r.__c).__=f.__E:("prototype"in N&&N.prototype.render?n.__c=f=new N(w,x):(n.__c=f=new h(w,x),f.constructor=N,f.render=j),k&&k.sub(f),f.props=w,f.state||(f.state={}),f.context=x,f.__n=o,p=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=N.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=_({},f.__s)),_(f.__s,N.getDerivedStateFromProps(w,f.__s))),v=f.props,y=f.state,f.__v=n,p)null==N.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==N.getDerivedStateFromProps&&w!==v&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(w,x),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(w,f.__s,x)||n.__v===r.__v){for(n.__v!==r.__v&&(f.props=w,f.state=f.__s,f.__d=!1),f.__e=!1,n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(e){e&&(e.__=n)})),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&l.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(w,f.__s,x),null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(v,y,m)}))}if(f.context=x,f.props=w,f.__P=e,C=t.__r,E=0,"prototype"in N&&N.prototype.render){for(f.state=f.__s,f.__d=!1,C&&C(n),s=f.render(f.props,f.state,f.context),O=0;O<f._sb.length;O++)f.__h.push(f._sb[O]);f._sb=[]}else do{f.__d=!1,C&&C(n),s=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++E<25);f.state=f.__s,null!=f.getChildContext&&(o=_(_({},o),f.getChildContext())),p||null==f.getSnapshotBeforeUpdate||(m=f.getSnapshotBeforeUpdate(v,y)),P=null!=s&&s.type===d&&null==s.key?s.props.children:s,g(e,Array.isArray(P)?P:[P],n,r,o,i,c,l,a,u),f.base=n.__e,n.__h=null,f.__h.length&&l.push(f),b&&(f.__E=f.__=null),f.__e=!1}else null==c&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=A(r.__e,n,r,o,i,c,l,u);(s=t.diffed)&&s(n)}catch(e){n.__v=null,(u||null!=c)&&(n.__e=a,n.__h=!!u,c[c.indexOf(a)]=null),t.__e(e,n,r)}}function T(e,n){t.__c&&t.__c(n,e),e.some((function(n){try{e=n.__h,n.__h=[],e.some((function(e){e.call(n)}))}catch(e){t.__e(e,n.__v)}}))}function A(t,n,r,o,i,c,a,u){var _,f,p,d=r.props,h=n.props,y=n.type,m=0;if("svg"===y&&(i=!0),null!=c)for(;m<c.length;m++)if((_=c[m])&&"setAttribute"in _==!!y&&(y?_.localName===y:3===_.nodeType)){t=_,c[m]=null;break}if(null==t){if(null===y)return document.createTextNode(h);t=i?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,h.is&&h),c=null,u=!1}if(null===y)d===h||u&&t.data===h||(t.data=h);else{if(c=c&&e.call(t.childNodes),f=(d=r.props||l).dangerouslySetInnerHTML,p=h.dangerouslySetInnerHTML,!u){if(null!=c)for(d={},m=0;m<t.attributes.length;m++)d[t.attributes[m].name]=t.attributes[m].value;(p||f)&&(p&&(f&&p.__html==f.__html||p.__html===t.innerHTML)||(t.innerHTML=p&&p.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||E(e,i,null,n[i],r);for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||E(e,i,t[i],n[i],r)}(t,h,d,i,u),p)n.__k=[];else if(m=n.props.children,g(t,Array.isArray(m)?m:[m],n,r,o,i&&"foreignObject"!==y,c,a,c?c[0]:r.__k&&v(r,0),u),null!=c)for(m=c.length;m--;)null!=c[m]&&s(c[m]);u||("value"in h&&void 0!==(m=h.value)&&(m!==t.value||"progress"===y&&!m||"option"===y&&m!==d.value)&&E(t,"value",m,d.value,!1),"checked"in h&&void 0!==(m=h.checked)&&m!==t.checked&&E(t,"checked",m,d.checked,!1))}return t}function U(e,n,r){try{"function"==typeof e?e(n):e.current=n}catch(e){t.__e(e,r)}}function H(e,n,r){var o,i;if(t.unmount&&t.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||U(o,null,n)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){t.__e(e,n)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&H(o[i],n,r||"function"!=typeof e.type);r||null==e.__e||s(e.__e),e.__=e.__e=e.__d=void 0}function j(e,t,n){return this.constructor(e,n)}function I(n,r,o){var i,c,a;t.__&&t.__(n,r),c=(i="function"==typeof o)?null:o&&o.__k||r.__k,a=[],N(r,n=(!i&&o||r).__k=f(d,null,[n]),c||l,l,void 0!==r.ownerSVGElement,!i&&o?[o]:c?null:r.firstChild?e.call(r.childNodes):null,a,!i&&o?o:c?c.__e:r.firstChild,i),T(a,n)}function D(e,t){I(e,t,D)}function L(t,n,r){var o,i,c,l=_({},t.props);for(c in n)"key"==c?o=n[c]:"ref"==c?i=n[c]:l[c]=n[c];return arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):r),p(t.type,l,o||t.key,i||t.ref,null)}function M(){return(M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function R(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(e,["context","children"]);return L(t,n)}function V(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=f(R,M({},this._props,{context:e.detail.context}),function e(t,n){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var r=[],o={},i=0,c=t.attributes,l=t.childNodes;for(i=c.length;i--;)"slot"!==c[i].name&&(o[c[i].name]=c[i].value,o[W(c[i].name)]=c[i].value);for(i=l.length;i--;){var a=e(l[i],null),u=l[i].slot;u?o[u]=f(B,{name:u},a):r[i]=a}var _=n?f(B,null,r):r;return f(n||t.nodeName.toLowerCase(),o,_)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?D:I)(this._vdom,this._root)}function W(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function F(e,t,n){if(this._vdom){var r={};r[e]=n=null==n?void 0:n,r[W(e)]=n,this._vdom=L(this._vdom,r),I(this._vdom,this._root)}}function z(){I(this._vdom=null,this._root)}function B(e,t){var n=this;return f("slot",M({},e,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}e=a.slice,t={__e:function(e,t,n,r){for(var o,i,c;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),c=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),c=o.__d),c)return o.__E=o}catch(t){e=t}throw e}},n=0,h.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},n),this.props)),e&&_(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),m(this))},h.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),m(this))},h.prototype.render=d,r=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},b.__r=0;var G=0;function $(e,n,r,o,i,c){var l,a,u={};for(a in n)"ref"==a?l=n[a]:u[a]=n[a];var _={type:e,props:u,key:r,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--G,__source:i,__self:c};if("function"==typeof e&&(l=e.defaultProps))for(a in l)void 0===u[a]&&(u[a]=l[a]);return t.vnode&&t.vnode(_),_}var q=function(){return q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},q.apply(this,arguments)};const J=function(e){return $("div",q({class:"flex flex-col mt-4"},{children:$("div",q({class:"-my-2 sm:-mx-6 lg:-mx-8"},{children:$("div",q({class:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"},{children:$("div",q({class:"shadow overflow-hidden border-b border-gray-200"},{children:$("table",q({class:"min-w-full divide-y divide-gray-200"},{children:[$("thead",{children:$("tr",{children:[$("th",q({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Profile Id"})),$("th",q({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Name"})),$("th",q({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Email"})),$("th",q({class:"px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"External Id"})),$("th",q({class:"px-6 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Catch E Id"}))]})}),$("tbody",{children:e.profiles.map((function(e,t){var n="px-6 py-4 whitespace-nowrap text-sm";return $("tr",q({class:t%2==0?"bg-white":"bg-gray-50"},{children:[$("td",q({class:n},{children:e.id})),$("td",q({class:n},{children:e.name})),$("td",q({class:n},{children:e.email})),$("td",q({class:n},{children:e.externalId})),$("td",q({class:n},{children:e.catchEId}))]}),t)}))})]}))}))}))}))}))};var Z,K,Q,X,Y=0,ee=[],te=[],ne=t.__b,re=t.__r,oe=t.diffed,ie=t.__c,ce=t.unmount;function le(e,n){t.__h&&t.__h(K,e,Y||n),Y=0;var r=K.__H||(K.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:te}),r.__[e]}function ae(e){return Y=1,function(e,t,n){var r=le(Z++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ye(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=K,!K.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var c=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(c=!0)}})),!(!c&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};K.u=!0;var i=K.shouldComponentUpdate,c=K.componentWillUpdate;K.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}c&&c.call(this,e,t,n)},K.shouldComponentUpdate=o}return r.__N||r.__}(ye,e)}function ue(e,n){var r=le(Z++,3);!t.__s&&ve(r.__H,n)&&(r.__=e,r.i=n,K.__H.__h.push(r))}function _e(e){return Y=5,function(e,t){var n=le(Z++,7);return ve(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}((function(){return{current:e}}),[])}function se(){for(var e;e=ee.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(de),e.__H.__h.forEach(he),e.__H.__h=[]}catch(n){e.__H.__h=[],t.__e(n,e.__v)}}t.__b=function(e){K=null,ne&&ne(e)},t.__r=function(e){re&&re(e),Z=0;var t=(K=e.__c).__H;t&&(Q===K?(t.__h=[],K.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=te,e.__N=e.i=void 0}))):(t.__h.forEach(de),t.__h.forEach(he),t.__h=[])),Q=K},t.diffed=function(e){oe&&oe(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(1!==ee.push(n)&&X===t.requestAnimationFrame||((X=t.requestAnimationFrame)||pe)(se)),n.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==te&&(e.__=e.__V),e.i=void 0,e.__V=te}))),Q=K=null},t.__c=function(e,n){n.some((function(e){try{e.__h.forEach(de),e.__h=e.__h.filter((function(e){return!e.__||he(e)}))}catch(r){n.some((function(e){e.__h&&(e.__h=[])})),n=[],t.__e(r,e.__v)}})),ie&&ie(e,n)},t.unmount=function(e){ce&&ce(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{de(e)}catch(e){n=e}})),r.__H=void 0,n&&t.__e(n,r.__v))};var fe="function"==typeof requestAnimationFrame;function pe(e){var t,n=function(){clearTimeout(r),fe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);fe&&(t=requestAnimationFrame(n))}function de(e){var t=K,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),K=t}function he(e){var t=K;e.__c=e.__(),K=t}function ve(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ye(e,t){return"function"==typeof t?t(e):t}var me,be=(me=function(e,t){return me=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])},me(e,t)},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}me(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ge=function(e){function t(n,r){var o=e.call(this,n)||this;return o._response=r,Object.setPrototypeOf(o,t.prototype),o}return be(t,e),Object.defineProperty(t.prototype,"response",{get:function(){return this._response},enumerable:!1,configurable:!0}),t}(Error),we=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,l)}a((r=r.apply(e,t||[])).next())}))},ke=function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,r=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}},xe=function(e,t){return function(n,r,o,i){return function(e,t,n,r,o){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,l)}a((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function(){var i,c;return function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,r=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}}(this,(function(l){switch(l.label){case 0:return[4,fetch(e,{method:t,body:r?JSON.stringify(r):void 0,headers:{authorization:"Bearer ".concat(n),"content-type":"application/json"},signal:(null===AbortSignal||void 0===AbortSignal?void 0:AbortSignal.timeout)&&AbortSignal.timeout(15e3)})];case 1:if(!(i=l.sent()).ok)throw new ge("[API] Fetch error: ".concat(i.statusText,". Url: ").concat(t," ").concat(e),i);return o?(c={},[3,4]):[3,2];case 2:return[4,i.json()];case 3:c=l.sent(),l.label=4;case 4:return[2,c]}}))}))}(new URL("".concat(e).concat("/salary-packaging/admin/v1.0").concat(n)),r,t,o,i)}},Se=function(e,t){return we(void 0,void 0,void 0,(function(){return ke(this,(function(n){switch(n.label){case 0:return[4,e("/accounts/".concat(t,"/auth"),"GET")];case 1:return[2,n.sent()]}}))}))},Ce=function(e,t,n){return we(void 0,void 0,void 0,(function(){return ke(this,(function(r){switch(r.label){case 0:return[4,e("/accounts/".concat(t,"/profiles/search?search=").concat(n),"GET")];case 1:return[2,r.sent()]}}))}))},Ee=function(e){return we(void 0,void 0,void 0,(function(){var t,n;return ke(this,(function(r){switch(r.label){case 0:return(t=new Date).setUTCDate((new Date).getUTCDate()-2),(n=new Date).setUTCDate((new Date).getUTCDate()+2),[4,e("/ingest/clients","POST",{startDate:t.toISOString().split("T")[0],endDate:n.toISOString().split("T")[0]},!0)];case 1:return r.sent(),[2]}}))}))},Oe=function(){return Oe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Oe.apply(this,arguments)};const Pe=function(e){return $("button",Oe({},e,{className:"ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 disabled:bg-gray-500 disabled:cursor-not-allowed hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},{children:e.children}))};var Ne=function(){return Ne=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ne.apply(this,arguments)},Te=function(e){var t=ae(""),n=t[0],r=t[1];return $("div",Ne({class:"flex flex-row gap-4 sm:-mr-6 lg:mr-0"},{children:[$("div",Ne({className:"flex-grow max-w-md"},{children:[$("label",Ne({for:"search",class:"block text-sm font-medium text-gray-700"},{children:"Search"})),$("div",Ne({className:"mt-1"},{children:$("input",{class:"py-2 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md",name:"search",id:"search",placeholder:"First Name, Middle Name, Last Name or Email Id.",type:"text",value:n,onChange:function(e){return function(e){r(e)}(e.currentTarget.value)},required:!0})}))]})),$("div",Ne({className:"pt-6"},{children:$("div",Ne({className:"flex justify-end"},{children:$(Pe,Ne({type:"search",onClick:function(){return e.onSearch(n)}},{children:"Search"}))}))})),$("div",Ne({className:"flex-grow max-w-md"},{children:e.error&&$("h3",Ne({className:"text-red-500"},{children:e.error}))}))]}))};function Ae(e){this.message=e}Ae.prototype=new Error,Ae.prototype.name="InvalidCharacterError";var Ue="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Ae("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,c="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?c+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return c};function He(e){this.message=e}He.prototype=new Error,He.prototype.name="InvalidTokenError";var je=function(){function e(e){this.roles=e,this.isAuthorized=e.includes("SalaryPackaging.Access")}return e.create=function(t){return new e(function(e,t){if("string"!=typeof e)throw new He("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(Ue(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return Ue(t)}}(e.split(".")[n]))}catch(e){throw new He("Invalid token specified: "+e.message)}}(t).roles||[])},e}(),Ie=function(){return Ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ie.apply(this,arguments)};const De=function(){return $("svg",Ie({className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},{children:[$("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),$("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}))};function Le(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Me(e){this.props=e}(Me.prototype=new h).isPureReactComponent=!0,Me.prototype.shouldComponentUpdate=function(e,t){return Le(this.props,e)||Le(this.state,t)};var Re=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Re&&Re(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Ve=t.__e;t.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Ve(e,t,n,r)};var We=t.unmount;function Fe(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Fe(e,t,n)}))),e}function ze(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return ze(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Be(){this.__u=0,this.t=null,this.__b=null}function Ge(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function $e(){this.u=null,this.o=null}t.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),We&&We(e)},(Be.prototype=new h).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Ge(r.__v),i=!1,c=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=c;var l=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=ze(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},a=!0===t.__h;r.__u++||a||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(c,c)},Be.prototype.componentWillUnmount=function(){this.t=[]},Be.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Fe(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&f(d,null,e.fallback);return o&&(o.__h=null),[f(d,null,t.__a?null:e.children),o]};var qe=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};($e.prototype=new h).__a=function(e){var t=this,n=Ge(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),qe(t,e,r)):o()};n?n(i):i()}},$e.prototype.render=function(e){this.u=null,this.o=new Map;var t=k(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},$e.prototype.componentDidUpdate=$e.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){qe(e,n,t)}))};var Je="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ze=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ke=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Qe=/[A-Z0-9]/g,Xe="undefined"!=typeof document,Ye=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};h.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(h.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var et=t.event;function tt(){}function nt(){return this.cancelBubble}function rt(){return this.defaultPrevented}t.event=function(e){return et&&(e=et(e)),e.persist=tt,e.isPropagationStopped=nt,e.isDefaultPrevented=rt,e.nativeEvent=e};var ot={enumerable:!1,configurable:!0,get:function(){return this.class}},it=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||Xe&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var c=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===c?o="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||Ye(t.type)?"onfocus"===c?o="onfocusin":"onblur"===c?o="onfocusout":Ke.test(o)?o=c:-1===n.indexOf("-")&&Ze.test(o)?o=o.replace(Qe,"-$&").toLowerCase():null===i&&(i=void 0):c=o="oninput","oninput"===c&&r[o=c]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=k(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=k(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",ot)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Je,it&&it(e)};var ct=t.__r;t.__r=function(e){ct&&ct(e),e.__c};var lt=t.diffed;t.diffed=function(e){lt&<(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};const at=function(e,t){var n=_e();ue((function(){n.current=e}),[e]),ue((function(){if(t){var e=setInterval((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return null===(e=null==n?void 0:n.current)||void 0===e?void 0:e.call.apply(e,function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([n],t,!1))}),t);return function(){return clearInterval(e)}}}),[t])};var ut=function(){return ut=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ut.apply(this,arguments)},_t=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,l)}a((r=r.apply(e,t||[])).next())}))},st=function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,r=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}};const ft=function(e){var t=ae(!1),n=t[0],r=t[1];return at((function(){return _t(void 0,void 0,void 0,(function(){return st(this,(function(t){switch(t.label){case 0:return[4,e.onCheck()];case 1:return t.sent()&&r(!1),[2]}}))}))}),n?e.checkInterval:void 0),ue((function(){if(n){var t=setTimeout((function(){n&&e.onTimeout(),r(!1)}),e.timeout);return function(){return clearTimeout(t)}}})),$(Pe,ut({onClick:function(){return _t(void 0,void 0,void 0,(function(){return st(this,(function(t){switch(t.label){case 0:return r(!0),[4,e.onClick()];case 1:return t.sent()||r(!1),[2]}}))}))},disabled:n},{children:$(d,n?{children:[$(De,{}),$("span",{children:e.processingText})]}:{children:e.text})}))};var pt=function(){return pt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},pt.apply(this,arguments)},dt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,l)}a((r=r.apply(e,t||[])).next())}))},ht=function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,r=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}};!function(e,t,n,r){function o(){var t=Reflect.construct(HTMLElement,[],o);return t._vdomComponent=e,t._root=t,t}(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=V,o.prototype.attributeChangedCallback=F,o.prototype.disconnectedCallback=z,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach((function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})})),customElements.define("superhero-salpac-profile-admin",o)}((function(e){var t=ae([]),n=t[0],r=t[1],o=ae(),i=o[0],c=o[1],l=ae({status:"NotLinked",message:"Access Denied"}),a=l[0],u=l[1],_=ae(je.create(e.accessToken))[0],s=ae("Loading"),f=s[0],p=s[1];ue((function(){dt(void 0,void 0,void 0,(function(){var t,n,r;return ht(this,(function(o){switch(o.label){case 0:if(!(_.isAuthorized&&e.backendUrl&&e.accessToken&&e.accountId))return[3,5];o.label=1;case 1:return o.trys.push([1,3,,5]),t=xe(e.backendUrl,e.accessToken),[4,Se(t,e.accountId)];case 2:return n=o.sent(),u(n),"Linked"===n.status?p("Search"):p("Unlinked"),[3,5];case 3:return r=o.sent(),[4,d(r)];case 4:return o.sent(),p("Error"),[3,5];case 5:return[2]}}))}))}),[e.accessToken,e.accountId,e.backendUrl,_]),ue((function(){_&&!_.isAuthorized&&(c("Access Denied"),p("Error"))}),[_]);var d=function(e){return dt(void 0,void 0,void 0,(function(){var t;return ht(this,(function(n){switch(n.label){case 0:if(!(e instanceof ge))return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.response.json()];case 2:return t=n.sent(),c(t.message||"".concat(e.response.status," error occurred")),[3,4];case 3:return n.sent(),c("".concat(e.response.status," error occurred")),[3,4];case 4:return[3,6];case 5:c("Unexpected error occurred"),n.label=6;case 6:return[2]}}))}))};switch(f){case"Loading":return $("h1",pt({className:"text-gray-500"},{children:"Loading..."}));case"Search":return $("div",{children:[$(Te,{onSearch:function(t){return dt(void 0,void 0,void 0,(function(){var n,o,i;return ht(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,4]),c(void 0),n=xe(e.backendUrl,e.accessToken),[4,Ce(n,e.accountId,t)];case 1:return o=l.sent(),r(o),[3,4];case 2:return i=l.sent(),[4,d(i)];case 3:return l.sent(),[3,4];case 4:return[2]}}))}))}}),$("div",{children:$("h1",pt({className:"text-red-500"},{children:i}))}),$(J,{profiles:n})]});case"Error":return $("h1",pt({className:"text-red-500"},{children:i}));case"Unlinked":return $("div",{children:[$("h1",pt({className:"text-red-500 mb-4 ml-4"},{children:a.message})),$(ft,{onClick:function(){return dt(void 0,void 0,void 0,(function(){var t,n;return ht(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,4]),t=xe(e.backendUrl,e.accessToken),[4,Ee(t)];case 1:return r.sent(),[2,!0];case 2:return n=r.sent(),[4,d(n)];case 3:return r.sent(),p("Error"),[2,!1];case 4:return[2]}}))}))},onCheck:function(){return dt(void 0,void 0,void 0,(function(){var t,n;return ht(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=xe(e.backendUrl,e.accessToken),[4,Se(t,e.accountId)];case 1:return"Linked"===(n=r.sent()).status?(u(n),p("Search"),[2,!0]):a.status!==n.status||a.message!==n.message?(u(n),[2,!0]):[2,!1];case 2:return r.sent(),[2,!1];case 3:return[2]}}))}))},onTimeout:function(){c("Client sync took too long. Please confirm you have updated Catch-E correctly, refresh the page and try again. "),p("Error")},checkInterval:5e3,timeout:3e4,text:"Sync Clients",processingText:"Syncing..."})]})}}),0,["backend-url","access-token"])})();
|
1
|
+
(()=>{"use strict";var e,n,t,r,o,i,c,a,l={},u=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function _(e,n){for(var t in n)e[t]=n[t];return e}function f(e){var n=e.parentNode;n&&n.removeChild(e)}function p(n,t,r){var o,i,c,a={};for(c in t)"key"==c?o=t[c]:"ref"==c?i=t[c]:a[c]=t[c];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof n&&null!=n.defaultProps)for(c in n.defaultProps)void 0===a[c]&&(a[c]=n.defaultProps[c]);return d(n,a,o,i,null)}function d(e,r,o,i,c){var a={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==c?++t:c};return null==c&&null!=n.vnode&&n.vnode(a),a}function h(e){return e.children}function v(e,n){this.props=e,this.context=n}function y(e,n){if(null==n)return e.__?y(e.__,e.__.__k.indexOf(e)+1):null;for(var t;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e)return t.__e;return"function"==typeof e.type?y(e):null}function b(e){var n,t;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e){e.__e=e.__c.base=t.__e;break}return b(e)}}function m(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!g.__r++||o!==n.debounceRendering)&&((o=n.debounceRendering)||i)(g)}function g(){var e,n,t,o,i,a,l,u;for(r.sort(c);e=r.shift();)e.__d&&(n=r.length,o=void 0,i=void 0,l=(a=(t=e).__v).__e,(u=t.__P)&&(o=[],(i=_({},a)).__v=a.__v+1,E(u,a,i,t.__n,void 0!==u.ownerSVGElement,null!=a.__h?[l]:null,o,null==l?y(a):l,a.__h),U(o,a),a.__e!=l&&b(a)),r.length>n&&r.sort(c));g.__r=0}function w(e,n,t,r,o,i,c,a,s,_){var f,p,v,b,m,g,w,x=r&&r.__k||u,S=x.length;for(t.__k=[],f=0;f<n.length;f++)if(null!=(b=t.__k[f]=null==(b=n[f])||"boolean"==typeof b||"function"==typeof b?null:"string"==typeof b||"number"==typeof b||"bigint"==typeof b?d(null,b,null,null,b):Array.isArray(b)?d(h,{children:b},null,null,null):b.__b>0?d(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)){if(b.__=t,b.__b=t.__b+1,null===(v=x[f])||v&&b.key==v.key&&b.type===v.type)x[f]=void 0;else for(p=0;p<S;p++){if((v=x[p])&&b.key==v.key&&b.type===v.type){x[p]=void 0;break}v=null}E(e,b,v=v||l,o,i,c,a,s,_),m=b.__e,(p=b.ref)&&v.ref!=p&&(w||(w=[]),v.ref&&w.push(v.ref,null,b),w.push(p,b.__c||m,b)),null!=m?(null==g&&(g=m),"function"==typeof b.type&&b.__k===v.__k?b.__d=s=k(b,s,e):s=C(e,b,v,x,m,s),"function"==typeof t.type&&(t.__d=s)):s&&v.__e==s&&s.parentNode!=e&&(s=y(v))}for(t.__e=g,f=S;f--;)null!=x[f]&&("function"==typeof t.type&&null!=x[f].__e&&x[f].__e==t.__d&&(t.__d=O(r).nextSibling),I(x[f],x[f]));if(w)for(f=0;f<w.length;f++)j(w[f],w[++f],w[++f])}function k(e,n,t){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,n="function"==typeof r.type?k(r,n,t):C(t,r,r,o,r.__e,n));return n}function x(e,n){return n=n||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){x(e,n)})):n.push(e)),n}function C(e,n,t,r,o,i){var c,a,l;if(void 0!==n.__d)c=n.__d,n.__d=void 0;else if(null==t||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),c=null;else{for(a=i,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==o)break e;e.insertBefore(o,i),c=i}return void 0!==c?c:o.nextSibling}function O(e){var n,t,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(n=e.__k.length-1;n>=0;n--)if((t=e.__k[n])&&(r=O(t)))return r;return null}function S(e,n,t){"-"===n[0]?e.setProperty(n,null==t?"":t):e[n]=null==t?"":"number"!=typeof t||s.test(n)?t:t+"px"}function P(e,n,t,r,o){var i;e:if("style"===n)if("string"==typeof t)e.style.cssText=t;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(n in r)t&&n in t||S(e.style,n,"");if(t)for(n in t)r&&t[n]===r[n]||S(e.style,n,t[n])}else if("o"===n[0]&&"n"===n[1])i=n!==(n=n.replace(/Capture$/,"")),n=n.toLowerCase()in e?n.toLowerCase().slice(2):n.slice(2),e.l||(e.l={}),e.l[n+i]=t,t?r||e.addEventListener(n,i?T:N,i):e.removeEventListener(n,i?T:N,i);else if("dangerouslySetInnerHTML"!==n){if(o)n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==n&&"height"!==n&&"href"!==n&&"list"!==n&&"form"!==n&&"tabIndex"!==n&&"download"!==n&&n in e)try{e[n]=null==t?"":t;break e}catch(e){}"function"==typeof t||(null==t||!1===t&&"-"!==n[4]?e.removeAttribute(n):e.setAttribute(n,t))}}function N(e){return this.l[e.type+!1](n.event?n.event(e):e)}function T(e){return this.l[e.type+!0](n.event?n.event(e):e)}function E(e,t,r,o,i,c,a,l,u){var s,f,p,d,y,b,m,g,k,x,C,O,S,P,N,T=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(u=r.__h,l=t.__e=r.__e,t.__h=null,c=[l]),(s=n.__b)&&s(t);try{e:if("function"==typeof T){if(g=t.props,k=(s=T.contextType)&&o[s.__c],x=s?k?k.props.value:s.__:o,r.__c?m=(f=t.__c=r.__c).__=f.__E:("prototype"in T&&T.prototype.render?t.__c=f=new T(g,x):(t.__c=f=new v(g,x),f.constructor=T,f.render=H),k&&k.sub(f),f.props=g,f.state||(f.state={}),f.context=x,f.__n=o,p=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=T.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=_({},f.__s)),_(f.__s,T.getDerivedStateFromProps(g,f.__s))),d=f.props,y=f.state,f.__v=t,p)null==T.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==T.getDerivedStateFromProps&&g!==d&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(g,x),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(g,f.__s,x)||t.__v===r.__v){for(t.__v!==r.__v&&(f.props=g,f.state=f.__s,f.__d=!1),f.__e=!1,t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),C=0;C<f._sb.length;C++)f.__h.push(f._sb[C]);f._sb=[],f.__h.length&&a.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(g,f.__s,x),null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(d,y,b)}))}if(f.context=x,f.props=g,f.__P=e,O=n.__r,S=0,"prototype"in T&&T.prototype.render){for(f.state=f.__s,f.__d=!1,O&&O(t),s=f.render(f.props,f.state,f.context),P=0;P<f._sb.length;P++)f.__h.push(f._sb[P]);f._sb=[]}else do{f.__d=!1,O&&O(t),s=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++S<25);f.state=f.__s,null!=f.getChildContext&&(o=_(_({},o),f.getChildContext())),p||null==f.getSnapshotBeforeUpdate||(b=f.getSnapshotBeforeUpdate(d,y)),N=null!=s&&s.type===h&&null==s.key?s.props.children:s,w(e,Array.isArray(N)?N:[N],t,r,o,i,c,a,l,u),f.base=t.__e,t.__h=null,f.__h.length&&a.push(f),m&&(f.__E=f.__=null),f.__e=!1}else null==c&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=A(r.__e,t,r,o,i,c,a,u);(s=n.diffed)&&s(t)}catch(e){t.__v=null,(u||null!=c)&&(t.__e=l,t.__h=!!u,c[c.indexOf(l)]=null),n.__e(e,t,r)}}function U(e,t){n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function A(n,t,r,o,i,c,a,u){var s,_,p,d=r.props,h=t.props,v=t.type,b=0;if("svg"===v&&(i=!0),null!=c)for(;b<c.length;b++)if((s=c[b])&&"setAttribute"in s==!!v&&(v?s.localName===v:3===s.nodeType)){n=s,c[b]=null;break}if(null==n){if(null===v)return document.createTextNode(h);n=i?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,h.is&&h),c=null,u=!1}if(null===v)d===h||u&&n.data===h||(n.data=h);else{if(c=c&&e.call(n.childNodes),_=(d=r.props||l).dangerouslySetInnerHTML,p=h.dangerouslySetInnerHTML,!u){if(null!=c)for(d={},b=0;b<n.attributes.length;b++)d[n.attributes[b].name]=n.attributes[b].value;(p||_)&&(p&&(_&&p.__html==_.__html||p.__html===n.innerHTML)||(n.innerHTML=p&&p.__html||""))}if(function(e,n,t,r,o){var i;for(i in t)"children"===i||"key"===i||i in n||P(e,i,null,t[i],r);for(i in n)o&&"function"!=typeof n[i]||"children"===i||"key"===i||"value"===i||"checked"===i||t[i]===n[i]||P(e,i,n[i],t[i],r)}(n,h,d,i,u),p)t.__k=[];else if(b=t.props.children,w(n,Array.isArray(b)?b:[b],t,r,o,i&&"foreignObject"!==v,c,a,c?c[0]:r.__k&&y(r,0),u),null!=c)for(b=c.length;b--;)null!=c[b]&&f(c[b]);u||("value"in h&&void 0!==(b=h.value)&&(b!==n.value||"progress"===v&&!b||"option"===v&&b!==d.value)&&P(n,"value",b,d.value,!1),"checked"in h&&void 0!==(b=h.checked)&&b!==n.checked&&P(n,"checked",b,d.checked,!1))}return n}function j(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,r)}}function I(e,t,r){var o,i;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||j(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&I(o[i],t,r||"function"!=typeof e.type);r||null==e.__e||f(e.__e),e.__=e.__e=e.__d=void 0}function H(e,n,t){return this.constructor(e,t)}function D(t,r,o){var i,c,a;n.__&&n.__(t,r),c=(i="function"==typeof o)?null:o&&o.__k||r.__k,a=[],E(r,t=(!i&&o||r).__k=p(h,null,[t]),c||l,l,void 0!==r.ownerSVGElement,!i&&o?[o]:c?null:r.firstChild?e.call(r.childNodes):null,a,!i&&o?o:c?c.__e:r.firstChild,i),U(a,t)}function L(e,n){D(e,n,L)}function M(n,t,r){var o,i,c,a=_({},n.props);for(c in t)"key"==c?o=t[c]:"ref"==c?i=t[c]:a[c]=t[c];return arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):r),d(n.type,a,o||n.key,i||n.ref,null)}function W(){return(W=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function V(e){this.getChildContext=function(){return e.context};var n=e.children,t=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n.indexOf(t=i[r])>=0||(o[t]=e[t]);return o}(e,["context","children"]);return M(n,t)}function F(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=p(V,W({},this._props,{context:e.detail.context}),function e(n,t){if(3===n.nodeType)return n.data;if(1!==n.nodeType)return null;var r=[],o={},i=0,c=n.attributes,a=n.childNodes;for(i=c.length;i--;)"slot"!==c[i].name&&(o[c[i].name]=c[i].value,o[R(c[i].name)]=c[i].value);for(i=a.length;i--;){var l=e(a[i],null),u=a[i].slot;u?o[u]=p(B,{name:u},l):r[i]=l}var s=t?p(B,null,r):r;return p(t||n.nodeName.toLowerCase(),o,s)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?L:D)(this._vdom,this._root)}function R(e){return e.replace(/-(\w)/g,(function(e,n){return n?n.toUpperCase():""}))}function G(e,n,t){if(this._vdom){var r={};r[e]=t=null==t?void 0:t,r[R(e)]=t,this._vdom=M(this._vdom,r),D(this._vdom,this._root)}}function z(){D(this._vdom=null,this._root)}function B(e,n){var t=this;return p("slot",W({},e,{ref:function(e){e?(t.ref=e,t._listener||(t._listener=function(e){e.stopPropagation(),e.detail.context=n},e.addEventListener("_preact",t._listener))):t.ref.removeEventListener("_preact",t._listener)}}))}e=u.slice,n={__e:function(e,n,t,r){for(var o,i,c;n=n.__;)if((o=n.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),c=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),c=o.__d),c)return o.__E=o}catch(n){e=n}throw e}},t=0,v.prototype.setState=function(e,n){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},t),this.props)),e&&_(t,e),null!=e&&this.__v&&(n&&this._sb.push(n),m(this))},v.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),m(this))},v.prototype.render=h,r=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,n){return e.__v.__b-n.__v.__b},g.__r=0,a=0;var $=0;function q(e,t,r,o,i,c){var a,l,u={};for(l in t)"ref"==l?a=t[l]:u[l]=t[l];var s={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--$,__source:i,__self:c};if("function"==typeof e&&(a=e.defaultProps))for(l in a)void 0===u[l]&&(u[l]=a[l]);return n.vnode&&n.vnode(s),s}var J,Z,K,Q,X=0,Y=[],ee=[],ne=n.__b,te=n.__r,re=n.diffed,oe=n.__c,ie=n.unmount;function ce(e,t){n.__h&&n.__h(Z,e,X||t),X=0;var r=Z.__H||(Z.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:ee}),r.__[e]}function ae(e){return X=1,function(e,n,t){var r=ce(J++,2);if(r.t=e,!r.__c&&(r.__=[t?t(n):ve(void 0,n),function(e){var n=r.__N?r.__N[0]:r.__[0],t=r.t(n,e);n!==t&&(r.__N=[t,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.u)){var o=function(e,n,t){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,n,t);var c=!1;return o.forEach((function(e){if(e.__N){var n=e.__[0];e.__=e.__N,e.__N=void 0,n!==e.__[0]&&(c=!0)}})),!(!c&&r.__c.props===e)&&(!i||i.call(this,e,n,t))};Z.u=!0;var i=Z.shouldComponentUpdate,c=Z.componentWillUpdate;Z.componentWillUpdate=function(e,n,t){if(this.__e){var r=i;i=void 0,o(e,n,t),i=r}c&&c.call(this,e,n,t)},Z.shouldComponentUpdate=o}return r.__N||r.__}(ve,e)}function le(e,t){var r=ce(J++,3);!n.__s&&he(r.__H,t)&&(r.__=e,r.i=t,Z.__H.__h.push(r))}function ue(e,n){var t=ce(J++,7);return he(t.__H,n)?(t.__V=e(),t.i=n,t.__h=e,t.__V):t.__}function se(){for(var e;e=Y.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(pe),e.__H.__h.forEach(de),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){Z=null,ne&&ne(e)},n.__r=function(e){te&&te(e),J=0;var n=(Z=e.__c).__H;n&&(K===Z?(n.__h=[],Z.__h=[],n.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ee,e.__N=e.i=void 0}))):(n.__h.forEach(pe),n.__h.forEach(de),n.__h=[])),K=Z},n.diffed=function(e){re&&re(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Y.push(t)&&Q===n.requestAnimationFrame||((Q=n.requestAnimationFrame)||fe)(se)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ee&&(e.__=e.__V),e.i=void 0,e.__V=ee}))),K=Z=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(pe),e.__h=e.__h.filter((function(e){return!e.__||de(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),oe&&oe(e,t)},n.unmount=function(e){ie&&ie(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{pe(e)}catch(e){t=e}})),r.__H=void 0,t&&n.__e(t,r.__v))};var _e="function"==typeof requestAnimationFrame;function fe(e){var n,t=function(){clearTimeout(r),_e&&cancelAnimationFrame(n),setTimeout(e)},r=setTimeout(t,100);_e&&(n=requestAnimationFrame(t))}function pe(e){var n=Z,t=e.__c;"function"==typeof t&&(e.__c=void 0,t()),Z=n}function de(e){var n=Z;e.__c=e.__(),Z=n}function he(e,n){return!e||e.length!==n.length||n.some((function(n,t){return n!==e[t]}))}function ve(e,n){return"function"==typeof n?n(e):n}var ye,be=(ye=function(e,n){return ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},ye(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}ye(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}),me=function(e){function n(t,r){var o=e.call(this,t)||this;return o._response=r,Object.setPrototypeOf(o,n.prototype),o}return be(n,e),Object.defineProperty(n.prototype,"response",{get:function(){return this._response},enumerable:!1,configurable:!0}),n}(Error),ge=function(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,a)}l((r=r.apply(e,n||[])).next())}))},we=function(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=n.call(e,c)}catch(e){a=[6,e],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},ke=function(e,n){return function(t,r,o,i){return function(e,n,t,r,o){return function(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,a)}l((r=r.apply(e,n||[])).next())}))}(void 0,void 0,void 0,(function(){var i,c;return function(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=n.call(e,c)}catch(e){a=[6,e],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(a){switch(a.label){case 0:return[4,fetch(e,{method:n,body:r?JSON.stringify(r):void 0,headers:{authorization:"Bearer ".concat(t),"content-type":"application/json"},signal:(null===AbortSignal||void 0===AbortSignal?void 0:AbortSignal.timeout)&&AbortSignal.timeout(15e3)})];case 1:if(!(i=a.sent()).ok)throw new me("[API] Fetch error: ".concat(i.statusText,". Url: ").concat(n," ").concat(e),i);return o?(c={},[3,4]):[3,2];case 2:return[4,i.json()];case 3:c=a.sent(),a.label=4;case 4:return[2,c]}}))}))}(new URL("".concat(e).concat("/salary-packaging/admin/v1.0").concat(t)),r,n,o,i)}},xe=function(e,n){return ge(void 0,void 0,void 0,(function(){return we(this,(function(t){switch(t.label){case 0:return[4,e("/accounts/".concat(n,"/auth"),"GET")];case 1:return[2,t.sent()]}}))}))},Ce=function(e,n,t){return ge(void 0,void 0,void 0,(function(){return we(this,(function(r){switch(r.label){case 0:return[4,e("/accounts/".concat(n,"/profiles/search?search=").concat(t),"GET")];case 1:return[2,r.sent()]}}))}))},Oe=function(e){return ge(void 0,void 0,void 0,(function(){var n,t;return we(this,(function(r){switch(r.label){case 0:return(n=new Date).setUTCDate((new Date).getUTCDate()-2),(t=new Date).setUTCDate((new Date).getUTCDate()+2),[4,e("/ingest/clients","POST",{startDate:n.toISOString().split("T")[0],endDate:t.toISOString().split("T")[0]},!0)];case 1:return r.sent(),[2]}}))}))};function Se(e){this.message=e}Se.prototype=new Error,Se.prototype.name="InvalidCharacterError";var Pe="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var n=String(e).replace(/=+$/,"");if(n.length%4==1)throw new Se("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,r,o=0,i=0,c="";r=n.charAt(i++);~r&&(t=o%4?64*t+r:r,o++%4)?c+=String.fromCharCode(255&t>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return c};function Ne(e){this.message=e}Ne.prototype=new Error,Ne.prototype.name="InvalidTokenError";var Te=function(){function e(e){this.roles=e,this.isAuthorized=e.includes("SalaryPackaging.Access")}return e.create=function(n){return new e(function(e,n){if("string"!=typeof e)throw new Ne("Invalid token specified");var t=!0===(n=n||{}).header?0:1;try{return JSON.parse(function(e){var n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(Pe(e).replace(/(.)/g,(function(e,n){var t=n.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(n)}catch(e){return Pe(n)}}(e.split(".")[t]))}catch(e){throw new Ne("Invalid token specified: "+e.message)}}(n).roles||[])},e}(),Ee=function(){return Ee=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},Ee.apply(this,arguments)};const Ue=function(e){return q("button",Ee({},e,{className:"ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 disabled:bg-gray-500 disabled:cursor-not-allowed hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},{children:e.children}))};var Ae=function(){return Ae=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},Ae.apply(this,arguments)};const je=function(){return q("svg",Ae({className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},{children:[q("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),q("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}))};function Ie(e,n){for(var t in e)if("__source"!==t&&!(t in n))return!0;for(var r in n)if("__source"!==r&&e[r]!==n[r])return!0;return!1}function He(e){this.props=e}(He.prototype=new v).isPureReactComponent=!0,He.prototype.shouldComponentUpdate=function(e,n){return Ie(this.props,e)||Ie(this.state,n)};var De=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),De&&De(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Le=n.__e;n.__e=function(e,n,t,r){if(e.then)for(var o,i=n;i=i.__;)if((o=i.__c)&&o.__c)return null==n.__e&&(n.__e=t.__e,n.__k=t.__k),o.__c(e,n);Le(e,n,t,r)};var Me=n.unmount;function We(e,n,t){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,n){for(var t in n)e[t]=n[t];return e}({},e)).__c&&(e.__c.__P===t&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return We(e,n,t)}))),e}function Ve(e,n,t){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Ve(e,n,t)})),e.__c&&e.__c.__P===n&&(e.__e&&t.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=t)),e}function Fe(){this.__u=0,this.t=null,this.__b=null}function Re(e){var n=e.__.__c;return n&&n.__a&&n.__a(e)}function Ge(){this.u=null,this.o=null}n.unmount=function(e){var n=e.__c;n&&n.__R&&n.__R(),n&&!0===e.__h&&(e.type=null),Me&&Me(e)},(Fe.prototype=new v).__c=function(e,n){var t=n.__c,r=this;null==r.t&&(r.t=[]),r.t.push(t);var o=Re(r.__v),i=!1,c=function(){i||(i=!0,t.__R=null,o?o(a):a())};t.__R=c;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Ve(e,e.__c.__P,e.__c.__O)}var n;for(r.setState({__a:r.__b=null});n=r.t.pop();)n.forceUpdate()}},l=!0===n.__h;r.__u++||l||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(c,c)},Fe.prototype.componentWillUnmount=function(){this.t=[]},Fe.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=We(this.__b,t,r.__O=r.__P)}this.__b=null}var o=n.__a&&p(h,null,e.fallback);return o&&(o.__h=null),[p(h,null,n.__a?null:e.children),o]};var ze=function(e,n,t){if(++t[1]===t[0]&&e.o.delete(n),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(t=e.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;e.u=t=t[2]}};(Ge.prototype=new v).__a=function(e){var n=this,t=Re(n.__v),r=n.o.get(e);return r[0]++,function(o){var i=function(){n.props.revealOrder?(r.push(o),ze(n,e,r)):o()};t?t(i):i()}},Ge.prototype.render=function(e){this.u=null,this.o=new Map;var n=x(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&n.reverse();for(var t=n.length;t--;)this.o.set(n[t],this.u=[1,0,this.u]);return e.children},Ge.prototype.componentDidUpdate=Ge.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(n,t){ze(e,t,n)}))};var Be="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,$e=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,qe=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Je=/[A-Z0-9]/g,Ze="undefined"!=typeof document,Ke=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};v.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(v.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})}));var Qe=n.event;function Xe(){}function Ye(){return this.cancelBubble}function en(){return this.defaultPrevented}n.event=function(e){return Qe&&(e=Qe(e)),e.persist=Xe,e.isPropagationStopped=Ye,e.isDefaultPrevented=en,e.nativeEvent=e};var nn={enumerable:!1,configurable:!0,get:function(){return this.class}},tn=n.vnode;n.vnode=function(e){"string"==typeof e.type&&function(e){var n=e.props,t=e.type,r={};for(var o in n){var i=n[o];if(!("value"===o&&"defaultValue"in n&&null==i||Ze&&"children"===o&&"noscript"===t||"class"===o||"className"===o)){var c=o.toLowerCase();"defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===c?o="ondblclick":"onchange"!==c||"input"!==t&&"textarea"!==t||Ke(n.type)?"onfocus"===c?o="onfocusin":"onblur"===c?o="onfocusout":qe.test(o)?o=c:-1===t.indexOf("-")&&$e.test(o)?o=o.replace(Je,"-$&").toLowerCase():null===i&&(i=void 0):c=o="oninput","oninput"===c&&r[o=c]&&(o="oninputCapture"),r[o]=i}}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=x(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=x(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",nn)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),e.props=r}(e),e.$$typeof=Be,tn&&tn(e)};var rn=n.__r;n.__r=function(e){rn&&rn(e),e.__c};var on=n.diffed;n.diffed=function(e){on&&on(e);var n=e.props,t=e.__e;null!=t&&"textarea"===e.type&&"value"in n&&n.value!==t.value&&(t.value=null==n.value?"":n.value)};const cn=function(e,n){var t=function(e){return X=5,ue((function(){return{current:e}}),[])}();le((function(){t.current=e}),[e]),le((function(){if(n){var e=setInterval((function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return null===(e=null==t?void 0:t.current)||void 0===e?void 0:e.call.apply(e,function(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}([t],n,!1))}),n);return function(){return clearInterval(e)}}}),[n])};var an=function(){return an=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},an.apply(this,arguments)},ln=function(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,a)}l((r=r.apply(e,n||[])).next())}))},un=function(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=n.call(e,c)}catch(e){a=[6,e],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};const sn=function(e){var n=ae(!1),t=n[0],r=n[1];return cn((function(){return ln(void 0,void 0,void 0,(function(){return un(this,(function(n){switch(n.label){case 0:return[4,e.onCheck()];case 1:return n.sent()&&r(!1),[2]}}))}))}),t?e.checkInterval:void 0),le((function(){if(t){var n=setTimeout((function(){t&&e.onTimeout(),r(!1)}),e.timeout);return function(){return clearTimeout(n)}}})),q(Ue,an({onClick:function(){return ln(void 0,void 0,void 0,(function(){return un(this,(function(n){switch(n.label){case 0:return r(!0),[4,e.onClick()];case 1:return n.sent()||r(!1),[2]}}))}))},disabled:t},{children:q(h,t?{children:[q(je,{}),q("span",{children:e.processingText})]}:{children:e.text})}))};var _n=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.filter(Boolean).join(" ")},fn=function(){return fn=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},fn.apply(this,arguments)};const pn=function(e){var n=e.tabs,t=e.currentTabId,r=e.onChange,o=ue((function(){return n.find((function(e){return e.id==t}))}),[n,t]);return q("div",{children:[q("div",fn({className:"sm:hidden"},{children:[q("label",fn({htmlFor:"tabs",className:"sr-only"},{children:"Select a tab"})),q("select",fn({id:"tabs",name:"tabs",defaultValue:null==o?void 0:o.id,onChange:function(e){return r(e.currentTarget.value)},className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm"},{children:n.map((function(e){return q("option",{children:e.displayName},e.id)}))}))]})),q("div",fn({className:"hidden sm:block"},{children:q("div",fn({className:"border-b border-gray-200"},{children:q("nav",fn({"aria-label":"Tabs",className:"-mb-px flex space-x-8"},{children:n.map((function(e){return q("a",fn({onClick:(n=e.id,function(){r(n)}),"aria-current":e.id==(null==o?void 0:o.id)?"page":void 0,className:_n(e.id==(null==o?void 0:o.id)?"border-indigo-500 text-indigo-600":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700","whitespace-nowrap border-b-2 px-1 py-4 text-sm font-medium cursor-pointer")},{children:e.displayName}),e.id);var n}))}))}))}))]})};var dn=function(){return dn=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},dn.apply(this,arguments)},hn=function(e){var n=ae(""),t=n[0],r=n[1];return q("div",dn({class:"flex flex-row gap-4 sm:-mr-6 lg:mr-0"},{children:[q("div",dn({className:"flex-grow max-w-md"},{children:[q("label",dn({for:"search",class:"block text-sm font-medium text-gray-700"},{children:"Search"})),q("div",dn({className:"mt-1"},{children:q("input",{class:"p-2 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md",name:"search",id:"search",placeholder:"First Name, Middle Name, Last Name or Email Id.",type:"text",value:t,onChange:function(e){return function(e){r(e)}(e.currentTarget.value)},required:!0})}))]})),q("div",dn({className:"pt-6"},{children:q("div",dn({className:"flex justify-end"},{children:q(Ue,dn({type:"search",onClick:function(){return e.onSearch(t)}},{children:"Search"}))}))})),q("div",dn({className:"flex-grow max-w-md"},{children:e.error&&q("h3",dn({className:"text-red-500"},{children:e.error}))}))]}))},vn=function(){return vn=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},vn.apply(this,arguments)};const yn=function(e){return q("div",vn({class:"flex flex-col mt-4"},{children:q("div",vn({class:"-my-2 sm:-mx-6 lg:-mx-8"},{children:q("div",vn({class:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"},{children:q("div",vn({class:"shadow overflow-hidden border-b border-gray-200"},{children:q("table",vn({class:"min-w-full divide-y divide-gray-200"},{children:[q("thead",{children:q("tr",{children:[q("th",vn({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Profile Id"})),q("th",vn({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Name"})),q("th",vn({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Email"})),q("th",vn({class:"px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"External Id"})),q("th",vn({class:"px-6 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Catch E Id"}))]})}),q("tbody",{children:e.profiles.map((function(e,n){var t="px-6 py-4 whitespace-nowrap text-sm";return q("tr",vn({class:n%2==0?"bg-white":"bg-gray-50"},{children:[q("td",vn({class:t},{children:e.id})),q("td",vn({class:t},{children:e.name})),q("td",vn({class:t},{children:e.email})),q("td",vn({class:t},{children:e.externalId})),q("td",vn({class:t},{children:e.catchEId}))]}),n)}))})]}))}))}))}))}))};var bn,mn=function(){return mn=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},mn.apply(this,arguments)},gn=function(e){return bn=function(e,n){var t={__c:n="__cC"+a++,__:e,Consumer:function(e,n){return e.children(n)},Provider:function(e){var t,r;return this.getChildContext||(t=[],(r={})[n]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some((function(e){e.__e=!0,m(e)}))},this.sub=function(e){t.push(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),n&&n.call(e)}}),e.children}};return t.Provider.__=t.Consumer.contextType=t}(mn(mn({},e),{backend:mn(mn({},e.backend),{url:e.backend.url.replace(/\/?$/,"")})}))},wn=function(e){return function(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,a)}l((r=r.apply(e,n||[])).next())}))}(void 0,void 0,void 0,(function(){return function(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=n.call(e,c)}catch(e){a=[6,e],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(n){switch(n.label){case 0:if(!(e instanceof me))return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.response.json()];case 2:return[2,n.sent().message||"".concat(e.response.status," error occurred")];case 3:return n.sent(),[2,"".concat(e.response.status," error occurred")];case 4:return[3,6];case 5:return[2,"Unexpected error occurred"];case 6:return[2]}}))}))},kn=function(){return kn=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},kn.apply(this,arguments)};const xn=function(){var e=ae([]),n=e[0],t=e[1],r=ae(),o=r[0],i=r[1],c=function(e){var n=Z.context[e.__c],t=ce(J++,9);return t.c=e,n?(null==t.__&&(t.__=!0,n.sub(Z)),n.props.value):e.__}(bn);return q("div",{children:[q(hn,{onSearch:function(e){return function(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,a)}l((r=r.apply(e,n||[])).next())}))}(void 0,void 0,void 0,(function(){var n,r,o,a;return function(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=n.call(e,c)}catch(e){a=[6,e],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,4]),i(void 0),n=ke(c.backend.url,c.backend.accessToken),[4,Ce(n,c.account.accountId,e)];case 1:return r=l.sent(),t(r),[3,4];case 2:return o=l.sent(),a=i,[4,wn(o)];case 3:return a.apply(void 0,[l.sent()]),[3,4];case 4:return[2]}}))}))}}),q("div",{children:q("h1",kn({className:"text-red-500"},{children:o}))}),q(yn,{profiles:n})]})};var Cn=function(){return Cn=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},Cn.apply(this,arguments)},On=[{id:"search",displayName:"Search"},{id:"linkedProfiles",displayName:"Linked Profiles"}],Sn=function(e){switch(e){case"search":return q(xn,{});case"linkedProfiles":return q("div",{children:"Coming soon..."})}};const Pn=function(){var e=ae("search"),n=e[0],t=e[1];return q(h,{children:[q(pn,{tabs:On,currentTabId:n,onChange:t}),q("div",Cn({className:"ml-4 mt-4"},{children:Sn(n)}))]})};var Nn=function(){return Nn=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},Nn.apply(this,arguments)},Tn=function(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,a)}l((r=r.apply(e,n||[])).next())}))},En=function(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=n.call(e,c)}catch(e){a=[6,e],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};!function(e,n,t){function r(){var n=Reflect.construct(HTMLElement,[],r);return n._vdomComponent=e,n._root=n,n}(r.prototype=Object.create(HTMLElement.prototype)).constructor=r,r.prototype.connectedCallback=F,r.prototype.attributeChangedCallback=G,r.prototype.disconnectedCallback=z,t=t||e.observedAttributes||Object.keys(e.propTypes||{}),r.observedAttributes=t,t.forEach((function(e){Object.defineProperty(r.prototype,e,{get:function(){return this._vdom.props[e]},set:function(n){this._vdom?this.attributeChangedCallback(e,null,n):(this._props||(this._props={}),this._props[e]=n,this.connectedCallback());var t=typeof n;null!=n&&"string"!==t&&"boolean"!==t&&"number"!==t||this.setAttribute(e,n)}})})),customElements.define("superhero-salpac-profile-admin",r)}((function(e){var n=ae(),t=n[0],r=n[1],o=ae({status:"NotLinked",message:"Access Denied"}),i=o[0],c=o[1],a=ae(Te.create(e.accessToken))[0],l=ae("Loading"),u=l[0],s=l[1];switch(gn({backend:{url:e.backendUrl,accessToken:e.accessToken},account:{accountId:e.accountId}}),gn({backend:{url:e.backendUrl,accessToken:e.accessToken},account:{accountId:e.accountId}}),le((function(){Tn(void 0,void 0,void 0,(function(){var n,t,o,i;return En(this,(function(l){switch(l.label){case 0:if(!(a.isAuthorized&&e.backendUrl&&e.accessToken&&e.accountId))return[3,5];l.label=1;case 1:return l.trys.push([1,3,,5]),n=ke(e.backendUrl,e.accessToken),[4,xe(n,e.accountId)];case 2:return t=l.sent(),c(t),"Linked"===t.status?s("Main"):s("Unlinked"),[3,5];case 3:return o=l.sent(),i=r,[4,wn(o)];case 4:return i.apply(void 0,[l.sent()]),s("Error"),[3,5];case 5:return[2]}}))}))}),[e.accessToken,e.accountId,e.backendUrl,a]),le((function(){a&&!a.isAuthorized&&(r("Access Denied"),s("Error"))}),[a]),u){case"Loading":return q("h1",Nn({className:"text-gray-500"},{children:"Loading..."}));case"Main":return q(Pn,{});case"Error":return q("h1",Nn({className:"text-red-500"},{children:t}));case"Unlinked":return q("div",{children:[q("h1",Nn({className:"text-red-500 mb-4 ml-4"},{children:i.message})),q(sn,{onClick:function(){return Tn(void 0,void 0,void 0,(function(){var n,t,o;return En(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),n=ke(e.backendUrl,e.accessToken),[4,Oe(n)];case 1:return i.sent(),[2,!0];case 2:return t=i.sent(),o=r,[4,wn(t)];case 3:return o.apply(void 0,[i.sent()]),s("Error"),[2,!1];case 4:return[2]}}))}))},onCheck:function(){return Tn(void 0,void 0,void 0,(function(){var n,t;return En(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),n=ke(e.backendUrl,e.accessToken),[4,xe(n,e.accountId)];case 1:return"Linked"===(t=r.sent()).status?(c(t),s("Main"),[2,!0]):i.status!==t.status||i.message!==t.message?(c(t),[2,!0]):[2,!1];case 2:return r.sent(),[2,!1];case 3:return[2]}}))}))},onTimeout:function(){r("Client sync took too long. Please confirm you have updated Catch-E correctly, refresh the page and try again. "),s("Error")},checkInterval:5e3,timeout:3e4,text:"Sync Clients",processingText:"Syncing..."})]})}}),0,["backend-url","access-token"])})();
|