@arkyn/components 1.3.86 → 1.3.88

Sign up to get free protection for your applications and to get access to all the features.
package/dist/bundle.js CHANGED
@@ -1120,7 +1120,7 @@ function jn(e) {
1120
1120
  te(G, String(re), String(ke));
1121
1121
  }, he = (G) => E && E(G, G.key, G.key);
1122
1122
  return Ze(() => {
1123
- const G = J || Q || void 0, [, re] = Nt(M, G, U);
1123
+ const G = J || +Q || void 0, [, re] = Nt(M, G, U);
1124
1124
  i(re);
1125
1125
  }, [U, Q, J]), /* @__PURE__ */ r.jsxs(
1126
1126
  "section",
@@ -29,5 +29,5 @@ Check the top-level render call using <`+g+">.")}return h}}function It(n,h){{if(
29
29
  <%s {...props} />
30
30
  React keys must be passed directly to JSX without using spread:
31
31
  let props = %s;
32
- <%s key={someKey} {...props} />`,ct,Te,Ea,Te),Ft[Te+ct]=!0}}return n===s?Ca(re):wa(re),re}}function ka(n,h,g){return Bt(n,h,g,!0)}function Na(n,h,g){return Bt(n,h,g,!1)}var ja=Na,Sa=ka;Be.Fragment=s,Be.jsx=ja,Be.jsxs=Sa}()),Be}process.env.NODE_ENV==="production"?Je.exports=Dt():Je.exports=Lt();var r=Je.exports;function ft(e){const{className:t,...a}=e,s=`arkynAlertTitle ${t}`;return r.jsx("div",{className:s.trim(),...a})}const ht=l.createContext({});function Mt(){return l.useContext(ht)}function At(e){const{schema:t,children:a,className:s,...i}=e,u=!(p=>{let m=!1;const v=o=>{Array.isArray(o)?o.forEach(v):o&&typeof o=="object"&&"type"in o&&(o.type===ft?m=!0:o.props&&o.props.children&&v(o.props.children))};return v(p),m})(a)?"nonExistsAlertTitle":"existsAlertTitle",d=`arkynAlertContainer ${t} ${u} ${s}`;return r.jsx(ht.Provider,{value:e,children:r.jsx("div",{className:d.trim(),...i,children:a})})}function Vt(e){const{className:t,...a}=e,s=`arkynAlertContent ${t}`;return r.jsx("div",{className:s.trim(),...a})}function Wt(e){const{className:t,...a}=e,s=`arkynAlertDescription ${t}`;return r.jsx("div",{className:s.trim(),...a})}function Yt(e){const{className:t,...a}=e,{schema:s}=Mt(),i=`arkynAlertIcon ${s} ${t}`;switch(s){case"success":return r.jsx(Y.CheckCircle2,{className:i,...a});case"danger":return r.jsx(Y.XCircle,{className:i,...a});case"warning":return r.jsx(Y.AlertTriangle,{className:i,...a});case"info":return r.jsx(Y.Info,{className:i,...a})}}function Ae(e,t){return t?r.jsx(t,{size:e,strokeWidth:2.5}):r.jsx(r.Fragment,{})}function mt(e,t){return[...new Array(t-e)].map((a,s)=>e+s+1).filter(a=>a>0)}function Ht(e,t,a){return e>=a?[]:mt(e,e+t)}function Ut(e,t){return e<=1?[]:mt(e-1-t,e-1)}function Kt(e,t,a){if(!e)return r.jsx(r.Fragment,{});if(typeof e=="string")return r.jsx("p",{className:a,children:e});const s=e;return r.jsx("p",{className:a,children:r.jsx(s,{color:"var(--secondary-600)",size:t,strokeWidth:2.5})})}function Xt(e){const{variant:t="ghost",scheme:a="primary",size:s="md",leftIcon:i,rightIcon:c,className:f="",children:u,...d}=e,m={md:12,lg:14}[s],v=`arkynBadge ${t} ${a} ${s} ${f}`;return r.jsxs("div",{className:v.trim(),...d,children:[Ae(m,i),u,Ae(m,i)]})}function qt(e){const{className:t,...a}=e,s=`arkynCard ${t}`;return r.jsx("div",{className:s.trim(),...a})}function Gt(e){const{className:t,orientation:a="horizontal",...s}=e,i=`arkynDivider ${a} ${t}`;return r.jsx("div",{className:i.trim(),...s})}function Jt(e){const{className:t,...a}=e,s=`arkynSkeleton ${t}`;return r.jsx("aside",{className:s.trim(),...a})}function Zt(e){const{emptyMessage:t="Nenhum dado adicionado.",className:a,children:s,...i}=e,c=`arkynTableBody ${a}`,f=l.Children.count(s)===0;return r.jsx("tbody",{className:c.trim(),...i,children:f?r.jsx("tr",{className:"arkynTableBodyEmptyLine",children:r.jsx("td",{colSpan:100,children:r.jsx("div",{children:t})})}):s})}function Qt(e){const{className:t,children:a,...s}=e,i=`arkynTableCaption ${t}`;return r.jsx("caption",{className:i.trim(),...s,children:r.jsx("div",{className:"arkynTableCaptionContent",children:a})})}function en(e){const{children:t,className:a,...s}=e,i=`arkynTableContainer ${a}`;return r.jsx("div",{className:i.trim(),...s,children:r.jsx("table",{children:t})})}function tn(e){const{className:t,children:a,...s}=e,i=`arkynTableFooter ${t}`;return r.jsxs("tfoot",{className:i.trim(),...s,children:[r.jsx("tr",{className:"spacingRow"}),r.jsx("tr",{children:r.jsx("th",{colSpan:100,children:r.jsx("div",{className:"arkynTableFooterContent",children:a})})})]})}function nn(e){const{className:t,children:a,...s}=e,i=`arkynTableHeader ${t}`;return r.jsxs("thead",{className:i.trim(),...s,children:[r.jsx("tr",{children:a}),r.jsx("tr",{className:"spacingRow"})]})}function an(e){const{isLoading:t=!1,scheme:a="primary",variant:s="solid",loadingText:i,size:c="md",leftIcon:f,rightIcon:u,disabled:d,className:p="",children:m,...v}=e,y={xs:12,sm:16,md:20,lg:24}[c],C=`arkynButton ${t?"loadingTrue":"loadingFalse"} ${s} ${a} ${c} ${i?"loadingTextTrue":"loadingTextFalse"} ${p}`;return r.jsxs("button",{className:C,disabled:d||t,...v,children:[r.jsxs("div",{className:"arkynButtonSpinner",children:[r.jsx(Y.Loader2,{size:y,strokeWidth:2.5}),i&&i]}),r.jsxs("div",{className:"arkynButtonContent",children:[Ae(y,f),m,Ae(y,u)]})]})}const pt=l.createContext({});function rn(e){var m,v;const t=Pe.useActionData(),{children:a,className:s,...i}=e,c=l.useRef(null),f=((m=c.current)==null?void 0:m.name)||"",u=((v=t==null?void 0:t.fieldErrors)==null?void 0:v[f])||null,d=l.useId(),p=`arkynFormController ${s}`;return r.jsx(pt.Provider,{value:{error:u,id:d,inputRef:c},children:r.jsx("section",{className:p.trim(),...i,children:a})})}function me(){return l.useContext(pt)}function sn(e){const{name:t,className:a="",size:s="md",isError:i,defaultChecked:c=!1,checked:f=null,onCheck:u,value:d,...p}=e,{id:m,inputRef:v,error:o}=me(),y=i||!!o,[N,w]=l.useState(c||!1),C=typeof f=="boolean"?f:N,O=`arkynCheckbox ${s} ${y?"errorTrue":"errorFalse"} ${C?"checkedTrue":"checkedFalse"} ${a}`;function F(){const $=N;w(!$),u&&u($?"":d||"checked")}return r.jsxs("button",{id:m,type:"button",className:O,onClick:F,...p,children:[r.jsx("input",{type:"hidden",name:t,ref:v,value:C?d||"checked":""}),r.jsx(Y.Check,{})]})}function on(e){const{children:t,className:a,...s}=e,i=`arkynFormError ${a}`,{error:c}=me();return t?r.jsx("strong",{className:i.trim(),...s,children:t}):c?r.jsx("strong",{className:i.trim(),...s,children:c}):r.jsx(r.Fragment,{})}function ln(e){const{showAsterisk:t=!1,className:a="",...s}=e,{id:i}=me(),f=`arkynFormLabel ${t?"asteriskTrue":"asteriskFalse"} ${a}`;return r.jsx("label",{className:f.trim(),htmlFor:i,...s})}function cn(e){const{isLoading:t=!1,scheme:a="primary",variant:s="solid",size:i="md",icon:c,disabled:f,className:u="",...d}=e,p={xs:12,sm:16,md:20,lg:24},v=`arkynIconButton ${s} ${a} ${i} ${t?"loadingTrue":"loadingFalse"} ${u}`;return r.jsxs("button",{disabled:f||t,className:v.trim(),...d,children:[r.jsx("div",{className:"arkynIconButtonSpinner",children:r.jsx(Y.Loader2,{size:p[i],strokeWidth:2.5})}),r.jsx("div",{className:"arkynIconButtonContent",children:r.jsx(c,{size:p[i],strokeWidth:2.5})})]})}function Ce(e,t,a){if(!e)return r.jsx(r.Fragment,{});if(typeof e=="string")return r.jsx("p",{className:a,children:e});const s=e;return r.jsx("p",{className:a,children:r.jsx(s,{color:"var(--secondary-600)",size:t,strokeWidth:2.5})})}function Ze(e){return e&&e.replace(/[^0-9]/g,"")}function gt(e,t){let a="",s=0;return Array.from(e).forEach((i,c)=>{t[c+s].match(/[0-9]/)||(a+=t[c+s],s++),a+=i}),a}function vt(e){return e.length>11?"CNPJ":"CPF"}const Qe={CPF:"999.999.999-999",CNPJ:"99.999.999/9999-99"},bt=Ze(Qe.CNPJ).length;function un(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:v,defaultValue:o,readOnly:y,onFocus:N,onBlur:w,title:C,style:b,onChange:k,...O}=e;function F(X){let M=Ze(X);const q=vt(M);if(!(M.length>bt))return M=gt(M,Qe[q]),M}const $=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${v||y||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,E={md:20,lg:20}[i];return{isLoading:a,className:z,prefix:Ce(u,E,"prefix"),sufix:Ce(d,E,"sufix"),LeftIcon:p,RightIcon:m,defaultValue:F(o||""),disabled:v,readOnly:y,onFocus:N,onBlur:w,title:C,style:b,onChange:k,loadingPosition:$,iconSize:E,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:E,strokeWidth:2.5}),...O}}function dn(e){const[t,a]=l.useState(!1),s=l.useRef(null),{inputRef:i,id:c,error:f}=me(),u=i||s,d=e.isError||!!f,{disabled:p,title:m,style:v,className:o,prefix:y,sufix:N,iconSize:w,loadingPosition:C,isLoading:b,LeftIcon:k,readOnly:O,onFocus:F,onBlur:$,RightIcon:W,Spinner:L,onChange:K,value:H,defaultValue:Z,...z}=un({...e,id:c,isError:d},t),[ae,E]=l.useState(Z),X=k&&!b,M=W&&!b,q=C==="left"&&b,te=C==="right"&&b;function R(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function Q(P){let S=Ze(P.target.value);const ee=vt(S);S.length>bt||(S=gt(S,Qe[ee]),P.target.value=S,E(S),K&&K(P))}function le(P){a(!0),F&&F(P)}function _(P){a(!1),$&&$(P)}return r.jsxs("section",{title:m,style:v,onClick:R,className:o,children:[y,q&&L,X&&r.jsx(k,{size:w,strokeWidth:2.5}),r.jsx("input",{disabled:p||b,readOnly:O,ref:u,value:H||ae,onFocus:le,onChange:Q,onBlur:_,...z}),M&&r.jsx(W,{size:w,strokeWidth:2.5}),te&&L,N]})}const fn=3,hn=(e="pt-BR",t,a="BRL",s=!0)=>new Intl.NumberFormat(e,{style:"currency",currency:a,currencyDisplay:"symbol",minimumFractionDigits:2,maximumFractionDigits:2}).format(t).slice(s?fn:0),Ve=2,yt=e=>typeof e=="number"?e:Number(e.toString().replace(/[^0-9-]/g,"")),et=e=>{let t=e;return typeof e=="string"?(t=yt(e),t%1!==0&&(t=t.toFixed(Ve))):t=Number.isInteger(e)?Number(e)*10**Ve:e.toFixed(Ve),yt(t)/10**Ve},xt=(e,t,a)=>{if(!t)return[0,""];const s=et(t),i=hn(e,s,a);return[s,i]};function mn(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,max:b=1e9,locale:k="pt-BR",currency:O="BRL",...F}=e,$=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${v||o||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,E={md:20,lg:20}[i];return{isLoading:a,className:z,prefix:Ce(u,E,"prefix"),sufix:Ce(d,E,"sufix"),LeftIcon:p,RightIcon:m,disabled:v,locale:k,currency:O,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,max:b,loadingPosition:$,iconSize:E,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:E,strokeWidth:2.5}),...F}}function pn(e){const[t,a]=l.useState(!1),[s,i]=l.useState("0"),c=l.useRef(null),{inputRef:f,id:u,error:d}=me(),p=f||c,m=e.isError||!!d,{disabled:v,title:o,style:y,className:N,prefix:w,sufix:C,iconSize:b,loadingPosition:k,isLoading:O,LeftIcon:F,readOnly:$,onFocus:W,onBlur:L,RightIcon:K,Spinner:H,value:Z,max:z,onChangeValue:ae,onKeyPress:E,currency:X,locale:M,name:q,defaultValue:te,...R}=mn({...e,id:u,isError:m},t),Q=F&&!O,le=K&&!O,_=k==="left"&&O,P=k==="right"&&O;function S(){v||!(p!=null&&p.current)||(a(!0),p.current.focus())}function ee(J){a(!0),W&&W(J)}function ce(J){a(!1),L&&L(J)}const G=J=>{const[se,ke]=xt(M,J,X);return!z||se<=z?(i(ke),[se,ke]):[et(s),s]},xe=J=>{J.preventDefault();const[se,ke]=G(J.target.value);ae(J,String(se),String(ke))},pe=J=>E&&E(J,J.key,J.key);return l.useEffect(()=>{const J=Z||te||void 0,[,se]=xt(M,J,X);i(se)},[X,te,Z]),r.jsxs("section",{title:o,style:y,onClick:S,className:N,children:[w,_&&H,Q&&r.jsx(F,{size:b,strokeWidth:2.5}),r.jsx("input",{value:s,onChange:xe,onBlur:ce,onFocus:ee,onKeyUp:pe,disabled:v||O,readOnly:$,...R}),r.jsx("input",{type:"hidden",ref:p,name:q,value:et(s)}),P&&H,le&&r.jsx(K,{size:b,strokeWidth:2.5}),C]})}function gn(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,onChange:b,showMask:k=!1,type:O,...F}=e,$=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${v||o||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,E={md:20,lg:20}[i];return{isLoading:a,className:z,prefix:Ce(u,E,"prefix"),sufix:Ce(d,E,"sufix"),LeftIcon:p,RightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,onChange:b,loadingPosition:$,iconSize:E,showMask:k,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:E,strokeWidth:2.5}),...F}}const vn=l.forwardRef((e,t)=>r.jsx("input",{ref:t,...e}));function bn(e){const[t,a]=l.useState(!1),s=l.useRef(null),{inputRef:i,id:c,error:f}=me(),u=i||s,d=e.isError||!!f,{disabled:p,title:m,style:v,className:o,prefix:y,sufix:N,iconSize:w,loadingPosition:C,isLoading:b,LeftIcon:k,readOnly:O,onFocus:F,onBlur:$,RightIcon:W,Spinner:L,...K}=gn({...e,id:c,isError:d},t),H=k&&!b,Z=W&&!b,z=C==="left"&&b,ae=C==="right"&&b;function E(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function X(q){a(!0),F&&F(q)}function M(q){a(!1),$&&$(q)}return r.jsxs("section",{title:m,style:v,onClick:E,className:o,children:[y,z&&L,H&&r.jsx(k,{size:w,strokeWidth:2.5}),r.jsx(Ot.InputMask,{component:vn,ref:u,onFocus:X,onBlur:M,disabled:p,...K}),Z&&r.jsx(W,{size:w,strokeWidth:2.5}),ae&&L,N]})}function yn(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,onChange:b,...k}=e,O=m?"right":"left",H=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${v||o||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,z={md:20,lg:20}[i];return{isLoading:a,className:H,prefix:Ce(u,z,"prefix"),sufix:Ce(d,z,"sufix"),LeftIcon:p,RightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,onChange:b,loadingPosition:O,iconSize:z,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:z,strokeWidth:2.5}),...k}}function xn(e){const[t,a]=l.useState(!1),s=l.useRef(null),{inputRef:i,id:c,error:f}=me(),u=i||s,d=e.isError||!!f,{disabled:p,title:m,style:v,className:o,prefix:y,sufix:N,iconSize:w,loadingPosition:C,isLoading:b,LeftIcon:k,readOnly:O,onFocus:F,onBlur:$,RightIcon:W,type:L,Spinner:K,...H}=yn({...e,id:c,isError:d},t),Z=k&&!b,z=W&&!b,ae=C==="left"&&b,E=C==="right"&&b;function X(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function M(te){a(!0),F&&F(te)}function q(te){a(!1),$&&$(te)}return L==="hidden"?r.jsx("input",{style:{display:"none"},readOnly:!0,type:"text",ref:u,...H}):r.jsxs("section",{title:m,style:v,onClick:X,className:o,children:[y,ae&&K,Z&&r.jsx(k,{size:w,strokeWidth:2.5}),r.jsx("input",{disabled:p||b,readOnly:O,ref:u,onFocus:M,onBlur:q,type:L,...H}),z&&r.jsx(W,{size:w,strokeWidth:2.5}),E&&K,N]})}function wn(e){return e.type==="currency"?r.jsx(pn,{...e}):e.type==="masked"?r.jsx(bn,{...e}):e.type==="cpf-cnpj"?r.jsx(dn,{...e}):r.jsx(xn,{...e})}const wt=l.createContext({});function Cn(){return l.useContext(wt)}function kn(e){const{defaultValue:t,name:a,value:s,onChange:i,size:c="md",className:f="",...u}=e,[d,p]=l.useState(t||""),{inputRef:m,id:v}=me();function o(N){p(N),i&&i(N)}const y=`arkynRadioGroup ${c} ${f}`;return r.jsxs(wt.Provider,{value:{onChange:o,value:s||d,size:c},children:[r.jsx("input",{style:{display:"none"},type:"text",id:v,readOnly:!0,name:a,ref:m,value:s||d}),r.jsx("div",{className:y.trim(),...u})]})}function Nn(e){const{value:t,size:a,disabled:s,children:i,className:c="",...f}=e,{onChange:u,size:d,value:p}=Cn(),{error:m}=me(),w=`arkynRadioBox ${a||d} ${p===t?"checkedTrue":"checkedFalse"} ${m?"errorTrue":"errorFalse"} ${s?"disabledTrue":"disabledFalse"} ${c}`;return r.jsxs("label",{className:w.trim(),children:[r.jsx("button",{type:"button",disabled:s,onClick:()=>u(t),onFocus:()=>u(t),...f}),i]})}function jn(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,leftIcon:d,disabled:p,readOnly:m,onFocus:v,onBlur:o,title:y,style:N,closeOnSelect:w=!0,...C}=e,$=`arkyn_select ${u?"hasPrefix":""} ${f} ${i} ${p||m||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,L={md:20,lg:20}[i];return{isLoading:a,className:$,prefix:Kt(u,L,"prefix"),LeftIcon:d,disabled:p||a||m,onFocus:v,onBlur:o,title:y,closeOnSelect:w,style:N,iconSize:L,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:L,strokeWidth:2.5}),...C}}function Sn(e){var P;const[t,a]=l.useState(!1),{inputRef:s,id:i,error:c}=me(),f=l.useRef(null),u=s||f,d=e.isError||!!c,{disabled:p,title:m,style:v,className:o,prefix:y,iconSize:N,isLoading:w,LeftIcon:C,value:b=null,defaultValue:k="",onFocus:O,onBlur:F,Spinner:$,name:W,placeholder:L,onSelect:K,options:H,optionMaxHeight:Z,closeOnSelect:z,...ae}=jn({...e,id:i,isError:d},t),[E,X]=l.useState(k);function M(){p||!(u!=null&&u.current)||t||(a(!0),u.current.focus())}function q(S){t||(a(!0),O&&O(S))}function te(){a(!1),F&&u.current&&u.current.blur()}function R(S){const{label:ee,value:ce}=S;X(E!==ce?ce:""),K&&K({label:ee,value:ce}),z&&te()}const Q=typeof b=="string"?b:E,le=((P=H.find(S=>S.value===Q))==null?void 0:P.label)||"",_=()=>{if(!t&&le)return!0;if(!t&&!le)return!1;if(t&&le)return!0;if(t&&!le)return!1};return r.jsxs(r.Fragment,{children:[r.jsxs("section",{title:m,style:v,onClick:M,className:`${o} placeholder_dark_${_()}`,children:[y,C&&r.jsx(C,{size:N,strokeWidth:2.5}),r.jsx("input",{disabled:p,readOnly:!0,placeholder:le||L,onFocus:q,...ae}),r.jsx("input",{type:"hidden",ref:u,name:W,value:Q||"",readOnly:!0}),t&&r.jsxs("div",{className:"arkyn_select_content",style:{overflow:"auto",maxHeight:Z},children:[H.map(({label:S,value:ee})=>r.jsxs("div",{onClick:()=>R({label:S,value:ee}),className:Q===ee?"arkyn_select_option active":"arkyn_select_option",children:[S," ",r.jsx(Y.Check,{})]},ee)),H.length<=0&&r.jsx("p",{children:"Sem opções disponíveis"})]}),!w&&r.jsx(Y.ChevronDown,{className:"arkyn_select_arrow",size:N,strokeWidth:2.5}),w&&$]}),t&&r.jsx("aside",{className:"arkyn_select_overlay",onClick:te})]})}function En(e){const{size:t="lg",defaultChecked:a=!1,checked:s=null,value:i,name:c,className:f="",onCheck:u,...d}=e,[p,m]=l.useState(a),{id:v,inputRef:o}=me();function y(){m(!p),u&&u(a?"":i||"checked")}const N=typeof s=="boolean"?s:p,C=`arkynSwitch ${N?"checkedTrue":"checkedFalse"} ${t} ${f}`;return r.jsx("button",{id:v,type:"button",onClick:y,className:C,...d,children:r.jsx("input",{type:"hidden",name:c,ref:o,value:N?i||"checked":""})})}function Tn(e){const{variant:t="solid",size:a="md",className:s,disabled:i=!1,readOnly:c=!1,onFocus:f,onBlur:u,title:d,style:p,...m}=e,[v,o]=l.useState(!1),{inputRef:y,id:N,error:w}=me(),C=l.useRef(null),b=y||C,O=e.isError||!!w?"errorTrue":"errorFalse",W=`arkynTextarea ${t} ${a} ${i||c?"opacityTrue":"opacityFalse"} ${O} ${v?"focusedTrue":"focusedFalse"} ${s}`;function L(){i||!(b!=null&&b.current)||(o(!0),b.current.focus())}function K(Z){o(!0),f&&f(Z)}function H(Z){o(!1),u&&u(Z)}return r.jsx("section",{title:d,style:p,onClick:L,className:W,children:r.jsx("textarea",{id:N,disabled:i,readOnly:c,ref:b,onFocus:K,onBlur:H,...m})})}function Pn(e){const{className:t="",...a}=e,s=`arkynBreadcrumbContainer ${t}`;return r.jsx("nav",{className:s,...a})}function $n(e){const{pathname:t}=Pe.useLocation(),{className:a="",disabled:s=!1,children:i,to:c,...f}=e,d=`arkynBreadcrumbLink ${t===c?"active":"inactive"} ${a}`;return s?r.jsxs("p",{className:d,children:[r.jsx(Y.ChevronRight,{size:14,strokeWidth:2.5}),i]}):r.jsxs(Pe.Link,{to:c,className:d,...f,children:[r.jsx(Y.ChevronRight,{size:14,strokeWidth:2.5}),i]})}function Ct(e=""){const t=Pe.useLocation(),a=new URLSearchParams(t.search),s=e?`${e}:`:"",i=c=>{Object.entries(c).forEach(([f,u])=>{u===void 0?a.delete(`${s}${f}`):a.set(`${s}${f}`,String(u))})};return{getParam:c=>a.get(`${s}${c}`),getScopedSearch:c=>{i(c);let f=a.toString();return f&&(f="?"+f),f}}}function Rn(e){const{scope:t,totalCountRegisters:a,perPageKey:s="per_page",pageKey:i="page",siblingsCount:c=2,...f}=e,u=Pe.useNavigate(),{getParam:d,getScopedSearch:p}=Ct(t),m=Number(d(i))||1,v=Number(d(s))||20,o=Math.ceil(a/v),y=Ut(m,c),N=Ht(m,c,o);function w(C){u(p({page:C}))}return r.jsxs("div",{className:"arkynPagination",...f,children:[r.jsx("button",{className:"arkynPaginationIconButton",disabled:m<=1,onClick:()=>w(m-1),children:r.jsx(Y.ChevronLeft,{})}),m>1+c&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"arkynPaginationPageButton",onClick:()=>w(1),children:"1"}),m>2+c&&r.jsx("button",{disabled:!0,className:"arkynPaginationSpread",children:r.jsx(Y.Ellipsis,{})})]}),y.map((C,b)=>r.jsx("button",{onClick:()=>w(C),className:"arkynPaginationPageButton",children:C},b)),r.jsx("button",{className:"arkynPaginationCurrent",disabled:!0,children:m}),N.map((C,b)=>r.jsx("button",{onClick:()=>w(C),className:"arkynPaginationPageButton",children:C},b)),m+c<o&&r.jsxs(r.Fragment,{children:[m+1+c<o&&r.jsx("button",{disabled:!0,className:"arkynPaginationSpread",children:r.jsx(Y.Ellipsis,{})}),r.jsx("button",{className:"arkynPaginationPageButton",onClick:()=>w(o),children:o})]}),r.jsx("button",{className:"arkynPaginationIconButton",disabled:m>=o,onClick:()=>w(m+1),children:r.jsx(Y.ChevronRight,{})})]})}const tt=l.createContext({});function In(){if(!tt)throw new Error("useTabContext must be used within a TabProvider");return l.useContext(tt)}function _n(e){const{children:t,onClick:a,defaultActive:s,className:i,...c}=e,[f,u]=l.useState(s||""),[d,p]=l.useState(!0),m=l.useRef(null),v=`arkynTabContainer ${i||""}`,[o,y]=l.useState({width:"0px",left:"0px",transition:"none"}),N=(C,b)=>{const k=C.getBoundingClientRect(),O=m.current.getBoundingClientRect(),F=b?void 0:"none";p(!1),y({transition:F,width:`${k.width}px`,left:`${k.left-O.left}px`})};l.useEffect(()=>{const C=m.current;if(!C)return;let b=null;b=C.querySelector("button.active"),b&&N(b)},[]);const w=C=>{const b=C.target;b&&(u(b.value),b.classList.add("active"),N(b,!0),a&&a(b.value))};return r.jsxs("nav",{ref:m,className:v.trim(),...c,children:[r.jsx(tt.Provider,{value:{handleTabClick:w,showInitialTab:d,value:f},children:t}),r.jsx("div",{className:"activeLine",style:o})]})}function Fn(e){const{children:t,className:a="",onClick:s,...i}=e,{value:c,showInitialTab:f,handleTabClick:u}=In(),d=c===i.value&&c?"activeTrue":"activeFalse",m=`arkynTabButton ${c===i.value&&f?"showBorderBottom":""} ${d} ${a}`;function v(o){u(o),s&&s(o)}return r.jsx("button",{onClick:v,className:m.trim(),...i,children:t})}const kt=l.createContext({});function Bn(e){const{isVisibled:t,makeInvisible:a,orientation:s="left",children:i,className:c,...f}=e,u=s==="left"?"-100%":"100%",p=`arkynDrawerContainer ${s} ${t?"visibleTrue":"visibleFalse"} ${c}`;return r.jsx(kt.Provider,{value:{makeInvisible:a},children:r.jsx(Se.AnimatePresence,{children:t&&r.jsxs("aside",{className:p.trim(),...f,children:[r.jsx(Se.motion.div,{className:"arkynDrawerContainerOverlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a}),r.jsx(Se.motion.div,{className:"arkynDrawerContainerContent",transition:{ease:"easeOut",duration:.15},initial:{transform:`translateX(${u})`},animate:{transform:"translateX(0px)"},exit:{transform:`translateX(${u})`},children:i})]})})})}function On(e){const{showCloseButton:t=!0,className:a,children:s,...i}=e,{makeInvisible:c}=l.useContext(kt),f=`arkynDrawerHeader ${a}`;return r.jsxs("header",{className:f.trim(),...i,children:[s,t&&r.jsx("button",{className:"arkynDrawerHeaderCloseButton",type:"button",onClick:c,"aria-label":"Close drawer",children:r.jsx(Y.X,{size:24})})]})}const Nt=l.createContext({});function zn(e){const{isVisibled:t,makeInvisible:a,children:s,className:i="",...c}=e,u=`arkynModalContainer ${t?"visibleTrue":"visibleFalse"} ${i}`;return r.jsx(Nt.Provider,{value:{makeInvisible:a},children:r.jsx(Se.AnimatePresence,{children:t&&r.jsxs("aside",{className:u.trim(),...c,children:[r.jsx(Se.motion.div,{className:"arkynModalContainerOverlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a}),r.jsx(Se.motion.div,{className:"arkynModalContainerContent",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0,scale:.75},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},children:s})]})})})}function Dn(e){const{alignment:t="right",className:a,...s}=e,i=`arkynModalFooter ${t} ${a}`;return r.jsx("footer",{className:i.trim(),...s})}function Ln(e){const{showCloseButton:t=!0,className:a,children:s,...i}=e,{makeInvisible:c}=l.useContext(Nt),f=`arkynModalHeader ${a}`;return r.jsxs("header",{className:f.trim(),...i,children:[s,t&&r.jsx("button",{type:"button",onClick:c,"aria-label":"Close modal button",className:"arkynModalHeaderCloseButton",children:r.jsx(Y.X,{size:24})})]})}function Mn(e){const{children:t,button:a,closeOnClick:s,orientation:i="bottomLeft"}=e,[c,f]=l.useState(!1),d=`arkynPopover ${i} ${c?"visibleTrue":"visibleFalse"}`;function p(){c||f(!0)}return r.jsxs("div",{className:d,onClick:p,children:[a,r.jsx(Se.motion.div,{style:{visibility:c?"visible":"hidden"},transition:{ease:"easeOut",duration:0},initial:{opacity:0},animate:{opacity:c?1:0},exit:{opacity:0},onClick:()=>s&&f(!1),className:"arkynPopoverContent",children:t}),c&&r.jsx("div",{onClick:()=>f(!1),className:"arkynPopoverOverlay"})]})}function jt(e){const{message:t,title:a,type:s,size:i="lg"}=e,c=`arkynToast ${s} ${i}`;function f(){switch(s){case"info":return r.jsx(Y.Info,{});case"success":return r.jsx(Y.CheckCircle2,{});case"danger":return r.jsx(Y.XCircle,{});case"warning":return r.jsx(Y.AlertCircle,{});default:return r.jsx(Y.Info,{})}}return r.jsxs("aside",{className:c,children:[r.jsxs("div",{children:[r.jsx("div",{className:"bg"}),r.jsx(f,{})]}),r.jsxs("p",{children:[r.jsx("strong",{title:a,children:a}),r.jsx("span",{children:t})]})]})}function An(e){const{text:t,size:a="lg",children:s,orientation:i="top",className:c="",...f}=e,u=`arkynTooltip ${a} ${i} ${c}`;return r.jsxs("div",{className:u.trim(),...f,children:[s,r.jsx("div",{className:"arkynTooltipText",children:t})]})}const nt=l.createContext({}),St=l.createContext({});function Et(){const e=l.useContext(St);if(Object.entries(e).length===0)throw new Error("useToast must be used within a Provider");return e}function Tt(e){return e&&typeof e.title=="string"&&typeof e.message=="string"&&(e.size===void 0||e.size==="md"||e.size==="lg")&&(e.type==="info"||e.type==="success"||e.type==="danger"||e.type==="warning")}function Vn(){const e=Pe.useActionData(),{closeModal:t}=l.useContext(nt),{showToast:a}=Et();l.useEffect(()=>{const s=e==null?void 0:e.closeModalKey;s&&t(s)},[e]),l.useEffect(()=>{const s=e==null?void 0:e.toast,i=e==null?void 0:e.message;Tt(s)&&a(s),!Tt(s)&&i&&a({message:i,title:"Atenção!",type:"warning"})},[e])}const Pt=l.createContext({});function Wn(e){const t=l.useContext(Pt);if(Object.entries(t).length===0)throw new Error("useDrawer must be used within a Provider");if(e){const{drawerData:a,drawerIsOpen:s,openDrawer:i,closeDrawer:c}=t,f=s(e),u=a(e);return{drawerIsOpen:f,drawerData:u,openDrawer:m=>i(e,m),closeDrawer:()=>c(e)}}else return t}function Yn(e){const t=l.useContext(nt);if(Object.entries(t).length===0)throw new Error("useModal must be used within a Provider");if(e){const{modalData:a,modalIsOpen:s,openModal:i,closeModal:c}=t,f=s(e),u=a(e);return{modalIsOpen:f,modalData:u,openModal:m=>i(e,m),closeModal:()=>c(e)}}else return t}function Hn(e){const{children:t=!1}=e,[a,s]=l.useState([]);function i(d){return!!a.some(p=>p.key===d)}function c(d){var p;return(p=a.find(m=>m.key===d))==null?void 0:p.data}function f(d,p){const m=i(d);s(m?v=>[...v.filter(y=>y.key!==d),{key:d,data:p}]:[...a,{key:d,data:p}])}function u(d){s(a.filter(p=>p.key!==d))}return r.jsx(Pt.Provider,{value:{drawerIsOpen:i,drawerData:c,openDrawer:f,closeDrawer:u},children:t})}function Un(e){const{children:t=!1}=e,[a,s]=l.useState([]);function i(d){return!!a.some(p=>p.key===d)}function c(d){var p;return(p=a.find(m=>m.key===d))==null?void 0:p.data}function f(d,p){const m=i(d);s(m?v=>[...v.filter(y=>y.key!==d),{key:d,data:p}]:[...a,{key:d,data:p}])}function u(d){s(a.filter(p=>p.key!==d))}return r.jsx(nt.Provider,{value:{modalIsOpen:i,modalData:c,openModal:f,closeModal:u},children:t})}var Kn=e=>{switch(e){case"success":return Gn;case"info":return Zn;case"warning":return Jn;case"error":return Qn;default:return null}},Xn=Array(12).fill(0),qn=({visible:e})=>l.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},l.createElement("div",{className:"sonner-spinner"},Xn.map((t,a)=>l.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),Gn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Jn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Zn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Qn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ea=()=>{let[e,t]=l.useState(document.hidden);return l.useEffect(()=>{let a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e},at=1,ta=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:a,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:at++,c=this.toasts.find(u=>u.id===i),f=e.dismissible===void 0?!0:e.dismissible;return c?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:a}),{...u,...e,id:i,dismissible:f,title:a}):u):this.addToast({title:a,...s,dismissible:f,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(a=>a({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let a;t.loading!==void 0&&(a=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let s=e instanceof Promise?e:e(),i=a!==void 0;return s.then(async c=>{if(aa(c)&&!c.ok){i=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:a,type:"error",message:f,description:u})}else if(t.success!==void 0){i=!1;let f=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:a,type:"success",message:f,description:u})}}).catch(async c=>{if(t.error!==void 0){i=!1;let f=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:a,type:"error",message:f,description:u})}}).finally(()=>{var c;i&&(this.dismiss(a),a=void 0),(c=t.finally)==null||c.call(t)}),a},this.custom=(e,t)=>{let a=(t==null?void 0:t.id)||at++;return this.create({jsx:e(a),id:a,...t}),a},this.subscribers=[],this.toasts=[]}},he=new ta,na=(e,t)=>{let a=(t==null?void 0:t.id)||at++;return he.addToast({title:e,...t,id:a}),a},aa=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ra=na,sa=()=>he.toasts,oa=Object.assign(ra,{success:he.success,info:he.info,warning:he.warning,error:he.error,custom:he.custom,message:he.message,promise:he.promise,dismiss:he.dismiss,loading:he.loading},{getHistory:sa});function ia(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&a.firstChild?a.insertBefore(s,a.firstChild):a.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}ia(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
32
+ <%s key={someKey} {...props} />`,ct,Te,Ea,Te),Ft[Te+ct]=!0}}return n===s?Ca(re):wa(re),re}}function ka(n,h,g){return Bt(n,h,g,!0)}function Na(n,h,g){return Bt(n,h,g,!1)}var ja=Na,Sa=ka;Be.Fragment=s,Be.jsx=ja,Be.jsxs=Sa}()),Be}process.env.NODE_ENV==="production"?Je.exports=Dt():Je.exports=Lt();var r=Je.exports;function ft(e){const{className:t,...a}=e,s=`arkynAlertTitle ${t}`;return r.jsx("div",{className:s.trim(),...a})}const ht=l.createContext({});function Mt(){return l.useContext(ht)}function At(e){const{schema:t,children:a,className:s,...i}=e,u=!(p=>{let m=!1;const v=o=>{Array.isArray(o)?o.forEach(v):o&&typeof o=="object"&&"type"in o&&(o.type===ft?m=!0:o.props&&o.props.children&&v(o.props.children))};return v(p),m})(a)?"nonExistsAlertTitle":"existsAlertTitle",d=`arkynAlertContainer ${t} ${u} ${s}`;return r.jsx(ht.Provider,{value:e,children:r.jsx("div",{className:d.trim(),...i,children:a})})}function Vt(e){const{className:t,...a}=e,s=`arkynAlertContent ${t}`;return r.jsx("div",{className:s.trim(),...a})}function Wt(e){const{className:t,...a}=e,s=`arkynAlertDescription ${t}`;return r.jsx("div",{className:s.trim(),...a})}function Yt(e){const{className:t,...a}=e,{schema:s}=Mt(),i=`arkynAlertIcon ${s} ${t}`;switch(s){case"success":return r.jsx(Y.CheckCircle2,{className:i,...a});case"danger":return r.jsx(Y.XCircle,{className:i,...a});case"warning":return r.jsx(Y.AlertTriangle,{className:i,...a});case"info":return r.jsx(Y.Info,{className:i,...a})}}function Ae(e,t){return t?r.jsx(t,{size:e,strokeWidth:2.5}):r.jsx(r.Fragment,{})}function mt(e,t){return[...new Array(t-e)].map((a,s)=>e+s+1).filter(a=>a>0)}function Ht(e,t,a){return e>=a?[]:mt(e,e+t)}function Ut(e,t){return e<=1?[]:mt(e-1-t,e-1)}function Kt(e,t,a){if(!e)return r.jsx(r.Fragment,{});if(typeof e=="string")return r.jsx("p",{className:a,children:e});const s=e;return r.jsx("p",{className:a,children:r.jsx(s,{color:"var(--secondary-600)",size:t,strokeWidth:2.5})})}function Xt(e){const{variant:t="ghost",scheme:a="primary",size:s="md",leftIcon:i,rightIcon:c,className:f="",children:u,...d}=e,m={md:12,lg:14}[s],v=`arkynBadge ${t} ${a} ${s} ${f}`;return r.jsxs("div",{className:v.trim(),...d,children:[Ae(m,i),u,Ae(m,i)]})}function qt(e){const{className:t,...a}=e,s=`arkynCard ${t}`;return r.jsx("div",{className:s.trim(),...a})}function Gt(e){const{className:t,orientation:a="horizontal",...s}=e,i=`arkynDivider ${a} ${t}`;return r.jsx("div",{className:i.trim(),...s})}function Jt(e){const{className:t,...a}=e,s=`arkynSkeleton ${t}`;return r.jsx("aside",{className:s.trim(),...a})}function Zt(e){const{emptyMessage:t="Nenhum dado adicionado.",className:a,children:s,...i}=e,c=`arkynTableBody ${a}`,f=l.Children.count(s)===0;return r.jsx("tbody",{className:c.trim(),...i,children:f?r.jsx("tr",{className:"arkynTableBodyEmptyLine",children:r.jsx("td",{colSpan:100,children:r.jsx("div",{children:t})})}):s})}function Qt(e){const{className:t,children:a,...s}=e,i=`arkynTableCaption ${t}`;return r.jsx("caption",{className:i.trim(),...s,children:r.jsx("div",{className:"arkynTableCaptionContent",children:a})})}function en(e){const{children:t,className:a,...s}=e,i=`arkynTableContainer ${a}`;return r.jsx("div",{className:i.trim(),...s,children:r.jsx("table",{children:t})})}function tn(e){const{className:t,children:a,...s}=e,i=`arkynTableFooter ${t}`;return r.jsxs("tfoot",{className:i.trim(),...s,children:[r.jsx("tr",{className:"spacingRow"}),r.jsx("tr",{children:r.jsx("th",{colSpan:100,children:r.jsx("div",{className:"arkynTableFooterContent",children:a})})})]})}function nn(e){const{className:t,children:a,...s}=e,i=`arkynTableHeader ${t}`;return r.jsxs("thead",{className:i.trim(),...s,children:[r.jsx("tr",{children:a}),r.jsx("tr",{className:"spacingRow"})]})}function an(e){const{isLoading:t=!1,scheme:a="primary",variant:s="solid",loadingText:i,size:c="md",leftIcon:f,rightIcon:u,disabled:d,className:p="",children:m,...v}=e,y={xs:12,sm:16,md:20,lg:24}[c],C=`arkynButton ${t?"loadingTrue":"loadingFalse"} ${s} ${a} ${c} ${i?"loadingTextTrue":"loadingTextFalse"} ${p}`;return r.jsxs("button",{className:C,disabled:d||t,...v,children:[r.jsxs("div",{className:"arkynButtonSpinner",children:[r.jsx(Y.Loader2,{size:y,strokeWidth:2.5}),i&&i]}),r.jsxs("div",{className:"arkynButtonContent",children:[Ae(y,f),m,Ae(y,u)]})]})}const pt=l.createContext({});function rn(e){var m,v;const t=Pe.useActionData(),{children:a,className:s,...i}=e,c=l.useRef(null),f=((m=c.current)==null?void 0:m.name)||"",u=((v=t==null?void 0:t.fieldErrors)==null?void 0:v[f])||null,d=l.useId(),p=`arkynFormController ${s}`;return r.jsx(pt.Provider,{value:{error:u,id:d,inputRef:c},children:r.jsx("section",{className:p.trim(),...i,children:a})})}function me(){return l.useContext(pt)}function sn(e){const{name:t,className:a="",size:s="md",isError:i,defaultChecked:c=!1,checked:f=null,onCheck:u,value:d,...p}=e,{id:m,inputRef:v,error:o}=me(),y=i||!!o,[N,w]=l.useState(c||!1),C=typeof f=="boolean"?f:N,O=`arkynCheckbox ${s} ${y?"errorTrue":"errorFalse"} ${C?"checkedTrue":"checkedFalse"} ${a}`;function F(){const $=N;w(!$),u&&u($?"":d||"checked")}return r.jsxs("button",{id:m,type:"button",className:O,onClick:F,...p,children:[r.jsx("input",{type:"hidden",name:t,ref:v,value:C?d||"checked":""}),r.jsx(Y.Check,{})]})}function on(e){const{children:t,className:a,...s}=e,i=`arkynFormError ${a}`,{error:c}=me();return t?r.jsx("strong",{className:i.trim(),...s,children:t}):c?r.jsx("strong",{className:i.trim(),...s,children:c}):r.jsx(r.Fragment,{})}function ln(e){const{showAsterisk:t=!1,className:a="",...s}=e,{id:i}=me(),f=`arkynFormLabel ${t?"asteriskTrue":"asteriskFalse"} ${a}`;return r.jsx("label",{className:f.trim(),htmlFor:i,...s})}function cn(e){const{isLoading:t=!1,scheme:a="primary",variant:s="solid",size:i="md",icon:c,disabled:f,className:u="",...d}=e,p={xs:12,sm:16,md:20,lg:24},v=`arkynIconButton ${s} ${a} ${i} ${t?"loadingTrue":"loadingFalse"} ${u}`;return r.jsxs("button",{disabled:f||t,className:v.trim(),...d,children:[r.jsx("div",{className:"arkynIconButtonSpinner",children:r.jsx(Y.Loader2,{size:p[i],strokeWidth:2.5})}),r.jsx("div",{className:"arkynIconButtonContent",children:r.jsx(c,{size:p[i],strokeWidth:2.5})})]})}function Ce(e,t,a){if(!e)return r.jsx(r.Fragment,{});if(typeof e=="string")return r.jsx("p",{className:a,children:e});const s=e;return r.jsx("p",{className:a,children:r.jsx(s,{color:"var(--secondary-600)",size:t,strokeWidth:2.5})})}function Ze(e){return e&&e.replace(/[^0-9]/g,"")}function gt(e,t){let a="",s=0;return Array.from(e).forEach((i,c)=>{t[c+s].match(/[0-9]/)||(a+=t[c+s],s++),a+=i}),a}function vt(e){return e.length>11?"CNPJ":"CPF"}const Qe={CPF:"999.999.999-999",CNPJ:"99.999.999/9999-99"},bt=Ze(Qe.CNPJ).length;function un(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:v,defaultValue:o,readOnly:y,onFocus:N,onBlur:w,title:C,style:b,onChange:k,...O}=e;function F(X){let M=Ze(X);const q=vt(M);if(!(M.length>bt))return M=gt(M,Qe[q]),M}const $=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${v||y||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,E={md:20,lg:20}[i];return{isLoading:a,className:z,prefix:Ce(u,E,"prefix"),sufix:Ce(d,E,"sufix"),LeftIcon:p,RightIcon:m,defaultValue:F(o||""),disabled:v,readOnly:y,onFocus:N,onBlur:w,title:C,style:b,onChange:k,loadingPosition:$,iconSize:E,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:E,strokeWidth:2.5}),...O}}function dn(e){const[t,a]=l.useState(!1),s=l.useRef(null),{inputRef:i,id:c,error:f}=me(),u=i||s,d=e.isError||!!f,{disabled:p,title:m,style:v,className:o,prefix:y,sufix:N,iconSize:w,loadingPosition:C,isLoading:b,LeftIcon:k,readOnly:O,onFocus:F,onBlur:$,RightIcon:W,Spinner:L,onChange:K,value:H,defaultValue:Z,...z}=un({...e,id:c,isError:d},t),[ae,E]=l.useState(Z),X=k&&!b,M=W&&!b,q=C==="left"&&b,te=C==="right"&&b;function R(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function Q(P){let S=Ze(P.target.value);const ee=vt(S);S.length>bt||(S=gt(S,Qe[ee]),P.target.value=S,E(S),K&&K(P))}function le(P){a(!0),F&&F(P)}function _(P){a(!1),$&&$(P)}return r.jsxs("section",{title:m,style:v,onClick:R,className:o,children:[y,q&&L,X&&r.jsx(k,{size:w,strokeWidth:2.5}),r.jsx("input",{disabled:p||b,readOnly:O,ref:u,value:H||ae,onFocus:le,onChange:Q,onBlur:_,...z}),M&&r.jsx(W,{size:w,strokeWidth:2.5}),te&&L,N]})}const fn=3,hn=(e="pt-BR",t,a="BRL",s=!0)=>new Intl.NumberFormat(e,{style:"currency",currency:a,currencyDisplay:"symbol",minimumFractionDigits:2,maximumFractionDigits:2}).format(t).slice(s?fn:0),Ve=2,yt=e=>typeof e=="number"?e:Number(e.toString().replace(/[^0-9-]/g,"")),et=e=>{let t=e;return typeof e=="string"?(t=yt(e),t%1!==0&&(t=t.toFixed(Ve))):t=Number.isInteger(e)?Number(e)*10**Ve:e.toFixed(Ve),yt(t)/10**Ve},xt=(e,t,a)=>{if(!t)return[0,""];const s=et(t),i=hn(e,s,a);return[s,i]};function mn(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,max:b=1e9,locale:k="pt-BR",currency:O="BRL",...F}=e,$=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${v||o||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,E={md:20,lg:20}[i];return{isLoading:a,className:z,prefix:Ce(u,E,"prefix"),sufix:Ce(d,E,"sufix"),LeftIcon:p,RightIcon:m,disabled:v,locale:k,currency:O,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,max:b,loadingPosition:$,iconSize:E,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:E,strokeWidth:2.5}),...F}}function pn(e){const[t,a]=l.useState(!1),[s,i]=l.useState("0"),c=l.useRef(null),{inputRef:f,id:u,error:d}=me(),p=f||c,m=e.isError||!!d,{disabled:v,title:o,style:y,className:N,prefix:w,sufix:C,iconSize:b,loadingPosition:k,isLoading:O,LeftIcon:F,readOnly:$,onFocus:W,onBlur:L,RightIcon:K,Spinner:H,value:Z,max:z,onChangeValue:ae,onKeyPress:E,currency:X,locale:M,name:q,defaultValue:te,...R}=mn({...e,id:u,isError:m},t),Q=F&&!O,le=K&&!O,_=k==="left"&&O,P=k==="right"&&O;function S(){v||!(p!=null&&p.current)||(a(!0),p.current.focus())}function ee(J){a(!0),W&&W(J)}function ce(J){a(!1),L&&L(J)}const G=J=>{const[se,ke]=xt(M,J,X);return!z||se<=z?(i(ke),[se,ke]):[et(s),s]},xe=J=>{J.preventDefault();const[se,ke]=G(J.target.value);ae(J,String(se),String(ke))},pe=J=>E&&E(J,J.key,J.key);return l.useEffect(()=>{const J=Z||+te||void 0,[,se]=xt(M,J,X);i(se)},[X,te,Z]),r.jsxs("section",{title:o,style:y,onClick:S,className:N,children:[w,_&&H,Q&&r.jsx(F,{size:b,strokeWidth:2.5}),r.jsx("input",{value:s,onChange:xe,onBlur:ce,onFocus:ee,onKeyUp:pe,disabled:v||O,readOnly:$,...R}),r.jsx("input",{type:"hidden",ref:p,name:q,value:et(s)}),P&&H,le&&r.jsx(K,{size:b,strokeWidth:2.5}),C]})}function gn(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,onChange:b,showMask:k=!1,type:O,...F}=e,$=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${v||o||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,E={md:20,lg:20}[i];return{isLoading:a,className:z,prefix:Ce(u,E,"prefix"),sufix:Ce(d,E,"sufix"),LeftIcon:p,RightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,onChange:b,loadingPosition:$,iconSize:E,showMask:k,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:E,strokeWidth:2.5}),...F}}const vn=l.forwardRef((e,t)=>r.jsx("input",{ref:t,...e}));function bn(e){const[t,a]=l.useState(!1),s=l.useRef(null),{inputRef:i,id:c,error:f}=me(),u=i||s,d=e.isError||!!f,{disabled:p,title:m,style:v,className:o,prefix:y,sufix:N,iconSize:w,loadingPosition:C,isLoading:b,LeftIcon:k,readOnly:O,onFocus:F,onBlur:$,RightIcon:W,Spinner:L,...K}=gn({...e,id:c,isError:d},t),H=k&&!b,Z=W&&!b,z=C==="left"&&b,ae=C==="right"&&b;function E(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function X(q){a(!0),F&&F(q)}function M(q){a(!1),$&&$(q)}return r.jsxs("section",{title:m,style:v,onClick:E,className:o,children:[y,z&&L,H&&r.jsx(k,{size:w,strokeWidth:2.5}),r.jsx(Ot.InputMask,{component:vn,ref:u,onFocus:X,onBlur:M,disabled:p,...K}),Z&&r.jsx(W,{size:w,strokeWidth:2.5}),ae&&L,N]})}function yn(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,onChange:b,...k}=e,O=m?"right":"left",H=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${v||o||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,z={md:20,lg:20}[i];return{isLoading:a,className:H,prefix:Ce(u,z,"prefix"),sufix:Ce(d,z,"sufix"),LeftIcon:p,RightIcon:m,disabled:v,readOnly:o,onFocus:y,onBlur:N,title:w,style:C,onChange:b,loadingPosition:O,iconSize:z,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:z,strokeWidth:2.5}),...k}}function xn(e){const[t,a]=l.useState(!1),s=l.useRef(null),{inputRef:i,id:c,error:f}=me(),u=i||s,d=e.isError||!!f,{disabled:p,title:m,style:v,className:o,prefix:y,sufix:N,iconSize:w,loadingPosition:C,isLoading:b,LeftIcon:k,readOnly:O,onFocus:F,onBlur:$,RightIcon:W,type:L,Spinner:K,...H}=yn({...e,id:c,isError:d},t),Z=k&&!b,z=W&&!b,ae=C==="left"&&b,E=C==="right"&&b;function X(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function M(te){a(!0),F&&F(te)}function q(te){a(!1),$&&$(te)}return L==="hidden"?r.jsx("input",{style:{display:"none"},readOnly:!0,type:"text",ref:u,...H}):r.jsxs("section",{title:m,style:v,onClick:X,className:o,children:[y,ae&&K,Z&&r.jsx(k,{size:w,strokeWidth:2.5}),r.jsx("input",{disabled:p||b,readOnly:O,ref:u,onFocus:M,onBlur:q,type:L,...H}),z&&r.jsx(W,{size:w,strokeWidth:2.5}),E&&K,N]})}function wn(e){return e.type==="currency"?r.jsx(pn,{...e}):e.type==="masked"?r.jsx(bn,{...e}):e.type==="cpf-cnpj"?r.jsx(dn,{...e}):r.jsx(xn,{...e})}const wt=l.createContext({});function Cn(){return l.useContext(wt)}function kn(e){const{defaultValue:t,name:a,value:s,onChange:i,size:c="md",className:f="",...u}=e,[d,p]=l.useState(t||""),{inputRef:m,id:v}=me();function o(N){p(N),i&&i(N)}const y=`arkynRadioGroup ${c} ${f}`;return r.jsxs(wt.Provider,{value:{onChange:o,value:s||d,size:c},children:[r.jsx("input",{style:{display:"none"},type:"text",id:v,readOnly:!0,name:a,ref:m,value:s||d}),r.jsx("div",{className:y.trim(),...u})]})}function Nn(e){const{value:t,size:a,disabled:s,children:i,className:c="",...f}=e,{onChange:u,size:d,value:p}=Cn(),{error:m}=me(),w=`arkynRadioBox ${a||d} ${p===t?"checkedTrue":"checkedFalse"} ${m?"errorTrue":"errorFalse"} ${s?"disabledTrue":"disabledFalse"} ${c}`;return r.jsxs("label",{className:w.trim(),children:[r.jsx("button",{type:"button",disabled:s,onClick:()=>u(t),onFocus:()=>u(t),...f}),i]})}function jn(e,t){const{isLoading:a,isError:s,size:i="md",className:c="",variant:f="solid",prefix:u,leftIcon:d,disabled:p,readOnly:m,onFocus:v,onBlur:o,title:y,style:N,closeOnSelect:w=!0,...C}=e,$=`arkyn_select ${u?"hasPrefix":""} ${f} ${i} ${p||m||a?"opacity":""} ${s?"errored":""} ${t?"focused":""} ${c}`,L={md:20,lg:20}[i];return{isLoading:a,className:$,prefix:Kt(u,L,"prefix"),LeftIcon:d,disabled:p||a||m,onFocus:v,onBlur:o,title:y,closeOnSelect:w,style:N,iconSize:L,Spinner:r.jsx(Y.Loader2,{className:"spinner",size:L,strokeWidth:2.5}),...C}}function Sn(e){var P;const[t,a]=l.useState(!1),{inputRef:s,id:i,error:c}=me(),f=l.useRef(null),u=s||f,d=e.isError||!!c,{disabled:p,title:m,style:v,className:o,prefix:y,iconSize:N,isLoading:w,LeftIcon:C,value:b=null,defaultValue:k="",onFocus:O,onBlur:F,Spinner:$,name:W,placeholder:L,onSelect:K,options:H,optionMaxHeight:Z,closeOnSelect:z,...ae}=jn({...e,id:i,isError:d},t),[E,X]=l.useState(k);function M(){p||!(u!=null&&u.current)||t||(a(!0),u.current.focus())}function q(S){t||(a(!0),O&&O(S))}function te(){a(!1),F&&u.current&&u.current.blur()}function R(S){const{label:ee,value:ce}=S;X(E!==ce?ce:""),K&&K({label:ee,value:ce}),z&&te()}const Q=typeof b=="string"?b:E,le=((P=H.find(S=>S.value===Q))==null?void 0:P.label)||"",_=()=>{if(!t&&le)return!0;if(!t&&!le)return!1;if(t&&le)return!0;if(t&&!le)return!1};return r.jsxs(r.Fragment,{children:[r.jsxs("section",{title:m,style:v,onClick:M,className:`${o} placeholder_dark_${_()}`,children:[y,C&&r.jsx(C,{size:N,strokeWidth:2.5}),r.jsx("input",{disabled:p,readOnly:!0,placeholder:le||L,onFocus:q,...ae}),r.jsx("input",{type:"hidden",ref:u,name:W,value:Q||"",readOnly:!0}),t&&r.jsxs("div",{className:"arkyn_select_content",style:{overflow:"auto",maxHeight:Z},children:[H.map(({label:S,value:ee})=>r.jsxs("div",{onClick:()=>R({label:S,value:ee}),className:Q===ee?"arkyn_select_option active":"arkyn_select_option",children:[S," ",r.jsx(Y.Check,{})]},ee)),H.length<=0&&r.jsx("p",{children:"Sem opções disponíveis"})]}),!w&&r.jsx(Y.ChevronDown,{className:"arkyn_select_arrow",size:N,strokeWidth:2.5}),w&&$]}),t&&r.jsx("aside",{className:"arkyn_select_overlay",onClick:te})]})}function En(e){const{size:t="lg",defaultChecked:a=!1,checked:s=null,value:i,name:c,className:f="",onCheck:u,...d}=e,[p,m]=l.useState(a),{id:v,inputRef:o}=me();function y(){m(!p),u&&u(a?"":i||"checked")}const N=typeof s=="boolean"?s:p,C=`arkynSwitch ${N?"checkedTrue":"checkedFalse"} ${t} ${f}`;return r.jsx("button",{id:v,type:"button",onClick:y,className:C,...d,children:r.jsx("input",{type:"hidden",name:c,ref:o,value:N?i||"checked":""})})}function Tn(e){const{variant:t="solid",size:a="md",className:s,disabled:i=!1,readOnly:c=!1,onFocus:f,onBlur:u,title:d,style:p,...m}=e,[v,o]=l.useState(!1),{inputRef:y,id:N,error:w}=me(),C=l.useRef(null),b=y||C,O=e.isError||!!w?"errorTrue":"errorFalse",W=`arkynTextarea ${t} ${a} ${i||c?"opacityTrue":"opacityFalse"} ${O} ${v?"focusedTrue":"focusedFalse"} ${s}`;function L(){i||!(b!=null&&b.current)||(o(!0),b.current.focus())}function K(Z){o(!0),f&&f(Z)}function H(Z){o(!1),u&&u(Z)}return r.jsx("section",{title:d,style:p,onClick:L,className:W,children:r.jsx("textarea",{id:N,disabled:i,readOnly:c,ref:b,onFocus:K,onBlur:H,...m})})}function Pn(e){const{className:t="",...a}=e,s=`arkynBreadcrumbContainer ${t}`;return r.jsx("nav",{className:s,...a})}function $n(e){const{pathname:t}=Pe.useLocation(),{className:a="",disabled:s=!1,children:i,to:c,...f}=e,d=`arkynBreadcrumbLink ${t===c?"active":"inactive"} ${a}`;return s?r.jsxs("p",{className:d,children:[r.jsx(Y.ChevronRight,{size:14,strokeWidth:2.5}),i]}):r.jsxs(Pe.Link,{to:c,className:d,...f,children:[r.jsx(Y.ChevronRight,{size:14,strokeWidth:2.5}),i]})}function Ct(e=""){const t=Pe.useLocation(),a=new URLSearchParams(t.search),s=e?`${e}:`:"",i=c=>{Object.entries(c).forEach(([f,u])=>{u===void 0?a.delete(`${s}${f}`):a.set(`${s}${f}`,String(u))})};return{getParam:c=>a.get(`${s}${c}`),getScopedSearch:c=>{i(c);let f=a.toString();return f&&(f="?"+f),f}}}function Rn(e){const{scope:t,totalCountRegisters:a,perPageKey:s="per_page",pageKey:i="page",siblingsCount:c=2,...f}=e,u=Pe.useNavigate(),{getParam:d,getScopedSearch:p}=Ct(t),m=Number(d(i))||1,v=Number(d(s))||20,o=Math.ceil(a/v),y=Ut(m,c),N=Ht(m,c,o);function w(C){u(p({page:C}))}return r.jsxs("div",{className:"arkynPagination",...f,children:[r.jsx("button",{className:"arkynPaginationIconButton",disabled:m<=1,onClick:()=>w(m-1),children:r.jsx(Y.ChevronLeft,{})}),m>1+c&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"arkynPaginationPageButton",onClick:()=>w(1),children:"1"}),m>2+c&&r.jsx("button",{disabled:!0,className:"arkynPaginationSpread",children:r.jsx(Y.Ellipsis,{})})]}),y.map((C,b)=>r.jsx("button",{onClick:()=>w(C),className:"arkynPaginationPageButton",children:C},b)),r.jsx("button",{className:"arkynPaginationCurrent",disabled:!0,children:m}),N.map((C,b)=>r.jsx("button",{onClick:()=>w(C),className:"arkynPaginationPageButton",children:C},b)),m+c<o&&r.jsxs(r.Fragment,{children:[m+1+c<o&&r.jsx("button",{disabled:!0,className:"arkynPaginationSpread",children:r.jsx(Y.Ellipsis,{})}),r.jsx("button",{className:"arkynPaginationPageButton",onClick:()=>w(o),children:o})]}),r.jsx("button",{className:"arkynPaginationIconButton",disabled:m>=o,onClick:()=>w(m+1),children:r.jsx(Y.ChevronRight,{})})]})}const tt=l.createContext({});function In(){if(!tt)throw new Error("useTabContext must be used within a TabProvider");return l.useContext(tt)}function _n(e){const{children:t,onClick:a,defaultActive:s,className:i,...c}=e,[f,u]=l.useState(s||""),[d,p]=l.useState(!0),m=l.useRef(null),v=`arkynTabContainer ${i||""}`,[o,y]=l.useState({width:"0px",left:"0px",transition:"none"}),N=(C,b)=>{const k=C.getBoundingClientRect(),O=m.current.getBoundingClientRect(),F=b?void 0:"none";p(!1),y({transition:F,width:`${k.width}px`,left:`${k.left-O.left}px`})};l.useEffect(()=>{const C=m.current;if(!C)return;let b=null;b=C.querySelector("button.active"),b&&N(b)},[]);const w=C=>{const b=C.target;b&&(u(b.value),b.classList.add("active"),N(b,!0),a&&a(b.value))};return r.jsxs("nav",{ref:m,className:v.trim(),...c,children:[r.jsx(tt.Provider,{value:{handleTabClick:w,showInitialTab:d,value:f},children:t}),r.jsx("div",{className:"activeLine",style:o})]})}function Fn(e){const{children:t,className:a="",onClick:s,...i}=e,{value:c,showInitialTab:f,handleTabClick:u}=In(),d=c===i.value&&c?"activeTrue":"activeFalse",m=`arkynTabButton ${c===i.value&&f?"showBorderBottom":""} ${d} ${a}`;function v(o){u(o),s&&s(o)}return r.jsx("button",{onClick:v,className:m.trim(),...i,children:t})}const kt=l.createContext({});function Bn(e){const{isVisibled:t,makeInvisible:a,orientation:s="left",children:i,className:c,...f}=e,u=s==="left"?"-100%":"100%",p=`arkynDrawerContainer ${s} ${t?"visibleTrue":"visibleFalse"} ${c}`;return r.jsx(kt.Provider,{value:{makeInvisible:a},children:r.jsx(Se.AnimatePresence,{children:t&&r.jsxs("aside",{className:p.trim(),...f,children:[r.jsx(Se.motion.div,{className:"arkynDrawerContainerOverlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a}),r.jsx(Se.motion.div,{className:"arkynDrawerContainerContent",transition:{ease:"easeOut",duration:.15},initial:{transform:`translateX(${u})`},animate:{transform:"translateX(0px)"},exit:{transform:`translateX(${u})`},children:i})]})})})}function On(e){const{showCloseButton:t=!0,className:a,children:s,...i}=e,{makeInvisible:c}=l.useContext(kt),f=`arkynDrawerHeader ${a}`;return r.jsxs("header",{className:f.trim(),...i,children:[s,t&&r.jsx("button",{className:"arkynDrawerHeaderCloseButton",type:"button",onClick:c,"aria-label":"Close drawer",children:r.jsx(Y.X,{size:24})})]})}const Nt=l.createContext({});function zn(e){const{isVisibled:t,makeInvisible:a,children:s,className:i="",...c}=e,u=`arkynModalContainer ${t?"visibleTrue":"visibleFalse"} ${i}`;return r.jsx(Nt.Provider,{value:{makeInvisible:a},children:r.jsx(Se.AnimatePresence,{children:t&&r.jsxs("aside",{className:u.trim(),...c,children:[r.jsx(Se.motion.div,{className:"arkynModalContainerOverlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a}),r.jsx(Se.motion.div,{className:"arkynModalContainerContent",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0,scale:.75},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},children:s})]})})})}function Dn(e){const{alignment:t="right",className:a,...s}=e,i=`arkynModalFooter ${t} ${a}`;return r.jsx("footer",{className:i.trim(),...s})}function Ln(e){const{showCloseButton:t=!0,className:a,children:s,...i}=e,{makeInvisible:c}=l.useContext(Nt),f=`arkynModalHeader ${a}`;return r.jsxs("header",{className:f.trim(),...i,children:[s,t&&r.jsx("button",{type:"button",onClick:c,"aria-label":"Close modal button",className:"arkynModalHeaderCloseButton",children:r.jsx(Y.X,{size:24})})]})}function Mn(e){const{children:t,button:a,closeOnClick:s,orientation:i="bottomLeft"}=e,[c,f]=l.useState(!1),d=`arkynPopover ${i} ${c?"visibleTrue":"visibleFalse"}`;function p(){c||f(!0)}return r.jsxs("div",{className:d,onClick:p,children:[a,r.jsx(Se.motion.div,{style:{visibility:c?"visible":"hidden"},transition:{ease:"easeOut",duration:0},initial:{opacity:0},animate:{opacity:c?1:0},exit:{opacity:0},onClick:()=>s&&f(!1),className:"arkynPopoverContent",children:t}),c&&r.jsx("div",{onClick:()=>f(!1),className:"arkynPopoverOverlay"})]})}function jt(e){const{message:t,title:a,type:s,size:i="lg"}=e,c=`arkynToast ${s} ${i}`;function f(){switch(s){case"info":return r.jsx(Y.Info,{});case"success":return r.jsx(Y.CheckCircle2,{});case"danger":return r.jsx(Y.XCircle,{});case"warning":return r.jsx(Y.AlertCircle,{});default:return r.jsx(Y.Info,{})}}return r.jsxs("aside",{className:c,children:[r.jsxs("div",{children:[r.jsx("div",{className:"bg"}),r.jsx(f,{})]}),r.jsxs("p",{children:[r.jsx("strong",{title:a,children:a}),r.jsx("span",{children:t})]})]})}function An(e){const{text:t,size:a="lg",children:s,orientation:i="top",className:c="",...f}=e,u=`arkynTooltip ${a} ${i} ${c}`;return r.jsxs("div",{className:u.trim(),...f,children:[s,r.jsx("div",{className:"arkynTooltipText",children:t})]})}const nt=l.createContext({}),St=l.createContext({});function Et(){const e=l.useContext(St);if(Object.entries(e).length===0)throw new Error("useToast must be used within a Provider");return e}function Tt(e){return e&&typeof e.title=="string"&&typeof e.message=="string"&&(e.size===void 0||e.size==="md"||e.size==="lg")&&(e.type==="info"||e.type==="success"||e.type==="danger"||e.type==="warning")}function Vn(){const e=Pe.useActionData(),{closeModal:t}=l.useContext(nt),{showToast:a}=Et();l.useEffect(()=>{const s=e==null?void 0:e.closeModalKey;s&&t(s)},[e]),l.useEffect(()=>{const s=e==null?void 0:e.toast,i=e==null?void 0:e.message;Tt(s)&&a(s),!Tt(s)&&i&&a({message:i,title:"Atenção!",type:"warning"})},[e])}const Pt=l.createContext({});function Wn(e){const t=l.useContext(Pt);if(Object.entries(t).length===0)throw new Error("useDrawer must be used within a Provider");if(e){const{drawerData:a,drawerIsOpen:s,openDrawer:i,closeDrawer:c}=t,f=s(e),u=a(e);return{drawerIsOpen:f,drawerData:u,openDrawer:m=>i(e,m),closeDrawer:()=>c(e)}}else return t}function Yn(e){const t=l.useContext(nt);if(Object.entries(t).length===0)throw new Error("useModal must be used within a Provider");if(e){const{modalData:a,modalIsOpen:s,openModal:i,closeModal:c}=t,f=s(e),u=a(e);return{modalIsOpen:f,modalData:u,openModal:m=>i(e,m),closeModal:()=>c(e)}}else return t}function Hn(e){const{children:t=!1}=e,[a,s]=l.useState([]);function i(d){return!!a.some(p=>p.key===d)}function c(d){var p;return(p=a.find(m=>m.key===d))==null?void 0:p.data}function f(d,p){const m=i(d);s(m?v=>[...v.filter(y=>y.key!==d),{key:d,data:p}]:[...a,{key:d,data:p}])}function u(d){s(a.filter(p=>p.key!==d))}return r.jsx(Pt.Provider,{value:{drawerIsOpen:i,drawerData:c,openDrawer:f,closeDrawer:u},children:t})}function Un(e){const{children:t=!1}=e,[a,s]=l.useState([]);function i(d){return!!a.some(p=>p.key===d)}function c(d){var p;return(p=a.find(m=>m.key===d))==null?void 0:p.data}function f(d,p){const m=i(d);s(m?v=>[...v.filter(y=>y.key!==d),{key:d,data:p}]:[...a,{key:d,data:p}])}function u(d){s(a.filter(p=>p.key!==d))}return r.jsx(nt.Provider,{value:{modalIsOpen:i,modalData:c,openModal:f,closeModal:u},children:t})}var Kn=e=>{switch(e){case"success":return Gn;case"info":return Zn;case"warning":return Jn;case"error":return Qn;default:return null}},Xn=Array(12).fill(0),qn=({visible:e})=>l.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},l.createElement("div",{className:"sonner-spinner"},Xn.map((t,a)=>l.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),Gn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Jn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Zn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Qn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ea=()=>{let[e,t]=l.useState(document.hidden);return l.useEffect(()=>{let a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e},at=1,ta=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:a,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:at++,c=this.toasts.find(u=>u.id===i),f=e.dismissible===void 0?!0:e.dismissible;return c?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:a}),{...u,...e,id:i,dismissible:f,title:a}):u):this.addToast({title:a,...s,dismissible:f,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(a=>a({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let a;t.loading!==void 0&&(a=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let s=e instanceof Promise?e:e(),i=a!==void 0;return s.then(async c=>{if(aa(c)&&!c.ok){i=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:a,type:"error",message:f,description:u})}else if(t.success!==void 0){i=!1;let f=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:a,type:"success",message:f,description:u})}}).catch(async c=>{if(t.error!==void 0){i=!1;let f=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:a,type:"error",message:f,description:u})}}).finally(()=>{var c;i&&(this.dismiss(a),a=void 0),(c=t.finally)==null||c.call(t)}),a},this.custom=(e,t)=>{let a=(t==null?void 0:t.id)||at++;return this.create({jsx:e(a),id:a,...t}),a},this.subscribers=[],this.toasts=[]}},he=new ta,na=(e,t)=>{let a=(t==null?void 0:t.id)||at++;return he.addToast({title:e,...t,id:a}),a},aa=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ra=na,sa=()=>he.toasts,oa=Object.assign(ra,{success:he.success,info:he.info,warning:he.warning,error:he.error,custom:he.custom,message:he.message,promise:he.promise,dismiss:he.dismiss,loading:he.loading},{getHistory:sa});function ia(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&a.firstChild?a.insertBefore(s,a.firstChild):a.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}ia(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
33
33
  `);function We(e){return e.label!==void 0}var la=3,ca="32px",ua=4e3,da=356,fa=14,ha=20,ma=200;function pa(...e){return e.filter(Boolean).join(" ")}var ga=e=>{var t,a,s,i,c,f,u,d,p,m;let{invert:v,toast:o,unstyled:y,interacting:N,setHeights:w,visibleToasts:C,heights:b,index:k,toasts:O,expanded:F,removeToast:$,defaultRichColors:W,closeButton:L,style:K,cancelButtonStyle:H,actionButtonStyle:Z,className:z="",descriptionClassName:ae="",duration:E,position:X,gap:M,loadingIcon:q,expandByDefault:te,classNames:R,icons:Q,closeButtonAriaLabel:le="Close toast",pauseWhenPageIsHidden:_,cn:P}=e,[S,ee]=l.useState(!1),[ce,G]=l.useState(!1),[xe,pe]=l.useState(!1),[J,se]=l.useState(!1),[ke,$e]=l.useState(0),[rt,Ye]=l.useState(0),Ee=l.useRef(null),ge=l.useRef(null),He=k===0,Ue=k+1<=C,oe=o.type,Ne=o.dismissible!==!1,st=o.className||"",Oe=o.descriptionClassName||"",Re=l.useMemo(()=>b.findIndex(T=>T.toastId===o.id)||0,[b,o.id]),ot=l.useMemo(()=>{var T;return(T=o.closeButton)!=null?T:L},[o.closeButton,L]),ze=l.useMemo(()=>o.duration||E||ua,[o.duration,E]),Ie=l.useRef(0),ve=l.useRef(0),Ke=l.useRef(0),we=l.useRef(null),[De,Le]=X.split("-"),Xe=l.useMemo(()=>b.reduce((T,A,V)=>V>=Re?T:T+A.height,0),[b,Re]),qe=ea(),it=o.invert||v,Me=oe==="loading";ve.current=l.useMemo(()=>Re*M+Xe,[Re,Xe]),l.useEffect(()=>{ee(!0)},[]),l.useLayoutEffect(()=>{if(!S)return;let T=ge.current,A=T.style.height;T.style.height="auto";let V=T.getBoundingClientRect().height;T.style.height=A,Ye(V),w(ie=>ie.find(de=>de.toastId===o.id)?ie.map(de=>de.toastId===o.id?{...de,height:V}:de):[{toastId:o.id,height:V,position:o.position},...ie])},[S,o.title,o.description,w,o.id]);let ye=l.useCallback(()=>{G(!0),$e(ve.current),w(T=>T.filter(A=>A.toastId!==o.id)),setTimeout(()=>{$(o)},ma)},[o,$,w,ve]);l.useEffect(()=>{if(o.promise&&oe==="loading"||o.duration===1/0||o.type==="loading")return;let T,A=ze;return F||N||_&&qe?(()=>{if(Ke.current<Ie.current){let V=new Date().getTime()-Ie.current;A=A-V}Ke.current=new Date().getTime()})():A!==1/0&&(Ie.current=new Date().getTime(),T=setTimeout(()=>{var V;(V=o.onAutoClose)==null||V.call(o,o),ye()},A)),()=>clearTimeout(T)},[F,N,te,o,ze,ye,o.promise,oe,_,qe]),l.useEffect(()=>{let T=ge.current;if(T){let A=T.getBoundingClientRect().height;return Ye(A),w(V=>[{toastId:o.id,height:A,position:o.position},...V]),()=>w(V=>V.filter(ie=>ie.toastId!==o.id))}},[w,o.id]),l.useEffect(()=>{o.delete&&ye()},[ye,o.delete]);function lt(){return Q!=null&&Q.loading?l.createElement("div",{className:"sonner-loader","data-visible":oe==="loading"},Q.loading):q?l.createElement("div",{className:"sonner-loader","data-visible":oe==="loading"},q):l.createElement(qn,{visible:oe==="loading"})}return l.createElement("li",{"aria-live":o.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:ge,className:P(z,st,R==null?void 0:R.toast,(t=o==null?void 0:o.classNames)==null?void 0:t.toast,R==null?void 0:R.default,R==null?void 0:R[oe],(a=o==null?void 0:o.classNames)==null?void 0:a[oe]),"data-sonner-toast":"","data-rich-colors":(s=o.richColors)!=null?s:W,"data-styled":!(o.jsx||o.unstyled||y),"data-mounted":S,"data-promise":!!o.promise,"data-removed":ce,"data-visible":Ue,"data-y-position":De,"data-x-position":Le,"data-index":k,"data-front":He,"data-swiping":xe,"data-dismissible":Ne,"data-type":oe,"data-invert":it,"data-swipe-out":J,"data-expanded":!!(F||te&&S),style:{"--index":k,"--toasts-before":k,"--z-index":O.length-k,"--offset":`${ce?ke:ve.current}px`,"--initial-height":te?"auto":`${rt}px`,...K,...o.style},onPointerDown:T=>{Me||!Ne||(Ee.current=new Date,$e(ve.current),T.target.setPointerCapture(T.pointerId),T.target.tagName!=="BUTTON"&&(pe(!0),we.current={x:T.clientX,y:T.clientY}))},onPointerUp:()=>{var T,A,V,ie;if(J||!Ne)return;we.current=null;let de=Number(((T=ge.current)==null?void 0:T.style.getPropertyValue("--swipe-amount").replace("px",""))||0),je=new Date().getTime()-((A=Ee.current)==null?void 0:A.getTime()),Ge=Math.abs(de)/je;if(Math.abs(de)>=ha||Ge>.11){$e(ve.current),(V=o.onDismiss)==null||V.call(o,o),ye(),se(!0);return}(ie=ge.current)==null||ie.style.setProperty("--swipe-amount","0px"),pe(!1)},onPointerMove:T=>{var A;if(!we.current||!Ne)return;let V=T.clientY-we.current.y,ie=T.clientX-we.current.x,de=(De==="top"?Math.min:Math.max)(0,V),je=T.pointerType==="touch"?10:2;Math.abs(de)>je?(A=ge.current)==null||A.style.setProperty("--swipe-amount",`${V}px`):Math.abs(ie)>je&&(we.current=null)}},ot&&!o.jsx?l.createElement("button",{"aria-label":le,"data-disabled":Me,"data-close-button":!0,onClick:Me||!Ne?()=>{}:()=>{var T;ye(),(T=o.onDismiss)==null||T.call(o,o)},className:P(R==null?void 0:R.closeButton,(i=o==null?void 0:o.classNames)==null?void 0:i.closeButton)},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},l.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,o.jsx||l.isValidElement(o.title)?o.jsx||o.title:l.createElement(l.Fragment,null,oe||o.icon||o.promise?l.createElement("div",{"data-icon":"",className:P(R==null?void 0:R.icon,(c=o==null?void 0:o.classNames)==null?void 0:c.icon)},o.promise||o.type==="loading"&&!o.icon?o.icon||lt():null,o.type!=="loading"?o.icon||(Q==null?void 0:Q[oe])||Kn(oe):null):null,l.createElement("div",{"data-content":"",className:P(R==null?void 0:R.content,(f=o==null?void 0:o.classNames)==null?void 0:f.content)},l.createElement("div",{"data-title":"",className:P(R==null?void 0:R.title,(u=o==null?void 0:o.classNames)==null?void 0:u.title)},o.title),o.description?l.createElement("div",{"data-description":"",className:P(ae,Oe,R==null?void 0:R.description,(d=o==null?void 0:o.classNames)==null?void 0:d.description)},o.description):null),l.isValidElement(o.cancel)?o.cancel:o.cancel&&We(o.cancel)?l.createElement("button",{"data-button":!0,"data-cancel":!0,style:o.cancelButtonStyle||H,onClick:T=>{var A,V;We(o.cancel)&&Ne&&((V=(A=o.cancel).onClick)==null||V.call(A,T),ye())},className:P(R==null?void 0:R.cancelButton,(p=o==null?void 0:o.classNames)==null?void 0:p.cancelButton)},o.cancel.label):null,l.isValidElement(o.action)?o.action:o.action&&We(o.action)?l.createElement("button",{"data-button":!0,"data-action":!0,style:o.actionButtonStyle||Z,onClick:T=>{var A,V;We(o.action)&&(T.defaultPrevented||((V=(A=o.action).onClick)==null||V.call(A,T),ye()))},className:P(R==null?void 0:R.actionButton,(m=o==null?void 0:o.classNames)==null?void 0:m.actionButton)},o.action.label):null))};function $t(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var va=e=>{let{invert:t,position:a="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:c,className:f,offset:u,theme:d="light",richColors:p,duration:m,style:v,visibleToasts:o=la,toastOptions:y,dir:N=$t(),gap:w=fa,loadingIcon:C,icons:b,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:O,cn:F=pa}=e,[$,W]=l.useState([]),L=l.useMemo(()=>Array.from(new Set([a].concat($.filter(_=>_.position).map(_=>_.position)))),[$,a]),[K,H]=l.useState([]),[Z,z]=l.useState(!1),[ae,E]=l.useState(!1),[X,M]=l.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=l.useRef(null),te=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=l.useRef(null),Q=l.useRef(!1),le=l.useCallback(_=>{var P;(P=$.find(S=>S.id===_.id))!=null&&P.delete||he.dismiss(_.id),W(S=>S.filter(({id:ee})=>ee!==_.id))},[$]);return l.useEffect(()=>he.subscribe(_=>{if(_.dismiss){W(P=>P.map(S=>S.id===_.id?{...S,delete:!0}:S));return}setTimeout(()=>{zt.flushSync(()=>{W(P=>{let S=P.findIndex(ee=>ee.id===_.id);return S!==-1?[...P.slice(0,S),{...P[S],..._},...P.slice(S+1)]:[_,...P]})})})}),[]),l.useEffect(()=>{if(d!=="system"){M(d);return}d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:_})=>{M(_?"dark":"light")})},[d]),l.useEffect(()=>{$.length<=1&&z(!1)},[$]),l.useEffect(()=>{let _=P=>{var S,ee;s.every(ce=>P[ce]||P.code===ce)&&(z(!0),(S=q.current)==null||S.focus()),P.code==="Escape"&&(document.activeElement===q.current||(ee=q.current)!=null&&ee.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[s]),l.useEffect(()=>{if(q.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,Q.current=!1)}},[q.current]),$.length?l.createElement("section",{"aria-label":`${k} ${te}`,tabIndex:-1},L.map((_,P)=>{var S;let[ee,ce]=_.split("-");return l.createElement("ol",{key:_,dir:N==="auto"?$t():N,tabIndex:-1,ref:q,className:f,"data-sonner-toaster":!0,"data-theme":X,"data-y-position":ee,"data-x-position":ce,style:{"--front-toast-height":`${((S=K[0])==null?void 0:S.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||ca,"--width":`${da}px`,"--gap":`${w}px`,...v},onBlur:G=>{Q.current&&!G.currentTarget.contains(G.relatedTarget)&&(Q.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,R.current=G.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{ae||z(!1)},onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},$.filter(G=>!G.position&&P===0||G.position===_).map((G,xe)=>{var pe,J;return l.createElement(ga,{key:G.id,icons:b,index:xe,toast:G,defaultRichColors:p,duration:(pe=y==null?void 0:y.duration)!=null?pe:m,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:t,visibleToasts:o,closeButton:(J=y==null?void 0:y.closeButton)!=null?J:c,interacting:ae,position:_,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:le,toasts:$.filter(se=>se.position==G.position),heights:K.filter(se=>se.position==G.position),setHeights:H,expandByDefault:i,gap:w,loadingIcon:C,expanded:Z,pauseWhenPageIsHidden:O,cn:F})}))})):null};function ba({children:e}){function t(a){oa.custom(s=>r.jsx(jt,{...a}))}return r.jsxs(St.Provider,{value:{showToast:t},children:[r.jsx(va,{}),e]})}x.AlertContainer=At,x.AlertContent=Vt,x.AlertDescription=Wt,x.AlertIcon=Yt,x.AlertTitle=ft,x.Badge=Xt,x.BreadcrumbContainer=Pn,x.BreadcrumbLink=$n,x.Button=an,x.Card=qt,x.Checkbox=sn,x.Divider=Gt,x.DrawerContainer=Bn,x.DrawerHeader=On,x.DrawerProvider=Hn,x.FormController=rn,x.FormError=on,x.FormLabel=ln,x.IconButton=cn,x.Input=wn,x.ModalContainer=zn,x.ModalFooter=Dn,x.ModalHeader=Ln,x.ModalProvider=Un,x.Pagination=Rn,x.Popover=Mn,x.RadioBox=Nn,x.RadioGroup=kn,x.Select=Sn,x.Skeleton=Jt,x.Switch=En,x.TabButton=Fn,x.TabContainer=_n,x.TableBody=Zt,x.TableCaption=Qt,x.TableContainer=en,x.TableFooter=tn,x.TableHeader=nn,x.Textarea=Tn,x.Toast=jt,x.ToastProvider=ba,x.Tooltip=An,x.useAutomation=Vn,x.useDrawer=Wn,x.useModal=Yn,x.useScopedParams=Ct,x.useToast=Et,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
@@ -283,7 +283,7 @@ declare function getConfig(props: CurrencyInputProps, isFocused: boolean): {
283
283
  placeholder?: string | undefined;
284
284
  required?: boolean | undefined;
285
285
  src?: string | undefined;
286
- defaultValue?: string;
286
+ defaultValue?: string | number | null;
287
287
  onChangeValue?: (event: import("react").ChangeEvent<HTMLInputElement>, originalValue: string, maskedValue: string) => void;
288
288
  value?: string;
289
289
  isLoading: boolean;
@@ -47,7 +47,7 @@ function CurrencyInput(props) {
47
47
  };
48
48
  const handleKeyUp = (event) => onKeyPress && onKeyPress(event, event.key, event.key);
49
49
  useEffect(() => {
50
- const currentValue = value || defaultValue || undefined;
50
+ const currentValue = value || +defaultValue || undefined;
51
51
  const [, maskedValue] = maskValues(locale, currentValue, currency);
52
52
  setMaskedValue(maskedValue);
53
53
  }, [currency, defaultValue, value]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/components",
3
- "version": "1.3.86",
3
+ "version": "1.3.88",
4
4
  "main": "./dist/bundle.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Lucas Gonçalves",
@@ -93,7 +93,7 @@ function CurrencyInput(props: CurrencyInputProps) {
93
93
  onKeyPress && onKeyPress(event, event.key, event.key);
94
94
 
95
95
  useEffect(() => {
96
- const currentValue = value || defaultValue || undefined;
96
+ const currentValue = value || +defaultValue || undefined;
97
97
  const [, maskedValue] = maskValues(locale, currentValue, currency);
98
98
 
99
99
  setMaskedValue(maskedValue);