1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1954],{1685:(e,t,a)=>{Promise.resolve().then(a.bind(a,3194)),Promise.resolve().then(a.bind(a,79210)),Promise.resolve().then(a.bind(a,66215)),Promise.resolve().then(a.bind(a,47442)),Promise.resolve().then(a.bind(a,34332))},3194:(e,t,a)=>{"use strict";a.d(t,{RefAttribution:()=>o});var r=a(78016),n=a(2002),l=a(17093),s=a(24573);let o=()=>{let e=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{if(e.current)return;let t=(0,l.pE)(),a=(0,s.aG)();(t||a)&&(e.current=!0,(async()=>{try{await (0,n.nr)("/auth/ref/attribute",{method:"POST",body:{ref:null!=t?t:void 0,userRef:null!=a?a:void 0}}),(0,l.Gb)(),(0,s.Pm)()}catch(t){e.current=!1}})())},[]),null}},11336:(e,t,a)=>{"use strict";a.d(t,{UW:()=>d,ZW:()=>o,j8:()=>l,tH:()=>s,tc:()=>i});var r=a(2002),n=a(73008);let l=()=>(0,r.nr)("/dashboard/cost-settings"),s=(e,t)=>(0,r.nr)("/dashboard/cost-settings/packaging",{method:"PUT",body:{packagingCost:e,scope:t}}),o=e=>(0,r.nr)("/dashboard/products/".concat(encodeURIComponent(e),"/packaging-cost")),i=(e,t,a)=>(0,r.nr)("/dashboard/products/".concat(encodeURIComponent(e),"/packaging-cost"),{method:"PUT",body:{packagingCost:t,scope:a}}),d=async(e,t)=>(0,n.p_)(await (0,r.nr)("/cost-settings/products/".concat(encodeURIComponent(e),"/package-dimensions"),{method:"PUT",body:t}))},16341:(e,t,a)=>{"use strict";a.d(t,{ShimmerBlock:()=>l});var r=a(6892),n=a(71919);let l=e=>{let{className:t,style:a}=e;return(0,r.jsx)("span",{"aria-hidden":"true",style:a,className:(0,n.cn)("relative block overflow-hidden rounded-[4px]","bg-[#EEF1F5] dark:bg-white/[0.06]","after:absolute after:inset-0","after:bg-gradient-to-r after:from-transparent after:via-white/70 after:to-transparent","after:animate-[shimmer_1.8s_ease-in-out_infinite]","dark:after:via-white/[0.08]",t)})}},16928:(e,t,a)=>{"use strict";a.d(t,{p:()=>p});var r=a(6892),n=a(78016),l=a(49169),s=a(27106),o=a(37259),i=a(35028),d=a(94056),c=a(71919);let u="var(--font-sans)",m=[{value:"forward",label:"S\xf3 daqui pra frente",hint:"S\xf3 as pr\xf3ximas vendas. As anteriores n\xe3o mudam.",Icon:i.Qp},{value:"all",label:"Em todo o per\xedodo",hint:"Atualiza a margem das vendas j\xe1 feitas.",Icon:i.Pm}],x={packaging:{title:"Novo custo de embalagem",question:"Escolha onde esse novo valor passa a valer."}},p=e=>{let{open:t,onClose:a,submitting:i=!1,portal:p=!0}=e,b=x[e.variant],[h,f]=(0,n.useState)(m[0].value),g=(0,n.useId)(),v=(0,n.useId)();(0,n.useEffect)(()=>{t&&f(m[0].value)},[t,m]),(0,n.useEffect)(()=>{if(!t)return;let e=e=>{"Escape"===e.key&&(e.stopImmediatePropagation(),a())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,a]);let y=(0,r.jsxs)(s.m.div,{role:"dialog","aria-modal":"true","aria-labelledby":g,initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.96},transition:{duration:.26,ease:[.32,.72,0,1]},onClick:e=>e.stopPropagation(),className:"relative flex w-full max-w-[440px] flex-col overflow-hidden rounded-[12px] border border-border bg-card shadow-[0_24px_64px_-12px_rgba(5,45,43,0.30),0_8px_24px_-8px_rgba(5,45,43,0.18)]",children:[(0,r.jsxs)("header",{className:"border-b border-solid border-border px-6 pb-4 pt-6",children:[(0,r.jsx)("h2",{id:g,className:"text-[18px] font-medium leading-tight tracking-[-0.02em] text-[#052D2B] dark:text-foreground",style:{fontFamily:u},children:b.title}),(0,r.jsx)("p",{className:"mt-1.5 text-[13px] leading-snug text-muted-foreground",style:{fontFamily:"'Eudoxus Sans', 'DM Sans', system-ui, sans-serif"},children:b.question})]}),(0,r.jsx)(d.Ny,{ariaLabel:b.question,className:"flex flex-col gap-2 px-6 pb-6 pt-5",children:m.map(e=>{let{Icon:t}=e;return(0,r.jsx)(d.O5,{name:v,checked:e.value===h,onSelect:()=>f(e.value),label:e.label,description:e.hint,icon:(0,r.jsx)(t,{size:18})},e.value)})}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2.5 border-t border-border px-6 py-4",children:[(0,r.jsx)("button",{type:"button",onClick:a,disabled:i,className:"inline-flex h-11 cursor-pointer items-center justify-center rounded-lg border border-solid border-[#052D2B]/12 bg-transparent px-4 text-[14px] font-medium text-[#052D2B] transition-colors hover:border-[#052D2B]/20 hover:bg-[#052D2B]/[0.03] disabled:cursor-not-allowed disabled:opacity-50 dark:border-border dark:text-foreground dark:hover:bg-muted/30",style:{fontFamily:u}
1,children:"Cancelar"}),(0,r.jsx)("button",{type:"button",onClick:()=>{i||e.onConfirm(h)},disabled:i,className:(0,c.cn)("inline-flex h-10 cursor-pointer items-center justify-center rounded-lg px-5 text-[14px] font-medium tracking-[-0.2px]","border-[0.5px] border-white/25 bg-[#B1FE7B] text-[#052D2B]","ring-1 [--btn-ring:color-mix(in_oklab,#052D2B_15%,#B1FE7B)] ring-[var(--btn-ring)]","shadow-[inset_0_1px_0_rgba(255,255,255,0.5)]","transition-all duration-200 hover:bg-[#a0f060] active:scale-[0.99]","disabled:cursor-not-allowed disabled:opacity-60"),style:{fontFamily:u},children:i?"Confirmandoâ¦":"Confirmar"})]})]}),j=(0,r.jsx)(o.N,{children:t?(0,r.jsxs)("div",{className:(0,c.cn)("grid place-items-center p-4",p?"fixed inset-0 z-[70]":"absolute inset-0 z-40"),children:[(0,r.jsx)(s.m.div,{className:"absolute inset-0",style:{background:p?"radial-gradient(ellipse at center, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.30) 80%)":"radial-gradient(ellipse at center, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.14) 80%)"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18,ease:[.16,1,.3,1]},onClick:a}),y]}):null});return p?"undefined"==typeof document?null:(0,l.createPortal)(j,document.body):j}},22389:(e,t,a)=>{"use strict";a.d(t,{n:()=>d});var r=a(77096),n=a(26778),l=a(2002);let s="/dashboard/dre/fixed-expenses",o=e=>"".concat(s,"/").concat(encodeURIComponent(e)),i=e=>({id:e.id,kind:e.type,category:e.category,name:e.name,displayName:e.displayName,periods:e.periods.map(e=>({id:e.id,startMonth:e.startMonth,endMonth:e.endMonth,amountCents:e.amountCents})),currentAmountCents:e.currentAmountCents,dormantAmountCents:e.dormantAmountCents,active:e.active,hiddenAt:e.hiddenAt,readOnly:!0===e.readOnly,createdAt:Date.parse(e.createdAt)||0,updatedAt:Date.parse(e.updatedAt)||0}),d=(0,r.v)((e,t)=>({items:[],monthlyTotalCents:0,currentMonth:null,variablesNeedingEntry:[],hydrated:!1,hydrate:()=>{t().hydrated||t().refetch().finally(()=>e({hydrated:!0}))},refetch:async()=>{try{let t=await (0,l.nr)(s);e({items:t.items.map(i),monthlyTotalCents:t.monthlyTotalCents,currentMonth:t.currentMonth,variablesNeedingEntry:[...t.variablesNeedingEntry]})}catch(e){}},create:async e=>{var a,r,o,d,c;let u,m=await (u={name:e.name,category:e.category,type:e.kind,startMonth:null!=(a=e.startMonth)?a:"",amountCents:null!=(r=e.amountCents)?r:0,endMonth:"ONE_OFF"===e.kind?null!=(d=null!=(o=e.endMonth)?o:e.startMonth)?d:null:"FIXED"===e.kind&&null!=(c=e.endMonth)?c:null},(0,l.nr)(s,{method:"POST",body:u}));return await t().refetch(),(0,n.kM)("costs","created",{kind:e.kind,category:e.category}),{ok:!0,cost:i(m)}},updateIdentity:async(e,a)=>{let r;await (r={name:a.name,category:a.category,type:a.kind},(0,l.nr)(o(e),{method:"PUT",body:r})),await t().refetch()},remove:async e=>{await (0,l.nr)(o(e),{method:"DELETE"}),await t().refetch()},deactivate:async e=>{await (0,l.nr)("".concat(o(e),"/deactivate"),{method:"POST"}),await t().refetch()},reactivate:async(e,a)=>{await (0,l.nr)("".concat(o(e),"/reactivate"),{method:"POST",body:{fillGap:a}}),await t().refetch()},hide:async e=>{await (0,l.nr)("".concat(o(e),"/hide"),{method:"POST"}),await t().refetch()},unhide:async e=>{await (0,l.nr)("".concat(o(e),"/unhide"),{method:"POST"}),await t().refetch()},changeAmount:async(e,a,r,n)=>{let s;await (s={amountCents:a,scope:r,month:n},(0,l.nr)("".concat(o(e),"/amount"),{method:"PUT",body:s})),await t().refetch()},setActiveMonths:async(e,a)=>{await (0,l.nr)("".concat(o(e),"/active-months"),{method:"PUT",body:{activeMonths:a}}),await t().refetch()},setMonthValue:async(e,a,r)=>{await (0,l.nr)("".concat(o(e),"/month-value"),{method:"PUT",body:{month:a,amountCents:r}}),await t().refetch()},moveOneOffMonth:async(e,a)=>{await (0,l.nr)("".concat(o(e),"/month"),{method:"PUT",body:{month:a}}),await t().refetch()}}))},24212:(e,t,a)=>{"use strict";a.d(t,{aX:()=>o,if:()=>s,uD:()=>l});var r=a(6892);let n=e=>{let{size:t=24,className:a,d:n}=e;return(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",className:a,children:(0,r.jsx)("path",{d:n,fill:"currentColor"})})},l=e=>(0,r.jsx)(n,{...e,d:"M9.26848 17.3992C9.16148 18.1501 8.78717 18.8371 8.21429 19.3342C7.6414 19.8312 6.90842 20.1049 6.14998 20.1049C5.39153 20.1049 4.65855 19.8312 4.08566 19.3342C3.51278 18.8371 3.13847 18.1501 3.03148 17.3992H2.09998V6.59922C2.09998 6.36052 2.1948 6.13161 2.36358 5.96282C2.53236 5.79404 2.76128 5.69922 2.99998 5.69922H15.6C1
15.8387 5.69922 16.0676 5.79404 16.2364 5.96282C16.4052 6.13161 16.5 6.36052 16.5 6.59922V8.39922H19.2L21.9 12.0496V17.3992H20.0685C19.9615 18.1501 19.5872 18.8371 19.0143 19.3342C18.4414 19.8312 17.7084 20.1049 16.95 20.1049C16.1915 20.1049 15.4585 19.8312 14.8857 19.3342C14.3128 18.8371 13.9385 18.1501 13.8315 17.3992H9.26848ZM14.7 7.49922H3.89998V14.7442C4.25508 14.3817 4.69252 14.1103 5.17505 13.9532C5.65759 13.7961 6.17094 13.7579 6.67141 13.8419C7.17189 13.9258 7.64467 14.1295 8.04952 14.4354C8.45438 14.7414 8.77931 15.1407 8.99668 15.5992H14.1033C14.2545 15.2815 14.457 14.9926 14.7 14.7442V7.49922ZM16.5 12.8992H20.1V12.6427L18.2928 10.1992H16.5V12.8992ZM16.95 18.2992C17.3081 18.2992 17.6516 18.1569 17.9049 17.9037C18.1581 17.6504 18.3004 17.3069 18.3004 16.9488C18.3004 16.5906 18.1581 16.2471 17.9049 15.9939C17.6516 15.7406 17.3081 15.5983 16.95 15.5983C16.5918 15.5983 16.2483 15.7406 15.9951 15.9939C15.7418 16.2471 15.5995 16.5906 15.5995 16.9488C15.5995 17.3069 15.7418 17.6504 15.9951 17.9037C16.2483 18.1569 16.5918 18.2992 16.95 18.2992ZM7.49998 16.9492C7.49998 16.7719 7.46506 16.5964 7.39721 16.4326C7.32937 16.2688 7.22993 16.12 7.10457 15.9946C6.97921 15.8693 6.83039 15.7698 6.6666 15.702C6.50281 15.6341 6.32726 15.5992 6.14998 15.5992C5.97269 15.5992 5.79714 15.6341 5.63335 15.702C5.46956 15.7698 5.32074 15.8693 5.19538 15.9946C5.07002 16.12 4.97058 16.2688 4.90274 16.4326C4.83489 16.5964 4.79998 16.7719 4.79998 16.9492C4.79998 17.3073 4.94221 17.6506 5.19538 17.9038C5.44856 18.157 5.79193 18.2992 6.14998 18.2992C6.50802 18.2992 6.8514 18.157 7.10457 17.9038C7.35774 17.6506 7.49998 17.3073 7.49998 16.9492Z"}),s=e=>(0,r.jsx)(n,{...e,d:"M4.8 6.72962V18.2712L9.3585 16.3182L14.7585 19.0182L19.2 17.1129V5.57222L20.3727 5.07002C20.4412 5.04066 20.5159 5.02877 20.5901 5.0354C20.6643 5.04204 20.7357 5.067 20.7979 5.10804C20.8601 5.14908 20.9111 5.20491 20.9464 5.27053C20.9816 5.33616 21.0001 5.40951 21 5.48402V18.3009L14.7 21.0009L9.3 18.3009L3.6273 20.7318C3.55882 20.7612 3.48413 20.7731 3.40992 20.7664C3.33571 20.7598 3.26431 20.7348 3.20213 20.6938C3.13995 20.6528 3.08893 20.5969 3.05365 20.5313C3.01837 20.4657 2.99993 20.3923 3 20.3178V7.50092L4.8 6.72962ZM15.8187 11.3196L12 15.1374L8.1813 11.3196C7.42619 10.5644 6.91198 9.60219 6.70369 8.55471C6.49541 7.50724 6.6024 6.42153 7.01114 5.43486C7.41988 4.44819 8.11201 3.60488 9.00002 3.01156C9.88802 2.41824 10.932 2.10156 12 2.10156C13.068 2.10156 14.112 2.41824 15 3.01156C15.888 3.60488 16.5801 4.44819 16.9889 5.43486C17.3976 6.42153 17.5046 7.50724 17.2963 8.55471C17.088 9.60219 16.5738 10.5644 15.8187 11.3196ZM12 12.5922L14.5452 10.0461C15.0488 9.54269 15.3918 8.90123 15.5307 8.20287C15.6697 7.50451 15.5985 6.78062 15.3261 6.12274C15.0536 5.46486 14.5922 4.90255 14.0002 4.50693C13.4081 4.11131 12.7121 3.90015 12 3.90015C11.2879 3.90015 10.5919 4.11131 9.99983 4.50693C9.40779 4.90255 8.94637 5.46486 8.67393 6.12274C8.40149 6.78062 8.33026 7.50451 8.46925 8.20287C8.60825 8.90123 8.95122 9.54269 9.4548 10.0461L12 12.5922Z"}),o=e=>(0,r.jsx)(n,{...e,d:"M12.9 8.4V15.6C12.9 16.3161 12.6155 17.0028 12.1092 17.5092C11.6029 18.0155 10.9161 18.3 10.2 18.3H8.24701C8.0347 18.9007 7.61683 19.4071 7.06729 19.7295C6.51774 20.052 5.87189 20.1697 5.2439 20.062C4.61591 19.9543 4.04622 19.6281 3.63553 19.1409C3.22483 18.6538 2.99957 18.0372 2.99957 17.4C2.99957 16.7628 3.22483 16.1462 3.63553 15.6591C4.04622 15.1719 4.61591 14.8457 5.2439 14.738C5.87189 14.6303 6.51774 14.748 7.06729 15.0705C7.61683 15.3929 8.0347 15.8993 8.24701 16.5H10.2C10.4387 16.5 10.6676 16.4052 10.8364 16.2364C11.0052 16.0676 11.1 15.8387 11.1 15.6V8.4C11.1 7.68392 11.3845 6.99716 11.8908 6.49081C12.3972 5.98446 13.0839 5.7 13.8 5.7H16.5V3L21 6.6L16.5 10.2V7.5H13.8C13.5613 7.5 13.3324 7.59482 13.1636 7.7636C12.9948 7.93239 12.9 8.1613 12.9 8.4ZM5.70001 18.3C5.93871 18.3 6.16762 18.2052 6.33641 18.0364C6.50519 17.8676 6.60001 17.6387 6.60001 17.4C6.60001 17.1613 6.50519 16.9324 6.33641 16.7636C6.16762 16.5948 5.93871 16.5 5.70001 16.5C5.46132 16.5 5.2324 16.5948 5.06362 16.7636C4.89483 16.9324 4.80001 17.1613 4.80001 17.4C4.80001 17.6387 4.89483 17.8676 5.06362 18.0364C5.2324 18.2052 5.46132 18.3 5.70001 18.3Z"})},34332:(e,t,a)=>{"use strict";a.d(t,{QueryProvider:()=>s});var r=a(6892),n=a(16944),l=a(71036);let s=e=>{let{children:t}=e;return(0,r.jsx)(n.Ht,{client:l.q,children:t})}},39313:(e,t,a)=>{"use strict";a.d(t,{BE:()=>s,CC:()=>d,Dr:()=>l,GB:()=>p,Ow:()=>i,eM:()=>f,pV:()=>c});var r=a(59394),n=a(35028);let l={insights:!1,multiAccounts:!1,eanSearchMaintenance:!1},s={ads:"off",dre:"off"},o={off:void 0,beta:"BETA",novo:"NOVO",pro:"PRO",ativo:void 0},i=e=>o[e],d=(e,t,a)=>"BETA"===e&&a&&t,c=[{id:"main",label:null,items:[{kind:"simple",id:"onboarding",label:"Onboarding",icon:n.BF,route:"/dashboard/onboarding",disabled:!1}]},{id:"overview",label:"OVERVIEW",breadcrumbLabel:"Overview",items:[{kind:"simple",id:"dashboard",label:"Dashboard",icon:n.ww,iconSize:22,route:r.qX?"/dashboard":null,disabled:!r.qX,badge:r.qX?void 0:"Em breve"},{kind:"simple",id:"listings",label:"An\xfancios",icon:n.vw,iconSize:17.1,route:r.KV?"/dashboard/listings":null,disabled:!r.KV,chip:r.KV?"NOVO":void 0,badge:r.KV?void 0:"Em breve",requiresProductsV2:!0},{kind:"simple",id:"products",label:"Produtos",icon:n.iL,iconSize:16.96,route:r.qX?"/dashboard/products":null,disabled:!r.qX,badge:r.qX?void 0:"Em breve",maintenanceUntilProductsV2:!0},{kind:"simple",id:"suppliers",label:"Fornecedores",icon:n.YV,route:r.An?"/dashboard/suppliers":null,disabled:!r.An,badge:r.An?void 0:"Em breve"},{kind:"simple",id:"ads",label:"Publicidade",icon:n.R0,iconSize:22,route:"/dashboard/growth/ads",disabled:!1,requiresStage:"ads",requiresProductsV2:!0},{kind:"simple",id:"assistant",label:"Assistente",icon:n.RE,iconSize:20,route:"/dashboard/assistente",disabled:!1,chip:"NOVO",requiresAiService:!0},{kind:"simple",id:"analytics",label:"Insights",icon:n.uS,route:null,disabled:!0,badge:"Em breve",requiresFlag:"insights"},{kind:"simple",id:"multiaccounts",label:"Multi-contas",icon:n.VM,route:null,disabled:!0,badge:"Em breve",requiresFlag:"multiAccounts"}]},{id:"playground",label:"PLAYGROUND",breadcrumbLabel:"Playground",items:[{kind:"simple",id:"ean-search",label:"Pesquisar por EAN",icon:n.XE,route:"/dashboard/ean",disabled:!1,chip:"PRO",maintenanceFlag:"eanSearchMaintenance"},{kind:"simple",id:"analyses",label:"An\xe1lise de Produtos",icon:n._C,route:"/dashboard/analysis",disabled:!1},...r.jr?[{kind:"collapsible",id:"generators",label:"C\xf3digos de produto",icon:n.vW,storageKey:"cargoos_sidebar_generators",defaultExpanded:!0,subItems:[{id:"ean-generator",label:"Gerador de EAN",route:"/dashboard/generators/ean",disabled:!1},{id:"sku-generator",label:"Gerador de SKU",route:null,disabled:!0,badge:"Em breve"}]}]:[],{kind:"simple",id:"extension",label:"Extens\xe3o Cargoos",icon:n._M,route:"https://cargoos.com.br/extensao",disabled:!1,external:!0,iconSize:18}]},{id:"accounting",label:"CONTABILIDADE",breadcrumbLabel:"Contabilidade",items:[{kind:"simple",id:"dre",label:"DRE",icon:n.ft,route:"/dashboard/dre",disabled:!1,requiresStage:"dre",proOnly:!0},{kind:"simple",id:"general-costs",label:"Custos gerais",icon:n.kQ,route:r.VP?"/dashboard/costs":null,disabled:!r.VP,badge:r.VP?void 0:"Em breve"},{kind:"simple",id:"invoices",label:"Notas fiscais",icon:n.SQ,route:r.Nr?"/dashboard/invoices":null,disabled:!r.Nr,chip:r.Nr?"NOVO":void 0,badge:r.Nr?void 0:"Em breve"}]},{id:"comunidade",label:"COMUNIDADE",breadcrumbLabel:"Comunidade",items:[{kind:"simple",id:"afiliado",label:"Afiliados",icon:n.nz,route:"/dashboard/affiliate",disabled:!1,requiresFeature:"affiliate_panel"}]},{id:"admin",label:"ADMIN",breadcrumbLabel:"Admin",items:[{kind:"simple",id:"storybook",label:"Storybook",icon:n.dt,route:"/dashboard/storybook",disabled:!1,requiresAdmin:!0,iconSize:15.3}]}];c.flatMap(e=>e.items);let u=(e,t)=>
1"/dashboard"===t?e===t:e===t||e.startsWith("".concat(t,"/")),m=c.flatMap(e=>{var t;let a=null!=(t=e.breadcrumbLabel)?t:null;return e.items.flatMap(e=>"simple"===e.kind?e.disabled||!e.route||e.external?[]:[{route:e.route,sectionLabel:a,parentId:e.id,parentLabel:e.label,parentRoute:e.route,childId:null,childLabel:null,childRoute:null}]:e.subItems.flatMap(t=>!t.disabled&&t.route?[{route:t.route,sectionLabel:a,parentId:e.id,parentLabel:e.label,parentRoute:null,childId:t.id,childLabel:t.label,childRoute:t.route}]:[]))}),x=e=>{for(let t of m)if(u(e,t.route))return t;return null},p=e=>{let t=x(e);return t?{parentId:t.parentId,childId:t.childId}:{parentId:null,childId:null}},b=[{match:e=>/^\/dashboard\/ean\/[^/]+$/.test(e),label:"Detalhes"},{match:e=>/^\/dashboard\/growth\/ads\/[^/]+$/.test(e),label:"Campanha",middle:[{label:"Campanhas",href:"/dashboard/growth/ads"}]}],h=[{match:e=>/^\/dashboard\/settings(\/.*)?$/.test(e),label:"Configura\xe7\xf5es"}],f=e=>{var t,a,r,n,l,s;let o=(e=>{var t;return null!=(t=b.find(t=>t.match(e)))?t:null})(e),i=x(e);if(!i){let t=(e=>{var t;return null!=(t=h.find(t=>t.match(e)))?t:null})(e);return t?[{label:t.label,isCurrent:!0}]:[{label:"Dashboard",isCurrent:!0}]}let d=[];if(i.sectionLabel&&d.push({label:i.sectionLabel,isCurrent:!1}),null===i.childId){if(o){for(let e of(d.push({label:i.parentLabel,isCurrent:!1,href:null!=(t=i.parentRoute)?t:void 0}),null!=(a=o.middle)?a:[]))d.push({label:e.label,isCurrent:!1,href:e.href});d.push({label:o.label,isCurrent:!0})}else d.push({label:i.parentLabel,isCurrent:!0});return d}if(d.push({label:i.parentLabel,isCurrent:!1}),o){for(let e of(d.push({label:null!=(r=i.childLabel)?r:"",isCurrent:!1,href:null!=(n=i.childRoute)?n:void 0}),null!=(l=o.middle)?l:[]))d.push({label:e.label,isCurrent:!1,href:e.href});d.push({label:o.label,isCurrent:!0})}else d.push({label:null!=(s=i.childLabel)?s:"",isCurrent:!0});return d}},41242:(e,t,a)=>{"use strict";a.d(t,{AuthGridLayout:()=>c});var r=a(6892),n=a(35028),l=a(80219);let s={squareSize:4,gridGap:6,maxOpacity:.03,flickerChance:.1};function o(e){let{color:t,cardWidth:a,showLogo:n}=e;return(0,r.jsxs)("div",{className:"flex flex-1",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0 bg-secondary/70",children:(0,r.jsx)("div",{className:"w-full h-full border-r border-b border-border rounded-br-[4px] bg-background"})}),(0,r.jsx)("div",{className:"w-full ".concat(a," bg-secondary/70 relative overflow-hidden"),children:(0,r.jsxs)("div",{className:"w-full h-full border-b border-border rounded-b-[4px] bg-background relative overflow-hidden",children:[(0,r.jsx)(l.FlickeringGrid,{className:"absolute inset-0 z-0",color:t,...s}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-transparent via-background/50 to-background z-10"}),n?(0,r.jsxs)("div",{className:"absolute bottom-6 left-6 z-20 px-3",children:[(0,r.jsx)("img",{src:"/logo.svg",alt:"Cargoos",width:196,height:56,className:"h-14 w-auto dark:hidden"}),(0,r.jsx)("img",{src:"/logo-complete-white.svg",alt:"","aria-hidden":!0,width:196,height:56,className:"hidden h-14 w-auto dark:block"})]}):null]})}),(0,r.jsx)("div",{className:"flex-1 min-w-0 bg-secondary/70",children:(0,r.jsx)("div",{className:"w-full h-full border-l border-b border-border rounded-bl-[4px] bg-background"})})]})}function i(e){let{children:t,color:a,cardWidth:n}=e;return(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0 bg-secondary/70 relative overflow-hidden",children:(0,r.jsxs)("div",{className:"w-full h-full border-r border-border rounded-r-[4px] bg-background relative overflow-hidden",children:[(0,r.jsx)(l.FlickeringGrid,{className:"absolute inset-0 z-0",color:a,...s}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-l from-transparent via-background/50 to-background z-10"})]})}),(0,r.jsx)("div",{className:"w-full ".concat(n," bg-secondary/70"),children:(0,r.jsx)("div",{className:"w-full h-full relative z-20 overflow-hidden rounded-[4px] bg-card flex items-center justify-center",children:t})}),(0,r.jsx)("div",{className:"flex-1 min-w-0 bg-secondary/70 relative overflow-hidden",children:(0,r.jsxs)("div",{className:"w-full h-full border-l border-border rounded-l-[4px] bg-background relative overflow-hidden",children:[(0,r.jsx)(l.FlickeringGrid,{className:"absolute inset-0 z-0",color:a,...s}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-background/50 to-background z-10"})]})})]})}
1function d(e){let{color:t,cardWidth:a}=e;return(0,r.jsxs)("div",{className:"flex flex-1",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0 bg-secondary/70",children:(0,r.jsx)("div",{className:"w-full h-full border-r border-t border-border rounded-tr-[4px] bg-background"})}),(0,r.jsx)("div",{className:"w-full ".concat(a," bg-secondary/70 relative overflow-hidden"),children:(0,r.jsxs)("div",{className:"w-full h-full border-t border-border rounded-t-[4px] bg-background relative overflow-hidden",children:[(0,r.jsx)(l.FlickeringGrid,{className:"absolute inset-0 z-0",color:t,...s}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-background/50 to-background z-10"})]})}),(0,r.jsx)("div",{className:"flex-1 min-w-0 bg-secondary/70",children:(0,r.jsx)("div",{className:"w-full h-full border-l border-t border-border rounded-tl-[4px] bg-background"})})]})}let c=e=>{let{children:t,fill:a=!1,showLogo:l=!0,cardWidthClass:s}=e,{theme:c}=(0,n.DP)(),u="dark"===c?"rgb(255, 255, 255)":"rgb(0, 0, 0)",m=null!=s?s:"max-w-[460px]";return(0,r.jsxs)("div",{className:"flex flex-col ".concat(a?"h-full":"min-h-screen"),children:[(0,r.jsx)(o,{color:u,cardWidth:m,showLogo:l}),(0,r.jsx)(i,{color:u,cardWidth:m,children:t}),(0,r.jsx)(d,{color:u,cardWidth:m})]})}},42855:(e,t,a)=>{"use strict";a.d(t,{Os:()=>n.Os,ZO:()=>s,x0:()=>l});var r=a(78016),n=a(38640);let l=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],[t,a]=(0,r.useState)(0);return(0,r.useEffect)(()=>{if(!e)return;let t=()=>a(e=>e+1);return window.addEventListener(n.GK,t),()=>window.removeEventListener(n.GK,t)},[e]),t},s=(e,t)=>{let a=(0,r.useRef)(e);a.current=e,(0,r.useEffect)(()=>{if(!t)return;let e=null,r=!1,l=!1,s=!1,o=()=>{s||null!==e||(e=window.setTimeout(()=>void i(),300))},i=async()=>{if(e=null,!r&&l&&!s){l=!1,r=!0;try{await a.current()}catch(e){}finally{r=!1,l&&o()}}},d=()=>{l=!0,r||o()};return window.addEventListener(n.GK,d),()=>{s=!0,window.removeEventListener(n.GK,d),null!==e&&window.clearTimeout(e)}},[t])}},43114:(e,t,a)=>{"use strict";a.d(t,{S:()=>d});var r=a(6892),n=a(27106),l=a(78016),s=a(71919);let o=[.16,1,.3,1],i=[{quote:"Joguei 5 mil EANs num domingo e na segunda j\xe1 tinha o relat\xf3rio pronto. Antes isso levava uma semana na m\xe3o.",name:"Mariana Costa",role:"Mercado L\xedder \xb7 Eletr\xf4nicos"},{quote:"Vi que o Buy Box tava 18% abaixo do meu custo e j\xe1 tinham 6 sellers full. Cancelei a compra na hora.",name:"Felipe Ramos",role:"Mercado L\xedder Gold \xb7 Suplementos"},{quote:"Pego a planilha do fornecedor com 300 EANs, jogo tudo de uma vez e j\xe1 sei o que tem demanda. Priorizo antes de gastar um centavo.",name:"Juliana Ferreira",role:"Mercado L\xedder Platinum \xb7 Cosm\xe9ticos"},{quote:"Vi demanda no Nordeste pra um item que em SP j\xe1 tinha 12 sellers brigando. Mandei pelo full e vendeu tudo em duas semanas.",name:"Ricardo Santos",role:"Mercado L\xedder \xb7 Ferramentas"},{quote:"O mapa mostrou que meu produto vendia 3x mais no Sul, mas eu mandava tudo pra SP. Redirecionei o estoque e a margem subiu 8%.",name:"Amanda Oliveira",role:"Mercado L\xedder Gold \xb7 Utilidades"},{quote:"Agora abro o an\xfancio e j\xe1 vejo quem ganhou o Buy Box e por quanto. Ajustei o pre\xe7o e recuperei a posi\xe7\xe3o no mesmo dia.",name:"Lucas Mendes",role:"Mercado L\xedder Platinum \xb7 Inform\xe1tica"}],d=e=>{let{className:t}=e,[a,d]=(0,l.useState)(null),c=null===a?null:i[a];return(0,l.useEffect)(()=>{d(Math.floor(Math.random()*i.length))},[]),(0,r.jsx)("div",{role:"status","aria-label":"Carregando",className:(0,s.cn)("fixed inset-0 z-50 flex select-none flex-col items-center justify-center overflow-hidden bg-background px-6",t),children:(0,r.jsxs)("div",{className:"flex w-full max-w-xl flex-col items-center",children:[(0,r.jsx)("img",{src:"/logo.svg",alt:"Cargoos",draggable:!1,className:"h-16 w-auto dark:hidden"}),(0,r.jsx)("img",{src:"/logo-complete-white.svg",alt:"","aria-hidden":!0,draggable:!1,className:"hidden h-16 w-auto dark:block"}),(0,r.jsx)("div",{className:"relative mt-16 h-[3px] w-44 overflow-hidden rounded-full bg-foreground
1/[0.07]",children:(0,r.jsx)("span",{"aria-hidden":!0,className:"absolute inset-0 origin-left rounded-full bg-[#B1FE7B]",style:{animation:"cg-splash-fill 2.6s cubic-bezier(0.65, 0, 0.35, 1) infinite"}})}),(0,r.jsx)("div",{className:"relative mt-10 flex h-[96px] w-full items-start justify-center",children:c&&(0,r.jsxs)(n.m.figure,{className:"absolute inset-x-0 top-0 text-center",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.5,ease:o},children:[(0,r.jsxs)("blockquote",{className:"text-pretty text-[14px] leading-relaxed tracking-[-0.01em] text-foreground/80",style:{fontFamily:"var(--font-sans)"},children:["â",c.quote,"â"]}),(0,r.jsxs)("figcaption",{className:"mt-4 text-[12px] text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:c.name})," ",c.role]})]})})]})})}},47442:(e,t,a)=>{"use strict";a.d(t,{DashboardShell:()=>a2});var r=a(6892),n=a(78016),l=a(54094),s=a(60393),o=a(94615),i=a(17919),d=a(71919),c=a(39313),u=a(77516),m=a(37444),x=a.n(m),p=a(55432);let b={width:2253,height:549},h=e=>{let{collapsed:t}=e;return(0,r.jsxs)("div",{className:(0,d.cn)("relative h-[31px] overflow-hidden","scale-120 origin-left -translate-x-[1.35px] -translate-y-[1.26px]","transition-[width] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]",t?"w-[28.91px]":"w-42"),children:[(0,r.jsx)(u.default,{src:"https://cdn.cargoos.com.br/logo.svg",alt:"Cargoos",width:b.width,height:b.height,draggable:!1,priority:!0,className:"h-[31px] w-42 max-w-none object-left object-contain dark:hidden"}),(0,r.jsx)(u.default,{src:"https://cdn.cargoos.com.br/logo-complete-white.svg",alt:"",width:b.width,height:b.height,"aria-hidden":!0,draggable:!1,priority:!0,className:"hidden h-[31px] w-42 max-w-none object-left object-contain dark:block"})]})},f=e=>{let{collapsed:t,onExpand:a}=e,n=(0,p.q)(e=>e.state),l=(null==n?void 0:n.status)==="completed"||(null==n?void 0:n.status)==="dismissed";return(0,r.jsx)("div",{className:"border-b border-border p-4 pb-4",children:(0,r.jsx)(x(),{href:l?"/dashboard":"/dashboard/onboarding","aria-label":t?"Expandir sidebar":"Cargoos",onClick:e=>{!t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||0===e.button&&(e.preventDefault(),null==a||a())},className:"flex w-full cursor-pointer items-center",children:(0,r.jsx)(h,{collapsed:t})})})};var g=a(25391),v=a(4820);let y=e=>{let{count:t,className:a}=e;return t<=0?null:(0,r.jsx)("span",{className:(0,d.cn)("inline-flex h-3.5 min-w-3.5 shrink-0 items-center justify-center rounded-[4.1px] px-1","text-[9.5px] font-bold leading-none text-white","bg-linear-to-b from-red-500 to-red-600","border-[0.5px] border-white/20","ring-1 ring-red-700/20",a),children:t})},j=()=>{let{state:e}=(0,v.z)();if(!e||"completed"===e.status||"dismissed"===e.status)return null;let t=e.progress.total-e.progress.completed;return(0,r.jsx)(y,{count:t,className:"ml-auto"})};var C=a(22389);let w=()=>{let e=(0,C.n)(e=>e.variablesNeedingEntry.length),t=(0,C.n)(e=>e.hydrate);return((0,n.useEffect)(()=>{t()},[t]),e>0)?(0,r.jsx)(y,{count:e,className:"ml-auto"}):null};var k=a(49169);let N=(e,t,a)=>{let l=(0,n.useRef)(null),[s,o]=(0,n.useState)(null),[i,c]=(0,n.useState)(!1);(0,n.useEffect)(()=>{c(!0)},[]);let u=(0,n.useCallback)(()=>{l.current&&(clearTimeout(l.current),l.current=null)},[]),m=(0,n.useCallback)(()=>{t&&(u(),l.current=setTimeout(()=>{let e=a.current;if(!e)return;let t=e.getBoundingClientRect();o({top:t.top+t.height/2,left:t.right+14})},120))},[t,u,a]),x=(0,n.useCallback)(()=>{u(),o(null)},[u]);return(0,n.useEffect)(()=>()=>u(),[u]),(0,n.useEffect)(()=>{t||x()},[t,x]),{handlers:{onMouseEnter:m,onMouseLeave:x,onFocus:m,onBlur:x},portal:i&&t&&s?(0,k.createPortal)((0,r.jsxs)("div",{role:"tooltip",style:{position:"fixed",top:s.top,left:s.left,fontFamily:"var(--font-sans)",willChange:"transform, opacity"},className:(0,d.cn)("cg-sidebar-tooltip pointer-events-none z-[100] relative","rounded-lg px-3 py-2 text-sm font-medium leading-none whitespace-nowrap tracking-[-0.005em]","border border-border/70 bg-popover text-popover-foreground","shadow-[0_1px_2px_rgba(15,23,30,0.06),0_8px_24px_-12px_rgba(15,23,30,0.18)]","dark:border-border/60 dar
1k:shadow-[0_2px_8px_rgba(0,0,0,0.45),0_16px_32px_-16px_rgba(0,0,0,0.6)]"),children:[(0,r.jsx)("span",{"aria-hidden":!0,className:(0,d.cn)("absolute top-1/2 -left-[4px] h-[7px] w-[7px] -translate-y-1/2 rotate-45 rounded-[1.5px]","border-b border-l border-border/70 bg-popover","dark:border-border/60")}),(0,r.jsx)("span",{className:"relative",children:e})]}),document.body):null}},E="bg-[#B1FE7B] text-[#052D2B] dark:bg-[#B1FE7B]/15 dark:text-[#B1FE7B]",F={NOVO:E,PRO:E,BETA:E},A=e=>{var t,a;let{item:l,isActive:o,isCollapsed:i,gated:c=!1,onNavigate:u}=e,{push:m}=(0,s.useRouter)(),x=(0,g.S)(e=>e.setOpen),p=l.icon,b=!l.disabled&&o,h=(0,n.useRef)(null),f=l.disabled?"".concat(l.label," â ").concat(null!=(t=l.badge)?t:"Em breve"):c?"".concat(l.label," â exclusivo do Pro"):l.label,{handlers:v,portal:y}=N(f,i,h);return(0,r.jsxs)("div",{className:"group/item relative",children:[(0,r.jsxs)("button",{ref:h,type:"button",onClick:e=>{if(l.disabled||!l.route)return void e.preventDefault();if(c){e.preventDefault(),null==u||u(),x(!0);return}if(l.external){window.open(l.route,"_blank","noopener,noreferrer"),null==u||u();return}m(l.route),null==u||u()},disabled:l.disabled,"aria-disabled":l.disabled||void 0,"aria-current":b?"page":void 0,"aria-label":i?f:void 0,...v,className:(0,d.cn)("relative flex w-full items-center overflow-hidden rounded-[10px] border border-transparent","h-[36px] justify-start",i?"px-2":"px-3","transition-all duration-200 ease-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime/40",i&&"w-[40px]",l.disabled&&"cursor-default text-muted-foreground/55 dark:text-muted-foreground/45",b&&"bg-[#b1fe7b]/80 text-[#214d12] dark:bg-lime",!l.disabled&&!o&&"text-[#262626]/90 dark:text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer"),children:[(0,r.jsx)(p,{size:null!=(a=l.iconSize)?a:20,className:(0,d.cn)("shrink-0 transition-all duration-300",i&&"translate-x-0.5",b&&"text-[#214d12]"),style:l.iconSize?{minWidth:21}:void 0}),(0,r.jsxs)("div",{className:(0,d.cn)("flex flex-1 items-center overflow-hidden","transition-[opacity,width,margin] duration-300 ease-in-out",i?"ml-0 w-0 opacity-0":"ml-3 opacity-100"),children:[(0,r.jsx)("span",{className:"truncate text-[13px] font-medium whitespace-nowrap",style:{fontFamily:"var(--font-sans)"},children:l.label}),l.badge&&(0,r.jsx)("span",{className:(0,d.cn)("ml-auto shrink-0 rounded-[4.1px] px-1.75 py-1 text-[10px] font-semibold uppercase tracking-wide leading-none","Manuten\xe7\xe3o"===l.badge?"bg-[#3B82F6]/12 text-[#2563EB] dark:bg-[#3B82F6]/20 dark:text-[#60A5FA]":"bg-zinc-100 text-zinc-500 dark:bg-zinc-800/60 dark:text-zinc-400"),children:l.badge}),l.chip&&!l.badge&&!b&&(0,r.jsx)("span",{className:(0,d.cn)("ml-auto shrink-0 rounded-[4.1px] px-1.75 py-1 text-[10px] font-semibold uppercase tracking-wide leading-none",F[l.chip]),children:l.chip}),"onboarding"===l.id&&!l.badge&&!l.chip&&(0,r.jsx)(j,{}),"general-costs"===l.id&&!l.badge&&(0,r.jsx)(w,{})]})]}),y]})};var B=a(35028);let S=(e,t)=>{try{window.localStorage.setItem(e,t?"1":"0")}catch(e){}},D=e=>{var t;let{item:a,hasActiveChild:l,activeChildId:o,isCollapsed:i,onNavigate:c}=e,{push:u}=(0,s.useRouter)(),m=a.icon,x=(0,n.useRef)(null),p=null!=(t=a.subItems.find(e=>!e.disabled&&e.route))?t:null,[b,h]=(0,n.useState)(()=>{var e;return((e,t)=>{try{let t=window.localStorage.getItem(e);if("1"===t)return!0;if("0"===t)return!1}catch(e){}return t})(a.storageKey,null!=(e=a.defaultExpanded)?e:l)});(0,n.useEffect)(()=>{l&&!b&&(h(!0),S(a.storageKey,!0))},[l,b,a.storageKey]);let f=(0,n.useCallback)(()=>{if(i){(null==p?void 0:p.route)&&(u(p.route),null==c||c());return}h(e=>{let t=!e;return S(a.storageKey,t),t})},[i,p,u,c,a.storageKey]),g=a.badge?"".concat(a.label," â Em breve"):a.label,{handlers:v,portal:y}=N(g,i,x);return(0,r.jsxs)("div",{className:"space-y-0.5",children:[(0,r.jsxs)("div",{className:"group/item relative",children:[(0,r.jsxs)("button",{ref:x,type:"button",onClick:f,"aria-expanded":i?void 0:b,"aria-controls":i?void 0:"sidebar-sub-".concat(a.id),"aria-label":i?g:void 0,...v,className:(0,d.cn)("relative flex w-full items-center overflow-hidden rounded-[10px] border border-transparent","h-[36px] justify-start",i?"w-[40px] px-2":"px-3","cursor-pointer transition-all duration-200 ease-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime/40",i&&l&&"bg-[#b1fe7b]/80 text-[#214d12] dark:bg-lime",!i&&l&&"text-foreground",!l&&"text-[#262626]/90 hover:bg-accent hover:text-foreground dark:text-muted-foreground"),children:[(0,r.jsx)(m,{size:20,className:(0,d.cn)("shrink-0 transition-all duration-300",i&&"translate-x-0.5",i&&l&&"text-[#214d12]")}),(0,r.jsxs)("div",{className:(0,d.cn)("flex flex-1 items-center overflow-hidden","transition-[opacity,width,margin] duration-300 ease-in-out",i?"ml-0 w-0 opacity-0":"ml-3 opacity-100"),children:[(0,r.jsx)("span",{className:"truncate text-[13px] font-medium whitespace-nowrap",style:{fontFamily:"var(--font-sans)"},children:a.label}),a.badge&&(0,r.jsx)("span",{className:(0,d.cn)("ml-2 shrink-0 rounded-[4.1px] px-1.75 py-1 text-[10px] font-semibold uppercase tracking-wide leading-none","bg-zinc-100 text-zinc-500 dark:bg-zinc-800/60 dark:text-zinc-400"),children:a.badge}),(0,r.jsx)(B.K3,{size:14,className:(0,d.cn)("ml-auto shrink-0 text-muted-foreground","transition-transform duration-300 ease-in-out",b&&"rotate-90")})]})]}),y]}),!i&&(0,r.jsx)("div",{id:"sidebar-sub-".concat(a.id),className:"grid transition-[grid-template-rows] duration-300 ease-in-out",style:{gridTemplateRows:b?"1fr":"0fr"}
1,children:(0,r.jsx)("div",{className:"overflow-hidden",children:(0,r.jsxs)("div",{className:"relative ml-4 pl-2.5 pt-0.5",children:[(0,r.jsx)("div",{"aria-hidden":!0,className:"absolute left-0 top-1 bottom-1 w-px bg-border"}),(0,r.jsx)("div",{className:"relative space-y-0.5",children:a.subItems.map(e=>{let t=e.id===o&&!e.disabled;return(0,r.jsxs)("button",{type:"button",disabled:e.disabled,onClick:()=>(e=>{!e.disabled&&e.route&&(u(e.route),null==c||c())})(e),"aria-disabled":e.disabled||void 0,"aria-current":t?"page":void 0,className:(0,d.cn)("flex h-[36px] w-full items-center justify-between gap-2 overflow-hidden rounded-[10px] px-3 py-0 text-[13px] font-medium","transition-all duration-200 ease-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime/40",e.disabled?"cursor-default text-muted-foreground/55 dark:text-muted-foreground/45":t?"cursor-pointer bg-[#b1fe7b]/80 text-[#214d12] dark:bg-lime":"cursor-pointer text-[#262626]/90 hover:bg-accent hover:text-foreground dark:text-muted-foreground"),children:[(0,r.jsx)("span",{className:"truncate whitespace-nowrap",style:{fontFamily:"var(--font-sans)"},children:e.label}),e.badge&&(0,r.jsx)("span",{className:(0,d.cn)("shrink-0 rounded-[4.1px] px-1.75 py-1 text-[10px] font-semibold uppercase tracking-wide leading-none","bg-zinc-100 text-zinc-500 dark:bg-zinc-800/60 dark:text-zinc-400"),children:e.badge})]},e.id)})})]})})})]})};var L=a(69589);let P=e=>{let t=e.trim();if(!t)return"?";let a=t.split(/\s+/);return a.length>=2?(a[0].charAt(0)+a[a.length-1].charAt(0)).toUpperCase():t.slice(0,2).toUpperCase()};var M=a(61880);let _=[{id:"account",title:"Criar conta",description:"Sua conta Cargoos est\xe1 pronta.",defaultCompleted:!0},{id:"plan",title:"Escolher um plano",description:"Teste 7 dias gr\xe1tis ou contrate o Pro.",defaultCompleted:!0},{id:"extension",title:"Instalar extens\xe3o",description:"Adicione a extens\xe3o ao Chrome para calcular em tempo real.",defaultCompleted:!1},{id:"ml",title:"Conectar Mercado Livre",description:"Desbloqueia a an\xe1lise de contas e m\xe9tricas.",defaultCompleted:!1}],z="cargoos:setup-changed",R=e=>{let{collapsed:t}=e,{trial:a,isTrial:n,trialDaysRemaining:l,paidTrial:s,loading:o}=(0,i.q)();if(o)return null;if(n&&a){let e=Math.max(1,Math.ceil((a.expiresAt-a.startedAt)/864e5));return(0,r.jsx)(T,{daysRemaining:null!=l?l:0,totalDays:e})}if(!s)return null;let d=Math.max(1,Math.round((s.expiresAt-s.startedAt)/864e5));return(0,r.jsx)(T,{daysRemaining:Math.min(d,s.daysRemaining),totalDays:d})},T=e=>{let{daysRemaining:t,totalDays:a}=e,n=a>0?t/a*100:0,l=t<=2,s=1===t?"1 dia":"".concat(t," dias");return(0,r.jsxs)("div",{role:"status","aria-label":"Trial Pro \xb7 ".concat(s," restantes"),className:"space-y-2.5 pb-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"text-[12px] font-medium tracking-[-0.02em] text-foreground",style:{fontFamily:"var(--font-sans)"},children:"Trial Pro"}),(0,r.jsx)("span",{className:(0,d.cn)("inline-flex items-center rounded-[7px] px-2 py-0.5","text-[12px] font-medium tracking-[-0.02em] tabular-nums",l?"bg-amber-100 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300":"bg-secondary text-muted-foreground dark:bg-foreground
1/10"),style:{fontFamily:"var(--font-sans)"},children:s})]}),(0,r.jsx)("div",{role:"progressbar","aria-valuenow":Math.round(n),"aria-valuemin":0,"aria-valuemax":100,"aria-hidden":"true",className:(0,d.cn)("relative h-1.5 w-full overflow-hidden rounded-full",l?"bg-amber-200/60 dark:bg-amber-900/40":"bg-[#1E4345]/8"),children:(0,r.jsx)("div",{className:(0,d.cn)("h-full rounded-full transition-[width] duration-500 ease-out",l?"bg-amber-500 dark:bg-amber-400":"bg-[#9EEA6C]"),style:{width:"".concat(n,"%")}})})]})},I=e=>{let{size:t=16,...a}=e;return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",...a,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M13.2 6.6L14.39 5.17L17.23 7.6L18.43 6.18L15.59 3.75L16.39 2.8L14.95 1.64L7.65 10.41C5.93 9.66 3.87 10.03 2.61 11.53C1.87 12.42 1.51 13.56 1.61 14.7C1.71 15.85 2.26 16.91 3.15 17.65C4.03 18.39 5.17 18.75 6.32 18.65C7.46 18.55 8.52 18 9.26 17.11C10.53 15.61 10.45 13.15 9.03 11.57L11.97 8.06L14.88 10.46L16.04 9.03L13.2 6.6L13.2 6.6ZM7.71 15.96C6.86 16.98 5.39 17.16 4.31 16.26C3.24 15.36 3.18 13.86 4.02 12.87C4.85 11.87 6.4 11.72 7.41 12.57C7.9 12.98 8.2 13.57 8.26 14.2C8.31 14.84 8.12 15.47 7.71 15.96ZM5.35 0.97L4.42 3.03L2.37 3.96L4.42 4.89L5.35 6.94L6.28 4.89L8.33 3.96L6.28 3.03L5.35 0.97Z",fill:"currentColor"})})},V="bg-[#B1FE7B] text-[#052D2B] dark:bg-[#B1FE7B]/15 dark:text-[#B1FE7B]",O={pro:{label:"Pro",cls:V},trial:{label:"Trial",cls:V},affiliate:{label:"Afiliado",cls:V},admin:{label:"Admin",cls:V},free:{label:"Free",cls:"bg-[#B1FE7B] text-[#052D2B] dark:bg-[#B1FE7B]/15 dark:text-[#B1FE7B]"}},q=e=>{let{plan:t}=e;return(0,r.jsx)("span",{className:(0,d.cn)("inline-flex shrink-0 items-center rounded-[4.1px] px-1.75 py-1 text-[10px] font-semibold uppercase tracking-wide leading-none",O[t].cls),style:{fontFamily:"var(--font-sans)"},children:O[t].label})},H=e=>{let{icon:t,label:a,href:n,onSelect:l}=e,s=(0,d.cn)("relative flex w-full cursor-pointer select-none items-center gap-2 rounded-[12px] px-2 py-1.5 min-h-[36px] text-[14px]","text-[#262626] dark:text-foreground hover:bg-[#262626]/[0.04] dark:hover:bg-accent/50","transition-all duration-150 active:scale-[0.98]","outline-none focus-visible:bg-[#262626]/[0.04] dark:focus-visible:bg-accent/50"),o={fontFamily:"var(--font-sans)"},i=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{size:16,className:"shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:a})]});return n?(0,r.jsx)(x(),{href:n,role:"menuitem",onClick:l,className:s,style:o,children:i}):(0,r.jsx)("button",{type:"button",role:"menuitem",onClick:l,className:s,style:o,children:i})},U=e=>{var t;let{collapsed:a,onToggleCollapsed:l,onNavigate:o,showCollapseToggle:c=!0}=e,{user:u,signOut:m}=(0,L.A)(),{replace:x}=(0,s.useRouter)(),[p,b]=(0,n.useState)(!1),[h,f]=(0,n.useState)(null),v=(0,n.useRef)(null),y=(0,n.useRef)(null),j=(0,n.useRef)(null),{isTrial:C,isPremium:w,isPaidTrial:k,role:E}=(0,i.q)(),F=C||k,A=(0,g.S)(e=>e.setOpen),S=(0,M.lH)(e=>e.openSettings),D=(()=>{let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=()=>t((()=>{let e=(()=>{try{let e=window.localStorage.getItem("cargoos_setup_completed");return new Set(e?JSON.parse(e):[])}catch(e){return new Set}})(),t=new Set;for(let e of _)e.defaultCompleted&&t.add(e.id);for(let a of e)t.add(a);return t.size===_.length})());return e(),window.addEventListener(z,e),()=>window.removeEventListener(z,e)},[]),e})(),T=F&&!a;(0,n.useEffect)(()=>{if(!p)return;let e=e=>{var t;(null==(t=v.current)?void 0:t.contains(e.target))||b(!1)},t=e=>{"Escape"===e.key&&b(!1)};return window.addEventListener("mousedown",e),window.addEventListener("keydown",t),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("keydown",t)}},[p]);let{handlers:V,portal:O}=N("Conta",a&&!p,y),{handlers:U,portal:G}=N(a?"Expandir sidebar":"Recolher sidebar",a,j);if(!u)return null;let Z=(null==(t=u.name)?void 0:t.trim())||u.email.split("@")[0]||"Voc\xea",W=P(Z),K=u.image&&u.image!==h?u.image:null,Q=async()=>{b(!1),null==o||o();try{await m()}catch(e){}try{window.localStorage.removeItem("cargoos_bearer_token")}catch(e){}window.location.replace("/auth?signedout=1")};return(0,r.jsxs)(r.Fragment,{children:[T&&(0,r.jsx)("div",{className:(0,d.cn)("p-3",D&&"border-t border-border"),children:(0,r.jsx)("div",{className:"-mx-3 grid transition-[grid-template-rows,opacity] duration-300 ease-[
1cubic-bezier(0.16,1,0.3,1)]",style:{gridTemplateRows:a||!F?"0fr":"1fr",opacity:a||!F?0:1},"aria-hidden":a||!F,children:(0,r.jsx)("div",{className:"overflow-hidden",children:(0,r.jsxs)("div",{className:"px-3 pt-1.5",children:[!D&&(0,r.jsx)("div",{className:"-mx-3 h-px bg-border","aria-hidden":!0}),(0,r.jsx)("div",{className:(0,d.cn)(!D&&"pt-1.5"),children:(0,r.jsx)(R,{collapsed:a})})]})})})}),(0,r.jsx)("div",{className:"shrink-0 border-t border-border py-2",children:(0,r.jsx)("div",{className:"px-3",children:(0,r.jsxs)("div",{ref:v,className:"relative",children:[(0,r.jsxs)("button",{ref:y,type:"button",onClick:()=>b(e=>!e),"aria-expanded":p,"aria-haspopup":"menu","aria-label":a?"Conta":void 0,...V,className:(0,d.cn)("group flex items-center rounded-[12px]",a?"h-12 -mx-1 w-12 justify-center translate-x-px":"min-h-[56px] w-full px-2 py-2","cursor-pointer text-foreground transition-all duration-150 ease-out","hover:bg-accent/50 active:scale-[0.98]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime/40"),children:[(0,r.jsxs)("span",{className:(0,d.cn)("relative shrink-0",a&&"translate-x-[2px]"),children:[(0,r.jsx)("span",{className:(0,d.cn)("flex h-10 w-10 items-center justify-center overflow-hidden rounded-[8px]","border border-border bg-foreground
1/[0.04]","transition-colors group-hover:bg-foreground/[0.06]"),children:K?(0,r.jsx)("img",{src:K,alt:"",referrerPolicy:"no-referrer",draggable:!1,onError:()=>f(K),className:"h-full w-full object-cover"}):(0,r.jsx)("span",{className:"text-[13px] font-medium leading-none tracking-tight text-[#052D2B] dark:text-foreground",style:{fontFamily:"var(--font-sans)"},children:W})}),(0,r.jsx)("span",{"aria-hidden":!0,className:"absolute -bottom-0.5 -right-0.5 size-3 rounded-full bg-[#22C55E] ring-2 ring-card"})]}),!a&&(0,r.jsxs)("span",{className:"ml-3 flex min-w-0 flex-1 flex-col gap-0.5 text-left",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"min-w-0 truncate text-[14px] font-medium leading-tight text-foreground",style:{fontFamily:"var(--font-sans)"},children:Z}),(0,r.jsx)(q,{plan:"admin"===E?"admin":"influencer"===E?"affiliate":k||C?"trial":w?"pro":"free"})]}),(0,r.jsx)("span",{className:"truncate text-[12px] leading-tight text-[#5C5C5C] dark:text-muted-foreground",style:{fontFamily:"var(--font-sans)"},children:u.email})]})]}),p&&(0,r.jsxs)("div",{role:"menu","aria-label":"Menu da conta",className:(0,d.cn)("absolute z-50 bottom-0 left-full ml-4","w-[230px] overflow-hidden rounded-[16px] border border-[#262626]/8 bg-popover","shadow-[0_12px_24px_rgba(0,0,0,0.08),0_4px_8px_rgba(0,0,0,0.04)]","animate-[user-dropdown-in_200ms_cubic-bezier(0.16,1,0.3,1)_forwards]"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-[#262626]/8 dark:border-border px-3 py-2.5",children:[(0,r.jsx)("h2",{className:"text-[14px] font-medium text-[#262626]/50 dark:text-muted-foreground",style:{fontFamily:"var(--font-sans)"},children:"Conta"}),(0,r.jsx)("button",{type:"button",onClick:()=>b(!1),"aria-label":"Fechar menu",className:(0,d.cn)("flex h-6 w-6 items-center justify-center rounded-md","text-[#262626]/40 dark:text-muted-foreground/60 hover:text-[#262626] dark:hover:text-foreground hover:bg-[#262626]/[0.04] dark:hover:bg-accent/60","transition-all duration-150 active:scale-[0.96] cursor-pointer"),children:(0,r.jsx)(B.X,{size:14})})]}),(0,r.jsxs)("div",{className:"space-y-0.5 p-2",children:[w?(0,r.jsx)(H,{icon:B.uW,label:"Cobran\xe7a",onSelect:()=>{b(!1),null==o||o(),(0,M.FV)()}}):(0,r.jsx)(H,{icon:I,label:"Upgrade para Pro",onSelect:()=>{b(!1),A(!0)}}),(0,r.jsx)(H,{icon:B.OB,label:"Configura\xe7\xf5es",onSelect:()=>{b(!1),S()}})]}),(0,r.jsx)("div",{className:"mx-3 h-px bg-[#262626]/8 dark:bg-border/60"}),(0,r.jsx)("div",{className:"p-2",children:(0,r.jsxs)("button",{type:"button",role:"menuitem",onClick:Q,className:(0,d.cn)("relative flex w-full cursor-pointer select-none items-center gap-2 rounded-[12px] px-2 py-1.5 min-h-[36px] text-[14px]","text-[#EF4444] hover:text-[#EF4444] hover:bg-[#EF4444]/[0.08]","dark:text-[#F87171]/80 dark:hover:text-[#F87171] dark:hover:bg-[#F87171]/[0.10]","transition-all duration-150 active:scale-[0.98]","outline-none focus-visible:bg-[#EF4444]/[0.08] dark:focus-visible:bg-[#F87171]/[0.10]"),style:{fontFamily:"var(--font-sans)"},children:[(0,r.jsx)(B.Ls,{size:16,className:"-scale-x-100"}),(0,r.jsx)("span",{children:"Sair"})]})})]}),O]})})}),c&&(0,r.jsx)("div",{className:"shrink-0 border-t border-border py-2",children:(0,r.jsxs)("div",{className:"px-3",children:[(0,r.jsxs)("button",{ref:j,type:"button",onClick:l,"aria-label":a?"Expandir sidebar":"Recolher sidebar",...U,className:(0,d.cn)("group flex h-12 items-center overflow-hidden rounded-[12px] bg-po",a?"-mx-1 w-12 justify-center":"w-full pl-3","bg-foreground
1/[0.04] hover:bg-foreground/[0.06]","text-foreground/75 hover:text-foreground","cursor-pointer transition-all duration-150 ease-out active:scale-[0.98]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime/40",a&&"translate-x-1"),children:[(0,r.jsx)("span",{className:(0,d.cn)("flex items-center justify-center"),children:a?(0,r.jsx)(B.K3,{size:19}):(0,r.jsx)(B.ZK,{size:19})}),!a&&(0,r.jsx)("span",{className:"ml-2.5 whitespace-nowrap text-[14px] font-medium leading-none",style:{fontFamily:"var(--font-sans)"},children:"Recolher sidebar"})]}),G]})})]})},G=e=>{let{collapsed:t,isMobile:a,mobileOpen:l,onToggleCollapsed:o,onCloseMobile:u,aiServiceConfigured:m=!1,flags:x=c.Dr,stages:p=c.BE,productsReadModel:b=null}=e,h=(0,s.usePathname)(),{parentId:g,childId:v}=(0,c.GB)(h),{hasFeature:y,isFree:j,resolved:C,role:w}=(0,i.q)(),k=(0,n.useMemo)(()=>c.pV.map(e=>({...e,items:e.items.filter(e=>"simple"!==e.kind||(!e.requiresAdmin||"admin"===w)&&(!e.requiresAiService||!!m)&&(!e.requiresFlag||!!x[e.requiresFlag])&&(!e.requiresStage||"off"!==p[e.requiresStage])&&(!e.requiresProductsV2||"V2"===b)&&(!e.requiresFeature||y(e.requiresFeature))).map(e=>"simple"===e.kind&&e.requiresStage?{...e,chip:(0,c.Ow)(p[e.requiresStage])}:e).map(e=>"simple"===e.kind&&(e.maintenanceUntilProductsV2&&"V2"!==b||e.maintenanceFlag&&x[e.maintenanceFlag])?{...e,disabled:!0,route:null,badge:"Manuten\xe7\xe3o"}:e)})).filter(e=>e.items.length>0),[m,x,y,b,w,p]),N=!a&&t,E=()=>{a&&u()};return(0,r.jsxs)(r.Fragment,{children:[a&&(0,r.jsx)("div",{"aria-hidden":!0,onClick:u,className:(0,d.cn)("fixed inset-0 z-40 bg-foreground
1/40 backdrop-blur-sm","transition-opacity duration-200 ease-out",l?"opacity-100":"pointer-events-none opacity-0")}),(0,r.jsxs)("aside",{"aria-label":"Navega\xe7\xe3o principal","data-qa":"dashboard-sidebar",className:(0,d.cn)("flex flex-col border-r border-border bg-card","transition-[width,transform] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]",a?(0,d.cn)("fixed inset-y-0 left-0 z-50 w-[260px]","pb-[env(safe-area-inset-bottom)]",l?"translate-x-0":"-translate-x-full"):(0,d.cn)("relative h-full shrink-0",N?"w-[64px]":"w-[252px]")),style:a?{height:"100dvh"}:void 0,children:[(0,r.jsx)(f,{collapsed:N,onExpand:o}),(0,r.jsx)("nav",{"aria-label":"Itens de navega\xe7\xe3o",className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain p-3 scrollbar-hide",children:k.map((e,t)=>{var a;return(0,r.jsxs)("div",{className:(0,d.cn)(t>0&&"mt-6"),role:"group","aria-label":null!=(a=e.label)?a:void 0,children:[e.label&&(N?(0,r.jsx)("div",{"aria-hidden":!0,className:"mx-2 mb-2 h-px -translate-x-1 bg-border"}):(0,r.jsx)("div",{className:(0,d.cn)("mb-3 px-2 text-[11px] font-medium uppercase tracking-[0.06em]","text-muted-foreground/70"),style:{fontFamily:"var(--font-sans)"},children:e.label})),(0,r.jsx)("div",{className:"space-y-2",children:e.items.map(e=>"simple"===e.kind?(0,r.jsx)(A,{item:e,isActive:g===e.id,isCollapsed:N,gated:(0,c.CC)(e.chip,j,C)||!0===e.proOnly&&"PRO"===e.chip&&C&&j,onNavigate:E},e.id):(0,r.jsx)(D,{item:e,hasActiveChild:g===e.id,activeChildId:v,isCollapsed:N,onNavigate:E},e.id))})]},e.id)})}),(0,r.jsx)("div",{className:"shrink-0",children:(0,r.jsx)(U,{collapsed:N,onToggleCollapsed:o,onNavigate:E,showCollapseToggle:!a})})]})]})};var Z=a(62941),W=a(25179),K=a(98251);let Q={update:"Estamos passando por uma atualiza\xe7\xe3o. Instabilidades podem acontecer.",maintenance:"Estamos atualizando nossos servidores. Alguns dados podem atrasar.",incident:"Estamos com uma instabilidade e j\xe1 estamos resolvendo."},J={update:{bar:"bg-[#3B82F6]/[0.18] text-[#1D4ED8] dark:bg-[#3B82F6]/15 dark:text-[#93C5FD]",icon:"text-[#2563EB] dark:text-[#93C5FD]"},maintenance:{bar:"bg-[#F59E0B]/[0.22] text-[#B45309] dark:bg-[#F59E0B]/15 dark:text-[#FBBF24]",icon:"text-[#D97706] dark:text-[#FBBF24]"},incident:{bar:"bg-[#EF4444]/[0.16] text-[#B91C1C] dark:bg-[#EF4444]/15 dark:text-[#F87171]",icon:"text-[#DC2626] dark:text-[#F87171]"}},X={update:Z.R,maintenance:W.N,incident:K.Q},$=e=>{let{kind:t}=e;if("off"===t)return null;let a=X[t];return(0,r.jsxs)("div",{role:"status","data-qa":"status-banner","data-kind":t,className:(0,d.cn)("flex w-full shrink-0 items-center justify-center gap-2 px-4 py-2.5",J[t].bar),children:[(0,r.jsx)(a,{size:16,weight:"fill","aria-hidden":"true",className:(0,d.cn)("shrink-0",J[t].icon)}),(0,r.jsx)("p",{className:"truncate text-[13.5px] font-medium tracking-[-0.01em]",style:{fontFamily:"var(--font-sans)"},title:Q[t],children:Q[t]})]})};var Y=a(37020),ee=a(16928),et=a(94520),ea=a(91575),er=a(52337),en=a(16944),el=a(2104);let es=["auth","has-password"],eo=async()=>{var e;let t=await el.yK.listAccounts();return(null!=(e=null==t?void 0:t.data)?e:[]).some(e=>{var t;return(null!=(t=e.providerId)?t:e.provider)==="credential"})};var ei=a(33306),ed=a(42855),ec=a(26778),eu=a(71036),em=a(77096),ex=a(81505),ep=a(76640);let eb=async e=>{if(!(await (0,ep.t)("/api/v1/auth/set-password",{method:"POST",body:JSON.stringify({newPassword:e})})).ok)throw Error("SET_PASSWORD_FAILED")},eh="/api/v1/users/me/whatsapp-phone",ef=async()=>{var e,t;let a=await (0,ep.t)(eh);if(!a.ok)throw Error("WHATSAPP_PHONE_FETCH_FAILED");return null!=(t=null==(e=(await a.json()).data)?void 0:e.phone)?t:null},eg=async e=>{var t,a,r,n;let l=await (0,ep.t)(eh,{method:"PUT",body:JSON.stringify({phone:e})}),s=await l.json().catch(()=>null);if(!l.ok)throw Error(null!=(r=null==s||null==(a=s.error)?void 0:a.code)?r:"WHATSAPP_PHONE_UPDATE_FAILED");return null!=(n=null==s||null==(t=s.data)?void 0:t.phone)?n:null},ev="/api/v1/users/me/avatar",ey=async e=>{var t,a,r;let n=await (0,ep.t)(ev,{method:"PUT",body:JSON.stringify({image:e})}),l=await n.json().catch(()=>null);if(!n.ok||!(null==l||null==(t=l.data)?void 0:t.image))throw Error(null!=(r=null==l||null==(a=l.error)?void 0:a.code)?r:"AVATAR_UPLOAD_FAILED");return l.data.image},ej=async()=>
1{if(!(await (0,ep.t)(ev,{method:"DELETE"})).ok)throw Error("AVATAR_REMOVE_FAILED")},eC=(e,t)=>{let a=(0,ex.PQ)(e),r=""===e.trim();return{phoneDirty:e!==(0,ex.mz)(null!=t?t:""),phoneValid:r||a.ok}},ew=(0,em.v)((e,t)=>({nameSaved:"",nameDraft:"",nameDirty:!1,nameValid:!0,nameError:null,seedName:a=>{t().nameDirty||e({nameSaved:a,nameDraft:a,nameValid:""!==a.trim(),nameError:null})},setName:a=>{e({nameDraft:a,nameError:null,nameDirty:a.trim()!==t().nameSaved.trim(),nameValid:""!==a.trim()})},commitName:async()=>{let{nameDraft:a,nameDirty:r,nameValid:n}=t();if(!r||!n)return;let l=a.trim();try{await el.yK.updateUser({name:l}),e({nameSaved:l,nameDraft:l,nameDirty:!1,nameError:null})}catch(t){throw e({nameError:"N\xe3o foi poss\xedvel salvar o nome. Tente novamente."}),Error("name-save-failed")}},discardName:()=>{let{nameSaved:a}=t();e({nameDraft:a,nameDirty:!1,nameValid:""!==a.trim(),nameError:null})},phoneSaved:null,phoneDraft:"",phoneLoaded:!1,phoneError:null,phoneDirty:!1,phoneValid:!0,loadPhone:async()=>{if(!t().phoneLoaded)try{let t=await ef();e({phoneSaved:t,phoneDraft:t?(0,ex.mz)(t):"",phoneLoaded:!0,phoneError:null,phoneDirty:!1,phoneValid:!0})}catch(t){e({phoneLoaded:!0})}},setPhone:a=>{let r=(0,ex.mz)(a);e({phoneDraft:r,phoneError:null,...eC(r,t().phoneSaved)})},commitPhone:async()=>{let{phoneDraft:a,phoneSaved:r}=t(),{phoneDirty:n,phoneValid:l}=eC(a,r);if(!n||!l)return;let s=(0,ex.PQ)(a),o=""===a.trim()?null:s.ok?s.e164:null;if(null!==o||""===a.trim())try{let t=await eg(o);e({phoneSaved:t,phoneDraft:t?(0,ex.mz)(t):"",phoneError:null,phoneDirty:!1,phoneValid:!0})}catch(a){let t=a instanceof Error?a.message:"";throw e({phoneError:"WHATSAPP_PHONE_TAKEN"===t?"Este n\xfamero j\xe1 est\xe1 vinculado a outra conta.":"WHATSAPP_PHONE_INVALID"===t?"N\xfamero de WhatsApp inv\xe1lido. Confira o DDD e o d\xedgito 9.":"N\xe3o foi poss\xedvel salvar o telefone. Tente novamente."}),a}},discardPhone:()=>{let{phoneSaved:a}=t();e({phoneDraft:a?(0,ex.mz)(a):"",phoneError:null,phoneDirty:!1,phoneValid:!0})},avatarDraft:null,avatarRemove:!1,avatarDirty:!1,avatarError:null,setAvatar:t=>e({avatarDraft:t,avatarRemove:!1,avatarDirty:!0,avatarError:null}),stageAvatarRemoval:t=>e({avatarDraft:null,avatarRemove:t,avatarDirty:t,avatarError:null}),setAvatarError:t=>e({avatarError:t}),commitAvatar:async()=>{let{avatarDraft:a,avatarRemove:r}=t();if(a||r)try{a?await ey(a):await ej(),e({avatarDraft:null,avatarRemove:!1,avatarDirty:!1,avatarError:null})}catch(a){let t=a instanceof Error?a.message:"";throw e({avatarError:"AVATAR_INVALID"===t?"Envie uma imagem JPG, PNG ou WebP.":"AVATAR_TOO_LARGE"===t?"A imagem passa de 200 KB. Escolha uma menor.":"N\xe3o foi poss\xedvel salvar a foto. Tente novamente."}),a}},discardAvatar:()=>e({avatarDraft:null,avatarRemove:!1,avatarDirty:!1,avatarError:null})}));var ek=a(11336);let eN=(0,em.v)((e,t)=>({data:null,loading:!1,saving:!1,error:null,packagingDraft:null,stagePackaging:t=>e({packagingDraft:t}),discardPackaging:()=>e({packagingDraft:null}),load:async function(){let{force:a=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(a||!t().data){e({loading:!0,error:null});try{let t=await (0,ek.j8)();e({data:t,loading:!1})}catch(t){e({loading:!1,error:t instanceof Error?t.message:"Falha ao carregar custos."})}}},setGlobalPackaging:async(t,a)=>{e({saving:!0,error:null});try{let r=await (0,ek.tH)(t,a);e({data:r,saving:!1,packagingDraft:null})}catch(t){throw e({saving:!1,error:t instanceof Error?t.message:"Falha ao salvar a embalagem."}),t}}}));var eE=a(40234),eF=a(92005),eA=a(98326),eB=a(95819);let eS=(0,em.v)((e,t)=>{let a=(t,a)=>{t?"fulfilled"===a.status?e({mcpConnections:a.value.filter(e=>null===e.revokedAt),mcpAvailable:!0,mcpLoaded:!0}):(0,eF.d7)(a.reason)&&404===a.reason.status?e({mcpConnections:null,mcpAvailable:!1,mcpLoaded:!0}):e({mcpLoaded:!0}):e({mcpConnections:null,mcpAvailable:!1,mcpLoaded:!0})};return{mlAccount:null,mlLoaded:!1,googleAccounts:null,mcpConnections:null,mcpAvailable:!0,mcpLoaded:!1,loaded:!1,load:async function(){var r,n,l;let{force:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!s&&t().loaded)return;let[o,i,d,c]=await Promise.allSettled([(0,eA.W3)(),el.yK.listAccounts(),(0,eB._r)(),(0,eB._W)()]);"fulfilled"===o.status?e({mlAccount:null!=(n=o.value.find(e=>e.isActive))?n:null,mlLoaded:!0}):(0,eF.d7)(o.reason)&&404===o.reason.status?e({mlAccount:null,mlLoaded:!0}):e({mlLoaded:!0}),a("fulfilled"===c.status&&c.value,d),e({googleAccounts:"fulfilled"===i.status&&null!=(l=null==(r=i.value)?void 0:r.data)?l:[],loaded:!0})},refreshGoogle:async()=>{try{var t;let a=await el.yK.listAccounts();e({googleAccounts:null!=(t=null==a?void 0:a.data)?t:[]})}catch(t){e({googleAccounts:[]})}},refreshMl:async()=>{try{var t;let a=await (0,eA.W3)();e({mlAccount:null!=(t=a.find(e=>e.isActive))?t:null,mlLoaded:!0})}
1catch(t){(0,eF.d7)(t)&&404===t.status?e({mlAccount:null,mlLoaded:!0}):e({mlLoaded:!0})}},refreshMcp:async()=>{let[e,t]=await Promise.allSettled([(0,eB._r)(),(0,eB._W)()]);a("fulfilled"===t.status&&t.value,e)}}});var eD=a(26498),eL=a(63524),eP=a(24212);let eM=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return a=>{let{size:n=20,className:l}=a;return(0,r.jsx)("svg",{width:n,height:n,viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",className:l,children:(0,r.jsx)("g",{transform:"translate(10 10) scale(".concat(t,") translate(-10 -10)"),children:(0,r.jsx)("path",{d:e,fill:"currentColor"})})})}},e_=eM("M9.99991 13.75C12.7464 13.75 15.1487 14.9312 16.4552 16.6937L15.0737 17.347C14.0102 16.087 12.1352 15.25 9.99991 15.25C7.86466 15.25 5.98966 16.087 4.92616 17.347L3.54541 16.693C4.85191 14.9305 7.25341 13.75 9.99991 13.75ZM9.99991 2.5C10.9945 2.5 11.9483 2.89509 12.6516 3.59835C13.3548 4.30161 13.7499 5.25544 13.7499 6.25V8.5C13.7499 9.46635 13.3768 10.3954 12.7084 11.0933C12.0401 11.7913 11.1281 12.2043 10.1627 12.2463L9.99991 12.25C9.00535 12.25 8.05152 11.8549 7.34826 11.1517C6.645 10.4484 6.24991 9.49456 6.24991 8.5V6.25C6.24997 5.28365 6.62307 4.35463 7.2914 3.65667C7.95974 2.95871 8.87172 2.54569 9.83716 2.50375L9.99991 2.5ZM9.99991 4C9.426 3.99997 8.87377 4.21924 8.45621 4.61296C8.03865 5.00668 7.78733 5.54508 7.75366 6.118L7.74991 6.25V8.5C7.74935 9.08568 7.97717 9.6485 8.38499 10.0689C8.7928 10.4892 9.34846 10.734 9.93388 10.7512C10.5193 10.7684 11.0884 10.5566 11.5201 10.1609C11.9519 9.76519 12.2124 9.2167 12.2462 8.632L12.2499 8.5V6.25C12.2499 5.65326 12.0129 5.08097 11.5909 4.65901C11.1689 4.23705 10.5966 4 9.99991 4Z",1.12),ez=eM("M6.1135 13.9992C6.25123 13.6089 6.50666 13.271 6.84456 13.0319C7.18247 12.7929 7.58622 12.6645 8.00016 12.6645C8.4141 12.6645 8.81786 12.7929 9.15576 13.0319C9.49367 13.271 9.74909 13.6089 9.88683 13.9992H16.6668V15.3322H9.88683C9.74909 15.7224 9.49367 16.0604 9.15576 16.2994C8.81786 16.5385 8.4141 16.6668 8.00016 16.6668C7.58622 16.6668 7.18247 16.5385 6.84456 16.2994C6.50666 16.0604 6.25123 15.7224 6.1135 15.3322H3.3335V13.9992H6.1135ZM10.1135 9.33366C10.2512 8.9434 10.5067 8.60546 10.8446 8.36642C11.1825 8.12738 11.5862 7.99902 12.0002 7.99902C12.4141 7.99902 12.8179 8.12738 13.1558 8.36642C13.4937 8.60546 13.7491 8.9434 13.8868 9.33366H16.6668V10.6667H13.8868C13.7491 11.0569 13.4937 11.3949 13.1558 11.6339C12.8
1179 11.8729 12.4141 12.0013 12.0002 12.0013C11.5862 12.0013 11.1825 11.8729 10.8446 11.6339C10.5067 11.3949 10.2512 11.0569 10.1135 10.6667H3.3335V9.33366H10.1135ZM6.1135 4.66814C6.25123 4.27788 6.50666 3.93994 6.84456 3.7009C7.18247 3.46186 7.58622 3.3335 8.00016 3.3335C8.4141 3.3335 8.81786 3.46186 9.15576 3.7009C9.49367 3.93994 9.74909 4.27788 9.88683 4.66814H16.6668V6.00114H9.88683C9.74909 6.3914 9.49367 6.72934 9.15576 6.96838C8.81786 7.20742 8.4141 7.33578 8.00016 7.33578C7.58622 7.33578 7.18247 7.20742 6.84456 6.96838C6.50666 6.72934 6.25123 6.3914 6.1135 6.00114H3.3335V4.66814H6.1135ZM8.00016 6.00114C8.17697 6.00114 8.34654 5.93092 8.47157 5.80593C8.59659 5.68093 8.66683 5.51141 8.66683 5.33464C8.66683 5.15787 8.59659 4.98834 8.47157 4.86335C8.34654 4.73836 8.17697 4.66814 8.00016 4.66814C7.82335 4.66814 7.65378 4.73836 7.52876 4.86335C7.40373 4.98834 7.3335 5.15787 7.3335 5.33464C7.3335 5.51141 7.40373 5.68093 7.52876 5.80593C7.65378 5.93092 7.82335 6.00114 8.00016 6.00114ZM12.0002 10.6667C12.177 10.6667 12.3465 10.5964 12.4716 10.4715C12.5966 10.3465 12.6668 10.1769 12.6668 10.0002C12.6668 9.82339 12.5966 9.65387 12.4716 9.52887C12.3465 9.40388 12.177 9.33366 12.0002 9.33366C11.8234 9.33366 11.6538 9.40388 11.5288 9.52887C11.4037 9.65387 11.3335 9.82339 11.3335 10.0002C11.3335 10.1769 11.4037 10.3465 11.5288 10.4715C11.6538 10.5964 11.8234 10.6667 12.0002 10.6667ZM8.00016 15.3322C8.17697 15.3322 8.34654 15.262 8.47157 15.137C8.59659 15.012 8.66683 14.8425 8.66683 14.6657C8.66683 14.4889 8.59659 14.3194 8.47157 14.1944C8.34654 14.0694 8.17697 13.9992 8.00016 13.9992C7.82335 13.9992 7.65378 14.0694 7.52876 14.1944C7.40373 14.3194 7.3335 14.4889 7.3335 14.6657C7.3335 14.8425 7.40373 15.012 7.52876 15.137C7.65378 15.262 7.82335 15.3322 8.00016 15.3322Z",1.12),eR=eM("M3.83725 3.1195L10 1.75L16.1628 3.1195C16.3293 3.15652 16.4782 3.24922 16.585 3.3823C16.6918 3.51538 16.75 3.68089 16.75 3.8515V11.3417C16.7499 12.0826 16.567 12.8119 16.2174 13.465C15.8678 14.1181 15.3624 14.6749 14.746 15.0858L10 18.25L5.254 15.0858C4.63771 14.6749 4.13235 14.1183 3.78276 13.4653C3.43318 12.8124 3.25018 12.0832 3.25 11.3425V3.8515C3.25003 3.68089 3.30823 3.51538 3.41499 3.3823C3.52176 3.24922 3.6707 3.15652 3.83725 3.1195ZM4.75 4.453V11.3417C4.75001 11.8356 4.87193 12.3218 5.10495 12.7572C5.33796 13.1926 5.67486 13.5638 6.08575 13.8378L10 16.4478L13.9143 13.8378C14.325 13.5639 14.6619 13.1928 14.8949 12.7575C15.1279 12.3223 15.2499 11.8362 15.25 11.3425V4.453L10 3.2875L4.75 4.453ZM10 9.25C9.50272 9.25 9.02581 9.05246 8.67418 8.70083C8.32254 8.34919 8.125 7.87228 8.125 7.375C8.125 6.87772 8.32254 6.40081 8.67418 6.04917C9.02581 5.69754 9.50272 5.5 10 5.5C10.4973 5.5 10.9742 5.69754 11.3258 6.04917C11.6775 6.40081 11.875 6.87772 11.875 7.375C11.875 7.87228 11.6775 8.34919 11.3258 8.70083C10.9742 9.05246 10.4973 9.25 10 9.25ZM6.64525 13C6.73617 12.1738 7.12876 11.4102 7.74781 10.8555C8.36686 10.3009 9.16881 9.99416 10 9.99416C10.8312 9.99416 11.6331 10.3009 12.2522 10.8555C12.8712 11.4102 13.2638 12.1738 13.3548 13H6.64525Z",1.08),eT=eM("M3.25 3.25H16.75C16.9489 3.25 17.1397 3.32902 17.2803 3.46967C17.421 3.61032 17.5 3.80109 17.5 4V16C17.5 16.1989 17.421 16.3897 17.2803 16.5303C17.1397 16.671 16.9489 16.75 16.75 16.75H3.25C3.05109 16.75 2.86032 16.671 2.71967 16.5303C2.57902 16.3897 2.5 16.1989 2.5 16V4C2.5 3.80109 2.57902 3.61032 2.71967 3.46967C2.86032 3.32902 3.05109 3.25 3.25 3.25ZM16 9.25H4V15.25H16V9.25ZM16 7.75V4.75H4V7.75H16ZM11.5 12.25H14.5V13.75H11.5V12.25Z");eM("M7.72375 14.5C7.63459 15.1257 7.32266 15.6983 6.84526 16.1125C6.36786 16.5267 5.75704 16.7547 5.125 16.7547C4.49296 16.7547 3.88214 16.5267 3.40474 16.1125C2.92734 15.6983 2.61541 15.1257 2.52625 14.5H1.75V5.5C1.75 5.30109 1.82902 5.11032 1.96967 4.96967C2.11032 4.82902 2.30109 4.75 2.5 4.75H13C13.1989 4.75 13.3897 4.82902 13.5303 4.96967C13.671 5.11032 13.75 5.30109 13.75 5.5V7H16L18.25 10.042V14.5H16.7238C16.6346 15.1257 16.3227 15.6983 15.8453 16.1125C15.3679 16.5267 14.757 16.7547 14.125 16.7547C13.493 16.7547 12.8821 16.5267 12.4047 16.1125C11.9273 15.6983 11.6154 15.1257 11.5262 14.5H7.72375ZM12.25 6.25H3.25V12.2875C3.54592 11.9854 3.91045 11.7593 4.31256 11.6283C4.71468 11.4974 5.
114247 11.4656 5.55953 11.5355C5.9766 11.6055 6.37058 11.7752 6.70796 12.0302C7.04533 12.2852 7.31611 12.6179 7.49725 13H11.7527C11.8787 12.7353 12.0475 12.4945 12.25 12.2875V6.25ZM13.75 10.75H16.75V10.5363L15.244 8.5H13.75V10.75ZM14.125 15.25C14.4235 15.25 14.7097 15.1314 14.9208 14.9204C15.1318 14.7093 15.2504 14.4231 15.2504 14.1246C15.2504 13.8262 15.1318 13.5399 14.9208 13.3289C14.7097 13.1178 14.4235 12.9992 14.125 12.9992C13.8265 12.9992 13.5403 13.1178 13.3292 13.3289C13.1182 13.5399 12.9996 13.8262 12.9996 14.1246C12.9996 14.4231 13.1182 14.7093 13.3292 14.9204C13.5403 15.1314 13.8265 15.25 14.125 15.25ZM6.25 14.125C6.25 13.9773 6.2209 13.831 6.16436 13.6945C6.10783 13.558 6.02496 13.434 5.9205 13.3295C5.81603 13.225 5.69201 13.1422 5.55552 13.0856C5.41903 13.0291 5.27274 13 5.125 13C4.97726 13 4.83097 13.0291 4.69448 13.0856C4.55799 13.1422 4.43397 13.225 4.3295 13.3295C4.22504 13.434 4.14217 13.558 4.08564 13.6945C4.0291 13.831 4 13.9773 4 14.125C4 14.4234 4.11853 14.7095 4.3295 14.9205C4.54048 15.1315 4.82663 15.25 5.125 15.25C5.42337 15.25 5.70952 15.1315 5.9205 14.9205C6.13147 14.7095 6.25 14.4234 6.25 14.125Z");let eI="var(--font-sans)",eV=[{id:"conta",group:"geral",label:"Conta",icon:e_,title:"Conta",subtitle:"Seus dados de perfil e a apar\xeancia da interface."},{id:"integracoes",group:"geral",label:"Integra\xe7\xf5es",icon:ez,title:"Integra\xe7\xf5es",subtitle:"Conecte e sincronize a Cargoos com outras plataformas."},{id:"seguranca",group:"geral",label:"Privacidade e seguran\xe7a",icon:eR,title:"Privacidade e seguran\xe7a",subtitle:"A senha e as prote\xe7\xf5es da sua conta."},{id:"custos",group:"geral",label:"Custos gerais",icon:e=>{let{size:t=20,className:a}=e;return(0,r.jsx)(B.TA,{size:Math.round(.86*t),className:a})},title:"Custos gerais",subtitle:"Impostos e embalagem que valem para todo o neg\xf3cio."},{id:"plano",group:"geral",label:"Plano e cr\xe9ditos",icon:eT,title:"Plano e cr\xe9ditos",subtitle:"Seu plano atual, cr\xe9ditos dispon\xedveis e upgrade."},{id:"padroes",group:"mercado-livre",label:"Padr\xf5es de an\xfancio",icon:e=>{let{size:t=20,className:a}=e;return(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",className:a,children:(0,r.jsx)("g",{transform:"translate(12 12) scale(1.2) translate(-12 -12)",children:(0,r.jsx)("path",{d:"M9.00006 7.5V9.75H6.75006V7.5H9.00006ZM5.25006 6V11.25H10.5001V6H5.25006ZM12.7501 6H18.7501V7.5H12.7501V6ZM12.7501 11.25H18.7501V12.75H12.7501V11.25ZM12.7501 16.5H18.7501V18H12.7501V16.5ZM11.0304 15.1553L9.96973 14.0947L7.50006 16.5644L6.15538 15.2197L5.09473 16.2803L7.50006 18.6856L11.0304 15.1553Z",fill:"currentColor"})})})},title:"Padr\xf5es de an\xfancio",subtitle:"Valores assumidos por padr\xe3o nas novas an\xe1lises."},{id:"full",group:"mercado-livre",label:"Envio Full",icon:e=>{let{size:t=20,className:a}=e;return(0,r.jsx)(eP.uD,{size:t,className:a})},title:"Custos do Full",subtitle:"Quanto voc\xea paga para operar no Full."},{id:"flex",group:"mercado-livre",label:"Envio Flex",icon:e=>{let{size:t=20,className:a}=e;return(0,r.jsx)(eP.if,{size:t,className:a})},title:"Custos do Flex",subtitle:"Quanto voc\xea paga por entrega no Flex."}],eO=[{id:"geral",label:"Configura\xe7\xf5es gerais"},{id:"mercado-livre",label:"Mercado Livre"}],eq=e=>{let{active:t,onChange:a}=e,n=eO.map(e=>({...e,items:eV.filter(t=>t.group===e.id)}
1));return(0,r.jsx)("div",{className:"flex flex-col",children:(0,r.jsx)("nav",{"aria-label":"Se\xe7\xf5es de configura\xe7\xe3o",className:"flex flex-col gap-5",children:n.map((e,n)=>(0,r.jsxs)("div",{className:"flex flex-col",children:[n>0?(0,r.jsx)("div",{"aria-hidden":!0,className:"mb-5 -mt-0.5 h-px w-full bg-[#EBEBEB] dark:bg-border"}):null,(0,r.jsx)("h3",{className:"mb-2.5 px-3 text-[11px] font-medium uppercase leading-[17px] tracking-[0.06em] text-[#A3A3A3] dark:text-muted-foreground/70",style:{fontFamily:eI},children:e.label}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:e.items.map(e=>{let n=e.id===t,l=e.icon;return(0,r.jsxs)("button",{type:"button",onClick:()=>a(e.id),"aria-current":n?"page":void 0,className:(0,d.cn)("flex h-[40px] w-full items-center rounded-[10px] px-3","transition-all duration-200 ease-out cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime/40",n?"bg-[#b1fe7b]/80 text-[#214d12] dark:bg-lime":"text-[#262626]/90 hover:bg-accent hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground"),children:[(0,r.jsx)(l,{size:20,className:"shrink-0"}),(0,r.jsx)("div",{className:"ml-3 flex flex-1 items-center overflow-hidden",children:(0,r.jsx)("span",{className:"truncate whitespace-nowrap text-[14px] font-medium tracking-[-0.01em]",style:{fontFamily:eI},children:e.label})})]},e.id)})})]},e.id))})})};var eH=a(40188),eU=a(13990),eG=a(328);let eZ="var(--font-sans)",eW="'Eudoxus Sans', 'DM Sans', system-ui, sans-serif",eK=e=>{let{title:t,body:a,error:l,loading:s,resetKey:o,onCancel:i,onConfirm:c,labelledById:u,widthClass:m="max-w-[460px]"}=e,x=(0,n.useId)();return(0,r.jsxs)(et.E,{elevated:!0,onClose:i,labelledById:u,describedById:x,widthClass:m,escapeToClose:!s,disableBackdropClose:s,children:[(0,r.jsxs)("div",{className:"flex flex-col px-7 pb-7 pt-7",children:[(0,r.jsx)("span",{className:(0,d.cn)("flex size-11 items-center justify-center rounded-lg","border border-[#EF4444]/25 bg-transparent"),children:(0,r.jsx)(B.E9,{size:20,className:"text-[#B91C1C] dark:text-[#F87171]","aria-hidden":"true"})}),(0,r.jsx)("h2",{id:u,className:"mt-4 text-[20px] font-medium leading-tight tracking-[-0.02em] text-[#052D2B] dark:text-foreground",style:{fontFamily:eZ},children:t}),(0,r.jsx)("div",{id:x,className:"mt-2 flex flex-col gap-1.5 text-[13.5px] leading-[19px] text-muted-foreground",style:{fontFamily:eW},children:a}),l?(0,r.jsx)("p",{role:"alert",className:(0,d.cn)("mt-5 w-full rounded-lg border px-3 py-2 text-left text-[12px] leading-4","border-[#EF4444]/30 bg-[#EF4444]/12 text-[#B91C1C] dark:text-[#F87171]"),style:{fontFamily:eW},children:l}):null]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 border-t border-solid border-border px-7 py-5",children:[(0,r.jsx)("button",{type:"button",onClick:i,disabled:s,className:(0,d.cn)("inline-flex h-10 flex-1 cursor-pointer items-center justify-center rounded-lg px-4 text-[14px] font-medium tracking-[-0.01em]","border border-[#052D2B]/12 bg-transparent text-[#052D2B] transition-colors duration-150","hover:bg-[#052D2B]/[0.03] dark:border-border dark:text-foreground dark:hover:bg-muted/30","focus-visible:border-[#93E663] focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[#93E663]/20","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:eZ},children:"Cancelar"}),(0,r.jsx)(eG.f,{onConfirm:c,loading:s,resetKey:o,className:"h-10 flex-1"})]})]})};var eQ=a(92038),eJ=a(2002);let eX=new Set(["active","trialing"]),e$="subscription_active",eY="Cancele sua assinatura antes de excluir a conta.";var e0=a(805),e1=a(37259),e2=a(27106),e5=a(1320);let e6="'DM Sans', system-ui, sans-serif",e3=e=>{let{label:t,description:a,control:n,align:l="center",footer:s,reveal:o}=e,i=(0,r.jsxs)("div",{className:(0,d.cn)("border-b border-dashed border-[#EBEBEB] py-5 dark:border-border",void 0===o&&"last:border-b-0"),children:[(0,r.jsxs)("div",{className:(0,d.cn)("flex justify-between gap-6","center"===l?"items-center":"items-start"),children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"text-[14px] font-medium leading-5 tracking-[-0.01em] text-[#171717] dark:text-foreground",style:{fontFamily:e6},children:t}),a?(0,r.jsx)("p",{className:"mt-1 text-[12px] leading-4 text-[#5C5C5C] dark:text-muted-foreground",style:{fontFamily:"'Eudoxus Sans', 'DM Sans', system-ui, sans-serif"},children:a}):null]}),(0,r.jsx)("div",{className:"shrink-0",children:n})]}),s?(0,r.jsx)("div",{className:"mt-4",children:s}):null]});return void 0===o?i:(0,r.jsx)(e1.N,{initial:!1,children:o?(0,r.jsx)(e2.m.div,{initial:{height:0,opacity:0}
1,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22,ease:[.16,1,.3,1]},className:"overflow-hidden last:[&>div]:border-b-0",children:i},"row"):null})},e4=e=>{let{checked:t,onChange:a,ariaLabel:n,disabled:l=!1}=e;return(0,r.jsx)(e5.d,{checked:t,onChange:a,ariaLabel:n,disabled:l})},e9=e=>{let{value:t,onChange:a,options:l,ariaLabel:s,fullWidth:o}=e,i=(0,n.useRef)(null),c=(0,n.useRef)([]),[u,m]=(0,n.useState)({x:0,w:0}),x=Math.max(0,l.findIndex(e=>e.value===t));return(0,n.useLayoutEffect)(()=>{let e=i.current,t=c.current[x];if(!e||!t)return;let a=()=>{let a=e.getBoundingClientRect(),r=t.getBoundingClientRect();m({x:r.left-a.left,w:r.width})};a();let r=new ResizeObserver(a);return r.observe(e),()=>r.disconnect()},[x,t]),(0,r.jsxs)("div",{ref:i,role:"radiogroup","aria-label":s,className:(0,d.cn)("relative h-[36px] items-center rounded-[8px] p-[3px]",o?"flex w-full":"inline-flex","bg-[#052D2B]/[0.06] dark:bg-muted/60"),children:[(0,r.jsx)(e2.m.div,{"aria-hidden":"true",className:(0,d.cn)("absolute top-[3px] h-[30px] rounded-[6px] bg-card","shadow-[0_1px_2px_rgba(5,45,43,0.12),0_1px_0_rgba(255,255,255,0.6)_inset]","dark:shadow-[0_1px_2px_rgba(0,0,0,0.4),0_1px_0_rgba(255,255,255,0.06)_inset]"),initial:!1,animate:{x:u.x,width:u.w},transition:{type:"spring",stiffness:480,damping:36,mass:.65}}),l.map((e,n)=>{let l=e.value===t;return(0,r.jsx)("button",{type:"button",role:"radio","aria-checked":l,"aria-label":e.ariaLabel,onClick:()=>a(e.value),ref:e=>{c.current[n]=e},className:(0,d.cn)("relative z-10 inline-flex h-full cursor-pointer items-center justify-center gap-1.5 rounded-[6px]",o?"min-w-0 flex-1 px-3":"px-5","text-[13.5px] font-medium tracking-[-0.01em] transition-colors duration-200",l?"text-[#052D2B] dark:text-foreground":"text-muted-foreground hover:text-foreground/70"),style:{fontFamily:e6},children:o?(0,r.jsx)("span",{className:"min-w-0 truncate",children:e.label}):e.label},e.value)})]})},e8=e=>{var t,a;let{value:l,onChange:s,options:o,ariaLabel:i,disabled:c,minWidth:u=160}=e,[m,x]=(0,n.useState)(!1),p=null!=(t=o.find(e=>e.value===l))?t:o[0];return(0,r.jsxs)(e0.bL,{open:m,onOpenChange:x,children:[(0,r.jsx)(e0.l9,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",disabled:c,"aria-label":i,className:(0,d.cn)("inline-flex h-11 cursor-pointer items-center justify-between gap-2 whitespace-nowrap rounded-lg border border-solid px-3.5","text-[14.5px] font-medium tracking-[-0.01em] transition-colors duration-150","border-[#052D2B]/20 bg-card text-foreground dark:border-foreground
1/20","hover:bg-[#052D2B]/[0.025] dark:hover:bg-muted/30","data-[state=open]:border-[#93E663] data-[state=open]:ring-1 data-[state=open]:ring-[#93E663]/30","focus-visible:outline-none","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:e6,minWidth:u},children:[(0,r.jsx)("span",{className:"truncate",children:null!=(a=null==p?void 0:p.label)?a:"..."}),(0,r.jsx)(B.aY,{size:14,className:"shrink-0 opacity-50"})]})}),(0,r.jsx)(e0.ZL,{children:(0,r.jsx)(e0.UC,{align:"end",sideOffset:6,className:(0,d.cn)("cg-popover-enter z-[70] flex w-[200px] flex-col gap-1 rounded-lg border border-border bg-card p-1.5 shadow-lg"),children:o.map(e=>{let t=e.value===l;return(0,r.jsxs)("button",{type:"button",onClick:()=>{s(e.value),x(!1)},className:(0,d.cn)("flex w-full cursor-pointer items-center justify-between rounded-md px-2.5 py-2 text-left text-[13.5px]","transition-colors duration-150",t?"bg-[#93E663]/20 font-medium text-[#052D2B] dark:bg-[#93E663]/15 dark:text-foreground":"text-foreground hover:bg-[#052D2B]/[0.04] dark:hover:bg-muted/40"),style:{fontFamily:e6},children:[(0,r.jsx)("span",{className:"truncate",children:e.label}),t?(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"size-3.5 shrink-0 text-[#052D2B] dark:text-foreground",children:(0,r.jsx)("path",{d:"M20 6 9 17l-5-5"})}):null]},e.value)})})})]})},e7=e=>{let{width:t=120,className:a,style:n,...l}=e;return(0,r.jsx)("label",{className:(0,d.cn)("relative inline-flex h-11 items-center rounded-[8.1px] border border-solid px-3","transition-colors duration-150","border-[#052D2B]/20 bg-card text-foreground dark:border-foreground
1/20","focus-within:border-[#9EEA6C] focus-within:ring-1 focus-within:ring-[#9EEA6C]/30",a),style:{fontFamily:e6,width:t,...null!=n?n:{}},children:(0,r.jsx)("input",{...l,className:(0,d.cn)("w-full bg-transparent text-right text-[14.5px] tabular-nums outline-none","placeholder:text-muted-foreground/60")})})},te=e=>(0,ex.kc)((0,ex.Mg)(Math.max(0,Math.round(e)))),tt=e=>{let t=e.replace(/\D/g,"");if(""===t)return 0;let a=Number(t);return Number.isFinite(a)?a:0},ta=e=>{let{value:t,onValueChange:a,className:n,style:l,width:s=140,...o}=e;return(0,r.jsxs)("label",{className:(0,d.cn)("relative inline-flex h-11 items-center rounded-[8.1px] border border-solid px-3","transition-colors duration-150","border-[#052D2B]/20 bg-card text-foreground dark:border-foreground/20","focus-within:border-[#9EEA6C] focus-within:ring-1 focus-within:ring-[#9EEA6C]/30",n),style:{fontFamily:e6,width:s,...null!=l?l:{}},children:[(0,r.jsx)("span",{className:"mr-2 select-none text-[12.5px] font-medium text-muted-foreground",children:"R$"}),(0,r.jsx)("input",{...o,type:"text",inputMode:"numeric",value:t,onChange:e=>a(te(tt(e.target.value))),className:"w-full bg-transparent text-right text-[14.5px] tabular-nums outline-none placeholder:text-muted-foreground/60"})]})},tr=e=>{let{value:t,onValueChange:a,className:n,style:l,width:s=110,...o}=e;return(0,r.jsxs)("label",{className:(0,d.cn)("relative inline-flex h-11 items-center rounded-[8.1px] border border-solid px-3","transition-colors duration-150","border-[#052D2B]/20 bg-card text-foreground dark:border-foreground
1/20","focus-within:border-[#9EEA6C] focus-within:ring-1 focus-within:ring-[#9EEA6C]/30",n),style:{fontFamily:e6,width:s,...null!=l?l:{}},children:[(0,r.jsx)("input",{...o,type:"text",inputMode:"decimal",value:t,onChange:e=>a(e.target.value),className:"w-full bg-transparent text-right text-[14.5px] tabular-nums outline-none placeholder:text-muted-foreground/60"}),(0,r.jsx)("span",{className:"ml-1 select-none text-[12.5px] font-medium text-muted-foreground",children:"%"})]})},tn=e=>{let{value:t,onChange:a,placeholder:n,ariaLabel:l,inputMode:s,locked:o,width:i=280}=e;return(0,r.jsxs)("div",{className:(0,d.cn)("flex h-11 items-center gap-2 rounded-lg border px-3.5 transition-colors",o?"border-[#EBEBEB] bg-[#F7F7F7] dark:border-border dark:bg-muted/40":"border-[#EBEBEB] bg-card focus-within:border-[#93E663] focus-within:ring-[3px] focus-within:ring-[#93E663]/20 dark:border-border"),style:{width:i,fontFamily:e6},children:[(0,r.jsx)("input",{value:t,onChange:e=>null==a?void 0:a(e.target.value),placeholder:n,inputMode:s,"aria-label":l,readOnly:o,className:(0,d.cn)("min-w-0 flex-1 bg-transparent text-[14px] outline-none placeholder:text-[#A3A3A3]",o?"cursor-not-allowed text-[#5C5C5C] dark:text-muted-foreground":"text-[#171717] dark:text-foreground")}),o?(0,r.jsx)(B.WO,{size:15,className:"shrink-0 text-[#A3A3A3]"}):null]})},tl="'DM Sans', system-ui, sans-serif",ts=()=>{let{signOut:e}=(0,L.A)(),t=(0,n.useId)(),a=(0,M.lH)(e=>e.setChildModalOpen),l=(0,M.lH)(e=>e.setSection),[s,o]=(0,n.useState)(!1),[i,c]=(0,n.useState)(!1),[u,m]=(0,n.useState)(!1),[x,p]=(0,n.useState)(null),[b,h]=(0,n.useState)(0);(0,n.useEffect)(()=>{let e=!0;return(0,eQ.uV)().then(t=>{var a;e&&o((e=>"string"==typeof e&&eX.has(e.trim().toLowerCase()))(null==(a=t.subscription)?void 0:a.status))}).catch(()=>{e&&o(!1)}),()=>{e=!1}},[]),(0,n.useEffect)(()=>(a(i),()=>a(!1)),[i,a]);let f=(0,n.useCallback)(async()=>{if(!u){m(!0),p(null);try{await (e=>{let t=null==e?void 0:e.trim();return(0,eJ.nr)("/account",{method:"DELETE",body:t?{reason:t.slice(0,255)}:{}})})()}catch(e){if(!(e=>(0,eF.d7)(e)&&401===e.status)(e)){m(!1),h(e=>e+1),(e=>(0,eF.d7)(e)&&e.code===e$)(e)&&o(!0),p((e=>(0,eF.d7)(e)&&e.code===e$?eY:"N\xe3o foi poss\xedvel excluir sua conta agora. Tente novamente.")(e));return}}try{await e()}catch(e){}try{window.localStorage.removeItem("cargoos_bearer_token")}catch(e){}window.location.replace("/auth")}},[u,e]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e3,{label:"Excluir minha conta",description:"Apaga seus dados e encerra seu acesso. N\xe3o pode ser desfeito.",footer:s?(0,r.jsxs)("div",{id:t,className:"flex items-center gap-2.5 rounded-lg bg-[#FCEBCD]/60 px-3.5 py-2.5 dark:bg-[#F59E0B]/10",children:[(0,r.jsx)("span",{className:"shrink-0 text-[#F59E0B]",children:(0,r.jsx)(eU.z,{})}),(0,r.jsxs)("p",{className:"text-[13px] leading-snug text-[#B45309] dark:text-[#FBBF24]",style:{fontFamily:"'Eudoxus Sans', 'DM Sans', system-ui, sans-serif"},children:[eY," ",(0,r.jsx)("button",{type:"button",onClick:()=>{c(!1),l("plano")},className:"cursor-pointer font-medium underline underline-offset-[3px] transition-opacity hover:opacity-70",style:{fontFamily:tl},children:"Abrir Plano e cr\xe9ditos"})]})]}):null,control:(0,r.jsxs)("button",{type:"button",onClick:()=>{p(null),h(e=>e+1),c(!0)},disabled:s,"aria-describedby":s?t:void 0,className:(0,d.cn)("inline-flex h-10 shrink-0 cursor-pointer items-center justify-center gap-2 rounded-lg border px-4","text-[14px] font-medium tracking-[-0.01em] transition-colors duration-150","border-[#EF4444]/25 bg-transparent text-[#B91C1C] dark:text-[#F87171]","hover:border-[#EF4444]/45 hover:bg-[#EF4444]/[0.06]","focus-visible:border-[#93E663] focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[#93E663]/20","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-[#EF4444]/25 disabled:hover:bg-transparent"),style:{fontFamily:tl},children:[(0,r.jsx)(B.E9,{size:16,className:"shrink-0","aria-hidden":"true"}),"Excluir conta"]})}),i?(0,r.jsx)(eK,{title:"Excluir sua conta?",labelledById:"delete-account-title",error:x,loading:u,resetKey:b,onCancel:()=>{u||c(!1)},onConfirm:()=>void f(),body:(0,r.jsx)("p",{children:"Apagamos seus dados e desconectamos sua conta do Mercado Livre. A exclus\xe3o \xe9 imediata e n\xe3o pode ser desfeita."})}):null]})},to=()=>{var e;let t=eN(e=>e.data),a=eN(e=>e.loading),l=eN(e=>e.error),s=eN(e=>e.load),o=eN(e=>e.packagingDraft),i=eN(e=>e.stagePackaging);(0,n.useEffect)(()=>{s()},[s]);
1let[d,c]=(0,n.useState)(""),u=(0,eL.C)(e=>{var t,a,r,n;return null!=(n=null!=(r=null==(t=e.draft)?void 0:t.global.splitAdsProfit)?r:null==(a=e.envelope)?void 0:a.global.splitAdsProfit)&&n}),m=(0,eL.C)(e=>{var t,a,r,n;return null!=(n=null!=(r=null==(t=e.draft)?void 0:t.global.distributeAdsPerOrder)?r:null==(a=e.envelope)?void 0:a.global.distributeAdsPerOrder)&&n}),x=(0,eL.C)(e=>e.stage),p=null!=(e=null==t?void 0:t.packaging.effective)?e:0;return(0,n.useEffect)(()=>{c(te(p))},[p]),(0,n.useEffect)(()=>{null===o&&c(te(p))},[o,p]),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(e3,{label:"Embalagem efetiva",description:"Valor aplicado hoje nos relat\xf3rios.",control:(0,r.jsx)(ta,{value:d,onValueChange:e=>{c(e);let t=tt(e);i(t===p?null:t)},"aria-label":"Custo de embalagem global efetivo",disabled:a})}),(0,r.jsx)(e3,{label:"Distribuir custo de Ads nos pedidos",description:"Ligado: cada pedido mostra uma estimativa do Ads do dia. Desligado: o Ads fica na DRE e em Publicidade.",control:(0,r.jsx)(e4,{checked:m,onChange:e=>x({global:{distributeAdsPerOrder:e}}),ariaLabel:"Distribuir o custo de Ads nos pedidos"})}),m?(0,r.jsx)(e3,{label:"Separar publicidade do lucro",description:"Ligado: publicidade em linha \xe0 parte. Desligado: j\xe1 entra no lucro l\xedquido.",control:(0,r.jsx)(e4,{checked:u,onChange:e=>x({global:{splitAdsProfit:e}}),ariaLabel:"Separar publicidade do lucro l\xedquido no detalhamento"})}):null,l&&!/mercado\s*livre|active.*connection/i.test(l)?(0,r.jsx)("p",{className:"mt-3 text-[12.5px]",style:{color:"var(--color-loss)",fontFamily:"'Eudoxus Sans', 'DM Sans', system-ui, sans-serif"},children:l}):null]})},ti=[{value:"mei",label:"MEI (Isento)"},{value:"simples4",label:"Simples (4%)"},{value:"simples6",label:"Simples (6%)"},{value:"custom",label:"Personalizado"}],td=e=>0===e?"":e.toString().replace(".",","),tc=e=>{let{value:t,onPatch:a}=e,[l,s]=(0,n.useState)(t.taxPresetId),[o,i]=(0,n.useState)(()=>td(t.customTaxRate));return(0,n.useEffect)(()=>{s(t.taxPresetId)},[t.taxPresetId]),(0,n.useEffect)(()=>{i(td(t.customTaxRate))},[t.customTaxRate]),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(e3,{label:"Regime tribut\xe1rio",description:"Base de imposto usada nos c\xe1lculos de lucro. Mudar a al\xedquota recalcula os meses anteriores.",control:(0,r.jsx)(e8,{value:l,onChange:e=>{if(s(e),e!==t.taxPresetId){if("custom"===e){t.customTaxRate>0&&a({taxPresetId:"custom",customTaxRate:t.customTaxRate});return}a({taxPresetId:e,customTaxRate:0})}},options:ti,ariaLabel:"Regime tribut\xe1rio"})}),"custom"===l?(0,r.jsx)(e3,{label:"Al\xedquota personalizada",description:"Percentual aplicado sobre a receita.",control:(0,r.jsx)(tu,{value:o,onDraftChange:i,onCommit:e=>{"custom"===l&&("custom"!==t.taxPresetId||e!==t.customTaxRate)&&a({taxPresetId:"custom",customTaxRate:e})}})}):null]})},tu=e=>{let{value:t,onDraftChange:a,onCommit:n}=e;return(0,r.jsx)(tr,{value:t,onValueChange:e=>{let t=e.replace(/[^\d,.]/g,"");if(a(t),""===t||"."===t||","===t)return;let r=parseFloat(t.replace(",","."));Number.isNaN(r)||n(Math.min(r,100))},placeholder:"0,0","aria-label":"Al\xedquota personalizada"})};var tm=a(62547),tx=a(4212),tp=a(16341);let tb="var(--font-sans)",th="'Eudoxus Sans', 'DM Sans', system-ui, sans-serif",tf=e=>{let{logo:t,name:a,description:n,action:l,dimmed:s}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-3.5 border-b border-dashed border-[#EBEBEB] py-5 last:border-b-0 dark:border-border",children:[(0,r.jsx)("span",{className:(0,d.cn)("flex size-10 shrink-0 items-center justify-center rounded-[10px] border border-[#EBEBEB] bg-white dark:border-border dark:bg-transparent",s&&"opacity-45"),children:t}),(0,r.jsxs)("div",{className:(0,d.cn)("min-w-0 flex-1",s&&"opacity-45"),children:[(0,r.jsx)("p",{className:"truncate text-[14px] font-medium leading-5 tracking-[-0.01em] text-[#171717] dark:text-foreground",style:{fontFamily:tb},children:a}),(0,r.jsx)("p",{className:"mt-0.5 truncate text-[12px] leading-4 text-[#5C5C5C] dark:text-muted-foreground",style:{fontFamily:th},children:n})]}),(0,r.jsx)("div",{className:"shrink-0",children:l})]})},tg="inline-flex h-9 shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[8px] border px-3.5 text-[13.5px] font-medium tracking-[-0.01em] transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-60",tv=e=>{let{children:t,onClick:a,disabled:n}=e;return(0,r.jsx)("button",{type:"button",onClick:a,disabled:n,className:(0,d.cn)(tg,"border-[#D4D4D4] bg-white text-[#171717] hover:border-[#052D2B]/30 hover:bg-[#F7F7F7] dark:border-border dark:bg-transparent dark:text-foreground dark:hover:bg-muted/30"),style:{fontFamily:tb},children:t})},ty=e=>{let{children:t,onClick:a,disabled:n}=e;return(0,r.jsx)("button",{type:"button",onClick:a,disabled:n,className:(0,d.cn)(tg,"border-[#
1EF4444]/30 bg-white text-[#B91C1C] hover:bg-[#EF4444]/[0.06] dark:border-[#F87171]/30 dark:bg-transparent dark:text-[#F87171]"),style:{fontFamily:tb},children:t})},tj=()=>(0,r.jsxs)("button",{type:"button",disabled:!0,"aria-disabled":!0,className:(0,d.cn)(tg,"border-[#EBEBEB] bg-transparent text-[#8A8A8A] dark:border-border dark:text-muted-foreground"),style:{fontFamily:tb},children:[(0,r.jsx)(B.WO,{size:13,className:"shrink-0"}),"Em breve"]}),tC=()=>(0,r.jsx)(tp.ShimmerBlock,{className:"h-9 w-[104px] rounded-lg"});var tw=a(31168),tk=a(6393),tN=a(30319),tE=a(17671),tF=a(1624),tA=a(60839),tB=a(38216),tS=a(92487);let tD="mcp-assistants-title",tL=e=>{let{label:t,value:a}=e,[l,s]=(0,n.useState)(!1),o=(0,n.useRef)(null),i=(0,n.useRef)(!1);(0,n.useEffect)(()=>(i.current=!0,()=>{i.current=!1,null!==o.current&&window.clearTimeout(o.current)}),[]);let c=async()=>{try{if(await navigator.clipboard.writeText(a),!i.current)return;null!==o.current&&window.clearTimeout(o.current),s(!0),o.current=window.setTimeout(()=>s(!1),1600)}catch(e){i.current&&Y.oR.error("N\xe3o foi poss\xedvel copiar. Selecione o endere\xe7o acima.",{duration:5e3})}};return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5",children:[(0,r.jsx)("span",{className:"text-[13px] font-medium text-[#052D2B] dark:text-foreground",style:{fontFamily:tb},children:t}),(0,r.jsxs)("div",{className:"flex h-10 min-w-0 items-stretch overflow-hidden rounded-lg border border-[#EBEBEB] bg-card dark:border-border",children:[(0,r.jsx)("span",{className:"flex min-w-0 flex-1 items-center truncate px-3 text-[14px] text-[#052D2B] dark:text-foreground",style:{fontFamily:tb},title:a,children:(0,r.jsx)("span",{className:"truncate",children:a})}),(0,r.jsx)(tS.t,{"aria-label":l?"".concat(t," copiado"):"Copiar ".concat(t),onClick:()=>void c(),className:(0,d.cn)("h-auto w-10 rounded-none border-0 border-l border-[#EBEBEB] px-0 dark:border-border",l?"text-lime-text hover:bg-transparent dark:text-lime":"text-[#052D2B]/60 hover:bg-[#052D2B]/[0.04] hover:text-[#052D2B] dark:text-muted-foreground dark:hover:bg-muted/30 dark:hover:text-foreground"),children:l?(0,r.jsx)(tk.J,{size:15,weight:"bold","aria-hidden":!0}):(0,r.jsx)(tN.Q,{size:15,"aria-hidden":!0})})]})]})},tP=[{id:"chatgpt",label:"ChatGPT",logo:"/integrations/chatgpt.svg"},{id:"claude",label:"Claude",logo:"/claude-icon.svg"},{id:"cursor",label:"Cursor",logo:"/integrations/cursor.svg"},{id:"codex",label:"Codex",logo:"/integrations/codex.svg"},{id:"other",label:"Outros"}],tM=e=>{let{action:t}=e;return"deep-link"===t.kind?(0,r.jsxs)(tS.z,{href:t.url,children:[t.label,(0,r.jsx)(tE.B,{size:14,"aria-hidden":!0})]}):(0,r.jsxs)(tS.t,{onClick:()=>window.open(t.url,"_blank","noopener,noreferrer"),className:"link"===t.kind?"h-auto border-0 p-0 text-[12px] hover:bg-transparent":void 0,children:[t.label,(0,r.jsx)(tE.B,{size:14,"aria-hidden":!0})]})},t_=new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"}),tz=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=new Date(t).getTime(),n=new Date(e).getTime();if(Number.isNaN(r)||Number.isNaN(n))return"";if(r<=n)return"ainda sem uso";let l=Math.floor((a-r)/864e5);return l<=0?"usado hoje":1===l?"usado ontem":"usado h\xe1 ".concat(l," dias")},tR=e=>{let{connection:t,onRevoke:a}=e;return(0,r.jsxs)("li",{className:"flex items-center gap-3.5 border-b border-dashed border-[#EBEBEB] py-3.5 last:border-b-0 dark:border-border",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"truncate text-[14px] font-medium leading-5 tracking-[-0.01em] text-[#171717] dark:text-foreground",style:{fontFamily:tb},children:t.clientName}),(0,r.jsxs)("p",{className:"mt-0.5 truncate text-[12px] leading-4 text-[#5C5C5C] dark:text-muted-foreground",style:{fontFamily:th},children:["Conectado em ",(e=>{let t=new Date(e);return Number.isNaN(t.getTime())?"":t_.format(t)})(t.createdAt),", ",tz(t.createdAt,t.lastUsedAt),"."]})]}),(0,r.jsx)(ty,{onClick:()=>a(t),children:"Revogar"})]})},tT=()=>(0,r.jsxs)("li",{className:"flex items-center gap-3.5 border-b border-dashed border-[#
1EBEBEB] py-3.5 last:border-b-0 dark:border-border",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,r.jsx)(tp.ShimmerBlock,{className:"h-5 w-24"}),(0,r.jsx)(tp.ShimmerBlock,{className:"h-4 w-56"})]}),(0,r.jsx)(tp.ShimmerBlock,{className:"h-9 w-[84px] rounded-lg"})]}),tI=e=>{let{children:t}=e;return(0,r.jsx)("h3",{className:"text-[13px] font-medium leading-[18px] text-[#052D2B] dark:text-foreground",style:{fontFamily:tb},children:t})},tV=e=>{var t;let{onClose:a}=e,l=eS(e=>e.mcpConnections),s=eS(e=>e.refreshMcp),[o,i]=(0,n.useState)(null),[c,u]=(0,n.useState)(!1),[m,x]=(0,n.useState)(!1),p=(0,eL.C)(e=>{var t,a,r,n;return null==(n=null!=(r=null==(t=e.draft)?void 0:t.global.assistantWidgets)?r:null==(a=e.envelope)?void 0:a.global.assistantWidgets)||n}),b=(0,eL.C)(e=>e.savePreference),[h,f]=(0,n.useState)("chatgpt"),g=(0,eB.Rz)(),v=(0,eB.SU)(h,g,(0,eB.Wx)()),y=null==(t=tP.find(e=>e.id===h))?void 0:t.label,j=null!=l?l:[],C=(0,n.useCallback)(async()=>{x(!0);try{await s()}finally{x(!1)}},[s]);(0,n.useEffect)(()=>{null===eS.getState().mcpConnections&&C()},[C]);let w=async()=>{if(o){u(!0);try{await (0,eB.Pn)(o.id),await s(),Y.oR.success("".concat(o.clientName," desconectado")),i(null)}catch(e){Y.oR.error("N\xe3o foi poss\xedvel revogar. Tente novamente.")}finally{u(!1)}}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(et.E,{onClose:a,labelledById:tD,widthClass:"max-w-[720px]",elevated:!0,escapeToClose:null===o,children:[(0,r.jsx)(tB.r,{title:"Assistentes de IA",description:"S\xf3 leitura. Nenhum assistente altera sua conta nem seu Mercado Livre.",titleId:tD,onClose:a,paddingClass:"px-7"}),(0,r.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto px-7 py-6",children:[(0,r.jsx)("section",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:tP.map(e=>(0,r.jsxs)(tS.t,{"aria-expanded":h===e.id,"aria-controls":"mcp-host-setup",onClick:()=>f(e.id),className:(0,d.cn)("group h-auto min-h-20 min-w-0 justify-start gap-3 rounded-xl p-3 text-left",h===e.id?"border-[#052D2B]/30 bg-[#052D2B]/[0.03] dark:border-foreground
1/30 dark:bg-muted/20":"border-[#EBEBEB] hover:border-[#052D2B]/30 dark:hover:border-foreground/30"),children:[e.logo?(0,r.jsx)("img",{src:e.logo,alt:"",width:36,height:36,className:"size-9 shrink-0 rounded-lg object-contain outline outline-1 -outline-offset-1 outline-black/10 dark:brightness-0 dark:invert"}):(0,r.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-[#052D2B]/[0.06] dark:bg-muted/30",children:(0,r.jsx)(tF.R,{size:20,"aria-hidden":!0})}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-[14px] font-medium",children:e.label}),(0,r.jsx)(tA.K,{size:14,"aria-hidden":!0,className:(0,d.cn)("shrink-0",h===e.id?"rotate-90":"group-hover:translate-x-0.5")})]},e.id))}),(0,r.jsxs)("section",{id:"mcp-host-setup",role:"region","aria-label":"Configurar ".concat(y),className:"flex min-w-0 flex-col gap-4 rounded-xl border border-[#EBEBEB] bg-card p-4 dark:border-border",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsxs)("h3",{className:"text-[16px] font-medium text-[#052D2B] dark:text-foreground",style:{fontFamily:tb},children:["Configurar ",y]}),v.subtitle?(0,r.jsx)("p",{className:"text-[13px] leading-5 text-[#5C5C5C] dark:text-muted-foreground",style:{fontFamily:th},children:v.subtitle}):null]}),g?(0,r.jsx)("ol",{className:"flex min-w-0 flex-col gap-4",children:v.steps.map((e,t)=>(0,r.jsxs)("li",{className:"flex min-w-0 items-start gap-3",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-[#052D2B]/[0.06] text-[12px] font-medium text-[#052D2B] dark:bg-muted/30 dark:text-foreground",style:{fontFamily:tb},children:t+1}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col items-start gap-2",children:[e.text?(0,r.jsx)("p",{className:"text-[13px] leading-6 text-[#052D2B] dark:text-foreground",style:{fontFamily:th},children:e.text}):null,e.copy?(0,r.jsx)("div",{className:"w-full min-w-0",children:(0,r.jsx)(tL,{...e.copy})}):null,e.action?(0,r.jsx)(tM,{action:e.action}):null]})]},t))},h):(0,r.jsx)("p",{className:"text-[13px] leading-5 text-muted-foreground",style:{fontFamily:th},children:"O endere\xe7o do servidor n\xe3o est\xe1 configurado nesta build."})]}),(0,r.jsx)(e3,{label:"Tabelas e gr\xe1ficos no assistente",description:"Ligado: o ChatGPT e outros assistentes desenham os cards do Cargoos na conversa. Desligado: s\xf3 a resposta em texto.",control:(0,r.jsx)(e4,{checked:p,onChange:e=>{b({global:{assistantWidgets:e}}).catch(()=>void 0)},ariaLabel:"Mostrar tabelas e gr\xe1ficos do Cargoos nos assistentes"})}),(0,r.jsxs)("section",{className:"flex flex-col gap-1",children:[(0,r.jsx)(tI,{children:"Conectados"}),null===l&&m?(0,r.jsxs)("ul",{className:"flex flex-col","aria-busy":"true",children:[(0,r.jsx)(tT,{}),(0,r.jsx)(tT,{})]}):null===l?(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 py-3",children:[(0,r.jsx)("p",{className:"text-[13px] leading-5 text-muted-foreground",style:{fontFamily:th},children:"N\xe3o foi poss\xedvel carregar as conex\xf5es."}),(0,r.jsx)(tS.t,{onClick:()=>void C(),className:"h-9 text-[13px]",children:"Tentar de novo"})]}):0===j.length?(0,r.jsx)("p",{className:"py-3 text-[13px] leading-5 text-muted-foreground",style:{fontFamily:th},children:"Nenhum assistente conectado ainda."}):(0,r.jsx)("ul",{className:"flex flex-col",children:j.map(e=>(0,r.jsx)(tR,{connection:e,onRevoke:i},e.id))})]})]})]}),o?(0,r.jsx)(tm.T,{title:"Revogar ".concat(o.clientName,"?"),body:"O assistente perde o acesso na hora. Para voltar, \xe9 s\xf3 autorizar de novo.",confirmLabel:"Revogar",danger:!0,busy:c,elevated:!0,onConfirm:()=>void w(),onCancel:()=>i(null)}):null]})},tO=()=>{let e=eS(e=>e.mcpAvailable),t=eS(e=>e.mcpLoaded),a=eS(e=>e.mcpConnections),l=(0,M.lH)(e=>e.setChildModalOpen),[s,o]=(0,n.useState)(!1);if(t&&!e)return null;let i=(null!=a?a:[]).map(e=>e.clientName);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tf,{logo:(0,r.jsx)(tw.X,{size:22,weight:"regular",className:"text-[#052D2B] dark:text-foreground"}),name:"Assistentes de IA",description:(e=>{if(0===e.length)return"Consulte seus dados no Claude, ChatGPT ou Cursor.";let t=Array.from(new Set(e)),a=t.slice(0,2).join(" e "),r=t.length-2;return 1===t.length?"Conectado ao ".concat(a,"."):"Conectado ao ".concat(a).concat(r>0?" e mais ".concat(r):"",".")})(i),action:t?(0,r.jsx)(tv,{onClick:()=>{l(!0),o(!0)},children:i.length>0?"Gerenciar":"Conectar"}):(0,r.jsx)(tC,{})}),s?(0,r.jsx)(tV,{onClose:()=>{l(!1),o(!1)}}):null]})},tq=()=>(0,r.jsxs)("div",{className:"flex flex-col py-4",children:[(0,r.jsx)(tG,{}),(0,r.jsx)(tZ,{}),(0,r.jsx)(tO,{}),(0,r.jsx)(tU,{logo:(0,r.jsx)(tH,{src:"/integrations/shopee-icon.svg"}),name:"Shopee",description:"Traga seus pedidos e an\xfancios da Shopee para a Cargoos."}),(0,r.jsx)(tU,{logo:(0,r.jsx)(tH,{src:"/integrations/amazon-icon.svg"}
1),name:"Amazon",description:"Analise suas vendas da Amazon no mesmo painel."})]}),tH=e=>{let{src:t}=e;return(0,r.jsx)("img",{src:t,alt:"","aria-hidden":!0,className:"size-6 shrink-0 object-contain"})},tU=e=>{let{logo:t,name:a,description:n}=e;return(0,r.jsx)(tf,{logo:t,name:a,description:n,action:(0,r.jsx)(tj,{}),dimmed:!0})},tG=()=>{let e=eS(e=>e.mlAccount),t=eS(e=>e.mlLoaded),a=eS(e=>e.refreshMl),[l,s]=(0,n.useState)(!1),[i,d]=(0,n.useState)(!1),{open:c}=(0,tx.X)({onSuccess:()=>{s(!1),a()},onClosed:()=>s(!1)}),u=async()=>{s(!0);try{await c()}catch(e){Y.oR.error("N\xe3o foi poss\xedvel iniciar a conex\xe3o. Tente de novo.",{id:"ml-callback-error"}),s(!1)}},m=async()=>{s(!0);try{await (0,eA.RU)(),(0,o.kf)(!1),await a(),d(!1),Y.oR.success("Mercado Livre desconectado")}catch(e){Y.oR.error("N\xe3o foi poss\xedvel desconectar. Tente novamente.")}finally{s(!1)}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tf,{logo:(0,r.jsx)(tH,{src:"/meli-logo.svg"}),name:"Mercado Livre",description:e?"Conectada como ".concat(e.mlNickname,"."):"Conecte sua conta de vendedor para liberar as an\xe1lises.",action:t?e?(0,r.jsx)(ty,{onClick:()=>d(!0),children:"Desconectar"}):(0,r.jsxs)(tv,{onClick:()=>void u(),disabled:l,children:[l?(0,r.jsx)(B.y$,{size:13}):null,"Conectar"]}):(0,r.jsx)(tC,{})}),i&&(0,r.jsx)(tm.T,{title:"Desconectar do Mercado Livre?",body:"Iremos parar de sincronizar suas vendas. Seu hist\xf3rico fica salvo e voc\xea reconecta quando quiser.",confirmLabel:"Desconectar",danger:!0,busy:l,onConfirm:()=>void m(),onCancel:()=>d(!1)})]})},tZ=()=>{var e;let t=eS(e=>e.googleAccounts),a=eS(e=>e.refreshGoogle),[l,s]=(0,n.useState)(!1),[o,i]=(0,n.useState)(!1),d=!!(null==t?void 0:t.some(e=>"google"===(e=>{var t,a;return null!=(a=null!=(t=e.providerId)?t:e.provider)?a:""})(e))),c=(null!=(e=null==t?void 0:t.length)?e:0)<=1,u=async()=>{s(!0);try{await el.yK.linkSocial({provider:"google",callbackURL:"".concat(window.location.origin,"/dashboard/settings?tab=integracoes")})}catch(e){Y.oR.error("N\xe3o foi poss\xedvel iniciar a conex\xe3o. Tente de novo.")}finally{s(!1)}},m=async()=>{if(!c){s(!0);try{await el.yK.unlinkAccount({providerId:"google"}),await a(),i(!1),Y.oR.success("Google desconectado")}catch(e){Y.oR.error("N\xe3o foi poss\xedvel desconectar. Tente novamente.")}finally{s(!1)}}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tf,{logo:(0,r.jsx)(tW,{}),name:"Google",description:d?"Voc\xea entra na Cargoos com sua conta Google.":"Conecte para entrar tamb\xe9m com o Google.",action:null===t?(0,r.jsx)(tC,{}):d?(0,r.jsx)(ty,{onClick:()=>i(!0),children:"Desconectar"}):(0,r.jsxs)(tv,{onClick:()=>void u(),disabled:l,children:[l?(0,r.jsx)(B.y$,{size:13}):null,"Conectar"]})}),o&&(0,r.jsx)(tm.T,{title:"Desconectar do Google?",body:c?"O Google \xe9 sua \xfanica forma de entrar na Cargoos. Defina uma senha antes de desconectar, sen\xe3o voc\xea fica sem acesso \xe0 conta.":"Voc\xea n\xe3o vai mais entrar com o Google. Ainda poder\xe1 acessar pelos outros m\xe9todos de login da sua conta.",confirmLabel:c?"Entendi":"Desconectar",danger:!c,busy:l,onConfirm:()=>c?i(!1):void m(),onCancel:()=>i(!1)})]})},tW=()=>(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 18 18","aria-hidden":!0,children:[(0,r.jsx)("path",{d:"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84a4.14 4.14 0 0 1-1.8 2.72v2.26h2.92c1.7-1.57 2.68-3.88 2.68-6.62z",fill:"#4285F4"}),(0,r.jsx)("path",{d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.81.54-1.85.86-3.04.86-2.34 0-4.32-1.58-5.03-3.7H.96v2.33A9 9 0 0 0 9 18z",fill:"#34A853"}),(0,r.jsx)("path",{d:"M3.97 10.72A5.41 5.41 0 0 1 3.68 9c0-.6.1-1.18.29-1.72V4.95H.96A9 9 0 0 0 0 9c0 1.45.35 2.82.96 4.05l3.01-2.33z",fill:"#FBBC05"}),(0,r.jsx)("path",{d:"M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.58C13.46.89 11.43 0 9 0A9 9 0 0 0 .96 4.95l3.01 2.33C4.68 5.16 6.66 3.58 9 3.58z",fill:"#EA4335"})]}),tK=[{value:"classico",label:"Cl\xe1ssico"},{value:"premium",label:"Premium"}],tQ=[{value:"flex",label:"Flex"},{value:"full",label:"Full"},{value:"coleta",label:"Coleta"}],tJ=e=>{let{value:t,onPatch:a}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e3,{label:"Tipo de an\xfancio",description:"Assumido por padr\xe3o nas novas an\xe1lises.",control:(0,r.jsx)(e9,{value:t.adType,onCh
1ange:e=>void a({adType:e}),options:tK,ariaLabel:"Tipo de an\xfancio padr\xe3o"})}),(0,r.jsx)(e3,{label:"Modalidade de envio",description:"Envio padr\xe3o usado nas simula\xe7\xf5es.",control:(0,r.jsx)(e8,{value:t.shippingMode,onChange:e=>void a({shippingMode:e}),options:tQ,ariaLabel:"Modalidade de envio padr\xe3o"})})]})},tX="'DM Sans', system-ui, sans-serif",t$=e=>{let{className:t}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:t,children:[(0,r.jsx)("rect",{x:"2.75",y:"4.75",width:"18.5",height:"14.5",rx:"2.5"}),(0,r.jsx)("path",{d:"m3.5 6.5 7.4 5.28a2 2 0 0 0 2.2 0L20.5 6.5"})]})},tY=()=>{let{user:e}=(0,L.A)(),t=(0,M.lH)(e=>e.setChildModalOpen),[a,l]=(0,n.useState)(!1);(0,n.useEffect)(()=>(t(a),()=>t(!1)),[a,t]);let[s,o]=(0,n.useState)(!1),[i,c]=(0,n.useState)(null),[u,m]=(0,n.useState)(0),x=(0,n.useRef)(null);(0,n.useEffect)(()=>()=>{x.current&&window.clearInterval(x.current)},[]);let p=async()=>{if((null==e?void 0:e.email)&&!s&&!(u>0)){o(!0),c(null);try{await el.yK.requestPasswordReset({email:e.email}),m(60),x.current&&window.clearInterval(x.current),x.current=window.setInterval(()=>{m(e=>e<=1?(x.current&&window.clearInterval(x.current),x.current=null,0):e-1)},1e3),l(!1),Y.oR.success("Link de redefini\xe7\xe3o enviado para o seu email.")}catch(e){l(!1),c("N\xe3o foi poss\xedvel enviar agora. Tente novamente em instantes.")}finally{o(!1)}}},b=s||u>0||!(null==e?void 0:e.email);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e3,{label:"Redefinir senha",description:"Enviamos um link para o seu email e voc\xea cria a nova senha por l\xe1.",control:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(e1.N,{initial:!1,children:u>0?(0,r.jsxs)(e2.m.span,{layout:!0,initial:{opacity:0,x:12},animate:{opacity:1,x:0},exit:{opacity:0,x:12},transition:{duration:.3,ease:[.16,1,.3,1]},className:"shrink-0 whitespace-nowrap text-[13px] font-medium text-muted-foreground",style:{fontFamily:tX},children:["Reenviar em"," ",(0,r.jsx)("span",{className:"inline-block text-right tabular-nums",style:{minWidth:"2ch"},children:u}),"s"]},"cooldown"):null}),(0,r.jsxs)(e2.m.button,{layout:!0,type:"button",onClick:()=>l(!0),disabled:b,className:(0,d.cn)("inline-flex h-11 shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[8px] border border-solid px-3.5","text-[13.5px] font-medium tracking-[-0.01em] transition-colors duration-150","border-[#052D2B]/20 bg-card text-[#052D2B] dark:border-foreground
1/20 dark:text-foreground","hover:bg-[#052D2B]/[0.025] hover:border-[#052D2B]/30 dark:hover:bg-muted/30","focus-visible:outline-none focus-visible:border-[#9EEA6C] focus-visible:ring-1 focus-visible:ring-[#9EEA6C]/30","disabled:cursor-not-allowed disabled:opacity-60"),style:{fontFamily:tX},children:[u>0?(0,r.jsx)(B.rA,{size:13,className:"text-(--color-profit)"}):null,u>0?"Link enviado":"Come\xe7ar"]})]})}),i?(0,r.jsx)("p",{className:"mt-3 rounded-[8px] border px-3 py-2 text-[12.5px]",style:{borderColor:"color-mix(in oklab, var(--color-loss) 30%, transparent)",background:"var(--color-loss-bg)",color:"var(--color-loss)",fontFamily:tX},children:i}):null,a?(0,r.jsxs)(et.E,{elevated:!0,onClose:()=>l(!1),labelledById:"reset-pwd-title",widthClass:"max-w-[440px]",children:[(0,r.jsx)(tB.r,{titleId:"reset-pwd-title",title:"Redefinir senha",description:"Enviamos um link pro seu email e voc\xea cria a nova senha por ele.",paddingClass:"px-7",onClose:()=>l(!1)}),(0,r.jsx)("div",{className:"px-7 py-6",children:(0,r.jsxs)("div",{className:"flex items-center gap-3.5 rounded-xl border border-[#EBEBEB] bg-card px-4 py-4 dark:border-border",children:[(0,r.jsx)("span",{className:"flex size-11 shrink-0 items-center justify-center rounded-lg border border-[#EBEBEB] text-[#052D2B] dark:border-border dark:text-foreground",children:(0,r.jsx)(t$,{className:"size-[22px]"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-[12px] font-medium leading-4 text-muted-foreground",style:{fontFamily:tX},children:"Enviar link para"}),(0,r.jsx)("p",{className:"truncate text-[15px] font-medium leading-5 text-[#052D2B] dark:text-foreground",style:{fontFamily:tX},title:null==e?void 0:e.email,children:null==e?void 0:e.email})]})]})}),(0,r.jsxs)("div",{className:"flex items-center gap-3 border-t border-solid border-border px-7 py-4",children:[(0,r.jsx)("button",{type:"button",onClick:()=>l(!1),disabled:s,className:(0,d.cn)("inline-flex h-11 flex-1 cursor-pointer items-center justify-center rounded-[8px] px-4 text-[14px] font-medium tracking-[-0.01em]","border border-[#052D2B]/12 bg-transparent text-[#052D2B] transition-colors duration-150","hover:bg-[#052D2B]/[0.03] dark:border-border dark:text-foreground dark:hover:bg-muted/30","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:tX},children:"Agora n\xe3o"}),(0,r.jsxs)(ea.j,{onClick:()=>void p(),disabled:s,className:"h-10 flex-1 text-[14px]",children:[s?(0,r.jsx)(B.y$,{size:16,className:"animate-spin"}):null,"Enviar link"]})]})]}):null]})};var t0=a(78799),t1=a(41242),t2=a(60497),t5=a(19308),t6=a(25175),t3=a(36491);let t4="var(--font-sans)",t9="'Eudoxus Sans', 'DM Sans', system-ui, sans-serif",t8=[{label:"Calculadora de margem real com taxas do Meli"},{label:"Dados completos do an\xfancio no Mercado Livre"},{label:"Leitura de demanda e visitas por an\xfancio"},{label:"Monitoramento de Buy Box e sellers"},{label:"At\xe9 50 an\xe1lises salvas"}],t7=e=>[{label:"Tudo do plano Free"},{label:"Dashboard de vendas, lucro e estoque em tempo real"},..."off"===e?[]:[{label:"Publicidade com lucro real por campanha",...(0,l.h)(e)?{badge:{tone:"muted",text:(0,l.h)(e)}}:{},tooltip:"Product Ads com ACOS de equil\xedbrio e lucro p\xf3s-m\xeddia, custo FIFO inclu\xeddo."}],{label:"Contabilidade com DRE, CMV e relat\xf3rios gerenciais",tooltip:"Demonstrativo de resultados, custo da mercadoria vendida e exporta\xe7\xe3o â pronto pra levar pro contador."},{label:"An\xe1lise de concorr\xeancia no cat\xe1logo"},{label:"An\xe1lise de geolocaliza\xe7\xe3o"},{label:"Filtros avan\xe7ados de busca de produtos"},{label:"Pesquisa em lote de EANs",badge:{tone:"lime",text:"3k cr\xe9ditos/m\xeas"},tooltip:"Cr\xe9ditos renovam todo m\xeas. Cada EAN pesquisado consome 1 cr\xe9dito."}],ae=[{label:"Tudo do plano Pro"},{label:"Intelig\xeancia competitiva para Amazon"},{label:"Hist\xf3rico de pre\xe7os com Keepa"},{label:"An\xe1lise multi marketplace"},{label:"Gestor de conta dedicado"}],at=e=>{let{reason:t,onClose:a}=e,s=(0,l.g)(e=>e.ads),{isPremium:o,isTrial:c,isFree:u}=(0,i.q)(),m=(0,t3.z)(e=>
1e.refresh),[x,p]=(0,n.useState)(!1),[b,h]=(0,n.useState)(null),[f,g]=(0,n.useState)({kind:"loading"}),[v,y]=(0,n.useState)(!1),[j,C]=(0,n.useState)(null),[w,k]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=e=>{e.persisted&&(p(!1),y(!1))};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)},[]),(0,n.useEffect)(()=>{if(o)return void g({kind:"active",flavor:"premium"});if(c)return void g({kind:"active",flavor:"trial"});let e=!1;return(0,t5.w_)().then(t=>{e||g(t.eligible?{kind:"eligible"}:{kind:"ineligible",reasons:t.reasons})}).catch(()=>{e||g({kind:"unavailable"})}),()=>{e=!0}},[o,c]),(0,n.useEffect)(()=>{let e=!1;return(0,t6.s)().then(t=>{e||k(t)}).catch(()=>{e||k(!1)}),()=>{e=!0}},[]);let N=async()=>{h(null),p(!0);try{let e="".concat(window.location.origin,"/dashboard/settings?tab=plano&success=true&from=pricing"),t="".concat(window.location.origin,"/dashboard/settings?tab=plano&from=pricing"),a=(0,t0.C)(),{sessionUrl:r}=await (0,eQ.fw)(e,t,a);window.location.href=r}catch(e){h(e instanceof Error?e.message:"Erro ao iniciar checkout"),p(!1)}},E=async()=>{C(null),y(!0);try{let e=await (0,t6.F)({successUrl:"".concat(window.location.origin,"/dashboard/settings?tab=plano&success=true&from=pricing"),cancelUrl:"".concat(window.location.origin,"/dashboard/settings?tab=plano&from=pricing"),affiliateCode:(0,t0.C)(),source:"web_plan"});if("paid"===e.kind){window.location.href=e.sessionUrl;return}await m(),null==a||a()}catch(t){let e=null==t?void 0:t.code;C((0,t5.OD)(e)),y(!1)}},F="unavailable"!==f.kind;return(0,r.jsxs)("div",{className:"min-h-full bg-background text-foreground",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between gap-3 px-8 pt-5 pb-5",children:[(0,r.jsx)("h1",{id:"subscription-pricing-title",className:"sr-only",children:"Planos"}),(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-foreground
1/5 px-4 py-2 text-[13px] font-medium text-muted-foreground",style:{fontFamily:t4},children:[(0,r.jsx)(ai,{}),"Escolha um plano para come\xe7ar"]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsx)(ad,{}),a&&(0,r.jsx)("button",{type:"button",onClick:a,"aria-label":"Fechar",className:(0,d.cn)("inline-flex size-[35px] shrink-0 cursor-pointer items-center justify-center rounded-[8px] transition-colors","bg-[#052D2B]/[0.04] text-muted-foreground dark:bg-muted/40","hover:bg-[#052D2B]/[0.08] hover:text-foreground dark:hover:bg-muted/60"),children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M18 6 6 18"}),(0,r.jsx)("path",{d:"M6 6l12 12"})]})})]})]}),(0,r.jsx)("div",{"aria-hidden":!0,className:"h-px w-full bg-border"}),(0,r.jsxs)("div",{className:"grid gap-[1px] bg-border lg:grid-cols-3",children:[(0,r.jsx)(aa,{name:"Essential",description:"Para come\xe7ar a vender melhor no Mercado Livre",price:(0,r.jsx)(an,{}),cta:(0,r.jsx)("div",{className:(0,d.cn)("flex h-11 w-full items-center justify-center gap-2 rounded-[8.1px] px-5 text-[14px] font-medium","bg-secondary text-muted-foreground","border border-border"),style:{fontFamily:t4},children:u?"Plano atual":"Plano gratuito"}),features:t8}),(0,r.jsx)(aa,{name:"Professional",description:"Tudo que voc\xea precisa para vender melhor",badge:"Mais popular",price:(0,r.jsx)(al,{originalCents:6799,priceCents:4999,discountPct:26}),cta:o?(0,r.jsx)("div",{className:(0,d.cn)("flex h-11 w-full items-center justify-center gap-2 rounded-[8.1px] px-5 text-[14px] font-medium","bg-secondary text-muted-foreground","border border-border"),style:{fontFamily:t4},children:"Plano atual"}):(0,r.jsx)("button",{type:"button",onClick:N,disabled:x,className:(0,d.cn)("flex h-11 w-full cursor-pointer items-center justify-center gap-2 rounded-[8.1px] px-5 text-[14px] font-medium tracking-[-0.01em]","bg-[#B1FE7B] text-[#052D2B]","border-[0.5px] border-white/25","ring-1 [--btn-ring:color-mix(in_oklab,#052D2B_15%,#B1FE7B)] ring-[var(--btn-ring)]","shadow-[inset_0_1px_0_rgba(255,255,255,0.5)]","transition-all duration-150 enabled:hover:bg-[#a0f060] enabled:active:scale-[0.99]","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-lime/30","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:t4},children:x?(0,r.jsx)(eU.kr,{className:"size-4 animate-spin"}):(0,r.jsxs)(r.Fragment,{children:["Assinar agora",(0,r.jsx)(eU.Qp,{size:14})]})}),messages:t||b?(0,r.jsxs)(r.Fragment,{children:[t&&(0,r.jsx)("p",{className:"rounded-lg bg-secondary px-3 py-2 text-[12.5px] text-muted-foreground",style:{fontFamily:t9},children:t}),b&&(0,r.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12.5px] text-destructive",style:{fontFamily:t9},children:b})]}):void 0,features:t7(s)}),(0,r.jsx)(aa,{name:"Business",description:"Para escalar al\xe9m do Mercado Livre",badge:"em constru\xe7\xe3o",badgeTone:"muted",price:(0,r.jsx)(as,{}),cta:(0,r.jsxs)("div",{className:(0,d.cn)("flex h-11 w-full items-center justify-center gap-2 rounded-[8.1px] px-5 text-[14px] font-medium","bg-secondary text-muted-foreground","border border-border","cursor-not-allowed"),style:{fontFamily:t4},children:[(0,r.jsx)(eU.c_,{size:13}),"Em breve"]}),features:ae,featuresMuted:!0})]}),F&&(0,r.jsx)(ao,{state:f,starting:v,error:j,onStart:E,paidTrialEnabled:w})]})},aa=e=>{let{name:t,description:a,price:n,cta:l,features:s,badge:o,badgeTone:i="lime",messages:c,featuresMuted:u}=e;return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col bg-card px-7 py-12 lg:px-8 lg:py-14",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,r.jsx)("h2",{className:"text-[22px] font-medium leading-none tracking-[-0.02em] text-[#052D2B] dark:text-foreground",style:{fontFamily:t4},children:t}),o&&(0,r.jsx)("span",{className:(0,d.cn)("shrink-0 rounded-[4.1px] px-[7px] py-1","text-[10px] font-semibold uppercase leading-none tracking-wide","lime"===i?"bg-[#B1FE7B] text-[#052D2B] dark:bg-[#B1FE7B]/15 dark:text-[#B1FE7B]":"bg-muted text-muted-foreground"),style:{fontFamily:t4},children:o})]}),(0,r.jsx)("p",{className:"mt-2 min-h-[2.9em] text-[14px] leading-[1.45] text-muted-foreground",style:{fontFamily:t9},children:a}),(0,r.jsx)("div",{className:"mt-6",children:n}),(0,r.jsx)("ul",{className:"mt-6 space-y-2.5",children:s.map(e=>{let{label:t,badge:a,tooltip:n,muted:l}=e,s=u||l;return(0,r.jsxs)("li",{className:"flex items-start gap-2.5",children:[(0,r.jsx)(eU.Jl,{size:14,className:(0,d.cn)("mt-[3px] shrink-0",s?"text-muted-foreground
1/60":"text-foreground/55")}),(0,r.jsxs)("span",{className:(0,d.cn)("flex items-center gap-x-2 text-[13.5px] leading-[1.4]",s?"text-muted-foreground":"text-foreground/90"),style:{fontFamily:t9},children:[n?(0,r.jsx)(t2.m,{label:n,side:"top",children:(0,r.jsx)("span",{className:"cursor-help border-b border-dashed border-muted-foreground/30",children:t})}):t,a&&(0,r.jsx)("span",{className:(0,d.cn)("lime"===a.tone?(0,d.cn)("inline-flex items-center rounded-[6px] px-2.5 py-1","text-[13px] font-medium leading-none tabular-nums tracking-[-0.01em]","bg-[#CFFBA8] text-[#052D2B]","dark:bg-[#1C3A16] dark:text-[#C6F5A0]"):"inline-flex items-center rounded-full bg-muted px-1.5 py-0.5 text-[10.5px] font-medium text-muted-foreground"),style:{fontFamily:t4},children:a.text})]})]},t)})}),(0,r.jsxs)("div",{className:"mt-auto pt-8",children:[c&&(0,r.jsx)("div",{className:"mb-4 space-y-2",children:c}),l]})]})},ar=e=>(e/100).toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2}),an=()=>(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"invisible h-[28px]","aria-hidden":!0}),(0,r.jsx)("div",{className:"flex items-baseline",children:(0,r.jsx)("span",{className:"text-[36px] font-medium leading-none tracking-[-0.02em] text-foreground tabular-nums",style:{fontFamily:t4},children:"Gr\xe1tis"})})]}),al=e=>{let{originalCents:t,priceCents:a,discountPct:n}=e;return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex h-[28px] items-center gap-2",children:[(0,r.jsxs)("span",{className:"text-[13px] text-muted-foreground line-through decoration-muted-foreground/40 tabular-nums",style:{fontFamily:t9},children:["R$ ",ar(t)]}),(0,r.jsxs)("span",{className:(0,d.cn)("inline-flex items-center rounded-[6px] px-2.5 py-1","text-[13px] font-medium leading-none tabular-nums tracking-[-0.01em]","bg-[#CFFBA8] text-[#052D2B]","dark:bg-[#1C3A16] dark:text-[#C6F5A0]"),style:{fontFamily:t4},children:["Economize ",n,"%"]})]}),(0,r.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,r.jsxs)("span",{className:"text-[36px] font-medium leading-none tracking-[-0.02em] text-foreground tabular-nums",style:{fontFamily:t4},children:["R$ ",ar(a)]}),(0,r.jsx)("span",{className:"text-[14px] text-muted-foreground",style:{fontFamily:t9},children:"/m\xeas"})]})]})},as=()=>(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"invisible h-[28px]","aria-hidden":!0}),(0,r.jsx)("div",{className:"flex items-baseline",children:(0,r.jsx)("span",{className:"text-[36px] font-medium leading-none tracking-[-0.02em] text-muted-foreground/80 tabular-nums",style:{fontFamily:t4},children:"Em breve"})})]}),ao=e=>{let{state:t,starting:a,error:n,onStart:l,paidTrialEnabled:s}=e,o="active"===t.kind,i=!o&&("loading"===t.kind||null===s),c=!i&&"eligible"===t.kind,u=!i&&"ineligible"===t.kind,m=u?(e=>{let t=["ALREADY_PREMIUM","EMAIL_NOT_VERIFIED","ML_ACCOUNT_REQUIRED","TRIAL_ALREADY_USED","ML_ACCOUNT_ALREADY_TRIALED","EMAIL_ALREADY_TRIALED","SUBSCRIPTION_HISTORY_EXISTS","DISPOSABLE_EMAIL","USER_BANNED","TRIAL_START_IN_PROGRESS","RATE_LIMITED","ML_API_UNAVAILABLE"].find(t=>e.includes(t));return t?"EMAIL_NOT_VERIFIED"===t?"Verifique seu email":"ML_ACCOUNT_REQUIRED"===t?"Conecte sua conta ML":"TRIAL_ALREADY_USED"===t||"ML_ACCOUNT_ALREADY_TRIALED"===t||"EMAIL_ALREADY_TRIALED"===t?"Trial j\xe1 utilizado":"SUBSCRIPTION_HISTORY_EXISTS"===t?"J\xe1 ativado":"DISPOSABLE_EMAIL"===t?"Email n\xe3o suportado":"USER_BANNED"===t?"Conta suspensa":"TRIAL_START_IN_PROGRESS"===t?"Processando":"RATE_LIMITED"===t?"Tente em breve":"ML_API_UNAVAILABLE"===t?"ML indispon\xedvel":"Indispon\xedvel":"Indispon\xedvel"})(t.reasons):null,x=o?"trial"===t.flavor?"Voc\xea est\xe1 testando o Pro.":"Voc\xea j\xe1 tem o Pro ativo.":null===s?"Pro gr\xe1tis por 7 dias.":s?"Pro gr\xe1tis por 7 dias. Cancele quando quiser.":"Pro gr\xe1tis por 7 dias, sem cart\xe3o.";return(0,r.jsxs)("div",{className:"relative overflow-hidden bg-[#9EEA6C]",children:[(0,r.jsx)("div",{"aria-hidden":!0,className:"landing-cta-bg pointer-events-none absolute inset-0 opacity-80"}),(0,r.jsxs)("div",{className:"relative flex flex-col items-center justify-center gap-3 px-6 py-4 sm:flex-row sm:gap-5 lg:px-8",children:[(0,r.jsx)("p",{className:"text-center text-[13.5px] leading-[1.45] text-[#052D2B] sm:text-left",style:{fontFamily:t9},children:x}),i&&(0,r.jsxs)("div",{className:(0,d.cn)("inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-[8px] border border-[#1E4345]/20 px-3 text-[13px] font-medium","text-[#1E4345]/70"),style:{fontFamily:t4},children:[(0,r.jsx)(eU.kr,{className:"size-3.5 animate-spin"}),"Verificando"]}),c&&(0,r.jsx)("button",{type:"button",onClick:l,disabled:a,className:(0,d.cn)("inline-flex h-9 shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[8px] px-4 text-[13px] font-medium tracking-[-0.01em]","bg-[#1E4345] text-white border border-white/10","shadow-[0_1px_2px_rgba(0,0,0,0.15),inset_0_1px_0_rgba(255,255,255,0.12)]","transition-all duration-150 enabled:hover:bg-[#264F52] enabled:active:scale-[0.99]","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[#1E4345]/30","disabled:cursor-not-allowed disabled:opacity-60"),style:{fontFamily:t4},children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eU.kr,{className:"size-3.5 animate-spin"}),"Iniciando"]}):(0,r.jsxs)(r.Fragment,{children:["Iniciar trial",(0,r.jsx)(eU.Qp,{size:13})]})}),u&&(0,r.jsxs)("div",{className:(0,d.cn)("inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-[8.1px] border border-[#1E4345]/10 px-3 text-[13px] font-medium","text-[#1E4345]/60 cursor-not-allowed"),style:{fontFamily:t4},title:null!=m?m:void 0,children:[(0,r.jsx)(eU.c_,{size:12,className:"text-[#1E4345]/60"}),m]}),o&&(0,r.jsxs)("span",{className:(0,d.cn)("inline-flex shrink-0 items-center gap-1.5 rounded-full px-2.5 py-1","text-[12px] font-medium tracking-[-0.01em] text-[#052D2B]","bg-white/55 border border-[#052D2B]/12"),style:{fontFamily:t4},children:[(0,r.jsx)(eU.Jl,{size:11,strokeWidth:3}),"trial"===t.flavor?"Trial ativo":"Plano ativo"]})]}),n&&(0,r.jsx)("p",{className:"relative pb-3 text-center text-[12px] text-[#1E4345]/80",style:{fontFamily:t9},children:n})]})},ai=()=>
1(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 256 256",width:"14",height:"14","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M88,24V16a8,8,0,0,1,16,0v8a8,8,0,0,1-16,0ZM16,104h8a8,8,0,0,0,0-16H16a8,8,0,0,0,0,16ZM124.42,39.16a8,8,0,0,0,10.74-3.58l8-16a8,8,0,0,0-14.31-7.16l-8,16A8,8,0,0,0,124.42,39.16Zm-96,81.69-16,8a8,8,0,0,0,7.16,14.31l16-8a8,8,0,1,0-7.16-14.31ZM219.31,184a16,16,0,0,1,0,22.63l-12.68,12.68a16,16,0,0,1-22.63,0L132.7,168,115,214.09c0,.1-.08.21-.13.32a15.83,15.83,0,0,1-14.6,9.59l-.79,0a15.83,15.83,0,0,1-14.41-11L32.8,52.92A16,16,0,0,1,52.92,32.8L213,85.07a16,16,0,0,1,1.41,29.8l-.32.13L168,132.69ZM208,195.31,156.69,144h0a16,16,0,0,1,4.93-26l.32-.14,45.95-17.64L48,48l52.2,159.86,17.65-46c0-.11.08-.22.13-.33a16,16,0,0,1,11.69-9.34,16.72,16.72,0,0,1,3-.28,16,16,0,0,1,11.3,4.69L195.31,208Z"})}),ad=()=>(0,r.jsxs)("div",{role:"radiogroup","aria-label":"Per\xedodo de cobran\xe7a",className:(0,d.cn)("relative inline-flex h-[35px] items-center rounded-[8px] p-[3px]","bg-[#052D2B]/[0.06] dark:bg-muted/60"),children:[(0,r.jsx)("div",{"aria-hidden":!0,className:(0,d.cn)("pointer-events-none absolute left-[3px] top-[3px] h-[29px] w-[88px] rounded-[6px] bg-card","shadow-[0_1px_2px_rgba(5,45,43,0.12),0_1px_0_rgba(255,255,255,0.6)_inset]","dark:shadow-[0_1px_2px_rgba(0,0,0,0.4),0_1px_0_rgba(255,255,255,0.06)_inset]")}),(0,r.jsx)("button",{type:"button",role:"radio","aria-checked":!0,className:(0,d.cn)("relative z-10 inline-flex h-full w-[88px] cursor-default items-center justify-center rounded-[6px]","text-[13px] font-medium tracking-[-0.01em]","text-[#052D2B] dark:text-foreground"),style:{fontFamily:t4},children:"Mensal"}),(0,r.jsxs)("button",{type:"button",role:"radio","aria-checked":!1,disabled:!0,"aria-disabled":!0,title:"Plano anual em breve",className:(0,d.cn)("relative z-10 inline-flex h-full w-[88px] cursor-not-allowed items-center justify-center gap-1.5 rounded-[6px]","text-[13px] font-medium tracking-[-0.01em]","text-muted-foreground/55"),style:{fontFamily:t4},children:["Anual",(0,r.jsx)(eU.c_,{size:11,className:"shrink-0"})]})]}),ac="var(--font-sans)",au="'Eudoxus Sans', 'DM Sans', system-ui, sans-serif",am={visa:"/payment-icons/visa-icon.svg",mastercard:"/payment-icons/mastercard-icon.svg",amex:"/payment-icons/amex-icon.svg",elo:"/payment-icons/elo-light-icon.svg"},ax=new Intl.NumberFormat("pt-BR",{maximumFractionDigits:0}),ap=()=>{let{balance:e,total:t,cycleResetAt:a,isPremium:n}=(0,i.q)();return(0,r.jsx)("div",{className:"h-full -mx-6",children:(0,r.jsx)(t1.AuthGridLayout,{fill:!0,showLogo:!1,cardWidthClass:"max-w-[420px]",children:(0,r.jsx)("div",{className:"w-full",children:n?(0,r.jsx)(ah,{balance:e,total:t,cycleResetAt:a}):(0,r.jsx)(ab,{})})})})},ab=()=>{let e=(0,l.g)(e=>e.ads),[t,a]=(0,n.useState)(!1),[s,o]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=e=>{e.persisted&&a(!1)};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)},[]);let i=async()=>{o(null),a(!0);try{let e="".concat(window.location.origin,"/dashboard/settings?tab=plano&success=true"),t="".concat(window.location.origin,"/dashboard/settings?tab=plano"),{sessionUrl:a}=await (0,eQ.fw)(e,t,(0,t0.C)());window.location.href=a}catch(e){o(e instanceof Error?e.message:"N\xe3o foi poss\xedvel iniciar o checkout."),a(!1)}};return(0,r.jsx)(aa,{name:"Professional",description:"Tudo que voc\xea precisa para vender melhor",badge:"Mais popular",price:(0,r.jsx)(al,{originalCents:6799,priceCents:4999,discountPct:26}),features:t7(e),messages:s?(0,r.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12.5px] text-destructive",style:{fontFamily:au},children:s}):void 0,cta:(0,r.jsx)("button",{type:"button",onClick:()=>void i(),disabled:t,className:(0,d.cn)("flex h-11 w-full cursor-pointer items-center justify-center gap-2 rounded-[8.1px] px-5 text-[14px] font-medium tracking-[-0.01em]","bg-[#B1FE7B] text-[#052D2B]","border-[0.5px] border-white/25","ring-1 [--btn-ring:color-mix(in_oklab,#052D2B_15%,#B1FE7B)] ring-[var(--btn-ring)]","shadow-[inset_0_1px_0_rgba(255,255,255,0.5)]","transition-all duration-150 enabled:hover:bg-[#a0f060] enabled:active:scale-[0.99]","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-lime/30","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:ac},children:t?(0,r.jsx)(eU.kr,{className:"size-4 animate-spin"}):(0,r.jsxs)(r.Fragment,{children:["Assinar agora",(0,r.jsx)(eU.Qp,{size:14})]})})})},ah=e=>{var t,a;let{balance:l,total:s,cycleResetAt:o}
1=e,[i,c]=(0,n.useState)(null),[u,m]=(0,n.useState)(!0),[x,p]=(0,n.useState)(!1),[b,h]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=e=>{e.persisted&&p(!1)};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)},[]),(0,n.useEffect)(()=>{let e=!0;return(0,eQ.uV)().then(t=>{e&&t.subscription&&c(t.subscription)}).catch(()=>void 0).finally(()=>{e&&m(!1)}),()=>{e=!1}},[]);let f=!!(null==i?void 0:i.cancelAtPeriodEnd)&&"active"===i.status,g=(e=>{if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"long",year:"numeric"}).format(t)})(null!=(t=null==i?void 0:i.currentPeriodEnd)?t:null),v=(null==i?void 0:i.currentAmount)!=null?(0,ex.y7)(i.currentAmount):(0,ex.y7)(4999),y=null!=(a=null==i?void 0:i.paymentMethod)?a:null,j=s>0?Math.min(100,Math.max(0,l/s*100)):0,C=(e=>{if(!e)return null;let t=new Date(e);if(Number.isNaN(t.getTime()))return null;let a=new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"short"}).format(t),r=new Intl.DateTimeFormat("pt-BR",{hour:"2-digit",minute:"2-digit"}).format(t);return"".concat(a," \xe0s ").concat(r)})(o),w=async()=>{h(null),p(!0);let e=function(){let e=null;try{e=window.open("about:blank","_blank")}catch(t){e=null}return{navigate:t=>!!e&&!e.closed&&(e.location.href=t,!0),abort:()=>{try{e&&!e.closed&&e.close()}catch(e){}}}}();try{let{url:t}=await (0,eQ.oE)("".concat(window.location.origin,"/dashboard/settings?tab=plano"));if(!e.navigate(t)){window.location.href=t;return}}catch(t){e.abort(),h("N\xe3o foi poss\xedvel abrir o portal de cobran\xe7a. Tente novamente.")}finally{p(!1)}},k=(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",children:[f?(0,r.jsx)("span",{"aria-hidden":!0,className:"size-2 rounded-full bg-[#F59E0B]"}):(0,r.jsxs)("span",{"aria-hidden":!0,className:"relative flex size-2",children:[(0,r.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-[#22C55E] opacity-75"}),(0,r.jsx)("span",{className:"relative inline-flex size-2 rounded-full bg-[#22C55E]"})]}),(0,r.jsx)("span",{className:"text-[12.5px] font-medium text-muted-foreground",style:{fontFamily:au},children:f?"Encerrando":"Assinatura ativa"})]}),N=u?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(af,{label:"Pr\xf3xima cobran\xe7a",value:(0,r.jsx)("span",{className:"cg-skeleton inline-block h-4 w-36 align-middle","aria-hidden":"true"})}),(0,r.jsx)(af,{label:"Valor",value:(0,r.jsx)("span",{className:"cg-skeleton inline-block h-4 w-24 align-middle","aria-hidden":"true"})}),(0,r.jsx)(af,{label:"Forma de pagamento",value:(0,r.jsx)("span",{className:"cg-skeleton inline-block h-4 w-28 align-middle","aria-hidden":"true"})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(af,{label:f?"Acesso at\xe9":"Pr\xf3xima cobran\xe7a",value:null!=g?g:"â"}),(0,r.jsx)(af,{label:"Valor",value:"".concat(v,"/m\xeas")}),y?(0,r.jsx)(af,{label:"Forma de pagamento",value:(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)("img",{src:(e=>{var t;return null!=(t=am[e.toLowerCase()])?t:"/payment-icons/placeholder.svg"})(y.brand),alt:y.brand,className:"h-[18px] w-auto shrink-0"}),(0,r.jsxs)("span",{children:["â¢â¢â¢â¢ ",y.last4]})]})}):null]}),E=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,r.jsx)("span",{className:"text-[13px] font-medium text-[#052D2B] dark:text-foreground",style:{fontFamily:ac},children:"Cr\xe9ditos de EAN"}),(0,r.jsxs)("span",{className:"text-[13px] tabular-nums text-muted-foreground",style:{fontFamily:au},children:[(0,r.jsx)("span",{className:"font-medium text-[#052D2B] dark:text-foreground",children:ax.format(l)})," ","/ ",ax.format(s)]})]}),(0,r.jsx)("div",{className:"mt-3 h-2.5 w-full overflow-hidden rounded-full bg-[#052D2B]/[0.07] dark:bg-muted",children:(0,r.jsx)("div",{className:"h-full rounded-full bg-[#6BD44C] transition-[width] duration-500 ease-out",style:{width:"".concat(j,"%"),backgroundImage:"repeating-linear-gradient(135deg, transparent, transparent 2px, rgba(255,255,255,0.22) 2px, rgba(255,255,255,0.22) 4px)"}})}),(0,r.jsx)("p",{className:"mt-2 text-[12px] text-muted-foreground",style:{fontFamily:au},children:C?"Os cr\xe9ditos voltam para ".concat(ax.format(s)," em ").concat(C,"."):"Os cr\xe9ditos voltam para ".concat(ax.format(s)," a cada ciclo.")}
1)]});return(0,r.jsxs)("div",{className:"flex flex-col px-8 pb-8 pt-7",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("h3",{className:"text-[27px] font-medium leading-none tracking-[-0.03em] text-[#052D2B] dark:text-foreground",style:{fontFamily:ac},children:"Cargoos Pro"}),k]}),(0,r.jsx)("dl",{className:"mt-7 flex flex-col",children:N}),(0,r.jsx)("div",{className:"mt-8",children:E}),(0,r.jsxs)("div",{className:"mt-9",children:[f?(0,r.jsx)("p",{className:"mb-2.5 text-[12.5px] text-muted-foreground",style:{fontFamily:au},children:"Sua assinatura encerra no fim do per\xedodo. Voc\xea pode reativ\xe1-la no portal."}):null,(0,r.jsx)("button",{type:"button",onClick:()=>void w(),disabled:x,className:(0,d.cn)("flex h-11 cursor-pointer items-center justify-center gap-2 rounded-[8.1px] px-5 text-[14px] font-medium tracking-[-0.01em]","w-full","bg-[#B1FE7B] text-[#052D2B]","border-[0.5px] border-white/25","ring-1 [--btn-ring:color-mix(in_oklab,#052D2B_15%,#B1FE7B)] ring-[var(--btn-ring)]","shadow-[inset_0_1px_0_rgba(255,255,255,0.5)]","transition-all duration-150 enabled:hover:bg-[#a0f060] enabled:active:scale-[0.99]","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-lime/30","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:ac},children:x?(0,r.jsx)(eU.kr,{className:"size-4 animate-spin"}):(0,r.jsxs)(r.Fragment,{children:["Gerenciar assinatura",(0,r.jsx)(eU.Qp,{size:14})]})}),(0,r.jsx)("p",{className:"mt-2.5 text-center text-[12px] text-muted-foreground",style:{fontFamily:au},children:null!=b?b:"Atualize o cart\xe3o, veja faturas ou cancele no portal do Stripe."})]})]})},af=e=>{let{label:t,value:a}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 border-t border-border py-3 first:border-t-0 first:pt-0",children:[(0,r.jsx)("dt",{className:"shrink-0 text-[13px] text-muted-foreground",style:{fontFamily:au},children:t}),(0,r.jsx)("dd",{className:"min-w-0 truncate text-right text-[14px] font-medium tabular-nums text-[#052D2B] dark:text-foreground",style:{fontFamily:ac},children:a})]})};var ag=a(62580),av=a(8400);let ay=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:256,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.82,r=await createImageBitmap(e);try{let e=Math.min(r.width,r.height);if(e<t)throw Error("too-small");let n=document.createElement("canvas");n.width=t,n.height=t;let l=n.getContext("2d");if(!l)throw Error("canvas-unavailable");return l.fillStyle="#ffffff",l.fillRect(0,0,t,t),l.drawImage(r,(r.width-e)/2,(r.height-e)/2,e,e,0,0,t,t),n.toDataURL("image/jpeg",a)}finally{r.close()}},aj=e=>{let{currentImage:t,displayName:a}=e,l=(0,n.useRef)(null),s=ew(e=>e.avatarDraft),o=ew(e=>e.avatarRemove),i=ew(e=>e.avatarError),d=ew(e=>e.setAvatar),c=ew(e=>e.stageAvatarRemoval),u=ew(e=>e.setAvatarError),[m,x]=(0,n.useState)(!1),p=o?null:null!=s?s:t,b=async e=>{if(l.current&&(l.current.value=""),e){x(!0);try{d(await ay(e))}catch(e){u(e instanceof Error&&"too-small"===e.message?"A imagem precisa ter pelo menos ".concat(256,"\xd7").concat(256,"px."):"N\xe3o foi poss\xedvel ler a imagem. Tente outro arquivo.")}finally{x(!1)}}};return(0,r.jsx)(e3,{label:"Foto de perfil",description:"M\xednimo ".concat(256,"\xd7").concat(256,"px. JPG, PNG ou WebP."),control:(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)("span",{className:"relative shrink-0",children:[(0,r.jsx)("span",{className:"flex size-10 items-center justify-center overflow-hidden rounded-lg border border-border bg-foreground
1/[0.04]",children:p?(0,r.jsx)("img",{src:p,alt:"",referrerPolicy:"no-referrer",draggable:!1,className:"h-full w-full object-cover"}):(0,r.jsx)("span",{className:"text-[13px] font-medium leading-none tracking-tight text-[#052D2B] dark:text-foreground",style:{fontFamily:"var(--font-sans)"},children:P(a)})}),p?(0,r.jsx)(av.$,{type:"button",variant:"destructive",size:"icon","aria-label":"Remover foto",onClick:()=>c(null!==t),className:"absolute -right-1.5 -top-1.5 h-3.5 w-3.5 rounded-full bg-[#EF4444] p-0 text-white ring-2 ring-card before:absolute before:-inset-1.5 before:content-[''] hover:bg-[#DC2626] active:scale-100",children:(0,r.jsx)(ag.X,{size:9,weight:"bold"})}):null]}),(0,r.jsx)("input",{ref:l,type:"file",accept:"image/jpeg,image/png,image/webp",className:"sr-only","aria-label":"Escolher foto",onChange:e=>{var t;b(null==(t=e.target.files)?void 0:t[0])}}),(0,r.jsx)(av.$,{type:"button",variant:"outline",size:"xs",onClick:()=>{var e;return null==(e=l.current)?void 0:e.click()},disabled:m,style:{fontFamily:"var(--font-sans)"},children:p?"Trocar":"Enviar"})]}),footer:i?(0,r.jsx)("p",{className:"text-[12px] leading-4 text-[#B91C1C] dark:text-[#F87171]",style:{fontFamily:"'Eudoxus Sans', 'DM Sans', system-ui, sans-serif"},children:i}):void 0})};var aC=a(91968);let aw="'DM Sans', system-ui, sans-serif",ak=()=>{let e=(0,en.jE)(),t=(0,M.lH)(e=>
1e.setChildModalOpen),[a,l]=(0,n.useState)(!1),[s,o]=(0,n.useState)(""),[i,c]=(0,n.useState)(""),[u,m]=(0,n.useState)(!1),[x,p]=(0,n.useState)(null);(0,n.useEffect)(()=>(t(a),()=>t(!1)),[a,t]);let b=(0,aC.YY)(s),h=i.length>=s.length&&i!==s,f=b&&i===s&&!u,g=()=>{u||l(!1)},v=async()=>{if(f){m(!0),p(null);try{await eb(s),l(!1),Y.oR.success("Senha criada com sucesso"),e.setQueryData(es,!0)}catch(e){p("N\xe3o foi poss\xedvel criar a senha. Tente novamente.")}finally{m(!1)}}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e3,{label:"Criar senha",description:"Defina uma senha para entrar tamb\xe9m com email e senha.",control:(0,r.jsx)("button",{type:"button",onClick:()=>{o(""),c(""),p(null),l(!0)},className:(0,d.cn)("inline-flex h-11 shrink-0 cursor-pointer items-center justify-center rounded-[8px] border border-solid px-3.5","text-[13.5px] font-medium tracking-[-0.01em] transition-colors duration-150","border-[#052D2B]/20 bg-card text-[#052D2B] dark:border-foreground/20 dark:text-foreground","hover:border-[#052D2B]/30 hover:bg-[#052D2B]/[0.025] dark:hover:bg-muted/30","focus-visible:border-[#93E663] focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[#93E663]/20"),style:{fontFamily:aw},children:"Criar senha"})}),a?(0,r.jsxs)(et.E,{elevated:!0,onClose:g,labelledById:"set-password-title",widthClass:"max-w-[440px]",escapeToClose:!u,disableBackdropClose:u,children:[(0,r.jsx)(tB.r,{titleId:"set-password-title",title:"Criar senha",description:"Voc\xea passa a entrar tamb\xe9m com email e senha.",paddingClass:"px-7",onClose:g}),(0,r.jsxs)("div",{className:"flex flex-col gap-4 px-7 py-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(eH.p,{type:"password",size:"lg",label:"Nova senha",value:s,onValueChange:o,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",autoComplete:"new-password",success:b}),(0,r.jsx)(aC.SM,{password:s,align:"left"})]}),(0,r.jsx)(eH.p,{type:"password",size:"lg",label:"Confirmar senha",value:i,onValueChange:c,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",autoComplete:"new-password",error:h?"As senhas n\xe3o s\xe3o iguais":null,success:i.length>0&&!h&&b}),x?(0,r.jsx)("p",{role:"alert",className:(0,d.cn)("rounded-lg border px-3 py-2 text-[12.5px] leading-4","border-[#EF4444]/30 bg-[#EF4444]/12 text-[#B91C1C] dark:text-[#F87171]"),style:{fontFamily:aw},children:x}):null]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 border-t border-solid border-border px-7 py-4",children:[(0,r.jsx)("button",{type:"button",onClick:g,disabled:u,className:(0,d.cn)("inline-flex h-11 flex-1 cursor-pointer items-center justify-center rounded-[8px] px-4 text-[14px] font-medium tracking-[-0.01em]","border border-[#052D2B]/12 bg-transparent text-[#052D2B] transition-colors duration-150","hover:bg-[#052D2B]/[0.03] dark:border-border dark:text-foreground dark:hover:bg-muted/30","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:aw},children:"Cancelar"}),(0,r.jsxs)(ea.j,{onClick:()=>void v(),disabled:!f,className:"h-10 flex-1 text-[14px]",children:[u?(0,r.jsx)(B.y$,{size:16,className:"animate-spin"}):null,"Criar senha"]})]})]}):null]})};var aN=a(12082);let aE="'Eudoxus Sans', 'DM Sans', system-ui, sans-serif",aF=e=>{let{value:t,onPatch:a}=e,[l,s]=(0,n.useState)(()=>te(t.flex.carrierCost)),[o,i]=(0,n.useState)(()=>te(t.flex.outsourcedCost)),[d,c]=(0,n.useState)(t.flex.useOutsourced);return(0,n.useEffect)(()=>{tt(l)!==t.flex.carrierCost&&s(te(t.flex.carrierCost)),tt(o)!==t.flex.outsourcedCost&&i(te(t.flex.outsourcedCost)),c(t.flex.useOutsourced)},[t.flex]),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(e3,{label:"Usar distribui\xe7\xe3o terceirizada / Prep Center",description:"Substitui a transportadora pelo custo terceirizado.",control:(0,r.jsx)(e4,{checked:d,onChange:e=>{c(e),a({flex:{useOutsourced:e}})},ariaLabel:"Usar distribui\xe7\xe3o terceirizada no Flex"})}),(0,r.jsx)(e3,{label:"Transportadora",control:(0,r.jsx)(ta,{value:l,onValueChange:e=>{s(e),a({flex:{carrierCost:tt(e)}})},"aria-label":"Custo de transportadora Flex"})}),(0,r.jsx)(e3,{reveal:d,label:"Distribui\xe7\xe3o terceirizada / Prep Center",control:(0,r.jsx)(ta,{value:o,onValueChange:e=>{i(e),a({flex:{outsourcedCost:tt(e)}})},"aria-label":"Custo de distribui\xe7\xe3o terceirizada Flex"})})]})},aA=e=>{let{value:t,onPatch:a}
1=e,[l,s]=(0,n.useState)(()=>te(t.full.collectionCostPerM3)),[o,i]=(0,n.useState)(t.full.itemsPerM3),[d,c]=(0,n.useState)(()=>te(t.full.outsourcedFee)),[u,m]=(0,n.useState)(t.full.useOutsourced),[x,p]=(0,n.useState)(t.full.useColeta),b=(0,aN.Ze)(t.full.applied),h=(0,aN.Z_)(b),f=(0,aN.JQ)(b);return(0,n.useEffect)(()=>{tt(l)!==t.full.collectionCostPerM3&&s(te(t.full.collectionCostPerM3)),o!==t.full.itemsPerM3&&i(t.full.itemsPerM3),tt(d)!==t.full.outsourcedFee&&c(te(t.full.outsourcedFee)),m(t.full.useOutsourced),p(t.full.useColeta)},[t.full]),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(e3,{label:"Usar distribui\xe7\xe3o terceirizada / Prep Center",description:"Aplica a taxa terceirizada no lugar da coleta pr\xf3pria.",control:(0,r.jsx)(e4,{checked:u,onChange:e=>{m(e),a({full:{useOutsourced:e}})},ariaLabel:"Usar distribui\xe7\xe3o terceirizada no Full"})}),(0,r.jsx)(e3,{label:"Custo da coleta por m\xb3",description:"Usado na calculadora e no lucro at\xe9 a fatura fechar.",control:(0,r.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,r.jsx)(ta,{value:l,onValueChange:e=>{s(e),a({full:{collectionCostPerM3:tt(e)}})},"aria-label":"Custo da coleta por metro c\xfabico Full"}),f?(0,r.jsx)("span",{"data-qa":"full-operation-rate-line",className:"whitespace-nowrap text-[12px] leading-4 text-[#5C5C5C] dark:text-muted-foreground",style:{fontFamily:aE},children:f}):null]})}),(0,r.jsx)(e3,{label:"Itens por m\xb3",description:"Usado na calculadora e nos produtos sem medidas.",control:(0,r.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,r.jsx)(e7,{type:"number",min:1,value:o,onChange:e=>{let t=Number(e.target.value);i(t),a({full:{itemsPerM3:t}})},"aria-label":"Itens por metro c\xfabico Full"}),h?(0,r.jsx)("span",{"data-qa":"full-operation-items-line",className:"whitespace-nowrap text-[12px] leading-4 text-[#5C5C5C] dark:text-muted-foreground",style:{fontFamily:aE},children:h}):null]})}),(0,r.jsx)(e3,{label:"Pagar coleta para galp\xe3o",description:"Inclui o custo de levar os itens at\xe9 o galp\xe3o do Full.",control:(0,r.jsx)(e4,{checked:x,onChange:e=>{p(e),a({full:{useColeta:e}})},ariaLabel:"Pagar coleta para o galp\xe3o Full"})}),(0,r.jsx)(e3,{reveal:u,label:"Taxa terceirizado",control:(0,r.jsx)(ta,{value:d,onValueChange:e=>{c(e),a({full:{outsourcedFee:tt(e)}})},"aria-label":"Taxa de terceirizado Full"})})]})},aB="var(--font-sans)",aS=e=>{let{section:t,envelope:a,loading:n,onPatchGlobal:l,onPatchMlDefaults:s,onPatchShipping:o}=e;switch(t){case"conta":return(0,r.jsx)(aP,{});case"integracoes":return(0,r.jsx)(tq,{});case"seguranca":return(0,r.jsx)(aM,{});case"custos":return(0,r.jsx)("div",{className:"flex flex-col py-4",children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tc,{value:a.global,onPatch:l}),(0,r.jsx)("div",{"aria-hidden":!0,className:"border-t border-dashed border-[#EBEBEB] dark:border-border"}),(0,r.jsx)(to,{})]}):(0,r.jsx)(aD,{loading:n})});case"plano":return(0,r.jsx)(ap,{});case"padroes":return(0,r.jsxs)("div",{className:"flex flex-col py-4",children:[a?(0,r.jsx)(tJ,{value:a.marketplaces.mercadoLivre.defaults,onPatch:s}):(0,r.jsx)(aD,{loading:n}),(0,r.jsx)(az,{label:"Frete gr\xe1tis por padr\xe3o",description:"Assume frete gr\xe1tis nas novas simula\xe7\xf5es de an\xfancio."}),(0,r.jsx)(az,{label:"Parcelamento sem juros",description:"N\xfamero de parcelas assumido no c\xe1lculo do pre\xe7o."}),(0,r.jsx)(az,{label:"Margem-alvo padr\xe3o",description:"Margem de refer\xeancia usada nas novas an\xe1lises."}),(0,r.jsx)(az,{label:"Desconto/rebate padr\xe3o",description:"Abatimento aplicado por padr\xe3o ao simular o an\xfancio."})]});case"full":return(0,r.jsx)("div",{className:"py-4",children:a?(0,r.jsx)(aA,{value:a.marketplaces.mercadoLivre.shippingCosts,onPatch:o}):(0,r.jsx)(aD,{loading:n})});case"flex":return(0,r.jsx)("div",{className:"py-4",children:a?(0,r.jsx)(aF,{value:a.marketplaces.mercadoLivre.shippingCosts,onPatch:o}):(0,r.jsx)(aD,{loading:n})});default:return null}},aD=e=>{let{loading:t}=e;return(0,r.jsx)("div",{className:"flex flex-col gap-3",children:t?[0,1,2].map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-6 py-4",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"h-3.5 w-40 animate-pulse rounded-md bg-muted/60"}),(0,r.jsx)("div",{className:"mt-2 h-2.5 w-52 animate-pulse rounded-md bg-muted/40"})]}),(0,r.jsx)("div",{className:"h-9 w-[160px] animate-pulse rounded-lg bg-muted/40"})]},e)):(0,r.jsx)("p",{className:"py-4 text-[13px] text-muted-foreground",style:{fontFamily:"'Eudoxus Sans', 'DM Sans', system-ui, sans-serif"},children:"N\xe3o foi poss\xedvel carregar estas configura\xe7\xf5es."})})},aL=[{value:"light",label:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B.bd,{size:14}),"Claro"]}),ariaLabel:"Tema claro"},{value:"dark",label:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B.AX,{size:14}),"Escuro"]}),ariaLabel:"Tema escuro"}],aP=()=>{var e,t,a;let{user:l}=(0,L.A)(),{theme:s,toggle:o}=(0,B.DP)(),i="dark"===s?"dark":"light",d=ew(e=>e.nameDraft),c=ew(e=>e.setName),u=ew(e=>e.seedName),m=ew(e=>e.phoneDraft),x=ew(e=>e.setPhone),p=ew(e=>e.phoneLoaded),b=ew(e=>e.phoneError);return(0,n.useEffect)(()=>{var e;u(null!=(e=null==l?void 0:l.name)?e:"")},[null==l?void 0:l.name,u]),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(aj,{currentImage:null!=(t=null==l?void 0:l.image)?t:null,displayName:(null==l||null==(e=l.name)?void 0:e.trim())||(null==l?void 0:l.email.split("@")[0])||"Voc\xea"}),(0,r.jsx)(e3,{label:"Nome",description:"Como voc\xea aparece na Cargoos.",control:(0,r.jsx)(tn,{value:d,onChange:c,placeholder:"Seu nome",ariaLabel:"Nome"})}),(0,r.jsx)(e3,{label:"Email",description:"Usado para entrar e n\xe3o pode ser alterado por aqui.",control:(0,r.jsx)(tn,{value:null!=(a=null==l?void 0:l.email)?a:"",ariaLabel:"Email",locked:!0})}),(0,r.jsx)(e3,{label:"WhatsApp",description:"Celular que recebe os avisos da conta.",control:(0,r.jsx)(eH.p,{type:"phone",size:"lg",value:m,onValueChange:x,error:b,"aria-label":"Telefone do WhatsApp",containerClassName:"w-[280px]",disabled:!p})}),(0,r.jsx)(e3,{label:"Tema",description:"Apar\xeancia clara ou escura da interface.",control:(0,r.jsx)(e9,{value:i,onChange:e=>{e!==i&&o()},options:aL,ariaLabel:"Selecionar tema"})})]})},aM=()=>{let e=(()=>{let e=(0,er.I)({queryKey:es,queryFn:eo,staleTime:1/0,gcTime:1/0});return void 0!==e.data?e.data:!!e.isError||null})();return(0,r.jsxs)("div",{className:"flex flex-col py-4",children:[null===e?(0,r.jsx)(a_,{}):e?(0,r.jsx)(tY,{}):(0,r.jsx)(ak,{}),(0,r.jsx)(az,{label:"Autentica\xe7\xe3o em dois fatores",description:"Uma camada extra de prote\xe7\xe3o ao entrar na conta."}),(0,r.jsx)(az,{label:"C\xf3digos de backup",description:"C\xf3digos para recuperar o acesso se perder o 2FA."}),(0,r.jsx)(ts,{})]})},a_=()=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-6 border-b border-dashed border-[#
1EBEBEB] py-5 last:border-b-0 dark:border-border",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"h-3.5 w-32 animate-pulse rounded-md bg-muted/60"}),(0,r.jsx)("div",{className:"mt-2 h-2.5 w-60 animate-pulse rounded-md bg-muted/40"})]}),(0,r.jsx)("div",{className:"h-11 w-[120px] shrink-0 animate-pulse rounded-[8px] bg-muted/40"})]}),az=e=>{let{label:t,description:a}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-6 border-b border-dashed border-[#EBEBEB] py-5 last:border-b-0 dark:border-border",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1 opacity-55",children:[(0,r.jsx)("p",{className:"text-[14px] font-medium leading-5 tracking-[-0.01em] text-[#171717] dark:text-foreground",style:{fontFamily:aB},children:t}),a?(0,r.jsx)("p",{className:"mt-0.5 text-[12px] leading-4 text-[#5C5C5C] dark:text-muted-foreground",style:{fontFamily:"'Eudoxus Sans', 'DM Sans', system-ui, sans-serif"},children:a}):null]}),(0,r.jsxs)("button",{type:"button",disabled:!0,"aria-disabled":!0,className:(0,d.cn)("inline-flex h-11 shrink-0 cursor-not-allowed items-center justify-center gap-2 rounded-[8px] border px-3.5 text-[13.5px] font-medium tracking-[-0.01em]","border-[#EBEBEB] bg-transparent text-[#8A8A8A] dark:border-border dark:text-muted-foreground"),style:{fontFamily:aB},children:[(0,r.jsx)(B.WO,{size:13,className:"shrink-0"}),"Em breve"]})]})},aR="var(--font-sans)",aT="settings-modal-title",aI=()=>(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,r.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),aV=()=>{let e=(0,M.lH)(e=>e.open),t=(0,M.lH)(e=>e.section),a=(0,M.lH)(e=>e.setSection),l=(0,M.lH)(e=>e.close),s=(0,M.lH)(e=>e.childModalOpen);(e=>{let t=(0,en.jE)();(0,n.useEffect)(()=>{e&&t.prefetchQuery({queryKey:es,queryFn:eo,staleTime:1/0})},[e,t])})(e);let o=(0,eL.C)(e=>e.envelope),i=(0,eL.C)(e=>e.draft),c=(0,eL.C)(e=>e.loading),u=(0,eL.C)(e=>e.load),m=(0,eL.C)(e=>e.stage),x=(0,eL.C)(e=>e.commit),p=(0,eL.C)(e=>e.discard),b=(0,eL.C)(e=>e.settingsDirty),h=ew(e=>e.loadPhone),f=ew(e=>e.commitPhone),g=ew(e=>e.discardPhone),v=ew(e=>
1e.phoneDirty),y=ew(e=>e.phoneValid),j=ew(e=>e.commitName),C=ew(e=>e.discardName),w=ew(e=>e.nameDirty),k=ew(e=>e.nameValid),N=ew(e=>e.commitAvatar),E=ew(e=>e.discardAvatar),F=ew(e=>e.avatarDirty),{refreshSession:A}=(0,L.A)(),S=eS(e=>e.load),D=eN(e=>e.packagingDraft),P=eN(e=>e.discardPackaging),_=eN(e=>e.setGlobalPackaging),z=eN(e=>{var t,a;return null!=(a=null==(t=e.data)?void 0:t.packaging.effective)?a:null}),R=(0,eD.V)(e=>e.apply),T=(0,eD.V)(e=>e.clear),I=null!==D,[V,O]=(0,n.useState)(!1),[q,H]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&(o||u(),h(),S())},[e,o,u,h,S]);let U=b||v||w||I||F,G=U&&y&&k&&!V,Z=(0,n.useCallback)(e=>m({global:e}),[m]),W=(0,n.useCallback)(e=>m({marketplaces:{mercadoLivre:{defaults:e}}}),[m]),K=(0,n.useCallback)(e=>m({marketplaces:{mercadoLivre:{shippingCosts:e}}}),[m]),Q=(0,n.useCallback)(async e=>{O(!0);let t=i?(e=>"custom"===e.taxPresetId?e.customTaxRate:"simples4"===e.taxPresetId?4:6*("simples6"===e.taxPresetId))(i.global):null,a="all"===e&&null!==D&&null!==z?D-z:void 0;R({...null!==t?{taxRatePct:t}:{},...void 0!==a?{packagingDeltaCentavos:a}:{}});let r=[x(),f(),j(),N()];null!==e&&null!==D&&r.push(_(D,e));let n=await Promise.allSettled(r);O(!1),F&&A(),n.every(e=>"fulfilled"===e.status)?(Y.oR.success("Altera\xe7\xf5es salvas"),(0,ec.kM)("settings","saved"),Promise.all([eE.TH.getState().refreshAll(),eu.q.invalidateQueries({queryKey:[ei.u]})]).finally(()=>T()),(0,ed.Os)()):(Y.oR.error("N\xe3o foi poss\xedvel salvar algumas altera\xe7\xf5es."),eE.TH.getState().refreshAll().finally(()=>T()))},[R,T,F,x,f,j,N,i,A,z,D,_]),J=(0,n.useCallback)(()=>{if(G){if(I)return void H(!0);Q(null)}},[G,I,Q]),X=(0,n.useCallback)(()=>{p(),g(),C(),E(),P()},[p,g,C,E,P]),$=(0,n.useCallback)(()=>{p(),g(),C(),E(),P(),l()},[p,g,C,E,P,l]);if(!e)return null;let er=(e=>{var t;return null!=(t=eV.find(t=>t.id===e))?t:eV[0]})(t);return(0,r.jsxs)(et.E,{onClose:$,labelledById:aT,widthClass:"max-w-[1080px]",entrance:"rise",elevated:!0,escapeToClose:!s&&!U,disableBackdropClose:U,cardClassName:"rounded-[24px]",children:[(0,r.jsxs)("div",{className:"flex h-[680px] max-h-[calc(100vh-32px)] min-h-0",children:[(0,r.jsx)("aside",{className:"hidden w-[256px] shrink-0 overflow-y-auto border-r border-[#EBEBEB] px-4 py-6 dark:border-border sm:block",children:(0,r.jsx)(eq,{active:t,onChange:a})}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,r.jsxs)("header",{className:"flex shrink-0 items-center justify-between gap-3.5 border-b border-[#EBEBEB] px-5 py-4 dark:border-border",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("h2",{id:aT,className:"truncate text-[18px] font-medium leading-6 tracking-[-0.02em] text-[#052D2B] dark:text-foreground",style:{fontFamily:aR},children:er.title}),(0,r.jsx)("p",{className:"mt-1 truncate text-[13.5px] leading-5 text-[#5C5C5C] dark:text-muted-foreground",style:{fontFamily:"'Eudoxus Sans', 'DM Sans', system-ui, sans-serif"},children:er.subtitle})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2.5",children:U?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:X,disabled:V,className:(0,d.cn)("flex h-11 items-center rounded-lg border border-[#EBEBEB] bg-white px-4 text-[14px] font-medium text-[#5C5C5C]","shadow-[0_1px_2px_rgba(10,13,20,0.03)] transition-colors","hover:border-[#052D2B]/20 hover:text-[#052D2B]","disabled:cursor-not-allowed disabled:opacity-50","dark:border-border dark:bg-card dark:text-muted-foreground dark:hover:text-foreground"),style:{fontFamily:aR},children:"Cancelar"}),(0,r.jsxs)(ea.j,{className:"h-10 text-[14px]",onClick:J,disabled:!G,children:[V?(0,r.jsx)(B.y$,{size:14}):null,V?"Salvando...":"Salvar"]})]}):(0,r.jsx)("button",{type:"button",onClick:$,"aria-label":"Fechar configura\xe7\xf5es",className:"flex size-10 items-center justify-center rounded-[8px] bg-[#052D2B]/[0.05] text-[#052D2B]/60 transition-colors hover:text-[#052D2B] dark:bg-muted/30 dark:text-muted-foreground dark:hover:text-foreground",children:(0,r.jsx)(aI,{})})})]}),(0,r.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto px-6",children:[(0,r.jsx)("div",{className:"mb-2 pt-4 sm:hidden",children:(0,r.jsx)(eq,{active:t,onChange:a})}),(0,r.jsx)(aS,{section:t,envelope:null!=i?i:o,loading:c,onPatchGlobal:Z,onPatchMlDefaults:W,onPatchShipping:K})]})]})]}),(0,r.jsx)(ee.p,{variant:"packaging",open:q,submitting:V,onClose:()=>H(!1),onConfirm:e=>{H(!1),Q(e)}})]})};var aO=a(72555);let aq=e=>{let{open:t,onClose:a}
1=e,[l,s]=(0,n.useState)(!1),o=(0,t3.z)(e=>e.refresh);return((0,n.useEffect)(()=>s(!0),[]),(0,n.useEffect)(()=>{if(!t)return;let e=!1;return(0,eQ.$K)().then(()=>{e||o()}).catch(()=>{}),()=>{e=!0}},[t,o]),t&&l)?(0,k.createPortal)((0,r.jsx)(aO.E,{onClose:a,labelledById:"subscription-pricing-title",maxWidthClassName:"max-w-[1280px]",children:(0,r.jsx)("div",{"data-qa":"upgrade-modal",className:"overflow-y-auto",children:(0,r.jsx)(at,{onClose:a})})}),document.body):null};var aH=a(67404);let aU=()=>{var e,t;let a=(0,s.usePathname)(),l=(0,c.eM)(a),o=(0,aH.m)(e=>e.leafLabel),i=l.slice(0,-1),d=null==(e=[...i].reverse().find(e=>e.href))?void 0:e.href,u=null==(t=[...i].reverse().find(e=>e.href))?void 0:t.label;return(0,r.jsx)(B.x4,{className:"min-w-0",children:(0,r.jsxs)(B.AB,{className:"min-w-0 flex-nowrap",children:[i.length>0&&(0,r.jsxs)(n.Fragment,{children:[(0,r.jsx)(B.J5,{className:"sm:hidden",children:d?(0,r.jsx)(x(),{href:d,"aria-label":"Voltar para ".concat(u),className:"text-muted-foreground transition-colors hover:text-foreground",style:{fontFamily:"var(--font-sans)"},children:"â¦"}):(0,r.jsx)("span",{"aria-hidden":!0,className:"text-muted-foreground",style:{fontFamily:"var(--font-sans)"},children:"â¦"})}),(0,r.jsx)(B.tH,{className:"shrink-0 sm:hidden"})]},"collapsed-ancestors"),l.map((e,t)=>{var a;let s=t===l.length-1,i=e.isCurrent&&o?o:e.label;return(0,r.jsxs)(n.Fragment,{children:[(0,r.jsx)(B.J5,{className:s?"min-w-0":"max-sm:hidden",children:e.isCurrent?(0,r.jsx)(B.tJ,{"data-qa":"breadcrumb-current",className:"block max-w-[280px] truncate",title:i,style:{fontFamily:"var(--font-sans)"},children:i}):e.href?(0,r.jsx)(x(),{href:e.href,className:"whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground",style:{fontFamily:"var(--font-sans)"},children:i}):(0,r.jsx)("span",{className:"whitespace-nowrap text-muted-foreground",style:{fontFamily:"var(--font-sans)"},children:i})}),!s&&(0,r.jsx)(B.tH,{className:"shrink-0 max-sm:hidden"})]},"".concat(null!=(a=e.href)?a:e.label,"-").concat(t))})]})})};var aG=a(95559),aZ=a(13220);let aW=e=>{var t;let{onToggleSidebar:a,isMobile:l}=e,{theme:o,toggle:c}=(0,B.DP)(),{isPremium:u,isPaidTrial:m,role:x}=(0,i.q)(),b=(0,g.S)(e=>e.open),h=(0,g.S)(e=>e.setOpen),f=(0,t3.z)(e=>e.refreshedAt),v=(0,t3.z)(e=>
1e.error),y=(0,s.usePathname)(),j=(0,s.useRouter)(),C=(0,s.useSearchParams)(),w="dark"===o,k=(0,aZ.k)(e=>e.gifts),N=(0,aZ.k)(e=>e.refresh),E=(0,aZ.k)(e=>e.affiliateGift),F=(0,aZ.k)(e=>e.refreshAffiliateGift),A=(0,aZ.k)(e=>e.trackedPromotionIds),S=(0,aZ.k)(e=>e.markAvailableTracked),[D,L]=(0,n.useState)(!1),[P,M]=(0,n.useState)(Date.now()),_=(0,n.useMemo)(()=>k.filter(e=>new Date(e.redeemBy).getTime()>P).toSorted((e,t)=>new Date(e.redeemBy).getTime()-new Date(t.redeemBy).getTime()),[k,P]),z=_[0],R=null===f||u||z?null:E,T=null!=(t=null==z?void 0:z.trialDays)?t:null==R?void 0:R.trialDays;return(0,n.useEffect)(()=>{N()},[N]),(0,n.useEffect)(()=>{null===f||u||F()},[f,u,F]),(0,n.useEffect)(()=>{let e=window.setInterval(()=>M(Date.now()),1e3);return()=>window.clearInterval(e)},[]),(0,n.useEffect)(()=>{for(let e of _)A.includes(e.promotionId)||((0,ec.u4)("promotion_gift_available",{promotionId:e.promotionId,hasSenderName:!!e.affiliateName,trialDays:e.trialDays}),S(e.promotionId))},[_,S,A]),(0,n.useEffect)(()=>{if((null==C?void 0:C.get("gift_redeemed"))!=="1")return;try{let e=sessionStorage.getItem("cargoos:last-gift"),t=e?JSON.parse(e):{};(0,ec.u4)("promotion_subscribed_via",t),sessionStorage.removeItem("cargoos:last-gift")}catch(e){(0,ec.u4)("promotion_subscribed_via")}(0,eQ.$K)().then(()=>Promise.all([t3.z.getState().refresh(),N(),F()])).catch(()=>void 0);let e=new URLSearchParams(C.toString());e.delete("gift_redeemed"),window.history.replaceState(null,"",e.toString()?"".concat(y,"?").concat(e):y),p.q.getState().refetch().then(()=>{var e;let t=null==(e=p.q.getState().state)?void 0:e.status;t&&"completed"!==t&&j.replace("/dashboard/onboarding")}).catch(()=>void 0)},[y,C,F,N,j]),(0,n.useEffect)(()=>{if((null==C?void 0:C.get("upgrade"))!=="1"||null===f&&!v)return;u||h(!0);let e=new URLSearchParams(C.toString());e.delete("upgrade");let t=e.toString(),a=t?"".concat(y,"?").concat(t):y;window.history.replaceState(null,"",a)},[y,C,h,f,v,u]),(0,r.jsxs)("div",{className:(0,d.cn)("sticky top-0 z-30 h-[60px] border-b border-border","bg-background/90 backdrop-blur-md"),children:[(0,r.jsxs)("div",{className:"mx-auto flex h-full items-center justify-between pl-3 pr-4",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:a,"aria-label":l?"Abrir menu":"Alternar sidebar",className:(0,d.cn)("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg","text-muted-foreground hover:text-foreground hover:bg-accent","transition-all duration-200 cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime/40"),children:(0,r.jsx)(B.e6,{size:18})}),(0,r.jsx)("div",{className:"mr-2 h-5 w-px bg-border"}),(0,r.jsx)(aU,{})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[void 0!==T&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(aX,{trialDays:T,onClick:()=>L(!0)}),(0,r.jsx)("div",{"aria-hidden":"true",className:"mx-1 h-5 w-px bg-border"})]}),l?null:(0,r.jsx)(aK,{ariaLabel:"Notifica\xe7\xf5es",disabled:!0,title:"Em breve",children:(0,r.jsx)(a$,{})}),(0,r.jsx)(aK,{ariaLabel:w?"Ativar modo claro":"Ativar modo escuro",onClick:c,children:w?(0,r.jsx)(B.AX,{size:16}):(0,r.jsx)(B.bd,{size:16})}),(0,r.jsxs)(aK,{ariaLabel:"Ajuda",onClick:()=>{window.open("https://wa.me/5511936234398?text=Oi%2C%20tudo%20bem%3F%20Preciso%20de%20ajuda%20na%20Cargoos","_blank","noopener,noreferrer")},children:[(0,r.jsx)(B.vN,{size:16}),(0,r.jsx)("span",{children:"Ajuda"})]}),u?(0,r.jsx)(aQ,{label:"influencer"===x?"Parceiro Cargoos":m?"Trial Pago":"Plano Pro"}):(0,r.jsx)(aJ,{onClick:()=>h(!0)})]})]}),(0,r.jsx)(aq,{open:b,onClose:()=>h(!1)}),(0,r.jsx)(aV,{}),D&&z&&(0,r.jsx)(aG.eW,{gifts:_,initialGift:z,onClose:()=>L(!1)}),D&&!z&&R&&(0,r.jsx)(aG.eW,{affiliateGift:R,onClose:()=>L(!1)})]})},aK=e=>{let{children:t,ariaLabel:a,onClick:n,disabled:l,title:s}=e;return(0,r.jsx)("button",{type:"button",onClick:n,disabled:l,"aria-label":a,title:s,className:(0,d.cn)("inline-flex h-10 items-center justify-center gap-1.5 rounded-[10px] px-3","text-[14px] font-medium text-[#052D2B] dark:text-foreground","border border-[#052D2B]/12 bg-transparent hover:bg-[#052D2B]/[0.04] hover:border-[#052D2B]/20","dark:border-border dark:hover:bg-foreground
1/[0.05] dark:hover:border-foreground/15","transition-colors duration-150 cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:cursor-not-allowed disabled:bg-transparent disabled:text-[#052D2B]/40 disabled:border-[#052D2B]/8 disabled:hover:bg-transparent disabled:hover:border-[#052D2B]/8","dark:disabled:text-foreground/40 dark:disabled:border-border/50 dark:disabled:hover:bg-transparent dark:disabled:hover:border-border/50"),style:{fontFamily:"var(--font-sans)"},children:t})},aQ=e=>{let{label:t="Plano Pro"}=e;return(0,r.jsxs)("span",{className:(0,d.cn)("relative inline-flex h-[33px] items-center overflow-hidden rounded-[8px] px-3","bg-[#B1FE7B] text-[#052D2B]","border-[0.5px] border-white/25","ring-1 [--btn-ring:color-mix(in_oklab,#052D2B_15%,#B1FE7B)] ring-[var(--btn-ring)]","shadow-[inset_0_1px_0_rgba(255,255,255,0.5)]","text-[13px] font-medium tracking-[-0.01em]"),style:{fontFamily:"var(--font-sans)"},"aria-label":"".concat(t," ativo"),children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 -translate-x-full animate-[badge-shine_5s_ease-in-out_infinite]",style:{background:"linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%)"}}),(0,r.jsx)("span",{className:"relative",children:t})]})},aJ=e=>{let{onClick:t}=e;return(0,r.jsxs)(ea.j,{onClick:t,"aria-label":"Fazer upgrade pro Plano Pro",className:"h-9 gap-1.5 px-3 text-[14px] tracking-[-0.01em]",children:[(0,r.jsx)(a0,{}),(0,r.jsx)("span",{children:"Upgrade"})]})},aX=e=>{let{trialDays:t,onClick:a}=e;return(0,r.jsxs)("button",{type:"button","aria-label":"Abrir presente: ".concat(t," dias de Cargoos PRO"),onClick:a,className:(0,d.cn)("relative inline-flex h-10 cursor-pointer items-center gap-1.5 overflow-hidden rounded-[10px] px-3","bg-[#9EEA6C] text-[#052D2B] text-[14px] font-medium tracking-[-0.01em]","border-[0.5px] border-white/25","ring-1 [--btn-ring:color-mix(in_oklab,#052D2B_15%,#9EEA6C)] ring-[var(--btn-ring)]","shadow-[inset_0_1px_0_rgba(255,255,255,0.5)]","transition-[filter] duration-150 hover:brightness-[1.04] active:scale-[0.99]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#93E663]"),style:{fontFamily:"var(--font-sans)"},children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"landing-cta-bg pointer-events-none absolute inset-0 opacity-60"}),(0,r.jsxs)("span",{className:"relative inline-flex items-center gap-1.5",children:[(0,r.jsx)(aY,{}),(0,r.jsxs)("span",{children:[t," dias de Cargoos PRO"]})]})]})},a$=()=>(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}),(0,r.jsx)("path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"})]}),aY=()=>(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"3",y:"8",width:"18",height:"4",rx:"1"}),(0,r.jsx)("path",{d:"M12 8v13M5 12v9h14v-9M7.5 8C5 8 4 6.8 4 5.5S5 3 6.5 3C9 3 12 8 12 8M16.5 8C19 8 20 6.8 20 5.5S19 3 17.5 3C15 3 12 8 12 8"})]}),a0=()=>(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M13.2 6.6L14.39 5.17L17.23 7.6L18.43 6.18L15.59 3.75L16.39 2.8L14.95 1.64L7.65 10.41C5.93 9.66 3.87 10.03 2.61 11.53C1.87 12.42 1.51 13.56 1.61 14.7C1.71 15.85 2.26 16.91 3.15 17.65C4.03 18.39 5.17 18.75 6.32 18.65C7.46 18.55 8.52 18 9.26 17.11C10.53 15.61 10.45 13.15 9.03 11.57L11.97 8.06L14.88 10.46L16.04 9.03L13.2 6.6L13.2 6.6ZM7.71 15.96C6.86 16.98 5.39 17.16 4.31 16.26C3.24 15.36 3.18 13.86 4.02 12.87C4.85 11.87 6.4 11.72 7.41 12.57C7.9 12.98 8.2 13.57 8.26 14.2C8.31 14.84 8.12 15.47 7.71 15.96ZM5.35 0.97L4.42 3.03L2.37 3.96L4.42 4.89L5.35 6.94L6.28 4.89L8.33 3.96L6.28 3.03L5.35 0.97Z",fill:"currentColor"})}),a1="cargoos_sidebar_collapsed",a2=e=>{let{children:t,aiServiceConfigured:a,sidebarFlags:i,sidebarStages:d,statusBanner:c="off"}=e,{collapsed:u,mobileOpen:m,isMobile:x,toggleCollapsed:p,closeMobile:b,toggleMobile:h}=(()=>
1{let[e,t]=(0,n.useState)(()=>(()=>{try{return"1"===window.localStorage.getItem(a1)}catch(e){return!1}})()),[a,r]=(0,n.useState)(!1),[l,s]=(0,n.useState)(!1),o=(0,n.useRef)(!1);(0,n.useEffect)(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),t=()=>s(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,n.useEffect)(()=>{if(!o.current){o.current=!0;return}try{window.localStorage.setItem(a1,e?"1":"0")}catch(e){}},[e]),(0,n.useEffect)(()=>{if(!a)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[a]),(0,n.useEffect)(()=>{if(!a)return;let e=e=>{"Escape"===e.key&&r(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a]),(0,n.useEffect)(()=>{!l&&a&&r(!1)},[l,a]);let i=(0,n.useCallback)(()=>{t(e=>!e)},[]),d=(0,n.useCallback)(()=>r(!0),[]);return{collapsed:e,mobileOpen:a,isMobile:l,toggleCollapsed:i,openMobile:d,closeMobile:(0,n.useCallback)(()=>r(!1),[]),toggleMobile:(0,n.useCallback)(()=>r(e=>!e),[])}})(),f=(0,o.ZS)(),g=(0,s.usePathname)(),v=(0,n.useRef)(null);(0,n.useLayoutEffect)(()=>{v.current&&(v.current.scrollTop=0),window.scrollTo(0,0)},[g]);let y=(0,l.g)(e=>e.hydrate);return(0,n.useEffect)(()=>{d&&y(d)},[d,y]),(0,n.useEffect)(()=>{let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[]),(0,r.jsxs)("div",{className:"flex h-screen w-full flex-col overflow-hidden bg-background",children:[(0,r.jsx)($,{kind:c}),(0,r.jsxs)("div",{className:"flex min-h-0 w-full flex-1 overflow-hidden",children:[(0,r.jsx)(G,{collapsed:u,isMobile:x,mobileOpen:m,onToggleCollapsed:p,onCloseMobile:b,aiServiceConfigured:a,flags:i,stages:d,productsReadModel:f}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,r.jsx)(aW,{onToggleSidebar:()=>{x?h():p()},isMobile:x}),(0,r.jsx)("div",{ref:v,className:"min-h-0 flex-1 overflow-auto [scrollbar-gutter:stable]",children:t})]})]})]})}},59394:(e,t,a)=>{"use strict";a.d(t,{An:()=>s,KV:()=>d,Nr:()=>i,VP:()=>o,e$:()=>u,jr:()=>c,qX:()=>l});var r=a(37811);let n=e=>{let t=null==e?void 0:e.trim().toLowerCase();return"1"===t||"true"===t||"yes"===t||"on"===t},l=n("true"),s=n("true"),o=n("true"),i=n(r.env.NEXT_PUBLIC_FEATURE_INVOICES),d=n("true")&&n("true"),c=n(r.env.NEXT_PUBLIC_FEATURE_GENERATORS),u="/dashboard/onboarding"},61880:(e,t,a)=>{"use strict";a.d(t,{FV:()=>s,lH:()=>l,yF:()=>n});var r=a(77096);let n="conta",l=(0,r.v)(e=>({open:!1,section:n,justConnectedMl:!1,childModalOpen:!1,setChildModalOpen:t=>e({childModalOpen:t}),openSettings:(t,a)=>{var r;return e({open:!0,section:null!=t?t:n,justConnectedMl:null!=(r=null==a?void 0:a.justConnectedMl)&&r,childModalOpen:!1})},setSection:t=>e({section:t,justConnectedMl:!1}),close:()=>e({open:!1,justConnectedMl:!1,childModalOpen:!1})})),s=()=>l.getState().openSettings("plano")},62547:(e,t,a)=>{"use strict";a.d(t,{T:()=>d});var r=a(6892),n=a(35028),l=a(94520),s=a(91575),o=a(71919);let i="var(--font-sans)",d=e=>{let{title:t,body:a,confirmLabel:d,cancelLabel:c="Cancelar",danger:u=!1,busy:m=!1,onConfirm:x,onCancel:p,secondaryAction:b,elevated:h=!1}=e;return(0,r.jsxs)(l.E,{onClose:p,labelledById:"confirm-dialog-title",widthClass:"max-w-[440px]",elevated:h,children:[(0,r.jsx)("div",{className:"border-b border-solid border-border px-7 py-5",children:(0,r.jsx)("h2",{id:"confirm-dialog-title",className:"text-[19px] font-medium leading-tight tracking-[-0.02em] text-[#052D2B] dark:text-foreground",style:{fontFamily:i},children:t})}),(0,r.jsx)("div",{className:"px-7 py-5 text-[14px] leading-relaxed text-muted-foreground",style:{fontFamily:"'Eudoxus Sans', 'DM Sans', system-ui, sans-serif"},children:a}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-solid border-border px-7 py-4",children:[(0,r.jsx)("div",{className:"min-w-0",children:b?(0,r.jsx)("button",{type:"button",onClick:b.onClick,disabled:m,className:(0,o.cn)("inline-flex h-10 cursor-pointer items-center rounded-[8.1px] text-[13.5px] font-medium","text-muted-foreground transition-colors hover:text-[#052D2B] dark:hover:text-foreground","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:i},children:b.label}):null}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:p,disabled:m,className:(0,o.cn)("inline-flex h-10 cursor-pointer items-center justify-center rounded-[8.1px] px-4 text-[14px] font-medium tracking-[-0.01em]","border border-[#052D2B]/12 bg-transparent text-[#052D2B] transition-colors duration-150","hover:bg-[#052D2B]/[0.03] dark:border-border dark:text-foreground dark:hover:bg-muted/30","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:i},children:c}),u?(0,r.jsxs)("button",{type:"button",onClick:x,disabled:m,className:(0,o.cn)("inline-flex h-10 cursor-pointer items-center justify-center gap-2 rounded-[8.1px] px-4 text-[14px] font-medium tracking-[-0.01em] transition-colors duration-150","border border-[#
1EF4444] bg-[#EF4444] text-white hover:bg-[#DC2626]","disabled:cursor-not-allowed disabled:opacity-50"),style:{fontFamily:i},children:[m?(0,r.jsx)(n.y$,{size:16,className:"animate-spin"}):null,d]}):(0,r.jsxs)(s.j,{onClick:x,disabled:m,className:"h-10 px-4 text-[14px]",children:[m?(0,r.jsx)(n.y$,{size:16,className:"animate-spin"}):null,d]})]})]})]})}},66215:(e,t,a)=>{"use strict";a.d(t,{DashboardBootstrap:()=>u});var r=a(78016),n=a(87275),l=a(36491),s=a(63524),o=a(77096),i=a(92005),d=a(92038);let c=(0,o.v)(e=>({data:null,refreshedAt:null,loading:!1,error:null,refresh:async()=>{e({loading:!0,error:null});try{let t=await (0,d.uV)();e({data:t.subscription?{status:t.subscription.status,currentPeriodEnd:t.subscription.currentPeriodEnd,cancelAtPeriodEnd:t.subscription.cancelAtPeriodEnd}:null,loading:!1,refreshedAt:Date.now()})}catch(t){if((0,i.d7)(t)&&(401===t.status||403===t.status))return void e({data:null,loading:!1,refreshedAt:Date.now(),error:null});e({loading:!1,error:t instanceof i.hD?t.message:"Failed to load subscription"})}},invalidate:()=>e({refreshedAt:0})}));(0,n.mc)(()=>{c.getState().refresh()});let u=()=>((0,r.useEffect)(()=>{l.z.getState().refresh(),c.getState().refresh(),s.C.getState().load();let e=()=>{let e=l.z.getState();(0,n.QO)(e.refreshedAt)&&!e.loading&&e.refresh();let t=c.getState();(0,n.QO)(t.refreshedAt)&&!t.loading&&t.refresh()},t=()=>e(),a=()=>{"visible"===document.visibilityState&&e()};window.addEventListener("focus",t),document.addEventListener("visibilitychange",a);let r=window.setInterval(()=>{"visible"===document.visibilityState&&e()},3e5);return()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",a),window.clearInterval(r)}},[]),null)},67404:(e,t,a)=>{"use strict";a.d(t,{m:()=>r});let r=(0,a(77096).v)(e=>({leafLabel:null,setLeafLabel:t=>e({leafLabel:t})}))},68253:(e,t,a)=>{"use strict";a.d(t,{GF:()=>l,Vh:()=>n,d5:()=>o,yE:()=>s});let r=()=>{try{let e="__cargoos_probe__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}},n=e=>{if(!r())return null;try{let t=window.localStorage.getItem(e);if(!t)return null;return JSON.parse(t)}catch(e){return null}},l=(e,t)=>{if(!r())return!1;try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){return!1}},s=e=>{if(r())try{window.localStorage.removeItem(e)}catch(e){}},o={activeCollection:"cargoos.activeCollection",settingsCache:"cargoos.settings.cache",eanResultsPageSize:"cargoos.ean.results.pageSize",suppliers:"cargoos.suppliers",suppliersStockConfig:"cargoos.suppliers.stockConfig",suppliersPageSize:"cargoos.suppliers.pageSize",costHistoryPageSize:"cargoos.suppliers.costHistory.pageSize",costs:"cargoos.costs",costsPageSize:"cargoos.costs.pageSize",productGroups:"cargoos.productGroups",productAttachments:"cargoos.productAttachments",productCostLayers:"cargoos.productCostLayers",adsPeriod:"cargoos.ads.period"}},79210:(e,t,a)=>{"use strict";a.d(t,{ProtectedRoute:()=>i});var r=a(6892),n=a(78016),l=a(60393),s=a(43114),o=a(69589);let i=e=>{let{children:t}=e,{user:a,loading:i}=(0,o.A)(),{replace:d}=(0,l.useRouter)();return((0,n.useEffect)(()=>{!i&&(a&&a.emailVerified||d("1"===new URL(window.location.href).searchParams.get("upgrade")?"/auth?upgrade=1":"/auth"))},[i,a,d]),!i&&a&&a.emailVerified)?(0,r.jsx)(r.Fragment,{children:t}):(0,r.jsx)(s.S,{})}},80219:(e,t,a)=>{"use strict";a.d(t,{FlickeringGrid:()=>s});var r=a(6892),n=a(78016),l=a(71919);let s=(0,n.memo)(e=>{let{squareSize:t=4,gridGap:a=6,flickerChance:s=.3,color:o="rgb(0, 0, 0)",width:i,height:d,className:c,maxOpacity:u=.3,...m}=e,x=(0,n.useRef)(null),p=(0,n.useRef)(null),[b,h]=(0,n.useState)({width:0,height:0}),[f,g]=(0,n.useState)(!1),v=(0,n.useMemo)(()=>(e=>{let t=document.createElement("canvas");t.width=t.height=1;let a=t.getContext("2d");if(!a)return"rgba(255, 0, 0,";a.fillStyle=e,a.fillRect(0,0,1,1);let[r,n,l]=Array.from(a.getImageData(0,0,1,1).data);return"rgba(".concat(r,", ").concat(n,", ").concat(l,",")})(o),[o]),y=(0,n.useCallback)((e,r,n)=>{let l=window.devicePixelRatio||1;e.width=r*l,e.height=n*l,Object.assign(e.style,{width:"".concat(r,"px"),height:"".concat(n,"px")});let s=Math.floor(r/(t+a)),o=Math.floor(n/(t+a)),i=new Float32Array(s*o);for(let e=0;e<i.length;e++)i[e]=Math.random()*u;return{cols:s,rows:o,squares:i,dpr:l}},[t,a,u]),j=(0,n.useCallback)((e,t)=>{for(let a=0;a<e.length;a++)Math.random()<s*t&&(e[a]=Math.random()*u)},[s,u]),C=(0,n.useCallback)((e,r,n,l,s,o,i)=>{e.clearRect(0,0,r,n),e.fillStyle="transparent",e.fillRect(0,0,r,n);for(let r=0;r<l;r++)for(let n=0;n<s;n++){let l=o[r*s+n];e.fillStyle="".concat(v).concat(l,")"),e.fillRect(r*(t+a)*i,n*(t+a)*i,t*i,t*i)}},[v,t,a]);return(0,n.useEffect)(()=>{let e,t,a=x.current,r=p.current;if(!a||!r)return;let n=a.getContext("2d");if(!n)return;let l=()=>{let e=i||r.clientWidth,n=d||r.clientHeight;h({width:e,height:n}),t=y(a,e,n)};l();let s=0,o=r=>{if(!f)return;let l=(r-s)/1e3;s=r,j(t.squares,l),C(n,a.width,a.height,t.cols,t.rows,t.squares,t.dpr),e=requestAnimationFrame(o)},c=new ResizeObserver(()=>l());c.observe(r);let u=new IntersectionObserver(e=>{let[t]=e;return g(t.isIntersecting)},{threshold:0});return u.observe(a),f&&(e=requestAnimationFrame(o)),()=>{cancelAnimationFrame(e),c.disconnect(),u.disconnect()}},[y,j,C,i,d,f]),(0,r.jsx)("div",{ref:p,className:(0,l.cn)("h-full w-full",c),...m,children:(0,r.jsx)("canvas",{ref:x,className:"pointer-events-none",style:{width:b.
1width,height:b.height}})})})},91968:(e,t,a)=>{"use strict";a.d(t,{AG:()=>s,SM:()=>o,YY:()=>i});var r=a(6892),n=a(35028),l=a(71919);let s=6,o=e=>{let{password:t,align:a="center"}=e,o=[{label:"".concat(s,"+ caracteres"),met:t.length>=s},{label:"Uma letra mai\xfascula",met:/[A-Z]/.test(t)},{label:"Um n\xfamero",met:/\d/.test(t)}];return(0,r.jsx)("div",{className:(0,l.cn)("mt-2 flex flex-wrap items-center gap-x-3 gap-y-1","center"===a?"justify-center":"justify-start"),children:o.map(e=>(0,r.jsxs)("span",{className:(0,l.cn)("inline-flex items-center gap-1 text-[11px] tracking-[-0.2px] transition-colors duration-200",e.met?"text-[#052D2B]/60 dark:text-muted-foreground":"text-muted-foreground/40"),children:[(0,r.jsx)("span",{className:(0,l.cn)("inline-flex w-3 h-3 rounded-full items-center justify-center transition-all duration-200",e.met?"bg-[#B1FE7B]":"border border-border/70"),children:e.met&&(0,r.jsx)(n.Jl,{size:7,className:"text-[#052D2B]",strokeWidth:3})}),e.label]},e.label))})},i=e=>e.length>=s&&/[A-Z]/.test(e)&&/\d/.test(e)},95819:(e,t,a)=>{"use strict";a.d(t,{$Q:()=>i,Pn:()=>s,Rz:()=>d,SU:()=>m,Sb:()=>o,Wx:()=>u,_W:()=>x,_r:()=>l});var r=a(2002),n=a(37811);let l=()=>(0,r.nr)("/oauth/connections"),s=e=>(0,r.nr)("/oauth/connections/".concat(encodeURIComponent(e)),{method:"DELETE"}),o=e=>(0,r.nr)("/oauth/authorizations/".concat(encodeURIComponent(e))),i=(e,t)=>(0,r.nr)("/oauth/consent",{method:"POST",body:{authorizationId:e,approved:t},raw:!0}),d=()=>{let e=c(n.env.NEXT_PUBLIC_MCP_SERVER_URL);if(!e)return null;let t=["localhost","127.0.0.1","[::1]"].includes(e.hostname);if("https:"!==e.protocol&&!("http:"===e.protocol&&t))return null;let a=e.pathname.replace(/\/+$/,"");return e.pathname=a.endsWith("/mcp")?a:"".concat(a,"/mcp"),e.toString()},c=e=>{let t=null==e?void 0:e.trim();if(!t||!/^https?:\/\/[^/]/i.test(t)||/[\s\\?#]/.test(t))return null;try{let e=new URL(t);return e.username||e.password?null:e}catch(e){return null}},u=()=>{let e=c(n.env.NEXT_PUBLIC_CHATGPT_APP_URL);return e&&"https://chatgpt.com"===e.origin&&e.pathname.replace(/\//g,"")?e.toString():null},m=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return{subtitle:null,steps:[]};let r={label:"Endere\xe7o do servidor",value:t};switch(e){case"chatgpt":return a?{subtitle:"Cargoos est\xe1 publicado no ChatGPT.",steps:[{action:{kind:"button",label:"Abrir Cargoos no ChatGPT",url:a}},{text:"Clique em Conectar e entre na sua conta Cargoos para autorizar."}]}:{subtitle:"Use o modo desenvolvedor do ChatGPT.",steps:[{text:"No ChatGPT, abra Configura\xe7\xf5es â Conectores â Criar e cole o endere\xe7o:",copy:r,action:{kind:"link",label:"Abrir Conectores do ChatGPT",url:"https://chatgpt.com/#settings/Connectors"}},{text:"Entre na Cargoos e autorize o acesso. S\xf3 leitura."}]};case"claude":return{subtitle:"Claude Code, Claude Desktop ou claude.ai.",steps:[{text:"Claude Code: rode no terminal",copy:{label:"Comando Claude Code",value:"claude mcp add --transport http --scope user cargoos ".concat(t)}},{text:"claude.ai e Desktop: Configura\xe7\xf5es â Conectores â Adicionar conector personalizado e cole o endere\xe7o:",copy:r,action:{kind:"link",label:"Abrir Conectores do Claude",url:"https://claude.ai/new#customize/connectors"}},{text:"Entre na Cargoos e autorize. Pronto."}]};case"cursor":{let e=encodeURIComponent(btoa(JSON.stringify({url:t})));return{subtitle:null,steps:[{action:{kind:"deep-link",label:"Adicionar no Cursor",url:"cursor://anysphere.cursor-deeplink/mcp/install?name=cargoos&config=".concat(e)}},{text:"Ou adicione em .cursor/mcp.json:",copy:{label:"Configura\xe7\xe3o do Cursor",value:JSON.stringify({mcpServers:{cargoos:{url:t}}})}},{text:"Na primeira chamada o Cursor abre a Cargoos para autorizar."}]}}case"codex":return{subtitle:null,steps:[{text:"Rode no terminal",copy:{label:"Comando Codex",value:"codex mcp add cargoos --url ".concat(t)}},{text:"Na primeira chamada o Codex abre a Cargoos para autorizar."}]};case"other":return{subtitle:"Qualquer cliente MCP com transporte Streamable HTTP e OAuth.",steps:[{text:"Cole o endere\xe7o do servidor no seu cliente:",copy:r},{text:"A autoriza\xe7\xe3o acontece na Cargoos; n\xe3o h\xe1 chave de API para copiar."}]}}},x=async()=>{try{let e=await fetch("/api/flags/mcp",{cache:"no-store",credentials:"same-origin"});if(!e.ok)return!1;let t=await e.json();return!0===t.enabled}catch(e){return!1}}}},e=>{e.O(0,[6390,7106,9018,2856,7020,6822,4565,2325,2337,5640,7444,290,4855,1505,6489,5028,6778,7404,9917,4820,4692,9723,4232,4654,7358],()=>e(e.s=1685)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.