@flarehr/workflows-app 2.39.1 → 2.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/workflows-app.js +1 -1
- package/package.json +1 -1
package/dist/workflows-app.js
CHANGED
|
@@ -7,4 +7,4 @@ function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterat
|
|
|
7
7
|
/*!
|
|
8
8
|
* Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com
|
|
9
9
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
10
|
-
*/const Up=(Fp=[],$(zp,{icon:jp},...Fp));var Fp,Gp,Hp,Wp,Vp,qp;function Yp(e){let t;const n=e.dispatch,r=e.allSteps,o=e.completedSteps,i=e.readyToCompleteStep,s=e.step;return $("div",{className:gr(" ",["row","mb-1"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col-2"]),children:vr.Children.toArray([Up]),onClick:e=>{n(new mh(1,function(e,t,n,r){return null==t?new ph(3,n,r):new ph(1,e,t,n,r)}(s,i,o,r)))}}),$("div",{className:gr(" ",["col-8","text-center"]),children:vr.Children.toArray([(t=dh(s),$("b",{children:[t]}))])}),$("div",{className:gr(" ",["col-2"])})])})}class Xp extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["backend-url","access-token"]}}class Zp extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["app-base-url"]}}class Jp extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["workflows-instance-id"]}}function Kp(e,t,n){return $(1===e.tag?ed.ComponentTagName:2===e.tag?td.ComponentTagName:3===e.tag?nd.ComponentTagName:4===e.tag?rd.ComponentTagName:5===e.tag?od.ComponentTagName:6===e.tag?sd.ComponentTagName:Qf.ComponentTagName,ml(t,1),...n)}function Qp(e){let t;return $("div",{className:gr(" ",["text-center"]),children:vr.Children.toArray([$("h4",{children:["Well done!"]}),(t=ei(["You've completed all the steps below.",$("br",{}),"You can review and edit your information by clicking the relevant step, or press Submit to continue."]),$("p",{children:vr.Children.toArray(Array.from(t))})),$("div",{className:gr(" ",["row","justify-content-center","mt-4","mx-1"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col-12","col-sm-6","col-md-4","text-left"]),children:vr.Children.toArray([$(yp,e)])})])})])})}function em(){let e;return $("div",{className:gr(" ",["text-center"]),children:vr.Children.toArray([$("h4",{children:["You're all set!"]}),(e=ei(["You have submitted all the required information and have successfully completed your onboarding.",$("br",{}),$("p",{children:["You can now close this browser tab."]})]),$("p",{children:vr.Children.toArray(Array.from(e))}))])})}function tm(e){const t=e.accessToken,n=e.appMode,r=Ia(function(e){const t=k$(e);return[new gh(Xf(t.sub),vd(t.workflow.instanceId),new vc(0),new ph(0),jo(),new uh(0)),cu()]}(t),(e,r)=>Nh(t,n,e,r),[]),o=r[0],i=r[1];Vs(Cc(()=>function(e,t){return Mh(e,t)}(o.ProcessInstanceId,t),e=>{i(new mh(0,e))}),[]),Vs(()=>{(window.ResizeObserver?new window.ResizeObserver(()=>{y$()}):new p$(()=>{y$()})).observe(document.body)},[]),Vs(()=>{const e=[o.ProcessInstance,o.CurrentView];let t;switch(t=2===e[0].tag?2===e[1].tag&&4===e[1].fields[0].tag?0:1:2,t){case 0:break;case 1:xu(Fo(zu(n)),2,2)}},[o.CurrentView,o.ProcessInstance]),Hs(()=>{window.addEventListener("step-completion",e=>{i(new mh(2,e))})});switch(o.ProcessInstance.tag){case 1:return $("div",{children:["Please wait..."]});case 3:case 2:return $("div",{className:gr(" ",["container-xl","pb-4"]),children:vr.Children.toArray(Array.from(Ei(_i(()=>Oi(Di(e=>$("style",{children:[e]}),o.CssOverrides),_i(()=>{let e;const r=o.CurrentView;switch(r.tag){case 1:{const e=r.fields[0],t=r.fields[1],n=r.fields[2],o=r.fields[3];return Oi(xi($("div",{className:gr(" ",["text-center"]),children:vr.Children.toArray([$("div",{className:gr(" ",["row","justify-content-center","mt-4","mx-1"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col-12","col-sm-6","col-md-4","text-left"]),children:vr.Children.toArray([$(yp,{dispatch:i,state:null==t?new hp(1,e,n,o):new hp(0,e,t,n,o)})])})])})])})),_i(()=>(b$(0),Si())))}case 2:{const s=r.fields[0],a=r.fields[1],c=r.fields[2],u=r.fields[3];return xi((e=Ei(_i(()=>Oi(Ho(u)>1?xi($("div",{className:gr(" ",["pt-2"]),children:vr.Children.toArray([$(Yp,{step:s,readyToCompleteStep:a,completedSteps:c,allSteps:u,dispatch:i}),$(Cp,{dispatch:i,state:null==a?new hp(1,s,c,u):new hp(0,s,a,c,u)})])})):Si(),_i(()=>xi($("div",{className:gr(" ",["row","px-1"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col-12","rounded-lg","border","p-3"]),style:{backgroundColor:"#FFFFFF"},children:vr.Children.toArray(Array.from(Ei(_i(()=>{if(4===s.tag)return 0===Lu.tag?hr(window.location.pathname,"/")?Oi(xi(Kp(new ch(4),[new Xp(1,t),new Xp(0,lr(ar("%s/super-selection/backend/v1.0/"))(Nu)),new Zp(0,zu(n))],[])),_i(()=>(b$(2500),Si()))):(i(new mh(6)),Si()):(i(new mh(1,new ph(4,Lu.fields[0]))),Si());{const e=s;return Oi(xi(Kp(e,Ei(_i(()=>Oi(xi(new Xp(1,t)),_i(()=>Oi(xi(new Xp(0,Nu)),_i(()=>gn(e,new ch(6))?xi(new Jp(0,cn(_d(o.ProcessInstanceId)))):Si())))))),[])),_i(()=>(b$(1500),Si())))}}))))})])})))))),$("div",{children:vr.Children.toArray(Array.from(e))})))}case 3:return Oi(xi($("div",{className:gr(" ",["pt-5"]),children:vr.Children.toArray([$(Qp,{dispatch:i,state:new hp(1,void 0,r.fields[0],r.fields[1])})])})),_i(()=>(b$(0),Si())));case 4:return Oi(xi($("div",{className:gr(" ",["text-center","mt-5"]),children:"We had an issue. Please try again shortly."})),_i(()=>(b$(0),Si())));case 5:return xi($("div",{className:gr(" ",["mt-5"]),children:vr.Children.toArray([$(em,null)])}));default:return xi($("div",{children:["Please wait..."]}))}}))))))});default:return $("div",{children:["Please wait..."]})}}class nm extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["HasNotStartedYet","InProgress","Resolved"]}}class rm extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Started","Finished"]}}class om extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["AuthCode"]}}function im(e){return new om(0,e)}class sm extends er{constructor(e,t,n,r,o,i){super(),this.id_token=e,this.access_token=t,this.expires_in=n,this.refresh_token=r,this.scope=o,this.token_type=i}}function am(){return Br("Workflows.UI.Auth.Types.Credentials",[],sm,()=>[["id_token",Gr],["access_token",Gr],["expires_in",Vr],["refresh_token",jr(Gr)],["scope",Gr],["token_type",Gr]])}class cm extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["SignIn"]}}class um extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Home","InviteValidation","AuthCodeExchange","NotFound","LoggedOut"]}}function lm(e){let t,n,r,o,i,s,a;const c=function(e){let t,n,r;switch(Go(e)?t=2:"workflows"===Wo(e)?Go(qo(e))?t=2:"app"===Wo(qo(e))?(t=0,n=qo(qo(e))):"embed"===Wo(qo(e))?Go(qo(qo(e)))?t=2:"v1.0"===Wo(qo(qo(e)))?(t=1,r=qo(qo(qo(e)))):t=2:t=2:t=2,t){case 0:return new ua(1,n);case 1:return new ua(0,r);case 2:return new ua(2,void 0)}}(e);return 1===c.tag?[Go(c.fields[0])?Go(c.fields[0])?new um(0):(o=Ou(Wo(c.fields[0])),null!=o?Go(o)?new um(0):"code"===Wo(o)[0]&&Go(qo(o))&&Go(qo(c.fields[0]))?(i=Wo(o)[1],new um(2,im(i))):new um(0):new um(0)):(t=Ou(Wo(c.fields[0])),null!=t?Go(t)?Go(c.fields[0])?new um(0):(o=Ou(Wo(c.fields[0])),null!=o?Go(o)?new um(0):"code"===Wo(o)[0]&&Go(qo(o))&&Go(qo(c.fields[0]))?(i=Wo(o)[1],new um(2,im(i))):new um(0):new um(0)):"invite"===Wo(t)[0]&&Go(qo(t))&&Go(qo(c.fields[0]))?(n=Wo(t)[1],r=jc(n),1===r.tag?new um(3):new um(1,r.fields[0])):Go(c.fields[0])?new um(0):(o=Ou(Wo(c.fields[0])),null!=o?Go(o)?new um(0):"code"===Wo(o)[0]&&Go(qo(o))&&Go(qo(c.fields[0]))?(i=Wo(o)[1],new um(2,im(i))):new um(0):new um(0)):Go(c.fields[0])?new um(0):(o=Ou(Wo(c.fields[0])),null!=o?Go(o)?new um(0):"code"===Wo(o)[0]&&Go(qo(o))&&Go(qo(c.fields[0]))?(i=Wo(o)[1],new um(2,im(i))):new um(0):new um(0))),new Bu(1)]:2===c.tag?[new um(3),new Bu(2)]:[Go(c.fields[0])||Go(qo(c.fields[0]))?new um(0):(s=Ou(Wo(qo(c.fields[0]))),null!=s?Go(s)?new um(0):"code"===Wo(s)[0]?Go(qo(s))?new um(0):"scope"===Wo(qo(s))[0]?Go(qo(qo(s)))?new um(0):"session_state"===Wo(qo(qo(s)))[0]&&Go(qo(qo(qo(s))))&&Go(qo(qo(c.fields[0])))?(a=Wo(s)[1],new um(2,im(a))):new um(0):new um(0):new um(0):new um(0)),new Bu(0)]}class fm extends er{constructor(e,t,n){super(),this.CurrentPage=e,this.Credentials=t,this.AppMode=n}}class dm extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["UrlChanged","AuthMsg","DisplayLoggedOut"]}}class $m extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Writable","ReadWritable"]}}class hm{constructor(e){this.state=new $m(0,xo(new Array(bn((e,t)=>yn(e,t),e,10)),0,bn((e,t)=>yn(e,t),e,10),null),0)}}function pm(e){const t=e.state;if(1===t.tag){const n=0|t.fields[1],r=0|t.fields[2],o=t.fields[0],i=(r+1)%o.length|0;return e.state=i===n?new $m(0,o,n):new $m(1,o,n,i),ho(o[r])}}function mm(e,t){const n=e.state;if(1===n.tag){const i=0|n.fields[1],s=0|n.fields[2],a=n.fields[0];a[i]=t;const c=(i+1)%a.length|0;e.state=c===s?new $m(1,(r=s,o=a,Array.from(_i(()=>Oi(Bi(r,o),_i(()=>Oi(zi(r,o),_i(()=>Li(e=>xi(null),Ds(0,1,o.length))))))))),a.length,0):new $m(1,a,c,s)}else{const r=0|n.fields[1],o=n.fields[0];o[r]=t;const i=(r+1)%o.length|0;e.state=new $m(1,o,i,r)}var r,o}class gm extends er{constructor(e,t,n,r,o,i,s){super(),this.init=e,this.update=t,this.subscribe=n,this.view=r,this.setState=o,this.onError=i,this.syncDispatch=s}}function wm(e,t){return new gm(t.init,t.update,t.subscribe,t.view,e,t.onError,t.syncDispatch)}function ym(e){return En(2,e.view)}function vm(e,t){const n=t.init(e),r=n[0],o=new hm(10);let i=!1,s=r;const a=kn(1,t.syncDispatch,[e=>{if(i)mm(o,e);else{i=!0;let n=ho(e);for(;null!=n;){const e=po(n);try{const n=t.update(e,s),r=n[0];t.setState(r,a),au(n=>{t.onError([lr(ar("Error in command while handling: %A"))(e),n])},a,n[1]),s=r}catch(n){t.onError([lr(ar("Unable to process the message: %A"))(e),n])}n=pm(o)}i=!1}}]);t.setState(r,a),au(e=>{t.onError(["Error intitializing:",e])},a,lu(ei([(()=>{try{return t.subscribe(r)}catch(e){return t.onError(["Unable to subscribe:",e]),cu()}})(),n[1]])))}class _m extends er{constructor(e,t,n){super(),this.model=e,this.render=t,this.equal=n}}class bm extends m{constructor(e){super(e)}shouldComponentUpdate(e,t){return!this.props.equal(this.props.model,e.model)}render(){return this.props.render()}}function Cm(e,t,n,r){return $(bm,new _m(n,()=>t(n,r),e))}function Sm(e,t,n){return wm((r,o)=>{Se(e((e,t)=>e===t,xn(2,ym(n)),r,o),document.getElementById(t))},n)}function xm(e,t){const n=encodeURIComponent(t.fields[0]);const r=encodeURIComponent("apollo-workflows-app"),o=encodeURIComponent((i=new Bu(0),`${window.location.protocol}//${window.location.host}${zu(i)}`));var i;return Xu(0,()=>{let e,t;const i=oa.Bind(ul((t=sl(new Zu(1),il(Pu+"/connect/token")),e=al(nl("application/x-www-form-urlencoded"),t),cl(new Ku(1,`grant_type=authorization_code&code=${n}&client_id=${r}&redirect_uri=${o}`),e))),e=>oa.Return(new ia(0,e)));return oa.Delay(()=>oa.Bind(i,e=>{let t;const n=e;return 1===n.tag?oa.Return(new ia(1,n.fields[0])):oa.ReturnFrom((t=n.fields[0],200===t.statusCode?oa.Return(Af(t.responseText,void 0,void 0,{ResolveType:am})):oa.Return(new ia(1,"Unexpected result from backend"))))}))})}function Im(){return vo(e=>{return 1===(t=Af(e,void 0,void 0,{ResolveType:am})).tag?void 0:ho(t.fields[0]);var t},mo(window.sessionStorage.getItem("credentials")))}function Em(e,t){const n=function(e){return[new nm(0),fu(new cm(0,new rm(0),e))]}(t);return[new fm(e.CurrentPage,n[0],e.AppMode),uu(e=>new dm(1,e),n[1])]}function km(e,t){switch(e.tag){case 1:{const n=function(e,t,n){let r;return 1===e.fields[0].tag?1===e.fields[0].fields[0].tag?[new nm(2,new ia(1,"SignIn failed: "+e.fields[0].fields[0].fields[0])),cu()]:(window.gtag&&window.gtag("event","oidc_sign_in",{}),[new nm(2,new ia(0,e.fields[0].fields[0].fields[0])),(r=window.location.pathname,Fo(e=>{xu(Fo(r),1,2)}))]):[new nm(1),du(e=>{$u(e)},e=>xm(0,e),e.fields[1],t=>{const n=[new rm(1,t),e.fields[1]];return new cm(0,n[0],n[1])},t=>{const n=[new rm(1,new ia(1,t.message)),e.fields[1]];return new cm(0,n[0],n[1])})]}(e.fields[0],t.Credentials,t.AppMode),r=n[0],o=[r,t.AppMode];let i,s;switch(2===o[0].tag&&0===o[0].fields[0].tag&&1===o[1].tag?(i=0,s=o[0].fields[0].fields[0]):i=1,i){case 0:!function(e){const t=["credentials",Th(0,new sm(e.id_token,e.access_token,e.expires_in,void 0,e.scope,e.token_type),void 0,void 0,void 0,{ResolveType:am})];window.sessionStorage.setItem(t[0],t[1])}(s)}return[new fm(t.CurrentPage,r,t.AppMode),uu(e=>new dm(1,e),n[1])]}case 2:return[new fm(new um(4),t.Credentials,t.AppMode),cu()];default:{const n=lm(e.fields[0])[0],r=new fm(n,t.Credentials,t.AppMode);return 2===n.tag?Em(r,n.fields[0]):[r,cu()]}}}function Tm(e,t){const n=$("div",{className:gr(" ",["workflows-app"]),children:vr.Children.toArray(Array.from(Ei(_i(()=>{const t=e.CurrentPage;switch(t.tag){case 2:return xi(function(){let e,t;return $("div",{className:gr(" ",["container","vh-100","fade-in"]),children:vr.Children.toArray([$("div",{className:gr(" ",["row","h-100","justify-content-center","align-items-center"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col","col-sm-10","col-md-8","col-lg-5","card","border-light","rounded-lg","shadow-sm"]),children:vr.Children.toArray([$("div",{className:"card-body",children:vr.Children.toArray([$("div",{className:gr(" ",["pt-4","text-center"]),children:vr.Children.toArray([$("i",{className:gr(" ",["fas","fa-5x","fa-shield-check","text-success"])}),$("h4",{className:gr(" ",["my-4","font-weight-normal","text-success"]),children:"Your identity is confirmed"}),$("p",{className:gr(" ",["mt-3","mb-5","text-muted"]),children:"You will be redirected in a moment."})])}),$("p",{className:gr(" ",["mt-5","mb-0","text-black-50","text-right"]),children:vr.Children.toArray([(e="Flare HR Pty Ltd © 2015-"+(t=jn(),Gn(t)),$("small",{children:[e]}))])})])})])})])})])})}());case 1:return xi($(C$,{inviteCode:t.fields[0]}));case 3:return xi($("h1",{children:["Not found"]}));case 4:return xi($(S$,null));default:{const t=e.Credentials;let n,r;switch(2===t.tag&&0===t.fields[0].tag?(n=0,r=t.fields[0].fields[0]):n=1,n){case 0:return xi($(tm,{appMode:e.AppMode,accessToken:r.access_token}));case 1:return xi($("h1",{children:["Unauthorised"]}))}}}}))))});return Eu({hashMode:2,onUrlChanged:e=>{t(new dm(0,e))},application:$(p,{},n)})}!function(e){vm(void 0,e)}((Gp="workflows-app",Wp=function(){const e=lm(Iu(window.location.pathname+window.location.search,2)),t=e[0],n=e[1],r=new fm(t,new nm(0),n);let o;switch(o=2===t.tag?0:1===t.tag?1:0===t.tag&&gn(n,new Bu(1))?2:3,o){case 0:return Em(r,t.fields[0]);case 1:return[r,cu()];case 2:{const e=Im();return null==e?[r,fu(new dm(2))]:[new fm(r.CurrentPage,new nm(2,new ia(0,e)),r.AppMode),cu()]}case 3:return[r,fu(new dm(2))]}},Vp=(e,t)=>km(e,t),qp=(e,t)=>Tm(e,t),Hp=new gm(Wp,Vp,e=>cu(),qp,(e,t)=>{qp(e,t)},e=>{iu(e[0],e[1])},xn(2,e=>e)),Sm((e,t,n,r)=>Cm(e,t,n,r),Gp,Hp)))}]);
|
|
10
|
+
*/const Up=(Fp=[],$(zp,{icon:jp},...Fp));var Fp,Gp,Hp,Wp,Vp,qp;function Yp(e){let t;const n=e.dispatch,r=e.allSteps,o=e.completedSteps,i=e.readyToCompleteStep,s=e.step;return $("div",{className:gr(" ",["row","mb-1"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col-2"]),children:vr.Children.toArray([Up]),onClick:e=>{n(new mh(1,function(e,t,n,r){return null==t?new ph(3,n,r):new ph(1,e,t,n,r)}(s,i,o,r)))}}),$("div",{className:gr(" ",["col-8","text-center"]),children:vr.Children.toArray([(t=dh(s),$("b",{children:[t]}))])}),$("div",{className:gr(" ",["col-2"])})])})}class Xp extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["backend-url","access-token"]}}class Zp extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["app-base-url"]}}class Jp extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["workflows-instance-id"]}}function Kp(e,t,n){return $(1===e.tag?ed.ComponentTagName:2===e.tag?td.ComponentTagName:3===e.tag?nd.ComponentTagName:4===e.tag?rd.ComponentTagName:5===e.tag?od.ComponentTagName:6===e.tag?sd.ComponentTagName:Qf.ComponentTagName,ml(t,1),...n)}function Qp(e){let t;return $("div",{className:gr(" ",["text-center"]),children:vr.Children.toArray([$("h4",{children:["Well done!"]}),(t=ei(["You've completed all the steps below.",$("br",{}),"You can review and edit your information by clicking the relevant step, or press Submit to continue."]),$("p",{children:vr.Children.toArray(Array.from(t))})),$("div",{className:gr(" ",["row","justify-content-center","mt-4","mx-1"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col-12","col-sm-6","col-md-4","text-left"]),children:vr.Children.toArray([$(yp,e)])})])})])})}function em(){let e;return $("div",{className:gr(" ",["text-center"]),children:vr.Children.toArray([$("h4",{children:["You're all set!"]}),(e=ei(["You have submitted all the required information and have successfully completed your onboarding.",$("br",{}),$("p",{children:["You can now close this browser tab."]})]),$("p",{children:vr.Children.toArray(Array.from(e))}))])})}function tm(e){const t=e.accessToken,n=e.appMode,r=Ia(function(e){const t=k$(e);return[new gh(Xf(t.sub),vd(t.workflow.instanceId),new vc(0),new ph(0),jo(),new uh(0)),cu()]}(t),(e,r)=>Nh(t,n,e,r),[]),o=r[0],i=r[1];Vs(Cc(()=>function(e,t){return Mh(e,t)}(o.ProcessInstanceId,t),e=>{i(new mh(0,e))}),[]),Vs(()=>{(window.ResizeObserver?new window.ResizeObserver(()=>{y$()}):new p$(()=>{y$()})).observe(document.body)},[]),Vs(()=>{const e=[o.ProcessInstance,o.CurrentView];let t;switch(t=2===e[0].tag?2===e[1].tag&&(4===e[1].fields[0].tag||5===e[1].fields[0].tag)?0:1:2,t){case 0:break;case 1:xu(Fo(zu(n)),2,2)}},[o.CurrentView,o.ProcessInstance]),Hs(()=>{window.addEventListener("step-completion",e=>{i(new mh(2,e))})});switch(o.ProcessInstance.tag){case 1:return $("div",{children:["Please wait..."]});case 3:case 2:return $("div",{className:gr(" ",["container-xl","pb-4"]),children:vr.Children.toArray(Array.from(Ei(_i(()=>Oi(Di(e=>$("style",{children:[e]}),o.CssOverrides),_i(()=>{let e;const r=o.CurrentView;switch(r.tag){case 1:{const e=r.fields[0],t=r.fields[1],n=r.fields[2],o=r.fields[3];return Oi(xi($("div",{className:gr(" ",["text-center"]),children:vr.Children.toArray([$("div",{className:gr(" ",["row","justify-content-center","mt-4","mx-1"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col-12","col-sm-6","col-md-4","text-left"]),children:vr.Children.toArray([$(yp,{dispatch:i,state:null==t?new hp(1,e,n,o):new hp(0,e,t,n,o)})])})])})])})),_i(()=>(b$(0),Si())))}case 2:{const s=r.fields[0],a=r.fields[1],c=r.fields[2],u=r.fields[3];return xi((e=Ei(_i(()=>Oi(Ho(u)>1?xi($("div",{className:gr(" ",["pt-2"]),children:vr.Children.toArray([$(Yp,{step:s,readyToCompleteStep:a,completedSteps:c,allSteps:u,dispatch:i}),$(Cp,{dispatch:i,state:null==a?new hp(1,s,c,u):new hp(0,s,a,c,u)})])})):Si(),_i(()=>xi($("div",{className:gr(" ",["row","px-1"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col-12","rounded-lg","border","p-3"]),style:{backgroundColor:"#FFFFFF"},children:vr.Children.toArray(Array.from(Ei(_i(()=>{if(4===s.tag)return 0===Lu.tag?hr(window.location.pathname,"/")?Oi(xi(Kp(new ch(4),[new Xp(1,t),new Xp(0,lr(ar("%s/super-selection/backend/v1.0/"))(Nu)),new Zp(0,zu(n))],[])),_i(()=>(b$(2500),Si()))):(i(new mh(6)),Si()):(i(new mh(1,new ph(4,Lu.fields[0]))),Si());{const e=s;return Oi(xi(Kp(e,Ei(_i(()=>Oi(xi(new Xp(1,t)),_i(()=>Oi(xi(new Xp(0,Nu)),_i(()=>gn(e,new ch(6))?xi(new Jp(0,cn(_d(o.ProcessInstanceId)))):Si())))))),[])),_i(()=>(b$(1500),Si())))}}))))})])})))))),$("div",{children:vr.Children.toArray(Array.from(e))})))}case 3:return Oi(xi($("div",{className:gr(" ",["pt-5"]),children:vr.Children.toArray([$(Qp,{dispatch:i,state:new hp(1,void 0,r.fields[0],r.fields[1])})])})),_i(()=>(b$(0),Si())));case 4:return Oi(xi($("div",{className:gr(" ",["text-center","mt-5"]),children:"We had an issue. Please try again shortly."})),_i(()=>(b$(0),Si())));case 5:return xi($("div",{className:gr(" ",["mt-5"]),children:vr.Children.toArray([$(em,null)])}));default:return xi($("div",{children:["Please wait..."]}))}}))))))});default:return $("div",{children:["Please wait..."]})}}class nm extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["HasNotStartedYet","InProgress","Resolved"]}}class rm extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Started","Finished"]}}class om extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["AuthCode"]}}function im(e){return new om(0,e)}class sm extends er{constructor(e,t,n,r,o,i){super(),this.id_token=e,this.access_token=t,this.expires_in=n,this.refresh_token=r,this.scope=o,this.token_type=i}}function am(){return Br("Workflows.UI.Auth.Types.Credentials",[],sm,()=>[["id_token",Gr],["access_token",Gr],["expires_in",Vr],["refresh_token",jr(Gr)],["scope",Gr],["token_type",Gr]])}class cm extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["SignIn"]}}class um extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Home","InviteValidation","AuthCodeExchange","NotFound","LoggedOut"]}}function lm(e){let t,n,r,o,i,s,a;const c=function(e){let t,n,r;switch(Go(e)?t=2:"workflows"===Wo(e)?Go(qo(e))?t=2:"app"===Wo(qo(e))?(t=0,n=qo(qo(e))):"embed"===Wo(qo(e))?Go(qo(qo(e)))?t=2:"v1.0"===Wo(qo(qo(e)))?(t=1,r=qo(qo(qo(e)))):t=2:t=2:t=2,t){case 0:return new ua(1,n);case 1:return new ua(0,r);case 2:return new ua(2,void 0)}}(e);return 1===c.tag?[Go(c.fields[0])?Go(c.fields[0])?new um(0):(o=Ou(Wo(c.fields[0])),null!=o?Go(o)?new um(0):"code"===Wo(o)[0]&&Go(qo(o))&&Go(qo(c.fields[0]))?(i=Wo(o)[1],new um(2,im(i))):new um(0):new um(0)):(t=Ou(Wo(c.fields[0])),null!=t?Go(t)?Go(c.fields[0])?new um(0):(o=Ou(Wo(c.fields[0])),null!=o?Go(o)?new um(0):"code"===Wo(o)[0]&&Go(qo(o))&&Go(qo(c.fields[0]))?(i=Wo(o)[1],new um(2,im(i))):new um(0):new um(0)):"invite"===Wo(t)[0]&&Go(qo(t))&&Go(qo(c.fields[0]))?(n=Wo(t)[1],r=jc(n),1===r.tag?new um(3):new um(1,r.fields[0])):Go(c.fields[0])?new um(0):(o=Ou(Wo(c.fields[0])),null!=o?Go(o)?new um(0):"code"===Wo(o)[0]&&Go(qo(o))&&Go(qo(c.fields[0]))?(i=Wo(o)[1],new um(2,im(i))):new um(0):new um(0)):Go(c.fields[0])?new um(0):(o=Ou(Wo(c.fields[0])),null!=o?Go(o)?new um(0):"code"===Wo(o)[0]&&Go(qo(o))&&Go(qo(c.fields[0]))?(i=Wo(o)[1],new um(2,im(i))):new um(0):new um(0))),new Bu(1)]:2===c.tag?[new um(3),new Bu(2)]:[Go(c.fields[0])||Go(qo(c.fields[0]))?new um(0):(s=Ou(Wo(qo(c.fields[0]))),null!=s?Go(s)?new um(0):"code"===Wo(s)[0]?Go(qo(s))?new um(0):"scope"===Wo(qo(s))[0]?Go(qo(qo(s)))?new um(0):"session_state"===Wo(qo(qo(s)))[0]&&Go(qo(qo(qo(s))))&&Go(qo(qo(c.fields[0])))?(a=Wo(s)[1],new um(2,im(a))):new um(0):new um(0):new um(0):new um(0)),new Bu(0)]}class fm extends er{constructor(e,t,n){super(),this.CurrentPage=e,this.Credentials=t,this.AppMode=n}}class dm extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["UrlChanged","AuthMsg","DisplayLoggedOut"]}}class $m extends Yn{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Writable","ReadWritable"]}}class hm{constructor(e){this.state=new $m(0,xo(new Array(bn((e,t)=>yn(e,t),e,10)),0,bn((e,t)=>yn(e,t),e,10),null),0)}}function pm(e){const t=e.state;if(1===t.tag){const n=0|t.fields[1],r=0|t.fields[2],o=t.fields[0],i=(r+1)%o.length|0;return e.state=i===n?new $m(0,o,n):new $m(1,o,n,i),ho(o[r])}}function mm(e,t){const n=e.state;if(1===n.tag){const i=0|n.fields[1],s=0|n.fields[2],a=n.fields[0];a[i]=t;const c=(i+1)%a.length|0;e.state=c===s?new $m(1,(r=s,o=a,Array.from(_i(()=>Oi(Bi(r,o),_i(()=>Oi(zi(r,o),_i(()=>Li(e=>xi(null),Ds(0,1,o.length))))))))),a.length,0):new $m(1,a,c,s)}else{const r=0|n.fields[1],o=n.fields[0];o[r]=t;const i=(r+1)%o.length|0;e.state=new $m(1,o,i,r)}var r,o}class gm extends er{constructor(e,t,n,r,o,i,s){super(),this.init=e,this.update=t,this.subscribe=n,this.view=r,this.setState=o,this.onError=i,this.syncDispatch=s}}function wm(e,t){return new gm(t.init,t.update,t.subscribe,t.view,e,t.onError,t.syncDispatch)}function ym(e){return En(2,e.view)}function vm(e,t){const n=t.init(e),r=n[0],o=new hm(10);let i=!1,s=r;const a=kn(1,t.syncDispatch,[e=>{if(i)mm(o,e);else{i=!0;let n=ho(e);for(;null!=n;){const e=po(n);try{const n=t.update(e,s),r=n[0];t.setState(r,a),au(n=>{t.onError([lr(ar("Error in command while handling: %A"))(e),n])},a,n[1]),s=r}catch(n){t.onError([lr(ar("Unable to process the message: %A"))(e),n])}n=pm(o)}i=!1}}]);t.setState(r,a),au(e=>{t.onError(["Error intitializing:",e])},a,lu(ei([(()=>{try{return t.subscribe(r)}catch(e){return t.onError(["Unable to subscribe:",e]),cu()}})(),n[1]])))}class _m extends er{constructor(e,t,n){super(),this.model=e,this.render=t,this.equal=n}}class bm extends m{constructor(e){super(e)}shouldComponentUpdate(e,t){return!this.props.equal(this.props.model,e.model)}render(){return this.props.render()}}function Cm(e,t,n,r){return $(bm,new _m(n,()=>t(n,r),e))}function Sm(e,t,n){return wm((r,o)=>{Se(e((e,t)=>e===t,xn(2,ym(n)),r,o),document.getElementById(t))},n)}function xm(e,t){const n=encodeURIComponent(t.fields[0]);const r=encodeURIComponent("apollo-workflows-app"),o=encodeURIComponent((i=new Bu(0),`${window.location.protocol}//${window.location.host}${zu(i)}`));var i;return Xu(0,()=>{let e,t;const i=oa.Bind(ul((t=sl(new Zu(1),il(Pu+"/connect/token")),e=al(nl("application/x-www-form-urlencoded"),t),cl(new Ku(1,`grant_type=authorization_code&code=${n}&client_id=${r}&redirect_uri=${o}`),e))),e=>oa.Return(new ia(0,e)));return oa.Delay(()=>oa.Bind(i,e=>{let t;const n=e;return 1===n.tag?oa.Return(new ia(1,n.fields[0])):oa.ReturnFrom((t=n.fields[0],200===t.statusCode?oa.Return(Af(t.responseText,void 0,void 0,{ResolveType:am})):oa.Return(new ia(1,"Unexpected result from backend"))))}))})}function Im(){return vo(e=>{return 1===(t=Af(e,void 0,void 0,{ResolveType:am})).tag?void 0:ho(t.fields[0]);var t},mo(window.sessionStorage.getItem("credentials")))}function Em(e,t){const n=function(e){return[new nm(0),fu(new cm(0,new rm(0),e))]}(t);return[new fm(e.CurrentPage,n[0],e.AppMode),uu(e=>new dm(1,e),n[1])]}function km(e,t){switch(e.tag){case 1:{const n=function(e,t,n){let r;return 1===e.fields[0].tag?1===e.fields[0].fields[0].tag?[new nm(2,new ia(1,"SignIn failed: "+e.fields[0].fields[0].fields[0])),cu()]:(window.gtag&&window.gtag("event","oidc_sign_in",{}),[new nm(2,new ia(0,e.fields[0].fields[0].fields[0])),(r=window.location.pathname,Fo(e=>{xu(Fo(r),1,2)}))]):[new nm(1),du(e=>{$u(e)},e=>xm(0,e),e.fields[1],t=>{const n=[new rm(1,t),e.fields[1]];return new cm(0,n[0],n[1])},t=>{const n=[new rm(1,new ia(1,t.message)),e.fields[1]];return new cm(0,n[0],n[1])})]}(e.fields[0],t.Credentials,t.AppMode),r=n[0],o=[r,t.AppMode];let i,s;switch(2===o[0].tag&&0===o[0].fields[0].tag&&1===o[1].tag?(i=0,s=o[0].fields[0].fields[0]):i=1,i){case 0:!function(e){const t=["credentials",Th(0,new sm(e.id_token,e.access_token,e.expires_in,void 0,e.scope,e.token_type),void 0,void 0,void 0,{ResolveType:am})];window.sessionStorage.setItem(t[0],t[1])}(s)}return[new fm(t.CurrentPage,r,t.AppMode),uu(e=>new dm(1,e),n[1])]}case 2:return[new fm(new um(4),t.Credentials,t.AppMode),cu()];default:{const n=lm(e.fields[0])[0],r=new fm(n,t.Credentials,t.AppMode);return 2===n.tag?Em(r,n.fields[0]):[r,cu()]}}}function Tm(e,t){const n=$("div",{className:gr(" ",["workflows-app"]),children:vr.Children.toArray(Array.from(Ei(_i(()=>{const t=e.CurrentPage;switch(t.tag){case 2:return xi(function(){let e,t;return $("div",{className:gr(" ",["container","vh-100","fade-in"]),children:vr.Children.toArray([$("div",{className:gr(" ",["row","h-100","justify-content-center","align-items-center"]),children:vr.Children.toArray([$("div",{className:gr(" ",["col","col-sm-10","col-md-8","col-lg-5","card","border-light","rounded-lg","shadow-sm"]),children:vr.Children.toArray([$("div",{className:"card-body",children:vr.Children.toArray([$("div",{className:gr(" ",["pt-4","text-center"]),children:vr.Children.toArray([$("i",{className:gr(" ",["fas","fa-5x","fa-shield-check","text-success"])}),$("h4",{className:gr(" ",["my-4","font-weight-normal","text-success"]),children:"Your identity is confirmed"}),$("p",{className:gr(" ",["mt-3","mb-5","text-muted"]),children:"You will be redirected in a moment."})])}),$("p",{className:gr(" ",["mt-5","mb-0","text-black-50","text-right"]),children:vr.Children.toArray([(e="Flare HR Pty Ltd © 2015-"+(t=jn(),Gn(t)),$("small",{children:[e]}))])})])})])})])})])})}());case 1:return xi($(C$,{inviteCode:t.fields[0]}));case 3:return xi($("h1",{children:["Not found"]}));case 4:return xi($(S$,null));default:{const t=e.Credentials;let n,r;switch(2===t.tag&&0===t.fields[0].tag?(n=0,r=t.fields[0].fields[0]):n=1,n){case 0:return xi($(tm,{appMode:e.AppMode,accessToken:r.access_token}));case 1:return xi($("h1",{children:["Unauthorised"]}))}}}}))))});return Eu({hashMode:2,onUrlChanged:e=>{t(new dm(0,e))},application:$(p,{},n)})}!function(e){vm(void 0,e)}((Gp="workflows-app",Wp=function(){const e=lm(Iu(window.location.pathname+window.location.search,2)),t=e[0],n=e[1],r=new fm(t,new nm(0),n);let o;switch(o=2===t.tag?0:1===t.tag?1:0===t.tag&&gn(n,new Bu(1))?2:3,o){case 0:return Em(r,t.fields[0]);case 1:return[r,cu()];case 2:{const e=Im();return null==e?[r,fu(new dm(2))]:[new fm(r.CurrentPage,new nm(2,new ia(0,e)),r.AppMode),cu()]}case 3:return[r,fu(new dm(2))]}},Vp=(e,t)=>km(e,t),qp=(e,t)=>Tm(e,t),Hp=new gm(Wp,Vp,e=>cu(),qp,(e,t)=>{qp(e,t)},e=>{iu(e[0],e[1])},xn(2,e=>e)),Sm((e,t,n,r)=>Cm(e,t,n,r),Gp,Hp)))}]);
|