tempest-react-sdk 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/styles.css +1 -1
- package/dist/tempest-react-sdk.cjs +3 -3
- package/dist/tempest-react-sdk.cjs.map +1 -1
- package/dist/tempest-react-sdk.d.ts +323 -0
- package/dist/tempest-react-sdk.js +2602 -2108
- package/dist/tempest-react-sdk.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),Ee=require("react-dom"),K=require("react-hook-form"),Ue=require("@tanstack/react-query"),Rt=require("zustand"),Ge=require("zustand/middleware"),Pt=require("dexie");function g(...e){const t=[];for(const n of e)if(!(n==null||n===!1||n===!0)){if(typeof n=="string")n&&t.push(n);else if(typeof n=="number"||typeof n=="bigint")t.push(String(n));else if(Array.isArray(n)){const s=g(...n);s&&t.push(s)}}return t.join(" ")}const Dt="tempest_accordion_LVhhv",Mt="tempest_item_7ryVk",At="tempest_header_WaTdJ",Ft="tempest_trigger_9BYFY",Bt="tempest_chevron_i-HVZ",Ot="tempest_open_98jLY",Wt="tempest_panel_Wx50w",ne={accordion:Dt,item:Mt,header:At,trigger:Ft,chevron:Bt,open:Ot,panel:Wt};function zt({items:e,multiple:t=!1,value:n,defaultValue:s=[],onChange:r,className:o}){const i=u.useId(),c=n!==void 0,[l,d]=u.useState(s),p=c?n:l,f=u.useCallback(m=>{const _=p.includes(m),h=t?_?p.filter(b=>b!==m):[...p,m]:_?[]:[m];c||d(h),r?.(h)},[p,t,c,r]);return a.jsx("div",{className:g(ne.accordion,o),children:e.map(m=>{const _=p.includes(m.id),h=`${i}-${m.id}-panel`,b=`${i}-${m.id}-trigger`;return a.jsxs("div",{className:g(ne.item,_&&ne.open),children:[a.jsx("h3",{className:ne.header,children:a.jsxs("button",{type:"button",id:b,className:ne.trigger,"aria-expanded":_,"aria-controls":h,disabled:m.disabled,onClick:()=>f(m.id),children:[a.jsx("span",{children:m.title}),a.jsx(qt,{className:ne.chevron})]})}),_&&a.jsx("div",{id:h,role:"region","aria-labelledby":b,className:ne.panel,children:m.children})]},m.id)})})}function qt({className:e}){return a.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ut="tempest_alert_7cYyI",Gt="tempest_content_UXnmZ",Kt="tempest_title_abGgF",Jt="tempest_description_pXPvw",Ht="tempest_icon_Zg6SB",Vt="tempest_close_narep",Qt="tempest_neutral_J7MH1",Zt="tempest_solid_s-oW5",Xt="tempest_outline_v7w9b",Yt="tempest_info_9r3r1",en="tempest_success_1bzoB",tn="tempest_warning_q-j1Q",nn="tempest_danger_CiZkW",H={alert:Ut,content:Gt,title:Kt,description:Jt,icon:Ht,close:Vt,neutral:Qt,solid:Zt,outline:Xt,info:Yt,success:en,warning:tn,danger:nn};function sn({variant:e="info",appearance:t="soft",title:n,description:s,icon:r,onClose:o,closeLabel:i="Dismiss",className:c,children:l,...d}){return a.jsxs("div",{role:"alert",className:g(H.alert,H[e],t==="solid"&&H.solid,t==="outline"&&H.outline,c),...d,children:[r&&a.jsx("span",{className:H.icon,children:r}),a.jsxs("div",{className:H.content,children:[n&&a.jsx("p",{className:H.title,children:n}),s&&a.jsx("p",{className:H.description,children:s}),l]}),o&&a.jsx("button",{type:"button",className:H.close,onClick:o,"aria-label":i,children:a.jsx(rn,{})})]})}function rn(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const ke={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},on=["xs","sm","md","lg","xl","2xl"];function an(e){let t="xs";for(const n of on)e>=ke[n]&&(t=n);return t}function ue(){const[e,t]=u.useState(()=>typeof window>"u"?0:window.innerWidth);u.useEffect(()=>{if(typeof window>"u")return;const o=()=>t(window.innerWidth);return o(),window.addEventListener("resize",o,{passive:!0}),()=>window.removeEventListener("resize",o)},[]);const n=an(e),s=o=>e>=ke[o],r=o=>e<ke[o];return{current:n,width:e,above:s,below:r,isMobile:r("md"),isTablet:s("md")&&r("lg"),isDesktop:s("lg")}}const cn="tempest_shell_-xp0O",ln="tempest_navbar_liTKV",un="tempest_row_PE41P",dn="tempest_sidebar_wyx-V",pn="tempest_main_O3GFv",mn="tempest_footer_IFW4q",fn="tempest_bottomNav_pKJ1v",se={shell:cn,navbar:ln,row:un,sidebar:dn,main:pn,footer:mn,bottomNav:fn};function hn({navbar:e,sidebar:t,bottomNav:n,footer:s,sidebarBreakpoint:r="md",className:o,children:i,...c}){const d=ue().above(r);return a.jsxs("div",{className:g(se.shell,o),...c,children:[e&&a.jsx("div",{className:se.navbar,children:e}),a.jsxs("div",{className:se.row,children:[t&&d&&a.jsx("div",{className:se.sidebar,children:t}),a.jsx("main",{className:se.main,children:i})]}),s&&a.jsx("div",{className:se.footer,children:s}),n&&!d&&a.jsx("div",{className:se.bottomNav,children:n})]})}const _n="tempest_aspect_GnAJt",bn={aspect:_n};function gn({ratio:e=16/9,className:t,style:n,children:s,...r}){const o={aspectRatio:String(e),...n};return a.jsx("div",{className:g(bn.aspect,t),style:o,...r,children:s})}const yn="tempest_avatar_3xMuZ",vn="tempest_image_ieqGp",wn="tempest_xs_oSaLL",xn="tempest_sm_sZ2bk",jn="tempest_md_Fdkbz",$n="tempest_lg_pTTUA",kn="tempest_xl_mW58F",Nn="tempest_status_ISBnL",Sn="tempest_dot_Wgfo-",En="tempest_online_-aWoW",Cn="tempest_offline_-StX3",Tn="tempest_busy_TbwuF",pe={avatar:yn,image:vn,xs:wn,sm:xn,md:jn,lg:$n,xl:kn,status:Nn,dot:Sn,online:En,offline:Cn,busy:Tn};function Ln(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2):`${t[0].charAt(0)}${t[t.length-1].charAt(0)}`}function In({src:e,alt:t,name:n="",size:s="md",status:r,className:o,onClick:i}){const[c,l]=u.useState(!1),d=u.useMemo(()=>Ln(n),[n]),p=e&&!c,f=i?"button":void 0,m=i?0:void 0;return a.jsxs("span",{className:g(pe.avatar,pe[s],r&&pe.status,o),role:f,tabIndex:m,onClick:i,onKeyDown:i?_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),i())}:void 0,children:[p?a.jsx("img",{src:e,alt:t??n,className:pe.image,onError:()=>l(!0)}):a.jsx("span",{"aria-label":t??n,children:d}),r&&a.jsx("span",{className:g(pe.dot,pe[r]),"aria-hidden":!0})]})}const Rn="tempest_badge_RsuMz",Pn="tempest_sm_LYsCn",Dn="tempest_md_4Or8q",Mn="tempest_lg_Bseje",An="tempest_square_l63D-",Fn="tempest_neutral_lulSm",Bn="tempest_solid_0Leug",On="tempest_outline_x06HL",Wn="tempest_success_u9JiS",zn="tempest_warning_nsGp-",qn="tempest_danger_PD2hz",Un="tempest_info_na6DQ",Gn="tempest_primary_S0WCS",Kn="tempest_dot_i0c-G",re={badge:Rn,sm:Pn,md:Dn,lg:Mn,square:An,neutral:Fn,solid:Bn,outline:On,success:Wn,warning:zn,danger:qn,info:Un,primary:Gn,dot:Kn};function Jn({variant:e="neutral",appearance:t="soft",size:n="md",shape:s="pill",dot:r=!1,className:o,children:i,...c}){return a.jsxs("span",{className:g(re.badge,re[e],t==="solid"&&re.solid,t==="outline"&&re.outline,re[n],s==="square"&&re.square,o),...c,children:[r&&a.jsx("span",{className:re.dot,"aria-hidden":!0}),i]})}const Hn="tempest_banner_oyoWE",Vn="tempest_info_s2q0P",Qn="tempest_success_uLYQ3",Zn="tempest_warning_9rua8",Xn="tempest_danger_Uzb-6",Yn="tempest_icon_vzKmx",es="tempest_body_-Qm4K",ts="tempest_title_AeTHT",ns="tempest_description_nbyf-",ss="tempest_action_47P8e",rs="tempest_close_Iy2oN",te={banner:Hn,info:Vn,success:Qn,warning:Zn,danger:Xn,icon:Yn,body:es,title:ts,description:ns,action:ss,close:rs};function os({variant:e="info",icon:t,title:n,action:s,dismissible:r=!1,onDismiss:o,className:i,children:c,...l}){const[d,p]=u.useState(!0);return d?a.jsxs("div",{className:g(te.banner,te[e],i),role:"status",...l,children:[t&&a.jsx("span",{className:te.icon,children:t}),a.jsxs("div",{className:te.body,children:[n&&a.jsx("p",{className:te.title,children:n}),c&&a.jsx("p",{className:te.description,children:c})]}),s&&a.jsx("div",{className:te.action,children:s}),r&&a.jsx("button",{type:"button",className:te.close,"aria-label":"Fechar",onClick:()=>{p(!1),o?.()},children:"×"})]}):null}const as="tempest_bar_kp35Q",is="tempest_item_XfDIW",cs="tempest_active_sK54f",ls="tempest_iconWrap_yJ20b",us="tempest_icon_TAjtI",ds="tempest_badge_-c3Do",ps="tempest_label_qJj3L",oe={bar:as,item:is,active:cs,iconWrap:ls,icon:us,badge:ds,label:ps};function ms({items:e,value:t,onChange:n,showLabels:s=!0,className:r,...o}){return a.jsx("nav",{className:g(oe.bar,r),"aria-label":"Navegação principal",...o,children:e.map(i=>{const c=i.key===t;return a.jsxs("button",{type:"button",className:g(oe.item,c&&oe.active),"aria-current":c?"page":void 0,disabled:i.disabled,onClick:()=>n(i.key),children:[a.jsxs("span",{className:oe.iconWrap,children:[i.icon&&a.jsx("span",{className:oe.icon,children:i.icon}),i.badge!==void 0&&a.jsx("span",{className:oe.badge,children:i.badge})]}),s&&a.jsx("span",{className:oe.label,children:i.label})]},i.key)})})}const fs="tempest_root_qXce2",hs="tempest_backdrop_WLqh0",_s="tempest_sheet_Okz1P",bs="tempest_handle_GWCoK",gs="tempest_handleBar_XPPiI",ys="tempest_title_i5Vuc",vs="tempest_body_bgDhJ",ae={root:fs,backdrop:hs,sheet:_s,handle:bs,handleBar:gs,title:ys,body:vs};function ws({open:e,onClose:t,title:n,showHandle:s=!0,dismissOnBackdrop:r=!0,dismissOnEsc:o=!0,className:i,children:c,...l}){return u.useEffect(()=>{if(!e||!o)return;const d=p=>{p.key==="Escape"&&t()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,o,t]),u.useEffect(()=>{if(!e)return;const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[e]),!e||typeof document>"u"?null:Ee.createPortal(a.jsxs("div",{className:ae.root,role:"dialog","aria-modal":"true",children:[a.jsx("div",{className:ae.backdrop,onClick:()=>r&&t(),"aria-hidden":"true"}),a.jsxs("div",{className:g(ae.sheet,i),...l,children:[s&&a.jsx("button",{type:"button",className:ae.handle,"aria-label":"Arrastar para fechar",onClick:t,children:a.jsx("span",{className:ae.handleBar})}),n&&a.jsx("div",{className:ae.title,children:n}),a.jsx("div",{className:ae.body,children:c})]})]}),document.body)}const xs="tempest_nav_H4g6P",js="tempest_item_O4g3P",$s="tempest_link_7WM67",ks="tempest_current_JdlcS",Ns="tempest_separator_zGWyJ",be={nav:xs,item:js,link:$s,current:ks,separator:Ns};function Ss({items:e,separator:t="/",className:n}){return a.jsx("nav",{"aria-label":"breadcrumb",className:g(be.nav,n),children:e.map((s,r)=>{const o=r===e.length-1,i=!o&&(s.href||s.onClick);return a.jsxs(u.Fragment,{children:[a.jsx("span",{className:be.item,children:i?a.jsx("a",{href:s.href,onClick:c=>{s.onClick&&(c.preventDefault(),s.onClick())},className:be.link,children:s.label}):a.jsx("span",{"aria-current":o?"page":void 0,className:o?be.current:void 0,children:s.label})}),!o&&a.jsx("span",{className:be.separator,"aria-hidden":!0,children:t})]},r)})})}const Es="tempest_button_2ZuB7",Cs="tempest_primary_s1sM6",Ts="tempest_secondary_R0waJ",Ls="tempest_danger_V4fX8",Is="tempest_success_w6qB6",Rs="tempest_ghost_1KINV",Ps="tempest_soft_c3kzm",Ds="tempest_outline_F5jq-",Ms="tempest_link_Zt5hw",As="tempest_xs_cF6m0",Fs="tempest_sm_NhG0g",Bs="tempest_md_hH4h3",Os="tempest_lg_2plQf",Ws="tempest_xl_nx4V0",zs="tempest_iconOnly_WCpTS",qs="tempest_pill_lx8lt",Us="tempest_fullWidth_36oJT",Gs="tempest_loading_EQAt2",Ks="tempest_hiddenText_hIiJ2",Js="tempest_spinner_ZExvW",Hs="tempest_tempest-spin_UOSVC",V={button:Es,primary:Cs,secondary:Ts,danger:Ls,success:Is,ghost:Rs,soft:Ps,outline:Ds,link:Ms,xs:As,sm:Fs,md:Bs,lg:Os,xl:Ws,iconOnly:zs,pill:qs,fullWidth:Us,loading:Gs,hiddenText:Ks,spinner:Js,tempestSpin:Hs};function Ne({variant:e="primary",size:t="md",loading:n=!1,fullWidth:s=!1,iconOnly:r=!1,pill:o=!1,leftIcon:i,rightIcon:c,disabled:l,className:d,children:p,...f}){return a.jsxs("button",{className:g(V.button,V[e],V[t],r&&V.iconOnly,o&&V.pill,n&&V.loading,s&&V.fullWidth,d),disabled:l||n,...f,children:[n&&a.jsx("span",{className:V.spinner,"aria-hidden":!0,children:a.jsx(Vs,{})}),a.jsxs("span",{className:g(n&&V.hiddenText),children:[i,p,c]})]})}function Vs(){return a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Qs="tempest_card_Cb1o4",Zs="tempest_flat_LRpce",Xs="tempest_raised_WmIqk",Ys="tempest_elevated_5VEDw",er="tempest_interactive_B8Tah",tr="tempest_padded_oOxwN",nr="tempest_flush_aiDZi",sr="tempest_header_PTXf2",rr="tempest_title_mSgoo",or="tempest_body_W441Z",ar="tempest_footer_Mu-JC",F={card:Qs,flat:Zs,raised:Xs,elevated:Ys,interactive:er,padded:tr,flush:nr,header:sr,title:rr,body:or,footer:ar};function ir({title:e,actions:t,footer:n,flush:s=!1,interactive:r=!1,elevation:o="default",className:i,children:c,...l}){const d=!!(e||t);return a.jsxs("div",{className:g(F.card,o==="flat"&&F.flat,o==="raised"&&F.raised,o==="elevated"&&F.elevated,r&&F.interactive,!d&&!s&&F.padded,s&&F.flush,i),tabIndex:r?l.tabIndex??0:l.tabIndex,...l,children:[d&&a.jsxs("header",{className:F.header,children:[typeof e=="string"?a.jsx("h3",{className:F.title,children:e}):e,t]}),d?a.jsx("div",{className:F.body,children:c}):c,n&&a.jsx("footer",{className:F.footer,children:n})]})}const cr="tempest_center_Pu1Pf",lr="tempest_both_53GWn",ur="tempest_horizontal_94-Bt",dr="tempest_vertical_Q7Kyg",Ke={center:cr,both:lr,horizontal:ur,vertical:dr};function pr({axis:e="both",minHeight:t,fullWidth:n=!0,className:s,style:r,children:o,...i}){const c={...t!==void 0?{minHeight:typeof t=="number"?`${t}px`:t}:null,...n?{width:"100%"}:null,...r};return a.jsx("div",{className:g(Ke.center,Ke[e],s),style:c,...i,children:o})}const mr="tempest_wrapper_rpthW",fr="tempest_disabled_x7-eg",hr="tempest_input_2kt-h",_r="tempest_box_OCPee",br="tempest_labelWrap_Ktbp0",gr="tempest_label_cwRtI",yr="tempest_description_rMhG1",ie={wrapper:mr,disabled:fr,input:hr,box:_r,labelWrap:br,label:gr,description:yr},vr=u.forwardRef(function({label:t,description:n,indeterminate:s,disabled:r,wrapperClassName:o,className:i,...c},l){const d=u.useRef(null);u.useEffect(()=>{d.current&&(d.current.indeterminate=!!s)},[s]);function p(f){d.current=f,typeof l=="function"?l(f):l&&(l.current=f)}return a.jsxs("label",{className:g(ie.wrapper,r&&ie.disabled,o),children:[a.jsx("input",{ref:p,type:"checkbox",disabled:r,className:g(ie.input,i),...c}),a.jsx("span",{className:ie.box,"aria-hidden":!0,children:s?a.jsx(xr,{}):a.jsx(wr,{})}),(t||n)&&a.jsxs("span",{className:ie.labelWrap,children:[t&&a.jsx("span",{className:ie.label,children:t}),n&&a.jsx("span",{className:ie.description,children:n})]})]})});function wr(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M5 12l5 5L20 7",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}function xr(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M5 12h14",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})}const jr="tempest_wrapper_KR4-F",$r="tempest_label_Mz-wX",kr="tempest_field_iIBJw",Nr="tempest_error_O9n-9",Sr="tempest_chip_GEwrc",Er="tempest_remove_JYDIq",Cr="tempest_input_frJmk",Tr="tempest_helper_Yts53",Lr="tempest_errorText_llJGq",Q={wrapper:jr,label:$r,field:kr,error:Nr,chip:Sr,remove:Er,input:Cr,helper:Tr,errorText:Lr};function Ir({value:e,onChange:t,label:n,placeholder:s="Adicionar e pressionar Enter…",helperText:r,error:o,commitKeys:i=["Enter",",","Tab"],normalize:c=!0,className:l}){const[d,p]=u.useState(""),f=u.useRef(null);function m(){const b=c?d.trim().toLowerCase():d.trim();if(b){if(e.includes(b)){p("");return}t([...e,b]),p("")}}function _(b){if(i.includes(b.key)){b.preventDefault(),m();return}b.key==="Backspace"&&!d&&e.length>0&&t(e.slice(0,-1))}function h(b){const y=e.slice();y.splice(b,1),t(y)}return a.jsxs("div",{className:g(Q.wrapper,o&&Q.error,l),children:[n&&a.jsx("label",{className:Q.label,children:n}),a.jsxs("div",{className:Q.field,onClick:()=>f.current?.focus(),children:[e.map((b,y)=>a.jsxs("span",{className:Q.chip,children:[b,a.jsx("button",{type:"button",className:Q.remove,"aria-label":`Remover ${b}`,onClick:()=>h(y),children:"×"})]},`${b}-${y}`)),a.jsx("input",{ref:f,className:Q.input,value:d,placeholder:e.length===0?s:"",onChange:b=>p(b.target.value),onKeyDown:_,onBlur:m})]}),o?a.jsx("span",{className:Q.errorText,children:o}):r?a.jsx("span",{className:Q.helper,children:r}):null]})}const Rr="tempest_wrapper_TNvle",Pr="tempest_label_KVkZO",Dr="tempest_field_BenH0",Mr="tempest_input_-HTv1",Ar="tempest_caret_jRplQ",Fr="tempest_menu_zPQG3",Br="tempest_option_vhhn5",Or="tempest_active_XCgtX",Wr="tempest_selected_T6nm2",zr="tempest_empty_Ahw5K",qr="tempest_helper_OzB7V",Ur="tempest_errorText_X18sQ",Gr="tempest_error_bnVuM",L={wrapper:Rr,label:Pr,field:Dr,input:Mr,caret:Ar,menu:Fr,option:Br,active:Or,selected:Wr,empty:zr,helper:qr,errorText:Ur,error:Gr};function Kr(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function Jr({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:o,error:i,disabled:c,filter:l=Kr,emptyMessage:d="Nenhuma opção encontrada",className:p}){const f=u.useId(),m=u.useRef(null),_=u.useRef(null),[h,b]=u.useState(!1),[y,v]=u.useState(""),[w,x]=u.useState(0),$=u.useMemo(()=>e.find(j=>j.value===t)?.label??"",[e,t]),N=u.useMemo(()=>e.filter(j=>l(j,y)),[e,l,y]),J=u.useCallback(()=>{b(!1),v(""),x(0)},[]),de=u.useCallback(j=>{j.disabled||(n(j.value),J())},[n,J]);u.useEffect(()=>{if(!h)return;const j=E=>{m.current&&!m.current.contains(E.target)&&J()};return window.addEventListener("mousedown",j),()=>window.removeEventListener("mousedown",j)},[h,J]);const k=j=>{if(j.key==="ArrowDown")j.preventDefault(),b(!0),x(E=>Math.min(N.length-1,E+1));else if(j.key==="ArrowUp")j.preventDefault(),x(E=>Math.max(0,E-1));else if(j.key==="Enter"){j.preventDefault();const E=N[w];E&&de(E)}else j.key==="Escape"&&J()};return a.jsxs("div",{ref:m,className:g(L.wrapper,i&&L.error,p),children:[s&&a.jsx("label",{htmlFor:f,className:L.label,children:s}),a.jsxs("div",{className:L.field,children:[a.jsx("input",{id:f,ref:_,type:"text",role:"combobox","aria-expanded":h,"aria-controls":`${f}-listbox`,"aria-autocomplete":"list",className:L.input,placeholder:r,disabled:c,value:h?y:$,onFocus:()=>b(!0),onChange:j=>{v(j.target.value),b(!0),x(0)},onKeyDown:k}),a.jsx("span",{className:L.caret,"aria-hidden":!0,children:"▾"})]}),h&&a.jsx("ul",{id:`${f}-listbox`,role:"listbox",className:L.menu,children:N.length===0?a.jsx("li",{className:L.empty,children:d}):N.map((j,E)=>a.jsx("li",{role:"option","aria-selected":j.value===t,className:g(L.option,E===w&&L.active,j.value===t&&L.selected),onMouseEnter:()=>x(E),onMouseDown:Ie=>{Ie.preventDefault(),de(j)},children:j.label},j.value))}),i?a.jsx("span",{className:L.errorText,children:i}):o?a.jsx("span",{className:L.helper,children:o}):null]})}const Hr="tempest_overlay_dd9h1",Vr="tempest_tempest-fade-in_DvgSp",Qr="tempest_dialog_ptM-K",Zr="tempest_tempest-modal-in_UoxQC",Xr="tempest_sm_K5k3W",Yr="tempest_md_gvyR7",eo="tempest_lg_BgB1a",to="tempest_xl_MR-68",no="tempest_size2xl_-PH9e",so="tempest_size3xl_iqDwN",ro="tempest_fullscreen_o84Xi",oo="tempest_fullscreenOnMobile_0bDwe",ao="tempest_body_lVhql",io="tempest_header_ILG9i",co="tempest_footer_rro2w",lo="tempest_title_A5OeE",uo="tempest_close_-ER1C",D={overlay:Hr,tempestFadeIn:Vr,dialog:Qr,tempestModalIn:Zr,sm:Xr,md:Yr,lg:eo,xl:to,size2Xl:no,size3Xl:so,fullscreen:ro,fullscreenOnMobile:oo,body:ao,header:io,footer:co,title:lo,close:uo};function st({open:e,onClose:t,title:n,children:s,footer:r,size:o="md",closeOnBackdrop:i=!0,closeOnEsc:c=!0,className:l,hideCloseButton:d=!1,fullscreen:p=!1,fullscreenOnMobile:f=!1}){return u.useEffect(()=>{if(!e)return;const m=document.body.style.overflow;document.body.style.overflow="hidden";const _=h=>{c&&h.key==="Escape"&&t()};return window.addEventListener("keydown",_),()=>{document.body.style.overflow=m,window.removeEventListener("keydown",_)}},[e,c,t]),!e||typeof document>"u"?null:Ee.createPortal(a.jsx("div",{className:D.overlay,role:"presentation",onClick:()=>{i&&t()},children:a.jsxs("div",{role:"dialog","aria-modal":"true",className:g(D.dialog,po(o),p&&D.fullscreen,f&&D.fullscreenOnMobile,l),onClick:m=>m.stopPropagation(),children:[(n||!d)&&a.jsxs("header",{className:D.header,children:[a.jsx("h3",{className:D.title,children:n}),!d&&a.jsx("button",{type:"button",className:D.close,"aria-label":"Fechar",onClick:t,children:a.jsx(mo,{})})]}),a.jsx("div",{className:D.body,children:s}),r&&a.jsx("footer",{className:D.footer,children:r})]})}),document.body)}function po(e){return e==="2xl"?D.size2xl:e==="3xl"?D.size3xl:D[e]}function mo(){return a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function fo({open:e,title:t,description:n,confirmLabel:s="Confirmar",cancelLabel:r="Cancelar",variant:o="primary",loading:i=!1,onConfirm:c,onCancel:l}){return a.jsx(st,{open:e,onClose:l,title:t,size:"sm",footer:a.jsxs(a.Fragment,{children:[a.jsx(Ne,{variant:"secondary",onClick:l,disabled:i,children:r}),a.jsx(Ne,{variant:o,loading:i,onClick:()=>{c()},children:s})]}),children:n})}const ho="tempest_wrapper_iHNUs",_o="tempest_label_-OEBL",bo="tempest_required_CTss-",go="tempest_field_65yGJ",yo="tempest_input_WjT81",vo="tempest_sizeSm_cgds6",wo="tempest_sizeMd_EPFGy",xo="tempest_sizeLg_5Cq8k",jo="tempest_hasLeftIcon_xYO-v",$o="tempest_hasRightIcon_C7uyr",ko="tempest_iconLeft_KrUhI",No="tempest_iconRight_Ssr47",So="tempest_error_VLISa",Eo="tempest_helper_7Vc-s",Co="tempest_errorText_xz4xS",T={wrapper:ho,label:_o,required:bo,field:go,input:yo,sizeSm:vo,sizeMd:wo,sizeLg:xo,hasLeftIcon:jo,hasRightIcon:$o,iconLeft:ko,iconRight:No,error:So,helper:Eo,errorText:Co},Ce=u.forwardRef(function({label:t,helperText:n,error:s,leftIcon:r,rightIcon:o,wrapperClassName:i,className:c,id:l,required:d,size:p="md",...f},m){const _=u.useId(),h=l??_,b=s?`${h}-error`:n?`${h}-helper`:void 0,y=p==="sm"?T.sizeSm:p==="lg"?T.sizeLg:T.sizeMd;return a.jsxs("div",{className:g(T.wrapper,s&&T.error,i),children:[t&&a.jsxs("label",{htmlFor:h,className:T.label,children:[t,d&&a.jsx("span",{className:T.required,children:"*"})]}),a.jsxs("div",{className:T.field,children:[r&&a.jsx("span",{className:T.iconLeft,children:r}),a.jsx("input",{ref:m,id:h,"aria-invalid":!!s,"aria-describedby":b,required:d,className:g(T.input,y,r&&T.hasLeftIcon,o&&T.hasRightIcon,c),...f}),o&&a.jsx("span",{className:T.iconRight,children:o})]}),s?a.jsx("span",{id:`${h}-error`,className:T.errorText,children:s}):n?a.jsx("span",{id:`${h}-helper`,className:T.helper,children:n}):null]})}),To=u.forwardRef(function({value:t,onChange:n,mode:s="date",...r},o){return a.jsx(Ce,{...r,ref:o,type:s,value:t,onChange:i=>n(i.target.value)})}),Lo="tempest_divider_KSGsi",Io="tempest_horizontal_pZ05Y",Ro="tempest_bare_elDbS",Po="tempest_vertical_p-jD4",Do="tempest_dashed_JWxCU",Mo="tempest_alignStart_QAIi1",Ao="tempest_alignEnd_eZDwa",P={divider:Lo,horizontal:Io,bare:Ro,vertical:Po,dashed:Do,alignStart:Mo,alignEnd:Ao};function Fo({orientation:e="horizontal",variant:t="solid",label:n,align:s="center",className:r,...o}){return e==="vertical"?a.jsx("span",{role:"separator","aria-orientation":"vertical",className:g(P.divider,P.vertical,t==="dashed"&&P.dashed,r),...o}):n?a.jsx("div",{role:"separator","aria-orientation":"horizontal",className:g(P.divider,P.horizontal,t==="dashed"&&P.dashed,s==="start"&&P.alignStart,s==="end"&&P.alignEnd,r),...o,children:n}):a.jsx("hr",{className:g(P.divider,P.horizontal,P.bare,t==="dashed"&&P.dashed,r)})}const Bo="tempest_overlay_hcG1G",Oo="tempest_tempest-drawer-overlay_XFbxY",Wo="tempest_panel_wUX0N",zo="tempest_right_-oX-6",qo="tempest_tempest-drawer-in-right_pWYHv",Uo="tempest_left_xi3nD",Go="tempest_tempest-drawer-in-left_o7JSb",Ko="tempest_top_7rGCn",Jo="tempest_tempest-drawer-in-top_kn6AF",Ho="tempest_bottom_zd-25",Vo="tempest_tempest-drawer-in-bottom_0x3u7",Qo="tempest_handle_5B-TB",Zo="tempest_handleTop_7aMf-",Xo="tempest_header_sYoP1",Yo="tempest_title_LqUOu",ea="tempest_close_tYPhU",ta="tempest_body_aV9FG",na="tempest_footer_AuvUP",U={overlay:Bo,tempestDrawerOverlay:Oo,panel:Wo,right:zo,tempestDrawerInRight:qo,left:Uo,tempestDrawerInLeft:Go,top:Ko,tempestDrawerInTop:Jo,bottom:Ho,tempestDrawerInBottom:Vo,handle:Qo,handleTop:Zo,header:Xo,title:Yo,close:ea,body:ta,footer:na};function sa({open:e,onClose:t,placement:n="right",title:s,children:r,footer:o,closeOnBackdrop:i=!0,closeOnEsc:c=!0,hideCloseButton:l=!1,className:d,mobilePlacement:p,showHandle:f=!1}){const{isMobile:m}=ue(),_=m&&p?p:n;return u.useEffect(()=>{if(!e)return;const h=document.body.style.overflow;document.body.style.overflow="hidden";const b=y=>{c&&y.key==="Escape"&&t()};return window.addEventListener("keydown",b),()=>{document.body.style.overflow=h,window.removeEventListener("keydown",b)}},[e,c,t]),!e||typeof document>"u"?null:Ee.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{className:U.overlay,onClick:()=>{i&&t()}}),a.jsxs("aside",{role:"dialog","aria-modal":"true",className:g(U.panel,U[_],d),children:[f&&(_==="bottom"||_==="top")&&a.jsx("div",{className:g(U.handle,_==="top"&&U.handleTop),"aria-hidden":!0}),(s||!l)&&a.jsxs("header",{className:U.header,children:[a.jsx("h3",{className:U.title,children:s}),!l&&a.jsx("button",{type:"button","aria-label":"Fechar",className:U.close,onClick:t,children:a.jsx(ra,{})})]}),a.jsx("div",{className:U.body,children:r}),o&&a.jsx("footer",{className:U.footer,children:o})]})]}),document.body)}function ra(){return a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const oa="tempest_root_5ZetV",aa="tempest_menu_-RiRW",ia="tempest_bottomStart_z60h9",ca="tempest_bottomEnd_b1tmU",la="tempest_topStart_A0em2",ua="tempest_topEnd_cFA5-",da="tempest_item_T-QPZ",pa="tempest_active_WNqoX",ma="tempest_danger_C0jN3",fa="tempest_separator_RimQa",ha="tempest_label_6yP76",z={root:oa,menu:aa,bottomStart:ia,bottomEnd:ca,topStart:la,topEnd:ua,item:da,active:pa,danger:ma,separator:fa,label:ha};function _a(e){switch(e){case"bottom-end":return z.bottomEnd;case"top-start":return z.topStart;case"top-end":return z.topEnd;default:return z.bottomStart}}function ba({trigger:e,items:t,placement:n="bottom-start",className:s}){const[r,o]=u.useState(!1),[i,c]=u.useState(-1),l=u.useId(),d=u.useRef(null),p=u.useRef([]),f=t.map((y,v)=>y.type==="item"&&!y.disabled?v:-1).filter(y=>y!==-1),m=u.useCallback(()=>{o(!1),c(-1)},[]);u.useEffect(()=>{if(!r)return;const y=w=>{if(w.key==="Escape"){m();return}if(w.key==="ArrowDown"){w.preventDefault();const x=f.indexOf(i),$=f[(x+1)%f.length]??-1;c($),p.current[$]?.focus()}if(w.key==="ArrowUp"){w.preventDefault();const x=f.indexOf(i),$=f[(x-1+f.length)%f.length]??-1;c($),p.current[$]?.focus()}},v=w=>{d.current&&!d.current.contains(w.target)&&m()};return window.addEventListener("keydown",y),window.addEventListener("mousedown",v),()=>{window.removeEventListener("keydown",y),window.removeEventListener("mousedown",v)}},[r,i,f,m]);const _=y=>{e.props.onClick?.(y),o(v=>!v)},h={...e,props:{...e.props,onClick:_,"aria-expanded":r,"aria-controls":l,"aria-haspopup":"menu"}},b=y=>{y.onSelect(),m()};return a.jsxs("span",{ref:d,className:z.root,children:[h,r&&a.jsx("ul",{id:l,role:"menu",className:g(z.menu,_a(n),s),children:t.map((y,v)=>y.type==="separator"?a.jsx("li",{role:"separator",className:z.separator,"aria-hidden":!0},y.id):y.type==="label"?a.jsx("li",{role:"presentation",className:z.label,children:y.label},y.id):a.jsx("li",{role:"none",children:a.jsxs("button",{ref:w=>{p.current[v]=w},type:"button",role:"menuitem",className:g(z.item,y.danger&&z.danger,i===v&&z.active),disabled:y.disabled,onClick:()=>b(y),onMouseEnter:()=>c(v),children:[y.icon&&a.jsx("span",{"aria-hidden":!0,children:y.icon}),y.label]})},y.id))})]})}const ga="tempest_wrapper_gzyTd",ya="tempest_icon_qVCyh",va="tempest_title_xPfUf",wa="tempest_description_oWwH1",xa="tempest_action_dqxw1",ge={wrapper:ga,icon:ya,title:va,description:wa,action:xa};function ja({icon:e,title:t,description:n,action:s,className:r}){return a.jsxs("div",{className:g(ge.wrapper,r),children:[e&&a.jsx("div",{className:ge.icon,children:e}),a.jsx("h4",{className:ge.title,children:t}),n&&a.jsx("p",{className:ge.description,children:n}),s&&a.jsx("div",{className:ge.action,children:s})]})}const $a="tempest_wrapper_luRyF",ka="tempest_icon_dEdBl",Na="tempest_title_StutD",Sa="tempest_description_A2XCb",Ea="tempest_action_vm1LC",ye={wrapper:$a,icon:ka,title:Na,description:Sa,action:Ea};function Ca({title:e="Algo deu errado",description:t="Não foi possível carregar essas informações.",onRetry:n,retryLabel:s="Tentar novamente",icon:r,className:o}){return a.jsxs("div",{className:g(ye.wrapper,o),children:[a.jsx("div",{className:ye.icon,children:r??a.jsx(Ta,{})}),a.jsx("h4",{className:ye.title,children:e}),t&&a.jsx("p",{className:ye.description,children:t}),n&&a.jsx("div",{className:ye.action,children:a.jsx(Ne,{variant:"secondary",onClick:n,children:s})})]})}function Ta(){return a.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const La="tempest_wrapper_E0qHs",Ia="tempest_label_lbMkx",Ra="tempest_dropzone_jqua0",Pa="tempest_active_CG9Uk",Da="tempest_disabled_WNUUl",Ma="tempest_icon_i9fGH",Aa="tempest_title_bTVFl",Fa="tempest_subtitle_S54OV",Ba="tempest_files_WljYm",Oa="tempest_file_Lp-dR",Wa="tempest_fileMeta_LTnN2",za="tempest_remove_jskra",qa="tempest_hidden_ReEq6",I={wrapper:La,label:Ia,dropzone:Ra,active:Pa,disabled:Da,icon:Ma,title:Aa,subtitle:Fa,files:Ba,file:Oa,fileMeta:Wa,remove:za,hidden:qa};function Ua(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Ga(e,t){if(!t)return!0;const n=t.split(",").map(o=>o.trim().toLowerCase()),s=e.name.toLowerCase(),r=e.type.toLowerCase();return n.some(o=>o.startsWith(".")?s.endsWith(o):o.endsWith("/*")?r.startsWith(o.replace("/*","/")):r===o)}function Ka({value:e,onChange:t,label:n,accept:s,multiple:r=!1,maxSize:o,onReject:i,disabled:c,title:l="Arraste arquivos aqui ou clique para selecionar",subtitle:d,className:p}){const[f,m]=u.useState(!1),_=u.useRef(null);function h(v){const w=[],x=[];for(const N of Array.from(v)){if(!Ga(N,s)){x.push({file:N,reason:"type"});continue}if(o&&N.size>o){x.push({file:N,reason:"size"});continue}w.push(N)}if(x.length>0&&i?.(x),w.length===0)return;const $=r?[...e,...w]:w.slice(0,1);t($)}function b(v){v.preventDefault(),m(!1),!c&&v.dataTransfer?.files&&h(v.dataTransfer.files)}function y(v){const w=e.slice();w.splice(v,1),t(w)}return a.jsxs("div",{className:g(I.wrapper,p),children:[n&&a.jsx("label",{className:I.label,children:n}),a.jsxs("div",{className:g(I.dropzone,f&&I.active,c&&I.disabled),role:"button",tabIndex:c?-1:0,onClick:()=>!c&&_.current?.click(),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),_.current?.click())},onDragEnter:v=>{v.preventDefault(),c||m(!0)},onDragOver:v=>v.preventDefault(),onDragLeave:()=>m(!1),onDrop:b,children:[a.jsx("div",{className:I.icon,"aria-hidden":!0,children:a.jsx(Ja,{})}),a.jsx("p",{className:I.title,children:l}),d&&a.jsx("p",{className:I.subtitle,children:d}),a.jsx("input",{ref:_,type:"file",accept:s,multiple:r,disabled:c,className:I.hidden,onChange:v=>{v.target.files&&h(v.target.files),v.target.value=""}})]}),e.length>0&&a.jsx("ul",{className:I.files,children:e.map((v,w)=>a.jsxs("li",{className:I.file,children:[a.jsxs("div",{children:[a.jsx("div",{children:v.name}),a.jsx("div",{className:I.fileMeta,children:Ua(v.size)})]}),a.jsx("button",{type:"button","aria-label":`Remover ${v.name}`,className:I.remove,onClick:()=>y(w),children:"×"})]},`${v.name}-${w}`))})]})}function Ja(){return a.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4M4 20h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ha="tempest_form_jNBDR",Va="tempest_stack_O1Hl-",Qa="tempest_inline_LBQAv",Za="tempest_grid_-B86T",Xa="tempest_section_HGqw3",Ya="tempest_sectionHeader_ji9hQ",ei="tempest_sectionTitle_GTPwe",ti="tempest_sectionDescription_KjW7k",ni="tempest_sectionBody_Vp2wz",si="tempest_row_1EkVR",ri="tempest_actions_hK95I",oi="tempest_start_gXnm3",ai="tempest_center_mKkz4",ii="tempest_end_O3yDQ",ci="tempest_between_tte2z",q={form:Ha,stack:Va,inline:Qa,grid:Za,section:Xa,sectionHeader:Ya,sectionTitle:ei,sectionDescription:ti,sectionBody:ni,row:si,actions:ri,start:oi,center:ai,end:ii,between:ci};function Te(e,t){return e===void 0?`${t*4}px`:typeof e=="number"?`${e*4}px`:e}function rt(e){return e===void 0?"repeat(2, minmax(0, 1fr))":typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}const li=u.forwardRef(function({layout:t="stack",columns:n,gap:s,className:r,style:o,children:i,...c},l){const d={gap:Te(s,4),...t==="grid"?{gridTemplateColumns:rt(n)}:null,...o};return a.jsx("form",{ref:l,className:g(q.form,q[t],r),style:d,...c,children:i})});function ui({title:e,description:t,layout:n="stack",columns:s,gap:r,className:o,style:i,children:c,...l}){const d={gap:Te(r,4),...n==="grid"?{gridTemplateColumns:rt(s)}:null};return a.jsxs("section",{className:g(q.section,o),style:i,...l,children:[(e||t)&&a.jsxs("header",{className:q.sectionHeader,children:[e&&a.jsx("h3",{className:q.sectionTitle,children:e}),t&&a.jsx("p",{className:q.sectionDescription,children:t})]}),a.jsx("div",{className:g(q.sectionBody,q[n]),style:d,children:c})]})}function di({gap:e,className:t,style:n,children:s,...r}){const o={gap:Te(e,3),...n};return a.jsx("div",{className:g(q.row,t),style:o,...r,children:s})}function pi({align:e="end",gap:t,className:n,style:s,children:r,...o}){const i={gap:Te(t,2),...s};return a.jsx("div",{className:g(q.actions,q[e],n),style:i,...o,children:r})}const mi="tempest_container_fJfOt",fi="tempest_sm_k8D4-",hi="tempest_md_EnpYy",_i="tempest_lg_UU-Ig",bi="tempest_xl_2TEWj",gi="tempest_full_l8bvG",yi="tempest_stack_sxR8u",vi="tempest_vertical_2TMf5",wi="tempest_horizontal_r7-c-",xi="tempest_center_EDSAh",ji="tempest_start_ucQ-K",$i="tempest_end_pnKlF",ki="tempest_stretch_pX6l7",Ni="tempest_justifyStart_lHYsS",Si="tempest_justifyCenter_JH2m6",Ei="tempest_justifyEnd_EBisT",Ci="tempest_justifyBetween_mAJwT",Ti="tempest_wrap_-xxOh",Li="tempest_grid_o-JIX",M={container:mi,sm:fi,md:hi,lg:_i,xl:bi,full:gi,stack:yi,vertical:vi,horizontal:wi,center:xi,start:ji,end:$i,stretch:ki,justifyStart:Ni,justifyCenter:Si,justifyEnd:Ei,justifyBetween:Ci,wrap:Ti,grid:Li};function Ii({size:e="lg",className:t,children:n,...s}){return a.jsx("div",{className:g(M.container,M[e],t),...s,children:n})}function Ri(e){return typeof e=="object"&&e!==null&&("mobile"in e||"tablet"in e||"desktop"in e)}function Se(e,t){if(e!==void 0)return Ri(e)?t==="desktop"?e.desktop??e.tablet??e.mobile:t==="tablet"?e.tablet??e.mobile??e.desktop:e.mobile??e.tablet??e.desktop:e}function ot(e){if(e!==void 0)return typeof e=="number"?`${e*4}px`:e}function at(e,t){return e?"mobile":t?"tablet":"desktop"}function Pi({direction:e="vertical",gap:t=2,align:n,justify:s,wrap:r=!1,className:o,style:i,children:c,...l}){const{isMobile:d,isTablet:p}=ue(),f=at(d,p),m=Se(e,f)??"vertical",h={gap:ot(Se(t,f)),...i},b=s==="between"?M.justifyBetween:s==="center"?M.justifyCenter:s==="end"?M.justifyEnd:s==="start"?M.justifyStart:void 0;return a.jsx("div",{className:g(M.stack,m==="vertical"?M.vertical:M.horizontal,n&&M[n],b,r&&M.wrap,o),style:h,...l,children:c})}function Di(e){if(e!==void 0)return typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}function Mi({columns:e=2,gap:t=4,className:n,style:s,children:r,...o}){const{isMobile:i,isTablet:c}=ue(),l=at(i,c),d=Di(Se(e,l)),p=ot(Se(t,l));return a.jsx("div",{className:g(M.grid,n),style:{gridTemplateColumns:d,gap:p,...s},...o,children:r})}const Ai="tempest_kbd_jgbYx",Fi="tempest_sm_9WPWA",Bi="tempest_md_BePC0",Oi="tempest_lg_cBKum",Je={kbd:Ai,sm:Fi,md:Bi,lg:Oi};function Wi({size:e="md",className:t,children:n,...s}){return a.jsx("kbd",{className:g(Je.kbd,Je[e],t),...s,children:n})}const zi="tempest_navbar_Ey25T",qi="tempest_surface_xyKhM",Ui="tempest_primary_w3ft-",Gi="tempest_transparent_N1vMR",Ki="tempest_bordered_HD49R",Ji="tempest_sticky_0XsOs",Hi="tempest_logo_O9j3q",Vi="tempest_nav_0oisE",Qi="tempest_actions_8BNWJ",ce={navbar:zi,surface:qi,primary:Ui,transparent:Gi,bordered:Ki,sticky:Ji,logo:Hi,nav:Vi,actions:Qi};function Zi({logo:e,nav:t,actions:n,sticky:s=!0,tone:r="surface",bordered:o=!0,className:i,...c}){return a.jsxs("header",{className:g(ce.navbar,ce[r],s&&ce.sticky,o&&ce.bordered,i),...c,children:[e&&a.jsx("div",{className:ce.logo,children:e}),t&&a.jsx("nav",{className:ce.nav,children:t}),n&&a.jsx("div",{className:ce.actions,children:n})]})}const Xi="tempest_page_THNNc",Yi="tempest_padded_bzjoF",ec="tempest_header_PZEzk",tc="tempest_headerText_qYXFI",nc="tempest_eyebrow_651RV",sc="tempest_title_2oGnT",rc="tempest_description_YzmWl",oc="tempest_actions_-rB3U",ac="tempest_toolbar_sA7sD",ic="tempest_content_RCB4b",cc="tempest_footer_540pQ",B={page:Xi,padded:Yi,header:ec,headerText:tc,eyebrow:nc,title:sc,description:rc,actions:oc,toolbar:ac,content:ic,footer:cc};function lc({title:e,eyebrow:t,description:n,actions:s,toolbar:r,footer:o,padded:i=!0,className:c,children:l,...d}){const p=e||t||n||s;return a.jsxs("main",{className:g(B.page,i&&B.padded,c),...d,children:[p&&a.jsxs("header",{className:B.header,children:[a.jsxs("div",{className:B.headerText,children:[t&&a.jsx("div",{className:B.eyebrow,children:t}),e&&a.jsx("h1",{className:B.title,children:e}),n&&a.jsx("p",{className:B.description,children:n})]}),s&&a.jsx("div",{className:B.actions,children:s})]}),r&&a.jsx("div",{className:B.toolbar,children:r}),a.jsx("div",{className:B.content,children:l}),o&&a.jsx("footer",{className:B.footer,children:o})]})}const uc="tempest_wrapper_cRGQm",dc="tempest_controls_fdL-y",pc="tempest_page_WjG0l",mc="tempest_active_1kqsJ",fc="tempest_ellipsis_V294k",hc="tempest_sizeSelect_ZayTo",_c="tempest_numeric_ztI0I",bc="tempest_summary_ZTggV",O={wrapper:uc,controls:dc,page:pc,active:mc,ellipsis:fc,sizeSelect:hc,numeric:_c,summary:bc};function gc(e,t,n){const s=n+4;if(t<=s)return Array.from({length:t},(c,l)=>l+1);const r=Math.max(2,e-Math.floor(n/2)),o=Math.min(t-1,r+n-1),i=[1];r>2&&i.push("...");for(let c=r;c<=o;c++)i.push(c);return o<t-1&&i.push("..."),i.push(t),i}function yc({page:e,totalPages:t,onPageChange:n,pageSize:s,onPageSizeChange:r,pageSizeOptions:o=[10,25,50,100],totalItems:i,siblingCount:c=3,className:l}){const d=u.useMemo(()=>gc(e,t,c),[e,t,c]);return t<=1&&!r?null:a.jsxs("div",{className:g(O.wrapper,l),children:[a.jsx("div",{className:O.summary,children:typeof i=="number"?`${i} resultado${i===1?"":"s"}`:`Página ${e} de ${t}`}),a.jsxs("div",{className:O.controls,children:[a.jsx("button",{type:"button",className:O.page,onClick:()=>n(Math.max(1,e-1)),disabled:e<=1,"aria-label":"Página anterior",children:"‹"}),d.map((p,f)=>p==="..."?a.jsx("span",{className:g(O.ellipsis,O.numeric),children:"…"},`ellipsis-${f}`):a.jsx("button",{type:"button",className:g(O.page,O.numeric,p===e&&O.active),onClick:()=>n(p),"aria-current":p===e?"page":void 0,children:p},p)),a.jsx("button",{type:"button",className:O.page,onClick:()=>n(Math.min(t,e+1)),disabled:e>=t,"aria-label":"Próxima página",children:"›"}),r&&a.jsx("select",{className:O.sizeSelect,value:s,onChange:p=>r(Number(p.target.value)),"aria-label":"Itens por página",children:o.map(p=>a.jsxs("option",{value:p,children:[p," / página"]},p))})]})]})}const vc="tempest_root_vEMon",wc="tempest_popover_E9K9X",xc="tempest_tempest-popover-in_W8miP",jc="tempest_top_TYlrh",$c="tempest_bottom_wGs70",kc="tempest_left_h7fCr",Nc="tempest_right_--bJW",Re={root:vc,popover:wc,tempestPopoverIn:xc,top:jc,bottom:$c,left:kc,right:Nc};function Sc({trigger:e,children:t,placement:n="bottom",open:s,onOpenChange:r,defaultOpen:o=!1,closeOnEsc:i=!0,closeOnOutsideClick:c=!0,className:l}){const d=s!==void 0,[p,f]=u.useState(o),m=d?s:p,_=u.useId(),h=u.useRef(null),b=u.useCallback(w=>{d||f(w),r?.(w)},[d,r]);u.useEffect(()=>{if(!m)return;const w=$=>{i&&$.key==="Escape"&&b(!1)},x=$=>{c&&h.current&&!h.current.contains($.target)&&b(!1)};return window.addEventListener("keydown",w),window.addEventListener("mousedown",x),()=>{window.removeEventListener("keydown",w),window.removeEventListener("mousedown",x)}},[m,i,c,b]);const y=w=>{e.props.onClick?.(w),b(!m)},v={...e,props:{...e.props,onClick:y,"aria-expanded":m,"aria-controls":_}};return a.jsxs("span",{ref:h,className:Re.root,children:[v,m&&a.jsx("div",{id:_,role:"dialog",className:g(Re.popover,Re[n],l),children:t})]})}const Ec="tempest_wrapper_BQek1",Cc="tempest_bar_uC-0x",Tc="tempest_fill_vmg7x",Lc="tempest_success_gWJ8U",Ic="tempest_warning_DGkPO",Rc="tempest_danger_gfwHh",Pc="tempest_indeterminate_HojUj",Dc="tempest_tempest-progress-loop_0nEdF",Mc="tempest_label_qqHJM",me={wrapper:Ec,bar:Cc,fill:Tc,success:Lc,warning:Ic,danger:Rc,indeterminate:Pc,tempestProgressLoop:Dc,label:Mc};function Ac({value:e=0,max:t=100,variant:n="primary",indeterminate:s=!1,showLabel:r=!1,label:o,className:i}){const c=s?0:Math.max(0,Math.min(100,e/t*100));return a.jsxs("div",{className:g(me.wrapper,i),children:[(r||o)&&a.jsxs("div",{className:me.label,children:[o&&a.jsx("span",{children:o}),r&&!s&&a.jsxs("span",{children:[Math.round(c),"%"]})]}),a.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":s?void 0:e,className:g(me.bar,s&&me.indeterminate),children:a.jsx("div",{className:g(me.fill,n!=="primary"&&me[n]),style:{width:s?void 0:`${c}%`}})})]})}const Fc="tempest_wrapper_P-gFm",Bc="tempest_disabled_0-cna",Oc="tempest_input_7R8ZN",Wc="tempest_dot_P7ejP",zc="tempest_labelWrap_iQ1HR",qc="tempest_label_vAFIP",Uc="tempest_description_bEB8u",Gc="tempest_group_oi329",Kc="tempest_horizontal_1Ovgu",ee={wrapper:Fc,disabled:Bc,input:Oc,dot:Wc,labelWrap:zc,label:qc,description:Uc,group:Gc,horizontal:Kc},it=u.createContext(null),Jc=u.forwardRef(function({label:t,description:n,value:s,disabled:r,name:o,checked:i,onChange:c,wrapperClassName:l,className:d,...p},f){const m=u.useContext(it),_=m?.name??o,h=m?.disabled??r,b=m?m.value===s:i;function y(v){m&&m.onChange?.(s),c?.(v)}return a.jsxs("label",{className:g(ee.wrapper,h&&ee.disabled,l),children:[a.jsx("input",{ref:f,type:"radio",name:_,value:s,checked:b,disabled:h,onChange:y,className:g(ee.input,d),...p}),a.jsx("span",{className:ee.dot,"aria-hidden":!0}),(t||n)&&a.jsxs("span",{className:ee.labelWrap,children:[t&&a.jsx("span",{className:ee.label,children:t}),n&&a.jsx("span",{className:ee.description,children:n})]})]})});function Hc({value:e,defaultValue:t,onChange:n,name:s,disabled:r,horizontal:o=!1,className:i,children:c}){const l=u.useId(),d=s??l,[p,f]=u.useState(t),m=e!==void 0,_=m?e:p;function h(b){m||f(b),n?.(b)}return a.jsx(it.Provider,{value:{name:d,value:_,onChange:h,disabled:r},children:a.jsx("div",{role:"radiogroup",className:g(ee.group,o&&ee.horizontal,i),children:c})})}const Vc="tempest_wrapper_o1aOo",Qc="tempest_label_jaBOA",Zc="tempest_value_GKfOu",Xc="tempest_field_YxCzt",Yc="tempest_track_j-2iy",el="tempest_fill_1pbqj",tl="tempest_input_1MASw",nl="tempest_helper_uqxKu",Z={wrapper:Vc,label:Qc,value:Zc,field:Xc,track:Yc,fill:el,input:tl,helper:nl};function sl({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:o,helperText:i,disabled:c=!1,formatValue:l,className:d}){const[p,f]=e,m=s-n,_=u.useMemo(()=>(p-n)/m*100,[p,n,m]),h=u.useMemo(()=>(f-n)/m*100,[f,n,m]),b=l?.(e)??`${p} – ${f}`,y=u.useCallback(w=>{const x=Math.min(Number(w.target.value),f);t([x,f])},[f,t]),v=u.useCallback(w=>{const x=Math.max(Number(w.target.value),p);t([p,x])},[p,t]);return a.jsxs("div",{className:g(Z.wrapper,d),children:[o&&a.jsxs("div",{className:Z.label,children:[a.jsx("span",{children:o}),a.jsx("span",{className:Z.value,children:b})]}),a.jsxs("div",{className:Z.field,children:[a.jsx("div",{className:Z.track}),a.jsx("div",{className:Z.fill,style:{left:`${_}%`,right:`${100-h}%`}}),a.jsx("input",{type:"range",className:Z.input,min:n,max:s,step:r,value:p,onChange:y,disabled:c,"aria-label":o?`${o} (mínimo)`:"Mínimo"}),a.jsx("input",{type:"range",className:Z.input,min:n,max:s,step:r,value:f,onChange:v,disabled:c,"aria-label":o?`${o} (máximo)`:"Máximo"})]}),i&&a.jsx("span",{className:Z.helper,children:i})]})}const rl="tempest_wrapper_K9Mqa",ol="tempest_star_goIGS",al="tempest_filled_mMs-d",il="tempest_disabled_tyUlQ",cl="tempest_readonly_bnKLN",ll="tempest_sm_K7-y9",ul="tempest_md_ex2Tb",dl="tempest_lg_TstLJ",fe={wrapper:rl,star:ol,filled:al,disabled:il,readonly:cl,sm:ll,md:ul,lg:dl};function pl({value:e,max:t=5,onChange:n,size:s="md",readonly:r=!1,disabled:o=!1,label:i="Avaliação",className:c}){const[l,d]=u.useState(0),p=l>0?l:e,f=m=>{r||o||n?.(m)};return a.jsx("span",{role:"radiogroup","aria-label":i,className:g(fe.wrapper,fe[s],o&&fe.disabled,r&&fe.readonly,c),onMouseLeave:()=>d(0),children:Array.from({length:t},(m,_)=>{const h=_+1,b=h<=p;return a.jsx("button",{type:"button",role:"radio","aria-checked":e===h,"aria-label":`${h} ${h===1?"estrela":"estrelas"}`,className:g(fe.star,b&&fe.filled),disabled:o,onMouseEnter:()=>!r&&!o&&d(h),onClick:()=>f(h),children:a.jsx(ml,{filled:b})},h)})})}function ml({filled:e}){return a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round","aria-hidden":!0,children:a.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14 2 9.27l6.91-1.01L12 2z"})})}function ct(e,t,n,s,r){return s?(Array.isArray(s)?s:[s]).includes(e):!(t&&!r.above(t)||n&&!r.below(n))}function fl({above:e,below:t,only:n,children:s}){const r=ue();return ct(r.current,e,t,n,r)?s:null}function hl({above:e,below:t,only:n,children:s}){const r=ue();return ct(r.current,e,t,n,r)?null:s}const _l="tempest_safe_iqDFY",bl="tempest_inline_V9eMG",gl="tempest_top_Xse9E",yl="tempest_right_GZm9b",vl="tempest_bottom_kkyD7",wl="tempest_left_Z4Q72",he={safe:_l,inline:bl,top:gl,right:yl,bottom:vl,left:wl},xl=["top","right","bottom","left"];function jl({edges:e=xl,inline:t=!1,className:n,children:s,...r}){return a.jsx("div",{className:g(he.safe,t&&he.inline,e.includes("top")&&he.top,e.includes("right")&&he.right,e.includes("bottom")&&he.bottom,e.includes("left")&&he.left,n),"data-edges":e.join(" "),...r,children:s})}const $l="tempest_wrapper_dKXJJ",kl="tempest_input_m0lPc",Nl="tempest_iconLeft_030-U",Sl="tempest_clear_nb6lG",$e={wrapper:$l,input:kl,iconLeft:Nl,clear:Sl},El=u.forwardRef(function({value:t,onChange:n,onClear:s,wrapperClassName:r,placeholder:o="Buscar...",className:i,...c},l){function d(){n(""),s?.()}return a.jsxs("div",{className:g($e.wrapper,r),children:[a.jsx("span",{className:$e.iconLeft,"aria-hidden":!0,children:a.jsx(Cl,{})}),a.jsx("input",{ref:l,type:"search",value:t,onChange:p=>n(p.target.value),placeholder:o,className:g($e.input,i),...c}),t&&a.jsx("button",{type:"button",className:$e.clear,"aria-label":"Limpar busca",onClick:d,children:a.jsx(Tl,{})})]})});function Cl(){return a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),a.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function Tl(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Ll="tempest_wrapper_KS2K3",Il="tempest_label_Lmgos",Rl="tempest_required_PvDVJ",Pl="tempest_field_h-wBy",Dl="tempest_select_cjdcr",Ml="tempest_caret_MdCao",Al="tempest_error_sw9MU",Fl="tempest_helper_frosK",Bl="tempest_errorText_-zd6i",X={wrapper:Ll,label:Il,required:Rl,field:Pl,select:Dl,caret:Ml,error:Al,helper:Fl,errorText:Bl},Ol=u.forwardRef(function({label:t,helperText:n,error:s,options:r,placeholder:o,wrapperClassName:i,className:c,children:l,id:d,required:p,...f},m){const _=u.useId(),h=d??_;return a.jsxs("div",{className:g(X.wrapper,s&&X.error,i),children:[t&&a.jsxs("label",{htmlFor:h,className:X.label,children:[t,p&&a.jsx("span",{className:X.required,children:"*"})]}),a.jsxs("div",{className:X.field,children:[a.jsxs("select",{ref:m,id:h,"aria-invalid":!!s,required:p,className:g(X.select,c),...f,children:[o&&a.jsx("option",{value:"",disabled:!0,hidden:!0,children:o}),r?.map(b=>a.jsx("option",{value:b.value,disabled:b.disabled,children:b.label},b.value)),l]}),a.jsx("span",{className:X.caret,"aria-hidden":!0,children:a.jsx(Wl,{})})]}),s?a.jsx("span",{className:X.errorText,children:s}):n?a.jsx("span",{className:X.helper,children:n}):null]})});function Wl(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const zl="tempest_sidebar_UB1qz",ql="tempest_header_zupoS",Ul="tempest_nav_aLYuL",Gl="tempest_item_IAjHb",Kl="tempest_collapsed_ZbZYA",Jl="tempest_active_BgcFy",Hl="tempest_icon_UQswn",Vl="tempest_label_TPvJ9",Ql="tempest_badge_xwEZv",Zl="tempest_footer_TyRyi",G={sidebar:zl,header:ql,nav:Ul,item:Gl,collapsed:Kl,active:Jl,icon:Hl,label:Vl,badge:Ql,footer:Zl};function Xl({header:e,items:t,value:n,onChange:s,footer:r,collapsed:o=!1,width:i=240,collapsedWidth:c=64,className:l,style:d,...p}){const f=typeof(o?c:i)=="number"?`${o?c:i}px`:o?c:i;return a.jsxs("aside",{className:g(G.sidebar,o&&G.collapsed,l),style:{width:f,...d},...p,children:[e&&a.jsx("div",{className:G.header,children:e}),a.jsx("nav",{className:G.nav,"aria-label":"Navegação lateral",children:t.map(m=>{const _=m.key===n;return a.jsxs("button",{type:"button",className:g(G.item,_&&G.active),"aria-current":_?"page":void 0,disabled:m.disabled,onClick:()=>s?.(m.key),title:o&&typeof m.label=="string"?m.label:void 0,children:[m.icon&&a.jsx("span",{className:G.icon,children:m.icon}),!o&&a.jsx("span",{className:G.label,children:m.label}),!o&&m.badge!==void 0&&a.jsx("span",{className:G.badge,children:m.badge})]},m.key)})}),r&&a.jsx("div",{className:G.footer,children:r})]})}const Yl="tempest_skeleton_CB4uF",eu="tempest_text_-A8IF",tu="tempest_circle_DYcl8",Pe={skeleton:Yl,text:eu,circle:tu};function nu({variant:e="rect",width:t,height:n,className:s,style:r}){return a.jsx("span",{"aria-hidden":!0,className:g(Pe.skeleton,e==="text"&&Pe.text,e==="circle"&&Pe.circle,s),style:{width:t,height:n,...r}})}const su="tempest_spacer_okdOd",ru="tempest_both_85qSF",ou="tempest_x_QiU2B",au="tempest_y_hTtCp",He={spacer:su,both:ru,x:ou,y:au};function iu({axis:e="both",className:t,...n}){return a.jsx("div",{className:g(He.spacer,He[e],t),...n})}const cu="tempest_spinner_GpFZS",lu="tempest_tempest-spinner_wKVCY",uu="tempest_xs_p8BFI",du="tempest_sm_3sIoD",pu="tempest_md_M2sPj",mu="tempest_lg_IxTw2",fu="tempest_xl_cgwqq",Ve={spinner:cu,tempestSpinner:lu,xs:uu,sm:du,md:pu,lg:mu,xl:fu};function hu({size:e="md",className:t,label:n="Carregando"}){return a.jsx("span",{role:"status","aria-label":n,className:g(Ve.spinner,Ve[e],t)})}const _u="tempest_stat_zoo9y",bu="tempest_header_3UQqq",gu="tempest_icon_zUG3e",yu="tempest_label_lIH47",vu="tempest_row_Ifyts",wu="tempest_value_JBWnr",xu="tempest_delta_mRVrE",ju="tempest_up_7qgUO",$u="tempest_down_3Rq2Z",ku="tempest_flat_R5pZT",Nu="tempest_hint_YkTF8",W={stat:_u,header:bu,icon:gu,label:yu,row:vu,value:wu,delta:xu,up:ju,down:$u,flat:ku,hint:Nu};function Su(e){if(typeof e!="string")return;const t=e.trim();if(t.startsWith("+"))return"up";if(t.startsWith("-")||t.startsWith("−"))return"down"}function Eu({label:e,value:t,delta:n,trend:s,hint:r,icon:o,className:i,...c}){const l=s??Su(n);return a.jsxs("div",{className:g(W.stat,i),...c,children:[a.jsxs("div",{className:W.header,children:[o&&a.jsx("span",{className:W.icon,children:o}),a.jsx("span",{className:W.label,children:e})]}),a.jsxs("div",{className:W.row,children:[a.jsx("span",{className:W.value,children:t}),n!==void 0&&a.jsx("span",{className:g(W.delta,l==="up"&&W.up,l==="down"&&W.down,l==="flat"&&W.flat),children:n})]}),r&&a.jsx("p",{className:W.hint,children:r})]})}const Cu="tempest_stepper_w3qjQ",Tu="tempest_vertical_d4mOs",Lu="tempest_step_s2nqL",Iu="tempest_dot_d1bSL",Ru="tempest_completed_gcFHM",Pu="tempest_active_kL-CH",Du="tempest_label_8irAI",Mu="tempest_connector_lyeWp",Y={stepper:Cu,vertical:Tu,step:Lu,dot:Iu,completed:Ru,active:Pu,label:Du,connector:Mu};function Au({steps:e,current:t,orientation:n="horizontal",className:s}){return a.jsx("ol",{className:g(Y.stepper,n==="vertical"&&Y.vertical,s),children:e.map((r,o)=>{const i=o<t,c=o===t;return a.jsxs(u.Fragment,{children:[a.jsxs("li",{className:g(Y.step,i&&Y.completed,c&&Y.active),"aria-current":c?"step":void 0,children:[a.jsx("span",{className:Y.dot,children:i?"✓":o+1}),a.jsx("span",{className:Y.label,children:r.label})]}),o<e.length-1&&a.jsx("span",{className:g(Y.connector,i&&Y.completed),"aria-hidden":!0})]},o)})})}const Fu="tempest_wrapper_kudO9",Bu="tempest_disabled_2aZ0V",Ou="tempest_input_5BPNu",Wu="tempest_track_7ObdZ",zu="tempest_thumb_-FTeK",qu="tempest_label_LrH7V",_e={wrapper:Fu,disabled:Bu,input:Ou,track:Wu,thumb:zu,label:qu},Uu=u.forwardRef(function({label:t,disabled:n,wrapperClassName:s,className:r,...o},i){return a.jsxs("label",{className:g(_e.wrapper,n&&_e.disabled,s),children:[a.jsx("input",{ref:i,type:"checkbox",role:"switch",disabled:n,className:g(_e.input,r),...o}),a.jsx("span",{className:_e.track,"aria-hidden":!0,children:a.jsx("span",{className:_e.thumb})}),t&&a.jsx("span",{className:_e.label,children:t})]})}),Gu="tempest_tag_16VPH",Ku="tempest_sm_pzyd5",Ju="tempest_md_GL6tQ",Hu="tempest_lg_8tgXU",Vu="tempest_neutral_jAd-x",Qu="tempest_primary_AXKlN",Zu="tempest_success_56lz4",Xu="tempest_warning_UK7SC",Yu="tempest_danger_kJ-yx",ed="tempest_info_hmHE-",td="tempest_label_ZBPfO",nd="tempest_remove_UEwgr",ve={tag:Gu,sm:Ku,md:Ju,lg:Hu,neutral:Vu,primary:Qu,success:Zu,warning:Xu,danger:Yu,info:ed,label:td,remove:nd};function sd({variant:e="neutral",size:t="md",onRemove:n,removeLabel:s="Remover",className:r,children:o,...i}){return a.jsxs("span",{className:g(ve.tag,ve[e],ve[t],r),...i,children:[a.jsx("span",{className:ve.label,children:o}),n&&a.jsx("button",{type:"button",className:ve.remove,"aria-label":s,onClick:n,children:"×"})]})}const rd="tempest_scroll_unrJp",od="tempest_table_Dkosn",ad="tempest_th_PNuEx",id="tempest_td_jv9tA",cd="tempest_tr_7UG8J",ld="tempest_clickable_B6Si-",ud="tempest_alignRight_9hY0G",dd="tempest_alignCenter_YiUQy",pd="tempest_emptyRow_kdMiv",md="tempest_priorityTablet_3alUt",fd="tempest_priorityDesktop_3f8Fq",hd="tempest_stackable_heix7",_d="tempest_stackableHead_mKGcA",bd="tempest_stackableRow_qPNqc",S={scroll:rd,table:od,th:ad,td:id,tr:cd,clickable:ld,alignRight:ud,alignCenter:dd,emptyRow:pd,priorityTablet:md,priorityDesktop:fd,stackable:hd,stackableHead:_d,stackableRow:bd};function Qe(e){if(e==="tablet")return S.priorityTablet;if(e==="desktop")return S.priorityDesktop}function gd({columns:e,data:t,rowKey:n,onRowClick:s,emptyMessage:r="Nenhum registro encontrado.",className:o,stackOnMobile:i=!1}){return a.jsx("div",{className:g(S.scroll,i&&S.stackable,o),children:a.jsxs("table",{className:S.table,children:[a.jsx("thead",{className:g(i&&S.stackableHead),children:a.jsx("tr",{children:e.map(c=>a.jsx("th",{className:g(S.th,c.align==="right"&&S.alignRight,c.align==="center"&&S.alignCenter,Qe(c.priority)),style:{width:c.width},children:c.header},c.key))})}),a.jsx("tbody",{children:t.length===0?a.jsx("tr",{children:a.jsx("td",{className:S.emptyRow,colSpan:e.length,children:r})}):t.map((c,l)=>a.jsx("tr",{className:g(S.tr,s&&S.clickable,i&&S.stackableRow),onClick:s?()=>s(c):void 0,children:e.map(d=>{const p=d.render?d.render(c,l):c[d.key];return a.jsx("td",{className:g(S.td,d.align==="right"&&S.alignRight,d.align==="center"&&S.alignCenter,Qe(d.priority),d.className),"data-label":typeof d.header=="string"?d.header:void 0,children:p},d.key)})},n(c,l)))})]})})}const yd="tempest_tablist_WR6ag",vd="tempest_tab_IdDYc",wd="tempest_active_PTNtG",xd="tempest_panel_08i9c",jd="tempest_pill_lGuqn",we={tablist:yd,tab:vd,active:wd,panel:xd,pill:jd};function $d({items:e,defaultId:t,activeId:n,onChange:s,variant:r="underline",className:o}){const i=e.find(_=>!_.disabled),[c,l]=u.useState(t??i?.id),d=n!==void 0,p=d?n:c,f=e.find(_=>_.id===p)??i;function m(_){d||l(_),s?.(_)}return a.jsxs("div",{className:o,children:[a.jsx("div",{role:"tablist",className:g(we.tablist,r==="pill"&&we.pill),children:e.map(_=>{const h=_.id===f?.id;return a.jsx("button",{type:"button",role:"tab","aria-selected":h,"aria-controls":`panel-${_.id}`,id:`tab-${_.id}`,disabled:_.disabled,className:g(we.tab,h&&we.active),onClick:()=>m(_.id),children:_.label},_.id)})}),f&&a.jsx("div",{role:"tabpanel",id:`panel-${f.id}`,"aria-labelledby":`tab-${f.id}`,className:we.panel,children:f.content})]})}const kd="tempest_wrapper_C0gfg",Nd="tempest_label_cWLXP",Sd="tempest_required_rDZXE",Ed="tempest_textarea_Z-y6g",Cd="tempest_error_NWC9f",Td="tempest_helper_gedut",Ld="tempest_errorText_ey07q",le={wrapper:kd,label:Nd,required:Sd,textarea:Ed,error:Cd,helper:Td,errorText:Ld},Id=u.forwardRef(function({label:t,helperText:n,error:s,wrapperClassName:r,className:o,id:i,required:c,...l},d){const p=u.useId(),f=i??p;return a.jsxs("div",{className:g(le.wrapper,s&&le.error,r),children:[t&&a.jsxs("label",{htmlFor:f,className:le.label,children:[t,c&&a.jsx("span",{className:le.required,children:"*"})]}),a.jsx("textarea",{ref:d,id:f,"aria-invalid":!!s,required:c,className:g(le.textarea,o),...l}),s?a.jsx("span",{className:le.errorText,children:s}):n?a.jsx("span",{className:le.helper,children:n}):null]})}),Rd="tempest_trigger_Dmc5E",Pd="tempest_bubble_TPGHB",Dd="tempest_tempest-tooltip-in_csYeZ",Md="tempest_top_m2tnn",Ad="tempest_bottom_9Twz4",Fd="tempest_left_UPdrG",Bd="tempest_right_CV--T",De={trigger:Rd,bubble:Pd,tempestTooltipIn:Dd,top:Md,bottom:Ad,left:Fd,right:Bd};function Od({content:e,placement:t="top",children:n,disabled:s=!1,openDelay:r=150}){const[o,i]=u.useState(!1),c=u.useId();let l=null;function d(){s||(l&&clearTimeout(l),l=setTimeout(()=>i(!0),r))}function p(){l&&(clearTimeout(l),l=null),i(!1)}const f=u.cloneElement(n,{onMouseEnter:d,onMouseLeave:p,onFocus:d,onBlur:p,"aria-describedby":o?c:void 0});return a.jsxs("span",{className:De.trigger,children:[f,o&&a.jsx("span",{id:c,role:"tooltip",className:g(De.bubble,De[t]),children:e})]})}const Wd="tempest_container_x4-Qm",zd="tempest_positionTopRight_gbUCQ",qd="tempest_positionTopLeft_Z-tMJ",Ud="tempest_positionTopCenter_A4Ze4",Gd="tempest_positionBottomRight_MGo19",Kd="tempest_positionBottomLeft_DpiNe",Jd="tempest_positionBottomCenter_XUdok",Hd="tempest_toast_FLdHz",Vd="tempest_tempest-toast-in_E2d-A",Qd="tempest_success_Oy694",Zd="tempest_warning_84GC8",Xd="tempest_error_hrQAA",Yd="tempest_info_eq5bQ",ep="tempest_title_-H6R2",tp="tempest_description_-QwfC",np="tempest_close_i10-s",A={container:Wd,positionTopRight:zd,positionTopLeft:qd,positionTopCenter:Ud,positionBottomRight:Gd,positionBottomLeft:Kd,positionBottomCenter:Jd,toast:Hd,tempestToastIn:Vd,success:Qd,warning:Zd,error:Xd,info:Yd,title:ep,description:tp,close:np},lt=u.createContext(null);function sp(){const e=u.useContext(lt);if(!e)throw new Error("useToast must be used inside a <ToastProvider>");return e}function rp({children:e,defaultDuration:t=4e3,position:n="top-right"}){const[s,r]=u.useState([]),o=u.useRef(0),i=u.useCallback(d=>{r(p=>p.filter(f=>f.id!==d))},[]),c=u.useCallback(d=>{const p=d.id??`toast-${++o.current}`,f={id:p,title:d.title,description:d.description,variant:d.variant??"info",duration:d.duration??t};return r(m=>[...m,f]),p},[t]),l=u.useMemo(()=>({show:c,dismiss:i,success:(d,p)=>c({...p,description:d,variant:"success"}),error:(d,p)=>c({...p,description:d,variant:"error"}),warning:(d,p)=>c({...p,description:d,variant:"warning"}),info:(d,p)=>c({...p,description:d,variant:"info"})}),[c,i]);return a.jsxs(lt.Provider,{value:l,children:[e,a.jsx(ap,{toasts:s,onDismiss:i,position:n})]})}function op(e){switch(e){case"top-left":return A.positionTopLeft;case"top-center":return A.positionTopCenter;case"bottom-right":return A.positionBottomRight;case"bottom-left":return A.positionBottomLeft;case"bottom-center":return A.positionBottomCenter;default:return A.positionTopRight}}function ap({toasts:e,onDismiss:t,position:n}){return typeof document>"u"?null:Ee.createPortal(a.jsx("div",{className:g(A.container,op(n)),"aria-live":"polite","aria-atomic":"true",children:e.map(s=>a.jsx(ip,{toast:s,onDismiss:t},s.id))}),document.body)}function ip({toast:e,onDismiss:t}){return u.useEffect(()=>{if(!e.duration)return;const n=setTimeout(()=>t(e.id),e.duration);return()=>clearTimeout(n)},[e.id,e.duration,t]),a.jsxs("div",{className:g(A.toast,A[e.variant]),role:"status",children:[a.jsxs("div",{children:[e.title&&a.jsx("p",{className:A.title,children:e.title}),e.description&&a.jsx("p",{className:A.description,children:e.description})]}),a.jsx("button",{type:"button",className:A.close,"aria-label":"Fechar notificação",onClick:()=>t(e.id),children:a.jsx(cp,{})})]})}function cp(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const lp="tempest_scroll_8Giwl",up="tempest_spacer_P3Pvl",dp="tempest_row_Ff0VU",Me={scroll:lp,spacer:up,row:dp};function pp({items:e,itemHeight:t,renderItem:n,height:s,overscan:r=4,getKey:o,className:i,style:c}){const l=u.useRef(null),[d,p]=u.useState(0),[f,m]=u.useState(0);u.useEffect(()=>{const v=l.current;if(!v||(m(v.clientHeight),typeof ResizeObserver>"u"))return;const w=new ResizeObserver(()=>m(v.clientHeight));return w.observe(v),()=>w.disconnect()},[]);const _=e.length*t,h=Math.max(0,Math.floor(d/t)-r),b=Math.ceil(f/t)+r*2,y=Math.min(e.length,h+b);return a.jsx("div",{ref:l,className:g(Me.scroll,i),style:{height:s,...c},onScroll:v=>p(v.target.scrollTop),role:"list",children:a.jsx("div",{className:Me.spacer,style:{height:_},children:e.slice(h,y).map((v,w)=>{const x=h+w,$=o?o(v,x):x;return a.jsx("div",{role:"listitem",className:Me.row,style:{top:x*t,height:t},children:n(v,x)},$)})})})}function mp(e,t=300){const[n,s]=u.useState(e);return u.useEffect(()=>{const r=setTimeout(()=>s(e),t);return()=>clearTimeout(r)},[e,t]),n}function fp(e=1,t=50){const[n,s]=u.useState(e),[r,o]=u.useState(t),i=u.useCallback(()=>s(1),[]);return{page:n,size:r,setPage:s,setSize:o,reset:i}}function hp(e,t,n){return u.useMemo(()=>{const s=t.trim().toLowerCase();return s?typeof n=="function"?e.filter(r=>n(r,s)):e.filter(r=>n.some(o=>{const i=r[o];return i!=null&&String(i).toLowerCase().includes(s)})):e},[e,t,n])}function _p(e){const[t,n]=u.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return u.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(e),r=o=>n(o.matches);return n(s.matches),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),t}function bp(e,t,n,s){const r=u.useRef(t);r.current=t,u.useEffect(()=>{const o=n===void 0?typeof window>"u"?null:window:"current"in n?n.current??null:n;if(!o?.addEventListener)return;const i=c=>r.current(c);return o.addEventListener(e,i,s),()=>o.removeEventListener(e,i,s)},[e,n,s])}const gp=JSON.stringify,yp=e=>JSON.parse(e);function vp(e,t,n={}){const s=n.serialize??gp,r=n.deserialize??yp,o=u.useCallback(()=>{if(typeof window>"u")return t;try{const p=window.localStorage.getItem(e);return p===null?t:r(p)}catch{return t}},[e,t,r]),[i,c]=u.useState(o);u.useEffect(()=>{c(o())},[o]);const l=u.useCallback(p=>{c(f=>{const m=typeof p=="function"?p(f):p;try{typeof window<"u"&&window.localStorage.setItem(e,s(m))}catch{}return m})},[e,s]),d=u.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e)}catch{}c(t)},[e,t]);return u.useEffect(()=>{if(typeof window>"u")return;const p=f=>{if(f.key===e){if(f.newValue===null){c(t);return}try{c(r(f.newValue))}catch{}}};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[e,t,r]),[i,l,d]}function wp(e=!1){const[t,n]=u.useState(e),s=u.useCallback(()=>n(c=>!c),[]),r=u.useCallback(()=>n(!0),[]),o=u.useCallback(()=>n(!1),[]),i=u.useCallback(c=>n(c),[]);return[t,{toggle:s,setTrue:r,setFalse:o,set:i}]}function xp(e,t=[],n={}){const{immediate:s=!1}=n,[r,o]=u.useState({status:"idle",data:void 0,error:void 0}),i=u.useRef(e);i.current=e;const c=u.useRef(0),l=u.useRef(!0);u.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const d=u.useCallback(async()=>{const f=++c.current;o(m=>({...m,status:"pending",error:void 0}));try{const m=await i.current();return l.current&&c.current===f&&o({status:"success",data:m,error:void 0}),m}catch(m){throw l.current&&c.current===f&&o({status:"error",data:void 0,error:m}),m}},[]),p=u.useCallback(()=>{c.current++,o({status:"idle",data:void 0,error:void 0})},[]);return u.useEffect(()=>{s&&d().catch(()=>{})},[s,...t]),{status:r.status,data:r.data,error:r.error,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",run:d,reset:p}}function jp(){const[e,t]=u.useState(()=>typeof navigator>"u"?!0:navigator.onLine);return u.useEffect(()=>{if(typeof window>"u")return;const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",s),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}},[]),e}function $p(){const[e,t]=u.useState(()=>typeof document>"u"?"visible":document.visibilityState);return u.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState);return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function kp(e,t={}){const[n,s]=u.useState(null),{once:r=!1,root:o,rootMargin:i,threshold:c}=t;return u.useEffect(()=>{const l=e.current;if(!l||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(([p])=>{p&&(s(p),r&&p.isIntersecting&&d.unobserve(l))},{root:o,rootMargin:i,threshold:c});return d.observe(l),()=>d.disconnect()},[e,r,o,i,c]),n}function Np(e){const[t,n]=u.useState(null);return u.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const r=new ResizeObserver(o=>{const i=o[0];if(!i)return;const c=i.contentRect;n({width:c.width,height:c.height})});return r.observe(s),()=>r.disconnect()},[e]),t}function Sp(e={}){const{resetAfter:t=1500}=e,[n,s]=u.useState(!1),r=u.useRef(null),o=u.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),s(!1)},[]);u.useEffect(()=>()=>o(),[o]);const i=u.useCallback(async c=>{try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(c);else if(typeof document<"u"){const l=document.createElement("textarea");l.value=c,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l)}else return!1;return s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),t),!0}catch{return!1}},[t]);return{copied:n,copy:i,reset:o}}function Ep(e,t){if(e.key.toLowerCase()!==t.key.toLowerCase())return!1;const n=!!t.ctrl,s=!!t.meta,r=!!t.shift,o=!!t.alt;if(t.mod){if(!e.ctrlKey&&!e.metaKey)return!1}else if(e.ctrlKey!==n||e.metaKey!==s)return!1;return!(e.shiftKey!==r||e.altKey!==o)}function Cp(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:e.isContentEditable}function Tp(e,t,n={}){const{disabled:s=!1,ignoreInput:r=!0}=n;u.useEffect(()=>{if(s||typeof window>"u")return;const o=i=>{r&&Cp(i.target)||Ep(i,e)&&t(i)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s,r,e.key,e.ctrl,e.meta,e.shift,e.alt,e.mod,t])}function Lp(){const[e,t]=u.useState(null),[n,s]=u.useState(!1);u.useEffect(()=>{if(typeof window>"u")return;const o=c=>{c.preventDefault(),t(c)},i=()=>{t(null),s(!0)};return window.addEventListener("beforeinstallprompt",o),window.addEventListener("appinstalled",i),()=>{window.removeEventListener("beforeinstallprompt",o),window.removeEventListener("appinstalled",i)}},[]);const r=u.useCallback(async()=>{if(!e)return"unsupported";await e.prompt();const o=await e.userChoice;return t(null),o.outcome==="accepted"&&s(!0),o.outcome},[e]);return{installable:!!e,installed:n,prompt:r}}const Ze=["mousemove","mousedown","keydown","touchstart","wheel","scroll"];function Ip(e=6e4){const[t,n]=u.useState(!1);return u.useEffect(()=>{if(typeof window>"u")return;let s=setTimeout(()=>n(!0),e);function r(){n(!1),clearTimeout(s),s=setTimeout(()=>n(!0),e)}for(const o of Ze)window.addEventListener(o,r,{passive:!0});return()=>{clearTimeout(s);for(const o of Ze)window.removeEventListener(o,r)}},[e]),t}function Rp(e={}){const{watch:t=!1,disabled:n=!1,...s}=e,[r,o]=u.useState({loading:!n,error:null,coords:null,timestamp:null});return u.useEffect(()=>{if(n||typeof navigator>"u"||!navigator.geolocation){o(l=>({...l,loading:!1}));return}const i=l=>{o({loading:!1,error:null,coords:l.coords,timestamp:l.timestamp})},c=l=>{o(d=>({...d,loading:!1,error:l}))};if(t){const l=navigator.geolocation.watchPosition(i,c,s);return()=>navigator.geolocation.clearWatch(l)}navigator.geolocation.getCurrentPosition(i,c,s)},[n,t,s.enableHighAccuracy,s.maximumAge,s.timeout]),r}function Pp(e){u.useEffect(()=>{if(!e||typeof document>"u")return;const t=document.body,n=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=n}},[e])}const Dp=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Mp(e,t){u.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const s=document.activeElement;function r(){return Array.from(n?.querySelectorAll(Dp)??[]).filter(c=>{if(c.hasAttribute("aria-hidden"))return!1;const l=typeof window<"u"?window.getComputedStyle(c):null;return!(l&&(l.display==="none"||l.visibility==="hidden"))})}function o(c){if(c.key!=="Tab")return;const l=r();if(l.length===0){c.preventDefault();return}const d=l[0],p=l[l.length-1],f=document.activeElement;c.shiftKey?(f===d||!f||!n?.contains(f))&&(c.preventDefault(),p.focus()):f===p&&(c.preventDefault(),d.focus())}return r()[0]?.focus(),document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),s?.focus?.()}},[e,t])}function Ap(e){const t=u.useRef(e);return t.current=e,u.useCallback((...n)=>t.current(...n),[])}function Be(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((r,o)=>Be(r,t[o]));const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every(r=>Be(e[r],t[r]))}function Fp(e){const t=u.useRef(e);return Be(t.current,e)||(t.current=e),t.current}function Bp(e,t,n){const s=new URL(t,e.endsWith("/")?e:`${e}/`);if(n)for(const[r,o]of Object.entries(n))o!=null&&s.searchParams.set(r,String(o));return s.toString()}function Op(e){return typeof FormData<"u"&&e instanceof FormData}async function Xe(e){let t=null;try{t=await e.clone().json()}catch{try{t=await e.text()}catch{t=null}}const n=(typeof t=="object"&&t!==null?t.detail??t.message:void 0)??`Erro ${e.status}`;return{status:e.status,detail:String(n),body:t}}function Wp(e){const t=e.fetcher??globalThis.fetch.bind(globalThis);function n(){const i=e.getToken?.();return i?{Authorization:`Bearer ${i}`}:{}}async function s(i,c){const{body:l,params:d,headers:p,...f}=c,m=Op(l),_={...m?{}:{"Content-Type":"application/json"},...e.headers,...n(),...p},h={...f,headers:_,credentials:e.withCredentials?"include":f.credentials,body:l==null?void 0:m?l:JSON.stringify(l)};return t(Bp(e.baseURL,i,d),h)}async function r(i,c={}){let l=await s(i,c);if(l.status===401)if(e.refresh)try{await e.refresh(),l=await s(i,c)}catch{throw await e.onUnauthorized?.(l),await Xe(l)}else await e.onUnauthorized?.(l);if(!l.ok)throw await Xe(l);return l.status===204?void 0:(l.headers.get("content-type")??"").includes("application/json")?await l.json():await l.text()}async function o(i,c,l="POST"){return r(i,{method:l,body:c})}return{request:r,get:(i,c)=>r(i,{...c,method:"GET"}),post:(i,c)=>r(i,{...c,method:"POST"}),put:(i,c)=>r(i,{...c,method:"PUT"}),patch:(i,c)=>r(i,{...c,method:"PATCH"}),delete:(i,c)=>r(i,{...c,method:"DELETE"}),upload:o}}function zp(e,t,n){const s=e.safeParse(t);if(s.success)return s.data;if(typeof process<"u"&&(process.env?.NODE_ENV==="development"||process.env?.NODE_ENV==="test")){const o=s.error.issues.map(i=>` - ${i.path.join(".")||"<root>"}: ${i.message}`).join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),Fe=require("react-dom"),Z=require("react-hook-form"),ot=require("@tanstack/react-query"),Xt=require("zustand"),at=require("zustand/middleware"),Yt=require("dexie");function b(...e){const t=[];for(const n of e)if(!(n==null||n===!1||n===!0)){if(typeof n=="string")n&&t.push(n);else if(typeof n=="number"||typeof n=="bigint")t.push(String(n));else if(Array.isArray(n)){const s=b(...n);s&&t.push(s)}}return t.join(" ")}const Zt="tempest_accordion_LVhhv",en="tempest_item_7ryVk",tn="tempest_header_WaTdJ",nn="tempest_trigger_9BYFY",sn="tempest_chevron_i-HVZ",rn="tempest_open_98jLY",on="tempest_panel_Wx50w",de={accordion:Zt,item:en,header:tn,trigger:nn,chevron:sn,open:rn,panel:on};function an({items:e,multiple:t=!1,value:n,defaultValue:s=[],onChange:r,className:o}){const i=u.useId(),c=n!==void 0,[l,d]=u.useState(s),p=c?n:l,m=u.useCallback(f=>{const _=p.includes(f),h=t?_?p.filter(g=>g!==f):[...p,f]:_?[]:[f];c||d(h),r?.(h)},[p,t,c,r]);return a.jsx("div",{className:b(de.accordion,o),children:e.map(f=>{const _=p.includes(f.id),h=`${i}-${f.id}-panel`,g=`${i}-${f.id}-trigger`;return a.jsxs("div",{className:b(de.item,_&&de.open),children:[a.jsx("h3",{className:de.header,children:a.jsxs("button",{type:"button",id:g,className:de.trigger,"aria-expanded":_,"aria-controls":h,disabled:f.disabled,onClick:()=>m(f.id),children:[a.jsx("span",{children:f.title}),a.jsx(cn,{className:de.chevron})]})}),_&&a.jsx("div",{id:h,role:"region","aria-labelledby":g,className:de.panel,children:f.children})]},f.id)})})}function cn({className:e}){return a.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const ln="tempest_alert_7cYyI",un="tempest_content_UXnmZ",dn="tempest_title_abGgF",pn="tempest_description_pXPvw",mn="tempest_icon_Zg6SB",fn="tempest_close_narep",hn="tempest_neutral_J7MH1",_n="tempest_solid_s-oW5",gn="tempest_outline_v7w9b",bn="tempest_info_9r3r1",yn="tempest_success_1bzoB",vn="tempest_warning_q-j1Q",wn="tempest_danger_CiZkW",te={alert:ln,content:un,title:dn,description:pn,icon:mn,close:fn,neutral:hn,solid:_n,outline:gn,info:bn,success:yn,warning:vn,danger:wn};function xn({variant:e="info",appearance:t="soft",title:n,description:s,icon:r,onClose:o,closeLabel:i="Dismiss",className:c,children:l,...d}){return a.jsxs("div",{role:"alert",className:b(te.alert,te[e],t==="solid"&&te.solid,t==="outline"&&te.outline,c),...d,children:[r&&a.jsx("span",{className:te.icon,children:r}),a.jsxs("div",{className:te.content,children:[n&&a.jsx("p",{className:te.title,children:n}),s&&a.jsx("p",{className:te.description,children:s}),l]}),o&&a.jsx("button",{type:"button",className:te.close,onClick:o,"aria-label":i,children:a.jsx(jn,{})})]})}function jn(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Ae={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},$n=["xs","sm","md","lg","xl","2xl"];function Nn(e){let t="xs";for(const n of $n)e>=Ae[n]&&(t=n);return t}function ve(){const[e,t]=u.useState(()=>typeof window>"u"?0:window.innerWidth);u.useEffect(()=>{if(typeof window>"u")return;const o=()=>t(window.innerWidth);return o(),window.addEventListener("resize",o,{passive:!0}),()=>window.removeEventListener("resize",o)},[]);const n=Nn(e),s=o=>e>=Ae[o],r=o=>e<Ae[o];return{current:n,width:e,above:s,below:r,isMobile:r("md"),isTablet:s("md")&&r("lg"),isDesktop:s("lg")}}const kn="tempest_shell_-xp0O",Sn="tempest_navbar_liTKV",En="tempest_row_PE41P",Cn="tempest_sidebar_wyx-V",Tn="tempest_main_O3GFv",Ln="tempest_footer_IFW4q",In="tempest_bottomNav_pKJ1v",pe={shell:kn,navbar:Sn,row:En,sidebar:Cn,main:Tn,footer:Ln,bottomNav:In};function Rn({navbar:e,sidebar:t,bottomNav:n,footer:s,sidebarBreakpoint:r="md",className:o,children:i,...c}){const d=ve().above(r);return a.jsxs("div",{className:b(pe.shell,o),...c,children:[e&&a.jsx("div",{className:pe.navbar,children:e}),a.jsxs("div",{className:pe.row,children:[t&&d&&a.jsx("div",{className:pe.sidebar,children:t}),a.jsx("main",{className:pe.main,children:i})]}),s&&a.jsx("div",{className:pe.footer,children:s}),n&&!d&&a.jsx("div",{className:pe.bottomNav,children:n})]})}const Mn="tempest_aspect_GnAJt",An={aspect:Mn};function Pn({ratio:e=16/9,className:t,style:n,children:s,...r}){const o={aspectRatio:String(e),...n};return a.jsx("div",{className:b(An.aspect,t),style:o,...r,children:s})}const Dn="tempest_avatar_3xMuZ",Fn="tempest_image_ieqGp",Bn="tempest_xs_oSaLL",Wn="tempest_sm_sZ2bk",On="tempest_md_Fdkbz",zn="tempest_lg_pTTUA",Un="tempest_xl_mW58F",qn="tempest_status_ISBnL",Hn="tempest_dot_Wgfo-",Gn="tempest_online_-aWoW",Kn="tempest_offline_-StX3",Jn="tempest_busy_TbwuF",we={avatar:Dn,image:Fn,xs:Bn,sm:Wn,md:On,lg:zn,xl:Un,status:qn,dot:Hn,online:Gn,offline:Kn,busy:Jn};function Vn(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2):`${t[0].charAt(0)}${t[t.length-1].charAt(0)}`}function Qn({src:e,alt:t,name:n="",size:s="md",status:r,className:o,onClick:i}){const[c,l]=u.useState(!1),d=u.useMemo(()=>Vn(n),[n]),p=e&&!c,m=i?"button":void 0,f=i?0:void 0;return a.jsxs("span",{className:b(we.avatar,we[s],r&&we.status,o),role:m,tabIndex:f,onClick:i,onKeyDown:i?_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),i())}:void 0,children:[p?a.jsx("img",{src:e,alt:t??n,className:we.image,onError:()=>l(!0)}):a.jsx("span",{"aria-label":t??n,children:d}),r&&a.jsx("span",{className:b(we.dot,we[r]),"aria-hidden":!0})]})}const Xn="tempest_badge_RsuMz",Yn="tempest_sm_LYsCn",Zn="tempest_md_4Or8q",es="tempest_lg_Bseje",ts="tempest_square_l63D-",ns="tempest_neutral_lulSm",ss="tempest_solid_0Leug",rs="tempest_outline_x06HL",os="tempest_success_u9JiS",as="tempest_warning_nsGp-",is="tempest_danger_PD2hz",cs="tempest_info_na6DQ",ls="tempest_primary_S0WCS",us="tempest_dot_i0c-G",me={badge:Xn,sm:Yn,md:Zn,lg:es,square:ts,neutral:ns,solid:ss,outline:rs,success:os,warning:as,danger:is,info:cs,primary:ls,dot:us};function ds({variant:e="neutral",appearance:t="soft",size:n="md",shape:s="pill",dot:r=!1,className:o,children:i,...c}){return a.jsxs("span",{className:b(me.badge,me[e],t==="solid"&&me.solid,t==="outline"&&me.outline,me[n],s==="square"&&me.square,o),...c,children:[r&&a.jsx("span",{className:me.dot,"aria-hidden":!0}),i]})}const ps="tempest_banner_oyoWE",ms="tempest_info_s2q0P",fs="tempest_success_uLYQ3",hs="tempest_warning_9rua8",_s="tempest_danger_Uzb-6",gs="tempest_icon_vzKmx",bs="tempest_body_-Qm4K",ys="tempest_title_AeTHT",vs="tempest_description_nbyf-",ws="tempest_action_47P8e",xs="tempest_close_Iy2oN",ce={banner:ps,info:ms,success:fs,warning:hs,danger:_s,icon:gs,body:bs,title:ys,description:vs,action:ws,close:xs};function js({variant:e="info",icon:t,title:n,action:s,dismissible:r=!1,onDismiss:o,className:i,children:c,...l}){const[d,p]=u.useState(!0);return d?a.jsxs("div",{className:b(ce.banner,ce[e],i),role:"status",...l,children:[t&&a.jsx("span",{className:ce.icon,children:t}),a.jsxs("div",{className:ce.body,children:[n&&a.jsx("p",{className:ce.title,children:n}),c&&a.jsx("p",{className:ce.description,children:c})]}),s&&a.jsx("div",{className:ce.action,children:s}),r&&a.jsx("button",{type:"button",className:ce.close,"aria-label":"Fechar",onClick:()=>{p(!1),o?.()},children:"×"})]}):null}const $s="tempest_bar_kp35Q",Ns="tempest_item_XfDIW",ks="tempest_active_sK54f",Ss="tempest_iconWrap_yJ20b",Es="tempest_icon_TAjtI",Cs="tempest_badge_-c3Do",Ts="tempest_label_qJj3L",fe={bar:$s,item:Ns,active:ks,iconWrap:Ss,icon:Es,badge:Cs,label:Ts};function Ls({items:e,value:t,onChange:n,showLabels:s=!0,className:r,...o}){return a.jsx("nav",{className:b(fe.bar,r),"aria-label":"Navegação principal",...o,children:e.map(i=>{const c=i.key===t;return a.jsxs("button",{type:"button",className:b(fe.item,c&&fe.active),"aria-current":c?"page":void 0,disabled:i.disabled,onClick:()=>n(i.key),children:[a.jsxs("span",{className:fe.iconWrap,children:[i.icon&&a.jsx("span",{className:fe.icon,children:i.icon}),i.badge!==void 0&&a.jsx("span",{className:fe.badge,children:i.badge})]}),s&&a.jsx("span",{className:fe.label,children:i.label})]},i.key)})})}const Is="tempest_root_qXce2",Rs="tempest_backdrop_WLqh0",Ms="tempest_sheet_Okz1P",As="tempest_handle_GWCoK",Ps="tempest_handleBar_XPPiI",Ds="tempest_title_i5Vuc",Fs="tempest_body_bgDhJ",he={root:Is,backdrop:Rs,sheet:Ms,handle:As,handleBar:Ps,title:Ds,body:Fs};function Bs({open:e,onClose:t,title:n,showHandle:s=!0,dismissOnBackdrop:r=!0,dismissOnEsc:o=!0,className:i,children:c,...l}){return u.useEffect(()=>{if(!e||!o)return;const d=p=>{p.key==="Escape"&&t()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,o,t]),u.useEffect(()=>{if(!e)return;const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[e]),!e||typeof document>"u"?null:Fe.createPortal(a.jsxs("div",{className:he.root,role:"dialog","aria-modal":"true",children:[a.jsx("div",{className:he.backdrop,onClick:()=>r&&t(),"aria-hidden":"true"}),a.jsxs("div",{className:b(he.sheet,i),...l,children:[s&&a.jsx("button",{type:"button",className:he.handle,"aria-label":"Arrastar para fechar",onClick:t,children:a.jsx("span",{className:he.handleBar})}),n&&a.jsx("div",{className:he.title,children:n}),a.jsx("div",{className:he.body,children:c})]})]}),document.body)}const Ws="tempest_nav_H4g6P",Os="tempest_item_O4g3P",zs="tempest_link_7WM67",Us="tempest_current_JdlcS",qs="tempest_separator_zGWyJ",ke={nav:Ws,item:Os,link:zs,current:Us,separator:qs};function Hs({items:e,separator:t="/",className:n}){return a.jsx("nav",{"aria-label":"breadcrumb",className:b(ke.nav,n),children:e.map((s,r)=>{const o=r===e.length-1,i=!o&&(s.href||s.onClick);return a.jsxs(u.Fragment,{children:[a.jsx("span",{className:ke.item,children:i?a.jsx("a",{href:s.href,onClick:c=>{s.onClick&&(c.preventDefault(),s.onClick())},className:ke.link,children:s.label}):a.jsx("span",{"aria-current":o?"page":void 0,className:o?ke.current:void 0,children:s.label})}),!o&&a.jsx("span",{className:ke.separator,"aria-hidden":!0,children:t})]},r)})})}const Gs="tempest_button_2ZuB7",Ks="tempest_primary_s1sM6",Js="tempest_secondary_R0waJ",Vs="tempest_danger_V4fX8",Qs="tempest_success_w6qB6",Xs="tempest_ghost_1KINV",Ys="tempest_soft_c3kzm",Zs="tempest_outline_F5jq-",er="tempest_link_Zt5hw",tr="tempest_xs_cF6m0",nr="tempest_sm_NhG0g",sr="tempest_md_hH4h3",rr="tempest_lg_2plQf",or="tempest_xl_nx4V0",ar="tempest_iconOnly_WCpTS",ir="tempest_pill_lx8lt",cr="tempest_fullWidth_36oJT",lr="tempest_loading_EQAt2",ur="tempest_hiddenText_hIiJ2",dr="tempest_spinner_ZExvW",pr="tempest_tempest-spin_UOSVC",ne={button:Gs,primary:Ks,secondary:Js,danger:Vs,success:Qs,ghost:Xs,soft:Ys,outline:Zs,link:er,xs:tr,sm:nr,md:sr,lg:rr,xl:or,iconOnly:ar,pill:ir,fullWidth:cr,loading:lr,hiddenText:ur,spinner:dr,tempestSpin:pr};function Pe({variant:e="primary",size:t="md",loading:n=!1,fullWidth:s=!1,iconOnly:r=!1,pill:o=!1,leftIcon:i,rightIcon:c,disabled:l,className:d,children:p,...m}){return a.jsxs("button",{className:b(ne.button,ne[e],ne[t],r&&ne.iconOnly,o&&ne.pill,n&&ne.loading,s&&ne.fullWidth,d),disabled:l||n,...m,children:[n&&a.jsx("span",{className:ne.spinner,"aria-hidden":!0,children:a.jsx(mr,{})}),a.jsxs("span",{className:b(n&&ne.hiddenText),children:[i,p,c]})]})}function mr(){return a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const fr="tempest_card_Cb1o4",hr="tempest_flat_LRpce",_r="tempest_raised_WmIqk",gr="tempest_elevated_5VEDw",br="tempest_interactive_B8Tah",yr="tempest_padded_oOxwN",vr="tempest_flush_aiDZi",wr="tempest_header_PTXf2",xr="tempest_title_mSgoo",jr="tempest_body_W441Z",$r="tempest_footer_Mu-JC",H={card:fr,flat:hr,raised:_r,elevated:gr,interactive:br,padded:yr,flush:vr,header:wr,title:xr,body:jr,footer:$r};function Nr({title:e,actions:t,footer:n,flush:s=!1,interactive:r=!1,elevation:o="default",className:i,children:c,...l}){const d=!!(e||t);return a.jsxs("div",{className:b(H.card,o==="flat"&&H.flat,o==="raised"&&H.raised,o==="elevated"&&H.elevated,r&&H.interactive,!d&&!s&&H.padded,s&&H.flush,i),tabIndex:r?l.tabIndex??0:l.tabIndex,...l,children:[d&&a.jsxs("header",{className:H.header,children:[typeof e=="string"?a.jsx("h3",{className:H.title,children:e}):e,t]}),d?a.jsx("div",{className:H.body,children:c}):c,n&&a.jsx("footer",{className:H.footer,children:n})]})}const kr="tempest_center_Pu1Pf",Sr="tempest_both_53GWn",Er="tempest_horizontal_94-Bt",Cr="tempest_vertical_Q7Kyg",it={center:kr,both:Sr,horizontal:Er,vertical:Cr};function Tr({axis:e="both",minHeight:t,fullWidth:n=!0,className:s,style:r,children:o,...i}){const c={...t!==void 0?{minHeight:typeof t=="number"?`${t}px`:t}:null,...n?{width:"100%"}:null,...r};return a.jsx("div",{className:b(it.center,it[e],s),style:c,...i,children:o})}const Lr="tempest_wrapper_rpthW",Ir="tempest_disabled_x7-eg",Rr="tempest_input_2kt-h",Mr="tempest_box_OCPee",Ar="tempest_labelWrap_Ktbp0",Pr="tempest_label_cwRtI",Dr="tempest_description_rMhG1",_e={wrapper:Lr,disabled:Ir,input:Rr,box:Mr,labelWrap:Ar,label:Pr,description:Dr},Fr=u.forwardRef(function({label:t,description:n,indeterminate:s,disabled:r,wrapperClassName:o,className:i,...c},l){const d=u.useRef(null);u.useEffect(()=>{d.current&&(d.current.indeterminate=!!s)},[s]);function p(m){d.current=m,typeof l=="function"?l(m):l&&(l.current=m)}return a.jsxs("label",{className:b(_e.wrapper,r&&_e.disabled,o),children:[a.jsx("input",{ref:p,type:"checkbox",disabled:r,className:b(_e.input,i),...c}),a.jsx("span",{className:_e.box,"aria-hidden":!0,children:s?a.jsx(Wr,{}):a.jsx(Br,{})}),(t||n)&&a.jsxs("span",{className:_e.labelWrap,children:[t&&a.jsx("span",{className:_e.label,children:t}),n&&a.jsx("span",{className:_e.description,children:n})]})]})});function Br(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M5 12l5 5L20 7",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wr(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M5 12h14",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})}const Or="tempest_wrapper_KR4-F",zr="tempest_label_Mz-wX",Ur="tempest_field_iIBJw",qr="tempest_error_O9n-9",Hr="tempest_chip_GEwrc",Gr="tempest_remove_JYDIq",Kr="tempest_input_frJmk",Jr="tempest_helper_Yts53",Vr="tempest_errorText_llJGq",se={wrapper:Or,label:zr,field:Ur,error:qr,chip:Hr,remove:Gr,input:Kr,helper:Jr,errorText:Vr};function Qr({value:e,onChange:t,label:n,placeholder:s="Adicionar e pressionar Enter…",helperText:r,error:o,commitKeys:i=["Enter",",","Tab"],normalize:c=!0,className:l}){const[d,p]=u.useState(""),m=u.useRef(null);function f(){const g=c?d.trim().toLowerCase():d.trim();if(g){if(e.includes(g)){p("");return}t([...e,g]),p("")}}function _(g){if(i.includes(g.key)){g.preventDefault(),f();return}g.key==="Backspace"&&!d&&e.length>0&&t(e.slice(0,-1))}function h(g){const y=e.slice();y.splice(g,1),t(y)}return a.jsxs("div",{className:b(se.wrapper,o&&se.error,l),children:[n&&a.jsx("label",{className:se.label,children:n}),a.jsxs("div",{className:se.field,onClick:()=>m.current?.focus(),children:[e.map((g,y)=>a.jsxs("span",{className:se.chip,children:[g,a.jsx("button",{type:"button",className:se.remove,"aria-label":`Remover ${g}`,onClick:()=>h(y),children:"×"})]},`${g}-${y}`)),a.jsx("input",{ref:m,className:se.input,value:d,placeholder:e.length===0?s:"",onChange:g=>p(g.target.value),onKeyDown:_,onBlur:f})]}),o?a.jsx("span",{className:se.errorText,children:o}):r?a.jsx("span",{className:se.helper,children:r}):null]})}const Xr="tempest_wrapper_TNvle",Yr="tempest_label_KVkZO",Zr="tempest_field_BenH0",eo="tempest_input_-HTv1",to="tempest_caret_jRplQ",no="tempest_menu_zPQG3",so="tempest_option_vhhn5",ro="tempest_active_XCgtX",oo="tempest_selected_T6nm2",ao="tempest_empty_Ahw5K",io="tempest_helper_OzB7V",co="tempest_errorText_X18sQ",lo="tempest_error_bnVuM",M={wrapper:Xr,label:Yr,field:Zr,input:eo,caret:to,menu:no,option:so,active:ro,selected:oo,empty:ao,helper:io,errorText:co,error:lo};function uo(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function po({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:o,error:i,disabled:c,filter:l=uo,emptyMessage:d="Nenhuma opção encontrada",className:p}){const m=u.useId(),f=u.useRef(null),_=u.useRef(null),[h,g]=u.useState(!1),[y,v]=u.useState(""),[w,x]=u.useState(0),N=u.useMemo(()=>e.find(j=>j.value===t)?.label??"",[e,t]),S=u.useMemo(()=>e.filter(j=>l(j,y)),[e,l,y]),z=u.useCallback(()=>{g(!1),v(""),x(0)},[]),U=u.useCallback(j=>{j.disabled||(n(j.value),z())},[n,z]);u.useEffect(()=>{if(!h)return;const j=E=>{f.current&&!f.current.contains(E.target)&&z()};return window.addEventListener("mousedown",j),()=>window.removeEventListener("mousedown",j)},[h,z]);const k=j=>{if(j.key==="ArrowDown")j.preventDefault(),g(!0),x(E=>Math.min(S.length-1,E+1));else if(j.key==="ArrowUp")j.preventDefault(),x(E=>Math.max(0,E-1));else if(j.key==="Enter"){j.preventDefault();const E=S[w];E&&U(E)}else j.key==="Escape"&&z()};return a.jsxs("div",{ref:f,className:b(M.wrapper,i&&M.error,p),children:[s&&a.jsx("label",{htmlFor:m,className:M.label,children:s}),a.jsxs("div",{className:M.field,children:[a.jsx("input",{id:m,ref:_,type:"text",role:"combobox","aria-expanded":h,"aria-controls":`${m}-listbox`,"aria-autocomplete":"list",className:M.input,placeholder:r,disabled:c,value:h?y:N,onFocus:()=>g(!0),onChange:j=>{v(j.target.value),g(!0),x(0)},onKeyDown:k}),a.jsx("span",{className:M.caret,"aria-hidden":!0,children:"▾"})]}),h&&a.jsx("ul",{id:`${m}-listbox`,role:"listbox",className:M.menu,children:S.length===0?a.jsx("li",{className:M.empty,children:d}):S.map((j,E)=>a.jsx("li",{role:"option","aria-selected":j.value===t,className:b(M.option,E===w&&M.active,j.value===t&&M.selected),onMouseEnter:()=>x(E),onMouseDown:ee=>{ee.preventDefault(),U(j)},children:j.label},j.value))}),i?a.jsx("span",{className:M.errorText,children:i}):o?a.jsx("span",{className:M.helper,children:o}):null]})}const mo="tempest_overlay_dd9h1",fo="tempest_tempest-fade-in_DvgSp",ho="tempest_dialog_ptM-K",_o="tempest_tempest-modal-in_UoxQC",go="tempest_sm_K5k3W",bo="tempest_md_gvyR7",yo="tempest_lg_BgB1a",vo="tempest_xl_MR-68",wo="tempest_size2xl_-PH9e",xo="tempest_size3xl_iqDwN",jo="tempest_fullscreen_o84Xi",$o="tempest_fullscreenOnMobile_0bDwe",No="tempest_body_lVhql",ko="tempest_header_ILG9i",So="tempest_footer_rro2w",Eo="tempest_title_A5OeE",Co="tempest_close_-ER1C",B={overlay:mo,tempestFadeIn:fo,dialog:ho,tempestModalIn:_o,sm:go,md:bo,lg:yo,xl:vo,size2Xl:wo,size3Xl:xo,fullscreen:jo,fullscreenOnMobile:$o,body:No,header:ko,footer:So,title:Eo,close:Co};function wt({open:e,onClose:t,title:n,children:s,footer:r,size:o="md",closeOnBackdrop:i=!0,closeOnEsc:c=!0,className:l,hideCloseButton:d=!1,fullscreen:p=!1,fullscreenOnMobile:m=!1}){return u.useEffect(()=>{if(!e)return;const f=document.body.style.overflow;document.body.style.overflow="hidden";const _=h=>{c&&h.key==="Escape"&&t()};return window.addEventListener("keydown",_),()=>{document.body.style.overflow=f,window.removeEventListener("keydown",_)}},[e,c,t]),!e||typeof document>"u"?null:Fe.createPortal(a.jsx("div",{className:B.overlay,role:"presentation",onClick:()=>{i&&t()},children:a.jsxs("div",{role:"dialog","aria-modal":"true",className:b(B.dialog,To(o),p&&B.fullscreen,m&&B.fullscreenOnMobile,l),onClick:f=>f.stopPropagation(),children:[(n||!d)&&a.jsxs("header",{className:B.header,children:[a.jsx("h3",{className:B.title,children:n}),!d&&a.jsx("button",{type:"button",className:B.close,"aria-label":"Fechar",onClick:t,children:a.jsx(Lo,{})})]}),a.jsx("div",{className:B.body,children:s}),r&&a.jsx("footer",{className:B.footer,children:r})]})}),document.body)}function To(e){return e==="2xl"?B.size2xl:e==="3xl"?B.size3xl:B[e]}function Lo(){return a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Io({open:e,title:t,description:n,confirmLabel:s="Confirmar",cancelLabel:r="Cancelar",variant:o="primary",loading:i=!1,onConfirm:c,onCancel:l}){return a.jsx(wt,{open:e,onClose:l,title:t,size:"sm",footer:a.jsxs(a.Fragment,{children:[a.jsx(Pe,{variant:"secondary",onClick:l,disabled:i,children:r}),a.jsx(Pe,{variant:o,loading:i,onClick:()=>{c()},children:s})]}),children:n})}const Ro="tempest_wrapper_iHNUs",Mo="tempest_label_-OEBL",Ao="tempest_required_CTss-",Po="tempest_field_65yGJ",Do="tempest_input_WjT81",Fo="tempest_sizeSm_cgds6",Bo="tempest_sizeMd_EPFGy",Wo="tempest_sizeLg_5Cq8k",Oo="tempest_hasLeftIcon_xYO-v",zo="tempest_hasRightIcon_C7uyr",Uo="tempest_iconLeft_KrUhI",qo="tempest_iconRight_Ssr47",Ho="tempest_error_VLISa",Go="tempest_helper_7Vc-s",Ko="tempest_errorText_xz4xS",I={wrapper:Ro,label:Mo,required:Ao,field:Po,input:Do,sizeSm:Fo,sizeMd:Bo,sizeLg:Wo,hasLeftIcon:Oo,hasRightIcon:zo,iconLeft:Uo,iconRight:qo,error:Ho,helper:Go,errorText:Ko},Be=u.forwardRef(function({label:t,helperText:n,error:s,leftIcon:r,rightIcon:o,wrapperClassName:i,className:c,id:l,required:d,size:p="md",...m},f){const _=u.useId(),h=l??_,g=s?`${h}-error`:n?`${h}-helper`:void 0,y=p==="sm"?I.sizeSm:p==="lg"?I.sizeLg:I.sizeMd;return a.jsxs("div",{className:b(I.wrapper,s&&I.error,i),children:[t&&a.jsxs("label",{htmlFor:h,className:I.label,children:[t,d&&a.jsx("span",{className:I.required,children:"*"})]}),a.jsxs("div",{className:I.field,children:[r&&a.jsx("span",{className:I.iconLeft,children:r}),a.jsx("input",{ref:f,id:h,"aria-invalid":!!s,"aria-describedby":g,required:d,className:b(I.input,y,r&&I.hasLeftIcon,o&&I.hasRightIcon,c),...m}),o&&a.jsx("span",{className:I.iconRight,children:o})]}),s?a.jsx("span",{id:`${h}-error`,className:I.errorText,children:s}):n?a.jsx("span",{id:`${h}-helper`,className:I.helper,children:n}):null]})}),Jo=u.forwardRef(function({value:t,onChange:n,mode:s="date",...r},o){return a.jsx(Be,{...r,ref:o,type:s,value:t,onChange:i=>n(i.target.value)})}),Vo="tempest_divider_KSGsi",Qo="tempest_horizontal_pZ05Y",Xo="tempest_bare_elDbS",Yo="tempest_vertical_p-jD4",Zo="tempest_dashed_JWxCU",ea="tempest_alignStart_QAIi1",ta="tempest_alignEnd_eZDwa",D={divider:Vo,horizontal:Qo,bare:Xo,vertical:Yo,dashed:Zo,alignStart:ea,alignEnd:ta};function na({orientation:e="horizontal",variant:t="solid",label:n,align:s="center",className:r,...o}){return e==="vertical"?a.jsx("span",{role:"separator","aria-orientation":"vertical",className:b(D.divider,D.vertical,t==="dashed"&&D.dashed,r),...o}):n?a.jsx("div",{role:"separator","aria-orientation":"horizontal",className:b(D.divider,D.horizontal,t==="dashed"&&D.dashed,s==="start"&&D.alignStart,s==="end"&&D.alignEnd,r),...o,children:n}):a.jsx("hr",{className:b(D.divider,D.horizontal,D.bare,t==="dashed"&&D.dashed,r)})}const sa="tempest_overlay_hcG1G",ra="tempest_tempest-drawer-overlay_XFbxY",oa="tempest_panel_wUX0N",aa="tempest_right_-oX-6",ia="tempest_tempest-drawer-in-right_pWYHv",ca="tempest_left_xi3nD",la="tempest_tempest-drawer-in-left_o7JSb",ua="tempest_top_7rGCn",da="tempest_tempest-drawer-in-top_kn6AF",pa="tempest_bottom_zd-25",ma="tempest_tempest-drawer-in-bottom_0x3u7",fa="tempest_handle_5B-TB",ha="tempest_handleTop_7aMf-",_a="tempest_header_sYoP1",ga="tempest_title_LqUOu",ba="tempest_close_tYPhU",ya="tempest_body_aV9FG",va="tempest_footer_AuvUP",X={overlay:sa,tempestDrawerOverlay:ra,panel:oa,right:aa,tempestDrawerInRight:ia,left:ca,tempestDrawerInLeft:la,top:ua,tempestDrawerInTop:da,bottom:pa,tempestDrawerInBottom:ma,handle:fa,handleTop:ha,header:_a,title:ga,close:ba,body:ya,footer:va};function wa({open:e,onClose:t,placement:n="right",title:s,children:r,footer:o,closeOnBackdrop:i=!0,closeOnEsc:c=!0,hideCloseButton:l=!1,className:d,mobilePlacement:p,showHandle:m=!1}){const{isMobile:f}=ve(),_=f&&p?p:n;return u.useEffect(()=>{if(!e)return;const h=document.body.style.overflow;document.body.style.overflow="hidden";const g=y=>{c&&y.key==="Escape"&&t()};return window.addEventListener("keydown",g),()=>{document.body.style.overflow=h,window.removeEventListener("keydown",g)}},[e,c,t]),!e||typeof document>"u"?null:Fe.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{className:X.overlay,onClick:()=>{i&&t()}}),a.jsxs("aside",{role:"dialog","aria-modal":"true",className:b(X.panel,X[_],d),children:[m&&(_==="bottom"||_==="top")&&a.jsx("div",{className:b(X.handle,_==="top"&&X.handleTop),"aria-hidden":!0}),(s||!l)&&a.jsxs("header",{className:X.header,children:[a.jsx("h3",{className:X.title,children:s}),!l&&a.jsx("button",{type:"button","aria-label":"Fechar",className:X.close,onClick:t,children:a.jsx(xa,{})})]}),a.jsx("div",{className:X.body,children:r}),o&&a.jsx("footer",{className:X.footer,children:o})]})]}),document.body)}function xa(){return a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const ja="tempest_root_5ZetV",$a="tempest_menu_-RiRW",Na="tempest_bottomStart_z60h9",ka="tempest_bottomEnd_b1tmU",Sa="tempest_topStart_A0em2",Ea="tempest_topEnd_cFA5-",Ca="tempest_item_T-QPZ",Ta="tempest_active_WNqoX",La="tempest_danger_C0jN3",Ia="tempest_separator_RimQa",Ra="tempest_label_6yP76",V={root:ja,menu:$a,bottomStart:Na,bottomEnd:ka,topStart:Sa,topEnd:Ea,item:Ca,active:Ta,danger:La,separator:Ia,label:Ra};function Ma(e){switch(e){case"bottom-end":return V.bottomEnd;case"top-start":return V.topStart;case"top-end":return V.topEnd;default:return V.bottomStart}}function Aa({trigger:e,items:t,placement:n="bottom-start",className:s}){const[r,o]=u.useState(!1),[i,c]=u.useState(-1),l=u.useId(),d=u.useRef(null),p=u.useRef([]),m=t.map((y,v)=>y.type==="item"&&!y.disabled?v:-1).filter(y=>y!==-1),f=u.useCallback(()=>{o(!1),c(-1)},[]);u.useEffect(()=>{if(!r)return;const y=w=>{if(w.key==="Escape"){f();return}if(w.key==="ArrowDown"){w.preventDefault();const x=m.indexOf(i),N=m[(x+1)%m.length]??-1;c(N),p.current[N]?.focus()}if(w.key==="ArrowUp"){w.preventDefault();const x=m.indexOf(i),N=m[(x-1+m.length)%m.length]??-1;c(N),p.current[N]?.focus()}},v=w=>{d.current&&!d.current.contains(w.target)&&f()};return window.addEventListener("keydown",y),window.addEventListener("mousedown",v),()=>{window.removeEventListener("keydown",y),window.removeEventListener("mousedown",v)}},[r,i,m,f]);const _=y=>{e.props.onClick?.(y),o(v=>!v)},h={...e,props:{...e.props,onClick:_,"aria-expanded":r,"aria-controls":l,"aria-haspopup":"menu"}},g=y=>{y.onSelect(),f()};return a.jsxs("span",{ref:d,className:V.root,children:[h,r&&a.jsx("ul",{id:l,role:"menu",className:b(V.menu,Ma(n),s),children:t.map((y,v)=>y.type==="separator"?a.jsx("li",{role:"separator",className:V.separator,"aria-hidden":!0},y.id):y.type==="label"?a.jsx("li",{role:"presentation",className:V.label,children:y.label},y.id):a.jsx("li",{role:"none",children:a.jsxs("button",{ref:w=>{p.current[v]=w},type:"button",role:"menuitem",className:b(V.item,y.danger&&V.danger,i===v&&V.active),disabled:y.disabled,onClick:()=>g(y),onMouseEnter:()=>c(v),children:[y.icon&&a.jsx("span",{"aria-hidden":!0,children:y.icon}),y.label]})},y.id))})]})}const Pa="tempest_wrapper_gzyTd",Da="tempest_icon_qVCyh",Fa="tempest_title_xPfUf",Ba="tempest_description_oWwH1",Wa="tempest_action_dqxw1",Se={wrapper:Pa,icon:Da,title:Fa,description:Ba,action:Wa};function Oa({icon:e,title:t,description:n,action:s,className:r}){return a.jsxs("div",{className:b(Se.wrapper,r),children:[e&&a.jsx("div",{className:Se.icon,children:e}),a.jsx("h4",{className:Se.title,children:t}),n&&a.jsx("p",{className:Se.description,children:n}),s&&a.jsx("div",{className:Se.action,children:s})]})}const za="tempest_wrapper_luRyF",Ua="tempest_icon_dEdBl",qa="tempest_title_StutD",Ha="tempest_description_A2XCb",Ga="tempest_action_vm1LC",Ee={wrapper:za,icon:Ua,title:qa,description:Ha,action:Ga};function Ka({title:e="Algo deu errado",description:t="Não foi possível carregar essas informações.",onRetry:n,retryLabel:s="Tentar novamente",icon:r,className:o}){return a.jsxs("div",{className:b(Ee.wrapper,o),children:[a.jsx("div",{className:Ee.icon,children:r??a.jsx(Ja,{})}),a.jsx("h4",{className:Ee.title,children:e}),t&&a.jsx("p",{className:Ee.description,children:t}),n&&a.jsx("div",{className:Ee.action,children:a.jsx(Pe,{variant:"secondary",onClick:n,children:s})})]})}function Ja(){return a.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Va="tempest_wrapper_E0qHs",Qa="tempest_label_lbMkx",Xa="tempest_dropzone_jqua0",Ya="tempest_active_CG9Uk",Za="tempest_disabled_WNUUl",ei="tempest_icon_i9fGH",ti="tempest_title_bTVFl",ni="tempest_subtitle_S54OV",si="tempest_files_WljYm",ri="tempest_file_Lp-dR",oi="tempest_fileMeta_LTnN2",ai="tempest_remove_jskra",ii="tempest_hidden_ReEq6",A={wrapper:Va,label:Qa,dropzone:Xa,active:Ya,disabled:Za,icon:ei,title:ti,subtitle:ni,files:si,file:ri,fileMeta:oi,remove:ai,hidden:ii};function ci(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function li(e,t){if(!t)return!0;const n=t.split(",").map(o=>o.trim().toLowerCase()),s=e.name.toLowerCase(),r=e.type.toLowerCase();return n.some(o=>o.startsWith(".")?s.endsWith(o):o.endsWith("/*")?r.startsWith(o.replace("/*","/")):r===o)}function ui({value:e,onChange:t,label:n,accept:s,multiple:r=!1,maxSize:o,onReject:i,disabled:c,title:l="Arraste arquivos aqui ou clique para selecionar",subtitle:d,className:p}){const[m,f]=u.useState(!1),_=u.useRef(null);function h(v){const w=[],x=[];for(const S of Array.from(v)){if(!li(S,s)){x.push({file:S,reason:"type"});continue}if(o&&S.size>o){x.push({file:S,reason:"size"});continue}w.push(S)}if(x.length>0&&i?.(x),w.length===0)return;const N=r?[...e,...w]:w.slice(0,1);t(N)}function g(v){v.preventDefault(),f(!1),!c&&v.dataTransfer?.files&&h(v.dataTransfer.files)}function y(v){const w=e.slice();w.splice(v,1),t(w)}return a.jsxs("div",{className:b(A.wrapper,p),children:[n&&a.jsx("label",{className:A.label,children:n}),a.jsxs("div",{className:b(A.dropzone,m&&A.active,c&&A.disabled),role:"button",tabIndex:c?-1:0,onClick:()=>!c&&_.current?.click(),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),_.current?.click())},onDragEnter:v=>{v.preventDefault(),c||f(!0)},onDragOver:v=>v.preventDefault(),onDragLeave:()=>f(!1),onDrop:g,children:[a.jsx("div",{className:A.icon,"aria-hidden":!0,children:a.jsx(di,{})}),a.jsx("p",{className:A.title,children:l}),d&&a.jsx("p",{className:A.subtitle,children:d}),a.jsx("input",{ref:_,type:"file",accept:s,multiple:r,disabled:c,className:A.hidden,onChange:v=>{v.target.files&&h(v.target.files),v.target.value=""}})]}),e.length>0&&a.jsx("ul",{className:A.files,children:e.map((v,w)=>a.jsxs("li",{className:A.file,children:[a.jsxs("div",{children:[a.jsx("div",{children:v.name}),a.jsx("div",{className:A.fileMeta,children:ci(v.size)})]}),a.jsx("button",{type:"button","aria-label":`Remover ${v.name}`,className:A.remove,onClick:()=>y(w),children:"×"})]},`${v.name}-${w}`))})]})}function di(){return a.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4M4 20h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const pi="tempest_form_jNBDR",mi="tempest_stack_O1Hl-",fi="tempest_inline_LBQAv",hi="tempest_grid_-B86T",_i="tempest_section_HGqw3",gi="tempest_sectionHeader_ji9hQ",bi="tempest_sectionTitle_GTPwe",yi="tempest_sectionDescription_KjW7k",vi="tempest_sectionBody_Vp2wz",wi="tempest_row_1EkVR",xi="tempest_actions_hK95I",ji="tempest_start_gXnm3",$i="tempest_center_mKkz4",Ni="tempest_end_O3yDQ",ki="tempest_between_tte2z",Q={form:pi,stack:mi,inline:fi,grid:hi,section:_i,sectionHeader:gi,sectionTitle:bi,sectionDescription:yi,sectionBody:vi,row:wi,actions:xi,start:ji,center:$i,end:Ni,between:ki};function We(e,t){return e===void 0?`${t*4}px`:typeof e=="number"?`${e*4}px`:e}function xt(e){return e===void 0?"repeat(2, minmax(0, 1fr))":typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}const Si=u.forwardRef(function({layout:t="stack",columns:n,gap:s,className:r,style:o,children:i,...c},l){const d={gap:We(s,4),...t==="grid"?{gridTemplateColumns:xt(n)}:null,...o};return a.jsx("form",{ref:l,className:b(Q.form,Q[t],r),style:d,...c,children:i})});function Ei({title:e,description:t,layout:n="stack",columns:s,gap:r,className:o,style:i,children:c,...l}){const d={gap:We(r,4),...n==="grid"?{gridTemplateColumns:xt(s)}:null};return a.jsxs("section",{className:b(Q.section,o),style:i,...l,children:[(e||t)&&a.jsxs("header",{className:Q.sectionHeader,children:[e&&a.jsx("h3",{className:Q.sectionTitle,children:e}),t&&a.jsx("p",{className:Q.sectionDescription,children:t})]}),a.jsx("div",{className:b(Q.sectionBody,Q[n]),style:d,children:c})]})}function Ci({gap:e,className:t,style:n,children:s,...r}){const o={gap:We(e,3),...n};return a.jsx("div",{className:b(Q.row,t),style:o,...r,children:s})}function Ti({align:e="end",gap:t,className:n,style:s,children:r,...o}){const i={gap:We(t,2),...s};return a.jsx("div",{className:b(Q.actions,Q[e],n),style:i,...o,children:r})}const Li="tempest_container_fJfOt",Ii="tempest_sm_k8D4-",Ri="tempest_md_EnpYy",Mi="tempest_lg_UU-Ig",Ai="tempest_xl_2TEWj",Pi="tempest_full_l8bvG",Di="tempest_stack_sxR8u",Fi="tempest_vertical_2TMf5",Bi="tempest_horizontal_r7-c-",Wi="tempest_center_EDSAh",Oi="tempest_start_ucQ-K",zi="tempest_end_pnKlF",Ui="tempest_stretch_pX6l7",qi="tempest_justifyStart_lHYsS",Hi="tempest_justifyCenter_JH2m6",Gi="tempest_justifyEnd_EBisT",Ki="tempest_justifyBetween_mAJwT",Ji="tempest_wrap_-xxOh",Vi="tempest_grid_o-JIX",W={container:Li,sm:Ii,md:Ri,lg:Mi,xl:Ai,full:Pi,stack:Di,vertical:Fi,horizontal:Bi,center:Wi,start:Oi,end:zi,stretch:Ui,justifyStart:qi,justifyCenter:Hi,justifyEnd:Gi,justifyBetween:Ki,wrap:Ji,grid:Vi};function Qi({size:e="lg",className:t,children:n,...s}){return a.jsx("div",{className:b(W.container,W[e],t),...s,children:n})}function Xi(e){return typeof e=="object"&&e!==null&&("mobile"in e||"tablet"in e||"desktop"in e)}function De(e,t){if(e!==void 0)return Xi(e)?t==="desktop"?e.desktop??e.tablet??e.mobile:t==="tablet"?e.tablet??e.mobile??e.desktop:e.mobile??e.tablet??e.desktop:e}function jt(e){if(e!==void 0)return typeof e=="number"?`${e*4}px`:e}function $t(e,t){return e?"mobile":t?"tablet":"desktop"}function Yi({direction:e="vertical",gap:t=2,align:n,justify:s,wrap:r=!1,className:o,style:i,children:c,...l}){const{isMobile:d,isTablet:p}=ve(),m=$t(d,p),f=De(e,m)??"vertical",h={gap:jt(De(t,m)),...i},g=s==="between"?W.justifyBetween:s==="center"?W.justifyCenter:s==="end"?W.justifyEnd:s==="start"?W.justifyStart:void 0;return a.jsx("div",{className:b(W.stack,f==="vertical"?W.vertical:W.horizontal,n&&W[n],g,r&&W.wrap,o),style:h,...l,children:c})}function Zi(e){if(e!==void 0)return typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}function ec({columns:e=2,gap:t=4,className:n,style:s,children:r,...o}){const{isMobile:i,isTablet:c}=ve(),l=$t(i,c),d=Zi(De(e,l)),p=jt(De(t,l));return a.jsx("div",{className:b(W.grid,n),style:{gridTemplateColumns:d,gap:p,...s},...o,children:r})}const tc="tempest_kbd_jgbYx",nc="tempest_sm_9WPWA",sc="tempest_md_BePC0",rc="tempest_lg_cBKum",ct={kbd:tc,sm:nc,md:sc,lg:rc};function oc({size:e="md",className:t,children:n,...s}){return a.jsx("kbd",{className:b(ct.kbd,ct[e],t),...s,children:n})}const ac="tempest_navbar_Ey25T",ic="tempest_surface_xyKhM",cc="tempest_primary_w3ft-",lc="tempest_transparent_N1vMR",uc="tempest_bordered_HD49R",dc="tempest_sticky_0XsOs",pc="tempest_logo_O9j3q",mc="tempest_nav_0oisE",fc="tempest_actions_8BNWJ",ge={navbar:ac,surface:ic,primary:cc,transparent:lc,bordered:uc,sticky:dc,logo:pc,nav:mc,actions:fc};function hc({logo:e,nav:t,actions:n,sticky:s=!0,tone:r="surface",bordered:o=!0,className:i,...c}){return a.jsxs("header",{className:b(ge.navbar,ge[r],s&&ge.sticky,o&&ge.bordered,i),...c,children:[e&&a.jsx("div",{className:ge.logo,children:e}),t&&a.jsx("nav",{className:ge.nav,children:t}),n&&a.jsx("div",{className:ge.actions,children:n})]})}const _c="tempest_page_THNNc",gc="tempest_padded_bzjoF",bc="tempest_header_PZEzk",yc="tempest_headerText_qYXFI",vc="tempest_eyebrow_651RV",wc="tempest_title_2oGnT",xc="tempest_description_YzmWl",jc="tempest_actions_-rB3U",$c="tempest_toolbar_sA7sD",Nc="tempest_content_RCB4b",kc="tempest_footer_540pQ",G={page:_c,padded:gc,header:bc,headerText:yc,eyebrow:vc,title:wc,description:xc,actions:jc,toolbar:$c,content:Nc,footer:kc};function Sc({title:e,eyebrow:t,description:n,actions:s,toolbar:r,footer:o,padded:i=!0,className:c,children:l,...d}){const p=e||t||n||s;return a.jsxs("main",{className:b(G.page,i&&G.padded,c),...d,children:[p&&a.jsxs("header",{className:G.header,children:[a.jsxs("div",{className:G.headerText,children:[t&&a.jsx("div",{className:G.eyebrow,children:t}),e&&a.jsx("h1",{className:G.title,children:e}),n&&a.jsx("p",{className:G.description,children:n})]}),s&&a.jsx("div",{className:G.actions,children:s})]}),r&&a.jsx("div",{className:G.toolbar,children:r}),a.jsx("div",{className:G.content,children:l}),o&&a.jsx("footer",{className:G.footer,children:o})]})}const Ec="tempest_wrapper_cRGQm",Cc="tempest_controls_fdL-y",Tc="tempest_page_WjG0l",Lc="tempest_active_1kqsJ",Ic="tempest_ellipsis_V294k",Rc="tempest_sizeSelect_ZayTo",Mc="tempest_numeric_ztI0I",Ac="tempest_summary_ZTggV",K={wrapper:Ec,controls:Cc,page:Tc,active:Lc,ellipsis:Ic,sizeSelect:Rc,numeric:Mc,summary:Ac};function Pc(e,t,n){const s=n+4;if(t<=s)return Array.from({length:t},(c,l)=>l+1);const r=Math.max(2,e-Math.floor(n/2)),o=Math.min(t-1,r+n-1),i=[1];r>2&&i.push("...");for(let c=r;c<=o;c++)i.push(c);return o<t-1&&i.push("..."),i.push(t),i}function Dc({page:e,totalPages:t,onPageChange:n,pageSize:s,onPageSizeChange:r,pageSizeOptions:o=[10,25,50,100],totalItems:i,siblingCount:c=3,className:l}){const d=u.useMemo(()=>Pc(e,t,c),[e,t,c]);return t<=1&&!r?null:a.jsxs("div",{className:b(K.wrapper,l),children:[a.jsx("div",{className:K.summary,children:typeof i=="number"?`${i} resultado${i===1?"":"s"}`:`Página ${e} de ${t}`}),a.jsxs("div",{className:K.controls,children:[a.jsx("button",{type:"button",className:K.page,onClick:()=>n(Math.max(1,e-1)),disabled:e<=1,"aria-label":"Página anterior",children:"‹"}),d.map((p,m)=>p==="..."?a.jsx("span",{className:b(K.ellipsis,K.numeric),children:"…"},`ellipsis-${m}`):a.jsx("button",{type:"button",className:b(K.page,K.numeric,p===e&&K.active),onClick:()=>n(p),"aria-current":p===e?"page":void 0,children:p},p)),a.jsx("button",{type:"button",className:K.page,onClick:()=>n(Math.min(t,e+1)),disabled:e>=t,"aria-label":"Próxima página",children:"›"}),r&&a.jsx("select",{className:K.sizeSelect,value:s,onChange:p=>r(Number(p.target.value)),"aria-label":"Itens por página",children:o.map(p=>a.jsxs("option",{value:p,children:[p," / página"]},p))})]})]})}const Fc="tempest_wrapper_zEU-L",Bc="tempest_label_ps3gD",Wc="tempest_field_7taZG",Oc="tempest_input_FWEvb",zc="tempest_sm_3-CZz",Uc="tempest_md_ReV0O",qc="tempest_lg_DiTiB",Hc="tempest_toggle_WNeX9",Gc="tempest_error_QdIFf",Kc="tempest_helper_mBUna",Jc="tempest_errorText_73Uvv",Vc="tempest_strength_i6RaQ",Qc="tempest_strengthBar_PAPHR",Xc="tempest_strengthLabel_u9QHS",Yc="tempest_level0_n6tWv",Zc="tempest_level1_FOI93",el="tempest_level2_q5Wii",tl="tempest_level3_BpB53",nl="tempest_level4_vyQ3x",P={wrapper:Fc,label:Bc,field:Wc,input:Oc,sm:zc,md:Uc,lg:qc,toggle:Hc,error:Gc,helper:Kc,errorText:Jc,strength:Vc,strengthBar:Qc,strengthLabel:Xc,level0:Yc,level1:Zc,level2:el,level3:tl,level4:nl},sl=["Muito fraca","Fraca","Razoável","Forte","Excelente"];function Nt(e){if(!e)return 0;let t=0;return e.length>=8&&(t+=1),e.length>=12&&(t+=1),/[a-z]/.test(e)&&/[A-Z]/.test(e)&&(t+=1),/[0-9]/.test(e)&&(t+=1),/[^A-Za-z0-9]/.test(e)&&(t+=1),Math.min(4,t)}const rl=u.forwardRef(function({label:t,helperText:n,error:s,size:r="md",showStrength:o=!1,strength:i,strengthLabels:c=sl,toggleLabels:l={show:"Mostrar senha",hide:"Esconder senha"},className:d,value:p,defaultValue:m,...f},_){const[h,g]=u.useState(!1),y=String(p??m??""),v=i??Nt(y);return a.jsxs("div",{className:b(P.wrapper,P[r],s&&P.error,d),children:[t&&a.jsx("label",{className:P.label,children:t}),a.jsxs("div",{className:P.field,children:[a.jsx("input",{ref:_,...f,value:p,defaultValue:m,type:h?"text":"password","aria-invalid":!!s,className:P.input}),a.jsx("button",{type:"button",className:P.toggle,"aria-label":h?l.hide:l.show,"aria-pressed":h,onClick:()=>g(w=>!w),children:h?"🙈":"👁"})]}),o&&a.jsxs("div",{className:b(P.strength,P[`level${v}`]),"aria-label":c[v],children:[a.jsx("div",{className:P.strengthBar,children:a.jsx("span",{style:{width:`${v/4*100}%`}})}),a.jsx("span",{className:P.strengthLabel,children:c[v]})]}),s?a.jsx("span",{className:P.errorText,children:s}):n?a.jsx("span",{className:P.helper,children:n}):null]})}),ol="tempest_wrapper_3WAh7",al="tempest_label_Hk01i",il="tempest_cells_URO3v",cl="tempest_cell_fxLzs",ll="tempest_sm_SQM-s",ul="tempest_md_aHCGl",dl="tempest_lg_JpI4A",pl="tempest_error_Kou0o",ml="tempest_helper_W04iL",fl="tempest_errorText_h4svq",le={wrapper:ol,label:al,cells:il,cell:cl,sm:ll,md:ul,lg:dl,error:pl,helper:ml,errorText:fl},hl=/[0-9]/,_l=/[A-Za-z0-9]/,gl=u.forwardRef(function({length:t=6,type:n="numeric",size:s="md",value:r,defaultValue:o,onChange:i,onComplete:c,masked:l=!1,label:d,helperText:p,error:m,disabled:f=!1,autoFocus:_=!1,id:h,className:g},y){const v=u.useId(),w=h??v,x=r!==void 0,[N,S]=u.useState(o??""),z=x?r??"":N,U=Array.from({length:t},(C,$)=>z[$]??""),k=u.useRef([]),j=n==="numeric"?hl:_l;u.useEffect(()=>{_&&k.current[0]?.focus()},[_]);const E=C=>{const $=C.slice(0,t);x||S($),i?.($),$.length===t&&c?.($)},ee=C=>{const $=Math.max(0,Math.min(t-1,C));k.current[$]?.focus(),k.current[$]?.select()},T=C=>$=>{const q=$.target.value.slice(-1);if(q&&!j.test(q))return;const rt=U.slice();rt[C]=q,E(rt.join("")),q&&ee(C+1)},R=C=>$=>{if($.key==="Backspace"){if(!U[C]&&C>0){$.preventDefault();const q=U.slice();q[C-1]="",E(q.join("")),ee(C-1)}}else $.key==="ArrowLeft"?($.preventDefault(),ee(C-1)):$.key==="ArrowRight"&&($.preventDefault(),ee(C+1))},ze=C=>{const $=C.clipboardData.getData("text").split("").filter(q=>j.test(q)).join("");$&&(C.preventDefault(),E($),ee(Math.min(t-1,$.length)))};return a.jsxs("div",{ref:y,className:b(le.wrapper,m&&le.error,g),id:w,children:[d&&a.jsx("label",{className:le.label,children:d}),a.jsx("div",{className:b(le.cells,le[s]),role:"group","aria-label":d,children:U.map((C,$)=>a.jsx("input",{ref:q=>{k.current[$]=q},type:l?"password":"text",inputMode:n==="numeric"?"numeric":"text",autoComplete:$===0?"one-time-code":"off",maxLength:1,value:C,disabled:f,className:le.cell,"aria-label":`Dígito ${$+1}`,"aria-invalid":!!m,onChange:T($),onKeyDown:R($),onPaste:ze},$))}),m?a.jsx("span",{className:le.errorText,children:m}):p?a.jsx("span",{className:le.helper,children:p}):null]})}),bl="tempest_root_vEMon",yl="tempest_popover_E9K9X",vl="tempest_tempest-popover-in_W8miP",wl="tempest_top_TYlrh",xl="tempest_bottom_wGs70",jl="tempest_left_h7fCr",$l="tempest_right_--bJW",Ue={root:bl,popover:yl,tempestPopoverIn:vl,top:wl,bottom:xl,left:jl,right:$l};function Nl({trigger:e,children:t,placement:n="bottom",open:s,onOpenChange:r,defaultOpen:o=!1,closeOnEsc:i=!0,closeOnOutsideClick:c=!0,className:l}){const d=s!==void 0,[p,m]=u.useState(o),f=d?s:p,_=u.useId(),h=u.useRef(null),g=u.useCallback(w=>{d||m(w),r?.(w)},[d,r]);u.useEffect(()=>{if(!f)return;const w=N=>{i&&N.key==="Escape"&&g(!1)},x=N=>{c&&h.current&&!h.current.contains(N.target)&&g(!1)};return window.addEventListener("keydown",w),window.addEventListener("mousedown",x),()=>{window.removeEventListener("keydown",w),window.removeEventListener("mousedown",x)}},[f,i,c,g]);const y=w=>{e.props.onClick?.(w),g(!f)},v={...e,props:{...e.props,onClick:y,"aria-expanded":f,"aria-controls":_}};return a.jsxs("span",{ref:h,className:Ue.root,children:[v,f&&a.jsx("div",{id:_,role:"dialog",className:b(Ue.popover,Ue[n],l),children:t})]})}const kl="tempest_wrapper_BQek1",Sl="tempest_bar_uC-0x",El="tempest_fill_vmg7x",Cl="tempest_success_gWJ8U",Tl="tempest_warning_DGkPO",Ll="tempest_danger_gfwHh",Il="tempest_indeterminate_HojUj",Rl="tempest_tempest-progress-loop_0nEdF",Ml="tempest_label_qqHJM",xe={wrapper:kl,bar:Sl,fill:El,success:Cl,warning:Tl,danger:Ll,indeterminate:Il,tempestProgressLoop:Rl,label:Ml};function Al({value:e=0,max:t=100,variant:n="primary",indeterminate:s=!1,showLabel:r=!1,label:o,className:i}){const c=s?0:Math.max(0,Math.min(100,e/t*100));return a.jsxs("div",{className:b(xe.wrapper,i),children:[(r||o)&&a.jsxs("div",{className:xe.label,children:[o&&a.jsx("span",{children:o}),r&&!s&&a.jsxs("span",{children:[Math.round(c),"%"]})]}),a.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":s?void 0:e,className:b(xe.bar,s&&xe.indeterminate),children:a.jsx("div",{className:b(xe.fill,n!=="primary"&&xe[n]),style:{width:s?void 0:`${c}%`}})})]})}const Pl="tempest_wrapper_P-gFm",Dl="tempest_disabled_0-cna",Fl="tempest_input_7R8ZN",Bl="tempest_dot_P7ejP",Wl="tempest_labelWrap_iQ1HR",Ol="tempest_label_vAFIP",zl="tempest_description_bEB8u",Ul="tempest_group_oi329",ql="tempest_horizontal_1Ovgu",ie={wrapper:Pl,disabled:Dl,input:Fl,dot:Bl,labelWrap:Wl,label:Ol,description:zl,group:Ul,horizontal:ql},kt=u.createContext(null),Hl=u.forwardRef(function({label:t,description:n,value:s,disabled:r,name:o,checked:i,onChange:c,wrapperClassName:l,className:d,...p},m){const f=u.useContext(kt),_=f?.name??o,h=f?.disabled??r,g=f?f.value===s:i;function y(v){f&&f.onChange?.(s),c?.(v)}return a.jsxs("label",{className:b(ie.wrapper,h&&ie.disabled,l),children:[a.jsx("input",{ref:m,type:"radio",name:_,value:s,checked:g,disabled:h,onChange:y,className:b(ie.input,d),...p}),a.jsx("span",{className:ie.dot,"aria-hidden":!0}),(t||n)&&a.jsxs("span",{className:ie.labelWrap,children:[t&&a.jsx("span",{className:ie.label,children:t}),n&&a.jsx("span",{className:ie.description,children:n})]})]})});function Gl({value:e,defaultValue:t,onChange:n,name:s,disabled:r,horizontal:o=!1,className:i,children:c}){const l=u.useId(),d=s??l,[p,m]=u.useState(t),f=e!==void 0,_=f?e:p;function h(g){f||m(g),n?.(g)}return a.jsx(kt.Provider,{value:{name:d,value:_,onChange:h,disabled:r},children:a.jsx("div",{role:"radiogroup",className:b(ie.group,o&&ie.horizontal,i),children:c})})}const Kl="tempest_wrapper_o1aOo",Jl="tempest_label_jaBOA",Vl="tempest_value_GKfOu",Ql="tempest_field_YxCzt",Xl="tempest_track_j-2iy",Yl="tempest_fill_1pbqj",Zl="tempest_input_1MASw",eu="tempest_helper_uqxKu",re={wrapper:Kl,label:Jl,value:Vl,field:Ql,track:Xl,fill:Yl,input:Zl,helper:eu};function tu({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:o,helperText:i,disabled:c=!1,formatValue:l,className:d}){const[p,m]=e,f=s-n,_=u.useMemo(()=>(p-n)/f*100,[p,n,f]),h=u.useMemo(()=>(m-n)/f*100,[m,n,f]),g=l?.(e)??`${p} – ${m}`,y=u.useCallback(w=>{const x=Math.min(Number(w.target.value),m);t([x,m])},[m,t]),v=u.useCallback(w=>{const x=Math.max(Number(w.target.value),p);t([p,x])},[p,t]);return a.jsxs("div",{className:b(re.wrapper,d),children:[o&&a.jsxs("div",{className:re.label,children:[a.jsx("span",{children:o}),a.jsx("span",{className:re.value,children:g})]}),a.jsxs("div",{className:re.field,children:[a.jsx("div",{className:re.track}),a.jsx("div",{className:re.fill,style:{left:`${_}%`,right:`${100-h}%`}}),a.jsx("input",{type:"range",className:re.input,min:n,max:s,step:r,value:p,onChange:y,disabled:c,"aria-label":o?`${o} (mínimo)`:"Mínimo"}),a.jsx("input",{type:"range",className:re.input,min:n,max:s,step:r,value:m,onChange:v,disabled:c,"aria-label":o?`${o} (máximo)`:"Máximo"})]}),i&&a.jsx("span",{className:re.helper,children:i})]})}const nu="tempest_wrapper_K9Mqa",su="tempest_star_goIGS",ru="tempest_filled_mMs-d",ou="tempest_disabled_tyUlQ",au="tempest_readonly_bnKLN",iu="tempest_sm_K7-y9",cu="tempest_md_ex2Tb",lu="tempest_lg_TstLJ",je={wrapper:nu,star:su,filled:ru,disabled:ou,readonly:au,sm:iu,md:cu,lg:lu};function uu({value:e,max:t=5,onChange:n,size:s="md",readonly:r=!1,disabled:o=!1,label:i="Avaliação",className:c}){const[l,d]=u.useState(0),p=l>0?l:e,m=f=>{r||o||n?.(f)};return a.jsx("span",{role:"radiogroup","aria-label":i,className:b(je.wrapper,je[s],o&&je.disabled,r&&je.readonly,c),onMouseLeave:()=>d(0),children:Array.from({length:t},(f,_)=>{const h=_+1,g=h<=p;return a.jsx("button",{type:"button",role:"radio","aria-checked":e===h,"aria-label":`${h} ${h===1?"estrela":"estrelas"}`,className:b(je.star,g&&je.filled),disabled:o,onMouseEnter:()=>!r&&!o&&d(h),onClick:()=>m(h),children:a.jsx(du,{filled:g})},h)})})}function du({filled:e}){return a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round","aria-hidden":!0,children:a.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14 2 9.27l6.91-1.01L12 2z"})})}function St(e,t,n,s,r){return s?(Array.isArray(s)?s:[s]).includes(e):!(t&&!r.above(t)||n&&!r.below(n))}function pu({above:e,below:t,only:n,children:s}){const r=ve();return St(r.current,e,t,n,r)?s:null}function mu({above:e,below:t,only:n,children:s}){const r=ve();return St(r.current,e,t,n,r)?null:s}const fu="tempest_safe_iqDFY",hu="tempest_inline_V9eMG",_u="tempest_top_Xse9E",gu="tempest_right_GZm9b",bu="tempest_bottom_kkyD7",yu="tempest_left_Z4Q72",$e={safe:fu,inline:hu,top:_u,right:gu,bottom:bu,left:yu},vu=["top","right","bottom","left"];function wu({edges:e=vu,inline:t=!1,className:n,children:s,...r}){return a.jsx("div",{className:b($e.safe,t&&$e.inline,e.includes("top")&&$e.top,e.includes("right")&&$e.right,e.includes("bottom")&&$e.bottom,e.includes("left")&&$e.left,n),"data-edges":e.join(" "),...r,children:s})}const xu="tempest_wrapper_dKXJJ",ju="tempest_input_m0lPc",$u="tempest_iconLeft_030-U",Nu="tempest_clear_nb6lG",Me={wrapper:xu,input:ju,iconLeft:$u,clear:Nu},ku=u.forwardRef(function({value:t,onChange:n,onClear:s,wrapperClassName:r,placeholder:o="Buscar...",className:i,...c},l){function d(){n(""),s?.()}return a.jsxs("div",{className:b(Me.wrapper,r),children:[a.jsx("span",{className:Me.iconLeft,"aria-hidden":!0,children:a.jsx(Su,{})}),a.jsx("input",{ref:l,type:"search",value:t,onChange:p=>n(p.target.value),placeholder:o,className:b(Me.input,i),...c}),t&&a.jsx("button",{type:"button",className:Me.clear,"aria-label":"Limpar busca",onClick:d,children:a.jsx(Eu,{})})]})});function Su(){return a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),a.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function Eu(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Cu="tempest_group_mYyFC",Tu="tempest_fullWidth_unSMm",Lu="tempest_segment_cu-EL",Iu="tempest_sm_CfD41",Ru="tempest_md_2ixuM",Mu="tempest_lg_2Kt7-",Au="tempest_active_GmyKg",Pu="tempest_icon_9h6GK",Du="tempest_label_mS17q",be={group:Cu,fullWidth:Tu,segment:Lu,sm:Iu,md:Ru,lg:Mu,active:Au,icon:Pu,label:Du};function Fu({options:e,value:t,onChange:n,size:s="md",fullWidth:r=!1,className:o,"aria-label":i,...c}){return a.jsx("div",{role:"radiogroup","aria-label":i,className:b(be.group,be[s],r&&be.fullWidth,o),...c,children:e.map(l=>{const d=l.value===t;return a.jsxs("button",{type:"button",role:"radio","aria-checked":d,disabled:l.disabled,className:b(be.segment,d&&be.active),onClick:()=>n(l.value),children:[l.icon&&a.jsx("span",{className:be.icon,children:l.icon}),a.jsx("span",{className:be.label,children:l.label})]},l.value)})})}const Bu="tempest_wrapper_KS2K3",Wu="tempest_label_Lmgos",Ou="tempest_required_PvDVJ",zu="tempest_field_h-wBy",Uu="tempest_select_cjdcr",qu="tempest_caret_MdCao",Hu="tempest_error_sw9MU",Gu="tempest_helper_frosK",Ku="tempest_errorText_-zd6i",oe={wrapper:Bu,label:Wu,required:Ou,field:zu,select:Uu,caret:qu,error:Hu,helper:Gu,errorText:Ku},Ju=u.forwardRef(function({label:t,helperText:n,error:s,options:r,placeholder:o,wrapperClassName:i,className:c,children:l,id:d,required:p,...m},f){const _=u.useId(),h=d??_;return a.jsxs("div",{className:b(oe.wrapper,s&&oe.error,i),children:[t&&a.jsxs("label",{htmlFor:h,className:oe.label,children:[t,p&&a.jsx("span",{className:oe.required,children:"*"})]}),a.jsxs("div",{className:oe.field,children:[a.jsxs("select",{ref:f,id:h,"aria-invalid":!!s,required:p,className:b(oe.select,c),...m,children:[o&&a.jsx("option",{value:"",disabled:!0,hidden:!0,children:o}),r?.map(g=>a.jsx("option",{value:g.value,disabled:g.disabled,children:g.label},g.value)),l]}),a.jsx("span",{className:oe.caret,"aria-hidden":!0,children:a.jsx(Vu,{})})]}),s?a.jsx("span",{className:oe.errorText,children:s}):n?a.jsx("span",{className:oe.helper,children:n}):null]})});function Vu(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Qu="tempest_sidebar_UB1qz",Xu="tempest_header_zupoS",Yu="tempest_nav_aLYuL",Zu="tempest_item_IAjHb",ed="tempest_collapsed_ZbZYA",td="tempest_active_BgcFy",nd="tempest_icon_UQswn",sd="tempest_label_TPvJ9",rd="tempest_badge_xwEZv",od="tempest_footer_TyRyi",Y={sidebar:Qu,header:Xu,nav:Yu,item:Zu,collapsed:ed,active:td,icon:nd,label:sd,badge:rd,footer:od};function ad({header:e,items:t,value:n,onChange:s,footer:r,collapsed:o=!1,width:i=240,collapsedWidth:c=64,className:l,style:d,...p}){const m=typeof(o?c:i)=="number"?`${o?c:i}px`:o?c:i;return a.jsxs("aside",{className:b(Y.sidebar,o&&Y.collapsed,l),style:{width:m,...d},...p,children:[e&&a.jsx("div",{className:Y.header,children:e}),a.jsx("nav",{className:Y.nav,"aria-label":"Navegação lateral",children:t.map(f=>{const _=f.key===n;return a.jsxs("button",{type:"button",className:b(Y.item,_&&Y.active),"aria-current":_?"page":void 0,disabled:f.disabled,onClick:()=>s?.(f.key),title:o&&typeof f.label=="string"?f.label:void 0,children:[f.icon&&a.jsx("span",{className:Y.icon,children:f.icon}),!o&&a.jsx("span",{className:Y.label,children:f.label}),!o&&f.badge!==void 0&&a.jsx("span",{className:Y.badge,children:f.badge})]},f.key)})}),r&&a.jsx("div",{className:Y.footer,children:r})]})}const id="tempest_skeleton_CB4uF",cd="tempest_text_-A8IF",ld="tempest_circle_DYcl8",qe={skeleton:id,text:cd,circle:ld};function ud({variant:e="rect",width:t,height:n,className:s,style:r}){return a.jsx("span",{"aria-hidden":!0,className:b(qe.skeleton,e==="text"&&qe.text,e==="circle"&&qe.circle,s),style:{width:t,height:n,...r}})}const dd="tempest_spacer_okdOd",pd="tempest_both_85qSF",md="tempest_x_QiU2B",fd="tempest_y_hTtCp",lt={spacer:dd,both:pd,x:md,y:fd};function hd({axis:e="both",className:t,...n}){return a.jsx("div",{className:b(lt.spacer,lt[e],t),...n})}const _d="tempest_spinner_GpFZS",gd="tempest_tempest-spinner_wKVCY",bd="tempest_xs_p8BFI",yd="tempest_sm_3sIoD",vd="tempest_md_M2sPj",wd="tempest_lg_IxTw2",xd="tempest_xl_cgwqq",ut={spinner:_d,tempestSpinner:gd,xs:bd,sm:yd,md:vd,lg:wd,xl:xd};function jd({size:e="md",className:t,label:n="Carregando"}){return a.jsx("span",{role:"status","aria-label":n,className:b(ut.spinner,ut[e],t)})}const $d="tempest_stat_zoo9y",Nd="tempest_header_3UQqq",kd="tempest_icon_zUG3e",Sd="tempest_label_lIH47",Ed="tempest_row_Ifyts",Cd="tempest_value_JBWnr",Td="tempest_delta_mRVrE",Ld="tempest_up_7qgUO",Id="tempest_down_3Rq2Z",Rd="tempest_flat_R5pZT",Md="tempest_hint_YkTF8",J={stat:$d,header:Nd,icon:kd,label:Sd,row:Ed,value:Cd,delta:Td,up:Ld,down:Id,flat:Rd,hint:Md};function Ad(e){if(typeof e!="string")return;const t=e.trim();if(t.startsWith("+"))return"up";if(t.startsWith("-")||t.startsWith("−"))return"down"}function Pd({label:e,value:t,delta:n,trend:s,hint:r,icon:o,className:i,...c}){const l=s??Ad(n);return a.jsxs("div",{className:b(J.stat,i),...c,children:[a.jsxs("div",{className:J.header,children:[o&&a.jsx("span",{className:J.icon,children:o}),a.jsx("span",{className:J.label,children:e})]}),a.jsxs("div",{className:J.row,children:[a.jsx("span",{className:J.value,children:t}),n!==void 0&&a.jsx("span",{className:b(J.delta,l==="up"&&J.up,l==="down"&&J.down,l==="flat"&&J.flat),children:n})]}),r&&a.jsx("p",{className:J.hint,children:r})]})}const Dd="tempest_stepper_w3qjQ",Fd="tempest_vertical_d4mOs",Bd="tempest_step_s2nqL",Wd="tempest_dot_d1bSL",Od="tempest_completed_gcFHM",zd="tempest_active_kL-CH",Ud="tempest_label_8irAI",qd="tempest_connector_lyeWp",ae={stepper:Dd,vertical:Fd,step:Bd,dot:Wd,completed:Od,active:zd,label:Ud,connector:qd};function Hd({steps:e,current:t,orientation:n="horizontal",className:s}){return a.jsx("ol",{className:b(ae.stepper,n==="vertical"&&ae.vertical,s),children:e.map((r,o)=>{const i=o<t,c=o===t;return a.jsxs(u.Fragment,{children:[a.jsxs("li",{className:b(ae.step,i&&ae.completed,c&&ae.active),"aria-current":c?"step":void 0,children:[a.jsx("span",{className:ae.dot,children:i?"✓":o+1}),a.jsx("span",{className:ae.label,children:r.label})]}),o<e.length-1&&a.jsx("span",{className:b(ae.connector,i&&ae.completed),"aria-hidden":!0})]},o)})})}function Ve(e,t,n){if(Number.isNaN(e))return e;if(t>n){const s=t;t=n,n=s}return e<t?t:e>n?n:e}const Gd="tempest_wrapper_JNjXK",Kd="tempest_label_9XKNm",Jd="tempest_row_cOARX",Vd="tempest_sm_RzVSU",Qd="tempest_md_pezRm",Xd="tempest_lg_kYbIN",Yd="tempest_disabled_vqmo2",Zd="tempest_btn_xuHhj",ep="tempest_value_NEatO",ue={wrapper:Gd,label:Kd,row:Jd,sm:Vd,md:Qd,lg:Xd,disabled:Yd,btn:Zd,value:ep},tp=u.forwardRef(function({value:t,onChange:n,min:s=0,max:r=Number.POSITIVE_INFINITY,step:o=1,size:i="md",disabled:c=!1,label:l,format:d,labels:p={decrement:"Diminuir",increment:"Aumentar"},className:m},f){const _=()=>{c||n(Ve(t-o,s,r))},h=()=>{c||n(Ve(t+o,s,r))},g=d?d(t):String(t),y=!c&&t>s,v=!c&&t<r;return a.jsxs("div",{ref:f,className:b(ue.wrapper,m),children:[l&&a.jsx("label",{className:ue.label,children:l}),a.jsxs("div",{className:b(ue.row,ue[i],c&&ue.disabled),children:[a.jsx("button",{type:"button",className:ue.btn,"aria-label":p.decrement,onClick:_,disabled:!y,children:"−"}),a.jsx("span",{className:ue.value,role:"status","aria-live":"polite",children:g}),a.jsx("button",{type:"button",className:ue.btn,"aria-label":p.increment,onClick:h,disabled:!v,children:"+"})]})]})}),np="tempest_wrapper_kudO9",sp="tempest_disabled_2aZ0V",rp="tempest_input_5BPNu",op="tempest_track_7ObdZ",ap="tempest_thumb_-FTeK",ip="tempest_label_LrH7V",Ne={wrapper:np,disabled:sp,input:rp,track:op,thumb:ap,label:ip},cp=u.forwardRef(function({label:t,disabled:n,wrapperClassName:s,className:r,...o},i){return a.jsxs("label",{className:b(Ne.wrapper,n&&Ne.disabled,s),children:[a.jsx("input",{ref:i,type:"checkbox",role:"switch",disabled:n,className:b(Ne.input,r),...o}),a.jsx("span",{className:Ne.track,"aria-hidden":!0,children:a.jsx("span",{className:Ne.thumb})}),t&&a.jsx("span",{className:Ne.label,children:t})]})}),lp="tempest_tag_16VPH",up="tempest_sm_pzyd5",dp="tempest_md_GL6tQ",pp="tempest_lg_8tgXU",mp="tempest_neutral_jAd-x",fp="tempest_primary_AXKlN",hp="tempest_success_56lz4",_p="tempest_warning_UK7SC",gp="tempest_danger_kJ-yx",bp="tempest_info_hmHE-",yp="tempest_label_ZBPfO",vp="tempest_remove_UEwgr",Ce={tag:lp,sm:up,md:dp,lg:pp,neutral:mp,primary:fp,success:hp,warning:_p,danger:gp,info:bp,label:yp,remove:vp};function wp({variant:e="neutral",size:t="md",onRemove:n,removeLabel:s="Remover",className:r,children:o,...i}){return a.jsxs("span",{className:b(Ce.tag,Ce[e],Ce[t],r),...i,children:[a.jsx("span",{className:Ce.label,children:o}),n&&a.jsx("button",{type:"button",className:Ce.remove,"aria-label":s,onClick:n,children:"×"})]})}const xp="tempest_scroll_unrJp",jp="tempest_table_Dkosn",$p="tempest_th_PNuEx",Np="tempest_td_jv9tA",kp="tempest_tr_7UG8J",Sp="tempest_clickable_B6Si-",Ep="tempest_alignRight_9hY0G",Cp="tempest_alignCenter_YiUQy",Tp="tempest_emptyRow_kdMiv",Lp="tempest_priorityTablet_3alUt",Ip="tempest_priorityDesktop_3f8Fq",Rp="tempest_stackable_heix7",Mp="tempest_stackableHead_mKGcA",Ap="tempest_stackableRow_qPNqc",L={scroll:xp,table:jp,th:$p,td:Np,tr:kp,clickable:Sp,alignRight:Ep,alignCenter:Cp,emptyRow:Tp,priorityTablet:Lp,priorityDesktop:Ip,stackable:Rp,stackableHead:Mp,stackableRow:Ap};function dt(e){if(e==="tablet")return L.priorityTablet;if(e==="desktop")return L.priorityDesktop}function Pp({columns:e,data:t,rowKey:n,onRowClick:s,emptyMessage:r="Nenhum registro encontrado.",className:o,stackOnMobile:i=!1}){return a.jsx("div",{className:b(L.scroll,i&&L.stackable,o),children:a.jsxs("table",{className:L.table,children:[a.jsx("thead",{className:b(i&&L.stackableHead),children:a.jsx("tr",{children:e.map(c=>a.jsx("th",{className:b(L.th,c.align==="right"&&L.alignRight,c.align==="center"&&L.alignCenter,dt(c.priority)),style:{width:c.width},children:c.header},c.key))})}),a.jsx("tbody",{children:t.length===0?a.jsx("tr",{children:a.jsx("td",{className:L.emptyRow,colSpan:e.length,children:r})}):t.map((c,l)=>a.jsx("tr",{className:b(L.tr,s&&L.clickable,i&&L.stackableRow),onClick:s?()=>s(c):void 0,children:e.map(d=>{const p=d.render?d.render(c,l):c[d.key];return a.jsx("td",{className:b(L.td,d.align==="right"&&L.alignRight,d.align==="center"&&L.alignCenter,dt(d.priority),d.className),"data-label":typeof d.header=="string"?d.header:void 0,children:p},d.key)})},n(c,l)))})]})})}const Dp="tempest_tablist_WR6ag",Fp="tempest_tab_IdDYc",Bp="tempest_active_PTNtG",Wp="tempest_panel_08i9c",Op="tempest_pill_lGuqn",Te={tablist:Dp,tab:Fp,active:Bp,panel:Wp,pill:Op};function zp({items:e,defaultId:t,activeId:n,onChange:s,variant:r="underline",className:o}){const i=e.find(_=>!_.disabled),[c,l]=u.useState(t??i?.id),d=n!==void 0,p=d?n:c,m=e.find(_=>_.id===p)??i;function f(_){d||l(_),s?.(_)}return a.jsxs("div",{className:o,children:[a.jsx("div",{role:"tablist",className:b(Te.tablist,r==="pill"&&Te.pill),children:e.map(_=>{const h=_.id===m?.id;return a.jsx("button",{type:"button",role:"tab","aria-selected":h,"aria-controls":`panel-${_.id}`,id:`tab-${_.id}`,disabled:_.disabled,className:b(Te.tab,h&&Te.active),onClick:()=>f(_.id),children:_.label},_.id)})}),m&&a.jsx("div",{role:"tabpanel",id:`panel-${m.id}`,"aria-labelledby":`tab-${m.id}`,className:Te.panel,children:m.content})]})}const Up="tempest_wrapper_C0gfg",qp="tempest_label_cWLXP",Hp="tempest_required_rDZXE",Gp="tempest_textarea_Z-y6g",Kp="tempest_error_NWC9f",Jp="tempest_helper_gedut",Vp="tempest_errorText_ey07q",ye={wrapper:Up,label:qp,required:Hp,textarea:Gp,error:Kp,helper:Jp,errorText:Vp},Qp=u.forwardRef(function({label:t,helperText:n,error:s,wrapperClassName:r,className:o,id:i,required:c,...l},d){const p=u.useId(),m=i??p;return a.jsxs("div",{className:b(ye.wrapper,s&&ye.error,r),children:[t&&a.jsxs("label",{htmlFor:m,className:ye.label,children:[t,c&&a.jsx("span",{className:ye.required,children:"*"})]}),a.jsx("textarea",{ref:d,id:m,"aria-invalid":!!s,required:c,className:b(ye.textarea,o),...l}),s?a.jsx("span",{className:ye.errorText,children:s}):n?a.jsx("span",{className:ye.helper,children:n}):null]})}),Xp="tempest_timeline_utrkA",Yp="tempest_item_T5xdQ",Zp="tempest_markerColumn_BMe4d",em="tempest_marker_kmPV-",tm="tempest_marker-primary_s9BNB",nm="tempest_marker-success_areMM",sm="tempest_marker-warning_rRrS8",rm="tempest_marker-danger_3GEBk",om="tempest_marker-neutral_M2mnw",am="tempest_line_CwY-N",im="tempest_body_KpMJ6",cm="tempest_row_AX2ti",lm="tempest_title_DxfAX",um="tempest_meta_GU0ih",dm="tempest_description_f9sxV",F={timeline:Xp,item:Yp,markerColumn:Zp,marker:em,markerPrimary:tm,markerSuccess:nm,markerWarning:sm,markerDanger:rm,markerNeutral:om,line:am,body:im,row:cm,title:lm,meta:um,description:dm};function pm({items:e,connector:t=!0,className:n,...s}){return a.jsx("ol",{className:b(F.timeline,t&&F.connector,n),...s,children:e.map((r,o)=>{const i=o===e.length-1;return a.jsxs("li",{className:F.item,children:[a.jsxs("div",{className:F.markerColumn,children:[a.jsx("span",{className:b(F.marker,F[`marker-${r.marker??"primary"}`]),"aria-hidden":"true",children:r.icon}),t&&!i&&a.jsx("span",{className:F.line,"aria-hidden":"true"})]}),a.jsxs("div",{className:F.body,children:[a.jsxs("div",{className:F.row,children:[a.jsx("span",{className:F.title,children:r.title}),r.meta&&a.jsx("span",{className:F.meta,children:r.meta})]}),r.description&&a.jsx("p",{className:F.description,children:r.description})]})]},r.id)})})}const mm="tempest_trigger_Dmc5E",fm="tempest_bubble_TPGHB",hm="tempest_tempest-tooltip-in_csYeZ",_m="tempest_top_m2tnn",gm="tempest_bottom_9Twz4",bm="tempest_left_UPdrG",ym="tempest_right_CV--T",He={trigger:mm,bubble:fm,tempestTooltipIn:hm,top:_m,bottom:gm,left:bm,right:ym};function vm({content:e,placement:t="top",children:n,disabled:s=!1,openDelay:r=150}){const[o,i]=u.useState(!1),c=u.useId();let l=null;function d(){s||(l&&clearTimeout(l),l=setTimeout(()=>i(!0),r))}function p(){l&&(clearTimeout(l),l=null),i(!1)}const m=u.cloneElement(n,{onMouseEnter:d,onMouseLeave:p,onFocus:d,onBlur:p,"aria-describedby":o?c:void 0});return a.jsxs("span",{className:He.trigger,children:[m,o&&a.jsx("span",{id:c,role:"tooltip",className:b(He.bubble,He[t]),children:e})]})}const wm="tempest_container_x4-Qm",xm="tempest_positionTopRight_gbUCQ",jm="tempest_positionTopLeft_Z-tMJ",$m="tempest_positionTopCenter_A4Ze4",Nm="tempest_positionBottomRight_MGo19",km="tempest_positionBottomLeft_DpiNe",Sm="tempest_positionBottomCenter_XUdok",Em="tempest_toast_FLdHz",Cm="tempest_tempest-toast-in_E2d-A",Tm="tempest_success_Oy694",Lm="tempest_warning_84GC8",Im="tempest_error_hrQAA",Rm="tempest_info_eq5bQ",Mm="tempest_title_-H6R2",Am="tempest_description_-QwfC",Pm="tempest_close_i10-s",O={container:wm,positionTopRight:xm,positionTopLeft:jm,positionTopCenter:$m,positionBottomRight:Nm,positionBottomLeft:km,positionBottomCenter:Sm,toast:Em,tempestToastIn:Cm,success:Tm,warning:Lm,error:Im,info:Rm,title:Mm,description:Am,close:Pm},Et=u.createContext(null);function Dm(){const e=u.useContext(Et);if(!e)throw new Error("useToast must be used inside a <ToastProvider>");return e}function Fm({children:e,defaultDuration:t=4e3,position:n="top-right"}){const[s,r]=u.useState([]),o=u.useRef(0),i=u.useCallback(d=>{r(p=>p.filter(m=>m.id!==d))},[]),c=u.useCallback(d=>{const p=d.id??`toast-${++o.current}`,m={id:p,title:d.title,description:d.description,variant:d.variant??"info",duration:d.duration??t};return r(f=>[...f,m]),p},[t]),l=u.useMemo(()=>({show:c,dismiss:i,success:(d,p)=>c({...p,description:d,variant:"success"}),error:(d,p)=>c({...p,description:d,variant:"error"}),warning:(d,p)=>c({...p,description:d,variant:"warning"}),info:(d,p)=>c({...p,description:d,variant:"info"})}),[c,i]);return a.jsxs(Et.Provider,{value:l,children:[e,a.jsx(Wm,{toasts:s,onDismiss:i,position:n})]})}function Bm(e){switch(e){case"top-left":return O.positionTopLeft;case"top-center":return O.positionTopCenter;case"bottom-right":return O.positionBottomRight;case"bottom-left":return O.positionBottomLeft;case"bottom-center":return O.positionBottomCenter;default:return O.positionTopRight}}function Wm({toasts:e,onDismiss:t,position:n}){return typeof document>"u"?null:Fe.createPortal(a.jsx("div",{className:b(O.container,Bm(n)),"aria-live":"polite","aria-atomic":"true",children:e.map(s=>a.jsx(Om,{toast:s,onDismiss:t},s.id))}),document.body)}function Om({toast:e,onDismiss:t}){return u.useEffect(()=>{if(!e.duration)return;const n=setTimeout(()=>t(e.id),e.duration);return()=>clearTimeout(n)},[e.id,e.duration,t]),a.jsxs("div",{className:b(O.toast,O[e.variant]),role:"status",children:[a.jsxs("div",{children:[e.title&&a.jsx("p",{className:O.title,children:e.title}),e.description&&a.jsx("p",{className:O.description,children:e.description})]}),a.jsx("button",{type:"button",className:O.close,"aria-label":"Fechar notificação",onClick:()=>t(e.id),children:a.jsx(zm,{})})]})}function zm(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Um="tempest_scroll_8Giwl",qm="tempest_spacer_P3Pvl",Hm="tempest_row_Ff0VU",Ge={scroll:Um,spacer:qm,row:Hm};function Gm({items:e,itemHeight:t,renderItem:n,height:s,overscan:r=4,getKey:o,className:i,style:c}){const l=u.useRef(null),[d,p]=u.useState(0),[m,f]=u.useState(0);u.useEffect(()=>{const v=l.current;if(!v||(f(v.clientHeight),typeof ResizeObserver>"u"))return;const w=new ResizeObserver(()=>f(v.clientHeight));return w.observe(v),()=>w.disconnect()},[]);const _=e.length*t,h=Math.max(0,Math.floor(d/t)-r),g=Math.ceil(m/t)+r*2,y=Math.min(e.length,h+g);return a.jsx("div",{ref:l,className:b(Ge.scroll,i),style:{height:s,...c},onScroll:v=>p(v.target.scrollTop),role:"list",children:a.jsx("div",{className:Ge.spacer,style:{height:_},children:e.slice(h,y).map((v,w)=>{const x=h+w,N=o?o(v,x):x;return a.jsx("div",{role:"listitem",className:Ge.row,style:{top:x*t,height:t},children:n(v,x)},N)})})})}function Km(e,t=300){const[n,s]=u.useState(e);return u.useEffect(()=>{const r=setTimeout(()=>s(e),t);return()=>clearTimeout(r)},[e,t]),n}function Jm(e=1,t=50){const[n,s]=u.useState(e),[r,o]=u.useState(t),i=u.useCallback(()=>s(1),[]);return{page:n,size:r,setPage:s,setSize:o,reset:i}}function Vm(e,t,n){return u.useMemo(()=>{const s=t.trim().toLowerCase();return s?typeof n=="function"?e.filter(r=>n(r,s)):e.filter(r=>n.some(o=>{const i=r[o];return i!=null&&String(i).toLowerCase().includes(s)})):e},[e,t,n])}function Qm(e){const[t,n]=u.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return u.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(e),r=o=>n(o.matches);return n(s.matches),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),t}function Xm(e,t,n,s){const r=u.useRef(t);r.current=t,u.useEffect(()=>{const o=n===void 0?typeof window>"u"?null:window:"current"in n?n.current??null:n;if(!o?.addEventListener)return;const i=c=>r.current(c);return o.addEventListener(e,i,s),()=>o.removeEventListener(e,i,s)},[e,n,s])}const Ym=JSON.stringify,Zm=e=>JSON.parse(e);function ef(e,t,n={}){const s=n.serialize??Ym,r=n.deserialize??Zm,o=u.useCallback(()=>{if(typeof window>"u")return t;try{const p=window.localStorage.getItem(e);return p===null?t:r(p)}catch{return t}},[e,t,r]),[i,c]=u.useState(o);u.useEffect(()=>{c(o())},[o]);const l=u.useCallback(p=>{c(m=>{const f=typeof p=="function"?p(m):p;try{typeof window<"u"&&window.localStorage.setItem(e,s(f))}catch{}return f})},[e,s]),d=u.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e)}catch{}c(t)},[e,t]);return u.useEffect(()=>{if(typeof window>"u")return;const p=m=>{if(m.key===e){if(m.newValue===null){c(t);return}try{c(r(m.newValue))}catch{}}};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[e,t,r]),[i,l,d]}function tf(e=!1){const[t,n]=u.useState(e),s=u.useCallback(()=>n(c=>!c),[]),r=u.useCallback(()=>n(!0),[]),o=u.useCallback(()=>n(!1),[]),i=u.useCallback(c=>n(c),[]);return[t,{toggle:s,setTrue:r,setFalse:o,set:i}]}function nf(e,t=[],n={}){const{immediate:s=!1}=n,[r,o]=u.useState({status:"idle",data:void 0,error:void 0}),i=u.useRef(e);i.current=e;const c=u.useRef(0),l=u.useRef(!0);u.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const d=u.useCallback(async()=>{const m=++c.current;o(f=>({...f,status:"pending",error:void 0}));try{const f=await i.current();return l.current&&c.current===m&&o({status:"success",data:f,error:void 0}),f}catch(f){throw l.current&&c.current===m&&o({status:"error",data:void 0,error:f}),f}},[]),p=u.useCallback(()=>{c.current++,o({status:"idle",data:void 0,error:void 0})},[]);return u.useEffect(()=>{s&&d().catch(()=>{})},[s,...t]),{status:r.status,data:r.data,error:r.error,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",run:d,reset:p}}function sf(){const[e,t]=u.useState(()=>typeof navigator>"u"?!0:navigator.onLine);return u.useEffect(()=>{if(typeof window>"u")return;const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",s),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}},[]),e}function rf(){const[e,t]=u.useState(()=>typeof document>"u"?"visible":document.visibilityState);return u.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState);return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function of(e,t={}){const[n,s]=u.useState(null),{once:r=!1,root:o,rootMargin:i,threshold:c}=t;return u.useEffect(()=>{const l=e.current;if(!l||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(([p])=>{p&&(s(p),r&&p.isIntersecting&&d.unobserve(l))},{root:o,rootMargin:i,threshold:c});return d.observe(l),()=>d.disconnect()},[e,r,o,i,c]),n}function af(e){const[t,n]=u.useState(null);return u.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const r=new ResizeObserver(o=>{const i=o[0];if(!i)return;const c=i.contentRect;n({width:c.width,height:c.height})});return r.observe(s),()=>r.disconnect()},[e]),t}function cf(e={}){const{resetAfter:t=1500}=e,[n,s]=u.useState(!1),r=u.useRef(null),o=u.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),s(!1)},[]);u.useEffect(()=>()=>o(),[o]);const i=u.useCallback(async c=>{try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(c);else if(typeof document<"u"){const l=document.createElement("textarea");l.value=c,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l)}else return!1;return s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),t),!0}catch{return!1}},[t]);return{copied:n,copy:i,reset:o}}function lf(e,t){if(e.key.toLowerCase()!==t.key.toLowerCase())return!1;const n=!!t.ctrl,s=!!t.meta,r=!!t.shift,o=!!t.alt;if(t.mod){if(!e.ctrlKey&&!e.metaKey)return!1}else if(e.ctrlKey!==n||e.metaKey!==s)return!1;return!(e.shiftKey!==r||e.altKey!==o)}function uf(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:e.isContentEditable}function df(e,t,n={}){const{disabled:s=!1,ignoreInput:r=!0}=n;u.useEffect(()=>{if(s||typeof window>"u")return;const o=i=>{r&&uf(i.target)||lf(i,e)&&t(i)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s,r,e.key,e.ctrl,e.meta,e.shift,e.alt,e.mod,t])}function pf(){const[e,t]=u.useState(null),[n,s]=u.useState(!1);u.useEffect(()=>{if(typeof window>"u")return;const o=c=>{c.preventDefault(),t(c)},i=()=>{t(null),s(!0)};return window.addEventListener("beforeinstallprompt",o),window.addEventListener("appinstalled",i),()=>{window.removeEventListener("beforeinstallprompt",o),window.removeEventListener("appinstalled",i)}},[]);const r=u.useCallback(async()=>{if(!e)return"unsupported";await e.prompt();const o=await e.userChoice;return t(null),o.outcome==="accepted"&&s(!0),o.outcome},[e]);return{installable:!!e,installed:n,prompt:r}}const pt=["mousemove","mousedown","keydown","touchstart","wheel","scroll"];function mf(e=6e4){const[t,n]=u.useState(!1);return u.useEffect(()=>{if(typeof window>"u")return;let s=setTimeout(()=>n(!0),e);function r(){n(!1),clearTimeout(s),s=setTimeout(()=>n(!0),e)}for(const o of pt)window.addEventListener(o,r,{passive:!0});return()=>{clearTimeout(s);for(const o of pt)window.removeEventListener(o,r)}},[e]),t}function ff(e={}){const{watch:t=!1,disabled:n=!1,...s}=e,[r,o]=u.useState({loading:!n,error:null,coords:null,timestamp:null});return u.useEffect(()=>{if(n||typeof navigator>"u"||!navigator.geolocation){o(l=>({...l,loading:!1}));return}const i=l=>{o({loading:!1,error:null,coords:l.coords,timestamp:l.timestamp})},c=l=>{o(d=>({...d,loading:!1,error:l}))};if(t){const l=navigator.geolocation.watchPosition(i,c,s);return()=>navigator.geolocation.clearWatch(l)}navigator.geolocation.getCurrentPosition(i,c,s)},[n,t,s.enableHighAccuracy,s.maximumAge,s.timeout]),r}function hf(e){u.useEffect(()=>{if(!e||typeof document>"u")return;const t=document.body,n=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=n}},[e])}const _f=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function gf(e,t){u.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const s=document.activeElement;function r(){return Array.from(n?.querySelectorAll(_f)??[]).filter(c=>{if(c.hasAttribute("aria-hidden"))return!1;const l=typeof window<"u"?window.getComputedStyle(c):null;return!(l&&(l.display==="none"||l.visibility==="hidden"))})}function o(c){if(c.key!=="Tab")return;const l=r();if(l.length===0){c.preventDefault();return}const d=l[0],p=l[l.length-1],m=document.activeElement;c.shiftKey?(m===d||!m||!n?.contains(m))&&(c.preventDefault(),p.focus()):m===p&&(c.preventDefault(),d.focus())}return r()[0]?.focus(),document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),s?.focus?.()}},[e,t])}function bf(e){const t=u.useRef(e);return t.current=e,u.useCallback((...n)=>t.current(...n),[])}function Qe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((r,o)=>Qe(r,t[o]));const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every(r=>Qe(e[r],t[r]))}function yf(e){const t=u.useRef(e);return Qe(t.current,e)||(t.current=e),t.current}function vf(e){const t=u.useRef(void 0);return u.useEffect(()=>{t.current=e},[e]),t.current}function wf(e,t){const n=u.useRef(e);n.current=e,u.useEffect(()=>{if(t===null)return;const s=setInterval(()=>n.current(),t);return()=>clearInterval(s)},[t])}function xf(e,t){const n=u.useRef(e);n.current=e,u.useEffect(()=>{if(t===null)return;const s=setTimeout(()=>n.current(),t);return()=>clearTimeout(s)},[t])}function jf(e,t){const[n,s]=u.useState(e),r=u.useRef(0),o=u.useRef(null);return u.useEffect(()=>{const i=Date.now(),c=i-r.current;return c>=t?(r.current=i,s(e)):(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r.current=Date.now(),s(e)},t-c)),()=>{o.current&&clearTimeout(o.current)}},[e,t]),n}function $f(){const[e,t]=u.useState(()=>typeof window>"u"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight});return u.useEffect(()=>{if(typeof window>"u")return;const n=()=>t({width:window.innerWidth,height:window.innerHeight});return n(),window.addEventListener("resize",n,{passive:!0}),()=>window.removeEventListener("resize",n)},[]),e}function Nf(e){const[t,n]=u.useState(!1);return u.useEffect(()=>{const s=e.current;if(!s)return;const r=()=>n(!0),o=()=>n(!1);return s.addEventListener("mouseenter",r),s.addEventListener("mouseleave",o),()=>{s.removeEventListener("mouseenter",r),s.removeEventListener("mouseleave",o)}},[e]),t}function kf(e,t,n={}){const{delay:s=500,moveThreshold:r=10}=n,o=u.useRef(t);o.current=t,u.useEffect(()=>{const i=e.current;if(!i)return;let c=null,l=0,d=0;const p=()=>{c&&(clearTimeout(c),c=null)},m=_=>{l=_.clientX,d=_.clientY,p(),c=setTimeout(()=>{c=null,o.current()},s)},f=_=>{if(c===null)return;const h=_.clientX-l,g=_.clientY-d;Math.hypot(h,g)>r&&p()};return i.addEventListener("pointerdown",m),i.addEventListener("pointermove",f),i.addEventListener("pointerup",p),i.addEventListener("pointercancel",p),i.addEventListener("pointerleave",p),()=>{p(),i.removeEventListener("pointerdown",m),i.removeEventListener("pointermove",f),i.removeEventListener("pointerup",p),i.removeEventListener("pointercancel",p),i.removeEventListener("pointerleave",p)}},[e,s,r])}function Sf(e,t,n){const s=new URL(t,e.endsWith("/")?e:`${e}/`);if(n)for(const[r,o]of Object.entries(n))o!=null&&s.searchParams.set(r,String(o));return s.toString()}function Ef(e){return typeof FormData<"u"&&e instanceof FormData}async function mt(e){let t=null;try{t=await e.clone().json()}catch{try{t=await e.text()}catch{t=null}}const n=(typeof t=="object"&&t!==null?t.detail??t.message:void 0)??`Erro ${e.status}`;return{status:e.status,detail:String(n),body:t}}function Cf(e){const t=e.fetcher??globalThis.fetch.bind(globalThis);function n(){const i=e.getToken?.();return i?{Authorization:`Bearer ${i}`}:{}}async function s(i,c){const{body:l,params:d,headers:p,...m}=c,f=Ef(l),_={...f?{}:{"Content-Type":"application/json"},...e.headers,...n(),...p},h={...m,headers:_,credentials:e.withCredentials?"include":m.credentials,body:l==null?void 0:f?l:JSON.stringify(l)};return t(Sf(e.baseURL,i,d),h)}async function r(i,c={}){let l=await s(i,c);if(l.status===401)if(e.refresh)try{await e.refresh(),l=await s(i,c)}catch{throw await e.onUnauthorized?.(l),await mt(l)}else await e.onUnauthorized?.(l);if(!l.ok)throw await mt(l);return l.status===204?void 0:(l.headers.get("content-type")??"").includes("application/json")?await l.json():await l.text()}async function o(i,c,l="POST"){return r(i,{method:l,body:c})}return{request:r,get:(i,c)=>r(i,{...c,method:"GET"}),post:(i,c)=>r(i,{...c,method:"POST"}),put:(i,c)=>r(i,{...c,method:"PUT"}),patch:(i,c)=>r(i,{...c,method:"PATCH"}),delete:(i,c)=>r(i,{...c,method:"DELETE"}),upload:o}}function Tf(e,t,n){const s=e.safeParse(t);if(s.success)return s.data;if(typeof process<"u"&&(process.env?.NODE_ENV==="development"||process.env?.NODE_ENV==="test")){const o=s.error.issues.map(i=>` - ${i.path.join(".")||"<root>"}: ${i.message}`).join(`
|
|
2
2
|
`);throw new Error(`[parseResponse] Contract drift on ${n}:
|
|
3
3
|
${o}
|
|
4
4
|
|
|
5
|
-
Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida do servidor (${n}).`)}function qp(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function Up(e){const{url:t,body:n,method:s="POST",headers:r={},getToken:o,withCredentials:i=!1,onProgress:c,signal:l,parser:d=JSON.parse}=e;return new Promise((p,f)=>{if(l?.aborted){f(new DOMException("Aborted","AbortError"));return}const m=new XMLHttpRequest;m.open(s,t),m.withCredentials=i;const _=o?.(),h={...r};_&&!("Authorization"in h)&&(h.Authorization=`Bearer ${_}`);for(const[y,v]of Object.entries(h))m.setRequestHeader(y,v);c&&(m.upload.onprogress=y=>{c({loaded:y.loaded,total:y.total,fraction:y.lengthComputable?y.loaded/y.total:null,lengthComputable:y.lengthComputable})});function b(){m.abort()}l?.addEventListener("abort",b),m.onload=()=>{l?.removeEventListener("abort",b);const y=m.status>=200&&m.status<300,v=m.getResponseHeader("content-type")??"";if(!y){const w=qp(m.responseText),x=(typeof w=="object"&&w!==null?w.detail??w.message:void 0)??`Erro ${m.status}`,$={status:m.status,detail:String(x),body:w};f($);return}if(m.status===204||!m.responseText){p(void 0);return}if(v.includes("application/json"))try{p(d(m.responseText))}catch(w){f(w)}else p(m.responseText)},m.onerror=()=>{l?.removeEventListener("abort",b),f({status:0,detail:"Falha de rede no upload."})},m.onabort=()=>{l?.removeEventListener("abort",b),f(new DOMException("Aborted","AbortError"))},m.send(n)})}function Gp(e,t){return new Promise((n,s)=>{if(t?.aborted){s(new DOMException("Aborted","AbortError"));return}const r=setTimeout(n,e);t?.addEventListener("abort",()=>{clearTimeout(r),s(new DOMException("Aborted","AbortError"))},{once:!0})})}async function Kp(e,t={}){const{retries:n=3,initialDelay:s=300,maxDelay:r=1e4,shouldRetry:o=()=>!0,onRetry:i,signal:c}=t;let l=0,d;for(;l<n;){if(c?.aborted)throw new DOMException("Aborted","AbortError");try{return await e()}catch(p){if(d=p,l+=1,l>=n||!o(p,l))throw p;const f=Math.min(s*2**(l-1),r);i?.({attempt:l,delay:f,error:p}),await Gp(f,c)}}throw d}function Jp(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16;return(e==="x"?Math.floor(t):Math.floor(t)&3|8).toString(16)})}function Hp(e,t){const{interval:n,disabled:s=!1,stopWhen:r,onError:o}=t,[i,c]=u.useState(null),[l,d]=u.useState(null),[p,f]=u.useState(!s),m=u.useRef(s),_=u.useRef(!1),h=u.useRef(null);async function b(){if(!(m.current||_.current)){_.current=!0;try{const y=await e();if(m.current)return;c(y),d(null),r?.(y)&&(m.current=!0)}catch(y){m.current||(d(y),o?.(y))}finally{_.current=!1,f(!1),m.current||(h.current=setTimeout(b,n))}}}return u.useEffect(()=>{if(m.current=s,s){h.current&&clearTimeout(h.current);return}return f(!0),b(),()=>{m.current=!0,h.current&&clearTimeout(h.current)}},[n,s]),{data:i,error:l,loading:p,stop:()=>{m.current=!0,h.current&&clearTimeout(h.current)},start:()=>{m.current&&(m.current=!1,b())}}}function Vp(e={}){const t=e.name??"tempest-auth",n=e.storage==="session"?()=>sessionStorage:()=>localStorage;return Rt.create()(Ge.persist(s=>({user:e.initialUser??null,token:e.initialToken??null,isAuthenticated:!!e.initialToken,setSession:({user:r,token:o})=>s({user:r,token:o,isAuthenticated:!0}),setUser:r=>s({user:r}),setToken:r=>s({token:r,isAuthenticated:!!r}),logout:()=>s({user:null,token:null,isAuthenticated:!1})}),{name:t,storage:Ge.createJSONStorage(n),partialize:s=>({user:s.user,token:s.token}),onRehydrateStorage:()=>s=>{s&&(s.isAuthenticated=!!s.token)}}))}function Qp({isAuthenticated:e,children:t,fallback:n}){return a.jsx(a.Fragment,{children:e?t:n})}function Ye(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4);return typeof atob<"u"?atob(t+n):Buffer.from(t+n,"base64").toString("binary")}function ut(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid JWT: must contain three segments.");const[n,s,r]=t;try{return{header:JSON.parse(Ye(n)),payload:JSON.parse(Ye(s)),signature:r}}catch{throw new Error("Invalid JWT: header or payload is not valid JSON.")}}function Zp(e,t=0){try{const{payload:n}=ut(e);if(typeof n.exp!="number")return!0;const s=Math.floor(Date.now()/1e3);return n.exp<=s+t}catch{return!0}}function Xp(e,t={}){const{retries:n=3,initialDelay:s=400,reloadOnFinalFailure:r=!0}=t;async function o(i=1){try{return await e()}catch(c){if(i>=n)throw r&&typeof window<"u"&&window.location.reload(),c;return await new Promise(l=>setTimeout(l,s*2**(i-1))),o(i+1)}}return u.lazy(o)}function Yp(e){let t=null;return()=>t||(t=(async()=>{try{await e()}finally{t=null}})(),t)}function em({component:e,onSuccess:t,onError:n,locale:s,theme:r,text:o,shape:i,size:c,disableOneTap:l,width:d,className:p,style:f}){return a.jsx("div",{className:p,style:f,children:e({onSuccess:m=>{if(!m.credential){n?.({provider:"google",message:"Google returned no credential",raw:m});return}return t({idToken:m.credential,provider:"google",raw:m})},onError:()=>{n?.({provider:"google",message:"Google login failed"})},locale:s,theme:r,text:o,shape:i,size:c,useOneTap:!l,width:d})})}function tm(e){const{exchange:t,onSuccess:n,onError:s}=e,[r,o]=u.useState(null),[i,c]=u.useState(null),[l,d]=u.useState("pending"),p=u.useRef(!1);return u.useEffect(()=>{if(p.current)return;p.current=!0;let f=!1;return t().then(m=>{if(!f)return o(m),d("success"),n?.(m)}).catch(m=>{f||(c(m),d("error"),s?.(m))}),()=>{f=!0}},[t,n,s]),{loading:l==="pending",data:r,error:i,status:l}}const dt={SHORT:30*1e3,DEFAULT:300*1e3,LONG:1800*1e3,INFINITE:1/0},pt={SHORT:300*1e3,DEFAULT:1800*1e3,LONG:3600*1e3},nm={REALTIME:5*1e3,FAST:30*1e3,DEFAULT:60*1e3,SLOW:300*1e3};function sm(e,t){const n={all:[e]};for(const[s,r]of Object.entries(t))typeof r=="function"?n[s]=(...o)=>[e,...r(...o)]:n[s]=[e,...r];return n}function rm({children:e,client:t,defaultOptions:n}){const[s]=u.useState(()=>t??new Ue.QueryClient({defaultOptions:{queries:{staleTime:dt.DEFAULT,gcTime:pt.DEFAULT,retry:1,refetchOnWindowFocus:!1,...n?.queries??{}},mutations:{retry:0,...n?.mutations??{}}}}));return a.jsx(Ue.QueryClientProvider,{client:s,children:e})}function om(e){try{return JSON.parse(e)}catch{return e}}function mt(e,t={}){const{withCredentials:n=!1,namedEvents:s=[],heartbeatEvents:r=["ping"],maxRetries:o=10,initialBackoff:i=1e3,maxBackoff:c=3e4,parser:l=om,onOpen:d,onMessage:p,onError:f,onStatusChange:m}=t;let _=null,h=null,b=0,y="idle",v=!1;function w(k){y!==k&&(y=k,m?.(k))}function x(k,j){r.includes(k)||p?.({event:k,data:l(j.data),id:j.lastEventId||void 0,raw:j})}function $(){if(v)return;if(b>=o){w("error");return}const k=Math.min(i*2**b,c);b+=1,h=setTimeout(N,k)}function N(){if(v)return;_&&_.close(),w("connecting");const k=new EventSource(e,{withCredentials:n});_=k,k.onopen=()=>{b=0,w("open"),d?.()},k.onmessage=j=>x("message",j);for(const j of s)k.addEventListener(j,E=>x(j,E));for(const j of r)k.addEventListener(j,()=>{});k.onerror=j=>{f?.(j),k.close(),_=null,w("closed"),$()}}function J(){v=!0,h&&(clearTimeout(h),h=null),b=0,_&&(_.close(),_=null),w("closed")}function de(){h&&(clearTimeout(h),h=null),b=0,v=!1,N()}return N(),{close:J,reconnect:de,get status(){return y}}}function am(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[o,i]=u.useState("idle"),[c,l]=u.useState(null),d=u.useRef(null),p=u.useRef(s);return p.current=s,u.useEffect(()=>{if(!n||!e){i("idle");return}const f=mt(e,{...r,onStatusChange:i,onMessage:m=>{l(m),p.current?.(m)}});return d.current=f.reconnect,()=>{f.close(),d.current=null}},[e,n]),{status:o,lastMessage:c,reconnect:()=>d.current?.()}}function ft(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(n),r=new ArrayBuffer(s.length),o=new Uint8Array(r);for(let i=0;i<s.length;i++)o[i]=s.charCodeAt(i);return o}function xe(){return typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}class Oe extends Error{constructor(){super("Web Push não suportado neste navegador."),this.name="WebPushUnsupportedError"}}class ht extends Error{constructor(){super("Permissão de notificação negada pelo usuário."),this.name="WebPushPermissionDeniedError"}}class _t{config;constructor(t){this.config=t}static isSupported(){return xe()}async registration(){if(!xe())throw new Oe;return this.config.getRegistration?await this.config.getRegistration():await navigator.serviceWorker.ready}permission(){return typeof Notification>"u"?"unsupported":Notification.permission}async requestPermission(){if(typeof Notification>"u")throw new Oe;return Notification.requestPermission()}async getSubscription(){return(await this.registration()).pushManager.getSubscription()}async isSubscribed(){return xe()?await this.getSubscription()!==null:!1}async subscribe(){if(await this.requestPermission()!=="granted")throw new ht;const n=await this.registration(),s=await n.pushManager.getSubscription();if(s)return await this.config.onSubscribe(s.toJSON()),s;const r=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:ft(this.config.vapidPublicKey)});return await this.config.onSubscribe(r.toJSON()),r}async unsubscribe(){const t=await this.getSubscription();return t?(this.config.onUnsubscribe&&await this.config.onUnsubscribe(t.toJSON()),t.unsubscribe()):!1}}function im(e){const t=u.useRef(e);t.current=e;const n=u.useMemo(()=>new _t({vapidPublicKey:e.vapidPublicKey,onSubscribe:b=>t.current.onSubscribe(b),onUnsubscribe:b=>t.current.onUnsubscribe?.(b),getRegistration:e.getRegistration}),[e.vapidPublicKey,e.getRegistration]),[s]=u.useState(()=>xe()),[r,o]=u.useState(()=>n.permission()),[i,c]=u.useState(!1),[l,d]=u.useState(!1),[p,f]=u.useState(null),m=u.useCallback(async()=>{if(s){o(n.permission());try{const b=await n.isSubscribed();c(b)}catch(b){f(b instanceof Error?b:new Error(String(b)))}}},[n,s]);u.useEffect(()=>{m()},[m]);const _=u.useCallback(async()=>{if(s){d(!0),f(null);try{await n.subscribe(),c(!0),o(n.permission())}catch(b){throw f(b instanceof Error?b:new Error(String(b))),b}finally{d(!1)}}},[n,s]),h=u.useCallback(async()=>{if(s){d(!0),f(null);try{await n.unsubscribe(),c(!1)}catch(b){throw f(b instanceof Error?b:new Error(String(b))),b}finally{d(!1)}}},[n,s]);return{supported:s,permission:r,subscribed:i,loading:l,error:p,subscribe:_,unsubscribe:h,refresh:m}}async function cm(e){if(typeof navigator>"u"||!("serviceWorker"in navigator))return null;try{const t=await navigator.serviceWorker.register(e.url,{scope:e.scope});return t.active&&e.onReady?.(t),t.addEventListener("updatefound",()=>{const n=t.installing;n&&n.addEventListener("statechange",()=>{n.state==="installed"&&navigator.serviceWorker.controller&&e.onUpdate?.(n,t)})}),t}catch(t){return e.onError?.(t),null}}function lm(e){e.postMessage({type:"SKIP_WAITING"})}async function um(){if(typeof navigator>"u"||!("serviceWorker"in navigator))return 0;const e=await navigator.serviceWorker.getRegistrations();let t=0;for(const n of e)await n.unregister()&&(t+=1);return t}function We(){return globalThis}function dm(e={}){const t=We(),{defaultTitle:n="Notificação",defaultIcon:s,defaultBadge:r,transform:o}=e;t.addEventListener("push",i=>{if(!i.data)return;let c;try{c=i.data.json()}catch{c={title:n,body:i.data.text()}}const l=o?o(c):c;if(!l)return;const d=l.title??n,p={body:l.body,icon:l.icon??s,badge:l.badge??r,image:l.image,tag:l.tag,data:{url:l.url??"/",...l.data??{}}};i.waitUntil(t.registration.showNotification(d,p))})}function pm(e={}){const t=We(),n=e.resolveUrl??(s=>{if(typeof s=="string")return s;if(s&&typeof s=="object"&&"url"in s){const r=s.url;return typeof r=="string"?r:"/"}return"/"});t.addEventListener("notificationclick",s=>{s.notification.close();const r=n(s.notification.data);s.waitUntil((async()=>{const o=await t.clients.matchAll({type:"window",includeUncontrolled:!0});for(const i of o)if(i.url.includes(r))return i.focus();return t.clients.openWindow(r)})())})}function mm(){const e=We();e.addEventListener("message",t=>{t.data?.type==="SKIP_WAITING"&&e.skipWaiting()})}function ze(){let e=null;async function t(s,{volume:r=1,loop:o=!1,autoplay:i=!0,stopPrevious:c=!1,onEnded:l,onError:d}={}){try{c&&e&&(e.pause(),e.currentTime=0);const p=new Audio(s);return p.volume=Math.max(0,Math.min(1,r)),p.loop=o,p.preload="auto",l&&(p.onended=l),d&&(p.onerror=f=>d(f)),e=p,i&&await p.play(),p}catch(p){return d?.(p),null}}function n(){e&&(e.pause(),e.currentTime=0)}return{play:t,stop:n,current:()=>e}}let Ae=null;function bt(){return Ae||(Ae=ze()),Ae}async function fm(e,t){return bt().play(e,t)}function hm(){bt().stop()}function _m(){const e=u.useRef(null),[t,n]=u.useState(!1);e.current||(e.current=ze()),u.useEffect(()=>()=>{e.current?.stop()},[]);const s=u.useCallback(async(o,i)=>{await e.current.play(o,i)&&n(!0)},[]),r=u.useCallback(()=>{e.current?.stop()},[]);return{play:s,stop:r,unlocked:t}}class bm extends Pt{store;constructor(t,n,s,r){super(t),this.version(n).stores({[s]:r}),this.store=this.table(s)}}function gm(e){const{databaseName:t,version:n,tableName:s,indexes:r,keyPath:o="id",ownerField:i}=e,c=new bm(t,n,s,r),l=c.store;function d(f,m){return!i||!m?f:{...f,[i]:m}}async function p(f,m={}){const{orderBy:_=o,reverse:h=!1,limit:b,offset:y,filter:v}=m;let w=i&&f?l.where(i).equals(f):l.toCollection();v&&(w=w.filter(v));let x=_===o?await w.toArray():await w.sortBy(_);return h&&(x=x.reverse()),y&&(x=x.slice(y)),typeof b=="number"&&(x=x.slice(0,b)),x}return{put:(f,m)=>l.put(d(f,m)),bulkPut:(f,m)=>l.bulkPut(f.map(_=>d(_,m))),get:f=>l.get(f),list:p,update:(f,m)=>l.update(f,m),updateMany:async(f,m)=>{const _=m;return i&&f?l.where(i).equals(f).modify(_):l.toCollection().modify(_)},delete:f=>l.delete(f),clear:async f=>{if(i&&f){await l.where(i).equals(f).delete();return}await l.clear()},count:f=>i&&f?l.where(i).equals(f).count():l.count(),raw:l,db:c}}function ym(e=[],t=[]){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!0;return!1}class vm extends u.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t){this.state.error&&ym(t.resetKeys,this.props.resetKeys)&&this.reset()}reset=()=>{this.setState({error:null})};render(){const{error:t}=this.state;if(!t)return this.props.children;const{fallback:n}=this.props;return typeof n=="function"?n({error:t,reset:this.reset}):n}}function wm(){const[,e]=u.useState(null);return u.useCallback(t=>{e(()=>{throw t instanceof Error?t:new Error(String(t))})},[])}function xm({name:e,label:t,helperText:n,required:s,control:r,children:o}){const i=K.useFormContext(),c=r??i?.control;if(!c)throw new Error("FormField requires either a `control` prop or a <FormProvider> in the tree.");return a.jsx(K.Controller,{name:e,control:c,render:({field:l,fieldState:d})=>{if(!u.isValidElement(o))return o;const p=d.error?.message;return u.cloneElement(o,{name:l.name,value:l.value,onChange:l.onChange,onBlur:l.onBlur,ref:l.ref,label:t,helperText:p?void 0:n,error:p,required:s,"aria-invalid":!!p})}})}function jm(e,t){const n=e.safeParse(t);if(n.success)return{success:!0,data:n.data,errors:{}};const s={};for(const r of n.error.issues){const o=r.path.length===0?"_root":r.path.join(".");o in s||(s[o]=r.message)}return{success:!1,errors:s}}function gt(e){return async(t,n,s)=>{const r=e.safeParse(t);if(r.success)return{values:r.data,errors:{}};const o={},i=s.criteriaMode??"firstError";for(const c of r.error.issues){const l=c.path.length===0?"_root":c.path.join(".");i==="firstError"&&o[l]||(o[l]={type:c.code,message:c.message})}return{values:{},errors:o}}}function $m(e,t={}){return K.useForm({...t,resolver:gt(e)})}function je(e){return e.replace(/\D/g,"")}function km(e){const t=je(e);if(t.length!==11||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number);let s=0;for(let o=0;o<9;o++)s+=n[o]*(10-o);let r=s*10%11;if(r===10&&(r=0),r!==n[9])return!1;s=0;for(let o=0;o<10;o++)s+=n[o]*(11-o);return r=s*10%11,r===10&&(r=0),r===n[10]}function Nm(e){const t=je(e);if(t.length!==14||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number),s=[5,4,3,2,9,8,7,6,5,4,3,2],r=[6,5,4,3,2,9,8,7,6,5,4,3,2];let o=0;for(let c=0;c<12;c++)o+=n[c]*s[c];let i=o%11;if(i=i<2?0:11-i,i!==n[12])return!1;o=0;for(let c=0;c<13;c++)o+=n[c]*r[c];return i=o%11,i=i<2?0:11-i,i===n[13]}function yt(e){return je(e).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2")}function vt(e){return je(e).slice(0,14).replace(/(\d{2})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1/$2").replace(/(\d{4})(\d)/,"$1-$2")}function Sm(e){return je(e)}function Em(e){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(e)}function Cm(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR").format(t)}function Tm(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR",{dateStyle:"short",timeStyle:"short"}).format(t)}function wt(e){const t=e.replace(/\D/g,"").slice(0,11);return t.length<=10?t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2"):t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2")}function xt(e){return e.replace(/\D/g,"").slice(0,11).replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2")}function Lm(e){return new Intl.NumberFormat("pt-BR",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}function Le(e,t="numeric"){return u.forwardRef(function({value:s,onChange:r,...o},i){return a.jsx(Ce,{...o,ref:i,value:e(s??""),inputMode:t,onChange:c=>r(e(c.target.value))})})}const Im=Le(xt),Rm=Le(vt),Pm=Le(wt,"tel"),Dm=Le(yt);function Mm(e,t,n){return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e/100)}function Am(e){const t=e.replace(/\D/g,"");return t?Number.parseInt(t,10):0}const Fm=u.forwardRef(function({value:t,onChange:n,currency:s="BRL",locale:r="pt-BR",...o},i){return a.jsx(Ce,{...o,ref:i,type:"text",inputMode:"numeric",value:Mm(t||0,r,s),onChange:c=>n(Am(c.target.value))})});function Bm(){const[e,t]=u.useState(!1),[n,s]=u.useState(null),[r,o]=u.useState(null),i=u.useCallback(async l=>{const d=l.replace(/\D/g,"");if(d.length!==8)return s("CEP inválido."),null;t(!0),s(null);try{const f=await(await fetch(`https://viacep.com.br/ws/${d}/json/`)).json();return"erro"in f&&f.erro?(s("CEP não encontrado."),o(null),null):(o(f),f)}catch(p){return s(p instanceof Error?p.message:String(p)),null}finally{t(!1)}},[]),c=u.useCallback(()=>{t(!1),s(null),o(null)},[]);return{loading:e,error:n,data:r,lookup:i,reset:c}}function Om(e){try{return JSON.parse(e)}catch{return e}}function jt(e,t={}){const{protocols:n,maxRetries:s=10,initialBackoff:r=1e3,maxBackoff:o=3e4,pingInterval:i=0,pingPayload:c=JSON.stringify({type:"ping"}),parser:l=Om,onOpen:d,onMessage:p,onClose:f,onError:m,onStatusChange:_}=t;let h=null,b=null,y=null,v=0,w="idle",x=!1;function $(C){w!==C&&(w=C,_?.(C))}function N(){y&&(clearInterval(y),y=null)}function J(){!i||i<=0||(N(),y=setInterval(()=>{h?.readyState===WebSocket.OPEN&&h.send(c)},i))}function de(){if(x)return;if(v>=s){$("error");return}const C=Math.min(r*2**v,o);v+=1,b=setTimeout(k,C)}function k(){if(x)return;h&&(h.onopen=null,h.onmessage=null,h.onclose=null,h.onerror=null,h.close()),$("connecting");const C=new WebSocket(e,n);h=C,C.onopen=R=>{v=0,$("open"),J(),d?.(R)},C.onmessage=R=>{const It=typeof R.data=="string"?R.data:"";p?.({data:l(It),raw:R})},C.onerror=R=>{m?.(R)},C.onclose=R=>{N(),f?.(R),h=null,$("closed"),!x&&!R.wasClean&&de()}}function j(C){return h?.readyState!==WebSocket.OPEN?!1:(h.send(C),!0)}function E(C,R){x=!0,b&&(clearTimeout(b),b=null),N(),v=0,h&&($("closing"),h.close(C,R),h=null),$("closed")}function Ie(){b&&(clearTimeout(b),b=null),v=0,x=!1,k()}return k(),{send:j,close:E,reconnect:Ie,get status(){return w}}}function Wm(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[o,i]=u.useState("idle"),[c,l]=u.useState(null),d=u.useRef(null),p=u.useRef(s);p.current=s,u.useEffect(()=>{if(!n||!e){i("idle");return}const _=jt(e,{...r,onStatusChange:i,onMessage:h=>{l(h),p.current?.(h)}});return d.current=_,()=>{_.close(),d.current=null}},[e,n]);const f=u.useCallback(_=>d.current?.send(_)??!1,[]),m=u.useCallback(()=>{d.current?.reconnect()},[]);return{status:o,lastMessage:c,send:f,reconnect:m}}const $t=u.createContext(null);function et(e){return e==="dark"||e==="light"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function zm(e){if(!e||typeof window>"u")return null;try{const t=window.localStorage.getItem(e);return t==="light"||t==="dark"||t==="system"?t:null}catch{return null}}function qm({children:e,defaultTheme:t="system",storageKey:n="tempest-theme",target:s,attribute:r="data-tempest-theme"}){const[o,i]=u.useState(()=>zm(n)??t),[c,l]=u.useState(()=>et(o)),d=u.useRef(s);d.current=s,u.useEffect(()=>{const _=d.current?.()??document.documentElement;if(!_)return;const h=et(o);_.setAttribute(r,h),l(h)},[o,r]),u.useEffect(()=>{if(o!=="system"||typeof window>"u")return;const _=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{const b=d.current?.()??document.documentElement,y=_.matches?"dark":"light";b?.setAttribute(r,y),l(y)};return _.addEventListener("change",h),()=>_.removeEventListener("change",h)},[o,r]);const p=u.useCallback(_=>{if(i(_),n&&typeof window<"u")try{window.localStorage.setItem(n,_)}catch{}},[n]),f=u.useCallback(()=>{p(c==="dark"?"light":"dark")},[c,p]),m=u.useMemo(()=>({theme:o,resolvedTheme:c,setTheme:p,toggle:f}),[o,c,p,f]);return a.jsx($t.Provider,{value:m,children:e})}function Um(){const e=u.useContext($t);if(!e)throw new Error("useTheme must be used inside a <ThemeProvider>");return e}function Gm(e={}){const{storageKey:t="tempest-theme",defaultTheme:n="system"}=e;if(typeof window>"u")return n==="dark"?"dark":"light";let s=null;try{s=window.localStorage.getItem(t)}catch{s=null}const r=s??n;return r==="dark"||r==="light"?r:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Km(e={}){const t=e.storageKey??"tempest-theme",n=e.defaultTheme??"system";return`
|
|
5
|
+
Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida do servidor (${n}).`)}function Lf(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function If(e){const{url:t,body:n,method:s="POST",headers:r={},getToken:o,withCredentials:i=!1,onProgress:c,signal:l,parser:d=JSON.parse}=e;return new Promise((p,m)=>{if(l?.aborted){m(new DOMException("Aborted","AbortError"));return}const f=new XMLHttpRequest;f.open(s,t),f.withCredentials=i;const _=o?.(),h={...r};_&&!("Authorization"in h)&&(h.Authorization=`Bearer ${_}`);for(const[y,v]of Object.entries(h))f.setRequestHeader(y,v);c&&(f.upload.onprogress=y=>{c({loaded:y.loaded,total:y.total,fraction:y.lengthComputable?y.loaded/y.total:null,lengthComputable:y.lengthComputable})});function g(){f.abort()}l?.addEventListener("abort",g),f.onload=()=>{l?.removeEventListener("abort",g);const y=f.status>=200&&f.status<300,v=f.getResponseHeader("content-type")??"";if(!y){const w=Lf(f.responseText),x=(typeof w=="object"&&w!==null?w.detail??w.message:void 0)??`Erro ${f.status}`,N={status:f.status,detail:String(x),body:w};m(N);return}if(f.status===204||!f.responseText){p(void 0);return}if(v.includes("application/json"))try{p(d(f.responseText))}catch(w){m(w)}else p(f.responseText)},f.onerror=()=>{l?.removeEventListener("abort",g),m({status:0,detail:"Falha de rede no upload."})},f.onabort=()=>{l?.removeEventListener("abort",g),m(new DOMException("Aborted","AbortError"))},f.send(n)})}function Rf(e,t){return new Promise((n,s)=>{if(t?.aborted){s(new DOMException("Aborted","AbortError"));return}const r=setTimeout(n,e);t?.addEventListener("abort",()=>{clearTimeout(r),s(new DOMException("Aborted","AbortError"))},{once:!0})})}async function Mf(e,t={}){const{retries:n=3,initialDelay:s=300,maxDelay:r=1e4,shouldRetry:o=()=>!0,onRetry:i,signal:c}=t;let l=0,d;for(;l<n;){if(c?.aborted)throw new DOMException("Aborted","AbortError");try{return await e()}catch(p){if(d=p,l+=1,l>=n||!o(p,l))throw p;const m=Math.min(s*2**(l-1),r);i?.({attempt:l,delay:m,error:p}),await Rf(m,c)}}throw d}function Af(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16;return(e==="x"?Math.floor(t):Math.floor(t)&3|8).toString(16)})}function Pf(e,t){const{interval:n,disabled:s=!1,stopWhen:r,onError:o}=t,[i,c]=u.useState(null),[l,d]=u.useState(null),[p,m]=u.useState(!s),f=u.useRef(s),_=u.useRef(!1),h=u.useRef(null);async function g(){if(!(f.current||_.current)){_.current=!0;try{const y=await e();if(f.current)return;c(y),d(null),r?.(y)&&(f.current=!0)}catch(y){f.current||(d(y),o?.(y))}finally{_.current=!1,m(!1),f.current||(h.current=setTimeout(g,n))}}}return u.useEffect(()=>{if(f.current=s,s){h.current&&clearTimeout(h.current);return}return m(!0),g(),()=>{f.current=!0,h.current&&clearTimeout(h.current)}},[n,s]),{data:i,error:l,loading:p,stop:()=>{f.current=!0,h.current&&clearTimeout(h.current)},start:()=>{f.current&&(f.current=!1,g())}}}function Df(e={}){const t=e.name??"tempest-auth",n=e.storage==="session"?()=>sessionStorage:()=>localStorage;return Xt.create()(at.persist(s=>({user:e.initialUser??null,token:e.initialToken??null,isAuthenticated:!!e.initialToken,setSession:({user:r,token:o})=>s({user:r,token:o,isAuthenticated:!0}),setUser:r=>s({user:r}),setToken:r=>s({token:r,isAuthenticated:!!r}),logout:()=>s({user:null,token:null,isAuthenticated:!1})}),{name:t,storage:at.createJSONStorage(n),partialize:s=>({user:s.user,token:s.token}),onRehydrateStorage:()=>s=>{s&&(s.isAuthenticated=!!s.token)}}))}function Ff({isAuthenticated:e,children:t,fallback:n}){return a.jsx(a.Fragment,{children:e?t:n})}function ft(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4);return typeof atob<"u"?atob(t+n):Buffer.from(t+n,"base64").toString("binary")}function Ct(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid JWT: must contain three segments.");const[n,s,r]=t;try{return{header:JSON.parse(ft(n)),payload:JSON.parse(ft(s)),signature:r}}catch{throw new Error("Invalid JWT: header or payload is not valid JSON.")}}function Bf(e,t=0){try{const{payload:n}=Ct(e);if(typeof n.exp!="number")return!0;const s=Math.floor(Date.now()/1e3);return n.exp<=s+t}catch{return!0}}function Wf(e,t={}){const{retries:n=3,initialDelay:s=400,reloadOnFinalFailure:r=!0}=t;async function o(i=1){try{return await e()}catch(c){if(i>=n)throw r&&typeof window<"u"&&window.location.reload(),c;return await new Promise(l=>setTimeout(l,s*2**(i-1))),o(i+1)}}return u.lazy(o)}function Of(e){let t=null;return()=>t||(t=(async()=>{try{await e()}finally{t=null}})(),t)}function zf({component:e,onSuccess:t,onError:n,locale:s,theme:r,text:o,shape:i,size:c,disableOneTap:l,width:d,className:p,style:m}){return a.jsx("div",{className:p,style:m,children:e({onSuccess:f=>{if(!f.credential){n?.({provider:"google",message:"Google returned no credential",raw:f});return}return t({idToken:f.credential,provider:"google",raw:f})},onError:()=>{n?.({provider:"google",message:"Google login failed"})},locale:s,theme:r,text:o,shape:i,size:c,useOneTap:!l,width:d})})}function Uf(e){const{exchange:t,onSuccess:n,onError:s}=e,[r,o]=u.useState(null),[i,c]=u.useState(null),[l,d]=u.useState("pending"),p=u.useRef(!1);return u.useEffect(()=>{if(p.current)return;p.current=!0;let m=!1;return t().then(f=>{if(!m)return o(f),d("success"),n?.(f)}).catch(f=>{m||(c(f),d("error"),s?.(f))}),()=>{m=!0}},[t,n,s]),{loading:l==="pending",data:r,error:i,status:l}}const Tt={SHORT:30*1e3,DEFAULT:300*1e3,LONG:1800*1e3,INFINITE:1/0},Lt={SHORT:300*1e3,DEFAULT:1800*1e3,LONG:3600*1e3},qf={REALTIME:5*1e3,FAST:30*1e3,DEFAULT:60*1e3,SLOW:300*1e3};function Hf(e,t){const n={all:[e]};for(const[s,r]of Object.entries(t))typeof r=="function"?n[s]=(...o)=>[e,...r(...o)]:n[s]=[e,...r];return n}function Gf({children:e,client:t,defaultOptions:n}){const[s]=u.useState(()=>t??new ot.QueryClient({defaultOptions:{queries:{staleTime:Tt.DEFAULT,gcTime:Lt.DEFAULT,retry:1,refetchOnWindowFocus:!1,...n?.queries??{}},mutations:{retry:0,...n?.mutations??{}}}}));return a.jsx(ot.QueryClientProvider,{client:s,children:e})}function Kf(e){try{return JSON.parse(e)}catch{return e}}function It(e,t={}){const{withCredentials:n=!1,namedEvents:s=[],heartbeatEvents:r=["ping"],maxRetries:o=10,initialBackoff:i=1e3,maxBackoff:c=3e4,parser:l=Kf,onOpen:d,onMessage:p,onError:m,onStatusChange:f}=t;let _=null,h=null,g=0,y="idle",v=!1;function w(k){y!==k&&(y=k,f?.(k))}function x(k,j){r.includes(k)||p?.({event:k,data:l(j.data),id:j.lastEventId||void 0,raw:j})}function N(){if(v)return;if(g>=o){w("error");return}const k=Math.min(i*2**g,c);g+=1,h=setTimeout(S,k)}function S(){if(v)return;_&&_.close(),w("connecting");const k=new EventSource(e,{withCredentials:n});_=k,k.onopen=()=>{g=0,w("open"),d?.()},k.onmessage=j=>x("message",j);for(const j of s)k.addEventListener(j,E=>x(j,E));for(const j of r)k.addEventListener(j,()=>{});k.onerror=j=>{m?.(j),k.close(),_=null,w("closed"),N()}}function z(){v=!0,h&&(clearTimeout(h),h=null),g=0,_&&(_.close(),_=null),w("closed")}function U(){h&&(clearTimeout(h),h=null),g=0,v=!1,S()}return S(),{close:z,reconnect:U,get status(){return y}}}function Jf(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[o,i]=u.useState("idle"),[c,l]=u.useState(null),d=u.useRef(null),p=u.useRef(s);return p.current=s,u.useEffect(()=>{if(!n||!e){i("idle");return}const m=It(e,{...r,onStatusChange:i,onMessage:f=>{l(f),p.current?.(f)}});return d.current=m.reconnect,()=>{m.close(),d.current=null}},[e,n]),{status:o,lastMessage:c,reconnect:()=>d.current?.()}}function Rt(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(n),r=new ArrayBuffer(s.length),o=new Uint8Array(r);for(let i=0;i<s.length;i++)o[i]=s.charCodeAt(i);return o}function Le(){return typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}class Xe extends Error{constructor(){super("Web Push não suportado neste navegador."),this.name="WebPushUnsupportedError"}}class Mt extends Error{constructor(){super("Permissão de notificação negada pelo usuário."),this.name="WebPushPermissionDeniedError"}}class At{config;constructor(t){this.config=t}static isSupported(){return Le()}async registration(){if(!Le())throw new Xe;return this.config.getRegistration?await this.config.getRegistration():await navigator.serviceWorker.ready}permission(){return typeof Notification>"u"?"unsupported":Notification.permission}async requestPermission(){if(typeof Notification>"u")throw new Xe;return Notification.requestPermission()}async getSubscription(){return(await this.registration()).pushManager.getSubscription()}async isSubscribed(){return Le()?await this.getSubscription()!==null:!1}async subscribe(){if(await this.requestPermission()!=="granted")throw new Mt;const n=await this.registration(),s=await n.pushManager.getSubscription();if(s)return await this.config.onSubscribe(s.toJSON()),s;const r=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Rt(this.config.vapidPublicKey)});return await this.config.onSubscribe(r.toJSON()),r}async unsubscribe(){const t=await this.getSubscription();return t?(this.config.onUnsubscribe&&await this.config.onUnsubscribe(t.toJSON()),t.unsubscribe()):!1}}function Vf(e){const t=u.useRef(e);t.current=e;const n=u.useMemo(()=>new At({vapidPublicKey:e.vapidPublicKey,onSubscribe:g=>t.current.onSubscribe(g),onUnsubscribe:g=>t.current.onUnsubscribe?.(g),getRegistration:e.getRegistration}),[e.vapidPublicKey,e.getRegistration]),[s]=u.useState(()=>Le()),[r,o]=u.useState(()=>n.permission()),[i,c]=u.useState(!1),[l,d]=u.useState(!1),[p,m]=u.useState(null),f=u.useCallback(async()=>{if(s){o(n.permission());try{const g=await n.isSubscribed();c(g)}catch(g){m(g instanceof Error?g:new Error(String(g)))}}},[n,s]);u.useEffect(()=>{f()},[f]);const _=u.useCallback(async()=>{if(s){d(!0),m(null);try{await n.subscribe(),c(!0),o(n.permission())}catch(g){throw m(g instanceof Error?g:new Error(String(g))),g}finally{d(!1)}}},[n,s]),h=u.useCallback(async()=>{if(s){d(!0),m(null);try{await n.unsubscribe(),c(!1)}catch(g){throw m(g instanceof Error?g:new Error(String(g))),g}finally{d(!1)}}},[n,s]);return{supported:s,permission:r,subscribed:i,loading:l,error:p,subscribe:_,unsubscribe:h,refresh:f}}async function Qf(e){if(typeof navigator>"u"||!("serviceWorker"in navigator))return null;try{const t=await navigator.serviceWorker.register(e.url,{scope:e.scope});return t.active&&e.onReady?.(t),t.addEventListener("updatefound",()=>{const n=t.installing;n&&n.addEventListener("statechange",()=>{n.state==="installed"&&navigator.serviceWorker.controller&&e.onUpdate?.(n,t)})}),t}catch(t){return e.onError?.(t),null}}function Xf(e){e.postMessage({type:"SKIP_WAITING"})}async function Yf(){if(typeof navigator>"u"||!("serviceWorker"in navigator))return 0;const e=await navigator.serviceWorker.getRegistrations();let t=0;for(const n of e)await n.unregister()&&(t+=1);return t}function tt(){return globalThis}function Zf(e={}){const t=tt(),{defaultTitle:n="Notificação",defaultIcon:s,defaultBadge:r,transform:o}=e;t.addEventListener("push",i=>{if(!i.data)return;let c;try{c=i.data.json()}catch{c={title:n,body:i.data.text()}}const l=o?o(c):c;if(!l)return;const d=l.title??n,p={body:l.body,icon:l.icon??s,badge:l.badge??r,image:l.image,tag:l.tag,data:{url:l.url??"/",...l.data??{}}};i.waitUntil(t.registration.showNotification(d,p))})}function eh(e={}){const t=tt(),n=e.resolveUrl??(s=>{if(typeof s=="string")return s;if(s&&typeof s=="object"&&"url"in s){const r=s.url;return typeof r=="string"?r:"/"}return"/"});t.addEventListener("notificationclick",s=>{s.notification.close();const r=n(s.notification.data);s.waitUntil((async()=>{const o=await t.clients.matchAll({type:"window",includeUncontrolled:!0});for(const i of o)if(i.url.includes(r))return i.focus();return t.clients.openWindow(r)})())})}function th(){const e=tt();e.addEventListener("message",t=>{t.data?.type==="SKIP_WAITING"&&e.skipWaiting()})}function nt(){let e=null;async function t(s,{volume:r=1,loop:o=!1,autoplay:i=!0,stopPrevious:c=!1,onEnded:l,onError:d}={}){try{c&&e&&(e.pause(),e.currentTime=0);const p=new Audio(s);return p.volume=Math.max(0,Math.min(1,r)),p.loop=o,p.preload="auto",l&&(p.onended=l),d&&(p.onerror=m=>d(m)),e=p,i&&await p.play(),p}catch(p){return d?.(p),null}}function n(){e&&(e.pause(),e.currentTime=0)}return{play:t,stop:n,current:()=>e}}let Ke=null;function Pt(){return Ke||(Ke=nt()),Ke}async function nh(e,t){return Pt().play(e,t)}function sh(){Pt().stop()}function rh(){const e=u.useRef(null),[t,n]=u.useState(!1);e.current||(e.current=nt()),u.useEffect(()=>()=>{e.current?.stop()},[]);const s=u.useCallback(async(o,i)=>{await e.current.play(o,i)&&n(!0)},[]),r=u.useCallback(()=>{e.current?.stop()},[]);return{play:s,stop:r,unlocked:t}}class oh extends Yt{store;constructor(t,n,s,r){super(t),this.version(n).stores({[s]:r}),this.store=this.table(s)}}function ah(e){const{databaseName:t,version:n,tableName:s,indexes:r,keyPath:o="id",ownerField:i}=e,c=new oh(t,n,s,r),l=c.store;function d(m,f){return!i||!f?m:{...m,[i]:f}}async function p(m,f={}){const{orderBy:_=o,reverse:h=!1,limit:g,offset:y,filter:v}=f;let w=i&&m?l.where(i).equals(m):l.toCollection();v&&(w=w.filter(v));let x=_===o?await w.toArray():await w.sortBy(_);return h&&(x=x.reverse()),y&&(x=x.slice(y)),typeof g=="number"&&(x=x.slice(0,g)),x}return{put:(m,f)=>l.put(d(m,f)),bulkPut:(m,f)=>l.bulkPut(m.map(_=>d(_,f))),get:m=>l.get(m),list:p,update:(m,f)=>l.update(m,f),updateMany:async(m,f)=>{const _=f;return i&&m?l.where(i).equals(m).modify(_):l.toCollection().modify(_)},delete:m=>l.delete(m),clear:async m=>{if(i&&m){await l.where(i).equals(m).delete();return}await l.clear()},count:m=>i&&m?l.where(i).equals(m).count():l.count(),raw:l,db:c}}function ih(e=[],t=[]){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!0;return!1}class ch extends u.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t){this.state.error&&ih(t.resetKeys,this.props.resetKeys)&&this.reset()}reset=()=>{this.setState({error:null})};render(){const{error:t}=this.state;if(!t)return this.props.children;const{fallback:n}=this.props;return typeof n=="function"?n({error:t,reset:this.reset}):n}}function lh(){const[,e]=u.useState(null);return u.useCallback(t=>{e(()=>{throw t instanceof Error?t:new Error(String(t))})},[])}function uh({name:e,label:t,helperText:n,required:s,control:r,children:o}){const i=Z.useFormContext(),c=r??i?.control;if(!c)throw new Error("FormField requires either a `control` prop or a <FormProvider> in the tree.");return a.jsx(Z.Controller,{name:e,control:c,render:({field:l,fieldState:d})=>{if(!u.isValidElement(o))return o;const p=d.error?.message;return u.cloneElement(o,{name:l.name,value:l.value,onChange:l.onChange,onBlur:l.onBlur,ref:l.ref,label:t,helperText:p?void 0:n,error:p,required:s,"aria-invalid":!!p})}})}function dh(e,t){const n=e.safeParse(t);if(n.success)return{success:!0,data:n.data,errors:{}};const s={};for(const r of n.error.issues){const o=r.path.length===0?"_root":r.path.join(".");o in s||(s[o]=r.message)}return{success:!1,errors:s}}function Dt(e){return async(t,n,s)=>{const r=e.safeParse(t);if(r.success)return{values:r.data,errors:{}};const o={},i=s.criteriaMode??"firstError";for(const c of r.error.issues){const l=c.path.length===0?"_root":c.path.join(".");i==="firstError"&&o[l]||(o[l]={type:c.code,message:c.message})}return{values:{},errors:o}}}function ph(e,t={}){return Z.useForm({...t,resolver:Dt(e)})}function Re(e){return e.replace(/\D/g,"")}function mh(e){const t=Re(e);if(t.length!==11||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number);let s=0;for(let o=0;o<9;o++)s+=n[o]*(10-o);let r=s*10%11;if(r===10&&(r=0),r!==n[9])return!1;s=0;for(let o=0;o<10;o++)s+=n[o]*(11-o);return r=s*10%11,r===10&&(r=0),r===n[10]}function fh(e){const t=Re(e);if(t.length!==14||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number),s=[5,4,3,2,9,8,7,6,5,4,3,2],r=[6,5,4,3,2,9,8,7,6,5,4,3,2];let o=0;for(let c=0;c<12;c++)o+=n[c]*s[c];let i=o%11;if(i=i<2?0:11-i,i!==n[12])return!1;o=0;for(let c=0;c<13;c++)o+=n[c]*r[c];return i=o%11,i=i<2?0:11-i,i===n[13]}function Ft(e){return Re(e).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2")}function Bt(e){return Re(e).slice(0,14).replace(/(\d{2})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1/$2").replace(/(\d{4})(\d)/,"$1-$2")}function hh(e){return Re(e)}function _h(e){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(e)}function gh(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR").format(t)}function bh(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR",{dateStyle:"short",timeStyle:"short"}).format(t)}function Wt(e){const t=e.replace(/\D/g,"").slice(0,11);return t.length<=10?t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2"):t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2")}function Ot(e){return e.replace(/\D/g,"").slice(0,11).replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2")}function yh(e){return new Intl.NumberFormat("pt-BR",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}function Oe(e,t="numeric"){return u.forwardRef(function({value:s,onChange:r,...o},i){return a.jsx(Be,{...o,ref:i,value:e(s??""),inputMode:t,onChange:c=>r(e(c.target.value))})})}const vh=Oe(Ot),wh=Oe(Bt),xh=Oe(Wt,"tel"),jh=Oe(Ft);function $h(e,t,n){return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e/100)}function Nh(e){const t=e.replace(/\D/g,"");return t?Number.parseInt(t,10):0}const kh=u.forwardRef(function({value:t,onChange:n,currency:s="BRL",locale:r="pt-BR",...o},i){return a.jsx(Be,{...o,ref:i,type:"text",inputMode:"numeric",value:$h(t||0,r,s),onChange:c=>n(Nh(c.target.value))})});function Sh(){const[e,t]=u.useState(!1),[n,s]=u.useState(null),[r,o]=u.useState(null),i=u.useCallback(async l=>{const d=l.replace(/\D/g,"");if(d.length!==8)return s("CEP inválido."),null;t(!0),s(null);try{const m=await(await fetch(`https://viacep.com.br/ws/${d}/json/`)).json();return"erro"in m&&m.erro?(s("CEP não encontrado."),o(null),null):(o(m),m)}catch(p){return s(p instanceof Error?p.message:String(p)),null}finally{t(!1)}},[]),c=u.useCallback(()=>{t(!1),s(null),o(null)},[]);return{loading:e,error:n,data:r,lookup:i,reset:c}}function Eh(e){try{return JSON.parse(e)}catch{return e}}function zt(e,t={}){const{protocols:n,maxRetries:s=10,initialBackoff:r=1e3,maxBackoff:o=3e4,pingInterval:i=0,pingPayload:c=JSON.stringify({type:"ping"}),parser:l=Eh,onOpen:d,onMessage:p,onClose:m,onError:f,onStatusChange:_}=t;let h=null,g=null,y=null,v=0,w="idle",x=!1;function N(T){w!==T&&(w=T,_?.(T))}function S(){y&&(clearInterval(y),y=null)}function z(){!i||i<=0||(S(),y=setInterval(()=>{h?.readyState===WebSocket.OPEN&&h.send(c)},i))}function U(){if(x)return;if(v>=s){N("error");return}const T=Math.min(r*2**v,o);v+=1,g=setTimeout(k,T)}function k(){if(x)return;h&&(h.onopen=null,h.onmessage=null,h.onclose=null,h.onerror=null,h.close()),N("connecting");const T=new WebSocket(e,n);h=T,T.onopen=R=>{v=0,N("open"),z(),d?.(R)},T.onmessage=R=>{const ze=typeof R.data=="string"?R.data:"";p?.({data:l(ze),raw:R})},T.onerror=R=>{f?.(R)},T.onclose=R=>{S(),m?.(R),h=null,N("closed"),!x&&!R.wasClean&&U()}}function j(T){return h?.readyState!==WebSocket.OPEN?!1:(h.send(T),!0)}function E(T,R){x=!0,g&&(clearTimeout(g),g=null),S(),v=0,h&&(N("closing"),h.close(T,R),h=null),N("closed")}function ee(){g&&(clearTimeout(g),g=null),v=0,x=!1,k()}return k(),{send:j,close:E,reconnect:ee,get status(){return w}}}function Ch(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[o,i]=u.useState("idle"),[c,l]=u.useState(null),d=u.useRef(null),p=u.useRef(s);p.current=s,u.useEffect(()=>{if(!n||!e){i("idle");return}const _=zt(e,{...r,onStatusChange:i,onMessage:h=>{l(h),p.current?.(h)}});return d.current=_,()=>{_.close(),d.current=null}},[e,n]);const m=u.useCallback(_=>d.current?.send(_)??!1,[]),f=u.useCallback(()=>{d.current?.reconnect()},[]);return{status:o,lastMessage:c,send:m,reconnect:f}}const Ut=u.createContext(null);function ht(e){return e==="dark"||e==="light"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Th(e){if(!e||typeof window>"u")return null;try{const t=window.localStorage.getItem(e);return t==="light"||t==="dark"||t==="system"?t:null}catch{return null}}function Lh({children:e,defaultTheme:t="system",storageKey:n="tempest-theme",target:s,attribute:r="data-tempest-theme"}){const[o,i]=u.useState(()=>Th(n)??t),[c,l]=u.useState(()=>ht(o)),d=u.useRef(s);d.current=s,u.useEffect(()=>{const _=d.current?.()??document.documentElement;if(!_)return;const h=ht(o);_.setAttribute(r,h),l(h)},[o,r]),u.useEffect(()=>{if(o!=="system"||typeof window>"u")return;const _=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{const g=d.current?.()??document.documentElement,y=_.matches?"dark":"light";g?.setAttribute(r,y),l(y)};return _.addEventListener("change",h),()=>_.removeEventListener("change",h)},[o,r]);const p=u.useCallback(_=>{if(i(_),n&&typeof window<"u")try{window.localStorage.setItem(n,_)}catch{}},[n]),m=u.useCallback(()=>{p(c==="dark"?"light":"dark")},[c,p]),f=u.useMemo(()=>({theme:o,resolvedTheme:c,setTheme:p,toggle:m}),[o,c,p,m]);return a.jsx(Ut.Provider,{value:f,children:e})}function Ih(){const e=u.useContext(Ut);if(!e)throw new Error("useTheme must be used inside a <ThemeProvider>");return e}function Rh(e={}){const{storageKey:t="tempest-theme",defaultTheme:n="system"}=e;if(typeof window>"u")return n==="dark"?"dark":"light";let s=null;try{s=window.localStorage.getItem(t)}catch{s=null}const r=s??n;return r==="dark"||r==="light"?r:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Mh(e={}){const t=e.storageKey??"tempest-theme",n=e.defaultTheme??"system";return`
|
|
6
6
|
(function(){try{
|
|
7
7
|
var key=${JSON.stringify(t)};
|
|
8
8
|
var def=${JSON.stringify(n)};
|
|
@@ -11,5 +11,5 @@ Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida d
|
|
|
11
11
|
var resolved=mode==="dark"||mode==="light"?mode:(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");
|
|
12
12
|
document.documentElement.setAttribute("data-tempest-theme",resolved);
|
|
13
13
|
}catch(e){}})();
|
|
14
|
-
`.trim()}function tt(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>{const r=t[s];return r===void 0?`{${s}}`:String(r)}):e}function Fe(e,t,n,s){const r=e[t]?.[s];if(r!==void 0)return r;if(n){const o=e[n]?.[s];if(o!==void 0)return o}return null}function qe(e){const{locale:t,fallbackLocale:n=null,messages:s}=e;function r(l,d){const p=Fe(s,t,n,l);return p===null?l:tt(p,d)}function o(l,d,p){const m=Fe(s,t,n,`${l}${d===1?"_one":"_other"}`)??Fe(s,t,n,l);return m===null?l:tt(m,{count:d,...p??{}})}function i(l,d){return new Intl.NumberFormat(t,d).format(l)}function c(l,d){const p=typeof l=="string"?new Date(l):l;return Number.isNaN(p.getTime())?"":new Intl.DateTimeFormat(t,d).format(p)}return{locale:t,fallbackLocale:n,t:r,plural:o,formatNumber:i,formatDate:c,withLocale:l=>qe({locale:l,fallbackLocale:n??void 0,messages:s})}}const kt=u.createContext(null);function Jm(e,t){if(!e||typeof window>"u")return null;try{const n=window.localStorage.getItem(e);return n&&t.includes(n)?n:null}catch{return null}}function Hm({children:e,locale:t,fallbackLocale:n,messages:s,storageKey:r="tempest-locale"}){const o=u.useMemo(()=>Object.keys(s),[s]),[i,c]=u.useState(()=>Jm(r,o)??t);u.useEffect(()=>{typeof document<"u"&&document.documentElement.setAttribute("lang",i)},[i]);const l=u.useCallback(p=>{if(c(p),r&&typeof window<"u")try{window.localStorage.setItem(r,p)}catch{}},[r]),d=u.useMemo(()=>({...qe({locale:i,fallbackLocale:n,messages:s}),setLocale:l,availableLocales:o}),[i,n,s,l,o]);return a.jsx(kt.Provider,{value:d,children:e})}function Nt(){const e=u.useContext(kt);if(!e)throw new Error("useI18n must be used inside an <I18nProvider>");return e}function Vm(){return Nt().t}const nt=["debug","info","warn","error"];function Qm(e,t){return nt.indexOf(t)>=nt.indexOf(e)}const St=({level:e,message:t,context:n})=>{const s=e==="debug"?"log":e;n?console[s](t,n):console[s](t)};function Et(e={}){const t=e.level??"info",n=e.sinks??[St],s=e.namespace??"";function r(o,i,c){if(!Qm(t,o))return;const l={level:o,message:s?`[${s}] ${i}`:i,context:c,timestamp:Date.now()};for(const d of n)try{d(l)}catch{}}return{debug:(o,i)=>r("debug",o,i),info:(o,i)=>r("info",o,i),warn:(o,i)=>r("warn",o,i),error:(o,i)=>r("error",o,i),child:o=>Et({level:t,sinks:n,namespace:s?`${s}:${o}`:o})}}const Ct=u.createContext(null);function Zm({adapter:e,children:t}){u.useEffect(()=>(e.init?.(),()=>{e.flush?.()}),[e]);const n=u.useMemo(()=>e,[e]);return a.jsx(Ct.Provider,{value:n,children:t})}function Xm(){return u.useContext(Ct)}const Ym={identify(e){console.info("[telemetry] identify",e)},track(e){console.info("[telemetry] track",e.name,e.properties)},captureException(e,t){console.error("[telemetry] exception",e,t)}};function ef(e){if(e===null)return null;const{id:t,email:n,name:s,traits:r}=e;return{...t!==void 0?{id:t}:null,...n!==void 0?{email:n}:null,...s!==void 0?{username:s}:null,...r??null}}function tf(e){const{sentry:t,initOptions:n,flushTimeout:s=2e3,breadcrumbCategory:r="app"}=e;return{init(){n&&t.init&&t.init(n)},identify(o){t.setUser(ef(o))},track(o){t.addBreadcrumb({category:r,message:o.name,level:"info",...o.properties?{data:o.properties}:null})},captureException(o,i){t.captureException(o,i?{extra:i}:void 0)},async flush(){t.flush&&await t.flush(s)}}}function nf(e){const{email:t,name:n,traits:s}=e;return{...t!==void 0?{email:t}:null,...n!==void 0?{name:n}:null,...s??null}}function sf(e){const{posthog:t,init:n}=e;return{init(){n&&t.init&&t.init(n.apiKey,n.options)},identify(s){if(s===null){t.reset?.();return}s.id!==void 0&&t.identify(s.id,nf(s))},track(s){t.capture(s.name,s.properties)},captureException(s,r){if(t.captureException){t.captureException(s,r);return}const o=s instanceof Error?s:new Error(String(s));t.capture("$exception",{$exception_message:o.message,$exception_type:o.name,$exception_stack_trace_raw:o.stack,...r})}}}const Tt=u.createContext(null);function rf({adapter:e,children:t}){const n=u.useMemo(()=>e,[e]);return u.useEffect(()=>{},[n]),a.jsx(Tt.Provider,{value:n,children:t})}function Lt(){const e=u.useContext(Tt);if(!e)throw new Error("useFeatureFlag requires <FeatureFlagsProvider>");return e}function of(e,t=!1){const n=Lt(),s=o=>n.onChange?n.onChange(o):()=>{},r=()=>n.isEnabled(e,t);return u.useSyncExternalStore(s,r,r)}function af(e,t){const n=Lt(),s=o=>n.onChange?n.onChange(o):()=>{},r=()=>n.get(e,t);return u.useSyncExternalStore(s,r,r)}function cf(e={}){const t={...e.initial??{}},n=new Set;function s(){for(const r of n)r()}return{isEnabled(r,o=!1){return r in t?!!t[r]:o},get(r,o){return r in t?t[r]:o},onChange(r){return n.add(r),()=>n.delete(r)},set(r,o){t[r]=o,s()}}}function lf(e){const{growthbook:t}=e,n=new Set;let s=!1;function r(){s||!t.setRenderer||(s=!0,t.setRenderer(()=>{for(const o of n)o()}))}return{isEnabled(o,i=!1){const c=t.isOn(o);return typeof c=="boolean"?c:i},get(o,i){return t.getFeatureValue(o,i)},onChange(o){return r(),n.add(o),()=>{n.delete(o)}}}}function uf(e){const{client:t}=e;return{isEnabled(n,s=!1){return t.variation(n,s)===!0},get(n,s){return t.variation(n,s)},onChange(n){return!t.on||!t.off?()=>{}:(t.on("change",n),()=>{t.off("change",n)})}}}async function df(e){if(typeof navigator>"u"||!("share"in navigator))return{shared:!1,unsupported:!0,cancelled:!1};if(e.files&&!navigator.canShare?.({files:e.files}))return{shared:!1,unsupported:!0,cancelled:!1};try{return await navigator.share(e),{shared:!0,unsupported:!1,cancelled:!1}}catch(t){return t instanceof DOMException&&t.name==="AbortError"?{shared:!1,unsupported:!1,cancelled:!0}:{shared:!1,unsupported:!1,cancelled:!1,error:t}}}function pf(){return typeof navigator<"u"&&"share"in navigator}const mf={get(e,t){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}},set(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}},remove(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}}};Object.defineProperty(exports,"Controller",{enumerable:!0,get:()=>K.Controller});Object.defineProperty(exports,"FormProvider",{enumerable:!0,get:()=>K.FormProvider});Object.defineProperty(exports,"useFieldArray",{enumerable:!0,get:()=>K.useFieldArray});Object.defineProperty(exports,"useForm",{enumerable:!0,get:()=>K.useForm});Object.defineProperty(exports,"useFormContext",{enumerable:!0,get:()=>K.useFormContext});Object.defineProperty(exports,"useFormState",{enumerable:!0,get:()=>K.useFormState});Object.defineProperty(exports,"useWatch",{enumerable:!0,get:()=>K.useWatch});exports.Accordion=zt;exports.Alert=sn;exports.AppShell=hn;exports.AspectRatio=gn;exports.AuthGuard=Qp;exports.Avatar=In;exports.BREAKPOINTS=ke;exports.Badge=Jn;exports.Banner=os;exports.BottomNavigation=ms;exports.BottomSheet=ws;exports.Breadcrumbs=Ss;exports.Button=Ne;exports.CACHE_TIME=pt;exports.CEPInput=Dm;exports.CNPJInput=Rm;exports.CPFInput=Im;exports.Card=ir;exports.Center=pr;exports.Checkbox=vr;exports.ChipInput=Ir;exports.Combobox=Jr;exports.ConfirmDialog=fo;exports.Container=Ii;exports.DatePicker=To;exports.Divider=Fo;exports.Drawer=sa;exports.DropdownMenu=ba;exports.EmptyState=ja;exports.ErrorBoundary=vm;exports.ErrorState=Ca;exports.FeatureFlagsProvider=rf;exports.FileUpload=Ka;exports.Form=li;exports.FormActions=pi;exports.FormField=xm;exports.FormRow=di;exports.FormSection=ui;exports.GoogleSignIn=em;exports.Grid=Mi;exports.Hide=hl;exports.I18nProvider=Hm;exports.Input=Ce;exports.Kbd=Wi;exports.Modal=st;exports.MoneyInput=Fm;exports.Navbar=Zi;exports.Page=lc;exports.Pagination=yc;exports.PhoneInput=Pm;exports.Popover=Sc;exports.Progress=Ac;exports.QueryProvider=rm;exports.REFETCH_TIME=nm;exports.Radio=Jc;exports.RadioGroup=Hc;exports.RangeSlider=sl;exports.RatingStars=pl;exports.STALE_TIME=dt;exports.SafeArea=jl;exports.SearchBar=El;exports.Select=Ol;exports.Show=fl;exports.Sidebar=Xl;exports.Skeleton=nu;exports.Spacer=iu;exports.Spinner=hu;exports.Stack=Pi;exports.Stat=Eu;exports.Stepper=Au;exports.Switch=Uu;exports.Table=gd;exports.Tabs=$d;exports.Tag=sd;exports.TelemetryProvider=Zm;exports.Textarea=Id;exports.ThemeProvider=qm;exports.ToastProvider=rp;exports.Tooltip=Od;exports.VirtualList=pp;exports.WebPushClient=_t;exports.WebPushPermissionDeniedError=ht;exports.WebPushUnsupportedError=Oe;exports.cn=g;exports.consoleSink=St;exports.consoleTelemetryAdapter=Ym;exports.createApiClient=Wp;exports.createAudioPlayer=ze;exports.createAuthStore=Vp;exports.createEventStream=mt;exports.createGrowthBookFeatureFlagsAdapter=lf;exports.createI18n=qe;exports.createInMemoryFlags=cf;exports.createLaunchDarklyFeatureFlagsAdapter=uf;exports.createLogger=Et;exports.createOfflineStore=gm;exports.createPostHogTelemetryAdapter=sf;exports.createQueryKeys=sm;exports.createRefreshQueue=Yp;exports.createSentryTelemetryAdapter=tf;exports.createWebSocket=jt;exports.decodeJWT=ut;exports.formatCEP=yt;exports.formatCNPJ=vt;exports.formatCPF=xt;exports.formatCurrency=Em;exports.formatDate=Cm;exports.formatDateTime=Tm;exports.formatPercent=Lm;exports.formatPhone=wt;exports.generateIdempotencyKey=Jp;exports.getInitialTheme=Gm;exports.installNotificationClickHandler=pm;exports.installPushHandler=dm;exports.installSkipWaitingListener=mm;exports.isJWTExpired=Zp;exports.isPushSupported=xe;exports.isShareSupported=pf;exports.lazyWithRetry=Xp;exports.parseResponse=zp;exports.playAudio=fm;exports.registerServiceWorker=cm;exports.retry=Kp;exports.share=df;exports.skipWaiting=lm;exports.stopAudio=hm;exports.storage=mf;exports.themeInitScript=Km;exports.unmask=Sm;exports.unregisterAllServiceWorkers=um;exports.uploadWithProgress=Up;exports.urlBase64ToUint8Array=ft;exports.useAsync=xp;exports.useAudio=_m;exports.useBeforeInstallPrompt=Lp;exports.useBreakpoint=ue;exports.useClientFilter=hp;exports.useClipboard=Sp;exports.useDebounce=mp;exports.useDeepMemo=Fp;exports.useDocumentVisibility=$p;exports.useErrorHandler=wm;exports.useEventListener=bp;exports.useEventStream=am;exports.useFeatureFlag=of;exports.useFlagValue=af;exports.useFocusTrap=Mp;exports.useGeolocation=Rp;exports.useI18n=Nt;exports.useIdle=Ip;exports.useIntersectionObserver=kp;exports.useKeyboardShortcut=Tp;exports.useLocalStorage=vp;exports.useMediaQuery=_p;exports.useOAuthCallback=tm;exports.useOnline=jp;exports.usePagination=fp;exports.usePoll=Hp;exports.usePushSubscription=im;exports.useResizeObserver=Np;exports.useScrollLock=Pp;exports.useStableCallback=Ap;exports.useTelemetry=Xm;exports.useTheme=Um;exports.useToast=sp;exports.useToggle=wp;exports.useTranslate=Vm;exports.useViaCEP=Bm;exports.useWebSocket=Wm;exports.useZodForm=$m;exports.validateCNPJ=Nm;exports.validateCPF=km;exports.validateForm=jm;exports.zodResolver=gt;
|
|
14
|
+
`.trim()}function _t(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>{const r=t[s];return r===void 0?`{${s}}`:String(r)}):e}function Je(e,t,n,s){const r=e[t]?.[s];if(r!==void 0)return r;if(n){const o=e[n]?.[s];if(o!==void 0)return o}return null}function st(e){const{locale:t,fallbackLocale:n=null,messages:s}=e;function r(l,d){const p=Je(s,t,n,l);return p===null?l:_t(p,d)}function o(l,d,p){const f=Je(s,t,n,`${l}${d===1?"_one":"_other"}`)??Je(s,t,n,l);return f===null?l:_t(f,{count:d,...p??{}})}function i(l,d){return new Intl.NumberFormat(t,d).format(l)}function c(l,d){const p=typeof l=="string"?new Date(l):l;return Number.isNaN(p.getTime())?"":new Intl.DateTimeFormat(t,d).format(p)}return{locale:t,fallbackLocale:n,t:r,plural:o,formatNumber:i,formatDate:c,withLocale:l=>st({locale:l,fallbackLocale:n??void 0,messages:s})}}const qt=u.createContext(null);function Ah(e,t){if(!e||typeof window>"u")return null;try{const n=window.localStorage.getItem(e);return n&&t.includes(n)?n:null}catch{return null}}function Ph({children:e,locale:t,fallbackLocale:n,messages:s,storageKey:r="tempest-locale"}){const o=u.useMemo(()=>Object.keys(s),[s]),[i,c]=u.useState(()=>Ah(r,o)??t);u.useEffect(()=>{typeof document<"u"&&document.documentElement.setAttribute("lang",i)},[i]);const l=u.useCallback(p=>{if(c(p),r&&typeof window<"u")try{window.localStorage.setItem(r,p)}catch{}},[r]),d=u.useMemo(()=>({...st({locale:i,fallbackLocale:n,messages:s}),setLocale:l,availableLocales:o}),[i,n,s,l,o]);return a.jsx(qt.Provider,{value:d,children:e})}function Ht(){const e=u.useContext(qt);if(!e)throw new Error("useI18n must be used inside an <I18nProvider>");return e}function Dh(){return Ht().t}const gt=["debug","info","warn","error"];function Fh(e,t){return gt.indexOf(t)>=gt.indexOf(e)}const Gt=({level:e,message:t,context:n})=>{const s=e==="debug"?"log":e;n?console[s](t,n):console[s](t)};function Kt(e={}){const t=e.level??"info",n=e.sinks??[Gt],s=e.namespace??"";function r(o,i,c){if(!Fh(t,o))return;const l={level:o,message:s?`[${s}] ${i}`:i,context:c,timestamp:Date.now()};for(const d of n)try{d(l)}catch{}}return{debug:(o,i)=>r("debug",o,i),info:(o,i)=>r("info",o,i),warn:(o,i)=>r("warn",o,i),error:(o,i)=>r("error",o,i),child:o=>Kt({level:t,sinks:n,namespace:s?`${s}:${o}`:o})}}const Jt=u.createContext(null);function Bh({adapter:e,children:t}){u.useEffect(()=>(e.init?.(),()=>{e.flush?.()}),[e]);const n=u.useMemo(()=>e,[e]);return a.jsx(Jt.Provider,{value:n,children:t})}function Wh(){return u.useContext(Jt)}const Oh={identify(e){console.info("[telemetry] identify",e)},track(e){console.info("[telemetry] track",e.name,e.properties)},captureException(e,t){console.error("[telemetry] exception",e,t)}};function zh(e){if(e===null)return null;const{id:t,email:n,name:s,traits:r}=e;return{...t!==void 0?{id:t}:null,...n!==void 0?{email:n}:null,...s!==void 0?{username:s}:null,...r??null}}function Uh(e){const{sentry:t,initOptions:n,flushTimeout:s=2e3,breadcrumbCategory:r="app"}=e;return{init(){n&&t.init&&t.init(n)},identify(o){t.setUser(zh(o))},track(o){t.addBreadcrumb({category:r,message:o.name,level:"info",...o.properties?{data:o.properties}:null})},captureException(o,i){t.captureException(o,i?{extra:i}:void 0)},async flush(){t.flush&&await t.flush(s)}}}function qh(e){const{email:t,name:n,traits:s}=e;return{...t!==void 0?{email:t}:null,...n!==void 0?{name:n}:null,...s??null}}function Hh(e){const{posthog:t,init:n}=e;return{init(){n&&t.init&&t.init(n.apiKey,n.options)},identify(s){if(s===null){t.reset?.();return}s.id!==void 0&&t.identify(s.id,qh(s))},track(s){t.capture(s.name,s.properties)},captureException(s,r){if(t.captureException){t.captureException(s,r);return}const o=s instanceof Error?s:new Error(String(s));t.capture("$exception",{$exception_message:o.message,$exception_type:o.name,$exception_stack_trace_raw:o.stack,...r})}}}const Vt=u.createContext(null);function Gh({adapter:e,children:t}){const n=u.useMemo(()=>e,[e]);return u.useEffect(()=>{},[n]),a.jsx(Vt.Provider,{value:n,children:t})}function Qt(){const e=u.useContext(Vt);if(!e)throw new Error("useFeatureFlag requires <FeatureFlagsProvider>");return e}function Kh(e,t=!1){const n=Qt(),s=o=>n.onChange?n.onChange(o):()=>{},r=()=>n.isEnabled(e,t);return u.useSyncExternalStore(s,r,r)}function Jh(e,t){const n=Qt(),s=o=>n.onChange?n.onChange(o):()=>{},r=()=>n.get(e,t);return u.useSyncExternalStore(s,r,r)}function Vh(e={}){const t={...e.initial??{}},n=new Set;function s(){for(const r of n)r()}return{isEnabled(r,o=!1){return r in t?!!t[r]:o},get(r,o){return r in t?t[r]:o},onChange(r){return n.add(r),()=>n.delete(r)},set(r,o){t[r]=o,s()}}}function Qh(e){const{growthbook:t}=e,n=new Set;let s=!1;function r(){s||!t.setRenderer||(s=!0,t.setRenderer(()=>{for(const o of n)o()}))}return{isEnabled(o,i=!1){const c=t.isOn(o);return typeof c=="boolean"?c:i},get(o,i){return t.getFeatureValue(o,i)},onChange(o){return r(),n.add(o),()=>{n.delete(o)}}}}function Xh(e){const{client:t}=e;return{isEnabled(n,s=!1){return t.variation(n,s)===!0},get(n,s){return t.variation(n,s)},onChange(n){return!t.on||!t.off?()=>{}:(t.on("change",n),()=>{t.off("change",n)})}}}async function Yh(e){if(typeof navigator>"u"||!("share"in navigator))return{shared:!1,unsupported:!0,cancelled:!1};if(e.files&&!navigator.canShare?.({files:e.files}))return{shared:!1,unsupported:!0,cancelled:!1};try{return await navigator.share(e),{shared:!0,unsupported:!1,cancelled:!1}}catch(t){return t instanceof DOMException&&t.name==="AbortError"?{shared:!1,unsupported:!1,cancelled:!0}:{shared:!1,unsupported:!1,cancelled:!1,error:t}}}function Zh(){return typeof navigator<"u"&&"share"in navigator}const e_={get(e,t){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}},set(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}},remove(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}}};function t_(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function n_(e,t,n="…"){if(e.length<=t)return e;const s=Math.max(0,t-n.length);return e.slice(0,s).trimEnd()+n}const s_={justNow:"agora há pouco",secondsAgo:e=>`${e} s atrás`,minutesAgo:e=>`${e} min atrás`,hoursAgo:e=>e===1?"1 hora atrás":`${e} horas atrás`,daysAgo:e=>e===1?"ontem":`${e} dias atrás`,weeksAgo:e=>e===1?"semana passada":`${e} semanas atrás`,monthsAgo:e=>e===1?"mês passado":`${e} meses atrás`,yearsAgo:e=>e===1?"ano passado":`${e} anos atrás`,inSeconds:e=>`em ${e} s`,inMinutes:e=>`em ${e} min`,inHours:e=>`em ${e} h`,inDays:e=>`em ${e} ${e===1?"dia":"dias"}`,inWeeks:e=>`em ${e} ${e===1?"semana":"semanas"}`,inMonths:e=>`em ${e} ${e===1?"mês":"meses"}`,inYears:e=>`em ${e} ${e===1?"ano":"anos"}`},r_={justNow:"just now",secondsAgo:e=>`${e}s ago`,minutesAgo:e=>`${e}m ago`,hoursAgo:e=>`${e}h ago`,daysAgo:e=>e===1?"yesterday":`${e} days ago`,weeksAgo:e=>`${e}w ago`,monthsAgo:e=>`${e}mo ago`,yearsAgo:e=>`${e}y ago`,inSeconds:e=>`in ${e}s`,inMinutes:e=>`in ${e}m`,inHours:e=>`in ${e}h`,inDays:e=>`in ${e}d`,inWeeks:e=>`in ${e}w`,inMonths:e=>`in ${e}mo`,inYears:e=>`in ${e}y`},o_={"pt-BR":s_,en:r_},Ye=1e3,Ze=60*Ye,et=60*Ze,Ie=24*et,bt=7*Ie,yt=30*Ie,vt=365*Ie;function a_(e,t={}){const{locale:n="pt-BR",now:s=Date.now()}=t,r=o_[n],o=e instanceof Date?e.getTime():new Date(e).getTime(),c=(typeof s=="number"?s:s.getTime())-o,l=c>=0,d=Math.abs(c);if(d<30*Ye)return r.justNow;if(d<Ze){const m=Math.round(d/Ye);return l?r.secondsAgo(m):r.inSeconds(m)}if(d<et){const m=Math.round(d/Ze);return l?r.minutesAgo(m):r.inMinutes(m)}if(d<Ie){const m=Math.round(d/et);return l?r.hoursAgo(m):r.inHours(m)}if(d<bt){const m=Math.round(d/Ie);return l?r.daysAgo(m):r.inDays(m)}if(d<yt){const m=Math.round(d/bt);return l?r.weeksAgo(m):r.inWeeks(m)}if(d<vt){const m=Math.round(d/yt);return l?r.monthsAgo(m):r.inMonths(m)}const p=Math.round(d/vt);return l?r.yearsAgo(p):r.inYears(p)}Object.defineProperty(exports,"Controller",{enumerable:!0,get:()=>Z.Controller});Object.defineProperty(exports,"FormProvider",{enumerable:!0,get:()=>Z.FormProvider});Object.defineProperty(exports,"useFieldArray",{enumerable:!0,get:()=>Z.useFieldArray});Object.defineProperty(exports,"useForm",{enumerable:!0,get:()=>Z.useForm});Object.defineProperty(exports,"useFormContext",{enumerable:!0,get:()=>Z.useFormContext});Object.defineProperty(exports,"useFormState",{enumerable:!0,get:()=>Z.useFormState});Object.defineProperty(exports,"useWatch",{enumerable:!0,get:()=>Z.useWatch});exports.Accordion=an;exports.Alert=xn;exports.AppShell=Rn;exports.AspectRatio=Pn;exports.AuthGuard=Ff;exports.Avatar=Qn;exports.BREAKPOINTS=Ae;exports.Badge=ds;exports.Banner=js;exports.BottomNavigation=Ls;exports.BottomSheet=Bs;exports.Breadcrumbs=Hs;exports.Button=Pe;exports.CACHE_TIME=Lt;exports.CEPInput=jh;exports.CNPJInput=wh;exports.CPFInput=vh;exports.Card=Nr;exports.Center=Tr;exports.Checkbox=Fr;exports.ChipInput=Qr;exports.Combobox=po;exports.ConfirmDialog=Io;exports.Container=Qi;exports.DatePicker=Jo;exports.Divider=na;exports.Drawer=wa;exports.DropdownMenu=Aa;exports.EmptyState=Oa;exports.ErrorBoundary=ch;exports.ErrorState=Ka;exports.FeatureFlagsProvider=Gh;exports.FileUpload=ui;exports.Form=Si;exports.FormActions=Ti;exports.FormField=uh;exports.FormRow=Ci;exports.FormSection=Ei;exports.GoogleSignIn=zf;exports.Grid=ec;exports.Hide=mu;exports.I18nProvider=Ph;exports.Input=Be;exports.Kbd=oc;exports.Modal=wt;exports.MoneyInput=kh;exports.Navbar=hc;exports.Page=Sc;exports.Pagination=Dc;exports.PasswordInput=rl;exports.PhoneInput=xh;exports.PinInput=gl;exports.Popover=Nl;exports.Progress=Al;exports.QueryProvider=Gf;exports.REFETCH_TIME=qf;exports.Radio=Hl;exports.RadioGroup=Gl;exports.RangeSlider=tu;exports.RatingStars=uu;exports.STALE_TIME=Tt;exports.SafeArea=wu;exports.SearchBar=ku;exports.SegmentedControl=Fu;exports.Select=Ju;exports.Show=pu;exports.Sidebar=ad;exports.Skeleton=ud;exports.Spacer=hd;exports.Spinner=jd;exports.Stack=Yi;exports.Stat=Pd;exports.Stepper=Hd;exports.StepperInput=tp;exports.Switch=cp;exports.Table=Pp;exports.Tabs=zp;exports.Tag=wp;exports.TelemetryProvider=Bh;exports.Textarea=Qp;exports.ThemeProvider=Lh;exports.Timeline=pm;exports.ToastProvider=Fm;exports.Tooltip=vm;exports.VirtualList=Gm;exports.WebPushClient=At;exports.WebPushPermissionDeniedError=Mt;exports.WebPushUnsupportedError=Xe;exports.clamp=Ve;exports.cn=b;exports.consoleSink=Gt;exports.consoleTelemetryAdapter=Oh;exports.createApiClient=Cf;exports.createAudioPlayer=nt;exports.createAuthStore=Df;exports.createEventStream=It;exports.createGrowthBookFeatureFlagsAdapter=Qh;exports.createI18n=st;exports.createInMemoryFlags=Vh;exports.createLaunchDarklyFeatureFlagsAdapter=Xh;exports.createLogger=Kt;exports.createOfflineStore=ah;exports.createPostHogTelemetryAdapter=Hh;exports.createQueryKeys=Hf;exports.createRefreshQueue=Of;exports.createSentryTelemetryAdapter=Uh;exports.createWebSocket=zt;exports.decodeJWT=Ct;exports.estimatePasswordStrength=Nt;exports.formatCEP=Ft;exports.formatCNPJ=Bt;exports.formatCPF=Ot;exports.formatCurrency=_h;exports.formatDate=gh;exports.formatDateTime=bh;exports.formatPercent=yh;exports.formatPhone=Wt;exports.generateIdempotencyKey=Af;exports.getInitialTheme=Rh;exports.installNotificationClickHandler=eh;exports.installPushHandler=Zf;exports.installSkipWaitingListener=th;exports.isJWTExpired=Bf;exports.isPushSupported=Le;exports.isShareSupported=Zh;exports.lazyWithRetry=Wf;exports.parseResponse=Tf;exports.playAudio=nh;exports.registerServiceWorker=Qf;exports.relativeTime=a_;exports.retry=Mf;exports.share=Yh;exports.skipWaiting=Xf;exports.slugify=t_;exports.stopAudio=sh;exports.storage=e_;exports.themeInitScript=Mh;exports.truncate=n_;exports.unmask=hh;exports.unregisterAllServiceWorkers=Yf;exports.uploadWithProgress=If;exports.urlBase64ToUint8Array=Rt;exports.useAsync=nf;exports.useAudio=rh;exports.useBeforeInstallPrompt=pf;exports.useBreakpoint=ve;exports.useClientFilter=Vm;exports.useClipboard=cf;exports.useDebounce=Km;exports.useDeepMemo=yf;exports.useDocumentVisibility=rf;exports.useErrorHandler=lh;exports.useEventListener=Xm;exports.useEventStream=Jf;exports.useFeatureFlag=Kh;exports.useFlagValue=Jh;exports.useFocusTrap=gf;exports.useGeolocation=ff;exports.useHover=Nf;exports.useI18n=Ht;exports.useIdle=mf;exports.useIntersectionObserver=of;exports.useInterval=wf;exports.useKeyboardShortcut=df;exports.useLocalStorage=ef;exports.useLongPress=kf;exports.useMediaQuery=Qm;exports.useOAuthCallback=Uf;exports.useOnline=sf;exports.usePagination=Jm;exports.usePoll=Pf;exports.usePrevious=vf;exports.usePushSubscription=Vf;exports.useResizeObserver=af;exports.useScrollLock=hf;exports.useStableCallback=bf;exports.useTelemetry=Wh;exports.useTheme=Ih;exports.useThrottle=jf;exports.useTimeout=xf;exports.useToast=Dm;exports.useToggle=tf;exports.useTranslate=Dh;exports.useViaCEP=Sh;exports.useWebSocket=Ch;exports.useWindowSize=$f;exports.useZodForm=ph;exports.validateCNPJ=fh;exports.validateCPF=mh;exports.validateForm=dh;exports.zodResolver=Dt;
|
|
15
15
|
//# sourceMappingURL=tempest-react-sdk.cjs.map
|