PageSourceSearch

https://cs2assets.caredge.com/_next/static/chunks/0z-msy65s4v8n.js

js caredge.com collected 2026-10-02 03:59:45 UTC 415,369 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47999,e=>{"use strict";var t=e.i(271645),n=e.i(827085);e.s(["useClerkZipSync",0,function(){let{user:e,isLoaded:r}=(0,n.useUser)();return(0,t.useCallback)(t=>{e&&r&&e.unsafeMetadata?.zip!==t&&e.update({unsafeMetadata:{...e.unsafeMetadata,zip:t}}).catch(e=>console.error("[zip-sync] Failed to update Clerk zip:",e))},[e,r])}])},935615,e=>{"use strict";e.s(["NEGOTIATION_CHANGES_MESSAGE",0,"Before we reach out — I'd like to change something about this deal.","NEGOTIATION_CONFIRM_KEY_ATTR",0,"data-negotiation-confirm-key","confirmMessageAlreadyPresent",0,function(e,t){return!!t&&e.some(e=>e.id===t)},"firstNewConfirmKey",0,function(e,t){let n=new Set(e);for(let e of t)if(!n.has(e))return e;return null},"lastActionableConfirmKey",0,function(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];if(!n?.has(i)&&(t[i]??"pending")==="pending")return i}return null},"mentionsMissingConfirmCard",0,function(e){let t=e.toLowerCase();return!!(/\b(can'?t|cannot|don'?t|doesn'?t|didn'?t|not)\s+(see|find|view|seeing|finding)\b[^.?!]{0,40}\b(card|cards|button|buttons)\b/.test(t)||/\bwhere\b[^.?!]{0,60}\b(confirm|card|button)/.test(t)||/\bwhich\s+button\b/.test(t)||/\b(no|missing)\s+confirm(ation)?\s+(card|cards)\b/.test(t))},"negotiationConfirmCardKey",0,function(e,t){return`${e}:${t}`},"parseNegotiationConfirmCardKey",0,function(e){let t=e.lastIndexOf(":");if(t<=0||t===e.length-1)return null;let n=e.slice(0,t),r=e.slice(t+1);return/^\d+$/.test(r)?{messageId:n,cardIndex:Number(r)}:null}])},417209,e=>{"use strict";e.s(["quotaDayStamp",0,function(e=new Date){let t=new Intl.DateTimeFormat("en-US",{timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),n=e=>t.find(t=>t.type===e)?.value??"";return`${n("year")}-${n("month")}-${n("day")}`}])},911459,e=>{"use strict";var t=e.i(847283),n=e.i(685703);e.s(["WIDGET_CHAT_SOURCE",0,"dealer-widget","WIDGET_EMPTY_STATE_TAGLINE",0,"Ask about inventory, pricing, features, or payments — all in one chat.","widgetErrorNotice",0,function(e){let t="Sorry — I'm having trouble responding right now. Please try again in a moment";return e?.phone?`${t}, or call ${e.name} at ${e.phone}.`:e?.name?`${t}, or contact ${e.name} directly.`:`${t}.`},"widgetLimitNotice",0,function(e){let t=e?.name??"the dealership";return e?.phone?`You've reached today's chat limit. Come back tomorrow, or call ${t} at ${e.phone} — the team is happy to help.`:`You've reached today's chat limit. Come back tomorrow, or reach out to ${t} directly — the team is happy to help.`},"widgetLimitReached",0,function(e,r){return!!(0,n.isWidgetSession)()&&(e&&!e.is_placeholder?e.messages_today>=e.daily_limit:r>=((0,n.getWidgetDealer)()?.dailyMessageLimit??t.WIDGET_MESSAGE_LIMIT))}])},510138,e=>{"use strict";e.s(["addBlock",0,function(e,t){let n=e[e.length-1];return!n||n.type!==t.type||"index"in n&&"index"in t&&n.index!==t.index?[...e,t]:e},"appendTextDelta",0,function(e,t){let n=e.contentBlocks,r=n[n.length-1];if(r&&"text"===r.type){let i=n.slice(0,-1);return i.push({type:"text",segment:r.segment+t}),{content:e.content+t,contentBlocks:i}}let i=-1;for(let e=n.length-1;e>=0;e--)if("text"===n[e].type){i=e;break}if(-1!==i){let r=n[i],a=/[.!?:;\n]\s*$/.test(r.segment),l=/^\s*(?:[A-Z]|[#*\-•]\s|\d+\.\s)/.test(t);if(!a&&!l){let a=n.slice();return a[i]={type:"text",segment:r.segment+t},{content:e.content+t,contentBlocks:a}}}return{content:e.content+t,contentBlocks:[...n,{type:"text",segment:t}]}},"emptyMessage",0,function(e,t="",n){return{id:crypto.randomUUID(),role:e,content:t,toolCalls:[],vehicleCards:[],dealAnalyses:[],dealerTransparency:[],otdPredictions:[],negotiations:[],tradeInValuations:[],paymentRequired:[],recallResults:[],windowStickers:[],financeResults:[],invoicePrices:[],vehicleFeatures:[],priceHistories:[],incentivesResults:[],domAnalyses:[],warrantyResults:[],costToOwnResults:[],depreciationCurves:[],marketValues:[],formSubmissions:[],garageDetails:[],onboardingDealerBoards:[],partnerCards:[],conciergeUpgrades:[],dealerMatches:[],negotiationConfirms:[],outboundApprovals:[],closeConfirms:[],contentBlocks:[],created_at:new Date().toISOString(),...void 0!==n?{isStreaming:n}:{}}}
1,"isDuplicateTail",0,function(e,t){return t.length>20&&e.length>0&&e.endsWith(t)},"replaceWithText",0,function(e){return{content:e,contentBlocks:[{type:"text",segment:e}]}},"resolveThinkingPhase",0,function(e){return!e.isStreaming||e.toolCalls.some(e=>"running"===e.status)||e.hasPendingSkeleton?null:e.content.trim().length>0?"continuing":"preparing"}])},158524,e=>{"use strict";var t=e.i(413824);e.s(["Link2",()=>t.default])},592443,e=>{"use strict";RegExp("^concierge/tradein/([^/]+)/[0-9a-f-]{36}/[a-zA-Z0-9._()-]+$"),e.s(["MAX_ATTACHMENTS_PER_MESSAGE",0,5,"MAX_ATTACHMENT_BYTES",0,5242880])},576934,738642,e=>{"use strict";let t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=RegExp(`\\b(${["2 girls 1 cup","2g1c","4r5e","5h1t","5hit","a55","a_s_s","acrotomophilia","alabama hot pocket","alaskan pipeline","anal","anilingus","anus","apeshit","ar5e","arrse","arse","arsehole","ass","ass-fucker","ass-hat","ass-pirate","assbag","assbandit","assbanger","assbite","assclown","asscock","asscracker","asses","assface","assfucker","assfukka","assgoblin","asshat","asshead","asshole","assholes","asshopper","assjacker","asslick","asslicker","assmonkey","assmunch","assmuncher","asspirate","assshole","asssucker","asswad","asswhole","asswipe","auto erotic","autoerotic","b!tch","b00bs","b17ch","b1tch","babeland","baby batter","baby juice","ball gag","ball gravy","ball kicking","ball licking","ball sack","ball sucking","ballbag","balls","ballsack","bampot","bangbros","bareback","barely legal","barenaked","bastard","bastardo","bastinado","bbw","bdsm","beaner","beaners","beastial","beastiality","beastility","beaver cleaver","beaver lips","bellend","bestial","bestiality","bi+ch","biatch","big black","big breasts","big knockers","big tits","bimbos","birdlock","bitch","bitcher","bitchers","bitches","bitchin","bitching","black cock","blonde action","blonde on blonde action","bloody","blow job","blow your load","blowjob","blowjobs","blue waffle","blumpkin","boiolas","bollock","bollocks","bollok","bollox","bondage","boner","boob","boobie","boobs","booobs","boooobs","booooobs","booooooobs","booty call","breasts","brown showers","brunette action","buceta","bugger","bukkake","bulldyke","bullet vibe","bum","bung hole","bunghole","bunny fucker","busty","butt","butt-pirate","buttcheeks","butthole","buttmunch","buttplug","bullshit","bull shit","c0ck","c0cksucker","camel toe","camgirl","camslut","camwhore","carpet muncher","carpetmuncher","cawk","chinc","chink","choad","chocolate rosebuds","chode","cipa","circlejerk","cl1t","cleveland steamer","clit","clitface","clitoris","clits","clover clamps","clusterfuck","cnut","cock","cock-sucker","cockbite","cockburger","cockface","cockhead","cockjockey","cockknoker","cockmaster","cockmongler","cockmongruel","cockmonkey","cockmunch","cockmuncher","cocknose","cocknugget","cocks","cockshit","cocksmith","cocksmoker","cocksuck","cocksuck","cocksucked","cocksucked","cocksucker","cocksucking","cocksucks","cocksuka","cocksukka","cok","cokmuncher","coksucka","coochie","coochy","coon","coons","cooter","coprolagnia","coprophilia","cornhole","cox","crap","creampie","cum","cumbubble","cumdumpster","cumguzzler","cumjockey","cummer","cumming","cums","cumshot","cumslut","cumtart","cunilingus","cunillingus","cunnie","cunnilingus","cunt","cuntface","cunthole","cuntlick","cuntlick","cuntlicker","cuntlicker","cuntlicking","cuntlicking","cuntrag","cunts","cyalis","cyberfuc","cyberfuck","cyberfucked","cyberfucker","cyberfuckers","cyberfucking","d1ck","dammit","damn","darkie","date rape","daterape","deep throat","deepthroat","dendrophilia","dick","dickbag","dickbeater","dickface","dickhead","dickhole","dickjuice","dickmilk","dickmonger","dickslap","dicksucker","dickwad","dickweasel","dickweed","dickwod","dike","dildo","dildos","dingleberries","dingleberry","dink","dinks","dipshit","dirsa","dirty pillows","dirty sanchez","dlck","dog style","dog-fucker","doggie style","doggiestyle","doggin","dogging","doggy style","doggystyle","dolcett","domination","dominatrix","dommes","donkey punch","donkeyribber","doochbag","dookie","doosh","double dong","double penetration","douche","douchebag","dp action","dry hump","duche","dumbshit","dumshit","dvda","dyke","eat my ass","ecchi","ejaculate","ejaculated","ejaculates","ejaculating","ejaculatings","ejaculation","ejakulate","erotic","erotism","eunuch","f u c k","f u c k e r","f4nny","f_u_c_k","fag","fagbag","fagg","fagging","faggit","faggitt","faggot","faggs","fagot","fagots","fags","fagtard","fanny","fannyflaps","fannyfucker","fanyy","fart","farted","farting","farty","fatass","fcuk","fcuker","fcuking","fecal","feck","fecker","felatio","felch","felching","fellate","fellatio","feltch","female squirting","femdom","figging","fingerbang","fingerfuck","fingerfucked","fingerfucker","fingerfuckers","fingerfucking","fingerfucks","fingering","fistfuck","fistfucked","fistfucker","fistfuckers","fistfucking","fistfuckings","fistfucks","fisting","flamer","flange","fook","fooker","foot fetish","footjob","frotting","fuck","fuck buttons","fucka","fucked","fucker","fuckers","fu
1ckhead","fuckheads","fuckin","fucking","fuckings","fuckingshitmotherfucker","fuckme","fucks","fucktards","fuckwhit","fuckwit","fudge packer","fudgepacker","fuk","fuker","fukker","fukkin","fuks","fukwhit","fukwit","futanari","fux","fux0r","g-spot","gang bang","gangbang","gangbanged","gangbanged","gangbangs","gay sex","gayass","gaybob","gaydo","gaylord","gaysex","gaytard","gaywad","genitals","giant cock","girl on top","girls gone wild","goatcx","goatse","god damn","god-dam","god-damned","goddamn","goddamned","gokkun","golden shower","goo girl","gooch","goodpoop","gook","goregasm","gringo","grope","group sex","guido","guro","hand job","handjob","hardcoresex","heeb","hentai","heshe","ho","hoar","hoare","hoe","hoer","holyshit","holy shit","homo","homoerotic","honkey","honky","hooker","hore","horniest","horny","horseshit","horse shit","hot carl","hot chick","hotsex","how to kill","how to murder","huge fat","humping","incest","intercourse","jack off","jack-off","jackass","jackoff","jail bait","jailbait","jap","jelly donut","jerk off","jerk-off","jigaboo","jiggaboo","jiggerboo","jism","jiz","jiz","jizm","jizm","jizz","juggs","kawk","kike","kinbaku","kinkster","kinky","kiunt","knob","knobbing","knobead","knobed","knobend","knobhead","knobjocky","knobjokey","kock","kondum","kondums","kooch","kootch","kum","kumer","kummer","kumming","kums","kunilingus","kunt","kyke","l3i+ch","l3itch","labia","leather restraint","leather straight jacket","lemon party","lesbo","lezzie","lmfao","lolita","lovemaking","lust","lusting","m0f0","m0fo","m45terbate","ma5terb8","ma5terbate","make me come","male squirting","masochist","master-bate","masterb8","masterbat*","masterbat3","masterbate","masterbation","masterbations","masturbate","menage a trois","milf","minge","missionary position","mo-fo","mof0","mofo","mothafuck","mothafucka","mothafuckas","mothafuckaz","mothafucked","mothafucker","mothafuckers","mothafuckin","mothafucking","mothafuckings","mothafucks","mother fucker","motherfuck","motherfucked","motherfucker","motherfuckers","motherfuckin","motherfucking","motherfuckings","motherfuckka","motherfucks","mound of venus","mr hands","muff","muff diver","muffdiver","muffdiving","mutha","muthafecker","muthafuckker","muther","mutherfucker","n1gga","n1gger","nambla","nawashi","nazi","negro","neonazi","nig nog","nigg3r","nigg4h","nigga","niggah","niggas","niggaz","nigger","niggers","niglet","nimphomania","nipple","nipples","nob","nob jokey","nobhead","nobjocky","nobjokey","nsfw images","nude","nudity","numbnuts","nutsack","nympho","nymphomania","octopussy","omorashi","one cup two girls","one guy one jar","orgasim","orgasim","orgasims","orgasm","orgasms","orgy","p0rn","paedophile","paki","panooch","panties","panty","pecker","peckerhead","pedobear","pedophile","pegging","penis","penisfucker","phone sex","phonesex","phuck","phuk","phuked","phuking","phukked","phukking","phuks","phuq","piece of shit","pigfucker","pimpis","pis","pises","pisin","pising","pisof","piss","piss pig","pissed","pisser","pissers","pisses","pissflap","pissflaps","pissin","pissin","pissing","pissoff","pissoff","pisspig","playboy","pleasure chest","pole smoker","polesmoker","pollock","ponyplay","poo","poof","poon","poonani","poonany","poontang","poop","poop chute","poopchute","porn","porno","pornography","pornos","prick","pricks","prince albert piercing","pron","pthc","pube","pubes","punanny","punany","punta","pusies","pusse","pussi","pussies","pussy","pussylicking","pussys","pusy","puto","queaf","queef","queerbait","queerhole","quim","raghead","raging boner","rape","raping","rapist","rectum","renob","retard","reverse cowgirl","rimjaw","rimjob","rimming","rosy palm","rosy palm and her 5 sisters","ruski","rusty trombone","s hit","s&m","s.o.b.","s_h_i_t","sadism","sadist","santorum","scat","schlong","scissoring","screwing","scroat","scrote","scrotum","semen","sex","sexo","sexy","sh!+","sh!t","sh1t","shag","shagger","shaggin","shagging","shaved beaver","shaved pussy","shemale","shi+","shibari","shit","shit-ass","shit-bag","shit-bagger","shit-brain","shit-breath","shit-cunt","shit-dick","shit-eating","shit-face","shit-faced","shit-fit","shit-head","shit-heel","shit-hole","shit-house","shit-load","shit-pot","shit-spitter","shit-stain","shitass","shitbag","shitbagger","shitblimp","shitbrain","shitbreath","shitcunt","shitdick","shite","shiteating","shited","shitey","shitface","shitfaced","shitfit","shitfuck","shitfull","shithead","shitheel","shithole","shithouse","shiting","shitings","shitload","shitpot","shits","shitspitter","shitstain","shitted","shitter","shitters","shittiest","shitting","shittings","shitty","shitty","shity","shiz","shiznit","shota","
1shrimping","skank","skeet","slanteye","slut","slutbag","sluts","smeg","smegma","smut","snatch","snowballing","sodomize","sodomy","son-of-a-bitch","spac","spic","spick","splooge","splooge moose","spooge","spread legs","spunk","strap on","strapon","strappado","strip club","style doggy","suck","sucks","suicide girls","sultry women","swastika","swinger","t1tt1e5","t1tties","tainted love","tard","taste my","tea bagging","teets","teez","testical","testicle","threesome","throating","thundercunt","tight white","tit","titfuck","tits","titt","tittie5","tittiefucker","titties","titty","tittyfuck","tittywank","titwank","tongue in a","topless","tosser","towelhead","tranny","tribadism","tub girl","tubgirl","turd","tushy","tw4t","twat","twathead","twatlips","twatty","twink","twinkie","two girls one cup","twunt","twunter","undressing","upskirt","urethra play","urophilia","v14gra","v1gra","va-j-j","vag","vagina","venus mound","viagra","vibrator","violet wand","vjayjay","vorarephilia","voyeur","vulva","w00se","wang","wank","wanker","wanky","wet dream","wetback","white power","whoar","whore","willies","wrapping men","wrinkled starfish","xrated","xx","xxx","yaoi","yellow showers","yiffy","zoophilia","🖕"].map(t).join("|")})\\b`,"gi"),r=[["cumming","ga"],["cumming","georgia"],["hooker","oklahoma"],["intercourse","pennsylvania"],["dyke","va"],["dyke","virginia"],["knob noster","missouri"],["coon rapids","mn"],["coon rapids","minnesota"],["cooter","missouri"],["cumming","ia"],["cumming","iowa"],["hooker","ne"],["hooker","nebraska"],["coon rapids","ia"],["coon rapids","iowa"],["coon valley","wi"],["coon valley","wisconsin"],["bald knob","ar"],["bald knob","arkansas"],["dike","ia"],["dike","iowa"],["dike","tx"],["dike","texas"]].map(([e,n])=>RegExp(`\\b${t(e)}\\b\\s*(?:county\\s*)?,?\\s*${t(n)}\\b`,"gi"));e.s(["getUnwantedWordMatch",0,(e,i=[])=>{if(n.lastIndex=0,!n.test(e))return null;let a=e;for(let e of r)a=a.replace(e,"");for(let e of i)e&&(a=a.replace(RegExp(t(e),"gi"),""));n.lastIndex=0;let l=n.exec(a);return l?l[0].toLowerCase():null}],576934);var i=e.i(271645),a=e.i(846696),l=e.i(927335);let s=e.i(592443).MAX_ATTACHMENT_BYTES,o=["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/plain","text/csv","image/png","image/jpeg","image/webp"];function c(e){return e+Math.floor(250*Math.random())}function d(e){switch(e){case"no_readable_content":return"This file appears to be empty — no readable content found.";case"pdf_ocr_unavailable":return"We couldn't read this scanned PDF. Try uploading a screenshot or photo of it instead.";case"s3_download_failed":return"Couldn't read the file from storage. Try uploading again.";default:if(e?.startsWith("extractor_exception:"))return"We couldn't process this file. Try a different format.";return e||"Extraction failed."}}function u(e,t){return{...e,serverId:t.id,status:t.status,errorMessage:"failed"===t.status?d(t.extraction_error):null,previewUrl:t.preview_url,meta:t.extracted_meta??{}}}e.s(["COPILOT_ATTACHMENT_ALLOWED_MIME",0,o,"COPILOT_ATTACHMENT_MAX_BYTES",0,s,"useAttachmentUploader",0,function(e){let[t,n]=(0,i.useState)([]),r=(0,i.useRef)(new Map),m=(0,i.useRef)(new Map),p=(0,i.useRef)(new Map),f=(0,i.useRef)(new Map),h=(0,i.useCallback)((e,t)=>{n(n=>n.map(n=>n.localId===e?t(n):n))},[]),g=(0,i.useCallback)(e=>{let t=r.current.get(e);t&&(t.cancelled=!0,t.timer&&clearTimeout(t.timer),r.current.delete(e))},[]),x=(0,i.useCallback)((t,n)=>{if(!e)return;g(n);let i={attachmentId:n,startedAt:Date.now(),timer:null,cancelled:!1};r.current.set(n,i);let s=async()=>{if(i.cancelled)return;let o=Date.now()-i.startedAt;if(o>6e4){h(t,e=>({...e,status:"failed",errorMessage:"Processing timed out. Try again."})),r.current.delete(n);return}try{let s=await (0,l.getCopilotAttachment)(e,n);if(i.cancelled)return;if(h(t,e=>u(e,s)),"extracting"!==s.status){"failed"===s.status&&("no_readable_content"===s.extraction_error?a.toast.error(`${s.file_name} appears to be empty`,{description:"We couldn't find any readable content in this file. Try a different one.",duration:7e3,id:`attachment-empty-${s.id}`}):a.toast.error(`Couldn't process ${s.file_name}`,{description:d(s.extraction_error),duration:6e3,id:`attachment-failed-${s.id}`})),r.current.delete(n);return}}catch(e){if(e instanceof l.CopilotAttachmentError&&404===e.status)return void r.current.delete(n)}i.timer=setTimeout(()=>{s()},c(o<1e4?1500:3e3))};i.timer=setTimeout(()=>{s()},c(1500))},[g,h,e]),b=(0,i.useCallback)(e=>{if(0===e.size)return"File is empty.";if(e.size>s){let e=(s/1024/1024).toFixed(0);return`File too large — max ${e} MB.`}let t=(e.type||"").toLowerCase();return o.includes(t)?null:"Unsupported file type."},[]),y=(0,i.useCallback)(async(t,n)=>{if(!e)return void h(t,e=>({...e,status:"failed",errorMessage:"Send a message first to start the chat, then attach files."}));let r=new AbortController;m.current.set(t,{controller:r,file:n}),h(t,e=>({...e,status:"uploading"}));try{let i=await (0,l.uploadCopilotAttachment)(e,n,{signal:r.signal});if(r.signal.aborted)return void await (0,l.deleteCopilotAttachment)(e,i.id).catch(()=>{});h(t,e=>u(e,i)),m.current.delete(t),"extracting"===i.status&&x(t,i.id)}catch(n){if(m.current.delete(t),r.signal.aborted||n instanceof DOMException&&"AbortError"===n.name)return;let e=n instanceof l.CopilotAttachmentError||n instanceof Error?n.message:"Upload failed.";if(n instanceof l.CopilotAttachmentError)if(429===n.status){let e="per_day_limit"===n.code,t
1=n.extra,r=e?t?.daily_limit:t?.session_limit,i=e?t?.daily_used:t?.session_used;a.toast.error(e?"Daily upload limit reached":"Attachment limit reached for this chat",{description:e?`You've used ${i??"all"} of ${r??"your"} daily uploads. Try again tomorrow or remove an earlier file.`:`This chat already has ${i??r??"the max"} attachments. Remove one before adding another.`,duration:1e4,id:`attachment-quota-${n.code}`})}else if(413===n.status){let e=(s/1024/1024).toFixed(0);a.toast.error("File too large",{description:`Files must be under ${e} MB.`,duration:6e3})}else a.toast.error(e,{duration:6e3});else a.toast.error("Upload failed",{description:e,duration:6e3});h(t,t=>({...t,status:"failed",errorMessage:n instanceof l.CopilotAttachmentError&&413===n.status?`File too large — max ${(s/1024/1024).toFixed(0)} MB`:e}))}},[h,e,x]),v=(0,i.useCallback)(async e=>{let t=b(e),r="u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`local-${Math.random().toString(36).slice(2)}-${Date.now()}`,i=!t&&e.type.startsWith("image/")?URL.createObjectURL(e):null;(i&&f.current.set(r,i),n(n=>[...n,{localId:r,serverId:null,fileName:e.name,fileSizeBytes:e.size,mimeType:e.type||"application/octet-stream",status:t?"failed":"queued",errorMessage:t,previewUrl:null,localPreviewUrl:i,meta:{}}]),t)?a.toast.error(`Can't attach ${e.name}`,{description:t,duration:6e3,id:`attachment-clientside-${r}`}):await y(r,e)},[y,b]),k=(0,i.useCallback)(e=>{let t=m.current.get(e);t&&(t.controller.abort(),m.current.delete(e)),n(t=>{let n=t.find(t=>t.localId===e);return n?.localPreviewUrl&&(URL.revokeObjectURL(n.localPreviewUrl),f.current.delete(e)),t.filter(t=>t.localId!==e)})},[]),j=(0,i.useCallback)(async t=>{let r;n(e=>(r=e.find(e=>e.localId===t),r?.localPreviewUrl&&(URL.revokeObjectURL(r.localPreviewUrl),f.current.delete(t)),e.filter(e=>e.localId!==t)));let i=m.current.get(t);if(i&&(i.controller.abort(),m.current.delete(t)),e&&r?.serverId){g(r.serverId);try{await (0,l.deleteCopilotAttachment)(e,r.serverId)}catch{}}},[g,e]),w=(0,i.useCallback)(()=>{n(e=>e.filter(e=>"ready"!==e.status))},[]);(0,i.useEffect)(()=>{let e=r.current,t=m.current,n=p.current,i=f.current;return()=>{e.forEach(e=>{e.cancelled=!0,e.timer&&clearTimeout(e.timer)}),e.clear(),t.forEach(e=>e.controller.abort()),t.clear(),n.forEach(e=>clearTimeout(e)),n.clear(),i.forEach(e=>URL.revokeObjectURL(e)),i.clear()}},[]),(0,i.useEffect)(()=>{let e=p.current,n=new Set;for(let r of t){if("failed"!==r.status||(n.add(r.localId),e.has(r.localId)))continue;let t=r.localId,i=setTimeout(()=>{e.delete(t),j(t)},3500);e.set(t,i)}for(let[t,r]of e)n.has(t)||(clearTimeout(r),e.delete(t))},[t,j]);let N=t.filter(e=>"ready"===e.status&&e.serverId);return{items:t,readyIds:N.map(e=>e.serverId),readyAttachments:N.map(e=>({id:e.serverId,file_name:e.fileName,mime_type:e.mimeType,file_size_bytes:e.fileSizeBytes,status:"ready",extraction_error:null,extracted_meta:e.meta,preview_url:e.previewUrl,created_at:null,updated_at:null})),attachFile:v,cancel:k,remove:j,clearReady:w}}],738642)},294918,e=>{"use strict";var t=e.i(473302);e.s(["FileSpreadsheet",()=>t.default])},82735,e=>{"use strict";var t=e.i(326524);e.s(["Paperclip",()=>t.default])},203823,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(63209),i=e.i(294918),a=e.i(178583),l=e.i(473708),s=e.i(531278),o=e.i(82735),c=e.i(16715),d=e.i(37727),u=e.i(846696),m=e.i(975157),p=e.i(503196),f=e.i(738642);let h=e.i(592443).MAX_ATTACHMENTS_PER_MESSAGE;function g({mimeType:e,className:n}){return e?e.startsWith("image/")?(0,t.jsx)(l.Image,{className:n}):"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===e||"text/csv"===e?(0,t.jsx)(i.FileSpreadsheet,{className:n}):(0,t.jsx)(a.FileText,{className:n}):(0,t.jsx)(a.FileText,{className:n})}function x({item:e,disabled:n,onCancel:i,onRemove:a,onRetry:l}){var o;let u="uploading"===e.status||"queued"===e.status,p="extracting"===e.status,f="failed"===e.status,h=e.mimeType.startsWith("image/"),b=e.localPreviewUrl,y=f?"border-destructive/50 bg-destructive/10 text-destructive":"ready"===e.status?"border-border bg-muted text-foreground":"border-primary/30 bg-primary/[0.06] text-primary";return(0,t.jsxs)("div",{className:(0,m.cn)("flex items-center gap-2 px-3 rounded-lg border text-sm max-w-full",h&&b?"py-1":"py-1.5",y
1),title:f?e.errorMessage??"Failed":void 0,children:[h&&b?(0,t.jsxs)("div",{className:"relative shrink-0 w-8 h-8 rounded overflow-hidden",children:[(0,t.jsx)("img",{src:b,alt:e.fileName,className:"w-full h-full object-cover"}),(u||p)&&(0,t.jsx)("div",{className:"absolute inset-0 bg-background/60 flex items-center justify-center",children:(0,t.jsx)(s.Loader2,{className:"w-3.5 h-3.5 animate-spin"})})]}):u||p?(0,t.jsx)(s.Loader2,{className:"w-4 h-4 animate-spin shrink-0"}):f?(0,t.jsx)(r.AlertCircle,{className:"w-4 h-4 shrink-0"}):(0,t.jsx)(g,{mimeType:e.mimeType,className:"w-4 h-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate max-w-[140px]",title:e.fileName,children:e.fileName}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:(o=e.fileSizeBytes)<1024?`${o}B`:o<1048576?`${(o/1024).toFixed(0)}KB`:`${(o/1048576).toFixed(1)}MB`}),(0,t.jsxs)("span",{className:(0,m.cn)("text-[10px] font-medium ml-0.5",f?"text-destructive":"text-muted-foreground"),children:["· ",function(e){switch(e){case"queued":return"Queued";case"uploading":return"Uploading";case"extracting":return"Processing";case"ready":return"Ready";case"failed":return"Failed"}}(e.status)]}),f?(0,t.jsx)("button",{type:"button",onClick:l,disabled:n,"aria-label":`Retry ${e.fileName}`,className:"p-1 -m-1 hover:text-foreground transition-colors rounded focus-visible:ring-2 focus-visible:ring-primary",children:(0,t.jsx)(c.RefreshCw,{className:"w-3.5 h-3.5"})}):null,(0,t.jsx)("button",{type:"button",onClick:u?i:a,disabled:n&&!u,"aria-label":`Remove ${e.fileName}`,className:"p-1 -m-1 text-muted-foreground hover:text-destructive transition-colors rounded focus-visible:ring-2 focus-visible:ring-primary",children:(0,t.jsx)(d.X,{className:"w-3.5 h-3.5"})})]})}e.s(["CopilotAttachmentChips",0,function({uploader:e,disabled:n=!1}){if(!(0,p.useFeatureFlags)(e=>e.enableCopilotAttachments))return null;let r=e.items;return 0===r.length?null:(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mb-3","data-testid":"copilot-attachment-chips",children:r.map(r=>(0,t.jsx)(x,{item:r,disabled:n,onCancel:()=>e.cancel(r.localId),onRemove:()=>void e.remove(r.localId),onRetry:()=>{u.toast.message("Pick the file again to retry."),e.remove(r.localId)}},r.localId))})},"CopilotAttachmentTrigger",0,function({uploader:e,disabled:r=!1,onFilesPicked:i,hasSession:a=!0,requireAuth:l=!1,onAuthRequired:s}){let c=(0,n.useRef)(null);if(!(0,p.useFeatureFlags)(e=>e.enableCopilotAttachments))return null;let d=r||!a,m=async t=>{let n=Array.from(t.target.files??[]);if(t.target.value="",0===n.length)return;i?.();let r=Math.max(0,h-e.items.length);if(0===r)return void u.toast.error(`Maximum ${h} files per message`);let a=n.slice(0,r);for(let t of(a.length<n.length&&u.toast.error(`Maximum ${h} files per message`),a))await e.attachFile(t)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>{if(!d){if(l)return void s?.();c.current?.click()}},disabled:d,title:a?l?"Sign in to attach files":void 0:"Send a message first to attach a file",className:"shrink-0 p-1.5 -m-1.5 text-muted-foreground hover:text-primary disabled:opacity-50 disabled:cursor-not-allowed transition-colors rounded-lg focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background","aria-label":"Attach a file",children:(0,t.jsx)(o.Paperclip,{className:"w-5 h-5"})}),(0,t.jsx)("input",{ref:c,type:"file",multiple:!0,accept:f.COPILOT_ATTACHMENT_ALLOWED_MIME.join(","),onChange:m,className:"hidden"})]})},"MAX_FILES_PER_TURN",0,h])},372003,376753,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(952571),i=e.i(531278),a=e.i(686311),l=e.i(39312),s=e.i(846696),o=e.i(337822),c=e.i(975157),d=e.i(846254),u=e.i(143945),m=e.i(985043),p=e.i(168206),f=e.i(227835),h=e.i(545274),g=e.i(417209);function x({messages_today:e,daily_limit:r,overage_cost_cents:i}){let a=(0,n.useRef)(!1),o=(0,u.useUIStore)(e=>e.usageBillingEnabledDate)===(0,g.quotaDayStamp)(),[f,h]=(0,n.useState)(!1);(0,n.useEffect)(()=>{a.current||(a.current=!0,(0,m.track)(p.EVENTS.COPILOT_DAILY_LIMIT_SHOWN))},[]);let y=(i/100).toFixed(2),v=async()=>{let e=!o;h(!0);try{(await fetch((0,d.apiUrl)("/api/copilot/usage-billing-consent"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({consented:e})})).ok?e?(u.useUIStore.getState().setUsageBillingPausedDate(null),u.useUIStore.getState().setUsageBillingEnabledDate((0,g.quotaDayStamp)()),s.toast.success("Usage billing turned back on.")):(u.useUIStore.getState().setUsageBillingEnabledDate(null),s.toast.success("Usage billing turned off. You'll be asked again next time you reach your daily limit.")):s.toast.error(`Could not turn ${e?"on":"off"} usage billing. Please try again.`)}catch{s.toast.error(`Could not turn ${e?"on":"off"} usage billing. Please try again.`)}finally{h(!1)}};
1return(0,t.jsxs)("div",{className:(0,c.cn)("flex items-center justify-center gap-2 px-4 py-1.5 text-xs","bg-amber-50 border-b border-amber-200 text-amber-800","dark:bg-amber-950/40 dark:border-amber-800/40 dark:text-amber-300"),children:[(0,t.jsxs)("span",{className:(0,c.cn)("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",o?"bg-amber-200/70 text-amber-900 dark:bg-amber-800/50 dark:text-amber-200":"bg-amber-100/60 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"),children:[(0,t.jsx)(l.Zap,{className:"size-2.5"}),"Usage billing ",o?"on":"off"]}),(0,t.jsxs)("span",{className:"tabular-nums",children:[e,"/",r," messages today"]}),(0,t.jsx)("span",{className:"text-amber-400 dark:text-amber-700","aria-hidden":"true",children:"·"}),(0,t.jsxs)("span",{className:"tabular-nums font-medium",children:["$",y," billed today"]}),(0,t.jsx)(b,{ratePerMessageCents:5,dailyLimit:r}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-amber-400 dark:text-amber-700","aria-hidden":"true",children:"·"}),(0,t.jsx)("button",{type:"button",onClick:v,disabled:f,className:"underline underline-offset-2 hover:text-amber-950 dark:hover:text-amber-100 disabled:opacity-50",children:f?o?"Turning off…":"Turning on…":o?"Turn off":"Turn on"})]})]})}function b({ratePerMessageCents:e,dailyLimit:n}){let i=`$${(e/100).toFixed(2)}`;return(0,t.jsxs)(o.Popover,{children:[(0,t.jsx)(o.PopoverTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button","aria-label":"How usage billing works",className:"inline-flex items-center justify-center rounded-full transition-opacity hover:opacity-70 text-amber-700 dark:text-amber-400",children:(0,t.jsx)(r.Info,{className:"size-3.5"})})}),(0,t.jsxs)(o.PopoverContent,{align:"center",side:"top",className:"w-72 text-xs leading-relaxed",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground mb-1.5",children:"How usage billing works"}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:["Your first ",n," messages each day are included. After that,"," ",h.tenantConfig.name," Copilot Usage adds ",i,"per message and bills you once at the end of the day for that day's total. Your included messages reset at midnight Eastern, so you only pay on days you go over. Usage billing turns itself off at the same time — you'll be asked again before it ever starts on a new day."]})]})]})}function y({daily_limit:e,onUpgradeClick:r,showConciergeUpsell:i}){let{betaFormatted:a,fullPrice:l}=(0,f.useAiNegotiatorPricing)(),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{s.current||(s.current=!0,(0,m.track)(p.EVENTS.COPILOT_CUMULATIVE_LIMIT_SHOWN))},[]),(0,t.jsxs)("div",{className:(0,c.cn)("px-4 py-2 border-b","bg-primary/5 border-primary/10 text-[11px] text-muted-foreground"),children:[(0,t.jsxs)("p",{className:"text-center",children:["You've used your ",e," free messages."]}),(0,t.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center justify-center gap-x-3 gap-y-1",children:[r?(0,t.jsxs)("button",{onClick:()=>{(0,m.track)(p.EVENTS.COPILOT_CUMULATIVE_LIMIT_UPGRADE_CLICKED),r()},className:"text-primary font-semibold hover:underline",children:["Get AI Buying Agent — ",(0,t.jsxs)("s",{className:"opacity-70",children:["$",l]})," ",a]}):(0,t.jsxs)("span",{className:"text-primary font-semibold",children:["Get AI Buying Agent — ",(0,t.jsxs)("s",{className:"opacity-70",children:["$",l]})," ",a]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"·"}),(0,t.jsx)("button",{type:"button",onClick:()=>{(0,m.track)(p.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Usage Meter",product:"concierge"}),u.useUIStore.getState().openConciergeCheckout("")},className:"text-primary font-semibold hover:underline",children:"Hand it to a pro — $999"})]})]})]})}function v({messages_today:e,daily_limit:r,onUpgradeClick:i}){let a=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{a.current||(a.current=!0,(0,m.track)(p.EVENTS.COPILOT_UPGRADE_VIEWED,{Location:"Usage Meter",product:"ai_negotiator"}))}
1,[]),(0,t.jsxs)("div",{className:(0,c.cn)("text-[11px] text-center py-1.5 border-b","bg-primary/5 border-primary/10 text-muted-foreground"),children:[(0,t.jsxs)("span",{className:"tabular-nums",children:[e,"/",r]})," ","free messages used ·"," ",i?(0,t.jsx)("button",{onClick:()=>{(0,m.track)(p.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Usage Meter",product:"ai_negotiator"}),i()},className:"text-primary font-medium hover:underline",children:"Get AI Buying Agent →"}):(0,t.jsx)("span",{className:"text-primary font-medium",children:"Get AI Buying Agent →"})]})}e.s(["UsageMeter",0,function({usage:e,isPro:n,onUpgradeClick:r,showConciergeUpsell:l,isLoading:s}){if(s)return(0,t.jsxs)("div",{className:(0,c.cn)("flex items-center justify-center gap-1.5 py-1.5 border-b text-[11px] text-muted-foreground","bg-primary/5 border-primary/10"),role:"status","aria-label":"Loading message usage",children:[(0,t.jsx)(i.Loader2,{className:"w-3 h-3 animate-spin","aria-hidden":"true"}),(0,t.jsx)("span",{children:"Loading usage…"})]});if(!e)return null;let{messages_today:o,daily_limit:d,overage_count:u,overage_cost_cents:m,overage_eligible:p}=e,f=u>0||!0===p&&o>d,h=d>0?o/d:0;return f?(0,t.jsx)(x,{messages_today:o,daily_limit:d,overage_cost_cents:m}):n&&!f?(0,t.jsxs)("div",{className:(0,c.cn)("flex items-center justify-center gap-1.5 px-4 py-1.5 text-xs","bg-background border-b border-border text-muted-foreground",n&&!f&&h>=.8&&"text-foreground"),children:[(0,t.jsx)(a.MessageSquare,{className:"w-3 h-3 shrink-0"}),(0,t.jsxs)("span",{className:"tabular-nums",children:[o,"/",d," messages today"]})]}):d-o<=0?(0,t.jsx)(y,{daily_limit:d,onUpgradeClick:r,showConciergeUpsell:l}):(0,t.jsx)(v,{messages_today:o,daily_limit:d,onUpgradeClick:r})}],372003);var k=e.i(878894),j=e.i(223945),w=e.i(776639),N=e.i(519455);e.s(["DealerContactOverrideModal",0,function({dealerEmail:e,dealerPhone:r,onApply:i,className:a}){let[l,s]=(0,n.useState)(!1),[o,d]=(0,n.useState)(e),[u,m]=(0,n.useState)(r),p=!!(e.trim()||r.trim());return(0,t.jsxs)(w.Dialog,{open:l,onOpenChange:t=>{t&&(d(e),m(r)),s(t)},children:[(0,t.jsx)(w.DialogTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button","aria-label":"Dealer contact override",title:p?"Dealer contact override active — click to edit":"Override dealer contact (staging testing)",className:(0,c.cn)("relative shrink-0 p-1.5 -m-1.5 rounded-lg transition-colors","focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background",p?"text-orange-600 hover:text-orange-700":"text-muted-foreground hover:text-primary",a),children:[(0,t.jsx)(j.Store,{className:"w-5 h-5"}),p&&(0,t.jsx)("span",{"aria-hidden":"true",className:"absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-orange-500 ring-2 ring-background"})]})}),(0,t.jsxs)(w.DialogContent,{children:[(0,t.jsxs)(w.DialogHeader,{children:[(0,t.jsxs)(w.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(k.AlertTriangle,{className:"w-4 h-4 text-orange-500"}),"Dealer Contact Override"]}),(0,t.jsx)(w.DialogDescription,{children:"Staging-only. If set, outreach goes directly to these addresses — skips the VIN / verified-contacts lookup. Leave blank to use the real dealer contact."})]}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),i(o.trim(),u.trim()),s(!1)},children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"dealer-email-override",className:"block text-xs font-medium text-foreground mb-1",children:"Dealer Email"}),(0,t.jsx)("input",{id:"dealer-email-override",type:"email",inputMode:"email",autoComplete:"off",value:o,onChange:e=>d(e.target.value),placeholder:"[email protected]",className:(0,c.cn)("w-full rounded-md border border-border bg-background","px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"dealer-phone-override",className:"block text-xs font-medium text-foreground mb-1",children:"Dealer Phone"}),(0,t.jsx)("input",{id:"dealer-phone-override",type:"tel",inputMode:"tel",autoComplete:"off",value:u,onChange:e=>
1m(e.target.value),placeholder:"+15551234567",className:(0,c.cn)("w-full rounded-md border border-border bg-background","px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary")})]})]}),(0,t.jsxs)(w.DialogFooter,{className:"sm:justify-between mt-4",children:[(0,t.jsx)(N.Button,{type:"button",variant:"ghost",onClick:()=>{d(""),m(""),i("","")},disabled:!o&&!u&&!p,children:"Clear"}),(0,t.jsxs)("div",{className:"flex gap-2 sm:justify-end",children:[(0,t.jsx)(w.DialogClose,{asChild:!0,children:(0,t.jsx)(N.Button,{type:"button",variant:"outline",children:"Cancel"})}),(0,t.jsx)(N.Button,{type:"submit",children:"Use"})]})]})]})]})]})}],376753)},806541,e=>{"use strict";var t=e.i(247167);e.s(["copilotAuthReturnPath",0,function(){let e=`${t.default.env.NEXT_PUBLIC_BASE_PATH||""}/askcaredge`,{pathname:n,search:r,hash:i}=window.location;return n===e||n===`${e}/`?n+r+i:e}])},395747,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(618566),i=e.i(338703),a=e.i(975558),l=e.i(205125),s=e.i(204997),o=e.i(158524),c=e.i(846696),d=e.i(975157),u=e.i(545274),m=e.i(576934),p=e.i(846254),f=e.i(528030),h=e.i(352991),g=e.i(732274),x=e.i(503196),b=e.i(738642),y=e.i(203823),v=e.i(372003),k=e.i(376753),j=e.i(847283),w=e.i(985043),N=e.i(168206),_=e.i(685703),C=e.i(911459),S=e.i(806541);let E=/https?:\/\/[^\s]+/g,T=/\/shop-cars\/(new|used)\/([A-HJ-NPR-Z0-9]{17})/i,A=/^[A-HJ-NPR-Z0-9]{17}$/i;function I({link:e}){let n=!e.url&&!!e.vin,r=n?`VIN ${e.vin}`:e.vin?`${u.tenantConfig.name} listing \xb7 VIN ${e.vin}`:e.domain,i=n?l.Car:o.Link2;return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-primary/[0.08] border border-primary/20 text-[11px] text-primary font-medium w-fit max-w-full",children:[(0,t.jsx)(i,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:r})]})}let P=(0,n.forwardRef)(function({onSend:e,isLoading:l,elevated:o,wide:P=!1,hideUsageMeter:L,widgetMode:D=!1,skinDark:M=!1,messageCount:O=0,usage:R,isUsageLoading:F,showConciergeUpsell:$=!1,dealerContactOverrideEnabled:U=!1,dealerEmailOverride:z="",dealerPhoneOverride:B="",onDealerEmailOverrideChange:V,onDealerPhoneOverrideChange:H,sessionId:W,placeholder:q,placeholderOpacity:G,disclaimerExtra:K,autoFocus:Y,knownSafePhrases:Z=[]}
1,X){let[Q,J]=(0,n.useState)(""),[ee,et]=(0,n.useState)(!1),en=(0,n.useRef)(0),er=(0,b.useAttachmentUploader)(W??null),ei=(0,x.useFeatureFlags)(e=>e.enableCopilotAttachments),ea=Q.trim()?function(e){let t=e.trim();if(A.test(t))return{url:"",domain:"",vin:t.toUpperCase()};let n=e.match(E);if(!n)return null;let r=n[0],i=r.match(T);if(i)return{url:r,domain:"caredge.com",vin:i[2].toUpperCase()};try{let e=new URL(r).hostname.replace(/^www\./,"");return{url:r,domain:e}}catch{return null}}(Q):null,el=(0,n.useRef)(null),es=(0,n.useRef)(!1),eo=(0,n.useRef)(!1),ec=(0,r.useRouter)(),{isPro:ed}=(0,f.useProStatus)(),{additionalPlans:eu}=(0,h.useNavData)(),{isSignedIn:em,isLoaded:ep}=(0,i.useAuth)(),{open:ef}=(0,g.useAuthModal)(),eh=ed||eu.aiNegotiator.active||!!o,eg=D||(0,_.isWidgetSession)(),ex=(0,C.widgetLimitReached)(R??null,O),eb=ep&&!em,ey=eb&&!eg&&O>=j.ANON_MESSAGE_LIMIT,ev=!ei||void 0===W||l||ey||eb&&eg,ek=eb&&!eg,ej=()=>{(0,w.track)(N.EVENTS.SIGNIN_GATE_CLICKED,{Location:"Copilot Attachment"}),c.toast.error("Sign in to attach files."),ef({redirectUrl:(0,S.copilotAuthReturnPath)(),source:"Copilot Attachment"})},ew=(0,n.useRef)(!1);(0,n.useEffect)(()=>{ey&&!ew.current&&(ew.current=!0,(0,w.track)(N.EVENTS.COPILOT_LIMIT_REACHED,{product:"account",user_tier:"anonymous",limit:j.ANON_MESSAGE_LIMIT}),(0,w.track)(N.EVENTS.COPILOT_SIGNUP_CTA_SHOWN,{Location:"Chat Input",product:"account"}),(0,w.track)(N.EVENTS.COPILOT_AUTH_MODAL_SHOWN,{trigger:"anon_limit",product:"account"}),(0,w.track)(N.EVENTS.COPILOT_SIGNUP_CTA_CLICKED,{trigger:"anon_limit",product:"account"}),ef({redirectUrl:(0,S.copilotAuthReturnPath)(),source:"Copilot Chat Limit"}))},[ey,ef]),(0,n.useImperativeHandle)(X,()=>({prefill:e=>{J(e),requestAnimationFrame(()=>{let t=el.current;t&&(t.focus(),t.setSelectionRange(e.length,e.length),t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,120)}px`)})}}));let eN=O>=j.FREE_MESSAGE_LIMIT;(0,n.useEffect)(()=>{!eN||eh||es.current||(es.current=!0,(0,w.track)(N.EVENTS.COPILOT_LIMIT_REACHED,{page:window.location.pathname,user_tier:"free",limit:j.FREE_MESSAGE_LIMIT}))},[eN,eh]);let e_=O>=j.AI_NEGOTIATOR_DAILY_LIMIT;(0,n.useEffect)(()=>{e_&&eh&&!eo.current&&(eo.current=!0,(0,w.track)(N.EVENTS.COPILOT_LIMIT_REACHED,{user_tier:eu.aiNegotiator.active?"ai_negotiator":"pro",limit:j.AI_NEGOTIATOR_DAILY_LIMIT}))},[e_,eh,eu.aiNegotiator.active]),(0,n.useEffect)(()=>{Y&&el.current?.focus()},[Y]);let eC=(0,n.useRef)(l);(0,n.useEffect)(()=>{!eC.current||l||ey||requestAnimationFrame(()=>{let e=el.current;e&&"u">typeof document&&document.activeElement===document.body&&e.focus()}),eC.current=l},[l,ey]);let eS=async e=>{if(e.preventDefault(),en.current=0,et(!1),ev)return;if(ek)return void ej();let t=Array.from(e.dataTransfer.files);if(0===t.length)return;let n=Math.max(0,y.MAX_FILES_PER_TURN-er.items.length);if(0===n)return void c.toast.error(`Maximum ${y.MAX_FILES_PER_TURN} files per message`);let r=t.slice(0,n);for(let e of(r.length<t.length&&c.toast.error(`Maximum ${y.MAX_FILES_PER_TURN} files per message`),(0,w.track)(N.EVENTS.COPILOT_ATTACHMENT_UPLOADED),r))await er.attachFile(e)},eE=()=>{let t=Q.trim(),n=er.readyIds,r=n.length>0;if((t||r)&&!l&&!ex){if(ey)return void ef({redirectUrl:(0,S.copilotAuthReturnPath)(),source:"Copilot"});if(t){let e=(0,m.getUnwantedWordMatch)(t,Z);if(e){c.toast.error(`Please keep it respectful — "${e}" looks like it triggered this. Try rephrasing or removing that word.`),fetch((0,p.apiUrl)("/api/copilot/moderation-block"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:W??null,word:e})}).catch(()=>{});return}}er.items.filter(e=>"queued"===e.status||"uploading"===e.status).length>0?c.toast.message("Hold on — still uploading attachments."):(e(t||(r?`I've attached ${n.length} file${n.length>1?"s":""} — please take a look.`:""),r?er.readyAttachments:void 0),J(""),er.clearReady(),el.current&&(el.current.style.height="auto"))}},eT=Q.trim().length>0||er.readyIds.length>0;return(0,t.jsxs)("div",{className:(0,d.cn)("bg-background/80 backdrop-blur-xl pb-[env(safe-area-inset-bottom)]",o?"border-t-0":"border-t border-border"),onDragEnter:e=>{e.preventDefault(),ev||ek||(en.current+=1,1===en.current&&et(!0))},onDragLeave:e=>{e.preventDefault(),en.current=Math.max(0,en.current-1),0===en.current&&et(!1)},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"},onDrop:e=>{eS(e)},children:[ex?(0,t.jsx)("div",{className:"w-full bg-primary/10 border-b border-primary/20 px-4 py-3",children:(0,t.jsx)("p",{className:"mx-auto max-w-3xl text-sm text-foreground",children:(0,C.widgetLimitNotice)((0,_.getWidgetDealer)())})}):ey?(0,t.jsx)("button",{type:"button",onClick:()=>{(0,w.track)(N.EVENTS.SIGNIN_GATE_CLICKED,{Location:"Copilot"}),(0,w.track)(N.EVENTS.COPILOT_SIGNUP_CTA_CLICKED,{trigger:"anon_limit_banner",product:"account"}
1),ef({redirectUrl:(0,S.copilotAuthReturnPath)(),source:"Copilot Chat Limit Banner"})},className:"w-full bg-primary/10 border-b border-primary/20 px-4 py-3 text-left hover:bg-primary/15 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",children:(0,t.jsxs)("div",{className:(0,d.cn)("mx-auto flex items-center justify-between gap-3",P?"max-w-[840px]":"max-w-3xl"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,t.jsx)("span",{className:"shrink-0 inline-flex size-8 items-center justify-center rounded-full bg-primary/15 text-primary",children:(0,t.jsx)(s.LogIn,{className:"size-4"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground leading-tight",children:"Log in to create an account"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-tight mt-0.5",children:"Create a free account to keep chatting"})]})]}),(0,t.jsx)("span",{className:"shrink-0 inline-flex items-center rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground",children:"Sign up"})]})}):L||eg?null:(0,t.jsx)(v.UsageMeter,{usage:R??null,isPro:eh,isLoading:F,onUpgradeClick:()=>{(0,w.track)(N.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Chat Input",product:"ai_negotiator",page:window.location.pathname}),ec.push("/checkout/ai-buying-agent?from=copilot")},showConciergeUpsell:$}),(0,t.jsxs)("div",{className:(0,d.cn)("relative px-4",P?"py-4 sm:py-5":"py-3 sm:py-4"),children:[ee&&ei&&void 0!==W&&(0,t.jsx)("div",{className:"absolute inset-0 z-20 m-2 rounded-2xl border-2 border-dashed border-primary bg-primary/5 flex items-center justify-center pointer-events-none",children:(0,t.jsx)("p",{className:"text-sm font-medium text-primary",children:"Drop files here"})}),(0,t.jsxs)("div",{className:(0,d.cn)("mx-auto",P?"max-w-[840px]":"max-w-3xl"),children:[ea&&(0,t.jsx)("div",{className:"mb-2",children:(0,t.jsx)(I,{link:ea})}),void 0!==W?(0,t.jsx)(y.CopilotAttachmentChips,{uploader:er,disabled:l||ey}):null,(0,t.jsxs)("div",{className:"relative",children:[!M&&(0,t.jsx)("div",{"aria-hidden":!0,style:{backgroundImage:"radial-gradient(closest-side, color-mix(in srgb, var(--primary) 30%, transparent), transparent)"},className:"pointer-events-none absolute left-1/2 top-1/2 z-0 h-[320%] w-[150%] -translate-x-1/2 -translate-y-1/2 rounded-[50%] opacity-80 blur-3xl"}),(0,t.jsxs)("div",{className:(0,d.cn)("relative z-10 flex items-center gap-3 bg-muted transition-all",M?"rounded-full":"rounded-3xl",o?"border-2 border-primary px-4 py-2 glow-settle":M?"border border-border py-[5px] pl-[15px] pr-1.5 focus-within:border-primary":"border border-primary/40 px-4 py-1.5 focus-within:border-primary"),children:[void 0!==W?(0,t.jsx)(y.CopilotAttachmentTrigger,{uploader:er,disabled:ev,hasSession:!!W,requireAuth:ek,onAuthRequired:ej,onFilesPicked:()=>(0,w.track)(N.EVENTS.COPILOT_ATTACHMENT_UPLOADED)}):null,U&&(0,t.jsx)(k.DealerContactOverrideModal,{dealerEmail:z,dealerPhone:B,onApply:(e,t)=>{V?.(e),H?.(t)}}),(0,t.jsxs)("label",{htmlFor:"copilot-input",className:"sr-only",children:["Message"," ",eg?"the dealership assistant":u.tenantConfig.chatName]}),(0,t.jsx)("textarea",{ref:el,id:"copilot-input",value:Q,onChange:e=>J(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eE())},onInput:()=>{let e=el.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,120)}px`)},placeholder:ex?"Daily chat limit reached — see you tomorrow!":ey?"Sign in to continue chatting...":q??"Paste a link, describe a car, or ask me anything...",rows:1,disabled:l||ey||ex,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,className:(0,d.cn)("appearance-none shadow-none","flex-1 bg-transparent text-base sm:text-[15px] text-foreground resize-none outline-none min-h-[24px] max-h-[120px] leading-[24px] py-0","placeholder:text-muted-foreground placeholder:transition-opacity placeholder:duration-300","placeholder:whitespace-nowrap placeholder:overflow-hidden placeholder:text-ellipsis",M&&"sm:text-[14.5px]",void 0!==G&&G<1&&"placeholder:opacity-0")}),(0,t.jsx)("button",{type:"button",onClick:eE,disabled:!eT||l,"aria-label":"Send message",className:(0,d.cn)("appearance-none [-webkit-tap-highlight-color:transparent]","shrink-0 w-9 h-9 rounded-full flex items-center justify-center transition-all duration-200","active:scale-95 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background",M&&"w-[34px] h-[34px]",eT&&!l?"bg-primary hover:bg-primary/90":"bg-transparent opacity-0 pointer-events-none"),children:(0,t.jsx)(a.ArrowUp,{className:"w-4 h-4 text-primary-foreground"})})]})]}),eg?(0,t.jsx)("div",{className:"widget-disclaimer text-xs text-muted-foreground text-center mt-2",children:(0,t.jsxs)("p",{children:["AI-powered. AI can make mistakes. By continuing you agree to our ",(0,t.jsx)("a",{href:"https://caredge.com/terms",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground transition-colors",children:"Terms"}),", ",(0,t.jsx)("a",{href:"https://caredge.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground transition-colors",children:"Privacy Policy"}),", and consent that data may be used to improve CarEdge products. Powered by CarEdge."]})}):eb?(0,t.jsxs)("p",{className:"text-xs text-muted-foreground text-center mt-2",children:["By using ",u.tenantConfig.chatName,", you agree to the"," ",(0,t.jsx)("a",{href:"https://caredge.com/terms",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground transition-colors",children:"Terms of Use"})," ","and acknowledge the"," ",(0,t.jsx)("a",{href:"https://caredge.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground transition-colors",children:"Privacy Policy"}),". ",u.tenantConfig.name," may use conversations, searches, dealer interactions and related outputs to improve its products and AI systems, and may publish aggregated or de-identified insights derived from those interactions. AI-generated responses may be inaccurate and should be independently verified.",K]}):K?(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center mt-2",children:K}):null]})]})]})});e.s(["ChatInput",0,P])},458841,901949,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(643531),i=e.i(354385),a=e.i(952571),l=e.i(531278),s=e.i(774215);e.s(["PencilLine",()=>s.default],901949);var s=s,o=e.i(89128),c=e.i(519455),d=e.i(257428),u=e.i(784296),m=e.i(975157),p=e.i(545274),f=e.i(846254),h=e.i(502201);function g(e){return null==e?null:`$${Math.round(e/100).toLocaleStr
1ing("en-US")}`}function x(e){return!!e&&/^\d{5}$/.test(e)}function b({savedZip:e,searchZip:t,readOnly:r}){let i=!r&&x(t)&&x(e)&&t!==e,[a,l]=(0,n.useState)(null),s=a??(i?"pending":"keep_saved"),[o,c]=(0,n.useState)(!1),[d,u]=(0,n.useState)(!1);async function m(){if(t&&!o){c(!0),u(!1);try{let e=await fetch((0,f.apiUrl)("/api/copilot/users/profile"),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({zip:t})});if(!e.ok)throw Error(`PATCH failed: ${e.status}`);(0,h.persistZip)(t),l("use_search")}catch{u(!0)}finally{c(!1)}}}return{hasZipConflict:i,zipDecision:s,zipSaving:o,zipSaveFailed:d,zipChoiceUnresolved:i&&"pending"===s,useSearchZip:m,keepSavedZip:function(){u(!1),l("keep_saved")}}}function y({savedZip:e,searchZip:n,radiusMiles:r,choice:i}){let{hasZipConflict:l,zipDecision:s,zipSaving:o,zipSaveFailed:c,useSearchZip:d,keepSavedZip:u}=i;return(0,t.jsx)(v,{label:"Your ZIP",children:(0,t.jsxs)(t.Fragment,{children:[l&&"pending"===s?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("p",{className:"text-foreground",children:["You have ",(0,t.jsx)("span",{className:"font-medium",children:e})," saved. This car was found near"," ",(0,t.jsx)("span",{className:"font-medium",children:n}),". Use ",n," ","for this deal (and save it as your ZIP going forward), or continue with ",e,"?"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:d,disabled:o,className:"cursor-pointer rounded-full border border-primary/40 bg-primary/5 px-2.5 py-1 text-xs font-medium text-primary transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-60",children:o?"Saving…":`Use ${n}`}),(0,t.jsxs)("button",{type:"button",onClick:u,disabled:o,className:"cursor-pointer rounded-full border border-border px-2.5 py-1 text-xs font-medium text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-60",children:["Continue with ",e]})]}),c&&(0,t.jsxs)("p",{className:"text-xs text-destructive",children:["Couldn't save ",n,". Try again, or continue with"," ",e,"."]})]}):"use_search"===s?(0,t.jsxs)("span",{className:"text-emerald-600 dark:text-emerald-400",children:["Saved ",n,". We'll use it for this and future deals."]}):(0,t.jsxs)(t.Fragment,{children:[e,null!=r&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" ","· within ",r," mi"]})]}),(0,t.jsxs)("p",{className:"mt-1 flex items-start gap-1 text-xs font-semibold text-foreground",children:[(0,t.jsx)(a.Info,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),"This ZIP code will be used to calculate the applicable tax and send OTDs."]})]})})}function v({label:e,children:n}){return(0,t.jsxs)("div",{className:"flex items-baseline gap-3 py-1.5",children:[(0,t.jsx)("dt",{className:"w-24 shrink-0 text-xs text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"min-w-0 flex-1 text-sm text-foreground",children:n})]})}function k(e){if(!p.IS_TENANT)return null;let t=g(e?.suggested_target_otd_cents??null);return e&&t?"can_do_better"===e.kind?`Your target looks softer than this deal allows. We could likely land nearer ${t}. Start it anyway, or change the number.`:`Your target is a stretch for this market. The realistic floor is nearer ${t}. Start it anyway, or change the number.`:null}function j(e){return"ai"===e.mode||"certified"===e.mode&&!0===e.agent_negotiates}function w(e){return"auto"===e?"Autopilot: replies sent automatically":"review"===e?"Review & Edit: you approve every reply":null}function N(e,t){if(0===e.length)return{shared:!1,value:void 0};let n=t(e[0]);return e.every(e=>t(e)===n)?{shared:!0,value:n}:{shared:!1,value:void 0}}function _({item:e,selected:n,disabled:i,submitting:a,onToggle:c,showTarget:p}){let{payload:f,status:h,blockedReason:x}=e,{vehicle:b,pricing:y,dealer:v,strategy:j}=f,w=[b.year,b.make,b.model,b.trim].filter(Boolean).join(" ")||"This vehicle",N=g(y.asking_price_cents),C=g(j.target_price_cents),S=k(j.target_warning??null),E=b.vin??null;return(0,t.jsxs)("li",{className:"flex items-start gap-2.5 py-2",children:[(0,t.jsx)("div",{className:"flex size-5 shrink-0 items-center justify-center pt-0.5",children:a?(0,t.jsx)(l.L
1oader2,{className:"size-4 animate-spin text-primary","aria-hidden":"true"}):x&&!e.retryable?(0,t.jsx)(o.TriangleAlert,{className:"size-4 text-amber-600 dark:text-amber-400","aria-hidden":"true"}):"confirmed"===h?(0,t.jsx)(r.Check,{className:"size-4 text-emerald-600 dark:text-emerald-400","aria-hidden":"true"}):"changes_requested"===h?(0,t.jsx)(s.default,{className:"size-4 text-muted-foreground","aria-hidden":"true"}):(0,t.jsx)(d.Checkbox,{checked:n,disabled:i,onCheckedChange:c,"aria-label":`Include ${w}${v.name?` at ${v.name}`:""}`})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:(0,m.cn)("flex flex-wrap items-center gap-x-2 gap-y-1 text-sm font-medium text-foreground","pending"!==h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:w}),e.carried&&(0,t.jsx)("span",{className:"rounded-full border border-border px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"From your previous selection"})]}),(0,t.jsxs)("p",{className:"mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground",children:[v.name&&(0,t.jsx)("span",{className:"truncate",children:v.name}),v.is_certified&&(0,t.jsx)(u.CertifiedPill,{}),N&&(0,t.jsxs)("span",{children:["· ",N]}),p&&(0,t.jsxs)("span",{children:["· target ",C??"not set"]}),E&&(0,t.jsxs)("span",{className:"font-mono break-all",children:["· VIN ",E]})]}),x&&(0,t.jsx)("p",{className:"mt-1 text-xs text-amber-700 dark:text-amber-400",children:x}),!x&&"pending"===h&&S&&(0,t.jsx)("p",{className:"mt-1 text-xs text-amber-700 dark:text-amber-400",children:S}),a&&(0,t.jsx)("p",{className:"mt-1 text-xs text-primary",children:"Starting…"}),!a&&"confirmed"===h&&(0,t.jsx)("p",{className:"mt-1 text-xs text-emerald-700 dark:text-emerald-400",children:e.startedElsewhere?"Already started":"Started"}),"changes_requested"===h&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Changes requested"})]})]})}e.s(["NegotiationConfirmCard",0,function({payload:e,status:n="pending",startedElsewhere:a=!1,isSubmitting:o=!1,readOnly:d=!1,blockedReason:f=null,onConfirm:h,onRequestChanges:x,className:N}){let{vehicle:_,pricing:C,dealer:S,buyer:E,strategy:T,mode:A,agent_negotiates:I}=e,P=E.search_zip,L=b({savedZip:E.zip,searchZip:P,readOnly:d}),{zipChoiceUnresolved:D}=L,M=[_.year,_.make,_.model,_.trim].filter(Boolean).join(" "),O=["new"===_.condition?"New":"Used",null!=_.mileage?`${_.mileage.toLocaleString("en-US")} mi`:null,_.exterior_color&&_.interior_color?`${_.exterior_color} / ${_.interior_color}
1`:_.exterior_color||_.interior_color].filter(Boolean),R=[S.city,S.state].filter(Boolean).join(", "),F=g(C.asking_price_cents),$=g(C.discount_cents),U=g(T.target_price_cents),z=w(T.autonomy),B=k(T.target_warning??null),V="certified"===A?I?`This is a ${p.tenantConfig.name} Certified dealer, vetted for transparency and fair pricing. Your AI Buying Agent will reach out under its own alias — your contact details stay private — and negotiate on your behalf.`:`This is a ${p.tenantConfig.name} Certified dealer. They'll send you an out-the-door price directly. No AI negotiation runs on this one.`:"manual"===A?"Your concierge will handle this negotiation directly. No automated outreach goes out.":"Your AI Buying Agent will contact this dealer and negotiate on your behalf. We'll reach out as soon as you confirm.";if("pending"!==n){let e="confirmed"===n;return(0,t.jsx)("div",{className:(0,m.cn)("max-w-md rounded-xl border p-3",e?"border-emerald-500/30 bg-emerald-50/50 dark:bg-emerald-950/20":"border-border bg-muted/40",N),children:(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:(0,m.cn)("flex size-7 shrink-0 items-center justify-center rounded-full",e?"bg-emerald-500/20 text-emerald-600 dark:text-emerald-400":"bg-muted text-muted-foreground"),children:e?(0,t.jsx)(r.Check,{className:"size-3.5"}):(0,t.jsx)(s.default,{className:"size-3.5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:a?"Negotiation already started":e?"Details confirmed":"Changes requested"}),M&&(0,t.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:M})]})]})})}return(0,t.jsxs)("section",{"aria-label":"Review negotiation details before we contact the dealer",className:(0,m.cn)("max-w-md rounded-xl border border-border bg-card p-4",N),children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:(0,t.jsx)(i.ClipboardCheck,{className:"size-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Review before we reach out"}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:V})]})]}),(0,t.jsxs)("div",{className:"mt-3 rounded-lg bg-muted/50 px-3 py-2",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:M||"This vehicle"}),O.length>0&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:O.join(" · ")}),_.vin&&(0,t.jsxs)("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:["VIN ",_.vin]})]}),(0,t.jsxs)("dl",{className:"mt-2 divide-y divide-border/60",children:[S.name&&(0,t.jsx)(v,{label:"Dealer",children:(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("span",{children:[S.name,R&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" ","· ",R]})]}),S.is_certified&&(0,t.jsx)(u.CertifiedPill,{})]})}),F&&(0,t.jsxs)(v,{label:"Asking price",children:[F,$&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" ","· ",$," off MSRP"]})]}),(0,t.jsx)(v,{label:"Your target",children:p.IS_TENANT?U??(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not set yet. We'll aim for the best price we can get"}):"ai"===A?(0,t.jsx)("span",{className:"text-muted-foreground",children:"You'll set this once the negotiation starts"}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not set yet. We'll aim for the best price we can get"})}),E.zip&&(0,t.jsx)(y,{savedZip:E.zip,searchZip:P,radiusMiles:E.radius_miles,choice:L}),z&&j(e)&&(0,t.jsx)(v,{label:"Replies",children:z}),E.contact_on_file&&(0,t.jsx)(v,{label:"Updates",children:"We'll keep you posted here and by email"})]}),(f||B)&&(0,t.jsx)("p",{className:"mt-3 rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-700 dark:text-amber-400",role:"note",children:f||B}),d?null:(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-2 @sm:flex-row",children:[(0,t.jsx)(c.Button,{type:"button",onClick:h,disabled:o||D,className:"@sm:flex-1",children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.L
1oader2,{className:"size-4 animate-spin"}),"Starting…"]}):"Yes, start it"}),(0,t.jsx)(c.Button,{type:"button",variant:"outline",onClick:x,disabled:o,className:"@sm:flex-1",children:"Need some changes"})]})]})},"NegotiationConfirmGroupCard",0,function({items:e,isSubmitting:r=!1,readOnly:a=!1,onConfirmAll:s,onRequestChanges:o,className:d}){let[u,f]=(0,n.useState)(()=>new Set),h=e.filter(e=>"pending"===e.status&&(!e.blockedReason||e.retryable)).map(e=>e.cardKey).filter(e=>!u.has(e)),x=e.map(e=>e.payload),{value:k}=N(x,e=>e.buyer.zip),{shared:C,value:S}=N(x,e=>e.buyer.search_zip),E=b({savedZip:k,searchZip:C?S:null,readOnly:a}),{value:T}=N(x,e=>e.buyer.radius_miles),{value:A}=N(x,e=>e.strategy.autonomy),I=N(x,e=>e.strategy.target_price_cents),P=x.some(e=>e.buyer.contact_on_file),L=x.some(j),D=null!=A?w(A):null,M=e.filter(e=>"pending"===e.status).length,O=!a&&M>0;return(0,t.jsxs)("section",{"aria-label":"Review these negotiations before we contact the dealers","aria-busy":r,className:(0,m.cn)("max-w-md rounded-xl border bg-card p-4 transition-colors",r?"border-primary/40":"border-border",d),children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:r?(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}):(0,t.jsx)(i.ClipboardCheck,{className:"size-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:r?"Contacting the dealers":"Review before we reach out"}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:r?`Starting ${h.length} negotiation${1===h.length?"":"s"} — this takes a few seconds. Don't close this.`:function(e){let t=e.filter(e=>"ai"===e.mode).length,n=e.filter(e=>"certified"===e.mode&&e.agent_negotiates).length,r=e.filter(e=>"certified"===e.mode&&!e.agent_negotiates).length,i=e.filter(e=>"manual"===e.mode).length,a=[];if(t&&a.push(`your AI Buying Agent will contact ${1===t?"1 dealer":`${t} dealers`} and negotiate on your behalf`),n&&a.push(`your AI Buying Agent will contact ${1===n?"1 ":`${n} `}${p.tenantConfig.name} Certified ${1===n?"dealer":"dealers"} under its alias and negotiate on your behalf`),r&&a.push(`${1===r?"1 ":`${r} `}${p.tenantConfig.name} Certified ${1===r?"dealer":"dealers"} will send you an out-the-door price directly — no AI negotiation runs on ${1===r?"that one":"those"}`),i&&a.push(`your concierge will handle ${1===i?"1":i} directly — no automated outreach goes out`),0===a.length)return"";let l=a.join("; ");return l.charAt(0).toUpperCase()+l.slice(1)+"."}(x)})]})]}),(0,t.jsx)("ul",{className:(0,m.cn)("mt-3 divide-y divide-border/60 transition-opacity",r&&"pointer-events-none"),children:e.map(e=>(0,t.jsx)(_,{item:e,selected:!u.has(e.cardKey),disabled:r||a,submitting:r&&h.includes(e.cardKey),onToggle:()=>{var t;return t=e.cardKey,void f(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},showTarget:p.IS_TENANT&&!I.shared},e.cardKey))}),(0,t.jsxs)("dl",{className:"mt-2 divide-y divide-border/60",children:[p.IS_TENANT?I.shared&&(0,t.jsx)(v,{label:"Your target",children:g(I.value)??(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not set yet — we'll aim for the best price we can get"})}):(0,t.jsx)(v,{label:"Your target",children:(0,t.jsx)("span",{className:"text-muted-foreground",children:L?"You'll set this once each negotiation starts":"Not set yet — we'll aim for the best price we can get"})}),k&&(0,t.jsx)(y,{savedZip:k,searchZip:C?S:null,radiusMiles:T??null,choice:E}),D&&L&&(0,t.jsx)(v,{label:"Replies",children:D}),P&&(0,t.jsx)(v,{label:"Updates",children:"We'll keep you posted here and by email"})]}),O&&(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-2 @sm:flex-row",children:[(0,t.jsx)(c.Button,{type:"button",onClick:()=>s?.(h),disabled:r||0===h.length||E.zipChoiceUnresolved,className:"@sm:flex-1",children:r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Loader2,{className:"size-4 animate-spin"}),"Starting…"]}):0===h.length?"Select at least one":`Start ${h.length} negotiation${1===h.length?"":"s"}`}),(0,t.jsx)(c.Button,{type:"button",variant:"outline",onClick:o,disabled:r,className:"@sm:flex-1",children:"Need some changes"})]})]})}],458841)},207585,e=>{"use strict";var t=e.i(935615);function n(e){return"sent"===e||"changes_requested"===e?e:r(e)?"answered":void 0}function r(e){return"string"==typeof e&&!!e.trim()&&"pending"!==e}let i=new Set(["draft_negotiation_message","create_dealer_inquiry","start_negotiation","submit_dealer_website_form"]);function a(e,...t){for(let n of t){let t=e?.[n];if("string"==typeof t&&t.trim())return t.trim()}return""}e.s(["KEEP_DEAL_OPEN_MESSAGE",0,"Actually, keep this deal open.","OUTBOUND_CHANGES_MESSAGE",0,"Before that goes out — I'd like to change something about it.","closeConfirmCardStatus",0,function({liveStatus:e,resolution:t,inquiryId:n,negotiationId:i,resolvedDealIds:a,answeredDealIds:l}){if(e)return e;let s="closed"===t||"kept"===t?t:r(t)?"answered":void 0;if(s)return s;let o=e=>!!n&&!!e?.has(n)||!!i&&!!e?.has(i);return o(a)?"closed":o(l)?"answered":"pending"},"holdReasonCopy",0,function(e){switch(e){case"always_gated:send_counter_offer":case"makes_an_offer":return"This puts a number on the table, so it needs your OK first.";case"agrees_to_terms":return"This accepts the dealer's terms, so it needs your OK first.";case"ends_negotiation":return"This ends the negotiation, so it needs your OK first.";case"chat_relay_needs_preview":return"You said this to me — check it before it goes to the dealer under your alias.";case"review_mode":return"You asked to approve every reply before it goes out.";default:return"This one needs your OK before it goes to the dealer."}},"knownOutboundResolution",0,n,"toolCallAwaitsApproval",0,function(e,t){if(!t.length||"completed"!==e.status||!i.has(e.tool_name))return!1;let n=a(e.toolArgs,"vin","vehicle_vin").toUpperCase();if(n){if(t.some(e=>e.vehicle_vin?.toUpperCase()===n))return!0;
1if(t.every(e=>e.vehicle_vin))return!1}let r=a(e.toolArgs,"dealer_name","dealer").toLowerCase();return!!r&&t.some(e=>e.dealer_name?.toLowerCase()===r)},"unresolvedHeldApprovals",0,function(e,r,i){return r?.length?r.filter((r,a)=>{let l=(0,t.negotiationConfirmCardKey)(e,a);return"pending"===(i?.[l]??n(r.resolution)??"pending")}):[]}])},19071,182536,e=>{"use strict";var t=e.i(843476),n=e.i(643531),r=e.i(952571),i=e.i(531278),a=e.i(901949),l=e.i(581418),s=e.i(519455),o=e.i(975157),c=e.i(207585);e.s(["OutboundApprovalCard",0,function({payload:e,status:d="pending",isSubmitting:u=!1,onApprove:m,onRequestChanges:p,className:f,sendBlockReason:h}){let g=e.dealer_name||"the dealer";if("pending"!==d){let i="sent"===d,l="answered"===d,s=l?"Already answered":i?`Sent to ${g}`:"Changes requested — nothing sent",c=l?e.vehicle?`${e.vehicle} \xb7 open the deal to see what was sent`:"Open the deal to see what was sent":i?e.vehicle:e.vehicle?`${e.vehicle} \xb7 we'll rework it with you here`:"We'll rework it with you here";return(0,t.jsx)("div",{className:(0,o.cn)("max-w-md rounded-xl border p-3",i?"border-emerald-500/30 bg-emerald-50/50 dark:bg-emerald-950/20":"border-border bg-muted/40",f),children:(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:(0,o.cn)("flex size-7 shrink-0 items-center justify-center rounded-full",i?"bg-emerald-500/20 text-emerald-600 dark:text-emerald-400":"bg-muted text-muted-foreground"),children:l?(0,t.jsx)(r.Info,{className:"size-3.5"}):i?(0,t.jsx)(n.Check,{className:"size-3.5"}):(0,t.jsx)(a.PencilLine,{className:"size-3.5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:s}),c&&(0,t.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:c})]})]})})}return(0,t.jsxs)("section",{"aria-label":"Approve this message before it goes to the dealer",className:(0,o.cn)("max-w-md rounded-xl border border-border bg-card p-4",f),children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:(0,t.jsx)(l.ShieldCheck,{className:"size-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Waiting on your OK — nothing sent yet"}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:(0,c.holdReasonCopy)(e.hold_reason)})]})]}),(0,t.jsxs)("div",{className:"mt-3 rounded-lg bg-muted/50 px-3 py-2",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["To ",g,e.vehicle?` \xb7 ${e.vehicle}`:""]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm whitespace-pre-wrap text-foreground",children:e.pending_text})]}),h?(0,t.jsxs)("p",{className:"mt-4 text-sm text-muted-foreground",children:[h," Open the deal to resume it, then send from there."]}):(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row",children:[(0,t.jsx)(s.Button,{type:"button",onClick:m,disabled:u,className:"sm:flex-1",children:u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}),"Sending…"]}):"Send it"}),(0,t.jsx)(s.Button,{type:"button",variant:"outline",onClick:p,disabled:u,className:"sm:flex-1",children:"Change it"})]})]})}],19071);var d=e.i(801073),u=e.i(367240),m=e.i(373884);e.s(["CloseDealConfirmCard",0,function({payload:e,status:a="pending",isSubmitting:l=!1,onClose:c,onKeepOpen:p,className:f}){let h=e.vehicle||"This deal",g=e.dealer_name,x="lost"===e.outcome,b=x?{heading:"Close this deal?",body:"Nothing has closed yet. We'll stop negotiating this one — you can always start it again later.",confirm:"Yes, close it",pending:"Closing…",receipt:"Deal closed"}:{heading:"Pause this deal?",body:"Nothing has changed yet. We'll stop negotiating for now — you can resume this deal whenever you're ready.",confirm:"Yes, pause it",pending:"Pausing…",receipt:"Deal paused"};if("pending"!==a){let e="closed"===a,i="answered"===a;return(0,t.jsx)("div",{className:(0,o.cn)("max-w-md rounded-xl border border-border bg-muted/40 p-3",f),children:(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:i?(0,t.jsx)(r.Info,{className:"size-3.5"}):e?(0,t.jsx)(n.Check,{className:"size-3.5"}):(0,t.jsx)(u.RotateCcw,{className:"size-3.5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:i?"Already answered":e?b.receipt:"Still open — nothing changed"}),(0,t.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[h,g?` \xb7 ${g}`:""]})]})]})})}return(0,t.jsxs)("section",{"aria-label":x?"Confirm before this deal closes":"Confirm before this deal pauses",className:(0,o.cn)("max-w-md rounded-xl border border-border bg-card p-4",f),children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:x?(0,t.jsx)(m.XCircle,{className:"size-4"}):(0,t.jsx)(d.PauseCircle,{className:"size-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:b.heading}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:b.body})]})]}),(0,t.jsxs)("div",{className:"mt-3 rounded-lg bg-muted/50 px-3 py-2",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:h}),g&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row",children:[(0,t.jsx)(s.Button,{type:"button",onClick:c,disabled:l,className:"sm:flex-1",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}),b.pending]}):b.confirm}),(0,t.jsx)(s.Button,{type:"button",variant:"outline",onClick:p,disabled:l,className:"sm:flex-1",children:"Keep it open"})]})]})}],182536)},111401,e=>{"use strict";var t=e.i(271645),n=e.i(827085),r=e.i(732274),i=e.i(545274);e.s(["useFairautoSigninGate",0,function(){let{isSignedIn:e,isLoaded:a}=(0,n.useUser)(),{open:l}=(0,r.useAuthModal)();return(0,t.useCallback)(()=>
1!!i.IS_FAIRAUTO&&!!a&&!1===e&&(l({isSignIn:!0,source:"Copilot Negotiate"}),!0),[a,e,l])}])},414935,e=>{"use strict";var t=e.i(271645),n=e.i(266027),r=e.i(338703),i=e.i(927335);let a=["copilot-closed-deals"];e.s(["CLOSED_DEALS_QUERY_KEY",0,a,"useClosedDeals",0,function(){let{isSignedIn:e,isLoaded:l}=(0,r.useAuth)(),s=(0,n.useQuery)({queryKey:a,queryFn:i.getClosedDeals,enabled:l&&!!e,staleTime:3e4,refetchInterval:3e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0,retry:!1});return{deals:(0,t.useMemo)(()=>s.data??[],[s.data]),isPending:s.isPending}}])},999965,e=>{"use strict";function t(e){return e?.iana?{timeZone:e.iana}:{}}function n(e){return e?.abbr?` ${e.abbr}`:""}let r=/(Z|[+-]\d{2}:?\d{2})$/i;function i(e){if(!e)return null;let t=e.trim();if(!t)return null;let n=t.includes("T")?t:t.replace(" ","T"),i=new Date(r.test(n)?n:`${n}Z`);return Number.isNaN(i.getTime())?null:i}e.s(["formatAbsolute",0,function(e,r={}){let a=i(e);if(!a)return"";let l=r.includeYear??"auto",s="always"===l||"auto"===l&&a.getFullYear()!==new Date().getFullYear();return a.toLocaleString(void 0,{...t(r.tz),month:"short",day:"numeric",...s?{year:"numeric"}:{},hour:"numeric",minute:"2-digit",hour12:!0})+n(r.tz)},"formatDayBucket",0,function(e){let t=i(e);if(!t)return"";let n=new Date,r=Math.floor((n.getTime()-t.getTime())/6e4);if(r<1)return"Just now";if(r<60)return`${r}m ago`;let a=new Date(n);a.setHours(0,0,0,0);let l=new Date(t);l.setHours(0,0,0,0);let s=Math.round((a.getTime()-l.getTime())/864e5);return s<=0?"Today":1===s?"Yesterday":s<7?`${s} days ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:t.getFullYear()!==n.getFullYear()?"numeric":void 0})},"formatRelative",0,function(e){let t=i(e);if(!t)return"";let n=Math.floor((Date.now()-t.getTime())/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let a=Math.floor(r/24);return a<7?`${a}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})},"formatRelativeCompact",0,function(e){let t=i(e);if(!t)return"";let n=Math.max(0,Math.round((Date.now()-t.getTime())/1e3));if(n<45)return"just now";let r=Math.round(n/60);if(r<60)return`${r}m`;let a=Math.round(r/60);if(a<24)return`${a}h`;let l=Math.round(a/24);return l<7?`${l}d`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})},"formatTime",0,function(e,r){let a=i(e);return a?a.toLocaleTimeString(void 0,{...t(r),hour:"numeric",minute:"2-digit",hour12:!0})+n(r):""},"formatTooltip",0,function(e,r){let a=i(e);return a?a.toLocaleString(void 0,{...t(r),month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})+n(r):""},"isToday",0,function(e,n){let r=i(e);if(!r)return!1;let a=e=>e.toLocaleDateString("en-CA",t(n));return a(r)===a(new Date)}])},56091,472995,327930,e=>{"use strict";var t=e.i(247167),n=e.i(843476),r=e.i(271645),i=e.i(618566),a=e.i(522016),l=e.i(338703),s=e.i(643531),o=e.i(243553),c=e.i(204997),d=e.i(283086),u=e.i(975157),m=e.i(528030),p=e.i(352991),f=e.i(732274),h=e.i(985043),g=e.i(168206),x=e.i(545274),b=e.i(657688),y=e.i(972520),v=e.i(761911),k=e.i(929560),j=e.i(288855);let w=[{label:"Price negotiation",text:"We negotiate the out-the-door price with every dealer for you."},{label:"Financing",text:"Help securing financing and checking the loan terms before you sign."},{label:"Trade-in",text:"Get top dollar for your trade — even with negative equity."},{label:"Paperwork & F&I",text:"Every form and finance-office add-on reviewed line by line."},{label:"At the dealership",text:"A real expert on call while you're at the dealer, start to finish."}];function N({data:e}){let{stats:t}=(0,j.useLiveStats)(),r=t?.totalNegotiations??0,i=t?.averageSavings??0,l=e.eyebrow??`${x.tenantConfig.name} Concierge`,o=e.headline??"Hand it to a 20-year pro. We handle the rest.",c=e.blurb??`A dedicated ${x.tenantConfig.name} expert runs your entire car search — research, dealer outreach, negotiation, paperwork, and delivery. You show up, sign, and drive.`,m="number"==typeof e.price?e.price:999,p=e.cta_primary_label??`Learn more about ${x.tenantConfig.name} Concierge`,f=e.cta_secondary_label??"Get a free consultation",_=k.CONCIERGE_TEAM.slice(0,5);return(0,n.jsxs)("div",{className:(0,u.cn)("copilot-message-enter relative w-full overflow-hidden rounded-2xl border border-primary/20 bg-card"),children:[(0,n.jsxs)("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",children:[(0,n.jsx)("div",{className:"absolute -top-24 -right-16 size-[22rem] rounded-full bg-primary/10 blur-3xl"}),(0,n.jsx)("div",{className:"absolute -bottom-20 -left-12 size-[18rem] rounded-full bg-emerald-400/[0.06] blur-3xl"})]}),(0,n.jsxs)("div",{className:"relative p-5 space-y-4",children:[(0,n.jsxs)("div",{className:"inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-[0.18em] text-primary",children:[(0,n.jsx)(v.Users,{className:"size-3.5","aria-hidden":"true"}),l]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg sm:text-xl font-bold tracking-tight leading-snug text-foreground",children:o}),(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground leading-relaxed",children:c})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"What your concierge handles"}),(0,n.jsx)("ul",{className:"space-y-1.5",children:w.map(e=>(0,n.jsxs)("li",{className:"flex items-start gap-2 text-[13px] leading-snug",children:[(0,n.jsx)(s.Check,{className:"mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400","aria-hidden":"true"}),(0,n.jsxs)("span",{className:"text-foreground",children:[(0,n.jsxs)("span",{className:"font-semibold",children:[e.label,":"]}
1)," ",(0,n.jsx)("span",{className:"text-muted-foreground",children:e.text})]})]},e.label))})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,n.jsx)("div",{className:"flex -space-x-2.5",children:_.map(e=>(0,n.jsx)("div",{className:"relative size-9 overflow-hidden rounded-full ring-2 ring-card shadow-sm",title:e.name,children:(0,n.jsx)(b.default,{src:e.photo,alt:e.name,fill:!0,sizes:"36px",className:"object-cover"})},e.id))}),(0,n.jsxs)("div",{className:"flex flex-col text-[12px] text-muted-foreground leading-tight",children:[(0,n.jsx)("span",{className:"font-semibold text-foreground",children:"20+ years inside dealerships. Now on your side."}),(r>0||i>0)&&(0,n.jsxs)("span",{className:"tabular-nums",children:[r>0&&(0,n.jsxs)(n.Fragment,{children:[r.toLocaleString("en-US")," deals closed"]}),r>0&&i>0&&" · ",i>0&&(0,n.jsxs)(n.Fragment,{children:["avg save $",i>=1e3?`${(i/1e3).toFixed(1).replace(/\.0$/,"")}K`:i.toLocaleString("en-US")]})]})]})]}),(0,n.jsxs)("div",{className:"flex items-baseline justify-between rounded-xl bg-background/60 border border-border px-4 py-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"One-time flat fee"}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"No percentage games. No pushy calls."})]}),(0,n.jsxs)("p",{className:"text-2xl font-bold tabular-nums text-foreground leading-none",children:["$",m.toLocaleString("en-US")]})]}),(0,n.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2.5",children:[(0,n.jsxs)(a.default,{href:"/concierge",prefetch:!1,onClick:()=>(0,h.track)(g.EVENTS.CONCIERGE_LANDING_GET_STARTED,{Location:"Copilot Concierge Card",cta_id:"copilot-concierge-primary"}),className:(0,u.cn)("group inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-full bg-primary text-white px-5 py-2.5 text-sm font-semibold flex-1","shadow-md shadow-primary/15 hover:bg-primary/90 transition-all active:scale-[0.98]"),children:[(0,n.jsx)(d.Sparkles,{className:"size-4 shrink-0","aria-hidden":"true"}),p,(0,n.jsx)(y.ArrowRight,{className:"size-4 arrow-nudge shrink-0","aria-hidden":"true"})]}),(0,n.jsx)(a.default,{href:"/consultation?from=copilot",prefetch:!1,onClick:()=>(0,h.track)(g.EVENTS.CONCIERGE_LANDING_FREE_CONSULTATION,{Location:"Copilot Concierge Card",cta_id:"copilot-concierge-secondary",source:"copilot"}),className:"inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-full border border-border bg-card px-5 py-2.5 text-sm font-semibold text-foreground hover:border-primary hover:text-primary transition-colors flex-1",children:f})]})]})]})}e.s(["ConciergeUpgradeCard",0,N],472995);var _=e.i(338136);function C({messagesUsed:e,dailyLimit:i=15,className:s,aiNegotiatorLimit:d=!1}){let m="ai_negotiator",p=void 0!==e,x=Math.max(i,1),b=p?Math.min(100,Math.round(e/x*100)):0,y=d||p&&e>=x,{isSignedIn:v,isLoaded:k}=(0,l.useAuth)(),{open:j}=(0,f.useAuthModal)(),w=k&&!v,N=(0,r.useRef)(!1);(0,r.useEffect)(()=>{N.current||(N.current=!0,(0,h.track)(g.EVENTS.COPILOT_UPGRADE_VIEWED,{Location:"Upgrade CTA Card",product:m}))},[]);let _=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{!w||d||_.current||(_.current=!0,(0,h.track)(g.EVENTS.COPILOT_SIGNUP_CTA_SHOWN,{Location:"Upgrade CTA Card"}))},[w,d]),(0,n.jsx)("div",{className:(0,u.cn)("copilot-message-enter overflow-hidden",s),children:(0,n.jsx)("div",{className:(0,u.cn)("rounded-2xl border border-amber-500/30 bg-amber-500/5"),children:(0,n.jsxs)("div",{className:"p-5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-10 h-10 rounded-xl bg-amber-500 flex items-center justify-center shrink-0",children:(0,n.jsx)(o.Crown,{className:"w-5 h-5 text-white","aria-hidden":"true"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("h3",{className:"text-base font-semibold text-foreground",children:y?"Daily message limit reached":"Upgrade for unlimited messages"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:d?"Your AI Buying Agent keeps working on active deals in the background — your message quota resets tomorrow.":y?`You've used your ${i} free messages for today. Here are your options to keep going.`:`You're on the free plan with ${i} messages per day. Upgrade to unlock unlimited access.`})]})]}
1),p&&!d&&(0,n.jsxs)("div",{className:"mt-4 border-t border-amber-500/20 pt-4 space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-baseline justify-between text-sm",children:[(0,n.jsx)("span",{className:"font-medium text-foreground",children:"Messages today"}),(0,n.jsxs)("span",{className:"tabular-nums text-foreground",children:[(0,n.jsx)("span",{className:"font-semibold text-amber-700 dark:text-amber-400",children:e.toLocaleString("en-US")}),(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" ","/ ",i.toLocaleString("en-US")]})]})]}),(0,n.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-muted",role:"progressbar","aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":100,children:(0,n.jsx)("div",{className:"h-full rounded-full bg-amber-500 transition-all",style:{width:`${b}%`}})})]}),!d&&(0,n.jsx)("div",{className:"mt-4 flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-amber-500/20 pt-4",children:w?(0,n.jsxs)("button",{type:"button",onClick:()=>{(0,h.track)(g.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Upgrade CTA Card",product:m});let e=void 0!==t.default&&t.default.env.NEXT_PUBLIC_BASE_PATH?t.default.env.NEXT_PUBLIC_BASE_PATH:"",n=window.location.origin;j({isSignIn:!0,source:"Copilot",redirectUrl:`${n}${e}/pricing`})},className:"inline-flex items-center gap-1.5 text-sm font-semibold text-primary hover:underline",children:[(0,n.jsx)(c.LogIn,{className:"size-3.5","aria-hidden":"true"}),"Sign Up or Log In to get more messages →"]}):(0,n.jsx)(a.default,{href:"/checkout/ai-buying-agent?from=copilot",prefetch:!1,className:"text-sm font-semibold text-primary hover:underline",onClick:()=>(0,h.track)(g.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Upgrade CTA Card",product:m}),children:"Upgrade to get more messages →"})})]})})})}e.s(["UpgradeCtaCard",0,C],327930);var S=e.i(683907),E=e.i(227835);let T=["Dealer invoice price","Market value vs MSRP","OTD estimates per dealer","Depreciation and cost-of-ownership data"];function A({message:e,messageCount:i,isSignedIn:l,authLoaded:s,onSignIn:d,onUpgrade:u,sessionId:m}){let{open:p}=(0,f.useAuthModal)(),x=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{x.current||(x.current=!0,(0,h.track)(g.EVENTS.COPILOT_UPGRADE_VIEWED,{Location:"Free Daily Limit Panel",product:"pro"}))},[]),(0,n.jsxs)("div",{className:"copilot-message-enter space-y-4 w-full",children:[(0,n.jsxs)("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-10 h-10 rounded-xl bg-amber-500 flex items-center justify-center shrink-0",children:(0,n.jsx)(o.Crown,{className:"w-5 h-5 text-white"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("h3",{className:"text-base font-semibold text-foreground",children:"Daily message limit reached"}),e&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e})]})]}),i&&(0,n.jsx)("div",{className:"mt-4 border-t border-amber-500/20 pt-4",children:i}),(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-amber-500/20 pt-4",children:[!l&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{(0,h.track)(g.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Free Daily Limit Panel",product:"pro"});let e=void 0!==t.default&&t.default.env.NEXT_PUBLIC_BASE_PATH?t.default.env.NEXT_PUBLIC_BASE_PATH:"",n=window.location.origin;p({isSignIn:!0,redirectUrl:`${n}${e}/pricing`})},className:"inline-flex items-center gap-1.5 text-sm font-semibold text-primary hover:underline",children:[(0,n.jsx)(c.LogIn,{className:"size-3.5","aria-hidden":"true"}),"Sign in"]}),(0,n.jsx)("span",{className:"text-muted-foreground/40","aria-hidden":"true",children:"·"})]}),(0,n.jsx)(a.default,{href:"/pricing",prefetch:!1,onClick:()=>(0,h.track)(g.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Free Daily Limit Panel",product:"pro"}),className:"text-sm font-semibold text-primary hover:underline",children:"Upgrade for more benefits →"})]})]}),(0,n.jsx)(I,{features:T,message:"Get more messages, dealer invoice prices, and OTD intelligence.",isSignedIn:l,authLoaded:s,onSignIn:d,onUpgrade:u,learnMoreHref:"/pro"}),(0,n.jsxs)("div",{className:"flex items-center gap-3 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,n.jsx)("div",{className:"h-px flex-1 bg-border"}),(0,n.jsx)("span",{children:"or have an expert negotiate for you"}),(0,n.jsx)("div",{className:"h-px flex-1 bg-border"})]}),(0,n.jsx)(_.DualUpgradeChoice,{sessionId:m,trigger:"free_daily_limit_panel"})]})}function I({features:e,toolName:t,message:i,isSignedIn:l,authLoaded:u,onSignIn:m,onUpgrade:p,learnMoreHref:f}){let b=i??(t?`Pull ${t} with ${x.tenantConfig.name} Pro.`:`Unlock dealer data with ${x.tenantConfig.name} Pro.`),{betaFormatted:y,fullPrice:v}=(0,E.useAiNegotiatorPricing)(),k=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{k.current||(k.current=!0,(0,h.track)(g.EVENTS.COPILOT_UPGRADE_VIEWED,{Location:"Pro Upgrade Card",product:"pro"}))},[]),(0,n.jsxs)("div",{className:"copilot-message-enter rounded-2xl border-2 border-primary/40 bg-gradient-to-br from-primary/5 via-background to-primary/5 p-5 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"inline-flex items-center gap-1.5 text-xs font-semibold text-primary uppercase tracking-wider mb-2",children:[(0,n.jsx)(o.Crown,{className:"size-3.5","aria-hidden":"true"}),x.tenantConfig.name," Pro"]}),(0,n.jsx)("p",{className:"font-bold text-lg text-foreground leading-tight",children:b})]}),(0,n.jsxs)("div",{className:"text-right flex-shrink-0",children:[(0,n.jsx)("p",{className:"text-2xl font-bold tabular-nums text-foreground leading-none",children:"$49"}),(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5 leading-tight",children:"per month"}),(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground leading-tight",children:"or $99 / year"})]})]}),(0,n.jsx)("div",{className:"grid grid-cols-2 gap-1.5 text-[13px]",children:e.map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-background/60 px-3 py-1.5",children:[(0,n.jsx)(s.Check,{className:"size-3.5 text-primary flex-shrink-0","aria-hidden":"true"}),(0,n.jsx)("span",{className:"text-foreground",children:e})]},e))}),u&&!l?(0,n.jsxs)("button",{onClick:()=>{(0,h.track)(g.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Pro Upgrade Card",product:"pro"}),m()},className:"w-full h-11 rounded-[14px] bg-primary text-white font-semibold text-sm flex items-center justify-center gap-2 border-0 cursor-pointer transition-opacity hover:opacity-90 active:scale-[0.98]",children:[(0,n.jsx)(c.LogIn,{className:"size-4","aria-hidden":"true"}),"Sign in to get Pro"]}):(0,n.jsxs)("button",{onClick:()=>{(0,h.track)(g.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Pro Upgrade Card",product:"pro"}),p()},className:"w-full h-11 rounded-[14px] bg-primary text-white font-semibold text-sm flex items-center justify-center gap-2 border-0 cursor-pointer transition-opacity hover:opacity-90 active:scale-[0.98]",children:[(0,n.jsx)(d.Sparkles,{className:"size-4","aria-hidden":"true"}),"Get ",x.tenantConfig.name," Pro"]}),(0,n.jsxs)("p",{className:"text-[11px] text-center text-muted-foreground",children:["Want us to negotiate for you instead?"," ",(0,n.jsxs)(a.default,{href:"/checkout/ai-buying-agent?from=copilot",prefetch:!1,onClick:()=>(0,h.track)(g.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Pro Upgrade Card",product:"ai_negotiator"}),className:"text-foreground font-medium underline-offset-2 hover:underline",children:["AI Buying Agent ",(0,n.jsxs)("s",{className:"opacity-70",children:["$",v]})," ",y]})]}),f&&(0,n.jsx)("p",{className:"text-[11px] text-center text-muted-foreground",children:(0,n.jsxs)(a.default,{href:f,prefetch:!1,onClick:()=>(0,h.track)(g.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Pro Upgrade Card",product:"pro"}),className:"text-foreground font-medium underline-offset-2 hover:underline",children:["Learn more about ",x.tenantConfig.name," Pro →"]})})]})}function P({used:e,limit:t}){let r=Math.min(100,Math.round(e/Math.max(t,1)*100)),i=e>t;return(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-baseline justify-between text-sm",children:[(0,n.jsx)("span",{className:"font-medium text-foreground",children:"Messages today"}),(0,n.jsxs)("span",{className:"tabular-nums text-foreground",children:[(0,n.jsx)("span",{className:(0,u.cn)("font-semibold",i&&"text-amber-700 dark:text-amber-400"),children:e.toLocaleStr
1ing("en-US")}),(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" ","/ ",t.toLocaleString("en-US")]})]})]}),(0,n.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-muted",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:(0,n.jsx)("div",{className:(0,u.cn)("h-full rounded-full transition-all",i?"bg-amber-500":"bg-primary"),style:{width:`${r}%`}})})]})}e.s(["PaymentCard",0,function({data:e,sessionId:a,onPaymentComplete:s,force:c=!1,suppressNegotiationUpsell:d=!1}){let u=(0,i.useRouter)(),{isSignedIn:x,isLoaded:b}=(0,l.useAuth)(),{isPro:y,isLoaded:v}=(0,m.useProStatus)(),{additionalPlans:k}=(0,p.useNavData)(),{open:j}=(0,f.useAuthModal)(),w=y||k.aiNegotiator.active,E="pro_daily_limit"===e.reason,L="ai_negotiator_daily_limit"===e.reason,D=(0,r.useRef)(!1);(0,r.useEffect)(()=>{v&&w&&("message_limit"===e.reason||"free_daily_limit"===e.reason||"ai_negotiator_daily_limit"===e.reason||"pro_daily_limit"===e.reason)&&(D.current||(D.current=!0,(0,h.track)(g.EVENTS.COPILOT_DAILY_LIMIT_SHOWN)))},[v,w,e.reason]);let M="message_limit"===e.reason||"free_daily_limit"===e.reason||L||E,O=M&&"number"==typeof e.daily_messages&&"number"==typeof e.daily_limit?(0,n.jsx)(P,{used:e.daily_messages,limit:e.daily_limit}):null;return v&&w&&M?(0,n.jsx)("div",{className:"copilot-message-enter rounded-2xl border border-amber-500/30 bg-amber-500/5 overflow-hidden",children:(0,n.jsxs)("div",{className:"p-5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-10 h-10 rounded-xl bg-amber-500 flex items-center justify-center shrink-0",children:(0,n.jsx)(o.Crown,{className:"w-5 h-5 text-white"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("h3",{className:"text-base font-semibold text-foreground",children:L?"AI Buying Agent daily limit reached":"Daily message limit reached"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:L?"Your AI Buying Agent keeps working on active deals in the background — your message quota resets tomorrow.":"You've reached your daily message limit. Your limit resets tomorrow."})]})]}),O&&(0,n.jsx)("div",{className:"mt-4 border-t border-amber-500/20 pt-4",children:O})]})}):"ai_negotiator"===e.required_sku&&v&&k.aiNegotiator.active||"ai_negotiator"!==e.required_sku&&v&&w&&!c||c&&k.aiNegotiator.active?null:"ai_negotiator"===e.required_sku?d?null:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(_.DualUpgradeChoice,{sessionId:a,compactOnMobile:!0,trigger:"tool_gate_ai_negotiator"}),(0,n.jsx)(S.PendingVehicleQuotesOffer,{})]}):x&&!w?(0,n.jsx)(C,{messagesUsed:"number"==typeof e.daily_messages?e.daily_messages:void 0,dailyLimit:"number"==typeof e.daily_limit?e.daily_limit:void 0}):"concierge"===e.required_sku?(0,n.jsx)(N,{data:{headline:e.message}}):"pro"===e.required_sku?(0,n.jsx)(I,{features:e.features??T,toolName:e.tool_name,message:e.message,isSignedIn:!!x,authLoaded:b,onSignIn:()=>j({isSignIn:!0,redirectUrl:`${window.location.origin}${t.default.env.NEXT_PUBLIC_BASE_PATH??""}/checkout/pro?from=copilot`}),onUpgrade:()=>u.push("/checkout/pro?from=copilot")}):"free_daily_limit"===e.reason?(0,n.jsx)(A,{message:e.message,messageCount:O,isSignedIn:!!x,authLoaded:b,onSignIn:()=>j({isSignIn:!0,redirectUrl:`${window.location.origin}${t.default.env.NEXT_PUBLIC_BASE_PATH??""}/checkout/pro?from=copilot`}),onUpgrade:()=>u.push("/checkout/pro?from=copilot"),sessionId:a}):d?null:(0,n.jsx)(_.DualUpgradeChoice,{sessionId:a,compactOnMobile:!0,trigger:"tool_gate_default"})}],56091)},280566,e=>{"use strict";var t=e.i(173024);e.s(["CircleDashed",()=>t.default])},206165,249598,195524,207627,366098,577550,968915,251242,905682,754015,632213,124285,148697,379304,567510,705942,169289,617365,304615,301942,697972,419218,881256,571811,861150,446773,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(975157),i=e.i(847283),a=e.i(545274);let l={parse_vehicle_link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",research_vehicle_value:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z",analyze_deal:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",draft_negotiation_message:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.25
15-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",check_vehicle_history:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4",search_caredge_inventory:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",get_window_sticker:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",lookup_dealer_transparency:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",predict_otd_price:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z",get_vehicle_features:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2M9 12h6M9 16h4",create_dealer_inquiry:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",estimate_trade_in:"M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5",start_negotiation:"M13 10V3L4 14h7v7l9-11h-7z",submit_dealer_website_form:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9",web_search:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"};e.s(["ToolCallIndicator",0,function({toolCall:e,shimmerIndex:s=0,awaitsApproval:o=!1}){let c="running"===e.status,d=e.display_name?.replace(/CarEdge/g,a.tenantConfig.name),u="blocked"===e.status,m=e.result,p=!c&&!u&&(m?.needs_confirmation===!0||m?.needs_details_confirmation===!0),f=!c&&!u&&o,h=!c&&!u&&("failed"===e.status||"string"==typeof m?.error),g=p||f||h,x=h&&"string"==typeof m?.shopper_message?m.shopper_message:null,b=l[e.tool_name]??l.analyze_deal,y=function(e,t){let[r,a]=(0,n.useState)(0),l=i.TOOL_STATUS_MESSAGES[e];return((0,n.useEffect)(()=>{if(!t||!l)return;a(0);let e=setInterval(()=>{a(e=>(e+1)%l.length)},2400);return()=>clearInterval(e)},[t,l]),t&&l)?l[r]:null}(e.tool_name,c),v=c?s<i.SHIMMER_CAP?"copilot-shimmer":"copilot-shimmer-simple":"";return(0,t.jsxs)("div",{className:(0,r.cn)("copilot-message-enter flex items-center gap-2 sm:gap-3 px-3 sm:px-4 py-2.5 rounded-lg border",c?`border-primary/30 bg-primary/5 ${v}`:u||g?"border-amber-500/30 bg-amber-500/5":"border-border bg-muted/50"),children:[(0,t.jsx)("div",{className:(0,r.cn)("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",c?"bg-primary/20":g?"bg-amber-500/20":"bg-emerald-500/20"),children:c?(0,t.jsxs)("svg",{className:"w-4 h-4 text-primary animate-spin",fill:"none",viewBox:"0 0 24 24",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-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):(0,t.jsx)("svg",{className:(0,r.cn)("w-4 h-4",g?"text-amber-500":"text-emerald-500"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:b})})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:(0,r.cn)("block truncate text-sm font-medium",c?"text-primary":"text-foreground"),children:d}),c&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 truncate transition-opacity duration-300",children:function(e){let t=e.toolArgs;if(!t)return null;switch(e.tool_name){case"search_caredge_inventory":{let e=[];return t.make&&e.push(String(t.make)),t.model&&e.push(String(t.model)),t.zip_code&&e.push(`near ${t.zip_code}`),e.length>0?e.join(" "):null}case"analyze_deal":case"research_vehicle_value":{let e=[];return t.year&&e.push(String(t.year)),t.make&&e.push(String(t.make)),t.model&&e.push(String(t.model)),e.length>0?e.join(" "):null}case"lookup_dealer_transparency":return t.dealer_name?String(t.dealer_name):null;case"get_vehicle_features":{let e=[];return t.make&&e.push(String(t.make)),t.model&&e.push(String(t.model)),e.length>0?`Checking features for ${e.join(" ")}`:null}default:return null}}(e)||y}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:x})]}),!c&&(0,t.jsx)("span",{className:(0,r.cn)("text-[11px] font-medium px-2 py-0.5 rounded-full whitespace-nowrap",u||g?"text-amber-600 dar
1k:text-amber-400 bg-amber-500/10":"text-emerald-600 dark:text-emerald-400 bg-emerald-500/10"),children:u?"AI Buying Agent":f?"Needs your OK":p?"Needs confirmation":h?"Didn't complete":"Done"})]})}],206165);var s=e.i(643531),o=e.i(664659),c=e.i(655900),d=e.i(778917),u=e.i(531278),m=e.i(522016),p=e.i(846696),f=e.i(967489),h=e.i(846254),g=e.i(685703),x=e.i(484092);function b(e,t,n,r){for(let i=0;i<n&&e.length<r;i++){let n=!1;for(let a of t)if(!(i>=a.length)&&(e.push(a[i]),n=!0,e.length>=r))return;if(!n)return}}var y=e.i(740348),v=e.i(839165),k=e.i(825405),j=e.i(952632),w=e.i(909200);function N({label:e="Loading listings…"}){return(0,t.jsx)("div",{className:"w-full flex items-center justify-center py-4","aria-live":"polite","aria-busy":"true",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2.5 rounded-full border border-border bg-muted/40 px-3.5 py-1.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1","aria-hidden":"true",children:[(0,t.jsx)("span",{className:"size-1.5 rounded-full bg-muted-foreground/60 animate-pulse [animation-delay:-0.3s]"}),(0,t.jsx)("span",{className:"size-1.5 rounded-full bg-muted-foreground/60 animate-pulse [animation-delay:-0.15s]"}),(0,t.jsx)("span",{className:"size-1.5 rounded-full bg-muted-foreground/60 animate-pulse"})]}),(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:e})]})})}e.s(["VehicleSkeletonGrid",0,N],249598);let _=[100,200,300,400,500],C=[{value:"distance_asc",label:"Distance: Nearest"},{value:"price_asc",label:"Selling Price: Low to High",conditions:["new"]},{value:"price_desc",label:"Selling Price: High to Low",conditions:["new"]},{value:"msrp_asc",label:"MSRP: Low to High",conditions:["new"]},{value:"msrp_desc",label:"MSRP: High to Low",conditions:["new"]},{value:"price_asc",label:"Price: Low to High",conditions:["used","certified"]},{value:"price_desc",label:"Price: High to Low",conditions:["used","certified"]},{value:"year_desc",label:"Year: Newest"},{value:"year_asc",label:"Year: Oldest"},{value:"mileage_asc",label:"Mileage: Lowest",conditions:["used","certified"]},{value:"mileage_desc",label:"Mileage: Highest",conditions:["used","certified"]},{value:"dos_active_asc",label:"Days on Market: Newest"},{value:"dos_active_desc",label:"Days on Market: Oldest"}];function S(e,t){let n=e.dealer_name?.toLowerCase().trim()??"";return!!n&&t(n,e.dealer_id??void 0)}function E(e,t,n){if("new"!==e||null!=t||null!=n)return{yearMin:t,yearMax:n};let r=new Date().getFullYear();return{yearMin:r-1,yearMax:r+1}}function T(e,t){return{compact:!0,year:e.year,make:e.make,model:e.model,trim:e.trim,vin:e.vin,mileage:e.mileage,price_cents:null!=e.price?Math.round(100*e.price):void 0,condition:t,image_url:e.photo_url,dealer_name:e.dealer_name,city:e.city,state:e.state,days_on_market:e.dos_active??e.dom_active,dealer_vdp_url:e.dealer_vdp_url,bounty:e.bounty,carfax_1_owner:e.carfax_1_owner,carfax_clean_title:e.carfax_clean_title,is_certified:e.is_certified}}let A=(0,n.memo)(function({vehicle:e,onAnalyze:n,conciergeShare:i,isNegotiating:a,onShare:l,onWidgetCta:o,select:c,dtiInfo:d}){let u=!!c&&!!e.vin,m=!!u&&c.selectedVins.has(e.vin),p=u&&!!c.disabledVins?.has(e.vin.toUpperCase()),f=u&&!m&&!!c.atCap,h=p||f;return(0,t.jsxs)("div",{className:"relative flex flex-col h-full",children:[(0,t.jsx)(k.VehicleCard,{vehicle:e,inGrid:!0,onAnalyze:n,conciergeShare:i,isNegotiating:a,onShare:l,onWidgetCta:o,dtiInfo:d}),u&&(0,t.jsx)("button",{type:"button","aria-pressed":m,disabled:h,"aria-label":p?"Already negotiating this vehicle":m?"Deselect listing":"Select listing",onClick:()=>c.onToggle(e),className:(0,r.cn)("absolute inset-0 z-20 rounded-xl transition-colors",m?"ring-2 ring-primary bg-primary/5":h?"cursor-not-allowed bg-background/60":"ring-1 ring-transparent hover:ring-primary/40 hover:bg-primary/5"),children:p?(0,t.jsx)("span",{className:"absolute top-2 right-2 rounded-full border border-border bg-background/90 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Already negotiating"}):(0,t.jsx)("span",{className:(0,r.cn)("absolute top-2 right-2 flex size-6 items-center justify-center rounded-full border transition-colors",m?"bg-primary border-primary text-primary-foreground":"bg-background/90 border-border"),children:m&&(0,t.jsx)(s.Check,{className:"size-3.5","aria-hidden":"true"})})})]})});e.s(["VehicleCardGroup",0,function({vehicles:e,label:l,defaultExpanded:s=!1,onAnalyze:k,conciergeShare:I,negotiatingVin:P,onShare:L,shareSelect:D,onNegotiateMany:M,negotiationBusy:O,alreadyNegotiatingVins:R,userZip:
1F,onWidgetCta:$,initialSort:U,yearMin:z,yearMax:B,priceMin:V,priceMax:H,radius:W,mileageMax:q,exteriorColor:G,interiorColor:K,bodyType:Y,trim:Z,partnerOnly:X,includeInTransit:Q,onDisplayedVehiclesChange:J}){let{isCaredgeCertified:ee}=(0,y.usePartnerDealers)(),et=(0,j.useConciergeActing)(),[en,er]=(0,n.useState)(U??"distance_asc"),[ei,ea]=(0,n.useState)(W??i.DEFAULT_SEARCH_RADIUS_MILES),el=(0,n.useRef)(ei);(0,n.useEffect)(()=>{el.current=ei},[ei]);let[es,eo]=(0,n.useState)(e),ec=(0,n.useRef)(e.length);(0,n.useEffect)(()=>{ec.current=e.length},[e.length]);let[ed,eu]=(0,n.useState)(e.length),[em,ep]=(0,n.useState)([]),[ef,eh]=(0,n.useState)(!1),eg=(0,n.useRef)(null),[ex,eb]=(0,n.useState)(!1),[ey,ev]=(0,n.useState)(()=>new Set),[ek,ej]=(0,n.useState)(!1),ew=(0,n.useCallback)(()=>{eb(!1),ev(new Set)},[]),eN=(0,n.useRef)({vehicles:e,userZip:F,initialSort:U,yearMin:z,yearMax:B,priceMin:V,priceMax:H,radius:W}),[e_,eC]=(0,n.useState)(s?Number.MAX_SAFE_INTEGER:6),eS=(0,n.useCallback)(e=>{null!=q&&e.set("mileage_max",String(q)),G&&e.set("exterior_color",G),K&&e.set("interior_color",K),Y&&e.set("body_type",Y),Z&&e.set("trim",Z),X&&e.set("partner_only","true"),e.set("include_in_transit",!1===Q?"false":"true")},[q,G,K,Y,Z,X,Q]);(0,n.useEffect)(()=>()=>{eg.current?.abort()},[]),(0,n.useEffect)(()=>{if((0,g.isWidgetSession)()||a.IS_FAIRAUTO)return;let{vehicles:e,userZip:t,initialSort:n}=eN.current;if(n&&"distance_asc"!==n)return;let r=e[0];if(!r?.make)return;eg.current?.abort();let i=new AbortController;eg.current=i,eh(!0),eC(6);let{yearMin:l,yearMax:s}=E(r.condition,z,B),o=new URLSearchParams;return r.condition&&o.set("condition",r.condition),o.set("make",r.make),e.every(e=>e.model===r.model)&&r.model&&o.set("model",r.model),t&&o.set("zip",t),null!=l&&o.set("year_min",String(l)),null!=s&&o.set("year_max",String(s)),null!=V&&o.set("price_min",String(V)),null!=H&&o.set("price_max",String(H)),o.set("radius",String(el.current)),o.set("sort","distance_asc"),o.set("per_page","60"),eS(o),fetch((0,h.apiUrl)(`/api/search?${o.toString()}`),{signal:i.signal}).then(async t=>{if(!t.ok)throw Error(`Search failed: ${t.status}`);let n=await t.json();i.signal.aborted||(n.hits?.length&&(eo(n.hits.map(e=>T(e,r.condition))),eu(e.length)),ep((n.pinned??[]).map(e=>T(e,r.condition))))}).catch(e=>{e instanceof Error&&"AbortError"!==e.name&&console.error("[VehicleCardGroup] initial distance fetch failed:",e)}).finally(()=>{i.signal.aborted||eh(!1)}),()=>i.abort()},[z,B,V,H,eS]),e.length>ed&&(eu(e.length),eo(t=>{let n=new Set(t.map(e=>e.vin).filter(Boolean)),r=e.filter(e=>!e.vin||!n.has(e.vin));return r.length?[...t,...r]:t}));let eE=(0,n.useCallback)(async(e,t,n)=>{let r=es[0];if(!r?.make)return null;let i=new URLSearchParams;r.condition&&i.set("condition",r.condition),i.set("make",r.make),es.every(e=>e.model===r.model)&&r.model&&i.set("model",r.model),F&&i.set("zip",F);let{yearMin:a,yearMax:l}=E(r.condition,z,B);null!=a&&i.set("year_min",String(a)),null!=l&&i.set("year_max",String(l)),null!=V&&i.set("price_min",String(V)),null!=H&&i.set("price_max",String(H)),i.set("radius",String(t)),i.set("sort",e),i.set("per_page","60"),eS(i);let s=await fetch((0,h.apiUrl)(`/api/search?${i.toString()}`),{signal:n});if(!s.ok)throw Error(`Search failed: ${s.status}`);let o=await s.json();return{hits:o.hits??[],pinned:o.pinned??[],condition:r.condition}},[es,F,z,B,V,H,eS]),eT=es[0]?.condition,eA=C.filter(e=>!e.conditions||!eT||e.conditions.includes(eT)),eI="new"===eT,eP=(0,n.useMemo)(()=>{var e;let t="distance_asc"===en?es:function(e,t){switch(t){case"price_asc":case"msrp_asc":return[...e].sort((e,t)=>null==e.price_cents?1:null==t.price_cents?-1:e.price_cents-t.price_cents);case"price_desc":case"msrp_desc":return[...e].sort((e,t)=>null==e.price_cents?1:null==t.price_cents?-1:t.price_cents-e.price_cents);case"mileage_asc":return[...e].sort((e,t)=>null==e.mileage?1:null==t.mileage?-1:e.mileage-t.mileage);case"mileage_desc":return[...e].sort((e,t)=>null==e.mileage?1:null==t.mileage?-1:t.mileage-e.mileage);case"year_desc":return[...e].sort((e,t)=>null==e.year?1:null==t.year?-1:t.year-e.year);case"year_asc":return[...e].sort((e,t)=>
1null==e.year?1:null==t.year?-1:e.year-t.year);case"dos_active_asc":return[...e].sort((e,t)=>null==e.days_on_market?1:null==t.days_on_market?-1:e.days_on_market-t.days_on_market);case"dos_active_desc":return[...e].sort((e,t)=>null==e.days_on_market?1:null==t.days_on_market?-1:t.days_on_market-e.days_on_market);default:return[...e]}}(es,en),n=(e=eI?function(e,{capPerDealer:t,max:n,isCertified:r,certifiedCap:i=10}){if(e.length<=1)return e.slice(0,n);let a=new Map;for(let t of e){let e=t.dealer_name??"__no_dealer__",n=a.get(e);n?n.push(t):a.set(e,[t])}let l=[...a.values()];if(1===l.length)return l[0].slice(0,n);let s=[],o=[];for(let e of l)r?.(e[0])?s.push(e):o.push(e);let c=1===s.length?1/0:i,d=[];return b(d,s,c,n),b(d,o,t,n),d}(t,{capPerDealer:6,max:30,certifiedCap:10,isCertified:e=>S(e,ee)}):t.slice(0,30),[...e].sort((e,t)=>!S(e,ee)-!S(t,ee)));if(0===em.length)return n;let r=new Set(em.map(e=>e.vin));return[...em,...n.filter(e=>!r.has(e.vin))].slice(0,30)},[es,em,en,eI,ee]);(0,n.useEffect)(()=>{J?.(eP)},[eP,J]);let eL=eP.length,eD=l??function(e,t){if((0,g.isWidgetSession)())return(0,x.widgetInventoryLabel)(e,(0,g.getWidgetDealer)()?.name);let n=e.length;if(0===n)return"Vehicle listings";let r=e[0].make,i=e[0].model,a=r&&i&&e.every(e=>e.make===r&&e.model===i)?`${n} ${r} ${i} listing${1===n?"":"s"}`:`${n} vehicle listing${1===n?"":"s"}`,l=t?` near ${t}`:"";return`${a}${l}`}(eP,F),eM=Math.min(e_,eL),eO=eP.slice(0,eM),eR=eP.filter(e=>e.vin&&ey.has(e.vin)),eF=eR.length>=i.MAX_BULK_NEGOTIATE,e$=(0,n.useMemo)(()=>new Set(eP.map(e=>e.vin).filter(e=>!!e)),[eP]),eU=(0,n.useCallback)(e=>{let t=e.vin;t&&ev(e=>{let n=new Set(e);return n.has(t)?(n.delete(t),n):[...n].filter(e=>e$.has(e)).length>=i.MAX_BULK_NEGOTIATE?e:(n.add(t),n)})},[e$]),ez=!!M&&!!k&&!D&&!(0,g.isWidgetSession)()&&!a.IS_FAIRAUTO&&eP.filter(e=>e.vin).length>=2,eB=async()=>{if(!ek&&0!==eR.length&&!O){ej(!0);try{await M?.(eR),ew()}catch{p.toast.error("Couldn't set those up. Please try again.")}finally{ej(!1)}}},eV=(()=>{let e=new Map;for(let t of eO){if(!S(t,ee)||!t.dealer_name)continue;let n=t.state??null,r=t.dealer_id??null,i=`${t.dealer_name}|${n??""}|${r??""}`;e.has(i)||e.set(i,{name:t.dealer_name,state:n,dealerId:r})}return[...e.values()]})(),{data:eH}=(0,v.useDealerTransparencyBatch)(eV);if(!ef&&0===eL)return null;let eW=Math.min(20,eL),eq=eM<eW,eG=!eq&&eM<eL,eK=async e=>{if(e===en)return;er(e),eg.current?.abort();let t=new AbortController;eg.current=t,eh(!0),eC(6);try{let n=await eE(e,ei,t.signal);n&&(n.hits.length&&(eo(n.hits.map(e=>T(e,n.condition))),eu(ec.current)),ep(n.pinned.map(e=>T(e,n.condition))))}catch(e){e instanceof Error&&"AbortError"!==e.name&&console.error("[VehicleCardGroup] sort refetch failed:",e)}finally{t.signal.aborted||eh(!1)}},eY=async e=>{if(e===ei)return;ea(e),eg.current?.abort();let t=new AbortController;eg.current=t,eh(!0),eC(6);try{let n=await eE(en,e,t.signal);n&&(eo(n.hits.map(e=>T(e,n.condition))),eu(ec.current),ep(n.pinned.map(e=>T(e,n.condition))))}catch(e){e instanceof Error&&"AbortError"!==e.name&&console.error("[VehicleCardGroup] radius refetch failed:",e)}finally{t.signal.aborted||eh(!1)}},eZ=function(e,t,n={}){if(0===e.length)return"/shop-cars";let r=e[0],i=e.every(e=>e.make===r.make),l=e.every(e=>e.model===r.model),s=null!=r.trim&&e.every(e=>e.trim===r.trim),o=n.trim??(i&&l&&s?r.trim:void 0),{yearMin:c,yearMax:d}=E(r.condition,n.yearMin,n.yearMax),u=new URLSearchParams;r.condition&&u.set("condition",r.condition),i&&r.make&&u.set("make",r.make),i&&l&&r.model&&u.set("model",r.model),o&&u.set("trim",o),t&&u.set("zip",t),null!=c&&u.set("year_min",String(c)),null!=d&&u.set("year_max",String(d)),null!=n.priceMin&&u.set("price_min",String(n.priceMin)),null!=n.priceMax&&u.set("price_max",String(n.priceMax)),null!=n.radius&&u.set("radius",String(n.radius)),null!=n.mileageMax&&u.set("mileage_max",String(n.mileageMax)),n.exteriorColor&&u.set("exterior_color",n.exteriorColor),n.interiorColor&&u.set("interior_color",n.interiorColor),n.bodyType&&u.set("body_type",n.bodyType),n.partnerOnly&&u.set("partner_only","true");let m=u.toString(),p=m?`/shop-cars?${m}`:"/shop-cars";return`https://${a.tenantConfig.domain}${p}`}(es,F,{yearMin:z,yearMax:B,priceMin:V,priceMax:H,radius:ei,mileageMax:q,exterior
1Color:G,interiorColor:K,bodyType:Y,trim:Z,partnerOnly:X}),eX=(0,w.withActingParams)(eZ,et);return(0,t.jsxs)("div",{className:"w-full flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:eD}),!(0,g.isWidgetSession)()&&!a.IS_FAIRAUTO&&e.length>=2&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(f.Select,{value:String(ei),onValueChange:e=>{eY(Number(e))},children:[(0,t.jsx)(f.SelectTrigger,{className:"w-[90px] h-7 text-xs",size:"sm","aria-label":"Search radius",children:(0,t.jsx)(f.SelectValue,{})}),(0,t.jsx)(f.SelectContent,{position:"popper",side:"bottom",align:"end",sideOffset:4,children:_.map(e=>(0,t.jsxs)(f.SelectItem,{value:String(e),className:"text-xs",children:[e," mi"]},e))})]}),(0,t.jsxs)(f.Select,{value:en,onValueChange:e=>{eK(e)},children:[(0,t.jsx)(f.SelectTrigger,{className:"w-[190px] h-7 text-xs",size:"sm","aria-label":"Sort results",children:(0,t.jsx)(f.SelectValue,{})}),(0,t.jsx)(f.SelectContent,{position:"popper",side:"bottom",align:"end",sideOffset:4,children:eA.map(e=>(0,t.jsx)(f.SelectItem,{value:e.value,className:"text-xs",children:e.label},e.label))})]})]})]}),ez&&!ex&&(0,t.jsx)("div",{className:"flex justify-start",children:(0,t.jsx)("button",{type:"button",onClick:()=>eb(!0),disabled:O,title:O?"Wait for the reply to finish":void 0,className:(0,r.cn)(O&&"cursor-not-allowed opacity-50","copilot-pulse-3 inline-flex min-h-[44px] items-center gap-1.5","rounded-full border border-primary/30 bg-primary/5 px-3.5 py-1.5","text-xs font-medium text-primary","transition-colors duration-150 hover:border-primary/50 hover:bg-primary/15","focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2","focus-visible:ring-offset-background focus-visible:outline-none"),children:"Negotiate several"})}),ez&&ex&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 rounded-xl border border-primary/30 bg-primary/5 px-3 py-2",children:[(0,t.jsxs)("p",{className:"min-w-0 flex-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[eR.length," selected"]}),O?" · we'll start these once the reply finishes":eF?` \xb7 that's the most we can start at once (${i.MAX_BULK_NEGOTIATE})`:` \xb7 tap listings to pick up to ${i.MAX_BULK_NEGOTIATE}`]}),(0,t.jsx)("button",{type:"button",onClick:ew,disabled:ek,className:"min-h-[44px] rounded-full px-3 text-xs text-muted-foreground hover:text-foreground",children:"Cancel"}),(0,t.jsxs)("button",{type:"button",onClick:()=>void eB(),disabled:ek||0===eR.length||O,"aria-busy":ek,className:(0,r.cn)("inline-flex min-h-[44px] items-center gap-1.5 rounded-full px-3.5 py-1.5","bg-primary text-xs font-medium text-primary-foreground","hover:bg-primary/90 transition-colors duration-150","focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2","focus-visible:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-60"),children:[ek&&(0,t.jsx)(u.Loader2,{className:"size-3.5 animate-spin","aria-hidden":"true"}),ek?"Setting up…":"Start negotiations"]})]}),ef&&0===eP.length?(0,t.jsx)(N,{label:"Sorting listings…"}):(0,t.jsxs)(t.Fragment,{children:[ef&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",role:"status","aria-live":"polite",children:"Updating listings…"}),(0,t.jsx)("div",{className:(0,r.cn)("grid gap-3 transition-opacity",ef&&"opacity-60",(0,g.isWidgetSession)()?"grid-cols-1":"grid-cols-1 sm:grid-cols-2 md:grid-cols-3"),children:eO.map((e,n)=>(0,t.jsx)("div",{className:"copilot-stagger-enter h-full",children:(0,t.jsx)(A,{vehicle:e,onAnalyze:(0,g.isWidgetSession)()?void 0:k,conciergeShare:I,isNegotiating:!!e.vin&&e.vin===P,onShare:L,onWidgetCta:$,select:D??(ex?{selectedVins:ey,onToggle:eU,disabledVins:R,atCap:eF}:void 0),dtiInfo:e.dealer_name?eH?.[(0,v.dealerBatchKey)(e.dealer_name,e.state,e.dealer_id)]??null:null})},e.vin??n))}),(eq||eG||eM>6)&&(0,t.jsx)("div",{className:"flex justify-center mt-1",children:(0,t.jsx)("button",{onClick:eq?()=>eC(eW):eG?()=>eC(eL):()=>eC(6),className:(0,r.cn)("inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full min-h-[44px]","border border-border bg-background text-xs text-muted-foreground","hover:bg-muted hover:text-foreground hover:border-primary/30","transition-colors duration-150 focus-visible:outline-none","focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2","focus-visible:ring-offset-background"),"aria-expanded":!eq&&!eG,children:eq?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.ChevronDown,{className:"w-3.5 h-3.5"}),"Show more"]}):eG?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.ChevronDown,{className:"w-3.5 h-3.5"}),"Show even more"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.ChevronUp,{className:"w-3.5 h-3.5"}),"Show less"]})})})]}),!(0,g.isWidgetSession)()&&(0,t.jsx)("div",{className:"flex justify-end mt-1",children:(0,t.jsxs)(m.default,{href:eX,prefetch:!1,target:"_blank",rel:"noopener noreferrer","data-see-more":!0,className:"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline transition-colors",children:[(0,t.jsx)(d.Exter
1nalLink,{className:"w-3 h-3"}),"See all listings on ",a.tenantConfig.name]})})]})}],195524);var I=e.i(618566),P=e.i(283086),L=e.i(985043),D=e.i(168206);function M(e){return e?`$${(e/100).toLocaleString("en-US",{maximumFractionDigits:0})}`:"N/A"}function O({label:e,value:n,highlight:i,green:a}){return(0,t.jsxs)("div",{className:(0,r.cn)("rounded-lg px-3 py-2.5 text-center",i?"bg-primary/10 border border-primary/30":a?"bg-emerald-500/10 border border-emerald-500/20":"bg-muted"),children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:e}),(0,t.jsx)("div",{className:(0,r.cn)("text-base font-bold tabular-nums",i?"text-primary":a?"text-emerald-600 dark:text-emerald-400":"text-foreground"),children:n})]})}e.s(["DealAnalysisCard",0,function({analysis:e}){let l,s=(0,I.useRouter)(),o=i.RATING_CONFIG[e.deal_rating??""]??i.RATING_CONFIG.fair,c=e.deal_score??50,d=!0===e.teaser,u=(0,n.useRef)(!1);(0,n.useEffect)(()=>{d&&!u.current&&(u.current=!0,(0,L.track)(D.EVENTS.COPILOT_BLUR_VIEWED,{Location:"Deal Analysis Card",product:"pro"}),(0,L.track)(D.EVENTS.COPILOT_UPGRADE_VIEWED,{Location:"Deal Analysis Card",product:"pro"}))},[d]);let m=2*Math.PI*45;return(0,t.jsx)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:(0,t.jsxs)("div",{className:"p-4 @sm:p-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 @sm:gap-5 mb-4",children:[(0,t.jsxs)("div",{className:"relative w-24 h-24 @sm:w-28 @sm:h-28 shrink-0",children:[(0,t.jsxs)("svg",{className:"w-24 h-24 @sm:w-28 @sm:h-28 -rotate-90",viewBox:"0 0 100 100",role:"img","aria-label":`Deal score: ${c} out of 100, rated ${o.label}`,children:[(0,t.jsx)("circle",{cx:"50",cy:"50",r:45,fill:"none",stroke:"currentColor",strokeWidth:"8",className:"text-muted"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:45,fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:m,strokeDashoffset:m-c/100*m,className:(0,r.cn)("copilot-score-ring",c>=70?"stroke-emerald-500 dark:stroke-emerald-400":c>=40?"stroke-amber-500 dark:stroke-amber-400":"stroke-red-500 dark:stroke-red-400")})]}),(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[(0,t.jsx)("span",{className:"text-3xl @sm:text-4xl font-bold text-foreground tabular-nums leading-none",children:c}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mt-0.5",children:"score"})]})]}),(0,t.jsxs)("div",{className:"flex-1",children:[(l=o.icon,(0,t.jsxs)("span",{className:(0,r.cn)("inline-flex items-center gap-1.5 text-sm font-semibold px-3 py-1 rounded-full mb-2",o.bg,o.color),children:[(0,t.jsx)(l,{className:"w-4 h-4"}),o.label]})),e.summary&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e.summary})]})]}),d?(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("div",{className:"blur-[6px] pointer-events-none select-none","aria-hidden":!0,children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[(0,t.jsx)(O,{label:"Market Value",value:"$ — "}),(0,t.jsx)(O,{label:"Suggested Offer",value:"$ — ",highlight:!0}),(0,t.jsx)(O,{label:"Savings Potential",value:"$ — ",green:!0})]}),(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Negotiation Tips"}),(0,t.jsx)("ul",{className:"space-y-1",children:["Leverage the days on market to negotiate a lower price.","Ask for a dealer fee breakdown before signing.","Request competing quotes from nearby dealers."].map((e,n)=>(0,t.jsxs)("li",{className:"text-sm text-foreground flex items-start gap-2",children:[(0,t.jsx)("span",{className:"text-primary mt-0.5 shrink-0",children:"→"}),e]},n))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wider text-red-500/80 mb-2",children:"Red Flags"}),(0,t.jsx)("ul",{className:"space-y-1",children:["Price above regional market average.","Extended days on market may indicate issues."].map((e,n)=>(0,t.jsxs)("li",{className:"text-sm text-red-600 dark:text-red-400 flex items-start gap-2",children:[(0,t.jsx)("span",{className:"mt-0.5 shrink-0",children:"⚠"}),e]},n))})]})]}),(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-background/80 backdrop-blur-sm rounded-xl",children:[(0,t.jsxs)("p",{className:"text-sm font-medium text-foreground text-center px-4",children:["Unlock the full analysis with ",a.tenantConfig.name," Pro"]}),(0,t.jsxs)("button",{onClick:()=>{(0,L.track)(D.EVENTS.COPILOT_BLUR_CLICKED,{Location:"Deal Analysis Card",product:"pro"}),(0,L.track)(D.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Deal Analysis Card",product:"pro"}),s.push("/checkout/pro?from=copilot")},className:(0,r.cn)("flex items-center gap-1.5 min-h-[44px] px-4 py-2.5 rounded-xl text-sm font-semibold","bg-primary text-primary-foreground hover:bg-primary/90","transition-all duration-200 active:scale-[0.98]"),children:[(0,t.jsx)(P.Sparkles,{className:"w-3.5 h-3.5"}),"Unlock full analysis"]})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[(0,t.jsx)(O,{label:"Market Value",value:M(e.fair_market_value_cents)}),(0,t.jsx)(O,{label:"Suggested Offer",value:M(e.suggested_offer_cents),highlight:!0}),(0,t.jsx)(O,{label:"Savings Potential",value:M(e.savings_potential_cents),green:!0})]}),e.negotiation_tips&&e.negotiation_tips.length>0&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Negotiation Tips"}),(0,t.jsx)("ul",{className:"space-y-1",children:e.negotiation_tips.map((e,n)=>(0,t.jsxs)("li",{className:"text-sm text-foreground flex items-start gap-2",children:[(0,t.jsx)("span",{className:"text-primary mt-0.5 shrink-0",children:"→"}),e]},n))})]}),e.red_flags&&e.red_flags.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wider text-red-500/80 mb-2",children:"Red Flags"}),(0,t.jsx)("ul",{className:"space-y-1",children:e.red_flags.map((e,n)=>(0,t.jsxs)("li",{className:"text-sm text-red-600 dark:text-red-400 flex items-start gap-2",children:[(0,t.jsx)("span",{className:"mt-0.5 shrink-0",children:"⚠"}),e]},n))})]})]})]})})}],207627);var R=e.i(346897),F=e.i(784296),$=e.i(864104);let U={A:"bg-emerald-500",B:"bg-green-500",C:"bg-amber-500",D:"bg-orange-500",F:"bg-red-500"};function z(e){return null==e?"N/A":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}
1function B(e){return e?`$${(e/100).toLocaleString("en-US",{maximumFractionDigits:0})}`:"$0"}function V({label:e,cents:n,isNegative:i,highlight:a}){return n?(0,t.jsxs)("div",{className:(0,r.cn)("flex items-center justify-between py-1.5",a&&"font-semibold"),children:[(0,t.jsx)("span",{className:(0,r.cn)("text-sm",a?"text-foreground":"text-muted-foreground"),children:e}),(0,t.jsxs)("span",{className:(0,r.cn)("text-sm font-medium tabular-nums",a?"text-foreground":i?"text-emerald-600 dark:text-emerald-400":"text-foreground"),children:[i?"-":"",B(Math.abs(n))]})]}):null}e.s(["DealerTransparencyCard",0,function({data:e}){let{isCaredgeCertified:n}=(0,y.usePartnerDealers)(),i=e.dealer;if(!i)return null;let l=i.name?.toLowerCase().trim()??"",s=!!l&&n(l),o=i.grade??"?",c=U[o]??"bg-muted",u=i.caredge_dealer_url,m=e.fees?.median_doc_fee??null,p=e.addons?.avg_add_ons??null,f=e.fees?.fee_score??null,h=e.pricing?.price_score??null,g=(m??0)+(p??0),x=g<=100&&(f??0)>=80,b=g>=500;return(0,t.jsxs)("div",{className:(0,r.cn)("copilot-message-enter overflow-hidden rounded-xl border bg-card shadow-sm",s?"border-primary/40 dark:border-primary/50":"border-border"),children:[s&&(0,t.jsx)(F.CertifiedBanner,{className:"px-3 @sm:px-4 py-2",subline:"Transparent. Trusted. Verified."}),(0,t.jsxs)("div",{className:"flex items-center gap-3 @sm:gap-4 px-3 @sm:px-4 py-3.5",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsx)("div",{className:(0,r.cn)("flex size-12 items-center justify-center rounded-full text-xl font-black text-white shadow-sm",c),children:o}),s&&(0,t.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-5 items-center justify-center rounded-full bg-primary ring-2 ring-card",children:(0,t.jsx)($.CertifiedSymbol,{className:"size-3 text-white"})})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-bold leading-tight truncate text-foreground",children:i.name??"Unknown Dealer"}),(i.city||i.state)&&(0,t.jsxs)("p",{className:"mt-0.5 flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(R.MapPin,{className:"size-3 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"truncate",children:[i.city,i.state].filter(Boolean).join(", ")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[u&&(0,t.jsxs)("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex min-h-[44px] @sm:min-h-0 items-center gap-1 rounded-md border px-3 @sm:px-2.5 py-2 @sm:py-1.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",children:["Full report",(0,t.jsx)(d.ExternalLink,{className:"size-2.5"})]}),(0,t.jsx)("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20",children:"Pro"})]})]}),(0,t.jsx)("div",{className:"border-t border-border/40"}),(0,t.jsxs)("div",{className:"px-3 @sm:px-4 py-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 @sm:grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] font-medium text-muted-foreground",children:"Doc Fee"}),(0,t.jsx)("p",{className:"text-sm font-bold tabular-nums text-foreground",children:z(m)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] font-medium text-muted-foreground",children:"Avg Add-ons"}),(0,t.jsx)("p",{className:"text-sm font-bold tabular-nums text-foreground",children:z(p)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] font-medium text-muted-foreground",children:"Fee Score"}),(0,t.jsx)("p",{className:"text-sm font-bold tabular-nums text-foreground",children:null!=f?`${Math.round(f)}/100`:"N/A"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] font-medium text-muted-foreground",children:"Price Accuracy"}),(0,t.jsx)("p",{className:"text-sm font-bold tabular-nums text-foreground",children:null!=h?`${Math.round(h)}/100`:"N/A"})]})]}),(0,t.jsx)("div",{className:(0,r.cn)("mt-3 rounded-lg px-3 py-2",x?"bg-emerald-50 dark:bg-emerald-500/10":b?"bg-amber-50 dark:bg-amber-500/10":"bg-muted/30"),children:(0,t.jsx)("p",{className:(0,r.cn)("text-xs font-medium",x?"text-emerald-700 dark:text-emerald-400":b?"text-amber-700 dark:text-amber-400":"text-muted-foreground"),children:x?"Transparent pricing — no surprise fees expected":b?`Expect ~${z(g)} in dealer fees and add-ons on top of the negotiated price`:null!=f?`This dealer scores ${Math.round(f)}/100 on fee transparency`:"Fee transparency data is being collected for this dealer"})})]}),null!=i.quote_count&&i.quote_count>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"border-t border-border/40"}),(0,t.jsx)("div",{className:"px-4 py-2",children:(0,t.jsxs)("p",{className:"text-[10px] font-medium text-muted-foreground
1/70",children:["Based on ",i.quote_count.toLocaleString()," verified quotes from real ",a.tenantConfig.name," shoppers"]})})]})]})}],366098),e.s(["OtdPredictionCard",0,function({prediction:e}){let n=e.listing_price_cents??0,i=e.predicted_otd_cents??0,a=i-n,l=n>0?(a/n*100).toFixed(1):"0",s=e.breakdown,o=e.dealer_data;return(0,t.jsx)("div",{className:"copilot-message-enter rounded-2xl border border-amber-500/30 bg-amber-500/5 overflow-hidden",children:(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg bg-amber-500/20 flex items-center justify-center",children:(0,t.jsx)("svg",{className:"w-4 h-4 text-amber-600 dark:text-amber-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,t.jsx)("h3",{className:"text-base font-semibold text-foreground",children:"Predicted Out-the-Door Price"}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[e.confidence&&(0,t.jsxs)("span",{className:(0,r.cn)("text-[11px] font-medium px-2 py-0.5 rounded-full","high"===e.confidence?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"medium"===e.confidence?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"bg-muted text-muted-foreground"),children:[e.confidence," confidence"]}),(0,t.jsx)("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20",children:"Pro"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[(0,t.jsxs)("div",{className:"rounded-lg bg-muted px-3 py-3 text-center",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Advertised"}),(0,t.jsx)("div",{className:"text-lg font-bold text-foreground tabular-nums",children:B(n)})]}),(0,t.jsxs)("div",{className:"rounded-lg bg-amber-500/10 border border-amber-500/20 px-3 py-3 text-center",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-amber-600 dark:text-amber-400 mb-1",children:"Real Cost (est.)"}),(0,t.jsx)("div",{className:"text-lg font-bold text-amber-600 dark:text-amber-400 tabular-nums",children:B(i)})]}),(0,t.jsxs)("div",{className:"rounded-lg bg-red-500/10 border border-red-500/20 px-3 py-3 text-center",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-red-500 mb-1",children:"Hidden Costs"}),(0,t.jsxs)("div",{className:"text-lg font-bold text-red-500 tabular-nums",children:["+",B(a)]}),(0,t.jsxs)("div",{className:"text-[10px] text-red-500/60 tabular-nums",children:["+",l,"%"]})]})]}),s&&(0,t.jsxs)("div",{className:"rounded-lg bg-muted px-4 py-3 mb-3",children:[(0,t.jsx)("div",{className:"text-[11px] uppercase tracking-wider text-muted-foreground mb-2",children:"Predicted Breakdown"}),(0,t.jsx)(V,{label:"Vehicle price",cents:s.vehicle_price_cents}),(0,t.jsx)(V,{label:"Doc fee",cents:s.doc_fee_cents}),(0,t.jsx)(V,{label:"Dealer add-ons (est.)",cents:s.estimated_addons_cents}),(0,t.jsx)(V,{label:"Taxes (est.)",cents:s.estimated_taxes_cents}),(0,t.jsx)(V,{label:"Title & registration",cents:s.title_registration_cents}),(0,t.jsx)("div",{className:"border-t border-border mt-2 pt-2",children:(0,t.jsx)(V,{label:"Predicted OTD",cents:i,highlight:!0})})]}),o&&(0,t.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:["Based on ",o.quote_count?.toLocaleString()," quotes from"," ",(0,t.jsxs)("span",{className:"text-primary",children:[o.name," (Grade ",o.grade,")"]})]})]})})}],577550);var H=e.i(463059),W=e.i(39312);function q(e){return e?`$${(e/100).toLocaleString("en-US",{maximumFractionDigits:0})}`:"N/A"}let G={email:"Email",sms:"SMS",facebook_message:"Facebook Messenger"},K={created:"Created",submitting:"Submitting",submitted:"Sent to dealer",submission_failed:"Submission failed",pending:"Awaiting dealer",awaiting_reply:"Waiting for dealer",dealer_replied:"Dealer replied",negotiating:"Negotiating",quoted:"Quote received",customer_review:"Your review needed",closed_won:"Deal won",closed_won_pending_docs:"Deal won — awaiting paperwork",closed_lost:"Deal closed",vehicle_sold_alternate_created:"Vehicle Sold - Alternate Created",vehicle_sold:"Vehicle Sold",halted:"Paused",stale:"Stale"};function Y({label:e,value:n}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:e}),(0,t.jsx)("div",{className:"text-sm text-foreground font-medium truncate",children:n})]})}e.s(["NegotiationCard",0,function({negotiation:e,onViewUpdates:n}){let i,a;return(0,t.jsx)("div",{"data-negotiation-card-id":e.negotiation_id,className:"copilot-message-enter rounded-2xl border border-emerald-500/30 bg-emerald-500/5 overflow-hidden",children:(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg bg-emerald-500/20 flex items-center justify-center",children:(0,t.jsx)(W.Zap,{className:"w-4 h-4 text-emerald-600 dark:text-emerald-400"})}),(0,t.jsx)("div",{children:(0,t.jsx)("h3",{className:"text-base font-semibold text-foreground",children:"Negotiation Active"})}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[n&&(0,t.jsxs)("button",{type:"button",onClick:()=>n(e),className:"inline-flex items-center gap-1 rounded-full border border-border bg-card min-h-[44px] sm:min-h-0 px-3 sm:px-2.5 py-2 sm:py-1 text-[11px] font-medium text-foreground
1/80 transition-colors hover:bg-muted",children:["View updates",(0,t.jsx)(H.ChevronRight,{className:"size-3","aria-hidden":"true"})]}),(0,t.jsx)("span",{className:(0,r.cn)("text-xs font-semibold uppercase tracking-wider px-2.5 py-1 rounded-full","bg-emerald-500/20 text-emerald-600 dark:text-emerald-300 copilot-pulse-3"),children:"Live"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(Y,{label:"Vehicle",value:e.vehicle||"—"}),(0,t.jsx)(Y,{label:"Seller",value:(i=e.seller_name?.trim(),a=e.seller_type?.trim(),i&&a?`${i} (${a})`:i||a||"—")}),(0,t.jsx)(Y,{label:"Asking Price",value:q(e.asking_price_cents)}),(0,t.jsx)(Y,{label:"Target Price",value:e.target_price_cents?q(e.target_price_cents):"Not set"}),(0,t.jsx)(Y,{label:"Channel",value:G[e.channel]??e.channel}),(0,t.jsx)(Y,{label:"Status",value:K[e.status]??e.status})]})]})})}],968915);var Z=e.i(519455),X=e.i(793479);let Q=new Set(["colors","must_have"]);e.s(["NegotiationPreferencesCard",0,function({data:e,onSubmit:i}){let[a,l]=(0,n.useState)({colors:[],must_have:[]}),[s,o]=(0,n.useState)(!1),c=e.fields??[];if(0===c.length)return null;let d=e=>{s||(o(!0),i((e=>{let t={__preferences:!0,skip:e};if(!e){if(a.trim&&(t.trim=a.trim),a.max_price){let e=Number(a.max_price);Number.isFinite(e)&&e>0&&(t.max_price=Math.round(e))}a.colors.length&&(t.colors=a.colors),a.must_have.length&&(t.must_have=a.must_have)}return JSON.stringify(t)})(e)))};return(0,t.jsxs)("div",{className:"copilot-quick-action-enter mt-2 w-full max-w-md rounded-2xl border border-border bg-muted/40 p-4",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:e.intro}),(0,t.jsx)("div",{className:"mt-3.5 space-y-3.5",children:c.map(e=>{if("number"===e.type)return(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:`pref-${e.key}`,className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:e.label}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),(0,t.jsx)(X.Input,{id:`pref-${e.key}`,type:"number",inputMode:"numeric",min:0,placeholder:"e.g. 40,000",value:a.max_price??"",disabled:s,onChange:e=>l(t=>({...t,max_price:e.target.value})),className:"pl-7"})]})]},e.key);let n=e.options??[];if(0===n.length)return null;let i=Q.has(e.key)||"multiselect"===e.type,o="colors"===e.key?a.colors:"must_have"===e.key?a.must_have:a.trim?[a.trim]:[];return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:e.label}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",role:"group","aria-label":e.label,children:n.map(n=>{let a=o.includes(n);return(0,t.jsx)("button",{type:"button","aria-pressed":a,disabled:s,onClick:()=>{if(i){var t;t=e.key,l(e=>{let r=e[t],i=r.includes(n)?r.filter(e=>e!==n):[...r,n];return{...e,[t]:i}})}else l(e=>({...e,trim:e.trim===n?void 0:n}))},className:(0,r.cn)("inline-flex min-h-[40px] items-center rounded-full border px-3.5 py-2 text-sm transition-all duration-150",a?"border-primary bg-primary text-primary-foreground":"border-border bg-background text-foreground hover:border-primary/50 hover:bg-primary/5","active:scale-95 disabled:pointer-events-none disabled:opacity-60","focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background"),children:n},n)})})]},e.key)})}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[(0,t.jsx)(Z.Button,{type:"button",onClick:()=>d(!1),disabled:s,className:"rounded-full",children:"Find my best fit"}),(0,t.jsx)(Z.Button,{type:"button",variant:"ghost",onClick:()=>d(!0),disabled:s,className:"rounded-full text-muted-foreground hover:text-foreground",children:"Just pick the best for me"})]})]})}],251242);var J=e.i(248256),ee=e.i(968553),et=e.i(878894);function en({label:e,value:n}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:e}),(0,t.jsx)("div",{className:"text-sm text-foreground font-medium truncate",children:n})]})}
1function er(e){return e?`$${(e/100).toLocaleString("en-US",{maximumFractionDigits:0})}`:"N/A"}e.s(["FormSubmissionCard",0,function({data:e}){if("skipped"===e.status)return null;let n="submitted"===e.status,i="failed"===e.status;return(0,t.jsx)("div",{className:(0,r.cn)("copilot-message-enter rounded-2xl border overflow-hidden",n?"border-indigo-500/30 bg-indigo-500/5":"border-amber-500/30 bg-amber-500/5"),children:(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("div",{className:(0,r.cn)("w-8 h-8 rounded-lg flex items-center justify-center",n?"bg-indigo-500/20":"bg-amber-500/20"),children:n?(0,t.jsx)(J.Globe,{className:"w-4 h-4 text-indigo-600 dark:text-indigo-400"}):(0,t.jsx)(et.AlertTriangle,{className:"w-4 h-4 text-amber-600 dark:text-amber-400"})}),(0,t.jsx)("div",{children:(0,t.jsx)("h3",{className:"text-base font-semibold text-foreground",children:n?"Website Form Submitted":"Form Submission Failed"})}),(0,t.jsx)("span",{className:(0,r.cn)("ml-auto text-xs font-semibold uppercase tracking-wider px-2.5 py-1 rounded-full",n?"bg-indigo-500/20 text-indigo-600 dark:text-indigo-300 copilot-pulse-3":"bg-amber-500/20 text-amber-600 dark:text-amber-300"),children:n?"In Progress":"Failed"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(en,{label:"Dealer",value:e.dealer_name}),e.dealer_website&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:"Website"}),(0,t.jsx)("a",{href:e.dealer_website,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-indigo-600 dark:text-indigo-400 hover:underline truncate block",children:function(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e.length>30?`${e.slice(0,30)}...`:e}}(e.dealer_website)})]}),e.vehicle&&(0,t.jsx)(en,{label:"Vehicle",value:e.vehicle})]}),e.message&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3 leading-relaxed line-clamp-3",children:e.message}),i&&e.reason&&(0,t.jsxs)("div",{className:"mt-3 rounded-lg bg-amber-500/10 px-3 py-2",children:[(0,t.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:e.reason}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Your email inquiry was still sent — this only affects the website form."})]}),n&&(0,t.jsx)("div",{className:"mt-3 rounded-lg border border-dashed border-indigo-500/20 bg-indigo-500/[0.02] p-4 copilot-shimmer-simple",children:(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 text-muted-foreground/50",children:[(0,t.jsx)(ee.Camera,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-xs",children:"Screenshots will appear once the form is submitted"})]})})]})})}],905682);let ei={outstanding:{label:"Outstanding",color:"text-emerald-600 dark:text-emerald-400"},clean:{label:"Clean",color:"text-green-600 dark:text-green-400"},average:{label:"Average",color:"text-amber-600 dark:text-amber-400"},rough:{label:"Rough",color:"text-orange-600 dark:text-orange-400"}};e.s(["TradeInCard",0,function({data:e}){let n=e.vehicle,i=e.valuation,a=e.market_data;if(!i)return null;let l=ei[i.condition_applied??"average"]??ei.average;return(0,t.jsx)("div",{className:"copilot-message-enter rounded-2xl border border-primary/30 bg-primary/5 overflow-hidden",children:(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-xl bg-primary/20 flex items-center justify-center shrink-0",children:(0,t.jsx)("svg",{className:"w-5 h-5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-foreground",children:"Trade-In Valuation"}),n?.description&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n.description})]}),(0,t.jsxs)("span",{className:(0,r.cn)("ml-auto text-xs font-medium px-2 py-0.5 rounded-full bg-primary/15",l.color),children:[l.label," condition"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[(0,t.jsxs)("div",{className:"rounded-lg bg-muted px-3 py-3 text-center",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Low Estimate"}),(0,t.jsx)("div",{className:"text-lg font-bold text-muted-foreground tabular-nums",children:er(i.trade_in_range_low_cents)})]}),(0,t.jsxs)("div",{className:"rounded-lg bg-primary/10 border border-primary/20 px-3 py-3 text-center",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-primary/80 mb-1",children:"Estimated Value"}),(0,t.jsx)("div",{className:"text-lg font-bold text-primary tabular-nums",children:er(i.estimated_trade_in_cents)})]}),(0,t.jsxs)("div",{className:"rounded-lg bg-muted px-3 py-3 text-center",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"High Estimate"}),(0,t.jsx)("div",{className:"text-lg font-bold text-muted-foreground tabular-nums",children:er(i.trade_in_range_high_cents)})]})]}),(0,t.jsxs)("div",{className:"rounded-lg bg-muted px-4 py-3 mb-3 space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Retail market value"}),(0,t.jsx)("span",{className:"text-foreground font-medium tabular-nums",children:er(i.median_retail_cents)})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Trade-in discount"}
1),(0,t.jsxs)("span",{className:"text-amber-600 dark:text-amber-400 font-medium tabular-nums",children:["-",i.condition_discount_pct,"%"]})]}),n?.mileage&&(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Current mileage"}),(0,t.jsxs)("span",{className:"text-foreground font-medium tabular-nums",children:[n.mileage.toLocaleString()," mi"]})]})]}),(0,t.jsxs)("div",{className:"text-[11px] text-muted-foreground mt-3",children:["Based on ",a?.comparable_count??0," comparable retail listings"]})]})})}],754015);var ea=e.i(269638);function el({recall:e}){let[r,i]=(0,n.useState)(!1);return(0,t.jsxs)("div",{className:"border border-border/60 rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{className:"w-full flex items-start justify-between gap-3 px-3 py-2.5 text-left bg-card hover:bg-muted/30 transition-colors",onClick:()=>i(e=>!e),"aria-expanded":r,children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground leading-tight",children:e.component??"Unknown Component"}),e.summary&&!r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:e.summary})]}),(0,t.jsx)("span",{className:"shrink-0 mt-0.5 text-muted-foreground",children:r?(0,t.jsx)(c.ChevronUp,{className:"size-4"}):(0,t.jsx)(o.ChevronDown,{className:"size-4"})})]}),r&&(0,t.jsxs)("div",{className:"px-3 pb-3 pt-1 space-y-2 bg-muted/10",children:[e.summary&&(0,t.jsx)("p",{className:"text-xs text-foreground leading-relaxed",children:e.summary}),e.consequence&&(0,t.jsxs)("div",{className:"rounded-md bg-amber-50 dark:bg-amber-500/10 px-2.5 py-1.5",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-amber-700 dark:text-amber-400 mb-0.5",children:"Risk"}),(0,t.jsx)("p",{className:"text-xs text-amber-800 dark:text-amber-300 leading-relaxed",children:e.consequence})]}),e.remedy&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Remedy: "}),e.remedy]}),e.campaign_number&&(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground/70 tabular-nums",children:["Campaign #",e.campaign_number]})]})]})}e.s(["RecallCard",0,function({data:e}){let n=e.recalls??[],i=e.total_recalls??n.length,a=i>0,l=n.slice(0,5),s=n.length-l.length,o=[e.year,e.make,e.model].filter(Boolean).join(" ");return(0,t.jsxs)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:[(0,t.jsxs)("div",{className:(0,r.cn)("flex items-center gap-3 px-4 py-3.5",a?"bg-amber-50 dark:bg-amber-500/10 border-b border-amber-200/60 dark:border-amber-500/20":"bg-emerald-50 dark:bg-emerald-500/10 border-b border-emerald-200/60 dark:border-emerald-500/20"),children:[a?(0,t.jsx)(et.AlertTriangle,{className:"size-5 shrink-0 text-amber-600 dark:text-amber-400"}):(0,t.jsx)(ea.CheckCircle,{className:"size-5 shrink-0 text-emerald-600 dark:text-emerald-400"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:(0,r.cn)("text-sm font-bold leading-tight",a?"text-amber-800 dark:text-amber-300":"text-emerald-800 dark:text-emerald-300"),children:a?`${i} Open ${1===i?"Recall":"Recalls"}`:"No Open Recalls"}),o&&(0,t.jsx)("p",{className:(0,r.cn)("text-xs mt-0.5",a?"text-amber-700/70 dark:text-amber-400/70":"text-emerald-700/70 dark:text-emerald-400/70"),children:o})]})]}),a&&l.length>0&&(0,t.jsxs)("div",{className:"px-4 py-3 space-y-2",children:[l.map((e,n)=>(0,t.jsx)(el,{recall:e},e.campaign_number??n)),s>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground text-center pt-1",children:["and ",s," more ",1===s?"recall":"recalls"," — check NHTSA for full list"]})]}
1),!a&&(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No open recalls found for this vehicle in the NHTSA database."})})]})}],632213);var es=e.i(770703),eo=e.i(827085),ec=e.i(266027),ed=e.i(484023),ed=ed,eu=e.i(178583),em=e.i(270756),ep=e.i(402699),ef=e.i(732274),eh=e.i(503196),eg=e.i(235118);let ex=(0,es.default)(()=>e.A(406288).then(e=>e.WindowStickerPdf),{loadableGenerated:{modules:[972161]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"mt-4 aspect-[1224/792] w-full animate-pulse rounded-xl bg-muted/40"})}),eb="/window-sticker/api/sticker",ey="https://caredge.com/window-sticker",ev="We couldn't find a sticker for this VIN. Double-check the VIN or try a different vehicle.",ek="The window sticker service isn't reachable right now. This isn't a problem with your VIN — try again in a few minutes.";async function ej(e){let t=await fetch(`${eb}?vin=${encodeURIComponent(e)}`);if(401===t.status)return{ok:!1,kind:"unauthorized"};let n={};try{n=await t.json()}catch{}return 429===t.status?{ok:!1,kind:"rate_limited",message:n.error??"Rate limit exceeded. Please try again shortly."}:422===t.status?{ok:!1,kind:"unsupported_make",message:n.error??"This brand's window stickers aren't available yet. We're working on adding more brands."}:404===t.status?{ok:!1,kind:"unavailable",message:ek}:t.ok?{ok:!0}:500===t.status?{ok:!1,kind:"not_found",message:ev}:{ok:!1,kind:"unavailable",message:n.error??ek}}function ew({doc:e,vin:n,onFailure:r}){return"pdf"===e.format?(0,t.jsx)(ex,{blobUrl:e.blobUrl,vin:n,onFailure:r}):(0,t.jsx)(eN,{blobUrl:e.blobUrl,vin:n})}function eN({blobUrl:e,vin:r}){let[i,a]=(0,n.useState)(0),l=(0,n.useCallback)(e=>{if(!e)return;a(e.getBoundingClientRect().width);let t=new ResizeObserver(e=>{for(let t of e)a(t.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]),s=i?i/980:0;return(0,t.jsx)("div",{ref:l,className:"mt-4 overflow-hidden rounded-xl bg-white ring-1 ring-black/[0.06] dark:ring-white/[0.06]",style:{height:Math.round(1615*s)},children:s>0&&(0,t.jsx)("iframe",{src:e,title:`Window sticker — ${r}`,style:{width:980,height:1615,transform:`scale(${s})`,transformOrigin:"top left",border:"none"}})})}function e_({vin:e}){return(0,t.jsxs)("div",{className:"copilot-message-enter w-full rounded-2xl border border-border bg-card p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(eu.FileText,{className:"size-4 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Pulling the window sticker"}),(0,t.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["VIN ",e," — this usually takes 5–15 seconds."]})]})]}),(0,t.jsx)("div",{className:"mt-4 w-full animate-pulse rounded-xl bg-muted/40",style:{aspectRatio:"1224/792"}})]})}function eC({url:e,filename:n,format:r,variant:i="secondary"}){return(0,t.jsxs)(Z.Button,{type:"button",size:"sm",variant:"primary"===i?"default":"secondary",onClick:()=>{let t=document.createElement("a");t.href=e,t.download=n,t.click()},className:"shrink-0 gap-1.5",children:[(0,t.jsx)(ed.default,{className:"size-3.5"}),"pdf"===r?"Download PDF":"Download sticker"]})}function eS({vin:e,kind:n,message:r,fullToolUrl:i,onSignIn:a}){let l="unauthorized"===n;return(0,t.jsx)("div",{className:"copilot-message-enter w-full rounded-2xl border border-destructive/30 bg-destructive/5 p-4",children:(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[l?(0,t.jsx)(em.Lock,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,t.jsx)(et.AlertTriangle,{className:"mt-0.5 size-4 shrink-0 text-destructive"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground",children:"Window sticker"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-foreground",children:l?"Sign in to pull the original window sticker for this VIN. It's free.":r}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["VIN: ",e]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[l&&(0,t.jsx)(Z.Button,{type:"button",size:"sm",onClick:a,children:"Sign in"}),("not_found"===n||"unsupported_make"===n||"unavailable"===n)&&(0,t.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-9 items-center gap-1.5 rounded-lg px-3 text-[13px] font-medium text-primary transition-colors hover:bg-primary/10",children:["Try the full window sticker tool",(0,t.jsx)(d.Exter
1nalLink,{className:"size-3.5"})]})]})]})]})})}function eE(e){return null==e?"N/A":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}function eT(e){return null==e?"N/A":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}function eA({label:e,value:n,muted:i,highlight:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,t.jsx)("span",{className:(0,r.cn)("text-sm",i?"text-muted-foreground":"text-foreground"),children:e}),(0,t.jsx)("span",{className:(0,r.cn)("text-sm font-semibold tabular-nums",a?"text-primary":i?"text-muted-foreground":"text-foreground"),children:n})]})}e.s(["WindowStickerCard",0,function({data:e}){var r,i;let a=(e.vin??"").toUpperCase(),{isSignedIn:l,isLoaded:s}=(0,eo.useUser)(),{openSignIn:o}=(0,ef.useAuthModal)(),c=(0,eh.useFeatureFlags)(e=>e.enableCopilotWindowSticker??!1),[u,m]=(0,n.useState)(!1),{data:p,refetch:f}=(0,ec.useQuery)({queryKey:["window-sticker",a],queryFn:()=>ej(a),enabled:c&&!!a&&!e.hydrated,staleTime:1/0,gcTime:1/0,retry:!1,refetchOnWindowFocus:!1}),h=e.hydrated?{ok:!0}:p,{data:g,isError:x}=(r=`${eb}/pdf?vin=${encodeURIComponent(a)}`,i=c&&!!a&&h?.ok===!0,(0,ec.useQuery)({queryKey:["window-sticker-doc",r],queryFn:async()=>{let e=await fetch(r);if(!e.ok)throw Error(`window sticker pdf fetch failed (${e.status})`);let t=await e.arrayBuffer(),n=(0,ep.sniffContentType)(new Uint8Array(t))??e.headers.get("content-type"),i=(0,ep.isPdfContentType)(n);return{blobUrl:URL.createObjectURL(new Blob([t],{type:i?"application/pdf":"text/html;charset=utf-8"})),format:i?"pdf":"html"}},enabled:i,staleTime:1/0,gcTime:1/0,retry:1,refetchOnWindowFocus:!1})),b=h?.ok===!1&&"unauthorized"===h.kind;(0,n.useEffect)(()=>{!b||s&&l&&f()},[b,s,l,f]);let y=(0,eg.getWindowStickerBrandSlug)(e.make),v=y?`${ey}/${y}?vin=${encodeURIComponent(a)}`:ey,k=()=>o(void 0,"Copilot window sticker");if(!c||!a)return null;if(!h)return(0,t.jsx)(e_,{vin:a});if(!h.ok)return(0,t.jsx)(eS,{vin:a,kind:h.kind,message:h.message,fullToolUrl:v,onSignIn:k});if(x||u)return(0,t.jsx)(eS,{vin:a,kind:"not_found",message:ev,fullToolUrl:v,onSignIn:k});if(!g)return(0,t.jsx)(e_,{vin:a});let j=g.blobUrl,w=`WindowSticker-${a}.${g.format}`;return(0,t.jsxs)("div",{className:"copilot-message-enter w-full rounded-2xl border border-border bg-card p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,t.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-emerald-500/10",children:(0,t.jsx)(ea.CheckCircle,{className:"size-4 text-emerald-600 dark:text-emerald-400"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Sticker found"}),(0,t.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:["VIN: ",a]})]})]}),(0,t.jsx)(eC,{url:j,filename:w,format:g.format})]}),(0,t.jsx)(ew,{doc:g,vin:a,onFailure:()=>m(!0)}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,t.jsx)(eC,{url:j,filename:w,format:g.format,variant:"primary"}),(0,t.jsxs)("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-9 items-center gap-1.5 rounded-lg px-3 text-[13px] font-medium text-primary transition-colors hover:bg-primary/10",children:["Open in the full window sticker tool",(0,t.jsx)(d.ExternalLink,{className:"size-3.5"})]})]})]})}],124285);let eI={Excellent:{color:"text-emerald-700 dark:text-emerald-400",bg:"bg-emerald-500/10 border border-emerald-500/30",highlight:!0},Good:{color:"text-primary",bg:"bg-primary/5 border border-primary/20",highlight:!1},Fair:{color:"text-amber-700 dark:text-amber-400",bg:"bg-amber-500/10 border border-amber-500/20",highlight:!1},Poor:{color:"text-muted-foreground",bg:"bg-muted border border-border",highlight:!1}};e.s(["FinanceCard",0,function({data:e}){let n=e.tiers?.length?e.tiers:Object.entries(e.breakdown_by_tier??{}).map(([e,t])=>({tier:e,...t})),i=n.length>0;return(0,t.jsx)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"px-4 pt-4 pb-2",children:[(0,t.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Monthly Payment by Credit Tier"}),null!=e.vehicle_price&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Based on ",eE(e.vehicle_price)," vehicle price",null!=e.down_payment&&` \xb7 ${eE(e.down_payment)} down`,null!=e.term_months&&` \xb7 ${e.term_months} months`]})]}),(0,t.jsx)("div",{className:"px-4 pb-4 grid grid-cols-2 gap-2",children:n.map(e=>{let n=eI[e.tier.split(" ")[0]]??eI.Poor;return(0,t.jsxs)("div",{className:(0,r.cn)("rounded-xl px-3 py-2.5",
1n.bg),children:[(0,t.jsx)("p",{className:(0,r.cn)("text-[11px] font-semibold uppercase tracking-wide mb-1",n.color),children:e.tier}),(0,t.jsxs)("p",{className:(0,r.cn)("text-xl font-bold tabular-nums leading-none",n.color),children:[eT(e.monthly_payment),(0,t.jsx)("span",{className:"text-[11px] font-normal ml-0.5",children:"/mo"})]}),(0,t.jsx)("p",{className:(0,r.cn)("text-[10px] tabular-nums mt-1",n.color),children:null!=e.apr?`${e.apr.toFixed(1)}% APR`:""})]},e.tier)})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"bg-primary/5 border-b border-primary/10 px-4 py-4 text-center",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Monthly Payment"}),(0,t.jsx)("p",{className:"text-4xl font-bold tabular-nums text-foreground leading-none",children:eT(e.monthly_payment)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1.5 tabular-nums",children:[null!=e.term_months&&`${e.term_months} months`,null!=e.apr&&`${e.apr.toFixed(1)}% APR`].filter(Boolean).join(" · ")})]}),(0,t.jsxs)("div",{className:"px-4 py-3 divide-y divide-border/40",children:[null!=e.vehicle_price&&(0,t.jsx)(eA,{label:"Vehicle Price",value:eE(e.vehicle_price)}),null!=e.down_payment&&e.down_payment>0&&(0,t.jsx)(eA,{label:"Down Payment",value:`− ${eE(e.down_payment)}`,muted:!0}),null!=e.trade_in_value&&e.trade_in_value>0&&(0,t.jsx)(eA,{label:"Trade-in Value",value:`− ${eE(e.trade_in_value)}`,muted:!0}),null!=e.tax_estimate&&(0,t.jsx)(eA,{label:`Tax & Fees${e.state?` (${e.state})`:""}`,value:eE(e.tax_estimate),muted:!0}),null!=e.loan_amount&&(0,t.jsx)(eA,{label:"Loan Amount",value:eE(e.loan_amount)}),null!=e.total_interest&&(0,t.jsx)(eA,{label:"Total Interest",value:eE(e.total_interest),muted:!0}),null!=e.total_cost&&(0,t.jsx)(eA,{label:"Total Cost",value:eE(e.total_cost),highlight:!0})]})]})})}],148697);var eP=e.i(247167),eL=e.i(217923),eD=e.i(87316),eM=e.i(465261),eO=e.i(488844),eR=e.i(25652),eF=e.i(693302);function e$(e){return null==e?"N/A":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}let eU={limited:{label:"Limited Leverage",color:"#ef4444",bgClass:"bg-red-50 dark:bg-red-950/40",textClass:"text-red-700 dark:text-red-400",ringTrackClass:"stroke-red-200 dark:stroke-red-800/60"},moderate:{label:"Moderate Leverage",color:"#f59e0b",bgClass:"bg-amber-50 dark:bg-amber-950/40",textClass:"text-amber-700 dark:text-amber-400",ringTrackClass:"stroke-amber-200 dark:stroke-amber-800/60"},strong:{label:"Strong Leverage",color:"#22c55e",bgClass:"bg-emerald-50 dark:bg-emerald-950/40",textClass:"text-emerald-700 dark:text-emerald-400",ringTrackClass:"stroke-emerald-200 dark:stroke-emerald-800/60"}};function ez({negotiation:e}){var n,i;let l=null==e,s=e?.score??null,o=e?eU[e.leverage]:null,c=e?(n=e.target_price_low,i=e.target_price_high,null==n&&null==i?null:null!=n&&null!=i?`Target Price ${e$(n)}–${e$(i)}`:`Target Price ${e$(n??i??void 0)}`):null,d=2*Math.PI*22,u=(0,t.jsxs)("div",{className:"flex flex-wrap items-stretch gap-3 px-4 py-3 border-b border-border/40",children:[(0,t.jsxs)("div",{className:"relative shrink-0 h-14 w-14 self-center",children:[(0,t.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",children:[(0,t.jsx)("circle",{cx:"28",cy:"28",r:22,fill:"none",strokeWidth:"5",className:l?"stroke-muted-foreground/20":o.ringTrackClass,transform:"rotate(-90 28 28)"}),!l&&o&&(0,t.jsx)("circle",{cx:"28",cy:"28",r:22,fill:"none",strokeWidth:"5",strokeLinecap:"round",stroke:o.color,strokeDasharray:d,strokeDashoffset:null!=s?d-s/100*d:d,transform:"rotate(-90 28 28)"})]}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:l?(0,t.jsx)(em.Lock,{className:"size-5 text-primary","aria-hidden":!0}):(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)("span",{className:"text-base font-bold tabular-nums leading-none text-foreground",children:s??"--"}),(0,t.jsx)("span",{className:"text-[8px] font-medium text-muted-foreground/60",children:"/100"})]})})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 flex flex-col justify-center",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsx)("span",{className:"text-sm font-bold text-foreground whitespace-nowrap",children:"Negotiation Power"}),o&&(0,t.jsx)("span",{className:(0,r.cn)("rounded-full px-2.5 py-0.5 text-[10px] font-bold whitespace-nowrap",o.bgClass,o.textClass),children:o.label})]}),l?(0,t.jsxs)("p",{className:"mt-1 flex flex-col @sm:flex-row @sm:items-center gap-x-1.5 gap-y-0.5 text-[13px] font-semibold tracking-tight",children:[(0,t.jsx)("span",{className:"text-foreground
1/80 whitespace-nowrap",children:"Target Price"}),(0,t.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"min-w-0 truncate tabular-nums blur-[5px] select-none text-foreground/60",children:"$—,———–$—,———"}),(0,t.jsx)(em.Lock,{className:"size-3.5 shrink-0 text-primary","aria-hidden":!0})]})]}):c?(0,t.jsx)("p",{className:"mt-1 text-[13px] font-semibold tracking-tight text-foreground/80 tabular-nums",children:c}):null]}),l&&(0,t.jsx)("span",{className:"self-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-bold text-primary group-hover:underline",children:"Unlock with Pro"})]});return l?(0,t.jsx)(m.default,{href:"/checkout/pro?from=copilot",target:"_blank",rel:"noopener noreferrer",prefetch:!1,"aria-label":`Unlock Negotiation Power with ${a.tenantConfig.name} Pro`,onClick:()=>{(0,L.track)(D.EVENTS.COPILOT_BLUR_CLICKED,{Location:"Negotiation Power",product:"pro"}),(0,L.track)(D.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Negotiation Power",product:"pro"})},className:"group block no-underline transition-colors hover:bg-primary/5",children:u}):u}function eB(e,t){if(null==e||null==t)return;let n=t>0?e/t:0;return n<.5?"strong":n<.8?"moderate":"limited"}function eV({marketInsights:e,isTeaser:n}){var r;let i=()=>{(0,L.track)(D.EVENTS.COPILOT_BLUR_CLICKED,{Location:"Market Insights",product:"pro"}),(0,L.track)(D.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Market Insights",product:"pro"});{let e=eP.default.env.NEXT_PUBLIC_BASE_PATH||"";window.open(`${e}/checkout/pro?from=copilot`,"_blank","noopener,noreferrer")}},a=e?.days_on_market??null,l=e?.market_days_supply??null,s=e?.total_for_sale??null,o=e?.total_sold_45_days??null,c=new Intl.NumberFormat("en-US"),d;return(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 @sm:grid-cols-2",children:[(0,t.jsx)(eF.PulseCard,{icon:(0,t.jsx)(eD.Calendar,{className:"size-5"}),title:"Days on Market",tooltip:"How long this specific vehicle has been listed for sale.",value:null!=a?`${a}`:"--",subtitle:null!=a?"days on market":void 0,description:null!=a?a<=15?"Fresh arrival — this vehicle may sell quickly at its current price.":null==d?"Time on market noted. Check market conditions for more context.":a>1.3*d?"Sitting longer than average. The dealer is likely motivated to sell.":a>.7*d?"Average time on market. Standard negotiation room applies.":"Moving fast. High demand suggests limited price flexibility.":"Time on market data isn't available for this vehicle.",leverage:null!=a?function(e,t){if(null!=t)return e>1.3*t?"strong":e>.7*t?"moderate":"limited"}(a,d):void 0,locked:!1,gauge:null!=a?{value:a,min:0,max:120}:void 0}),(0,t.jsx)(eF.PulseCard,{icon:(0,t.jsx)(eL.BarChart3,{className:"size-5"}),title:"Market Days Supply",tooltip:"How many days it would take to sell all similar vehicles at the current sales pace.",value:null!=l?`${l}`:"--",subtitle:null!=l?"days supply":void 0,description:null!=l?null==l?"Market supply data unavailable for this vehicle.":l>=91?"High inventory. Dealers have plenty of stock and are more willing to negotiate.":l>=61?"Moderate supply. Some room for negotiation on price.":"Low supply. High demand limits your leverage on price.":n?"See if supply gives you leverage in negotiations.":"Market supply data isn't available for this vehicle.",leverage:function(e){if(null!=e)return e>=91?"strong":e>=61?"moderate":"limited"}(l??void 0),locked:n&&null==l,lockedTeaser:"See if supply gives you leverage in negotiations.",onLockedClick:i,gauge:null!=l?{value:l,min:0,max:150}:void 0}),(0,t.jsx)(eF.PulseCard,{icon:(0,t.jsx)(eO.Package,{className:"size-5"}),title:"Total for Sale",tooltip:"Number of similar vehicles currently listed in your area.",value:null!=s?c.format(s):"--",subtitle:null!=s?"listed nearby":void 0,description:null!=s?null==s?"Inventory data unavailable for this vehicle.":s>100?"Plenty of options available — use alternatives as leverage.":"Fewer options available — demand works against you.":"Inventory data isn't available for this vehicle.",leverage:function(e){if(null!=e)return e>100?"strong":e>40?"moderate":"limited"}(s??void 0),locked:!1,gauge:null!=s?{value:s,min:0,max:350}:void 0}),(0,t.jsx)(eF.PulseCard,{icon:(0,t.jsx)(eR.TrendingUp,{className:"size-5"}),title:"Sold Last 45 Days",tooltip:"How many similar vehicles sold recently — indicates demand velocity.",value:null!=o?c.format(
1o):"--",subtitle:null!=o?"sold recently":void 0,description:null!=o?null==(r=eB(o,s??void 0))?"Sales velocity data unavailable for this vehicle.":"strong"===r?"Slow sales pace. Dealers may be more willing to deal.":"moderate"===r?"Moderate demand. Standard market dynamics apply.":"High demand. Vehicles are selling faster than new ones list.":n?"See demand velocity and what it means for your leverage.":"Recent sales data isn't available for this vehicle.",leverage:eB(o??void 0,s??void 0),locked:n&&null==o,lockedTeaser:"See demand velocity and what it means for your leverage.",onLockedClick:i,gauge:null!=o?{value:o,min:0,max:Math.max((s??100)*1.5,100)}:void 0})]})}e.s(["InvoicePriceCard",0,function({data:e}){let i=!0===e.teaser,l=(0,g.isWidgetSession)(),s=[e.year,e.make,e.model,e.trim].filter(Boolean).join(" "),o=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{l||!i||o.current||(o.current=!0,(0,L.track)(D.EVENTS.COPILOT_BLUR_VIEWED,{Location:"Invoice Price Card",product:"pro"}),(0,L.track)(D.EVENTS.COPILOT_UPGRADE_VIEWED,{Location:"Invoice Price Card",product:"pro"}))},[i,l]),(0,t.jsxs)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border/40",children:[(0,t.jsx)("div",{className:"flex size-7 items-center justify-center rounded-full bg-primary/10",children:(0,t.jsx)(eM.KeyRound,{className:"size-3.5 text-primary"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Dealer Cost Breakdown"}),s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:s})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-border/40 border-b border-border/40",children:[(0,t.jsxs)("div",{className:"px-4 py-4 text-center",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Sticker Price (MSRP)"}),(0,t.jsx)("p",{className:(0,r.cn)("text-xl font-bold tabular-nums text-muted-foreground",!i&&"line-through decoration-muted-foreground/50"),children:e$(e.msrp)})]}),i&&!l?(0,t.jsxs)(m.default,{href:"/checkout/pro?from=copilot",target:"_blank",rel:"noopener noreferrer",prefetch:!1,"aria-label":`Unlock invoice pricing with ${a.tenantConfig.name} Pro`,onClick:()=>{(0,L.track)(D.EVENTS.COPILOT_BLUR_CLICKED,{Location:"Invoice Price",product:"pro"}),(0,L.track)(D.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Invoice Price",product:"pro"})},className:(0,r.cn)("group px-4 py-4 text-center cursor-pointer no-underline","transition-all duration-200 active:scale-[0.98]","hover:bg-primary/5"),children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Invoice Price"}),(0,t.jsxs)("div",{className:"relative flex items-center justify-center",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"text-xl font-bold tabular-nums text-primary/40 blur-[3px] select-none",children:"$ —"}),(0,t.jsx)(em.Lock,{className:"absolute size-5 text-primary","aria-hidden":!0})]}),(0,t.jsx)("p",{className:"text-[10px] text-primary mt-0.5 font-semibold group-hover:underline",children:"Unlock with Pro"})]}):(0,t.jsxs)("div",{className:"px-4 py-4 text-center",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Invoice Price"}),(0,t.jsx)("p",{className:"text-xl font-bold tabular-nums text-primary",children:e$(e.invoice_price)}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:"Dealer cost"})]})]}),!l&&(e.negotiation||i)&&(0,t.jsx)(ez,{negotiation:e.negotiation}),!l&&(e.market_insights||i)&&(0,t.jsx)("div",{className:"px-4 py-3 border-b border-border/40",children:(0,t.jsx)(eV,{marketInsights:e.market_insights,isTeaser:i})}),!l&&i&&(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsxs)(m.default,{href:"/checkout/pro?from=copilot",target:"_blank",rel:"noopener noreferrer",prefetch:!1,className:"font-bold text-primary hover:underline",children:[a.tenantConfig.name," Pro"]})," ","reveals the dealer's invoice price."]})})]})}],379304);var eH=e.i(205125),eW=e.i(581418),eq=e.i(63639),eG=e.i(990793),eK=e.i(63804);let eY=[{pattern:/\b(awd|4wd|all.wheel|four.wheel)\b/i,label:"AWD / 4WD",icon:eH.Car},{pattern:/heated.seat/i,label:"Heated Seats",icon:eG.Armchair},{pattern:/panoram|moonroof|sunroof/i,label:"Moonroof / Sunroof",icon:P.Sparkles},{pattern:/premium.audio|bose|harman|bang.olufsen|mark.levinson|burmester|meridian|jbl/i,label:"Premium Audio",icon:eq.Radio},{pattern:/adaptive.cruise|lane.keep|blind.spot|collision.warning|forward.warning|auto.?brake/i,label:"Advanced Safety",icon:eW.ShieldCheck},{pattern:/third.row|3rd.row/i,label:"Third Row",icon:eG.Armchair},{pattern:/leather/i,label:"Leather Seats",icon:eG.Armchair},{pattern:/navigation|nav.system/i,label:"Navigation",icon:eq.Radio},{pattern:/remote.start|keyless/i,label:"Remote Start",icon:P.Sparkles},{pattern:/carplay|android.auto/i,label:"CarPlay / Android Auto",icon:eq.Radio},{pattern:/backup.cam|rear.cam|rearview.cam|surround.view|360.cam/i,label:"Backup Camera",icon:eW.ShieldCheck},{pattern:/turbo|supercharg/i,label:"Turbocharged",icon:W.Zap},{pattern:/tow.?(?:ing)?.?(?:package|hitch|capable)/i,label:"Towing Package",icon:eH.Car},{pattern:/ventilated.seat|cooled.seat/i,label:"Ventilated Seats",icon:eG.Armchair},{pattern:/wireless.charg/i,label:"Wireless Charging",icon:P.Sparkles},{pattern:/power.liftgate|power.tailgate/i,label:"Power Liftgate",icon:eH.Car}];e.s(["VehicleFeaturesCard",0,function({data:e}
1){let[i,a]=(0,n.useState)(!1),l=[e.year,e.make,e.model,e.trim].filter(Boolean).join(" "),s=function(e){let t=new Set,n=[];for(let r of e)for(let e of eY)!t.has(e.label)&&e.pattern.test(r)&&(t.add(e.label),n.push({label:e.label,icon:e.icon}));return n}(e.features_raw??[]),c=e.found&&s.length>0;return(0,t.jsxs)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c&&a(e=>!e),disabled:!c,"aria-expanded":c?i:void 0,className:(0,r.cn)("flex w-full items-center gap-2.5 px-4 py-3 text-left",c&&"hover:bg-muted/40 transition-colors"),children:[(0,t.jsx)("div",{className:"flex size-7 items-center justify-center rounded-full bg-primary/10",children:(0,t.jsx)(eK.ListChecks,{className:"size-3.5 text-primary"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"text-sm font-semibold text-foreground",children:["Vehicle Features",c&&(0,t.jsxs)("span",{className:"ml-1 font-medium text-muted-foreground",children:["(",s.length,")"]})]}),l&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:l})]}),c&&(0,t.jsx)(o.ChevronDown,{className:(0,r.cn)("size-4 shrink-0 text-muted-foreground transition-transform",i&&"rotate-180")})]}),c?i&&(0,t.jsx)("div",{className:"divide-y divide-border/60 border-t border-border/40 motion-safe:animate-in motion-safe:fade-in motion-safe:duration-200",children:s.map(({label:e,icon:n})=>(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[(0,t.jsx)(n,{className:"size-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"text-[13px] text-foreground",children:e})]},e))}):(0,t.jsx)("p",{className:"px-4 pb-3 text-sm text-muted-foreground",children:e.found?"No standout features listed for this vehicle.":"No current listing found to check features for."})]})}],567510);var eZ=e.i(730267),eX=e.i(175379),eQ=e.i(37461);e.s(["PriceHistoryCard",0,function({data:e}){let[i,a]=(0,n.useState)(!0);if(!e?.points||0===e.points.length)return null;let l=e.points,s=l.length,c=e.current_listed_price??null,d=c&&c>0?[...l,{price:c,updated_on:new Date().toISOString()}]:l,u=d.map(e=>({date:(0,eQ.formatPriceHistoryDate)(e.updated_on),price:e.price})),m=d.map(e=>e.price),{yMin:p,yMax:f}=(0,eQ.computePriceYBounds)(m),h=m[0],g=m[m.length-1]-h,x=1===s&&1===d.length,b=x?"No changes yet":0===g?"No change":g<0?`${(0,eX.formatPrice)(Math.abs(g))} drop`:`${(0,eX.formatPrice)(g)} increase`,y=x?"text-muted-foreground":g<0?"text-green-600":g>0?"text-red-600":"text-muted-foreground",v=1===s?`Tracked once \xb7 ${(0,eQ.formatPriceHistoryDate)(e.last_updated_on)}`:`${s} updates \xb7 ${(0,eQ.formatPriceHistoryDate)(e.first_updated_on)} → ${(0,eQ.formatPriceHistoryDate)(e.last_updated_on)}`;return(0,t.jsxs)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),"aria-expanded":i,className:"flex w-full items-center gap-2.5 px-4 py-3 border-b border-border/40 hover:bg-muted/40 transition-colors text-left",children:[(0,t.jsx)("div",{className:"flex size-7 items-center justify-center rounded-full bg-primary/10 shrink-0",children:(0,t.jsx)(eZ.LineChart,{className:"size-3.5 text-primary"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Price History"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground tabular-nums",children:v})]}),(0,t.jsx)("span",{className:(0,r.cn)("text-sm font-medium shrink-0",y),children:b}),(0,t.jsx)(o.ChevronDown,{"aria-hidden":!0,className:(0,r.cn)("size-4 text-muted-foreground shrink-0 transition-transform",i&&"rotate-180")})]}),(0,t.jsx)("div",{className:(0,r.cn)("overflow-hidden transition-all duration-300 ease-in-out px-4",i?"max-h-[260px] opacity-100 py-4":"max-h-0 opacity-0"),children:(0,t.jsx)(eQ.PriceHistoryAreaChart,{data:u,yMin:p,yMax:f})})]})}],705942);let eJ={cash_back:{label:"Cash Back",color:"text-emerald-700 dark:text-emerald-400",bg:"bg-emerald-500/10 border-emerald-500/20"},lease:{label:"Lease",color:"text-blue-700 dark:text-blue-400",bg:"bg-blue-500/10 border-blue-500/20"},finance:{label:"Finance",color:"text-purple-700 dark:text-purple-400",bg:"bg-purple-500/10 border-purple-500/20"},loyalty:{label:"Loyalty",color:"text-amber-700 dark:text-amber-400",bg:"bg-amber-500/10 border-amber-500/20"}};function e0(e){return null==e?"":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}function e1({incentive:e}){var n;let i=(n=e.offer_type)?eJ[n]??{label:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),color:"text-muted-foreground",bg:"bg-muted border-border"}:null,a=null!=e.amount&&e.amount>0?e0(e.amount):null!=e.monthly?`${e0(e.monthly)}/mo${e.term?` \xb7 ${e.term} mo`:""}`:null!=e.apr?`${e.apr.toFixed(1)}% APR`:null;return(0,t.jsxs)("div",{className:"flex items-start gap-3 py-2.5",children:[i&&(0,t.jsx)("span",{className:(0,r.cn)("shrink-0 mt-0.5 text-[10px] font-semibold uppercase tracking-wide px-1.5 py-0.5 rounded border",i.color,i.bg),children:i.label}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[e.description&&(0,t.jsx)("p",{className:"text-sm text-foreground leading-snug",children:e.description}),e.expires&&(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:["Expires ",function(e){if(!e)return"";try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch{return e}}(e.expires)]})]}),a&&(0,t.jsx)("p",{className:"shrink-0 text-sm font-bold tabular-nums text-foreground",children:a})]})}e.s(["IncentivesCard",0,function({data:e}){let n=e.incentives?.length?e.incentives:Object.values(e.offers_by_type??{}).flat().map(e=>({offer_type:e.offer_type,description:e.vehicle,amount:e.cash_amount,monthly:e.monthly_payment,term:e.term_months,apr:e.apr,expires:e.end_date})),r=e.total_incentives??e.total_incentives_found??n.length,i=n.length>
10,a=[e.year,e.make,e.model].filter(Boolean).join(" ");return(0,t.jsxs)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-3.5 border-b border-border/40",children:[(0,t.jsx)("span",{className:"text-lg","aria-hidden":!0,children:"🏷️"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-bold text-foreground",children:i?`${r} Active ${1===r?"Incentive":"Incentives"}`:"No Incentives Available"}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a})]})]}),i?(0,t.jsx)("div",{className:"px-4 divide-y divide-border/40",children:n.map((e,n)=>(0,t.jsx)(e1,{incentive:e},e.offer_type?`${e.offer_type}-${n}`:n))}):(0,t.jsx)("div",{className:"px-4 py-4",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No manufacturer incentives are currently available for this vehicle."})})]})}],169289);let e2={strong:{label:"Strong Leverage",color:"text-emerald-700 dark:text-emerald-400",bg:"bg-emerald-500/10 border-emerald-500/30",barColor:"bg-emerald-500"},moderate:{label:"Moderate Leverage",color:"text-amber-700 dark:text-amber-400",bg:"bg-amber-500/10 border-amber-500/30",barColor:"bg-amber-500"},weak:{label:"Weak Leverage",color:"text-red-700 dark:text-red-400",bg:"bg-red-500/10 border-red-500/30",barColor:"bg-red-500"}};function e5({warranty:e}){var n;let r=[function(e){if(null==e)return"";let t=e/12;return Number.isInteger(t)?`${t} yr`:`${e} mo`}(e.months),null==(n=e.miles)?"":new Intl.NumberFormat("en-US").format(n)+" mi"].filter(Boolean).join(" / ");return(0,t.jsxs)("div",{className:"flex items-center justify-between py-2.5 gap-3",children:[(0,t.jsx)("span",{className:"text-sm text-foreground",children:e.type??"Coverage"}),(0,t.jsx)("span",{className:"text-sm font-semibold tabular-nums text-foreground shrink-0",children:r||"—"})]})}function e4(e){return null==e?"N/A":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}e.s(["DomAnalysisCard",0,function({data:e}){let n=e.leverage_assessment&&e.leverage_assessment in e2?e2[e.leverage_assessment]:e2.moderate,i=e.avg_dom_similar??30,a=e.vehicle_dom??0,l=i>0?Math.min(100,Math.round(a/(2*i)*100)):Math.min(100,a),s=Math.min(100,Math.round(i/(2*i)*100));return(0,t.jsx)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:(0,t.jsxs)("div",{className:"p-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:"This Vehicle"}),(0,t.jsxs)("p",{className:"text-3xl font-bold tabular-nums text-foreground leading-none",children:[e.vehicle_dom??"—",(0,t.jsx)("span",{className:"text-sm font-normal text-muted-foreground ml-1",children:"days"})]})]}),(0,t.jsxs)("div",{className:"border-l border-border/40 pl-4",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:"Avg Similar"}),(0,t.jsxs)("p",{className:"text-xl font-semibold tabular-nums text-muted-foreground leading-none",children:[e.avg_dom_similar??"—",(0,t.jsx)("span",{className:"text-sm font-normal ml-1",children:"days"})]})]})]}),(0,t.jsx)("span",{className:(0,r.cn)("shrink-0 text-[11px] font-semibold px-2.5 py-1.5 rounded-full border",n.color,n.bg),children:n.label})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"relative h-2 bg-muted rounded-full overflow-visible",children:[(0,t.jsx)("div",{className:(0,r.cn)("absolute left-0 top-0 h-full rounded-full transition-all duration-700",n.barColor),style:{width:`${l}%`}}),(0,t.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 w-0.5 h-4 bg-foreground
1/40 rounded-full",style:{left:`${s}%`},"aria-label":"Market average"})]}),(0,t.jsxs)("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{children:"Just listed"}),(0,t.jsxs)("span",{className:"tabular-nums",children:["Avg (",i,"d)"]}),(0,t.jsx)("span",{children:"Sitting long"})]})]}),null!=e.percentile&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground tabular-nums",children:["This vehicle has been listed longer than"," ",(0,t.jsxs)("span",{className:"font-semibold text-foreground",children:[e.percentile,"%"]})," ","of similar vehicles."]}),e.insight&&(0,t.jsx)("div",{className:"rounded-lg bg-muted/40 px-3 py-2.5",children:(0,t.jsx)("p",{className:"text-xs text-foreground leading-relaxed",children:e.insight})})]})})}],617365),e.s(["WarrantyCard",0,function({data:e}){let n=e.warranties??[],r=[e.year,e.make,e.model].filter(Boolean).join(" ");return(0,t.jsxs)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border/40",children:[(0,t.jsx)("div",{className:"flex size-7 items-center justify-center rounded-full bg-primary/10",children:(0,t.jsx)(eW.ShieldCheck,{className:"size-3.5 text-primary"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Warranty Coverage"}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:r})]})]}),n.length>0?(0,t.jsx)("div",{className:"px-4 divide-y divide-border/40",children:n.map((e,n)=>(0,t.jsx)(e5,{warranty:e},e.type??n))}):(0,t.jsx)("div",{className:"px-4 py-4",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No warranty information available for this vehicle."})})]})}],304615);let e3={depreciation:{label:"Depreciation",color:"bg-red-500"},maintenance:{label:"Maintenance",color:"bg-amber-500"},insurance:{label:"Insurance",color:"bg-blue-500"},fuel:{label:"Fuel",color:"bg-emerald-500"},interest:{label:"Interest",color:"bg-purple-500"},fees:{label:"Fees",color:"bg-gray-400"}};e.s(["CostToOwnCard",0,function({data:e}){let n=[e.make,e.model].filter(Boolean).join(" ")||"Vehicle",i=e.total_cost_to_own??0,a=e.breakdown?Object.entries(e.breakdown).filter(([,e])=>null!=e&&e>0).map(([e,t])=>({key:e,value:t,pct:i>0?t/i*100:0,...e3[e]??{label:e,color:"bg-gray-400"}})).sort((e,t)=>t.value-e.value):[];return(0,t.jsx)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:(0,t.jsxs)("div",{className:"p-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:["Total Cost to Own",e.ownership_years?` \xb7 ${e.ownership_years} Years`:""]}),(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:n})]}),(0,t.jsx)("div",{className:"text-right shrink-0",children:(0,t.jsx)("p",{className:"text-2xl font-bold tabular-nums text-foreground leading-none",children:e4(i)})})]}),(null!=e.new_price||null!=e.resale_value)&&(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[null!=e.new_price&&(0,t.jsxs)("span",{className:"tabular-nums text-muted-foreground",children:["New:"," ",(0,t.jsx)("span",{className:"font-semibold text-foreground",children:e4(e.new_price)})]}),null!=e.new_price&&null!=e.resale_value&&(0,t.jsx)("span",{className:"text-muted-foreground",children:"→"}),null!=e.resale_value&&(0,t.jsxs)("span",{className:"tabular-nums text-muted-foreground",children:["Resale:"," ",(0,t.jsx)("span",{className:"font-semibold text-foreground",children:e4(e.resale_value)})]})]}),a.length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex h-3 rounded-full overflow-hidden",children:a.map(e=>(0,t.jsx)("div",{className:(0,r.cn)("h-full transition-all duration-500",e.color),style:{width:`${e.pct}%`},title:`${e.label}: ${e4(e.value)}`},e.key))}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:a.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("div",{className:(0,r.cn)("w-2 h-2 rounded-full shrink-0",e.color)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.label})]}),(0,t.jsx)("span",{className:"text-xs font-semibold tabular-nums text-foreground",children:e4(e.value)})]},e.key))})]}),e.best_in_class&&e.best_in_class.length>0&&(0,t.jsxs)("div",{className:"rounded-lg bg-muted/40 overflow-hidden",children:[(0,t.jsx)("div",{className:"px-3 py-2 border-b border-border/40",children:(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-semibold",children:"Best in Class"})}),(0,t.jsx)("div",{className:"divide-y divide-border/40",children:e.best_in_class.map((e,n)=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2",children:[(0,t.jsxs)("span",{className:"text-xs text-foreground",children:[e.make," ",e.model]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs tabular-nums",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e4(e.new_price)}),(0,t.jsx)("span",{className:"font-semibold text-foreground",children:e4(e.cto)})]})]},n))})]})]})})}],301942),e.s(["DepreciationCurveCard",0,function({data:e}
1){let n=[e.make,e.model].filter(Boolean).join(" ")||"Vehicle",i=e.data_points??[],a=e.steepest_depreciation_year;return(0,t.jsx)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:(0,t.jsxs)("div",{className:"p-4 space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:"Depreciation Curve"}),(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:n})]}),null!=a&&null!=e.steepest_depreciation_pct&&(0,t.jsx)("div",{className:"flex items-center gap-2 rounded-lg bg-red-500/10 border border-red-500/20 px-3 py-2",children:(0,t.jsxs)("span",{className:"text-xs text-red-600 dark:text-red-400",children:["Steepest drop:"," ",(0,t.jsxs)("span",{className:"font-bold tabular-nums",children:["Year ",a]})," ","(",e.steepest_depreciation_pct.toFixed(1),"% loss)"]})}),i.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1 mb-1",children:[(0,t.jsx)("span",{className:"w-14 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Age"}),(0,t.jsx)("span",{className:"flex-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Value Retained"}),(0,t.jsx)("span",{className:"w-12 text-right text-[10px] uppercase tracking-wider text-muted-foreground",children:"%"})]}),i.map((e,n)=>{let i=e.percent_retained??0,l=null!=a&&e.years_old===a;return(0,t.jsxs)("div",{className:(0,r.cn)("flex items-center gap-2 rounded-lg px-2 py-1.5 transition-colors",l?"bg-red-500/10 border border-red-500/20":"hover:bg-muted/40"),children:[(0,t.jsx)("span",{className:"w-12 text-xs tabular-nums text-muted-foreground shrink-0",children:null!=e.years_old?`${e.years_old}yr`:"—"}),(0,t.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:(0,r.cn)("h-full rounded-full transition-all duration-500",l?"bg-red-500":"bg-primary"),style:{width:`${Math.max(0,Math.min(100,i))}%`}})}),(0,t.jsxs)("span",{className:(0,r.cn)("w-12 text-right text-xs font-semibold tabular-nums shrink-0",l?"text-red-600 dark:text-red-400":"text-foreground"),children:[i.toFixed(0),"%"]})]},n)})]}),e.insight&&(0,t.jsx)("div",{className:"rounded-lg bg-muted/40 px-3 py-2.5",children:(0,t.jsx)("p",{className:"text-xs text-foreground leading-relaxed",children:e.insight})})]})})}],697972);let e9={Outstanding:{color:"text-emerald-700 dark:text-emerald-400",bg:"bg-emerald-500/10"},Clean:{color:"text-primary",bg:"bg-primary/5"},Average:{color:"text-amber-700 dark:text-amber-400",bg:"bg-amber-500/10"},Rough:{color:"text-muted-foreground",bg:"bg-muted"}};function e6(e){if(null==e)return!0;let t=e.trim().toLowerCase();return""===t||"na"===t||"n/a"===t}function e7(e){return!e6(e.trade_in)||!e6(e.private_party)||!e6(e.dealer_retail)}let e8=[{label:"Trade-In",key:"trade_in"},{label:"Private Party",key:"private_party"},{label:"Dealer Retail",key:"dealer_retail"}];e.s(["MarketValueCard",0,function({data:e}){let n=[e.year,e.make,e.model,e.trim].filter(Boolean).join(" ")||"Vehicle",i=(e.valuations??[]).filter(e7);return 0===i.length?null:(0,t.jsx)("div",{className:"copilot-message-enter rounded-2xl border border-border bg-card overflow-hidden",children:(0,t.jsxs)("div",{className:"p-4 space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:"Market Value Estimate"}),(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:n}),(e.mileage||e.state)&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 tabular-nums",children:[e.mileage&&`${e.mileage} mi`,e.state].filter(Boolean).join(" · ")})]}),(0,t.jsx)("div",{className:"rounded-lg border border-border divide-y divide-border/40 overflow-hidden",children:i.map((e,n)=>{let i=e.condition&&e.condition in e9?e9[e.condition]:{color:"text-foreground",bg:""},a=e8.filter(t=>!e6(e[t.key]));return(0,t.jsxs)("div",{className:(0,r.cn)("flex items-center justify-between gap-3 px-3 py-2.5 transition-colors",i.bg),children:[e.condition&&(0,t.jsx)("span",{className:(0,r.cn)("text-xs font-semibold shrink-0",i.color),children:e.condition}),(0,t.jsx)("div",{className:"flex flex-wrap items-start justify-end gap-x-4 gap-y-1.5",children:a.map(n=>(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("span",{className:"block text-[9px] uppercase tracking-wider text-muted-foreground",children:n.label}),(0,t.jsx)("span",{className:"block text-xs font-semibold tabular-nums text-foreground",children:e[n.key]})]},n.key))})]},n)})}),e.vin&&(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground tabular-nums",children:["VIN: ",e.vin]})]})})},"hasRenderableMarketValue",0,function(e){return(e.valuations??[]).some(e7)}],419218);var te=e.i(657688),tt=e.i(972520),tn=e.i(635408),tr=e.i(916677),ti=e.i(282046);let ta={src:e.i(843271).default,width:220,height:56,blurWidth:0,blurHeight:0};var tl=e.i(887381);function ts({label:e,sublabel:n,low:r,high:i}){var a,l;return(0,t.jsxs)("div",{className:"px-5 py-3 flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:e}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:n})]}),(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground tabular-nums whitespace-nowrap shrink-0",children:(a=r,l=i,a||l?a!==l&&a?`${td(a)} – ${td(l)}`:td(l||a):"—")})]})}function to({delta:e,className:n}){if(0===e)return null;let i=e>0,a=i?eR.TrendingUp:tn.TrendingDown;return(0,t.jsxs)("span",{className:(0,r.cn)("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-medium tabular-nums",i?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400":"bg-amber-500/10 text-amber-700 dark:text-amber-400",n),"aria-label":`Value ${i?"up":"down"} ${td(Math.abs(e))} this month`,children:[(0,t.jsx)(a,{className:"w-3 h-3"}),i?"+":"-",td(Math.abs(e))," this month"]})}function tc({logo:e,logoAlt:n,title:i,subtitle:a,href:l,partnerId:s,product:o,vehicleYear:c,vehicleMake:d,vehicleModel:u,vehicleVin:m}){return(0,t.jsxs)("a",{href:l,onClick:function(){(0,L.track)(D.EVENTS.PARTNER_CTA_CLICKED,{product:o,Location:"Copilot Garage Breakdown",vehicleMake:d,vehicleModel:u,vehicleYear:c,vehicleVin:m,partnerId:s})},target:"_blank",rel:"noopener noreferrer sponsored",className:(0,r.cn)("group/cta block text-left rounded-xl border border-border bg-background px-3.5 py-3","no-underline hover:border-primary/40 hover:bg-muted/40 active:scale-[0.99] transition-all","focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background"),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(te.default,{src:e,alt:n,className:"h-4 w-auto shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:i})]}),(0,t.jsx)(tt.ArrowRight,{className:"w-4 h-4 text-muted-foreground
1/60 group-hover/cta:text-primary group-hover/cta:translate-x-0.5 transition-all shrink-0"})]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground mt-1.5 leading-snug",children:a})]})}function td(e){return`$${Math.round(e).toLocaleString("en-US")}`}e.s(["GarageBreakdownCard",0,function({data:e,onSendMessage:r}){var i,l,s;let o,{vehicle:c,breakdown:d}=e,[u,m]=(0,n.useState)(!1),p=null!=c.year&&""!==c.year?Number(c.year):void 0,f=d.estimated_trade_in.high,h=d.month_over_month_delta;return(0,t.jsxs)("div",{className:"copilot-message-enter rounded-2xl border border-emerald-500/30 bg-card overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-5 bg-gradient-to-br from-emerald-500/10 to-emerald-500/5 border-b border-emerald-500/20",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-emerald-700 dark:text-emerald-400 mb-1 font-semibold",children:"Estimated Trade-In Today"}),(0,t.jsxs)("div",{className:"flex items-end gap-3 flex-wrap",children:[(0,t.jsx)("span",{className:"text-3xl font-bold text-foreground tabular-nums",children:td(f)}),(0,t.jsx)(to,{delta:h,className:"ml-auto"})]})]}),(0,t.jsxs)("div",{className:"divide-y divide-emerald-500/20",children:[(0,t.jsx)(ts,{label:"Dealer trade-in",sublabel:"Lowest, but sales-tax credit can offset",low:d.dealer_trade_in.low,high:d.dealer_trade_in.high}),(0,t.jsx)(ts,{label:"Private-party sale",sublabel:"Most effort, best number",low:d.private_party.low,high:d.private_party.high})]}),!a.IS_FAIRAUTO&&(0,t.jsxs)("div",{className:"p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 border-t border-emerald-500/20",children:[a.tenantInsurance?(0,t.jsx)(tc,{logo:tr.brandIcon,logoAlt:a.tenantConfig.name,title:"Insurance",subtitle:`Get a quote from ${a.tenantInsurance.name}.`,href:a.tenantInsurance.quoteUrl,partnerId:a.tenantInsurance.partnerId,product:"insurance"}):(0,t.jsx)(tc,{logo:ta,logoAlt:"Insurify",title:"Insurance",subtitle:"Compare quotes from 100+ carriers.",href:"https://insurance.caredge.com/",partnerId:"insurify",product:"insurance"}),(0,t.jsx)(tc,{logo:tl.default,logoAlt:"Fair Warranty",title:"Warranty",subtitle:"Extended protection plans.",href:(i=c.make,l=c.model,s=c.vin,o=new URL("https://app.v2.fairwarranty.com/quote/vehicle-information?sourceId=egd64c"),p&&o.searchParams.set("year",String(p)),i&&o.searchParams.set("make",i),l&&o.searchParams.set("model",l),s&&o.searchParams.set("vin",s),o.toString()),partnerId:"fair_warranty",product:"vsc",vehicleYear:p,vehicleMake:c.make??void 0,vehicleModel:c.model??void 0,vehicleVin:c.vin??void 0})]}),(0,t.jsx)(ti.CarMaxEmbed,{open:u,onOpenChange:m,vehicleInfo:{vin:c.vin??void 0,make:c.make??void 0,model:c.model??void 0,mileage:c.mileage,state:c.state??void 0,zipCode:c.zip_code??void 0}})]})}],881256);var tu=e.i(531245),tm=e.i(280566),tp=e.i(686311),tf=e.i(751975);function th(e){return`$${(e/100).toLocaleString("en-US",{maximumFractionDigits:0})}`}function tg({status:e}){return(0,t.jsx)("span",{className:(0,r.cn)("mt-0.5 size-2 shrink-0 rounded-full","offer_received"===e&&"bg-emerald-500","in_dialog"===e&&"bg-amber-500","waiting"===e&&"bg-muted-foreground/30")})}function tx({status:e}){return"offer_received"===e?(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[11px] font-semibold text-emerald-700 dark:text-emerald-400",children:"Offer received"}):"in_dialog"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-[11px] font-semibold text-amber-700 dark:text-amber-400",children:[(0,t.jsx)(tp.MessageSquare,{className:"size-3","aria-hidden":"true"}),"In dialog"]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[11px] font-semibold text-muted-foreground",children:[(0,t.jsx)(tm.CircleDashed,{className:"size-3","aria-hidden":"true"}),"Waiting"]})}e.s(["OnboardingDealerBoardCard",0,function({board:e}){return(0,t.jsxs)("div",{className:"w-full overflow-hidden rounded-2xl border border-border bg-card shadow-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-border/70 bg-muted/40 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,t.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,t.jsx)(tu.Bot,{className:"size-4","aria-hidden":"true"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"truncate text-sm font-semibold text-foreground",children:e.car}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.dealers_count," dealer",1!==e.dealers_count?"s":""," contacted"]})]})]}),e.best_offer_cents&&(0,t.jsxs)("div",{className:"shrink-0 text-right",children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Best offer"}),(0,t.jsx)("p",{className:"text-sm font-bold tabular-nums text-emerald-600 dark:text-emerald-400",children:th(e.best_offer_cents)})]})]}),(0,t.jsx)("ul",{className:"divide-y divide-border/50",children:e.dealers.map((e,n)=>(0,t.jsxs)("li",{className:"flex items-start gap-3 px-4 py-3",children:[(0,t.jsx)(tg,{status:e.status}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm font-semibold text-foreground",children:e.name}),(e.city??e.state)&&(0,t.jsxs)("p",{className:"mt-0.5 flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(R.MapPin,{className:"size-3 shrink-0","aria-hidden":"true"}
1),[e.city,e.state].filter(Boolean).join(", ")]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[(0,t.jsx)(tx,{status:e.status}),"offer_received"===e.status&&e.price_cents&&(0,t.jsx)("p",{className:"text-xs font-semibold tabular-nums text-foreground",children:th(e.price_cents)}),"offer_received"===e.status&&e.msrp_cents&&e.price_cents&&e.msrp_cents>e.price_cents&&(0,t.jsxs)("p",{className:"flex items-center gap-0.5 text-[11px] tabular-nums text-emerald-600 dark:text-emerald-400",children:[(0,t.jsx)(tf.Tag,{className:"size-3","aria-hidden":"true"}),"↓",th(e.msrp_cents-e.price_cents)," vs MSRP"]})]})]},`${e.name}-${n}`))})]})}],571811);var tb=e.i(98919),ty=e.i(351361),tv=e.i(234511);let tk={allstate:{...ty.INSURANCE_CTA,__key:"insurance"},fair_warranty:{...ty.VSC_CTA,__key:"vsc"}},tj={insurify:ta};e.s(["ProtectionPartnersCard",0,function({data:e}){if(a.IS_FAIRAUTO)return null;if(a.tenantInsurance)return e.partners?.some(e=>"insurance"===e.category)?(0,t.jsx)("div",{className:"copilot-message-enter",children:(0,t.jsx)(tv.TenantInsuranceCta,{variant:"inline",location:"Copilot",vehicleYear:e.vehicle_context?.year,vehicleMake:e.vehicle_context?.make,vehicleModel:e.vehicle_context?.model})}):null;if(!e?.partners?.length)return null;let n=new Set,r=e.partners.filter(e=>!n.has(e.partner_id)&&(n.add(e.partner_id),!0));return(0,t.jsx)("div",{className:"copilot-message-enter space-y-2",children:r.map(n=>(function(e,n){let r=n?.year,i=n?.make,a=n?.model,l=tk[e.partner_id];if(l){let{__key:n,...s}=l;return(0,t.jsx)(ty.PartnerCTA,{...s,partnerId:e.partner_id,location:"Copilot",vehicleYear:r,vehicleMake:i,vehicleModel:a},e.partner_id)}return(0,t.jsx)(ty.PartnerCTA,{icon:tb.Shield,logo:tj[e.partner_id],partnerId:e.partner_id,title:e.name,subtitle:e.tagline,buttonText:e.cta_label,badge:e.name,product:function(e){switch(e){case"insurance":return"insurance";case"warranty":return"vsc";default:return"u">typeof console&&console.warn('[ProtectionPartnersCard] unknown partner category, defaulting to "insurance":',e),"insurance"}}(e.category),location:"Copilot",href:e.url,vehicleYear:r,vehicleMake:i,vehicleModel:a},e.partner_id)})(n,e.vehicle_context??null))})}],861150);var tw=e.i(338703),tN=e.i(227835),t_=e.i(780559),tC=e.i(892029),tS=e.i(943576);e.s(["ReferralChoicePills",0,function({sessionId:e,onIntroduce:r,onQuestions:i}){let a=(0,I.useRouter)(),{isSignedIn:l,isLoaded:s}=(0,tw.useAuth)(),{open:o}=(0,ef.useAuthModal)(),{betaFormatted:c}
1=(0,tN.useAiNegotiatorPricing)(),[d,u]=(0,n.useState)("initial"),m=(0,n.useMemo)(()=>(0,t_.buildCheckoutVehicleParams)(e),[e]),p=`/checkout/ai-buying-agent?${m?`${m}&`:""}from=copilot`,f=(0,n.useRef)(!1);return((0,n.useEffect)(()=>{f.current||(f.current=!0,(0,tC.trackEvent)(tS.COPILOT_REFERRAL_GA4.CHOICE_SHOWN,{Name:"Copilot Referral - Choice Shown",Category:"Marketing",source:"copilot"}))},[]),"initial"===d)?(0,t.jsxs)("div",{className:"rounded-2xl border bg-card p-4 space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Ready to get some quotes, or do you have any questions?"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsx)(Z.Button,{type:"button",onClick:function(){(0,tC.trackEvent)(tS.COPILOT_REFERRAL_GA4.QUOTES_CLICKED,{Name:"Copilot Referral - Quotes Clicked",Category:"Marketing",source:"copilot"}),u("quotes")},className:"flex-1",children:"Quotes"}),(0,t.jsx)(Z.Button,{type:"button",variant:"outline",onClick:function(){(0,tC.trackEvent)(tS.COPILOT_REFERRAL_GA4.QUESTIONS_CLICKED,{Name:"Copilot Referral - Questions Clicked",Category:"Marketing",source:"copilot"}),i?.()},className:"flex-1",children:"Questions"})]})]}):(0,t.jsxs)("div",{className:"rounded-2xl border bg-card p-4 space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Ready for the next step?"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsx)(Z.Button,{type:"button",onClick:function(){(0,tC.trackEvent)(tS.COPILOT_REFERRAL_GA4.INTRODUCE_CLICKED,{Name:"Copilot Referral - Introduce Clicked",Category:"Marketing",source:"copilot"}),r()},className:"flex-1",children:"Introduce me — free"}),(0,t.jsxs)(Z.Button,{type:"button",variant:"outline",onClick:function(){((0,tC.trackEvent)(tS.COPILOT_REFERRAL_GA4.NEGOTIATE_CLICKED,{Name:"Copilot Referral - Negotiate Clicked",Category:"Marketing",source:"copilot"}),s&&!l)?o({isSignIn:!0,source:"Copilot Referral - Choice Pills",redirectUrl:`${window.location.origin}${eP.default.env.NEXT_PUBLIC_BASE_PATH??""}${p}`}):((0,t_.markPendingVehicleForCheckout)(e),a.push(p))},className:"flex-1",children:["Negotiate for me — ",c]})]})]})}],446773)},126568,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g;function u(e){return e?e.replace(d,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,d=1;function m(e){var t=e.match(i);t&&(n+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:n,column:d};return function(t){return t.position=new f(e),g(a),t}}function f(e){this.start=e,this.end={line:n,column:d},this.source=t.source}function h(r){var i=Error(t.source+":"+n+":"+d+": "+r);if(i.reason=r,i.filename=t.source,i.line=n,i.column=d,i.source=e,t.silent);else throw i}function g(t){var n=t.exec(e);if(n){var r=n[0];return m(r),e=e.slice(r.length),n}}function x(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return h("End of comment missing");var r=e.slice(2,n-2);return d+=2,m(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}f.prototype.content=e,g(a);var y,v=[];for(x(v);y=function(){var e=p(),t=g(l);if(t){if(b(),!g(s))return h("property missing ':'");var n=g(o),i=e({type:"declaration",property:u(t[0].replace(r,"")),value:n?u(n[0].replace(r,"")):""});return g(c),i}}();)!1!==y&&(v.push(y),x(v));return v}},270454,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,i.default)(e),a="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:i}=e;a?t(r,i,e):i&&((n=n||{})[r]=i)}),n};let i=r(e.r(126568))},745575,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}
1),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(e,t){return t.toUpperCase()},c=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||a.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,c):e.replace(l,c)).replace(i,o))}},515511,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(270454)),i=e.r(745575);function a(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a},104100,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},o=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!a)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){a&&"__proto__"===t.name?a(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(l)return l(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,l,u=arguments[0],m=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},m=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});m<p;++m)if(t=arguments[m],null!=t)for(n in t)r=d(u,n),u!==(i=d(t,n))&&(f&&i&&(o(i)||(a=s(i)))?(a?(a=!1,l=r&&s(r)?r:[]):l=r&&o(r)?r:{},c(u,{name:n,newValue:e(f,l,i)})):void 0!==i&&c(u,{name:n,newValue:i}));return u}},918789,877894,257229,752766,e=>{"use strict";function t(){}function n(){}let r=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a={};function l(e,t){return((t||a).jsx?i:r).test(e)}let s=/[ \t\n\f\r]/g;function o(e){return""===e.replace(s,"")}class c{constructor(e,t){this.attribute=t,this.property=e}}c.prototype.attribute="",c.prototype.booleanish=!1,c.prototype.boolean=!1,c.prototype.commaOrSpaceSeparated=!1,c.prototype.commaSeparated=!1,c.prototype.defined=!1,c.prototype.mustUseProperty=!1,c.prototype.number=!1,c.prototype.overloadedBoolean=!1,c.prototype.property="",c.prototype.spaceSeparated=!1,c.prototype.space=void 0;let d=0,u=b(),m=b(),p=b(),f=b(),h=b(),g=b(),x=b();function b(){return 2**++d}e.s(["boolean",0,u,"booleanish",0,m,"commaOrSpaceSeparated",0,x,"commaSeparated",0,g,"number",0,f,"overloadedBoolean",0,p,"spaceSeparated",0,h],400744);var y=e.i(400744);let v=Object.keys(y);class k extends c{constructor(e,t,n,r){let i=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++i<v.length;){const e=v[i];!function(e,t,n){n&&(e[t]=n)}(this,v[i],(n&y[e])===y[e])}}}function j(e){return e.toLowerCase()}k.prototype.defined=!0;let w=/[A-Z]/g,N=/-[a-z]/g,_=/^data[-\w.:]+$/i;function C(e){return"-"+e.toLowerCase()}function S(e){return e.charAt(1).toUpperCase()}let E={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class T{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function A(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new T(n,r,t)}function I(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new k(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[j(r)]=r,n[j(a.attribute)]=r}return new T(t,n,e.space)}T.prototype.normal={},T.prototype.property={},T.prototype.space=void 0;let P=I({properties:{ariaActiveDescendant:null,ariaAtomic:m,ariaAutoComplete:null,ariaBusy:m,ariaChecked:m,ariaColCount:f,ariaColIndex:f,ariaColSpan:f,ariaControl
1s:h,ariaCurrent:null,ariaDescribedBy:h,ariaDetails:null,ariaDisabled:m,ariaDropEffect:h,ariaErrorMessage:null,ariaExpanded:m,ariaFlowTo:h,ariaGrabbed:m,ariaHasPopup:null,ariaHidden:m,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:h,ariaLevel:f,ariaLive:null,ariaModal:m,ariaMultiLine:m,ariaMultiSelectable:m,ariaOrientation:null,ariaOwns:h,ariaPlaceholder:null,ariaPosInSet:f,ariaPressed:m,ariaReadOnly:m,ariaRelevant:null,ariaRequired:m,ariaRoleDescription:h,ariaRowCount:f,ariaRowIndex:f,ariaRowSpan:f,ariaSelected:m,ariaSetSize:f,ariaSort:null,ariaValueMax:f,ariaValueMin:f,ariaValueNow:f,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function L(e,t){return t in e?e[t]:t}function D(e,t){return L(e,t.toLowerCase())}let M=I({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:g,acceptCharset:h,accessKey:h,action:null,allow:null,allowFullScreen:u,allowPaymentRequest:u,allowUserMedia:u,alt:null,as:null,async:u,autoCapitalize:null,autoComplete:h,autoFocus:u,autoPlay:u,blocking:h,capture:null,charSet:null,checked:u,cite:null,className:h,cols:f,colSpan:null,content:null,contentEditable:m,controls:u,controlsList:h,coords:f|g,crossOrigin:null,data:null,dateTime:null,decoding:null,default:u,defer:u,dir:null,dirName:null,disabled:u,download:p,draggable:m,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:u,formTarget:null,headers:h,height:f,hidden:p,high:f,href:null,hrefLang:null,htmlFor:h,httpEquiv:h,id:null,imageSizes:null,imageSrcSet:null,inert:u,inputMode:null,integrity:null,is:null,isMap:u,itemId:null,itemProp:h,itemRef:h,itemScope:u,itemType:h,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:u,low:f,manifest:null,max:null,maxLength:f,media:null,method:null,min:null,minLength:f,multiple:u,muted:u,name:null,nonce:null,noModule:u,noValidate:u,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:u,optimum:f,pattern:null,ping:h,placeholder:null,playsInline:u,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:u,referrerPolicy:null,rel:h,required:u,reversed:u,rows:f,rowSpan:f,sandbox:h,scope:null,scoped:u,seamless:u,selected:u,shadowRootClonable:u,shadowRootDelegatesFocus:u,shadowRootMode:null,shape:null,size:f,sizes:null,slot:null,span:f,spellCheck:m,src:null,srcDoc:null,srcLang:null,srcSet:null,start:f,step:null,style:null,tabIndex:f,target:null,title:null,translate:null,type:null,typeMustMatch:u,useMap:null,value:m,width:f,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:h,axis:null,background:null,bgColor:null,border:f,borderColor:null,bottomMargin:f,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:u,declare:u,event:null,face:null,frame:null,frameBorder:null,hSpace:f,leftMargin:f,link:null,longDesc:null,lowSrc:null,marginHeight:f,marginWidth:f,noResize:u,noHref:u,noShade:u,noWrap:u,object:null,profile:null,prompt:null,rev:null,rightMargin:f,rules:null,scheme:null,scrolling:m,standby:null,summary:null,text:null,topMargin:f,valueType:null,version:null,vAlign:null,vLink:null,vSpace:f,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:u,disableRemotePlayback:u,prefix:null,property:null,results:f,security:null,unselectable:null},space:"html",transform:D}),O=I({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRen
1dering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:x,accentHeight:f,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:f,amplitude:f,arabicForm:null,ascent:f,attributeName:null,attributeType:null,azimuth:f,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:f,by:null,calcMode:null,capHeight:f,className:h,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRen
1dering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:f,diffuseConstant:f,direction:null,display:null,dur:null,divisor:f,dominantBaseline:null,download:u,dx:null,dy:null,edgeMode:null,editable:null,elevation:f,enableBackground:null,end:null,event:null,exponent:f,externalResourcesRequired:null,fill:null,fillOpacity:f,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:g,g2:g,glyphName:g,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:f,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:f,horizOriginX:f,horizOriginY:f,id:null,ideographic:f,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:f,k:f,k1:f,k2:f,k3:f,k4:f,kernelMatrix:x,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:f,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:f,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:f,overlineThickness:f,paintOrder:null,panose1:null,path:null,pathLength:f,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:h,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:f,pointsAtY:f,pointsAtZ:f,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:x,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:x,rev:x,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:x,requiredFeatures:x,requiredFonts:x,requiredFormats:x,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:f,specularExponent:f,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:f,strikethroughThickness:f,string:null,stroke:null,strokeDashArray:x,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:f,strokeOpacity:f,strokeWidth:null,style:null,surfaceScale:f,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:x,tabIndex:f,tableValues:null,target:null,targetX:f,targetY:f,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:x,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:f,underlineThickness:f,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:f,values:null,vAlphabetic:f,vMathematical:f,vectorEffect:null,vHanging:f,vIdeographic:f,version:null,vertAdvY:f,vertOriginX:f,vertOriginY:f,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:f,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:L}),R=I({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>
1"xlink:"+t.slice(5).toLowerCase()}),F=I({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:D}),$=I({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),U=A([P,M,R,F,$],"html"),z=A([P,O,R,F,$],"svg");var B=e.i(515511);let V=W("end"),H=W("start");function W(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function q(e){return e&&"object"==typeof e?"position"in e||"type"in e?K(e.position):"start"in e||"end"in e?K(e):"line"in e||"column"in e?G(e):"":""}function G(e){return Y(e&&e.line)+":"+Y(e&&e.column)}function K(e){return G(e&&e.start)+"-"+G(e&&e.end)}function Y(e){return e&&"number"==typeof e?e:1}class Z extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=q(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Z.prototype.file="",Z.prototype.name="",Z.prototype.reason="",Z.prototype.message="",Z.prototype.stack="",Z.prototype.column=void 0,Z.prototype.line=void 0,Z.prototype.ancestors=void 0,Z.prototype.cause=void 0,Z.prototype.fatal=void 0,Z.prototype.place=void 0,Z.prototype.ruleId=void 0,Z.prototype.source=void 0;let X={}.hasOwnProperty,Q=new Map,J=/[A-Z]/g,ee=new Set(["table","tbody","thead","tfoot","tr"]),et=new Set(["td","th"]),en="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function er(e,n,r){var i,a,l,s,d,u,m,p,f;let h,g,x,b,y,v,T,A,I,P,L;return"element"===n.type?(i=e,a=n,l=r,g=h=i.schema,"svg"===a.tagName.toLowerCase()&&"html"===h.space&&(i.schema=z),i.ancestors.push(a),x=es(i,a.tagName,!1),b=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&X.call(t.properties,r)){let a=function(e,t,n){let r=function(e,t){let n=j(t),r=t,i=c;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&_.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(N,S);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!N.test(e)){let n=e.replace(w,C);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=k}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,B.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new Z("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=en+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)X.call(e,t)&&(n[function(e){let t=e.replace(J,ec);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?E[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(a){let[r,l]=a;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof l&&et.has(t.tagName)?n=l:i[r]=l}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(i,a),y=el(i,a),ee.has(a.tagName)&&(y=y.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&o(e.value):o(e))})),ei(i,b,x,a),ea(b,y),i.ancestors.pop(),i.schema=h,i.create(a,x,b,l)):"mdxFlowExpression"===n.type||"mdxTextExpression"===n.type?function(e,n){if(n.data&&n.data.estree&&e.evaluater){let r=n.data.estree.body[0];return t("ExpressionStatement"===r.type),e.evaluater.evaluateExpression(r.expression)}eo(e,n.position)}(e,n):"mdxJsxFlowElement"===n.type||"mdxJsxTextElement"===n.type?(s=e,d=n,u=r,T=v=s.schema,"svg"===d.name&&"html"===v.space&&(s.schema=z),s.ancestors.push(d),A=null===d.name?s.Fragment:es(s,d.name,!0),I=function(e,n){let r={};for(let i of n.attributes)if("mdxJsxExpressionAttribute"===i.type)if(i.data&&i.data.estree&&e.evaluater){let n=i.data.estree.body[0];t("ExpressionStatement"===n.type);let a=n.expression;t("ObjectExpression"===a.type);let l=a.properties[0];t("SpreadElement"===l.type),Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else eo(e,n.position);else{let a,l=i.name;if(i.value&&"object"==typeof i.value)if(i.value.data&&i.value.data.estree&&e.evaluater){let n=i.value.data.estree.body[0];t("ExpressionStatement"===n.type),a=e.evaluater.evaluateExpression(n.expression)}else eo(e,n.position);else a=null===i.value||i.value;r[l]=a}return r}(s,d),P=el(s,d),ei(s,I,A,d),ea(I,P),s.ancestors.pop(),s.schema=v,s.create(d,A,I,u)):"mdxjsEsm"===n.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eo(e,t.position)}(e,n):"root"===n.type?(m=e,p=n,f=r,ea(L={},el(m,p)),m.create(p,m.Fragment,L,f)):"text"===n.type?n.value:void 0}function ei(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ea(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function el(e,t){let n=[],r=-1,i=e.passKeys?new Map:Q;for(;++r<t.children.length;){let a,l=t.children[r];if(e.passKeys){let e="element"===l.type?l.tagName:"mdxJsxFlowElement"===l.type||"mdxJsxTextElement"===l.type?l.name:void 0;if(e){let t=i.get(e)||0;a=e+"-"+t,i.set(e,t+1)}}let s=er(e,l,a);void 0!==s&&n.push(s)}return n}function es(e,n,r){let i;if(r)if(n.includes(".")){let e,r=n.split("."),a=-1;for(;++a<r.length;){let t=l(r[a])?{type:"Identifier",name:r[a]}:{type:"Literal",value:r[a]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(a&&"Literal"===t.type),optional:!1}:t}t(e,"always a result"),i=e}else i=l(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};else i={type:"Literal",value:n};if("Literal"===i.type){let t=i.value;return X.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(i);eo(e)}function eo(e,t){let n=new Z("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=en+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ec(e){return"-"+e.toLowerCase()}let ed={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var eu=e.i(843476);e.i(271645);let em={};function ep(e,t){let n=t||em;return ef(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function ef(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eh(e.children,t,n)}return Array.isArray(e)?eh(e,t,n):""}function eh(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=ef(e[i],t,n);return r.join("")}function eg(e,t,n,r){let i,a=e.length,l=0;if(t=t<0?-t>a?0:a+t:t>a?a:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);l<r.length;)(i=r.slice(l,l+1e4)).unshift(t,0),e.splice(...i),l+=1e4,t+=1e4}function ex(e,t){return e.length>0?(eg(e,e.length,0,t),e):t}let eb={}.hasOwnProperty;function ey(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(eb.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];if(a)for(r in a){eb.call(i,r)||(i[r]=[]);let e=a[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);eg(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let ev=eP(/[A-Za-z]/),ek=eP(/[\dA-Za-z]/),ej=eP(/[#-'*+\--9=?A-Z^-~]/);function ew(e){return null!==e&&(e<32||127===e)}let eN=eP(/\d/),e_=eP(/[\dA-Fa-f]/),eC=eP(/[!-/:-@[-`{-~]/);function eS(e){return null!==e&&e<-2}function eE(e){return null!==e&&(e<0||32===e)}function eT(e){return -2===e||-1===e||32===e}let eA=eP(/\p{P}|\p{S}/u),eI=eP(/\s/);function eP(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function eL(e,t,n,r){let i=r?r-1:1/0,a=0;return function(r){return eT(r)?(e.enter(n),function r(l){return eT(l)&&a++<i?(e.consume(l),r):(e.exit(n),t(l))}(r)):t(r)}}let eD={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eL(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return eS(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},eM={tokenize:function(e){let t,n,r,i=this,a=[],l=0;return s;function s(t){if(l<a.length){let n=a[l];return i.containerState=n[1],e.attempt(n[0].continuation,o,c)(t)}return c(t)}function o(e){if(l++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&x();let r=i.events.length,a=r;for(;a--;)if("exit"===i.events[a][0]&&"chunkFlow"===i.events[a][1].type){n=i.events[a][1].end;break}g(l);let s=r;for(;s<i.events.length;)i.events[s][1].end={...n},s++;return eg(i.events,a+1,0,i.events.slice(r)),i.events.length=s,c(e)}return s(e)}function c(n){if(l===a.length){if(!t)return m(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(eO,d,u)(n)}function d(e){return t&&x(),g(l),m(e)}function u(e){return i.parser.lazy[i.now().line]=l!==a.length,r=i.now().offset,f(e)}function m(t){return i.containerState={},e.attempt(eO,p,f)(t)}function p(e){return l++,a.push([i.currentConstruct,i.containerState]),m(e)}function f(r){if(null===r){t&&x(),g(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){h(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return eS(n)?(e.consume(n),h(e.exit("chunkFlow")),l=0,i.interrupt=void 0,s):(e.consume(n),t)}(r)}function h(e,a){let s=i.sliceStream(e);
1if(a&&s.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(s),i.parser.lazy[e.start.line]){let e,n,a=t.events.length;for(;a--;)if(t.events[a][1].start.offset<r&&(!t.events[a][1].end||t.events[a][1].end.offset>r))return;let s=i.events.length,o=s;for(;o--;)if("exit"===i.events[o][0]&&"chunkFlow"===i.events[o][1].type){if(e){n=i.events[o][1].end;break}e=!0}for(g(l),a=s;a<i.events.length;)i.events[a][1].end={...n},a++;eg(i.events,o+1,0,i.events.slice(s)),i.events.length=a}}function g(t){let n=a.length;for(;n-- >t;){let t=a[n];i.containerState=t[1],t[0].exit.call(i,e)}a.length=t}function x(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},eO={tokenize:function(e,t,n){return eL(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},eR={partial:!0,tokenize:function(e,t,n){return function(t){return eT(t)?eL(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||eS(e)?t(e):n(e)}}};class eF{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&e$(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),e$(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),e$(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);e$(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);e$(this.left,t.reverse())}}}function e$(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function eU(e){let t,n,r,i,a,l,s,o={},c=-1,d=new eF(e);for(;++c<d.length;){for(;c in o;)c=o[c];if(t=d.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===d.get(c-1)[1].type&&((r=0)<(l=t[1]._tokenizer.events).length&&"lineEndingBlank"===l[r][1].type&&(r+=2),r<l.length&&"content"===l[r][1].type))for(;++r<l.length&&"content"!==l[r][1].type;)"chunkText"===l[r][1].type&&(l[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(o,function(e,t){let n,r,i=e.get(t)[1],a=e.get(t)[2],l=t-1,s=[],o=i._tokenizer;!o&&(o=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let c=o.events,d=[],u={},m=-1,p=i,f=0,h=0,g=[0];for(;p;){for(;e.get(++l)[1]!==p;);s.push(l),!p._tokenizer&&(n=a.sliceStream(p),p.next||n.push(null),r&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(n),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),r=p,p=p.next}for(p=i;++m<c.length;)"exit"===c[m][0]&&"enter"===c[m-1][0]&&c[m][1].type===c[m-1][1].type&&c[m][1].start.line!==c[m][1].end.line&&(h=m+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),m=g.length;m--;){let t=c.slice(g[m],g[m+1]),n=s.pop();d.push([n,n+t.length-1]),e.splice(n,2,t)}for(d.reverse(),m=-1;++m<d.length;)u[f+d[m][0]]=f+d[m][1],f+=d[m][1]-d[m][0]-1;return u}(d,c)),c=o[c],s=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(i=d.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(d.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;
1n&&(t[1].end={...d.get(n)[1].start},(a=d.slice(n,c)).unshift(t),d.splice(n,c-n+1,a))}}return eg(e,0,1/0,d.slice(0)),!s}let ez={resolve:function(e){return eU(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):eS(t)?e.check(eB,a,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},eB={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eL(e,i,"linePrefix")};function i(i){if(null===i||eS(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},eV={tokenize:function(e){let t=this,n=e.attempt(eR,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,eL(e,e.attempt(this.parser.constructs.flow,r,e.attempt(ez,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},eH={resolveAll:eK()},eW=eG("string"),eq=eG("text");function eG(e){return{resolveAll:eK("text"===e?eY:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,l);return a;function a(e){return o(e)?i(e):l(e)}function l(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return o(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function o(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function eK(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function eY(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],a=t.sliceStream(i),l=a.length,s=-1,o=0;for(;l--;){let e=a[l];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)o++,s--;if(s)break;s=-1}else if(-2===e)r=!0,o++;else if(-1===e);else{l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){let a={type:n===e.length||r||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:i.start._bufferIndex+s,_index:i.start._index+l,line:i.end.line,column:i.end.column-o,offset:i.end.offset-o},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):(e.splice(n,0,["enter",a,t],["exit",a,t]),n+=2)}n++}return e}function eZ(e){return null===e||eE(e)||eI(e)?1:eA(e)?2:void 0}function eX(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}let eQ={name:"attention",resolveAll:function(e,t){let n,r,i,a,l,s,o,c,d=-1;for(;++d<e.length;)if("enter"===e[d][0]&&"attentionSequence"===e[d][1].type&&e[d][1]._close){for(n=d;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[d][1]).charCodeAt(0)){if((e[n][1]._close||e[d][1]._open)&&(e[d][1].end.offset-e[d][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[d][1].end.offset-e[d][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[d][1].end.offset-e[d][1].start.offset>1?2:1;let u={...e[n][1].end},m={...e[d][1].start};eJ(u,-s),eJ(m,s),a={type:s>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[d][1].start},end:m},i={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[d][1].start}},r={type:s>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[n][1].end={...a.start},e[d][1].start={...l.end},o=[],e[n][1].end.offset-e[n][1].start.offset&&(o=ex(o,[["enter",e[n][1],t],["exit",e[n][1],t]])),o=ex(o,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",i,t]]),o=ex(o,eX(t.parser.constructs.insideSpan.null,e.slice(n+1,d),t)),o=ex(o,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[d][1].end.offset-e[d][1].start.offset?(c=2,o=ex(o,[["enter",e[d][1],t],["exit",e[d][1],t]])):c=0,eg(e,n-1,d-n+3,o),d=n+o.length-c-2;break}}for(d=-1;++d<e.length;)"attentionSequence"===e[d][1].type&&(e[d][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,a=eZ(i);return function(l){return n=l,e.enter("attentionSequence"),function l(s){if(s===n)return e.consume(s),l;let o=e.exit("attentionSequence"),c=eZ(s),d=!c||2===c&&a||r.includes(s),u=!a||2===a&&c||r.includes(i);return o._open=!!(42===n?d:d&&(a||!u)),o._close=!!(42===n?u:u&&(c||!d)),t(s)}(l)}}};function eJ(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let e0={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return eT(t)?eL(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(e0,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return eT(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},e1={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return eC(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},e2=document.createElement("i");function e5(e){let t="&"+e+";";e2.innerHTML=t;let n=e2.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let e4={name:"characterReference",tokenize:function(e,t,n){let r,i,a=this,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),o):(e.enter("characterReferenceValue"),r=31,i=ek,c(t))}function o(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=e_,c):(e.enter("characterReferenceValue"),r=7,i=eN,c(t))}function c(s){if(59===s&&l){let r=e.exit("characterReferenceValue");return i!==ek||e5(a.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&l++<r?(e.consume(s),c):n(s)}}},e3={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},e9={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,a={partial:!0,tokenize:function(e,t,n){let a=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l};
1function l(t){return e.enter("codeFencedFence"),eT(t)?eL(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)}function o(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(a++,e.consume(i),t):a>=s?(e.exit("codeFencedFenceSequence"),eT(i)?eL(e,c,"whitespace")(i):c(i)):n(i)}(t)):n(t)}function c(r){return null===r||eS(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},l=0,s=0;return function(t){var a;let c;return a=t,l=(c=i.events[i.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=a,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(s++,e.consume(i),t):s<3?n(i):(e.exit("codeFencedFenceSequence"),eT(i)?eL(e,o,"whitespace")(i):o(i))}(a)};function o(a){return null===a||eS(a)?(e.exit("codeFencedFence"),i.interrupt?t(a):e.check(e3,d,f)(a)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||eS(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),o(i)):eT(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),eL(e,c,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(a))}function c(t){return null===t||eS(t)?o(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||eS(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),o(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function d(t){return e.attempt(a,f,u)(t)}function u(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return l>0&&eT(t)?eL(e,p,"linePrefix",l+1)(t):p(t)}function p(t){return null===t||eS(t)?e.check(e3,d,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||eS(n)?(e.exit("codeFlowValue"),p(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},e6={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),eL(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?a(n):eS(n)?e.attempt(e7,t,a)(n):(e.enter("codeFlowValue"),function n(r){return null===r||eS(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function a(n){return e.exit("codeIndented"),t(n)}}},e7={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):eS(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):eL(e,a,"linePrefix",5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):eS(e)?i(e):n(e)}}};function e8(e,t,n,r,i,a,l,s,o){let c=o||1/0,d=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),u):null===t||32===t||41===t||ew(t)?n(t):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(n))}function m(t){return 62===t?(e.exit("chunkString"),e.exit(s),u(t)):null===t||60===t||eS(t)?n(t):(e.consume(t),92===t?p:m)}function p(t){return 60===t||62===t||92===t?(e.consume(t),m):m(t)}function f(i){return!d&&(null===i||41===i||eE(i))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(i)):d<c&&40===i?(e.consume(i),d++,f):41===i?(e.consume(i),d--,f):null===i||32===i||40===i||ew(i)?n(i):(e.consume(i),92===i?h:f)}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function te(e,t,n,r,i,a){let l,s=this,o=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),c};function c(u){return o>999||null===u||91===u||93===u&&!l||94===u&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(u):93===u?(e.exit(a),e.enter(i),e.consume(u),e.exit(i),e.exit(r),t):eS(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(u))}function d(t){return null===t||91===t||93===t||eS(t)||o++>999?(e.exit("chunkString"),c(t)):(e.consume(t),l||(l=!eT(t)),92===t?u:d)}function u(t){return 91===t||92===t||93===t?(e.consume(t),o++,d):d(t)}}function tt(e,t,n,r,i,a){let l;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),l=40===t?41:t,s):n(t)};function s(n){return n===l?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),o(n))}function o(t){return t===l?(e.exit(a),s(l)):null===t?n(t):eS(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eL(e,o,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===l||null===t||eS(t)?(e.exit("chunkString"),o(t)):(e.consume(t),92===t?d:c)}function d(t){return t===l||92===t?(e.consume(t),c):c(t)}}function tn(e,t){let n;return function r(i){return eS(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):eT(i)?eL(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let ti={partial:!0,tokenize:function(e,t,n){return function(t){return eE(t)?tn(e,r)(t):n(t)};function r(t){return tt(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return eT(t)?eL(e,a,"whitespace")(t):a(t)}function a(e){return null===e||eS(e)?t(e):n(e)}}},ta=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],tl=["pre","script","style","textarea"],ts={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(eR,t,n)}}},to={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return eS(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tc={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&eg(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,a,l=e.length,s=0;for(;l--;)if(n=e[l][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[l][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[l][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=l,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(i=l);let o={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},d={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[i-2][1].start}};return a=ex(a=[["enter",o,t],["enter",c,t]],e.slice(r+1,r+s+3)),a=ex(a,[["enter",d,t]]
vendor: 3,769 bytes, line 1
1),a=ex(a,eX(t.parser.constructs.insideSpan.null,e.slice(r+s+4,i-3),t)),a=ex(a,[["exit",d,t],e[i-2],e[i-1],["exit",c,t]]),a=ex(a,e.slice(i+1)),a=ex(a,[["exit",o,t]]),eg(e,r,e.length,a),e},tokenize:function(e,t,n){let r,i,a=this,l=a.events.length;for(;l--;)if(("labelImage"===a.events[l][1].type||"labelLink"===a.events[l][1].type)&&!a.events[l][1]._balanced){r=a.events[l][1];break}return function(t){return r?r._inactive?d(t):(i=a.parser.defined.includes(tr(a.sliceSerialize({start:r.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s):n(t)};function s(t){return 40===t?e.attempt(td,c,i?c:d)(t):91===t?e.attempt(tu,c,i?o:d)(t):i?c(t):d(t)}function o(t){return e.attempt(tm,c,d)(t)}function c(e){return t(e)}function d(e){return r._balanced=!0,n(e)}}},td={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return eE(t)?tn(e,i)(t):i(t)}function i(t){return 41===t?c(t):e8(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function a(t){return eE(t)?tn(e,s)(t):c(t)}function l(e){return n(e)}function s(t){return 34===t||39===t||40===t?tt(e,o,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function o(t){return eE(t)?tn(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},tu={tokenize:function(e,t,n){let r=this;return function(t){return te.call(r,e,i,a,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function a(e){return n(e)}}},tm={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},tp={name:"labelStartImage",resolveAll:tc.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),a):n(t)}function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},tf={name:"labelStartLink",resolveAll:tc.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},th={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),eL(e,t,"linePrefix")}}},tg={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(a){var l;return e.enter("thematicBreak"),r=l=a,function a(l){return l===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),eT(n)?eL(e,a,"whitespace")(n):a(n))}(l)):i>=3&&(null===l||eS(l))?(e.exit("thematicBreak"),t(l)):n(l)}(l)}}},tx={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(eR,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,eL(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!eT(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine
1=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ty,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,eL(e,e.attempt(tx,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,l=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:eN(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(tg,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return eN(i)&&++l<10?(e.consume(i),t):(!r.interrupt||l<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),s(i)):n(i)}(t)}return n(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(eR,r.interrupt?n:o,e.attempt(tb,d,c))}
1function o(e){return r.containerState.initialBlankLine=!0,a++,d(e)}function c(t){return eT(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},tb={partial:!0,tokenize:function(e,t,n){let r=this;return eL(e,function(e){let i=r.events[r.events.length-1];return!eT(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},ty={partial:!0,tokenize:function(e,t,n){let r=this;return eL(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},tv={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),i||"definition"!==e[a][1].type||(i=a);let l={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",l,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=l,e.push(["exit",l,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var l;let s,o=i.events.length;for(;o--;)if("lineEnding"!==i.events[o][1].type&&"linePrefix"!==i.events[o][1].type&&"content"!==i.events[o][1].type){s="paragraph"===i.events[o][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||s)?(e.enter("setextHeadingLine"),r=t,l=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),eT(n)?eL(e,a,"lineSuffix")(n):a(n))}(l)):n(t)};function a(r){return null===r||eS(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,te.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function a(t){return(r=tr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l):n(t)}function l(t){return eE(t)?tn(e,s)(t):s(t)}function s(t){return e8(e,o,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function o(t){return e.attempt(ti,c,c)(t)}function c(t){return eT(t)?eL(e,d,"whitespace")(t):d(t)}function d(a){return null===a||eS(a)?(e.exit("definition"),i.parser.defined.push(r),t(a)):n(a)}}}},"disable",0,{null:[]},"document",0,{42:tx,43:tx,45:tx,48:tx,49:tx,50:tx,51:tx,52:tx,53:tx,54:tx,55:tx,56:tx,57:tx,62:e0},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,a=3;return"whitespace"===e[3][1].type&&(a+=2),i-2>a&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(a===i-1||i-4>a&&"whitespace"===e[i-2][1].type)&&(i-=a+1===i?2:4),i>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},r={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},eg(e,a,i-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var a;return e.enter("atxHeading"),a=i,e.enter("atxHeadingSequence"),function i(a){return 35===a&&r++<6?(e.consume(a),i):null===a||eE(a)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||eS(r)?(e.exit("atxHeading"),t(r)):eT(r)?eL(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||eE(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(a)):n(a)}(a)}}},42:tg,45:[tv,tg],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,a,l,s,o=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(l){return 33===l?(e.consume(l),d):47===l?(e.consume(l),i=!0,p):63===l?(e.consume(l),r=3,o.interrupt?t:P):ev(l)?(e.consume(l),a=String.fromCharCode(l),f):n(l)}function d(i){return 45===i?(e.consume(i),r=2,u):91===i?(e.consume(i),r=5,l=0,m):ev(i)?(e.consume(i),r=4,o.interrupt?t:P):n(i)}function u(r){return 45===r?(e.consume(r),o.interrupt?t:P):n(r)}function m(r){let i="CDATA[";return r===i.charCodeAt(l++)?(e.consume(r),l===i.length)?o.interrupt?t:N:m:n(r)}
1function p(t){return ev(t)?(e.consume(t),a=String.fromCharCode(t),f):n(t)}function f(l){if(null===l||47===l||62===l||eE(l)){let s=47===l,c=a.toLowerCase();return!s&&!i&&tl.includes(c)?(r=1,o.interrupt?t(l):N(l)):ta.includes(a.toLowerCase())?(r=6,s)?(e.consume(l),h):o.interrupt?t(l):N(l):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(l):i?function t(n){return eT(n)?(e.consume(n),t):j(n)}(l):g(l))}return 45===l||ek(l)?(e.consume(l),a+=String.fromCharCode(l),f):n(l)}function h(r){return 62===r?(e.consume(r),o.interrupt?t:N):n(r)}function g(t){return 47===t?(e.consume(t),j):58===t||95===t||ev(t)?(e.consume(t),x):eT(t)?(e.consume(t),g):j(t)}function x(t){return 45===t||46===t||58===t||95===t||ek(t)?(e.consume(t),x):b(t)}function b(t){return 61===t?(e.consume(t),y):eT(t)?(e.consume(t),b):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,v):eT(t)?(e.consume(t),y):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||eE(n)?b(n):(e.consume(n),t)}(t)}function v(t){return t===s?(e.consume(t),s=null,k):null===t||eS(t)?n(t):(e.consume(t),v)}function k(e){return 47===e||62===e||eT(e)?g(e):n(e)}function j(t){return 62===t?(e.consume(t),w):n(t)}function w(t){return null===t||eS(t)?N(t):eT(t)?(e.consume(t),w):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),E):60===t&&1===r?(e.consume(t),T):62===t&&4===r?(e.consume(t),L):63===t&&3===r?(e.consume(t),P):93===t&&5===r?(e.consume(t),I):eS(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(ts,D,_)(t)):null===t||eS(t)?(e.exit("htmlFlowData"),_(t)):(e.consume(t),N)}function _(t){return e.check(to,C,D)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),S}function S(t){return null===t||eS(t)?_(t):(e.enter("htmlFlowData"),N(t))}function E(t){return 45===t?(e.consume(t),P):N(t)}function T(t){return 47===t?(e.consume(t),a="",A):N(t)}function A(t){if(62===t){let n=a.toLowerCase();return tl.includes(n)?(e.consume(t),L):N(t)}return ev(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),A):N(t)}function I(t){return 93===t?(e.consume(t),P):N(t)}function P(t){return 62===t?(e.consume(t),L):45===t&&2===r?(e.consume(t),P):N(t)}function L(t){return null===t||eS(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),L)}function D(n){return e.exit("htmlFlow"),t(n)}}},61:tv,95:tg,96:e9,126:e9},"flowInitial",0,{[-2]:e6,[-1]:e6,32:e6},"insideSpan",0,{null:[eQ,eH]},"string",0,{38:e4,92:e1},"text",0,{[-5]:th,[-4]:th,[-3]:th,33:tp,38:e4,42:eQ,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return ev(t)?(e.consume(t),a):64===t?n(t):s(t)}function a(t){return 43===t||45===t||46===t||ek(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,l):(43===n||45===n||46===n||ek(n))&&r++<32?(e.consume(n),t):(r=0,s(n))}(t)):s(t)}function l(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||ew(r)?n(r):(e.consume(r),l)}function s(t){return 64===t?(e.consume(t),o):ej(t)?(e.consume(t),s):n(t)}function o(i){return ek(i)?function i(a){return 46===a?(e.consume(a),r=0,o):62===a?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(a),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(a){if((45===a||ek(a))&&r++<63){let n=45===a?t:i;return e.consume(a),n}return n(a)}(a)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,a,l=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),o):47===t?(e.consume(t),v):63===t?(e.consume(t),b):ev(t)?(e.consume(t),j):n(t)}function o(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,p):ev(t)?(e.consume(t),x):n(t)}function c(t){return 45===t?(e.consume(t),m):n(t)}function d(t){return null===t?n(t):45===t?(e.consume(t),u):eS(t)?(a=d,A(t)):(e.consume(t),d)}function u(t){return 45===t?(e.consume(t),m):d(t)}function m(e){return 62===e?T(e):45===e?u(e):d(e)}function p(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):eS(t)?(a=f,A(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):f(t)}function x(t){return null===t||62===t?T(t):eS(t)?(a=x,A(t)):(e.consume(t),x)}function b(t){return null===t?n(t):63===t?(e.consume(t),y):eS(t)?(a=b,A(t)):(e.consume(t),b)}function y(e){return 62===e?T(e):b(e)}function v(t){return ev(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||ek(t)?(e.consume(t),k):function t(n){return eS(n)?(a=t,A(n)):eT(n)?(e.consume(n),t):T(n)}(t)}function j(t){return 45===t||ek(t)?(e.consume(t),j):47===t||62===t||eE(t)?w(t):n(t)}function w(t){return 47===t?(e.consume(t),T):58===t||95===t||ev(t)?(e.consume(t),N):eS(t)?(a=w,A(t)):eT(t)?(e.consume(t),w):T(t)}function N(t){return 45===t||46===t||58===t||95===t||ek(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),_):eS(n)?(a=t,A(n)):eT(n)?(e.consume(n),t):w(n)}(t)}function _(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,C):eS(t)?(a=_,A(t)):eT(t)?(e.consume(t),_):(e.consume(t),S)}function C(t){return t===r?(e.consume(t),r=void 0,E):null===t?n(t):eS(t)?(a=C,A(t)):(e.consume(t),C)}function S(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||eE(t)?w(t):(e.consume(t),S)}function E(e){return 47===e||62===e||eE(e)?w(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function A(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),I}function I(t){return eT(t)?eL(e,P,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):P(t)}function P(t){return e.enter("htmlTextData"),a(t)}}}],91:tf,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return eS(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},e1],93:tc,95:eQ,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,a=0;
1return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),a++,t):(e.exit("codeTextSequence"),l(n))}(t)};function l(o){return null===o?n(o):32===o?(e.enter("space"),e.consume(o),e.exit("space"),l):96===o?(i=e.enter("codeTextSequence"),r=0,function n(l){return 96===l?(e.consume(l),r++,n):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(l)):(i.type="codeTextData",s(l))}(o)):eS(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):(e.enter("codeTextData"),s(o))}function s(t){return null===t||32===t||96===t||eS(t)?(e.exit("codeTextData"),l(t)):(e.consume(t),s)}}}}],304127);var tk=e.i(304127);let tj=/[\0\t\n\r]/g;function tw(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let tN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function t_(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return tw(n.slice(t?2:1),t?16:10)}return e5(n)||e}let tC={}.hasOwnProperty;function tS(e){return{line:e.line,column:e.column,offset:e.offset}}function tE(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+q({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+q({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+q({start:t.start,end:t.end})+") is still open")}function tT(e){let t=this;t.parser=function(n){var r,i;let a,l,s,o;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(x),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(p),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(p,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(h),hardBreakTrailing:r(h),htmlFlow:r(g,i),htmlFlowData:c,htmlText:r(g,i),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(x),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(b,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(b),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:l(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:l(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:l(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:m,characterReferenceMarkerNumeric:m,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=tw(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=e5(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=tS(e.end)},codeFenced:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:d,codeIndented:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:l(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=tr(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:l(),hardBreakEscape:l(u),hardBreakTrailing:l(u),htmlFlow:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(tN,t_),n.identifier=tr(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=tS(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.t
1ype)&&(c.call(this,e),d.call(this,e))},link:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=tr(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:l(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:l(),thematicBreak:l()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(tC.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},l={stack:[r],tokenStack:[],config:t,enter:a,exit:s,buffer:i,resume:o,data:n},c=[],d=-1;for(;++d<e.length;)("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)&&("enter"===e[d][0]?c.push(d):d=function(e,t,n){let r,i,a,l,s=t-1,o=-1,c=!1;for(;++s<=n;){let t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?o++:o--,l=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||l||o||a||(a=s),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!o&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===o&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let l=s;for(i=void 0;l--;){let t=e[l];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=l}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}a&&(!i||a<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(s,0,["enter",i,t[2]]),s++,n++,a=void 0,l=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];tC.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},l),e[d][1])}if(l.tokenStack.length>0){let e=l.tokenStack[l.tokenStack.length-1];(e[1]||tE).call(l,void 0,e[0])}for(r.position={start:tS(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:tS(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r};function r(e,t){return function(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:tS(t.start),end:void 0}}function l(e){return function(t){e&&e.call(this,t),s.call(this,t)}}function s(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||tE).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+q({start:e.start,end:e.end})+"): it’s not open");n.position.end=tS(e.end)}function o(){return ep(this.stack.pop())}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:tS(e.start),end:void 0},t.push(n)),this.stack.push(n)}function d(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=tS(e.end)}function u(){this.data.atHardBreak=!0}function m(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function h(){return{type:"break"}}function g(){return{type:"html",value:""}}function x(){return{type:"link",title:null,url:"",children:[]}}function b(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!eU(e););return e}((function(e){let t={constructs:ey([tk,...(e||{}).extensions||[]]),content:n(eD),defined:[],document:n(eM),flow:n(eV),lazy:{},string:n(eW),text:n(eq)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,c
1olumn:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],l=[],s=[],o={attempt:f(function(e,t){h(e,t.from)}),check:f(p),consume:function(e){eS(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=m(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){let t=s.pop();return t.end=m(),c.events.push(["exit",t,c]),t},interrupt:f(p,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,g()},events:[],now:m,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let a,l=e[r];if("string"==typeof l)a=l;else switch(l){case -5:a="\r";break;case -4:a="\n";break;case -3:a="\r\n";break;case -2:a=t?" ":"	";break;case -1:if(!t&&n)continue;a=" ";break;default:a=String.fromCharCode(l)}n=-2===l,i.push(a)}return i.join("")}(u(e),t)},sliceStream:u,write:function(e){return(l=ex(l,e),function(){let e;for(;r._index<l.length;){let n=l[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),d=d(t)}else d=d(n)}}(),null!==l[l.length-1])?[]:(h(t,0),c.events=eX(a,c.events,c),c.events)}},d=t.tokenize.call(c,o);return t.resolveAll&&a.push(t),c;function u(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;if(r===a)n=[e[r].slice(i,l)];else{if(n=e.slice(r,a),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}l>0&&n.push(e[a].slice(0,l))}return n}(l,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function p(e,t){t.restore()}function f(e,t){return function(n,i,a){var l;let d,u,p,f;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):(l=n,function(e){let t=null!==e&&l[e],n=null!==e&&l.null;return h([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function h(e){return(d=e,u=0,0===e.length)?a:x(e[u])}function x(e){return function(n){let i,a,l,d,u;return(i=m(),a=c.previous,l=c.currentConstruct,d=c.events.length,u=Array.from(s),f={from:d,restore:function(){r=i,c.previous=a,c.currentConstruct=l,c.events.length=d,s=u,g()}},p=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?y(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,o,b,y)(n)}}function b(t){return e(p,f),i}function y(e){return(f.restore(),++u<d.length)?x(d[u]):a}}}function h(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&eg(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function g(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((l=1,s="",o=!0,function(e,t,n){let r,i,c,d,u,m=[];for(e=s+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,s="",o&&(65279===e.charCodeAt(0)&&c++,o=void 0);c<e.length;){if(tj.lastIndex=c,d=(r=tj.exec(e))&&void 0!==r.index?r.index:e.length,u=e.charCodeAt(d),!r){s=e.slice(c);break}if(10===u&&c===d&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),c<d&&(m.push(e.slice(c,d)),l+=d-c),u){case 0:m.push(65533),l++;break;case 9:for(i=4*Math.ceil(l/4),m.push(-2);l++<i;)m.push(-1);break;case 10:m.push(-4),l=1;break;default:a=!0,l=1}c=d+1}return n&&(a&&m.push(-5),s&&m.push(s),m.push(null)),m})(n,r,!0))))}}let tA="object"==typeof self?self:globalThis,tI=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[a,l]=e[i];switch(a){case 0:case -1:return n(l,i);case 1:{let e=n([],i);for(let t of l)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of l)e[r(t)]=r(n);return e}case 3:return n(new Date(l),i);case 4:{let{source:e,flags:t}=l;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of l)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of l)e.add(r(t));return e}case 7:{let{name:e,message:t}=l;return n(new tA[e](t),i)}case 8:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{let{buffer:e}=new Uint8Array(l);return n(new DataView(e),l)}}return n(new tA[a](l),i)})(0)},{toString:tP}={},{keys:tL}=Object,tD=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=tP.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},tM=([e,t])=>0===e&&("function"===t||"symbol"===t),tO=(e,{json:t,lossy:n}={})=>{var r,i,a;let l,s,o=[];return(r=!(t||n),i=!!t,a=new Map,l=(e,t)=>
1{let n=o.push(e)-1;return a.set(t,n),n},s=e=>{if(a.has(e))return a.get(e);let[t,n]=tD(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return l([-1],e)}return l([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),l([n,[...t]],e)}let r=[],i=l([t,r],e);for(let t of e)r.push(s(t));return i}case 2:{if(n)switch(n){case"BigInt":return l([n,e.toString()],e);case"Boolean":case"Number":case"String":return l([n,e.valueOf()],e)}if(i&&"toJSON"in e)return s(e.toJSON());let a=[],o=l([t,a],e);for(let t of tL(e))(r||!tM(tD(e[t])))&&a.push([s(t),s(e[t])]);return o}case 3:return l([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return l([t,{source:n,flags:r}],e)}case 5:{let n=[],i=l([t,n],e);for(let[t,i]of e)(r||!(tM(tD(t))||tM(tD(i))))&&n.push([s(t),s(i)]);return i}case 6:{let n=[],i=l([t,n],e);for(let t of e)(r||!tM(tD(t)))&&n.push(s(t));return i}}let{message:o}=e;return l([t,{name:n,message:o}],e)})(e),o},tR="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?tI(tO(e,t)):structuredClone(e):(e,t)=>tI(tO(e,t));function tF(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),l="";if(37===a&&ek(e.charCodeAt(n+1))&&ek(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(l=String.fromCharCode(a,t),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function t$(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function tU(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let tz=function(e){var t,n;if(null==e)return tV;if("function"==typeof e)return tB(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=tz(e[n]);return tB(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,tB(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,tB(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function tB(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function tV(){return!0}let tH=[];function tW(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let a=tz(i),l=r?-1:1;(function e(i,s,o){let c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){let e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(d,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return d;function d(){var c;let d,u,m,p=tH;if((!t||a(i,s,o[o.length-1]||void 0))&&!1===(p=Array.isArray(c=n(i,o))?c:"number"==typeof c?[!0,c]:null==c?tH:[c])[0])return p;if("children"in i&&i.children&&i.children&&"skip"!==p[0])for(u=(r?i.children.length:-1)+l,m=o.concat(i);u>-1&&u<i.children.length;){if(!1===(d=e(i.children[u],u,m)())[0])return d;u="number"==typeof d[1]?d[1]:u+l}return p}})(e,void 0,[])()}function tq(e,t,n,r){let i,a,l;"function"==typeof t&&"function"!=typeof n?(a=void 0,l=t,i=n):(a=t,l=n,i=r),tW(e,a,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return l(e,r,n)},i)}function tG(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),a=i[0];a&&"text"===a.type?a.value="["+a.value:i.unshift({type:"text",value:"["});let l=i[i.length-1];return l&&"text"===l.type?l.value+=r:i.push({type:"text",value:r}),i}function tK(e){let t=e.spread;return null==t?e.children.length>1:t}function tY(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let tZ={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}
1,footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=tF(i.toLowerCase()),l=e.footnoteOrder.indexOf(i),s=e.footnoteCounts.get(i);void 0===s?(s=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=l+1,s+=1,e.footnoteCounts.set(i,s);let o={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,o);let c={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tG(e,t);let i={src:tF(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){let n={src:tF(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tG(e,t);let i={href:tF(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){let n={href:tF(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=tK(n[r])}return t}(n):tK(t),a={},l=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s<r.length;){let e=r[s];(i||0!==s||"element"!==e.type||"p"!==e.tagName)&&l.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?l.push(e):l.push(...e.children)}let o=r[r.length-1];o&&(i||"element"!==o.type||"p"!==o.tagName)&&l.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=H(t.children[1]),l=V(t.children[t.children.length-1]);a&&l&&(r.position={start:a,end:l}),i.push(r)}let a={type:"element",tagName:"table",properties:{}
1,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,l=a?a.length:t.children.length,s=-1,o=[];for(;++s<l;){let n=t.children[s],r={},l=a?a[s]:void 0;l&&(r.align=l);let c={type:"element",tagName:i,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),o.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(o,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(tY(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(tY(t.slice(i),i>0,!1)),a.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:tX,yaml:tX,definition:tX,footnoteDefinition:tX};function tX(){}let tQ={}.hasOwnProperty,tJ={};function t0(e,t){e.position&&(t.position=function(e){let t=H(e),n=V(e);if(t&&n)return{start:t,end:n}}(e))}function t1(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,tR(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function t2(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function t5(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function t4(e,n){let r,i,a,l,s=(r=n||tJ,i=new Map,a=new Map,l={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=l.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=t5(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=t5(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:t1,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],handlers:{...tZ,...r.handlers},one:function(e,t){let n=e.type,r=l.handlers[n];if(tQ.call(l.handlers,n)&&r)return r(l,e,t);if(l.options.passThrough&&l.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=tR(n);return r.children=l.all(e),r}return tR(e)}return(l.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(tQ.call(n,"hProperties")||tQ.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(l,e,t)},options:r,patch:t0,wrap:t2},tq(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),l),o=s.one(e,void 0),c=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||t$,r=e.options.footnoteBackLabel||tU,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[],o=-1;for(;++o<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[o]);if(!i)continue;let a=e.all(i),l=String(i.identifier).toUpperCase(),c=tF(l.toLowerCase()),d=0,u=[],m=e.footnoteCounts.get(l);for(;void 0!==m&&++d<=m;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(o,d);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(o,d),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else a.push(...u);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(i,f),s.push(f)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...tR(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)}
1,{type:"text",value:"\n"}]}}(s),d=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return c&&(t("children"in d),d.children.push({type:"text",value:"\n"},c)),d}function t3(e,t){return e&&"run"in e?async function(n,r){let i=t4(n,{file:r,...t});await e.run(i,r)}:function(n,r){return t4(n,{file:r,...e||t})}}function t9(e){if(e)throw e}var t6=e.i(104100);function t7(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let t8=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');nr(e);let r=0,i=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let l=-1,s=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else l<0&&(n=!0,l=a+1),s>-1&&(e.codePointAt(a)===t.codePointAt(s--)?s<0&&(i=a):(s=-1,i=l));return r===i?i=l:i<0&&(i=e.length),e.slice(r,i)},ne=function(e){let t;if(nr(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},nt=function(e){let t;nr(e);let n=e.length,r=-1,i=0,a=-1,l=0;for(;n--;){let s=e.codePointAt(n);if(47===s){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===s?a<0?a=n:1!==l&&(l=1):a>-1&&(l=-1)}return a<0||r<0||0===l||1===l&&a===r-1&&a===i+1?"":e.slice(a,r)},nn=function(...e){var t;let n,r,i,a=-1;for(;++a<e.length;)nr(e[a]),e[a]&&(i=void 0===i?e[a]:i+"/"+e[a]);return void 0===i?".":(nr(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",a=0,l=-1,s=0,o=-1;for(;++o<=e.length;){if(o<e.length)n=e.codePointAt(o);else if(47===n)break;else n=47;if(47===n){if(l===o-1||1===s);else if(l!==o-1&&2===s){if(i.length<2||2!==a||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",a=0):a=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),l=o,s=0;continue}}else if(i.length>0){i="",a=0,l=o,s=0;continue}}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(l+1,o):i=e.slice(l+1,o),a=o-l-1;l=o,s=0}else 46===n&&s>-1?s++:s=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function nr(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function ni(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let na=["history","path","basename","stem","extname","dirname"];class nl{constructor(e){let t,n;t=e?ni(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<na.length;){const e=na[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)na.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?t8(this.path):void 0}set basename(e){no(e,"basename"),ns(e,"basename"),this.path=nn(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?ne(this.path):void 0}set dirname(e){nc(this.basename,"dirname"),this.path=nn(e||"",this.basename)}get extname(){return"string"==typeof this.path?nt(this.path):void 0}set extname(e){if(ns(e,"extname"),nc(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=nn(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ni(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!ni(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),no(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?t8(this.path,this.extname):void 0}set stem(e){no(e,"stem"),ns(e,"stem"),this.path=nn(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Z(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function ns(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function no(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function nc(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let nd=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},nu={}.hasOwnProperty;
1class nm extends nd{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(a,...l){let s=e[++n],o=-1;if(a)return void r(a);for(;++o<t.length;)(null===l[o]||void 0===l[o])&&(l[o]=t[o]);t=l,s?(function(e,t){let n;return function(...t){let a,l=e.length>t.length;l&&t.push(r);try{a=e.apply(this,t)}catch(e){if(l&&n)throw e;return r(e)}l||(a&&a.then&&"function"==typeof a.then?a.then(i,r):a instanceof Error?r(a):i(a))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(s,i)(...l):r(null,...l)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new nm,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,t6.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(ng("data",this.frozen),this.namespace[e]=t,this):nu.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ng("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=ny(e),n=this.parser||this.Parser;return nf("parse",n),n(String(t),t)}process(e,n){let r=this;return this.freeze(),nf("process",this.parser||this.Parser),nh("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(i,a){let l=ny(e),s=r.parse(l);function o(e,r){e||!r?a(e):i?i(r):(t(n,"`done` is defined if `resolve` is not"),n(void 0,r))}r.run(s,l,function(e,t,n){var i,a;if(e||!t||!n)return o(e);let l=r.stringify(t,n);"string"==typeof(i=l)||(a=i)&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a?n.value=l:n.result=l,o(e,n)})}}processSync(e){let n,r=!1;return this.freeze(),nf("processSync",this.parser||this.Parser),nh("processSync",this.compiler||this.Compiler),this.process(e,function(e,t){r=!0,t9(e),n=t}),nb("processSync","process",r),t(n,"we either bailed on an error or have a tree"),n}run(e,n,r){nx(e),this.freeze();let i=this.transformers;return r||"function"!=typeof n||(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(a,l){t("function"!=typeof n,"`file` can’t be a `done` anymore, we checked");let s=ny(n);i.run(e,s,function(n,i,s){let o=i||e;n?l(n):a?a(o):(t(r,"`done` is defined if `resolve` is not"),r(void 0,o,s))})}}runSync(e,n){let r,i=!1;return this.run(e,n,function(e,t){t9(e),r=t,i=!0}),nb("runSync","run",i),t(r,"we either bailed on an error or have a tree"),r}stringify(e,t){this.freeze();let n=ny(t),r=this.compiler||this.Compiler;return nh("stringify",r),nx(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(ng("use",this.frozen),null==e);else if("function"==typeof e)l(e,t);else if("object"==typeof e)Array.isArray(e)?a(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=(0,t6.default)(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)l(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;l(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function l(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,l=n[i][1];t7(l)&&t7(r)&&(r=(0,t6.default)(!0,l,r)),n[i]=[e,r,...a]}}}}let np=new nm().freeze();function nf(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function nh(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function ng(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nx(e){if(!t7(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function nb(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ny(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new nl(e)}let nv=[],nk={allowDangerousHtml:!0},nj=/^(https?|ircs?|mailto|xmpp)$/i,nw=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function nN(e){var t;let r,i,a,l,s,o=(r=(t=e).rehypePlugins||nv,i=t.remarkPlugins||nv,a=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...nk}:nk,np().use(tT).use(i).use(t3,a).use(r)),c=(l=e.children||"",s=new nl,"string"==typeof l?s.value=l:n("Unexpected value `"+l+"` for `children` prop, expected `string`"),s);return function(e,t){let r=t.allowedElements,i=t.allowElement,a=t.components,l=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||n_;for(let e of nw)Object.hasOwn(t,e.from)&&n("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&l&&n("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),tq(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return s?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in ed)if(Object.hasOwn(ed,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=ed[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let a=r?!r.includes(e.tagName):!!l&&l.includes(e.tagName);if(!a&&i&&"number"==typeof t&&(a=!i(e,t,n)),a&&n&&"number"==typeof t)return o&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,i,a;let l;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let s=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=s,r=t.jsxDEV,l=function(e,t,i,a){let l=Array.isArray(i.children),s=H(e);return r(t,i,a,l,{columnNumber:s?s.column-1:void 0,fileName:n,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");
1if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,a=t.jsxs,l=function(e,t,n,r){let l=Array.isArray(n.children)?a:i;return r?l(t,n,r):l(t,n)}}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:l,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?z:U,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=er(o,e,void 0);return c&&"string"!=typeof c?c:o.create(e,o.Fragment,{children:c||void 0},void 0)}(e,{Fragment:eu.Fragment,components:a,ignoreInvalidStyle:!0,jsx:eu.jsx,jsxs:eu.jsxs,passKeys:!0,passNode:!0})}(o.runSync(o.parse(c),c),e)}function n_(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||nj.test(e.slice(0,t))?e:""}function nC(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}function nS(e,t,n){let r=tz((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),a=-1;for(;++a<i.length;)tW(e,"text",l);function l(e,t){let n,l=-1;for(;++l<t.length;){let e=t[l],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[a][0],l=i[a][1],s=0,o=n.children.indexOf(e),c=!1,d=[];r.lastIndex=0;let u=r.exec(e.value);for(;u;){let n=u.index,i={index:u.index,input:u.input,stack:[...t,e]},a=l(...u,i);if("string"==typeof a&&(a=a.length>0?{type:"text",value:a}:void 0),!1===a?r.lastIndex=n+1:(s!==n&&d.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(a)?d.push(...a):a&&d.push(a),s=n+u[0].length,c=!0),!r.global)break;u=r.exec(e.value)}return c?(s<e.value.length&&d.push({type:"text",value:e.value.slice(s)}),n.children.splice(o,1,...d)):d=[e],o+d.length}(e,t)}}e.s(["Markdown",0,nN,"defaultUrlTransform",0,n_],877894),e.s(["default",0,nN],918789),e.s(["findAndReplace",0,nS],257229);let nE="phrasing",nT=["autolink","link","image","label"];function nA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function nI(e){this.config.enter.autolinkProtocol.call(this,e)}function nP(e){this.config.exit.autolinkProtocol.call(this,e)}function nL(e){this.config.exit.data.call(this,e);let n=this.stack[this.stack.length-1];t("link"===n.type),n.url="http://"+this.sliceSerialize(e)}function nD(e){this.config.exit.autolinkEmail.call(this,e)}function nM(e){this.exit(e)}function nO(e){nS(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,nR],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,nF]],{ignore:["link","linkReference"]})}function nR(e,t,n,r,i){let a,l="";if(!n$(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",l="http://"),(a=n.split(".")).length<2||a[a.length-1]&&(/_/.test(a[a.length-1])||!/[a-zA-Z\d]/.test(a[a.length-1]))||a[a.length-2]&&(/_/.test(a[a.length-2])||!/[a-zA-Z\d]/.test(a[a.length-2])))return!1;let s=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=nC(e,"("),a=nC(e,")");for(;-1!==r&&i>a;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),a++;return[e,n]}(n+r);if(!s[0])return!1;let o={type:"link",title:null,url:l+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function nF(e,t,n,r){return!(!n$(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function n$(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||eI(n)||eA(n))&&(!t||47!==n)}function nU(){this.buffer()}function nz(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function nB(){this.buffer()}function nV(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function nH(e){let n=this.resume(),r=this.stack[this.stack.length-1];t("footnoteReference"===r.type),r.identifier=tr(this.sliceSerialize(e)).toLowerCase(),r.label=n}function nW(e){this.exit(e)}function nq(e){let n=this.resume(),r=this.stack[this.stack.length-1];t("footnoteDefinition"===r.type),r.identifier=tr(this.sliceSerialize(e)).toLowerCase(),r.label=n}function nG(e){this.exit(e)}function nK(e,t,n,r){let i=n.createTracker(r),a=i.move("[^"),l=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),s(),l(),a+=i.move("]")}function nY(e,t,n){return 0===t?e:nZ(e,t,n)}
1function nZ(e,t,n){return(n?"":"    ")+e}nK.peek=function(){return"["};let nX=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function nQ(e){this.enter({type:"delete",children:[]},e)}function nJ(e){this.exit(e)}function n0(e,t,n,r){let i=n.createTracker(r),a=n.enter("strikethrough"),l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),a(),l}function n1(e){return e.length}function n2(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}n0.peek=function(){return"~"};function n5(e,t,n){let r=e.value||"",i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){let e,t=n.unsafe[a],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}n5.peek=function(){return"`"};tz(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let n4=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),a=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(a=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let l=a.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(l=4*Math.ceil(l/4));let s=n.createTracker(r);s.move(a+" ".repeat(l-a.length)),s.shift(l);let o=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){return t?(n?"":" ".repeat(l))+e:(n?a:a+" ".repeat(l-a.length))+e});return o(),c};function n3(e){let n=e._align;t(n,"expected `_align` on table"),this.enter({type:"table",align:n.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function n9(e){this.exit(e),this.data.inTable=void 0}function n6(e){this.enter({type:"tableRow",children:[]},e)}function n7(e){this.exit(e)}function n8(e){this.enter({type:"tableCell",children:[]},e)}function re(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,rt));let r=this.stack[this.stack.length-1];t("inlineCode"===r.type),r.value=n,this.exit(e)}function rt(e,t){return"|"===t?t:e}function rn(e){let n=this.stack[this.stack.length-2];t("listItem"===n.type),n.checked="taskListCheckValueChecked"===e.type}function rr(e){let n=this.stack[this.stack.length-2];if(n&&"listItem"===n.type&&"boolean"==typeof n.checked){let e=this.stack[this.stack.length-1];t("paragraph"===e.type);let r=e.children[0];if(r&&"text"===r.type){let t,i=n.children,a=-1;for(;++a<i.length;){let e=i[a];if("paragraph"===e.type){t=e;break}}t===e&&(r.value=r.value.slice(1),0===r.value.length?e.children.shift():e.position&&r.position&&"number"==typeof r.position.start.offset&&(r.position.start.column++,r.position.start.offset++,e.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function ri(e,t,n,r){let i=e.children[0],a="boolean"==typeof e.checked&&i&&"paragraph"===i.type,l="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);a&&s.move(l);let o=n4(e,t,n,{...r,...s.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+l})),o}let ra={tokenize:function(e,t,n){let r=0;return function t(a){return(87===a||119===a)&&r<3?(r++,e.consume(a),t):46===a&&3===r?(e.consume(a),i):n(a)};function i(e){return null===e?n(e):t(e)}},partial:!0},rl={tokenize:function(e,t,n){let r,i,a;return l;function l(t){return 46===t||95===t?e.check(ro,o,s)(t):null===t||eE(t)||eI(t)||45!==t&&eA(t)?o(t):(a=!0,e.consume(t),l)}function s(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),l}function o(e){return i||r||!a?n(e):t(e)}},partial:!0},rs={tokenize:function(e,t){let n=0,r=0;return i;
1function i(l){return 40===l?(n++,e.consume(l),i):41===l&&r<n?a(l):33===l||34===l||38===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||60===l||63===l||93===l||95===l||126===l?e.check(ro,t,a)(l):null===l||eE(l)||eI(l)?t(l):(e.consume(l),i)}function a(t){return 41===t&&r++,e.consume(t),i}},partial:!0},ro={tokenize:function(e,t,n){return r;function r(l){return 33===l||34===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||63===l||95===l||126===l?(e.consume(l),r):38===l?(e.consume(l),a):93===l?(e.consume(l),i):60===l||null===l||eE(l)||eI(l)?t(l):n(l)}function i(e){return null===e||40===e||91===e||eE(e)||eI(e)?t(e):r(e)}function a(t){return ev(t)?function t(i){return 59===i?(e.consume(i),r):ev(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},rc={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return ek(e)?n(e):t(e)}},partial:!0},rd={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!rh.call(r,r.previous)||ry(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ra,e.attempt(rl,e.attempt(rs,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:rh},ru={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",a=!1;return function(t){return(72===t||104===t)&&rg.call(r,r.previous)&&!ry(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),l):n(t)};function l(t){if(ev(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),l;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),a)?o:(a=!0,s):n(t)}function o(t){return null===t||ew(t)||eE(t)||eI(t)||eA(t)?n(t):e.attempt(rl,e.attempt(rs,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:rg},rm={name:"emailAutolink",tokenize:function(e,t,n){let r,i,a=this;return function(t){return!rb(t)||!rx.call(a,a.previous)||ry(a.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return rb(r)?(e.consume(r),t):64===r?(e.consume(r),l):n(r)}(t))};function l(t){return 46===t?e.check(rc,o,s)(t):45===t||95===t||ek(t)?(i=!0,e.consume(t),l):o(t)}function s(t){return e.consume(t),r=!0,l}function o(l){return i&&r&&ev(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(l)):n(l)}},previous:rx},rp={},rf=48;for(;rf<123;)rp[rf]=rm,58==++rf?rf=65:91===rf&&(rf=97);function rh(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||eE(e)}function rg(e){return!ev(e)}function rx(e){return!(47===e||rb(e))}function rb(e){return 43===e||45===e||46===e||95===e||ek(e)}function ry(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}rp[43]=rm,rp[45]=rm,rp[46]=rm,rp[95]=rm,rp[72]=[rm,ru],rp[104]=[rm,ru],rp[87]=[rm,rd],rp[119]=[rm,rd];let rv={tokenize:function(e,t,n){let r=this;return eL(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function rk(e,t,n){let r,i=this,a=i.events.length,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;a--;){let e=i.events[a][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(a){if(!r||!r._balanced)return n(a);let s=tr(i.sliceSerialize({start:r.end,end:i.now()}));return 94===s.codePointAt(0)&&l.includes(s.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a)):n(a)}}function rj(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function rw(e,t,n){let r,i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),l=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",o)}function o(s){if(l>999||93===s&&!r||null===s||91===s||eE(s))return n(s);if(93===s){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return a.includes(tr(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return eE(s)||(r=!0),l++,e.consume(s),92===s?c:o}function c(t){return 91===t||92===t||93===t?(e.consume(t),l++,o):o(t)}}function rN(e,t,n){let r,i,a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),o};function o(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!i||null===t||91===t||eE(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=tr(a.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return eE(t)||(i=!0),s++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l.includes(r)||l.push(r),eL(e,m,"gfmFootnoteDefinitionWhitespace")):n(t)}function m(e){return t(e)}}function r_(e,t,n){return e.check(eR,t,e.attempt(rv,t,n))}function rC(e){e.exit("gfmFootnoteDefinition")}class rS{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function rE(e,t,n){let r,i=this,a=0,l=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,a="tableHead"===r||"tableRow"===r?b:s;return a===b&&i.parser.lazy[i.now().line]?n(e):a(e)};function s(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,l+=1),o(n)}function o(t){return null===t?n(t):eS(t)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):eT(t)?eL(e,o,"whitespace")(t):(l+=1,r&&(r=!1,a+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,o):(e.enter("data"),c(t))}function c(t){return null===t||124===t||eE(t)?(e.exit("data"),o(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function u(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,eT(t))?eL(e,m,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):m(t)}function m(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return eT(t)?eL(e,f,"whitespace")(t):f(t)}
1function f(t){return 58===t?(l+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),h):45===t?(l+=1,h(t)):null===t||eS(t)?x(t):n(t)}function h(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return eT(t)?eL(e,x,"whitespace")(t):x(t)}function x(i){if(124===i)return m(i);if(null===i||eS(i))return r&&a===l?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function b(t){return e.enter("tableRow"),y(t)}function y(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),y):null===n||eS(n)?(e.exit("tableRow"),t(n)):eT(n)?eL(e,y,"whitespace")(n):(e.enter("data"),v(n))}function v(t){return null===t||124===t||eE(t)?(e.exit("data"),y(t)):(e.consume(t),92===t?k:v)}function k(t){return 92===t||124===t?(e.consume(t),v):v(t)}}function rT(e,t){let n,r,i,a=-1,l=!0,s=0,o=[0,0,0,0],c=[0,0,0,0],d=!1,u=0,m=new rS;for(;++a<e.length;){let p=e[a],f=p[1];"enter"===p[0]?"tableHead"===f.type?(d=!1,0!==u&&(rI(m,t,u,n,r),r=void 0,u=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(a,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(l=!0,i=void 0,o=[0,0,0,0],c=[0,a+1,0,0],d&&(d=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(a,0,[["enter",r,t]])),s="tableDelimiterRow"===f.type?2:r?3:1):s&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(l=!1,0===c[2]&&(0!==o[1]&&(c[0]=c[1],i=rA(m,t,o,s,void 0,i),o=[0,0,0,0]),c[2]=a)):"tableCellDivider"===f.type&&(l?l=!1:(0!==o[1]&&(c[0]=c[1],i=rA(m,t,o,s,void 0,i)),c=[(o=c)[1],a,0,0])):"tableHead"===f.type?(d=!0,u=a):"tableRow"===f.type||"tableDelimiterRow"===f.type?(u=a,0!==o[1]?(c[0]=c[1],i=rA(m,t,o,s,a,i)):0!==c[1]&&(i=rA(m,t,c,s,a,i)),s=0):s&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(c[3]=a)}for(0!==u&&rI(m,t,u,n,r),m.consume(t.events),a=-1;++a<t.events.length;){let e=t.events[a];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,a))}return e}function rA(e,t,n,r,i,a){0!==n[0]&&(a.end=Object.assign({},rP(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));let l=rP(t.events,n[1]);if(a={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",a,t]]),0!==n[2]){let i=rP(t.events,n[2]),a=rP(t.events,n[3]),l={type:"tableContent",start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[["enter",l,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",l,t]])}return void 0!==i&&(a.end=Object.assign({},rP(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function rI(e,t,n,r,i){let a=[],l=rP(t.events,n);i&&(i.end=Object.assign({},l),a.push(["exit",i,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function rP(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let rL={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return eE(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(t)}function l(r){return eS(r)?t(r):eT(r)?e.check({tokenize:rD},t,n)(r):n(r)}}};function rD(e,t,n){return eL(e,function(e){return null===e?n(e):t(e)},"whitespace")}let rM={};e.s(["default",0,function(e){let t,n,r,i=e||rM,a=this.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),s=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),o=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(ey([{text:rp},{document:{91:{name:"gfmFootnoteDefinition",tokenize:rN,continuation:{tokenize:r_},exit:rC}},text:{91:{name:"gfmFootnoteCall",tokenize:rw},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rk,resolveTo:rj}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,a=this.events,l=0;return function(s){return 126===i&&"characterEscape"!==a[a.length-1][1].type?r(s):(e.enter("strikethroughSequenceTemporary"),function a(s){let o=eZ(i);if(126===s)return l>1?r(s):(e.consume(s),l++,a);if(l<2&&!t)return r(s);let c=e.exit("strikethroughSequenceTemporary"),d=eZ(s);return c._open=!d||2===d&&!!o,c._close=!o||2===o&&!!d,n(s)}(s))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},l=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",a,t]],s=t.parser.constructs.insideSpan.null;s&&eg(l,l.length,0,eX(s,e.slice(r+1,n),t)),eg(l,l.length,0,[["exit",a,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),eg(e,r-1,n-r+3,l),n=r+l.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:rE,resolveAll:rT}}},{text:{91:rL}}])),s.push([{transforms:[nO],enter:{literalAutolink:nA,literalAutolinkEmail:nI,literalAutolinkHttp:nI,literalAutolinkWww:nI},exit:{literalAutolink:nM,literalAutolinkEmail:nD,literalAutolinkHttp:nP,literalAutolinkWww:nL}}
1,{enter:{gfmFootnoteCallString:nU,gfmFootnoteCall:nz,gfmFootnoteDefinitionLabelString:nB,gfmFootnoteDefinition:nV},exit:{gfmFootnoteCallString:nH,gfmFootnoteCall:nW,gfmFootnoteDefinitionLabelString:nq,gfmFootnoteDefinition:nG}},{canContainEols:["delete"],enter:{strikethrough:nQ},exit:{strikethrough:nJ}},{enter:{table:n3,tableData:n8,tableHeader:n8,tableRow:n6},exit:{codeText:re,table:n9,tableData:n7,tableHeader:n7,tableRow:n7}},{exit:{taskListCheckValueChecked:rn,taskListCheckValueUnchecked:rn,paragraph:rr}}]),o.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:nE,notInConstruct:nT},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:nE,notInConstruct:nT},{character:":",before:"[ps]",after:"\\/",inConstruct:nE,notInConstruct:nT}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let a=n.createTracker(i),l=a.move("[^"),s=n.enter("footnoteDefinition"),o=n.enter("label");return l+=a.move(n.safe(n.associationId(e),{before:l,after:"]"})),o(),l+=a.move("]:"),e.children&&e.children.length>0&&(a.shift(4),l+=a.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,a.current()),r?nZ:nY))),s(),l},footnoteReference:nK},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nX}],handlers:{delete:n0}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=n5(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return s(function(e,t,n){let r=e.children,i=-1,a=[],l=t.enter("table");for(;++i<r.length;)a[i]=o(r[i],t,n);return l(),a}(e,n,r),e.align)},tableCell:l,tableRow:function(e,t,n,r){let i=s([o(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function l(e,t,n,r){let i=n.enter("tableCell"),l=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:a,after:a});return l(),i(),s}function s(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||n1,a=[],l=[],s=[],o=[],c=0,d=-1;for(;++d<e.length;){let t=[],r=[],a=-1;for(e[d].length>c&&(c=e[d].length);++a<e[d].length;){var u;let l=null==(u=e[d][a])?"":String(u);if(!1!==n.alignDelimiters){let e=i(l);r[a]=e,(void 0===o[a]||e>o[a])&&(o[a]=e)}t.push(l)}l[d]=t,s[d]=r}let m=-1;if("object"==typeof r&&"length"in r)for(;++m<c;)a[m]=n2(r[m]);else{let e=n2(r);for(;++m<c;)a[m]=e}m=-1;let p=[],f=[];for(;++m<c;){let e=a[m],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,o[m]-t.length-r.length),l=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>o[m]&&(o[m]=i),f[m]=i),p[m]=l}l.splice(1,0,p),s.splice(1,0,f),d=-1;let h=[];for(;++d<l.length;){let e=l[d],t=s[d];m=-1;let r=[];for(;++m<c;){let i=e[m]||"",l="",s="";if(!1!==n.alignDelimiters){let e=o[m]-(t[m]||0),n=a[m];114===n?l=" ".repeat(e):99===n?e%2?(l=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):s=l=" ".repeat(e/2):s=" ".repeat(e)}!1===n.delimiterStart||m||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||m)&&r.push(" "),!1!==n.alignDelimiters&&r.push(l),r.push(i),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||m!==c-1)&&r.push("|")}h.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return h.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function o(e,t,n){let r=e.children,i=-1,a=[],s=t.enter("tableRow");for(;++i<r.length;)a[i]=l(r[i],e,t,n);return s(),a}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ri}}]})}],752766)},268286,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(522016),i=e.i(618566),a=e.i(846696),l=e.i(643531),s=e.i(595468),o=e.i(174886),c=e.i(294918),d=e.i(178583),u=e.i(473708),m=e.i(270756),p=e.i(283086),f=e.i(365582),h=e.i(400417),g=e.i(373884),x=e.i(985043),b=e.i(545274),y=e.i(168206),v=e.i(892029),k=e.i(943576),j=e.i(846254),w=e.i(770703),N=e.i(945433),_=e.i(984970),C=e.i(121641),S=e.i(952632),E=e.i(945984),T=e.i(458841),A=e.i(19071),I=e.i(182536),P=e.i(935615),L=e.i(207585),D=e.i(927335),M=e.i(502201),O=e.i(685703),R=e.i(484092),F=e.i(510138),$=e.i(975157),U=e.i(776639),z=e.i(624687),B=e.i(519455),V=e.i(528030),H=e.i(35299
11),W=e.i(111401),q=e.i(211431),G=e.i(435252),K=e.i(414935),Y=e.i(847283),Z=e.i(999965),X=e.i(780559),Q=e.i(784296),J=e.i(740348),ee=e.i(677154),et=e.i(206165),en=e.i(825405),er=e.i(195524),ei=e.i(804665),ea=e.i(249598),el=e.i(207627),es=e.i(366098),eo=e.i(577550),ec=e.i(968915),ed=e.i(251242),eu=e.i(905682),em=e.i(56091),ep=e.i(754015),ef=e.i(632213),eh=e.i(124285),eg=e.i(148697),ex=e.i(379304),eb=e.i(567510),ey=e.i(705942),ev=e.i(169289),ek=e.i(617365),ej=e.i(338136),ew=e.i(304615),eN=e.i(301942),e_=e.i(697972),eC=e.i(419218),eS=e.i(881256),eE=e.i(571811),eT=e.i(861150),eA=e.i(472995),eI=e.i(446773),eP=e.i(918789),eL=e.i(752766);let eD=(0,w.default)(()=>e.A(495203).then(e=>e.FreeDealerQuotesOffer),{loadableGenerated:{modules:[143339]},ssr:!1}),eM=new Set(["price_asc","price_desc","msrp_asc","msrp_desc","year_desc","year_asc","mileage_asc","mileage_desc","dos_active_asc","dos_active_desc","distance_asc"]);function eO(e){if("number"==typeof e)return e;if("string"==typeof e){let t=Number(e);return Number.isFinite(t)?t:void 0}}function eR(e){return"string"==typeof e&&e.length>0?e:void 0}let eF=["SUV","Truck","Sedan","Coupe","Convertible","Van","Wagon","Hatchback","Minivan"],e$=["White","Gray","Black","Blue","Red","Silver","Green","Beige","Brown","Orange","Gold","Yellow","Purple","Pink"];function eU(e,t){if(e)return t.find(t=>t.toLowerCase()===e.toLowerCase())}class ez extends n.default.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("[Copilot] message content block failed to render:",e,t.componentStack)}render(){return this.state.hasError?this.props.fallback??(0,t.jsx)("div",{className:"px-3 py-2 rounded-lg bg-muted text-sm text-muted-foreground",children:"This content could not be displayed."}):this.props.children}}function eB(e){if(!e)return!1;try{let t=new URL(e);return"https:"===t.protocol&&t.hostname.endsWith(".cloudfront.net")&&t.pathname.includes("/otd-sheets/")&&t.pathname.endsWith(".pdf")}catch{return!1}}function eV(e){let t=new URL(e);try{return t.hostname+decodeURIComponent(t.pathname)}catch{return t.hostname+t.pathname}}function eH({href:e,children:r}
1){let i=(0,O.isWidgetSession)(),[a,l]=(0,n.useState)(()=>i?"loading":"idle"),s=(0,n.useCallback)(e=>{if(!e)return;let t=()=>l("failed");return e.addEventListener("error",t),()=>e.removeEventListener("error",t)},[]);return(0,n.useEffect)(()=>{if("loading"!==a)return;let e=setTimeout(()=>l("failed"),8e3);return()=>clearTimeout(e)},[a]),(0,t.jsxs)("span",{className:"my-2 block rounded-xl border border-border bg-muted/30 p-3","data-otd-sheet-preview":!0,"data-preview-state":a,children:[(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"otd-sheet-title text-sm font-medium text-primary underline hover:text-primary/80",children:r}),"failed"===a&&(0,t.jsx)("span",{className:"mt-1 block text-sm text-muted-foreground",children:"Preview unavailable — open or download the sheet instead."}),("loading"===a||"loaded"===a)&&(0,t.jsx)("object",{ref:s,type:"application/pdf",data:e,"aria-label":"Out-the-door sheet preview",className:"mt-2 block h-[420px] w-full overflow-hidden rounded-lg border border-border bg-background",onLoad:()=>l("loaded")}),(0,t.jsxs)("span",{className:"mt-2 flex items-center gap-4 text-sm",children:[("idle"===a||"failed"===a)&&(0,t.jsx)("button",{type:"button",onClick:()=>l("loading"),className:"otd-sheet-preview-btn inline-flex items-center rounded-lg border border-primary/20 bg-primary/5 px-2.5 py-1 text-sm font-medium text-primary transition-colors hover:border-primary/40 hover:bg-primary/10",children:"failed"===a?"Try again":"Show preview"}),i&&("loading"===a||"loaded"===a)&&(0,t.jsx)("button",{type:"button",onClick:()=>l("idle"),className:"otd-sheet-preview-btn inline-flex items-center rounded-lg border border-primary/20 bg-primary/5 px-2.5 py-1 text-sm font-medium text-primary transition-colors hover:border-primary/40 hover:bg-primary/10",children:"Hide preview"}),(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"otd-sheet-open-link text-primary underline hover:text-primary/80",children:"Open in new tab"}),(0,t.jsx)("a",{href:e,download:!0,target:"_blank",rel:"noopener noreferrer",className:"otd-sheet-download-link text-primary underline hover:text-primary/80",children:"Download"})]})]})}let eW=/(CarEdge Pro)/;function eq(e,i="root"){if(b.IS_FAIRAUTO||null==e||"boolean"==typeof e)return e;if("string"==typeof e)return e.includes("CarEdge Pro")?e.split(eW).map((e,a)=>"CarEdge Pro"===e?(0,t.jsx)(r.default,{href:"/pro",target:"_blank",rel:"noopener noreferrer",prefetch:!1,className:"font-bold text-primary hover:underline",children:e},`${i}-cp-${a}`):(0,t.jsx)(n.default.Fragment,{children:e},`${i}-t-${a}`)):e;if("number"==typeof e)return e;if(Array.isArray(e))return e.map((e,r)=>(0,t.jsx)(n.default.Fragment,{children:eq(e,`${i}-${r}`)},`${i}-${r}`));if(n.default.isValidElement(e)){let t=e.type;if(t===r.default||"a"===t||"code"===t)return e;let a=e.props;return null==a.children?e:n.default.cloneElement(e,void 0,eq(a.children,`${i}-c`))}return e}let eG={h2:({children:e})=>(0,t.jsx)("h2",{className:"text-base font-semibold text-foreground mt-4 mb-2",children:eq(e,"h2")}),h3:({children:e})=>(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mt-3 mb-1",children:eq(e,"h3")}),p:({children:e})=>(0,t.jsx)("p",{className:"text-[15px] leading-relaxed text-foreground mb-2",children:eq(e,"p")}),strong:({children:e})=>(0,t.jsx)("strong",{className:"font-semibold text-foreground",children:eq(e,"strong")}),ul:({children:e})=>(0,t.jsx)("ul",{className:"space-y-1.5 mb-3 list-disc pl-5 marker:text-muted-foreground",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"space-y-1.5 mb-3 list-decimal pl-5 marker:text-muted-foreground",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"text-[15px] text-foreground leading-relaxed pl-1",children:eq(e,"li")}),a:function({href:e,children:n}){let r=(0,S.useActingLink)(e??"");if(!function(e){if(!e)return!1;if(/^\/[^/]/.test(e)||/^#/.test(e))return!0;try{return["http:","https:","mailto:"].includes(new URL(e).protocol)}catch{return!1}}(e))return(0,t.jsx)("span",{children:n});if(e&&eB(e))return(0,t.jsx)(eH,{href:e,children:n});let i=function(e){if(!e||!b.IS_FAIRAUTO)return e;try{let t=new URL(e),n="caredge.com"===t.hostname||t.hostname.endsWith(".caredge.com"),r=t.pathname.startsWith("/shop-cars/new/")||t.pathname.startsWith("/shop-cars/used/");if(!n||!r)return e;return t.hostname=b.tenantConfig.domain,t.toString()}catch{return e}}(r||e);return e&&/caredge\.com\/shop-cars\/(new|used)\//.test(e)?(0,t.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg border border-primary/20 bg-primary/5 hover:bg-primary/10 hover:border-primary/40 text-primary text-sm font-medium transition-colors no-u
1nderline",children:[(0,t.jsx)("svg",{className:"w-3.5 h-3.5 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),n]}):(0,t.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 underline",children:n})},code:({children:e})=>(0,t.jsx)("code",{className:"text-sm bg-muted text-foreground px-1.5 py-0.5 rounded",children:e}),table:({children:e})=>(0,t.jsx)("div",{className:"my-3 w-full overflow-x-auto",children:(0,t.jsx)("table",{className:"w-full min-w-max text-[12.5px] border-collapse",children:e})}),thead:({children:e})=>(0,t.jsx)("thead",{className:"bg-muted/40",children:e}),tbody:({children:e})=>(0,t.jsx)("tbody",{children:e}),tr:({children:e})=>(0,t.jsx)("tr",{className:"border-b border-border last:border-b-0",children:e}),th:({children:e})=>(0,t.jsx)("th",{className:"px-2 py-1 text-left font-semibold text-foreground whitespace-nowrap",children:eq(e,"th")}),td:({children:e})=>(0,t.jsx)("td",{className:"px-2 py-1 text-foreground align-top",children:eq(e,"td")})};function eK({content:e,isStreaming:n,carMake:r,carModel:i,dealerSearchUrl:a}){let l,s,o,c,d=function(e){let t;if(!e.includes("|"))return e;let n=/\|(?:\s*:?-+:?\s*\|){2,}/g,r=e,i=[];for(;null!==(t=n.exec(r));)i.push({start:t.index,end:t.index+t[0].length,text:t[0]});for(let e=i.length-1;e>=0;e--){let t,{start:n,end:a,text:l}=i[e],s=(l.match(/\|/g)||[]).length-1;if(s<2)continue;let o=-1,c=0;for(let e=n-1;e>=0;e--){let t=r[e];if("\n"===t)break;if("|"===t&&++c===s+1){o=e;break}}if(-1===o)continue;let d=[],u=a,m=0,p=a;for(let e=a;e<r.length;e++){let t=r[e];if("\n"===t)break;"|"===t&&++m===s+1&&(d.push(r.slice(u,e+1).trim()),u=e+1,m=0,p=e+1)}let f=r.slice(o,n).trim(),h=f.replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim()),g=h.length>0&&h.every(e=>""===e),x=2===s;if((g||x)&&d.length>0){let e=[];for(let t of d){let n=t.replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim()).filter(e=>e.length>0);if(0===n.length)continue;if(1===n.length){e.push(`- ${n[0]}`);continue}let r=n[0],i=n.slice(1).join(" — ");e.push(`- ${r}: ${i}`)}t="\n\n"+e.join("\n")+"\n\n"}else t="\n\n"+f+"\n"+l+(d.length>0?"\n"+d.join("\n"):"")+"\n\n";r=r.slice(0,o).replace(/\s+$/,"")+t+r.slice(p).replace(/^\s+/,"")}return r}(function(e){if(!e.includes("|"))return e;let t=e.split("\n"),n=/^\s*\|(?:\s*:?-+:?\s*\|){2,}\s*$/,r=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").length;for(let e=1;e<t.length;e++){if(!n.test(t[e]))continue;let i=r(t[e]);if(i<2)continue;let a=e-1;if(a<0)continue;a-1>=0&&"|"===t[a-1].trim()&&(t.splice(a-1,1),e--,a--);let l=t[a];if(!l.trim().startsWith("|"))continue;let s=r(l);if(s<1||s>=i)continue;let o=i-s;t[a]="|"+" |".repeat(o)+l.trim().slice(1)}return t.join("\n")}(function(e){if(!e.includes("|"))return e;let t=/^\|(\s*\|)+\s*$/,n=/^\|(\s*:?-+:?\s*\|)+\s*$/,r=e.split("\n"),i=[];for(let e=0;e<r.length;e++){let a=r[e],l=e+1<r.length?r[e+1]:"";if(!t.test(a.trim())||!n.test(l.trim())){i.push(a);continue}let s=[],o=e+2;for(;o<r.length;o++){let e=r[o].trim();if(!e.startsWith("|")||!e.endsWith("|")||e.length<2)break;let t=e.slice(1,-1).split("|").map(e=>e.trim()).filter(e=>e.length>0);if(0===t.length)continue;let n=t[0].replace(/^\*\*(.+)\*\*$/,"$1"),i=t.slice(1).join(" — ");s.push(i?`**${n}:** ${i}`:`**${n}**`)}if(s.length>0){for(let[e,t]of(i.length>0&&""!==i[i.length-1].trim()&&i.push(""),s.entries()))e>0&&i.push(""),i.push(t);o<r.length&&""!==r[o].trim()&&i.push("")}e=o-1}return i.join("\n")}(i&&a?(l=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=r?`(?:${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}[ \\t\\u00A0]+)?`:"",o=RegExp(`\\b(?:(\\d{4})[ \\t\\u00A0]+)?${s}${l}(?:s\\b|(?:[ \\t\\u00A0]+[A-Z][A-Za-z0-9-]*)*)\\b`,"g"),c=new URLSearchParams(a.includes("?")?a.split("?")[1]:""),e.split(/(\[[^\]]*\]\([^)]*\)|`[^`]+`)/g).map((e,t)=>t%2==1?e:e.replace(o,(e,t)=>{let n=a;if(t){let e=new URLSearchParams(c);e.set("year_min",t),e.set("year_max",t),n=`https://${b.tenantConfig.domain}/shop-cars?${e.toString()}`}return`[${e}](${n})`})).join("")):e)));return(0,t.jsx)("div",{className:(0,$.cn)("prose-chat w-full [overflow-wrap:anywhere]",n&&"copilot-streaming"),children:(0,t.jsx)(eP.default,{components:eG,remarkPlugins:[eL.default],children:d})})}function eY({vehicles:e,onSend:n}){let r=(0,R.widgetGroupCtas)(e,(0,O.getWidgetDealer)());return 0===r.length?null:(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:r.map(e=>e.href?(0,t.jsx)("a",{href:e.href,className:"widget-group-cta rounded-full border border-border bg-muted px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-muted/80",children:e.label},e.label):(0,t.jsx)("button",{type:"button",onClick:()=>e.message&&n(e.message),className:"widget-group-cta cursor-pointer rounded-full border border-border bg-muted px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-muted/80",children:e.label},e.label))})}function eZ(){let{isPro:e,isLoaded:r}=(0,V.useProStatus)(),{additionalPlans:a}=(0,H.useNavData)(),l=(0,i.useRouter)(),s=(0,n.useRef)(!1);return((0,n.useEffect)(()=>{!r||e||a.aiNegotiator.active||s.current||(s.current=!0,(0,x.track)(y.EVENTS.COPILOT_UPGRADE_VIEWED,{Location:"Pro Nudge Banner",product:"ai_negotiator"}))},[r,e,a.aiNegotiator.active]),!r||e||a.aiNegotiator.active)?null:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2.5 rounded-xl bg-gradient-to-r from-primary/5 to-primary/10 border border-primary/15 mt-2",children:[(0,t.jsx)(p.Sparkles,{className:"w-4 h-4 text-primary shrink-0"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground flex-1",children:[(0,t.jsx)("span",{className:"text-foreground font-medium",children:"You're on the free tier."})," ","Get AI Buying Agent and let AI negotiate car deals with dealers on your behalf."]}),(0,t.jsx)("button",{onClick:()=>{(0,x.track)(y.EVENTS.COPILOT_UPGRADE_CLICKED,{Location:"Pro Nudge Banner",product:"ai_negotiator"}),l.push("/checkout/ai-buying-agent?from=copilot")},className:"shrink-0 text-xs font-semibold text-primary hover:text-primary/80 transition-colors",children:"Get AI Buying Agent →"})]})}function eX({createdAt:e}){let n=(0,Z.formatRelativeCompact)(e);if(!n)return null;let r=(0,Z.isToday)(e),i=(0,Z.formatTime)(e),a=(0,Z.formatAbsolute)(e,{includeYear:"auto"});return(0,t.jsx)("span",{className:"text-[11px] tabular-nums text-muted-foreground
1/70",title:(0,Z.formatTooltip)(e)||void 0,children:r?(0,t.jsxs)(t.Fragment,{children:[n,i&&(0,t.jsxs)("span",{className:"text-muted-foreground/50",children:[" (",i,")"]})]}):a||n})}function eQ({content:e,messageId:r,sessionId:i,initialFeedback:s,suppressFeedbackPrompt:c=!1}){let[d,u]=(0,n.useState)(!1),[m,p]=(0,n.useState)(s),[g,b]=(0,n.useState)(!1),[v,k]=(0,n.useState)(!1),[j,w]=(0,n.useState)(null),[N,_]=(0,n.useState)(""),[C,S]=(0,n.useState)(!1),E=(0,n.useRef)(!1),T=async()=>{if(e)try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},A=async t=>{if(g||!i)return;let n=m===t?null:t;p(n),b(!0),(0,x.track)(y.EVENTS.COPILOT_FEEDBACK,{rating:n??"cleared",message_preview:e.slice(0,200),page:window.location.pathname});try{await (0,D.submitMessageFeedback)(i,r,n,{messagePreview:e.slice(0,500),notifySlack:c}),n&&!c&&(w(n),_(""),k(!0))}catch(e){console.error("Failed to save message feedback",e),p(m),a.toast.error("Couldn't save your feedback. Please try again.")}finally{b(!1)}},I=()=>{C||(k(!1),_(""),w(null))},P=async()=>{if(C||!i||!j)return void I();I(),a.toast.success("Thanks for your feedback!");try{await (0,D.submitMessageFeedback)(i,r,j,{messagePreview:e.slice(0,500),notifySlack:!0})}catch(e){console.error("Failed to send feedback Slack notification",e)}},L=async()=>{if(C||!i||!j)return;let t=N.trim();if(!t)return void P();S(!0);try{await (0,D.submitMessageFeedback)(i,r,j,{comment:t,messagePreview:e.slice(0,500),notifySlack:!0}),a.toast.success("Thanks for the detail!"),E.current=!0,k(!1),_(""),w(null)}catch(e){console.error("Failed to send feedback detail",e),a.toast.error("Couldn't send your comment. Please try again.")}finally{S(!1)}};return(0,t.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground -mt-1",children:[(0,t.jsx)("button",{onClick:T,"aria-label":d?"Copied!":"Copy message",className:"p-1 rounded-md text-muted-foreground/70 hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:d?(0,t.jsx)(l.Check,{className:"w-3.5 h-3.5 text-primary"}):(0,t.jsx)(o.Copy,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{onClick:()=>A("like"),disabled:g||v||!i,"aria-label":"like"===m?"Remove like":"Like","aria-pressed":"like"===m,className:(0,$.cn)("p-1 rounded-md transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed","like"===m?"text-primary":"text-muted-foreground/70 hover:text-foreground","dislike"===m&&"opacity-40"),children:(0,t.jsx)(h.ThumbsUp,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{onClick:()=>A("dislike"),disabled:g||v||!i,"aria-label":"dislike"===m?"Remove dislike":"Dislike","aria-pressed":"dislike"===m,className:(0,$.cn)("p-1 rounded-md transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed","dislike"===m?"text-destructive":"text-muted-foreground/70 hover:text-foreground","like"===m&&"opacity-40"),children:(0,t.jsx)(f.ThumbsDown,{className:"w-3.5 h-3.5"})}),(0,t.jsx)(e1,{open:v,rating:j,text:N,isSending:C,onTextChange:_,onSkip:P,onSubmit:L,onOpenChange:e=>{e||(E.current?(E.current=!1,I()):P())}})]})}function eJ({attachments:e}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-2 justify-end max-w-full",children:e.map(e=>{var n,r,i;let a=!0===e.deleted,l="failed"===e.status,s="extracting"===e.status,o="ready"===e.status&&e.preview_url?e.preview_url:null,m=(n=e.mime_type)?n.startsWith("image/")?u.Image:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===n||"text/csv"===n?c.FileSpreadsheet:d.FileText:d.FileText,p=[(r=e.mime_type)?"application/pdf"===r?"PDF":"text/plain"===r?"Text":"text/csv"===r?"CSV":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===r?"Spreadsheet":"application/vnd.openxmlformats-officedocument.wordprocessingml.document"===r?"Word document":r.startsWith("image/")?r.replace("image/","").toUpperCase():r.split("/").pop()?.toUpperCase()||"File":"File",!(i=e.file_size_bytes)?"":i<1024?`${i} B`:i<1048576?`${(i/1024).toFixed(0)} KB`:`${(i/1048576).toFixed(1)}
1 MB`].filter(Boolean).join(" · "),f=!a&&!l&&!!e.mime_type?.startsWith("image/")&&!!o,h=(0,t.jsxs)(t.Fragment,{children:[f?(0,t.jsx)("span",{className:"shrink-0 w-9 h-9 rounded-md overflow-hidden",children:(0,t.jsx)("img",{src:o,alt:e.file_name??"Image attachment",className:"w-full h-full object-cover"})}):(0,t.jsx)("span",{className:(0,$.cn)("flex shrink-0 items-center justify-center w-9 h-9 rounded-md",a?"bg-muted text-muted-foreground":l?"bg-destructive/10 text-destructive":"bg-primary/10 text-primary"),children:(0,t.jsx)(m,{className:"w-4 h-4"})}),(0,t.jsxs)("span",{className:"flex flex-col min-w-0 leading-tight",children:[(0,t.jsx)("span",{className:(0,$.cn)("truncate text-[13px] font-medium",a?"text-muted-foreground italic":l?"text-destructive":"text-foreground"),children:a?"File deleted":e.file_name}),(0,t.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:a?"Removed from this conversation":l?e.extraction_error??"Processing failed":s?"Processing…":p})]})]}),g=(0,$.cn)("flex items-center gap-2.5 px-2.5 py-2 rounded-xl border max-w-[280px] min-w-[200px] transition-colors",a?"bg-muted/40 border-border":l?"bg-destructive/5 border-destructive/30":"bg-card border-border hover:bg-muted/40");return o?(0,t.jsx)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:(0,$.cn)(g,"cursor-pointer no-underline"),title:`Open ${e.file_name} in a new tab`,children:h},e.id):(0,t.jsx)("div",{className:g,title:a?`${e.file_name} (deleted)`:l?e.extraction_error??e.file_name:e.file_name,children:h},e.id)})})}function e0({content:e}){let[r,i]=(0,n.useState)(!1),a=async()=>{if(e)try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)}catch{}};return(0,t.jsx)("button",{type:"button",onClick:a,"aria-label":r?"Copied!":"Copy message",className:"p-1 rounded-md text-muted-foreground/70 hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:r?(0,t.jsx)(l.Check,{className:"w-3.5 h-3.5 text-primary"}):(0,t.jsx)(o.Copy,{className:"w-3.5 h-3.5"})})}function e1({open:e,rating:n,text:r,isSending:i,onTextChange:a,onSkip:l,onSubmit:s,onOpenChange:o}
1){let c="like"===n;return(0,t.jsx)(U.Dialog,{open:e,onOpenChange:o,children:(0,t.jsxs)(U.DialogContent,{children:[(0,t.jsxs)(U.DialogHeader,{children:[(0,t.jsxs)(U.DialogTitle,{className:"flex items-center gap-2",children:[c?(0,t.jsx)(h.ThumbsUp,{className:"size-4 text-primary","aria-hidden":"true"}):(0,t.jsx)(f.ThumbsDown,{className:"size-4 text-destructive","aria-hidden":"true"}),c?"What did you like?":"What went wrong?"]}),(0,t.jsx)(U.DialogDescription,{children:c?"Help us repeat what worked. (Optional)":"Tell us what to fix. (Optional)"})]}),(0,t.jsx)(z.Textarea,{value:r,onChange:e=>a(e.target.value),placeholder:c?"What was helpful about this answer?":"What was missing, wrong, or confusing?",rows:4,maxLength:4e3,autoFocus:!0,disabled:i,"aria-label":"Additional feedback"}),(0,t.jsxs)(U.DialogFooter,{children:[(0,t.jsx)(B.Button,{type:"button",variant:"ghost",onClick:l,disabled:i,children:"Skip"}),(0,t.jsx)(B.Button,{type:"button",onClick:s,disabled:!r.trim()||i,children:i?"Sending…":"Send"})]})]})})}function e2({deals:e,onSend:r}){let i=(0,n.useRef)(null);return(0,n.useEffect)(()=>{i.current?.scrollIntoView({behavior:"smooth",block:"end"})},[]),(0,t.jsx)("div",{ref:i,className:"grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-2 mt-2 copilot-quick-action-enter",children:e.map(e=>{let n,i=[e.year,e.make,e.model,e.trim].filter(Boolean).join(" "),a=`Latest on my ${i}`+(e.dealer_name?` at ${e.dealer_name}`:"");return(0,t.jsxs)("button",{type:"button",onClick:()=>r?.(a,void 0,{activeDcInquiryId:e.inquiry_id,isStatusPoll:!0}),className:(0,$.cn)("flex flex-col gap-1 w-full text-left min-h-[44px]","px-3 py-2.5 rounded-xl border text-sm transition-all duration-150","border-primary/30 bg-primary/5 hover:bg-primary/15 hover:border-primary/50","active:scale-[0.99]","focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background"),children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:(0,$.cn)("size-2 rounded-full shrink-0","dealer_replied"===(n=(e.status??"").toLowerCase())||"quoted"===n?"bg-emerald-500":"negotiating"===n?"bg-primary":"bg-amber-500"),"aria-hidden":!0}),(0,t.jsx)("span",{className:"font-medium text-foreground truncate",children:i||"Deal"})]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums truncate",children:e.vin?`VIN ${e.vin}`:"VIN unavailable"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:e.dealer_name||"Dealer unavailable"})]},e.inquiry_id)})})}function e5({replies:e,onSend:r,onPrefill:i,condition:a,autoScroll:l=!0}){let s=(0,n.useRef)(null);return(0,n.useEffect)(()=>{l&&s.current?.scrollIntoView({behavior:"smooth",block:"end"})},[]),(0,t.jsx)("div",{ref:s,className:"flex flex-wrap gap-2 mt-2 copilot-quick-action-enter",children:e.map(e=>(0,t.jsx)("button",{onClick:()=>{/negotiate/i.test(e)&&(0,x.track)(y.EVENTS.NEGOTIATION_START_DEAL,{source:"copilot_suggestion",Condition:a??void 0}),r?r(e):i&&i(e)},className:(0,$.cn)("copilot-suggestion-chip","inline-flex items-center px-4 py-2.5 min-h-[44px] rounded-full border text-sm transition-all duration-150","border-primary/30 bg-primary/5 text-primary","hover:bg-primary/15 hover:border-primary/50","active:scale-95","focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background"),children:e},e))})}let e4="M13 10V3L4 14h7v7l9-11h-7z";function e3(e,t=!1){let n=[],r=e.vehicleCards.length,i=r>0,a=e.dealAnalyses.length>0,l=e.otdPredictions.length>0,s=e.negotiations.length>0,o=e.paymentRequired.length>0,c=e.tradeInValuations.length>0,d=e.dealerTransparency.length>0;return r>=5?[{label:"Negotiate for me",message:"Help me negotiate on the best option!",iconPath:e4,isPremium:!0}]:s?(t?n.push({label:"View vehicle details",message:"View vehicle details — show me the market value, what the dealer paid, and the out-the-door price for this car."},{label:"What's a certified dealer?",message:`What's a ${b.tenantConfig.name} Certified dealer, and why does it matter for this deal?`},{label:"Set a target price",message:"I'd like to set a target price for this negotiation.",isPremium:!0}):n.push({label:"Find another car to negotiate",message:"Can you help me find another car to negotiate on?"},{label:"Show my deal overview",message:"Show me my deal overview.",kind:"open_deal_overview"},{label:"Add my trade-in",message:"I have a vehicle to trade in — can you estimate its value?"}),n):o?[]:(l||a?(n.push({label:"Negotiate for me",message:"Yes, negotiate this deal for me!",iconPath:e4,isPremium:!0}),c||n.push({label:"I have a trade-in",message:"I have a vehicle to trade in — can you estimate its value?"}),a&&n.push({label:"Find similar vehicles",message:"Can you find me similar vehicles at a better price?"})):i&&d?n.push({label:"Learn more about this car",message:"I'd like to learn more about this car."},{label:"What will I really pay?",message:"What will I actually pay out the door for this?"},{label:"Negotiate for me",message:"Yes, negotiate this deal for me!",iconPath:e4,isPremium:!0}):i?n.push({label:"Learn more about this car",message:"I'd like to learn more about this car."},{label:"Is this a good deal?",message:"Is this a good deal? What should I really expect to pay?"},{label:"Negotiate for me",message:"Yes, negotiate this deal for me!",iconPath:e4,isPremium:!0}):c&&n.push({label:"Use toward a new car",message:"I want to use this trade-in toward a new purchase."}),n)}function e9({message:e,sessionId:r,onSend:a,onPrefill:l,conciergeRouted:s,onAskConcierge:o,onOpenDealOverview:c}){let{isPartnerDealer:d}=(0,J.usePartnerDealers)(),u=e.negotiations[0]?.dealer_name,p=(0,ee.isNoAgentPartnerDeal)(!!u&&d(u),e.negotiations[0]),f=e3(e,p).filter(e=>"open_deal_overview"!==e.kind||!!c),{isPro:h}=(0,V.useProStatus)(),{additionalPlans:g}=(0,H.useNavData)(),b=(0,i.useRouter)(),v=f.some(e=>e.isPremium&&/negotiate/i.test(e.label)),k=(0,n.useRef)(!1);if((0,n.useEffect)(()=>{v&&!k.current&&(k.current=!0,(0,x.track)(y.EVENTS.COPILOT_NEGOTIATE_CTA_SHOWN,{vin:e.vehicleCards[0]?.vin??void 0,make:e.vehicleCards[0]?.make??void 0,model:e.vehicleCards[0]?.model??void 0,source:"chat_suggestion"}))},[v,e.vehicleCards]),0===f.length)return null;let j=h||g.aiNegotiator.active;return(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-2 copilot-quick-action-enter",children:f.map(n=>{let i=n.isPremium&&!j;return(0,t.jsxs)("button",{onClick:()=>
1{if("open_deal_overview"===n.kind){let t=e.negotiations[0];t&&c?.(t);return}if(s&&n.isPremium&&/negotiate/i.test(n.label))return void o?.(e.vehicleCards[0]);if(n.isPremium&&/negotiate/i.test(n.label)&&(0,x.track)(y.EVENTS.COPILOT_NEGOTIATE_CTA_CLICKED,{vin:e.vehicleCards[0]?.vin??void 0,make:e.vehicleCards[0]?.make??void 0,model:e.vehicleCards[0]?.model??void 0,is_locked:i,source:"chat_suggestion"}),i){let t=e.vehicleCards[0];t?.vin?((0,X.savePendingVehicle)({vin:t.vin,year:null!=t.year?String(t.year):null,make:t.make??null,model:t.model??null,trim:t.trim??null,price:null!=t.price_cents?String(Math.round(t.price_cents/100)):null,dealer:t.dealer_name??null,dealerId:t.dealer_id??null,condition:t.condition??null}),(0,X.markPendingVehicleForCheckout)(r??null)):(0,X.clearPendingVehicle)();let n=(0,X.buildCheckoutVehicleParams)(r);b.push(`/checkout/ai-buying-agent?${n?`${n}&`:""}from=copilot`);return}n.isPremium&&/negotiate/i.test(n.label)&&(0,x.track)(y.EVENTS.NEGOTIATION_START_DEAL,{source:"copilot_quick_action",Condition:e.vehicleCards[0]?.condition??void 0}),a?a(n.message):l&&l(n.message)},"aria-label":i?`${n.label} — requires Pro`:void 0,className:(0,$.cn)("group inline-flex items-center gap-1.5 px-4 py-2.5 min-h-[44px] rounded-full border text-sm transition-all duration-150 active:scale-95 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background",i?"border-amber-500/30 bg-amber-500/5 text-amber-600 hover:bg-amber-500/10 hover:border-amber-500/50 dark:text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 hover:border-primary/50 text-primary hover:text-primary"),children:[i?(0,t.jsx)(m.Lock,{className:"w-3.5 h-3.5 shrink-0"}):n.iconPath?(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:n.iconPath})}):null,n.label]},n.label)})})}function e6({intent:e,phase:r="preparing",dotsOnly:i=!1}){let a="continuing"===r?Y.CONTINUATION_MESSAGES:Y.THINKING_MESSAGES[e??"default"],[l,s]=(0,n.useState)(()=>Math.floor(Math.random()*a.length));return(0,n.useEffect)(()=>{let e=setInterval(()=>{s(e=>(e+1)%a.length)},2800);return()=>clearInterval(e)},[a]),(0,t.jsxs)("div",{role:"status","aria-label":i?"Typing":void 0,className:"flex items-center gap-2.5 text-muted-foreground",children:[(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-primary animate-bounce",style:{animationDelay:"0ms"}}),(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-primary animate-bounce",style:{animationDelay:"150ms"}}),(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-primary animate-bounce",style:{animationDelay:"300ms"}})]}),!i&&(0,t.jsx)("span",{className:"text-sm text-muted-foreground transition-opacity duration-300",children:a[l]})]})}function e7(e){if(!e)return null;let t=e.split("\n")[0].trim();if(!t.startsWith("{"))return null;try{let e=JSON.parse(t);if(!0!==e.__vdp)return null;return e}catch{return null}}function e8(e){if(!e)return null;let t=e.split("\n")[0].trim();if(!t.startsWith("{"))return null;try{let e=JSON.parse(t);if(!0!==e.__referral)return null;return e}catch{return null}}function te(e){let{isCaredgeCertified:t}=(0,J.usePartnerDealers)();return!!e&&t(e.toLowerCase().trim())}function tt({data:e,isValidating:n,isStarted:r}){let i=[e.year,e.make,e.model,e.trim].filter(Boolean).join(" "),a=e.price?`$${e.price.toLocaleString("en-US")}`:null,l=te(e.dealer);return(0,t.jsxs)("div",{className:"rounded-2xl border border-border bg-muted/50 px-4 py-3 text-sm max-w-xs",children:[(0,t.jsx)("p",{className:(0,$.cn)("text-[10px] font-semibold uppercase tracking-[0.18em] mb-1.5",r?"text-primary":n?"text-muted-foreground animate-pulse":"text-primary animate-pulse"),children:r?"AI Buying Agent · Started":n?"Validating plan…":"AI Buying Agent · Starting…"}),i&&(0,t.jsx)("p",{className:"font-semibold text-foreground leading-snug",children:i}),(0,t.jsxs)("div",{className:"mt-1.5 space-y-0.5 text-muted-foreground text-xs",children:[a&&(0,t.jsxs)("p",{children:["Listed at ",a]}),e.dealer&&(0,t.jsxs)("p",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)("span",{className:"truncate",children:e.dealer}),l&&(0,t.jsx)(Q.CertifiedPill,{})]}),e.vin&&(0,t.jsx)("p",{className:"font-mono text-[10px]",children:e.vin})]})]})}function tn(e){if(!e)return null;let t=e.split("\n")[0].trim();if(!t.startsWith("{"))return null;try{let e=JSON.parse(t);if(!0!==e.__negotiate)return null;return e}catch{return null}}function tr(e){if(!e)return null;let t=e.split("\n")[0].trim();if(!t.startsWith("{"))return null;try{let e=JSON.parse(t);if(!0!==e.__negotiate_bulk)return null;let n=e.vehicles;if(!Array.isArray(n))return null;return n.filter(e=>!!e&&"object"==typeof e)}catch{return null}}function ti({data:e}){return(0,t.jsxs)("div",{className:"max-w-xs rounded-2xl border border-border bg-muted/50 px-4 py-3 text-sm",children:[(0,t.jsxs)("p",{className:"mb-1.5 text-[10px] font-semibold tracking-[0.18em] text-primary uppercase",children:["Negotiate · ",e.length," requested"]}),(0,t.jsx)("ul",{className:"space-y-1.5",children:e.map((e,n)=>
1{let r=[e.year,e.make,e.model,e.trim].filter(Boolean).join(" ");return(0,t.jsxs)("li",{className:"min-w-0",children:[r&&(0,t.jsx)("p",{className:"truncate leading-snug font-semibold text-foreground",children:r}),e.dealer_name&&(0,t.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:e.dealer_name})]},e.vin??n)})})]})}function ta({data:e}){let n=[e.year,e.make,e.model,e.trim].filter(Boolean).join(" "),r=e.price_cents?`$${Math.round(e.price_cents/100).toLocaleString("en-US")}`:null,i=te(e.dealer_name);return(0,t.jsxs)("div",{className:"rounded-2xl border border-border bg-muted/50 px-4 py-3 text-sm max-w-xs",children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] text-primary mb-1.5",children:"Negotiate · Requested"}),n&&(0,t.jsx)("p",{className:"font-semibold text-foreground leading-snug",children:n}),(0,t.jsxs)("div",{className:"mt-1.5 space-y-0.5 text-muted-foreground text-xs",children:[r&&(0,t.jsxs)("p",{children:["Listed at ",r]}),e.dealer_name&&(0,t.jsxs)("p",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)("span",{className:"truncate",children:e.dealer_name}),i&&(0,t.jsx)(Q.CertifiedPill,{})]}),e.vin&&(0,t.jsx)("p",{className:"font-mono text-[10px]",children:e.vin})]})]})}function tl(e){if(!e)return null;let t=e.split("\n")[0].trim();if(!t.startsWith("{"))return null;try{let e=JSON.parse(t);if(!0!==e.__preferences)return null;return e}catch{return null}}function ts({data:e}){let n=[];e.trim&&n.push(e.trim),"number"==typeof e.max_price&&n.push(`Under $${e.max_price.toLocaleString("en-US")}`),e.colors?.length&&n.push(e.colors.join(", ")),e.must_have?.length&&n.push(e.must_have.join(", "));let r=!e.skip&&n.length>0;return(0,t.jsxs)("div",{className:"rounded-2xl border border-border bg-muted/50 px-4 py-3 text-sm max-w-xs",children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] text-primary mb-1.5",children:e.skip?"Pick the best for me":"My preferences"}),r?(0,t.jsx)("p",{className:"font-medium text-foreground leading-snug",children:n.join(" · ")}):(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e.skip?"Recommend the best fit and I'll confirm.":"Show me your best recommendation."})]})}e.s(["ChatMessage",0,function({message:e,sessionId:r,isAiNegotiator:i,isNavDataPending:l,activeNegotiationVins:o,closedNegotiationIds:c,onPaymentComplete:d,onSend:u,onPrefill:m,isLastAssistant:p,isLoading:f,showProNudge:h,onEdit:w,isEditable:S,canShowEditButton:R,onEditingChange:z,thinkingIntent:B,suppressNegotiationUpsell:V,isNegotiateKickoff:H,conciergeRouted:Y,negotiationConfirm:Z,outboundApproval:Q,closeConfirm:eP,confirmDetailsBeforeOutreach:eL,onRequestNegotiationConfirmation:eW,onRequestNegotiationConfirmationMany:eq,onRequestReferralConsent:eG,bulkNegotiateEnabled:e1,onAskConcierge:e4,onOpenDealOverview:te,confirmOutreachUrl:to,manualNegotiateUrl:tc,onShareVehicle:td,shareSelect:tu,shareControl:tm,onDisplayedVehiclesChange:tp,onNegotiationStarted:tf,onWidgetCta:th,suppressFeedbackPrompt:tg,typingDotsOnly:tx=!1,readOnly:tb,freeDealerQuotesEnabled:ty=!1}){var tv,tk;let tj,tw,tN,t_,tC,tS,tE,tT,tA="user"===e.role,tI=e.isStreaming??!1,tP=(tv=e.toolCalls,tk=e.content,tj=tv.map(e=>"dealer_otd_sheet"===e.tool_name?e.result?.url:e.result?.otd_sheet_url).filter(e=>"string"==typeof e&&eB(e)),tw=new Set((tk.match(/https?:\/\/[^\s)<>\]"']+/g)??[]).filter(eB).map(eV)),tj.some(e=>tw.has(eV(e)))?null:tj.at(-1)??null),{isPartnerDealer:tL}=(0,J.usePartnerDealers)(),tD=e.negotiations[0]?.dealer_name,tM=(0,ee.isNoAgentPartnerDeal)(!!tD&&tL(tD),e.negotiations[0]),[tO,tR]=(0,n.useState)(!1),[tF,t$]=(0,n.useState)(""),[tU,tz]=(0,n.useState)(!1),tB=(0,n.useRef)(null),[tV,tH]=(0,n.useState)(null),[tW,tq]=(0,n.use
1State)(null),tG=(0,n.useRef)(!1),[tK,tY]=(0,n.useState)(null),tZ=(0,W.useFairautoSigninGate)(),tX=(0,n.useMemo)(()=>new Set([...o??[]].map(e=>e.toUpperCase())),[o]),tQ=(0,q.useDealUpdates)().deals,tJ=(0,G.useWonDeals)().deals,t0=(0,K.useClosedDeals)().deals,t1=tQ.length>0||tJ.length>0||t0.length>0,t2=e.id,t5=(0,n.useCallback)(e=>tp?.(t2,e),[tp,t2]),[t4,t3]=(0,n.useState)(null),[t9,t6]=(0,n.useState)(!1),t7=e=>{tR(e),z?.(e)},t8=(0,n.useRef)(null),ne=e=>""===e.trim()?0:e.trim().split(/\s+/).length,nt=ne(tF),nn=nt>=300,nr=()=>{let e=tF.trim();e&&(w?.(e),t7(!1))},ni=()=>{t7(!1)},na=e=>{let t=e.target.value;ne(t)>300||t$(t)},nl=e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),nr())};(0,n.useEffect)(()=>{if(tO&&t8.current){t8.current.focus();let e=t8.current.value.length;t8.current.setSelectionRange(e,e)}},[tO]),(0,n.useEffect)(()=>{if(!tO)return;let e=e=>{"Escape"===e.key&&(tR(!1),z?.(!1))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[tO,z]);let ns=(0,n.useCallback)(async(e,t)=>{if(!u||!r||!e.dealer_name||tG.current)return;tG.current=!0,tY(e.vin??null);let n=e.dealer_name;try{let l=t?.alreadyCreated?{inquiries_started:1}:await (0,D.confirmOutreach)(r,[{name:n,dealer_id:e.dealer_id??void 0,vin:e.vin??void 0,year:e.year??void 0,make:e.make??void 0,model:e.model??void 0,trim:e.trim??void 0,price_cents:e.price_cents??void 0,asking_price_cents:e.asking_price_cents??void 0,msrp_cents:null!=e.msrp?Math.round(100*e.msrp):void 0,is_new:"new"===e.condition}],{isAiNegotiator:i,baseUrl:to});if(l?.payment_required||l?.results?.some(e=>e.payment_required)){tB.current=e,tz(!0);return}if(!l||(l.inquiries_started??0)===0)return void a.toast.error(l?.message??`Couldn't start negotiation with ${n}. Please try again.`);let s=l?.results?.find(e=>e.free_referral_id);if(s)return void u(s.message??"Reached out to the dealer for you — they'll be in touch directly by email or phone, so check your inbox for their reply.");(0,x.track)(y.EVENTS.NEGOTIATION_START_DEAL,{source:"copilot_chat",Location:"Copilot Chat",VIN:e.vin??void 0,Condition:e.condition??void 0}),u(JSON.stringify({__negotiate:!0,dealer_name:n,vin:e.vin??void 0,dealer_id:e.dealer_id??null,year:e.year??void 0,make:e.make??void 0,model:e.model??void 0,trim:e.trim??void 0,price_cents:e.price_cents??void 0,asking_price_cents:e.asking_price_cents??void 0,msrp_cents:null!=e.msrp?Math.round(100*e.msrp):void 0})),tf?.(e,"ai")}catch{a.toast.error(`Couldn't start negotiation with ${n}. Please try again.`)}finally{tG.current=!1,tY(null)}},[u,r,i,to,tf]),no=(0,n.useCallback)(async e=>{if(u){if(f)return void a.toast.info("One moment — finishing the reply first.");if(Y)return void e4?.(e);if(!e.vin?.trim())return void a.toast.error("I need the exact vehicle first — pick a specific listing to negotiate.");if(!tZ()&&!l&&!(!i&&!b.IS_FAIRAUTO&&r&&e.dealer_name&&eG&&tL(e.dealer_name,e.dealer_id??void 0)&&eG({dealerName:e.dealer_name,dealerIds:e.dealer_id?[e.dealer_id]:[]},()=>void ns(e)))){if(!i){e.vin&&(0,X.savePendingVehicle)({vin:e.vin,year:null!=e.year?String(e.year):null,make:e.make??null,model:e.model??null,trim:e.trim??null,price:null!=e.price_cents?String(Math.round(e.price_cents/100)):null,dealer:e.dealer_name??null,dealerId:e.dealer_id??null,condition:e.condition??null}),tB.current=e,tz(!0);return}if(!r)return void a.toast.error("Couldn't start negotiation — session not ready. Please refresh and try again.");if(!e.dealer_name)return void a.toast.error("Couldn't start negotiation — dealer info missing. Please try again.");if(eL&&!b.IS_FAIRAUTO&&eW){tY(e.vin??null);try{let t=await eW(e);if("awaiting_confirmation"===t)return;if("payment_required"===t){tB.current=e,tz(!0);return}if("created"===t)return void await ns(e,{alreadyCreated:!0});a.toast.error(`Couldn't reach ${e.dealer_name}. Please try again.`);return}finally{tY(null)}}if(!b.IS_FAIRAUTO&&tL(e.dealer_name,e.dealer_id??void 0)||b.IS_FAIRAUTO&&t1)return void await ns(e);tq({dealerLabel:e.dealer_name,execute:()=>void ns(e)})}}},[u,r,i,l,tz,Y,e4,tL,ns,eL,eW,eG,tZ,t1,f]),nc=(0,n.useCallback)(async e=>{if(!u||0===e.length)return;if(f)return void a.toast.info("One moment — finishing the reply first.");if(Y)return void e4?.(e[0]);if(tZ()||l)return;if(!i){let t=e[0];t?.vin&&(0,X.savePendingVehicle)({vin:t.vin,year:null!=t.year?String(t.year):null,make:t.make??null,model:t.model??null,trim:t.trim??null,price:null!=t.price_cents?String(Math.round(t.price_cents/100)):null,dealer:t.dealer_name??null,dealerId:t.dealer_id??null,condition:t.condition??null}),tB.current=t??null,tz(!0);return}if(!r)return void a.toast.error("Couldn't start — session not ready. Please refresh and try again.");if(!eL||!eq){for(let t of e)await no(t);return}let{outcome:t,dropped:n}=await eq(e);
1if("payment_required"===t){tB.current=e[0]??null,tz(!0);return}"error"===t?a.toast.error("Couldn't set those up. Please try again."):n.length>0&&a.toast.warning(`We couldn't set up ${1===n.length?"one":n.length}: ${n.join(", ")}. Review the rest below.`)},[u,Y,e4,tZ,l,i,r,tz,eL,eq,no,f]),nd=(0,n.useCallback)(async e=>{if(tc){if(f)return void a.toast.info("One moment — finishing the reply first.");if(!e.dealer_name)return void a.toast.error("Couldn't create a manual negotiation — dealer info missing.");t6(!0);try{if(!(await fetch((0,j.apiUrl)(tc),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({manual:!0,dealer_name:e.dealer_name,dealer_id:e.dealer_id??null,vin:e.vin??void 0,year:e.year??void 0,make:e.make??void 0,model:e.model??void 0,trim:e.trim??void 0,price_cents:e.price_cents??void 0,is_new:"new"===e.condition})})).ok)throw Error("manual create failed");(0,x.track)(y.EVENTS.NEGOTIATION_START_DEAL,{source:"copilot_chat_manual",Location:"Copilot Chat",VIN:e.vin??void 0,Condition:e.condition??void 0}),a.toast.success("Manual negotiation created — it's under My Concierge."),tf?.(e,"manual")}catch{a.toast.error("Couldn't create the manual negotiation. Please try again.")}finally{t6(!1),t3(null)}}},[tc,tf,f]),nu=(0,n.useCallback)(async e=>{if(u){if(e.existing_negotiation_id){let t=[e.year,e.make,e.model,e.trim].filter(Boolean).join(" ");u(`Show me the latest status of my negotiation #${e.existing_negotiation_id} (${t})`);return}if(tc)return void t3(e);await no(e)}},[u,tc,no]),nm=(0,n.useMemo)(()=>{let t=function(e,t,n=!1){let{toolCalls:r,vehicleCards:i}=e;var a=function(e){let t=[],n=[];for(let r of e)"single"===r.kind&&"dealer_match"===r.block.type?t.push(r):n.push(r);return[...n,...t]}(function(e,t){let n=e=>"single"===e.kind&&"tool_call"===e.block.type?t[e.block.index]?.tool_name:void 0,r=[],i=0;for(;i<e.length;){let t=n(e[i]);if(!t){r.push(e[i]),i+=1;continue}let a=[],l=i;for(;l<e.length&&n(e[l])===t;){let t=e[l];"single"===t.kind&&"tool_call"===t.block.type&&a.push(t.block.index),l+=1}a.length>=2?r.push({kind:"tool-group",indices:a,key:`tg-${t}-${a[0]}`}):r.push(e[i]),i=l}return r}(function(e){let t=e.some(e=>"group"===e.kind||"single"===e.kind&&"vehicle_card"===e.block.type),n=[],r=[];for(let i of e)("skeleton-grid"!==i.kind||t)&&("single"!==i.kind||"tool_call"!==i.block.type)?r.push(i):n.push(i);return[...n,...r]}(function(e,t,n,r){let i=[],a=[],l=0;for(;l<e.length;){let s=e[l];if("tool_call"===s.type&&t[s.index]?.tool_name==="search_caredge_inventory"){let s=!1,o=!1,c=0,d=0,u=[],m=[];for(;l<e.length;){let r=e[l];if("tool_call"===r.type&&t[r.index]?.tool_name==="search_caredge_inventory"){let e=t[r.index];e?.status==="running"&&(s=!0);let n=e?.result,a=n?.vehicles?.length??0;(a>0||(n?.total_found??0)>0)&&(o=!0),c+=a,i.push({kind:"single",block:r,blockIdx:l,key:`pt-${l}`}),l++;continue}if("vehicle_card"===r.type){let e=n[r.index];d++,e&&(u.push(e),m.push({block:r,blockIdx:l})),l++;continue}break}let p=r&&(s||0===u.length&&(d>0||o)||c>0&&u.length<c);if(u.length>0){let e=u[0].condition,t=u[0].make,n=a.find(n=>0===n.vehicles.length||n.vehicles[0]?.condition===e&&n.vehicles[0]?.make===t);n||(n={key:`vehicle-slot-${a.length}`,outIdx:i.length,vehicles:[],cardRefs:[],seenKeys:new Set,pending:!1},a.push(n),i.push({kind:"skeleton-grid",key:`${n.key}-reserved`,count:1}));for(let e=0;e<u.length;e++){let t=u[e],r=t.vin;r&&n.seenKeys.has(r)||(r&&n.seenKeys.add(r),n.vehicles.push(t),n.cardRefs.push(m[e]))}p&&(n.pending=!0)}else if(p)if(a.length>0)a[a.length-1].pending=!0;else{let e={key:"vehicle-slot-0",outIdx:i.length,vehicles:[],cardRefs:[],seenKeys:new Set,pending:!0};a.push(e),i.push({kind:"skeleton-grid",key:`${e.key}-reserved`,count:1})}continue}if("vehicle_card"===s.type){let t=l,r=[];for(;l<e.length&&"vehicle_card"===e[l].type;){let t=n[e[l].index];t&&r.push(t),l++}r.length>=2?i.push({kind:"group",vehicles:r,key:`group-${t}`}):i.push({kind:"single",block:e[t],blockIdx:t,key:`pt-${t}`});continue}i.push({kind:"single",block:s,blockIdx:l,key:`pt-${l}`}),l++}for(let e=a.length-1;e>=0;e--){let t=a[e],n=[];if(t.vehicles.length>=2)n.push({kind:"group",vehicles:t.vehicles,key:`merged-${t.key}`});else if(1===t.vehicles.length){let e=t.cardRefs[0];n.push({kind:"single",block:e.block,blockIdx:e.blockIdx,key:`pt-${e.blockIdx}`})}t.pending&&n.push({kind:"skeleton-grid",key:`${t.key}-loading`,count:1}),i.splice(t.outIdx,1,...n)}return i}(n?e.contentBlocks.filter(e=>"vehicle_card"!==e.type&&("tool_call"!==e.type||r[e.index]?.tool_name!=="search_caredge_inventory")):e.contentBlocks,r,i,t)),r));let l=[],s=[];for(let e of a)"single"===e.kind&&"payment_required"===e.block.type?l.push(e):s.push(e);return[...s,...l]}(e,tI,H);
1return tx?t.filter(e=>"tool-group"!==e.kind&&"skeleton-grid"!==e.kind&&("single"!==e.kind||"tool_call"!==e.block.type)):t},[e,tI,H,tx]),np=(0,n.useMemo)(()=>(function(e){let t=e.toolCalls.find(e=>"search_caredge_inventory"===e.tool_name),n=t?.toolArgs;if(!n)return;let r="string"==typeof n.make?n.make:void 0,i="string"==typeof n.model?n.model:void 0,a=new URLSearchParams;"string"==typeof n.condition&&a.set("condition",n.condition),r&&a.set("make",r),i&&a.set("model",i),"string"==typeof n.zip_code&&a.set("zip",n.zip_code),"number"==typeof n.year?(a.set("year_min",String(n.year)),a.set("year_max",String(n.year))):("number"==typeof n.year_min&&a.set("year_min",String(n.year_min)),"number"==typeof n.year_max&&a.set("year_max",String(n.year_max))),"number"==typeof n.price_max&&a.set("price_max",String(n.price_max)),"number"==typeof n.price_min&&a.set("price_min",String(n.price_min)),"number"==typeof n.radius&&a.set("radius",String(n.radius));let l=eU("string"==typeof n.exterior_color?n.exterior_color:void 0,e$),s=eU("string"==typeof n.interior_color?n.interior_color:void 0,e$),o=eU("string"==typeof n.body_type?n.body_type:void 0,eF);l&&a.set("exterior_color",l),s&&a.set("interior_color",s),o&&a.set("body_type",o),"string"==typeof n.trim&&n.trim.length>0&&a.set("trim",n.trim),"number"==typeof n.mileage_max&&a.set("mileage_max",String(n.mileage_max));let c=a.toString(),d=c?`/shop-cars?${c}`:"/shop-cars";return{searchUrl:`https://${b.tenantConfig.domain}${d}`,make:r,model:i}})(e),[e]),nf=np?.searchUrl,nh=np?.make,ng=np?.model,nx=e.toolCalls?.some(e=>"search_caredge_inventory"===e.tool_name&&"completed"===e.status),nb=(0,N.isQualifyTreatment)(),ny=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{nx&&nb&&!ny.current&&(ny.current=!0,(0,v.trackEvent)(k.COPILOT_REFERRAL_GA4.SEARCH_SHOWN,{Name:"Copilot Referral - Search Shown",Category:"Marketing",source:"copilot"}))},[nx,nb]),(0,t.jsxs)("div",{className:(0,$.cn)("copilot-message-enter flex",tA?"justify-end":"justify-start"),children:[(0,t.jsxs)("div",{className:(0,$.cn)("flex flex-col gap-3 min-w-0",tA&&tO?"w-full":tA?"copilot-user-row max-w-[85%]":"w-full sm:max-w-[85%]",tA?"items-end":"items-start"),children:[tA&&(()=>{var n;let r,i,a,s=e7(e.content);if(s){let e=!!(s.vin&&o?.has(s.vin));return(0,t.jsx)(tt,{data:s,isValidating:l,isStarted:e})}let c=tn(e.content);if(c)return(0,t.jsx)(ta,{data:c});let d=tr(e.content);if(d)return d.length>0?(0,t.jsx)(ti,{data:d}):null;let u=tl(e.content);if(u)return(0,t.jsx)(ts,{data:u});let m=e8(e.content);return m?(0,t.jsx)("div",{"data-bubble":"user",className:"px-4 py-3 rounded-2xl rounded-br-md text-[15px] leading-relaxed [overflow-wrap:anywhere] overflow-hidden bg-gradient-to-br from-primary to-primary/90 text-primary-foreground",children:(r="used"===(n=m).inventoryType?"used":"new",i=[n.year,n.make,n.model,n.trim,n.exteriorColor].filter(
1Boolean).join(" "),a=n.postalCode?` near ${n.postalCode}`:"",`I'm looking for a ${r} ${i}${a}. Can you find dealers that have this vehicle?`)}):tO?(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsx)("textarea",{ref:t8,value:tF,onChange:na,onKeyDown:nl,placeholder:"Edit your message...",rows:3,className:"w-full min-h-[80px] resize-none rounded-xl border border-border bg-background px-3 py-2.5 text-[15px] text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50"}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-1.5",children:[(0,t.jsxs)("span",{className:(0,$.cn)("text-xs tabular-nums",nn?"text-destructive":"text-muted-foreground"),children:[nt," / ",300," words"]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("button",{onClick:ni,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"}),(0,t.jsx)("button",{onClick:nr,disabled:!tF.trim(),className:"text-xs font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Save"})]})]})]}):(0,t.jsxs)("div",{className:(0,$.cn)("flex flex-col items-end gap-1.5",!!w&&!1!==S&&!1!==R&&"group"),children:[(0,t.jsx)("div",{"data-bubble":e.isAutoMessage?"user-auto":"user",className:(0,$.cn)("px-4 py-3 rounded-2xl rounded-br-md text-[15px] leading-relaxed [overflow-wrap:anywhere] overflow-hidden",e.isAutoMessage?"bg-slate-200 text-slate-500 dark:bg-slate-700 dark:text-slate-400":"bg-gradient-to-br from-primary to-primary/90 text-primary-foreground"),children:e.content}),e.attachments&&e.attachments.length>0?(0,t.jsx)(eJ,{attachments:e.attachments}):null]})})(),tA&&!tO&&(tN=null!==e7(e.content)||null!==tn(e.content)||null!==tr(e.content)||null!==tl(e.content)||null!==e8(e.content),e.content&&!tN?(0,t.jsxs)("div",{className:"flex items-center gap-1 -mt-1",children:[(0,t.jsx)(e0,{content:e.content}),(0,t.jsx)(eX,{createdAt:e.created_at})]}):(0,t.jsx)(eX,{createdAt:e.created_at})),!tA&&e.isAutoMessage&&(t_=e.content,tC=/resumed/i.test(t_)?(0,t.jsx)(s.CheckCircle2,{className:"size-4 shrink-0"}):(0,t.jsx)(g.XCircle,{className:"size-4 shrink-0"}),(0,t.jsxs)("div",{className:"w-full flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"inline-flex max-w-full items-center gap-2 self-start rounded-xl border border-yellow-200 bg-yellow-50 px-3 py-2 text-[15px] leading-relaxed text-yellow-900 dark:border-yellow-500/30 dark:bg-yellow-500/10 dark:text-yellow-100",children:[tC,(0,t.jsx)("span",{className:"break-words",children:t_})]}),(0,t.jsx)(eX,{createdAt:e.created_at})]})),!tA&&!e.isAutoMessage&&(0,t.jsxs)("div",{className:"relative group/msg w-full @container flex flex-col gap-3",children:[e.contentBlocks.length>0?nm.map(n=>{if("group"===n.kind){let r,i;return(0,t.jsxs)(ez,{children:[(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsx)(er.VehicleCardGroup,{vehicles:n.vehicles,onAnalyze:tb?void 0:nu,conciergeShare:Y,negotiatingVin:tK,onShare:td,shareSelect:tu,onNegotiateMany:tb||!e1?void 0:nc,negotiationBusy:!!f,alreadyNegotiatingVins:tX,userZip:function(e,t=!1){if((0,O.isWidgetSession)())return;let n=e.toolCalls.find(e=>"search_caredge_inventory"===e.tool_name),r=n?.toolArgs?.zip_code;return"string"==typeof r?r:t?void 0:(0,M.getZip)()??void 0}(e,!!td||!!tu),initialSort:(r=e.toolCalls.find(e=>"search_caredge_inventory"===e.tool_name),"string"==typeof(i=r?.toolArgs?.sort_by)&&eM.has(i)?i:void 0),onWidgetCta:th,onDisplayedVehiclesChange:tp?t5:void 0,...function(e){let t,n,r=e.toolCalls.find(e=>"search_caredge_inventory"===e.tool_name),i=r?.toolArgs;if(!i)return{};let a=eO(i.target_year),l=eO(i.year);return null!=a?(t=a,n=a):null!=l?(t=l,n=l):(t=eO(i.year_min),n=eO(i.year_max)),{yearMin:t,yearMax:n,priceMin:eO(i.price_min),priceMax:eO(i.price_max),radius:eO(i.radius_miles)??eO(i.radius),mileageMax:eO(i.mileage_max),exteriorColor:eU(eR(i.exterior_color),e$),interiorColor:eU(eR(i.interior_color),e$),bodyType:eU(eR(i.body_type),eF),trim:eR(i.trim),partnerOnly:!0===i.partner_only||void 0,includeInTransit:!1!==i.include_in_transit&&void 0}}(e)}),th&&(0,t.jsx)(eY,{vehicles:n.vehicles,onSend:th})]}),tm]},n.key)}if("skeleton-grid"===n.kind)return(0,t.jsx)(ez,{children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ea.VehicleSkeletonGrid,{count:n.count})})},n.key);if("tool-group"===n.kind){let r=n.indices.map(t=>
1e.toolCalls[t]).filter(Boolean);if(0===r.length)return null;let i=r.find(e=>"running"===e.status)??r[r.length-1];return(0,t.jsx)(ez,{children:(0,t.jsx)(et.ToolCallIndicator,{toolCall:i,shimmerIndex:n.indices[0],awaitsApproval:(0,L.toolCallAwaitsApproval)(i,(0,L.unresolvedHeldApprovals)(e.id,e.outboundApprovals,Q?.statuses))})},n.key)}return(0,t.jsx)(ez,{children:function(e,n,r,i,a,l,s,o,c,d,u,m,p,f,h,g,v,k,j,w){switch(e.type){case"tool_call":{let i=r.toolCalls[e.index];return i?(0,t.jsx)(et.ToolCallIndicator,{toolCall:i,shimmerIndex:e.index,awaitsApproval:(0,L.toolCallAwaitsApproval)(i,(0,L.unresolvedHeldApprovals)(r.id,r.outboundApprovals,h?.statuses))},`tc-${n}`):null}case"vehicle_card":{let i=r.vehicleCards[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(en.VehicleCard,{vehicle:i,onAnalyze:l,onWidgetCta:v,onShare:j,isNegotiating:!!i.vin&&i.vin===p})},`vc-${n}`):null}case"dealer_transparency":{let i=r.dealerTransparency[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(es.DealerTransparencyCard,{data:i})},`dt-${n}`):null}case"otd_prediction":{let i=r.otdPredictions[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eo.OtdPredictionCard,{prediction:i})},`otd-${n}`):null}case"deal_analysis":{let i=r.dealAnalyses[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(el.DealAnalysisCard,{analysis:i})},`da-${n}`):null}case"trade_in_valuation":{let i=r.tradeInValuations[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ep.TradeInCard,{data:i})},`tiv-${n}`):null}case"payment_required":{let l=r.paymentRequired[e.index];return l?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(em.PaymentCard,{data:l,sessionId:i,onPaymentComplete:a,suppressNegotiationUpsell:m})},`pay-${n}`):null}case"negotiation":{let i=r.negotiations[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ec.NegotiationCard,{negotiation:i,onViewUpdates:w})},`neg-${n}`):null}case"form_submission":{let i=r.formSubmissions[e.index];return i&&"skipped"!==i.status?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eu.FormSubmissionCard,{data:i})},`form-${n}`):null}case"recall_result":{let i=r.recallResults[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ef.RecallCard,{data:i})},`recall-${n}`):null}case"window_sticker":{let i=r.windowStickers[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eh.WindowStickerCard,{data:i})},`sticker-${n}`):null}case"finance_result":{let i=r.financeResults[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eg.FinanceCard,{data:i})},`fin-${n}`):null}case"invoice_price":{let i=r.invoicePrices[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ex.InvoicePriceCard,{data:i})},`inv-${n}`):null}case"vehicle_features":{let i=r.vehicleFeatures[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eb.VehicleFeaturesCard,{data:i})},`vf-${n}`):null}case"price_history":{let i=r.priceHistories[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ey.PriceHistoryCard,{data:i})},`ph-${n}`):null}case"incentives_result":{let i=r.incentivesResults[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ev.IncentivesCard,{data:i})},`inc-${n}`):null}case"dom_analysis":{let i=r.domAnalyses[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ek.DomAnalysisCard,{data:i})},`dom-${n}`):null}case"warranty_result":{let i=r.warrantyResults[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ew.WarrantyCard,{data:i})},`war-${n}`):null}case"cost_to_own":{let i=r.costToOwnResults[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eN.CostToOwnCard,{data:i})},`cto-${n}`):null}case"depreciation_curve":{let i=r.depreciationCurves[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(e_.DepreciationCurveCard,{data:i})},`dep-${n}`):null}case"market_value":{let i=r.marketValues[e.index];return i&&(0,eC.hasRenderableMarketValue)(i)?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eC.MarketValueCard,{data:i})},`mv-${n}`):null}case"garage_details":{let i=r.garageDetails[e.index];if(!i)return null;return(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eS.GarageBreakdownCard,{data:i,onSendMessage:s??o??(()=>{})})},`gd-${n}`)}case"onboarding_dealer_board":{let i=r.onboardingDealerBoards?.[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eE.OnboardingDealerBoardCard,{board:i})},`odb-${n}`):null}case"partner_cards":{let i=r.partnerCards?.[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eT.ProtectionPartnersCard,{data:i})},`pc-${n}`):null}case"concierge_upgrade":{if(b.IS_FAIRAUTO)return null;let i=r.conciergeUpgrades?.[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(eA.ConciergeUpgradeCard,{data:i})},`cu-${n}`):null}case"dealer_match":{if(b.IS_FAIRAUTO)return null;let i=r.dealerMatches?.[e.index];return i?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(ei.DealerMatchInlineCard,{data:i,onSend:s,restored:r.restored})},`dm-${n}`):null}case"negotiation_confirm":{let i=r.negotiationConfirms??[],a=!0===k,l=a?i.findIndex(Boolean):e.index;if(l<0||e.index!==l)return null;let s=[];if(i.forEach((t,n)=>{if(!t||!a&&n!==e.index)return;let i=(0,P.negotiationConfirmCardKey)(r.id,n),l=t.vehicle.vin?.toUpperCase(),o=!!l&&!!f?.startedVins?.has(l),c=!!f?.submittingKeys.has(i),d=f?.statuses[i];s.push({payload:t,cardKey:i,startedElsewhere:o&&!c&&!d,status:c?"pen
1ding":o?"confirmed":d??t.resolution??"pending",blockedReason:f?.blockedReasons[i]??null,retryable:f?.retryableBlocked.has(i)??!1,carried:(!!l&&f?.carriedVinsByMessage[r.id]?.has(l))??!1})}),0===s.length)return null;let o=1===s.length?s[0]:null;if(!f)return(0,t.jsx)("div",{className:"w-full",children:o?(0,t.jsx)(T.NegotiationConfirmCard,{payload:o.payload,status:o.status,startedElsewhere:o.startedElsewhere,readOnly:!0}):(0,t.jsx)(T.NegotiationConfirmGroupCard,{items:s,readOnly:!0})},`ncf-${n}`);return(0,t.jsx)("div",{className:"w-full",[P.NEGOTIATION_CONFIRM_KEY_ATTR]:s[0].cardKey,children:o?(0,t.jsx)(T.NegotiationConfirmCard,{payload:o.payload,status:o.status,startedElsewhere:o.startedElsewhere,blockedReason:o.blockedReason,isSubmitting:f.submittingKeys.has(o.cardKey),onConfirm:()=>f.onConfirm(o.payload,o.cardKey),onRequestChanges:()=>f.onRequestChanges(o.payload,o.cardKey)}):(0,t.jsx)(T.NegotiationConfirmGroupCard,{items:s,isSubmitting:s.some(e=>f.submittingKeys.has(e.cardKey)),onConfirmAll:e=>{let t=new Set(e),n=s.filter(e=>t.has(e.cardKey)).map(e=>({payload:e.payload,cardKey:e.cardKey}));(0,x.track)(y.EVENTS.NEGOTIATION_BULK_START_CLICKED,{selected:n.length,total:s.length}),f.onConfirmAll(n)},onRequestChanges:()=>f.onRequestChangesAll(s.filter(e=>"pending"===e.status).map(e=>({payload:e.payload,cardKey:e.cardKey})))})},`ncf-${n}`)}case"outbound_approval":{let i=r.outboundApprovals?.[e.index];if(!i||!h)return null;let a=(0,P.negotiationConfirmCardKey)(r.id,e.index);return(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(A.OutboundApprovalCard,{payload:i,status:h.statuses[a]??(0,L.knownOutboundResolution)(i.resolution)??"pending",isSubmitting:h.submittingKey===a,sendBlockReason:i.inquiry_id&&h.sendBlockedReasons?.get(i.inquiry_id)||null,onApprove:()=>h.onApprove(i,a),onRequestChanges:()=>h.onRequestChanges(i,a)})},`oa-${n}`)}case"close_confirm":{let i=r.closeConfirms?.[e.index];if(!i||!g)return null;let a=(0,P.negotiationConfirmCardKey)(r.id,e.index);return(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(I.CloseDealConfirmCard,{payload:i,status:(0,L.closeConfirmCardStatus)({liveStatus:g.statuses[a],resolution:i.resolution,inquiryId:i.inquiry_id,negotiationId:i.negotiation_id,resolvedDealIds:g.resolvedDealIds,answeredDealIds:g.answeredDealIds}),isSubmitting:g.submittingKey===a,onClose:()=>g.onClose(i,a),onKeepOpen:()=>g.onKeepOpen(i,a)})},`cc-${n}`)}case"text":return e.segment?(0,t.jsx)(eK,{content:e.segment,isStreaming:r.isStreaming,dealerSearchUrl:c,carMake:d,carModel:u},`text-${n}`):null;default:return null}}(n.block,n.blockIdx,e,r,d,tb?void 0:nu,u,m,nf,nh,ng,V,tK,tb?void 0:Z,tb?void 0:Q,tb?void 0:eP,th,e1,tb?void 0:td,tb?void 0:te)},n.key)}):(0,t.jsx)(t.Fragment,{children:e.content&&(0,t.jsx)(eK,{content:e.content,isStreaming:tI})}),!tI&&tP&&(0,t.jsx)(eH,{href:tP,children:"Your out-the-door price sheet (PDF)"}),!b.IS_FAIRAUTO&&nx&&nb&&r&&u&&!tI&&(0,t.jsx)(eI.ReferralChoicePills,{sessionId:r,onIntroduce:()=>u?.("Yes, introduce me to these dealers."),onQuestions:()=>u?.("I have a few questions about these.")}),!tI&&e.content&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eQ,{content:e.content,messageId:e.id,sessionId:r,initialFeedback:e.feedback??null,suppressFeedbackPrompt:tg}),(0,t.jsx)(eX,{createdAt:e.created_at})]}),!tI&&p&&!f&&(u||m)&&(()=>{let n=e.negotiationPreferences;if(n?.fields&&n.fields.length>0&&u)return(0,t.jsx)(ed.NegotiationPreferencesCard,{data:n,onSubmit:u});if(e3(e,tM).length>0&&!(nx&&nb)&&!tb)return(0,t.jsx)(e9,{message:e,sessionId:r,onSend:tb?void 0:u,onPrefill:m,conciergeRouted:Y,onAskConcierge:e4,onOpenDealOverview:te});if(e.dealPicker&&e.dealPicker.length>0)return(0,t.jsx)(e2,{deals:e.dealPicker,onSend:u});if(e.suggestedReplies&&e.suggestedReplies.length>0){let n=c&&c.size>0&&e.negotiations.some(e=>c.has(e.negotiation_id))?e.suggestedReplies.filter(e=>!/follow.?up|close.*deal/i.test(e)):e.suggestedReplies;return 0===n.length?null:(0,t.jsx)(e5,{replies:n.slice(0,3),onSend:u,onPrefill:m,condition:e.vehicleCards[0]?.condition})}return null})(),!tI&&p&&!f&&!u&&!m&&th&&e.suggestedReplies&&e.suggestedReplies.length>0&&(0===(tS=e.suggestedReplies.filter(e=>!/negotiate/i.test(e))).length?null:(0,t.jsx)(e5,{replies:tS.slice(0,4),onSend:th,autoScroll:!1})),h&&!tI&&e.content&&0===e.negotiations.length&&(0,t.jsx)(eZ,{}),(tE=H?e.toolCalls.filter(e=>"search_caredge_inventory"!==e.tool_name):e.toolCalls,(tT=(0,F.resolveThinkingPhase)({isStreaming:tI,content:e.content,toolCalls:tx?[]:tE,hasPendingSkeleton:nm.some(e=>"skeleton-grid"===e.kind)}))?(0,t.jsx)(e6,{intent:B,phase:tT,dotsOnly:tx}):null)]}),tV&&(0,t.jsx)(eD,{offer:tV,onDismiss:()=>tH(null)})]}),(0,t.jsx)(U.Dialog,{open:tU,onOpenChange:e=>{tz(e),e||!b.IS_FAIRAUTO&&ty&&tB.current&&tH((0,_.resolveFreeQuotesOffer)({vehicle:tB.current,profileZip:(0,M.getZip)(),listingZip:null}))},children:(0,t.jsxs)(U.DialogContent,{className:"sm:max-w-2xl p-0 overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-6 pt-6 pb-2",children:[(0,t.jsx)(U.DialogTitle,{className:"text-lg font-semibold",children:"Upgrade to start negotiation"}),(0,t.jsx)(U.DialogDescription,{className:"sr-only",children:"Choose AI Buying Agent or Concierge to start negotiating"})]}),(0,t.jsx)(ej.DualUpgradeChoice,{sessionId:r,className:"px-6 pb-6",onDismiss:()=>tz(!1),trigger:"negotiate_cta_click"})]})}),(0,t.jsx)(C.NegotiateModeDialog,{open:!!t4,onOpenChange:e=>{e||t3(null)},isSubmitting:t9,vehicleLabel:t4&&[t4.year,t4.make,t4.model].filter(
1Boolean).join(" ")||void 0,onChooseAI:()=>{t3(null),t4&&no(t4)},onChooseManual:()=>{t4&&nd(t4)}}),(0,t.jsx)(E.NegotiationConfirmModal,{open:!!tW,onOpenChange:e=>{e||tq(null)},dealerLabel:tW?.dealerLabel??null,onConfirm:()=>{tW?.execute(),tq(null)}})]})},"DealPicker",0,e2,"NegotiateBulkContextCard",0,ti,"NegotiateContextCard",0,ta,"parseNegotiateBulkMarker",0,tr,"parseNegotiateMarker",0,tn])}]);

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.