@jpmorgan-payments/embedded-finance-components 0.7.9 → 0.7.10
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var ps = Object.defineProperty;
|
|
2
2
|
var ws = (e, t, n) => t in e ? ps(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Le = (e, t, n) => ws(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { g as xs, c as M, a as m, b as be, d as K, o as Ot, e as B, P as qo, S as N, t as P, i as E, f as H, h as I, j as $s, k as tr, u as pe, l as G, s as Nn, m as Un, n as rt, p as T, q as Cs, r as kn, v as Ke, w as Ss, x as Dt, y as Tt, z as ks, A as Es, B as mn, F as Ds, C as zr, D as Ft, $ as Ro, E as Ms, G as As, H as j, I as Br, J as Ts, K as nr, L as Fs, M as Is, N as _n, O as Ls, Q as Os, R as te, T as Ps, U as _s } from "./production-
|
|
4
|
+
import { g as xs, c as M, a as m, b as be, d as K, o as Ot, e as B, P as qo, S as N, t as P, i as E, f as H, h as I, j as $s, k as tr, u as pe, l as G, s as Nn, m as Un, n as rt, p as T, q as Cs, r as kn, v as Ke, w as Ss, x as Dt, y as Tt, z as ks, A as Es, B as mn, F as Ds, C as zr, D as Ft, $ as Ro, E as Ms, G as As, H as j, I as Br, J as Ts, K as nr, L as Fs, M as Is, N as _n, O as Ls, Q as Os, R as te, T as Ps, U as _s } from "./production-1mngpmZS.js";
|
|
5
5
|
var Ko = {
|
|
6
6
|
À: "A",
|
|
7
7
|
Á: "A",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as i, L as s, M as t, y as n, O as c, c as o, b as r, R as p, T as m, p as R, n as d, x as f, d as g, a as l, r as u, m as y, k as C, l as S, f as D, t as E, g as F, q as M, h as P, i as b, w as k, s as v, e as A, v as B } from "../index-
|
|
1
|
+
import { E as i, L as s, M as t, y as n, O as c, c as o, b as r, R as p, T as m, p as R, n as d, x as f, d as g, a as l, r as u, m as y, k as C, l as S, f as D, t as E, g as F, q as M, h as P, i as b, w as k, s as v, e as A, v as B } from "../index-Cv6H2bLE.js";
|
|
2
2
|
export {
|
|
3
3
|
i as EBComponentsProvider,
|
|
4
4
|
s as LinkedAccountWidget,
|
|
@@ -50352,7 +50352,7 @@ const c0 = new ise(), CY = Kn(void 0), kY = Kn({
|
|
|
50352
50352
|
}), aH = Yj.NODE_ENV === "development" ? $te(
|
|
50353
50353
|
() => import(
|
|
50354
50354
|
// eslint-disable-next-line import/extensions
|
|
50355
|
-
"./production-
|
|
50355
|
+
"./production-1mngpmZS.js"
|
|
50356
50356
|
).then((e) => e.V).then((e) => ({
|
|
50357
50357
|
default: e.ReactQueryDevtools
|
|
50358
50358
|
}))
|
|
@@ -94153,7 +94153,9 @@ const XOe = 18, QOe = 120, JOe = (e) => {
|
|
|
94153
94153
|
"078051120",
|
|
94154
94154
|
"219099999",
|
|
94155
94155
|
"123456789",
|
|
94156
|
+
"777777777",
|
|
94156
94157
|
"333333333",
|
|
94158
|
+
"222222222",
|
|
94157
94159
|
"111111111",
|
|
94158
94160
|
"457555462",
|
|
94159
94161
|
"012345678",
|
|
@@ -4,7 +4,7 @@ var Ye = (e) => {
|
|
|
4
4
|
var Ze = (e, t, n) => t.has(e) || Ye("Cannot " + n);
|
|
5
5
|
var v = (e, t, n) => (Ze(e, t, "read from private field"), n ? n.call(e) : t.get(e)), T = (e, t, n) => t.has(e) ? Ye("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), C = (e, t, n, r) => (Ze(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
|
|
6
6
|
import * as _ from "react";
|
|
7
|
-
import { u as jt, o as $t, j as _t } from "./index-
|
|
7
|
+
import { u as jt, o as $t, j as _t } from "./index-Cv6H2bLE.js";
|
|
8
8
|
var d = {
|
|
9
9
|
context: void 0,
|
|
10
10
|
registry: void 0,
|
|
@@ -1853,7 +1853,7 @@ var Br = (e, t = !1) => {
|
|
|
1853
1853
|
const t = vn(() => {
|
|
1854
1854
|
const n = this, [r] = v(this, W), [s] = v(this, Y), [i] = v(this, Z), [o] = v(this, J), [l] = v(this, Q);
|
|
1855
1855
|
let a;
|
|
1856
|
-
return v(this, ee) ? a = v(this, ee) : (a = ln(() => import("./2FJCTAHO-
|
|
1856
|
+
return v(this, ee) ? a = v(this, ee) : (a = ln(() => import("./2FJCTAHO-CWrVTv5B.js")), C(this, ee, a)), dr(v(this, ge), v(this, X)), nn(a, sn({
|
|
1857
1857
|
get queryFlavor() {
|
|
1858
1858
|
return v(n, de);
|
|
1859
1859
|
},
|
|
@@ -7779,7 +7779,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
7779
7779
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
7780
7780
|
`)},z_e=0,k2=[];function __e(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(z_e++)[0],o=C.useState(wie)[0],a=C.useRef(e);C.useEffect(function(){a.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=PO([e.lockRef.current],(e.shards||[]).map(Eie),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=C.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var x=UP(g),w=n.current,k="deltaX"in g?g.deltaX:w[0]-x[0],M="deltaY"in g?g.deltaY:w[1]-x[1],S,I=g.target,L=Math.abs(k)>Math.abs(M)?"h":"v";if("touches"in g&&L==="h"&&I.type==="range")return!1;var E=Sie(L,I);if(!E)return!0;if(E?S=L:(S=L==="v"?"h":"v",E=Sie(L,I)),!E)return!1;if(!r.current&&"changedTouches"in g&&(k||M)&&(r.current=S),!S)return!0;var A=r.current||S;return $_e(A,v,g,A==="h"?k:M)},[]),c=C.useCallback(function(g){var v=g;if(!(!k2.length||k2[k2.length-1]!==o)){var x="deltaY"in v?Lie(v):UP(v),w=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&O_e(S.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var k=(a.current.shards||[]).map(Eie).filter(Boolean).filter(function(S){return S.contains(v.target)}),M=k.length>0?s(v,k[0]):!a.current.noIsolation;M&&v.cancelable&&v.preventDefault()}}},[]),d=C.useCallback(function(g,v,x,w){var k={name:g,delta:v,target:x,should:w,shadowParent:R_e(x)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(M){return M!==k})},1)},[]),p=C.useCallback(function(g){n.current=UP(g),r.current=void 0},[]),h=C.useCallback(function(g){d(g.type,Lie(g),g.target,s(g,e.lockRef.current))},[]),f=C.useCallback(function(g){d(g.type,UP(g),g.target,s(g,e.lockRef.current))},[]);C.useEffect(function(){return k2.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,w2),document.addEventListener("touchmove",c,w2),document.addEventListener("touchstart",p,w2),function(){k2=k2.filter(function(g){return g!==o}),document.removeEventListener("wheel",c,w2),document.removeEventListener("touchmove",c,w2),document.removeEventListener("touchstart",p,w2)}},[]);var m=e.removeScrollBar,b=e.inert;return C.createElement(C.Fragment,null,b?C.createElement(o,{styles:j_e(i)}):null,m?C.createElement(E_e,{gapMode:e.gapMode}):null)}function R_e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const q_e=g_e(xie,__e);var Aie=C.forwardRef(function(e,t){return C.createElement(BP,Nn({},e,{ref:t,sideCar:q_e}))});Aie.classNames=BP.classNames;var Hq=["Enter"," "],H_e=["ArrowDown","PageUp","Home"],Die=["ArrowUp","PageDown","End"],B_e=[...H_e,...Die],V_e={ltr:[...Hq,"ArrowRight"],rtl:[...Hq,"ArrowLeft"]},U_e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wf="Menu",[kf,G_e,W_e]=zje(wf),[w1,Tie]=Sq(wf,[W_e,Xre,pie]),GP=Xre(),Nie=pie(),[K_e,k1]=w1(wf),[Y_e,Cf]=w1(wf),Fie=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=GP(t),[c,d]=C.useState(null),p=C.useRef(!1),h=Js(o),f=Rje(i);return C.useEffect(()=>{const m=()=>{p.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>p.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),l.jsx(kze,{...s,children:l.jsx(K_e,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:l.jsx(Y_e,{scope:t,onClose:C.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:f,modal:a,children:r})})})};Fie.displayName=wf;var Z_e="MenuAnchor",Bq=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=GP(n);return l.jsx(Cze,{...i,...r,ref:t})});Bq.displayName=Z_e;var Vq="MenuPortal",[X_e,Pie]=w1(Vq,{forceMount:void 0}),$ie=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=k1(Vq,t);return l.jsx(X_e,{scope:t,forceMount:n,children:l.jsx(xf,{present:n||o.open,children:l.jsx(aie,{asChild:!0,container:i,children:r})})})};$ie.displayName=Vq;var mo="MenuContent",[Q_e,Uq]=w1(mo),Oie=C.forwardRef((e,t)=>{const n=Pie(mo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=k1(mo,e.__scopeMenu),a=Cf(mo,e.__scopeMenu);return l.jsx(kf.Provider,{scope:e.__scopeMenu,children:l.jsx(xf,{present:r||o.open,children:l.jsx(kf.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(J_e,{...i,ref:t}):l.jsx(eRe,{...i,ref:t})})})})}),J_e=C.forwardRef((e,t)=>{const n=k1(mo,e.__scopeMenu),r=C.useRef(null),i=Vi(t,r);return C.useEffect(()=>{const o=r.current;if(o)return s_e(o)},[]),l.jsx(Gq,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),eRe=C.forwardRef((e,t)=>{const n=k1(mo,e.__scopeMenu);return l.jsx(Gq,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tRe=OP("MenuContent.ScrollLock"),Gq=C.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:b,...g}=e,v=k1(mo,n),x=Cf(mo,n),w=GP(n),k=Nie(n),M=G_e(n),[S,I]=C.useState(null),L=C.useRef(null),E=Vi(t,L,v.onContentChange),A=C.useRef(0),j=C.useRef(""),q=C.useRef(0),P=C.useRef(null),z=C.useRef("right"),B=C.useRef(0),N=b?Aie:C.Fragment,F=b?{as:tRe,allowPinchZoom:!0}:void 0,_=W=>{var G,Y;const $=j.current+W,V=M().filter(ae=>!ae.disabled),T=document.activeElement,D=(G=V.find(ae=>ae.ref.current===T))==null?void 0:G.textValue,R=V.map(ae=>ae.textValue),O=hRe(R,$,D),K=(Y=V.find(ae=>ae.textValue===O))==null?void 0:Y.ref.current;(function ae(ue){j.current=ue,window.clearTimeout(A.current),ue!==""&&(A.current=window.setTimeout(()=>ae(""),1e3))})($),K&&setTimeout(()=>K.focus())};C.useEffect(()=>()=>window.clearTimeout(A.current),[]),Zje();const H=C.useCallback(W=>{var V,T;return z.current===((V=P.current)==null?void 0:V.side)&&mRe(W,(T=P.current)==null?void 0:T.area)},[]);return l.jsx(Q_e,{scope:n,searchRef:j,onItemEnter:C.useCallback(W=>{H(W)&&W.preventDefault()},[H]),onItemLeave:C.useCallback(W=>{var $;H(W)||(($=L.current)==null||$.focus(),I(null))},[H]),onTriggerLeave:C.useCallback(W=>{H(W)&&W.preventDefault()},[H]),pointerGraceTimerRef:q,onPointerGraceIntentChange:C.useCallback(W=>{P.current=W},[]),children:l.jsx(N,{...F,children:l.jsx(Bre,{asChild:!0,trapped:i,onMountAutoFocus:Pn(o,W=>{var $;W.preventDefault(),($=L.current)==null||$.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(zre,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,children:l.jsx(n_e,{asChild:!0,...k,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:I,onEntryFocus:Pn(c,W=>{x.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(Sze,{role:"menu","aria-orientation":"vertical","data-state":Jie(v.open),"data-radix-menu-content":"",dir:x.dir,...w,...g,ref:E,style:{outline:"none",...g.style},onKeyDown:Pn(g.onKeyDown,W=>{const V=W.target.closest("[data-radix-menu-content]")===W.currentTarget,T=W.ctrlKey||W.altKey||W.metaKey,D=W.key.length===1;V&&(W.key==="Tab"&&W.preventDefault(),!T&&D&&_(W.key));const R=L.current;if(W.target!==R||!B_e.includes(W.key))return;W.preventDefault();const K=M().filter(G=>!G.disabled).map(G=>G.ref.current);Die.includes(W.key)&&K.reverse(),dRe(K)}),onBlur:Pn(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(A.current),j.current="")}),onPointerMove:Pn(e.onPointerMove,Mf(W=>{const $=W.target,V=B.current!==W.clientX;if(W.currentTarget.contains($)&&V){const T=W.clientX>B.current?"right":"left";z.current=T,B.current=W.clientX}}))})})})})})})});Oie.displayName=mo;var nRe="MenuGroup",Wq=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ho.div,{role:"group",...r,ref:t})});Wq.displayName=nRe;var rRe="MenuLabel",jie=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ho.div,{...r,ref:t})});jie.displayName=rRe;var WP="MenuItem",zie="menu.itemSelect",KP=C.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=C.useRef(null),a=Cf(WP,e.__scopeMenu),s=Uq(WP,e.__scopeMenu),c=Vi(t,o),d=C.useRef(!1),p=()=>{const h=o.current;if(!n&&h){const f=new CustomEvent(zie,{bubbles:!0,cancelable:!0});h.addEventListener(zie,m=>r==null?void 0:r(m),{once:!0}),$re(h,f),f.defaultPrevented?d.current=!1:a.onClose()}};return l.jsx(_ie,{...i,ref:c,disabled:n,onClick:Pn(e.onClick,p),onPointerDown:h=>{var f;(f=e.onPointerDown)==null||f.call(e,h),d.current=!0},onPointerUp:Pn(e.onPointerUp,h=>{var f;d.current||(f=h.currentTarget)==null||f.click()}),onKeyDown:Pn(e.onKeyDown,h=>{const f=s.searchRef.current!=="";n||f&&h.key===" "||Hq.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});KP.displayName=WP;var _ie=C.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=Uq(WP,n),s=Nie(n),c=C.useRef(null),d=Vi(t,c),[p,h]=C.useState(!1),[f,m]=C.useState("");return C.useEffect(()=>{const b=c.current;b&&m((b.textContent??"").trim())},[o.children]),l.jsx(kf.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:l.jsx(r_e,{asChild:!0,...s,focusable:!r,children:l.jsx(Ho.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Pn(e.onPointerMove,Mf(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pn(e.onPointerLeave,Mf(b=>a.onItemLeave(b))),onFocus:Pn(e.onFocus,()=>h(!0)),onBlur:Pn(e.onBlur,()=>h(!1))})})})}),iRe="MenuCheckboxItem",Rie=C.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return l.jsx(Uie,{scope:e.__scopeMenu,checked:n,children:l.jsx(KP,{role:"menuitemcheckbox","aria-checked":YP(n)?"mixed":n,...i,ref:t,"data-state":Yq(n),onSelect:Pn(i.onSelect,()=>r==null?void 0:r(YP(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Rie.displayName=iRe;var qie="MenuRadioGroup",[oRe,aRe]=w1(qie,{value:void 0,onValueChange:()=>{}}),Hie=C.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Js(r);return l.jsx(oRe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:l.jsx(Wq,{...i,ref:t})})});Hie.displayName=qie;var Bie="MenuRadioItem",Vie=C.forwardRef((e,t)=>{const{value:n,...r}=e,i=aRe(Bie,e.__scopeMenu),o=n===i.value;return l.jsx(Uie,{scope:e.__scopeMenu,checked:o,children:l.jsx(KP,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":Yq(o),onSelect:Pn(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});Vie.displayName=Bie;var Kq="MenuItemIndicator",[Uie,sRe]=w1(Kq,{checked:!1}),Gie=C.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=sRe(Kq,n);return l.jsx(xf,{present:r||YP(o.checked)||o.checked===!0,children:l.jsx(Ho.span,{...i,ref:t,"data-state":Yq(o.checked)})})});Gie.displayName=Kq;var lRe="MenuSeparator",Wie=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ho.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Wie.displayName=lRe;var cRe="MenuArrow",Kie=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=GP(n);return l.jsx(Mze,{...i,...r,ref:t})});Kie.displayName=cRe;var uRe="MenuSub",[PQe,Yie]=w1(uRe),Sf="MenuSubTrigger",Zie=C.forwardRef((e,t)=>{const n=k1(Sf,e.__scopeMenu),r=Cf(Sf,e.__scopeMenu),i=Yie(Sf,e.__scopeMenu),o=Uq(Sf,e.__scopeMenu),a=C.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=o,d={__scopeMenu:e.__scopeMenu},p=C.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return C.useEffect(()=>p,[p]),C.useEffect(()=>{const h=s.current;return()=>{window.clearTimeout(h),c(null)}},[s,c]),l.jsx(Bq,{asChild:!0,...d,children:l.jsx(_ie,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Jie(n.open),...e,ref:Mq(t,i.onTriggerChange),onClick:h=>{var f;(f=e.onClick)==null||f.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pn(e.onPointerMove,Mf(h=>{o.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Pn(e.onPointerLeave,Mf(h=>{var m,b;p();const f=(m=n.content)==null?void 0:m.getBoundingClientRect();if(f){const g=(b=n.content)==null?void 0:b.dataset.side,v=g==="right",x=v?-5:5,w=f[v?"left":"right"],k=f[v?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+x,y:h.clientY},{x:w,y:f.top},{x:k,y:f.top},{x:k,y:f.bottom},{x:w,y:f.bottom}],side:g}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Pn(e.onKeyDown,h=>{var m;const f=o.searchRef.current!=="";e.disabled||f&&h.key===" "||V_e[r.dir].includes(h.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),h.preventDefault())})})})});Zie.displayName=Sf;var Xie="MenuSubContent",Qie=C.forwardRef((e,t)=>{const n=Pie(mo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=k1(mo,e.__scopeMenu),a=Cf(mo,e.__scopeMenu),s=Yie(Xie,e.__scopeMenu),c=C.useRef(null),d=Vi(t,c);return l.jsx(kf.Provider,{scope:e.__scopeMenu,children:l.jsx(xf,{present:r||o.open,children:l.jsx(kf.Slot,{scope:e.__scopeMenu,children:l.jsx(Gq,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var h;a.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Pn(e.onFocusOutside,p=>{p.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Pn(e.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:Pn(e.onKeyDown,p=>{var m;const h=p.currentTarget.contains(p.target),f=U_e[a.dir].includes(p.key);h&&f&&(o.onOpenChange(!1),(m=s.trigger)==null||m.focus(),p.preventDefault())})})})})})});Qie.displayName=Xie;function Jie(e){return e?"open":"closed"}function YP(e){return e==="indeterminate"}function Yq(e){return YP(e)?"indeterminate":e?"checked":"unchecked"}function dRe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function pRe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function hRe(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=pRe(e,Math.max(o,0));i.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function fRe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o].x,c=t[o].y,d=t[a].x,p=t[a].y;c>r!=p>r&&n<(d-s)*(r-c)/(p-c)+s&&(i=!i)}return i}function mRe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return fRe(n,t)}function Mf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var gRe=Fie,yRe=Bq,bRe=$ie,vRe=Oie,xRe=Wq,wRe=jie,kRe=KP,CRe=Rie,SRe=Hie,MRe=Vie,IRe=Gie,LRe=Wie,ERe=Kie,ARe=Zie,DRe=Qie,TRe=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},NRe=C[" useId ".trim().toString()]||(()=>{}),FRe=0;function eoe(e){const[t,n]=C.useState(NRe());return TRe(()=>{n(r=>r??String(FRe++))},[e]),e||(t?`radix-${t}`:"")}var Zq="DropdownMenu",[PRe,$Qe]=xje(Zq,[Tie]),ui=Tie(),[$Re,toe]=PRe(Zq),noe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,c=ui(t),d=C.useRef(null),[p=!1,h]=kje({prop:i,defaultProp:o,onChange:a});return l.jsx($Re,{scope:t,triggerId:eoe(),triggerRef:d,contentId:eoe(),open:p,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(f=>!f),[h]),modal:s,children:l.jsx(gRe,{...c,open:p,onOpenChange:h,dir:r,modal:s,children:n})})};noe.displayName=Zq;var roe="DropdownMenuTrigger",ioe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=toe(roe,n),a=ui(n);return l.jsx(yRe,{asChild:!0,...a,children:l.jsx(Tje.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Nre(t,o.triggerRef),onPointerDown:$P(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:$P(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});ioe.displayName=roe;var ORe="DropdownMenuPortal",ooe=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ui(t);return l.jsx(bRe,{...r,...n})};ooe.displayName=ORe;var aoe="DropdownMenuContent",soe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=toe(aoe,n),o=ui(n),a=C.useRef(!1);return l.jsx(vRe,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:$P(e.onCloseAutoFocus,s=>{var c;a.current||(c=i.triggerRef.current)==null||c.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:$P(e.onInteractOutside,s=>{const c=s.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,p=c.button===2||d;(!i.modal||p)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});soe.displayName=aoe;var jRe="DropdownMenuGroup",zRe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(xRe,{...i,...r,ref:t})});zRe.displayName=jRe;var _Re="DropdownMenuLabel",loe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(wRe,{...i,...r,ref:t})});loe.displayName=_Re;var RRe="DropdownMenuItem",coe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(kRe,{...i,...r,ref:t})});coe.displayName=RRe;var qRe="DropdownMenuCheckboxItem",uoe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(CRe,{...i,...r,ref:t})});uoe.displayName=qRe;var HRe="DropdownMenuRadioGroup",BRe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(SRe,{...i,...r,ref:t})});BRe.displayName=HRe;var VRe="DropdownMenuRadioItem",doe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(MRe,{...i,...r,ref:t})});doe.displayName=VRe;var URe="DropdownMenuItemIndicator",poe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(IRe,{...i,...r,ref:t})});poe.displayName=URe;var GRe="DropdownMenuSeparator",hoe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(LRe,{...i,...r,ref:t})});hoe.displayName=GRe;var WRe="DropdownMenuArrow",KRe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(ERe,{...i,...r,ref:t})});KRe.displayName=WRe;var YRe="DropdownMenuSubTrigger",foe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(ARe,{...i,...r,ref:t})});foe.displayName=YRe;var ZRe="DropdownMenuSubContent",moe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ui(n);return l.jsx(DRe,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});moe.displayName=ZRe;var XRe=noe,QRe=ioe,JRe=ooe,goe=soe,yoe=loe,boe=coe,voe=uoe,xoe=doe,woe=poe,koe=hoe,Coe=foe,Soe=moe;const Moe=XRe,Ioe=QRe,eqe=C.forwardRef(({className:e,inset:t,children:n,...r},i)=>l.jsxs(Coe,{ref:i,className:ye("eb-flex eb-cursor-pointer eb-select-none eb-items-center eb-gap-2 eb-rounded-sm eb-px-2 eb-py-1.5 eb-text-sm eb-outline-none focus:eb-bg-accent data-[state=open]:eb-bg-accent [&_svg]:eb-pointer-events-none [&_svg]:eb-size-4 [&_svg]:eb-shrink-0",t&&"eb-pl-8",e),...r,children:[n,l.jsx(Ra,{className:"eb-ml-auto"})]}));eqe.displayName=Coe.displayName;const tqe=C.forwardRef(({className:e,...t},n)=>l.jsx(Soe,{ref:n,className:ye("eb-z-50 eb-min-w-[8rem] eb-origin-[--radix-dropdown-menu-content-transform-origin] eb-overflow-hidden eb-rounded-md eb-border eb-bg-popover eb-p-1 eb-text-popover-foreground eb-shadow-lg data-[state=open]:eb-animate-in data-[state=closed]:eb-animate-out data-[state=closed]:eb-fade-out-0 data-[state=open]:eb-fade-in-0 data-[state=closed]:eb-zoom-out-95 data-[state=open]:eb-zoom-in-95 data-[side=bottom]:eb-slide-in-from-top-2 data-[side=left]:eb-slide-in-from-right-2 data-[side=right]:eb-slide-in-from-left-2 data-[side=top]:eb-slide-in-from-bottom-2",e),...t}));tqe.displayName=Soe.displayName;const Xq=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(JRe,{children:l.jsx(goe,{ref:r,sideOffset:t,className:ye("eb-z-50 eb-max-h-[var(--radix-dropdown-menu-content-available-height)] eb-min-w-[8rem] eb-overflow-y-auto eb-overflow-x-hidden eb-rounded-md eb-border eb-bg-popover eb-p-1 eb-text-popover-foreground eb-shadow-md","eb-origin-[--radix-dropdown-menu-content-transform-origin] data-[state=open]:eb-animate-in data-[state=closed]:eb-animate-out data-[state=closed]:eb-fade-out-0 data-[state=open]:eb-fade-in-0 data-[state=closed]:eb-zoom-out-95 data-[state=open]:eb-zoom-in-95 data-[side=bottom]:eb-slide-in-from-top-2 data-[side=left]:eb-slide-in-from-right-2 data-[side=right]:eb-slide-in-from-left-2 data-[side=top]:eb-slide-in-from-bottom-2",e),...n})}));Xq.displayName=goe.displayName;const Qq=C.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(boe,{ref:r,className:ye("eb-relative eb-flex eb-cursor-pointer eb-select-none eb-items-center eb-gap-2 eb-rounded-sm eb-px-2 eb-py-1.5 eb-text-sm eb-outline-none eb-transition-colors focus:eb-bg-accent focus:eb-text-accent-foreground data-[disabled]:eb-pointer-events-none data-[disabled]:eb-opacity-50 [&>svg]:eb-size-4 [&>svg]:eb-shrink-0",t&&"eb-pl-8",e),...n}));Qq.displayName=boe.displayName;const nqe=C.forwardRef(({className:e,children:t,checked:n,...r},i)=>l.jsxs(voe,{ref:i,className:ye("eb-relative eb-flex eb-cursor-pointer eb-select-none eb-items-center eb-rounded-sm eb-py-1.5 eb-pl-8 eb-pr-2 eb-text-sm eb-outline-none eb-transition-colors focus:eb-bg-accent focus:eb-text-accent-foreground data-[disabled]:eb-pointer-events-none data-[disabled]:eb-opacity-50",e),checked:n,...r,children:[l.jsx("span",{className:"eb-absolute eb-left-2 eb-flex eb-h-3.5 eb-w-3.5 eb-items-center eb-justify-center",children:l.jsx(woe,{children:l.jsx(_r,{className:"eb-h-4 eb-w-4"})})}),t]}));nqe.displayName=voe.displayName;const rqe=C.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(xoe,{ref:r,className:ye("eb-relative eb-flex eb-cursor-pointer eb-select-none eb-items-center eb-rounded-sm eb-py-1.5 eb-pl-8 eb-pr-2 eb-text-sm eb-outline-none eb-transition-colors focus:eb-bg-accent focus:eb-text-accent-foreground data-[disabled]:eb-pointer-events-none data-[disabled]:eb-opacity-50",e),...n,children:[l.jsx("span",{className:"eb-absolute eb-left-2 eb-flex eb-h-3.5 eb-w-3.5 eb-items-center eb-justify-center",children:l.jsx(woe,{children:l.jsx(Fc,{className:"eb-h-2 eb-w-2 eb-fill-current"})})}),t]}));rqe.displayName=xoe.displayName;const iqe=C.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(yoe,{ref:r,className:ye("eb-px-2 eb-py-1.5 eb-text-sm eb-font-semibold",t&&"eb-pl-8",e),...n}));iqe.displayName=yoe.displayName;const oqe=C.forwardRef(({className:e,...t},n)=>l.jsx(koe,{ref:n,className:ye("eb--mx-1 eb-my-1 eb-h-px eb-bg-muted",e),...t}));oqe.displayName=koe.displayName;const aqe=new Date().getFullYear(),sqe=/^[a-zA-Z0-9()_\\/@&+%#;,.: '-]*$/,lqe=/[()_\\/&+%@#;,.: '-]/,cqe=Z.object({description:Z.string().max(100,Q.t("onboarding:fields.organizationIds.description.validation.maxLength")).optional(),idType:Z.enum(["EIN","BUSINESS_REGISTRATION_ID","BUSINESS_NUMBER","BUSINESS_REGISTRATION_NUMBER"]),value:Z.string().min(1,Q.t("onboarding:fields.organizationIds.value.validation.required")).max(100,Q.t("onboarding:fields.organizationIds.value.validation.maxLength")).refine(e=>/^[A-Za-z0-9-]+$/.test(e),Q.t("onboarding:fields.organizationIds.value.validation.format")),issuer:Z.string().min(1,Q.t("onboarding:fields.organizationIds.issuer.validation.required")).max(500,Q.t("onboarding:fields.organizationIds.issuer.validation.maxLength")),expiryDate:Z.string().refine(e=>/^\d{4}-\d{2}-\d{2}$/.test(e),{message:Q.t("onboarding:fields.organizationIds.expiryDate.validation.format")}).refine(e=>!Number.isNaN(new Date(e).getTime()),{message:Q.t("onboarding:fields.organizationIds.expiryDate.validation.invalid")}).refine(e=>new Date(e)>new Date,{message:Q.t("onboarding:fields.organizationIds.expiryDate.validation.future")}).refine(e=>{const t=new Date(e),n=new Date,r=new Date(n.setFullYear(n.getFullYear()+10));return t<r},{message:Q.t("onboarding:fields.organizationIds.expiryDate.validation.maxYears")}).optional()}).refine(e=>{switch(e.idType){case"EIN":return/^\d{9}$/.test(e.value);case"BUSINESS_REGISTRATION_ID":return/^[A-Za-z0-9]{5,15}$/.test(e.value);case"BUSINESS_NUMBER":return/^\d{9,12}$/.test(e.value);case"BUSINESS_REGISTRATION_NUMBER":return/^[A-Za-z0-9-]{6,15}$/.test(e.value);default:return!0}},e=>({message:Q.t(`onboarding:fields.organizationIds.value.validation.${e.idType.toLowerCase()}Format`),path:["value"]})),uqe=Z.object({countryOfFormation:Z.string().length(2,Q.t("onboarding:fields.countryOfFormation.validation.exactlyTwoChars")).refine(e=>Dr.includes(e),Q.t("onboarding:fields.countryOfFormation.validation.invalidCountry")),organizationName:Z.string().min(2,Q.t("onboarding:fields.organizationName.validation.minLength")).max(100,Q.t("onboarding:fields.organizationName.validation.maxLength")).refine(e=>sqe.test(e),Q.t("onboarding:fields.organizationName.validation.pattern")).refine(e=>!/\s\s/.test(e),Q.t("onboarding:fields.organizationName.validation.noConsecutiveSpaces")).refine(e=>!lqe.test(e.charAt(0)),Q.t("onboarding:fields.organizationName.validation.noSpecialAtStart")),yearOfFormation:Z.string().refine(e=>/^(19|20)\d{2}$/.test(e),Q.t("onboarding:fields.yearOfFormation.validation.format")).refine(e=>parseInt(e,10)>=1800,Q.t("onboarding:fields.yearOfFormation.validation.min")).refine(e=>parseInt(e,10)<=aqe,Q.t("onboarding:fields.yearOfFormation.validation.max")),organizationIds:Z.array(cqe).max(6,Q.t("onboarding:fields.organizationIds.validation.maxIds")).refine(e=>{const t=e.map(n=>n.idType);return new Set(t).size===t.length},Q.t("onboarding:fields.organizationIds.validation.uniqueTypes"))}),Loe=()=>{const{t:e}=on(["onboarding-overview"]),t=Jn(),n=a=>{switch(a){case"EIN":return"## - #######";default:return}},r=a=>e(a?`idValueLabels.${a}`:"idValueLabels.placeholder"),i=a=>a?e(`idValueDescriptions.${a}`):"",o=t.watch("organizationIds.0.idType");return u.useEffect(()=>{t.watch("organizationIds.0.issuer")!=="US"&&t.setValue("organizationIds.0.issuer","US")},[t.watch("organizationIds.0.issuer")]),l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsx(we,{control:t.control,name:"organizationName",type:"text"}),l.jsx(we,{control:t.control,name:"yearOfFormation",type:"text",inputProps:{maxLength:4}}),l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx(we,{control:t.control,name:"countryOfFormation",type:"combobox",options:Dr.map(a=>({value:a,label:l.jsxs("span",{children:[l.jsxs("span",{className:"eb-font-medium",children:["[",a,"]"]})," ",e([`common:countries.${a}`])]})}))}),l.jsxs(en,{variant:"informative",density:"sm",noTitle:!0,children:[l.jsx(fr,{className:"eb-size-4"}),l.jsx(tn,{children:e("screens.companyIdentification.contactPlatformOperator")})]})]}),t.watch("countryOfFormation")==="US"&&l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx(we,{control:t.control,name:"organizationIds.0.value",type:"text",label:r(o),description:i(o),maskFormat:n(o),maskChar:"_"},o),l.jsxs(Moe,{children:[l.jsx(Ioe,{asChild:!0,children:l.jsxs(Fe,{variant:"ghost",type:"button",size:"sm",className:"",children:[e("screens.companyIdentification.useDifferentIdType"),l.jsx(no,{})]})}),l.jsx(Xq,{className:"eb-component",children:["EIN","BUSINESS_REGISTRATION_ID","BUSINESS_REGISTRATION_NUMBER"].map(a=>l.jsx(Qq,{disabled:t.watch("organizationIds.0.idType")===a,onClick:()=>{t.setValue("organizationIds.0.idType",a),t.setValue("organizationIds.0.value","")},children:l.jsx("div",{className:"eb-flex eb-items-center eb-gap-2",children:r(a)})},a))})]})]})]})};Loe.schema=uqe;const dqe=/^[a-zA-Z0-9()_\\/@&+%#;,.: '-]*$/,pqe=Z.object({dbaName:Z.string().max(100,Q.t("onboarding:fields.dbaName.validation.maxLength")).refine(e=>dqe.test(e),Q.t("onboarding:fields.dbaName.validation.pattern")).refine(e=>!e||!/\s\s/.test(e),Q.t("onboarding:fields.dbaName.validation.noConsecutiveSpaces")).refine(e=>!e||e.length>=2,Q.t("onboarding:fields.dbaName.validation.minLength")),dbaNameNotAvailable:Z.boolean(),organizationDescription:Z.string().min(10).max(500).transform(hre),website:Z.string().url(Q.t("onboarding:fields.website.validation.invalid")).max(500,Q.t("onboarding:fields.website.validation.maxLength")).refine(e=>/^https?:\/\//.test(e),Q.t("onboarding:fields.website.validation.httpsRequired")).refine(e=>!e||!/^https?:\/\/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/.test(e),Q.t("onboarding:fields.website.validation.noIp")),websiteNotAvailable:Z.boolean()}),hqe=e=>e.superRefine((t,n)=>{t.websiteNotAvailable===!1&&!t.website&&n.addIssue({code:Z.ZodIssueCode.custom,message:Q.t("onboarding:fields.website.validation.required"),path:["website"]}),t.dbaNameNotAvailable===!1&&!t.dbaName&&n.addIssue({code:Z.ZodIssueCode.custom,message:"Required",path:["dbaName"]})}),ZP=({currentPartyData:e})=>{var r;const{t}=on(["onboarding-overview"]),n=Jn();return u.useEffect(()=>{const i=n.watch((o,{name:a})=>{a==="dbaNameNotAvailable"&&o.dbaNameNotAvailable&&n.clearErrors("dbaName")});return()=>i.unsubscribe()},[n,e]),u.useEffect(()=>{const i=n.watch((o,{name:a})=>{a==="websiteNotAvailable"&&o.websiteNotAvailable&&n.clearErrors("website")});return()=>i.unsubscribe()},[n]),l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx(we,{control:n.control,name:"dbaName",type:"text",valueOverride:n.watch("dbaNameNotAvailable")?((r=e==null?void 0:e.organizationDetails)==null?void 0:r.organizationName)??"":void 0,disabled:n.watch("dbaNameNotAvailable"),required:!0}),l.jsx(we,{control:n.control,name:"dbaNameNotAvailable",type:"checkbox-basic",label:t("fields.dbaNameNotAvailable.label"),noOptionalLabel:!0})]}),l.jsx("div",{children:l.jsx(we,{control:n.control,name:"organizationDescription",type:"textarea",popoutTooltip:!0,tooltip:l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx("h2",{className:"eb-font-header eb-text-2xl eb-font-medium",children:t("fields.organizationDescription.tooltipContent.exampleTitle")}),l.jsx("p",{className:"eb-text-sm",children:t("fields.organizationDescription.tooltipContent.exampleText")}),l.jsx("p",{className:"eb-pb-1 eb-text-sm",children:t("fields.organizationDescription.tooltipContent.alignmentNote")}),l.jsx("h2",{className:"eb-font-header eb-text-2xl eb-font-medium",children:t("fields.organizationDescription.tooltipContent.visibilityTitle")}),l.jsx("p",{className:"eb-pb-1 eb-text-sm",children:t("fields.organizationDescription.tooltipContent.visibilityText")})]})})}),l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx(we,{control:n.control,name:"website",type:"text",valueOverride:n.watch("websiteNotAvailable")?"N/A":void 0,disabled:n.watch("websiteNotAvailable"),required:!0}),l.jsx(we,{control:n.control,name:"websiteNotAvailable",type:"checkbox-basic",label:t("fields.websiteNotAvailable.label"),noOptionalLabel:!0})]})]})};ZP.schema=pqe,ZP.refineSchemaFn=hqe,ZP.modifyFormValuesBeforeSubmit=e=>{const{dbaName:t,website:n,dbaNameNotAvailable:r,websiteNotAvailable:i,...o}=e;return{...o,...r?{}:{dbaName:t},...i?{}:{website:n},websiteNotAvailable:i}};const fqe=Z.object({industry:Z.string().min(1,Q.t("onboarding:fields.industry.validation.required"))}),Eoe=()=>{const e=Jn();return l.jsxs("div",{className:"eb-mt-1 eb-space-y-6",children:[l.jsxs(en,{variant:"informative",density:"sm",noTitle:!0,className:"eb-mt-8",children:[l.jsx(fr,{className:"eb-size-4"}),l.jsx(tn,{children:"This is used for regulatory and compliance purposes, so please ensure your selection is accurate."})]}),l.jsx(we,{control:e.control,name:"industry",type:"industrySelect",popoutTooltip:!0,tooltip:l.jsxs("div",{className:"eb-mb-6",children:[l.jsx("h2",{className:"eb-mb-0 eb-font-header eb-text-2xl eb-font-medium",children:"How do I make the right choice?"}),l.jsx("p",{className:"eb-mb-0 eb-mt-1 eb-text-sm",children:"Please select the same classification chosen when your business or organization was registered in North America."}),l.jsx("h3",{className:"eb-mb-0 eb-mt-3 eb-text-sm eb-font-medium",children:"If you are a sole proprietor or your business is registered outside of North America,"}),l.jsx("p",{className:"eb-mb-0 eb-mt-1 eb-text-sm",children:"You may not have previously selected a classification. In this case, please make the best choice based on your primary line of business."})]})})]})};Eoe.schema=fqe;const mqe={"application/pdf":[".pdf"],"image/jpeg":[".jpeg",".jpg"],"image/png":[".png"]},gqe=e=>e?e.split(`
|
|
7781
7781
|
`).map((t,n)=>{const r=/^\d+\./.test(t.trim());if(t.includes("[OR]")){let i=t.split("Acceptable documents are");if(i.length===2){const[o,a]=i,s=a.split(/\[AND\]|\[OR\]/g).map(c=>c.trim()).filter(c=>c);return l.jsxs("div",{className:"eb-mb-2",children:[l.jsx("p",{className:`eb-text-sm ${r?"eb-font-medium":""}`,children:o}),l.jsx("p",{className:"eb-ml-4 eb-mt-1 eb-text-sm",children:"Acceptable documents are:"}),l.jsx("ul",{className:"eb-ml-12 eb-mt-1 eb-list-disc eb-text-sm",children:s.map((c,d)=>l.jsx("li",{className:"eb-mb-1",children:c},`doc-${d}`))})]},`section-${n}`)}return i=t.split(/\[OR\]/g).map(o=>o.trim()).filter(o=>o),l.jsxs("div",{className:"eb-mb-2",children:[l.jsx("p",{className:`eb-text-sm ${r?"eb-font-medium":""}`,children:i[0]}),i.length>1&&l.jsx(l.Fragment,{children:l.jsx("ul",{className:"eb-ml-6 eb-list-disc eb-text-sm",children:i.slice(1).map((o,a)=>l.jsx("li",{className:"eb-mb-1",children:o},`part-${a}`))})})]},`section-${n}`)}if(t.includes("[AND]")){const i=t.split("[AND]").map(o=>o.trim()).filter(o=>o);return l.jsx("div",{className:"eb-mb-2",children:i.map((o,a)=>{const s=/^\d+\./.test(o.trim());return l.jsx("p",{className:`eb-text-sm ${s||r&&a===0?"eb-font-medium":""} ${a>0?"eb-mt-2":""}`,children:o},`and-part-${a}`)})},`section-${n}`)}return l.jsx("p",{className:`eb-mb-2 eb-text-sm ${r?"eb-font-medium":""}`,children:t},`section-${n}`)}):null,yqe=({documentRequestId:e,requirementIndex:t,uploadIndex:n,availableDocTypes:r,control:i,isReadOnly:o=!1,isOptional:a=!1,maxFileSizeBytes:s,isOnlyFieldShown:c=!1})=>{const[d,p]=u.useState(!1),h=n>0?`_${n}`:"",f=`${e}.requirement_${t}_docType${h}`,m=`${e}.requirement_${t}_files${h}`,b=$N({control:i,name:m,defaultValue:[]}),g=()=>{const{userAgent:x}=navigator,{width:w,height:k}=window.screen,M=/Android.*Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(x)||/iPad|Macintosh/i.test(x)&&"ontouchend"in document,S=/Windows NT/i.test(x),I=/Macintosh|MacIntel/i.test(x)&&!("ontouchend"in document),L=/Linux/i.test(x)&&!/Android/i.test(x),E=S||I||L,A="maxTouchPoints"in navigator&&navigator.maxTouchPoints>0&&!E&&(w<=768||k<=1024)&&w<1200;return M||A},v=()=>!!(navigator.mediaDevices&&"getUserMedia"in navigator.mediaDevices&&"enumerateDevices"in navigator.mediaDevices);return u.useEffect(()=>{(async()=>{const w=g(),k=v();if(w&&k)try{const S=(await navigator.mediaDevices.enumerateDevices()).some(I=>I.kind==="videoinput");p(S)}catch{p(!0)}})()},[]),l.jsxs("div",{children:[!c&&l.jsxs("h3",{className:"eb-mb-3 eb-font-header eb-text-lg eb-font-medium",children:["Document ",n+1]}),l.jsx(jt,{control:i,name:f,render:({field:x})=>l.jsxs(wt,{className:"eb-mb-4",children:[l.jsxs(Dt,{asterisk:!a,className:"eb-text-sm eb-font-medium eb-text-gray-700",children:["Select Document Type",a&&l.jsx("span",{className:"eb-ml-2 eb-text-xs eb-font-normal eb-text-gray-500",children:"(Optional)"})]}),l.jsx(it,{children:l.jsxs(qr,{onValueChange:x.onChange,value:x.value||"",disabled:o,children:[l.jsx(Lr,{className:"eb-w-full",children:l.jsx(Hr,{placeholder:"Select a document type"})}),l.jsx(Er,{children:r.map(w=>{var k;return l.jsx(cn,{value:w,children:((k=y1[w])==null?void 0:k.label)||w},w)})})]})}),l.jsx(_t,{className:"eb-text-xs"})]})}),l.jsx(jt,{control:i,name:m,render:({field:{onChange:x,value:w,...k}})=>l.jsxs(wt,{className:"eb-space-y-2",children:[l.jsxs(Dt,{asterisk:!a,className:"eb-text-sm eb-font-medium eb-text-gray-700",children:["Upload Document",a&&l.jsx("span",{className:"eb-ml-2 eb-text-xs eb-font-normal eb-text-gray-500",children:"(Optional)"})]}),l.jsx(it,{children:l.jsx(Cte,{containerClassName:"eb-max-w-full",...k,multiple:!0,accept:mqe,onChange:x,compressionFunc:Bde,compressibleExtensions:[".jpeg",".jpg",".png"],fileMaxSize:s,compressionMaxDimension:1e3,showCompressionInfo:!0,enableCameraCapture:d,captureMode:"environment",value:b})}),l.jsx(_t,{className:"eb-text-xs"})]})})]})},bqe=({documentRequest:e,requirementIndex:t,isActive:n,isPastRequirement:r,satisfiedDocTypes:i,docTypesForRequirement:o,numFieldsToShow:a,control:s,watch:c,resetKey:d,maxFileSizeBytes:p,isOnlyRequirement:h=!1})=>{var w;const[f,m]=u.useState(n?`req-${t}`:void 0);u.useEffect(()=>{n&&m(`req-${t}`)},[n,t]);const b=(w=e.requirements)==null?void 0:w[t];if(!b)return null;const g=b.documentTypes.filter(k=>{const M=k,S=Array.from({length:a}).some((I,L)=>{const E=`${e.id}.requirement_${t}_docType${L>0?`_${L}`:""}`;return c(E)===M});return!i.includes(M)||S}),v=o.length>0?o:b.documentTypes.filter(k=>i.includes(k)).map(k=>k),x=l.jsx(l.Fragment,{children:Array.from({length:a}).map((k,M)=>l.jsxs(u.Fragment,{children:[l.jsx(yqe,{documentRequestId:e.id||"",requirementIndex:t,uploadIndex:M,availableDocTypes:g,control:s,isReadOnly:r,isOptional:b.minRequired===0,maxFileSizeBytes:p,isOnlyFieldShown:a===1}),M<a-1&&l.jsx(Ar,{className:"eb-my-6"})]},`${e.id}-${t}-${M}-${d}`))});return h?x:l.jsx(V0,{type:"single",className:"eb-w-full eb-rounded-lg eb-border eb-bg-card eb-shadow-md",value:f,onValueChange:m,collapsible:!0,children:l.jsxs(r2,{className:"eb-rounded-md eb-border eb-border-gray-200",value:`req-${t}`,children:[l.jsxs(i2,{className:"eb-py-2",children:[l.jsx(no,{className:"eb-ml-2 eb-size-4 eb-shrink-0 eb-transition-transform eb-duration-200"}),l.jsxs("span",{className:"eb-ml-2 eb-text-nowrap eb-text-sm eb-font-semibold",children:["Step ",t+1]}),r?l.jsxs("span",{className:"eb-ml-2 eb-text-sm eb-font-normal eb-text-muted-foreground",children:["Completed - Documents provided:",l.jsx("span",{className:"eb-ml-1 eb-inline-flex eb-flex-wrap eb-gap-1",children:v.map(k=>{var M;return l.jsx("span",{className:"eb-inline-flex eb-items-center eb-rounded-full eb-bg-green-100 eb-px-2 eb-py-0.5 eb-text-xs eb-font-medium eb-text-green-800",children:((M=y1[k])==null?void 0:M.label)||k},k)})})]}):a>0?l.jsx("span",{className:"eb-ml-2 eb-font-normal eb-text-gray-600",children:b.minRequired===0&&l.jsx("span",{className:"eb-ml-2 eb-inline-flex eb-items-center eb-rounded-full eb-bg-gray-100 eb-px-2 eb-py-0.5 eb-text-xs eb-font-medium eb-text-gray-500",children:"Optional"})}):null,l.jsx("div",{className:"eb-ml-auto eb-mr-2 eb-flex eb-items-center eb-gap-2 eb-text-sm eb-font-normal eb-text-muted-foreground",children:r?l.jsx(Pi,{className:"eb-size-4 eb-text-green-600"}):l.jsx(oa,{className:"eb-size-4 eb-text-muted-foreground"})})]}),l.jsx(U0,{className:"eb-p-4",children:x})]})})},vqe=({documentRequest:e,activeRequirements:t,satisfiedDocTypes:n,requirementDocTypes:r,control:i,watch:o,resetKey:a,onReset:s,maxFileSizeBytes:c})=>{var d;return!(e!=null&&e.id)||!((d=e.requirements)!=null&&d.length)?null:l.jsxs("div",{children:[e.description&&l.jsx(en,{variant:"informative",density:"sm",noTitle:!0,children:l.jsx(tn,{children:gqe(e.description)})}),l.jsxs("div",{className:"eb-mt-6 eb-w-full",children:[l.jsx("div",{className:"eb-mb-4 eb-flex eb-justify-end",children:l.jsxs(Fe,{type:"button",variant:"outline",size:"sm",onClick:s,className:"eb-flex eb-h-6 eb-items-center eb-gap-1 eb-p-1 eb-text-xs",children:[l.jsx(Ds,{className:"!eb-size-3"})," Reset form"]})}),l.jsx("div",{className:"eb-space-y-6",children:e.requirements.map((p,h)=>{var w;const f=t.includes(h),m=p.documentTypes.filter(k=>n.includes(k)).length,b=Math.max((p.minRequired||1)-m,0),g=m>0&&(m===p.documentTypes.length||b===0),v=r[h]||[],x=Math.max(v.length,p.minRequired||1);return l.jsx(bqe,{documentRequest:e,requirementIndex:h,isActive:f,isPastRequirement:g,satisfiedDocTypes:n,docTypesForRequirement:v,numFieldsToShow:x,control:i,watch:o,resetKey:a,maxFileSizeBytes:c,isOnlyRequirement:((w=e.requirements)==null?void 0:w.length)===1},`${e.id}-req-${h}`)})})]})]})},xqe=()=>{var j,q,P,z;const{clientData:e,docUploadMaxFileSizeBytes:t=2*1024*1024}=ai(),n=mi(),{goTo:r,editingPartyIds:i}=Ca(),o=i["document-upload-form"],a=qX(),s=RX(),[c,d]=u.useState({}),[p,h]=u.useState([]),[f,m]=u.useState({}),[b,g]=u.useState(0),{data:v,status:x}=Wve(o??""),w=(j=e==null?void 0:e.parties)==null?void 0:j.find(B=>{var N;return v!=null&&v.partyId?B.id===(v==null?void 0:v.partyId):(N=B.roles)==null?void 0:N.includes("CLIENT")}),k=v?[v]:[],M=u.useMemo(()=>{const B={};return k.forEach(N=>{if(!(N!=null&&N.id)||!N.requirements)return;const F={};N.requirements.forEach((_,H)=>{if(Math.max((_.minRequired||1)-_.documentTypes.filter($=>p.includes($)).length,0)>0){const $=_.minRequired||1;for(let V=0;V<$;V+=1){const T=V>0?`_${V}`:"";F[`requirement_${H}_docType${T}`]=Z.string().optional(),F[`requirement_${H}_files${T}`]=Z.array(Z.instanceof(File)).optional()}}}),B[N.id]=Z.object(F)}),Z.object(B)},[JSON.stringify(k),JSON.stringify(p)]),S=vi({resolver:po(M),mode:"onChange"});u.useEffect(()=>{const B=setTimeout(()=>{S.trigger()},100);return()=>clearTimeout(B)},[JSON.stringify(c),S]);const I=$N({control:S.control});u.useEffect(()=>{if(!I)return;const B={},N=[],F={};Object.entries(I).forEach(([H,W])=>{B[H]=[],F[H]={},Object.entries(W).forEach(([$,V])=>{var T;if($.includes("_docType")&&V){const D=$.split("_"),R=parseInt(D[1],10),O=`requirement_${R}_files`,K=$.replace(`requirement_${R}_docType`,""),G=`${O}${K}`,Y=W[G];if(Y&&Y.length>0){const ae=(T=S.formState.errors)==null?void 0:T[H],ue=!!(ae!=null&&ae[$]),de=!!(ae!=null&&ae[G]);if(!ue&&!de){const ce=V;B[H].push({documentType:ce,files:Y}),N.includes(ce)||N.push(ce),F[H][R]||(F[H][R]=[]),F[H][R].includes(ce)||F[H][R].push(ce)}}}})}),h(N),m(F);const _={...c};k==null||k.forEach(H=>{if(!(H!=null&&H.id))return;const W=H.id;if(_[W]||(_[W]=[0]),H.requirements){let $=!1;const V=[];H.requirements.forEach((T,D)=>{var O;(((O=B[W])==null?void 0:O.filter(K=>T.documentTypes.includes(K.documentType)).length)||0)>=(T.minRequired||1)&&V.push(D)});for(let T=0;T<H.requirements.length;T+=1)if(!V.includes(T)&&(T===0||H.requirements.slice(0,T).every((R,O)=>V.includes(O)))){_[W]=[T],$=!0;break}!$&&H.requirements.length>0&&(V.length===H.requirements.length?_[W]=[]:_[W]=[0])}}),d(_)},[I,JSON.stringify(k),S.formState.errors]);const L=S.handleSubmit(async()=>{S.clearErrors();const B=S.getValues();try{const N=[];for(const[F,_]of Object.entries(B)){N.push(F);const H=[];Object.entries(_).forEach(([W,$])=>{if(W.includes("_docType")&&$){const V=W.split("_"),T=parseInt(V[1],10),D=`requirement_${T}_files`,R=W.replace(`requirement_${T}_docType`,""),O=`${D}${R}`,K=_[O];K&&K.length>0&&K.forEach(G=>{H.push({documentType:$,file:G})})}});for(const{documentType:W,file:$}of H){const V={documentRequestId:F,documentType:W};await a.mutateAsync({data:{documentData:JSON.stringify(V),file:$}})}}if(N.length>0)for(const F of N)await s.mutateAsync({id:F});n.invalidateQueries(),r("upload-documents-section")}catch(N){console.error("Error uploading documents:",N)}}),E=()=>{S.reset({}),h([]),m({});const B={};k.forEach(N=>{N!=null&&N.id&&(B[N.id]=[0])}),d(B),a.reset(),s.reset(),g(N=>N+1)},A=u.useMemo(()=>{if(!(k!=null&&k.length))return!1;const B=(F,_)=>{var T,D;if(!(F!=null&&F.id)||!F.requirements)return!1;if((T=c[F.id])==null?void 0:T.includes(_)){const R=(D=S.formState.errors)==null?void 0:D[F.id];return R&&Object.keys(R).some(K=>K.includes(`requirement_${_}_`)),!1}const W=F.requirements[_];if(!W)return!1;if(W.minRequired===0)return!0;const $=W.documentTypes.filter(R=>p.includes(R)).length;return $>0&&($===W.documentTypes.length||$>=(W.minRequired||1))};return k.every(F=>{var H;return!(F!=null&&F.id)||!((H=F.requirements)!=null&&H.length)?!0:F.requirements.every((W,$)=>{var G,Y;const V=W.documentTypes.filter(ae=>p.includes(ae)).length,T=F.id&&((G=c[F.id])==null?void 0:G.includes($)),D=B(F,$),R=F.id?(Y=S.formState.errors)==null?void 0:Y[F.id]:void 0,O=R?Object.keys(R).some(ae=>ae.includes(`requirement_${$}_`)):!1;return W.minRequired===0?!0:V>=(W.minRequired??1)&&!O&&(D||!T)})})},[JSON.stringify(k),JSON.stringify(c),p,S.formState.errors]);return x==="pending"?l.jsx(Ws,{message:"Fetching document request..."}):l.jsx(gr,{...S,children:l.jsx("form",{onSubmit:L,className:"eb-flex eb-min-h-full eb-flex-col",children:l.jsxs(x1,{title:bf(w),children:[l.jsxs("div",{className:"eb-flex-auto eb-space-y-6",children:[l.jsxs("div",{className:"eb-mb-6 eb-mt-1",children:[((q=w==null?void 0:w.roles)==null?void 0:q.includes("CLIENT"))&&l.jsx(wn,{variant:"subtle",size:"lg",children:"Business"}),((P=w==null?void 0:w.roles)==null?void 0:P.includes("BENEFICIAL_OWNER"))&&l.jsx(wn,{variant:"subtle",size:"lg",children:"Owner"}),((z=w==null?void 0:w.roles)==null?void 0:z.includes("CONTROLLER"))&&l.jsx(wn,{variant:"subtle",size:"lg",children:"Controller"})]}),l.jsx("div",{className:"eb-space-y-4",children:k==null?void 0:k.map(B=>l.jsx(vqe,{documentRequest:B,activeRequirements:c[B.id||""]||[0],satisfiedDocTypes:p,requirementDocTypes:f[B.id||""]||{},control:S.control,watch:S.watch,resetKey:b,onReset:E,maxFileSizeBytes:t},B.id))})]}),l.jsxs("div",{className:"eb-mt-6 eb-flex eb-flex-col eb-gap-3",children:[l.jsx(ii,{error:a.error||s.error,customErrorMessage:a.error?"There was an unexpected error uploading documents. Please try again.":s.error?"There was an unexpected error submitting document requests. Please try again.":void 0}),l.jsx(Fe,{type:"submit",disabled:S.formState.isSubmitting||!A,children:S.formState.isSubmitting?"Uploading...":A?"Upload Documents":"Complete All Required Documents"}),l.jsx(Fe,{variant:"ghost",onClick:()=>r("upload-documents-section"),className:"eb-text-primary hover:eb-bg-primary/5 hover:eb-text-primary",children:"Cancel"})]})]})})})},wqe=({party:e,docRequest:t,onUploadClick:n})=>{var p,h,f,m;const r=b=>b?new Date(parseInt(b,10)).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"}):"",i=(b,g)=>{var v;return(v=b==null?void 0:b.find(x=>x.key===g))==null?void 0:v.value},o=b=>{if(!b||b.length===0)return[];const g=Object.values(FDe).reduce((v,x)=>(v[x]=[],v),{});return b.forEach(v=>{const x=v.documentType;g[x].push(v)}),Object.keys(g).map(v=>({documentType:v,documents:g[v]}))},{clientData:a}=ai(),{data:{documentDetails:s}={}}=t4e({clientId:a==null?void 0:a.id,...(p=e.roles)!=null&&p.includes("CLIENT")?{}:{partyId:e.id}}),c=s==null?void 0:s.filter(b=>{var g;return((g=b.metadata.find(v=>v.key==="DOCUMENT_REQUEST_ID"))==null?void 0:g.value)===t.id}),d=o(c);return l.jsxs(Gt,{className:"eb-space-y-6 eb-rounded-lg eb-border eb-p-6 eb-shadow",children:[l.jsxs("div",{className:"eb-space-y-1.5",children:[l.jsxs("div",{className:"eb-flex eb-items-center eb-justify-between",children:[l.jsx("h3",{className:"eb-min-w-0 eb-shrink eb-overflow-hidden eb-break-words eb-font-header eb-text-lg eb-font-medium",children:bf(e)}),t.status==="ACTIVE"&&l.jsxs("span",{children:[l.jsx(oa,{className:"eb-size-5 eb-text-muted-foreground"}),l.jsx("span",{className:"eb-sr-only",children:"Pending"})]}),t.status==="CLOSED"&&l.jsxs("span",{children:[l.jsx(To,{className:"eb-size-5 eb-stroke-green-700"}),l.jsx("span",{className:"eb-sr-only",children:"Completed"})]}),t.status==="EXPIRED"&&l.jsxs("span",{children:[l.jsx(Fn,{className:"eb-size-5 eb-stroke-[#C75300]"}),l.jsx("span",{className:"eb-sr-only",children:"Expired"})]})]}),l.jsxs("div",{className:"eb-flex eb-gap-2",children:[((h=e.roles)==null?void 0:h.includes("CLIENT"))&&l.jsx(wn,{variant:"subtle",size:"lg",children:"Business"}),((f=e.roles)==null?void 0:f.includes("BENEFICIAL_OWNER"))&&l.jsx(wn,{variant:"subtle",size:"lg",children:"Owner"}),((m=e.roles)==null?void 0:m.includes("CONTROLLER"))&&l.jsx(wn,{variant:"subtle",size:"lg",children:"Controller"})]})]}),l.jsxs("div",{children:[t.status==="ACTIVE"?l.jsxs(Fe,{variant:"outline",className:"eb-w-full eb-border-primary eb-text-primary",onClick:n,children:[l.jsx(Ha,{})," Upload documents"]}):l.jsxs("div",{className:"eb-inline-flex eb-items-center eb-justify-center eb-gap-2 eb-text-xs eb-text-green-700",children:[l.jsx(_r,{className:"eb-size-4"}),"Required documents successfully uploaded"]}),l.jsx("div",{children:d.map(b=>{var g;return b.documents.length===0?null:l.jsxs("div",{className:"eb-mt-2 eb-rounded-md eb-border eb-p-2",children:[l.jsxs("div",{className:"eb-flex eb-items-center eb-gap-2",children:[l.jsx(tu,{className:"eb-size-4 eb-text-muted-foreground"}),l.jsx("span",{className:"eb-text-sm eb-font-medium",children:((g=y1[b.documentType])==null?void 0:g.label)||b.documentType})]}),b.documents.map(v=>{const x=i(v.metadata,"UPLOADED_FILE_NAME"),w=i(v.metadata,"UPLOAD_TIME");return l.jsxs("div",{className:"eb-ml-6 eb-mt-2",children:[x&&l.jsx("div",{className:"eb-flex eb-items-center eb-gap-2",children:l.jsx("span",{className:"eb-max-w-[200px] eb-truncate eb-text-xs eb-text-muted-foreground",title:x,children:x})}),w&&l.jsxs("div",{className:"eb-mt-1 eb-flex eb-items-center eb-gap-2",children:[l.jsx(Es,{className:"eb-size-3 eb-text-muted-foreground"}),l.jsxs("span",{className:"eb-text-xs eb-text-muted-foreground",children:["Uploaded on ",r(w)]})]})]},v.id)})]},b.documentType)})})]})]})},Aoe=({title:e,documentRequests:t,clientData:n,onDocRequestSelect:r})=>n!=null&&n.parties?l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx("h2",{className:"eb-font-header eb-text-2xl eb-font-medium",children:e}),t.length>0?t.map(i=>{var a,s;const o=i.partyId?(a=n.parties)==null?void 0:a.find(c=>c.id===i.partyId):(s=n.parties)==null?void 0:s.find(c=>{var d;return(d=c.roles)==null?void 0:d.includes("CLIENT")});return o?l.jsx(wqe,{party:o,docRequest:i,onUploadClick:()=>r(i.id)},o.id):null}):l.jsx(Gt,{className:"eb-space-y-6 eb-rounded-lg eb-border eb-p-6 eb-shadow",children:l.jsx("p",{className:"eb-flex eb-items-center eb-justify-center eb-text-sm eb-font-medium",children:"No documents required"})})]}):null,kqe=(e,t)=>{var o;if(!(e!=null&&e.length)||!(t!=null&&t.parties))return{businessDocumentRequests:[],individualDocumentRequests:[]};const n=(o=t.parties.find(a=>{var s;return(s=a.roles)==null?void 0:s.includes("CLIENT")}))==null?void 0:o.id,r=e.filter(a=>!a.partyId&&a.clientId===t.id||a.partyId&&a.partyId===n),i=e.filter(a=>a.partyId&&a.partyId!==n);return{businessDocumentRequests:r,individualDocumentRequests:i}},Cqe=({clientStatus:e,documentRequestStatus:t,hasDocumentRequests:n,clientOutstanding:r})=>{var i,o,a,s;if(e==="REVIEW_IN_PROGRESS")return l.jsxs(en,{variant:"informative",children:[l.jsx(fr,{className:"eb-h-4 eb-w-4"}),l.jsx(hr,{children:"Review in progress"}),l.jsx(tn,{children:"Your onboarding is currently under review. Please check back later."})]});if(e==="APPROVED")return l.jsxs(en,{variant:"success",noTitle:!0,children:[l.jsx(_r,{className:"eb-h-4 eb-w-4"}),l.jsx(tn,{children:"Your onboarding has been approved. No documents are required."})]});if(!e)return l.jsxs(en,{variant:"destructive",children:[l.jsx(Fn,{className:"eb-h-4 eb-w-4"}),l.jsx(hr,{children:"There was a problem"}),l.jsx(tn,{children:"Unable to load client data. Please try again later."})]});if(t!=="pending"){if(t==="error")return l.jsxs(en,{variant:"destructive",children:[l.jsx(Fn,{className:"eb-h-4 eb-w-4"}),l.jsx(hr,{children:"There was a problem"}),l.jsx(tn,{children:"Unable to load document requests. Please try again later."})]});if(!n)return l.jsxs(en,{variant:"warning",children:[l.jsx(Fn,{className:"eb-h-4 eb-w-4"}),l.jsx(hr,{children:"There is a problem"}),l.jsx(tn,{children:"No document requests found."})]});if(e==="NEW"&&((((i=r==null?void 0:r.attestationDocumentIds)==null?void 0:i.length)??0)>0||(((o=r==null?void 0:r.partyIds)==null?void 0:o.length)??0)>0||(((a=r==null?void 0:r.partyRoles)==null?void 0:a.length)??0)>0||(((s=r==null?void 0:r.questionIds)==null?void 0:s.length)??0)>0))return l.jsxs(en,{variant:"warning",children:[l.jsx(Fn,{className:"eb-h-4 eb-w-4"}),l.jsx(hr,{children:"Outstanding items"}),l.jsx(tn,{children:"Your onboarding has outstanding items that need to be addressed. Please return to the onboarding flow to resolve them."})]})}},Sqe=()=>{const{clientData:e,docUploadOnlyMode:t}=ai(),{goTo:n}=Ca(),r=mi(),i=u.useRef(null),{data:o,status:a}=Vve({clientId:e==null?void 0:e.id,includeRelatedParty:!0},{query:{enabled:!!(e!=null&&e.id)}}),s=o==null?void 0:o.documentRequests,c=!!(s!=null&&s.length);u.useEffect(()=>{if(e!=null&&e.id&&s){const h=JSON.stringify(s);i.current!==null&&i.current!==h&&r.invalidateQueries({queryKey:$o(e.id)}),i.current=h}},[e==null?void 0:e.id,s,r]);const d=h=>{n("document-upload-form",{editingPartyId:h})},p=()=>{const h=Cqe({clientStatus:e==null?void 0:e.status,documentRequestStatus:a,hasDocumentRequests:c,clientOutstanding:e==null?void 0:e.outstanding}),f=h!==null?h:null;if(f)return f;if(a==="pending")return l.jsx(Ws,{message:"Loading document requests"});const{businessDocumentRequests:m,individualDocumentRequests:b}=kqe(s,e);return l.jsxs("div",{className:"eb-space-y-6",children:[l.jsx(Aoe,{title:"For the business",documentRequests:m,clientData:e,onDocRequestSelect:d}),l.jsx(Aoe,{title:"For owners and key roles",documentRequests:b,clientData:e,onDocRequestSelect:d})]})};return l.jsxs(x1,{title:"Supporting documents",description:a==="success"&&(e==null?void 0:e.status)==="INFORMATION_REQUESTED"&&c?"To satisfy regulatory requirements, we need to obtain the following":void 0,children:[l.jsx("div",{className:"eb-mt-6 eb-flex-auto eb-space-y-6",children:p()}),!t&&l.jsx("div",{className:"eb-mt-6 eb-space-y-6",children:l.jsx("div",{className:"eb-flex eb-justify-between eb-gap-4",children:l.jsx(Fe,{type:"button",variant:"default",size:"lg",className:"eb-w-full eb-text-lg",onClick:()=>n("overview"),children:"Return to overview"})})})]})},Doe=Z.object({organizationTypeHierarchy:Z.object({generalOrganizationType:Z.union([Z.enum(["SOLE_PROPRIETORSHIP","REGISTERED_BUSINESS","OTHER"]),Z.literal("")]).refine(e=>e!=="",{message:Q.t("common:validation.required")}),specificOrganizationType:Z.union([Z.enum(["LIMITED_LIABILITY_COMPANY","LIMITED_LIABILITY_PARTNERSHIP","GENERAL_PARTNERSHIP","LIMITED_PARTNERSHIP","C_CORPORATION","S_CORPORATION","PARTNERSHIP","NON_PROFIT_CORPORATION","GOVERNMENT_ENTITY","SOLE_PROPRIETORSHIP","UNINCORPORATED_ASSOCIATION","PUBLICLY_TRADED_COMPANY"]),Z.literal("")]).refine(e=>e!=="",{message:Q.t("common:validation.required")})})}),Jq={SOLE_PROPRIETORSHIP:["SOLE_PROPRIETORSHIP"],REGISTERED_BUSINESS:["LIMITED_LIABILITY_COMPANY","LIMITED_LIABILITY_PARTNERSHIP","GENERAL_PARTNERSHIP","LIMITED_PARTNERSHIP","C_CORPORATION","S_CORPORATION","PARTNERSHIP"],OTHER:["NON_PROFIT_CORPORATION","GOVERNMENT_ENTITY","UNINCORPORATED_ASSOCIATION"]},Mqe=()=>{var N;const e=mi(),{clientData:t,setClientId:n,onPostClientSettled:r,onPostPartySettled:i,availableOrganizationTypes:o}=ai(),{goTo:a,sessionData:s,updateSessionData:c}=Ca(),{t:d}=on(["onboarding-overview","onboarding","common"]),p=nee({clientData:t,schema:Doe,defaultValues:{}}),h=(N=t==null?void 0:t.parties)==null?void 0:N.find(F=>F.partyType==="ORGANIZATION"),[f,m]=u.useState(!1),b=()=>{a("overview")};u.useEffect(()=>{if(t&&h&&!f){const F=B0(t,h.id);p.reset(Zs(F,Doe)),m(!0)}},[t,h,f,p]);const{mutate:g,error:v,status:x}=jX(),{mutate:w,error:k,status:M}=ya(),{mutate:S,error:I,status:L}=ba(),E=p.handleSubmit(F=>{var H;const _={roles:[$De.CLIENT],partyType:PDe.ORGANIZATION,organizationDetails:{organizationName:"PLACEHOLDER_ORG_NAME",countryOfFormation:"US"}};if(t)if(t&&(h!=null&&h.id)){if(F.organizationTypeHierarchy.specificOrganizationType===((H=h.organizationDetails)==null?void 0:H.organizationType)){b();return}const W=t2(F,{});S({partyId:h.id,data:W},{onSettled:($,V)=>{var T;i==null||i($,(T=V==null?void 0:V.response)==null?void 0:T.data)},onSuccess:$=>{e.setQueryData($o(t.id),V=>{var T;return{...V,parties:(T=V==null?void 0:V.parties)==null?void 0:T.map(D=>D.id===$.id?{...D,...$}:D)}}),b()},onError:$=>{var V,T;if((T=(V=$.response)==null?void 0:V.data)!=null&&T.context){const{context:D}=$.response.data,R=e2(D);Ci(p,R)}}})}else{const W=Ys(F,0,"addParties",{addParties:[_]});w({id:t.id,data:W},{onSettled:($,V)=>{var T;r==null||r($,(T=V==null?void 0:V.response)==null?void 0:T.data)},onSuccess:()=>{b()},onError:$=>{var V,T;if((T=(V=$.response)==null?void 0:V.data)!=null&&T.context){const{context:D}=$.response.data,R=Ks(D,0,"addParties");Ci(p,R)}}})}else{const W=Ys(F,0,"parties",{parties:[_]});g({data:{products:["EMBEDDED_PAYMENTS"],...W}},{onSettled:($,V)=>{var T;r==null||r($,(T=V==null?void 0:V.response)==null?void 0:T.data)},onSuccess:$=>{n($.id),e.setQueryData($o($.id),$),b()},onError:$=>{var V,T;if((T=(V=$.response)==null?void 0:V.data)!=null&&T.context){const{context:D}=$.response.data,R=Ks(D,0,"parties");Ci(p,R)}}})}}),A=()=>{const F=[];return Object.entries(Jq).forEach(([_,H])=>{const W=_;(o?H.some(V=>o.includes(V)):H.some(V=>pq.includes(V)))&&F.push(W)}),F.length?F:Object.keys(Jq)},j=p.watch("organizationTypeHierarchy.generalOrganizationType"),q=F=>{if(F==="SOLE_PROPRIETORSHIP"){p.setValue("organizationTypeHierarchy.specificOrganizationType","SOLE_PROPRIETORSHIP");return}p.setValue("organizationTypeHierarchy.specificOrganizationType","")},P=M==="pending"||x==="pending"||L==="pending",B=P||h&&!f;return l.jsx(gr,{...p,children:l.jsxs("form",{onSubmit:E,className:"eb-flex eb-min-h-full eb-flex-col",children:[!s.hideGatewayInfoAlert&&l.jsxs(en,{variant:"informative",density:"sm",className:"eb-mb-4",children:[l.jsx(fr,{className:"eb-h-4 eb-w-4"}),l.jsx(hr,{className:"eb-text-sm eb-font-semibold",children:d("screens.gateway.infoAlert.title")}),l.jsx(tn,{children:d("screens.gateway.infoAlert.description")}),l.jsxs("button",{type:"button",className:"eb-hover:eb-opacity-100 eb-focus:eb-outline-none eb-focus:eb-ring-2 eb-focus:eb-ring-ring eb-focus:eb-ring-offset-2 eb-disabled:eb-pointer-events-none eb-absolute eb-right-4 eb-top-3 eb-rounded-sm eb-opacity-70 eb-ring-offset-background eb-transition-opacity data-[state=open]:eb-bg-accent data-[state=open]:eb-text-muted-foreground [&&]:eb-pl-0",onClick:()=>{c({hideGatewayInfoAlert:!0})},children:[l.jsx(Mr,{className:"eb-h-4 eb-w-4 eb-pl-0 eb-text-foreground"}),l.jsx("span",{className:"eb-sr-only",children:"Close"})]})]}),l.jsxs(x1,{subTitle:d("welcomeText"),title:d("screens.gateway.title"),description:d("screens.gateway.description"),children:[l.jsxs("div",{className:"eb-mt-6 eb-flex-auto eb-space-y-6",children:[l.jsx(we,{control:p.control,disableFieldRuleMapping:!0,name:"organizationTypeHierarchy.generalOrganizationType",type:"radio-group-blocks",options:A().map(F=>({value:F,label:d([`generalOrganizationTypes.${F}`]),description:d([`generalOrganizationTypeDescriptions.${F}`])})),onChange:q,required:!0,disabled:B}),(j==="REGISTERED_BUSINESS"||j==="OTHER")&&l.jsx(we,{control:p.control,disableFieldRuleMapping:!0,name:"organizationTypeHierarchy.specificOrganizationType",type:"combobox",label:d([`fields.organizationTypeHierarchy.specificOrganizationType.label.${j}`]),description:d([`fields.organizationTypeHierarchy.specificOrganizationType.description.${j}`]),options:(o??pq).filter(F=>Jq[j].includes(F)).map(F=>({value:F,label:d([`organizationTypes.${F}`,`onboarding:organizationTypes.${F}`]),description:d(`onboarding:organizationTypeDescriptions.${F}`)})),required:!0,disabled:B})]}),l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsx(ii,{error:I||k||v}),l.jsxs(Fe,{type:"submit",variant:"default",size:"lg",className:"eb-w-full eb-text-lg",disabled:B,children:[P?l.jsx(Ln,{className:"eb-animate-spin"}):null,d("screens.gateway.nextButton")]})]})]})]})})},Toe=["30071","30073"],Iqe=["30005"],Lqe=e=>{const t={};return e.forEach(n=>{var c,d,p,h,f,m,b,g,v,x;const r=((d=(c=n==null?void 0:n.responseSchema)==null?void 0:c.items)==null?void 0:d.type)??"string",i=(h=(p=n==null?void 0:n.responseSchema)==null?void 0:p.items)==null?void 0:h.enum,o=(m=(f=n==null?void 0:n.responseSchema)==null?void 0:f.items)==null?void 0:m.pattern,a=!!n.parentQuestionId;let s;if(n.id&&Toe.includes(n.id))s=Z.string().refine(w=>/^\d{4}-\d{2}-\d{2}$/.test(w),Q.t("onboarding:fields.additionalQuestions.validation.dateFormat"));else if(r)switch(r){case"boolean":s=Z.enum(["true","false"]);break;case"string":i?i.length>0?s=Z.enum([i[0],...i.slice(1)]):s=Z.string():(s=Z.string().min(1,Q.t("onboarding:fields.additionalQuestions.validation.required")),o&&(s=s.refine(w=>new RegExp(o).test(w),Q.t("onboarding:fields.additionalQuestions.validation.invalidFormat"))));break;case"integer":s=Z.string().min(1,Q.t("onboarding:fields.additionalQuestions.validation.required")).refine(w=>/^\d+$/.test(w),Q.t("onboarding:fields.additionalQuestions.validation.numberFormat"));break;default:s=Z.string()}else{console.log("Unknown question type",n);return}if(((b=n==null?void 0:n.responseSchema)==null?void 0:b.type)==="array"){const w=s;s=Z.array(w),a||(s=s.min(((g=n==null?void 0:n.responseSchema)==null?void 0:g.minItems)??1,Q.t("onboarding:fields.additionalQuestions.validation.required")).max(((v=n==null?void 0:n.responseSchema)==null?void 0:v.maxItems)??1,Q.t("onboarding:fields.additionalQuestions.validation.maxItems",{maxItems:(x=n==null?void 0:n.responseSchema)==null?void 0:x.maxItems})).superRefine((k,M)=>(k.forEach(S=>{const I=w.safeParse(S);I.error&&M.addIssue(I.error.issues[0])}),!0)))}t[`question_${n.id}`]=s}),Z.object(t).superRefine((n,r)=>{e.forEach(i=>{var o,a,s,c,d,p;if(i.parentQuestionId){const h=n==null?void 0:n[`question_${i.parentQuestionId}`],f=e.find(m=>m.id===i.parentQuestionId);if(f!=null&&f.subQuestions){const m=f.subQuestions.find(b=>{var g;return(g=b.questionIds)==null?void 0:g.includes(i.id??"")});m&&(typeof(m==null?void 0:m.anyValuesMatch)=="string"&&h.includes(m.anyValuesMatch)||Array.isArray(m==null?void 0:m.anyValuesMatch)&&h.some(b=>{var g;return(g=m.anyValuesMatch)==null?void 0:g.includes(b)}))&&(((o=i==null?void 0:i.responseSchema)==null?void 0:o.type)==="array"?((a=i==null?void 0:i.responseSchema)!=null&&a.minItems&&(!(n!=null&&n[`question_${i.id}`])||(n==null?void 0:n[`question_${i.id}`].length)<((s=i==null?void 0:i.responseSchema)==null?void 0:s.minItems))&&r.addIssue({code:Z.ZodIssueCode.custom,message:Q.t("onboarding:fields.additionalQuestions.validation.required"),path:[`question_${i.id}`]}),(c=i==null?void 0:i.responseSchema)!=null&&c.maxItems&&(n==null?void 0:n[`question_${i.id}`].length)>((d=i==null?void 0:i.responseSchema)==null?void 0:d.maxItems)&&r.addIssue({code:Z.ZodIssueCode.custom,message:Q.t("onboarding:fields.additionalQuestions.validation.maxItems",{maxItems:(p=i==null?void 0:i.responseSchema)==null?void 0:p.maxItems}),path:[`question_${i.id}`]})):n!=null&&n[`question_${i.id}`]||r.addIssue({code:Z.ZodIssueCode.custom,message:Q.t("onboarding:fields.additionalQuestions.validation.required"),path:[`question_${i.id}`]}))}}})})},Eqe=()=>{var A;const e=mi(),{clientData:t}=ai(),{originScreenId:n,goTo:r,updateSessionData:i}=Ca(),o=n==="review-attest-section",a=((A=t==null?void 0:t.outstanding)==null?void 0:A.questionIds)??[],s=(t==null?void 0:t.questionResponses)??[],c=u.useMemo(()=>{const j=s.map(q=>q.questionId??"undefined");return[...new Set([...a,...j])].sort()},[a,s]),{data:d,status:p,error:h}=Up({questionIds:c.join(",")}),f=u.useMemo(()=>c.reduce((j,q)=>{const P=s==null?void 0:s.find(z=>z.questionId===q);return j[`question_${q}`]=P?P.values:[],j},{}),[c,s]),m=$o((t==null?void 0:t.id)??""),{mutate:b,error:g,status:v}=ya({mutation:{onMutate:async j=>{await e.cancelQueries({queryKey:m});const q=e.getQueryData(["client",t==null?void 0:t.id]);return e.setQueryData(m,P=>{var z,B;return{...P,outstanding:{...P==null?void 0:P.outstanding,questionIds:((B=(z=P==null?void 0:P.outstanding)==null?void 0:z.questionIds)==null?void 0:B.filter(N=>!(j.data.questionResponses??[]).some(F=>F.questionId===N)))??[]},questionResponses:[...j.data.questionResponses??[]]}}),{previousClientData:q}},onError:(j,q,P)=>{e.setQueryData(m,P==null?void 0:P.previousClientData)},onSuccess:j=>{e.setQueryData(m,j),o?r("review-attest-section",{reviewScreenOpenedSectionId:"additional-questions-section"}):(r("overview"),i({mockedVerifyingSectionId:"additional-questions-section"}))}}}),x=j=>{var N,F,_,H,W,$,V,T;const q=`question_${j.id??"undefined"}`,P=((F=(N=j==null?void 0:j.responseSchema)==null?void 0:N.items)==null?void 0:F.type)??"string",z=(H=(_=j==null?void 0:j.responseSchema)==null?void 0:_.items)==null?void 0:H.enum,B=l.jsx("div",{className:"",children:($=(W=j.description)==null?void 0:W.split(`
|
|
7782
|
-
`))==null?void 0:$.map((D,R)=>l.jsx("div",{children:l.jsx(Dt,{asterisk:R===0,className:ye({"eb-ml-4":R>0}),children:D},R)}))});if(j.id&&Toe.includes(j.id))return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsx(zt,{...D,type:"date",onChange:R=>D.onChange([R.target.value])})}),l.jsx(_t,{})]})});if(j.id&&Iqe.includes(j.id))return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>{var R;return l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsxs("div",{className:"eb-relative",children:[l.jsx("span",{className:"eb-absolute eb-left-3 eb-translate-y-2 eb-text-gray-500",children:"$"}),l.jsx(zt,{type:"number",min:0,max:1e10,step:.01,placeholder:"0.00",className:"eb-pl-7",...D,value:(R=D.value)==null?void 0:R[0],onChange:O=>{const K=parseFloat(O.target.value);K>=0&&K<=1e10&&D.onChange([O.target.value])},onBlur:O=>{const K=parseFloat(O.target.value);K<0&&D.onChange(["0"]),K>1e10&&D.onChange(["10000000000"])}})]})}),l.jsx(_t,{})]})}});switch(P){case"boolean":return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>{var R;return l.jsxs(wt,{className:"eb-space-y-3",children:[B,l.jsx(it,{children:l.jsxs(Tp,{onValueChange:O=>D.onChange([O]),defaultValue:(R=D==null?void 0:D.value)==null?void 0:R[0],className:"eb-flex eb-flex-col eb-space-y-1",children:[l.jsxs(wt,{className:"eb-flex eb-items-center eb-space-x-3 eb-space-y-0",children:[l.jsx(it,{children:l.jsx(Rs,{value:"true"})}),l.jsx(Dt,{className:"eb-font-normal",children:"Yes"})]}),l.jsxs(wt,{className:"eb-flex eb-items-center eb-space-x-3 eb-space-y-0",children:[l.jsx(it,{children:l.jsx(Rs,{value:"false"})}),l.jsx(Dt,{className:"eb-font-normal",children:"No"})]})]})}),l.jsx(_t,{})]})}});case"string":return z?(V=j==null?void 0:j.responseSchema)!=null&&V.maxItems&&((T=j==null?void 0:j.responseSchema)==null?void 0:T.maxItems)>0?l.jsx(jt,{control:k.control,name:q,render:()=>l.jsxs(wt,{children:[B,z.map(D=>l.jsx(jt,{control:k.control,name:q,render:({field:R})=>{var O;return l.jsxs(wt,{className:"eb-flex eb-flex-row eb-items-start eb-space-x-3 eb-space-y-0",children:[l.jsx(it,{children:l.jsx(io,{checked:(O=R.value)==null?void 0:O.includes(D),onCheckedChange:K=>{var G;return K?R.onChange([...R.value,D]):R.onChange((G=R.value)==null?void 0:G.filter(Y=>Y!==D))}})}),l.jsx(Dt,{className:"eb-font-normal",children:D})]},D)}},D)),l.jsx(_t,{})]})}):l.jsx(jt,{control:k.control,name:q,render:({field:D})=>{var R;return l.jsxs(wt,{children:[B,l.jsxs(qr,{onValueChange:O=>D.onChange([O]),defaultValue:(R=D==null?void 0:D.value)==null?void 0:R[0],children:[l.jsx(it,{children:l.jsx(Lr,{children:l.jsx(Hr,{placeholder:"Select an option"})})}),l.jsx(Er,{children:z.map(O=>l.jsx(cn,{value:O,children:O},O))})]}),l.jsx(_t,{})]})}}):l.jsx(jt,{control:k.control,name:q,render:({field:D})=>l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsx(zt,{...D,onChange:R=>D.onChange([R.target.value])})}),l.jsx(_t,{})]})});case"integer":return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsx(zt,{type:"number",...D,onChange:R=>D.onChange([R.target.value])})}),l.jsx(_t,{})]})});default:return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsx(zt,{...D,onChange:R=>D.onChange([R.target.value])})}),l.jsx(_t,{})]})})}},w=u.useMemo(()=>{const j=(d==null?void 0:d.questions)??[];return j?Lqe(j):Z.object({})},[d]),k=vi({resolver:po(w),defaultValues:f}),M=j=>{var B,N;if(!j.parentQuestionId)return!0;const q=(B=d==null?void 0:d.questions)==null?void 0:B.find(F=>F.id===j.parentQuestionId);if(!q)return!1;const P=k.watch(`question_${q.id}`);if(!P)return!1;const z=(N=q==null?void 0:q.subQuestions)==null?void 0:N.find(F=>{var _;return(_=F.questionIds)==null?void 0:_.includes(j.id??"")});return typeof(z==null?void 0:z.anyValuesMatch)=="string"?P.includes(z.anyValuesMatch):Array.isArray(z==null?void 0:z.anyValuesMatch)?P.some(F=>{var _;return(_=z.anyValuesMatch)==null?void 0:_.includes(F)}):!1},S=j=>!j.parentQuestionId,I=j=>{if(t!=null&&t.id){const P={questionResponses:Object.entries(j).map(([z,B])=>({questionId:z.replace("question_",""),values:Array.isArray(B)?B:[B]}))};b({id:t.id,data:P})}},L=()=>{var j;return d?(j=d==null?void 0:d.questions)==null?void 0:j.filter(S).filter(M).map((q,P)=>{var z;return l.jsxs(u.Fragment,{children:[P!==0&&l.jsx(Ar,{}),l.jsx("div",{className:"eb-mb-6",children:x(q)}),(z=d==null?void 0:d.questions)==null?void 0:z.filter(B=>B.parentQuestionId===q.id).filter(M).map(B=>l.jsx("div",{className:"eb-mb-6",children:x(B)},B.id))]},q.id)}):l.jsx("div",{className:"eb-text-muted-foreground",children:"There are no additional questions. You may proceed to the next step."})},E=p==="pending"||v==="pending";return p==="pending"?l.jsx(Ws,{message:"Loading questions..."}):l.jsx(gr,{...k,children:l.jsx("form",{onSubmit:k.handleSubmit(I),className:"eb-space-y-6",children:l.jsx(x1,{title:"Operational details",description:"Please answer these additional questions to help us understand your business operations.",children:l.jsxs("div",{className:"eb-mt-6 eb-flex-auto eb-space-y-6",children:[L(),l.jsx(ii,{error:h||g}),l.jsxs(Fe,{type:"submit",size:"lg",className:"eb-w-full eb-text-lg",disabled:E,children:[v==="pending"&&l.jsx(Ln,{className:"eb-animate-spin"}),o?"Save and return to review":"Save and return to overview"]})]})})})})},Aqe=()=>{const{organizationType:e,clientData:t}=ai(),{sections:n,goTo:r,sessionData:i,updateSessionData:o}=Ca(),{sectionStatuses:a,stepValidations:s}=kq(n,i,t),{t:c}=on(["onboarding-overview","common"]),d=i.mockedKycCompleted||(t==null?void 0:t.status)==="APPROVED",p=c(`organizationTypes.${e}`),h=!Ere(t);return l.jsx(x1,{title:l.jsxs("div",{className:"eb-flex eb-items-center eb-justify-between",children:[l.jsx("p",{children:c("screens.overview.title")}),l.jsxs(Fe,{variant:"outline",size:"sm",children:[l.jsx(Uh,{})," ",c("screens.overview.downloadChecklist")]})]}),subTitle:!i.hideOverviewInfoAlert&&(t==null?void 0:t.status)==="NEW"?l.jsxs(en,{variant:"informative",density:"sm",noTitle:!0,children:[l.jsx(fr,{className:"eb-size-4"}),l.jsx(tn,{children:c("screens.overview.infoAlert")}),l.jsxs("button",{type:"button",className:"eb-hover:eb-opacity-100 eb-focus:eb-outline-none eb-focus:eb-ring-2 eb-focus:eb-ring-ring eb-focus:eb-ring-offset-2 eb-disabled:eb-pointer-events-none eb-absolute eb-right-4 eb-top-3 eb-rounded-sm eb-opacity-70 eb-ring-offset-background eb-transition-opacity data-[state=open]:eb-bg-accent data-[state=open]:eb-text-muted-foreground [&&]:eb-pl-0",onClick:()=>{o({hideOverviewInfoAlert:!0})},children:[l.jsx(Mr,{className:"eb-size-4 eb-pl-0 eb-text-foreground"}),l.jsx("span",{className:"eb-sr-only",children:"Close"})]})]}):void 0,description:c("screens.overview.description"),children:l.jsxs("div",{className:"eb-flex-auto eb-space-y-6",children:[l.jsxs(Gt,{className:"eb-mt-6 eb-rounded-md eb-border-none eb-bg-card",children:[l.jsx(mr,{className:"eb-p-3",children:l.jsx(Ir,{children:l.jsx("h2",{className:"eb-font-header eb-text-2xl eb-font-medium",children:c("screens.overview.verifyBusinessSection.title")})})}),l.jsxs(Qn,{className:"eb-p-3 eb-pt-0",children:[(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"&&!h&&l.jsxs(en,{variant:"informative",density:"sm",className:"eb-mb-6",children:[l.jsx(hp,{className:"eb-size-4"}),l.jsx(hr,{children:c("screens.overview.verifyBusinessSection.reviewInProgress.title")}),l.jsxs(tn,{children:[c("screens.overview.verifyBusinessSection.reviewInProgress.description"),l.jsx(Ln,{className:"eb-mt-1.5 eb-size-9 eb-animate-spin eb-stroke-primary"})]})]}),(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"&&h&&l.jsxs(en,{variant:"informative",density:"sm",className:"eb-mb-6",children:[l.jsx(hp,{className:"eb-size-4"}),l.jsx(hr,{children:c("screens.overview.verifyBusinessSection.documentsReceived.title")}),l.jsxs(tn,{children:[c("screens.overview.verifyBusinessSection.documentsReceived.description"),l.jsx(Ln,{className:"eb-mt-1.5 eb-size-9 eb-animate-spin eb-stroke-primary"})]})]}),(t==null?void 0:t.status)==="INFORMATION_REQUESTED"&&l.jsxs(en,{variant:"warning",density:"sm",className:"eb-mb-6",noTitle:!0,children:[l.jsx(Fn,{className:"eb-size-4"}),l.jsx(tn,{children:c("screens.overview.verifyBusinessSection.informationRequested.description")})]}),(t==null?void 0:t.status)==="DECLINED"&&l.jsxs(en,{variant:"destructive",density:"sm",children:[l.jsx(Xn,{className:"eb-size-4"}),l.jsx(hr,{children:c("screens.overview.verifyBusinessSection.declined.title")}),l.jsx(tn,{children:c("screens.overview.verifyBusinessSection.declined.description")})]}),(t==null?void 0:t.status)==="APPROVED"&&l.jsxs(en,{variant:"success",density:"sm",children:[l.jsx(_r,{className:"eb-size-4"}),l.jsx(hr,{children:c("screens.overview.verifyBusinessSection.approved.title")}),l.jsx(tn,{children:c("screens.overview.verifyBusinessSection.approved.description")})]}),l.jsxs("div",{className:"eb-space-y-3",children:[(t==null?void 0:t.status)==="NEW"&&l.jsxs("div",{className:"eb-space-y-3 eb-rounded eb-bg-accent eb-px-4 eb-py-3",children:[l.jsx("p",{className:"eb-text-xs eb-font-semibold eb-tracking-normal eb-text-muted-foreground",children:c("screens.overview.verifyBusinessSection.businessTypeLabel")}),l.jsxs("div",{children:[l.jsxs("span",{id:"business-structure",className:"eb-inline-flex eb-h-10 eb-w-full eb-items-center eb-justify-between eb-gap-2 eb-rounded-input eb-border eb-py-2 eb-pl-3 eb-text-sm",children:[l.jsx("span",{className:"eb-flex eb-text-start eb-font-sans eb-text-sm eb-font-normal eb-normal-case eb-text-foreground",children:p}),l.jsxs(Fe,{variant:"ghost",size:"sm",onClick:()=>r("gateway"),"aria-label":"Edit business type",className:"eb-rounded-input hover:eb-bg-black/5",children:[l.jsx(ro,{}),c("screens.overview.verifyBusinessSection.editBusinessType")]})]}),l.jsxs("p",{className:"eb-mt-3 eb-flex eb-gap-2 eb-text-xs eb-italic eb-text-muted-foreground",children:[l.jsx(Fn,{className:"eb-size-4"}),c("screens.overview.verifyBusinessSection.changeWarning")]})]})]}),n.map(f=>{var x,w,k;const m=a==null?void 0:a[f.id],b=m==="on_hold"||m==="completed_disabled",g=s[f.id]?(w=(x=f.stepperConfig)==null?void 0:x.steps.find(M=>s[f.id][M.id]&&!s[f.id][M.id].isValid))==null?void 0:w.id:void 0,v=wq(t,(k=f.stepperConfig)==null?void 0:k.associatedPartyFilters);return m==="hidden"?null:l.jsxs("div",{children:[m==="on_hold"&&f.sectionConfig.onHoldText&&l.jsxs("p",{className:ye("eb-mb-3 eb-mt-7 eb-flex eb-items-center eb-gap-2 eb-text-sm eb-font-medium",{"eb-text-muted-foreground":b}),children:[l.jsx(gp,{className:"eb-size-4"}),f.sectionConfig.onHoldText]}),l.jsxs(Gt,{className:ye("eb-rounded-md eb-border eb-bg-card eb-p-3",{"eb-border-dashed eb-border-muted-foreground":b}),children:[l.jsxs("div",{className:"eb-flex eb-w-full eb-items-center eb-justify-between",children:[l.jsxs("div",{className:"eb-flex eb-items-center eb-gap-2",children:[l.jsx(f.sectionConfig.icon,{className:ye("eb-size-4",{"eb-text-muted-foreground":b})}),l.jsx("h3",{className:ye("eb-font-header eb-text-lg eb-font-medium",{"eb-text-muted-foreground":b}),children:f.sectionConfig.label})]}),l.jsxs("div",{className:"eb-flex [&_svg]:eb-size-4",children:[(m==="completed"||m==="completed_disabled")&&l.jsxs(l.Fragment,{children:[l.jsx(To,{className:"eb-stroke-success"}),l.jsx("span",{className:"eb-sr-only",children:"Completed"})]}),["not_started","on_hold"].includes(m)&&l.jsxs(l.Fragment,{children:[l.jsx(oa,{className:"eb-stroke-muted-foreground"}),l.jsx("span",{className:"eb-sr-only",children:"Not started"})]}),m==="missing_details"&&l.jsxs(l.Fragment,{children:[l.jsx(Fn,{className:"eb-stroke-warning"}),l.jsx("span",{className:"eb-sr-only",children:"Missing details"})]})]})]}),f.sectionConfig.requirementsList&&l.jsx("ul",{className:"eb-mt-1.5 eb-w-full eb-list-disc eb-whitespace-break-spaces eb-pl-8 eb-text-start eb-font-sans eb-text-sm eb-font-normal",children:f.sectionConfig.requirementsList.map((M,S)=>l.jsx("li",{children:M},S))}),l.jsx("div",{className:"eb-flex eb-justify-end",children:l.jsxs(Fe,{variant:["completed","on_hold"].includes(m)?"secondary":"default",size:"sm",className:ye("eb-mt-3",{"eb-hidden":m==="completed_disabled"}),disabled:b,onClick:()=>{r(f.id,{editingPartyId:v.id,previouslyCompleted:m==="completed",initialStepperStepId:g})},children:[["on_hold","not_started"].includes(m)&&l.jsxs(l.Fragment,{children:[c("common:start"),l.jsx(Ra,{})]}),m==="completed"&&l.jsxs(l.Fragment,{children:[c("common:edit"),l.jsx(ro,{})]}),m==="missing_details"&&l.jsxs(l.Fragment,{children:[c("common:continue"),l.jsx(Ra,{})]})]})})]})]},f.id)})]})]})]}),l.jsxs(Gt,{className:"eb-mt-6 eb-rounded-md eb-border-none eb-bg-card",children:[l.jsx(mr,{className:"eb-p-3",children:l.jsx(Ir,{children:l.jsx("h2",{className:"eb-font-header eb-text-2xl eb-font-medium",children:c("screens.overview.bankAccountSection.title")})})}),l.jsx(Qn,{className:"eb-p-3 eb-pt-0",children:l.jsx("div",{className:"eb-space-y-3",children:l.jsxs("div",{children:[l.jsxs("p",{className:ye("eb-mb-3 eb-flex eb-items-center eb-gap-2 eb-text-sm eb-font-medium",{"eb-text-muted-foreground":!d}),children:[l.jsx(gp,{className:"eb-size-4"}),c("screens.overview.bankAccountSection.lockedMessage")]}),l.jsxs(Gt,{className:ye("eb-rounded-md eb-border eb-bg-card eb-p-3",{"eb-border-dashed eb-border-muted-foreground":!d}),children:[l.jsxs("div",{className:"eb-flex eb-w-full eb-justify-between",children:[l.jsxs("div",{className:"eb-flex eb-items-center eb-gap-2",children:[l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M5.5 4V3H6.5V4H5.5Z",fill:"#4C5157",fillOpacity:"0.4"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 0L12 6H10V11H12V12H0V11L2 11V6H0L6 0ZM3 6V11H4V6H3ZM5 6V11H7V6H5ZM8 6V11H9V6H8ZM6 1.41421L9.58579 5H2.41421L6 1.41421Z",fill:"#4C5157",fillOpacity:d?"1":"0.8"})]}),l.jsx("h3",{className:ye("eb-font-header eb-text-lg eb-font-medium",{"eb-text-muted-foreground":!d}),children:c("screens.overview.bankAccountSection.linkAccountTitle")})]}),l.jsxs("div",{className:"eb-flex [&_svg]:eb-size-4",children:[l.jsx(oa,{className:"eb-stroke-gray-600"}),l.jsx("span",{className:"eb-sr-only",children:"Not started"})]})]}),l.jsx("div",{className:"eb-flex eb-justify-end",children:l.jsxs(Fe,{variant:"secondary",size:"sm",className:"eb-mt-3",disabled:!d,children:[c("common:start"),l.jsx(Ra,{})]})})]})]})})})]})]})})},Dqe=Z.object({controllerEmail:Z.string().email(Q.t("onboarding:fields.organizationEmail.validation.invalid")).max(100,Q.t("onboarding:fields.organizationEmail.validation.maxLength")),controllerPhone:X0,controllerAddresses:Z.array(Q0).refine(e=>{const t=e.map(n=>n.addressType);return new Set(t).size===t.length},Q.t("onboarding:fields.controllerAddresses.validation.uniqueTypes"))}),XP=()=>{const{t:e}=on("onboarding-overview"),t=Jn();return l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsx(we,{control:t.control,name:"controllerEmail",type:"email"}),l.jsx(we,{control:t.control,name:"controllerPhone.phoneNumber",type:"phone"}),l.jsxs("fieldset",{className:"eb-grid eb-gap-3",children:[l.jsx("legend",{className:"eb-mb-3 eb-font-header eb-text-lg eb-font-medium",children:"Personal address"}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.country",type:"combobox",options:Dr.map(n=>({value:n,label:l.jsxs("span",{children:[l.jsxs("span",{className:"eb-font-medium",children:["[",n,"]"]})," ",e([`common:countries.${n}`])]})}))}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.primaryAddressLine",type:"text"}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.additionalAddressLines.0.value",type:"text",description:"Apt, Suite, Unit, Building etc."}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.additionalAddressLines.1.value",type:"text",description:""}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.postalCode",type:"text",className:"eb-max-w-48"}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.city",type:"text"}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.state",type:"combobox",options:Z0})]})]})};XP.schema=Dqe,XP.modifyFormValuesBeforeSubmit=e=>({...e,controllerPhone:{...e.controllerPhone,phoneType:"MOBILE_PHONE"}});const Tqe=18,Nqe=120,Fqe=e=>{const t=e.slice(1,3),n=parseInt(t,10);return n>=50&&n<=65||n>=70&&n<=88||n>=90&&n<=92||n>=94&&n<=99},Pqe=Z.object({description:Z.string().optional(),expiryDate:Z.string().refine(e=>/^\d{4}-\d{2}-\d{2}$/.test(e),{message:Q.t("onboarding-overview:fields.controllerIds.expiryDate.validation.format")}).refine(e=>!Number.isNaN(new Date(e).getTime()),{message:Q.t("onboarding-overview:fields.controllerIds.expiryDate.validation.invalid")}).refine(e=>new Date(e)>new Date,{message:Q.t("onboarding-overview:fields.controllerIds.expiryDate.validation.past")}).refine(e=>{const t=new Date(e),n=new Date,r=new Date(n.setFullYear(n.getFullYear()+10));return t<=r},{message:Q.t("onboarding-overview:fields.controllerIds.expiryDate.validation.tooFar")}).or(Z.literal(void 0)),idType:Z.enum(["SSN","ITIN","NATIONAL_ID","DRIVERS_LICENSE","PASSPORT","SOCIAL_INSURANCE_NUMBER","OTHER_GOVERNMENT_ID"]),issuer:Z.string().length(2,Q.t("onboarding-overview:fields.controllerIds.issuer.validation.exactlyTwoChars")),value:Z.string().min(1,Q.t("onboarding-overview:fields.controllerIds.value.validation.required")).refine(e=>!/\s/.test(e),{message:Q.t("onboarding-overview:fields.controllerIds.value.validation.noSpaces")})}).refine(e=>{switch(e.idType){case"SSN":{const t=parseInt(e.value.slice(0,3),10);return e.value.length===9&&e.value.match(/^[0-8]{1}[0-9]{2}[0-9]{2}[0-9]{4}/)&&t!==666&&t!==0&&!["078051120","219099999","123456789","333333333","111111111","457555462","012345678","987654321"].includes(e.value)}case"ITIN":return e.value.startsWith("9")&&e.value.length===9;default:return!0}},e=>({message:Q.t(`onboarding-overview:fields.controllerIds.value.validation.${e.idType.toLowerCase()}Format`),path:["value"]})).refine(e=>e.idType==="ITIN"&&e.value.startsWith("9")&&e.value.length===9?!Fqe(e.value):!0,()=>({message:Q.t("onboarding-overview:fields.controllerIds.value.validation.itinRestrictedRange"),path:["value"]})),$qe=Z.object({birthDate:Z.string().refine(e=>/^\d{4}-\d{2}-\d{2}$/.test(e),Q.t("onboarding-overview:fields.birthDate.validation.format")).refine(e=>!Number.isNaN(new Date(e).getTime()),Q.t("onboarding-overview:fields.birthDate.validation.invalid")).refine(e=>new Date(e)<=new Date,Q.t("onboarding-overview:fields.birthDate.validation.future")).refine(e=>{const t=new Date(e);return new Date().getFullYear()-t.getFullYear()>=Tqe},Q.t("onboarding-overview:fields.birthDate.validation.tooYoung")).refine(e=>{const t=new Date(e);return new Date().getFullYear()-t.getFullYear()<=Nqe},Q.t("onboarding-overview:fields.birthDate.validation.tooOld")),countryOfResidence:Z.string().length(2,Q.t("onboarding-overview:fields.countryOfResidence.validation.exactlyTwoChars")).refine(e=>e==="US",{message:"Only US is supported at this time."}),controllerIds:Z.array(Pqe).refine(e=>{const t=e.map(n=>n.idType);return new Set(t).size===t.length},Q.t("onboarding-overview:fields.controllerIds.validation.uniqueTypes"))}),eH=()=>{const{t:e}=on(["onboarding-overview","onboarding"]),t=Jn(),n=o=>e(o?[`idValueLabels.${o}`,`onboarding:idValueLabels.${o}`]:["onboarding:idValueLabels.placeholder"]),r=o=>o?e([`idValueDescriptions.${o}`]):"",i=t.watch("controllerIds.0.idType");return u.useEffect(()=>{t.watch("controllerIds.0.issuer")!=="US"&&t.setValue("controllerIds.0.issuer","US")},[t.watch("controllerIds.0.issuer")]),u.useEffect(()=>{t.clearErrors("controllerIds.0.value")},[i]),l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsx(we,{control:t.control,name:"birthDate",type:"importantDate",labelClassName:"eb-mb-1 eb-font-header eb-text-lg eb-font-medium"}),l.jsx(we,{control:t.control,name:"countryOfResidence",type:"combobox",options:Dr.map(o=>({value:o,label:l.jsxs("span",{children:[l.jsxs("span",{className:"eb-font-medium",children:["[",o,"]"]})," ",e([`common:countries.${o}`])]})}))}),t.watch("countryOfResidence")==="US"&&l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx(we,{control:t.control,name:"controllerIds.0.value",type:"text",maskFormat:"### - ## - ####",maskChar:"_",label:n(i),description:r(i)},i),l.jsxs(Moe,{children:[l.jsx(Ioe,{asChild:!0,children:l.jsxs(Fe,{variant:"ghost",type:"button",size:"sm",className:"",children:["Use a different ID type",l.jsx(no,{})]})}),l.jsx(Xq,{className:"eb-component",children:["SSN","ITIN"].map(o=>l.jsx(Qq,{disabled:t.watch("controllerIds.0.idType")===o,onClick:()=>{t.setValue("controllerIds.0.idType",o),t.setValue("controllerIds.0.value","")},children:l.jsx("div",{className:"eb-flex eb-items-center eb-gap-2",children:n(o)})},o))})]})]})]})};eH.schema=$qe;const tH=/^[a-zA-Z0-9()_\\/@&+%#;,.: '-]*$/,Oqe=/^[A-Za-z.IVX]*$/,jqe=Z.object({controllerFirstName:Z.string().min(2,Q.t("onboarding:fields.controllerFirstName.validation.minLength")).max(30,Q.t("onboarding:fields.controllerFirstName.validation.maxLength")).refine(e=>tH.test(e),Q.t("onboarding:fields.controllerFirstName.validation.pattern")).refine(e=>!/\s\s/.test(e),Q.t("onboarding:fields.controllerName.validation.noConsecutiveSpaces")).refine(e=>!/-{2,}/.test(e),Q.t("onboarding:fields.controllerName.validation.noConsecutiveHyphens")),controllerMiddleName:Z.string().max(30,Q.t("onboarding:fields.controllerMiddleName.validation.maxLength")).refine(e=>tH.test(e),Q.t("onboarding:fields.controllerMiddleName.validation.pattern")),controllerLastName:Z.string().min(2,Q.t("onboarding:fields.controllerLastName.validation.minLength")).max(30,Q.t("onboarding:fields.controllerLastName.validation.maxLength")).refine(e=>tH.test(e),Q.t("onboarding:fields.controllerLastName.validation.pattern")).refine(e=>!/\s\s/.test(e),Q.t("onboarding:fields.controllerName.validation.noConsecutiveSpaces")).refine(e=>!/-{2,}/.test(e),Q.t("onboarding:fields.controllerName.validation.noConsecutiveHyphens")),controllerNameSuffix:Z.string().min(1,Q.t("onboarding:fields.controllerNameSuffix.validation.minLength")).max(5,Q.t("onboarding:fields.controllerNameSuffix.validation.maxLength")).refine(e=>Oqe.test(e),Q.t("onboarding:fields.controllerNameSuffix.validation.pattern")),controllerJobTitle:Z.union([Z.enum(["CEO","CFO","COO","President","Chairman","Senior Branch Manager","Other"]),Z.literal("")]).refine(e=>e!=="",{message:Q.t("common:validation.required")}),controllerJobTitleDescription:Z.string().max(50,Q.t("onboarding:fields.controllerJobTitleDescription.validation.maxLength")).refine(e=>/^[a-zA-Z0-9\s,.&-]+$/.test(e),Q.t("onboarding:fields.controllerJobTitleDescription.validation.pattern")).refine(e=>!/(<[^>]*>)/.test(e),Q.t("onboarding:fields.controllerJobTitleDescription.validation.noHtml")).refine(e=>!/https?:\/\/[^\s]+/.test(e),Q.t("onboarding:fields.controllerJobTitleDescription.validation.noUrls"))}),zqe=e=>e.superRefine((t,n)=>{t.controllerJobTitle==="Other"&&!t.controllerJobTitleDescription&&n.addIssue({code:Z.ZodIssueCode.custom,message:Q.t("onboarding:fields.controllerJobTitleDescription.validation.required"),path:["controllerJobTitleDescription"]})}),If=()=>{const e=Jn(),t=e.watch("controllerJobTitle");return l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsxs("fieldset",{className:"eb-grid eb-gap-y-3",children:[l.jsx("legend",{className:"eb-mb-1.5 eb-text-lg eb-font-medium",children:"Legal name"}),l.jsx("p",{className:"eb-text-sm",children:"Your full name as recorded with government agencies"}),l.jsx(we,{control:e.control,name:"controllerFirstName",type:"text"}),l.jsx(we,{control:e.control,name:"controllerMiddleName",type:"text"}),l.jsx(we,{control:e.control,name:"controllerLastName",type:"text"}),l.jsx(we,{control:e.control,name:"controllerNameSuffix",type:"text",className:"eb-max-w-48"})]}),l.jsxs("div",{className:"eb-space-y-6",children:[l.jsx(we,{control:e.control,name:"controllerJobTitle",type:"combobox",options:[{value:"CEO",label:"CEO"},{value:"CFO",label:"CFO"},{value:"COO",label:"COO"},{value:"President",label:"President"},{value:"Chairman",label:"Chairman"},{value:"Senior Branch Manager",label:"Senior Branch Manager"},{value:"Other",label:"Other"}]}),t==="Other"&&l.jsx(we,{control:e.control,name:"controllerJobTitleDescription",type:"text",required:!0})]})]})};If.schema=jqe,If.refineSchemaFn=zqe,If.modifyFormValuesBeforeSubmit=(e,t)=>{var r;return e.controllerJobTitle!=="Other"&&delete e.controllerJobTitleDescription,{...e,countryOfResidence:((r=t==null?void 0:t.individualDetails)==null?void 0:r.countryOfResidence)??"US"}};const Lf=[{id:"personal-details",stepType:"form",title:"Personal details",description:"We collect personal information to verify individuals for security and compliance.",Component:If},{id:"identity-document",stepType:"form",title:"Identity document",description:"We need some additional details to verify individuals for security and compliance.",Component:eH},{id:"contact-details",stepType:"form",title:"Contact details",description:"We need some additional details to confirm your identity.",Component:XP},{id:"check-answers",stepType:"check-answers",title:"Check your answers",description:"Please ensure your answers are accurate and complete anything you may have missed."}],_qe=()=>{var P,z,B;const{clientData:e,onPostPartySettled:t,organizationType:n}=ai(),{t:r}=on(["onboarding","onboarding-overview","common"]),i=mi(),o=(P=e==null?void 0:e.parties)==null?void 0:P.find(N=>{var F;return(N==null?void 0:N.partyType)==="INDIVIDUAL"&&((F=N==null?void 0:N.roles)==null?void 0:F.includes("CONTROLLER"))&&N.active}),{originScreenId:a,goTo:s,sections:c,sessionData:d,updateSessionData:p}=Ca(),{sectionStatuses:h}=kq(c,d,e),f=a==="review-attest-section",m=vi({defaultValues:{controllerIsAnOwner:o?(z=o.roles)!=null&&z.includes("BENEFICIAL_OWNER")?"yes":d.isControllerOwnerQuestionAnswered?"no":void 0:void 0}}),{mutate:b,error:g,status:v}=ba();u.useEffect(()=>{const N=(F,_)=>{b({partyId:F,data:{roles:_}},{onSettled:(H,W)=>{var $;t==null||t(H,($=W==null?void 0:W.response)==null?void 0:$.data)},onSuccess:H=>{e&&(i.setQueryData($o(e.id),W=>{var $;return{...W,parties:($=W==null?void 0:W.parties)==null?void 0:$.map(V=>V.id===H.id?{...V,...H,roles:_}:V)}}),i.invalidateQueries({queryKey:$o(e.id)}))},onError:H=>{var W,$,V,T,D;m.setValue("controllerIsAnOwner",(W=o==null?void 0:o.roles)!=null&&W.includes("BENEFICIAL_OWNER")?"yes":"no"),m.setError("controllerIsAnOwner",{type:"server",message:(D=(T=(V=($=H==null?void 0:H.response)==null?void 0:$.data)==null?void 0:V.context)==null?void 0:T[0])==null?void 0:D.message})}})};m.watch("controllerIsAnOwner")==="yes"&&(o!=null&&o.id)&&(o!=null&&o.roles)&&!o.roles.includes("BENEFICIAL_OWNER")?N(o.id,[...o.roles,"BENEFICIAL_OWNER"]):m.watch("controllerIsAnOwner")==="no"&&(o!=null&&o.id)&&(o!=null&&o.roles)&&o.roles.includes("BENEFICIAL_OWNER")&&N(o.id,[...o.roles.filter(F=>F!=="BENEFICIAL_OWNER")]),d.isControllerOwnerQuestionAnswered||p({isControllerOwnerQuestionAnswered:!0})},[m.watch("controllerIsAnOwner")]);const{mutate:x,error:w,status:k}=ba(),M=((B=e==null?void 0:e.parties)==null?void 0:B.filter(N=>{var F;return(N==null?void 0:N.partyType)==="INDIVIDUAL"&&((F=N==null?void 0:N.roles)==null?void 0:F.includes("BENEFICIAL_OWNER"))}))||[],S=M.filter(N=>N.active||N.status==="ACTIVE"),I=Are(Lf,S,e),L=N=>{var F;if(N){const _=I[N]?(F=Lf.find(H=>I[N].stepValidationMap[H.id]&&!I[N].stepValidationMap[H.id].isValid))==null?void 0:F.id:void 0;s("owner-stepper",{editingPartyId:N,previouslyCompleted:I[N].allStepsValid,shortLabelOverride:"Edit owner",initialStepperStepId:_})}else s("owner-stepper",{shortLabelOverride:"Add owner"})},E=N=>{x({partyId:N,data:{active:!1}},{onSuccess:F=>{if(e){const _=$o(e.id);i.setQueryData(_,H=>{var W;return{...H,parties:(W=H==null?void 0:H.parties)==null?void 0:W.map($=>$.id===F.id?{...$,...F}:$)}}),j(!1),i.invalidateQueries({queryKey:_})}}})},[A,j]=u.useState(!1),q=v==="pending"||k==="pending";return l.jsxs(x1,{title:"Owners and key roles",description:"Provide information for owners and senior managers for your company. Keep in mind that individual people may have multiple roles.",children:[l.jsxs("div",{className:"eb-mt-6 eb-flex-auto eb-space-y-6",children:[l.jsxs(en,{variant:"informative",children:[l.jsx(fr,{className:"eb-h-4 eb-w-4"}),l.jsxs(tn,{className:"eb-flex eb-flex-col",children:[l.jsxs("p",{className:"eb-mb-2 eb-text-sm eb-font-semibold",children:["For a"," ",n&&r(`onboarding-overview:organizationTypes.${n}`)]}),l.jsxs("div",{className:"eb-flex eb-items-center eb-space-x-2",children:[l.jsx("span",{className:"eb-text-lg eb-font-bold",children:"Owners"}),l.jsx(Gee,{content:l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx("h2",{className:"eb-font-header eb-text-xl eb-font-medium",children:"What is an owner?"}),l.jsx("p",{className:"eb-pb-1 eb-text-sm",children:"An owner is an individual or entity that ultimately owns at least part of a business, established through a chain of ownership or by means of control other than direct control."})]}),children:l.jsx(Fe,{variant:"ghost",size:"icon",children:l.jsx(fr,{className:"eb-size-6 eb-stroke-primary"})})})]}),l.jsxs("p",{children:["Please add ",l.jsx("span",{className:"eb-font-semibold",children:"all owners"})," ","holding 25% or more of the business"]})]})]}),l.jsx(gr,{...m,children:l.jsxs("form",{children:[l.jsx(we,{control:m.control,disableFieldRuleMapping:!0,disabled:q||o===void 0||S.length>=4&&m.watch("controllerIsAnOwner")==="no",type:"radio-group",name:"controllerIsAnOwner",label:r("beneficialOwnerStepForm.controllerIsOwnerQuestion"),description:"",tooltip:"",options:[{value:"yes",label:r("common:yes")},{value:"no",label:r("common:no")}],noOptionalLabel:!0}),h["personal-section"]!=="completed"&&l.jsxs("div",{className:"eb-mt-2 eb-flex eb-items-center",children:[l.jsxs("p",{className:"eb-flex eb-h-8 eb-items-center eb-text-sm eb-font-normal eb-text-orange-500",children:["ⓘ"," Please complete the personal details first."]}),l.jsxs(Fe,{variant:"link",size:"sm",className:"eb-h-8",onClick:()=>{s("personal-section",{editingPartyId:o==null?void 0:o.id})},children:["Go now",l.jsx(up,{})]})]}),S.length>=4&&m.watch("controllerIsAnOwner")==="no"&&v!=="pending"&&l.jsxs("p",{className:"eb-mt-1 eb-text-sm eb-font-normal eb-text-blue-500",children:["ⓘ"," ",r("beneficialOwnerStepForm.controllerCannotBeOwnerWarning")]}),l.jsx("div",{className:"eb-mt-2 eb-inline-flex eb-h-4 eb-items-center eb-justify-center eb-gap-2 eb-text-sm eb-text-muted-foreground",children:v==="pending"&&l.jsxs(l.Fragment,{children:[l.jsx(Ln,{className:"eb-pointer-events-none eb-size-4 eb-shrink-0 eb-animate-spin"}),l.jsx("span",{children:r("beneficialOwnerStepForm.makingChanges")})]})})]})}),l.jsxs("div",{className:"eb-space-y-4",children:[l.jsxs(Fe,{type:"button",variant:"secondary",size:"lg",className:"eb-w-full eb-text-lg",onClick:()=>L(""),disabled:q||S.length>=4,children:[l.jsx(As,{})," Add Owner"]}),M.length>=4&&l.jsxs("p",{className:"eb-mt-1 eb-text-sm eb-font-normal eb-text-orange-500",children:["ⓘ"," ",r("beneficialOwnerStepForm.maxOwnersWarning")]}),S.length===0&&l.jsx(Gt,{className:"eb-mt-6 eb-p-4 eb-shadow-md",children:l.jsxs("div",{className:"eb-flex eb-flex-col eb-items-center eb-space-y-3",children:[l.jsx("div",{className:"eb-flex eb-h-8 eb-w-8 eb-items-center eb-justify-center eb-rounded-full eb-bg-primary eb-stroke-white",children:l.jsx(xp,{className:"eb-size-4 eb-fill-white eb-stroke-white"})}),l.jsx("p",{className:"eb-text-sm",children:"No stakeholders added yet."})]})}),S.map(N=>{var F,_,H,W,$;return l.jsxs(Gt,{className:"eb-space-y-4 eb-rounded-lg eb-border eb-p-4",children:[l.jsxs("div",{className:"eb-space-y-1",children:[l.jsx(Ir,{className:"eb-text-xl eb-font-bold eb-tracking-tight",children:bf(N)}),l.jsx("p",{className:"eb-text-sm eb-font-medium",children:((F=N.individualDetails)==null?void 0:F.jobTitle)==="Other"?`${r("jobTitles.Other")} - ${N.individualDetails.jobTitleDescription}`:r([`jobTitles.${(_=N.individualDetails)==null?void 0:_.jobTitle}`])}),l.jsxs("div",{className:"eb-flex eb-gap-2 eb-pt-2",children:[l.jsx(wn,{variant:"outline",className:"eb-border-transparent eb-bg-[#EDF4FF] eb-text-[#355FA1]",children:"Owner"}),((H=N.roles)==null?void 0:H.includes("CONTROLLER"))&&l.jsx(wn,{variant:"outline",className:"eb-border-transparent eb-bg-[#FFEBD9] eb-text-[#8F521F]",children:"Controller"})]})]}),l.jsxs("div",{className:"eb-flex eb-gap-2 eb-pt-4",children:[!((W=N.roles)!=null&&W.includes("CONTROLLER"))&&l.jsxs(Dhe,{open:A,onOpenChange:j,children:[l.jsx(The,{asChild:!0,children:l.jsxs(Fe,{variant:"ghost",size:"sm",children:[l.jsx(qd,{}),"Remove"]})}),l.jsxs(BG,{className:"eb-component",children:[l.jsxs(VG,{children:[l.jsx(GG,{children:"Remove Owner?"}),l.jsxs(WG,{children:["Are you sure you want to remove"," ",l.jsx("b",{children:bf(N)})," as an owner?"]})]}),l.jsxs(UG,{children:[l.jsx(YG,{children:"Cancel"}),l.jsxs(KG,{onClick:()=>N.id&&E(N.id),children:[k==="pending"&&l.jsx(Ln,{className:"eb-size-4 eb-animate-spin"}),"Remove"]})]})]})]}),l.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>N.id&&L(N.id),children:[l.jsx(ro,{}),"Edit"]})]}),N.id&&!(($=I[N.id])!=null&&$.allStepsValid)&&l.jsxs("p",{className:"eb-mt-1 eb-text-sm eb-font-normal eb-text-orange-500",children:["ⓘ"," This individual is missing some details."]})]},N.id)})]})]}),l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsx(ii,{error:g||w}),l.jsx("div",{className:"eb-flex eb-justify-between eb-gap-4",children:l.jsx(Fe,{type:"button",variant:"default",size:"lg",className:"eb-w-full eb-text-lg",onClick:()=>{m.getValues("controllerIsAnOwner")!==void 0&&p({isOwnersSectionDone:!0,mockedVerifyingSectionId:"owners-section"}),f?s("review-attest-section",{reviewScreenOpenedSectionId:"owners-section"}):s("overview")},disabled:q,children:f?"Save and return to review":"Save and return to overview"})})]})]})},Rqe=({handlePrev:e,handleNext:t,getPrevButtonLabel:n,getNextButtonLabel:r})=>{var L,E;const{clientData:i}=ai(),{t:o}=on(["onboarding","common"]),{sections:a,goTo:s,sessionData:c,reviewScreenOpenedSectionId:d}=Ca(),p=vi({defaultValues:{attested:!1},resolver:po(Z.object({attested:Z.boolean().refine(A=>A===!0,{message:"You must attest that the data is true, accurate, and complete."})}))}),{sectionStatuses:h}=kq(a,c,i),f=((L=i==null?void 0:i.outstanding)==null?void 0:L.questionIds)??[],m=(i==null?void 0:i.questionResponses)??[],b=u.useMemo(()=>{const A=m.map(j=>j.questionId??"undefined");return[...new Set([...f,...A])]},[f,m]),{data:g}=Up({questionIds:b.join(",")}),v=A=>{var z,B,N;if(!A.parentQuestionId)return!0;const j=(z=g==null?void 0:g.questions)==null?void 0:z.find(F=>F.id===A.parentQuestionId);if(!j)return!1;const q=(B=m.find(F=>F.questionId===j.id))==null?void 0:B.values;if(!q)return!1;const P=(N=j==null?void 0:j.subQuestions)==null?void 0:N.find(F=>{var _;return(_=F.questionIds)==null?void 0:_.includes(A.id??"")});return typeof(P==null?void 0:P.anyValuesMatch)=="string"?q.includes(P.anyValuesMatch):Array.isArray(P==null?void 0:P.anyValuesMatch)?q.some(F=>{var _;return(_=P.anyValuesMatch)==null?void 0:_.includes(F)}):!1},x=((E=i==null?void 0:i.parties)==null?void 0:E.filter(A=>{var j;return(A==null?void 0:A.partyType)==="INDIVIDUAL"&&((j=A==null?void 0:A.roles)==null?void 0:j.includes("BENEFICIAL_OWNER"))&&A.active}))||[],w=Are(Lf,x,i),k=["personal-section","business-section","owners-section","additional-questions-section"],M=k.some(A=>h[A]!=="completed"),[S,I]=u.useState(!1);return l.jsx(gr,{...p,children:l.jsxs("form",{onSubmit:A=>{A.preventDefault(),M?I(!0):p.handleSubmit(()=>{t()})(A)},className:"eb-flex eb-flex-auto eb-flex-col",children:[l.jsxs("div",{className:"eb-mt-6 eb-flex-auto eb-space-y-6",children:[l.jsxs(en,{variant:"informative",noTitle:!0,children:[l.jsx(fr,{className:"eb-h-4 eb-w-4"}),l.jsx(tn,{children:"Your application is not submitted yet. Review your data and continue to finish."})]}),M&&S&&l.jsxs(en,{variant:"warning",children:[l.jsx(Fn,{className:"eb-h-4 eb-w-4"}),l.jsx(hr,{children:"There is a problem"}),l.jsx(tn,{children:"Please provide missing details before finishing your application."})]}),l.jsx("div",{children:l.jsx(V0,{type:"single",collapsible:!0,className:"eb-w-full",defaultValue:d??void 0,children:a.filter(A=>k.includes(A.id)).map(A=>{var P,z,B;let j=null;const q=h[A.id]==="completed";if(A.type==="stepper"&&A.id!=="review-attest-section"){const N=(P=A.stepperConfig)==null?void 0:P.associatedPartyFilters,F=N?(z=i==null?void 0:i.parties)==null?void 0:z.find(_=>{var H;return(_==null?void 0:_.partyType)===N.partyType&&((H=N.roles)==null?void 0:H.every(W=>{var $;return($=_==null?void 0:_.roles)==null?void 0:$.includes(W)}))&&_.active}):void 0;j=l.jsx(Dre,{steps:A.stepperConfig.steps,partyData:F,onEditClick:_=>{s(A.id,{initialStepperStepId:_,editingPartyId:F==null?void 0:F.id})}})}else if(A.id==="owners-section"){const N=()=>{s("owners-section")};j=l.jsxs(Gt,{className:"eb-mt-6 eb-p-4",children:[l.jsxs("div",{className:"eb-flex eb-items-start eb-justify-between",children:[l.jsx("h2",{className:"eb-text-xl eb-font-bold eb-tracking-tight",children:"Owners"}),q?l.jsxs(Fe,{variant:"ghost",type:"button",size:"sm",className:"eb-h-8 eb-p-2 eb-text-sm",onClick:N,children:[l.jsx(ro,{}),"Change"]}):l.jsxs(Fe,{variant:"default",type:"button",size:"sm",className:"eb-bg-warning eb-text-sm hover:eb-bg-warning/90",onClick:N,children:[l.jsx(ro,{}),"Add"]})]}),l.jsxs("div",{className:"eb-mt-4 eb-space-y-4",children:[x.length===0&&l.jsx(Gt,{className:"eb-mt-6 eb-p-4 eb-shadow-md",children:l.jsxs("div",{className:"eb-flex eb-flex-col eb-items-center eb-space-y-3",children:[l.jsx("div",{className:"eb-flex eb-h-8 eb-w-8 eb-items-center eb-justify-center eb-rounded-full eb-bg-primary eb-stroke-white",children:l.jsx(xp,{className:"eb-size-4 eb-fill-white eb-stroke-white"})}),l.jsx("p",{className:"eb-text-sm",children:"No stakeholders added yet."})]})}),x.map(F=>{var _,H,W;return l.jsxs(Gt,{className:"eb-space-y-4 eb-rounded-lg eb-border eb-p-4",children:[l.jsxs("div",{className:"eb-space-y-1",children:[l.jsx(Ir,{className:"eb-text-xl eb-font-bold eb-tracking-tight",children:bf(F)}),l.jsx("p",{className:"eb-text-sm eb-font-medium",children:((_=F.individualDetails)==null?void 0:_.jobTitle)==="Other"?`${o("jobTitles.Other")} - ${F.individualDetails.jobTitleDescription}`:o([`jobTitles.${(H=F.individualDetails)==null?void 0:H.jobTitle}`])}),l.jsxs("div",{className:"eb-flex eb-gap-2 eb-pt-2",children:[l.jsx(wn,{variant:"outline",className:"eb-border-transparent eb-bg-[#EDF4FF] eb-text-[#355FA1]",children:"Owner"}),((W=F.roles)==null?void 0:W.includes("CONTROLLER"))&&l.jsx(wn,{variant:"outline",className:"eb-border-transparent eb-bg-[#FFEBD9] eb-text-[#8F521F]",children:"Controller"})]})]}),F.id&&!w[F.id].allStepsValid&&l.jsxs("p",{className:"eb-mt-1 eb-text-sm eb-font-normal eb-text-orange-500",children:["ⓘ"," This individual is missing some details."]})]},F.id)})]})]})}else A.id==="additional-questions-section"&&(j=l.jsxs(Gt,{className:"eb-mt-6 eb-space-y-3 eb-rounded-lg eb-border eb-p-4",children:[l.jsxs("div",{className:"eb-flex eb-items-start eb-justify-between",children:[l.jsx("h2",{className:"eb-text-xl eb-font-bold eb-tracking-tight",children:"Operational details"}),l.jsxs(Fe,{variant:"ghost",type:"button",size:"sm",className:"eb-h-8 eb-p-2 eb-text-sm",onClick:()=>{s("additional-questions-section")},children:[l.jsx(ro,{}),"Change"]})]}),(B=g==null?void 0:g.questions)==null?void 0:B.map(N=>{var H,W;if(!v(N))return null;const F=(H=N.description)==null?void 0:H.split(`
|
|
7782
|
+
`))==null?void 0:$.map((D,R)=>l.jsx("div",{children:l.jsx(Dt,{asterisk:R===0,className:ye({"eb-ml-4":R>0}),children:D},R)}))});if(j.id&&Toe.includes(j.id))return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsx(zt,{...D,type:"date",onChange:R=>D.onChange([R.target.value])})}),l.jsx(_t,{})]})});if(j.id&&Iqe.includes(j.id))return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>{var R;return l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsxs("div",{className:"eb-relative",children:[l.jsx("span",{className:"eb-absolute eb-left-3 eb-translate-y-2 eb-text-gray-500",children:"$"}),l.jsx(zt,{type:"number",min:0,max:1e10,step:.01,placeholder:"0.00",className:"eb-pl-7",...D,value:(R=D.value)==null?void 0:R[0],onChange:O=>{const K=parseFloat(O.target.value);K>=0&&K<=1e10&&D.onChange([O.target.value])},onBlur:O=>{const K=parseFloat(O.target.value);K<0&&D.onChange(["0"]),K>1e10&&D.onChange(["10000000000"])}})]})}),l.jsx(_t,{})]})}});switch(P){case"boolean":return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>{var R;return l.jsxs(wt,{className:"eb-space-y-3",children:[B,l.jsx(it,{children:l.jsxs(Tp,{onValueChange:O=>D.onChange([O]),defaultValue:(R=D==null?void 0:D.value)==null?void 0:R[0],className:"eb-flex eb-flex-col eb-space-y-1",children:[l.jsxs(wt,{className:"eb-flex eb-items-center eb-space-x-3 eb-space-y-0",children:[l.jsx(it,{children:l.jsx(Rs,{value:"true"})}),l.jsx(Dt,{className:"eb-font-normal",children:"Yes"})]}),l.jsxs(wt,{className:"eb-flex eb-items-center eb-space-x-3 eb-space-y-0",children:[l.jsx(it,{children:l.jsx(Rs,{value:"false"})}),l.jsx(Dt,{className:"eb-font-normal",children:"No"})]})]})}),l.jsx(_t,{})]})}});case"string":return z?(V=j==null?void 0:j.responseSchema)!=null&&V.maxItems&&((T=j==null?void 0:j.responseSchema)==null?void 0:T.maxItems)>0?l.jsx(jt,{control:k.control,name:q,render:()=>l.jsxs(wt,{children:[B,z.map(D=>l.jsx(jt,{control:k.control,name:q,render:({field:R})=>{var O;return l.jsxs(wt,{className:"eb-flex eb-flex-row eb-items-start eb-space-x-3 eb-space-y-0",children:[l.jsx(it,{children:l.jsx(io,{checked:(O=R.value)==null?void 0:O.includes(D),onCheckedChange:K=>{var G;return K?R.onChange([...R.value,D]):R.onChange((G=R.value)==null?void 0:G.filter(Y=>Y!==D))}})}),l.jsx(Dt,{className:"eb-font-normal",children:D})]},D)}},D)),l.jsx(_t,{})]})}):l.jsx(jt,{control:k.control,name:q,render:({field:D})=>{var R;return l.jsxs(wt,{children:[B,l.jsxs(qr,{onValueChange:O=>D.onChange([O]),defaultValue:(R=D==null?void 0:D.value)==null?void 0:R[0],children:[l.jsx(it,{children:l.jsx(Lr,{children:l.jsx(Hr,{placeholder:"Select an option"})})}),l.jsx(Er,{children:z.map(O=>l.jsx(cn,{value:O,children:O},O))})]}),l.jsx(_t,{})]})}}):l.jsx(jt,{control:k.control,name:q,render:({field:D})=>l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsx(zt,{...D,onChange:R=>D.onChange([R.target.value])})}),l.jsx(_t,{})]})});case"integer":return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsx(zt,{type:"number",...D,onChange:R=>D.onChange([R.target.value])})}),l.jsx(_t,{})]})});default:return l.jsx(jt,{control:k.control,name:q,render:({field:D})=>l.jsxs(wt,{children:[B,l.jsx(it,{children:l.jsx(zt,{...D,onChange:R=>D.onChange([R.target.value])})}),l.jsx(_t,{})]})})}},w=u.useMemo(()=>{const j=(d==null?void 0:d.questions)??[];return j?Lqe(j):Z.object({})},[d]),k=vi({resolver:po(w),defaultValues:f}),M=j=>{var B,N;if(!j.parentQuestionId)return!0;const q=(B=d==null?void 0:d.questions)==null?void 0:B.find(F=>F.id===j.parentQuestionId);if(!q)return!1;const P=k.watch(`question_${q.id}`);if(!P)return!1;const z=(N=q==null?void 0:q.subQuestions)==null?void 0:N.find(F=>{var _;return(_=F.questionIds)==null?void 0:_.includes(j.id??"")});return typeof(z==null?void 0:z.anyValuesMatch)=="string"?P.includes(z.anyValuesMatch):Array.isArray(z==null?void 0:z.anyValuesMatch)?P.some(F=>{var _;return(_=z.anyValuesMatch)==null?void 0:_.includes(F)}):!1},S=j=>!j.parentQuestionId,I=j=>{if(t!=null&&t.id){const P={questionResponses:Object.entries(j).map(([z,B])=>({questionId:z.replace("question_",""),values:Array.isArray(B)?B:[B]}))};b({id:t.id,data:P})}},L=()=>{var j;return d?(j=d==null?void 0:d.questions)==null?void 0:j.filter(S).filter(M).map((q,P)=>{var z;return l.jsxs(u.Fragment,{children:[P!==0&&l.jsx(Ar,{}),l.jsx("div",{className:"eb-mb-6",children:x(q)}),(z=d==null?void 0:d.questions)==null?void 0:z.filter(B=>B.parentQuestionId===q.id).filter(M).map(B=>l.jsx("div",{className:"eb-mb-6",children:x(B)},B.id))]},q.id)}):l.jsx("div",{className:"eb-text-muted-foreground",children:"There are no additional questions. You may proceed to the next step."})},E=p==="pending"||v==="pending";return p==="pending"?l.jsx(Ws,{message:"Loading questions..."}):l.jsx(gr,{...k,children:l.jsx("form",{onSubmit:k.handleSubmit(I),className:"eb-space-y-6",children:l.jsx(x1,{title:"Operational details",description:"Please answer these additional questions to help us understand your business operations.",children:l.jsxs("div",{className:"eb-mt-6 eb-flex-auto eb-space-y-6",children:[L(),l.jsx(ii,{error:h||g}),l.jsxs(Fe,{type:"submit",size:"lg",className:"eb-w-full eb-text-lg",disabled:E,children:[v==="pending"&&l.jsx(Ln,{className:"eb-animate-spin"}),o?"Save and return to review":"Save and return to overview"]})]})})})})},Aqe=()=>{const{organizationType:e,clientData:t}=ai(),{sections:n,goTo:r,sessionData:i,updateSessionData:o}=Ca(),{sectionStatuses:a,stepValidations:s}=kq(n,i,t),{t:c}=on(["onboarding-overview","common"]),d=i.mockedKycCompleted||(t==null?void 0:t.status)==="APPROVED",p=c(`organizationTypes.${e}`),h=!Ere(t);return l.jsx(x1,{title:l.jsxs("div",{className:"eb-flex eb-items-center eb-justify-between",children:[l.jsx("p",{children:c("screens.overview.title")}),l.jsxs(Fe,{variant:"outline",size:"sm",children:[l.jsx(Uh,{})," ",c("screens.overview.downloadChecklist")]})]}),subTitle:!i.hideOverviewInfoAlert&&(t==null?void 0:t.status)==="NEW"?l.jsxs(en,{variant:"informative",density:"sm",noTitle:!0,children:[l.jsx(fr,{className:"eb-size-4"}),l.jsx(tn,{children:c("screens.overview.infoAlert")}),l.jsxs("button",{type:"button",className:"eb-hover:eb-opacity-100 eb-focus:eb-outline-none eb-focus:eb-ring-2 eb-focus:eb-ring-ring eb-focus:eb-ring-offset-2 eb-disabled:eb-pointer-events-none eb-absolute eb-right-4 eb-top-3 eb-rounded-sm eb-opacity-70 eb-ring-offset-background eb-transition-opacity data-[state=open]:eb-bg-accent data-[state=open]:eb-text-muted-foreground [&&]:eb-pl-0",onClick:()=>{o({hideOverviewInfoAlert:!0})},children:[l.jsx(Mr,{className:"eb-size-4 eb-pl-0 eb-text-foreground"}),l.jsx("span",{className:"eb-sr-only",children:"Close"})]})]}):void 0,description:c("screens.overview.description"),children:l.jsxs("div",{className:"eb-flex-auto eb-space-y-6",children:[l.jsxs(Gt,{className:"eb-mt-6 eb-rounded-md eb-border-none eb-bg-card",children:[l.jsx(mr,{className:"eb-p-3",children:l.jsx(Ir,{children:l.jsx("h2",{className:"eb-font-header eb-text-2xl eb-font-medium",children:c("screens.overview.verifyBusinessSection.title")})})}),l.jsxs(Qn,{className:"eb-p-3 eb-pt-0",children:[(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"&&!h&&l.jsxs(en,{variant:"informative",density:"sm",className:"eb-mb-6",children:[l.jsx(hp,{className:"eb-size-4"}),l.jsx(hr,{children:c("screens.overview.verifyBusinessSection.reviewInProgress.title")}),l.jsxs(tn,{children:[c("screens.overview.verifyBusinessSection.reviewInProgress.description"),l.jsx(Ln,{className:"eb-mt-1.5 eb-size-9 eb-animate-spin eb-stroke-primary"})]})]}),(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"&&h&&l.jsxs(en,{variant:"informative",density:"sm",className:"eb-mb-6",children:[l.jsx(hp,{className:"eb-size-4"}),l.jsx(hr,{children:c("screens.overview.verifyBusinessSection.documentsReceived.title")}),l.jsxs(tn,{children:[c("screens.overview.verifyBusinessSection.documentsReceived.description"),l.jsx(Ln,{className:"eb-mt-1.5 eb-size-9 eb-animate-spin eb-stroke-primary"})]})]}),(t==null?void 0:t.status)==="INFORMATION_REQUESTED"&&l.jsxs(en,{variant:"warning",density:"sm",className:"eb-mb-6",noTitle:!0,children:[l.jsx(Fn,{className:"eb-size-4"}),l.jsx(tn,{children:c("screens.overview.verifyBusinessSection.informationRequested.description")})]}),(t==null?void 0:t.status)==="DECLINED"&&l.jsxs(en,{variant:"destructive",density:"sm",children:[l.jsx(Xn,{className:"eb-size-4"}),l.jsx(hr,{children:c("screens.overview.verifyBusinessSection.declined.title")}),l.jsx(tn,{children:c("screens.overview.verifyBusinessSection.declined.description")})]}),(t==null?void 0:t.status)==="APPROVED"&&l.jsxs(en,{variant:"success",density:"sm",children:[l.jsx(_r,{className:"eb-size-4"}),l.jsx(hr,{children:c("screens.overview.verifyBusinessSection.approved.title")}),l.jsx(tn,{children:c("screens.overview.verifyBusinessSection.approved.description")})]}),l.jsxs("div",{className:"eb-space-y-3",children:[(t==null?void 0:t.status)==="NEW"&&l.jsxs("div",{className:"eb-space-y-3 eb-rounded eb-bg-accent eb-px-4 eb-py-3",children:[l.jsx("p",{className:"eb-text-xs eb-font-semibold eb-tracking-normal eb-text-muted-foreground",children:c("screens.overview.verifyBusinessSection.businessTypeLabel")}),l.jsxs("div",{children:[l.jsxs("span",{id:"business-structure",className:"eb-inline-flex eb-h-10 eb-w-full eb-items-center eb-justify-between eb-gap-2 eb-rounded-input eb-border eb-py-2 eb-pl-3 eb-text-sm",children:[l.jsx("span",{className:"eb-flex eb-text-start eb-font-sans eb-text-sm eb-font-normal eb-normal-case eb-text-foreground",children:p}),l.jsxs(Fe,{variant:"ghost",size:"sm",onClick:()=>r("gateway"),"aria-label":"Edit business type",className:"eb-rounded-input hover:eb-bg-black/5",children:[l.jsx(ro,{}),c("screens.overview.verifyBusinessSection.editBusinessType")]})]}),l.jsxs("p",{className:"eb-mt-3 eb-flex eb-gap-2 eb-text-xs eb-italic eb-text-muted-foreground",children:[l.jsx(Fn,{className:"eb-size-4"}),c("screens.overview.verifyBusinessSection.changeWarning")]})]})]}),n.map(f=>{var x,w,k;const m=a==null?void 0:a[f.id],b=m==="on_hold"||m==="completed_disabled",g=s[f.id]?(w=(x=f.stepperConfig)==null?void 0:x.steps.find(M=>s[f.id][M.id]&&!s[f.id][M.id].isValid))==null?void 0:w.id:void 0,v=wq(t,(k=f.stepperConfig)==null?void 0:k.associatedPartyFilters);return m==="hidden"?null:l.jsxs("div",{children:[m==="on_hold"&&f.sectionConfig.onHoldText&&l.jsxs("p",{className:ye("eb-mb-3 eb-mt-7 eb-flex eb-items-center eb-gap-2 eb-text-sm eb-font-medium",{"eb-text-muted-foreground":b}),children:[l.jsx(gp,{className:"eb-size-4"}),f.sectionConfig.onHoldText]}),l.jsxs(Gt,{className:ye("eb-rounded-md eb-border eb-bg-card eb-p-3",{"eb-border-dashed eb-border-muted-foreground":b}),children:[l.jsxs("div",{className:"eb-flex eb-w-full eb-items-center eb-justify-between",children:[l.jsxs("div",{className:"eb-flex eb-items-center eb-gap-2",children:[l.jsx(f.sectionConfig.icon,{className:ye("eb-size-4",{"eb-text-muted-foreground":b})}),l.jsx("h3",{className:ye("eb-font-header eb-text-lg eb-font-medium",{"eb-text-muted-foreground":b}),children:f.sectionConfig.label})]}),l.jsxs("div",{className:"eb-flex [&_svg]:eb-size-4",children:[(m==="completed"||m==="completed_disabled")&&l.jsxs(l.Fragment,{children:[l.jsx(To,{className:"eb-stroke-success"}),l.jsx("span",{className:"eb-sr-only",children:"Completed"})]}),["not_started","on_hold"].includes(m)&&l.jsxs(l.Fragment,{children:[l.jsx(oa,{className:"eb-stroke-muted-foreground"}),l.jsx("span",{className:"eb-sr-only",children:"Not started"})]}),m==="missing_details"&&l.jsxs(l.Fragment,{children:[l.jsx(Fn,{className:"eb-stroke-warning"}),l.jsx("span",{className:"eb-sr-only",children:"Missing details"})]})]})]}),f.sectionConfig.requirementsList&&l.jsx("ul",{className:"eb-mt-1.5 eb-w-full eb-list-disc eb-whitespace-break-spaces eb-pl-8 eb-text-start eb-font-sans eb-text-sm eb-font-normal",children:f.sectionConfig.requirementsList.map((M,S)=>l.jsx("li",{children:M},S))}),l.jsx("div",{className:"eb-flex eb-justify-end",children:l.jsxs(Fe,{variant:["completed","on_hold"].includes(m)?"secondary":"default",size:"sm",className:ye("eb-mt-3",{"eb-hidden":m==="completed_disabled"}),disabled:b,onClick:()=>{r(f.id,{editingPartyId:v.id,previouslyCompleted:m==="completed",initialStepperStepId:g})},children:[["on_hold","not_started"].includes(m)&&l.jsxs(l.Fragment,{children:[c("common:start"),l.jsx(Ra,{})]}),m==="completed"&&l.jsxs(l.Fragment,{children:[c("common:edit"),l.jsx(ro,{})]}),m==="missing_details"&&l.jsxs(l.Fragment,{children:[c("common:continue"),l.jsx(Ra,{})]})]})})]})]},f.id)})]})]})]}),l.jsxs(Gt,{className:"eb-mt-6 eb-rounded-md eb-border-none eb-bg-card",children:[l.jsx(mr,{className:"eb-p-3",children:l.jsx(Ir,{children:l.jsx("h2",{className:"eb-font-header eb-text-2xl eb-font-medium",children:c("screens.overview.bankAccountSection.title")})})}),l.jsx(Qn,{className:"eb-p-3 eb-pt-0",children:l.jsx("div",{className:"eb-space-y-3",children:l.jsxs("div",{children:[l.jsxs("p",{className:ye("eb-mb-3 eb-flex eb-items-center eb-gap-2 eb-text-sm eb-font-medium",{"eb-text-muted-foreground":!d}),children:[l.jsx(gp,{className:"eb-size-4"}),c("screens.overview.bankAccountSection.lockedMessage")]}),l.jsxs(Gt,{className:ye("eb-rounded-md eb-border eb-bg-card eb-p-3",{"eb-border-dashed eb-border-muted-foreground":!d}),children:[l.jsxs("div",{className:"eb-flex eb-w-full eb-justify-between",children:[l.jsxs("div",{className:"eb-flex eb-items-center eb-gap-2",children:[l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M5.5 4V3H6.5V4H5.5Z",fill:"#4C5157",fillOpacity:"0.4"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 0L12 6H10V11H12V12H0V11L2 11V6H0L6 0ZM3 6V11H4V6H3ZM5 6V11H7V6H5ZM8 6V11H9V6H8ZM6 1.41421L9.58579 5H2.41421L6 1.41421Z",fill:"#4C5157",fillOpacity:d?"1":"0.8"})]}),l.jsx("h3",{className:ye("eb-font-header eb-text-lg eb-font-medium",{"eb-text-muted-foreground":!d}),children:c("screens.overview.bankAccountSection.linkAccountTitle")})]}),l.jsxs("div",{className:"eb-flex [&_svg]:eb-size-4",children:[l.jsx(oa,{className:"eb-stroke-gray-600"}),l.jsx("span",{className:"eb-sr-only",children:"Not started"})]})]}),l.jsx("div",{className:"eb-flex eb-justify-end",children:l.jsxs(Fe,{variant:"secondary",size:"sm",className:"eb-mt-3",disabled:!d,children:[c("common:start"),l.jsx(Ra,{})]})})]})]})})})]})]})})},Dqe=Z.object({controllerEmail:Z.string().email(Q.t("onboarding:fields.organizationEmail.validation.invalid")).max(100,Q.t("onboarding:fields.organizationEmail.validation.maxLength")),controllerPhone:X0,controllerAddresses:Z.array(Q0).refine(e=>{const t=e.map(n=>n.addressType);return new Set(t).size===t.length},Q.t("onboarding:fields.controllerAddresses.validation.uniqueTypes"))}),XP=()=>{const{t:e}=on("onboarding-overview"),t=Jn();return l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsx(we,{control:t.control,name:"controllerEmail",type:"email"}),l.jsx(we,{control:t.control,name:"controllerPhone.phoneNumber",type:"phone"}),l.jsxs("fieldset",{className:"eb-grid eb-gap-3",children:[l.jsx("legend",{className:"eb-mb-3 eb-font-header eb-text-lg eb-font-medium",children:"Personal address"}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.country",type:"combobox",options:Dr.map(n=>({value:n,label:l.jsxs("span",{children:[l.jsxs("span",{className:"eb-font-medium",children:["[",n,"]"]})," ",e([`common:countries.${n}`])]})}))}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.primaryAddressLine",type:"text"}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.additionalAddressLines.0.value",type:"text",description:"Apt, Suite, Unit, Building etc."}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.additionalAddressLines.1.value",type:"text",description:""}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.postalCode",type:"text",className:"eb-max-w-48"}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.city",type:"text"}),l.jsx(we,{control:t.control,name:"controllerAddresses.0.state",type:"combobox",options:Z0})]})]})};XP.schema=Dqe,XP.modifyFormValuesBeforeSubmit=e=>({...e,controllerPhone:{...e.controllerPhone,phoneType:"MOBILE_PHONE"}});const Tqe=18,Nqe=120,Fqe=e=>{const t=e.slice(1,3),n=parseInt(t,10);return n>=50&&n<=65||n>=70&&n<=88||n>=90&&n<=92||n>=94&&n<=99},Pqe=Z.object({description:Z.string().optional(),expiryDate:Z.string().refine(e=>/^\d{4}-\d{2}-\d{2}$/.test(e),{message:Q.t("onboarding-overview:fields.controllerIds.expiryDate.validation.format")}).refine(e=>!Number.isNaN(new Date(e).getTime()),{message:Q.t("onboarding-overview:fields.controllerIds.expiryDate.validation.invalid")}).refine(e=>new Date(e)>new Date,{message:Q.t("onboarding-overview:fields.controllerIds.expiryDate.validation.past")}).refine(e=>{const t=new Date(e),n=new Date,r=new Date(n.setFullYear(n.getFullYear()+10));return t<=r},{message:Q.t("onboarding-overview:fields.controllerIds.expiryDate.validation.tooFar")}).or(Z.literal(void 0)),idType:Z.enum(["SSN","ITIN","NATIONAL_ID","DRIVERS_LICENSE","PASSPORT","SOCIAL_INSURANCE_NUMBER","OTHER_GOVERNMENT_ID"]),issuer:Z.string().length(2,Q.t("onboarding-overview:fields.controllerIds.issuer.validation.exactlyTwoChars")),value:Z.string().min(1,Q.t("onboarding-overview:fields.controllerIds.value.validation.required")).refine(e=>!/\s/.test(e),{message:Q.t("onboarding-overview:fields.controllerIds.value.validation.noSpaces")})}).refine(e=>{switch(e.idType){case"SSN":{const t=parseInt(e.value.slice(0,3),10);return e.value.length===9&&e.value.match(/^[0-8]{1}[0-9]{2}[0-9]{2}[0-9]{4}/)&&t!==666&&t!==0&&!["078051120","219099999","123456789","777777777","333333333","222222222","111111111","457555462","012345678","987654321"].includes(e.value)}case"ITIN":return e.value.startsWith("9")&&e.value.length===9;default:return!0}},e=>({message:Q.t(`onboarding-overview:fields.controllerIds.value.validation.${e.idType.toLowerCase()}Format`),path:["value"]})).refine(e=>e.idType==="ITIN"&&e.value.startsWith("9")&&e.value.length===9?!Fqe(e.value):!0,()=>({message:Q.t("onboarding-overview:fields.controllerIds.value.validation.itinRestrictedRange"),path:["value"]})),$qe=Z.object({birthDate:Z.string().refine(e=>/^\d{4}-\d{2}-\d{2}$/.test(e),Q.t("onboarding-overview:fields.birthDate.validation.format")).refine(e=>!Number.isNaN(new Date(e).getTime()),Q.t("onboarding-overview:fields.birthDate.validation.invalid")).refine(e=>new Date(e)<=new Date,Q.t("onboarding-overview:fields.birthDate.validation.future")).refine(e=>{const t=new Date(e);return new Date().getFullYear()-t.getFullYear()>=Tqe},Q.t("onboarding-overview:fields.birthDate.validation.tooYoung")).refine(e=>{const t=new Date(e);return new Date().getFullYear()-t.getFullYear()<=Nqe},Q.t("onboarding-overview:fields.birthDate.validation.tooOld")),countryOfResidence:Z.string().length(2,Q.t("onboarding-overview:fields.countryOfResidence.validation.exactlyTwoChars")).refine(e=>e==="US",{message:"Only US is supported at this time."}),controllerIds:Z.array(Pqe).refine(e=>{const t=e.map(n=>n.idType);return new Set(t).size===t.length},Q.t("onboarding-overview:fields.controllerIds.validation.uniqueTypes"))}),eH=()=>{const{t:e}=on(["onboarding-overview","onboarding"]),t=Jn(),n=o=>e(o?[`idValueLabels.${o}`,`onboarding:idValueLabels.${o}`]:["onboarding:idValueLabels.placeholder"]),r=o=>o?e([`idValueDescriptions.${o}`]):"",i=t.watch("controllerIds.0.idType");return u.useEffect(()=>{t.watch("controllerIds.0.issuer")!=="US"&&t.setValue("controllerIds.0.issuer","US")},[t.watch("controllerIds.0.issuer")]),u.useEffect(()=>{t.clearErrors("controllerIds.0.value")},[i]),l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsx(we,{control:t.control,name:"birthDate",type:"importantDate",labelClassName:"eb-mb-1 eb-font-header eb-text-lg eb-font-medium"}),l.jsx(we,{control:t.control,name:"countryOfResidence",type:"combobox",options:Dr.map(o=>({value:o,label:l.jsxs("span",{children:[l.jsxs("span",{className:"eb-font-medium",children:["[",o,"]"]})," ",e([`common:countries.${o}`])]})}))}),t.watch("countryOfResidence")==="US"&&l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx(we,{control:t.control,name:"controllerIds.0.value",type:"text",maskFormat:"### - ## - ####",maskChar:"_",label:n(i),description:r(i)},i),l.jsxs(Moe,{children:[l.jsx(Ioe,{asChild:!0,children:l.jsxs(Fe,{variant:"ghost",type:"button",size:"sm",className:"",children:["Use a different ID type",l.jsx(no,{})]})}),l.jsx(Xq,{className:"eb-component",children:["SSN","ITIN"].map(o=>l.jsx(Qq,{disabled:t.watch("controllerIds.0.idType")===o,onClick:()=>{t.setValue("controllerIds.0.idType",o),t.setValue("controllerIds.0.value","")},children:l.jsx("div",{className:"eb-flex eb-items-center eb-gap-2",children:n(o)})},o))})]})]})]})};eH.schema=$qe;const tH=/^[a-zA-Z0-9()_\\/@&+%#;,.: '-]*$/,Oqe=/^[A-Za-z.IVX]*$/,jqe=Z.object({controllerFirstName:Z.string().min(2,Q.t("onboarding:fields.controllerFirstName.validation.minLength")).max(30,Q.t("onboarding:fields.controllerFirstName.validation.maxLength")).refine(e=>tH.test(e),Q.t("onboarding:fields.controllerFirstName.validation.pattern")).refine(e=>!/\s\s/.test(e),Q.t("onboarding:fields.controllerName.validation.noConsecutiveSpaces")).refine(e=>!/-{2,}/.test(e),Q.t("onboarding:fields.controllerName.validation.noConsecutiveHyphens")),controllerMiddleName:Z.string().max(30,Q.t("onboarding:fields.controllerMiddleName.validation.maxLength")).refine(e=>tH.test(e),Q.t("onboarding:fields.controllerMiddleName.validation.pattern")),controllerLastName:Z.string().min(2,Q.t("onboarding:fields.controllerLastName.validation.minLength")).max(30,Q.t("onboarding:fields.controllerLastName.validation.maxLength")).refine(e=>tH.test(e),Q.t("onboarding:fields.controllerLastName.validation.pattern")).refine(e=>!/\s\s/.test(e),Q.t("onboarding:fields.controllerName.validation.noConsecutiveSpaces")).refine(e=>!/-{2,}/.test(e),Q.t("onboarding:fields.controllerName.validation.noConsecutiveHyphens")),controllerNameSuffix:Z.string().min(1,Q.t("onboarding:fields.controllerNameSuffix.validation.minLength")).max(5,Q.t("onboarding:fields.controllerNameSuffix.validation.maxLength")).refine(e=>Oqe.test(e),Q.t("onboarding:fields.controllerNameSuffix.validation.pattern")),controllerJobTitle:Z.union([Z.enum(["CEO","CFO","COO","President","Chairman","Senior Branch Manager","Other"]),Z.literal("")]).refine(e=>e!=="",{message:Q.t("common:validation.required")}),controllerJobTitleDescription:Z.string().max(50,Q.t("onboarding:fields.controllerJobTitleDescription.validation.maxLength")).refine(e=>/^[a-zA-Z0-9\s,.&-]+$/.test(e),Q.t("onboarding:fields.controllerJobTitleDescription.validation.pattern")).refine(e=>!/(<[^>]*>)/.test(e),Q.t("onboarding:fields.controllerJobTitleDescription.validation.noHtml")).refine(e=>!/https?:\/\/[^\s]+/.test(e),Q.t("onboarding:fields.controllerJobTitleDescription.validation.noUrls"))}),zqe=e=>e.superRefine((t,n)=>{t.controllerJobTitle==="Other"&&!t.controllerJobTitleDescription&&n.addIssue({code:Z.ZodIssueCode.custom,message:Q.t("onboarding:fields.controllerJobTitleDescription.validation.required"),path:["controllerJobTitleDescription"]})}),If=()=>{const e=Jn(),t=e.watch("controllerJobTitle");return l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsxs("fieldset",{className:"eb-grid eb-gap-y-3",children:[l.jsx("legend",{className:"eb-mb-1.5 eb-text-lg eb-font-medium",children:"Legal name"}),l.jsx("p",{className:"eb-text-sm",children:"Your full name as recorded with government agencies"}),l.jsx(we,{control:e.control,name:"controllerFirstName",type:"text"}),l.jsx(we,{control:e.control,name:"controllerMiddleName",type:"text"}),l.jsx(we,{control:e.control,name:"controllerLastName",type:"text"}),l.jsx(we,{control:e.control,name:"controllerNameSuffix",type:"text",className:"eb-max-w-48"})]}),l.jsxs("div",{className:"eb-space-y-6",children:[l.jsx(we,{control:e.control,name:"controllerJobTitle",type:"combobox",options:[{value:"CEO",label:"CEO"},{value:"CFO",label:"CFO"},{value:"COO",label:"COO"},{value:"President",label:"President"},{value:"Chairman",label:"Chairman"},{value:"Senior Branch Manager",label:"Senior Branch Manager"},{value:"Other",label:"Other"}]}),t==="Other"&&l.jsx(we,{control:e.control,name:"controllerJobTitleDescription",type:"text",required:!0})]})]})};If.schema=jqe,If.refineSchemaFn=zqe,If.modifyFormValuesBeforeSubmit=(e,t)=>{var r;return e.controllerJobTitle!=="Other"&&delete e.controllerJobTitleDescription,{...e,countryOfResidence:((r=t==null?void 0:t.individualDetails)==null?void 0:r.countryOfResidence)??"US"}};const Lf=[{id:"personal-details",stepType:"form",title:"Personal details",description:"We collect personal information to verify individuals for security and compliance.",Component:If},{id:"identity-document",stepType:"form",title:"Identity document",description:"We need some additional details to verify individuals for security and compliance.",Component:eH},{id:"contact-details",stepType:"form",title:"Contact details",description:"We need some additional details to confirm your identity.",Component:XP},{id:"check-answers",stepType:"check-answers",title:"Check your answers",description:"Please ensure your answers are accurate and complete anything you may have missed."}],_qe=()=>{var P,z,B;const{clientData:e,onPostPartySettled:t,organizationType:n}=ai(),{t:r}=on(["onboarding","onboarding-overview","common"]),i=mi(),o=(P=e==null?void 0:e.parties)==null?void 0:P.find(N=>{var F;return(N==null?void 0:N.partyType)==="INDIVIDUAL"&&((F=N==null?void 0:N.roles)==null?void 0:F.includes("CONTROLLER"))&&N.active}),{originScreenId:a,goTo:s,sections:c,sessionData:d,updateSessionData:p}=Ca(),{sectionStatuses:h}=kq(c,d,e),f=a==="review-attest-section",m=vi({defaultValues:{controllerIsAnOwner:o?(z=o.roles)!=null&&z.includes("BENEFICIAL_OWNER")?"yes":d.isControllerOwnerQuestionAnswered?"no":void 0:void 0}}),{mutate:b,error:g,status:v}=ba();u.useEffect(()=>{const N=(F,_)=>{b({partyId:F,data:{roles:_}},{onSettled:(H,W)=>{var $;t==null||t(H,($=W==null?void 0:W.response)==null?void 0:$.data)},onSuccess:H=>{e&&(i.setQueryData($o(e.id),W=>{var $;return{...W,parties:($=W==null?void 0:W.parties)==null?void 0:$.map(V=>V.id===H.id?{...V,...H,roles:_}:V)}}),i.invalidateQueries({queryKey:$o(e.id)}))},onError:H=>{var W,$,V,T,D;m.setValue("controllerIsAnOwner",(W=o==null?void 0:o.roles)!=null&&W.includes("BENEFICIAL_OWNER")?"yes":"no"),m.setError("controllerIsAnOwner",{type:"server",message:(D=(T=(V=($=H==null?void 0:H.response)==null?void 0:$.data)==null?void 0:V.context)==null?void 0:T[0])==null?void 0:D.message})}})};m.watch("controllerIsAnOwner")==="yes"&&(o!=null&&o.id)&&(o!=null&&o.roles)&&!o.roles.includes("BENEFICIAL_OWNER")?N(o.id,[...o.roles,"BENEFICIAL_OWNER"]):m.watch("controllerIsAnOwner")==="no"&&(o!=null&&o.id)&&(o!=null&&o.roles)&&o.roles.includes("BENEFICIAL_OWNER")&&N(o.id,[...o.roles.filter(F=>F!=="BENEFICIAL_OWNER")]),d.isControllerOwnerQuestionAnswered||p({isControllerOwnerQuestionAnswered:!0})},[m.watch("controllerIsAnOwner")]);const{mutate:x,error:w,status:k}=ba(),M=((B=e==null?void 0:e.parties)==null?void 0:B.filter(N=>{var F;return(N==null?void 0:N.partyType)==="INDIVIDUAL"&&((F=N==null?void 0:N.roles)==null?void 0:F.includes("BENEFICIAL_OWNER"))}))||[],S=M.filter(N=>N.active||N.status==="ACTIVE"),I=Are(Lf,S,e),L=N=>{var F;if(N){const _=I[N]?(F=Lf.find(H=>I[N].stepValidationMap[H.id]&&!I[N].stepValidationMap[H.id].isValid))==null?void 0:F.id:void 0;s("owner-stepper",{editingPartyId:N,previouslyCompleted:I[N].allStepsValid,shortLabelOverride:"Edit owner",initialStepperStepId:_})}else s("owner-stepper",{shortLabelOverride:"Add owner"})},E=N=>{x({partyId:N,data:{active:!1}},{onSuccess:F=>{if(e){const _=$o(e.id);i.setQueryData(_,H=>{var W;return{...H,parties:(W=H==null?void 0:H.parties)==null?void 0:W.map($=>$.id===F.id?{...$,...F}:$)}}),j(!1),i.invalidateQueries({queryKey:_})}}})},[A,j]=u.useState(!1),q=v==="pending"||k==="pending";return l.jsxs(x1,{title:"Owners and key roles",description:"Provide information for owners and senior managers for your company. Keep in mind that individual people may have multiple roles.",children:[l.jsxs("div",{className:"eb-mt-6 eb-flex-auto eb-space-y-6",children:[l.jsxs(en,{variant:"informative",children:[l.jsx(fr,{className:"eb-h-4 eb-w-4"}),l.jsxs(tn,{className:"eb-flex eb-flex-col",children:[l.jsxs("p",{className:"eb-mb-2 eb-text-sm eb-font-semibold",children:["For a"," ",n&&r(`onboarding-overview:organizationTypes.${n}`)]}),l.jsxs("div",{className:"eb-flex eb-items-center eb-space-x-2",children:[l.jsx("span",{className:"eb-text-lg eb-font-bold",children:"Owners"}),l.jsx(Gee,{content:l.jsxs("div",{className:"eb-space-y-3",children:[l.jsx("h2",{className:"eb-font-header eb-text-xl eb-font-medium",children:"What is an owner?"}),l.jsx("p",{className:"eb-pb-1 eb-text-sm",children:"An owner is an individual or entity that ultimately owns at least part of a business, established through a chain of ownership or by means of control other than direct control."})]}),children:l.jsx(Fe,{variant:"ghost",size:"icon",children:l.jsx(fr,{className:"eb-size-6 eb-stroke-primary"})})})]}),l.jsxs("p",{children:["Please add ",l.jsx("span",{className:"eb-font-semibold",children:"all owners"})," ","holding 25% or more of the business"]})]})]}),l.jsx(gr,{...m,children:l.jsxs("form",{children:[l.jsx(we,{control:m.control,disableFieldRuleMapping:!0,disabled:q||o===void 0||S.length>=4&&m.watch("controllerIsAnOwner")==="no",type:"radio-group",name:"controllerIsAnOwner",label:r("beneficialOwnerStepForm.controllerIsOwnerQuestion"),description:"",tooltip:"",options:[{value:"yes",label:r("common:yes")},{value:"no",label:r("common:no")}],noOptionalLabel:!0}),h["personal-section"]!=="completed"&&l.jsxs("div",{className:"eb-mt-2 eb-flex eb-items-center",children:[l.jsxs("p",{className:"eb-flex eb-h-8 eb-items-center eb-text-sm eb-font-normal eb-text-orange-500",children:["ⓘ"," Please complete the personal details first."]}),l.jsxs(Fe,{variant:"link",size:"sm",className:"eb-h-8",onClick:()=>{s("personal-section",{editingPartyId:o==null?void 0:o.id})},children:["Go now",l.jsx(up,{})]})]}),S.length>=4&&m.watch("controllerIsAnOwner")==="no"&&v!=="pending"&&l.jsxs("p",{className:"eb-mt-1 eb-text-sm eb-font-normal eb-text-blue-500",children:["ⓘ"," ",r("beneficialOwnerStepForm.controllerCannotBeOwnerWarning")]}),l.jsx("div",{className:"eb-mt-2 eb-inline-flex eb-h-4 eb-items-center eb-justify-center eb-gap-2 eb-text-sm eb-text-muted-foreground",children:v==="pending"&&l.jsxs(l.Fragment,{children:[l.jsx(Ln,{className:"eb-pointer-events-none eb-size-4 eb-shrink-0 eb-animate-spin"}),l.jsx("span",{children:r("beneficialOwnerStepForm.makingChanges")})]})})]})}),l.jsxs("div",{className:"eb-space-y-4",children:[l.jsxs(Fe,{type:"button",variant:"secondary",size:"lg",className:"eb-w-full eb-text-lg",onClick:()=>L(""),disabled:q||S.length>=4,children:[l.jsx(As,{})," Add Owner"]}),M.length>=4&&l.jsxs("p",{className:"eb-mt-1 eb-text-sm eb-font-normal eb-text-orange-500",children:["ⓘ"," ",r("beneficialOwnerStepForm.maxOwnersWarning")]}),S.length===0&&l.jsx(Gt,{className:"eb-mt-6 eb-p-4 eb-shadow-md",children:l.jsxs("div",{className:"eb-flex eb-flex-col eb-items-center eb-space-y-3",children:[l.jsx("div",{className:"eb-flex eb-h-8 eb-w-8 eb-items-center eb-justify-center eb-rounded-full eb-bg-primary eb-stroke-white",children:l.jsx(xp,{className:"eb-size-4 eb-fill-white eb-stroke-white"})}),l.jsx("p",{className:"eb-text-sm",children:"No stakeholders added yet."})]})}),S.map(N=>{var F,_,H,W,$;return l.jsxs(Gt,{className:"eb-space-y-4 eb-rounded-lg eb-border eb-p-4",children:[l.jsxs("div",{className:"eb-space-y-1",children:[l.jsx(Ir,{className:"eb-text-xl eb-font-bold eb-tracking-tight",children:bf(N)}),l.jsx("p",{className:"eb-text-sm eb-font-medium",children:((F=N.individualDetails)==null?void 0:F.jobTitle)==="Other"?`${r("jobTitles.Other")} - ${N.individualDetails.jobTitleDescription}`:r([`jobTitles.${(_=N.individualDetails)==null?void 0:_.jobTitle}`])}),l.jsxs("div",{className:"eb-flex eb-gap-2 eb-pt-2",children:[l.jsx(wn,{variant:"outline",className:"eb-border-transparent eb-bg-[#EDF4FF] eb-text-[#355FA1]",children:"Owner"}),((H=N.roles)==null?void 0:H.includes("CONTROLLER"))&&l.jsx(wn,{variant:"outline",className:"eb-border-transparent eb-bg-[#FFEBD9] eb-text-[#8F521F]",children:"Controller"})]})]}),l.jsxs("div",{className:"eb-flex eb-gap-2 eb-pt-4",children:[!((W=N.roles)!=null&&W.includes("CONTROLLER"))&&l.jsxs(Dhe,{open:A,onOpenChange:j,children:[l.jsx(The,{asChild:!0,children:l.jsxs(Fe,{variant:"ghost",size:"sm",children:[l.jsx(qd,{}),"Remove"]})}),l.jsxs(BG,{className:"eb-component",children:[l.jsxs(VG,{children:[l.jsx(GG,{children:"Remove Owner?"}),l.jsxs(WG,{children:["Are you sure you want to remove"," ",l.jsx("b",{children:bf(N)})," as an owner?"]})]}),l.jsxs(UG,{children:[l.jsx(YG,{children:"Cancel"}),l.jsxs(KG,{onClick:()=>N.id&&E(N.id),children:[k==="pending"&&l.jsx(Ln,{className:"eb-size-4 eb-animate-spin"}),"Remove"]})]})]})]}),l.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>N.id&&L(N.id),children:[l.jsx(ro,{}),"Edit"]})]}),N.id&&!(($=I[N.id])!=null&&$.allStepsValid)&&l.jsxs("p",{className:"eb-mt-1 eb-text-sm eb-font-normal eb-text-orange-500",children:["ⓘ"," This individual is missing some details."]})]},N.id)})]})]}),l.jsxs("div",{className:"eb-mt-6 eb-space-y-6",children:[l.jsx(ii,{error:g||w}),l.jsx("div",{className:"eb-flex eb-justify-between eb-gap-4",children:l.jsx(Fe,{type:"button",variant:"default",size:"lg",className:"eb-w-full eb-text-lg",onClick:()=>{m.getValues("controllerIsAnOwner")!==void 0&&p({isOwnersSectionDone:!0,mockedVerifyingSectionId:"owners-section"}),f?s("review-attest-section",{reviewScreenOpenedSectionId:"owners-section"}):s("overview")},disabled:q,children:f?"Save and return to review":"Save and return to overview"})})]})]})},Rqe=({handlePrev:e,handleNext:t,getPrevButtonLabel:n,getNextButtonLabel:r})=>{var L,E;const{clientData:i}=ai(),{t:o}=on(["onboarding","common"]),{sections:a,goTo:s,sessionData:c,reviewScreenOpenedSectionId:d}=Ca(),p=vi({defaultValues:{attested:!1},resolver:po(Z.object({attested:Z.boolean().refine(A=>A===!0,{message:"You must attest that the data is true, accurate, and complete."})}))}),{sectionStatuses:h}=kq(a,c,i),f=((L=i==null?void 0:i.outstanding)==null?void 0:L.questionIds)??[],m=(i==null?void 0:i.questionResponses)??[],b=u.useMemo(()=>{const A=m.map(j=>j.questionId??"undefined");return[...new Set([...f,...A])]},[f,m]),{data:g}=Up({questionIds:b.join(",")}),v=A=>{var z,B,N;if(!A.parentQuestionId)return!0;const j=(z=g==null?void 0:g.questions)==null?void 0:z.find(F=>F.id===A.parentQuestionId);if(!j)return!1;const q=(B=m.find(F=>F.questionId===j.id))==null?void 0:B.values;if(!q)return!1;const P=(N=j==null?void 0:j.subQuestions)==null?void 0:N.find(F=>{var _;return(_=F.questionIds)==null?void 0:_.includes(A.id??"")});return typeof(P==null?void 0:P.anyValuesMatch)=="string"?q.includes(P.anyValuesMatch):Array.isArray(P==null?void 0:P.anyValuesMatch)?q.some(F=>{var _;return(_=P.anyValuesMatch)==null?void 0:_.includes(F)}):!1},x=((E=i==null?void 0:i.parties)==null?void 0:E.filter(A=>{var j;return(A==null?void 0:A.partyType)==="INDIVIDUAL"&&((j=A==null?void 0:A.roles)==null?void 0:j.includes("BENEFICIAL_OWNER"))&&A.active}))||[],w=Are(Lf,x,i),k=["personal-section","business-section","owners-section","additional-questions-section"],M=k.some(A=>h[A]!=="completed"),[S,I]=u.useState(!1);return l.jsx(gr,{...p,children:l.jsxs("form",{onSubmit:A=>{A.preventDefault(),M?I(!0):p.handleSubmit(()=>{t()})(A)},className:"eb-flex eb-flex-auto eb-flex-col",children:[l.jsxs("div",{className:"eb-mt-6 eb-flex-auto eb-space-y-6",children:[l.jsxs(en,{variant:"informative",noTitle:!0,children:[l.jsx(fr,{className:"eb-h-4 eb-w-4"}),l.jsx(tn,{children:"Your application is not submitted yet. Review your data and continue to finish."})]}),M&&S&&l.jsxs(en,{variant:"warning",children:[l.jsx(Fn,{className:"eb-h-4 eb-w-4"}),l.jsx(hr,{children:"There is a problem"}),l.jsx(tn,{children:"Please provide missing details before finishing your application."})]}),l.jsx("div",{children:l.jsx(V0,{type:"single",collapsible:!0,className:"eb-w-full",defaultValue:d??void 0,children:a.filter(A=>k.includes(A.id)).map(A=>{var P,z,B;let j=null;const q=h[A.id]==="completed";if(A.type==="stepper"&&A.id!=="review-attest-section"){const N=(P=A.stepperConfig)==null?void 0:P.associatedPartyFilters,F=N?(z=i==null?void 0:i.parties)==null?void 0:z.find(_=>{var H;return(_==null?void 0:_.partyType)===N.partyType&&((H=N.roles)==null?void 0:H.every(W=>{var $;return($=_==null?void 0:_.roles)==null?void 0:$.includes(W)}))&&_.active}):void 0;j=l.jsx(Dre,{steps:A.stepperConfig.steps,partyData:F,onEditClick:_=>{s(A.id,{initialStepperStepId:_,editingPartyId:F==null?void 0:F.id})}})}else if(A.id==="owners-section"){const N=()=>{s("owners-section")};j=l.jsxs(Gt,{className:"eb-mt-6 eb-p-4",children:[l.jsxs("div",{className:"eb-flex eb-items-start eb-justify-between",children:[l.jsx("h2",{className:"eb-text-xl eb-font-bold eb-tracking-tight",children:"Owners"}),q?l.jsxs(Fe,{variant:"ghost",type:"button",size:"sm",className:"eb-h-8 eb-p-2 eb-text-sm",onClick:N,children:[l.jsx(ro,{}),"Change"]}):l.jsxs(Fe,{variant:"default",type:"button",size:"sm",className:"eb-bg-warning eb-text-sm hover:eb-bg-warning/90",onClick:N,children:[l.jsx(ro,{}),"Add"]})]}),l.jsxs("div",{className:"eb-mt-4 eb-space-y-4",children:[x.length===0&&l.jsx(Gt,{className:"eb-mt-6 eb-p-4 eb-shadow-md",children:l.jsxs("div",{className:"eb-flex eb-flex-col eb-items-center eb-space-y-3",children:[l.jsx("div",{className:"eb-flex eb-h-8 eb-w-8 eb-items-center eb-justify-center eb-rounded-full eb-bg-primary eb-stroke-white",children:l.jsx(xp,{className:"eb-size-4 eb-fill-white eb-stroke-white"})}),l.jsx("p",{className:"eb-text-sm",children:"No stakeholders added yet."})]})}),x.map(F=>{var _,H,W;return l.jsxs(Gt,{className:"eb-space-y-4 eb-rounded-lg eb-border eb-p-4",children:[l.jsxs("div",{className:"eb-space-y-1",children:[l.jsx(Ir,{className:"eb-text-xl eb-font-bold eb-tracking-tight",children:bf(F)}),l.jsx("p",{className:"eb-text-sm eb-font-medium",children:((_=F.individualDetails)==null?void 0:_.jobTitle)==="Other"?`${o("jobTitles.Other")} - ${F.individualDetails.jobTitleDescription}`:o([`jobTitles.${(H=F.individualDetails)==null?void 0:H.jobTitle}`])}),l.jsxs("div",{className:"eb-flex eb-gap-2 eb-pt-2",children:[l.jsx(wn,{variant:"outline",className:"eb-border-transparent eb-bg-[#EDF4FF] eb-text-[#355FA1]",children:"Owner"}),((W=F.roles)==null?void 0:W.includes("CONTROLLER"))&&l.jsx(wn,{variant:"outline",className:"eb-border-transparent eb-bg-[#FFEBD9] eb-text-[#8F521F]",children:"Controller"})]})]}),F.id&&!w[F.id].allStepsValid&&l.jsxs("p",{className:"eb-mt-1 eb-text-sm eb-font-normal eb-text-orange-500",children:["ⓘ"," This individual is missing some details."]})]},F.id)})]})]})}else A.id==="additional-questions-section"&&(j=l.jsxs(Gt,{className:"eb-mt-6 eb-space-y-3 eb-rounded-lg eb-border eb-p-4",children:[l.jsxs("div",{className:"eb-flex eb-items-start eb-justify-between",children:[l.jsx("h2",{className:"eb-text-xl eb-font-bold eb-tracking-tight",children:"Operational details"}),l.jsxs(Fe,{variant:"ghost",type:"button",size:"sm",className:"eb-h-8 eb-p-2 eb-text-sm",onClick:()=>{s("additional-questions-section")},children:[l.jsx(ro,{}),"Change"]})]}),(B=g==null?void 0:g.questions)==null?void 0:B.map(N=>{var H,W;if(!v(N))return null;const F=(H=N.description)==null?void 0:H.split(`
|
|
7783
7783
|
`).map(($,V)=>l.jsx("p",{className:ye({"eb-ml-4":V>0}),children:$},V));if(N.id&&((W=i==null?void 0:i.outstanding.questionIds)!=null&&W.includes(N.id)))return l.jsxs("div",{className:"eb-space-y-0.5",children:[l.jsx("div",{className:"eb-text-sm eb-font-medium",children:F}),l.jsxs("div",{className:"eb-flex eb-items-center eb-gap-1 eb-text-warning",children:[l.jsx(Fn,{className:"eb-size-4"}),l.jsx("p",{className:"eb-italic",children:"This field is missing"})]})]},N.id);const _=m==null?void 0:m.find($=>$.questionId===N.id);return l.jsxs("div",{className:"eb-space-y-0.5",children:[l.jsx("div",{className:"eb-text-sm eb-font-medium",children:F}),l.jsxs("div",{children:[l.jsxs("b",{children:[o("reviewAndAttest.response"),":"]})," ",_&&mje(_)||l.jsx("span",{className:"eb-italic eb-text-muted-foreground",children:o("common:empty")})]})]},N.id)})]}));return l.jsxs(r2,{value:A.id,className:ye({"eb-border-success":q,"eb-border-warning":!q}),children:[l.jsxs(i2,{className:ye({"eb-bg-success-accent":q,"eb-bg-warning-accent":!q}),children:[l.jsx(no,{className:"eb-ml-2 eb-h-4 eb-w-4 eb-shrink-0 eb-transition-transform eb-duration-200"}),l.jsx("div",{className:"eb-ml-2 eb-text-sm",children:A.sectionConfig.label}),l.jsx("div",{className:"eb-ml-auto eb-mr-2 eb-flex eb-items-center eb-gap-2 eb-text-sm eb-font-normal eb-text-muted-foreground",children:q?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:"Complete"}),l.jsx(_r,{className:"eb-size-4 eb-text-success"})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{children:"Missing details"}),l.jsx(Fn,{className:"eb-size-4 eb-text-warning"})]})})]}),l.jsx(U0,{className:"eb-mt-4",children:j})]},A.id)})})}),l.jsxs("div",{className:"eb-space-y-2",children:[l.jsx("p",{className:"eb-text-sm eb-font-medium",children:"Data accuracy attestation"}),l.jsx(jt,{control:p.control,name:"attested",render:({field:A})=>l.jsxs(wt,{children:[l.jsxs("div",{className:"eb-flex eb-items-start eb-space-x-3",children:[l.jsx(it,{children:l.jsx(io,{className:"eb-mt-0.5 eb-rounded-sm",checked:A.value,onCheckedChange:A.onChange})}),l.jsx(Dt,{className:"eb-text-sm eb-font-normal eb-text-foreground peer-disabled:eb-cursor-not-allowed peer-disabled:eb-opacity-70",children:"The data I am providing is true, accurate and complete to the best of my knowledge."})]}),l.jsx(_t,{})]})})]})]}),l.jsx("div",{className:"eb-mt-6 eb-space-y-6",children:l.jsxs("div",{className:"eb-flex eb-justify-between eb-gap-4",children:[l.jsx(Fe,{onClick:e,variant:"secondary",size:"lg",className:ye("eb-w-full eb-text-lg",{"eb-hidden":n()===null}),children:n()}),l.jsx(Fe,{type:"submit",variant:"default",size:"lg",className:ye("eb-w-full eb-text-lg",{"eb-hidden":r()===null}),children:r()})]})})]})})},qqe=()=>mre().replace(/[^a-zA-Z0-9_-]/g,""),Hqe=({handlePrev:e,handleNext:t,getPrevButtonLabel:n,getNextButtonLabel:r})=>{var N;const i=mi(),{clientData:o,onPostClientSettled:a}=ai(),{updateSessionData:s}=Ca(),{t:c}=on("onboarding"),d=vi({defaultValues:{attested:!1},resolver:po(Z.object({attested:Z.boolean().refine(F=>F===!0,{message:"You must agree to all of the documents listed on this page."})}))}),{data:p}=gre(),[h,f]=u.useState({}),[m,b]=u.useState({}),[g,v]=u.useState({}),{mutateAsync:x,error:w,status:k}=ya(),{mutateAsync:M,error:S,status:I}=zX(),L=((N=o==null?void 0:o.outstanding)==null?void 0:N.attestationDocumentIds)||[],E=hO({queries:L.map(F=>({queryKey:["documentDetail",F],queryFn:()=>HX(F)}))}),A=L.every(F=>h[F]||g[F]),j=F=>async()=>{try{v(V=>({...V,[F]:null})),b(V=>({...V,[F]:!0}));const _=await BX(F,{responseType:"blob"}),H=new Blob([_],{type:"application/pdf"}),W=URL.createObjectURL(H),$=window.open(W,"_blank");if(!$)throw new Error("Failed to open document. Please check your popup blocker settings.");$.focus(),f(V=>({...V,[F]:!0}))}catch(_){v(H=>({...H,[F]:_ instanceof Error?_.message:"Failed to download document"})),f(H=>({...H,[F]:!0}))}finally{b(_=>({..._,[F]:!1}))}},q=async()=>{var F,_,H,W,$,V,T;if(o!=null&&o.id){const D={addAttestations:[{attestationTime:new Date().toISOString(),attesterFullName:(H=(_=(F=o==null?void 0:o.parties)==null?void 0:F.find(O=>(O==null?void 0:O.partyType)==="INDIVIDUAL"))==null?void 0:_.individualDetails)==null?void 0:H.firstName,ipAddress:p,documentId:($=(W=o==null?void 0:o.outstanding)==null?void 0:W.attestationDocumentIds)==null?void 0:$[0]}]},R={consumerDevice:{ipAddress:p,sessionId:qqe()}};try{(T=(V=o==null?void 0:o.outstanding)==null?void 0:V.attestationDocumentIds)!=null&&T.length&&await x({id:o.id,data:D},{onSettled:(O,K)=>{var G;a==null||a(O,(G=K==null?void 0:K.response)==null?void 0:G.data)}}),await M({id:o.id,data:R},{onSuccess:()=>{s({mockedKycCompleted:!0}),i.invalidateQueries({queryKey:$o(o.id)}),t()}})}catch(O){console.error("Error completing KYC process:",O)}}};u.useEffect(()=>{const F=E.reduce((H,W)=>{var $;return($=W.data)!=null&&$.id&&(H[W.data.id]=!1),H},{});Object.keys(F).some(H=>!(H in h))&&f(F)},[E.map(F=>{var _;return(_=F.data)==null?void 0:_.id}).filter(Boolean)]);const[P,z]=u.useState(!1),B=k==="pending"||I==="pending";return l.jsx(gr,{...d,children:l.jsxs("form",{onSubmit:F=>{F.preventDefault(),A?d.handleSubmit(()=>{q()})(F):z(!0)},className:"eb-flex eb-flex-auto eb-flex-col",children:[l.jsxs("div",{className:"eb-mt-6 eb-flex-auto eb-space-y-6",children:[!A&&P&&l.jsxs(en,{variant:"destructive",noTitle:!0,children:[l.jsx(Xn,{className:"eb-h-4 eb-w-4"}),l.jsx(tn,{children:"Please open the document links and confirm that you have read and agree to all documents."})]}),l.jsx("div",{className:"eb-mt-2 eb-flex eb-flex-col eb-gap-2",children:L.map(F=>{var H,W;const _=E.find($=>{var V;return((V=$.data)==null?void 0:V.id)===F});return l.jsxs("div",{className:"eb-flex eb-flex-col eb-gap-1",children:[l.jsxs(Fe,{type:"button",onClick:j(F),variant:"ghost",className:ye("eb-flex eb-h-14 eb-w-full eb-justify-between eb-rounded-md eb-border eb-bg-card eb-px-4 eb-py-2 eb-font-sans eb-text-sm eb-font-normal eb-shadow-md",{"eb-border-success eb-bg-success-accent hover:eb-bg-success-accent/80":h[F]}),disabled:(_==null?void 0:_.isFetching)||m[F],children:[l.jsxs("span",{className:"eb-flex eb-items-center eb-gap-2",children:[l.jsx(tu,{}),l.jsx("p",{className:"eb-text-[#12647E] eb-underline",children:_!=null&&_.isFetching||m[F]||!(_!=null&&_.data)?"Loading...":(H=_==null?void 0:_.data)==null?void 0:H.documentType}),l.jsx(fp,{className:"eb-text-[#12647E]"})]}),l.jsxs("span",{children:[h[F]&&l.jsx(Pi,{className:"eb-text-success"}),m[F]&&c("reviewAndAttest.termsAndConditions.downloading")]})]}),((W=_==null?void 0:_.data)==null?void 0:W.id)&&g[_==null?void 0:_.data.id]&&l.jsxs("div",{className:"eb-ml-1 eb-text-sm eb-text-destructive",children:["Failed to download document: ",g[F]]}),!_&&g[F]&&l.jsxs("div",{className:"eb-ml-1 eb-text-sm eb-text-destructive",children:["Failed to fetch document details: ",g[F]]})]},F)})}),l.jsxs("div",{className:"eb-space-y-1",children:[l.jsx("p",{className:"eb-text-sm eb-font-medium",children:"Document attestation"}),l.jsx(jt,{control:d.control,name:"attested",disabled:!A,render:({field:F})=>l.jsxs(wt,{children:[l.jsxs("div",{className:"eb-flex eb-items-center eb-space-x-2",children:[l.jsx(it,{children:l.jsx(io,{checked:F.value,onCheckedChange:F.onChange,disabled:F.disabled})}),l.jsx(Dt,{className:"eb-text-sm eb-font-normal eb-text-foreground peer-disabled:eb-cursor-not-allowed peer-disabled:eb-opacity-70",children:"I have read and agree to all of the documents listed on this page"})]}),l.jsx(_t,{})]})})]}),!A&&l.jsxs(en,{variant:"informative",noTitle:!0,children:[l.jsx(fr,{className:"eb-h-4 eb-w-4"}),l.jsx(tn,{children:"You must open and review all documents before selecting the checkbox"})]}),l.jsx(ii,{error:w||S})]}),l.jsx("div",{className:"eb-mt-6 eb-space-y-6",children:l.jsxs("div",{className:"eb-flex eb-flex-col eb-gap-3",children:[l.jsxs(Fe,{type:"submit",variant:"default",size:"lg",className:ye("eb-w-full eb-text-lg",{"eb-hidden":r()===null}),disabled:B,children:[B&&l.jsx(Ln,{className:"eb-animate-spin"}),r()]}),l.jsx(Fe,{onClick:e,variant:"secondary",size:"lg",className:ye("eb-w-full eb-text-lg",{"eb-hidden":n()===null}),children:n()})]})})]})})},Bqe=[{id:"gateway",isSection:!1,type:"component",Component:Mqe},{id:"overview",isSection:!1,type:"component",Component:Aqe},{id:"owner-stepper",isSection:!1,type:"stepper",stepperConfig:{associatedPartyFilters:{partyType:"INDIVIDUAL",roles:["BENEFICIAL_OWNER"]},defaultPartyRequestBody:{partyType:"INDIVIDUAL",roles:["BENEFICIAL_OWNER"]},steps:Lf}},{id:"document-upload-form",isSection:!1,type:"component",Component:xqe}],Vqe=[{id:"personal-section",isSection:!0,type:"stepper",sectionConfig:{label:"Your personal details",shortLabel:"Personal details",icon:Ts,requirementsList:["Your name and job title","Government issued identifier (e.g. social security number)","Address and contact details"],statusResolver:(e,t,n,r)=>e.mockedKycCompleted||(t==null?void 0:t.status)==="INFORMATION_REQUESTED"||(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"||(t==null?void 0:t.status)==="APPROVED"||(t==null?void 0:t.status)==="DECLINED"?"hidden":n?"completed":Object.entries(r).some(([,o])=>o.isValid)?"missing_details":"not_started"},stepperConfig:{associatedPartyFilters:{partyType:"INDIVIDUAL",roles:["CONTROLLER"]},defaultPartyRequestBody:{partyType:"INDIVIDUAL",roles:["CONTROLLER"]},steps:[{id:"personal-details",title:"Your personal details",stepType:"form",description:"We collect your personal information as the primary person controlling business operations for the company.",Component:If},{id:"identity-document",title:"Your ID details",stepType:"form",description:"We need some additional details to confirm your identity.",Component:eH},{id:"contact-details",title:"Your contact details",stepType:"form",description:"We need some additional details to confirm your identity.",Component:XP},{id:"check-answers",title:"Check your answers",stepType:"check-answers",description:"Please ensure your answers are accurate and complete anything you may have missed."}]}},{id:"business-section",isSection:!0,type:"stepper",sectionConfig:{label:"Business details",icon:Ul,requirementsList:["Industry classification code","Registration ID details (e.g. employer identification number)","Location and contact details"],statusResolver:(e,t,n,r)=>e.mockedKycCompleted||(t==null?void 0:t.status)==="INFORMATION_REQUESTED"||(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"||(t==null?void 0:t.status)==="APPROVED"||(t==null?void 0:t.status)==="DECLINED"?"hidden":n?"completed":Object.entries(r).some(([,o])=>o.isValid)?"missing_details":"not_started"},stepperConfig:{associatedPartyFilters:{partyType:"ORGANIZATION",roles:["CLIENT"]},defaultPartyRequestBody:{partyType:"ORGANIZATION",roles:["CLIENT"]},steps:[{id:"industry",stepType:"form",title:"Industry classification",description:"Choose a classification that best describes your income-producing lines of business.",Component:Eoe},{id:"company-identification",stepType:"form",title:"Business identity",description:"Please provide details about your business.",Component:Loe},{id:"customer-facing-details",stepType:"form",title:"Description & website",description:"Please help us understand the products and services you offer.",Component:ZP},{id:"contact-info",stepType:"form",title:"Contact information",description:"Please let us know how to get in touch.",Component:Cq},{id:"check-answers",stepType:"check-answers",title:"Check your answers",description:"Please ensure your answers are accurate and complete anything you may have missed."}]}},{id:"owners-section",isSection:!0,type:"component",sectionConfig:{label:"Owners and key roles",icon:Ns,requirementsList:["Name and job titles for all individuals","Government issued identifier (e.g. social security number)","Address and contact details"],statusResolver:(e,t)=>{const n=pje(t),r=n==null?void 0:n.every(i=>{const{allStepsValid:o}=vf(Lf,i,t);return o});return e.mockedKycCompleted||(t==null?void 0:t.status)==="INFORMATION_REQUESTED"||(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"||(t==null?void 0:t.status)==="APPROVED"||(t==null?void 0:t.status)==="DECLINED"?"hidden":r?e.isOwnersSectionDone?"completed":"not_started":"missing_details"}},Component:_qe},{id:"additional-questions-section",isSection:!0,type:"component",sectionConfig:{label:"Operational details",icon:t0,requirementsList:["Total annual revenue","Additional questions based on your business profile"],statusResolver:(e,t)=>{var r,i;const n=((i=(r=t==null?void 0:t.outstanding)==null?void 0:r.questionIds)==null?void 0:i.length)===0;return e.mockedKycCompleted||(t==null?void 0:t.status)==="INFORMATION_REQUESTED"||(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"||(t==null?void 0:t.status)==="APPROVED"||(t==null?void 0:t.status)==="DECLINED"?"hidden":n?"completed":"not_started"}},Component:Eqe},{id:"review-attest-section",isSection:!0,type:"stepper",sectionConfig:{label:"Review and attest",icon:tu,statusResolver:(e,t)=>e.mockedKycCompleted||(t==null?void 0:t.status)==="INFORMATION_REQUESTED"||(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"||(t==null?void 0:t.status)==="APPROVED"||(t==null?void 0:t.status)==="DECLINED"?"hidden":"not_started"},stepperConfig:{steps:[{id:"review",title:"Review your details",stepType:"static",description:"Please ensure your answers are accurate and complete anything you may have missed.",Component:Rqe},{id:"documents",title:"Terms and conditions",stepType:"static",description:"Please open and review the following documents from J.P. Morgan to complete the process.",Component:Hqe}]}},{id:"upload-documents-section",isSection:!0,type:"component",sectionConfig:{label:"Supporting documents",icon:Ha,onHoldText:"We'll let you know if any documents are needed",statusResolver:(e,t)=>{const n=Ere(t);return(t==null?void 0:t.status)==="NEW"?"on_hold":(t==null?void 0:t.status)==="INFORMATION_REQUESTED"&&n?"not_started":(t==null?void 0:t.status)==="REVIEW_IN_PROGRESS"&&!n?"completed_disabled":(t==null?void 0:t.status)==="APPROVED"||(t==null?void 0:t.status)==="DECLINED"?"hidden":"completed_disabled"}},Component:Sqe}],Noe={screens:[...Bqe,...Vqe]},Uqe=({initialClientId:e,alertOnExit:t=!1,userEventsToTrack:n=[],userEventsHandler:r,height:i,onGetClientSettled:o,...a})=>{var x,w;const[s,c]=u.useState(e??""),{interceptorReady:d}=A3e(),{data:p,status:h,error:f}=_i(s,{query:{enabled:!!s&&d,refetchOnWindowFocus:!0,refetchInterval:6e4}});u.useEffect(()=>{o&&o(p,h,f)},[p,h,f,o]),u.useEffect(()=>{c(e??"")},[e]);const m=(x=p==null?void 0:p.parties)==null?void 0:x.find(k=>k.partyType==="ORGANIZATION"),b=(w=m==null?void 0:m.organizationDetails)==null?void 0:w.organizationType,{t:g}=on(["onboarding-overview","onboarding"]);u.useEffect(()=>{const k=M=>{M.preventDefault(),M.returnValue=!0};return t&&window.addEventListener("beforeunload",k),()=>{window.removeEventListener("beforeunload",k)}},[t]);const v=u.useCallback(k=>{var S;const M=k.target;Object.keys(M.dataset).includes("userEventTracking")&&(r==null||r({actionName:`${k.type} on ${(S=M.dataset)==null?void 0:S.userEventTracking}`}))},[]);return u.useEffect(()=>{if((n==null?void 0:n.length)>0&&r){const k=document.getElementById("eb-component");return n.forEach(M=>k==null?void 0:k.addEventListener(M,v)),()=>{n.forEach(M=>k==null?void 0:k.removeEventListener(M,v))}}return()=>{}},[]),OX({userEmail:"test@test.com",DOMElementToTrack:"embedded-component-layout",eventsToTrack:["click","blur"]}),l.jsx(gee.Provider,{value:{...a,clientData:p,setClientId:c,organizationType:b},children:l.jsx("div",{id:"embedded-component-layout",className:"eb-component eb-mx-auto eb-flex eb-flex-1 eb-flex-col eb-bg-background eb-p-4 eb-pb-6 eb-font-sans eb-text-foreground eb-antialiased sm:eb-max-w-screen-sm sm:eb-p-10 sm:eb-pb-12",style:{minHeight:i},children:f?l.jsx(ii,{error:f}):h==="pending"&&e&&!a.docUploadOnlyMode?l.jsx(Ws,{message:g("onboarding:fetchingClientData")}):l.jsx(uje,{initialScreenId:a.docUploadOnlyMode?"upload-documents-section":b?"overview":"gateway",flowConfig:Noe,children:l.jsx(Gqe,{})})},e)})},Gqe=()=>{const{clientData:e,organizationType:t,docUploadOnlyMode:n}=ai(),{currentScreenId:r,goTo:i,sessionData:o,updateSessionData:a}=Ca(),s=u.useRef(null),c=u.useRef(!0);u.useEffect(()=>{var h;if(c.current){c.current=!1;return}(h=s.current)==null||h.scrollIntoView({behavior:"smooth",block:"start"})},[r]),u.useEffect(()=>{n&&!["upload-documents-section","document-upload-form"].includes(r)?i("upload-documents-section",{resetHistory:!0}):!n&&!t&&r!=="gateway"&&i("gateway",{resetHistory:!0})},[r,n,t]),u.useEffect(()=>{if(o.mockedVerifyingSectionId){const h=setTimeout(()=>{a({mockedVerifyingSectionId:void 0})},1500);return()=>clearTimeout(h)}return()=>{}},[o.mockedVerifyingSectionId]);const d=Noe.screens.find(h=>h.id===r),p=()=>{if(!d)return l.jsxs("div",{children:["Unknown screen id: ",r]});if(d.type==="component"){const h=d.Component;return l.jsx(h,{})}return d.type==="stepper"?l.jsx(gje,{...d.stepperConfig},d.id):l.jsx("div",{children:"Unhandled screen error"})};return l.jsx("div",{className:"eb-flex eb-flex-1 eb-scroll-mt-44 sm:eb-scroll-mt-48",ref:s,children:l.jsx("div",{className:"eb-w-full",children:p()})},e==null?void 0:e.id)};var Rt={context:void 0,registry:void 0,getContextId(){return Foe(this.context.count)},getNextContextId(){return Foe(this.context.count++)}};function Foe(e){const t=String(e),n=t.length-1;return Rt.context.id+(n?String.fromCharCode(96+n):"")+t}function Ef(e){Rt.context=e}var Wqe=(e,t)=>e===t,QP=Symbol("solid-proxy"),JP=Symbol("solid-track"),e$={equals:Wqe},Poe=qoe,is=1,t$=2,$oe={owned:null,cleanups:null,context:null,owner:null},nH={},sn=null,rH=null,Kqe=null,vn=null,Gr=null,os=null,n$=0;function as(e,t){const n=vn,r=sn,i=e.length===0,o=t===void 0?r:t,a=i?$oe:{owned:null,cleanups:null,context:o?o.context:null,owner:o},s=i?e:()=>e(()=>qn(()=>a$(a)));sn=a,vn=null;try{return Sa(s,!0)}finally{vn=n,sn=r}}function Ge(e,t){t=t?Object.assign({},e$,t):e$;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),Roe(n,i));return[_oe.bind(n),r]}function Ooe(e,t,n){const r=r$(e,t,!0,is);C2(r)}function ut(e,t,n){const r=r$(e,t,!1,is);C2(r)}function ot(e,t,n){Poe=oHe;const r=r$(e,t,!1,is);(!n||!n.render)&&(r.user=!0),os?os.push(r):C2(r)}function Le(e,t,n){n=n?Object.assign({},e$,n):e$;const r=r$(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,C2(r),_oe.bind(r)}function Yqe(e){return e&&typeof e=="object"&&"then"in e}function Zqe(e,t,n){let r,i,o;arguments.length===1?(r=!0,i=e,o={}):(r=e,i=t,o={});let a=null,s=nH,c=null,d=!1,p="initialValue"in o,h=typeof r=="function"&&Le(r);const f=new Set,[m,b]=(o.storage||Ge)(o.initialValue),[g,v]=Ge(void 0),[x,w]=Ge(void 0,{equals:!1}),[k,M]=Ge(p?"ready":"unresolved");if(Rt.context){c=Rt.getNextContextId();let A;o.ssrLoadFrom==="initial"?s=o.initialValue:Rt.load&&(A=Rt.load(c))&&(s=A)}function S(A,j,q,P){return a===A&&(a=null,P!==void 0&&(p=!0),(A===s||j===s)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(P,{value:j})),s=nH,I(j,q)),j}function I(A,j){Sa(()=>{j===void 0&&b(()=>A),M(j!==void 0?"errored":p?"ready":"unresolved"),v(j);for(const q of f.keys())q.decrement();f.clear()},!1)}function L(){const A=nHe,j=m(),q=g();if(q!==void 0&&!a)throw q;return vn&&vn.user,j}function E(A=!0){if(A!==!1&&d)return;d=!1;const j=h?h():r;if(j==null||j===!1){S(a,qn(m));return}const q=s!==nH?s:qn(()=>i(j,{value:m(),refetching:A}));return Yqe(q)?(a=q,"value"in q?(q.status==="success"?S(a,q.value,void 0,j):S(a,void 0,iH(q.value),j),q):(d=!0,queueMicrotask(()=>d=!1),Sa(()=>{M(p?"refreshing":"pending"),w()},!1),q.then(P=>S(q,P,void 0,j),P=>S(q,void 0,iH(P),j)))):(S(a,q,void 0,j),q)}return Object.defineProperties(L,{state:{get:()=>k()},error:{get:()=>g()},loading:{get(){const A=k();return A==="pending"||A==="refreshing"}},latest:{get(){if(!p)return L();const A=g();if(A&&!a)throw A;return m()}}}),h?Ooe(()=>E(!1)):E(!1),[L,{refetch:E,mutate:b}]}function Xqe(e){return Sa(e,!1)}function qn(e){if(vn===null)return e();const t=vn;vn=null;try{return e()}finally{vn=t}}function ss(e,t,n){const r=Array.isArray(e);let i,o=n&&n.defer;return a=>{let s;if(r){s=Array(e.length);for(let d=0;d<e.length;d++)s[d]=e[d]()}else s=e();if(o)return o=!1,a;const c=qn(()=>t(s,i,a));return i=s,c}}function C1(e){ot(()=>qn(e))}function dt(e){return sn===null||(sn.cleanups===null?sn.cleanups=[e]:sn.cleanups.push(e)),e}function joe(){return sn}function Qqe(e,t){const n=sn,r=vn;sn=e,vn=null;try{return Sa(t,!0)}catch(i){oH(i)}finally{sn=n,vn=r}}function Jqe(e){const t=vn,n=sn;return Promise.resolve().then(()=>{vn=t,sn=n;let r;return Sa(e,!1),vn=sn=null,r?r.done:void 0})}var[eHe,OQe]=Ge(!1);function tHe(){return[eHe,Jqe]}function Nr(e,t){const n=Symbol("context");return{id:n,Provider:aHe(n),defaultValue:e}}function Fr(e){let t;return sn&&sn.context&&(t=sn.context[e.id])!==void 0?t:e.defaultValue}function zoe(e){const t=Le(e),n=Le(()=>aH(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var nHe;function _oe(){if(this.sources&&this.state)if(this.state===is)C2(this);else{const e=Gr;Gr=null,Sa(()=>o$(this),!1),Gr=e}if(vn){const e=this.observers?this.observers.length:0;vn.sources?(vn.sources.push(this),vn.sourceSlots.push(e)):(vn.sources=[this],vn.sourceSlots=[e]),this.observers?(this.observers.push(vn),this.observerSlots.push(vn.sources.length-1)):(this.observers=[vn],this.observerSlots=[vn.sources.length-1])}return this.value}function Roe(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Sa(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],a=rH&&rH.running;a&&rH.disposed.has(o),(a?!o.tState:!o.state)&&(o.pure?Gr.push(o):os.push(o),o.observers&&Hoe(o)),a||(o.state=is)}if(Gr.length>1e6)throw Gr=[],new Error},!1)),t}function C2(e){if(!e.fn)return;a$(e);const t=n$;rHe(e,e.value,t)}function rHe(e,t,n){let r;const i=sn,o=vn;vn=sn=e;try{r=e.fn(t)}catch(a){return e.pure&&(e.state=is,e.owned&&e.owned.forEach(a$),e.owned=null),e.updatedAt=n+1,oH(a)}finally{vn=o,sn=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Roe(e,r):e.value=r,e.updatedAt=n)}function r$(e,t,n,r=is,i){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:sn,context:sn?sn.context:null,pure:n};return sn===null||sn!==$oe&&(sn.owned?sn.owned.push(o):sn.owned=[o]),o}function i$(e){if(e.state===0)return;if(e.state===t$)return o$(e);if(e.suspense&&qn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<n$);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===is)C2(e);else if(e.state===t$){const r=Gr;Gr=null,Sa(()=>o$(e,t[0]),!1),Gr=r}}function Sa(e,t){if(Gr)return e();let n=!1;t||(Gr=[]),os?n=!0:os=[],n$++;try{const r=e();return iHe(n),r}catch(r){n||(os=null),Gr=null,oH(r)}}function iHe(e){if(Gr&&(qoe(Gr),Gr=null),e)return;const t=os;os=null,t.length&&Sa(()=>Poe(t),!1)}function qoe(e){for(let t=0;t<e.length;t++)i$(e[t])}function oHe(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:i$(r)}if(Rt.context){if(Rt.count){Rt.effects||(Rt.effects=[]),Rt.effects.push(...e.slice(0,n));return}else Rt.effects&&(e=[...Rt.effects,...e],n+=Rt.effects.length,delete Rt.effects);Ef()}for(t=0;t<n;t++)i$(e[t])}function o$(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const i=r.state;i===is?r!==t&&(!r.updatedAt||r.updatedAt<n$)&&i$(r):i===t$&&o$(r,t)}}}function Hoe(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=t$,n.pure?Gr.push(n):os.push(n),n.observers&&Hoe(n))}}function a$(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const o=i.pop(),a=n.observerSlots.pop();r<i.length&&(o.sourceSlots[a]=r,i[r]=o,n.observerSlots[r]=a)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)a$(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function iH(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function oH(e,t=sn){throw iH(e)}function aH(e){if(typeof e=="function"&&!e.length)return aH(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=aH(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function aHe(e,t){return function(r){let i;return ut(()=>i=qn(()=>(sn.context={...sn.context,[e]:r.value},zoe(()=>r.children))),void 0),i}}var sH=Symbol("fallback");function s$(e){for(let t=0;t<e.length;t++)e[t]()}function sHe(e,t,n={}){let r=[],i=[],o=[],a=0,s=t.length>1?[]:null;return dt(()=>s$(o)),()=>{let c=e()||[],d=c.length,p,h;return c[JP],qn(()=>{let m,b,g,v,x,w,k,M,S;if(d===0)a!==0&&(s$(o),o=[],r=[],i=[],a=0,s&&(s=[])),n.fallback&&(r=[sH],i[0]=as(I=>(o[0]=I,n.fallback())),a=1);else if(a===0){for(i=new Array(d),h=0;h<d;h++)r[h]=c[h],i[h]=as(f);a=d}else{for(g=new Array(d),v=new Array(d),s&&(x=new Array(d)),w=0,k=Math.min(a,d);w<k&&r[w]===c[w];w++);for(k=a-1,M=d-1;k>=w&&M>=w&&r[k]===c[M];k--,M--)g[M]=i[k],v[M]=o[k],s&&(x[M]=s[k]);for(m=new Map,b=new Array(M+1),h=M;h>=w;h--)S=c[h],p=m.get(S),b[h]=p===void 0?-1:p,m.set(S,h);for(p=w;p<=k;p++)S=r[p],h=m.get(S),h!==void 0&&h!==-1?(g[h]=i[p],v[h]=o[p],s&&(x[h]=s[p]),h=b[h],m.set(S,h)):o[p]();for(h=w;h<d;h++)h in g?(i[h]=g[h],o[h]=v[h],s&&(s[h]=x[h],s[h](h))):i[h]=as(f);i=i.slice(0,a=d),r=c.slice(0)}return i});function f(m){if(o[h]=m,s){const[b,g]=Ge(h);return s[h]=g,t(c[h],b)}return t(c[h])}}}function lHe(e,t,n={}){let r=[],i=[],o=[],a=[],s=0,c;return dt(()=>s$(o)),()=>{const d=e()||[],p=d.length;return d[JP],qn(()=>{if(p===0)return s!==0&&(s$(o),o=[],r=[],i=[],s=0,a=[]),n.fallback&&(r=[sH],i[0]=as(f=>(o[0]=f,n.fallback())),s=1),i;for(r[0]===sH&&(o[0](),o=[],r=[],i=[],s=0),c=0;c<p;c++)c<r.length&&r[c]!==d[c]?a[c](()=>d[c]):c>=r.length&&(i[c]=as(h));for(;c<r.length;c++)o[c]();return s=a.length=o.length=p,r=d.slice(0),i=i.slice(0,s)});function h(f){o[c]=f;const[m,b]=Ge(d[c]);return a[c]=b,t(m,c)}}}function re(e,t){return qn(()=>e(t||{}))}function l$(){return!0}var lH={get(e,t,n){return t===QP?n:e.get(t)},has(e,t){return t===QP?!0:e.has(t)},set:l$,deleteProperty:l$,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:l$,deleteProperty:l$}},ownKeys(e){return e.keys()}};function cH(e){return(e=typeof e=="function"?e():e)?e:{}}function cHe(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Nt(...e){let t=!1;for(let a=0;a<e.length;a++){const s=e[a];t=t||!!s&&QP in s,e[a]=typeof s=="function"?(t=!0,Le(s)):s}if(t)return new Proxy({get(a){for(let s=e.length-1;s>=0;s--){const c=cH(e[s])[a];if(c!==void 0)return c}},has(a){for(let s=e.length-1;s>=0;s--)if(a in cH(e[s]))return!0;return!1},keys(){const a=[];for(let s=0;s<e.length;s++)a.push(...Object.keys(cH(e[s])));return[...new Set(a)]}},lH);const n={},r=Object.create(null);for(let a=e.length-1;a>=0;a--){const s=e[a];if(!s)continue;const c=Object.getOwnPropertyNames(s);for(let d=c.length-1;d>=0;d--){const p=c[d];if(p==="__proto__"||p==="constructor")continue;const h=Object.getOwnPropertyDescriptor(s,p);if(!r[p])r[p]=h.get?{enumerable:!0,configurable:!0,get:cHe.bind(n[p]=[h.get.bind(s)])}:h.value!==void 0?h:void 0;else{const f=n[p];f&&(h.get?f.push(h.get.bind(s)):h.value!==void 0&&f.push(()=>h.value))}}}const i={},o=Object.keys(r);for(let a=o.length-1;a>=0;a--){const s=o[a],c=r[s];c&&c.get?Object.defineProperty(i,s,c):i[s]=c?c.value:void 0}return i}function pn(e,...t){if(QP in e){const i=new Set(t.length>1?t.flat():t[0]),o=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},lH));return o.push(new Proxy({get(a){return i.has(a)?void 0:e[a]},has(a){return i.has(a)?!1:a in e},keys(){return Object.keys(e).filter(a=>!i.has(a))}},lH)),o}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const o=Object.getOwnPropertyDescriptor(e,i),a=!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable;let s=!1,c=0;for(const d of t)d.includes(i)&&(s=!0,a?r[c][i]=o.value:Object.defineProperty(r[c],i,o)),++c;s||(a?n[i]=o.value:Object.defineProperty(n,i,o))}return[...r,n]}function uHe(e){let t,n;const r=i=>{const o=Rt.context;if(o){const[s,c]=Ge();Rt.count||(Rt.count=0),Rt.count++,(n||(n=e())).then(d=>{Ef(o),Rt.count--,c(()=>d.default),Ef()}),t=s}else if(!t){const[s]=Zqe(()=>(n||(n=e())).then(c=>c.default));t=s}let a;return Le(()=>(a=t())&&qn(()=>{if(!o)return a(i);const s=Rt.context;Ef(o);const c=a(i);return Ef(s),c}))};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}var dHe=0;function go(){return Rt.context?Rt.getNextContextId():`cl-${dHe++}`}var Boe=e=>`Stale read from <${e}>.`;function pHe(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Le(sHe(()=>e.each,e.children,t||void 0))}function hHe(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Le(lHe(()=>e.each,e.children,t||void 0))}function pt(e){const t=e.keyed,n=Le(()=>e.when,void 0,{equals:(r,i)=>t?r===i:!r==!i});return Le(()=>{const r=n();if(r){const i=e.children;return typeof i=="function"&&i.length>0?qn(()=>i(t?r:()=>{if(!qn(n))throw Boe("Show");return e.when})):i}return e.fallback},void 0,void 0)}function fHe(e){let t=!1;const n=(o,a)=>(t?o[1]===a[1]:!o[1]==!a[1])&&o[2]===a[2],r=zoe(()=>e.children),i=Le(()=>{let o=r();Array.isArray(o)||(o=[o]);for(let a=0;a<o.length;a++){const s=o[a].when;if(s)return t=!!o[a].keyed,[a,s,o[a]]}return[-1]},void 0,{equals:n});return Le(()=>{const[o,a,s]=i();if(o<0)return e.fallback;const c=s.children;return typeof c=="function"&&c.length>0?qn(()=>c(t?a:()=>{if(qn(i)[0]!==o)throw Boe("Match");return s.when})):c},void 0,void 0)}function uH(e){return e}var mHe=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],gHe=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...mHe]),yHe=new Set(["innerHTML","textContent","innerText","children"]),bHe=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),vHe=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function xHe(e,t){const n=vHe[e];return typeof n=="object"?n[t]?n.$:void 0:n}var wHe=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),kHe=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),CHe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function SHe(e,t,n){let r=n.length,i=t.length,o=r,a=0,s=0,c=t[i-1].nextSibling,d=null;for(;a<i||s<o;){if(t[a]===n[s]){a++,s++;continue}for(;t[i-1]===n[o-1];)i--,o--;if(i===a){const p=o<r?s?n[s-1].nextSibling:n[o-s]:c;for(;s<o;)e.insertBefore(n[s++],p)}else if(o===s)for(;a<i;)(!d||!d.has(t[a]))&&t[a].remove(),a++;else if(t[a]===n[o-1]&&n[s]===t[i-1]){const p=t[--i].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--o],p),t[i]=n[o]}else{if(!d){d=new Map;let h=s;for(;h<o;)d.set(n[h],h++)}const p=d.get(t[a]);if(p!=null)if(s<p&&p<o){let h=a,f=1,m;for(;++h<i&&h<o&&!((m=d.get(t[h]))==null||m!==p+f);)f++;if(f>p-s){const b=t[a];for(;s<p;)e.insertBefore(n[s++],b)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}}var Af="_$DX_DELEGATE";function MHe(e,t,n,r={}){let i;return as(o=>{i=o,t===document?e():Ae(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function et(e,t,n){let r;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},o=()=>(r||(r=i())).cloneNode(!0);return o.cloneNode=o,o}function c$(e,t=window.document){const n=t[Af]||(t[Af]=new Set);for(let r=0,i=e.length;r<i;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Koe))}}function IHe(e=window.document){if(e[Af]){for(let t of e[Af].keys())e.removeEventListener(t,Koe);delete e[Af]}}function $e(e,t,n){Rt.context&&e.isConnected||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function LHe(e,t,n,r){Rt.context&&e.isConnected||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function qe(e,t){Rt.context&&e.isConnected||(t==null?e.removeAttribute("class"):e.className=t)}function Voe(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=o=>i.call(e,n[1],o))}else e.addEventListener(t,n)}function EHe(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let o,a;for(o=0,a=i.length;o<a;o++){const s=i[o];!s||s==="undefined"||t[s]||(Goe(e,s,!1),delete n[s])}for(o=0,a=r.length;o<a;o++){const s=r[o],c=!!t[s];!s||s==="undefined"||n[s]===c||!c||(Goe(e,s,!0),n[s]=c)}return n}function AHe(e,t,n){if(!t)return n?$e(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,o;for(o in n)t[o]==null&&r.removeProperty(o),delete n[o];for(o in t)i=t[o],i!==n[o]&&(r.setProperty(o,i),n[o]=i);return n}function Uoe(e,t={},n,r){const i={};return r||ut(()=>i.children=Tf(e,t.children,i.children)),ut(()=>typeof t.ref=="function"&&Df(t.ref,e)),ut(()=>DHe(e,t,n,!0,i,!0)),i}function Df(e,t,n){return qn(()=>e(t,n))}function Ae(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Tf(e,t,r,n);ut(i=>Tf(e,t(),i,n),r)}function DHe(e,t,n,r,i={},o=!1){t||(t={});for(const a in i)if(!(a in t)){if(a==="children")continue;i[a]=Woe(e,a,null,i[a],n,o)}for(const a in t){if(a==="children")continue;const s=t[a];i[a]=Woe(e,a,s,i[a],n,o)}}function THe(e){let t,n;return!Rt.context||!(t=Rt.registry.get(n=FHe()))?e():(Rt.completed&&Rt.completed.add(t),Rt.registry.delete(n),t)}function NHe(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Goe(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,o=r.length;i<o;i++)e.classList.toggle(r[i],n)}function Woe(e,t,n,r,i,o){let a,s,c,d,p;if(t==="style")return AHe(e,n,r);if(t==="classList")return EHe(e,n,r);if(n===r)return r;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r),n&&e.addEventListener(h,n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),f=wHe.has(h);if(!f&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(h,m)}(f||n)&&(Voe(e,h,n,f),f&&c$([h]))}else if(t.slice(0,5)==="attr:")$e(e,t.slice(5),n);else if((p=t.slice(0,5)==="prop:")||(c=yHe.has(t))||!i&&((d=xHe(t,e.tagName))||(s=gHe.has(t)))||(a=e.nodeName.includes("-"))){if(p)t=t.slice(5),s=!0;else if(Rt.context&&e.isConnected)return n;t==="class"||t==="className"?qe(e,n):a&&!s&&!c?e[NHe(t)]=n:e[d||t]=n}else{const h=i&&t.indexOf(":")>-1&&CHe[t.split(":")[0]];h?LHe(e,h,t,n):$e(e,bHe[t]||t,n)}return n}function Koe(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Rt.registry&&!Rt.done&&(Rt.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const i=n[`${t}Data`];if(i!==void 0?r.call(n,i,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Tf(e,t,n,r,i){const o=!!Rt.context&&e.isConnected;if(o){!n&&(n=[...e.childNodes]);let c=[];for(let d=0;d<n.length;d++){const p=n[d];p.nodeType===8&&p.data.slice(0,2)==="!$"?p.remove():c.push(p)}n=c}for(;typeof n=="function";)n=n();if(t===n)return n;const a=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,a==="string"||a==="number"){if(o||a==="number"&&(t=t.toString(),t===n))return n;if(s){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=S2(e,n,r,c)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||a==="boolean"){if(o)return n;n=S2(e,n,r)}else{if(a==="function")return ut(()=>{let c=t();for(;typeof c=="function";)c=c();n=Tf(e,c,n,r)}),()=>n;if(Array.isArray(t)){const c=[],d=n&&Array.isArray(n);if(dH(c,t,n,i))return ut(()=>n=Tf(e,c,n,r,!0)),()=>n;if(o){if(!c.length)return n;if(r===void 0)return[...e.childNodes];let p=c[0],h=[p];for(;(p=p.nextSibling)!==r;)h.push(p);return n=h}if(c.length===0){if(n=S2(e,n,r),s)return n}else d?n.length===0?Yoe(e,c,r):SHe(e,n,c):(n&&S2(e),Yoe(e,c));n=c}else if(t.nodeType){if(o&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=S2(e,n,r,t);S2(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function dH(e,t,n,r){let i=!1;for(let o=0,a=t.length;o<a;o++){let s=t[o],c=n&&n[e.length],d;if(!(s==null||s===!0||s===!1))if((d=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=dH(e,s,c)||i;else if(d==="function")if(r){for(;typeof s=="function";)s=s();i=dH(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||i}else e.push(s),i=!0;else{const p=String(s);c&&c.nodeType===3&&c.data===p?e.push(c):e.push(document.createTextNode(p))}}return i}function Yoe(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function S2(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const s=t[a];if(i!==s){const c=s.parentNode===e;!o&&!a?c?e.replaceChild(i,s):e.insertBefore(i,n):c&&s.remove()}else o=!0}}else e.insertBefore(i,n);return[i]}function FHe(){return Rt.getNextContextId()}var PHe="http://www.w3.org/2000/svg";function Zoe(e,t=!1){return t?document.createElementNS(PHe,e):document.createElement(e)}function Xoe(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=joe();let o,a=!!Rt.context;return ot(()=>{a&&(joe().user=a=!1),o||(o=Qqe(i,()=>Le(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[c,d]=Ge(!1),p=()=>d(!0);as(h=>Ae(s,()=>c()?h():o(),null)),dt(p)}else{const c=Zoe(e.isSVG?"g":"div",e.isSVG),d=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return n.parentNode},configurable:!0}),Ae(d,o),s.appendChild(c),e.ref&&e.ref(c),dt(()=>s.removeChild(c))}},void 0,{render:!a}),n}function $He(e){const[t,n]=pn(e,["component"]),r=Le(()=>t.component);return Le(()=>{const i=r();switch(typeof i){case"function":return qn(()=>i(n));case"string":const o=kHe.has(i),a=Rt.context?THe():Zoe(i,o);return Uoe(a,n,o),a}})}var OHe=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},Qoe=class{constructor(e){this.generateIdentifier=e,this.kv=new OHe}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},jHe=class extends Qoe{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function zHe(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function _He(e,t){const n=zHe(e);if("find"in n)return n.find(t);const r=n;for(let i=0;i<r.length;i++){const o=r[i];if(t(o))return o}}function M2(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function u$(e,t){return e.indexOf(t)!==-1}function Joe(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var RHe=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return _He(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},qHe=e=>Object.prototype.toString.call(e).slice(8,-1),eae=e=>typeof e>"u",HHe=e=>e===null,Nf=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,pH=e=>Nf(e)&&Object.keys(e).length===0,tl=e=>Array.isArray(e),BHe=e=>typeof e=="string",VHe=e=>typeof e=="number"&&!isNaN(e),UHe=e=>typeof e=="boolean",GHe=e=>e instanceof RegExp,Ff=e=>e instanceof Map,Pf=e=>e instanceof Set,tae=e=>qHe(e)==="Symbol",WHe=e=>e instanceof Date&&!isNaN(e.valueOf()),KHe=e=>e instanceof Error,nae=e=>typeof e=="number"&&isNaN(e),YHe=e=>UHe(e)||HHe(e)||eae(e)||VHe(e)||BHe(e)||tae(e),ZHe=e=>typeof e=="bigint",XHe=e=>e===1/0||e===-1/0,QHe=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),JHe=e=>e instanceof URL,rae=e=>e.replace(/\./g,"\\."),hH=e=>e.map(String).map(rae).join("."),$f=e=>{const t=[];let n="";for(let i=0;i<e.length;i++){let o=e.charAt(i);if(o==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(o==="."){t.push(n),n="";continue}n+=o}const r=n;return t.push(r),t};function Ma(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var iae=[Ma(eae,"undefined",()=>null,()=>{}),Ma(ZHe,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):e),Ma(WHe,"Date",e=>e.toISOString(),e=>new Date(e)),Ma(KHe,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),Ma(GHe,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Ma(Pf,"set",e=>[...e.values()],e=>new Set(e)),Ma(Ff,"map",e=>[...e.entries()],e=>new Map(e)),Ma(e=>nae(e)||XHe(e),"number",e=>nae(e)?"NaN":e>0?"Infinity":"-Infinity",Number),Ma(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),Ma(JHe,"URL",e=>e.toString(),e=>new URL(e))];function d$(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var oae=d$((e,t)=>tae(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),eBe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),aae=d$(QHe,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=eBe[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function sae(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var lae=d$(sae,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(i=>{r[i]=e[i]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),cae=d$((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),tBe=[lae,oae,cae,aae],uae=(e,t)=>{const n=Joe(tBe,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=Joe(iae,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},dae={};iae.forEach(e=>{dae[e.annotation]=e});var nBe=(e,t,n)=>{if(tl(t))switch(t[0]){case"symbol":return oae.untransform(e,t,n);case"class":return lae.untransform(e,t,n);case"custom":return cae.untransform(e,t,n);case"typed-array":return aae.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=dae[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},I2=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function pae(e){if(u$(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(u$(e,"prototype"))throw new Error("prototype is not allowed as a property");if(u$(e,"constructor"))throw new Error("constructor is not allowed as a property")}var rBe=(e,t)=>{pae(t);for(let n=0;n<t.length;n++){const r=t[n];if(Pf(e))e=I2(e,+r);else if(Ff(e)){const i=+r,o=+t[++n]==0?"key":"value",a=I2(e,i);switch(o){case"key":e=a;break;case"value":e=e.get(a);break}}else e=e[r]}return e},fH=(e,t,n)=>{if(pae(t),t.length===0)return n(e);let r=e;for(let o=0;o<t.length-1;o++){const a=t[o];if(tl(r)){const s=+a;r=r[s]}else if(Nf(r))r=r[a];else if(Pf(r)){const s=+a;r=I2(r,s)}else if(Ff(r)){if(o===t.length-2)break;const c=+a,d=+t[++o]==0?"key":"value",p=I2(r,c);switch(d){case"key":r=p;break;case"value":r=r.get(p);break}}}const i=t[t.length-1];if(tl(r)?r[+i]=n(r[+i]):Nf(r)&&(r[i]=n(r[i])),Pf(r)){const o=I2(r,+i),a=n(o);o!==a&&(r.delete(o),r.add(a))}if(Ff(r)){const o=+t[t.length-2],a=I2(r,o);switch(+i==0?"key":"value"){case"key":{const c=n(a);r.set(c,r.get(a)),c!==a&&r.delete(a);break}case"value":{r.set(a,n(r.get(a)));break}}}return e};function mH(e,t,n=[]){if(!e)return;if(!tl(e)){M2(e,(o,a)=>mH(o,t,[...n,...$f(a)]));return}const[r,i]=e;i&&M2(i,(o,a)=>{mH(o,t,[...n,...$f(a)])}),t(r,n)}function iBe(e,t,n){return mH(t,(r,i)=>{e=fH(e,i,o=>nBe(o,r,n))}),e}function oBe(e,t){function n(r,i){const o=rBe(e,$f(i));r.map($f).forEach(a=>{e=fH(e,a,()=>o)})}if(tl(t)){const[r,i]=t;r.forEach(o=>{e=fH(e,$f(o),()=>e)}),i&&M2(i,n)}else M2(t,n);return e}var aBe=(e,t)=>Nf(e)||tl(e)||Ff(e)||Pf(e)||sae(e,t);function sBe(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function lBe(e,t){const n={};let r;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(s=>s.map(String)).sort((s,c)=>s.length-c.length));const[o,...a]=i;o.length===0?r=a.map(hH):n[hH(o)]=a.map(hH)}),r?pH(n)?[r]:[r,n]:pH(n)?void 0:n}var hae=(e,t,n,r,i=[],o=[],a=new Map)=>{const s=YHe(e);if(!s){sBe(e,i,t);const m=a.get(e);if(m)return r?{transformedValue:null}:m}if(!aBe(e,n)){const m=uae(e,n),b=m?{transformedValue:m.value,annotations:[m.type]}:{transformedValue:e};return s||a.set(e,b),b}if(u$(o,e))return{transformedValue:null};const c=uae(e,n),d=(c==null?void 0:c.value)??e,p=tl(d)?[]:{},h={};M2(d,(m,b)=>{if(b==="__proto__"||b==="constructor"||b==="prototype")throw new Error(`Detected property ${b}. This is a prototype pollution risk, please remove it from your object.`);const g=hae(m,t,n,r,[...i,b],[...o,e],a);p[b]=g.transformedValue,tl(g.annotations)?h[b]=g.annotations:Nf(g.annotations)&&M2(g.annotations,(v,x)=>{h[rae(b)+"."+x]=v})});const f=pH(h)?{transformedValue:p,annotations:c?[c.type]:void 0}:{transformedValue:p,annotations:c?[c.type,h]:h};return s||a.set(e,f),f};function fae(e){return Object.prototype.toString.call(e).slice(8,-1)}function mae(e){return fae(e)==="Array"}function cBe(e){if(fae(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function uBe(e,t,n,r,i){const o={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";o==="enumerable"&&(e[t]=n),i&&o==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function gH(e,t={}){if(mae(e))return e.map(i=>gH(i,t));if(!cBe(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,o)=>{if(mae(t.props)&&!t.props.includes(o))return i;const a=e[o],s=gH(a,t);return uBe(i,o,s,e,t.nonenumerable),i},{})}var xn=class{constructor({dedupe:e=!1}={}){this.classRegistry=new jHe,this.symbolRegistry=new Qoe(t=>t.description??""),this.customTransformerRegistry=new RHe,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=hae(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=lBe(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=gH(t);return n!=null&&n.values&&(r=iBe(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=oBe(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};xn.defaultInstance=new xn,xn.serialize=xn.defaultInstance.serialize.bind(xn.defaultInstance),xn.deserialize=xn.defaultInstance.deserialize.bind(xn.defaultInstance),xn.stringify=xn.defaultInstance.stringify.bind(xn.defaultInstance),xn.parse=xn.defaultInstance.parse.bind(xn.defaultInstance),xn.registerClass=xn.defaultInstance.registerClass.bind(xn.defaultInstance),xn.registerSymbol=xn.defaultInstance.registerSymbol.bind(xn.defaultInstance),xn.registerCustom=xn.defaultInstance.registerCustom.bind(xn.defaultInstance),xn.allowErrorProps=xn.defaultInstance.allowErrorProps.bind(xn.defaultInstance);var dBe=xn.serialize,pBe=xn.stringify;function L2(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function hBe(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function fBe({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function E2({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function mBe(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var p$=(e,t=!1)=>{const{json:n}=dBe(e);return JSON.stringify(n,null,t?2:void 0)},h$=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,gBe=(e,t)=>e.queryHash.localeCompare(t.queryHash),gae=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,yBe=(e,t)=>h$(e)===h$(t)?gae(e,t):h$(e)>h$(t)?1:-1,yH={status:yBe,"query hash":gBe,"last updated":gae},f$=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,yae=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,bBe=(e,t)=>f$(e)===f$(t)?yae(e,t):f$(e)>f$(t)?1:-1,bH={status:bBe,"last updated":yae},bae=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),vBe=()=>{const[e,t]=Ge("dark");return C1(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=i=>{t(i.matches?"dark":"light")};n.addEventListener("change",r),dt(()=>n.removeEventListener("change",r))}),e},S1=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[i,...o]=t;return r.set(i,S1(r.get(i),o,n)),r}if(e instanceof Set){const r=S1(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[i,...o]=t;return r[i]=S1(r[i],o,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[i,...o]=t;return r[i]=S1(r[i],o,n),r}return e},Of=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...i]=t;return n.set(r,Of(n.get(r),i)),n}if(e instanceof Set){const n=Of(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((o,a)=>a.toString()!==t[0]);const[r,...i]=t;return n[r]=Of(n[r],i),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...i]=t;return n[r]=Of(n[r],i),n}return e},xBe=(e,t)=>{if(!e||document.querySelector("#_goober")||(t==null?void 0:t.querySelector("#_goober")))return;const r=document.createElement("style"),i=document.createTextNode("");r.appendChild(i),r.id="_goober",r.setAttribute("nonce",e),t?t.appendChild(r):document.head.appendChild(r)},wBe=(oce=class{constructor(e){Xe(this,Q2);Xe(this,om);Xe(this,am);Xe(this,sm);Xe(this,z1,!1);Xe(this,lm);Xe(this,J2);Xe(this,eh);Xe(this,th);Xe(this,nh);Xe(this,rh);Xe(this,ih);Xe(this,cm);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:o,position:a,initialIsOpen:s,errorTypes:c,styleNonce:d,shadowDOMTarget:p}=e;je(this,Q2,Ge(t)),je(this,am,n),je(this,sm,r),je(this,om,i),je(this,lm,d),je(this,J2,p),je(this,eh,Ge(o)),je(this,th,Ge(a)),je(this,nh,Ge(s)),je(this,rh,Ge(c))}setButtonPosition(e){ne(this,eh)[1](e)}setPosition(e){ne(this,th)[1](e)}setInitialIsOpen(e){ne(this,nh)[1](e)}setErrorTypes(e){ne(this,rh)[1](e)}setClient(e){ne(this,Q2)[1](e)}mount(e){if(ne(this,z1))throw new Error("Devtools is already mounted");const t=MHe(()=>{const n=this,[r]=ne(this,eh),[i]=ne(this,th),[o]=ne(this,nh),[a]=ne(this,rh),[s]=ne(this,Q2);let c;return ne(this,ih)?c=ne(this,ih):(c=uHe(()=>Promise.resolve().then(()=>oYe)),je(this,ih,c)),xBe(ne(this,lm),ne(this,J2)),re(c,Nt({get queryFlavor(){return ne(n,am)},get version(){return ne(n,sm)},get onlineManager(){return ne(n,om)},get shadowDOMTarget(){return ne(n,J2)}},{get client(){return s()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return o()},get errorTypes(){return a()}}))},e);je(this,z1,!0),je(this,cm,t)}unmount(){var e;if(!ne(this,z1))throw new Error("Devtools is not mounted");(e=ne(this,cm))==null||e.call(this),je(this,z1,!1)}},Q2=new WeakMap,om=new WeakMap,am=new WeakMap,sm=new WeakMap,z1=new WeakMap,lm=new WeakMap,J2=new WeakMap,eh=new WeakMap,th=new WeakMap,nh=new WeakMap,rh=new WeakMap,ih=new WeakMap,cm=new WeakMap,oce);function kBe(e){const t=mi(e.client),n=C.useRef(null),{buttonPosition:r,position:i,initialIsOpen:o,errorTypes:a,styleNonce:s,shadowDOMTarget:c}=e,[d]=C.useState(new wBe({client:t,queryFlavor:"React Query",version:"5",onlineManager:Th,buttonPosition:r,position:i,initialIsOpen:o,errorTypes:a,styleNonce:s,shadowDOMTarget:c}));return C.useEffect(()=>{d.setClient(t)},[t,d]),C.useEffect(()=>{r&&d.setButtonPosition(r)},[r,d]),C.useEffect(()=>{i&&d.setPosition(i)},[i,d]),C.useEffect(()=>{d.setInitialIsOpen(o||!1)},[o,d]),C.useEffect(()=>{d.setErrorTypes(a||[])},[a,d]),C.useEffect(()=>(n.current&&d.mount(n.current),()=>{d.unmount()}),[d]),l.jsx("div",{className:"tsqd-parent-container",ref:n})}var CBe=kBe;const SBe=Object.freeze(Object.defineProperty({__proto__:null,ReactQueryDevtools:CBe},Symbol.toStringTag,{value:"Module"})),vae="[a-fA-F\\d:]",nl=e=>e&&e.includeBoundaries?`(?:(?<=\\s|^)(?=${vae})|(?<=${vae})(?=\\s|$))`:"",Bo="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",ir="[a-fA-F\\d]{1,4}",m$=`
|
|
7784
7784
|
(?:
|
|
7785
7785
|
(?:${ir}:){7}(?:${ir}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|