@flarehr/apollo-import-workspace-app 0.1.542 → 0.1.546
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.
|
@@ -64,4 +64,4 @@ License: MIT
|
|
|
64
64
|
`,B='"',pe=B+B,Z=!1,W=null,P=!1,G=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||c.BAD_DELIMITERS.filter(function(z){return _.delimiter.indexOf(z)!==-1}).length||(I=_.delimiter),typeof _.quotes!="boolean"&&typeof _.quotes!="function"&&!Array.isArray(_.quotes)||(k=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(Z=_.skipEmptyLines),typeof _.newline=="string"&&(O=_.newline),typeof _.quoteChar=="string"&&(B=_.quoteChar),typeof _.header=="boolean"&&(N=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");W=_.columns}_.escapeChar!==void 0&&(pe=_.escapeChar+B),_.escapeFormulae instanceof RegExp?P=_.escapeFormulae:typeof _.escapeFormulae=="boolean"&&_.escapeFormulae&&(P=/^[=+\-@\t\r].*$/)}})(),new RegExp(b(B),"g"));if(typeof E=="string"&&(E=JSON.parse(E)),Array.isArray(E)){if(!E.length||Array.isArray(E[0]))return j(null,E,Z);if(typeof E[0]=="object")return j(W||Object.keys(E[0]),E,Z)}else if(typeof E=="object")return typeof E.data=="string"&&(E.data=JSON.parse(E.data)),Array.isArray(E.data)&&(E.fields||(E.fields=E.meta&&E.meta.fields||W),E.fields||(E.fields=Array.isArray(E.data[0])?E.fields:typeof E.data[0]=="object"?Object.keys(E.data[0]):[]),Array.isArray(E.data[0])||typeof E.data[0]=="object"||(E.data=[E.data])),j(E.fields||[],E.data||[],Z);throw new Error("Unable to serialize unrecognized input");function j(z,R,ge){var me="",we=(typeof z=="string"&&(z=JSON.parse(z)),typeof R=="string"&&(R=JSON.parse(R)),Array.isArray(z)&&0<z.length),Ee=!Array.isArray(R[0]);if(we&&N){for(var ne=0;ne<z.length;ne++)0<ne&&(me+=I),me+=de(z[ne],ne);0<R.length&&(me+=O)}for(var xe=0;xe<R.length;xe++){var Ce=(we?z:R[xe]).length,De=!1,ee=we?Object.keys(R[xe]).length===0:R[xe].length===0;if(ge&&!we&&(De=ge==="greedy"?R[xe].join("").trim()==="":R[xe].length===1&&R[xe][0].length===0),ge==="greedy"&&we){for(var oe=[],q=0;q<Ce;q++){var Se=Ee?z[q]:q;oe.push(R[xe][Se])}De=oe.join("").trim()===""}if(!De){for(var te=0;te<Ce;te++){0<te&&!ee&&(me+=I);var ce=we&&Ee?z[te]:te;me+=de(R[xe][ce],te)}xe<R.length-1&&(!ge||0<Ce&&!ee)&&(me+=O)}}return me}function de(z,R){var ge,me;return z==null?"":z.constructor===Date?JSON.stringify(z).slice(1,25):(me=!1,P&&typeof z=="string"&&P.test(z)&&(z="'"+z,me=!0),ge=z.toString().replace(G,pe),(me=me||k===!0||typeof k=="function"&&k(z,R)||Array.isArray(k)&&k[R]||((we,Ee)=>{for(var ne=0;ne<Ee.length;ne++)if(-1<we.indexOf(Ee[ne]))return!0;return!1})(ge,c.BAD_DELIMITERS)||-1<ge.indexOf(I)||ge.charAt(0)===" "||ge.charAt(ge.length-1)===" ")?B+ge+B:ge)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
|
|
65
65
|
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!o&&!!r.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=x,c.ParserHandle=v,c.NetworkStreamer=d,c.FileStreamer=p,c.StringStreamer=h,c.ReadableStreamStreamer=m,r.jQuery&&((i=r.jQuery).fn.parse=function(E){var _=E.config||{},k=[];return this.each(function(O){if(!(i(this).prop("tagName").toUpperCase()==="INPUT"&&i(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var B=0;B<this.files.length;B++)k.push({file:this.files[B],inputElem:this,instanceConfig:i.extend({},_)})}),N(),this;function N(){if(k.length===0)L(E.complete)&&E.complete();else{var O,B,pe,Z,W=k[0];if(L(E.before)){var P=E.before(W.file,W.inputElem);if(typeof P=="object"){if(P.action==="abort")return O="AbortError",B=W.file,pe=W.inputElem,Z=P.reason,void(L(E.error)&&E.error({name:O},B,pe,Z));if(P.action==="skip")return void I();typeof P.config=="object"&&(W.instanceConfig=i.extend(W.instanceConfig,P.config))}else if(P==="skip")return void I()}var G=W.instanceConfig.complete;W.instanceConfig.complete=function(j){L(G)&&G(j,W.file,W.inputElem),I()},c.parse(W.file,W.instanceConfig)}}function I(){k.splice(0,1),N()}}),s&&(r.onmessage=function(E){E=E.data,c.WORKER_ID===void 0&&E&&(c.WORKER_ID=E.workerId),typeof E.input=="string"?r.postMessage({workerId:c.WORKER_ID,results:c.parse(E.input,E.config),finished:!0}):(r.File&&E.input instanceof File||E.input instanceof Object)&&(E=c.parse(E.input,E.config))&&r.postMessage({workerId:c.WORKER_ID,results:E,finished:!0})}),(d.prototype=Object.create(f.prototype)).constructor=d,(p.prototype=Object.create(f.prototype)).constructor=p,(h.prototype=Object.create(h.prototype)).constructor=h,(m.prototype=Object.create(f.prototype)).constructor=m,c})}(ls)),ls.exports}var n4=t4();const r4=e=>e.filter(n=>!Ci(n)).length===0;function i4(e,t){const n=t.type==="text/csv",r=t.size<=10485760;if(n)if(r){const i={};i.complete=(o,s)=>{let a,l,c,f,d,p,h,m,v,b,x,C;e((a=o.errors,!Tr(Q,a,Ae())&&a.length===0?(l=(c=o.data,c.filter(S=>!r4(S))),f=l.length>1?new M(0,[void 0]):new M(1,[new En(2,[])]),f.tag===1?new M(1,[f.fields[0]]):(d=l.length<=5001?new M(0,[void 0]):new M(1,[new En(3,[])]),d.tag===1?new M(1,[d.fields[0]]):(p=_c(l),h=p.length|0,m=p.some(Ci)?new M(1,[new En(4,[])]):new M(0,[void 0]),m.tag===1?new M(1,[m.fields[0]]):(v=(b=Sm(Ze(S=>S.trim().toLocaleLowerCase(),p),{Equals:(S,$)=>S===$,GetHashCode:lr}),b.length===h?new M(0,[void 0]):new M(1,[new En(5,[])])),v.tag===1?new M(1,[v.fields[0]]):(x=(C=l.filter(S=>S.length!==h),C.length===0?new M(0,[void 0]):new M(1,[new En(6,[])])),x.tag===1?new M(1,[x.fields[0]]):new M(0,[new z_(new Nm(t.name),o0((S,$)=>[new O_(S),new U_($.trim())],_c(l)),new km(Ze(S=>new W_(Ze($=>$.trim(),S)),tg(l))),t.size)])))))):new M(1,[new En(7,[he(0,o.errors).message])])))},i.error=(o,s)=>{e(new M(1,[new En(7,[o])]))},i.worker=!0,n4.parse(t,i)}else e(new M(1,[new En(1,[])]));else e(new M(1,[new En(0,[])]))}let _r=class extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["NoFileSelected","ParsingFile","FileSelected"]}};function o4(e){return e==null?[new _r(0,[void 0]),X()]:[new _r(2,[e]),X()]}function s4(e,t,n){let r,i,o,s,a;switch(t.tag){case 1:{n.tag===1?r=4:r=5;break}case 2:{n.tag===2?r=6:r=7;break}default:if(t.fields[0].tag===1)t.fields[0].fields[0].tag===1?n.tag===1?(r=2,a=t.fields[0].fields[0].fields[0]):r=3:n.tag===1?(r=1,s=t.fields[0].fields[0].fields[0]):r=3;else switch(n.tag){case 0:{r=0,i=t.fields[0].fields[0][0],o=t.fields[0].fields[0][1];break}case 2:{r=0,i=t.fields[0].fields[0][0],o=t.fields[0].fields[0][1];break}default:r=3}}switch(r){case 0:return[new _r(1,[i]),ns(o)];case 1:return[new _r(2,[s]),ns(l=>{e(!0)})];case 2:return[new _r(0,[a]),X()];case 3:return[n,X()];case 4:return[new _r(0,[void 0]),X()];case 5:return[n,X()];case 6:return[new _r(0,[void 0]),ns(l=>{e(!1)})];default:return[n,X()]}}function a4(e,t){let n,r,i,o,s,a,l;return Fi(g([new bt(3,[e]),new bt(4,[t]),new bt(5,[[Vi(le(new Li(2,["fixed inset-0 bg-gray-500/50"]))),u("div",w(g([["className","fixed top-0 bottom-0 right-0 w-[480px] bg-white overflow-y-auto"],(n=[Pi(le(new ar(2,[[u("div",w(g([["className","flex flex-col mt-6 mb-6 px-6"],(r=[u("div",w(g([["className","flex flex-row justify-between"],(i=[u("span",{className:"text-gray-900 font-semibold text-lg",children:"Frequently asked questions"}),u("button",w(g([["onClick",c=>{t()}],["type","button"],["className","text-gray-700"],(o=[Hi(24,24)],["children",y.Children.toArray(Array.from(o))])])))],["children",y.Children.toArray(Array.from(i))])]))),u("div",{className:"font-semibold text-sm pt-6",children:"What file format is accepted for bulk import?"}),u("div",{className:"text-sm text-gray-500 pt-2",children:"The only accepted file format for bulk import is CSV."}),u("div",{className:"font-semibold text-sm pt-6",children:"What is the maximum upload file size?"}),u("div",{className:"text-sm text-gray-500 pt-2",children:"The maximum upload file size is 10 MB."}),u("div",{className:"font-semibold text-sm pt-6",children:"What is the maximum number of rows supported for bulk import?"}),u("div",{className:"text-sm text-gray-500 pt-2",children:"The maximum number of rows you can upload is 5,000."}),u("div",{className:"font-semibold text-sm pt-6",children:"What information do I need to include in the CSV file?"}),u("div",w(g([["className","text-sm text-gray-500 pt-2"],(s="You must include the required fields: “First name,” “Last name,” and “Email” to create a profile. “Mobile number” and “Employment basis” are optional but recommended, as they can help with searching and filtering.",["children",s])]))),u("div",{className:"font-semibold text-sm pt-6",children:"How do I format the CSV file?"}),u("div",w(g([["className","text-sm text-gray-500 pt-2"],(a=`We recommend downloading and editing our sample CSV template, which includes all the necessary column headers and example values.
|
|
66
66
|
If you’re using your own CSV, ensure that your data is organised correctly and that there are no extra spaces or special characters.`,["children",a])]))),u("div",{className:"font-semibold text-sm pt-6",children:"What should I do if my CSV file contains errors?"}),u("div",w(g([["className","text-sm text-gray-500 pt-2"],(l=`We recommend checking for common issues, such as missing data or incorrect formatting before upload.
|
|
67
|
-
If errors are detected during import, you can download a CSV file that lists all the rows with issues.`,["children",l])])))],["children",y.Children.toArray(Array.from(r))])])))]])))],["children",y.Children.toArray(Array.from(n))])])))]])]))}function l4(e,t){let n,r,i;return u("svg",w(g([["fill","none"],["height",t],["width",e],["viewBox","0 0 "+e+" "+t],["xmlns","http://www.w3.org/2000/svg"],(n=g([u("path",w(g([(r="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM3.99743 10C3.99743 13.3151 6.68487 16.0026 10 16.0026C13.3151 16.0026 16.0026 13.3151 16.0026 10C16.0026 6.68487 13.3151 3.99743 10 3.99743C6.68487 3.99743 3.99743 6.68487 3.99743 10Z",["d",r]),["fill","#D6E2FC"]]))),u("path",w(g([(i="M10 3C10 2.44772 10.4494 1.99356 10.9974 2.06242C11.7053 2.15137 12.3996 2.3348 13.0615 2.60896C14.0321 3.011 14.914 3.60028 15.6569 4.34315C16.3997 5.08602 16.989 5.96793 17.391 6.93853C17.6652 7.60043 17.8486 8.29473 17.9376 9.0026C18.0064 9.55057 17.5523 10 17 10C16.4477 10 16.0085 9.54925 15.9169 9.00462C15.842 8.55939 15.7169 8.12298 15.5433 7.7039C15.2417 6.97595 14.7998 6.31451 14.2426 5.75736C13.6855 5.20021 13.0241 4.75825 12.2961 4.45672C11.877 4.28313 11.4406 4.15804 10.9954 4.08314C10.4508 3.99152 10 3.55228 10 3Z",["d",i]),["fill","#2E66F7"]])))]),["children",y.Children.toArray(Array.from(n))])])))}function u4(e,t){let n,r;return u("svg",w(g([["fill","none"],["height",t],["width",e],["viewBox","0 0 "+e+" "+t],["xmlns","http://www.w3.org/2000/svg"],(n=g([u("path",w(g([(r="M17 21H3C1.346 21 0 19.654 0 18V14H2V18C2 18.551 2.448 19 3 19H17C17.552 19 18 18.551 18 18V14H20V18C20 19.654 18.654 21 17 21Z",["d",r]),["fill","#9CA3AF"]]))),u("path",{d:"M16.414 7L10 0.585999L3.586 7L5 8.414L9 4.414V15H11V4.414L15 8.414L16.414 7Z",fill:"#9CA3AF"})]),["children",y.Children.toArray(Array.from(n))])])))}function c4(e,t){Js(J.Delay(()=>J.Bind(N0(1e3),()=>(i4(n=>{t(new as(0,[new Qs(1,[n])]))},e),J.Zero()))))}const Xa=(()=>{const e=new Blob(["First name,Last name,Email,Mobile phone,Employment basis"],{type:"text/csv;charset=utf-8;"});return window.URL.createObjectURL(e)})();function d4(e){let t,n,r,i,o,s,a,l;const c=e.markDirty,f=e.cancel,d=e.next,p=e.existingCsvFile;let h;const m=o4(p);h=Hr(()=>Vr(()=>m,(k,N)=>s4(c,k,N),(k,N)=>{}),void 0,void 0);const v=h[0],b=h[1],x=k=>{b(new as(0,[new Qs(0,[[new Nm(k.name),N=>{c4(k,N)}]])]))},C=y.useState(!1),S=C[1],$=y.useState(!1),D=$[1],F=y.useState(!1),L=F[1],E=y.useRef(void 0),_=v.tag===2;return u("div",w(g([["className","bg-gray-50 h-full"],(t=[u("div",w(g([["className","max-w-[640px] flex flex-col mx-12 mt-8 mb-12"],(n=[mp(Xa,C[0],()=>{S(!1)}),a4(F[0],()=>{L(!1)}),Ca("Upload CSV"),Sa("Download and use our template, or upload your own CSV to get started."),u("a",w(g([["className","flex flex-row items-end gap-1"],["href",Xa],["download","import_users"],(r=[u("span",{className:"text-sm font-medium text-primary-600 pt-2",children:"Download sample CSV template"}),fp(16,16)],["children",y.Children.toArray(Array.from(r))])]))),u("div",w(g([["className","flex flex-row pt-3 gap-2"],(i=[go("What kind of data do I need?",()=>{S(!0)}),go("Frequently asked questions",()=>{L(!0)})],["children",y.Children.toArray(Array.from(i))])]))),u("div",w(Y(T(()=>H($[0]?A(["className","h-75 border-gray-300 border-dashed border-2 rounded-md my-6 bg-blue-50 border-blue-300"]):A(["className","h-75 border-gray-300 border-dashed border-2 rounded-md my-6 hover:bg-gray-100"]),T(()=>{let k;return A((k=Y(T(()=>{let N,I,O,B,pe,Z,W,P,G,j,de,z,R,ge;switch(v.tag){case 2:{let me;const we=v.fields[0].SizeInBytes/1024/1024;return me=we<.01?.01:we,A(u("div",w(g([["className","p-6 justify-between items-center inline-flex w-full"],(N=[u("div",w(g([["className","justify-start items-start gap-2 flex"],(I=[u("div",{className:"text-center text-gray-600 text-sm font-medium",children:v.fields[0].Name.fields[0]}),u("span",w(g([["className","text-emerald-700"],(O=[Vu(20,20)],["children",y.Children.toArray(Array.from(O))])])))],["children",y.Children.toArray(Array.from(I))])]))),u("div",w(g([["className","justify-start items-start gap-3 flex"],(B=[u("div",{className:"text-center text-gray-500 text-sm font-medium",children:(pe=Jl("{0:F2}",me),kr(Fn("%sMB"))(pe))}),u("button",w(g([["className","justify-start items-center gap-1 flex text-red-600"],["onClick",Ee=>{b(new as(2,[]))}],(Z=[u("div",{className:"text-center text-sm font-medium",children:"Remove"}),u("div",w(g([["className","w-4 h-4 justify-center items-center flex"],(W=[Ss(10,10)],["children",y.Children.toArray(Array.from(W))])])))],["children",y.Children.toArray(Array.from(Z))])])))],["children",y.Children.toArray(Array.from(B))])])))],["children",y.Children.toArray(Array.from(N))])]))))}case 1:return A(u("div",w(g([["className","p-6 justify-between items-center inline-flex w-full"],(P=[u("div",w(g([["className","justify-start items-start gap-2 flex"],(G=[u("div",{className:"text-center text-gray-600 text-sm font-medium",children:v.fields[0].fields[0]}),u("span",w(g([["className","animate-spin"],(j=[l4(20,20)],["children",y.Children.toArray(Array.from(j))])])))],["children",y.Children.toArray(Array.from(G))])]))),u("div",w(g([["className","justify-start items-start gap-2 flex"],(de=[u("button",w(g([["className","justify-start items-center gap-1 flex text-red-600"],["onClick",me=>{b(new as(1,[]))}],(z=[u("div",{className:"text-center text-sm font-medium",children:"Cancel"}),u("div",w(g([["className","w-4 h-4 justify-center items-center flex"],(R=[Ss(10,10)],["children",y.Children.toArray(Array.from(R))])])))],["children",y.Children.toArray(Array.from(z))])])))],["children",y.Children.toArray(Array.from(de))])])))],["children",y.Children.toArray(Array.from(P))])]))));default:{const me=we=>{we.preventDefault(),we.stopPropagation()};return A(u("div",w(g([["className","flex flex-col items-center p-4"],["onDragEnter",we=>{me(we),D(!0)}],["onDragLeave",we=>{me(we),D(!1)}],["onDragOver",we=>{me(we),D(!0)}],["onDrop",we=>{let Ee;me(we),D(!1),x((Ee=we,Ee.dataTransfer).files.item(0))}],(ge=Y(T(()=>{let we,Ee,ne,xe,Ce,De;return H((we=v.fields[0],we==null?A(Ae()):(Ee=we,A(u("div",w(g([["className","h-9 p-2 bg-red-50 rounded-md justify-start items-start gap-2 inline-flex w-full"],(ne=[u("div",w(g([["className","w-5 h-5 px-0.5 pt-0.5 pb-[3px] justify-center items-center flex"],(xe=[Zh(16,15)],["children",y.Children.toArray(Array.from(xe))])]))),u("div",w(g([["className","grow shrink basis-0 flex-col justify-start items-start gap-2 inline-flex"],(Ce=[u("div",w(g([["className","self-stretch text-red-800 text-sm font-normal"],(De=Y(T(()=>{let ee;const oe=te=>u("span",{className:"font-medium",children:te}),q=te=>u("span",{children:[te]}),Se=u("a",{className:"underline",children:"sample CSV",href:Xa,download:"import_users"});return A((ee=Ee.tag===1?g([oe("File is too large (over 10MB). "),q("Upload a "),oe("smaller file"),q(".")]):Ee.tag===2?g([oe("File is empty. "),q("Ensure your file contains data before uploading.")]):Ee.tag===3?g([oe("Too many rows (5000+). "),q("Upload a "),oe("file with fewer rows"),q(".")]):Ee.tag===4?g([oe("Invalid CSV: Missing header field(s). "),q("Try using our "),Se,q(".")]):Ee.tag===5?g([oe("Invalid CSV: Duplicate header fields. "),q("Try using our "),Se,q(".")]):Ee.tag===6?g([oe("Invalid CSV: Rows have different lengths. "),q("Check for missing or extra columns.")]):Ee.tag===7?g([oe("Invalid CSV format. "),q("Try using our "),Se,q(".")]):g([oe("Unsupported file type. "),q("Upload a "),oe(".csv file"),q(".")]),u("p",{children:y.Children.toArray(Array.from(ee))})))})),["children",y.Children.toArray(Array.from(De))])])))],["children",y.Children.toArray(Array.from(Ce))])])))],["children",y.Children.toArray(Array.from(ne))])])))))),T(()=>{let ee;return H(A(u("div",w(g([["className","pt-2"],(ee=[u4(20,21)],["children",y.Children.toArray(Array.from(ee))])])))),T(()=>H(A(u("input",{type:"file",onChange:oe=>{const q=oe.target.files;q!=null&&q.length>0&&x(q.item(0))},className:"hidden",ref:E})),T(()=>H(A(u("span",{className:"text-gray-600 text-sm font-medium mt-3",children:"Drag and drop CSV file here"})),T(()=>H(A(u("button",{className:"rounded text-sm w-[120px] border px-3 py-2 mt-4 font-medium text-gray-700 bg-white hover:bg-gray-50",onClick:oe=>{Hn(q=>{q.click()},Si(E.current))},type:"button",children:y.Children.toArray(["Choose file"])})),T(()=>A(u("span",{className:"text-gray-500 text-xs font-normal mt-2 font-normal pb-2",children:"Maximum size: 10 MB"}))))))))))}))})),["children",y.Children.toArray(Array.from(ge))])]))))}}})),["children",y.Children.toArray(Array.from(k))]))})))))),u("div",w(g([["className","flex flex-row justify-end gap-3"],(o=[u("button",w(g([(s="bg-white hover:bg-gray-50 rounded-md text-red-700 shadow-sm text-sm border border-gray-300 font-medium px-3 py-2 w-[120px]",["className",s]),["onClick",k=>{f()}],["type","button"],["children",y.Children.toArray(["Cancel import"])]]))),u("button",w(g([(a="inline-flex justify-center items-center gap-x-1 rounded-md text-white bg-primary-600 hover:enabled:bg-primary-700 text-sm w-[120px] border font-medium px-3 py-2 disabled:opacity-50",["className",a]),["onClick",k=>{v.tag===2&&d(v.fields[0])}],["type","button"],["disabled",!_],(l=["Map fields",Hu(13,8)],["children",y.Children.toArray(Array.from(l))])])))],["children",y.Children.toArray(Array.from(o))])])))],["children",y.Children.toArray(Array.from(n))])])))],["children",y.Children.toArray(Array.from(t))])])))}class Bt extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["UploadingCsv","MappingColumns","MappingEmploymentBasis","Reviewing"]}}class Lt extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Configuring","Importing"]}}function f4(){return[new Lt(0,[new Bt(0,[void 0])]),X()]}function m4(e,t){let n,r,i,o,s,a,l,c,f,d,p,h,m,v,b,x,C,S,$,D,F,L,E,_,k,N,I,O,B,pe,Z,W,P,G,j,de,z;if(e.tag===1)switch(e.fields[0].tag){case 1:{t.tag===0&&t.fields[0].tag===2?(n=13,N=t.fields[0].fields[0][1],I=t.fields[0].fields[0][0],O=t.fields[0].fields[0][2],B=e.fields[0].fields[0]):n=14;break}case 2:{e.fields[0].fields[0].tag===0?t.tag===0&&t.fields[0].tag===1?(n=17,de=t.fields[0].fields[0][0],z=e.fields[0].fields[0].fields[0]):n=18:e.fields[0].fields[0].fields[1]!=null?t.tag===0&&t.fields[0].tag===1?(n=16,W=e.fields[0].fields[0].fields[0],P=t.fields[0].fields[0][0],G=e.fields[0].fields[0].fields[1],j=t.fields[0].fields[0][1]):n=18:t.tag===0&&t.fields[0].tag===1?(n=15,pe=e.fields[0].fields[0].fields[0],Z=t.fields[0].fields[0][0]):n=18;break}default:t.tag===0&&t.fields[0].tag===3?t.fields[0].fields[0][2]!=null?(n=11,L=t.fields[0].fields[0][1],E=t.fields[0].fields[0][0],_=t.fields[0].fields[0][2][0],k=t.fields[0].fields[0][2][1]):(n=10,D=t.fields[0].fields[0][1],F=t.fields[0].fields[0][0]):n=12}else switch(e.fields[0].tag){case 1:{e.fields[0].fields[1]!=null?t.tag===0&&t.fields[0].tag===1?(n=4,c=e.fields[0].fields[0],f=t.fields[0].fields[0][0],d=e.fields[0].fields[1],p=t.fields[0].fields[0][1]):n=5:t.tag===0&&t.fields[0].tag===1?(n=3,a=e.fields[0].fields[0],l=t.fields[0].fields[0][0]):n=5;break}case 2:{t.tag===0&&t.fields[0].tag===2?(n=6,h=t.fields[0].fields[0][1],m=t.fields[0].fields[0][0],v=t.fields[0].fields[0][2],b=e.fields[0].fields[0]):n=7;break}case 3:{t.tag===0&&t.fields[0].tag===3?(n=8,t.fields[0].fields[0][0],x=t.fields[0].fields[0][1],C=t.fields[0].fields[0][2],S=e.fields[0].fields[1],$=e.fields[0].fields[0]):n=9;break}default:t.tag===0&&t.fields[0].tag===0?t.fields[0].fields[0]!=null?(n=1,i=e.fields[0].fields[0],o=t.fields[0].fields[0][0],s=t.fields[0].fields[0][1]):(n=0,r=e.fields[0].fields[0]):n=2}switch(n){case 0:return[new Lt(0,[new Bt(1,[[r,new Sn(0,[void 0])]])]),X()];case 1:return Q(i,o)?[new Lt(0,[new Bt(1,[[o,s]])]),X()]:[new Lt(0,[new Bt(1,[[i,new Sn(0,[void 0])]])]),X()];case 2:return[t,X()];case 3:return[new Lt(0,[new Bt(3,[[l,a,void 0]])]),X()];case 4:return[new Lt(0,[new Bt(2,[[f,c,d,p.tag===1&&p.fields[0].tag===1&&Q(d,p.fields[0].fields[1])?p.fields[0].fields[2]:void 0]])]),X()];case 5:return[t,X()];case 6:return[new Lt(0,[new Bt(3,[[m,h,[v,b]]])]),X()];case 7:return[t,X()];case 8:return[new Lt(1,[[$,x,C,S]]),X()];case 9:return[t,X()];case 10:return[new Lt(0,[new Bt(1,[[F,new Sn(1,[new Gr(0,[D])])]])]),X()];case 11:return[new Lt(0,[new Bt(2,[[E,L,_,k]])]),X()];case 12:return[t,X()];case 13:return[new Lt(0,[new Bt(1,[[I,new Sn(1,[new Gr(1,[N,O,B])])]])]),X()];case 14:return[t,X()];case 15:return[new Lt(0,[new Bt(0,[[Z,new Sn(1,[new Gr(0,[pe])])]])]),X()];case 16:return[new Lt(0,[new Bt(0,[[P,j.tag===1?j.fields[0].tag===1?Q(W,j.fields[0].fields[0])&&Q(G,j.fields[0].fields[1])?j:new Sn(1,[new Gr(1,[W,G,void 0])]):new Sn(1,[new Gr(1,[W,G,void 0])]):new Sn(1,[new Gr(1,[W,G,void 0])])]])]),X()];case 17:return[new Lt(0,[new Bt(0,[[de,new Sn(0,[z])]])]),X()];default:return[t,X()]}}function h4(e,t,n){let r,i,o,s,a,l,c,f,d,p,h;return Fi(g([new bt(3,[e]),new bt(4,[t]),new bt(5,[[Vi(le(new Li(2,["fixed inset-0 bg-gray-500/50"]))),u("div",w(g([["className","fixed inset-0 z-10 w-screen overflow-y-auto"],(r=[u("div",w(g([["className","flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"],(i=[Pi(g([new ar(1,["relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl sm:my-8 sm:w-full sm:max-w-lg sm:p-6"]),new ar(2,[[u("div",w(g([["className","absolute top-0 right-0 hidden pt-4 pr-4 sm:block"],(o=[u("button",w(g([["type","button"],["onClick",m=>{t()}],["className","text-gray-600"],(s=[Hi(24,24)],["children",y.Children.toArray(Array.from(s))])])))],["children",y.Children.toArray(Array.from(o))])]))),u("div",w(g([["className","sm:flex sm:items-start"],(a=[u("div",w(g([["className","mx-auto flex size-12 shrink-0 items-center justify-center sm:mx-0 sm:size-10"],(l=[H6([])],["children",y.Children.toArray(Array.from(l))])]))),u("div",w(g([["className","mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"],(c=[qh(g([new Os(2,["text-gray-900 text-lg font-bold"]),new Os(3,[["Cancel import"]])])),u("div",w(g([["className","mt-2 text-sm text-gray-500 leading-tight"],(f=[u("p",{children:["You’re about to cancel your import. All changes will be discarded."]}),u("br",{}),u("p",{children:["Are you sure you want to cancel and exit?"]})],["children",y.Children.toArray(Array.from(f))])])))],["children",y.Children.toArray(Array.from(c))])])))],["children",y.Children.toArray(Array.from(a))])]))),u("div",w(g([["className","mt-5 sm:mt-4 sm:flex sm:flex-row-reverse"],(d=[u("button",w(g([["type","button"],["onClick",m=>{n()}],(p="inline-flex w-full justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-medium text-white shadow-xs hover:bg-red-500 sm:ml-3 sm:w-auto",["className",p]),["children","Cancel import and exit"]]))),u("button",w(g([["type","button"],["onClick",m=>{t()}],(h="mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-gray-700 text-sm font-medium ring-1 shadow-xs ring-gray-300 ring-inset hover:bg-gray-50 sm:mt-0 sm:w-auto",["className",h]),["children","Continue import"]])))],["children",y.Children.toArray(Array.from(d))])])))]])]))],["children",y.Children.toArray(Array.from(i))])])))],["children",y.Children.toArray(Array.from(r))])])))]])]))}class Ja extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function p4(e,t){let n;const r=kw();return n=y.useRef(r),_m(()=>Cu(()=>{Nw(n.current)})),xm(i=>{Tw(n.current)||Js(J.Delay(()=>J.TryWith(J.Delay(()=>(t(new Ja(1,[])),J.Bind(e(i),o=>(t(new Ja(2,[o])),J.Zero())))),o=>(t(new Ja(3,[o])),J.Zero()))),n.current)})}function g4(e,t,n,r,i,o,s){let a,l,c,f,d,p,h;return bm((a=[()=>E6(e,t,n,r,i),m=>{let v,b,x,C;switch(m.tag){case 1:case 0:{v=3;break}case 3:{v=2,C=m.fields[0];break}default:m.fields[0].tag===1?(v=1,x=m.fields[0].fields[0]):(v=0,b=m.fields[0].fields[0])}switch(v){case 0:{o(b);break}case 1:{s(x);break}case 2:{s(Je(C));break}}}],p4(a[0],a[1]))),u("div",w(g([["className","fixed inset-0 z-100 w-screen overflow-y-auto bg-white"],(l=[u("div",w(g([["className","flex-col w-full h-full justify-center items-center gap-2.5 inline-flex overflow-hidden"],(c=[u("div",w(g([["className","self-stretch h-[118px] flex-col justify-center items-center gap-8 flex"],(f=[u("div",w(g([["className","relative"],(d=[B6([])],["children",y.Children.toArray(Array.from(d))])]))),u("div",w(g([["className","flex-col justify-start items-center gap-6 flex"],(p=[u("div",w(g([["className","w-[140px] h-1.5 relative bg-blue-100 rounded-[5px] overflow-hidden"],(h=[u("div",{style:{animation:"progressBar 2s linear infinite"},className:"h-1.5 top-0 absolute bg-gradient-to-r from-[#a650ff] to-[#0095f2] rounded-[5px]"})],["children",y.Children.toArray(Array.from(h))])])))],["children",y.Children.toArray(Array.from(p))])])))],["children",y.Children.toArray(Array.from(f))])])))],["children",y.Children.toArray(Array.from(c))])])))],["children",y.Children.toArray(Array.from(l))])])))}class pn extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Key","As","Appear","Show","ClassName","Enter","EnterFrom","EnterTo","Leave","LeaveFrom","LeaveTo","Children"]}}function w4(e){return u(Bh,jn(e,1))}class qr extends _e{constructor(t,n,r){super(),this.Type=t,this.Title=n,this.Message=r}}class Yr extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Success","Failure","InProgress"]}}function y4(e,t){let n,r,i,o,s,a,l,c;return w4(g([new pn(1,["div"]),new pn(4,["pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5"]),new pn(3,[!0]),new pn(5,["transform ease-out duration-300 transition"]),new pn(6,["translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"]),new pn(7,["translate-y-0 opacity-100 sm:translate-x-0"]),new pn(8,["transition ease-in duration-100"]),new pn(9,["opacity-100"]),new pn(10,["opacity-0"]),new pn(11,[[u("div",w(g([["key","1"],(n=[u("div",w(g([["className","p-4"],(r=[u("div",w(g([["className","flex items-start"],(i=[u("div",w(g([["className","flex-shrink-0"],(o=Y(T(()=>{const f=t.Type;return f.tag===1?A(W6([])):f.tag===2?A(G6([])):A(U6([]))})),["children",y.Children.toArray(Array.from(o))])]))),u("div",w(g([["className","ml-3 w-0 flex-1 pt-0.5"],(s=[u("p",{className:"text-sm font-medium text-gray-900",children:t.Title}),u("p",{className:"mt-1 text-sm text-gray-500",children:t.Message})],["children",y.Children.toArray(Array.from(s))])]))),u("div",w(g([["className","ml-4 flex flex-shrink-0"],(a=[u("button",w(g([["type","button"],(l="inline-flex rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",["className",l]),["onClick",f=>{e()}],(c=[Ss(10,10)],["children",y.Children.toArray(Array.from(c))])])))],["children",y.Children.toArray(Array.from(a))])])))],["children",y.Children.toArray(Array.from(i))])])))],["children",y.Children.toArray(Array.from(r))])])))],["children",y.Children.toArray(Array.from(n))])])))]])]))}function v4(e){const t=document.getElementById("toasts-container"),n=Gy(),r=y4(()=>{document.getElementById(n).remove()},e),i=document.createElement("div");Gl(r,i);const o=i.children[0];o.id=n,t.appendChild(o)}const b4=3e4;function _4(e,t,n,r,i){const o=r.fields[0],s=()=>J.Delay(()=>J.Bind(N0(b4),()=>J.Bind(t(n),a=>{let l,c,f,d;const p=a;return p.tag!==1&&(p.fields[0].tag!==1||(p.fields[0].fields[0].tag===1?(e(new qr(new Yr(1,[]),"We found a duplicate user",`"${he(i.fields[0],he(p.fields[0].fields[0].fields[0]-2,o).fields[0])}" already exists in our system. This user was skipped during the import.`)),!1):p.fields[0].fields[0].tag===2?(l=p.fields[0].fields[0].fields[0].DuplicateEmailCount>0,c=p.fields[0].fields[0].fields[0].OtherFailuresCount>0,e(l?c?new qr(new Yr(1,[]),"We found multiple import errors",(f="One or more of the rows experienced errors during import. These rows were skipped during the import.",f)):new qr(new Yr(1,[]),`We found ${p.fields[0].fields[0].fields[0].DuplicateEmailCount} duplicate users`,(d="One or more of the users you’re trying to add already exist in our system. These users were skipped during the import.",d)):new qr(new Yr(1,[]),"We found multiple import errors",(f="One or more of the rows experienced errors during import. These rows were skipped during the import.",f))),!1):(e(new qr(new Yr(0,[]),`Successfully added ${p.fields[0].fields[0].fields[0]} users`,"If you don’t see any new users, try refreshing this page.")),!1)))?J.Bind(s(),()=>J.Return(void 0)):J.Zero()})));e(new qr(new Yr(2,[]),`Importing ${o.length} users`,"This might take a while, we'll let you know via email when it's finished.")),Js(s())}class kt extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Completed","Active","Disabled"]}}class Jo extends _e{constructor(t,n,r,i){super(),this.UploadingCsv=t,this.MappingColumns=n,this.MappingEmploymentBasis=r,this.Reviewing=i}}function tf(){Cm(g(["admin","app","users"]))}function hp(e){Cm(g(["admin","app","oops"]))}function x4(e){switch(e.tag){case 1:return new Jo(new kt(0,[]),new kt(1,[]),new kt(2,[]),new kt(2,[]));case 2:return new Jo(new kt(0,[]),new kt(0,[]),new kt(1,[]),new kt(2,[]));case 3:return new Jo(new kt(0,[]),new kt(0,[]),new kt(0,[]),new kt(1,[]));default:return new Jo(new kt(1,[]),new kt(2,[]),new kt(2,[]),new kt(2,[]))}}function C4(e,t,n,r,i){switch(i.tag){case 1:{const o=i.fields[0],s=o[1].tag===1?o[1].fields[0].tag===1?[Ed(o[1].fields[0].fields[0],o[1].fields[0].fields[1]),o[0].HeaderRow,o[0].DataRows]:[Ed(o[1].fields[0].fields[0],void 0),o[0].HeaderRow,o[0].DataRows]:[o[1].fields[0],o[0].HeaderRow,o[0].DataRows];return u(d6,{existingMappings:eo(s[0]),headerRow:s[1],dataRows:s[2],next:a=>{let l;n(new pr(0,[(l=a,new Yo(1,[l[0],l[1]]))]))},back:a=>{n(new pr(1,[new Ka(2,[a])]))}})}case 2:{const o=G_(i.fields[0][0].DataRows,i.fields[0][2]);return u(b6,{existingMappings:eo(i.fields[0][3]),employmentBasisColumn:o,next:s=>{n(new pr(0,[new Yo(2,[s])]))},back:s=>{n(new pr(1,[new Ka(1,[s])]))}})}case 3:return u(Q6,{apiCallAsync:e,dataRows:i.fields[0][0].DataRows,baseColumnMappings:i.fields[0][1],employmentBasis:eo(i.fields[0][2]),next:o=>{let s;n(new pr(0,[(s=o,new Yo(3,[s[0],s[1]]))]))},back:()=>{n(new pr(1,[new Ka(0,[])]))},onError:o=>{hp()}});default:{const o=Ct(s=>s[0],i.fields[0]);return u(d4,{existingCsvFile:eo(o),next:s=>{n(new pr(0,[new Yo(0,[s])]))},cancel:t,markDirty:r})}}}function Qo(e,t){let n,r,i;switch(t.tag){case 1:return u("div",w(g([["className","text-sm font-medium border-b-2 border-primary-600 pt-1 pb-3 text-primary-600"],(n=[u("span",{children:e})],["children",y.Children.toArray(Array.from(n))])])));case 2:return u("div",w(g([["className","text-sm font-medium pt-1 pb-3 text-gray-500"],(r=[u("span",{children:e})],["children",y.Children.toArray(Array.from(r))])])));default:return u("div",w(g([["className","text-sm font-medium pt-1 pb-3 text-emerald-700 gap-2 inline-flex"],(i=[Vu(20,20),u("span",{children:e})],["children",y.Children.toArray(Array.from(i))])])))}}function S4(e){let t,n,r,i,o;const s=f4();o=Hr(()=>Vr(()=>s,m4,(x,C)=>{}),void 0,void 0);const a=o[0],l=y.useState(!1),c=l[0],f=l[1],d=y.useState(!1),p=d[0],h=y.useCallback(x=>{x.preventDefault(),x.returnValue=!0},[]),m=()=>{window.removeEventListener("beforeunload",h)};vm(()=>(p?window.addEventListener("beforeunload",h):m(),{Dispose(){m()}}),[p]);let v;if(a.tag===0){const x=a.fields[0],C=()=>{c||f(!0)},S=x4(x),$=C4(D=>tv(e.backendUrl,D),C,o[1],d[1],x);v=u("div",w(g([["className","flex flex-col h-full"],(t=[h4(c,()=>{c&&f(!1)},()=>{c&&(m(),tf())}),u("div",w(g([["className","flex flex-row justify-between px-12 pt-8 pb-4"],(n=[u("span",{className:"font-sonoma text-gray-900 font-bold text-lg",children:"Import Users from CSV"}),u("button",w(g([(r="bg-white hover:bg-gray-50 rounded-md text-red-700 shadow-sm text-sm border border-gray-300 font-medium px-3 py-2 w-[120px]",["className",r]),["onClick",D=>{C()}],["type","button"],["children",y.Children.toArray(["Cancel import"])]])))],["children",y.Children.toArray(Array.from(n))])]))),u("div",w(g([["className","flex flex-row items-center px-12 gap-2 border-b border-gray-200"],(i=[Qo("1. Upload CSV",S.UploadingCsv),u("hr",{className:"w-16 pt-1.5"}),Qo("2. Map fields",S.MappingColumns),u("hr",{className:"w-16 pt-1.5"}),Qo("3. Map values",S.MappingEmploymentBasis),u("hr",{className:"w-16 pt-1.5"}),Qo("4. Review",S.Reviewing)],["children",y.Children.toArray(Array.from(i))])]))),$],["children",y.Children.toArray(Array.from(t))])])))}else{const x=a.fields[0][0],C=a.fields[0][1];v=g4(S=>nv(e.backendUrl,S),x,C,a.fields[0][2],a.fields[0][3],S=>{m();const $=[S,x,C.Email];_4(D=>{v4(D)},D=>rv(e.backendUrl,D),$[0],$[1],$[2]),tf()},S=>{m(),hp()})}const b=[u("style",{children:[Zl]}),v];return u(ze,{},...b)}function E4(){Fl(e=>u(S4,e),"apollo-import-workspace-wizard")}Fl(e=>u(gg,e),"apollo-import-workspace-app");b_();E4();
|
|
67
|
+
If errors are detected during import, you can download a CSV file that lists all the rows with issues.`,["children",l])])))],["children",y.Children.toArray(Array.from(r))])])))]])))],["children",y.Children.toArray(Array.from(n))])])))]])]))}function l4(e,t){let n,r,i;return u("svg",w(g([["fill","none"],["height",t],["width",e],["viewBox","0 0 "+e+" "+t],["xmlns","http://www.w3.org/2000/svg"],(n=g([u("path",w(g([(r="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM3.99743 10C3.99743 13.3151 6.68487 16.0026 10 16.0026C13.3151 16.0026 16.0026 13.3151 16.0026 10C16.0026 6.68487 13.3151 3.99743 10 3.99743C6.68487 3.99743 3.99743 6.68487 3.99743 10Z",["d",r]),["fill","#D6E2FC"]]))),u("path",w(g([(i="M10 3C10 2.44772 10.4494 1.99356 10.9974 2.06242C11.7053 2.15137 12.3996 2.3348 13.0615 2.60896C14.0321 3.011 14.914 3.60028 15.6569 4.34315C16.3997 5.08602 16.989 5.96793 17.391 6.93853C17.6652 7.60043 17.8486 8.29473 17.9376 9.0026C18.0064 9.55057 17.5523 10 17 10C16.4477 10 16.0085 9.54925 15.9169 9.00462C15.842 8.55939 15.7169 8.12298 15.5433 7.7039C15.2417 6.97595 14.7998 6.31451 14.2426 5.75736C13.6855 5.20021 13.0241 4.75825 12.2961 4.45672C11.877 4.28313 11.4406 4.15804 10.9954 4.08314C10.4508 3.99152 10 3.55228 10 3Z",["d",i]),["fill","#2E66F7"]])))]),["children",y.Children.toArray(Array.from(n))])])))}function u4(e,t){let n,r;return u("svg",w(g([["fill","none"],["height",t],["width",e],["viewBox","0 0 "+e+" "+t],["xmlns","http://www.w3.org/2000/svg"],(n=g([u("path",w(g([(r="M17 21H3C1.346 21 0 19.654 0 18V14H2V18C2 18.551 2.448 19 3 19H17C17.552 19 18 18.551 18 18V14H20V18C20 19.654 18.654 21 17 21Z",["d",r]),["fill","#9CA3AF"]]))),u("path",{d:"M16.414 7L10 0.585999L3.586 7L5 8.414L9 4.414V15H11V4.414L15 8.414L16.414 7Z",fill:"#9CA3AF"})]),["children",y.Children.toArray(Array.from(n))])])))}function c4(e,t){Js(J.Delay(()=>J.Bind(N0(1e3),()=>(i4(n=>{t(new as(0,[new Qs(1,[n])]))},e),J.Zero()))))}const Xa=(()=>{const e=new Blob(["First name,Last name,Email,Mobile phone,Employment basis"],{type:"text/csv;charset=utf-8;"});return window.URL.createObjectURL(e)})();function d4(e){let t,n,r,i,o,s,a,l;const c=e.markDirty,f=e.cancel,d=e.next,p=e.existingCsvFile;let h;const m=o4(p);h=Hr(()=>Vr(()=>m,(k,N)=>s4(c,k,N),(k,N)=>{}),void 0,void 0);const v=h[0],b=h[1],x=k=>{b(new as(0,[new Qs(0,[[new Nm(k.name),N=>{c4(k,N)}]])]))},C=y.useState(!1),S=C[1],$=y.useState(!1),D=$[1],F=y.useState(!1),L=F[1],E=y.useRef(void 0),_=v.tag===2;return u("div",w(g([["className","bg-gray-50 h-full"],(t=[u("div",w(g([["className","max-w-[640px] flex flex-col mx-12 mt-8 mb-12"],(n=[mp(Xa,C[0],()=>{S(!1)}),a4(F[0],()=>{L(!1)}),Ca("Upload CSV"),Sa("Download and use our template, or upload your own CSV to get started."),u("a",w(g([["className","flex flex-row items-end gap-1"],["href",Xa],["download","import_users"],(r=[u("span",{className:"text-sm font-medium text-primary-600 pt-2",children:"Download sample CSV template"}),fp(16,16)],["children",y.Children.toArray(Array.from(r))])]))),u("div",w(g([["className","flex flex-row pt-3 gap-2"],(i=[go("What kind of data do I need?",()=>{S(!0)}),go("Frequently asked questions",()=>{L(!0)})],["children",y.Children.toArray(Array.from(i))])]))),u("div",w(Y(T(()=>H($[0]?A(["className","h-75 border-gray-300 border-dashed border-2 rounded-md my-6 bg-blue-50 border-blue-300"]):A(["className","h-75 border-gray-300 border-dashed border-2 rounded-md my-6 hover:bg-gray-100"]),T(()=>{let k;return A((k=Y(T(()=>{let N,I,O,B,pe,Z,W,P,G,j,de,z,R,ge;switch(v.tag){case 2:{let me;const we=v.fields[0].SizeInBytes/1024/1024;return me=we<.01?.01:we,A(u("div",w(g([["className","p-6 justify-between items-center inline-flex w-full"],(N=[u("div",w(g([["className","justify-start items-start gap-2 flex"],(I=[u("div",{className:"text-center text-gray-600 text-sm font-medium",children:v.fields[0].Name.fields[0]}),u("span",w(g([["className","text-emerald-700"],(O=[Vu(20,20)],["children",y.Children.toArray(Array.from(O))])])))],["children",y.Children.toArray(Array.from(I))])]))),u("div",w(g([["className","justify-start items-start gap-3 flex"],(B=[u("div",{className:"text-center text-gray-500 text-sm font-medium",children:(pe=Jl("{0:F2}",me),kr(Fn("%sMB"))(pe))}),u("button",w(g([["className","justify-start items-center gap-1 flex text-red-600"],["onClick",Ee=>{b(new as(2,[]))}],(Z=[u("div",{className:"text-center text-sm font-medium",children:"Remove"}),u("div",w(g([["className","w-4 h-4 justify-center items-center flex"],(W=[Ss(10,10)],["children",y.Children.toArray(Array.from(W))])])))],["children",y.Children.toArray(Array.from(Z))])])))],["children",y.Children.toArray(Array.from(B))])])))],["children",y.Children.toArray(Array.from(N))])]))))}case 1:return A(u("div",w(g([["className","p-6 justify-between items-center inline-flex w-full"],(P=[u("div",w(g([["className","justify-start items-start gap-2 flex"],(G=[u("div",{className:"text-center text-gray-600 text-sm font-medium",children:v.fields[0].fields[0]}),u("span",w(g([["className","animate-spin"],(j=[l4(20,20)],["children",y.Children.toArray(Array.from(j))])])))],["children",y.Children.toArray(Array.from(G))])]))),u("div",w(g([["className","justify-start items-start gap-2 flex"],(de=[u("button",w(g([["className","justify-start items-center gap-1 flex text-red-600"],["onClick",me=>{b(new as(1,[]))}],(z=[u("div",{className:"text-center text-sm font-medium",children:"Cancel"}),u("div",w(g([["className","w-4 h-4 justify-center items-center flex"],(R=[Ss(10,10)],["children",y.Children.toArray(Array.from(R))])])))],["children",y.Children.toArray(Array.from(z))])])))],["children",y.Children.toArray(Array.from(de))])])))],["children",y.Children.toArray(Array.from(P))])]))));default:{const me=we=>{we.preventDefault(),we.stopPropagation()};return A(u("div",w(g([["className","flex flex-col items-center p-4"],["onDragEnter",we=>{me(we),D(!0)}],["onDragLeave",we=>{me(we),D(!1)}],["onDragOver",we=>{me(we),D(!0)}],["onDrop",we=>{let Ee;me(we),D(!1),x((Ee=we,Ee.dataTransfer).files.item(0))}],(ge=Y(T(()=>{let we,Ee,ne,xe,Ce,De;return H((we=v.fields[0],we==null?A(Ae()):(Ee=we,A(u("div",w(g([["className","h-9 p-2 bg-red-50 rounded-md justify-start items-start gap-2 inline-flex w-full"],(ne=[u("div",w(g([["className","w-5 h-5 px-0.5 pt-0.5 pb-[3px] justify-center items-center flex"],(xe=[Zh(16,15)],["children",y.Children.toArray(Array.from(xe))])]))),u("div",w(g([["className","grow shrink basis-0 flex-col justify-start items-start gap-2 inline-flex"],(Ce=[u("div",w(g([["className","self-stretch text-red-800 text-sm font-normal"],(De=Y(T(()=>{let ee;const oe=te=>u("span",{className:"font-medium",children:te}),q=te=>u("span",{children:[te]}),Se=u("a",{className:"underline",children:"sample CSV",href:Xa,download:"import_users"});return A((ee=Ee.tag===1?g([oe("File is too large (over 10MB). "),q("Upload a "),oe("smaller file"),q(".")]):Ee.tag===2?g([oe("File is empty. "),q("Ensure your file contains data before uploading.")]):Ee.tag===3?g([oe("Too many rows (5000+). "),q("Upload a "),oe("file with fewer rows"),q(".")]):Ee.tag===4?g([oe("Invalid CSV: Missing header field(s). "),q("Try using our "),Se,q(".")]):Ee.tag===5?g([oe("Invalid CSV: Duplicate header fields. "),q("Try using our "),Se,q(".")]):Ee.tag===6?g([oe("Invalid CSV: Rows have different lengths. "),q("Check for missing or extra columns.")]):Ee.tag===7?g([oe("Invalid CSV format. "),q("Try using our "),Se,q(".")]):g([oe("Unsupported file type. "),q("Upload a "),oe(".csv file"),q(".")]),u("p",{children:y.Children.toArray(Array.from(ee))})))})),["children",y.Children.toArray(Array.from(De))])])))],["children",y.Children.toArray(Array.from(Ce))])])))],["children",y.Children.toArray(Array.from(ne))])])))))),T(()=>{let ee;return H(A(u("div",w(g([["className","pt-2"],(ee=[u4(20,21)],["children",y.Children.toArray(Array.from(ee))])])))),T(()=>H(A(u("input",{type:"file",onChange:oe=>{const q=oe.target.files;q!=null&&q.length>0&&x(q.item(0))},className:"hidden",ref:E})),T(()=>H(A(u("span",{className:"text-gray-600 text-sm font-medium mt-3",children:"Drag and drop CSV file here"})),T(()=>H(A(u("button",{className:"rounded text-sm w-[120px] border px-3 py-2 mt-4 font-medium text-gray-700 bg-white hover:bg-gray-50",onClick:oe=>{Hn(q=>{q.click()},Si(E.current))},type:"button",children:y.Children.toArray(["Choose file"])})),T(()=>A(u("span",{className:"text-gray-500 text-xs font-normal mt-2 font-normal pb-2",children:"Maximum size: 10 MB"}))))))))))}))})),["children",y.Children.toArray(Array.from(ge))])]))))}}})),["children",y.Children.toArray(Array.from(k))]))})))))),u("div",w(g([["className","flex flex-row justify-end gap-3"],(o=[u("button",w(g([(s="bg-white hover:bg-gray-50 rounded-md text-red-700 shadow-sm text-sm border border-gray-300 font-medium px-3 py-2 w-[120px]",["className",s]),["onClick",k=>{f()}],["type","button"],["children",y.Children.toArray(["Cancel import"])]]))),u("button",w(g([(a="inline-flex justify-center items-center gap-x-1 rounded-md text-white bg-primary-600 hover:enabled:bg-primary-700 text-sm w-[120px] border font-medium px-3 py-2 disabled:opacity-50",["className",a]),["onClick",k=>{v.tag===2&&d(v.fields[0])}],["type","button"],["disabled",!_],(l=["Map fields",Hu(13,8)],["children",y.Children.toArray(Array.from(l))])])))],["children",y.Children.toArray(Array.from(o))])])))],["children",y.Children.toArray(Array.from(n))])])))],["children",y.Children.toArray(Array.from(t))])])))}class Bt extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["UploadingCsv","MappingColumns","MappingEmploymentBasis","Reviewing"]}}class Lt extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Configuring","Importing"]}}function f4(){return[new Lt(0,[new Bt(0,[void 0])]),X()]}function m4(e,t){let n,r,i,o,s,a,l,c,f,d,p,h,m,v,b,x,C,S,$,D,F,L,E,_,k,N,I,O,B,pe,Z,W,P,G,j,de,z;if(e.tag===1)switch(e.fields[0].tag){case 1:{t.tag===0&&t.fields[0].tag===2?(n=13,N=t.fields[0].fields[0][1],I=t.fields[0].fields[0][0],O=t.fields[0].fields[0][2],B=e.fields[0].fields[0]):n=14;break}case 2:{e.fields[0].fields[0].tag===0?t.tag===0&&t.fields[0].tag===1?(n=17,de=t.fields[0].fields[0][0],z=e.fields[0].fields[0].fields[0]):n=18:e.fields[0].fields[0].fields[1]!=null?t.tag===0&&t.fields[0].tag===1?(n=16,W=e.fields[0].fields[0].fields[0],P=t.fields[0].fields[0][0],G=e.fields[0].fields[0].fields[1],j=t.fields[0].fields[0][1]):n=18:t.tag===0&&t.fields[0].tag===1?(n=15,pe=e.fields[0].fields[0].fields[0],Z=t.fields[0].fields[0][0]):n=18;break}default:t.tag===0&&t.fields[0].tag===3?t.fields[0].fields[0][2]!=null?(n=11,L=t.fields[0].fields[0][1],E=t.fields[0].fields[0][0],_=t.fields[0].fields[0][2][0],k=t.fields[0].fields[0][2][1]):(n=10,D=t.fields[0].fields[0][1],F=t.fields[0].fields[0][0]):n=12}else switch(e.fields[0].tag){case 1:{e.fields[0].fields[1]!=null?t.tag===0&&t.fields[0].tag===1?(n=4,c=e.fields[0].fields[0],f=t.fields[0].fields[0][0],d=e.fields[0].fields[1],p=t.fields[0].fields[0][1]):n=5:t.tag===0&&t.fields[0].tag===1?(n=3,a=e.fields[0].fields[0],l=t.fields[0].fields[0][0]):n=5;break}case 2:{t.tag===0&&t.fields[0].tag===2?(n=6,h=t.fields[0].fields[0][1],m=t.fields[0].fields[0][0],v=t.fields[0].fields[0][2],b=e.fields[0].fields[0]):n=7;break}case 3:{t.tag===0&&t.fields[0].tag===3?(n=8,t.fields[0].fields[0][0],x=t.fields[0].fields[0][1],C=t.fields[0].fields[0][2],S=e.fields[0].fields[1],$=e.fields[0].fields[0]):n=9;break}default:t.tag===0&&t.fields[0].tag===0?t.fields[0].fields[0]!=null?(n=1,i=e.fields[0].fields[0],o=t.fields[0].fields[0][0],s=t.fields[0].fields[0][1]):(n=0,r=e.fields[0].fields[0]):n=2}switch(n){case 0:return[new Lt(0,[new Bt(1,[[r,new Sn(0,[void 0])]])]),X()];case 1:return Q(i,o)?[new Lt(0,[new Bt(1,[[o,s]])]),X()]:[new Lt(0,[new Bt(1,[[i,new Sn(0,[void 0])]])]),X()];case 2:return[t,X()];case 3:return[new Lt(0,[new Bt(3,[[l,a,void 0]])]),X()];case 4:return[new Lt(0,[new Bt(2,[[f,c,d,p.tag===1&&p.fields[0].tag===1&&Q(d,p.fields[0].fields[1])?p.fields[0].fields[2]:void 0]])]),X()];case 5:return[t,X()];case 6:return[new Lt(0,[new Bt(3,[[m,h,[v,b]]])]),X()];case 7:return[t,X()];case 8:return[new Lt(1,[[$,x,C,S]]),X()];case 9:return[t,X()];case 10:return[new Lt(0,[new Bt(1,[[F,new Sn(1,[new Gr(0,[D])])]])]),X()];case 11:return[new Lt(0,[new Bt(2,[[E,L,_,k]])]),X()];case 12:return[t,X()];case 13:return[new Lt(0,[new Bt(1,[[I,new Sn(1,[new Gr(1,[N,O,B])])]])]),X()];case 14:return[t,X()];case 15:return[new Lt(0,[new Bt(0,[[Z,new Sn(1,[new Gr(0,[pe])])]])]),X()];case 16:return[new Lt(0,[new Bt(0,[[P,j.tag===1?j.fields[0].tag===1?Q(W,j.fields[0].fields[0])&&Q(G,j.fields[0].fields[1])?j:new Sn(1,[new Gr(1,[W,G,void 0])]):new Sn(1,[new Gr(1,[W,G,void 0])]):new Sn(1,[new Gr(1,[W,G,void 0])])]])]),X()];case 17:return[new Lt(0,[new Bt(0,[[de,new Sn(0,[z])]])]),X()];default:return[t,X()]}}function h4(e,t,n){let r,i,o,s,a,l,c,f,d,p,h;return Fi(g([new bt(3,[e]),new bt(4,[t]),new bt(5,[[Vi(le(new Li(2,["fixed inset-0 bg-gray-500/50"]))),u("div",w(g([["className","fixed inset-0 z-10 w-screen overflow-y-auto"],(r=[u("div",w(g([["className","flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"],(i=[Pi(g([new ar(1,["relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl sm:my-8 sm:w-full sm:max-w-lg sm:p-6"]),new ar(2,[[u("div",w(g([["className","absolute top-0 right-0 hidden pt-4 pr-4 sm:block"],(o=[u("button",w(g([["type","button"],["onClick",m=>{t()}],["className","text-gray-600"],(s=[Hi(24,24)],["children",y.Children.toArray(Array.from(s))])])))],["children",y.Children.toArray(Array.from(o))])]))),u("div",w(g([["className","sm:flex sm:items-start"],(a=[u("div",w(g([["className","mx-auto flex size-12 shrink-0 items-center justify-center sm:mx-0 sm:size-10"],(l=[H6([])],["children",y.Children.toArray(Array.from(l))])]))),u("div",w(g([["className","mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"],(c=[qh(g([new Os(2,["text-gray-900 text-lg font-bold"]),new Os(3,[["Cancel import"]])])),u("div",w(g([["className","mt-2 text-sm text-gray-500 leading-tight"],(f=[u("p",{children:["You’re about to cancel your import. All changes will be discarded."]}),u("br",{}),u("p",{children:["Are you sure you want to cancel and exit?"]})],["children",y.Children.toArray(Array.from(f))])])))],["children",y.Children.toArray(Array.from(c))])])))],["children",y.Children.toArray(Array.from(a))])]))),u("div",w(g([["className","mt-5 sm:mt-4 sm:flex sm:flex-row-reverse"],(d=[u("button",w(g([["type","button"],["onClick",m=>{n()}],(p="inline-flex w-full justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-medium text-white shadow-xs hover:bg-red-500 sm:ml-3 sm:w-auto",["className",p]),["children","Cancel import and exit"]]))),u("button",w(g([["type","button"],["onClick",m=>{t()}],(h="mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-gray-700 text-sm font-medium ring-1 shadow-xs ring-gray-300 ring-inset hover:bg-gray-50 sm:mt-0 sm:w-auto",["className",h]),["children","Continue import"]])))],["children",y.Children.toArray(Array.from(d))])])))]])]))],["children",y.Children.toArray(Array.from(i))])])))],["children",y.Children.toArray(Array.from(r))])])))]])]))}class Ja extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function p4(e,t){let n;const r=kw();return n=y.useRef(r),_m(()=>Cu(()=>{Nw(n.current)})),xm(i=>{Tw(n.current)||Js(J.Delay(()=>J.TryWith(J.Delay(()=>(t(new Ja(1,[])),J.Bind(e(i),o=>(t(new Ja(2,[o])),J.Zero())))),o=>(t(new Ja(3,[o])),J.Zero()))),n.current)})}function g4(e,t,n,r,i,o,s){let a,l,c,f,d,p,h;return bm((a=[()=>E6(e,t,n,r,i),m=>{let v,b,x,C;switch(m.tag){case 1:case 0:{v=3;break}case 3:{v=2,C=m.fields[0];break}default:m.fields[0].tag===1?(v=1,x=m.fields[0].fields[0]):(v=0,b=m.fields[0].fields[0])}switch(v){case 0:{o(b);break}case 1:{s(x);break}case 2:{s(Je(C));break}}}],p4(a[0],a[1]))),u("div",w(g([["className","fixed inset-0 z-100 w-screen overflow-y-auto bg-white"],(l=[u("div",w(g([["className","flex-col w-full h-full justify-center items-center gap-2.5 inline-flex overflow-hidden"],(c=[u("div",w(g([["className","self-stretch h-[118px] flex-col justify-center items-center gap-8 flex"],(f=[u("div",w(g([["className","relative"],(d=[B6([])],["children",y.Children.toArray(Array.from(d))])]))),u("div",w(g([["className","flex-col justify-start items-center gap-6 flex"],(p=[u("div",w(g([["className","w-[140px] h-1.5 relative bg-blue-100 rounded-[5px] overflow-hidden"],(h=[u("div",{style:{animation:"progressBar 2s linear infinite"},className:"h-1.5 top-0 absolute bg-gradient-to-r from-[#a650ff] to-[#0095f2] rounded-[5px]"})],["children",y.Children.toArray(Array.from(h))])])))],["children",y.Children.toArray(Array.from(p))])])))],["children",y.Children.toArray(Array.from(f))])])))],["children",y.Children.toArray(Array.from(c))])])))],["children",y.Children.toArray(Array.from(l))])])))}class pn extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Key","As","Appear","Show","ClassName","Enter","EnterFrom","EnterTo","Leave","LeaveFrom","LeaveTo","Children"]}}function w4(e){return u(Bh,jn(e,1))}class qr extends _e{constructor(t,n,r){super(),this.Type=t,this.Title=n,this.Message=r}}class Yr extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Success","Failure","InProgress"]}}function y4(e,t){let n,r,i,o,s,a,l,c;return w4(g([new pn(1,["div"]),new pn(4,["pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5"]),new pn(3,[!0]),new pn(5,["transform ease-out duration-300 transition"]),new pn(6,["translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"]),new pn(7,["translate-y-0 opacity-100 sm:translate-x-0"]),new pn(8,["transition ease-in duration-100"]),new pn(9,["opacity-100"]),new pn(10,["opacity-0"]),new pn(11,[[u("div",w(g([["key","1"],(n=[u("div",w(g([["className","p-4"],(r=[u("div",w(g([["className","flex items-start"],(i=[u("div",w(g([["className","flex-shrink-0"],(o=Y(T(()=>{const f=t.Type;return f.tag===1?A(W6([])):f.tag===2?A(G6([])):A(U6([]))})),["children",y.Children.toArray(Array.from(o))])]))),u("div",w(g([["className","ml-3 w-0 flex-1 pt-0.5"],(s=[u("p",{className:"text-sm font-medium text-gray-900",children:t.Title}),u("p",{className:"mt-1 text-sm text-gray-500",children:t.Message})],["children",y.Children.toArray(Array.from(s))])]))),u("div",w(g([["className","ml-4 flex flex-shrink-0"],(a=[u("button",w(g([["type","button"],(l="inline-flex rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",["className",l]),["onClick",f=>{e()}],(c=[Ss(10,10)],["children",y.Children.toArray(Array.from(c))])])))],["children",y.Children.toArray(Array.from(a))])])))],["children",y.Children.toArray(Array.from(i))])])))],["children",y.Children.toArray(Array.from(r))])])))],["children",y.Children.toArray(Array.from(n))])])))]])]))}function v4(e){const t=document.getElementById("workspace-toasts-container"),n=Gy(),r=y4(()=>{document.getElementById(n).remove()},e),i=document.createElement("div");Gl(r,i);const o=i.children[0];o.id=n,t.appendChild(o)}const b4=3e4;function _4(e,t,n,r,i){const o=r.fields[0],s=()=>J.Delay(()=>J.Bind(N0(b4),()=>J.Bind(t(n),a=>{let l,c,f,d;const p=a;return p.tag!==1&&(p.fields[0].tag!==1||(p.fields[0].fields[0].tag===1?(e(new qr(new Yr(1,[]),"We found a duplicate user",`"${he(i.fields[0],he(p.fields[0].fields[0].fields[0]-2,o).fields[0])}" already exists in our system. This user was skipped during the import.`)),!1):p.fields[0].fields[0].tag===2?(l=p.fields[0].fields[0].fields[0].DuplicateEmailCount>0,c=p.fields[0].fields[0].fields[0].OtherFailuresCount>0,e(l?c?new qr(new Yr(1,[]),"We found multiple import errors",(f="One or more of the rows experienced errors during import. These rows were skipped during the import.",f)):new qr(new Yr(1,[]),`We found ${p.fields[0].fields[0].fields[0].DuplicateEmailCount} duplicate users`,(d="One or more of the users you’re trying to add already exist in our system. These users were skipped during the import.",d)):new qr(new Yr(1,[]),"We found multiple import errors",(f="One or more of the rows experienced errors during import. These rows were skipped during the import.",f))),!1):(e(new qr(new Yr(0,[]),`Successfully added ${p.fields[0].fields[0].fields[0]} users`,"If you don’t see any new users, try refreshing this page.")),!1)))?J.Bind(s(),()=>J.Return(void 0)):J.Zero()})));e(new qr(new Yr(2,[]),`Importing ${o.length} users`,"This might take a while. We’ll let you know via email when it’s finished.")),Js(s())}class kt extends U{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Completed","Active","Disabled"]}}class Jo extends _e{constructor(t,n,r,i){super(),this.UploadingCsv=t,this.MappingColumns=n,this.MappingEmploymentBasis=r,this.Reviewing=i}}function tf(){Cm(g(["admin","app","users"]))}function hp(e){Cm(g(["admin","app","oops"]))}function x4(e){switch(e.tag){case 1:return new Jo(new kt(0,[]),new kt(1,[]),new kt(2,[]),new kt(2,[]));case 2:return new Jo(new kt(0,[]),new kt(0,[]),new kt(1,[]),new kt(2,[]));case 3:return new Jo(new kt(0,[]),new kt(0,[]),new kt(0,[]),new kt(1,[]));default:return new Jo(new kt(1,[]),new kt(2,[]),new kt(2,[]),new kt(2,[]))}}function C4(e,t,n,r,i){switch(i.tag){case 1:{const o=i.fields[0],s=o[1].tag===1?o[1].fields[0].tag===1?[Ed(o[1].fields[0].fields[0],o[1].fields[0].fields[1]),o[0].HeaderRow,o[0].DataRows]:[Ed(o[1].fields[0].fields[0],void 0),o[0].HeaderRow,o[0].DataRows]:[o[1].fields[0],o[0].HeaderRow,o[0].DataRows];return u(d6,{existingMappings:eo(s[0]),headerRow:s[1],dataRows:s[2],next:a=>{let l;n(new pr(0,[(l=a,new Yo(1,[l[0],l[1]]))]))},back:a=>{n(new pr(1,[new Ka(2,[a])]))}})}case 2:{const o=G_(i.fields[0][0].DataRows,i.fields[0][2]);return u(b6,{existingMappings:eo(i.fields[0][3]),employmentBasisColumn:o,next:s=>{n(new pr(0,[new Yo(2,[s])]))},back:s=>{n(new pr(1,[new Ka(1,[s])]))}})}case 3:return u(Q6,{apiCallAsync:e,dataRows:i.fields[0][0].DataRows,baseColumnMappings:i.fields[0][1],employmentBasis:eo(i.fields[0][2]),next:o=>{let s;n(new pr(0,[(s=o,new Yo(3,[s[0],s[1]]))]))},back:()=>{n(new pr(1,[new Ka(0,[])]))},onError:o=>{hp()}});default:{const o=Ct(s=>s[0],i.fields[0]);return u(d4,{existingCsvFile:eo(o),next:s=>{n(new pr(0,[new Yo(0,[s])]))},cancel:t,markDirty:r})}}}function Qo(e,t){let n,r,i;switch(t.tag){case 1:return u("div",w(g([["className","text-sm font-medium border-b-2 border-primary-600 pt-1 pb-3 text-primary-600"],(n=[u("span",{children:e})],["children",y.Children.toArray(Array.from(n))])])));case 2:return u("div",w(g([["className","text-sm font-medium pt-1 pb-3 text-gray-500"],(r=[u("span",{children:e})],["children",y.Children.toArray(Array.from(r))])])));default:return u("div",w(g([["className","text-sm font-medium pt-1 pb-3 text-emerald-700 gap-2 inline-flex"],(i=[Vu(20,20),u("span",{children:e})],["children",y.Children.toArray(Array.from(i))])])))}}function S4(e){let t,n,r,i,o;const s=f4();o=Hr(()=>Vr(()=>s,m4,(x,C)=>{}),void 0,void 0);const a=o[0],l=y.useState(!1),c=l[0],f=l[1],d=y.useState(!1),p=d[0],h=y.useCallback(x=>{x.preventDefault(),x.returnValue=!0},[]),m=()=>{window.removeEventListener("beforeunload",h)};vm(()=>(p?window.addEventListener("beforeunload",h):m(),{Dispose(){m()}}),[p]);let v;if(a.tag===0){const x=a.fields[0],C=()=>{c||f(!0)},S=x4(x),$=C4(D=>tv(e.backendUrl,D),C,o[1],d[1],x);v=u("div",w(g([["className","flex flex-col h-full"],(t=[h4(c,()=>{c&&f(!1)},()=>{c&&(m(),tf())}),u("div",w(g([["className","flex flex-row justify-between px-12 pt-8 pb-4"],(n=[u("span",{className:"font-sonoma text-gray-900 font-bold text-lg",children:"Import Users from CSV"}),u("button",w(g([(r="bg-white hover:bg-gray-50 rounded-md text-red-700 shadow-sm text-sm border border-gray-300 font-medium px-3 py-2 w-[120px]",["className",r]),["onClick",D=>{C()}],["type","button"],["children",y.Children.toArray(["Cancel import"])]])))],["children",y.Children.toArray(Array.from(n))])]))),u("div",w(g([["className","flex flex-row items-center px-12 gap-2 border-b border-gray-200"],(i=[Qo("1. Upload CSV",S.UploadingCsv),u("hr",{className:"w-16 pt-1.5"}),Qo("2. Map fields",S.MappingColumns),u("hr",{className:"w-16 pt-1.5"}),Qo("3. Map values",S.MappingEmploymentBasis),u("hr",{className:"w-16 pt-1.5"}),Qo("4. Review",S.Reviewing)],["children",y.Children.toArray(Array.from(i))])]))),$],["children",y.Children.toArray(Array.from(t))])])))}else{const x=a.fields[0][0],C=a.fields[0][1];v=g4(S=>nv(e.backendUrl,S),x,C,a.fields[0][2],a.fields[0][3],S=>{m();const $=[S,x,C.Email];_4(D=>{v4(D)},D=>rv(e.backendUrl,D),$[0],$[1],$[2]),tf()},S=>{m(),hp()})}const b=[u("style",{children:[Zl]}),v];return u(ze,{},...b)}function E4(){Fl(e=>u(S4,e),"apollo-import-workspace-wizard")}Fl(e=>u(gg,e),"apollo-import-workspace-app");b_();E4();
|