@flarehr/promoted-benefits-ui 1.0.59 → 1.0.60
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){const _=document.createElement("link").relList;if(_&&_.supports&&_.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function t(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(n){if(n.ep)return;n.ep=!0;const r=t(n);fetch(n.href,r)}})();var M,p,de,C,ee,pe,B,he,N={},ve=[],$e=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Q=Array.isArray;function P(e,_){for(var t in _)e[t]=_[t];return e}function me(e){var _=e.parentNode;_&&_.removeChild(e)}function He(e,_,t){var o,n,r,c={};for(r in _)r=="key"?o=_[r]:r=="ref"?n=_[r]:c[r]=_[r];if(arguments.length>2&&(c.children=arguments.length>3?M.call(arguments,2):t),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)c[r]===void 0&&(c[r]=e.defaultProps[r]);return W(e,c,o,n,null)}function W(e,_,t,o,n){var r={type:e,props:_,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++de,__i:-1,__u:0};return n==null&&p.vnode!=null&&p.vnode(r),r}function V(e){return e.children}function D(e,_){this.props=e,this.context=_}function $(e,_){if(_==null)return e.__?$(e.__,e.__i+1):null;for(var t;_<e.__k.length;_++)if((t=e.__k[_])!=null&&t.__e!=null)return t.__e;return typeof e.type=="function"?$(e):null}function ye(e){var _,t;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,_=0;_<e.__k.length;_++)if((t=e.__k[_])!=null&&t.__e!=null){e.__e=e.__c.base=t.__e;break}return ye(e)}}function j(e){(!e.__d&&(e.__d=!0)&&C.push(e)&&!O.__r++||ee!==p.debounceRendering)&&((ee=p.debounceRendering)||pe)(O)}function O(){var e,_,t,o,n,r,c,s,u;for(C.sort(B);e=C.shift();)e.__d&&(_=C.length,o=void 0,r=(n=(t=e).__v).__e,s=[],u=[],(c=t.__P)&&((o=P({},n)).__v=n.__v+1,p.vnode&&p.vnode(o),J(c,o,n,t.__n,c.ownerSVGElement!==void 0,32&n.__u?[r]:null,s,r??$(n),!!(32&n.__u),u),o.__v=n.__v,o.__.__k[o.__i]=o,ke(s,o,u),o.__e!=r&&ye(o)),C.length>_&&C.sort(B));O.__r=0}function ge(e,_,t,o,n,r,c,s,u,l,f){var i,d,a,y,w,g=o&&o.__k||ve,h=_.length;for(t.__d=u,Se(t,_,g),u=t.__d,i=0;i<h;i++)(a=t.__k[i])!=null&&typeof a!="boolean"&&typeof a!="function"&&(d=a.__i===-1?N:g[a.__i]||N,a.__i=i,J(e,a,d,n,r,c,s,u,l,f),y=a.__e,a.ref&&d.ref!=a.ref&&(d.ref&&X(d.ref,null,a),f.push(a.ref,a.__c||y,a)),w==null&&y!=null&&(w=y),65536&a.__u||d.__k===a.__k?(y||d.__e!=u||(u=$(d)),u=be(a,u,e)):typeof a.type=="function"&&a.__d!==void 0?u=a.__d:y&&(u=y.nextSibling),a.__d=void 0,a.__u&=-196609);t.__d=u,t.__e=w}function Se(e,_,t){var o,n,r,c,s,u=_.length,l=t.length,f=l,i=0;for(e.__k=[],o=0;o<u;o++)c=o+i,(n=e.__k[o]=(n=_[o])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?W(null,n,null,null,null):Q(n)?W(V,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?W(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,s=Ne(n,t,c,f),n.__i=s,r=null,s!==-1&&(f--,(r=t[s])&&(r.__u|=131072)),r==null||r.__v===null?(s==-1&&i--,typeof n.type!="function"&&(n.__u|=65536)):s!==c&&(s===c+1?i++:s>c?f>u-c?i+=s-c:i--:s<c?s==c-1&&(i=s-c):i=0,s!==o+i&&(n.__u|=65536))):(r=t[c])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==e.__d&&(e.__d=$(r)),z(r,r,!1),t[c]=null,f--);if(f)for(o=0;o<l;o++)(r=t[o])!=null&&!(131072&r.__u)&&(r.__e==e.__d&&(e.__d=$(r)),z(r,r))}function be(e,_,t){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,_=be(o[n],_,t));return _}e.__e!=_&&(t.insertBefore(e.__e,_||null),_=e.__e);do _=_&&_.nextSibling;while(_!=null&&_.nodeType===8);return _}function Ne(e,_,t,o){var n=e.key,r=e.type,c=t-1,s=t+1,u=_[t];if(u===null||u&&n==u.key&&r===u.type&&!(131072&u.__u))return t;if(o>(u!=null&&!(131072&u.__u)?1:0))for(;c>=0||s<_.length;){if(c>=0){if((u=_[c])&&!(131072&u.__u)&&n==u.key&&r===u.type)return c;c--}if(s<_.length){if((u=_[s])&&!(131072&u.__u)&&n==u.key&&r===u.type)return s;s++}}return-1}function _e(e,_,t){_[0]==="-"?e.setProperty(_,t??""):e[_]=t==null?"":typeof t!="number"||$e.test(_)?t:t+"px"}function A(e,_,t,o,n){var r;e:if(_==="style")if(typeof t=="string")e.style.cssText=t;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(_ in o)t&&_ in t||_e(e.style,_,"");if(t)for(_ in t)o&&t[_]===o[_]||_e(e.style,_,t[_])}else if(_[0]==="o"&&_[1]==="n")r=_!==(_=_.replace(/(PointerCapture)$|Capture$/i,"$1")),_=_.toLowerCase()in e||_==="onFocusOut"||_==="onFocusIn"?_.toLowerCase().slice(2):_.slice(2),e.l||(e.l={}),e.l[_+r]=t,t?o?t.u=o.u:(t.u=Date.now(),e.addEventListener(_,r?ne:te,r)):e.removeEventListener(_,r?ne:te,r);else{if(n)_=_.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(_!=="width"&&_!=="height"&&_!=="href"&&_!=="list"&&_!=="form"&&_!=="tabIndex"&&_!=="download"&&_!=="rowSpan"&&_!=="colSpan"&&_!=="role"&&_ in e)try{e[_]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&_[4]!=="-"?e.removeAttribute(_):e.setAttribute(_,t))}}function te(e){if(this.l){var _=this.l[e.type+!1];if(e.t){if(e.t<=_.u)return}else e.t=Date.now();return _(p.event?p.event(e):e)}}function ne(e){if(this.l)return this.l[e.type+!0](p.event?p.event(e):e)}function J(e,_,t,o,n,r,c,s,u,l){var f,i,d,a,y,w,g,h,b,x,U,S,Z,L,R,k=_.type;if(_.constructor!==void 0)return null;128&t.__u&&(u=!!(32&t.__u),r=[s=_.__e=t.__e]),(f=p.__b)&&f(_);e:if(typeof k=="function")try{if(h=_.props,b=(f=k.contextType)&&o[f.__c],x=f?b?b.props.value:f.__:o,t.__c?g=(i=_.__c=t.__c).__=i.__E:("prototype"in k&&k.prototype.render?_.__c=i=new k(h,x):(_.__c=i=new D(h,x),i.constructor=k,i.render=Ue),b&&b.sub(i),i.props=h,i.state||(i.state={}),i.context=x,i.__n=o,d=i.__d=!0,i.__h=[],i._sb=[]),i.__s==null&&(i.__s=i.state),k.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=P({},i.__s)),P(i.__s,k.getDerivedStateFromProps(h,i.__s))),a=i.props,y=i.state,i.__v=_,d)k.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(k.getDerivedStateFromProps==null&&h!==a&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(h,x),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(h,i.__s,x)===!1||_.__v===t.__v)){for(_.__v!==t.__v&&(i.props=h,i.state=i.__s,i.__d=!1),_.__e=t.__e,_.__k=t.__k,_.__k.forEach(function(T){T&&(T.__=_)}),U=0;U<i._sb.length;U++)i.__h.push(i._sb[U]);i._sb=[],i.__h.length&&c.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(h,i.__s,x),i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(a,y,w)})}if(i.context=x,i.props=h,i.__P=e,i.__e=!1,S=p.__r,Z=0,"prototype"in k&&k.prototype.render){for(i.state=i.__s,i.__d=!1,S&&S(_),f=i.render(i.props,i.state,i.context),L=0;L<i._sb.length;L++)i.__h.push(i._sb[L]);i._sb=[]}else do i.__d=!1,S&&S(_),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++Z<25);i.state=i.__s,i.getChildContext!=null&&(o=P(P({},o),i.getChildContext())),d||i.getSnapshotBeforeUpdate==null||(w=i.getSnapshotBeforeUpdate(a,y)),ge(e,Q(R=f!=null&&f.type===V&&f.key==null?f.props.children:f)?R:[R],_,t,o,n,r,c,s,u,l),i.base=_.__e,_.__u&=-161,i.__h.length&&c.push(i),g&&(i.__E=i.__=null)}catch(T){_.__v=null,u||r!=null?(_.__e=s,_.__u|=u?160:32,r[r.indexOf(s)]=null):(_.__e=t.__e,_.__k=t.__k),p.__e(T,_,t)}else r==null&&_.__v===t.__v?(_.__k=t.__k,_.__e=t.__e):_.__e=Ee(t.__e,_,t,o,n,r,c,u,l);(f=p.diffed)&&f(_)}function ke(e,_,t){_.__d=void 0;for(var o=0;o<t.length;o++)X(t[o],t[++o],t[++o]);p.__c&&p.__c(_,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){p.__e(r,n.__v)}})}function Ee(e,_,t,o,n,r,c,s,u){var l,f,i,d,a,y,w,g=t.props,h=_.props,b=_.type;if(b==="svg"&&(n=!0),r!=null){for(l=0;l<r.length;l++)if((a=r[l])&&"setAttribute"in a==!!b&&(b?a.localName===b:a.nodeType===3)){e=a,r[l]=null;break}}if(e==null){if(b===null)return document.createTextNode(h);e=n?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,h.is&&h),r=null,s=!1}if(b===null)g===h||s&&e.data===h||(e.data=h);else{if(r=r&&M.call(e.childNodes),g=t.props||N,!s&&r!=null)for(g={},l=0;l<e.attributes.length;l++)g[(a=e.attributes[l]).name]=a.value;for(l in g)a=g[l],l=="children"||(l=="dangerouslySetInnerHTML"?i=a:l==="key"||l in h||A(e,l,null,a,n));for(l in h)a=h[l],l=="children"?d=a:l=="dangerouslySetInnerHTML"?f=a:l=="value"?y=a:l=="checked"?w=a:l==="key"||s&&typeof a!="function"||g[l]===a||A(e,l,a,g[l],n);if(f)s||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),_.__k=[];else if(i&&(e.innerHTML=""),ge(e,Q(d)?d:[d],_,t,o,n&&b!=="foreignObject",r,c,r?r[0]:t.__k&&$(t,0),s,u),r!=null)for(l=r.length;l--;)r[l]!=null&&me(r[l]);s||(l="value",y!==void 0&&(y!==e[l]||b==="progress"&&!y||b==="option"&&y!==g[l])&&A(e,l,y,g[l],!1),l="checked",w!==void 0&&w!==e[l]&&A(e,l,w,g[l],!1))}return e}function X(e,_,t){try{typeof e=="function"?e(_):e.current=_}catch(o){p.__e(o,t)}}function z(e,_,t){var o,n;if(p.unmount&&p.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||X(o,null,_)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){p.__e(r,_)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&z(o[n],_,t||typeof e.type!="function");t||e.__e==null||me(e.__e),e.__=e.__e=e.__d=void 0}function Ue(e,_,t){return this.constructor(e,t)}function Le(e,_,t){var o,n,r,c;p.__&&p.__(e,_),n=(o=typeof t=="function")?null:t&&t.__k||_.__k,r=[],c=[],J(_,e=(!o&&t||_).__k=He(V,null,[e]),n||N,N,_.ownerSVGElement!==void 0,!o&&t?[t]:n?null:_.firstChild?M.call(_.childNodes):null,r,!o&&t?t:n?n.__e:_.firstChild,o,c),ke(r,e,c)}function we(e,_){var t={__c:_="__cC"+he++,__:e,Consumer:function(o,n){return o.children(n)},Provider:function(o){var n,r;return this.getChildContext||(n=[],(r={})[_]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(c){this.props.value!==c.value&&n.some(function(s){s.__e=!0,j(s)})},this.sub=function(c){n.push(c);var s=c.componentWillUnmount;c.componentWillUnmount=function(){n.splice(n.indexOf(c),1),s&&s.call(c)}}),o.children}};return t.Provider.__=t.Consumer.contextType=t}M=ve.slice,p={__e:function(e,_,t,o){for(var n,r,c;_=_.__;)if((n=_.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(e)),c=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),c=n.__d),c)return n.__E=n}catch(s){e=s}throw e}},de=0,D.prototype.setState=function(e,_){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=P({},this.state),typeof e=="function"&&(e=e(P({},t),this.props)),e&&P(t,e),e!=null&&this.__v&&(_&&this._sb.push(_),j(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),j(this))},D.prototype.render=V,C=[],pe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,B=function(e,_){return e.__v.__b-_.__v.__b},O.__r=0,he=0;var Te=0;function H(e,_,t,o,n,r){var c,s,u={};for(s in _)s=="ref"?c=_[s]:u[s]=_[s];var l={type:e,props:u,key:t,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Te,__i:-1,__u:0,__source:n,__self:r};if(typeof e=="function"&&(c=e.defaultProps))for(s in c)u[s]===void 0&&(u[s]=c[s]);return p.vnode&&p.vnode(l),l}var E,v,q,oe,G=0,xe=[],F=[],m=p,re=m.__b,ie=m.__r,ce=m.diffed,se=m.__c,le=m.unmount,ue=m.__;function Y(e,_){m.__h&&m.__h(v,e,G||_),G=0;var t=v.__H||(v.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({__V:F}),t.__[e]}function ae(e){return G=1,Ae(Pe,e)}function Ae(e,_,t){var o=Y(E++,2);if(o.t=e,!o.__c&&(o.__=[t?t(_):Pe(void 0,_),function(s){var u=o.__N?o.__N[0]:o.__[0],l=o.t(u,s);u!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=v,!v.u)){var n=function(s,u,l){if(!o.__c.__H)return!0;var f=o.__c.__H.__.filter(function(d){return!!d.__c});if(f.every(function(d){return!d.__N}))return!r||r.call(this,s,u,l);var i=!1;return f.forEach(function(d){if(d.__N){var a=d.__[0];d.__=d.__N,d.__N=void 0,a!==d.__[0]&&(i=!0)}}),!(!i&&o.__c.props===s)&&(!r||r.call(this,s,u,l))};v.u=!0;var r=v.shouldComponentUpdate,c=v.componentWillUpdate;v.componentWillUpdate=function(s,u,l){if(this.__e){var f=r;r=void 0,n(s,u,l),r=f}c&&c.call(this,s,u,l)},v.shouldComponentUpdate=n}return o.__N||o.__}function We(e,_){var t=Y(E++,3);!m.__s&&Oe(t.__H,_)&&(t.__=e,t.i=_,v.__H.__h.push(t))}function De(e){var _=v.context[e.__c],t=Y(E++,9);return t.c=e,_?(t.__==null&&(t.__=!0,_.sub(v)),_.props.value):e.__}function Fe(){for(var e;e=xe.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(I),e.__H.__h.forEach(K),e.__H.__h=[]}catch(_){e.__H.__h=[],m.__e(_,e.__v)}}m.__b=function(e){v=null,re&&re(e)},m.__=function(e,_){e&&_.__k&&_.__k.__m&&(e.__m=_.__k.__m),ue&&ue(e,_)},m.__r=function(e){ie&&ie(e),E=0;var _=(v=e.__c).__H;_&&(q===v?(_.__h=[],v.__h=[],_.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=F,t.__N=t.i=void 0})):(_.__h.forEach(I),_.__h.forEach(K),_.__h=[],E=0)),q=v},m.diffed=function(e){ce&&ce(e);var _=e.__c;_&&_.__H&&(_.__H.__h.length&&(xe.push(_)!==1&&oe===m.requestAnimationFrame||((oe=m.requestAnimationFrame)||Ie)(Fe)),_.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==F&&(t.__=t.__V),t.i=void 0,t.__V=F})),q=v=null},m.__c=function(e,_){_.some(function(t){try{t.__h.forEach(I),t.__h=t.__h.filter(function(o){return!o.__||K(o)})}catch(o){_.some(function(n){n.__h&&(n.__h=[])}),_=[],m.__e(o,t.__v)}}),se&&se(e,_)},m.unmount=function(e){le&&le(e);var _,t=e.__c;t&&t.__H&&(t.__H.__.forEach(function(o){try{I(o)}catch(n){_=n}}),t.__H=void 0,_&&m.__e(_,t.__v))};var fe=typeof requestAnimationFrame=="function";function Ie(e){var _,t=function(){clearTimeout(o),fe&&cancelAnimationFrame(_),setTimeout(e)},o=setTimeout(t,100);fe&&(_=requestAnimationFrame(t))}function I(e){var _=v,t=e.__c;typeof t=="function"&&(e.__c=void 0,t()),v=_}function K(e){var _=v;e.__c=e.__(),v=_}function Oe(e,_){return!e||e.length!==_.length||_.some(function(t,o){return t!==e[o]})}function Pe(e,_){return typeof _=="function"?_(e):_}let Ce=we({});const Me=e=>Ce=we({...e}),Ve=()=>De(Ce),Re={clientId:"apollo-promoted-benefits-app"},qe=async(e,_,t,o)=>{const n=new Headers;n.append("Content-Type","application/x-www-form-urlencoded");let r;const c=new URLSearchParams;c.append("grant_type","authorization_code"),c.append("code",_),c.append("client_id",t),c.append("redirect_uri",o);const s=await fetch(`${e}/connect/token`,{method:"POST",headers:n,body:c});return s.ok&&(r=await s.json()),r},Be=e=>{if(e)return{accessToken:e.access_token,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},je=e=>new URLSearchParams(window.location.search).get(e)??void 0,ze=()=>{const e=window.location.hostname;switch(!0){case(e.startsWith("autodev")||e.startsWith("localhost")):return"https://autodev-identity.flarehr.com";case e.startsWith("test"):return"https://test-identity.flarehr.com";case e.startsWith("sandbox"):return"https://sandbox-identity.flarehr.com";case e.startsWith("identity"):return"https://identity.flarehr.com";default:return}},Ge=async()=>{const e=ze(),_=je("code"),t=Re.clientId,o=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e||!_))return Be(await qe(e,_,t,o))},Ke=()=>{const[e,_]=ae({}),[t,o]=ae(!1);Me(e);const n=Ve();return We(()=>{(async()=>{if(!t){const r=await Ge();r&&_(r),o(!0)}})()},[]),t?n.isLoggedIn?H("div",{className:"text-3xl font-bold",children:H("h1",{children:"Hello World!"})}):H("div",{className:"text-3xl font-bold danger",children:H("h1",{children:"Auth failed"})}):H("p",{children:"Loading..."})};Le(H(Ke,{}),document.body);
|
package/dist/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
margin: 0;
|
|
9
9
|
}
|
|
10
10
|
</style>
|
|
11
|
-
<script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-Du0cJXjQ.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/promoted-benefits/app/v1.0/assets/index-BRG82v_N.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){const _=document.createElement("link").relList;if(_&&_.supports&&_.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function t(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(n){if(n.ep)return;n.ep=!0;const r=t(n);fetch(n.href,r)}})();var M,p,pe,C,ee,he,B,ve,S={},me=[],He=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Q=Array.isArray;function P(e,_){for(var t in _)e[t]=_[t];return e}function ye(e){var _=e.parentNode;_&&_.removeChild(e)}function Ee(e,_,t){var o,n,r,c={};for(r in _)r=="key"?o=_[r]:r=="ref"?n=_[r]:c[r]=_[r];if(arguments.length>2&&(c.children=arguments.length>3?M.call(arguments,2):t),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)c[r]===void 0&&(c[r]=e.defaultProps[r]);return W(e,c,o,n,null)}function W(e,_,t,o,n){var r={type:e,props:_,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++pe,__i:-1,__u:0};return n==null&&p.vnode!=null&&p.vnode(r),r}function V(e){return e.children}function D(e,_){this.props=e,this.context=_}function $(e,_){if(_==null)return e.__?$(e.__,e.__i+1):null;for(var t;_<e.__k.length;_++)if((t=e.__k[_])!=null&&t.__e!=null)return t.__e;return typeof e.type=="function"?$(e):null}function ge(e){var _,t;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,_=0;_<e.__k.length;_++)if((t=e.__k[_])!=null&&t.__e!=null){e.__e=e.__c.base=t.__e;break}return ge(e)}}function j(e){(!e.__d&&(e.__d=!0)&&C.push(e)&&!O.__r++||ee!==p.debounceRendering)&&((ee=p.debounceRendering)||he)(O)}function O(){var e,_,t,o,n,r,c,l,s;for(C.sort(B);e=C.shift();)e.__d&&(_=C.length,o=void 0,r=(n=(t=e).__v).__e,l=[],s=[],(c=t.__P)&&((o=P({},n)).__v=n.__v+1,p.vnode&&p.vnode(o),J(c,o,n,t.__n,c.ownerSVGElement!==void 0,32&n.__u?[r]:null,l,r??$(n),!!(32&n.__u),s),o.__v=n.__v,o.__.__k[o.__i]=o,we(l,o,s),o.__e!=r&&ge(o)),C.length>_&&C.sort(B));O.__r=0}function be(e,_,t,o,n,r,c,l,s,u,f){var i,d,a,y,w,g=o&&o.__k||me,h=_.length;for(t.__d=s,Se(t,_,g),s=t.__d,i=0;i<h;i++)(a=t.__k[i])!=null&&typeof a!="boolean"&&typeof a!="function"&&(d=a.__i===-1?S:g[a.__i]||S,a.__i=i,J(e,a,d,n,r,c,l,s,u,f),y=a.__e,a.ref&&d.ref!=a.ref&&(d.ref&&X(d.ref,null,a),f.push(a.ref,a.__c||y,a)),w==null&&y!=null&&(w=y),65536&a.__u||d.__k===a.__k?(y||d.__e!=s||(s=$(d)),s=ke(a,s,e)):typeof a.type=="function"&&a.__d!==void 0?s=a.__d:y&&(s=y.nextSibling),a.__d=void 0,a.__u&=-196609);t.__d=s,t.__e=w}function Se(e,_,t){var o,n,r,c,l,s=_.length,u=t.length,f=u,i=0;for(e.__k=[],o=0;o<s;o++)c=o+i,(n=e.__k[o]=(n=_[o])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?W(null,n,null,null,null):Q(n)?W(V,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?W(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,l=Ue(n,t,c,f),n.__i=l,r=null,l!==-1&&(f--,(r=t[l])&&(r.__u|=131072)),r==null||r.__v===null?(l==-1&&i--,typeof n.type!="function"&&(n.__u|=65536)):l!==c&&(l===c+1?i++:l>c?f>s-c?i+=l-c:i--:l<c?l==c-1&&(i=l-c):i=0,l!==o+i&&(n.__u|=65536))):(r=t[c])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==e.__d&&(e.__d=$(r)),z(r,r,!1),t[c]=null,f--);if(f)for(o=0;o<u;o++)(r=t[o])!=null&&!(131072&r.__u)&&(r.__e==e.__d&&(e.__d=$(r)),z(r,r))}function ke(e,_,t){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,_=ke(o[n],_,t));return _}e.__e!=_&&(t.insertBefore(e.__e,_||null),_=e.__e);do _=_&&_.nextSibling;while(_!=null&&_.nodeType===8);return _}function Ue(e,_,t,o){var n=e.key,r=e.type,c=t-1,l=t+1,s=_[t];if(s===null||s&&n==s.key&&r===s.type&&!(131072&s.__u))return t;if(o>(s!=null&&!(131072&s.__u)?1:0))for(;c>=0||l<_.length;){if(c>=0){if((s=_[c])&&!(131072&s.__u)&&n==s.key&&r===s.type)return c;c--}if(l<_.length){if((s=_[l])&&!(131072&s.__u)&&n==s.key&&r===s.type)return l;l++}}return-1}function _e(e,_,t){_[0]==="-"?e.setProperty(_,t??""):e[_]=t==null?"":typeof t!="number"||He.test(_)?t:t+"px"}function A(e,_,t,o,n){var r;e:if(_==="style")if(typeof t=="string")e.style.cssText=t;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(_ in o)t&&_ in t||_e(e.style,_,"");if(t)for(_ in t)o&&t[_]===o[_]||_e(e.style,_,t[_])}else if(_[0]==="o"&&_[1]==="n")r=_!==(_=_.replace(/(PointerCapture)$|Capture$/i,"$1")),_=_.toLowerCase()in e||_==="onFocusOut"||_==="onFocusIn"?_.toLowerCase().slice(2):_.slice(2),e.l||(e.l={}),e.l[_+r]=t,t?o?t.u=o.u:(t.u=Date.now(),e.addEventListener(_,r?ne:te,r)):e.removeEventListener(_,r?ne:te,r);else{if(n)_=_.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(_!=="width"&&_!=="height"&&_!=="href"&&_!=="list"&&_!=="form"&&_!=="tabIndex"&&_!=="download"&&_!=="rowSpan"&&_!=="colSpan"&&_!=="role"&&_ in e)try{e[_]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&_[4]!=="-"?e.removeAttribute(_):e.setAttribute(_,t))}}function te(e){if(this.l){var _=this.l[e.type+!1];if(e.t){if(e.t<=_.u)return}else e.t=Date.now();return _(p.event?p.event(e):e)}}function ne(e){if(this.l)return this.l[e.type+!0](p.event?p.event(e):e)}function J(e,_,t,o,n,r,c,l,s,u){var f,i,d,a,y,w,g,h,b,x,N,E,Z,L,R,k=_.type;if(_.constructor!==void 0)return null;128&t.__u&&(s=!!(32&t.__u),r=[l=_.__e=t.__e]),(f=p.__b)&&f(_);e:if(typeof k=="function")try{if(h=_.props,b=(f=k.contextType)&&o[f.__c],x=f?b?b.props.value:f.__:o,t.__c?g=(i=_.__c=t.__c).__=i.__E:("prototype"in k&&k.prototype.render?_.__c=i=new k(h,x):(_.__c=i=new D(h,x),i.constructor=k,i.render=Le),b&&b.sub(i),i.props=h,i.state||(i.state={}),i.context=x,i.__n=o,d=i.__d=!0,i.__h=[],i._sb=[]),i.__s==null&&(i.__s=i.state),k.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=P({},i.__s)),P(i.__s,k.getDerivedStateFromProps(h,i.__s))),a=i.props,y=i.state,i.__v=_,d)k.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(k.getDerivedStateFromProps==null&&h!==a&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(h,x),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(h,i.__s,x)===!1||_.__v===t.__v)){for(_.__v!==t.__v&&(i.props=h,i.state=i.__s,i.__d=!1),_.__e=t.__e,_.__k=t.__k,_.__k.forEach(function(T){T&&(T.__=_)}),N=0;N<i._sb.length;N++)i.__h.push(i._sb[N]);i._sb=[],i.__h.length&&c.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(h,i.__s,x),i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(a,y,w)})}if(i.context=x,i.props=h,i.__P=e,i.__e=!1,E=p.__r,Z=0,"prototype"in k&&k.prototype.render){for(i.state=i.__s,i.__d=!1,E&&E(_),f=i.render(i.props,i.state,i.context),L=0;L<i._sb.length;L++)i.__h.push(i._sb[L]);i._sb=[]}else do i.__d=!1,E&&E(_),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++Z<25);i.state=i.__s,i.getChildContext!=null&&(o=P(P({},o),i.getChildContext())),d||i.getSnapshotBeforeUpdate==null||(w=i.getSnapshotBeforeUpdate(a,y)),be(e,Q(R=f!=null&&f.type===V&&f.key==null?f.props.children:f)?R:[R],_,t,o,n,r,c,l,s,u),i.base=_.__e,_.__u&=-161,i.__h.length&&c.push(i),g&&(i.__E=i.__=null)}catch(T){_.__v=null,s||r!=null?(_.__e=l,_.__u|=s?160:32,r[r.indexOf(l)]=null):(_.__e=t.__e,_.__k=t.__k),p.__e(T,_,t)}else r==null&&_.__v===t.__v?(_.__k=t.__k,_.__e=t.__e):_.__e=Ne(t.__e,_,t,o,n,r,c,s,u);(f=p.diffed)&&f(_)}function we(e,_,t){_.__d=void 0;for(var o=0;o<t.length;o++)X(t[o],t[++o],t[++o]);p.__c&&p.__c(_,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){p.__e(r,n.__v)}})}function Ne(e,_,t,o,n,r,c,l,s){var u,f,i,d,a,y,w,g=t.props,h=_.props,b=_.type;if(b==="svg"&&(n=!0),r!=null){for(u=0;u<r.length;u++)if((a=r[u])&&"setAttribute"in a==!!b&&(b?a.localName===b:a.nodeType===3)){e=a,r[u]=null;break}}if(e==null){if(b===null)return document.createTextNode(h);e=n?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,h.is&&h),r=null,l=!1}if(b===null)g===h||l&&e.data===h||(e.data=h);else{if(r=r&&M.call(e.childNodes),g=t.props||S,!l&&r!=null)for(g={},u=0;u<e.attributes.length;u++)g[(a=e.attributes[u]).name]=a.value;for(u in g)a=g[u],u=="children"||(u=="dangerouslySetInnerHTML"?i=a:u==="key"||u in h||A(e,u,null,a,n));for(u in h)a=h[u],u=="children"?d=a:u=="dangerouslySetInnerHTML"?f=a:u=="value"?y=a:u=="checked"?w=a:u==="key"||l&&typeof a!="function"||g[u]===a||A(e,u,a,g[u],n);if(f)l||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),_.__k=[];else if(i&&(e.innerHTML=""),be(e,Q(d)?d:[d],_,t,o,n&&b!=="foreignObject",r,c,r?r[0]:t.__k&&$(t,0),l,s),r!=null)for(u=r.length;u--;)r[u]!=null&&ye(r[u]);l||(u="value",y!==void 0&&(y!==e[u]||b==="progress"&&!y||b==="option"&&y!==g[u])&&A(e,u,y,g[u],!1),u="checked",w!==void 0&&w!==e[u]&&A(e,u,w,g[u],!1))}return e}function X(e,_,t){try{typeof e=="function"?e(_):e.current=_}catch(o){p.__e(o,t)}}function z(e,_,t){var o,n;if(p.unmount&&p.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||X(o,null,_)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){p.__e(r,_)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&z(o[n],_,t||typeof e.type!="function");t||e.__e==null||ye(e.__e),e.__=e.__e=e.__d=void 0}function Le(e,_,t){return this.constructor(e,t)}function Te(e,_,t){var o,n,r,c;p.__&&p.__(e,_),n=(o=typeof t=="function")?null:t&&t.__k||_.__k,r=[],c=[],J(_,e=(!o&&t||_).__k=Ee(V,null,[e]),n||S,S,_.ownerSVGElement!==void 0,!o&&t?[t]:n?null:_.firstChild?M.call(_.childNodes):null,r,!o&&t?t:n?n.__e:_.firstChild,o,c),we(r,e,c)}function xe(e,_){var t={__c:_="__cC"+ve++,__:e,Consumer:function(o,n){return o.children(n)},Provider:function(o){var n,r;return this.getChildContext||(n=[],(r={})[_]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(c){this.props.value!==c.value&&n.some(function(l){l.__e=!0,j(l)})},this.sub=function(c){n.push(c);var l=c.componentWillUnmount;c.componentWillUnmount=function(){n.splice(n.indexOf(c),1),l&&l.call(c)}}),o.children}};return t.Provider.__=t.Consumer.contextType=t}M=me.slice,p={__e:function(e,_,t,o){for(var n,r,c;_=_.__;)if((n=_.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(e)),c=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),c=n.__d),c)return n.__E=n}catch(l){e=l}throw e}},pe=0,D.prototype.setState=function(e,_){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=P({},this.state),typeof e=="function"&&(e=e(P({},t),this.props)),e&&P(t,e),e!=null&&this.__v&&(_&&this._sb.push(_),j(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),j(this))},D.prototype.render=V,C=[],he=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,B=function(e,_){return e.__v.__b-_.__v.__b},O.__r=0,ve=0;var Ae=0;function H(e,_,t,o,n,r){var c,l,s={};for(l in _)l=="ref"?c=_[l]:s[l]=_[l];var u={type:e,props:s,key:t,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ae,__i:-1,__u:0,__source:n,__self:r};if(typeof e=="function"&&(c=e.defaultProps))for(l in c)s[l]===void 0&&(s[l]=c[l]);return p.vnode&&p.vnode(u),u}var U,v,q,oe,G=0,Pe=[],F=[],m=p,re=m.__b,ie=m.__r,ce=m.diffed,le=m.__c,ue=m.unmount,se=m.__;function Y(e,_){m.__h&&m.__h(v,e,G||_),G=0;var t=v.__H||(v.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({__V:F}),t.__[e]}function ae(e){return G=1,We(Ce,e)}function We(e,_,t){var o=Y(U++,2);if(o.t=e,!o.__c&&(o.__=[t?t(_):Ce(void 0,_),function(l){var s=o.__N?o.__N[0]:o.__[0],u=o.t(s,l);s!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=v,!v.u)){var n=function(l,s,u){if(!o.__c.__H)return!0;var f=o.__c.__H.__.filter(function(d){return!!d.__c});if(f.every(function(d){return!d.__N}))return!r||r.call(this,l,s,u);var i=!1;return f.forEach(function(d){if(d.__N){var a=d.__[0];d.__=d.__N,d.__N=void 0,a!==d.__[0]&&(i=!0)}}),!(!i&&o.__c.props===l)&&(!r||r.call(this,l,s,u))};v.u=!0;var r=v.shouldComponentUpdate,c=v.componentWillUpdate;v.componentWillUpdate=function(l,s,u){if(this.__e){var f=r;r=void 0,n(l,s,u),r=f}c&&c.call(this,l,s,u)},v.shouldComponentUpdate=n}return o.__N||o.__}function De(e,_){var t=Y(U++,3);!m.__s&&Me(t.__H,_)&&(t.__=e,t.i=_,v.__H.__h.push(t))}function Fe(e){var _=v.context[e.__c],t=Y(U++,9);return t.c=e,_?(t.__==null&&(t.__=!0,_.sub(v)),_.props.value):e.__}function Ie(){for(var e;e=Pe.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(I),e.__H.__h.forEach(K),e.__H.__h=[]}catch(_){e.__H.__h=[],m.__e(_,e.__v)}}m.__b=function(e){v=null,re&&re(e)},m.__=function(e,_){e&&_.__k&&_.__k.__m&&(e.__m=_.__k.__m),se&&se(e,_)},m.__r=function(e){ie&&ie(e),U=0;var _=(v=e.__c).__H;_&&(q===v?(_.__h=[],v.__h=[],_.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=F,t.__N=t.i=void 0})):(_.__h.forEach(I),_.__h.forEach(K),_.__h=[],U=0)),q=v},m.diffed=function(e){ce&&ce(e);var _=e.__c;_&&_.__H&&(_.__H.__h.length&&(Pe.push(_)!==1&&oe===m.requestAnimationFrame||((oe=m.requestAnimationFrame)||Oe)(Ie)),_.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==F&&(t.__=t.__V),t.i=void 0,t.__V=F})),q=v=null},m.__c=function(e,_){_.some(function(t){try{t.__h.forEach(I),t.__h=t.__h.filter(function(o){return!o.__||K(o)})}catch(o){_.some(function(n){n.__h&&(n.__h=[])}),_=[],m.__e(o,t.__v)}}),le&&le(e,_)},m.unmount=function(e){ue&&ue(e);var _,t=e.__c;t&&t.__H&&(t.__H.__.forEach(function(o){try{I(o)}catch(n){_=n}}),t.__H=void 0,_&&m.__e(_,t.__v))};var fe=typeof requestAnimationFrame=="function";function Oe(e){var _,t=function(){clearTimeout(o),fe&&cancelAnimationFrame(_),setTimeout(e)},o=setTimeout(t,100);fe&&(_=requestAnimationFrame(t))}function I(e){var _=v,t=e.__c;typeof t=="function"&&(e.__c=void 0,t()),v=_}function K(e){var _=v;e.__c=e.__(),v=_}function Me(e,_){return!e||e.length!==_.length||_.some(function(t,o){return t!==e[o]})}function Ce(e,_){return typeof _=="function"?_(e):_}let $e=xe({});const Ve=e=>$e=xe({...e}),Re=()=>Fe($e),de=e=>({accessToken:e==null?void 0:e.access_token,isLoggedIn:!!(e!=null&&e.access_token),expiresIn:e==null?void 0:e.expires_in}),qe={clientId:"apollo-promoted-benefits-app"},Be=async(e,_,t,o)=>{try{const n=new Headers;n.append("Content-Type","application/x-www-form-urlencoded");const r=new URLSearchParams;r.append("grant_type","authorization_code"),r.append("code",_),r.append("client_id",t),r.append("redirect_uri",o);const c=await fetch(`${e}/connect/token`,{method:"POST",headers:n,body:r});if(c.ok)return await c.json();throw new Error("Unexpected result from backend")}catch{throw new Error("Unexpected result from backend")}},je=e=>new URLSearchParams(window.location.search).get(e)??"",ze=()=>{const e=window.location.hostname;switch(!0){case(e.startsWith("autodev")||e.startsWith("localhost")):return"https://autodev-identity.flarehr.com";case e.startsWith("test"):return"https://test-identity.flarehr.com";case e.startsWith("sandbox"):return"https://sandbox-identity.flarehr.com";case e.startsWith("identity"):return"https://identity.flarehr.com"}},Ge=()=>{const e=ze(),_=je("code"),t=qe.clientId,o=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!e)throw new Error("identity url cannot be null");if(!_)throw new Error("auth code cannot be null");return Be(e,_,t,o)},Ke=()=>{const[e,_]=ae({}),[t,o]=ae(!1);Ve(e);const n=Re();return De(()=>{(async()=>{if(!t)try{const r=await Ge();r&&(_(de(r)),o(!0))}catch{_(de({})),o(!0)}})()},[]),t?n.isLoggedIn?H("div",{className:"text-3xl font-bold",children:H("h1",{children:"Hello World!"})}):H("div",{className:"text-3xl font-bold danger",children:H("h1",{children:"Auth failed"})}):H("p",{children:"Loading..."})};Te(H(Ke,{}),document.body);
|