@techlabi/kycrazy-ui-kit 0.53.0-beta.6 → 0.53.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -31898,70 +31898,60 @@ const sV = async (r, e) => {
31898
31898
  onPointerDownOutside: _,
31899
31899
  onInteractOutside: _,
31900
31900
  onFocusOutside: N,
31901
- children: /* @__PURE__ */ l(
31902
- "div",
31901
+ children: /* @__PURE__ */ l("div", { ref: c, onPointerDown: Z, onPointerUp: Z, onClick: Z, children: /* @__PURE__ */ M(
31902
+ e9,
31903
31903
  {
31904
- ref: c,
31905
- onPointerDown: Z,
31906
- onPointerUp: Z,
31907
- onClick: Z,
31908
- children: /* @__PURE__ */ M(
31909
- e9,
31910
- {
31911
- className: "flex flex-col overflow-hidden",
31912
- style: {
31913
- maxHeight: 360,
31914
- display: "flex",
31915
- flexDirection: "column",
31916
- overflow: "hidden"
31917
- },
31918
- shouldFilter: !0,
31919
- filter: (W, D) => {
31920
- const J = D.toLowerCase().trim(), ar = " ", X = W.indexOf(ar), er = X >= 0 ? W.slice(0, X) : W, U = X >= 0 ? W.slice(X + ar.length) : "";
31921
- return er.toLowerCase().includes(J) || U.toLowerCase().includes(J) ? 1 : 0;
31922
- },
31923
- children: [
31924
- /* @__PURE__ */ l(a9, { placeholder: "Search by code or description..." }),
31925
- /* @__PURE__ */ M(
31926
- t9,
31927
- {
31928
- className: "min-h-0 flex-1 touch-pan-y",
31929
- style: {
31930
- minHeight: 0,
31931
- flex: 1,
31932
- overflowY: "auto",
31933
- overflowX: "hidden",
31934
- maxHeight: 280,
31935
- WebkitOverflowScrolling: "touch"
31904
+ className: "flex h-80 flex-col overflow-hidden",
31905
+ style: {
31906
+ display: "flex",
31907
+ flexDirection: "column",
31908
+ overflow: "hidden"
31909
+ },
31910
+ shouldFilter: !0,
31911
+ filter: (W, D) => {
31912
+ const J = D.toLowerCase().trim(), ar = " ​ ", X = W.indexOf(ar), er = X >= 0 ? W.slice(0, X) : W, U = X >= 0 ? W.slice(X + ar.length) : "";
31913
+ return er.toLowerCase().includes(J) || U.toLowerCase().includes(J) ? 1 : 0;
31914
+ },
31915
+ children: [
31916
+ /* @__PURE__ */ l(a9, { placeholder: "Search by code or description..." }),
31917
+ /* @__PURE__ */ M(
31918
+ t9,
31919
+ {
31920
+ className: "min-h-0 flex-1 touch-pan-y",
31921
+ style: {
31922
+ minHeight: 0,
31923
+ flex: 1,
31924
+ height: 280,
31925
+ overflowY: "auto",
31926
+ overflowX: "hidden",
31927
+ WebkitOverflowScrolling: "touch"
31928
+ },
31929
+ onTouchStart: C,
31930
+ children: [
31931
+ /* @__PURE__ */ l(n9, { children: "No MCC code found." }),
31932
+ /* @__PURE__ */ l(i9, { children: h.map((W) => /* @__PURE__ */ M(
31933
+ o9,
31934
+ {
31935
+ value: `${W.code} ​ ${W.description}`,
31936
+ onSelect: () => v(W.code),
31937
+ className: "flex items-center gap-2",
31938
+ children: [
31939
+ /* @__PURE__ */ l("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ l(bo, { className: Zr("h-4 w-4", r === W.code ? "opacity-100" : "opacity-0") }) }),
31940
+ /* @__PURE__ */ M("span", { className: "min-w-0 flex-1 truncate", children: [
31941
+ W.code,
31942
+ " — ",
31943
+ W.description
31944
+ ] })
31945
+ ]
31936
31946
  },
31937
- onTouchStart: C,
31938
- children: [
31939
- /* @__PURE__ */ l(n9, { children: "No MCC code found." }),
31940
- /* @__PURE__ */ l(i9, { children: h.map((W) => /* @__PURE__ */ M(
31941
- o9,
31942
- {
31943
- value: `${W.code} ​ ${W.description}`,
31944
- onSelect: () => v(W.code),
31945
- className: "flex items-center gap-2",
31946
- children: [
31947
- /* @__PURE__ */ l("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ l(bo, { className: Zr("h-4 w-4", r === W.code ? "opacity-100" : "opacity-0") }) }),
31948
- /* @__PURE__ */ M("span", { className: "min-w-0 flex-1 truncate", children: [
31949
- W.code,
31950
- " — ",
31951
- W.description
31952
- ] })
31953
- ]
31954
- },
31955
- W.code
31956
- )) })
31957
- ]
31958
- }
31959
- )
31960
- ]
31961
- }
31962
- )
31947
+ W.code
31948
+ )) })
31949
+ ]
31950
+ }
31951
+ )
31952
+ ]
31963
31953
  }
31964
- )
31954
+ ) })
31965
31955
  }
31966
31956
  )
31967
31957
  ] });
package/dist/index.umd.js CHANGED
@@ -287,7 +287,7 @@ onmessage = (message) => {
287
287
 
288
288
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
289
289
 
290
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return p.useEffect(()=>{r&&(document.getElementById(r)||console.error(a))},[a,r]),null},nV="DialogDescriptionWarning",iV=({contentRef:r,descriptionId:e})=>{const t=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${cy(nV).contentName}}.`;return p.useEffect(()=>{var i;const n=(i=r.current)==null?void 0:i.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(t))},[t,r,e]),null},oV=qp,dy=ay,$d=ty,Wd=ny,hy=oy,by=sy,AV=ly,rA='[cmdk-group=""]',Td='[cmdk-group-items=""]',sV='[cmdk-group-heading=""]',my='[cmdk-item=""]',vy=`${my}:not([aria-disabled="true"])`,Pd="cmdk-item-select",_2="data-value",fV=(r,e,a)=>QD(r,e,a),gy=p.createContext(void 0),eA=()=>p.useContext(gy),py=p.createContext(void 0),Od=()=>p.useContext(py),yy=p.createContext(void 0),wy=p.forwardRef((r,e)=>{let a=I2(()=>{var E,Z;return{search:"",value:(Z=(E=r.value)!=null?E:r.defaultValue)!=null?Z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),t=I2(()=>new Set),n=I2(()=>new Map),i=I2(()=>new Map),o=I2(()=>new Set),A=ky(r),{label:s,children:l,value:u,onValueChange:c,filter:h,shouldFilter:d,loop:g,disablePointerSelection:b=!1,vimBindings:v=!0,...I}=r,_=Te(),N=Te(),F=Te(),C=p.useRef(null),T=yV();ei(()=>{if(u!==void 0){let E=u.trim();a.current.value=E,M.emit()}},[u]),ei(()=>{T(6,ar)},[]);let M=p.useMemo(()=>({subscribe:E=>(o.current.add(E),()=>o.current.delete(E)),snapshot:()=>a.current,setState:(E,Z,B)=>{var S,O,W,U;if(!Object.is(a.current[E],Z)){if(a.current[E]=Z,E==="search")L(),R(),T(1,er);else if(E==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let K=document.getElementById(F);K?K.focus():(S=document.getElementById(_))==null||S.focus()}if(T(7,()=>{var K;a.current.selectedItemId=(K=P())==null?void 0:K.id,M.emit()}),B||T(5,ar),((O=A.current)==null?void 0:O.value)!==void 0){let K=Z??"";(U=(W=A.current).onValueChange)==null||U.call(W,K);return}}M.emit()}},emit:()=>{o.current.forEach(E=>E())}}),[]),Q=p.useMemo(()=>({value:(E,Z,B)=>{var S;Z!==((S=i.current.get(E))==null?void 0:S.value)&&(i.current.set(E,{value:Z,keywords:B}),a.current.filtered.items.set(E,rr(Z,B)),T(2,()=>{R(),M.emit()}))},item:(E,Z)=>(t.current.add(E),Z&&(n.current.has(Z)?n.current.get(Z).add(E):n.current.set(Z,new Set([E]))),T(3,()=>{L(),R(),a.current.value||er(),M.emit()}),()=>{i.current.delete(E),t.current.delete(E),a.current.filtered.items.delete(E);let B=P();T(4,()=>{L(),(B==null?void 0:B.getAttribute("id"))===E&&er(),M.emit()})}),group:E=>(n.current.has(E)||n.current.set(E,new Set),()=>{i.current.delete(E),n.current.delete(E)}),filter:()=>A.current.shouldFilter,label:s||r["aria-label"],getDisablePointerSelection:()=>A.current.disablePointerSelection,listId:_,inputId:F,labelId:N,listInnerRef:C}),[]);function rr(E,Z){var B,S;let O=(S=(B=A.current)==null?void 0:B.filter)!=null?S:fV;return E?O(E,a.current.search,Z):0}function R(){if(!a.current.search||A.current.shouldFilter===!1)return;let E=a.current.filtered.items,Z=[];a.current.filtered.groups.forEach(S=>{let O=n.current.get(S),W=0;O.forEach(U=>{let K=E.get(U);W=Math.max(K,W)}),Z.push([S,W])});let B=C.current;Y().sort((S,O)=>{var W,U;let K=S.getAttribute("id"),H=O.getAttribute("id");return((W=E.get(H))!=null?W:0)-((U=E.get(K))!=null?U:0)}).forEach(S=>{let O=S.closest(Td);O?O.appendChild(S.parentElement===O?S:S.closest(`${Td} > *`)):B.appendChild(S.parentElement===B?S:S.closest(`${Td} > *`))}),Z.sort((S,O)=>O[1]-S[1]).forEach(S=>{var O;let W=(O=C.current)==null?void 0:O.querySelector(`${rA}[${_2}="${encodeURIComponent(S[0])}"]`);W==null||W.parentElement.appendChild(W)})}function er(){let E=Y().find(B=>B.getAttribute("aria-disabled")!=="true"),Z=E==null?void 0:E.getAttribute(_2);M.setState("value",Z||void 0)}function L(){var E,Z,B,S;if(!a.current.search||A.current.shouldFilter===!1){a.current.filtered.count=t.current.size;return}a.current.filtered.groups=new Set;let O=0;for(let W of t.current){let U=(Z=(E=i.current.get(W))==null?void 0:E.value)!=null?Z:"",K=(S=(B=i.current.get(W))==null?void 0:B.keywords)!=null?S:[],H=rr(U,K);a.current.filtered.items.set(W,H),H>0&&O++}for(let[W,U]of n.current)for(let K of U)if(a.current.filtered.items.get(K)>0){a.current.filtered.groups.add(W);break}a.current.filtered.count=O}function ar(){var E,Z,B;let S=P();S&&(((E=S.parentElement)==null?void 0:E.firstChild)===S&&((B=(Z=S.closest(rA))==null?void 0:Z.querySelector(sV))==null||B.scrollIntoView({block:"nearest"})),S.scrollIntoView({block:"nearest"}))}function P(){var E;return(E=C.current)==null?void 0:E.querySelector(`${my}[aria-selected="true"]`)}function Y(){var E;return Array.from(((E=C.current)==null?void 0:E.querySelectorAll(vy))||[])}function j(E){let Z=Y()[E];Z&&M.setState("value",Z.getAttribute(_2))}function V(E){var Z;let B=P(),S=Y(),O=S.findIndex(U=>U===B),W=S[O+E];(Z=A.current)!=null&&Z.loop&&(W=O+E<0?S[S.length-1]:O+E===S.length?S[0]:S[O+E]),W&&M.setState("value",W.getAttribute(_2))}function m(E){let Z=P(),B=Z==null?void 0:Z.closest(rA),S;for(;B&&!S;)B=E>0?gV(B,rA):pV(B,rA),S=B==null?void 0:B.querySelector(vy);S?M.setState("value",S.getAttribute(_2)):V(E)}let w=()=>j(Y().length-1),y=E=>{E.preventDefault(),E.metaKey?w():E.altKey?m(1):V(1)},k=E=>{E.preventDefault(),E.metaKey?j(0):E.altKey?m(-1):V(-1)};return p.createElement(Or.div,{ref:e,tabIndex:-1,...I,"cmdk-root":"",onKeyDown:E=>{var Z;(Z=I.onKeyDown)==null||Z.call(I,E);let B=E.nativeEvent.isComposing||E.keyCode===229;if(!(E.defaultPrevented||B))switch(E.key){case"n":case"j":{v&&E.ctrlKey&&y(E);break}case"ArrowDown":{y(E);break}case"p":case"k":{v&&E.ctrlKey&&k(E);break}case"ArrowUp":{k(E);break}case"Home":{E.preventDefault(),j(0);break}case"End":{E.preventDefault(),w();break}case"Enter":{E.preventDefault();let S=P();if(S){let O=new Event(Pd);S.dispatchEvent(O)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:Q.inputId,id:Q.labelId,style:kV},s),Of(r,E=>p.createElement(py.Provider,{value:M},p.createElement(gy.Provider,{value:Q},E))))}),lV=p.forwardRef((r,e)=>{var a,t;let n=Te(),i=p.useRef(null),o=p.useContext(yy),A=eA(),s=ky(r),l=(t=(a=s.current)==null?void 0:a.forceMount)!=null?t:o==null?void 0:o.forceMount;ei(()=>{if(!l)return A.item(n,o==null?void 0:o.id)},[l]);let u=Ey(n,i,[r.value,r.children,i],r.keywords),c=Od(),h=dn(T=>T.value&&T.value===u.current),d=dn(T=>l||A.filter()===!1?!0:T.search?T.filtered.items.get(n)>0:!0);p.useEffect(()=>{let T=i.current;if(!(!T||r.disabled))return T.addEventListener(Pd,g),()=>T.removeEventListener(Pd,g)},[d,r.onSelect,r.disabled]);function g(){var T,M;b(),(M=(T=s.current).onSelect)==null||M.call(T,u.current)}function b(){c.setState("value",u.current,!0)}if(!d)return null;let{disabled:v,value:I,onSelect:_,forceMount:N,keywords:F,...C}=r;return p.createElement(Or.div,{ref:En(i,e),...C,id:n,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||A.getDisablePointerSelection()?void 0:b,onClick:v?void 0:g},r.children)}),uV=p.forwardRef((r,e)=>{let{heading:a,children:t,forceMount:n,...i}=r,o=Te(),A=p.useRef(null),s=p.useRef(null),l=Te(),u=eA(),c=dn(d=>n||u.filter()===!1?!0:d.search?d.filtered.groups.has(o):!0);ei(()=>u.group(o),[]),Ey(o,A,[r.value,r.heading,s]);let h=p.useMemo(()=>({id:o,forceMount:n}),[n]);return p.createElement(Or.div,{ref:En(A,e),...i,"cmdk-group":"",role:"presentation",hidden:c?void 0:!0},a&&p.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:l},a),Of(r,d=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?l:void 0},p.createElement(yy.Provider,{value:h},d))))}),cV=p.forwardRef((r,e)=>{let{alwaysRender:a,...t}=r,n=p.useRef(null),i=dn(o=>!o.search);return!a&&!i?null:p.createElement(Or.div,{ref:En(n,e),...t,"cmdk-separator":"",role:"separator"})}),dV=p.forwardRef((r,e)=>{let{onValueChange:a,...t}=r,n=r.value!=null,i=Od(),o=dn(l=>l.search),A=dn(l=>l.selectedItemId),s=eA();return p.useEffect(()=>{r.value!=null&&i.setState("search",r.value)},[r.value]),p.createElement(Or.input,{ref:e,...t,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":A,id:s.inputId,type:"text",value:n?r.value:o,onChange:l=>{n||i.setState("search",l.target.value),a==null||a(l.target.value)}})}),hV=p.forwardRef((r,e)=>{let{children:a,label:t="Suggestions",...n}=r,i=p.useRef(null),o=p.useRef(null),A=dn(l=>l.selectedItemId),s=eA();return p.useEffect(()=>{if(o.current&&i.current){let l=o.current,u=i.current,c,h=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let d=l.offsetHeight;u.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return h.observe(l),()=>{cancelAnimationFrame(c),h.unobserve(l)}}},[]),p.createElement(Or.div,{ref:En(i,e),...n,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":A,"aria-label":t,id:s.listId},Of(r,l=>p.createElement("div",{ref:En(o,s.listInnerRef),"cmdk-list-sizer":""},l)))}),bV=p.forwardRef((r,e)=>{let{open:a,onOpenChange:t,overlayClassName:n,contentClassName:i,container:o,...A}=r;return p.createElement(oV,{open:a,onOpenChange:t},p.createElement(dy,{container:o},p.createElement($d,{"cmdk-overlay":"",className:n}),p.createElement(Wd,{"aria-label":r.label,"cmdk-dialog":"",className:i},p.createElement(wy,{ref:e,...A}))))}),mV=p.forwardRef((r,e)=>dn(a=>a.filtered.count===0)?p.createElement(Or.div,{ref:e,...r,"cmdk-empty":"",role:"presentation"}):null),vV=p.forwardRef((r,e)=>{let{progress:a,children:t,label:n="Loading...",...i}=r;return p.createElement(Or.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},Of(r,o=>p.createElement("div",{"aria-hidden":!0},o)))}),Se=Object.assign(wy,{List:hV,Item:lV,Input:dV,Group:uV,Separator:cV,Dialog:bV,Empty:mV,Loading:vV});function gV(r,e){let a=r.nextElementSibling;for(;a;){if(a.matches(e))return a;a=a.nextElementSibling}}function pV(r,e){let a=r.previousElementSibling;for(;a;){if(a.matches(e))return a;a=a.previousElementSibling}}function ky(r){let e=p.useRef(r);return ei(()=>{e.current=r}),e}var ei=typeof window>"u"?p.useEffect:p.useLayoutEffect;function I2(r){let e=p.useRef();return e.current===void 0&&(e.current=r()),e}function dn(r){let e=Od(),a=()=>r(e.snapshot());return p.useSyncExternalStore(e.subscribe,a,a)}function Ey(r,e,a,t=[]){let n=p.useRef(),i=eA();return ei(()=>{var o;let A=(()=>{var l;for(let u of a){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(l=u.current.textContent)==null?void 0:l.trim():n.current}})(),s=t.map(l=>l.trim());i.value(r,A,s),(o=e.current)==null||o.setAttribute(_2,A),n.current=A}),n}var yV=()=>{let[r,e]=p.useState(),a=I2(()=>new Map);return ei(()=>{a.current.forEach(t=>t()),a.current=new Map},[r]),(t,n)=>{a.current.set(t,n),e({})}};function wV(r){let e=r.type;return typeof e=="function"?e(r.props):"render"in e?e.render(r.props):r}function Of({asChild:r,children:e},a){return r&&p.isValidElement(e)?p.cloneElement(wV(e),{ref:e.ref},a(e.props.children)):a(e)}var kV={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const EV=dy,Cy=p.forwardRef(({className:r,...e},a)=>f.jsx($d,{ref:a,className:Zr("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...e}));Cy.displayName=$d.displayName;const CV=p.forwardRef(({className:r,children:e,...a},t)=>f.jsxs(EV,{children:[f.jsx(Cy,{}),f.jsxs(Wd,{ref:t,className:Zr("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a,children:[e,f.jsxs(AV,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[f.jsx(e1,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));CV.displayName=Wd.displayName;const _V=p.forwardRef(({className:r,...e},a)=>f.jsx(hy,{ref:a,className:Zr("text-lg font-semibold leading-none tracking-tight",r),...e}));_V.displayName=hy.displayName;const IV=p.forwardRef(({className:r,...e},a)=>f.jsx(by,{ref:a,className:Zr("text-sm text-muted-foreground",r),...e}));IV.displayName=by.displayName;const _y=p.forwardRef(({className:r,...e},a)=>f.jsx(Se,{ref:a,className:Zr("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",r),...e}));_y.displayName=Se.displayName;const Iy=p.forwardRef(({className:r,...e},a)=>f.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[f.jsx(Aw,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f.jsx(Se.Input,{ref:a,className:Zr("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",r),...e})]}));Iy.displayName=Se.Input.displayName;const By=p.forwardRef(({className:r,...e},a)=>f.jsx(Se.List,{ref:a,className:Zr("max-h-[300px] overflow-y-auto overflow-x-hidden",r),...e}));By.displayName=Se.List.displayName;const Ny=p.forwardRef((r,e)=>f.jsx(Se.Empty,{ref:e,className:"py-6 text-center text-sm",...r}));Ny.displayName=Se.Empty.displayName;const xy=p.forwardRef(({className:r,...e},a)=>f.jsx(Se.Group,{ref:a,className:Zr("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",r),...e}));xy.displayName=Se.Group.displayName;const BV=p.forwardRef(({className:r,...e},a)=>f.jsx(Se.Separator,{ref:a,className:Zr("-mx-1 h-px bg-border",r),...e}));BV.displayName=Se.Separator.displayName;const Zy=p.forwardRef(({className:r,...e},a)=>f.jsx(Se.Item,{ref:a,className:Zr("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",r),...e}));Zy.displayName=Se.Item.displayName;const NV=async(r,e)=>{const{data:a}=await v0.get(`${r}/api/kyb/mcc-codes`,{headers:{"X-API-Key":e,"Content-Type":"application/json"}});if(!a.success||!Array.isArray(a.data))throw new Error("Invalid MCC codes response");return a.data},xV=(r,e)=>eb({queryKey:["mcc-codes",r,e],queryFn:()=>NV(r,e),enabled:!!r&&!!e}),Sy=p.forwardRef(({value:r,onValueChange:e,apiEndpoint:a,apiKey:t,placeholder:n="Search by code or description...",disabled:i=!1,className:o,"data-testid":A},s)=>{const[l,u]=p.useState(!1),c=p.useRef(null),{data:h=[],isLoading:d,isError:g}=xV(a,t),b=h.find(T=>T.code===r),v=T=>{e(T),u(!1)},I=(T,M)=>{if(!c.current)return!1;const Q=c.current.getBoundingClientRect();return T>=Q.left&&T<=Q.right&&M>=Q.top&&M<=Q.bottom},_=T=>{var er,L,ar,P,Y;const M=T.target;if((er=c.current)!=null&&er.contains(M)){T.preventDefault();return}const Q=T,rr=Q.clientX??((ar=(L=Q.touches)==null?void 0:L[0])==null?void 0:ar.clientX),R=Q.clientY??((Y=(P=Q.touches)==null?void 0:P[0])==null?void 0:Y.clientY);typeof rr=="number"&&typeof R=="number"&&I(rr,R)&&T.preventDefault()},N=T=>{var M;(M=c.current)!=null&&M.contains(document.activeElement)&&T.preventDefault()},F=T=>T.stopPropagation(),C=()=>{var T;document.activeElement instanceof HTMLInputElement&&((T=c.current)!=null&&T.contains(document.activeElement))&&document.activeElement.blur()};return f.jsxs(xs,{open:l,onOpenChange:u,modal:!1,children:[f.jsx(Zs,{asChild:!0,children:f.jsxs(g0,{ref:s,variant:"outline",role:"combobox","aria-expanded":l,disabled:i||d,"data-testid":A,className:Zr("h-10 w-full justify-between font-normal",!r&&"text-muted-foreground",o),children:[d?f.jsxs(f.Fragment,{children:[f.jsx(Pt,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading codes..."]}):g?f.jsx("span",{className:"text-destructive",children:"Failed to load codes"}):b?f.jsxs("span",{className:"truncate",children:[b.code," - ",b.description]}):n,f.jsx(nw,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),f.jsx(Fo,{className:"z-[100] w-[var(--radix-popover-trigger-width)] p-0",align:"start",onPointerDownOutside:_,onInteractOutside:_,onFocusOutside:N,children:f.jsx("div",{ref:c,onPointerDown:F,onPointerUp:F,onClick:F,children:f.jsxs(_y,{className:"flex flex-col overflow-hidden",style:{maxHeight:360,display:"flex",flexDirection:"column",overflow:"hidden"},shouldFilter:!0,filter:(T,M)=>{const Q=M.toLowerCase().trim(),rr=" ​ ",R=T.indexOf(rr),er=R>=0?T.slice(0,R):T,L=R>=0?T.slice(R+rr.length):"";return er.toLowerCase().includes(Q)||L.toLowerCase().includes(Q)?1:0},children:[f.jsx(Iy,{placeholder:"Search by code or description..."}),f.jsxs(By,{className:"min-h-0 flex-1 touch-pan-y",style:{minHeight:0,flex:1,overflowY:"auto",overflowX:"hidden",maxHeight:280,WebkitOverflowScrolling:"touch"},onTouchStart:C,children:[f.jsx(Ny,{children:"No MCC code found."}),f.jsx(xy,{children:h.map(T=>f.jsxs(Zy,{value:`${T.code} ​ ${T.description}`,onSelect:()=>v(T.code),className:"flex items-center gap-2",children:[f.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:f.jsx(L2,{className:Zr("h-4 w-4",r===T.code?"opacity-100":"opacity-0")})}),f.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[T.code," — ",T.description]})]},T.code))})]})]})})})]})});Sy.displayName="MccCodeSelect";const ZV=On({registration_number:qr().min(1,"Registration number is required"),mcc_code:qr().min(1,"MCC code is required"),country:qr().min(1,"Country is required"),company_name:qr().min(2,"Company name must be at least 2 characters"),tax_identity_number:qr().min(1,"Tax identity number is required"),doing_business_as:qr().trim().min(1,"Doing Business As (DBA) is required"),corporate_type:qr().min(1,"Corporate type is required"),date_of_establishment:bI.date({required_error:"Date of establishment is required"})}),SV=[{value:"us",label:"United States"},{value:"uk",label:"United Kingdom"},{value:"ca",label:"Canada"},{value:"au",label:"Australia"},{value:"de",label:"Germany"},{value:"fr",label:"France"}],FV=[{value:"llc",label:"LLC"},{value:"corporation",label:"Corporation"},{value:"partnership",label:"Partnership"},{value:"sole-proprietorship",label:"Sole Proprietorship"}],$V=({data:r,onDataChange:e,onContinue:a,onBack:t,renderProgress:n,apiEndpoint:i,apiKey:o})=>{const A=Fn({resolver:$n(ZV),defaultValues:{registration_number:r.registration_number,mcc_code:r.mcc_code??"",country:r.country,company_name:r.company_name,doing_business_as:r.doing_business_as||"",tax_identity_number:r.tax_identity_number,corporate_type:r.corporate_type,date_of_establishment:r.date_of_establishment?new Date(r.date_of_establishment):void 0}}),s=l=>{e(l),a(l)};return f.jsxs(K0,{className:"w-full max-w-2xl mx-auto",children:[f.jsx(lt,{children:f.jsx(pt,{title:"Business Information",subTitle:"Please provide your business details",onBack:t})}),f.jsxs(q0,{children:[f.jsx(Mn,{...A,children:f.jsxs("form",{onSubmit:A.handleSubmit(s),className:"space-y-6",children:[f.jsx(Rr,{control:A.control,name:"registration_number",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Registration Number"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter registration number",...l})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"mcc_code",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"MCC Code"}),f.jsx(Gr,{children:f.jsx(Sy,{value:l.value,onValueChange:l.onChange,apiEndpoint:i,apiKey:o,placeholder:"Search by code or description..."})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"country",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Country"}),f.jsx(Gr,{children:f.jsx(C2,{value:l.value,onValueChange:l.onChange,options:SV,placeholder:"Enter country",name:"country"})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"company_name",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Company Name"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter company name",...l})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"doing_business_as",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Doing Business As (DBA)"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter Doing Business As (DBA)",...l})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"tax_identity_number",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Tax Identity Number"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter tax identity number",...l})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"corporate_type",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Corporate Type"}),f.jsx(Gr,{children:f.jsx(C2,{value:l.value,onValueChange:l.onChange,options:FV,placeholder:"Enter corporate type",name:"corporate_type"})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"date_of_establishment",render:({field:l})=>f.jsxs(Mr,{className:"flex flex-col",children:[f.jsx(Hr,{children:"Date of Establishment"}),f.jsxs(xs,{modal:!0,children:[f.jsx(Zs,{asChild:!0,children:f.jsx(Gr,{children:f.jsxs(g0,{variant:"outline",className:Zr("w-full pl-3 text-left font-normal",!l.value&&"text-muted-foreground"),children:[l.value?ja(l.value,"PPP"):f.jsx("span",{children:"Pick a date"}),f.jsx(r1,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),f.jsx(Fo,{className:"w-auto p-0",align:"start",onOpenAutoFocus:u=>u.preventDefault(),children:f.jsx(Vs,{mode:"single",selected:l.value,onSelect:l.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:u=>u>new Date,initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),f.jsx(Xr,{})]})}),f.jsx(g0,{type:"submit",className:"w-full",children:"Continue"})]})}),f.jsx("div",{className:"mt-6",children:n()})]})]})},WV=H3(new Date),TV=On({full_name:qr().min(2,"Full name must be at least 2 characters"),title:qr().min(1,"Title is required"),email:qr().email("Invalid email").optional(),birth:$3({required_error:"Birth date is required"}).refine(r=>es(r,WV),{message:"You must be at least 16 years old"}),phone_number:qr().min(1,"Phone number is required").refine(r=>_m(r),{message:"Invalid phone number"})}).superRefine((r,e)=>{r.email||e.addIssue({path:["email"],message:"Email is required",code:sr.custom})}),PV=({data:r,onDataChange:e,onContinue:a,onBack:t,renderProgress:n})=>{const i=Fn({resolver:$n(TV),defaultValues:{full_name:r.full_name,title:r.title,email:r.email||"",birth:r.birth||void 0,phone_number:r.phone_number}}),o=A=>{e(A),a(A)};return f.jsxs(K0,{className:"w-full max-w-2xl mx-auto",children:[f.jsx(lt,{children:f.jsx(pt,{title:"Personal Details",subTitle:"Please provide your personal information",onBack:t})}),f.jsxs(q0,{children:[f.jsx(Mn,{...i,children:f.jsxs("form",{onSubmit:i.handleSubmit(o),className:"space-y-6",children:[f.jsx(Rr,{control:i.control,name:"full_name",render:({field:A})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Full Name"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter your full name",...A})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"title",render:({field:A})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Title"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"e.g., CEO, Director, Manager",...A})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"email",render:({field:A})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Email"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"example@gmail.com",...A})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"birth",render:({field:A})=>f.jsxs(Mr,{className:"flex flex-col",children:[f.jsx(Hr,{children:"Date of Birth"}),f.jsxs(xs,{modal:!0,children:[f.jsx(Zs,{asChild:!0,children:f.jsx(Gr,{children:f.jsxs(g0,{variant:"outline",className:Zr("w-full pl-3 text-left font-normal",!A.value&&"text-muted-foreground"),children:[A.value?ja(A.value,"PPP"):f.jsx("span",{children:"Pick a date"}),f.jsx(r1,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),f.jsx(Fo,{className:"w-auto p-0",align:"start",onOpenAutoFocus:s=>s.preventDefault(),children:f.jsx(Vs,{mode:"single",selected:A.value,onSelect:A.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:s=>s>new Date||s<new Date("1900-01-01"),initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"phone_number",render:({field:A})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Phone Number"}),f.jsx(Gr,{children:f.jsx(J8,{control:i.control,name:"phone_number",placeholder:"Enter your phone number",defaultCountry:"US"})}),f.jsx(Xr,{})]})}),f.jsx(g0,{type:"submit",className:"w-full",children:"Continue"})]})}),f.jsx("div",{className:"mt-6",children:n()})]})]})},OV=On({inventory_maintained:qr().min(1,"Please select an inventory option"),offsite_address:qr().optional(),fulfillment_agreement:qA(File).nullable().optional(),other_companies_involved:qr().min(1,"Please select an option"),other_fulfillment_agreement:qA(File).nullable().optional(),recurring_services:qr().min(1,"Please select an option"),recurring_services_description:qr().optional(),fulfillment_time:qr().min(1,"Please select a fulfillment time"),delivery_time:qr().min(1,"Please select a delivery time"),charge_time:qr().min(1,"Please select a charge time"),return_policy:qr().min(1,"Return policy is required"),bankruptcy_filed:qr().min(1,"Please select an option"),was_terminated_from_card_acceptance:qr().min(1,"Please select an option"),has_coa:qr().min(1,"Please select an option"),coa_document:qA(File).nullable().optional()}).superRefine((r,e)=>{var a,t;r.inventory_maintained==="off-site"&&!((a=r.offsite_address)!=null&&a.trim())&&e.addIssue({code:sr.custom,message:"Warehouse address is required when inventory is maintained off-site",path:["offsite_address"]}),r.inventory_maintained==="third-party"&&!r.fulfillment_agreement&&e.addIssue({code:sr.custom,message:"Fulfillment agreement file is required when using a third-party fulfillment center",path:["fulfillment_agreement"]}),r.other_companies_involved==="yes"&&!r.other_fulfillment_agreement&&e.addIssue({code:sr.custom,message:"Fulfillment agreement file is required when other companies are involved",path:["other_fulfillment_agreement"]}),r.recurring_services==="yes"&&!((t=r.recurring_services_description)!=null&&t.trim())&&e.addIssue({code:sr.custom,message:"Recurring services description is required when offering recurring services",path:["recurring_services_description"]}),r.has_coa==="yes"&&!r.coa_document&&e.addIssue({code:sr.custom,message:"Certificate of Analysis document is required when COA is available",path:["coa_document"]})}),DV=[{value:"on-site",label:"On-Site"},{value:"off-site",label:"Off-Site (e.g., Warehouse)"},{value:"third-party",label:"3rd Party Fulfillment Center"},{value:"service-only",label:"Service Only (No Products Sold)"}],Df=[{value:"no",label:"No"},{value:"yes",label:"Yes"}],VV=[{value:"24-hours",label:"Within 24 Hours"},{value:"2-days",label:"2 Days"},{value:"3-10-days",label:"3-10 Days"},{value:"11-30-days",label:"11-30 Days"},{value:"31-90-days",label:"31-90 Days"},{value:"90-plus-days",label:"90+ Days"}],MV=[{value:"24-hours",label:"Within 24 Hours"},{value:"2-5-days",label:"2-5 Days"},{value:"6-10-days",label:"6-10 Days"},{value:"11-plus-days",label:"11+ Days"}],GV=[{value:"time-of-order",label:"Time of Order"},{value:"upon-shipment",label:"Upon Shipment"}],XV=[{value:"business-bankruptcy",label:"Business Bankruptcy"},{value:"personal-bankruptcy",label:"Personal Bankruptcy"},{value:"never",label:"Never"}],RV=({data:r,onDataChange:e,onContinue:a,onBack:t,renderProgress:n})=>{const i=Fn({resolver:$n(OV),defaultValues:{inventory_maintained:r.inventory_maintained||"",offsite_address:r.offsite_address||"",fulfillment_agreement:r.fulfillment_agreement||null,other_companies_involved:r.other_companies_involved||"",other_fulfillment_agreement:r.other_fulfillment_agreement||null,recurring_services:r.recurring_services||"",recurring_services_description:r.recurring_services_description||"",fulfillment_time:r.fulfillment_time||"",delivery_time:r.delivery_time||"",charge_time:r.charge_time||"",return_policy:r.return_policy||"",bankruptcy_filed:r.bankruptcy_filed||"",was_terminated_from_card_acceptance:r.was_terminated_from_card_acceptance||"",has_coa:r.has_coa||"",coa_document:r.coa_document||null}}),{isSubmitting:o}=i.formState,A=async d=>{const g={...d};d.inventory_maintained!=="off-site"&&delete g.offsite_address,d.inventory_maintained!=="third-party"&&delete g.fulfillment_agreement,d.other_companies_involved!=="yes"&&delete g.other_fulfillment_agreement,d.recurring_services!=="yes"&&delete g.recurring_services_description,d.has_coa!=="yes"&&delete g.coa_document,e(g),await a(g)},s=i.watch("inventory_maintained"),l=i.watch("other_companies_involved"),u=i.watch("recurring_services"),c=i.watch("has_coa"),h=(d,g)=>{const b=g&&g.length>0?g[0]:null;i.setValue(d,b,{shouldValidate:!0}),e({[d]:b})};return f.jsxs(K0,{className:"w-full max-w-2xl mx-auto",children:[f.jsx(lt,{children:f.jsx(pt,{title:"Business Questionnaire",subTitle:"Provide details about your business operations",onBack:t})}),f.jsxs(q0,{children:[f.jsx(Mn,{...i,children:f.jsxs("form",{onSubmit:i.handleSubmit(A),className:"space-y-6",children:[f.jsx(Rr,{control:i.control,name:"inventory_maintained",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Inventory Maintained"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select inventory option"})})}),f.jsx(_a,{children:DV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),s==="off-site"&&f.jsx(Rr,{control:i.control,name:"offsite_address",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Warehouse Address"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter warehouse address",...d,disabled:o})}),f.jsx(Xr,{})]})}),s==="third-party"&&f.jsx(Rr,{control:i.control,name:"fulfillment_agreement",render:()=>{var d;return f.jsxs(Mr,{children:[f.jsx(Gr,{children:f.jsx(qo,{label:"Fulfillment Agreement",placeholder:"Upload fulfillment agreement",hint:"Upload fully executed fulfillment agreement with 3rd party",accept:"image/*,application/pdf,.pdf",onFileSelect:g=>h("fulfillment_agreement",g),error:(d=i.formState.errors.fulfillment_agreement)==null?void 0:d.message,isSubmitting:o,disabled:o})}),f.jsx(Xr,{})]})}}),f.jsx(Rr,{control:i.control,name:"other_companies_involved",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Are there any other companies involved in shipping or fulfilling product/service?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:Df.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),l==="yes"&&f.jsx(Rr,{control:i.control,name:"other_fulfillment_agreement",render:()=>{var d;return f.jsxs(Mr,{children:[f.jsx(Gr,{children:f.jsx(qo,{label:"Fulfillment Agreement for Other Companies",placeholder:"Upload fulfillment agreement",hint:"Upload fully executed fulfillment agreement",accept:"image/*,application/pdf,.pdf",onFileSelect:g=>h("other_fulfillment_agreement",g),error:(d=i.formState.errors.other_fulfillment_agreement)==null?void 0:d.message,isSubmitting:o,disabled:o})}),f.jsx(Xr,{})]})}}),f.jsx(Rr,{control:i.control,name:"recurring_services",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Do you offer recurring or time-extended services?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:Df.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),u==="yes"&&f.jsx(Rr,{control:i.control,name:"recurring_services_description",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Recurring Services Description and Duration"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"e.g., Monthly subscription, 12-month plan",...d,disabled:o})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"has_coa",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Do you have a Certificate of Analysis (COA) for your product(s)?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:Df.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),c==="yes"&&f.jsx(Rr,{control:i.control,name:"coa_document",render:()=>{var d;return f.jsxs(Mr,{children:[f.jsx(Gr,{children:f.jsx(qo,{label:"Certificate of Analysis",placeholder:"Upload COA document",hint:"Upload the Certificate of Analysis document",accept:"image/*,application/pdf,.pdf",onFileSelect:g=>h("coa_document",g),error:(d=i.formState.errors.coa_document)==null?void 0:d.message,isSubmitting:o,disabled:o})}),f.jsx(Xr,{})]})}}),f.jsx(Rr,{control:i.control,name:"fulfillment_time",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"How long after charging the customer is the product fulfilled or service begun?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select fulfillment time"})})}),f.jsx(_a,{children:VV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"delivery_time",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"How long after order does the cardholder receive the product/service?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select delivery time"})})}),f.jsx(_a,{children:MV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"charge_time",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"When is the cardholder charged?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select charge time"})})}),f.jsx(_a,{children:GV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"bankruptcy_filed",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Have you (your business or any principal) filed bankruptcy?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:XV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"was_terminated_from_card_acceptance",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Have you (your business or any principal) ever been terminated from accepting bank cards?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:Df.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"return_policy",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Return Policy"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Describe your return policy",...d,disabled:o})}),f.jsx(Xr,{})]})}),f.jsx(g0,{type:"submit",className:"w-full",disabled:o,children:o?"Submitting...":"Continue"})]})}),f.jsx("div",{className:"mt-6",children:n()})]})]})};var Dd="Progress",Vd=100,[jV]=Wt(Dd),[LV,UV]=jV(Dd),Fy=p.forwardRef((r,e)=>{const{__scopeProgress:a,value:t=null,max:n,getValueLabel:i=YV,...o}=r;(n||n===0)&&!Py(n)&&console.error(HV(`${n}`,"Progress"));const A=Py(n)?n:Vd;t!==null&&!Oy(t,A)&&console.error(QV(`${t}`,"Progress"));const s=Oy(t,A)?t:null,l=Vf(s)?i(s,A):void 0;return f.jsx(LV,{scope:a,value:s,max:A,children:f.jsx(Or.div,{"aria-valuemax":A,"aria-valuemin":0,"aria-valuenow":Vf(s)?s:void 0,"aria-valuetext":l,role:"progressbar","data-state":Ty(s,A),"data-value":s??void 0,"data-max":A,...o,ref:e})})});Fy.displayName=Dd;var $y="ProgressIndicator",Wy=p.forwardRef((r,e)=>{const{__scopeProgress:a,...t}=r,n=UV($y,a);return f.jsx(Or.div,{"data-state":Ty(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...t,ref:e})});Wy.displayName=$y;function YV(r,e){return`${Math.round(r/e*100)}%`}function Ty(r,e){return r==null?"indeterminate":r===e?"complete":"loading"}function Vf(r){return typeof r=="number"}function Py(r){return Vf(r)&&!isNaN(r)&&r>0}function Oy(r,e){return Vf(r)&&!isNaN(r)&&r<=e&&r>=0}function HV(r,e){return`Invalid prop \`max\` of value \`${r}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Vd}\`.`}function QV(r,e){return`Invalid prop \`value\` of value \`${r}\` supplied to \`${e}\`. The \`value\` prop must be:
290
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return p.useEffect(()=>{r&&(document.getElementById(r)||console.error(a))},[a,r]),null},nV="DialogDescriptionWarning",iV=({contentRef:r,descriptionId:e})=>{const t=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${cy(nV).contentName}}.`;return p.useEffect(()=>{var i;const n=(i=r.current)==null?void 0:i.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(t))},[t,r,e]),null},oV=qp,dy=ay,$d=ty,Wd=ny,hy=oy,by=sy,AV=ly,rA='[cmdk-group=""]',Td='[cmdk-group-items=""]',sV='[cmdk-group-heading=""]',my='[cmdk-item=""]',vy=`${my}:not([aria-disabled="true"])`,Pd="cmdk-item-select",_2="data-value",fV=(r,e,a)=>QD(r,e,a),gy=p.createContext(void 0),eA=()=>p.useContext(gy),py=p.createContext(void 0),Od=()=>p.useContext(py),yy=p.createContext(void 0),wy=p.forwardRef((r,e)=>{let a=I2(()=>{var E,Z;return{search:"",value:(Z=(E=r.value)!=null?E:r.defaultValue)!=null?Z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),t=I2(()=>new Set),n=I2(()=>new Map),i=I2(()=>new Map),o=I2(()=>new Set),A=ky(r),{label:s,children:l,value:u,onValueChange:c,filter:h,shouldFilter:d,loop:g,disablePointerSelection:b=!1,vimBindings:v=!0,...I}=r,_=Te(),N=Te(),F=Te(),C=p.useRef(null),T=yV();ei(()=>{if(u!==void 0){let E=u.trim();a.current.value=E,M.emit()}},[u]),ei(()=>{T(6,ar)},[]);let M=p.useMemo(()=>({subscribe:E=>(o.current.add(E),()=>o.current.delete(E)),snapshot:()=>a.current,setState:(E,Z,B)=>{var S,O,W,U;if(!Object.is(a.current[E],Z)){if(a.current[E]=Z,E==="search")L(),R(),T(1,er);else if(E==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let K=document.getElementById(F);K?K.focus():(S=document.getElementById(_))==null||S.focus()}if(T(7,()=>{var K;a.current.selectedItemId=(K=P())==null?void 0:K.id,M.emit()}),B||T(5,ar),((O=A.current)==null?void 0:O.value)!==void 0){let K=Z??"";(U=(W=A.current).onValueChange)==null||U.call(W,K);return}}M.emit()}},emit:()=>{o.current.forEach(E=>E())}}),[]),Q=p.useMemo(()=>({value:(E,Z,B)=>{var S;Z!==((S=i.current.get(E))==null?void 0:S.value)&&(i.current.set(E,{value:Z,keywords:B}),a.current.filtered.items.set(E,rr(Z,B)),T(2,()=>{R(),M.emit()}))},item:(E,Z)=>(t.current.add(E),Z&&(n.current.has(Z)?n.current.get(Z).add(E):n.current.set(Z,new Set([E]))),T(3,()=>{L(),R(),a.current.value||er(),M.emit()}),()=>{i.current.delete(E),t.current.delete(E),a.current.filtered.items.delete(E);let B=P();T(4,()=>{L(),(B==null?void 0:B.getAttribute("id"))===E&&er(),M.emit()})}),group:E=>(n.current.has(E)||n.current.set(E,new Set),()=>{i.current.delete(E),n.current.delete(E)}),filter:()=>A.current.shouldFilter,label:s||r["aria-label"],getDisablePointerSelection:()=>A.current.disablePointerSelection,listId:_,inputId:F,labelId:N,listInnerRef:C}),[]);function rr(E,Z){var B,S;let O=(S=(B=A.current)==null?void 0:B.filter)!=null?S:fV;return E?O(E,a.current.search,Z):0}function R(){if(!a.current.search||A.current.shouldFilter===!1)return;let E=a.current.filtered.items,Z=[];a.current.filtered.groups.forEach(S=>{let O=n.current.get(S),W=0;O.forEach(U=>{let K=E.get(U);W=Math.max(K,W)}),Z.push([S,W])});let B=C.current;Y().sort((S,O)=>{var W,U;let K=S.getAttribute("id"),H=O.getAttribute("id");return((W=E.get(H))!=null?W:0)-((U=E.get(K))!=null?U:0)}).forEach(S=>{let O=S.closest(Td);O?O.appendChild(S.parentElement===O?S:S.closest(`${Td} > *`)):B.appendChild(S.parentElement===B?S:S.closest(`${Td} > *`))}),Z.sort((S,O)=>O[1]-S[1]).forEach(S=>{var O;let W=(O=C.current)==null?void 0:O.querySelector(`${rA}[${_2}="${encodeURIComponent(S[0])}"]`);W==null||W.parentElement.appendChild(W)})}function er(){let E=Y().find(B=>B.getAttribute("aria-disabled")!=="true"),Z=E==null?void 0:E.getAttribute(_2);M.setState("value",Z||void 0)}function L(){var E,Z,B,S;if(!a.current.search||A.current.shouldFilter===!1){a.current.filtered.count=t.current.size;return}a.current.filtered.groups=new Set;let O=0;for(let W of t.current){let U=(Z=(E=i.current.get(W))==null?void 0:E.value)!=null?Z:"",K=(S=(B=i.current.get(W))==null?void 0:B.keywords)!=null?S:[],H=rr(U,K);a.current.filtered.items.set(W,H),H>0&&O++}for(let[W,U]of n.current)for(let K of U)if(a.current.filtered.items.get(K)>0){a.current.filtered.groups.add(W);break}a.current.filtered.count=O}function ar(){var E,Z,B;let S=P();S&&(((E=S.parentElement)==null?void 0:E.firstChild)===S&&((B=(Z=S.closest(rA))==null?void 0:Z.querySelector(sV))==null||B.scrollIntoView({block:"nearest"})),S.scrollIntoView({block:"nearest"}))}function P(){var E;return(E=C.current)==null?void 0:E.querySelector(`${my}[aria-selected="true"]`)}function Y(){var E;return Array.from(((E=C.current)==null?void 0:E.querySelectorAll(vy))||[])}function j(E){let Z=Y()[E];Z&&M.setState("value",Z.getAttribute(_2))}function V(E){var Z;let B=P(),S=Y(),O=S.findIndex(U=>U===B),W=S[O+E];(Z=A.current)!=null&&Z.loop&&(W=O+E<0?S[S.length-1]:O+E===S.length?S[0]:S[O+E]),W&&M.setState("value",W.getAttribute(_2))}function m(E){let Z=P(),B=Z==null?void 0:Z.closest(rA),S;for(;B&&!S;)B=E>0?gV(B,rA):pV(B,rA),S=B==null?void 0:B.querySelector(vy);S?M.setState("value",S.getAttribute(_2)):V(E)}let w=()=>j(Y().length-1),y=E=>{E.preventDefault(),E.metaKey?w():E.altKey?m(1):V(1)},k=E=>{E.preventDefault(),E.metaKey?j(0):E.altKey?m(-1):V(-1)};return p.createElement(Or.div,{ref:e,tabIndex:-1,...I,"cmdk-root":"",onKeyDown:E=>{var Z;(Z=I.onKeyDown)==null||Z.call(I,E);let B=E.nativeEvent.isComposing||E.keyCode===229;if(!(E.defaultPrevented||B))switch(E.key){case"n":case"j":{v&&E.ctrlKey&&y(E);break}case"ArrowDown":{y(E);break}case"p":case"k":{v&&E.ctrlKey&&k(E);break}case"ArrowUp":{k(E);break}case"Home":{E.preventDefault(),j(0);break}case"End":{E.preventDefault(),w();break}case"Enter":{E.preventDefault();let S=P();if(S){let O=new Event(Pd);S.dispatchEvent(O)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:Q.inputId,id:Q.labelId,style:kV},s),Of(r,E=>p.createElement(py.Provider,{value:M},p.createElement(gy.Provider,{value:Q},E))))}),lV=p.forwardRef((r,e)=>{var a,t;let n=Te(),i=p.useRef(null),o=p.useContext(yy),A=eA(),s=ky(r),l=(t=(a=s.current)==null?void 0:a.forceMount)!=null?t:o==null?void 0:o.forceMount;ei(()=>{if(!l)return A.item(n,o==null?void 0:o.id)},[l]);let u=Ey(n,i,[r.value,r.children,i],r.keywords),c=Od(),h=dn(T=>T.value&&T.value===u.current),d=dn(T=>l||A.filter()===!1?!0:T.search?T.filtered.items.get(n)>0:!0);p.useEffect(()=>{let T=i.current;if(!(!T||r.disabled))return T.addEventListener(Pd,g),()=>T.removeEventListener(Pd,g)},[d,r.onSelect,r.disabled]);function g(){var T,M;b(),(M=(T=s.current).onSelect)==null||M.call(T,u.current)}function b(){c.setState("value",u.current,!0)}if(!d)return null;let{disabled:v,value:I,onSelect:_,forceMount:N,keywords:F,...C}=r;return p.createElement(Or.div,{ref:En(i,e),...C,id:n,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||A.getDisablePointerSelection()?void 0:b,onClick:v?void 0:g},r.children)}),uV=p.forwardRef((r,e)=>{let{heading:a,children:t,forceMount:n,...i}=r,o=Te(),A=p.useRef(null),s=p.useRef(null),l=Te(),u=eA(),c=dn(d=>n||u.filter()===!1?!0:d.search?d.filtered.groups.has(o):!0);ei(()=>u.group(o),[]),Ey(o,A,[r.value,r.heading,s]);let h=p.useMemo(()=>({id:o,forceMount:n}),[n]);return p.createElement(Or.div,{ref:En(A,e),...i,"cmdk-group":"",role:"presentation",hidden:c?void 0:!0},a&&p.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:l},a),Of(r,d=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?l:void 0},p.createElement(yy.Provider,{value:h},d))))}),cV=p.forwardRef((r,e)=>{let{alwaysRender:a,...t}=r,n=p.useRef(null),i=dn(o=>!o.search);return!a&&!i?null:p.createElement(Or.div,{ref:En(n,e),...t,"cmdk-separator":"",role:"separator"})}),dV=p.forwardRef((r,e)=>{let{onValueChange:a,...t}=r,n=r.value!=null,i=Od(),o=dn(l=>l.search),A=dn(l=>l.selectedItemId),s=eA();return p.useEffect(()=>{r.value!=null&&i.setState("search",r.value)},[r.value]),p.createElement(Or.input,{ref:e,...t,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":A,id:s.inputId,type:"text",value:n?r.value:o,onChange:l=>{n||i.setState("search",l.target.value),a==null||a(l.target.value)}})}),hV=p.forwardRef((r,e)=>{let{children:a,label:t="Suggestions",...n}=r,i=p.useRef(null),o=p.useRef(null),A=dn(l=>l.selectedItemId),s=eA();return p.useEffect(()=>{if(o.current&&i.current){let l=o.current,u=i.current,c,h=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let d=l.offsetHeight;u.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return h.observe(l),()=>{cancelAnimationFrame(c),h.unobserve(l)}}},[]),p.createElement(Or.div,{ref:En(i,e),...n,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":A,"aria-label":t,id:s.listId},Of(r,l=>p.createElement("div",{ref:En(o,s.listInnerRef),"cmdk-list-sizer":""},l)))}),bV=p.forwardRef((r,e)=>{let{open:a,onOpenChange:t,overlayClassName:n,contentClassName:i,container:o,...A}=r;return p.createElement(oV,{open:a,onOpenChange:t},p.createElement(dy,{container:o},p.createElement($d,{"cmdk-overlay":"",className:n}),p.createElement(Wd,{"aria-label":r.label,"cmdk-dialog":"",className:i},p.createElement(wy,{ref:e,...A}))))}),mV=p.forwardRef((r,e)=>dn(a=>a.filtered.count===0)?p.createElement(Or.div,{ref:e,...r,"cmdk-empty":"",role:"presentation"}):null),vV=p.forwardRef((r,e)=>{let{progress:a,children:t,label:n="Loading...",...i}=r;return p.createElement(Or.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},Of(r,o=>p.createElement("div",{"aria-hidden":!0},o)))}),Se=Object.assign(wy,{List:hV,Item:lV,Input:dV,Group:uV,Separator:cV,Dialog:bV,Empty:mV,Loading:vV});function gV(r,e){let a=r.nextElementSibling;for(;a;){if(a.matches(e))return a;a=a.nextElementSibling}}function pV(r,e){let a=r.previousElementSibling;for(;a;){if(a.matches(e))return a;a=a.previousElementSibling}}function ky(r){let e=p.useRef(r);return ei(()=>{e.current=r}),e}var ei=typeof window>"u"?p.useEffect:p.useLayoutEffect;function I2(r){let e=p.useRef();return e.current===void 0&&(e.current=r()),e}function dn(r){let e=Od(),a=()=>r(e.snapshot());return p.useSyncExternalStore(e.subscribe,a,a)}function Ey(r,e,a,t=[]){let n=p.useRef(),i=eA();return ei(()=>{var o;let A=(()=>{var l;for(let u of a){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(l=u.current.textContent)==null?void 0:l.trim():n.current}})(),s=t.map(l=>l.trim());i.value(r,A,s),(o=e.current)==null||o.setAttribute(_2,A),n.current=A}),n}var yV=()=>{let[r,e]=p.useState(),a=I2(()=>new Map);return ei(()=>{a.current.forEach(t=>t()),a.current=new Map},[r]),(t,n)=>{a.current.set(t,n),e({})}};function wV(r){let e=r.type;return typeof e=="function"?e(r.props):"render"in e?e.render(r.props):r}function Of({asChild:r,children:e},a){return r&&p.isValidElement(e)?p.cloneElement(wV(e),{ref:e.ref},a(e.props.children)):a(e)}var kV={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const EV=dy,Cy=p.forwardRef(({className:r,...e},a)=>f.jsx($d,{ref:a,className:Zr("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...e}));Cy.displayName=$d.displayName;const CV=p.forwardRef(({className:r,children:e,...a},t)=>f.jsxs(EV,{children:[f.jsx(Cy,{}),f.jsxs(Wd,{ref:t,className:Zr("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a,children:[e,f.jsxs(AV,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[f.jsx(e1,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));CV.displayName=Wd.displayName;const _V=p.forwardRef(({className:r,...e},a)=>f.jsx(hy,{ref:a,className:Zr("text-lg font-semibold leading-none tracking-tight",r),...e}));_V.displayName=hy.displayName;const IV=p.forwardRef(({className:r,...e},a)=>f.jsx(by,{ref:a,className:Zr("text-sm text-muted-foreground",r),...e}));IV.displayName=by.displayName;const _y=p.forwardRef(({className:r,...e},a)=>f.jsx(Se,{ref:a,className:Zr("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",r),...e}));_y.displayName=Se.displayName;const Iy=p.forwardRef(({className:r,...e},a)=>f.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[f.jsx(Aw,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f.jsx(Se.Input,{ref:a,className:Zr("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",r),...e})]}));Iy.displayName=Se.Input.displayName;const By=p.forwardRef(({className:r,...e},a)=>f.jsx(Se.List,{ref:a,className:Zr("max-h-[300px] overflow-y-auto overflow-x-hidden",r),...e}));By.displayName=Se.List.displayName;const Ny=p.forwardRef((r,e)=>f.jsx(Se.Empty,{ref:e,className:"py-6 text-center text-sm",...r}));Ny.displayName=Se.Empty.displayName;const xy=p.forwardRef(({className:r,...e},a)=>f.jsx(Se.Group,{ref:a,className:Zr("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",r),...e}));xy.displayName=Se.Group.displayName;const BV=p.forwardRef(({className:r,...e},a)=>f.jsx(Se.Separator,{ref:a,className:Zr("-mx-1 h-px bg-border",r),...e}));BV.displayName=Se.Separator.displayName;const Zy=p.forwardRef(({className:r,...e},a)=>f.jsx(Se.Item,{ref:a,className:Zr("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",r),...e}));Zy.displayName=Se.Item.displayName;const NV=async(r,e)=>{const{data:a}=await v0.get(`${r}/api/kyb/mcc-codes`,{headers:{"X-API-Key":e,"Content-Type":"application/json"}});if(!a.success||!Array.isArray(a.data))throw new Error("Invalid MCC codes response");return a.data},xV=(r,e)=>eb({queryKey:["mcc-codes",r,e],queryFn:()=>NV(r,e),enabled:!!r&&!!e}),Sy=p.forwardRef(({value:r,onValueChange:e,apiEndpoint:a,apiKey:t,placeholder:n="Search by code or description...",disabled:i=!1,className:o,"data-testid":A},s)=>{const[l,u]=p.useState(!1),c=p.useRef(null),{data:h=[],isLoading:d,isError:g}=xV(a,t),b=h.find(T=>T.code===r),v=T=>{e(T),u(!1)},I=(T,M)=>{if(!c.current)return!1;const Q=c.current.getBoundingClientRect();return T>=Q.left&&T<=Q.right&&M>=Q.top&&M<=Q.bottom},_=T=>{var er,L,ar,P,Y;const M=T.target;if((er=c.current)!=null&&er.contains(M)){T.preventDefault();return}const Q=T,rr=Q.clientX??((ar=(L=Q.touches)==null?void 0:L[0])==null?void 0:ar.clientX),R=Q.clientY??((Y=(P=Q.touches)==null?void 0:P[0])==null?void 0:Y.clientY);typeof rr=="number"&&typeof R=="number"&&I(rr,R)&&T.preventDefault()},N=T=>{var M;(M=c.current)!=null&&M.contains(document.activeElement)&&T.preventDefault()},F=T=>T.stopPropagation(),C=()=>{var T;document.activeElement instanceof HTMLInputElement&&((T=c.current)!=null&&T.contains(document.activeElement))&&document.activeElement.blur()};return f.jsxs(xs,{open:l,onOpenChange:u,modal:!1,children:[f.jsx(Zs,{asChild:!0,children:f.jsxs(g0,{ref:s,variant:"outline",role:"combobox","aria-expanded":l,disabled:i||d,"data-testid":A,className:Zr("h-10 w-full justify-between font-normal",!r&&"text-muted-foreground",o),children:[d?f.jsxs(f.Fragment,{children:[f.jsx(Pt,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading codes..."]}):g?f.jsx("span",{className:"text-destructive",children:"Failed to load codes"}):b?f.jsxs("span",{className:"truncate",children:[b.code," - ",b.description]}):n,f.jsx(nw,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),f.jsx(Fo,{className:"z-[100] w-[var(--radix-popover-trigger-width)] p-0",align:"start",onPointerDownOutside:_,onInteractOutside:_,onFocusOutside:N,children:f.jsx("div",{ref:c,onPointerDown:F,onPointerUp:F,onClick:F,children:f.jsxs(_y,{className:"flex h-80 flex-col overflow-hidden",style:{display:"flex",flexDirection:"column",overflow:"hidden"},shouldFilter:!0,filter:(T,M)=>{const Q=M.toLowerCase().trim(),rr=" ​ ",R=T.indexOf(rr),er=R>=0?T.slice(0,R):T,L=R>=0?T.slice(R+rr.length):"";return er.toLowerCase().includes(Q)||L.toLowerCase().includes(Q)?1:0},children:[f.jsx(Iy,{placeholder:"Search by code or description..."}),f.jsxs(By,{className:"min-h-0 flex-1 touch-pan-y",style:{minHeight:0,flex:1,height:280,overflowY:"auto",overflowX:"hidden",WebkitOverflowScrolling:"touch"},onTouchStart:C,children:[f.jsx(Ny,{children:"No MCC code found."}),f.jsx(xy,{children:h.map(T=>f.jsxs(Zy,{value:`${T.code} ​ ${T.description}`,onSelect:()=>v(T.code),className:"flex items-center gap-2",children:[f.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:f.jsx(L2,{className:Zr("h-4 w-4",r===T.code?"opacity-100":"opacity-0")})}),f.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[T.code," — ",T.description]})]},T.code))})]})]})})})]})});Sy.displayName="MccCodeSelect";const ZV=On({registration_number:qr().min(1,"Registration number is required"),mcc_code:qr().min(1,"MCC code is required"),country:qr().min(1,"Country is required"),company_name:qr().min(2,"Company name must be at least 2 characters"),tax_identity_number:qr().min(1,"Tax identity number is required"),doing_business_as:qr().trim().min(1,"Doing Business As (DBA) is required"),corporate_type:qr().min(1,"Corporate type is required"),date_of_establishment:bI.date({required_error:"Date of establishment is required"})}),SV=[{value:"us",label:"United States"},{value:"uk",label:"United Kingdom"},{value:"ca",label:"Canada"},{value:"au",label:"Australia"},{value:"de",label:"Germany"},{value:"fr",label:"France"}],FV=[{value:"llc",label:"LLC"},{value:"corporation",label:"Corporation"},{value:"partnership",label:"Partnership"},{value:"sole-proprietorship",label:"Sole Proprietorship"}],$V=({data:r,onDataChange:e,onContinue:a,onBack:t,renderProgress:n,apiEndpoint:i,apiKey:o})=>{const A=Fn({resolver:$n(ZV),defaultValues:{registration_number:r.registration_number,mcc_code:r.mcc_code??"",country:r.country,company_name:r.company_name,doing_business_as:r.doing_business_as||"",tax_identity_number:r.tax_identity_number,corporate_type:r.corporate_type,date_of_establishment:r.date_of_establishment?new Date(r.date_of_establishment):void 0}}),s=l=>{e(l),a(l)};return f.jsxs(K0,{className:"w-full max-w-2xl mx-auto",children:[f.jsx(lt,{children:f.jsx(pt,{title:"Business Information",subTitle:"Please provide your business details",onBack:t})}),f.jsxs(q0,{children:[f.jsx(Mn,{...A,children:f.jsxs("form",{onSubmit:A.handleSubmit(s),className:"space-y-6",children:[f.jsx(Rr,{control:A.control,name:"registration_number",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Registration Number"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter registration number",...l})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"mcc_code",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"MCC Code"}),f.jsx(Gr,{children:f.jsx(Sy,{value:l.value,onValueChange:l.onChange,apiEndpoint:i,apiKey:o,placeholder:"Search by code or description..."})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"country",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Country"}),f.jsx(Gr,{children:f.jsx(C2,{value:l.value,onValueChange:l.onChange,options:SV,placeholder:"Enter country",name:"country"})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"company_name",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Company Name"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter company name",...l})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"doing_business_as",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Doing Business As (DBA)"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter Doing Business As (DBA)",...l})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"tax_identity_number",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Tax Identity Number"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter tax identity number",...l})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"corporate_type",render:({field:l})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Corporate Type"}),f.jsx(Gr,{children:f.jsx(C2,{value:l.value,onValueChange:l.onChange,options:FV,placeholder:"Enter corporate type",name:"corporate_type"})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:A.control,name:"date_of_establishment",render:({field:l})=>f.jsxs(Mr,{className:"flex flex-col",children:[f.jsx(Hr,{children:"Date of Establishment"}),f.jsxs(xs,{modal:!0,children:[f.jsx(Zs,{asChild:!0,children:f.jsx(Gr,{children:f.jsxs(g0,{variant:"outline",className:Zr("w-full pl-3 text-left font-normal",!l.value&&"text-muted-foreground"),children:[l.value?ja(l.value,"PPP"):f.jsx("span",{children:"Pick a date"}),f.jsx(r1,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),f.jsx(Fo,{className:"w-auto p-0",align:"start",onOpenAutoFocus:u=>u.preventDefault(),children:f.jsx(Vs,{mode:"single",selected:l.value,onSelect:l.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:u=>u>new Date,initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),f.jsx(Xr,{})]})}),f.jsx(g0,{type:"submit",className:"w-full",children:"Continue"})]})}),f.jsx("div",{className:"mt-6",children:n()})]})]})},WV=H3(new Date),TV=On({full_name:qr().min(2,"Full name must be at least 2 characters"),title:qr().min(1,"Title is required"),email:qr().email("Invalid email").optional(),birth:$3({required_error:"Birth date is required"}).refine(r=>es(r,WV),{message:"You must be at least 16 years old"}),phone_number:qr().min(1,"Phone number is required").refine(r=>_m(r),{message:"Invalid phone number"})}).superRefine((r,e)=>{r.email||e.addIssue({path:["email"],message:"Email is required",code:sr.custom})}),PV=({data:r,onDataChange:e,onContinue:a,onBack:t,renderProgress:n})=>{const i=Fn({resolver:$n(TV),defaultValues:{full_name:r.full_name,title:r.title,email:r.email||"",birth:r.birth||void 0,phone_number:r.phone_number}}),o=A=>{e(A),a(A)};return f.jsxs(K0,{className:"w-full max-w-2xl mx-auto",children:[f.jsx(lt,{children:f.jsx(pt,{title:"Personal Details",subTitle:"Please provide your personal information",onBack:t})}),f.jsxs(q0,{children:[f.jsx(Mn,{...i,children:f.jsxs("form",{onSubmit:i.handleSubmit(o),className:"space-y-6",children:[f.jsx(Rr,{control:i.control,name:"full_name",render:({field:A})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Full Name"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter your full name",...A})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"title",render:({field:A})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Title"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"e.g., CEO, Director, Manager",...A})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"email",render:({field:A})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Email"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"example@gmail.com",...A})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"birth",render:({field:A})=>f.jsxs(Mr,{className:"flex flex-col",children:[f.jsx(Hr,{children:"Date of Birth"}),f.jsxs(xs,{modal:!0,children:[f.jsx(Zs,{asChild:!0,children:f.jsx(Gr,{children:f.jsxs(g0,{variant:"outline",className:Zr("w-full pl-3 text-left font-normal",!A.value&&"text-muted-foreground"),children:[A.value?ja(A.value,"PPP"):f.jsx("span",{children:"Pick a date"}),f.jsx(r1,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),f.jsx(Fo,{className:"w-auto p-0",align:"start",onOpenAutoFocus:s=>s.preventDefault(),children:f.jsx(Vs,{mode:"single",selected:A.value,onSelect:A.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:s=>s>new Date||s<new Date("1900-01-01"),initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"phone_number",render:({field:A})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Phone Number"}),f.jsx(Gr,{children:f.jsx(J8,{control:i.control,name:"phone_number",placeholder:"Enter your phone number",defaultCountry:"US"})}),f.jsx(Xr,{})]})}),f.jsx(g0,{type:"submit",className:"w-full",children:"Continue"})]})}),f.jsx("div",{className:"mt-6",children:n()})]})]})},OV=On({inventory_maintained:qr().min(1,"Please select an inventory option"),offsite_address:qr().optional(),fulfillment_agreement:qA(File).nullable().optional(),other_companies_involved:qr().min(1,"Please select an option"),other_fulfillment_agreement:qA(File).nullable().optional(),recurring_services:qr().min(1,"Please select an option"),recurring_services_description:qr().optional(),fulfillment_time:qr().min(1,"Please select a fulfillment time"),delivery_time:qr().min(1,"Please select a delivery time"),charge_time:qr().min(1,"Please select a charge time"),return_policy:qr().min(1,"Return policy is required"),bankruptcy_filed:qr().min(1,"Please select an option"),was_terminated_from_card_acceptance:qr().min(1,"Please select an option"),has_coa:qr().min(1,"Please select an option"),coa_document:qA(File).nullable().optional()}).superRefine((r,e)=>{var a,t;r.inventory_maintained==="off-site"&&!((a=r.offsite_address)!=null&&a.trim())&&e.addIssue({code:sr.custom,message:"Warehouse address is required when inventory is maintained off-site",path:["offsite_address"]}),r.inventory_maintained==="third-party"&&!r.fulfillment_agreement&&e.addIssue({code:sr.custom,message:"Fulfillment agreement file is required when using a third-party fulfillment center",path:["fulfillment_agreement"]}),r.other_companies_involved==="yes"&&!r.other_fulfillment_agreement&&e.addIssue({code:sr.custom,message:"Fulfillment agreement file is required when other companies are involved",path:["other_fulfillment_agreement"]}),r.recurring_services==="yes"&&!((t=r.recurring_services_description)!=null&&t.trim())&&e.addIssue({code:sr.custom,message:"Recurring services description is required when offering recurring services",path:["recurring_services_description"]}),r.has_coa==="yes"&&!r.coa_document&&e.addIssue({code:sr.custom,message:"Certificate of Analysis document is required when COA is available",path:["coa_document"]})}),DV=[{value:"on-site",label:"On-Site"},{value:"off-site",label:"Off-Site (e.g., Warehouse)"},{value:"third-party",label:"3rd Party Fulfillment Center"},{value:"service-only",label:"Service Only (No Products Sold)"}],Df=[{value:"no",label:"No"},{value:"yes",label:"Yes"}],VV=[{value:"24-hours",label:"Within 24 Hours"},{value:"2-days",label:"2 Days"},{value:"3-10-days",label:"3-10 Days"},{value:"11-30-days",label:"11-30 Days"},{value:"31-90-days",label:"31-90 Days"},{value:"90-plus-days",label:"90+ Days"}],MV=[{value:"24-hours",label:"Within 24 Hours"},{value:"2-5-days",label:"2-5 Days"},{value:"6-10-days",label:"6-10 Days"},{value:"11-plus-days",label:"11+ Days"}],GV=[{value:"time-of-order",label:"Time of Order"},{value:"upon-shipment",label:"Upon Shipment"}],XV=[{value:"business-bankruptcy",label:"Business Bankruptcy"},{value:"personal-bankruptcy",label:"Personal Bankruptcy"},{value:"never",label:"Never"}],RV=({data:r,onDataChange:e,onContinue:a,onBack:t,renderProgress:n})=>{const i=Fn({resolver:$n(OV),defaultValues:{inventory_maintained:r.inventory_maintained||"",offsite_address:r.offsite_address||"",fulfillment_agreement:r.fulfillment_agreement||null,other_companies_involved:r.other_companies_involved||"",other_fulfillment_agreement:r.other_fulfillment_agreement||null,recurring_services:r.recurring_services||"",recurring_services_description:r.recurring_services_description||"",fulfillment_time:r.fulfillment_time||"",delivery_time:r.delivery_time||"",charge_time:r.charge_time||"",return_policy:r.return_policy||"",bankruptcy_filed:r.bankruptcy_filed||"",was_terminated_from_card_acceptance:r.was_terminated_from_card_acceptance||"",has_coa:r.has_coa||"",coa_document:r.coa_document||null}}),{isSubmitting:o}=i.formState,A=async d=>{const g={...d};d.inventory_maintained!=="off-site"&&delete g.offsite_address,d.inventory_maintained!=="third-party"&&delete g.fulfillment_agreement,d.other_companies_involved!=="yes"&&delete g.other_fulfillment_agreement,d.recurring_services!=="yes"&&delete g.recurring_services_description,d.has_coa!=="yes"&&delete g.coa_document,e(g),await a(g)},s=i.watch("inventory_maintained"),l=i.watch("other_companies_involved"),u=i.watch("recurring_services"),c=i.watch("has_coa"),h=(d,g)=>{const b=g&&g.length>0?g[0]:null;i.setValue(d,b,{shouldValidate:!0}),e({[d]:b})};return f.jsxs(K0,{className:"w-full max-w-2xl mx-auto",children:[f.jsx(lt,{children:f.jsx(pt,{title:"Business Questionnaire",subTitle:"Provide details about your business operations",onBack:t})}),f.jsxs(q0,{children:[f.jsx(Mn,{...i,children:f.jsxs("form",{onSubmit:i.handleSubmit(A),className:"space-y-6",children:[f.jsx(Rr,{control:i.control,name:"inventory_maintained",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Inventory Maintained"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select inventory option"})})}),f.jsx(_a,{children:DV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),s==="off-site"&&f.jsx(Rr,{control:i.control,name:"offsite_address",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Warehouse Address"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Enter warehouse address",...d,disabled:o})}),f.jsx(Xr,{})]})}),s==="third-party"&&f.jsx(Rr,{control:i.control,name:"fulfillment_agreement",render:()=>{var d;return f.jsxs(Mr,{children:[f.jsx(Gr,{children:f.jsx(qo,{label:"Fulfillment Agreement",placeholder:"Upload fulfillment agreement",hint:"Upload fully executed fulfillment agreement with 3rd party",accept:"image/*,application/pdf,.pdf",onFileSelect:g=>h("fulfillment_agreement",g),error:(d=i.formState.errors.fulfillment_agreement)==null?void 0:d.message,isSubmitting:o,disabled:o})}),f.jsx(Xr,{})]})}}),f.jsx(Rr,{control:i.control,name:"other_companies_involved",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Are there any other companies involved in shipping or fulfilling product/service?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:Df.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),l==="yes"&&f.jsx(Rr,{control:i.control,name:"other_fulfillment_agreement",render:()=>{var d;return f.jsxs(Mr,{children:[f.jsx(Gr,{children:f.jsx(qo,{label:"Fulfillment Agreement for Other Companies",placeholder:"Upload fulfillment agreement",hint:"Upload fully executed fulfillment agreement",accept:"image/*,application/pdf,.pdf",onFileSelect:g=>h("other_fulfillment_agreement",g),error:(d=i.formState.errors.other_fulfillment_agreement)==null?void 0:d.message,isSubmitting:o,disabled:o})}),f.jsx(Xr,{})]})}}),f.jsx(Rr,{control:i.control,name:"recurring_services",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Do you offer recurring or time-extended services?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:Df.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),u==="yes"&&f.jsx(Rr,{control:i.control,name:"recurring_services_description",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Recurring Services Description and Duration"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"e.g., Monthly subscription, 12-month plan",...d,disabled:o})}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"has_coa",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Do you have a Certificate of Analysis (COA) for your product(s)?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:Df.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),c==="yes"&&f.jsx(Rr,{control:i.control,name:"coa_document",render:()=>{var d;return f.jsxs(Mr,{children:[f.jsx(Gr,{children:f.jsx(qo,{label:"Certificate of Analysis",placeholder:"Upload COA document",hint:"Upload the Certificate of Analysis document",accept:"image/*,application/pdf,.pdf",onFileSelect:g=>h("coa_document",g),error:(d=i.formState.errors.coa_document)==null?void 0:d.message,isSubmitting:o,disabled:o})}),f.jsx(Xr,{})]})}}),f.jsx(Rr,{control:i.control,name:"fulfillment_time",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"How long after charging the customer is the product fulfilled or service begun?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select fulfillment time"})})}),f.jsx(_a,{children:VV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"delivery_time",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"How long after order does the cardholder receive the product/service?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select delivery time"})})}),f.jsx(_a,{children:MV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"charge_time",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"When is the cardholder charged?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select charge time"})})}),f.jsx(_a,{children:GV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"bankruptcy_filed",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Have you (your business or any principal) filed bankruptcy?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:XV.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"was_terminated_from_card_acceptance",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Have you (your business or any principal) ever been terminated from accepting bank cards?"}),f.jsxs(Ua,{onValueChange:d.onChange,value:d.value,disabled:o,children:[f.jsx(Gr,{children:f.jsx(Ca,{children:f.jsx(Ya,{placeholder:"Select an option"})})}),f.jsx(_a,{children:Df.map(g=>f.jsx(Ia,{value:g.value,children:g.label},g.value))})]}),f.jsx(Xr,{})]})}),f.jsx(Rr,{control:i.control,name:"return_policy",render:({field:d})=>f.jsxs(Mr,{children:[f.jsx(Hr,{children:"Return Policy"}),f.jsx(Gr,{children:f.jsx(V0,{placeholder:"Describe your return policy",...d,disabled:o})}),f.jsx(Xr,{})]})}),f.jsx(g0,{type:"submit",className:"w-full",disabled:o,children:o?"Submitting...":"Continue"})]})}),f.jsx("div",{className:"mt-6",children:n()})]})]})};var Dd="Progress",Vd=100,[jV]=Wt(Dd),[LV,UV]=jV(Dd),Fy=p.forwardRef((r,e)=>{const{__scopeProgress:a,value:t=null,max:n,getValueLabel:i=YV,...o}=r;(n||n===0)&&!Py(n)&&console.error(HV(`${n}`,"Progress"));const A=Py(n)?n:Vd;t!==null&&!Oy(t,A)&&console.error(QV(`${t}`,"Progress"));const s=Oy(t,A)?t:null,l=Vf(s)?i(s,A):void 0;return f.jsx(LV,{scope:a,value:s,max:A,children:f.jsx(Or.div,{"aria-valuemax":A,"aria-valuemin":0,"aria-valuenow":Vf(s)?s:void 0,"aria-valuetext":l,role:"progressbar","data-state":Ty(s,A),"data-value":s??void 0,"data-max":A,...o,ref:e})})});Fy.displayName=Dd;var $y="ProgressIndicator",Wy=p.forwardRef((r,e)=>{const{__scopeProgress:a,...t}=r,n=UV($y,a);return f.jsx(Or.div,{"data-state":Ty(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...t,ref:e})});Wy.displayName=$y;function YV(r,e){return`${Math.round(r/e*100)}%`}function Ty(r,e){return r==null?"indeterminate":r===e?"complete":"loading"}function Vf(r){return typeof r=="number"}function Py(r){return Vf(r)&&!isNaN(r)&&r>0}function Oy(r,e){return Vf(r)&&!isNaN(r)&&r<=e&&r>=0}function HV(r,e){return`Invalid prop \`max\` of value \`${r}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Vd}\`.`}function QV(r,e){return`Invalid prop \`value\` of value \`${r}\` supplied to \`${e}\`. The \`value\` prop must be:
291
291
  - a positive number
292
292
  - less than the value passed to \`max\` (or ${Vd} if no \`max\` prop is set)
293
293
  - \`null\` or \`undefined\` if the progress is indeterminate.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "description": "A modern React component library for KYC",
5
5
  "author": "TechLabi",
6
- "version": "0.53.0-beta.6",
6
+ "version": "0.53.0-beta.7",
7
7
  "type": "module",
8
8
  "types": "dist/types/index.d.ts",
9
9
  "style": "dist/style.css",