@flarehr/superhero-import-app 0.28.0 → 0.30.0

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.
@@ -21,7 +21,7 @@ Thoth.Json.Net only support the following enum types:
21
21
  - uint32
22
22
  If you can't use one of these types, please pass an extra decoder.
23
23
  `))(c);return p=>m(p)}}else if(Bc(r))if(us(r)){const f=gt(c=>ot(e,t,!1,c),Vc(r));return c=>m=>Array.isArray(m)?wt(p=>qc(Jt(p)),Ca(0,f,c,m)):new h(1,[[c,new E(0,["an array",m])]])}else switch(de(jc(r))){case"Microsoft.FSharp.Core.FSharpOption`1[System.Object]":return o=ot(e,t,!0,pe(0,ht(r))),c=>m=>yd(V(o),c,m);case"Microsoft.FSharp.Collections.FSharpList`1[System.Object]":return i=ot(e,t,!1,pe(0,ht(r))),c=>m=>va(V(i),c,m);case"System.Collections.Generic.IEnumerable`1[System.Object]":return s=ot(e,t,!1,pe(0,ht(r))),c=>m=>bd(V(s),c,m);case"Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]":{const c=ot(e,t,!1,pe(0,ht(r))),m=ot(e,t,!1,pe(1,ht(r)));let p;const g=x([_=>w=>Id(V(c),V(m),_,w),(a=Sd(V(c),V(m)),_=>w=>va(V(a),_,w))]);return p=_=>w=>Ad(g,_,w),_=>w=>xd(Cd,V(p),_,w)}case"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]":{const c=ot(e,t,!1,pe(0,ht(r)));return m=>p=>{const g=xa(V(c),m,p);return g.tag===0?new h(0,[Ed(g.fields[0])]):new h(1,[g.fields[0]])}}default:return ka(e,t,n,r)}else switch(u){case"System.Boolean":return f=>c=>pd(f,c);case"Microsoft.FSharp.Core.Unit":return f=>c=>dd(f,c);case"System.String":return f=>c=>ha(f,c);case"System.Char":return f=>c=>ud(f,c);case"System.SByte":return ma;case"System.Byte":return ga;case"System.Int16":return wa;case"System.UInt16":return _a;case"System.Int32":return ya;case"System.UInt32":return ba;case"System.Double":return f=>c=>hd(f,c);case"System.Single":return f=>c=>md(f,c);case"System.DateTime":return f=>c=>gd(f,c);case"System.DateTimeOffset":return f=>c=>wd(f,c);case"System.TimeSpan":return f=>c=>_d(f,c);case"System.Guid":return f=>c=>fd(f,c);case"System.Object":return f=>c=>new h(0,[c]);default:return ka(e,t,n,r)}else{const f=l;return c=>m=>f.contents(c)(m)}}function Dd(e){return ea({Compare:so})}function sn(e,t,n){const r=Ss(t,new Dt(0,[]));return ot(Dd(),r,!1,e)}class Eo extends Y{constructor(t){super(),this.tag=0,this.fields=[t]}cases(){return["AccessRole"]}}function Td(e){return new Eo(e)}const Rd=new Eo("Import.RunInvites"),Md=new Eo("Import.RunImports");class Fd extends G{constructor(t,n){super(),this.UserName=t,this.Roles=n}}function Ia(e){return Ts(Rd,e.Roles,{Equals:ke,GetHashCode:os})}function Da(e){return Ts(Md,e.Roles,{Equals:ke,GetHashCode:os})}function Od(e){let t;const n=go(e??"",["."],void 0,0);if(!Eu((r,o)=>r===o,n)&&n.length===3){const r=pe(1,n),o=atob(r);t=on(V(sn(uo(["Name",le],["Roles",Fc(le)]),new Dt(1,[]))),o)}else t=new h(1,["Failed to identify the user"]);if(t.tag!==1){const r=t.fields[0];return new Fd(r.Name,x(gt(Td,r.Roles)))}}class Nd extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Profiles","Tax"]}}function ko(){return xn("Import.Dto.Shared.AdminApi.Read.ImportStageDto",[],Nd,()=>[[],[]])}class Pd extends G{constructor(t,n){super(),this.RowId=t|0,this.Reason=n}}function Bd(){return Ue("Import.Dto.Shared.AdminApi.Read.FailedRowInfoDto",[],Pd,()=>[["RowId",ce],["Reason",le]])}class jd extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Invite","RevokeInvite"]}}function $d(){return xn("Import.Dto.Shared.AdminApi.Read.BenefitsRequestTypeDto",[],jd,()=>[[],[]])}class Hd extends G{constructor(t,n,r,o){super(),this.User=t,this.ProfileCount=n|0,this.RequestType=r,this.RequestedAt=o}}function Ud(){return Ue("Import.Dto.Shared.AdminApi.Read.BenefitsRequestInfoDto",[],Hd,()=>[["User",le],["ProfileCount",ce],["RequestType",$d()],["RequestedAt",mt("System.DateTime")]])}class Vd extends G{constructor(t,n,r,o,i,s){super(),this.Stage=t,this.InputRowCount=n|0,this.StartTime=r,this.SucceededRowCount=o,this.FailedRowCount=i,this.RemainingRowCount=s}}function Ld(){return Ue("Import.Dto.Shared.AdminApi.Read.RunningStageDto",[],Vd,()=>[["Stage",ko()],["InputRowCount",ce],["StartTime",mt("System.DateTime")],["SucceededRowCount",Gt(ce)],["FailedRowCount",Gt(ce)],["RemainingRowCount",Gt(ce)]])}class zd extends G{constructor(t,n,r,o,i,s){super(),this.Stage=t,this.InputRowCount=n|0,this.SucceededRowCount=r|0,this.FailedRowCount=o|0,this.StartTime=i,this.StopTime=s}}function Ta(){return Ue("Import.Dto.Shared.AdminApi.Read.CompletedStageDto",[],zd,()=>[["Stage",ko()],["InputRowCount",ce],["SucceededRowCount",ce],["FailedRowCount",ce],["StartTime",mt("System.DateTime")],["StopTime",mt("System.DateTime")]])}class Gd extends G{constructor(t,n,r,o,i,s,a){super(),this.ImportId=t|0,this.User=n,this.Filename=r,this.NumberOfRecords=o|0,this.CurrentStage=i,this.CompletedStages=s,this.StartTime=a}}function Ra(){return Ue("Import.Dto.Shared.AdminApi.Read.ActiveImportDto",[],Gd,()=>[["ImportId",ce],["User",le],["Filename",le],["NumberOfRecords",ce],["CurrentStage",Gt(Ld())],["CompletedStages",st(Ta())],["StartTime",mt("System.DateTime")]])}class Wd extends G{constructor(t,n,r,o,i,s,a,u){super(),this.ImportId=t|0,this.User=n,this.Filename=r,this.NumberOfRecords=o|0,this.CompletedStages=i,this.BenefitsRequests=s,this.StartTime=a,this.StopTime=u}}function Ma(){return Ue("Import.Dto.Shared.AdminApi.Read.PastImportDto",[],Wd,()=>[["ImportId",ce],["User",le],["Filename",le],["NumberOfRecords",ce],["CompletedStages",st(Ta())],["BenefitsRequests",st(Ud())],["StartTime",mt("System.DateTime")],["StopTime",mt("System.DateTime")]])}class Fa extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Active","Complete"]}}function Qd(){return xn("Import.Dto.Shared.AdminApi.Read.ImportStatusDto",[],Fa,()=>[[["Item",Ra()]],[["Item",Ma()]]])}class qd extends G{constructor(t,n){super(),this.ActiveImport=t,this.ImportHistory=n}}function Zd(){return Ue("Import.Dto.Shared.AdminApi.Read.AccountImportsDto",[],qd,()=>[["ActiveImport",Gt(Ra())],["ImportHistory",st(Ma())]])}class Jd extends G{constructor(t,n){super(),this.Column=t,this.Message=n}}function Kd(){return Ue("Import.Dto.Shared.AdminApi.Read.FieldError",[],Jd,()=>[["Column",le],["Message",le]])}class Xd extends G{constructor(t,n){super(),this.RowId=t|0,this.FieldErrors=n}}function Yd(){return Ue("Import.Dto.Shared.AdminApi.Read.RowValidationError",[],Xd,()=>[["RowId",ce],["FieldErrors",st(Kd())]])}class ep extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["InvalidFileContentType","InvalidImportStages","InvalidImportStage","StageNotCompleted","InvalidFileName","ExceedsMaxRows","FileFormatError","NoData","NoFile","MultipleFiles","RowValidationErrors","UnknownAccount","ImportInProgress","BadInternalRequestPayload","DuplicateRowId","InternalApiDeserializationError","InternalApiClientError"]}}function tp(){return xn("Import.Dto.Shared.AdminApi.Read.ApiError",[],ep,()=>[[],[],[],[],[],[],[["Item",le]],[],[],[],[["Item",st(Yd())]],[],[],[],[],[["Item",uo(["Message",le])]],[["Item",uo(["Message",le])]]])}class np extends G{constructor(t,n,r,o,i,s,a){super(),this.Stage=t,this.FailedRows=n,this.TotalRowCount=r|0,this.SucceededRowCount=o|0,this.FailedRowCount=i|0,this.StartTime=s,this.StopTime=a}}function rp(){return Ue("Import.Dto.Shared.AdminApi.Read.CompletedStageDetailsDto",[],np,()=>[["Stage",ko()],["FailedRows",st(Bd())],["TotalRowCount",ce],["SucceededRowCount",ce],["FailedRowCount",ce],["StartTime",mt("System.DateTime")],["StopTime",mt("System.DateTime")]])}class op extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["MaxLength","Pattern","AllowedValues"]}}function ip(){return xn("Import.Dto.Shared.AdminApi.Read.ValidationRule",[],op,()=>[[["Item",ce]],[["Item",le]],[["Item",st(le)]]])}class sp extends G{constructor(t,n,r,o,i){super(),this.DisplayName=t,this.PropName=n,this.Description=r,this.Required=o,this.ValidationRules=i}}function ap(){return Ue("Import.Dto.Shared.AdminApi.Read.ColumnDefinitionDto",[],sp,()=>[["DisplayName",le],["PropName",le],["Description",Gt(le)],["Required",Nc],["ValidationRules",st(ip())]])}class lp extends G{constructor(t){super(),this.ColumnsInfo=t}}function cp(){return Ue("Import.Dto.Shared.AdminApi.Read.ImportSchemaDto",[],lp,()=>[["ColumnsInfo",st(ap())]])}class up{constructor(t=!1){this._id=0,this._cancelled=t,this._listeners=new Map}get isCancelled(){return this._cancelled}cancel(){if(!this._cancelled){this._cancelled=!0;for(const[,t]of this._listeners)t()}}addListener(t){const n=this._id;return this._listeners.set(this._id++,t),n}removeListener(t){return this._listeners.delete(t)}register(t,n){const r=this,o=this.addListener(n==null?t:()=>t(n));return{Dispose(){r.removeListener(o)}}}Dispose(){}}class yr extends Error{constructor(){super("The operation was canceled"),Object.setPrototypeOf(this,yr.prototype)}}class Io{static get maxTrampolineCallCount(){return 2e3}constructor(){this.callCount=0}incrementAndCheck(){return this.callCount++>Io.maxTrampolineCallCount}hijack(t){this.callCount=0,setTimeout(t,0)}}function _t(e){return t=>{if(t.cancelToken.isCancelled)t.onCancel(new yr);else if(t.trampoline.incrementAndCheck())t.trampoline.hijack(()=>{try{e(t)}catch(n){t.onError(er(n))}});else try{e(t)}catch(n){t.onError(er(n))}}}function fp(e,t){return _t(n=>{e({onSuccess:r=>{try{t(r)(n)}catch(o){n.onError(er(o))}},onError:n.onError,onCancel:n.onCancel,cancelToken:n.cancelToken,trampoline:n.trampoline})})}function dp(e){return _t(t=>t.onSuccess(e))}class pp{Bind(t,n){return fp(t,n)}Combine(t,n){return this.Bind(t,()=>n)}Delay(t){return _t(n=>t()(n))}For(t,n){const r=t[Symbol.iterator]();let o=r.next();return this.While(()=>!o.done,this.Delay(()=>{const i=n(o.value);return o=r.next(),i}))}Return(t){return dp(t)}ReturnFrom(t){return t}TryFinally(t,n){return _t(r=>{t({onSuccess:o=>{n(),r.onSuccess(o)},onError:o=>{n(),r.onError(o)},onCancel:o=>{n(),r.onCancel(o)},cancelToken:r.cancelToken,trampoline:r.trampoline})})}TryWith(t,n){return _t(r=>{t({onSuccess:r.onSuccess,onCancel:r.onCancel,cancelToken:r.cancelToken,trampoline:r.trampoline,onError:o=>{try{n(o)(r)}catch(i){r.onError(er(i))}}})})}Using(t,n){return this.TryFinally(n(t),()=>t.Dispose())}While(t,n){return t()?this.Bind(n,()=>this.While(t,n)):this.Return(void 0)}Zero(){return _t(t=>t.onSuccess(void 0))}}const A=new pp;function hp(e){return new Oa(0,[e])}function mp(e){return new Oa(1,[e])}class Oa extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Choice1Of2","Choice2Of2"]}}function gp(e){return hp(e)}function wp(e){return mp(e)}function Do(e){}const _p=new up;function yp(e){return _t(t=>{e({onSuccess:n=>t.onSuccess(gp(n)),onError:n=>t.onSuccess(wp(n)),onCancel:t.onCancel,cancelToken:t.cancelToken,trampoline:t.trampoline})})}function bp(e){return _t(t=>e([t.onSuccess,t.onError,t.onCancel]))}function Ap(e){return _t(t=>{let n;const r=setTimeout(()=>{t.cancelToken.removeListener(n),t.onSuccess(void 0)},e);n=t.cancelToken.addListener(()=>{clearTimeout(r),t.onCancel(new yr)})})}function vp(e,t){return xp(e,t)}function To(e,t){return vp(e,t)}function xp(e,t,n,r,o){typeof t!="function"&&(o=t,t=void 0);const i=new Io;e({onSuccess:t||Do,onError:Do,onCancel:Do,cancelToken:o||_p,trampoline:i})}class St extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]}}class Sp extends Y{constructor(t,n){super(),this.tag=0,this.fields=[t,n]}cases(){return["Header"]}}class Na extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Empty","Text","Binary","Form"]}}class Nn extends G{constructor(t,n,r,o,i,s,a,u){super(),this.url=t,this.method=n,this.headers=r,this.withCredentials=o,this.overridenMimeType=i,this.overridenResponseType=s,this.timeout=a,this.content=u}}class an extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Text","Blob","ArrayBuffer","Unknown"]}}class Pa extends G{constructor(t,n,r,o,i,s){super(),this.statusCode=t|0,this.responseText=n,this.responseType=r,this.responseUrl=o,this.responseHeaders=i,this.content=s}}function Mt(e){return new Sp("Authorization",e)}const Ft=new Nn("",new St(0,[]),he(),!1,void 0,void 0,void 0,new Na(0,[]));new Pa(0,"","","",ea({Compare:so}),new an(0,[""]));function Ba(e,t){return wu(t)?new Array(0):go(t,[e],void 0,0)}function Cp(e){switch(e.tag){case 1:return"POST";case 3:return"PATCH";case 2:return"PUT";case 4:return"DELETE";case 6:return"OPTIONS";case 5:return"HEAD";default:return"GET"}}function Ot(e){return new Nn(e,Ft.method,Ft.headers,Ft.withCredentials,Ft.overridenMimeType,Ft.overridenResponseType,Ft.timeout,Ft.content)}function Nt(e,t){return new Nn(t.url,e,t.headers,t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.timeout,t.content)}function Pt(e,t){return new Nn(t.url,t.method,Rn(t.headers,W(e)),t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.timeout,t.content)}function Ep(e,t){return new Nn(t.url,t.method,t.headers,t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.timeout,e)}function Bt(e){return bp(t=>{const n=new XMLHttpRequest;n.open(Cp(e.method),e.url),n.onreadystatechange=()=>{let u,l,f,c,m,p,g;n.readyState===4&&t[0]((u=(l=n.responseType,l===""||l==="text"?n.responseText:""),f=n.status|0,c=n.responseType,m=(p=n.responseType,p===""?new an(0,[n.responseText]):p==="text"?new an(0,[n.responseText]):p==="arraybuffer"?new an(2,[n.response]):p==="blob"?new an(1,[n.response]):new an(3,[n.response])),g=Gf(Cu(_=>{const w=x(Ba(":",_));if(!P(w))return[k(w).toLocaleLowerCase(),Me(":",N(w)).trim()]},Ba(`\r
24
- `,n.getAllResponseHeaders())),{Compare:so}),new Pa(f,u,c,n.responseURL,g,m)))};const r=ne(e.headers);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const u=r["System.Collections.Generic.IEnumerator`1.get_Current"]();n.setRequestHeader(u.fields[0],u.fields[1])}}finally{q(r)}n.withCredentials=e.withCredentials;const o=e.overridenMimeType;if(o!=null){const u=o;n.overrideMimeType(u)}const i=e.overridenResponseType;if(i!=null)switch(i.tag){case 1:{n.responseType="blob";break}case 2:{n.responseType="arraybuffer";break}default:n.responseType="text"}const s=e.timeout;if(s!=null){const u=s|0;n.timeout=u|0}const a=e.content;switch(a.tag){case 1:{n.send(Fe(a.fields[0]));break}case 3:{n.send(Fe(a.fields[0]));break}case 2:{n.send(Fe(a.fields[0]));break}default:n.send()}})}class Ro extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["BadRequest","OtherError"]}}class kp{constructor(t,n,r,o){this.backendUrl=t,this.accessToken=o,this.baseUrl=`${this.backendUrl}/import/admin/partners/${n}/accounts/${r}/imports`}}function Ip(e,t,n,r){return new kp(e,t,n,r)}function Dp(e){return A.Delay(()=>{let t,n;const r=Bt((t=Nt(new St(0,[]),Ot(`${e.backendUrl}/import/admin/schema`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),t)));return n=A.Bind(r,o=>A.Return(new h(0,[o]))),A.Bind(n,o=>{const i=o;if(i.tag===1)return A.Return(new h(1,[i.fields[0]]));{const s=i.fields[0];if(s.statusCode===200){const a=on(V(sn(cp(),new Dt(1,[]))),s.responseText);return A.Return(a)}else return A.Return(new h(1,["Failed to get import schema"]))}})})}function Tp(e,t){return A.Delay(()=>{let n,r;const o=Bt((n=Nt(new St(0,[]),Ot(`${e.baseUrl}/${t}/status`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),n)));return r=A.Bind(o,i=>A.Return(new h(0,[i]))),A.Bind(r,i=>{const s=i;if(s.tag===1)return A.Return(new h(1,[s.fields[0]]));{const a=s.fields[0];if(a.statusCode===200){const u=on(V(sn(Qd(),new Dt(1,[]))),a.responseText);return A.Return(u)}else return A.Return(new h(1,["Failed to get import status"]))}})})}function Rp(e,t,n){return A.Delay(()=>{let r,o;const i=Bt((r=Nt(new St(0,[]),Ot(`${e.baseUrl}/${t}/stages/${n}`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),r)));return o=A.Bind(i,s=>A.Return(new h(0,[s]))),A.Bind(o,s=>{const a=s;if(a.tag===1)return A.Return(new h(1,[a.fields[0]]));{const u=a.fields[0];if(u.statusCode===200){const l=on(V(sn(rp(),new Dt(1,[]))),u.responseText);return A.Return(l)}else return A.Return(new h(1,["Failed to get import stage details"]))}})})}function Mp(e){return A.Delay(()=>{let t,n;const r=Bt((t=Nt(new St(0,[]),Ot(e.baseUrl)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),t)));return n=A.Bind(r,o=>A.Return(new h(0,[o]))),A.Bind(n,o=>{const i=o;if(i.tag===1)return A.Return(new h(1,[i.fields[0]]));{const s=i.fields[0];switch(s.statusCode|0){case 200:{let u;const l=on(V(sn(Zd(),new Dt(1,[]))),s.responseText);return u=l.tag===1?new h(1,[l.fields[0]]):new h(0,[l.fields[0]]),A.Return(u)}case 404:return A.Return(new h(0,[void 0]));default:return A.Return(new h(1,["Failed to get account imports"]))}}})})}function Fp(e,t){return A.Delay(()=>{let n,r;const o=Bt((n=Ep(new Na(3,[t]),Nt(new St(1,[]),Ot(e.baseUrl))),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),n)));return r=A.Bind(o,i=>A.Return(new h(0,[i]))),A.Bind(r,i=>{const s=i;if(s.tag===1)return A.Return(new h(1,[s.fields[0]]));{const a=s.fields[0];switch(a.statusCode|0){case 202:return A.Return(new h(0,[void 0]));case 400:{let l,f;const c=on(V(sn(tp(),new Dt(1,[]))),a.responseText);return f=c.tag===1?new h(1,[new Ro(1,[c.fields[0]])]):new h(0,[c.fields[0]]),l=A.Return(f),A.Bind(l,m=>{const p=m;return p.tag===1?A.Return(new h(1,[p.fields[0]])):A.Return(new h(1,[new Ro(0,[p.fields[0]])]))})}default:return A.Return(new h(1,[new Ro(1,["Failed to start import"])]))}}})})}function Op(e,t){return A.Delay(()=>{let n,r;const o=Bt((n=Nt(new St(2,[]),Ot(`${e.baseUrl}/${t}/benefits/invite-all`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),n)));return r=A.Bind(o,i=>A.Return(new h(0,[i]))),A.Bind(r,i=>{const s=i;return s.tag===1?A.Return(new h(1,[s.fields[0]])):s.fields[0].statusCode===202?A.Return(new h(0,[void 0])):A.Return(new h(1,["Failed to send invites"]))})})}function Np(e,t){return A.Delay(()=>{let n,r;const o=Bt((n=Nt(new St(2,[]),Ot(`${e.baseUrl}/${t}/benefits/uninvite-all`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),n)));return r=A.Bind(o,i=>A.Return(new h(0,[i]))),A.Bind(r,i=>{const s=i;return s.tag===1?A.Return(new h(1,[s.fields[0]])):s.fields[0].statusCode===202?A.Return(new h(0,[void 0])):A.Return(new h(1,["Failed to revoke invites"]))})})}class Pp{constructor(t,n,r){this.OnNext=t,this.OnError=n||(o=>{}),this.OnCompleted=r||(()=>{})}}function Bp(e,t){t.Subscribe(new Pp(e))}class jp{constructor(){this.delegates=[]}_add(t){this.delegates.push(t)}_remove(t){const n=this.delegates.indexOf(t);n>-1&&this.delegates.splice(n,1)}get Publish(){return Hp(t=>{this._add(t)},t=>{this._remove(t)})}Trigger(t,n){let r=null;const o=n===void 0?t:(r=t,n);this.delegates.forEach(i=>{i(r,o)})}}class $p extends jp{}function Hp(e,t){return{AddHandler(n){e(n)},RemoveHandler(n){t(n)},Subscribe(n){const r=(o,i)=>n.OnNext(i);return e(r),{Dispose(){t(r)}}}}}class Up{constructor(t){this._enabled=!1,this._isDisposed=!1,this._intervalId=0,this._timeoutId=0,this.Interval=t&&t>0?t:100,this.AutoReset=!0,this._elapsed=new $p}Elapsed(){return this._elapsed.Publish}get Enabled(){return this._enabled}set Enabled(t){!this._isDisposed&&this._enabled!==t&&(this._enabled=t,this._enabled?this.AutoReset?this._intervalId=setInterval(()=>{this.AutoReset||(this.Enabled=!1),this._elapsed.Trigger(new Date)},this.Interval):this._timeoutId=setTimeout(()=>{this.Enabled=!1,this._timeoutId=0,this.AutoReset&&(this.Enabled=!0),this._elapsed.Trigger(new Date)},this.Interval):(this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=0),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=0)))}Dispose(){this.Enabled=!1,this._isDisposed=!0}Close(){this.Dispose()}Start(){this.Enabled=!0}Stop(){this.Enabled=!1}}function Vp(e,t){console.error(Fe(e),t)}function Lp(e,t){let n,r=new Up(e);r.AutoReset=!1,n=r,Bp(t,n.Elapsed()),n.Enabled=!0,n.Start()}function ja(e,t,n){Tn(r=>{try{r(t)}catch(o){e(o)}},n)}function Ie(){return he()}function Pn(e,t,n,r){return W(o=>{e(A.Delay(()=>A.Bind(yp(t(n)),i=>{const s=i;return s.tag===0&&o(r(s.fields[0])),A.Zero()})))})}function Bn(e){Lp(1,t=>{To(e)})}function Mo(e){return e.tag===1?"tax":"profiles"}class _e extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Requested","Finished"]}}class We extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["ActiveImport","PastImports"]}}function $a(e){return e.tag===1?"Past Imports":"Active Import"}class zp extends G{constructor(t,n){super(),this.AccountId=t,this.PartnerId=n}}class De extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Initialising","FileSelection","Validating","ValidationError","ImportInProgress","UnexpectedError"]}}class jn extends G{constructor(t,n){super(),this.PastImports=t,this.ImportSummary=n}}class ye extends G{constructor(t,n,r,o,i){super(),this.User=t,this.CurrentTab=n,this.AccountInfo=r,this.ActiveImportTabState=o,this.ImportHistoryTabState=i}}class re extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["SetCurrentTab","SelectFile","ShowImportSummary","ShowImportHistory","GetImports","StartImport","GetImportStatus","SendInvites","RevokeInvites"]}}function Gp(e,t){return[new ye(e,new We(0,[]),t,new De(0,[]),new jn(he(),void 0)),W(n=>{n(new re(4,[new _e(0,[void 0])]))})]}function Wp(e,t,n){let r,o,i;switch(t.tag){case 4:if(t.fields[0].tag===1){if(t.fields[0].fields[0].tag===1)return[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()];if(t.fields[0].fields[0].fields[0]==null)return[new ye(n.User,n.CurrentTab,n.AccountInfo,new De(1,[]),n.ImportHistoryTabState),Ie()];{const s=t.fields[0].fields[0].fields[0];let a;const u=s.ActiveImport;if(u==null)a=[new De(1,[]),Ie()];else{const l=u;a=[new De(4,[new Fa(0,[l])]),W(f=>{f(new re(6,[new _e(0,[l.ImportId])]))})]}return[new ye(n.User,n.CurrentTab,n.AccountInfo,a[0],new jn(s.ImportHistory,(r=n.ImportHistoryTabState.ImportSummary,r==null?void 0:(o=r,Fu(l=>l.ImportId===o.ImportId,s.ImportHistory))))),a[1]]}}else return[n,Pn(s=>{Bn(s)},()=>Mp(e),t.fields[0].fields[0],s=>new re(4,[new _e(1,[s])]))];case 6:return t.fields[0].tag===1?t.fields[0].fields[0].tag===1?[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),(i=n.ActiveImportTabState,i.tag===4&&i.fields[0].tag===0?W(s=>{s(new re(6,[new _e(0,[i.fields[0].fields[0].ImportId])]))}):Ie())]:t.fields[0].fields[0].fields[0].tag===1?[new ye(n.User,new We(1,[]),n.AccountInfo,new De(1,[]),new jn(n.ImportHistoryTabState.PastImports,t.fields[0].fields[0].fields[0].fields[0])),W(s=>{s(new re(4,[new _e(0,[void 0])]))})]:[new ye(n.User,n.CurrentTab,n.AccountInfo,new De(4,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),W(s=>{s(new re(6,[new _e(0,[t.fields[0].fields[0].fields[0].fields[0].ImportId])]))})]:[n,Pn(s=>{Bn(s)},s=>A.Delay(()=>A.Bind(Ap(1e4),()=>A.ReturnFrom(Tp(e,s)))),t.fields[0].fields[0],s=>new re(6,[new _e(1,[s])]))];case 1:return[new ye(n.User,n.CurrentTab,n.AccountInfo,new De(1,[]),n.ImportHistoryTabState),Ie()];case 5:return t.fields[0].tag===1?t.fields[0].fields[0].tag===1?t.fields[0].fields[0].fields[0].tag===1?[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()]:[new ye(n.User,new We(0,[]),n.AccountInfo,new De(3,[t.fields[0].fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()]:[n,W(s=>{s(new re(4,[new _e(0,[void 0])]))})]:[new ye(n.User,n.CurrentTab,n.AccountInfo,new De(2,[]),n.ImportHistoryTabState),Pn(s=>{Bn(s)},s=>Fp(e,s),t.fields[0].fields[0],s=>new re(5,[new _e(1,[s])]))];case 2:return[new ye(n.User,new We(1,[]),n.AccountInfo,n.ActiveImportTabState,new jn(n.ImportHistoryTabState.PastImports,t.fields[0])),Ie()];case 3:return[new ye(n.User,new We(1,[]),n.AccountInfo,n.ActiveImportTabState,new jn(n.ImportHistoryTabState.PastImports,void 0)),Ie()];case 7:return t.fields[0].tag===1?t.fields[0].fields[0].tag===1?[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()]:[n,W(s=>{s(new re(4,[new _e(0,[void 0])]))})]:[n,Pn(s=>{Bn(s)},s=>Op(e,s),t.fields[0].fields[0],s=>new re(7,[new _e(1,[s])]))];case 8:return t.fields[0].tag===1?t.fields[0].fields[0].tag===1?[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()]:[n,W(s=>{s(new re(4,[new _e(0,[void 0])]))})]:[n,Pn(s=>{Bn(s)},s=>Np(e,s),t.fields[0].fields[0],s=>new re(8,[new _e(1,[s])]))];default:return[new ye(n.User,t.fields[0],n.AccountInfo,n.ActiveImportTabState,n.ImportHistoryTabState),Ie()]}}function Qp(){return he()}function Fo(e){return Me("/",e)}function qp(e,t){const n=new Error("Duplicate SubId");return e(["Duplicate SubId: "+Fo(t),n])}function Ha(e,t,n){try{q(n)}catch(r){e(["Error stopping subscription: "+Fo(t),r])}}function Zp(e,t,n,r){try{return[n,r(t)]}catch(o){e(["Error starting subscription: "+Fo(n),o]);return}}function Jp(e,t){Tn(n=>{Ha(e,n[0],n[1])},t)}function Ua(e,t,n,r,o,i){return Tn(s=>{qp(e,s)},n),Tn(s=>{Ha(e,s[0],s[1])},r),Rn(o,Bu(s=>Zp(e,t,s[0],s[1]),i))}function Kp(){return[he(),sd({Compare:$e}),he()]}function Xp(e,t,n,r,o){return Co(e,r)?[ze(e,n),r,o]:[n,id(e,r),ze([e,t],o)]}function Yp(e){return Du((t,n)=>Xp(t[0],t[1],n[0],n[1],n[2]),e,Kp())}const eh=he();function Va(e,t){const n=ad(xt(s=>s[0],e),{Compare:$e}),r=Yp(t),o=r[1],i=r[0];if(n.Equals(o))return[i,he(),e,he()];{const s=Pu(a=>Co(a[0],o),e);return[i,s[1],s[0],Nu(a=>!Co(a[0],n),r[2])]}}function th(e,t,n,r){const o=$e(e,n)|0;if(o===0)throw new Error("The step of a range cannot be zero");const i=o>0;return s=>{const a=$e(s,t)|0;return i&&a<=0||!i&&a>=0?[s,r(s,e)]:void 0}}function nh(e,t,n,r,o){const i=th(t,n,r,o);return M(()=>_f(i,e))}function rh(e,t,n){return nh(e,t,n,0,(r,o)=>r+o)}class ln extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Writable","ReadWritable"]}}class oh{constructor(t){this.state=new ln(0,[wo(new Array(ks(t,10)),0,ks(t,10),null),0])}}function ih(e){return new oh(e)}function La(e){const t=e.state;if(t.tag===1){const n=t.fields[1]|0,r=t.fields[2]|0,o=t.fields[0],i=(r+1)%o.length|0;return i===n?e.state=new ln(0,[o,n]):e.state=new ln(1,[o,n,i]),Fe(pe(r,o))}else return}function sh(e,t){const n=e.state;if(n.tag===1){const r=n.fields[1]|0,o=n.fields[2]|0,i=n.fields[0];vt(i,r,t);const s=(r+1)%i.length|0;s===o?e.state=new ln(1,[ah(e,o,i),i.length,0]):e.state=new ln(1,[i,s,o])}else{const r=n.fields[1]|0,o=n.fields[0];vt(o,r,t);const i=(r+1)%o.length|0;e.state=new ln(1,[o,i,r])}}function ah(e,t,n){return Array.from(M(()=>$(Sf(t,n),M(()=>$(Cf(t,n),M(()=>Fn(r=>R(At()),rh(0,1,n.length))))))))}class Oo extends G{constructor(t,n,r,o,i,s,a){super(),this.init=t,this.update=n,this.subscribe=r,this.view=o,this.setState=i,this.onError=s,this.termination=a}}function lh(e,t,n){return new Oo(e,t,r=>Qp(),n,V(r=>{const o=He(n)(r);return i=>{o(i)}}),r=>{Vp(r[0],r[1])},[r=>!1,r=>{}])}function ch(e,t){return new Oo(t.init,t.update,t.subscribe,t.view,e,t.onError,t.termination)}function uh(e){return e.init}function fh(e,t,n,r,o,i,s){const a=He(e)(s.init),u=Yn(t)(He(s.update)),l=Yn(n)(He(s.view)),f=Yn(r)(He(s.setState));return new Oo(a,V(u),He(o)(s.subscribe),V(l),V(f),s.onError,i(s.termination))}function dh(e,t,n){let r;const o=n.init(t),i=o[0],s=n.subscribe(i),a=n.termination,u=ih(10);let l=!1,f=i,c=eh,m=!1;const p=w=>{m||(sh(u,w),l||(l=!0,_(),l=!1))},g=He(e)(p),_=()=>{let w,y=La(u);for(;!m&&y!=null;){const C=b(y);if(a[0](C))Jp(n.onError,c),a[1](f),m=!0;else{const T=n.update(C,f),ee=T[0],Q=n.subscribe(ee);n.setState(ee,g),ja(X=>{n.onError([Ve(Re("Error handling the message: %A"))(C),X])},g,T[1]),f=ee,c=(w=Va(c,Q),Ua(n.onError,g,w[0],w[1],w[2],w[3])),y=La(u)}}};l=!0,n.setState(i,g),ja(w=>{n.onError([Ve(Re("Error intitializing:")),w])},g,o[1]),c=(r=Va(c,s),Ua(n.onError,g,r[0],r[1],r[2],r[3])),_(),l=!1}function ph(e,t){dh(V(n=>n),e,t)}function hh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mh(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var za={exports:{}},Ga={};const gh=mh(ac);/**
24
+ `,n.getAllResponseHeaders())),{Compare:so}),new Pa(f,u,c,n.responseURL,g,m)))};const r=ne(e.headers);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const u=r["System.Collections.Generic.IEnumerator`1.get_Current"]();n.setRequestHeader(u.fields[0],u.fields[1])}}finally{q(r)}n.withCredentials=e.withCredentials;const o=e.overridenMimeType;if(o!=null){const u=o;n.overrideMimeType(u)}const i=e.overridenResponseType;if(i!=null)switch(i.tag){case 1:{n.responseType="blob";break}case 2:{n.responseType="arraybuffer";break}default:n.responseType="text"}const s=e.timeout;if(s!=null){const u=s|0;n.timeout=u|0}const a=e.content;switch(a.tag){case 1:{n.send(Fe(a.fields[0]));break}case 3:{n.send(Fe(a.fields[0]));break}case 2:{n.send(Fe(a.fields[0]));break}default:n.send()}})}class Ro extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["BadRequest","OtherError"]}}class kp{constructor(t,n,r,o){this.backendUrl=t,this.accessToken=o,this.baseUrl=`${this.backendUrl}/import/admin/partners/${n}/accounts/${r}/imports`}}function Ip(e,t,n,r){return new kp(e,t,n,r)}function Dp(e){return A.Delay(()=>{let t,n;const r=Bt((t=Nt(new St(0,[]),Ot(`${e.backendUrl}/import/admin/schema`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),t)));return n=A.Bind(r,o=>A.Return(new h(0,[o]))),A.Bind(n,o=>{const i=o;if(i.tag===1)return A.Return(new h(1,[i.fields[0]]));{const s=i.fields[0];if(s.statusCode===200){const a=on(V(sn(cp(),new Dt(1,[]))),s.responseText);return A.Return(a)}else return A.Return(new h(1,["Failed to get import schema"]))}})})}function Tp(e,t){return A.Delay(()=>{let n,r;const o=Bt((n=Nt(new St(0,[]),Ot(`${e.baseUrl}/${t}/status`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),n)));return r=A.Bind(o,i=>A.Return(new h(0,[i]))),A.Bind(r,i=>{const s=i;if(s.tag===1)return A.Return(new h(1,[s.fields[0]]));{const a=s.fields[0];if(a.statusCode===200){const u=on(V(sn(Qd(),new Dt(1,[]))),a.responseText);return A.Return(u)}else return A.Return(new h(1,["Failed to get import status"]))}})})}function Rp(e,t,n){return A.Delay(()=>{let r,o;const i=Bt((r=Nt(new St(0,[]),Ot(`${e.baseUrl}/${t}/stages/${n}`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),r)));return o=A.Bind(i,s=>A.Return(new h(0,[s]))),A.Bind(o,s=>{const a=s;if(a.tag===1)return A.Return(new h(1,[a.fields[0]]));{const u=a.fields[0];if(u.statusCode===200){const l=on(V(sn(rp(),new Dt(1,[]))),u.responseText);return A.Return(l)}else return A.Return(new h(1,["Failed to get import stage details"]))}})})}function Mp(e){return A.Delay(()=>{let t,n;const r=Bt((t=Nt(new St(0,[]),Ot(e.baseUrl)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),t)));return n=A.Bind(r,o=>A.Return(new h(0,[o]))),A.Bind(n,o=>{const i=o;if(i.tag===1)return A.Return(new h(1,[i.fields[0]]));{const s=i.fields[0];switch(s.statusCode|0){case 200:{let u;const l=on(V(sn(Zd(),new Dt(1,[]))),s.responseText);return u=l.tag===1?new h(1,[l.fields[0]]):new h(0,[l.fields[0]]),A.Return(u)}case 404:return A.Return(new h(0,[void 0]));default:return A.Return(new h(1,["Failed to get account imports"]))}}})})}function Fp(e,t){return A.Delay(()=>{let n,r;const o=Bt((n=Ep(new Na(3,[t]),Nt(new St(1,[]),Ot(e.baseUrl))),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),n)));return r=A.Bind(o,i=>A.Return(new h(0,[i]))),A.Bind(r,i=>{const s=i;if(s.tag===1)return A.Return(new h(1,[s.fields[0]]));{const a=s.fields[0];switch(a.statusCode|0){case 201:return A.Return(new h(0,[void 0]));case 400:{let l,f;const c=on(V(sn(tp(),new Dt(1,[]))),a.responseText);return f=c.tag===1?new h(1,[new Ro(1,[c.fields[0]])]):new h(0,[c.fields[0]]),l=A.Return(f),A.Bind(l,m=>{const p=m;return p.tag===1?A.Return(new h(1,[p.fields[0]])):A.Return(new h(1,[new Ro(0,[p.fields[0]])]))})}default:return A.Return(new h(1,[new Ro(1,["Failed to start import"])]))}}})})}function Op(e,t){return A.Delay(()=>{let n,r;const o=Bt((n=Nt(new St(2,[]),Ot(`${e.baseUrl}/${t}/benefits/invite-all`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),n)));return r=A.Bind(o,i=>A.Return(new h(0,[i]))),A.Bind(r,i=>{const s=i;return s.tag===1?A.Return(new h(1,[s.fields[0]])):s.fields[0].statusCode===202?A.Return(new h(0,[void 0])):A.Return(new h(1,["Failed to send invites"]))})})}function Np(e,t){return A.Delay(()=>{let n,r;const o=Bt((n=Nt(new St(2,[]),Ot(`${e.baseUrl}/${t}/benefits/uninvite-all`)),Pt(Mt(Ve(Re("Bearer %s"))(e.accessToken)),n)));return r=A.Bind(o,i=>A.Return(new h(0,[i]))),A.Bind(r,i=>{const s=i;return s.tag===1?A.Return(new h(1,[s.fields[0]])):s.fields[0].statusCode===202?A.Return(new h(0,[void 0])):A.Return(new h(1,["Failed to revoke invites"]))})})}class Pp{constructor(t,n,r){this.OnNext=t,this.OnError=n||(o=>{}),this.OnCompleted=r||(()=>{})}}function Bp(e,t){t.Subscribe(new Pp(e))}class jp{constructor(){this.delegates=[]}_add(t){this.delegates.push(t)}_remove(t){const n=this.delegates.indexOf(t);n>-1&&this.delegates.splice(n,1)}get Publish(){return Hp(t=>{this._add(t)},t=>{this._remove(t)})}Trigger(t,n){let r=null;const o=n===void 0?t:(r=t,n);this.delegates.forEach(i=>{i(r,o)})}}class $p extends jp{}function Hp(e,t){return{AddHandler(n){e(n)},RemoveHandler(n){t(n)},Subscribe(n){const r=(o,i)=>n.OnNext(i);return e(r),{Dispose(){t(r)}}}}}class Up{constructor(t){this._enabled=!1,this._isDisposed=!1,this._intervalId=0,this._timeoutId=0,this.Interval=t&&t>0?t:100,this.AutoReset=!0,this._elapsed=new $p}Elapsed(){return this._elapsed.Publish}get Enabled(){return this._enabled}set Enabled(t){!this._isDisposed&&this._enabled!==t&&(this._enabled=t,this._enabled?this.AutoReset?this._intervalId=setInterval(()=>{this.AutoReset||(this.Enabled=!1),this._elapsed.Trigger(new Date)},this.Interval):this._timeoutId=setTimeout(()=>{this.Enabled=!1,this._timeoutId=0,this.AutoReset&&(this.Enabled=!0),this._elapsed.Trigger(new Date)},this.Interval):(this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=0),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=0)))}Dispose(){this.Enabled=!1,this._isDisposed=!0}Close(){this.Dispose()}Start(){this.Enabled=!0}Stop(){this.Enabled=!1}}function Vp(e,t){console.error(Fe(e),t)}function Lp(e,t){let n,r=new Up(e);r.AutoReset=!1,n=r,Bp(t,n.Elapsed()),n.Enabled=!0,n.Start()}function ja(e,t,n){Tn(r=>{try{r(t)}catch(o){e(o)}},n)}function Ie(){return he()}function Pn(e,t,n,r){return W(o=>{e(A.Delay(()=>A.Bind(yp(t(n)),i=>{const s=i;return s.tag===0&&o(r(s.fields[0])),A.Zero()})))})}function Bn(e){Lp(1,t=>{To(e)})}function Mo(e){return e.tag===1?"tax":"profiles"}class _e extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Requested","Finished"]}}class We extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["ActiveImport","PastImports"]}}function $a(e){return e.tag===1?"Past Imports":"Active Import"}class zp extends G{constructor(t,n){super(),this.AccountId=t,this.PartnerId=n}}class De extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Initialising","FileSelection","Validating","ValidationError","ImportInProgress","UnexpectedError"]}}class jn extends G{constructor(t,n){super(),this.PastImports=t,this.ImportSummary=n}}class ye extends G{constructor(t,n,r,o,i){super(),this.User=t,this.CurrentTab=n,this.AccountInfo=r,this.ActiveImportTabState=o,this.ImportHistoryTabState=i}}class re extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["SetCurrentTab","SelectFile","ShowImportSummary","ShowImportHistory","GetImports","StartImport","GetImportStatus","SendInvites","RevokeInvites"]}}function Gp(e,t){return[new ye(e,new We(0,[]),t,new De(0,[]),new jn(he(),void 0)),W(n=>{n(new re(4,[new _e(0,[void 0])]))})]}function Wp(e,t,n){let r,o,i;switch(t.tag){case 4:if(t.fields[0].tag===1){if(t.fields[0].fields[0].tag===1)return[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()];if(t.fields[0].fields[0].fields[0]==null)return[new ye(n.User,n.CurrentTab,n.AccountInfo,new De(1,[]),n.ImportHistoryTabState),Ie()];{const s=t.fields[0].fields[0].fields[0];let a;const u=s.ActiveImport;if(u==null)a=[new De(1,[]),Ie()];else{const l=u;a=[new De(4,[new Fa(0,[l])]),W(f=>{f(new re(6,[new _e(0,[l.ImportId])]))})]}return[new ye(n.User,n.CurrentTab,n.AccountInfo,a[0],new jn(s.ImportHistory,(r=n.ImportHistoryTabState.ImportSummary,r==null?void 0:(o=r,Fu(l=>l.ImportId===o.ImportId,s.ImportHistory))))),a[1]]}}else return[n,Pn(s=>{Bn(s)},()=>Mp(e),t.fields[0].fields[0],s=>new re(4,[new _e(1,[s])]))];case 6:return t.fields[0].tag===1?t.fields[0].fields[0].tag===1?[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),(i=n.ActiveImportTabState,i.tag===4&&i.fields[0].tag===0?W(s=>{s(new re(6,[new _e(0,[i.fields[0].fields[0].ImportId])]))}):Ie())]:t.fields[0].fields[0].fields[0].tag===1?[new ye(n.User,new We(1,[]),n.AccountInfo,new De(1,[]),new jn(n.ImportHistoryTabState.PastImports,t.fields[0].fields[0].fields[0].fields[0])),W(s=>{s(new re(4,[new _e(0,[void 0])]))})]:[new ye(n.User,n.CurrentTab,n.AccountInfo,new De(4,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),W(s=>{s(new re(6,[new _e(0,[t.fields[0].fields[0].fields[0].fields[0].ImportId])]))})]:[n,Pn(s=>{Bn(s)},s=>A.Delay(()=>A.Bind(Ap(1e4),()=>A.ReturnFrom(Tp(e,s)))),t.fields[0].fields[0],s=>new re(6,[new _e(1,[s])]))];case 1:return[new ye(n.User,n.CurrentTab,n.AccountInfo,new De(1,[]),n.ImportHistoryTabState),Ie()];case 5:return t.fields[0].tag===1?t.fields[0].fields[0].tag===1?t.fields[0].fields[0].fields[0].tag===1?[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()]:[new ye(n.User,new We(0,[]),n.AccountInfo,new De(3,[t.fields[0].fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()]:[n,W(s=>{s(new re(4,[new _e(0,[void 0])]))})]:[new ye(n.User,n.CurrentTab,n.AccountInfo,new De(2,[]),n.ImportHistoryTabState),Pn(s=>{Bn(s)},s=>Fp(e,s),t.fields[0].fields[0],s=>new re(5,[new _e(1,[s])]))];case 2:return[new ye(n.User,new We(1,[]),n.AccountInfo,n.ActiveImportTabState,new jn(n.ImportHistoryTabState.PastImports,t.fields[0])),Ie()];case 3:return[new ye(n.User,new We(1,[]),n.AccountInfo,n.ActiveImportTabState,new jn(n.ImportHistoryTabState.PastImports,void 0)),Ie()];case 7:return t.fields[0].tag===1?t.fields[0].fields[0].tag===1?[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()]:[n,W(s=>{s(new re(4,[new _e(0,[void 0])]))})]:[n,Pn(s=>{Bn(s)},s=>Op(e,s),t.fields[0].fields[0],s=>new re(7,[new _e(1,[s])]))];case 8:return t.fields[0].tag===1?t.fields[0].fields[0].tag===1?[new ye(n.User,new We(0,[]),n.AccountInfo,new De(5,[t.fields[0].fields[0].fields[0]]),n.ImportHistoryTabState),Ie()]:[n,W(s=>{s(new re(4,[new _e(0,[void 0])]))})]:[n,Pn(s=>{Bn(s)},s=>Np(e,s),t.fields[0].fields[0],s=>new re(8,[new _e(1,[s])]))];default:return[new ye(n.User,t.fields[0],n.AccountInfo,n.ActiveImportTabState,n.ImportHistoryTabState),Ie()]}}function Qp(){return he()}function Fo(e){return Me("/",e)}function qp(e,t){const n=new Error("Duplicate SubId");return e(["Duplicate SubId: "+Fo(t),n])}function Ha(e,t,n){try{q(n)}catch(r){e(["Error stopping subscription: "+Fo(t),r])}}function Zp(e,t,n,r){try{return[n,r(t)]}catch(o){e(["Error starting subscription: "+Fo(n),o]);return}}function Jp(e,t){Tn(n=>{Ha(e,n[0],n[1])},t)}function Ua(e,t,n,r,o,i){return Tn(s=>{qp(e,s)},n),Tn(s=>{Ha(e,s[0],s[1])},r),Rn(o,Bu(s=>Zp(e,t,s[0],s[1]),i))}function Kp(){return[he(),sd({Compare:$e}),he()]}function Xp(e,t,n,r,o){return Co(e,r)?[ze(e,n),r,o]:[n,id(e,r),ze([e,t],o)]}function Yp(e){return Du((t,n)=>Xp(t[0],t[1],n[0],n[1],n[2]),e,Kp())}const eh=he();function Va(e,t){const n=ad(xt(s=>s[0],e),{Compare:$e}),r=Yp(t),o=r[1],i=r[0];if(n.Equals(o))return[i,he(),e,he()];{const s=Pu(a=>Co(a[0],o),e);return[i,s[1],s[0],Nu(a=>!Co(a[0],n),r[2])]}}function th(e,t,n,r){const o=$e(e,n)|0;if(o===0)throw new Error("The step of a range cannot be zero");const i=o>0;return s=>{const a=$e(s,t)|0;return i&&a<=0||!i&&a>=0?[s,r(s,e)]:void 0}}function nh(e,t,n,r,o){const i=th(t,n,r,o);return M(()=>_f(i,e))}function rh(e,t,n){return nh(e,t,n,0,(r,o)=>r+o)}class ln extends Y{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Writable","ReadWritable"]}}class oh{constructor(t){this.state=new ln(0,[wo(new Array(ks(t,10)),0,ks(t,10),null),0])}}function ih(e){return new oh(e)}function La(e){const t=e.state;if(t.tag===1){const n=t.fields[1]|0,r=t.fields[2]|0,o=t.fields[0],i=(r+1)%o.length|0;return i===n?e.state=new ln(0,[o,n]):e.state=new ln(1,[o,n,i]),Fe(pe(r,o))}else return}function sh(e,t){const n=e.state;if(n.tag===1){const r=n.fields[1]|0,o=n.fields[2]|0,i=n.fields[0];vt(i,r,t);const s=(r+1)%i.length|0;s===o?e.state=new ln(1,[ah(e,o,i),i.length,0]):e.state=new ln(1,[i,s,o])}else{const r=n.fields[1]|0,o=n.fields[0];vt(o,r,t);const i=(r+1)%o.length|0;e.state=new ln(1,[o,i,r])}}function ah(e,t,n){return Array.from(M(()=>$(Sf(t,n),M(()=>$(Cf(t,n),M(()=>Fn(r=>R(At()),rh(0,1,n.length))))))))}class Oo extends G{constructor(t,n,r,o,i,s,a){super(),this.init=t,this.update=n,this.subscribe=r,this.view=o,this.setState=i,this.onError=s,this.termination=a}}function lh(e,t,n){return new Oo(e,t,r=>Qp(),n,V(r=>{const o=He(n)(r);return i=>{o(i)}}),r=>{Vp(r[0],r[1])},[r=>!1,r=>{}])}function ch(e,t){return new Oo(t.init,t.update,t.subscribe,t.view,e,t.onError,t.termination)}function uh(e){return e.init}function fh(e,t,n,r,o,i,s){const a=He(e)(s.init),u=Yn(t)(He(s.update)),l=Yn(n)(He(s.view)),f=Yn(r)(He(s.setState));return new Oo(a,V(u),He(o)(s.subscribe),V(l),V(f),s.onError,i(s.termination))}function dh(e,t,n){let r;const o=n.init(t),i=o[0],s=n.subscribe(i),a=n.termination,u=ih(10);let l=!1,f=i,c=eh,m=!1;const p=w=>{m||(sh(u,w),l||(l=!0,_(),l=!1))},g=He(e)(p),_=()=>{let w,y=La(u);for(;!m&&y!=null;){const C=b(y);if(a[0](C))Jp(n.onError,c),a[1](f),m=!0;else{const T=n.update(C,f),ee=T[0],Q=n.subscribe(ee);n.setState(ee,g),ja(X=>{n.onError([Ve(Re("Error handling the message: %A"))(C),X])},g,T[1]),f=ee,c=(w=Va(c,Q),Ua(n.onError,g,w[0],w[1],w[2],w[3])),y=La(u)}}};l=!0,n.setState(i,g),ja(w=>{n.onError([Ve(Re("Error intitializing:")),w])},g,o[1]),c=(r=Va(c,s),Ua(n.onError,g,r[0],r[1],r[2],r[3])),_(),l=!1}function ph(e,t){dh(V(n=>n),e,t)}function hh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mh(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var za={exports:{}},Ga={};const gh=mh(ac);/**
25
25
  * @license React
26
26
  * use-sync-external-store-shim.production.min.js
27
27
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flarehr/superhero-import-app",
3
- "version": "0.28.0",
3
+ "version": "0.30.0",
4
4
  "description": "Flare Superhero Import App",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",