PageSourceSearch

https://www.mitsubishimotors.com.br/_next/static/chunks/9263.9ae8652a6c948b66.js

js mitsubishimotors.com.br collected 2026-10-02 11:07:08 UTC 63,631 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="278d65a9-6cbb-4994-b18e-c845dadd64af",e._sentryDebugIdIdentifier="sentry-dbid-278d65a9-6cbb-4994-b18e-c845dadd64af")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9263],{11093:(e,a,o)=>{o.d(a,{a:()=>l});var t=o(77204),s=o(45400),r=o(46521),n=o(68172),i=o(73629);function l({isOpen:e,onClose:a,children:o,title:l,className:c,align:d="center"}){let u=(0,s.useSyncExternalStore)(()=>()=>{},()=>!0,()=>!1),m=(0,s.useRef)(null),x=(0,s.useRef)(a);return((0,s.useEffect)(()=>{x.current=a}),(0,s.useEffect)(()=>{let a=e=>{"Escape"===e.key&&x.current()};return e&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden",m.current?.focus()),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[e]),u)?(0,r.createPortal)((0,t.jsx)(n.N,{children:e&&(0,t.jsx)(i.m.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:`fixed inset-0 z-[200] flex items-end justify-center bg-black/60${"center"===d?" md:items-center":""}`,onClick:e=>{e.target===e.currentTarget&&a()},role:"dialog","aria-modal":"true","aria-label":l,children:(0,t.jsx)(i.m.div,{initial:{opacity:0,y:12,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:12,scale:.98},transition:{type:"spring",damping:28,stiffness:320},ref:m,tabIndex:-1,className:c??"relative bg-white w-full max-w-2xl max-h-[95vh] overflow-auto rounded-xl shadow-2xl outline-none",children:o})})}),document.body):null}},14578:(e,a,o)=>{function t(e){window.dataLayer=window.dataLayer??[],window.dataLayer.push(e)}o.d(a,{z:()=>s});let s={pageLoad({pagetype:e}){t({event:"pageLoad",pagetype:e})},menuView({avaibleOptions:e}){t({event:"menuView",avaibleOptions:e})},menuClick({item:e}){t({event:"menuClick",item:e,NavigationItem:e})},carListLoad({name:e,brand:a,link:o,listName:s,position:r,price:n,variant:i}){t({event:"carListLoad",name:e,brand:a,listName:s,position:r,price:n,link:o,variant:i})},carListClick({item:e,name:a,position:o,link:s,callToAction:r,navigationItem:n}){t({event:"carListClick",...void 0!==e&&{item:e},...void 0!==a&&{name:a},...void 0!==o&&{position:o},...void 0!==r&&{callToAction:r},...void 0!==n&&{NavigationItem:n},link:s})},quoteRequestClick({item:e,name:a,position:o,link:s,callToAction:r}){t({event:"quoteRequestClick",item:e,name:a,...void 0!==o&&{position:o},callToAction:r,link:s})},bannerClick({position:e,link:a}){t({event:"bannerClick",position:e,link:a})},bannerView({name:e,callToAction:a,link:o,position:s}){t({event:"bannerView",name:e,callToAction:a,position:s,link:o})},formView({formName:e,formStep:a}){t({event:"formView",formName:e,formStep:a})},formClick({formName:e,formData:a}){t({event:"formClick",formName:e,formData:a})},formThankYouPage({formName:e,modelName:a,modelId:o,modelPrice:s,modelCategory:r,modelVersion:n,modelBrand:i="Mitsubishi",leadId:l}){t({event:"formThankYouPage",parameters:[{parameter:"form_name",parameterValue:e},{parameter:"model_name",parameterValue:a??null},{parameter:"model_id",parameterValue:o??null},{parameter:"model_price",parameterValue:s??null},{parameter:"model_category",parameterValue:r??null},{parameter:"model_version",parameterValue:n??null},{parameter:"model_brand",parameterValue:i??null},{parameter:"lead_id",parameterValue:l??null},{parameter:"lead",parameterValue:"1"}]})},userId({userId:e}){t({userId:e})},dealershipClick({formName:e,formStep:a,name:o,address:s,distance:r}){t({event:"dealershipClick",pagePath:window.location.pathname,...void 0!==e&&{formName:e},...void 0!==a&&{formStep:a},formData:{name:o,...void 0!==s&&{address:s},...void 0!==r&&{distance:r}},...void 0!==r&&{distance:r}})},cepInformed({cep:e,numberOfDealerships:a}){t({event:"cepInformed",cep:e,numberOfDealerships:a})}}},17888:(e,a,o)=>{function t(e){return[...new Set((e.modelos_versoes??[]).flatMap(e=>e.modelo_ui?[e.modelo_ui]:[]))]}function s(e){return[...new Set((e.modelos_versoes_legados??[]).flatMap(e=>e.modelo_legado_ui?[e.modelo_legado_ui]:[]))]}function r(e){return[...new Set((e.modelos_versoes??[]).flatMap(e=>(function(e){if(!e)return[];try{let a=JSON.parse(e);return Array.isArray(a)?a:[e]}catch{return[e]}})(e.versao_ui)))]}function n(e,a){return(e.modelos_versoes??[]).some(e=>e.modelo_ui===a)}o.d(a,{X7:()=>s,ZD:()=>r,hD:()=>t,jZ:()=>n})},18952:(e,a,o)=>{o.d(a,{b:()=>l});var t=o(77204),s=o(45400),r=o(46521),n=o(14901),i=o(41571);function l({textoLegal:e}){let[a,o]=(0,s.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button","aria-label":"Ver texto legal",onClick:()=>o(!0),className:"inline-flex items-center justify-center size-4 rounded-full border border-current text-secondary-1 hover:text-black transition-colors text-[10px] font-bold leading-none shrink-0",children:"i"}),a&&(0,r.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-end",children:[(0,t.jsx)("button",{type:"button","aria-label":"Fechar",onClick:()=>o(!1),className:"absolute inset-0 size-full cursor-default bg-black/50"}),(0,t.jsxs)("div",{className:"relative z-10 bg-white w-full max-h-[70vh] flex flex-col shadow-[0_-4px_24px_0_rgba(0,0,0,0.15)]",children:[(0,t.jsx)("div",{className:"flex justify-end px-6 pt-4 pb-2",children:(0,t.jsx)("button",{type:"button","aria-label":"Fechar",onClick:()=>o(!1),className:"text-secondary-1 hover:text-black transition-colors shrink-0",children:(0,t.jsx)(n.A,{className:"size-4"})})}),(0,t.jsx)("div",{className:"overflow-y-auto px-6 pb-6 text-xs text-secondary-1 leading-relaxed prose prose-sm max-w-none",children:(0,i.Ay)(e)})]})]}),document.body)]})}},24774:(e,a,o)=>{o.d(a,{JC:()=>u,ZA:()=>x,Oy:()=>h,vx:()=>p});var t=o(77204),s=o(56491),r=o(22921),n=o(55397),i=o(95322),l=o(43342),c=o(94523),d=o(34549);let u=["Novos","Seminovos","Revis\xe3o Programada","Funilaria","Pintura automotiva","MIT 4 Fun","Kit Pe\xe7as","Alinhamento e balanceamento","MIT Locadora"],m={Novos:"novos",Seminovos:"seminovos","MIT 4 Fun":"mit4fun","Revis\xe3o Programada":"revisao_programada","Alinhamento e balanceamento":"alinhamento","Kit Pe\xe7as":"kit_pecas","Pintura automotiva":"pintura_automotiva",Funilaria:"funilaria","MIT Locadora":"mit_locadora"},x={Novos:s.A,Seminovos:r.A,"MIT 4 Fun":n.A,"Revis\xe3o Programada":i.A,"Alinhamento e balanceamento":l.A,"Kit Pe\xe7as":function({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsxs)("g",{clipPath:"url(#pecas-clip)",children:[(0,t.jsx)("path",{d:"M8 13.33C9.41 13.33 10.77 12.77 11.77 11.77C12.77 10.77 13.33 9.41 13.33 8
1C13.33 6.59 12.77 5.23 11.77 4.23C10.77 3.23 9.41 2.67 8 2.67C6.59 2.67 5.23 3.23 4.23 4.23C3.23 5.23 2.67 6.59 2.67 8C2.67 9.41 3.23 10.77 4.23 11.77C5.23 12.77 6.59 13.33 8 13.33Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8 9.33C8.35 9.33 8.69 9.19 8.94 8.94C9.19 8.69 9.33 8.35 9.33 8C9.33 7.65 9.19 7.31 8.94 7.06C8.69 6.81 8.35 6.67 8 6.67C7.65 6.67 7.31 6.81 7.06 7.06C6.81 7.31 6.67 7.65 6.67 8C6.67 8.35 6.81 8.69 7.06 8.94C7.31 9.19 7.65 9.33 8 9.33Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8 1.33V2.67",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8 14.67V13.33",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M11.33 13.77L10.67 12.62",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M7.33 6.85L4.67 2.23",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M13.77 11.33L12.62 10.67",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M2.23 4.67L3.38 5.33",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M9.33 8H14.67",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M1.33 8H2.67",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M13.77 4.67L12.62 5.33",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M2.23 11.33L3.38 10.67",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M11.33 2.23L10.67 3.38",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M7.33 9.15L4.67 13.77",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"pecas-clip",children:(0,t.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})},"Pintura automotiva":c.A,Funilaria:d.A,"MIT Locadora":function({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"29.5 6.75 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("g",{clipPath:"url(#locadora-cl
1ip)",children:(0,t.jsx)("path",{d:"M35.35 6.75C34.18 6.75 33.19 7.73 33.19 8.9C33.19 10.07 34.18 11.06 35.35 11.06C36.18 11.06 36.92 10.54 37.27 9.83H41.19L41.81 9.21V8.6L41.19 7.98H40.58L40.08 8.48L39.65 7.98H39.15L38.79 8.35L38.37 7.98H37.27C36.91 7.26 36.18 6.75 35.35 6.75ZM34.73 8.29C35.1 8.29 35.35 8.53 35.35 8.9C35.35 9.27 35.1 9.52 34.73 9.52C34.36 9.52 34.12 9.27 34.12 8.9C34.12 8.53 34.36 8.29 34.73 8.29ZM35.1 12.29C34.55 12.29 34.02 12.47 33.58 12.81C33.15 13.14 32.84 13.61 32.69 14.13L32.25 15.98H31.96C31.59 15.98 31.35 16.23 31.35 16.6V17.21C31.35 17.58 31.59 17.83 31.96 17.83V22.13C31.96 22.5 32.21 22.75 32.58 22.75H33.81C34.18 22.75 34.42 22.5 34.42 22.13V21.52H40.58V22.13C40.58 22.5 40.82 22.75 41.19 22.75H42.42C42.79 22.75 43.04 22.5 43.04 22.13V17.83C43.41 17.83 43.65 17.58 43.65 17.21V16.6C43.65 16.23 43.41 15.98 43.04 15.98H42.75L42.31 14.13C42 13.03 41.01 12.29 39.9 12.29H35.1ZM35.1 13.52H39.9C40.46 13.52 40.95 13.89 41.08 14.44L41.6 16.6H33.4L33.92 14.44C34.05 13.89 34.54 13.52 35.1 13.52ZM34.12 18.44C34.61 18.44 35.04 18.87 35.04 19.37C35.04 19.86 34.61 20.29 34.12 20.29C33.62 20.29 33.19 19.86 33.19 19.37C33.19 18.87 33.62 18.44 34.12 18.44ZM40.88 18.44C41.38 18.44 41.81 18.87 41.81 19.37C41.81 19.86 41.38 20.29 40.88 20.29C40.39 20.29 39.96 19.86 39.96 19.37C39.96 18.87 40.39 18.44 40.88 18.44Z",fill:"currentColor"})}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"locadora-cl
1ip",children:(0,t.jsx)("rect",{width:"16",height:"16",fill:"white",transform:"translate(29.5 6.75)"})})})]})}},h={Novos:"Novos",Seminovos:"Seminovos","MIT 4 Fun":"MIT 4 Fun","Revis\xe3o Programada":"Revis\xe3o","Alinhamento e balanceamento":"Alinhamento","Kit Pe\xe7as":"Pe\xe7as","Pintura automotiva":"Pintura",Funilaria:"Funilaria","MIT Locadora":"MIT Locadora"};function p(e,a){return!0===e[m[a]]}},30114:(e,a,o)=>{o.d(a,{s:()=>s});var t=o(77204);function s({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,t.jsx)("rect",{width:"32",height:"32",rx:"7",fill:"#F5F5F3"}),(0,t.jsx)("path",{d:"M0 32V21l11 11z",fill:"#C4E5BE"}),(0,t.jsx)("path",{d:"M32 8l-7-8h-6l13 14z",fill:"#A9D2F3"}),(0,t.jsx)("path",{d:"M3 29L29 3",stroke:"#FBD25E",strokeWidth:"2.4",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M16 7.2c-3.2 0-5.8 2.6-5.8 5.8 0 4.35 5.8 10.8 5.8 10.8s5.8-6.45 5.8-10.8c0-3.2-2.6-5.8-5.8-5.8z",fill:"#EA4335"}),(0,t.jsx)("circle",{cx:"16",cy:"13",r:"2.25",fill:"#fff"})]})}},30840:(e,a,o)=>{o.d(a,{C:()=>s});var t=o(77204);function s({className:e,circleColor:a="#ED0000",checkColor:o="white"}){return(0,t.jsxs)("svg",{className:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"7",cy:"7",r:"7",fill:a}),(0,t.jsx)("path",{d:"M4 7L6 9L10 5",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},32802:(e,a,o)=>{o.d(a,{CI:()=>l,KP:()=>i,SC:()=>c});let t="mit_lead_tracking",s={google:"google",kbb_org:"kbb_org",kbb_ecomm:"kbb_ecomm",kbb:"kbb"},r=["leadSource","subSource","campaignCode","gclid","utmSource","utmMedium","utmCampaign","utmContent","utmTerm"],n=[...r,"campaignOrigin"];function i(e){let a=function(e){let a="string"==typeof e?new URLSearchParams(e):e,o=e=>a.get(e)?.trim()||void 0,t=o("utm_source"),r=t?s[t]??"r_sociais":void 0;return{leadSource:o("leadSource")??o("leadsource"),subSource:o("subSource")??o("subsource")??r,campaignCode:o("campanha"),gclid:o("gclid")??o("fbclid"),utmSource:r,utmMedium:o("utm_medium"),utmCampaign:o("utm_campaign"),utmContent:o("utm_content"),utmTerm:o("utm_term")}}(e??window.location.search),o=function(){try{let e=sessionStorage.getItem(t);if(!e)return{};let a=JSON.parse(e);if(!a||"object"!=typeof a)return{};let o={};for(let e of n){let t=a[e];"string"==typeof t&&t&&(o[e]=t)}return o}catch{return{}}}(),i={...o},l=!1;for(let e of r){let t=a[e];t&&t!==o[e]&&(i[e]=t,l=!0)}return i.campaignOrigin||(i.campaignOrigin=window.location.href,l=!0),l&&function(e){try{sessionStorage.setItem(t,JSON.stringify(e)),e.gclid&&sessionStorage.setItem("gclid",e.gclid),e.campaignCode&&sessionStorage.setItem("campanha",e.campaignCode),e.utmSource&&sessionStorage.setItem("utm_source",e.utmSource)}catch{}}(i),i}function l(e){return i(e)}function c(e,...a){return e?.campaignCode||i(void 0).campaignCode||e?.defaultCampaignCode||a.find(Boolean)||void 0}},32962:(e,a,o)=>{o.d(a,{k:()=>n});var t=o(45400),s=o(52697),r=o(32802);function n(){let e=(0,s.useSearchParams)().toString();return(0,t.useMemo)(()=>(0,r.CI)(e),[e])}},39475:(e,a,o)=>{o.d(a,{Z:()=>s});var t=o(77204);function s({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,t.jsx)("rect",{width:"32",height:"32",rx:"4",fill:"#25D366"}),(0,t.jsxs)("g",{transform:"translate(5.6 5.6) scale(0.865)",children:[(0,t.jsx)("path",{d:"M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38a9.86 9.86 0 0 0 4.74 1.21h.004c5.46 0 9.91-4.45 9.91-9.91C21.95 6.45 17.5 2 12.04 2Z",fill:"#25D366",stroke:"#fff",strokeWidth:"1.7",strokeLinejoin:"round"}),(0,t.jsx)("path",{fill:"#fff",d:"M17.47 14.38c-.3-.15-1.76-.87-2.03-.97-.27-.1-.47-.15-.67.15-.2.3-.77.97-.94 1.16-.17.2-.35.22-.64.07-.3-.15-1.26-.46-2.39-1.48-.88-.79-1.48-1.76-1.65-2.06-.17-.3-.02-.46.13-.61.13-.13.3-.35.45-.52.15-.17.2-.3.3-.5.1-.2.05-.37-.02-.52-.08-.15-.67-1.61-.92-2.21-.24-.58-.49-.5-.67-.51h-.57c-.2 0-.52.07-.79.37-.27.3-1.04 1.02-1.04 2.48 0 1.46 1.07 2.88 1.21 3.07.15.2 2.1 3.2 5.08 4.49.71.3 1.26.49 1.69.62.71.23 1.36.2 
11.87.12.57-.09 1.76-.72 2.01-1.41.25-.7.25-1.29.17-1.41-.07-.12-.27-.2-.57-.35Z"})]})]})}},60787:(e,a,o)=>{o.d(a,{N:()=>s});var t=o(77204);function s({className:e}){return(0,t.jsxs)("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}},61335:(e,a,o)=>{o.d(a,{N:()=>s});var t=o(77204);function s({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}},67943:(e,a,o)=>{function t(){return"https://cms.mitsubishimotors.com.br"}function s(e){if(null==e)return null;if(e.startsWith("http")||e.startsWith("//")||e.startsWith("data:"))return e;let a=t();return`${a}${e}`}function r(e,a){if(!e)return null;let{formats:o,url:t}=e;if(o){if(a<=156&&o.thumbnail)return s(o.thumbnail.url);if(a<=500&&o.small)return s(o.small.url);if(a<=750&&o.medium)return s(o.medium.url);if(a<=1e3&&o.large)return s(o.large.url)}return s(t)}o.d(a,{Gf:()=>s,PW:()=>t,hE:()=>r})},70775:(e,a,o)=>{function t(e){return Math.PI/180*e}function s(e,a,o,s){let r=t(o-e),n=t(s-a),i=Math.sin(r/2)*Math.sin(r/2)+Math.cos(t(e))*Math.cos(t(o))*Math.sin(n/2)*Math.sin(n/2);return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371}function r(e,a,o){return[...e].map(e=>e.geodata?.coordinates&&"number"==typeof e.geodata.coordinates.lat&&"number"==typeof e.geodata.coordinates.lng?{...e,distanciaCalculada:s(a,o,e.geodata.coordinates.lat,e.geodata.coordinates.lng)}:e).sort((e,a)=>(e.distanciaCalculada??1/0)-(a.distanciaCalculada??1/0))}o.d(a,{$:()=>s,H:()=>r})},78807:(e,a,o)=>{o.d(a,{H:()=>s});var t=o(32802);function s(e){let{campaignOrigin:a}=(0,t.CI)();return fetch("/api/lead",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,...a&&{campaign_origin:a}})})}},80789:(e,a,o)=>{o.d(a,{o:()=>r});var t=o(77204),s=o(24774);function r({service:e}){let a=s.ZA[e];return(0,t.jsxs)("div",{className:"flex min-h-[54px] flex-col items-center justify-center gap-1 rounded-[6px] border border-secondary-3 bg-white px-2 py-1.5 text-center",children:[(0,t.jsx)(a,{className:"size-5 text-text-default"}),(0,t.jsx)("span",{className:"text-11 text-text-default leading-tight whitespace-nowrap",children:s.Oy[e]})]})}},81421:(e,a,o)=>{o.d(a,{J:()=>s});var t=o(77204);function s({className:e}){return(0,t.jsxs)("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[(0,t.jsx)("path",{d:"M3.49 3.27C4.39 3.27 5.12 2.54 5.12 1.64C5.12 0.73 4.39 0 3.49 0C2.59 0 1.85 0.73 1.85 1.64C1.85 2.54 2.59 3.27 3.49 3.27Z",fill:"white"}),(0,t.jsx)("path",{d:"M6.53 11.66C5.96 12.179 5.21 12.47 4.43 12.47C2.71 12.47 1.31 11.06 1.31 9.34C1.31 8.4 1.73 7.51 2.46 6.92C2.74 6.69 2.78 6.28 2.55 6C2.32 5.72 1.91 5.68 1.63 5.9C0.59 6.75 0 8 0 9.34C0 11.79 1.99 13.77 4.43 13.77C5.54 13.77 6.59 13.367 7.41 12.63C7.68 12.38 7.7 11.97 7.46 11.7C7.21 11.435 6.8 11.42 6.53 11.66Z",fill:"white"}),(0,t.jsx)("path",{d:"M9.76 12.86L7.98 8.79C7.86 8.53 7.6 8.37 7.32 8.4L4.42 8.63L4.34 7.3H6.8C7.16 7.3 7.45 7.01 7.45 6.65C7.45 6.29 7.16 5.99 6.8 5.99H4.25L4.14 4.32C4.12 3.96 3.8 3.68 3.45 3.71C3.08 3.73 2.81 4.04 2.84 4.4L3.16 9.38C3.17 9.56 3.26 9.72 3.39 9.84C3.52 9.95 3.69 10.01 3.87 9.99L6.96 9.74L8.56 13.38C8.67 13.63 8.91 13.77 9.16 13.77C9.25 13.77 9.33 13.76 9.42 13.72C9.75 13.575 9.9 13.19 9.76 12.86Z",fill:"white"})]})}},83178:(e,a,o)=>{o.d(a,{K:()=>s});var t=o(77204);function s({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"16",cy:"16",r:"13",strokeWidth:"1.7"}),(0,t.jsx)("path",{d:"M10.93 10.5A5.6 13 0 0 1 21.07 10.5",strokeWidth:"1.4"}),(0,t.jsx)("path",{d:"M10.93 21.5A5.6 13 0 0 0 21.07 21.5",strokeWidth:"1.4"}),(0,t.jsx)("path",{d:"M3.6 10.5h24.8M3.6 21.5h24.8",strokeWidth:"1.4"}),(0,t.jsx)("text",{x:"16",y:"18.3",textAnchor:"middle",fontFamily:"Arial, Helvetica, sans-serif",fontSize:"6.4",fontWeight:"800",letterSpacing:"-0.3",fill:"
1currentColor",stroke:"none",children:"WWW"})]})}},85455:(e,a,o)=>{function t(e){return parseInt(e.replace(/\./g,""),10)}function s(e){return parseInt(e,10)}function r(e){let a=e?.linha.map(e=>e.prazo)??[];return a.length?a.reduce((e,a)=>s(a)>s(e)?a:e):null}function n(e){let a=r(e),o=function(e,a){let o=(e?.linha??[]).filter(e=>e.prazo===a).map(e=>e.kilometragem);return o.length?o.reduce((e,a)=>t(a)<t(e)?a:e):null}(e,a);return null==a||null==o?null:e?.linha.find(e=>e.prazo===a&&e.kilometragem===o)??null}function i(e){let a=e.replace(/km\s*\/?\s*m[êe]s/gi,"").trim();return a?`${a} km/m\xeas`:e}function l(e){let a=e.replace(/dias?/gi,"").trim();return a?`${a} dias`:e}function c(e){return!!e&&"dias_entrega"in e}function d(e){return(e?.linha.length??0)>0}function u(e,a,o,t){let s=(e?.linha??[]).filter(e=>e.prazo===a&&e.kilometragem===o);if(!s.length)return null;let r=(t??"").trim().toLowerCase();return s.find(e=>(e.cor??"").trim().toLowerCase()===r)??s[0]??null}o.d(a,{P8:()=>u,Se:()=>d,_v:()=>r,qB:()=>c,te:()=>n,vH:()=>l,xs:()=>i})},91291:(e,a,o)=>{o.r(a),o.d(a,{QuoteFormBlockClient:()=>ey});var t=o(77204),s=o(45400),r=o(4076),n=o(97859),i=o(68172),l=o(73629),c=o(88245),d=o(96744),u=o(68637),m=o(10586),x=o(60362),h=o(17948),p=o(59883),f=o(37546),v=o(76827),g=o(35604),b=o.n(g),j=o(99591),C=o(63634),N=o(19445),_=o(91344),w=o(1771),k=o(26983),y=o(96631),S=o(74103),M=o(14578),L=o(468),P=o(12245);let I=L.object({nomeCompleto:L.string().min(3,"Nome completo \xe9 obrigat\xf3rio").regex(j.VQ,"Apenas letras s\xe3o permitidas").refine(e=>e.trim().includes(" "),"Informe nome e sobrenome"),cpf:L.string().min(1,"CPF \xe9 obrigat\xf3rio").refine(e=>(0,P.u)(e),"CPF inv\xe1lido"),email:L.email("E-mail inv\xe1lido"),mobilePhone:L.string().min(1,"Telefone \xe9 obrigat\xf3rio").refine(e=>e.replace(/\D/g,"").length>=10,"Telefone inv\xe1lido"),periodo:L.enum(["manha","tarde"]).optional().refine(e=>void 0!==e,{message:"Selecione um per\xedodo"}),contatoPreferido:L.array(L.enum(["whatsapp","email","telefone","sms"])).min(1,"Selecione ao menos uma forma de contato"),mensagem:L.string().optional(),lgpdConsent:L.boolean().refine(e=>!0===e,{message:"\xc9 necess\xe1rio aceitar os termos"})}),A=["nomeCompleto","cpf","email","mobilePhone"],z=[{value:"manha",label:"Manh\xe3",subtitle:"(08h–11h)"},{value:"tarde",label:"Tarde",subtitle:"(13h–18h)"}],E=[{value:"whatsapp",label:"WhatsApp"},{value:"email",label:"E-mail"},{value:"telefone",label:"Telefone"},{value:"sms",label:"SMS"}];var T=o(78807);function V({step:e}){let a="success"===e?3:e;return(0,t.jsxs)("div",{className:"flex items-center w-[72px] md:w-[140px] justify-between relative","aria-label":"Progresso do formul\xe1rio",children:[(0,t.jsx)("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-full flex z-0",children:(0,t.jsx)("div",{className:(0,j.cn)("flex-1 h-[1px]",a>1?"bg-black":1===a?"bg-gradient-to-r from-black from-50% to-secondary-3 to-50%":"bg-secondary-3")})}),[1,2].map(e=>(0,t.jsxs)("div",{className:(0,j.cn)("z-10 shrink-0 rounded-full flex items-center justify-center size-4 md:size-5",e<a?"bg-black":e===a?"bg-white border border-black":"bg-white border border-secondary-3"),"aria-current":e===a?"step":void 0,children:[e<a&&(0,t.jsx)(c.A,{className:"size-[6px] md:size-3 text-white",strokeWidth:3}),e===a&&(0,t.jsx)("div",{className:"size-[6px] md:size-2 rounded-full bg-black"})]},e))]})}let B={whatsapp:_.m,email:d.A,telefone:u.A,sms:m.A};function $({concessionaria:e,onEditConcessionaria:a,onBack:o,onNext:s}){let{register:r,control:i,formState:{errors:l}}=(0,n.xW)(),c=r("nomeCompleto");return(0,t.jsxs)("div",{className:"flex flex-col gap-[22px] flex-1 overflow-y-auto",children:[(0,t.jsxs)("div",{className:"flex md:hidden items-center justify-between border-b border-secondary-3 pb-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-11 text-secondary-1 uppercase tracking-wider font-medium",children:"Concession\xe1ria"}),(0,t.jsx)("span",{className:"text-15 font-semibold text-black truncate",children:e.nome})]}),a&&(0,t.jsx)("button",{type:"button",onClick:a,className:"shrink-0 text-secondary-1 hover:text-black transition-colors","aria-label":"Alterar concession\xe1ria",children:(0,t.jsx)(x.A,{className:"size-4"})})]}),(0,t.jsx)(k.zB,{label:"Nome completo",required:!0,error:l.nomeCompleto?.message,children:(0,t.jsx)("input",{...c,type:"text",placeholder:"Seu nome completo",className:(0,y.T)(!!l.nomeCompleto),autoComplete:"name",onChange:e=>{e.target.value=(0,j.kL)(e.target.value),c.onChange(e)}})}),(0,t.jsx)(n.xI,{name:"cpf",control:i,render:({field:e,fieldState:{error:a}})=>(0,t.jsx)(k.zB,{label:"CPF",required:!0,error:a?.message,children:(0,t.jsx)("input",{value:e.value,onChange:a=>e.onChange((0,N.V)(a.target.value)),onBlur:e.onBlur,inputMode:"numeric",placeholder:"000.000.000-00","aria-label":"CPF",className:(0,y.T)(!!a)})})}),(0,t.jsx)(k.zB,{label:"E-mail",required:!0,error:l.email?.message,children:(0,t.jsx)("input",{...r("email"),type:"email",placeholder:"[email protected]",className:(0,y.T)(!!l.email),autoComplete:"email"})}),(0,t.jsx)(n.xI,{name:"mobilePhone",control:i,render:({field:e,fieldState:{error:a}})=>(0,t.jsx)(k.zB,{label:"Telefone / WhatsApp",required:!0,error:a?.message,children:(0,t.jsx)("input",{value:e.value,onChange:a=>e.onChange(function(e){let a=e.replace(/\D/g,"").slice(0,11);return a.length<=2?a:a.length<=7?`(${a.slice(0,2)}) ${a.slice(2)}`:`(${a.slice(0,2)}) ${a.slice(2,7)}-${a.slice(7)}`}(a.target.value)),onBlur:e.onBlur,type:"tel",placeholder:"(00) 00000-0000","aria-label":"Telefone ou WhatsApp",className:(0,y.T)(!!a),autoComplete:"tel",inputMode:"tel"})})}),(0,t.jsxs)("div",{className:"mt-auto pt-5 flex gap-3 md:justify-end",children:[o&&(0,t.jsx)("button",{type:"button",onClick:o,className:"w-full md:w-1/2 h-[52px] border border-gray-300 text-gray-700 text-base font-medium rounded-lg hover:bg-gray-50 transition-colors cursor-pointer",children:"Voltar"}),(0,t.jsx)("button",{type:"button",onClick:s,className:"w-full md:w-1/2 h-[52px] bg-brand-red text-white text-base font-medium rounded-lg shadow hover:bg-brand-red-dark transition-colors cursor-pointer",children:"Pr\xf3ximo"})]})]})}function W({onBack:e,onSubmit:a,isSubmitting:o,apiError:s,captchaRef:r,captchaToken:i,onCaptchaChange:l}){let{register:d,control:u,formState:{errors:m}}=(0,n.xW)();return(0,t.jsxs)("div",{className:"flex flex-col gap-[22px] flex-1 overflow-y-auto",children:[(0,t.jsx)(n.xI,{name:"periodo",control:u,render:({field:e})=>(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-15",children:[(0,t.jsx)("span",{className:"font-medium text-text-default leading-5",children:"Melhor per\xedodo para contato"}),(0,t.jsx)("span",{className:"text-brand-red opacity-80",children:"*"})]}),(0,t.jsx)("div",{className:"flex gap-2.5",children:z.map(({value:a,label:o,subtitle:s})=>(0,t.jsxs)(k.ff,{selected:e.value===a,onClick:()=>e.onChange(a),children:[(0,t.jsx)("span",{className:"text-text-default",children:o}),(0,t.jsx)("span",{className:"text-secondary-1 text-sm ml-1",children:s})]},a))}),m.periodo&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-13 text-red-600",children:[(0,t.jsx)(h.A,{className:"size-3.5 shrink-0"}),m.periodo.message]})]})}),(0,t.jsx)(n.xI,{name:"contatoPreferido",control:u,render:({field:e})=>(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-15",children:[(0,t.jsx)("span",{className:"font-medium text-text-default leading-5",children:"Como deseja ser contatado"}),(0,t.jsx)("span",{className:"text-brand-red opacity-80",children:"*"})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2.5",children:E.map(({value:a,label:o},s,r)=>{let n=B[a],i=e.value.includes(a);return(0,t.jsxs)(k.ff,{selected:i,onClick:()=>{let o=e.value;e.onChange(i?o.filter(e=>e!==a):[...o,a])},className:s===r.length-1?"col-span-2 md:col-span-1":"",children:[(0,t.jsx)(n,{className:"size-4 mr-2 shrink-0"}),o]},a)})}),m.contatoPreferido&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-13 text-red-600",children:[(0,t.jsx)(h.A,{className:"size-3.5 shrink-0"}),m.contatoPreferido.message]})]})}),(0,t.jsx)(k.zB,{label:"Observa\xe7\xe3o (opcional)",children:(0,t.jsx)("textarea",{...d("mensagem"),rows:4,placeholder:"Deseja deixar alguma mensagem?",className:"w-full border border-secondary-3 rounded p-4 text-15 text-text-default placeholder:text-secondary-1 bg-white outline-none focus:border-black transition-colors resize-none"})}),(0,t.jsx)(n.xI,{name:"lgpdConsent",control:u,render:({field:e})=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"flex items-start gap-4 cursor-pointer group",children:[(0,t.jsxs)("div",{className:(0,j.cn)("shrink-0 size-5 mt-0.5 border-[1.5px] rounded flex items-center justify-center bg-white transition-colors",m.lgpdConsent?"border-red-400":"border-secondary-3 group-hover:border-black"),children:[(0,t.jsx)("input",{type:"checkbox",checked:e.value,onChange:a=>e.onChange(a.target.checked),"aria-label":"Aceitar termos de contato",className:"sr-only"}),e.value&&(0,t.jsx)(c.A,{className:"size-3 text-black",strokeWidth:3})]}),(0,t.jsxs)("span",{className:"text-sm text-text-default leading-[1.45]",children:["Autorizo a HPE Automotores do Brasil a utilizar meus dados pessoais fornecidos neste formul\xe1rio e compartilh\xe1-los com a concession\xe1ria selecionada para fins comerciais, incluindo contato para atendimento e envio de ofertas e informa\xe7\xf5es sobre produtos e servi\xe7os da marca. Para mais detalhes, consulte nossa"," ",(0,t.jsx)(b(),{href:"/politica-de-privacidade",onClick:e=>e.stopPropagation(),className:"underline hover:no-underline",children:"Pol\xedtica de Privacidade."})]})]}),m.lgpdConsent&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-13 text-red-600 ml-9",children:[(0,t.jsx)(h.A,{className:"size-3.5 shrink-0"}),m.lgpdConsent.message]})]})}),C.R.NEXT_PUBLIC_RECAPTCHA_SITE_KEY&&(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)(v.default,{ref:r,
1sitekey:C.R.NEXT_PUBLIC_RECAPTCHA_SITE_KEY,onChange:l})}),s&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-red-600 text-sm bg-red-50 border border-red-200 rounded p-3",children:[(0,t.jsx)(h.A,{className:"size-4 shrink-0"}),s]}),(0,t.jsxs)("div",{className:"mt-auto pt-5 flex gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:e,disabled:o,className:"flex-1 h-[52px] bg-white border border-secondary-3 text-black text-base font-medium rounded hover:border-black/40 disabled:opacity-50 transition-colors",children:"Voltar"}),(0,t.jsxs)("button",{type:"button",onClick:a,disabled:o||!i,className:"flex-1 h-[52px] bg-brand-red text-white text-base font-medium rounded shadow hover:bg-brand-red-dark disabled:bg-secondary-3 disabled:text-secondary-2 transition-colors flex items-center justify-center gap-2",children:[o&&(0,t.jsx)(p.A,{className:"size-4 animate-spin"}),o?"Enviando…":"Enviar"]})]})]})}function F({concessionaria:e,onClose:a}){return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center flex-1 gap-5 py-10",children:[(0,t.jsx)("div",{className:"size-20 rounded-full bg-surface-subtle flex items-center justify-center",children:(0,t.jsx)(f.A,{className:"size-12 text-black"})}),(0,t.jsx)("p",{className:"text-xl font-medium text-text-default text-center",children:"Solicita\xe7\xe3o enviada!"}),(0,t.jsxs)("p",{className:"text-15 text-text-default text-center leading-5 max-w-xs",children:["Em breve a concession\xe1ria"," ",(0,t.jsx)("strong",{className:"font-medium",children:e.nome})," entrar\xe1 em contato para realizar o seu atendimento."]}),(0,t.jsx)("div",{className:"w-full mt-4",children:(0,t.jsx)("button",{type:"button",onClick:a,className:"w-full h-[52px] bg-brand-red text-white text-base font-medium rounded-lg shadow hover:bg-brand-red-dark transition-colors",children:"Nova solicita\xe7\xe3o"})})]})}function D({concessionaria:e,leadParams:a,onClose:o,onEditConcessionaria:r}){let{step:c,setStep:d,isSubmitting:u,apiError:m,captchaToken:x,captchaRef:h,methods:p,goToStep2:f,onSubmit:v,handleCaptchaChange:g}=function({concessionaria:e,leadParams:a,onClose:o}){let[t,r]=(0,s.useState)(1),[i,l]=(0,s.useState)(!1),[c,d]=(0,s.useState)(null),[u,m]=(0,s.useState)(null),x=(0,s.useRef)(null),h=(0,n.mN)({resolver:(0,S.u)(I),defaultValues:{nomeCompleto:"",cpf:"",email:"",mobilePhone:"",periodo:void 0,contatoPreferido:[],mensagem:"",lgpdConsent:!1}}),{trigger:p,handleSubmit:f}=h,v=async()=>{await p(A)&&r(2)},g=f(async o=>{l(!0),d(null);let[t,...s]=o.nomeCompleto.trim().split(" "),n=s.join(" ")||t,i=[o.contatoPreferido.length>0?`Contato preferido: ${o.contatoPreferido.join(", ")}`:null,o.periodo?`Per\xedodo: ${"manha"===o.periodo?"Manh\xe3 (08h–11h)":"Tarde (13h–18h)"}`:null,o.mensagem?`Mensagem: ${o.mensagem}`:null].filter(Boolean).join(" | ");try{let s=await (0,T.H)({firstName:t,lastName:n,cpf:o.cpf,email:o.email,mobilePhone:o.mobilePhone,interestIn:a?.interestIn??"pre_atendimento",preferredSellers:e.id_integracao,description:i||void 0,leadSource:a?.leadSource??"digital_montadora",subSource:a?.subSource??"portal_mmc",...a?.type&&{type:a.type},...a?.campaignCode&&{campaignHistories:[{campaignCode:a.campaignCode}]},recaptcha:u??""});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.message||"Erro ao enviar. Tente novamente.")}M.z.formThankYouPage({formName:"pre-atendimento"}),r("success")}catch(e){d(e instanceof Error?e.message:"Erro ao enviar. Tente novamente."),x.current?.reset(),m(null)}finally{l(!1)}});return{step:t,setStep:r,isSubmitting:i,apiError:c,captchaToken:u,captchaRef:x,methods:h,goToStep2:v,onSubmit:g,handleCaptchaChange:e=>{m(e),d(null)},onClose:o}}({concessionaria:e,leadParams:a,onClose:o});return(0,t.jsx)(n.Op,{...p,children:(0,t.jsxs)("div",{className:"flex flex-row h-full md:min-h-[702px]",children:[(0,t.jsx)(w.W,{concessionaria:e,onEditConcessionaria:r}),(0,t.jsxs)("div",{className:"flex-1 bg-white flex flex-col min-w-0 overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between h-[60px] px-4 md:px-14 border-b border-surface-subtle shrink-0",children:[(0,t.jsx)("h2",{className:"text-lg font-medium text-black tracking-[-0.45px] leading-[30px]",children:"Pr\xe9-atendimento"}),"success"!==c&&(0,t.jsx)(V,{step:c})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto px-4 md:px-14 py-5 flex flex-col",children:(0,t.jsx)(i.N,{mode:"wait",children:(0,t.jsxs)(l.m.div,{initial:{opacity:0,x:12}
1,animate:{opacity:1,x:0},exit:{opacity:0,x:-12},transition:{duration:.18},className:"flex flex-col flex-1",children:[1===c&&(0,t.jsx)($,{concessionaria:e,onEditConcessionaria:r,onBack:o,onNext:f}),2===c&&(0,t.jsx)(W,{concessionaria:e,onBack:()=>d(1),onSubmit:v,isSubmitting:u,apiError:m,captchaRef:h,captchaToken:x,onCaptchaChange:g}),"success"===c&&(0,t.jsx)(F,{concessionaria:e,onClose:o})]},c)})})]})]})})}var H=o(65218),R=o(73007),Z=o(38678),U=o(32798),O=o(95289),q=o(48496),K=o(71306),J=o(18149),Y=o(32802);async function Q({formData:e,vehicle:a,versao:o,concessionaria:t,leadParams:s,recaptcha:r}){let[n,...i]=e.nomeCompleto.trim().split(" "),l=i.join(" ")||n,c=(e.cpf??"").replace(/\D/g,""),d=["Tipo: MIT Barter",`Ve\xedculo: ${a.nome}`,`Vers\xe3o: ${o.nome}`,e.aceitaComunicacoes?"Aceita comunica\xe7\xf5es: Sim":null,e.comentario?`Coment\xe1rio: ${e.comentario}`:null].filter(Boolean).join(" | "),u=(0,Y.SC)(s,a.custom_campaign_id),m=await (0,T.H)({firstName:n,lastName:l,email:e.email||void 0,mobilePhone:e.celular,...11===c.length?{cpf:e.cpf}:{},...c.length>11?{cnpj:e.cpf}:{},interestIn:s?.interestIn??"mit_barter",...s?.type&&{type:s.type},preferredSellers:t.id_integracao,product:o.fipe_id??void 0,description:d,leadSource:s?.leadSource??"digital_montadora",subSource:s?.subSource??"portal_mmc",...u&&{campaignHistories:[{campaignCode:u}]},recaptcha:r});if(!m.ok)throw Error((await m.json().catch(()=>({}))).message||"Erro ao enviar. Tente novamente.")}var X=o(74790),G=o(89129);let ee=(0,X.default)(()=>Promise.all([o.e(9093),o.e(8550),o.e(8726)]).then(o.bind(o,38726)),{loadableGenerated:{webpack:()=>[38726]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"size-full bg-[#f0f0f0] flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-13 text-secondary-1",children:"Carregando mapa…"})})});function ea({concessionaria:e,onEditConcessionaria:a}){return(0,t.jsxs)("div",{className:"hidden md:flex flex-col w-1/2 shrink-0 bg-surface-light overflow-hidden",children:[(0,t.jsx)("div",{className:"flex-1 min-h-0 relative",children:(0,t.jsx)(ee,{concessionaria:e})}),(0,t.jsxs)("div",{className:"shrink-0 border-t border-secondary-3 px-10 py-5 flex flex-col gap-1.5 bg-surface-light",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-11 text-secondary-1 uppercase tracking-wider font-medium",children:"Concession\xe1ria MIT Barter"}),(0,t.jsx)("span",{className:"text-base font-semibold text-black truncate",children:e.nome})]}),a&&(0,t.jsx)("button",{type:"button",onClick:a,className:"shrink-0 text-secondary-1 hover:text-black transition-colors mt-1","aria-label":"Alterar concession\xe1ria",children:(0,t.jsx)(x.A,{className:"size-4"})})]}),(e.endereco||e.telefone)&&(0,t.jsxs)("div",{className:"flex flex-col gap-1 mt-0.5",children:[e.endereco&&(0,t.jsxs)("div",{className:"flex items-start gap-1.5 text-13 text-secondary-1",children:[(0,t.jsx)(G.A,{className:"size-3.5 mt-0.5 shrink-0"}),(0,t.jsx)("span",{className:"leading-[1.4]",children:e.endereco})]}),e.telefone&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-13 text-secondary-1",children:[(0,t.jsx)(u.A,{className:"size-3.5 shrink-0"}),(0,t.jsx)("span",{children:e.telefone})]})]})]})]})}function eo({concessionaria:e,onClose:a}){return(0,t.jsxs)("div",{className:"flex flex-row h-full md:min-h-[702px]",children:[(0,t.jsx)(ea,{concessionaria:e}),(0,t.jsxs)("div",{className:"flex-1 bg-white flex flex-col items-center justify-center gap-6 py-16 text-center px-4",children:[(0,t.jsx)("div",{className:"size-16 bg-[#f0fdf4] rounded-full flex items-center justify-center",children:(0,t.jsx)(f.A,{className:"size-8 text-green-600"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"text-22 font-bold text-black",children:"Solicita\xe7\xe3o enviada!"}),(0,t.jsx)("p",{className:"text-15 text-secondary-1 max-w-sm",children:"Entraremos em contato em breve para dar continuidade ao seu MIT Barter."})]}),(0,t.jsx)("button",{type:"button",onClick:a,className:"h-12 px-8 bg-black text-white text-15 font-medium rounded-lg hover:bg-black/80 transition-colors",children:"Nova solicita\xe7\xe3o"})]})]})}var et=o(23119);function es({vehicle:e,versao:a,onEditVeiculo:o,onEditVersao:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-4 mb-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[e.imagem_principal?.url&&(0,t.jsx)("div",{className:"w-[64px] h-[36px] relative shrink-0",children:(0,t.jsx)(et.default,{src:e.imagem_principal.url,alt:e.imagem_principal.alternativeText??e.nome,fill:!0,className:"object-contain",sizes:"64px"})}),(0,t.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-11 text-secondary-1",children:"Ve\xedculo desejado"}),(0,t.jsx)("span",{className:"text-15 font-medium text-black truncate",children:e.nome})]}),(0,t.jsx)("button",{type:"button",onClick:o,className:"shrink-0 text-secondary-1 hover:text-black transition-colors","aria-label":"Alterar ve\xedculo",children:(0,t.jsx)(x.A,{className:"size-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary-3 pb-4",children:[(0,t.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-11 text-secondary-1",children:"Vers\xe3o"}),(0,t.jsx)("span",{className:"text-15 font-medium text-black truncate",children:a.nome})]}),(0,t.jsx)("button",{type:"button",onClick:s,className:"shrink-0 text-secondary-1 hover:text-black transition-colors","aria-label":"Alterar vers\xe3o",children:(0,t.jsx)(x.A,{className:"size-4"})})]})]})}function er(e){return(0,j.cn)("h-12 w-full border rounded px-4 text-15 text-text-default placeholder:text-secondary-1 bg-white outline-none focus:border-black transition-colors",e?"border-red-400 focus:border-red-500":"border-secondary-3")}function en({register:e,errors:a,celular:o,cpf:s,onChangeCelular:r,onChangeCpf:n,isSubmitting:i,apiError:l,captchaError:c,isDev:d,captchaRef:u,onCaptchaChange:m}){let x=e("nomeCompleto");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("input",{...x,placeholder:"Nome completo *","aria-label":"Nome completo",className:er(!!a.nomeCompleto),onChange:e=>{e.target.value=(0,j.kL)(e.target.value),x.onChange(e)}}),a.nomeCompleto&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-13 text-red-600",children:[(0,t.jsx)(h.A,{className:"size-3.5 shrink-0"}),a.nomeCompleto.message]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("input",{value:s,onChange:e=>{var a;return n((a=(a=e.target.value).replace(/\D/g,"").substring(0,11)).length>9?a.replace(/(\d{3})(\d{3})(\d{3})(\d{1,2})/,"$1.$2.$3-$4"):a.length>6?a.replace(/(\d{3})(\d{3})(\d{1,3})/,"$1.$2.$3"):a.length>3?a.replace(/(\d{3})(\d{1,3})/,"$1.$2"):a)},placeholder:"CPF do cliente *","aria-label":"CPF do cliente",className:er(!!a.cpf)}),a.cpf&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-13 text-red-600",children:[(0,t.jsx)(h.A,{className:"size-3.5 shrink-0"}),a.cpf.message]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("input",{value:o,onChange:e=>{var a;return r((a=(a=e.target.value).replace(/\D/g,"")).length>10?a.replace(/(\d{2})(\d{5})(\d{4})/,"($1) $2-$3").substring(0,15):a.replace(/(\d{2})(\d{4})(\d{4})/,"($1) $2-$3").substring(0,14))},type:"tel",placeholder:"Celular *","aria-label":"Celular do cliente",className:er(!!a.celular)}),a.celular&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-13 text-red-600",children:[(0,t.jsx)(h.A,{className:"size-3.5 shrink-0"}),a.celular.message]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("input",{...e("email"),type:"email",placeholder:"E-mail",className:er(!!a.email)}),a.email&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-13 text-red-600",children:[(0,t.jsx)(h.A,{className:"size-3.5 shrink-0"}),a.email.message]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3 border-b border-secondary-3 pb-4",children:(0,t.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",...e("aceitaComunicacoes"),className:"size-4 accent-brand-red cursor-pointer"}),(0,t.jsx)("span",{className:"text-sm text-text-default",children:"O cliente aceita receber comunica\xe7\xf5es da Mitsubishi"})]})}),(0,t.jsx)("div",{className:"flex flex-col gap-2",children:(0,t.jsx)("textarea",{...e("comentario"),rows:3,placeholder:"Coment\xe1rio",className:"w-full border border-secondary-3 rounded px-4 py-3 text-15 text-text-default placeholder:text-secondary-1 bg-white outline-none focus:border-black transition-colors resize-none"})}),l&&(0,t.jsxs)("div",{className:"flex items-center gap-2 bg-red-50 border border-red-200 rounded-lg px-4 py-3",children:[(0,t.jsx)(h.A,{className:"size-4 text-red-500 shrink-0"}),(0,t.jsx)("p",{className:"text-sm text-red-600",children:l})]}
1),!d&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)(v.default,{ref:u,size:"normal",sitekey:C.R.NEXT_PUBLIC_RECAPTCHA_SITE_KEY??"",onChange:m}),c&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-13 text-red-600",children:[(0,t.jsx)(h.A,{className:"size-3.5 shrink-0"}),"Confirme que voc\xea n\xe3o \xe9 um rob\xf4"]})]}),(0,t.jsxs)("button",{type:"submit",disabled:i,className:"h-[52px] w-full bg-brand-red text-white text-base font-medium rounded-lg shadow hover:bg-brand-red-dark transition-colors disabled:opacity-60 flex items-center justify-center gap-2",children:[i&&(0,t.jsx)(p.A,{className:"size-4 animate-spin"}),i?"Enviando...":"ENVIAR"]})]})}let ei=L.object({nomeCompleto:L.string().min(3,"Nome completo \xe9 obrigat\xf3rio").regex(j.VQ,"Apenas letras s\xe3o permitidas").refine(e=>e.trim().includes(" "),"Informe nome e sobrenome"),cpf:L.string().min(1,"CPF \xe9 obrigat\xf3rio").refine(e=>(0,P.u)(e),"CPF inv\xe1lido"),celular:L.string().min(1,"Celular \xe9 obrigat\xf3rio").refine(e=>e.replace(/\D/g,"").length>=10,"Celular inv\xe1lido"),email:L.string().email("E-mail inv\xe1lido").optional().or(L.literal("")),aceitaComunicacoes:L.boolean().optional(),comentario:L.string().optional()});function el({vehicle:e,versao:a,concessionaria:o,leadParams:r,onEditVeiculo:i,onEditVersao:l,onEditConcessionaria:c,onClose:d}
1){let[u,m]=(0,s.useState)(!1),[h,p]=(0,s.useState)(null),[f,v]=(0,s.useState)(!1),g=(0,s.useRef)(null),[b,j]=(0,s.useState)(!1),C=(0,s.useRef)(null),{register:N,handleSubmit:_,setValue:w,control:k,reset:y,formState:{errors:L}}=(0,n.mN)({resolver:(0,S.u)(ei),defaultValues:{nomeCompleto:"",cpf:"",celular:"",email:"",aceitaComunicacoes:!1,comentario:""}}),P=(0,n.FH)({name:"celular",control:k}),I=(0,n.FH)({name:"cpf",control:k}),A=_(async t=>{let s="DEV_BYPASS";if(!g.current)return void j(!0);s=g.current,m(!0),p(null),j(!1);try{await Q({formData:t,vehicle:e,versao:a,concessionaria:o,leadParams:r,recaptcha:s}),M.z.formThankYouPage({formName:"mit-barter",modelName:e.nome,modelId:e.id,modelVersion:a.nome}),v(!0),C.current?.reset(),g.current=null}catch(e){p(e instanceof Error?e.message:"Erro ao enviar. Tente novamente."),C.current?.reset(),g.current=null}finally{m(!1)}});return f?(0,t.jsx)(eo,{concessionaria:o,onClose:()=>{y(),v(!1),d()}}):(0,t.jsxs)("div",{className:"flex flex-row h-full md:min-h-[702px]",children:[(0,t.jsx)(ea,{concessionaria:o,onEditConcessionaria:c}),(0,t.jsxs)("div",{className:"flex-1 bg-white flex flex-col min-w-0 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center h-[60px] px-4 md:px-14 border-b border-surface-subtle shrink-0",children:(0,t.jsx)("h2",{className:"text-lg font-medium text-black tracking-[-0.45px] leading-[30px]",children:"MIT Barter"})}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 md:px-14 py-5 flex flex-col",children:[(0,t.jsxs)("div",{className:"flex md:hidden items-center justify-between border-b border-secondary-3 pb-3 mb-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-11 text-secondary-1 uppercase tracking-wider font-medium",children:"Concession\xe1ria"}),(0,t.jsx)("span",{className:"text-15 font-semibold text-black truncate",children:o.nome})]}),(0,t.jsx)("button",{type:"button",onClick:c,className:"shrink-0 text-secondary-1 hover:text-black transition-colors","aria-label":"Alterar concession\xe1ria",children:(0,t.jsx)(x.A,{className:"size-4"})})]}),(0,t.jsx)(es,{vehicle:e,versao:a,onEditVeiculo:i,onEditVersao:l}),(0,t.jsx)("form",{onSubmit:A,className:"flex flex-col gap-5",noValidate:!0,children:(0,t.jsx)(en,{register:N,errors:L,celular:P,cpf:I,onChangeCelular:e=>w("celular",e,{shouldValidate:!0}),onChangeCpf:e=>w("cpf",e,{shouldValidate:!0}),isSubmitting:u,apiError:h,captchaError:b,isDev:!1,captchaRef:C,onCaptchaChange:e=>{g.current=e,e&&j(!1)}})})]})]})]})}var ec=o(87748),ed=o(32962),eu=o(70775),em=o(17888),ex=o(45151),eh=o(5087),ep=o(31388);function ef(){return(0,t.jsxs)("div",{className:"border border-secondary-3 rounded-xl overflow-hidden flex",children:[(0,t.jsxs)("div",{className:"hidden md:flex flex-col w-1/2 bg-surface-subtle px-12 py-8 gap-6",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2 flex-1",children:[(0,t.jsx)("div",{className:"h-7 w-48 bg-secondary-3 rounded animate-pulse"}),(0,t.jsx)("div",{className:"h-4 w-28 bg-secondary-3 rounded animate-pulse"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[(0,t.jsx)("div",{className:"h-4 w-24 bg-secondary-3 rounded animate-pulse"}),(0,t.jsx)("div",{className:"h-7 w-32 bg-secondary-3 rounded animate-pulse"})]})]}),(0,t.jsx)("div",{className:"flex-1 min-h-[220px] bg-secondary-3 rounded-lg animate-pulse"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("div",{className:"h-4 w-36 bg-secondary-3 rounded animate-pulse"}),(0,t.jsx)("div",{className:"h-3 w-full bg-secondary-3 rounded animate-pulse"}),(0,t.jsx)("div",{className:"h-3 w-3/4 bg-secondary-3 rounded animate-pulse"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col flex-1 px-6 md:px-12 py-8 gap-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between h-[60px] border-b border-surface-subtle pb-[13px]",children:[(0,t.jsx)("div",{className:"h-6 w-36 bg-secondary-3 rounded animate-pulse"}),(0,t.jsx)("div",{className:"h-5 w-24 bg-secondary-3 rounded-full animate-pulse"})]}),(0,t.jsx)("div",{className:"flex flex-col gap-4 pt-2",children:[1,2,3,4].map((e,a)=>(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("div",{className:`h-4 ${0===a?"w-48":"w-36"} bg-secondary-3 rounded animate-pulse`}),(0,t.jsx)("div",{className:"h-12 w-full bg-secondary-3 rounded animate-pulse"})]},e))})]})]})}function ev({vehicles:e,concessionarias:a,cotacaoView:o,preSelectedVehicle:s,urlParam
1s:r,leadParams:n,formKey:i,setFormKey:l,setUrlParams:c}){return(0,t.jsxs)(t.Fragment,{children:["selecionar-veiculo"===o&&(0,t.jsx)("div",{className:"py-8",children:(0,t.jsx)(K.r,{vehicles:e,onSelect:e=>{c({cotacao_veiculo:String(e.id),cotacao_versao:""})}})}),"selecionar-versao"===o&&s&&(0,t.jsx)("div",{className:"py-8",children:(0,t.jsx)(J.a,{vehicle:s,onSelect:e=>{c({cotacao_versao:String(e.id)})},onBack:()=>c({cotacao_veiculo:"",cotacao_versao:""})})}),"form"===o&&(0,t.jsx)("div",{className:"border border-secondary-3 rounded-xl overflow-hidden md:min-h-[702px]",children:(0,t.jsx)(eh.QuoteFormContent,{vehicle:s??void 0,concessionarias:a,defaultVersaoId:r.cotacao_versao||void 0,leadParams:n,onClose:()=>{l(e=>e+1),c({cotacao_veiculo:"",cotacao_versao:""})},hideCloseButton:!0},i)})]})}function eg({vehicles:e,concessionarias:a,preSelectedVehicle:o,urlParams:s,fetchedAccessory:r,leadParams:n,setUrlParams:i}){return(0,t.jsx)(t.Fragment,{children:s.cotacao_acessorio&&!r?(0,t.jsx)(ef,{}):(0,t.jsx)("div",{className:"border border-secondary-3 rounded-xl overflow-hidden",children:(0,t.jsx)(ep.L,{vehicles:e,concessionarias:a,defaultVehicle:o,defaultVersaoId:s.cotacao_versao||void 0,accessory:r??void 0,showProductPanel:!0,leadParams:n,onClose:()=>{i({cotacao_veiculo:"",cotacao_versao:"",cotacao_conc:"",cotacao_acessorio:""})},hideCloseButton:!0})})})}let eb=[];function ej({concessionarias:e,preAgendamentoView:a,preAgendamentoConc:o,leadParams:s,setUrlParams:n}){return(0,t.jsxs)("div",{className:"py-8",children:["selecionar-concessionaria"===a&&(0,t.jsx)(q.v,{concessionarias:e,onSelect:e=>{n({cotacao_conc:String(e.id)}),window.scrollTo(0,0)}}),"form"===a&&o&&(0,t.jsx)("div",{className:"border border-secondary-3 rounded-xl overflow-hidden",children:(0,t.jsx)(r.q,{concessionaria:o,leadParams:s,onClose:()=>{n({cotacao_conc:""})},onEditConcessionaria:()=>{n({cotacao_conc:""})}})})]})}function eC({concessionarias:e,preAtendimentoView:a,preAtendimentoConc:o,leadParams:s,setUrlParams:r}){return(0,t.jsxs)("div",{className:"py-8",children:["selecionar-concessionaria"===a&&(0,t.jsx)(q.v,{concessionarias:e,onSelect:e=>{r({cotacao_conc:String(e.id)}),window.scrollTo(0,0)}}),"form"===a&&o&&(0,t.jsx)("div",{className:"border border-secondary-3 rounded-xl overflow-hidden",children:(0,t.jsx)(D,{concessionaria:o,leadParams:s,onClose:()=>{r({cotacao_conc:""})},onEditConcessionaria:()=>{r({cotacao_conc:""})}})})]})}function eN({vehicles:e,concessionarias:a,revisaoView:o,revisaoVehicle:s,revisaoVersao:r,revisaoRevisao:n,leadParams:i,formKey:l,setFormKey:c,setUrlParams:d}){return(0,t.jsxs)("div",{className:"py-8",children:["selecionar-veiculo"===o&&(0,t.jsx)(K.r,{vehicles:e,onSelect:e=>{d({cotacao_veiculo:String(e.id),cotacao_revisao:"",cotacao_versao:""})}}),"selecionar-versao"===o&&s&&(0,t.jsx)(J.a,{vehicle:s,onSelect:e=>d({cotacao_versao:String(e.id)}),onBack:()=>d({cotacao_veiculo:"",cotacao_versao:""})}),"selecionar-revisao"===o&&s&&(0,t.jsx)(Z.v,{vehicle:s,onSelect:e=>d({cotacao_revisao:e.id}),onBack:()=>d({cotacao_versao:"",cotacao_revisao:""})}),"form"===o&&s&&(0,t.jsx)("div",{className:"border border-secondary-3 rounded-xl overflow-hidden",children:(0,t.jsx)(R.L,{vehicle:s,versaoNome:r?.nome,revisaoNome:n?.nome,concessionarias:a,leadParams:i,onClose:()=>{c(e=>e+1),d({cotacao_veiculo:"",cotacao_revisao:"",cotacao_versao:""})}},l)})]})}function e_({assinaturas:e,assinaturaView:a,assinaturasForModelo:o,initialAssinaturaId:r,assinaturaSelectedItemIds:n,leadParams:i,formKey:l,setFormKey:c,setUrlParams:d}){return(0,t.jsxs)("div",{className:"py-8",children:["selecionar-modelo"===a&&(0,t.jsx)(O.j,{assinaturas:e,onSelect:e=>d({cotacao_veiculo:String(e),cotacao_versao:""})}),"form"===a&&o.length>0&&(0,t.jsx)("div",{className:"border border-secondary-3 rounded-xl overflow-hidden",children:(0,t.jsx)(s.Suspense,{fallback:null,children:(0,t.jsx)(U.J,{assinaturas:o,initialAssinaturaId:r,selectedItemIds:n,leadParams:i,onClose:()=>{c(e=>e+1),d({cotacao_veiculo:"",cotacao_versao:"",cotacao_assinatura:"",cotacao_personalizacao:""})}},l)})})]})}function ew({vehicles:e,concessionariasMitBarter:a,barterView:o,barterVehicle:s,barterVersao:r,barterConc:n,leadParams:i,formKey:l,setFormKey:c,setUrlParams:d}){return(0,t.jsxs)("div",{className:"py-8",children:["selecionar-veiculo"===o&&(0,t.jsx)(K.r,{vehicles:e,onSelect:e=>{d({cotacao_veiculo:String(e.id),cotacao_versao:"",cotacao_conc:""})}}),"selecionar-versao"===o&&s&&(0,t.jsx)(J.a,{vehicle:s,onSelect:e=>d({cotacao_versao:String(e.id)}),onBack:()=>d({cotacao_veiculo:"",cotacao_versao:""})}),"selecionar-concessionaria"===o&&(0,t.jsx)(q.v,{concessionarias:a,onSelect:e=>d({cotacao_conc:String(e.id)}),onBack:r?()=>d({cotacao_versao:""}):void 0}),"form"===o&&s&&r&&n&&(0,t.jsx)("div",{className:"border border-secondary-3 rounded-xl overflow-hidden md:min-
1h-[702px]",children:(0,t.jsx)(el,{vehicle:s,versao:r,concessionaria:n,leadParams:i,onEditVeiculo:()=>d({cotacao_veiculo:""}),onEditVersao:()=>d({cotacao_versao:""}),onEditConcessionaria:()=>d({cotacao_conc:""}),onClose:()=>{c(e=>e+1),d({cotacao_veiculo:"",cotacao_versao:"",cotacao_conc:""})}},l)})]})}function ek({eventosVehicles:e,eventosConcessionarias:a,eventosView:o,eventosVehicle:s,eventosVersao:r,eventosConc:n,eventosDealerCode:i,eventosContatoOpcional:l,urlParams:c,leadParams:d,setUrlParams:u}){return(0,t.jsxs)(t.Fragment,{children:["selecionar-veiculo"===o&&(0,t.jsx)("div",{className:"py-8",children:(0,t.jsx)(K.r,{vehicles:e,onSelect:e=>{u(c.cotacao_versao||c.cotacao_conc?{cotacao_veiculo:String(e.id)}:{cotacao_veiculo:String(e.id),cotacao_versao:"",cotacao_conc:""})}})}),"selecionar-versao"===o&&s&&(0,t.jsx)("div",{className:"py-8",children:(0,t.jsx)(J.a,{vehicle:s,onSelect:e=>u({cotacao_versao:String(e.id)}),onBack:c.cotacao_conc?void 0:()=>u({cotacao_veiculo:"",cotacao_versao:""})})}),"selecionar-concessionaria"===o&&(0,t.jsx)("div",{className:"py-8",children:(0,t.jsx)(q.v,{concessionarias:a,onSelect:e=>u({cotacao_conc:String(e.id)}),onBack:c.cotacao_veiculo&&c.cotacao_versao&&!n?()=>u({cotacao_versao:""}):void 0})}),"form"===o&&(0,t.jsx)("div",{className:"border border-secondary-3 rounded-xl overflow-hidden md:min-h-[702px]",children:(0,t.jsx)(H.W,{vehicle:s,versao:r,concessionaria:n,vehicles:e,concessionarias:a,leadParams:d,onEditVeiculo:s?()=>u({cotacao_veiculo:""}
1):void 0,onEditVersao:r?()=>u({cotacao_versao:""}):void 0,onEditConcessionaria:n&&!i?()=>u({cotacao_conc:""}):void 0,onClose:()=>u({cotacao_veiculo:"",cotacao_versao:"",cotacao_conc:""}),hideCloseButton:!0,contatoOpcional:l})})]})}function ey({data:e,vehicles:a,concessionarias:o,assinaturas:r=eb}){let{tipo:n="cotacao"}=e,i=function({data:e,vehicles:a,concessionarias:o,assinaturas:t}){let[r,n]=(0,ec.ab)({cotacao_veiculo:ec.tU.withDefault(""),cotacao_versao:ec.tU.withDefault(""),cotacao_conc:ec.tU.withDefault(""),cotacao_acessorio:ec.tU.withDefault(""),cotacao_revisao:ec.tU.withDefault(""),cotacao_assinatura:ec.tU.withDefault(""),cotacao_personalizacao:ec.tU.withDefault(""),cotacao_campanha:ec.tU.withDefault(""),cotacao_subsource:ec.tU.withDefault(""),cotacao_interesse:ec.tU.withDefault("")}),[i]=(0,s.useState)(()=>{try{let e=localStorage.getItem("@mitsubishi:user-location-full");if(e){let a=JSON.parse(e);if(void 0!==a.lat&&void 0!==a.lng)return{lat:a.lat,lng:a.lng}}}catch{}return null}),l=(0,s.useMemo)(()=>i?o.toSorted((e,a)=>(e.geodata?.coordinates?(0,eu.$)(i.lat,i.lng,e.geodata.coordinates.lat,e.geodata.coordinates.lng):1/0)-(a.geodata?.coordinates?(0,eu.$)(i.lat,i.lng,a.geodata.coordinates.lat,a.geodata.coordinates.lng):1/0)):o.toSorted((e,a)=>e.nome.localeCompare(a.nome,"pt-BR")),[o,i]),[c]=(0,s.useState)(()=>
1(0,Y.CI)().campaignCode??null),[d]=(0,s.useState)(()=>{try{return new URLSearchParams(window.location.search).get("type")||null}catch{return null}}),[u]=(0,s.useState)(()=>{try{let e=new URLSearchParams(window.location.search),a=e.get("concessionaria")?.trim()||"",o=e.get("trim-list")?.trim()||"",t=e.get("model-list")?.trim()||"",s=a.toUpperCase().startsWith("DN");return{dealerCode:s?a:null,concCodes:a&&!s?a.split("-").filter(Boolean):null,versaoIds:o?o.split("-").filter(Boolean):null,modeloIds:t?t.split("-").filter(Boolean):null}}catch{return{dealerCode:null,concCodes:null,versaoIds:null,modeloIds:null}}}),{leadSource:m,subSource:x}=(0,ed.k)(),h=(0,s.useMemo)(()=>({leadSource:m||void 0,subSource:r.cotacao_subsource||x||e.subsource||void 0,interestIn:r.cotacao_interesse||e.interesse_em||void 0,type:d||e.tipo_de_lead||void 0,campaignCode:r.cotacao_campanha||c||e.codigo_campanha||("pcd"===(d||e.tipo_de_lead)?"ee9cdd10-07a4-11ed-ae29-02f4f61106cc":void 0)}),[m,x,r.cotacao_subsource,r.cotacao_campanha,r.cotacao_interesse,e.subsource,e.interesse_em,e.codigo_campanha,e.tipo_de_lead,c,d]),[p,f]=(0,s.useState)(0),v=(0,s.useMemo)(()=>r.cotacao_veiculo?a.find(e=>String(e.id)===r.cotacao_veiculo)??null:null,[a,r.cotacao_veiculo]),g=r.cotacao_veiculo?r.cotacao_versao?"form":"selecionar-versao":"selecionar-veiculo",[b,j]=(0,s.useState)(null),C=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=r.cotacao_acessorio;(async()=>{if(!e)return j(null);let o=/^\d+$/.test(e)?`filters[id][$eq]=${e}`:`filters[referencia][$eq]=${encodeURIComponent(e)}`,t=`https://cms.mitsubishimotors.com.br/api/acessorios?${o}&populate[0]=foto&populate[1]=modelos_versoes&populate[2]=modelos_versoes_legados&pagination[pageSize]=1`;try{let o=await fetch(t),s=o.ok?await o.json():null,r=s?.data?.[0];if(!r)return void j(null);if(j({name:r.nome,partNumber:r.referencia??void 0,priceFull:r.preco??void 0,pricePromo:r.possui_promo&&null!=r.preco_promo?r.preco_promo:void 0,image:r.foto?{id:r.foto.id,documentId:r.foto.documentId,url:r.foto.url,alternativeText:r.foto.alternativeText,mime:r.foto.mime,width:r.foto.width,height:r.foto.height,formats:null}:null}),C.current!==e){let o=(0,em.hD)(r),t=a.find(e=>null!=e.documentId&&o.includes(e.documentId));if(t){let a=(0,em.ZD)(r),o=t.versoes.find(e=>null!=e.documentId&&a.includes(e.documentId));C.current=e,n({cotacao_veiculo:String(t.id),...o?{cotacao_versao:String(o.id)}:{}})}}}catch{j(null)}})()},[r.cotacao_acessorio,a,n]);let N=(0,s.useMemo)(()=>r.cotacao_conc?o.find(e=>String(e.id)===r.cotacao_conc)??null:null,[o,r.cotacao_conc]),_=(0,s.useMemo)(()=>r.cotacao_conc?l.find(e=>String(e.id)===r.cotacao_conc)??null:null,[l,r.cotacao_conc]),w=(0,s.useMemo)(()=>r.cotacao_veiculo?a.find(e=>String(e.id)===r.cotacao_veiculo)??null:null,[a,r.cotacao_veiculo]),k=(0,s.useMemo)(()=>r.cotacao_revisao?ex.N.find(e=>e.id===r.cotacao_revisao)??null:null,[r.cotacao_revisao]),y=(0,s.useMemo)(()=>w&&r.cotacao_versao?w.versoes.find(e=>String(e.id)===r.cotacao_versao)??null:null,[w,r.cotacao_versao]),S=w?y?k?"form":"selecionar-revisao":"selecionar-versao":"selecionar-veiculo",M=(0,s.useMemo)(()=>r.cotacao_veiculo?t.filter(e=>String(e.versao.modelo.id)===r.cotacao_veiculo):[],[t,r.cotacao_veiculo]),L=(0,s.useMemo)(()=>r.cotacao_assinatura?Number(r.cotacao_assinatura):r.cotacao_versao?t.find(e=>String(e.versao.id)===r.cotacao_versao)?.id??null:null,[t,r.cotacao_assinatura,r.cotacao_versao]),P=r.cotacao_assinatura||r.cotacao_veiculo?"form":"selecionar-modelo",I=(0,s.useMemo)(()=>r.cotacao_personalizacao?r.cotacao_personalizacao.split(",").map(Number).filter(Boolean):[],[r.cotacao_personalizacao]),A=(0,s.useMemo)(()=>{let e=a;if(u.modeloIds){let a=new Set(u.modeloIds),o=e.filter(e=>null!=e.modelo_id&&a.has(String(e.modelo_id)));o.length>0&&(e=o)}if(u.versaoIds){let a=new Set(u.versaoIds),o=e.map(e=>({...e,versoes:e.versoes.filter(e=>a.has(String(e.versao_id)))})).filter(e=>e.versoes.length>0);o.length>0&&(e=o)}return e},[a,u.modeloIds,u.versaoIds]),z=(0,s.useMemo)(()=>{if(!u.concCodes)return l;let e=new Set(u.concCodes),a=l.filter(a=>e.has(a.id_integracao));return a.length>0?a:l},[l,u.concCodes]),E=(0,s.useMemo)(()=>r.cotacao_veiculo?A.find(e=>String(e.id)===r.cotacao_veiculo)??null:null,[A,r.cotacao_veiculo]),T=(0,s.useMemo)(()=>E&&r.cotacao_versao?E.versoes.find(e=>String(e.id)===r.cotacao_versao)??null:null,[E,r.cotacao_versao]),V=u.dealerCode,B=(0,s.useMemo)(()=>r.cotacao_conc?z.find(e=>String(e.id)===r.cotacao_conc)??null:null,[z,r.cotacao_conc]),$=V?{nome:V,id_integracao:V}:B,W=!1===e.step_selecionar_veiculo||E?!1===e.step_selecionar_versao||T?!1===e.step_selecionar_concessionaria||$?"form":"selecionar-concessionaria":"selecionar-versao":"selecionar-veiculo",F=(0,s.useMemo)(()=>l.filter(e=>e.servicos?.mit_barter===!0),[l]),D=(0,s.useMemo)(()=>r.cotacao_veiculo?a.find(e=>String(e.id)===r.cotacao_veiculo)??null:null,[a,r.cotacao_veiculo]),H=(0,s.useMemo)(()=>D&&r.cotacao_versao?D.versoes.find(e=>String(e.id)===r.cotacao_versao)??null:null,[D,r.cotacao_versao]),R=(0,s.useMemo)(()=>r.cotacao_conc?F.find(e=>String(e.id)===r.cotacao_conc)??null:null,[F,r.cotacao_conc]),Z=D?H?R?"form":"selecionar-concessionaria":"selecionar-versao":"selecionar-veiculo";
1return{vehicles:a,concessionarias:l,assinaturas:t,urlParams:r,setUrlParams:n,leadParams:h,formKey:p,setFormKey:f,preSelectedVehicle:v,cotacaoView:g,fetchedAccessory:b,preAgendamentoConc:N,preAgendamentoView:N?"form":"selecionar-concessionaria",preAtendimentoConc:_,preAtendimentoView:_?"form":"selecionar-concessionaria",revisaoVehicle:w,revisaoRevisao:k,revisaoVersao:y,revisaoView:S,assinaturasForModelo:M,initialAssinaturaId:L,assinaturaView:P,assinaturaSelectedItemIds:I,eventosVehicles:A,eventosConcessionarias:z,eventosVehicle:E,eventosVersao:T,eventosConc:$,eventosDealerCode:V,eventosView:W,eventosContatoOpcional:e.contato_opcional??!1,concessionariasMitBarter:F,barterVehicle:D,barterVersao:H,barterConc:R,barterView:Z}}({data:e,vehicles:a,concessionarias:o,assinaturas:r});return(0,t.jsx)("section",{className:"w-full bg-white",children:(0,t.jsxs)("div",{className:"max-w-[1280px] mx-auto px-4 md:px-8 py-12",children:["cotacao"===n&&(0,t.jsx)(ev,{...i}),"acessorios"===n&&(0,t.jsx)(eg,{...i}),"pre-agendamento"===n&&(0,t.jsx)(ej,{...i}),"pre-atendimento"===n&&(0,t.jsx)(eC,{...i}),"revisao-programada"===n&&(0,t.jsx)(eN,{...i}),"assinatura"===n&&(0,t.jsx)(e_,{...i}),"mit-barter"===n&&(0,t.jsx)(ew,{...i}),"eventos"===n&&(0,t.jsx)(ek,{...i})]})})}},99591:(e,a,o)=>{o.d(a,{VQ:()=>i,cn:()=>r,kL:()=>l,tb:()=>n});var t=o(76397),s=o(757);function r(...e){return(0,s.QP)((0,t.$)(e))}function n(e){return!!e&&(/^(https?:)?\/\//.test(e)||/^(mailto:|tel:|whatsapp:)/.test(e))}let i=/^[a-zA-ZÀ-ÖØ-öø-ÿ\s]*$/;function l(e){return e.replace(/[^a-zA-ZÀ-ÖØ-öø-ÿ\s]/g,"")}}}]);

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.