(globalThis.TURBOPACK_remote_chunk_loading_global_prj_Ea8QNpCs22Ye85AIRZ6hT1aa8n7z||(globalThis.TURBOPACK_remote_chunk_loading_global_prj_Ea8QNpCs22Ye85AIRZ6hT1aa8n7z=[])).push(["object"==typeof document?document.currentScript:void 0,45188,97334,70225,e=>{"use strict";var t=e.i(43476),a=e.i(71645),i=e.i(14394),n=e.i(54495),r=e.i(88924),l=e.i(45780),s=e.i(25275);e.i(92409);var o=e.i(943),u=e.i(29065),d=e.i(42166),c=e.i(24755),f=e.i(60310),h=e.i(61728),p=e.i(32193),g=e.i(9149),m=e.i(57095),x=e.i(40998),b=e.i(90920),v=e.i(40195),y=e.i(85463),w=e.i(87513),j=e.i(15925),N=e.i(22806),k=e.i(29616),$=e.i(77280),M=e.i(82815),A=e.i(53297),C=e.i(24944),S=e.i(80637),I=e.i(2586),D=e.i(7146),E=e.i(2052);let L=["pdf417","aztec","qr"],O=e=>{let[t=NaN,a=NaN,i=NaN]=e.split("-").map(Number);return(Date.UTC(t,a-1,i)-Date.UTC(t,0,0))/864e5},T="Couldn’t read that picture. Try another one.";async function R(e,t,a){let i,n=e.flatMap(e=>{let t=function(e){if("M"!==e[0])return null;let t=Number(e[1]);if(!Number.isInteger(t)||t4)return null;let a=[],i=23;for(let n=0;ne.slice(i+t,i+t+a).trim(),n=t(7,3),r=t(10,3),l=t(13,3),s=/^0*(\d{1,4}[A-Z]?)$/.exec(t(16,5)),o=Number(t(21,3)),u=Number.parseInt(t(35,2),16);if(!/^[A-Z]{3}$/.test(n)||!/^[A-Z]{3}$/.test(r)||!/^[A-Z0-9]{2,3}$/.test(l)||!s||!Number.isInteger(o)||o366||!Number.isFinite(u))return null;a.push({pnr:t(0,7),from:n,to:r,carrier:l,flightNumber:s[1],dayOfYear:o,seat:/^0*(\d{1,3}[A-Z])$/.exec(t(25,4))?.[1]??""}),i+=37+u}return{legs:a}}(e.text);return t?[{...e,pass:t}]:[]});for(let{text:e,format:i,pass:r}of n){let n=function(e,t){let a=t.times.gateOut.scheduled??t.times.gateOut.best;if(!a)return null;let i=O((0,E.localDateStr)(a,t.origin.timezone)),n=[t.ident.iata,t.operating?.iata].map(e=>e?(0,D.splitFlightIdent)(e):null).filter(e=>null!=e);return e.legs.find(e=>e.from===t.origin.iata&&e.to===t.destination.iata&&e.dayOfYear===i&&n.some(t=>t.airline===e.carrier&&Number(t.number)===Number.parseInt(e.flightNumber,10)))??null}(r,t);if(!n)continue;let l=await a();return{patch:{barcode:e,barcodeFormat:i,booking:n.pnr,...n.seat?{seat:n.seat}:{},...l?{group:l}:{}}}}for(let{pass:e}of n){let a=function(e,t){let a=t.times.gateOut.scheduled??t.times.gateOut.best;if(!a)return null;let i=(0,E.localDateStr)(a,t.origin.timezone),n=Number(i.slice(0,4)),r=Date.UTC(n,0,O(i)),l=[t.ident.iata,t.operating?.iata].map(e=>e?(0,D.splitFlightIdent)(e):null).filter(e=>null!=e),s=e.legs.find(e=>e.from===t.origin.iata&&e.to===t.destination.iata&&l.some(t=>t.airline===e.carrier&&Number(t.number)===Number.parseInt(e.flightNumber,10)));if(!s)return null;let o=[n-1,n,n+1].map(e=>Date.UTC(e,0,s.dayOfYear)).reduce((e,t)=>Math.abs(t-r)e.toUpperCase().replace(/[^A-Z0-9]/g,""),W=e=>(e.y0+e.y1)/2;function B(e){return e.filter(e=>_.test(e.text.toUpperCase().trim())).map(t=>{let a=t.box.y1-t.box.y0,i=e.find(e=>"BOARDING"===U(e.text)&&Math.abs(W(e.box)-W(t.box))=-(.2*a)&&t.box.x0-e.box.x1e.box.y0-t.box.y0||e.box.x0-t.box.x0)}function K(e){for(let t of e){let e=z.exec(t.text.toUpperCase().trim());if(e)return e[1]??e[2]}for(let t of B(e)){let{x0:a,y0:i,x1:n,y1:r}=t.box,l=r-i,s=(a+n)/2,o=(i+r)/2,u=null;for(let t of e){let e=U(t.text);if(!P.test(e))continue;let i=t.box,d=i.x0-n,c=i.y0-r,f=Math.abs(W(i)-o)=-(.2*l)&&d=-(.3*l)&&ca,p=Math.min(f?d+Math.abs(W(i)-o):1/0,h?c+Math.abs((i.x0+i.x1)/2-s):1/0);pMath.min(e.x1,t.x1)-Math.max(e.x0,t.x0)>=(e.x1-e.x0)/2&&Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)>=(t.y1-t.y0)/2;async function G(e,t){let a=e.filter(e=>/[A-Z]{3}/.test(U(e.text))),i=e.filter(e=>P.test(U(e.text)));for(let n of B(e)){let e=[];for(let r of function(e){let t=e.y1-e.y0,a=(e,t,a,i)=>({left:Math.max(0,Math.round(e)),top:Math.max(0,Math.round(t)),width:Math.round(a),height:Math.round(i)});return[a(e.x0-t,e.y1,e.x1-e.x0+2*t,3*t),a(e.x1,e.y0-t,4*t,3*t)]}(n.box))for(let n of(await t(function(e,t){let a=e.left+e.width,i=e.top+e.height,{left:n,top:r}=e,[l,s]=[a,i];for(let{box:o}of t)!(o.x1=a)&&(o.y1=i||(n=Math.min(n,Math.floor(o.x0)),r=Math.min(r,Math.floor(o.y0)),l=Math.max(l,Math.ceil(o.x1)),s=Math.max(s,Math.ceil(o.y1))));return{left:n,top:r,width:l-n,height:s-r}}(r,i))))a.some(e=>H(n.box,e.box))||e.push(n);let r=K([n,...e]);if(r)return r}return K(e)}var Y=e.i(9875);async function V(t){let a=e=>new URL((0,Y.withBase)(`/ocr/${e}`),location.href).href,i=await e.A(40947).then(async({createWorker:e,OEM:t,PSM:i})=>({PSM:i,ocr:await e("eng",t.LSTM_ONLY,{workerPath:a("worker.min.js"),corePath:a("tesseract-core-simd-lstm.wasm.js"),langPath:a(""),workerBlobURL:!1})})).catch(()=>null);if(!i)return null;let{ocr:n,PSM:r}=i;try{let e=async e=>{let{data:a}=await n.recognize(t,e?{rectangle:e}:{},{blocks:!0});return(a.blocks??[]).flatMap(e=>e.paragraphs.flatMap(e=>e.lines.flatMap(e=>e.words.map(e=>({text:e.text,box:e.bbox})))))};await n.setParameters({tessedit_pageseg_mode:r.AUTO});let a=await e();return await n.setParameters({tessedit_pageseg_mode:r.SINGLE_LINE,tessedit_char_whitelist:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"}),await G(a,e)}catch{return null}finally{await n.terminate()}}async function Z(e){let t=URL.createObjectURL(e);try{let a=new Image;await new Promise((e,i)=>{a.onload=()=>e(),a.onerror=()=>i(Error("The picture can’t be drawn")),a.src=t});let i=Math.max(a.naturalWidth,a.naturalHeight);if(ir.toBlob(e,"image/png"))??e}catch{return e}finally{URL.revokeObjectURL(t)}}async function q(t,a){let i,n=await Z(t);try{let{prepareZXingModule:t,readBarcodes:a}=await e.A(42608);t({overrides:{locateFile:(e,t)=>e.endsWith(".wasm")?(0,Y.withBase)(`/${e}`):t+e}}),i=await a(n,{formats:["PDF417","Aztec","QRCode"],tryHarder:!0})}catch{return{error:T}}return R(i.flatMap(e=>{let t,a=(t=e.format).includes("PDF417")?"pdf417":t.startsWith("Aztec")?"aztec":t.startsWith("QRCode")?"qr":null;return a?[{text:e.text,format:a}]:[]}),a,()=>V(n))}var Q=e.i(30086),J=e.i(920),X=e.i(52236),ee=e.i(4534);function et({barcode:i,fallback:n}){let{text:r,format:l}=i,[s,o]=(0,a.useState)(null);return((0,a.useEffect)(()=>{let t=!0;return o(null),e.A(91279).then(({toSVG:e})=>{let a=e({bcid:F[l],text:r,scale:3}).replace("t&&o("failed")),()=>{t=!1}},[r,l]),"failed"===s)?n:(0,t.jsx)("div",{role:"img","aria-label":"Boarding pass barcode","data-testid":"boarding-pass-barcode",className:(0,X.cn)("mt-stack rounded-control bg-ticket-barcode p-4","pdf417"!==l&&"mx-auto w-64 max-w-full"),children:s?(0,t.jsx)("div",{dangerouslySetInnerHTML:{__html:s}}):(0,t.jsx)("div",{className:"h-24"})})}let ea="w-full min-w-0 rounded-control border border-ticket bg-ticket-actions px-3 py-2 text-ticket-value text-fg-ticket uppercase outline-none placeholder:text-fg-ticket-placeholder focus-visible:ring-2 focus-visible:ring-focus",ei="flex press-95 items-center justify-center gap-1.5 rounded-control bg-ticket-stripe px-4 py-2.5 text-body-strong text-fg-ticket-stripe focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none disabled:opacity-40",en="press-95 rounded-control px-3 py-2.5 text-body-strong text-fg-ticket-action focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none disabled:opacity-40",er="flex flex-1 press-95 flex-col items-center gap-1.5 px-1 py-3.5 text-tile text-fg-ticket-action focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none focus-visible:ring-inset";function el({label:e,className:a,children:i}){return(0,t.jsxs)("div",{className:(0,X.cn)("flex min-w-0 flex-col gap-0.5",a),children:[(0,t.jsx)("span",{className:"text-ticket-label text-fg-ticket-tertiary",children:e}),i]})}function es({initial:e,onSave:i,onCancel:n}){let[r,l]=(0,a.useState)(e),s=(0,k.canSaveBookingCode)(r.booking);return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),s&&i(r)},onKeyDown:e=>"Escape"===e.key&&n(),"aria-label":"Boarding pass details",className:"flex animate-fade-in flex-col gap-stack",children:[(0,t.jsxs)(el,{label:"CONFIRMATION",className:"gap-1.5",children:[(0,t.jsx)("input",{value:r.booking,onChange:e=>l({...r,booking:(0,k.typedBookingCode)(e.target.value)}),placeholder:"ABC123","aria-label":"Confirmation code","aria-describedby":"boarding-pass-code-help",autoFocus:!0,autoCapitalize:"characters",autoComplete:"off",autoCorrect:"off",spellCheck:!1,className:(0,X.cn)(ea,"tabular")}),(0,t.jsx)("span",{id:"boarding-pass-code-help",className:"text-caption text-fg-ticket-tertiary",children:"6 letters and numbers, from your booking email"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-inline",children:[(0,t.jsx)(el,{label:"SEAT",className:"gap-1.5",children:(0,t.jsx)("input",{value:r.seat,onChange:e=>l({...r,seat:(0,k.typedSeat)(e.target.value)}),placeholder:"14A","aria-label":"Seat",autoCapitalize:"characters",autoComplete:"off",autoCorrect:"off",spellCheck:!1,className:ea})}),(0,t.jsx)(el,{label:"GROUP",className:"gap-1.5",children:(0,t.jsx)("input",{value:r.group,onChange:e=>l({...r,group:(0,k.typedGroup)(e.target.value)}),placeholder:"5","aria-label":"Boarding group",autoCapitalize:"characters",autoComplete:"off",autoCorrect:"off",spellCheck:!1,className:ea})}),(0,t.jsx)(el,{label:"CABIN",className:"gap-1.5",children:(0,t.jsx)("input",{value:r.cabin,onChange:e=>l({...r,cabin:e.target.value}),placeholder:"Main","aria-label":"Cabin",maxLength:14,autoComplete:"off",className:ea})})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-inline-sm",children:[(0,t.jsx)("button",{type:"button",onClick:n,className:en,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",disabled:!s,className:ei,children:"Save"})]})]})}function eo({pass:e,notes:i,barcode:n=null,onChange:r,onScan:l,saveFailed:s=!1}){let o=(0,ee.loopRuns)(),[u,d]=(0,a.useState)(null),[c,f]=(0,a.useState)(!1),[h,p]=(0,a.useState)({reading:!1,error:null}),g=async e=>{if(e&&l){p({reading:!0,error:null});try{let t=await l(e);if("error"in t)return p({reading:!1,error:t.error});r(t.patch),f(!1),p({reading:!1,error:null})}catch{p({reading:!1,error:T})}}},m=(0,a.useRef)(null),x=(0,a.useRef)(!1);(0,a.useEffect)(()=>{x.current&&!c&&m.current?.focus(),x.current=c},[c]),(0,a.useEffect)(()=>{if(!u)return;let e=setTimeout(()=>d(null),1400);return()=>clearTimeout(e)},[u]);let b=()=>{if(!navigator.clipboard)return d("failed");navigator.clipboard.writeText(e.shareText).then(()=>d("copied"),()=>d("failed"))},v="copied"===u?Q.Check:"failed"===u?Q.CircleAlert:Q.Share2,y=(0,t.jsx)("p",{className:"mt-1 text-body-sm text-fg-ticket-secondary",children:e.gateHint});return(0,t.jsxs)("article",{"data-testid":"boarding-pass","data-livery":e.livery??void 0,className:"flex flex-col overflow-hidden rounded-dialog",children:[(0,t.jsxs)("div",{className:"bg-ticket",children:[(0,t.jsxs)("header",{className:"flex items-end justify-between gap-inline bg-ticket-stripe px-5 pt-4 pb-3.5 text-fg-ticket-stripe",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"truncate text-ticket-airline uppercase",children:e.airline}),(0,t.jsx)("h2",{className:"text-ticket-flight tabular",children:e.flight})]}),(0,t.jsxs)("div",{className:"flex shrink-0 flex-col items-end",children:[i.cabin&&(0,t.jsx)("p",{className:"max-w-28 truncate text-ticket-airline uppercase",children:i.cabin}),e.day&&(0,t.jsx)("p",{className:"text-ticket-day",children:e.day})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-inline px-5 pt-5 pb-2.5",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-ticket-code text-fg-ticket",children:e.from.code}),e.from.city&&(0,t.jsx)("p",{className:"mt-1 truncate text-body-sm text-fg-ticket-tertiary",children:e.from.city})]}),(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"size-8.5 shrink-0 animate-drift text-fg-ticket-tertiary",style:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 4l18 8-18 8 4-8z"})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col items-end",children:[(0,t.jsx)("p",{className:"text-ticket-code text-fg-ticket",children:e.to.code}),e.to.city&&(0,t.jsx)("p",{className:"mt-1 truncate text-right text-body-sm text-fg-ticket-tertiary",children:e.to.city})]})]})]}),(0,t.jsx)("div",{className:"flex ticket-tear items-center bg-ticket px-5.5",children:(0,t.jsx)("span",{className:"flex-1 border-t-2 border-dashed border-ticket"})}),(0,t.jsxs)("div",{className:"bg-ticket",children:[(0,t.jsx)("div",{className:"px-5 pt-1.5 pb-stack",children:c?(0,t.jsx)(es,{initial:i,onSave:e=>{var t;r((t=i.booking,e.booking===t?e:{...e,barcode:"",barcodeFormat:""})),f(!1)},onCancel:()=>f(!1)}):i.booking?(0,t.jsxs)("div",{className:"animate-fade-in",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-inline",children:[(0,t.jsx)(el,{label:"CONFIRMATION",children:(0,t.jsx)("p",{className:"text-ticket-code text-fg-ticket-accent tabular",children:i.booking})}),(0,t.jsx)("button",{ref:m,type:"button",onClick:()=>f(!0),"aria-label":"Edit the boarding pass details",className:(0,X.cn)(en,"-mr-3"),children:"Edit"})]}),n?(0,t.jsx)(et,{barcode:n,fallback:y}):y]}):(0,t.jsxs)("div",{className:"flex flex-col gap-stack-xs",children:[l&&(0,t.jsxs)("label",{className:(0,X.cn)(ei,"w-full cursor-pointer has-focus-visible:ring-2 has-focus-visible:ring-focus",h.reading&&"opacity-40"),children:[h.reading?"Reading the pass…":"Scan boarding pass",(0,t.jsx)("input",{type:"file",accept:"image/*",disabled:h.reading,onChange:e=>{g(e.target.files?.[0]),e.target.value=""},"aria-describedby":"boarding-pass-scan-help",className:"sr-only"})]}),(0,t.jsxs)("button",{ref:m,type:"button",disabled:h.reading,onClick:()=>f(!0),className:(0,X.cn)(l?en:ei,"flex w-full items-center justify-center gap-1.5"),children:[!l&&(0,t.jsx)(Q.Plus,{size:18,"aria-hidden":"true"}),l?"Enter the code yourself":"Add boarding pass"]}),(0,t.jsx)("p",{id:"boarding-pass-scan-help",role:"status",className:(0,X.cn)("text-body-sm",h.error?"text-fg-ticket":"sr-only"),children:h.error??"Take a photo of the pass, or pick a screenshot of it."})]})}),(0,t.jsxs)("div",{className:"flex justify-between gap-2 px-5 pb-4.5",children:[(0,t.jsx)(el,{label:"GROUP",children:(0,t.jsx)("p",{className:"truncate text-ticket-value text-fg-ticket",children:i.group||"—"})}),(0,t.jsx)(el,{label:"SEAT",children:(0,t.jsx)("p",{className:"truncate text-ticket-value text-fg-ticket",children:i.seat||"—"})}),e.gate&&(0,t.jsx)(el,{label:"GATE",children:(0,t.jsx)("p",{className:"truncate text-ticket-value text-fg-ticket",children:e.gate})}),e.departs&&(0,t.jsx)(el,{label:"DEPARTS",children:(0,t.jsx)("p",{className:"truncate text-ticket-value text-fg-ticket tabular",children:e.departs})})]}),s&&(0,t.jsxs)("p",{role:"status",className:"-mt-2.5 flex items-center gap-1.5 px-5 pb-4.5 text-body-sm text-fg-ticket",children:[(0,t.jsx)(Q.CircleAlert,{className:"size-4 shrink-0","aria-hidden":!0}),"Couldn’t save on this device. It will be lost when you leave the page."]}),(0,t.jsxs)("div",{className:"flex border-t border-ticket bg-ticket-actions",children:[e.phone&&(0,t.jsxs)("a",{href:`tel:${e.phone}`,className:er,children:[(0,t.jsx)(Q.Phone,{size:20,"aria-hidden":"true"}),"Call"]}),e.manageUrl&&(0,t.jsxs)("a",{href:e.manageUrl,target:"_blank",rel:"noopener noreferrer",className:er,children:[(0,t.jsx)(Q.ExternalLink,{size:20,"aria-hidden":"true"}),"Manage"]}),J.SHARING_ENABLED&&(0,t.jsxs)("button",{type:"button",onClick:()=>{if(!navigator.share)return b();navigator.share({title:"My flight",text:e.shareText}).catch(e=>{e instanceof DOMException&&"AbortError"===e.name||b()})},className:er,children:[(0,t.jsx)(v,{size:20,"aria-hidden":"true"}),(0,t.jsx)("span",{"aria-live":"polite",children:"copied"===u?"Copied":"failed"===u?"Couldn’t copy":"Share"})]})]})]})]})}var eu=e.i(9694);let ed=[["hotel","Hotel","e.g. Kimpton Everly · conf #48213"],["meeting","Meeting","e.g. 2 PM · client HQ, Santa Monica"],["pickup","Who’s picking up","e.g. Sam · text on landing"]];function ec({notes:e,onChange:a,saveFailed:i=!1}){return(0,t.jsxs)(eu.default,{title:"Trip notes",className:"gap-stack-sm",children:[(0,t.jsxs)("div",{"data-testid":"trip-notes",className:"flex flex-col",children:[ed.map(([i,n,r])=>(0,t.jsxs)("label",{className:"flex items-center gap-2.5 border-b border-subtle py-2.5 transition-hover focus-within:border-interactive",children:[(0,t.jsx)("span",{className:"w-28 shrink-0 text-label font-semibold text-fg-secondary",children:n}),(0,t.jsx)("input",{value:e[i]??"",onChange:e=>a({[i]:e.target.value}),placeholder:r,className:"min-w-0 flex-1 bg-transparent text-body text-fg outline-none placeholder:text-fg-tertiary"})]},i)),(0,t.jsx)("textarea",{value:e.notes??"",onChange:e=>a({notes:e.target.value}),placeholder:"Anything else for this trip…","aria-label":"Other notes",rows:3,className:"mt-2 min-h-20 resize-none rounded-control bg-surface-muted px-3 py-2.5 text-body text-fg outline-none placeholder:text-fg-tertiary focus-visible:ring-2 focus-visible:ring-focus"})]}),i&&(0,t.jsxs)("p",{role:"status",className:"flex items-center gap-inline-sm text-body-sm text-fg-danger",children:[(0,t.jsx)(Q.CircleAlert,{className:"size-4 shrink-0","aria-hidden":!0}),"Couldn’t save on this device. Your notes will be lost when you leave the page."]})]})}var ef=e.i(8116),eh=e.i(94893),ep=e.i(13065),eg=e.i(81789);let em=e=>({scheduled:e.scheduled,best:e.best,known:"actual"===e.bestSource||"estimated"===e.bestSource});function ex({context:e,title:a}){let{data:i,failed:n}=function(e){let{data:t,status:a}=(0,eg.useFlightResource)((0,eg.selectionRef)(e));return{data:t??null,failed:!t&&!!a?.failed}}(e);if(!i)return(0,t.jsx)(eu.default,{title:a,children:n?(0,t.jsx)(ep.default,{status:{failed:!0,at:null},what:"the timetable"}):(0,t.jsx)("p",{className:"text-body-sm text-fg-tertiary",children:"Loading timetable…"})});let r=i.times,l=(0,eh.timetableModel)({gateOut:em(r.gateOut),takeoff:em(r.takeoff),landing:em(r.landing),gateIn:em(r.gateIn)},{origin:{iata:i.origin.iata,timezone:i.origin.timezone},destination:{iata:i.destination.iata,timezone:i.destination.timezone}});return(0,t.jsx)(ef.default,{title:a,...l})}var eb=e.i(26320),ev=e.i(39338),ey=e.i(84380);for(let[e,a]of Object.entries({"en-route":{title:"En Route",variants:["classic"],Component:function({context:e,title:a}){let i=(0,I.useNow)(3e4),n=(0,eb.useUnits)(),r="flight-leg"===e.kind?e.data?.flight:null;if(!r||null==i)return null;let l=(0,ev.enRouteModelV1)({flight:r,now:i,units:n});if(!l)return null;let s=l.progress;return(0,t.jsx)(eu.default,{title:a,children:(0,t.jsxs)("div",{"data-testid":"en-route-card",className:"flex flex-col gap-stack",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-stack-2xs",children:[(0,t.jsx)("p",{className:"text-headline tabular",children:l.headline}),(0,t.jsxs)("p",{className:"text-body-sm text-fg-secondary tabular",children:[l.eta,l.detail&&(0,t.jsxs)(t.Fragment,{children:[l.eta?" · ":"",(0,t.jsx)("span",{className:(0,X.cn)(l.late&&"text-body-strong text-fg-warning"),children:l.detail})]})]})]}),null!=s&&(0,t.jsxs)("div",{className:"flex flex-col gap-stack-xs",children:[(0,t.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-surface-muted",role:"progressbar","aria-valuenow":Math.round(s),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Flight progress",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-interactive",style:{width:`${Math.max(0,Math.min(100,s))}%`}})}),(0,t.jsx)("p",{className:"text-caption text-fg-secondary tabular",children:l.stats})]}),null==s&&l.stats&&(0,t.jsx)("p",{className:"text-caption text-fg-secondary tabular",children:l.stats}),l.staleFix&&(0,t.jsx)("p",{"data-testid":"stale-position",className:"text-caption text-fg-warning",children:"The last position report is old, so the arrival time may be out of date."}),(0,t.jsx)("p",{className:(0,X.cn)("text-body-sm",!l.arrivalGate&&"text-fg-tertiary"),children:l.arrivalGate?`Arrival ${l.arrivalGate}`:"Arrival gate not assigned yet. Airlines often assign it close to landing."})]})})}},"leave-by":{title:"Be at the airport by",Component:p.default},"wheres-my-plane":{title:"Where’s My Plane?",Component:g.default},"flight-status":{title:"Flight Status",Component:o.default},"delay-risk":{title:"Delay Risk",Component:u.default},"departure-window":{title:"Departure Window",Component:h.default},"departure-capacity":{title:"Departure Capacity",Component:m.FlightDepartureCapacityCard},deicing:{title:"De-icing Risk",Component:b.DeicingOutCard},"taxi-out":{title:"Taxi time",Component:x.TaxiOutCard},"taxi-in":{title:"Taxi time",Component:x.TaxiInCard},timezone:{title:"Time Zone",Component:j.default},"arrival-capacity":{title:"Arrival Capacity",Component:m.FlightArrivalCapacityCard},"airport-about":{title:"Airport Summary",Component:v.default},"weather-impact":{title:"Weather impact today",Component:y.default},"your-connection":{title:"Your connection",Component:w.default},"flight-history":{title:"This flight’s history",Component:N.default},"boarding-pass":{title:"Boarding pass",Component:function({context:e}){let a,i=(0,M.selectedFlight)(e),n=(0,I.useNow)(6e4),r=(0,A.useSavedItineraries)(),{notes:l,update:s,saveFailed:o}=(0,C.useTripNotes)(i?(0,S.tripNotesKey)(i.ident,i.date):null);if(!i||null==n)return null;let u=r.flatMap(e=>e.legs).find(e=>(0,$.legIsFlight)(e,i)&&e.scheduledDate===i.date),d=(0,k.boardingPass)(i.flight,l,n,u);return d?(0,t.jsx)(eo,{pass:d.pass,notes:d.fields,barcode:(a=L.find(e=>e===l.barcodeFormat),l.barcode&&a?{text:l.barcode,format:a}:null),onChange:s,onScan:e=>q(e,i.flight),saveFailed:o}):null}},"trip-notes":{title:"Trip notes",Component:function({context:e}){let a=(0,M.selectedFlight)(e),{notes:i,update:n,saveFailed:r}=(0,C.useTripNotes)(a?(0,S.tripNotesKey)(a.ident,a.date):null);return a?(0,t.jsx)(ec,{notes:i,onChange:n,saveFailed:r}):null}},timetable:{title:"Detailed Timetable",Component:function({context:e,title:a}){return"flight-leg"!==e.kind?null:(0,t.jsx)(ex,{context:e,title:a})}},"winds-aloft":{title:"Winds at cruise",Component:f.default},"weather-combined":{title:"Departure & Arrival Weather",Component:d.default},"route-profile":{title:"Route weather",Component:c.default},"departure-weather":{title:"Departure weather",Component:function(e){return(0,t.jsx)(ey.default,{...e,endpoint:"origin"})}},"arrival-weather":{title:"Arrival weather",Component:function(e){return(0,t.jsx)(ey.default,{...e,endpoint:"destination"})}}}))(0,i.registerCard)({id:e,contexts:["flight-leg"],size:"full",...a});e.s([],97334);let ew={full:"@min-[480px]:col-span-2",wide:"@min-[480px]:col-span-2",narrow:""};e.s(["default",0,function({context:e,order:o,gridClassName:u}){let d=(0,n.useCardVariant)(),c=(0,s.useCardSlotMotion)(),f=(0,a.useRef)(null);(0,l.useCardReorderMotion)(f,o.join("|"),e.kind);let h=o.map(e=>(0,i.getCard)(e)).filter(e=>null!=e&&(!e.variants||e.variants.includes(d)));return(0,t.jsx)("div",{ref:f,className:`@container grid grid-cols-1 gap-4 ${u??"@min-[480px]:grid-cols-2"}`,children:h.map(a=>{let i=a.Component;return(0,t.jsx)("div",{ref:c,"data-card-slot":a.id,className:`${ew[a.size]??""} empty:hidden`,children:(0,t.jsx)(r.default,{title:a.title,children:(0,t.jsx)(i,{context:e,title:a.title})})},a.id)})})}],45188),e.s(["AIRPORT_ORDER",0,["airport-summary","delays-now","tsa-wait","airport-deicing","taxi-time","weather-now","airport-impact","airport-departure-capacity","airport-arrival-capacity"],"FLIGHT_LEG_ORDER",0,{before:["leave-by","flight-status","delay-risk","departure-window","departure-capacity","deicing","taxi-out","wheres-my-plane","flight-history","route-profile","winds-aloft","boarding-pass","arrival-capacity","departure-weather","arrival-weather","timetable","timezone","trip-notes"],during:["en-route","flight-status","your-connection","route-profile","winds-aloft","arrival-capacity","taxi-in","arrival-weather","timetable","timezone","trip-notes"],landed:["flight-status","taxi-in","your-connection","arrival-weather","timetable","timezone","trip-notes","airport-about"],cancelled:["flight-status","weather-impact","weather-combined","trip-notes"]}],70225)},54495,e=>{"use strict";var t=e.i(71645);let a=(0,t.createContext)("classic");e.s(["CardVariantContext",0,a,"useCardVariant",0,()=>(0,t.useContext)(a)])},27737,84380,88107,e=>{"use strict";var t=e.i(43476),a=e.i(77494),i=e.i(79231),n=e.i(13065),r=e.i(2052);e.i(51615);var l=e.i(43277),s=e.i(47448),o=e.i(2586),u=e.i(52518);function d({iata:e,title:c}){let f=(0,u.useTsaWaitInfo)(e),h=(0,u.useTsaWaitStatus)(e),p=(0,s.useKnownAirportTimezone)(e),g=(0,o.useNow)(6e4);if(void 0===f&&!h?.failed)return(0,t.jsx)(i.default,{title:c,shape:"meter"});if(!f)return h?.failed?(0,t.jsx)(n.default,{status:h,what:"the security wait"}):null;let m=(0,l.tsaOutlook)({minutes:f.waitMinutes,level:f.level,live:f.live,observedAt:f.observedAt,timeZone:p,precheckAvailable:f.precheckAvailable,typical:f.typical,nowHour:p&&null!=g?(0,r.localHour)(g,p):null,nowMs:g});return(0,t.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,t.jsx)(a.default,{title:c,code:e,outlook:m}),(0,t.jsx)(n.default,{status:h,what:"the security wait"})]})}e.s(["default",0,function({context:e,title:a}){return"airport"!==e.kind?null:(0,t.jsx)(d,{iata:e.iata,title:a})}],27737);var c=e.i(49157),f=e.i(30086),h=e.i(9694),p=e.i(47970),g=e.i(80635),m=e.i(64720);function x(e,t){if("flight-leg"!==e.kind)return null;let a=e.data?.flight,i="origin"===t;if(a){let e=i?a.origin:a.destination;return{code:e.icao,label:e.iata??e.icao,end:e,timeIso:i?a.times.gateOut.best:a.times.gateIn.best}}let n=i?e.originIata:e.destinationIata;return n?{code:n,label:n,end:null,timeIso:null}:null}function b(e,t){let a=x(e,t),i=(0,g.useAirportWeather)(a?.code),n=(0,s.useAirportTimezone)(a&&!a.end?a.code:null),r="origin"===t,l=(0,c.endpointStripV1)({code:a?.label??null,departure:r,weather:i,flightIso:a?.timeIso,tz:a?.end?.timezone??n});return"ready"!==l.state?l:{...l,...(0,p.stripBanner)(a?.end??null,r?"takeoff":"landing"),icon:r?f.PlaneTakeoff:f.PlaneLanding}}function v({title:e,strip:a,status:r}){return"none"===a.state?null:"loading"===a.state?(0,t.jsx)(i.default,{title:e,shape:"strip"}):"ready"!==a.state?(0,t.jsxs)(h.default,{title:e,children:[(0,t.jsx)("p",{className:"text-body-sm text-fg-tertiary",children:"Forecast unavailable."}),(0,t.jsx)(n.default,{status:r,what:"the forecast"})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,t.jsx)(m.default,{title:e,icon:a.icon,place:a.place,verdict:a.verdict,category:a.category,hours:a.hours,markerIndex:a.markerIndex,markerLabel:a.markerLabel},a.key),(0,t.jsx)(n.default,{status:r,what:"the forecast"})]})}e.s(["EndpointStripCard",0,v,"default",0,function({context:e,title:a,endpoint:i}){let n=b(e,i),r=(0,g.useAirportWeatherStatus)(x(e,i)?.code);return(0,t.jsx)(v,{title:a,strip:n,status:r})},"flightEnd",0,x,"useEndpointStrip",0,b],84380),e.s(["default",0,function({context:e,title:a}){let n="airport"===e.kind?e.iata:"",r=(0,g.useAirportWeather)(n),l=(0,g.useAirportHazards)(n),u=(0,g.useAirportWeatherStatus)(n),d=(0,s.useKnownAirportTimezone)(n),h=(0,o.useNow)(6e4);if(!n)return null;if(!d||null==h||void 0===r)return(0,t.jsx)(i.default,{title:a,shape:"strip"});let m=(0,c.endpointStripV1)({code:n,departure:!0,weather:r,flightIso:new Date(h).toISOString(),tz:d}),x=(0,p.stripBanner)(r?{flightCategory:{now:r.flightCategory,atFlightTime:r.flightCategory},hazards:l??null}:null,"takeoff");return(0,t.jsx)(v,{title:a,status:u,strip:"ready"===m.state?{...m,...x,icon:f.PlaneTakeoff,key:`${n}-${null!=m.markerIndex?m.hours[m.markerIndex]?.key:""}`,place:n,markerLabel:"Now"}:m})}],88107)},29065,42166,3492,24755,16779,86895,60310,61728,9149,57095,85463,87513,15925,22806,29616,77280,82815,e=>{"use strict";var t=e.i(43476),a=e.i(76818),i=e.i(46470),n=e.i(21291),r=e.i(55104),l=e.i(11383),s=e.i(2586),o=e.i(80279),u=e.i(71645),d=e.i(64891),c=e.i(51871);function f(e){let t=(0,c.useStoreVersion)();return(0,u.useEffect)(()=>{e&&d.v1StatusStore.ensure(e)},[e,t]),(e?d.v1StatusStore.get(e):null)??null}function h(e){return(0,c.useLoadStatus)(d.v1StatusStore,e)}var p=e.i(37385),g=e.i(80635),m=e.i(78213),x=e.i(9694),b=e.i(13065),v=e.i(79231),y=e.i(28679);e.s(["default",0,function({context:e,title:u}){let d="flight-leg"===e.kind?e.data?.flight:null,c="flight-leg"===e.kind?e.date:null,w=(0,n.useFlightRisk)(d??null,d?.history??null),j=(0,i.useFlightInboundMemory)(d??null,c),N=d?.origin.icao,k=d?.destination.icao,$=f(N),M=f(k),A=(0,o.useAirportImpact)(N),C=(0,o.useAirportImpact)(k),S=(0,p.useAirportDeicing)(N),I=(0,r.useDataAt)(),D=(0,s.useNow)(2e4),E=[(0,g.useAirportWeatherStatus)(N),(0,g.useAirportWeatherStatus)(k),(0,o.useAirportImpactStatus)(N),(0,o.useAirportImpactStatus)(k),h(N),h(k),(0,p.useAirportDeicingStatus)(N)].find(e=>e?.failed),L=(0,t.jsx)(b.default,{status:E,what:"airport conditions"});if((0,v.flightPending)(e))return(0,t.jsx)(v.default,{title:u,shape:"rows"});if(!d)return null;let O=(0,m.delayRiskModel)({flight:d,risk:w,originStatus:$,destinationStatus:M,originImpact:A??null,destinationImpact:C??null,originDeicing:S??null,rememberedInbound:j?(0,a.describeInboundMemory)(j):null,now:D});if(!O)return E?(0,t.jsxs)(x.default,{title:u,children:[(0,t.jsx)("p",{className:"text-body-sm text-fg-tertiary",children:"Delay risk may be understated."}),L]}):null;let T=null!==I&&null!==D?(0,l.updatedLabel)(new Date(I),D):void 0;return(0,t.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,t.jsx)(y.default,{title:u,updated:T,...O}),L]})}],29065);var w=e.i(64720),j=e.i(84380);function N({strip:e,title:a,context:i,endpoint:n}){let r=(0,g.useAirportWeatherStatus)((0,j.flightEnd)(i,n)?.code);return"none"===e.state?null:(0,t.jsxs)(x.FlightCardSection,{className:"gap-stack first:border-t-0 first:pt-0",children:["ready"===e.state?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.StripHeader,{title:a,icon:e.icon,place:e.place}),(0,t.jsx)(w.HourlyStripBody,{title:a,verdict:e.verdict,category:e.category,hours:e.hours,markerIndex:e.markerIndex,markerLabel:e.markerLabel},e.key)]}):(0,t.jsxs)("p",{className:"text-body-sm text-fg-tertiary",children:[a,":"," ","loading"===e.state?"loading forecast…":"forecast unavailable."]}),(0,t.jsx)(b.default,{status:r,what:"the forecast"})]})}e.s(["default",0,function({context:e}){let a=(0,j.useEndpointStrip)(e,"origin"),i=(0,j.useEndpointStrip)(e,"destination");return"none"===a.state&&"none"===i.state?null:(0,t.jsxs)(x.default,{children:[(0,t.jsx)(N,{strip:a,title:"Departure weather",context:e,endpoint:"origin"}),(0,t.jsx)(N,{strip:i,title:"Arrival weather",context:e,endpoint:"destination"})]})}],42166);var k=e.i(75019);function $(e,t,a){let i=(0,g.useAirportWeather)(e?.icao);return(0,k.endpointConditionsV1)(e,i,t,a)}var M=e.i(55529);let A=["landed","arrived","cancelled","diverted"];function C(e){let t=e?.flight;return!!t&&"live"===t.resolution&&!t.times.gateOut.actual&&!e.position&&!t.cancelled&&!t.diverted&&!A.includes(t.status)}function S(e,t=Date.now()){let a=Date.parse(e.flight?.times.gateOut.best??"");return!Number.isNaN(a)&&!(t-a>M.UNDEPARTED_GRACE_MS)&&a-t"number"==typeof e&&Number.isFinite(e)&&e>0;e.s(["CLIMB_DESCENT_HOURS",0,.42,"MIN_FILED_SEC",0,3600,"NM_PER_MILE",0,.869,"impliedWind",0,function(e){let{airspeedKt:t,routeMiles:a,eteSec:i}=e;if(!P(t)||!P(a)||!P(i)||i150)return null;let s=Math.round((n/t-n/r)*60);return{airspeedKt:Math.round(t),groundSpeedKt:Math.round(r),windKt:Math.round(l),minutesSaved:s}}],16779);let U=e=>"number"==typeof e&&Number.isFinite(e)&&e>0,W=(e,t)=>`${e.toFixed(3)},${t.toFixed(3)}`;function B(e){let t=new Map;for(let a of e?.features??[]){let[e,i]=a.geometry?.coordinates??[],{variable:n,value:r}=a.properties??{};if("number"!=typeof i||"number"!=typeof e||"number"!=typeof r||!(150>=Math.abs(r))||"string"!=typeof n)continue;let l=W(i,e),s=t.get(l)??{};n.startsWith("ucomponent")?s.u=r:n.startsWith("vcomponent")&&(s.v=r),t.set(l,s)}return t}let K="https://api.weather.com/v2/tiler",H="84a572b507ab4d74a572b507abed744b",G="packed_FLWind:packed",Y=null,V=new Map,Z=new Set;function q(e,t){Z.has(e)||(Z.add(e),console.warn(`[winds] ${e}`,t??""))}async function Q(e){let t=await fetch(e,{signal:AbortSignal.timeout(8e3)});if(!t.ok)throw Error(`HTTP ${t.status}`);return t.json()}async function J(){let e=function(e){let t=e?.layers?.packed_FLWind?.packed?.dimensions,a=null;for(let e of t??[]){let t=Number(e.rt?.[0]),i=(e.t??[]).map(Number).filter(Number.isFinite).sort((e,t)=>e-t);Number.isFinite(t)&&i.length&&(!a||t>a.rt)&&(a={rt:t,times:i})}return a}(await Q(`${K}/info?products=${G}&apiKey=${H}`));return e||q("the SUN answer has no packed_FLWind model run"),e}async function X(e){let{bands:t}=e,a=function(e,t,a,i){if(!Number.isFinite(a)||!(i>=3600))return[];let n=[e.lon,e.lat],r=[t.lon,t.lat],l=(0,z.greatCircleDistanceMeters)(n,r),s=(0,z.bearing)(n,r),o=i/3600,u=.21/o,d=Math.min(12,Math.max(3,Math.round((o-.42)*2)+1));return Array.from({length:d},(e,t)=>{let o=u+(1-2*u)*t/(d-1),[c,f]=(0,z.destinationPoint)(n,s,o*l);return{lat:f,lon:c,at:a+o*i*1e3,track:(0,z.bearing)([c,f],r)}})}(e.from,e.to,e.offMs,e.eteSec),i=a.length?await function(){if(!Y||Date.now()-Y.at>9e5){let e={at:Date.now(),read:J().catch(t=>(Y===e&&(Y=null),q("the model run read failed",t),null))};Y=e}return Y.read}():null;if(!i)return null;let n=function(e,t){let a=new Map;for(let i of e){let e=null;for(let a of t)(null==e||Math.abs(a-i.at)54e5||a.set(e,[...a.get(e)??[],i])}return[...a].map(([e,t])=>({t:e,samples:t}))}(a,i.times),r=await Promise.all(n.map(async({t:e,samples:a})=>{var n;let r,l=a.map(e=>e.lat.toFixed(3)).join(","),s=a.map(e=>e.lon.toFixed(3)).join(","),o=await (n=`${K}/point?rt=${i.rt}&t=${e}&lat=${l}&lon=${s}&products=${t.u},${t.v}&format=geojson&method=nearest&apiKey=${H}`,!(r=V.get(n))&&(r=Q(n).then(B).catch(e=>(V.delete(n),q("a wind point read failed",e),new Map)),V.set(n,r)),r);return a.flatMap(e=>{var t,a;let i,n=o.get(W(e.lat,e.lon));return n?.u!=null&&null!=n.v?[(t=n.u,a=n.v,(t*Math.sin(i=e.track*Math.PI/180)+a*Math.cos(i))*1.943844)]:[]})}));return n.length&&!r.flat().length&&q("no wind values in the SUN point answers",t.u),function(e,t,a){let{airspeedKt:i,routeMiles:n}=e;if(!U(i)||!U(n)||!t.length||2*t.lengthe+t,0)/t.length,l=i+r;if(Math.abs(r)>250||l<.5 null s=".869*n;return{airspeedKt:Math.round(i),groundSpeedKt:Math.round(l),windKt:Math.round(r),minutesSaved:Math.round((s/i-s/l)*60)}}(e,r.flat(),a.length)}function" ee t="e?function(e){let" i='function(e){if("number"!=typeof' e>500)return null;let t=10*Math.round(e/10),a=8270+t/10-1,i=`FL${String(t).padStart(3,"0")}`;return{u:`${a}:ucomponentofwindAt${i}`,v:`${a}:vcomponentofwindAt${i}`}}(null!=t.cruiseAltitudeFt?t.cruiseAltitudeFt/100:null);if(!i||!e.routeDistanceNm)return null;let{origin:n,destination:r}=e;return{from:{lat:n.position.lat,lon:n.position.lon},to:{lat:r.position.lat,lon:r.position.lon},offMs:6e5*Math.round(a/6e5),eteSec:60*t.timeEnRouteMinutes,bands:i,airspeedKt:t.airspeedKt,routeMiles:e.routeDistanceNm/.869}}(e):null,a=t?JSON.stringify(t):null,i=t?JSON.stringify({...t,offMs:null}):null,[n,r]=(0,u.useState)(null);return((0,u.useEffect)(()=>{if(!a||!i)return;let e=!1,t=t=>{e||(e=!0,clearTimeout(n),r(e=>({key:a,flight:i,wind:t??(e?.flight===i?e.wind:null)})))},n=setTimeout(()=>t(null),1500);return X(JSON.parse(a)).catch(e=>(q("the forecast read failed",e),null)).then(t),()=>{e=!0,clearTimeout(n)}},[a,i]),a)?n&&(n.key===a||n.flight===i)?n.wind:void 0:null}e.s(["isFlWindRead",0,function(e){return`${e.origin}${e.pathname}`==`${K}/info`?e.searchParams.get("products")===G:`${e.origin}${e.pathname}`==`${K}/point`&&(e.searchParams.get("products")??"").includes("componentofwindAt")},"useForecastWind",0,ee],86895);var et=e.i(30250);e.s(["default",0,function({context:e,title:a}){let i=(0,E.useUnits)(),n="flight-leg"===e.kind?e.data?.flight:null,r=ee(n??null),l=n?.windsAloft;return(0,v.flightPending)(e)||l&&void 0===r?(0,t.jsx)(v.default,{title:a,shape:"meter"}):l&&void 0!==r?(0,t.jsx)(et.default,{summary:(0,_.windsAloftView)(l,i,r)}):null}],60310),e.i(8199);var ea=e.i(50798),ei=e.i(81614),en=e.i(66528);e.s(["default",0,function({context:e,title:a}){let i=(0,s.useNow)(6e4),n="flight-leg"===e.kind?e.data?.flight:null,r=n?.origin.icao,l=(0,g.useAirportWeather)(r),u=(0,o.useAirportImpact)(r),d=(0,g.useAirportWeatherStatus)(r),c=(0,o.useAirportImpactStatus)(r);if((0,v.flightPending)(e))return(0,t.jsx)(v.default,{title:a,shape:"bars"});if(!n||null==i)return null;let f=(0,M.phaseAt)(n,i);if("preflight"!==f&&"at-airport"!==f||n.times.gateOut.actual)return null;if(void 0===l||void 0===u)return(0,t.jsx)(v.default,{title:a,shape:"bars"});let h=n.origin.iata??n.origin.icao,p=n.origin.timezone,m=n.times.gateOut.best,y=(0,M.formatClock)(m,p)??void 0,w=(u?(0,ea.impactWindowV1)(u,(0,ei.hourIndexAt)(u,m),h,p,y):null)??(l?(0,ea.departureWindowV1)(l.hourly,(0,ei.hourIndexAt)(l.hourly,m),h,p,y):null),j=[d,c].find(e=>e?.failed);return w?(0,t.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,t.jsx)(en.default,{code:h,window:w}),(0,t.jsx)(b.default,{status:j,what:"the departure forecast"})]}):j?(0,t.jsx)(x.default,{title:"Departure Window",children:(0,t.jsx)(b.default,{status:j,what:"the departure forecast"})}):null}],61728);var er=e.i(35120),el=e.i(43975),es=e.i(9875);let eo={fails:0,lastOkAt:null};function eu(e,t,a){return t?{fails:0,lastOkAt:a}:{fails:e.fails+1,lastOkAt:e.lastOkAt}}function ed(e,t){return e.fails"minor"===e||"moderate"===e||"severe"===e;function ex(e){return e.hazards.length?e.hazards.slice(0,2).map(e=>eh.HAZARD_KIND_PRESENTATION[e].label).join(" · "):"Weather impact"}let eb=(e,t)=>(0,M.formatClock)(e,t)??"—";var ev=e.i(30086),ey=e.i(4534);let ew={0:"bg-sev-none",1:"bg-sev-light",2:"bg-sev-moderate",3:"bg-sev-severe"},ej={0:"bg-sev-none/18",1:"bg-sev-light/18",2:"bg-sev-moderate/18",3:"bg-sev-severe/18"},eN={0:"text-fg-sev-none",1:"text-fg-sev-light",2:"text-fg-sev-moderate",3:"text-fg-sev-severe"};function ek({subtitle:e,verdict:a,rows:i}){let[n,r]=(0,u.useState)(!1),l=(0,u.useId)();return(0,t.jsxs)("section",{"data-testid":"plane-day",className:"flex flex-col border-t border-subtle px-card pt-stack pb-card",children:[(0,t.jsxs)("button",{type:"button","data-testid":"plane-day-toggle","aria-expanded":n,"aria-controls":n?l:void 0,onClick:()=>r(e=>!e),className:"flex w-full items-center gap-2.5 text-left",children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-px",children:[(0,t.jsx)("span",{className:"text-body-strong",children:"Your plane’s day"}),(0,t.jsx)("span",{className:"truncate text-body-sm text-fg-secondary",children:e})]}),(0,t.jsxs)("span",{className:(0,L.cn)("inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-1 text-chip whitespace-nowrap",ej[a.level],eN[a.level]),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,L.cn)("size-2 rounded-full",ew[a.level])}),(0,t.jsx)("span",{"data-testid":"plane-day-verdict",children:a.pill})]}),(0,t.jsx)(ev.ChevronDown,{className:(0,L.cn)("size-4 shrink-0 text-fg-tertiary transition-transform duration-base ease-arrive",n&&"rotate-180"),"aria-hidden":!0})]}),(0,t.jsx)(ey.Reveal,{open:n,children:(0,t.jsx)(ey.FadeIn,{className:"flex flex-col gap-2.5 pt-2.5",children:(0,t.jsxs)("div",{id:l,className:"flex flex-col gap-2.5",children:[(0,t.jsx)("p",{className:(0,L.cn)("text-headline",eN[a.level]),"data-testid":"plane-day-headline",children:a.headline}),(0,t.jsxs)("ul",{className:"relative flex flex-col",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute top-3.5 bottom-3.5 left-1.25 border-l-2 border-subtle"}),i.map(e=>(0,t.jsxs)("li",{"data-testid":"plane-day-leg",className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 py-1.75",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,L.cn)("relative size-3 shrink-0 rounded-full ring-2 ring-surface",e.own?"bg-info":e.arrived?"bg-fg-tertiary":"bg-plane")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-px",children:[(0,t.jsx)("span",{"data-testid":"plane-day-leg-label",className:(0,L.cn)("text-body-strong",e.own?"text-fg-info":e.arrived&&"text-fg-secondary"),children:e.label}),(0,t.jsx)("span",{"data-testid":"plane-day-leg-times",className:"text-body-sm text-fg-secondary tabular",children:e.times})]}),(0,t.jsx)("span",{"data-testid":"plane-day-leg-status",className:(0,L.cn)("shrink-0 text-label font-semibold whitespace-nowrap",eN[e.status.level]),children:e.status.text})]}),e.turn&&(0,t.jsxs)("div",{className:(0,L.cn)("ml-6 flex flex-wrap items-center gap-2 pt-0.5 pb-1",e.turn.done&&"opacity-70"),children:[(0,t.jsx)("span",{"data-testid":"plane-day-turn",className:"text-body-sm text-fg-tertiary tabular",children:e.turn.text}),!e.turn.done&&e.turn.weather&&(0,t.jsx)("span",{className:(0,L.cn)("rounded-full px-2 py-0.5 text-label font-semibold whitespace-nowrap",ej[e.turn.weather.level],eN[e.turn.weather.level]),children:e.turn.weather.text})]})]},e.id))]})]})})})]})}function e$({flight:e,aircraft:a,status:i}){let n=function({flight:e,aircraft:t}){let a=t?.earlierFlights,i=t?.knockOn;if(!a?.length||!i||!t?.verdict)return null;let n=function(e,t){let a=eg[e.level],i=eh.PLANE_DAY_VERDICT_PRESENTATION[e.kind].label,n=e.turn;switch(e.kind){case"running-late":return{level:a,pill:i,headline:`Your plane could leave about ${(0,ep.formatMinutes)(t)} late`};case"tight-turn":if(n?.bufferMinutes!=null){let e;return{level:a,pill:i,headline:`Tight turn at ${(e=n.airport).iata??e.icao}: ${n.bufferMinutes{var a;let i,n,r,l,s;return{id:e.id??`earlier-${t}`,own:!1,arrived:null!=e.times.gateIn.actual,label:`${e.ident.iata??e.ident.icao} ${(i=e.origin).iata??i.icao} → ${(n=e.destination).iata??n.icao}`,times:`${eb(e.times.gateOut.best,e.origin.timezone)} – ${eb(e.times.gateIn.best,e.destination.timezone)}`,status:function(e){let{delay:t}=e,a=em(t.arrivalLevel)&&null!=t.arrivalMinutes;return"cancelled"===e.status?{text:"Cancelled",level:3}:"diverted"===e.status?{text:"Diverted",level:3}:null!=e.times.gateIn.actual?a?{text:`Landed ${(0,ep.formatMinutes)(t.arrivalMinutes)} late`,level:2}:{text:"Landed",level:0}:"actual"===e.times.gateOut.bestSource?a?{text:`In the air \xb7 ${(0,ep.formatMinutes)(t.arrivalMinutes)} late`,level:2}:{text:"In the air",level:0}:em(t.departureLevel)&&null!=t.departureMinutes?{text:`Delayed ${(0,ep.formatMinutes)(t.departureMinutes)}`,level:2}:{text:"On time",level:0}}(e),turn:{text:(l=(r=(a=e.turn).airport).iata??r.icao,null==(s=a.bufferMinutes)?`Turns at ${l}`:se.A(20358),{loadableGenerated:{modules:[81851]},ssr:!1}),eA={success:{text:"text-fg-sev-none",fill:"to-sev-none"},warning:{text:"text-fg-sev-moderate",fill:"to-sev-moderate"},danger:{text:"text-fg-sev-severe",fill:"to-sev-severe"},neutral:{text:"text-fg-secondary",fill:"to-fg-tertiary"}},eC=340/230,eS={top:112,bottom:44,left:36,right:36};function eI({photo:e,registration:a,alt:i}){return(0,t.jsxs)("div",{className:"absolute right-3 -bottom-5 flex h-17.5 w-26 animate-photo-pop items-center justify-center overflow-hidden rounded-control bg-sky-night-mid ring-2 ring-surface drop-shadow-plane",children:[e?(0,t.jsx)("img",{src:e.src,alt:i,className:"absolute inset-0 size-full object-cover"}):(0,t.jsx)(ev.PlaneGlyph,{size:30}),a&&(0,t.jsx)("span",{className:"absolute bottom-1.25 left-1.5 rounded-md bg-overlay px-1.5 py-px text-badge tracking-wide text-fg-on-solid tabular",children:a})]})}function eD({turn:e,tone:a}){let i=[{label:e.landsLabel,time:e.lands,dot:"bg-plane"},{label:"You depart",time:e.departs,dot:"bg-fg"}];return(0,t.jsxs)("div",{className:"relative flex justify-between pt-3.5",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,L.cn)("absolute inset-x-1.25 top-1 h-0.75 animate-line-wipe rounded-full bg-linear-to-r from-plane",eA[a].fill)}),i.map((e,a)=>(0,t.jsxs)(ey.Rise,{i:a,className:(0,L.cn)("relative flex flex-col gap-px",1===a&&"items-end text-right"),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,L.cn)("absolute -top-3.5 size-2.5 rounded-full ring-3 ring-surface",e.dot)}),(0,t.jsx)("span",{className:"text-card-title tabular",children:e.time}),(0,t.jsx)("span",{className:"text-caption text-fg-tertiary",children:e.label})]},e.label))]})}function eE({title:e,subtitle:a,aircraftName:i,registration:n,photo:r,map:l,verdict:s,turn:o,note:u,children:d}){return(0,t.jsxs)(x.default,{className:"gap-0 overflow-hidden p-0",children:[(0,t.jsxs)("div",{className:"relative z-10 bg-surface-muted",style:{aspectRatio:eC},children:[(0,t.jsxs)("header",{className:"pointer-events-none absolute inset-x-0 top-0 z-10 flex items-start justify-between gap-inline px-card pt-card",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-stack-2xs",children:[(0,t.jsx)("h2",{className:"text-card-title",children:e}),(0,t.jsx)("p",{className:"text-body-sm text-fg-secondary tabular",children:a}),l.where&&(0,t.jsx)("p",{"data-testid":"wheres-my-plane-where",className:"text-caption text-fg-secondary tabular",children:l.where})]}),l.updated&&(0,t.jsx)("p",{className:"shrink-0 text-caption text-fg-tertiary tabular",children:l.updated})]}),(0,t.jsx)(eM,{stops:l.stops,plane:l.plane,padding:eS,className:"absolute inset-0"}),(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-28 bg-linear-to-b from-surface via-surface/80 via-45% to-transparent"}),(0,t.jsx)(eI,{photo:r,registration:n,alt:`${i??"Aircraft"} ${n??""}`.trim()})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 px-card pt-3 pb-card",children:[(0,t.jsxs)("p",{className:"min-h-4.25 pr-28 text-body-sm text-fg-secondary",children:[i,r&&(0,t.jsxs)(t.Fragment,{children:[i&&" · ",(0,t.jsxs)("a",{href:r.credit.url,target:"_blank",rel:"noopener noreferrer",className:"text-fg-tertiary underline-offset-2 hover:underline",children:["© ",r.credit.name," · Planespotters.net"]})]})]}),o&&s&&(0,t.jsx)(eD,{turn:o,tone:s.tone}),s&&(0,t.jsx)("p",{"data-testid":"wheres-my-plane-verdict",className:(0,L.cn)("text-body-strong",eA[s.tone].text),children:s.message}),u]}),d]})}e.s(["default",0,function({context:e,title:a}){var i;let n,r=(0,s.useNow)(3e4),o="flight-leg"===e.kind?e:null,d=(0,D.useFlightResource)(o&&o.data?.flight===void 0?(0,D.selectionRef)(o):null).data,c=o?.data?.flight??d??null,f=!!c&&null!=r&&(0,ec.wheresMyPlaneShows)(c,r),{inbound:h,status:p}=function(e,t,a){let i=e??null,[n,r]=(0,u.useState)(null),[l,s]=(0,u.useState)(eo),[o,d]=(0,u.useState)(()=>Date.now()),c=n&&n.key===i?n.info:t??null,f=!!t,h=!!c&&"airborne"!==(0,ec.inboundState)(c)&&"scheduled"!==(0,ec.inboundState)(c);return(0,u.useEffect)(()=>{s(eo),d(Date.now())},[i]),(0,u.useEffect)(()=>{if(!i||!f||!a||h)return;let e=!0,t=()=>{document.hidden||(0,D.loadFlight)(i,{fresh:!0}).then(({data:t,failed:a})=>{if(!e)return;let n=!a&&!t?.unavailable.includes("inbound");s(e=>eu(e,n,Date.now())),t?.inbound&&r({key:i,info:t.inbound})}).catch(()=>{e&&s(e=>eu(e,!1,Date.now()))})},n=setInterval(t,6e4),l=()=>{document.hidden||t()};return document.addEventListener("visibilitychange",l),()=>{e=!1,clearInterval(n),document.removeEventListener("visibilitychange",l)}},[i,f,a,h]),{inbound:c,status:ed(l,o)}}(c?.id,c?.inbound,f),{aircraft:g,status:m}=function(e,t){let[a,i]=(0,u.useState)(eo),[n,r]=(0,u.useState)(()=>Date.now()),[l,s]=(0,u.useState)(null);return(0,u.useEffect)(()=>{i(eo),r(Date.now())},[e]),(0,u.useEffect)(()=>{if(!e||!t)return;let a=!0,n=()=>{document.hidden||fetch((0,es.withBase)(`/api/v1/flights/${encodeURIComponent(e)}/aircraft`)).then(e=>{if(!e.ok)throw Error(`status ${e.status}`);return e.json()}).then(t=>{if(!a)return;let n=(0,el.normalizeFlightAircraft)(t),r=!n.unavailable.includes("earlierFlights");i(e=>eu(e,r,Date.now())),s(t=>({id:e,aircraft:function(e,t){if(!e)return t;let a={...t};return t.unavailable.includes("photo")&&(a.photo=e.photo),t.unavailable.includes("whereabouts")&&(a.whereabouts=e.whereabouts),t.unavailable.includes("earlierFlights")&&(a.earlierFlights=e.earlierFlights,a.knockOn=e.knockOn,a.verdict=e.verdict),a}(t?.id===e?t.aircraft:null,n)}))}).catch(()=>{a&&i(e=>eu(e,!1,Date.now()))})};n();let r=setInterval(n,6e4),l=()=>{document.hidden||n()};return document.addEventListener("visibilitychange",l),()=>{a=!1,clearInterval(r),document.removeEventListener("visibilitychange",l)}},[e,t]),{aircraft:l&&l.id===e?l.aircraft:null,status:ed(a,n)}}(c?.id,f),x=(0,ef.usePremium)(),y="locked"===(0,er.forecastLockFor)({status:x?x.premium:null});if((0,v.flightPending)(e))return(0,t.jsx)(v.default,{title:a,shape:"picture"});if(!c||null==r)return null;let w=(0,ec.wheresMyPlaneView)({flight:c,aircraft:g,inbound:h,now:r});if(!w)return null;if(!h)return(0,t.jsx)(eE,{title:a,...w,map:{...(0,ec.ourAirportMap)(c.origin),updated:null}});let j=(0,ec.wheresMyPlaneMap)(c.origin,h,g?.whereabouts??null,y?null:g?.earlierFlights??null),N={...j,updated:(i=j.reportedAt,Number.isNaN(n=i?Date.parse(i):NaN)?null:(0,l.updatedLabel)(new Date(n),r))};return(0,t.jsx)(eE,{title:a,...w,map:N,note:(0,t.jsx)(b.default,{status:p,what:"the plane's position"}),children:!y&&(0,t.jsx)(e$,{flight:c,aircraft:g,status:m})})}],9149);var eL=e.i(65766),eO=e.i(30215);function eT({context:e,title:a,direction:i}){let n="flight-leg"===e.kind?e.data?.flight:null,r="departures"===i,l=r?n?.origin:n?.destination,o=(0,s.useNow)(6e4),u=n&&null!=o?(0,M.phaseAt)(n,o):null,d=!!n&&null!=o&&(!r||("preflight"===u||"at-airport"===u)&&!n.times.gateOut.actual),c=(0,p.useAirportCapacity)(d?l?.icao??"":""),f=(0,p.useAirportCapacityStatus)(d?l?.icao??"":"");if(!d||!n||!l||null==o)return null;let h=`${r?"departure":"arrival"} capacity`,g=l.iata??l.icao,m=l.timezone,v=r?n.times.gateOut.best:n.times.landing.best??n.times.gateIn.best,y=Date.parse((r?n.times.takeoff.best??v:v)??""),w=c&&Number.isFinite(y)?(0,eL.hourlyCapacityOutlook)(c,o,m,{direction:i,you:{atMs:y,code:g,time:(0,M.formatClock)(v,m)??void 0}}):null;return w?(0,t.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,t.jsx)(eO.default,{title:a,code:g,direction:i,outlook:w}),(0,t.jsx)(b.default,{status:f,what:h})]}):f?.failed?(0,t.jsx)(x.default,{title:a,children:(0,t.jsx)(b.default,{status:f,what:h})}):null}e.s(["FlightArrivalCapacityCard",0,function(e){return(0,t.jsx)(eT,{...e,direction:"arrivals"})},"FlightDepartureCapacityCard",0,function(e){return(0,t.jsx)(eT,{...e,direction:"departures"})}],57095);let eR=["moderate","severe"],eF=e=>e.some(e=>eR.includes(e.level)),e_=e=>e.flatMap(e=>"none"===e.level?[]:e.reasons.map(e=>e.replace(/ at [A-Z0-9]{3,4}$/,"")));var ez=e.i(1673);let eP={none:0,light:1,moderate:2,severe:3},eU={none:"8%",light:"35%",moderate:"62%",severe:"89%"},eW={success:"text-fg-success",warning:"text-fg-warning",danger:"text-fg-danger"};function eB({m:e}){return(0,t.jsx)(x.default,{title:"Weather impact today",children:(0,t.jsxs)(x.FlightCardSection,{className:"gap-stack",children:[(0,t.jsx)("p",{"data-testid":"weather-impact-headline",className:(0,L.cn)("text-headline",eW[e.tone]),children:e.headline}),e.rows.map(a=>(0,t.jsxs)("div",{"data-testid":"weather-impact-row",className:"flex flex-col gap-stack-sm",children:[(0,t.jsxs)("p",{className:"text-body-sm text-fg-secondary",children:[(0,t.jsx)("span",{className:"text-body-strong text-fg",children:a.code})," ",a.summary]}),(0,t.jsx)("ol",{className:"flex justify-between gap-0.5","aria-label":`${a.code} weather impact by hour`,children:a.levels.map((a,i)=>(0,t.jsx)("li",{"aria-label":`${e.hours[i].time}: ${null==a?"no forecast":"none"===a?"no impact":`${a} impact`}`,className:"flex min-w-0 flex-1 flex-col items-center",children:null!=a&&(0,t.jsx)(ez.OutlookBar,{level:eP[a],height:eU[a]})},e.hours[i].key))})]},a.code)),(0,t.jsx)("ol",{className:"flex justify-between gap-0.5","aria-hidden":!0,children:e.hours.map(e=>(0,t.jsxs)("li",{className:"flex min-w-0 flex-1 flex-col items-center gap-stack-2xs",children:[(0,t.jsx)("span",{className:(0,L.cn)("text-caption tabular",e.now?"font-semibold text-fg":"text-fg-secondary"),children:e.label}),(0,t.jsx)("span",{"data-testid":e.now?"weather-impact-now":void 0,className:(0,L.cn)("text-caption font-semibold text-fg",!e.now&&"invisible"),children:"Now"})]},e.key))}),(0,t.jsxs)("p",{className:"border-t border-subtle pt-stack text-body-sm text-fg-secondary",children:[e.footnote,e.zoneNote?` ${e.zoneNote}`:""]})]})})}let eK="the weather impact forecast";e.s(["default",0,function({context:e}){let a="flight-leg"===e.kind?e.data?.flight:null,i=a?.origin.icao,n=a?.destination.icao,r=(0,o.useAirportImpact)(i),l=(0,o.useAirportImpact)(n),u=(0,o.useAirportImpactStatus)(i),d=(0,o.useAirportImpactStatus)(n),c=(0,s.useNow)(6e4);if(!a||null==c)return null;let f=u?.failed?u:d,h=r&&l?function(e,t,a){let i=new Date(a).toISOString(),n=e=>{let t=(0,ei.hourIndexAt)(e.series,i);return(0,ea.impactWindowV1)(e.series,t,e.code,e.timezone,void 0,!0)},r=n(e),l=n(t);if(!r||!l)return null;let s=r.bars.map(e=>({key:e.key,label:e.label,time:e.time,now:e.flight})),o=e=>r.bars.map(t=>{let a,i;return a=e.bars,i=Date.parse(t.key),a.find(e=>{let t=Date.parse(e.key);return t>=i&&te.flight),f=e=>e.filter(e=>null!=e),h=eF(f(u.slice(c))),p=eF(f(d.slice(c))),g=h&&p?"Weather impact at both airports":h?`Weather impact at ${e.code}`:p?`Weather impact at ${t.code}`:"No weather trouble expected at either airport",m=[r,l].some(e=>"danger"===e.tone)?"danger":h||p?"warning":"success",x=[...new Set([...e_(f(u)),...e_(f(d))])];return{headline:g,tone:m,hours:s,rows:[{code:e.code,w:r,bars:u},{code:t.code,w:l,bars:d}].map(({code:e,w:t,bars:a})=>({code:e,summary:`${t.headline}. ${t.subtitle}.`,levels:a.map(e=>e?.level??null)})),footnote:x.length?`Hazards: ${x.join(", ")}.`:"No weather hazards in these hours.",zoneNote:e.timezone===t.timezone?null:`Hours are in ${e.code} time.`}}({code:a.origin.iata??a.origin.icao,timezone:a.origin.timezone,series:r},{code:a.destination.iata??a.destination.icao,timezone:a.destination.timezone,series:l},c):null;return h?(0,t.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,t.jsx)(eB,{m:h}),(0,t.jsx)(b.default,{status:f,what:eK})]}):f?.failed?(0,t.jsx)(x.default,{title:"Weather impact today",children:(0,t.jsx)(b.default,{status:f,what:eK})}):null}],85463);let eH=new Set(["DL","AA","UA","AS","WN","B6","F9","9E","MQ","OO"]),eG={DL:{phone:"+18002211212",manage:"https://www.delta.com/mytrips/"},AA:{phone:"+18004337300",manage:"https://www.aa.com/reservation/view/find-your-trip"},UA:{phone:"+18008648331",manage:"https://www.united.com/en/us/manageres/mytrips"},AS:{phone:"+18002527522",manage:"https://www.alaskaair.com/booking/reservation-lookup"},WN:{phone:"+18004359792",manage:"https://www.southwest.com/air/manage-reservation/"},B6:{phone:"+18005385438",manage:"https://www.jetblue.com/manage-trips"}},eY={MQ:"AA","9E":"DL"},eV=e=>eG[eY[e]??e]??null;var eZ=e.i(7146),eq=e.i(84275),eQ=e.i(46194),eJ=e.i(42132);let eX=new Set(["enroute","landed"]),e0=e=>{if(!e)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null},e1=e=>Date.parse(e.scheduled??e.best??""),e2=e=>(0,M.formatCountdown)(e),e5=e=>`${Math.round(e)} min`;var e4=e.i(55294),e6=e.i(53297),e3=e.i(96095),e8=e.i(52518),e7=e.i(94966);let e9={success:{band:"bg-success-subtle",text:"text-fg-success"},warning:{band:"bg-warning-subtle",text:"text-fg-warning"},"sev-moderate":{band:"bg-sev-moderate-subtle",text:"text-fg-sev-moderate"},danger:{band:"bg-danger-subtle",text:"text-fg-danger"}},te={check:ev.CircleCheck,warning:ev.TriangleAlert,weather:ev.CloudLightning,alert:ev.CircleAlert,missed:ev.X};function tt({m:e}){let a=e9[e.tone],i=te[e.icon];return(0,t.jsxs)(x.default,{className:"gap-2.5",children:[(0,t.jsxs)("div",{"data-testid":"connection-verdict","data-tone":e.tone,className:(0,L.cn)("flex items-center justify-between gap-inline-sm rounded-tile px-4 py-3",a.band,a.text),children:[(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-inline-sm",children:[(0,t.jsx)(i,{size:20,className:"shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"text-body-strong whitespace-nowrap",children:e.verdict})]}),(0,t.jsx)("span",{className:"shrink-0 text-body-sm font-semibold whitespace-nowrap tabular",children:e.spare})]}),(0,t.jsxs)("div",{"data-testid":"your-connection-card",className:"flex flex-col gap-2.5",children:[(0,t.jsx)("p",{className:"px-1 text-body-sm text-fg-secondary",children:e.gateLine}),(0,t.jsxs)("div",{className:(0,L.cn)("flex flex-col gap-3.5 rounded-tile bg-surface-muted p-4",e.outlined&&"border border-sev-moderate"),children:[(0,t.jsxs)("div",{className:"flex items-end justify-between gap-inline",children:[e.countdown&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:e7.HEADING,children:e.countdown.label}),(0,t.jsx)("span",{"data-testid":"connection-countdown",className:"text-hero tabular",children:e.countdown.value}),(0,t.jsx)("span",{className:"text-body-sm text-fg-secondary",children:e.countdown.note})]}),(0,t.jsxs)("div",{"data-testid":"connection-gate",className:"ml-auto flex shrink-0 flex-col items-end gap-1",children:[(0,t.jsx)("span",{className:e7.HEADING,children:"Gate"}),(0,t.jsx)(e7.GateBadge,{icon:ev.ArrowUpRight,gate:e.gate}),e.gateNote&&(0,t.jsx)("span",{className:"text-row-note text-fg-secondary",children:e.gateNote})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-x-inline gap-y-2 border-t border-inset pt-3.5",children:[(0,t.jsx)("span",{className:"text-body-sm font-semibold whitespace-nowrap text-fg-secondary",children:e.flight.title}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-inline-sm text-body-sm tabular",children:[(0,t.jsx)("span",{className:"text-fg-tertiary",children:"Departs"}),(0,t.jsx)("span",{className:"font-semibold text-fg",children:e.flight.departs??"—"}),e.flight.scheduled&&(0,t.jsx)("span",{className:"text-fg-tertiary line-through",children:e.flight.scheduled}),(0,t.jsxs)("span",{"data-testid":"connection-status",className:"text-fg-secondary",children:["· ",e.flight.chip.label]})]})]})]}),(e.change||e.notes.length>0||e.manage)&&(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 px-1 pt-1.5 text-body-sm text-fg-secondary",children:[e.change&&(0,t.jsxs)("p",{className:"tabular",children:[e.change.label," ",(0,t.jsxs)("span",{className:"text-fg-tertiary",children:[e.change.from," →"]})," ",(0,t.jsx)("span",{className:"font-bold text-fg",children:e.change.to})]}),e.notes.map(e=>(0,t.jsx)("p",{children:e},e)),e.manage&&(0,t.jsxs)("a",{href:e.manage.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-fg underline",children:["Manage your booking on ",e.manage.domain,(0,t.jsx)(ev.ExternalLink,{size:14,"aria-hidden":!0})]})]})]})]})}e.s(["default",0,function({context:e}){let a=(0,s.useNow)(3e4),i="flight-leg"===e.kind?e.data:void 0,r=i?.flight??null,l=r?function(e,t){let a=e1(e.times.gateIn);if(!Number.isFinite(a))return null;let i=(t??[]).filter(t=>t.id!==e.id&&t.origin.icao===e.destination.icao&&!t.cancelled&&!t.diverted).map(e=>({s:e,out:e1(e.times.gateOut)})).filter(({out:e})=>Number.isFinite(e)&&e>=a-36e5&&ee.out-t.out);return i[0]?.s??null}(r,i?.siblings):null,o=(0,e4.hasWeatherConnectionAccess)(!0===(0,e3.useSignedIn)(),er.FLINT_FREEMIUM_ENABLED),u=(0,n.useFlightRisk)(o?r:null,r?.history??null),d=(0,n.useFlightRisk)(o?l:null,l?.history??null),c=(0,e8.useTsaWaitInfo)(l?.origin.icao),f=(0,e6.useSavedItineraries)();if(!r||!l||null==a)return null;let h=f.flatMap(e=>e.legs).find(e=>e.flightId===l.id||e.snapshot?.id===l.id),p=function({arriving:e,departing:t,nowMs:a,arrivingRisk:i,departingRisk:n,gateChange:r,tsa:l}){var s;let o,u,d,c,f,h,p;if(!eX.has((0,M.phaseAt)(e,a)))return null;let g=(0,eq.analyzeFlightConnection)(e,t);if(!g)return null;let m=(0,eJ.escalateConnection)(g,i,n),{verdict:x,tone:b,icon:v}=function(e){switch(e.riskLevel){case"safe":return{verdict:"You’ll make it",tone:"success",icon:"check"};case"tight":return e.weatherAdjusted&&"safe"===e.baseRiskLevel?{verdict:"Could get tight",tone:"warning",icon:"weather"}:{verdict:"Tight. Go straight there",tone:"warning",icon:"warning"};case"at-risk":return{verdict:"You might miss it",tone:"sev-moderate",icon:e.weatherAdjusted?"weather":"alert"};case"impossible":return{verdict:"You’ll miss it",tone:"danger",icon:"missed"}}}(m),y=t.origin.timezone,w=m.estimatedLayoverMinutes-m.minimumConnectionMinutes,j=e0(e.times.gateIn.best??e.times.gateIn.scheduled),N=e0(t.times.gateOut.best??t.times.gateOut.scheduled),k=e0(t.times.gateOut.actual);if(null!=k&&null!=j&&j=0?`${e2(A)} to spare`:`${e2(-A)} short`,I=null;if(null!=N&&null==k&&a0&&U){let e=w-$;z.push(`${U} could add about ${e5($)} to your landing. ${e>=0?`That would leave ${e2(e)} to spare.`:`That would leave you ${e2(-e)} short.`}`)}else"at-risk"===m.riskLevel&&(m.scheduledLayoverMinutes!==m.estimatedLayoverMinutes&&(P={label:"Layover",from:e2(m.scheduledLayoverMinutes),to:e2(m.estimatedLayoverMinutes)}),z.push(`That’s ${e2(-w)} less than the ${e5(m.minimumConnectionMinutes)} ${m.layoverAirportIata} needs for a connection.`));if(L){let e=(0,M.formatClock)(L.changedAt,y);z.push(`Gate changed from ${L.previousGate} to ${D}${e?` at ${e}`:""}.`)}let W=e.destination.terminal,B=t.origin.terminal;if(W&&B&&W!==B&&"impossible"!==m.riskLevel){let e=t.origin.iata??t.origin.icao;z.push(`You’re changing terminals, which can mean going through security again.${l?.live?` ${e}’s TSA wait is about ${e2(l.waitMinutes)} right now.`:""}`)}let K=null,H=(0,eZ.splitFlightIdent)(t.ident.iata??"")?.airline??t.ident.airline.iata,G="impossible"===m.riskLevel&&H?eV(H)?.manage:null,Y=G?.match(/^https?:\/\/(?:www\.)?([^/:?#]+)/)?.[1];return G&&Y&&(K={url:G,domain:Y}),{risk:m,tone:b,icon:v,verdict:x,spare:S,gateLine:(d=e.destination.gate,c=t.origin.gate,f=d||c?`Gate ${d??"not assigned"} → ${c??"not assigned"}`:"Gates not assigned",h=e.destination.terminal,p=t.origin.terminal,h&&p?h===p?`${f} \xb7 both in Terminal ${h}`:`${f} \xb7 Terminal ${h} → ${p}`:f),countdown:I,gate:D,gateNote:O,flight:{title:`${F} to ${_}`,departs:T,scheduled:T&&R&&T!==R?R:null,chip:(0,M.flightChip)(t,a)},outlined:"at-risk"===m.riskLevel,change:P,notes:z,manage:K}}({arriving:r,departing:l,nowMs:a,arrivingRisk:u,departingRisk:d,gateChange:h?.previousGateOrigin?{previousGate:h.previousGateOrigin,changedAt:h.gateChangedAt??null}:null,tsa:c});return p?(0,t.jsx)(tt,{m:p}):null}],87513);var ta=e.i(61110),ti=e.i(8150);e.s(["default",0,function({context:e}){let a="flight-leg"===e.kind?e.data?.flight:null,i=a?(0,ta.timezoneCardLines)(a):null;return i?(0,t.jsx)(ti.default,{lines:i}):null}],15925);let tn=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"});function tr(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?"":tn.format(t)}var tl=e.i(64864);function ts({m:e,ident:a}){let i=(0,eZ.splitFlightIdent)(a);return(0,t.jsx)(x.default,{title:"This flight's history",meta:(0,t.jsx)(tl.Pill,{children:i?`${i.airline} ${i.number}`:a}),children:(0,t.jsxs)("div",{"data-testid":"flight-history-card",className:"flex flex-col gap-stack",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-stack-2xs",children:[(0,t.jsx)("p",{"data-testid":"flight-history-headline",className:(0,L.cn)("text-headline",e.totals.late>0&&"text-fg-sev-light"),children:e.headline}),(0,t.jsx)("p",{className:"text-body text-fg-secondary",children:e.period})]}),(0,t.jsxs)("div",{"data-testid":"flight-history-bar",className:"flex flex-col gap-stack-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-body-strong",children:[(0,t.jsx)("span",{children:"This flight"}),(0,t.jsxs)("span",{className:"tabular",children:[e.percent,"% late"]})]}),(0,t.jsx)("span",{className:"block h-1.5 overflow-hidden rounded-full bg-surface-muted",children:(0,t.jsx)("span",{className:"block h-full rounded-full bg-sev-light",style:{width:`${e.percent}%`}})})]}),(0,t.jsx)("dl",{"data-testid":"flight-history-totals",className:"grid grid-cols-3 gap-inline-sm",children:[["Flights",e.totals.flights],["Late",e.totals.late],["Cancelled",e.totals.cancelled]].map(([e,a])=>(0,t.jsxs)("div",{className:"flex flex-col gap-stack-2xs rounded-control bg-surface-muted px-2.5 py-2",children:[(0,t.jsx)("dt",{className:"text-caption text-fg-secondary",children:e}),(0,t.jsx)("dd",{className:"text-title tabular",children:a})]},e))}),(0,t.jsx)("p",{className:"border-t border-subtle pt-stack text-caption text-fg-secondary",children:e.footnote})]})})}e.s(["default",0,function({context:e}){let a="flight-leg"===e.kind?e.data?.flight:null,i=a?.history??null,n=(0,u.useMemo)(()=>(function(e){var t;let a=e?.recent;if(!a||a.flightsNumber.isFinite(d)?new Intl.DateTimeFormat("en-US",{timeZone:e.origin.timezone,...t}).format(d):null,f=c({hour:"numeric",minute:"2-digit"}),h=t.seat??i?.seatNumber??"",p=u?(0,to.airlineName)(u):"",g=o?`${o.airline} ${o.number}`:r,m=u?eV(u):null;return{pass:{livery:u?eH.has(u)?u:null:null,airline:p,flight:g,day:c({weekday:"short"}),from:{code:l,city:e.origin.city},to:{code:s,city:e.destination.city},gate:e.origin.gate,departs:f,gateHint:`Show this with your ID if you don’t have your ${p||"airline"} pass.`,phone:m?.phone??null,manageUrl:m?.manage??null,shareText:[`${p} ${g}`.trim(),`${l} → ${s}`,f&&`departs ${f}`].filter(Boolean).join(" · ")},fields:{booking:t.booking??i?.bookingReference??"",seat:h,group:t.group??"",cabin:t.cabin??i?.cabinClass??""}}},"canSaveBookingCode",0,e=>""===e||/^[A-Z0-9]{6}$/.test(e),"typedBookingCode",0,e=>e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6),"typedGroup",0,e=>e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,3),"typedSeat",0,e=>e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,4)],29616),e.s(["legIsFlight",0,function(e,t){let a=t.ident.toUpperCase();if(e.identIata.toUpperCase()!==a&&e.identIcao?.toUpperCase()!==a)return!1;let i=e.snapshot?.origin.iata||e.originIata,n=e.snapshot?.destination.iata||e.destinationIata;return i?.toUpperCase()===t.originIata.toUpperCase()&&n?.toUpperCase()===t.destinationIata.toUpperCase()}],77280),e.s(["selectedFlight",0,function(e){if("flight-leg"!==e.kind)return null;let t=e.data?.flight,a=(t?.ident.iata||t?.ident.icao)?.trim().toUpperCase();return t&&a?{flight:t,ident:a,date:e.date??e.data?.arc?.date??null,originIata:(t.origin.iata??t.origin.icao).toUpperCase(),destinationIata:(t.destination.iata??t.destination.icao).toUpperCase()}:null}],82815)},943,45291,920,e=>{"use strict";var t=e.i(43476),a=e.i(58785),i=e.i(26320),n=e.i(55529),r=e.i(6191),l=e.i(78137),s=e.i(9694),o=e.i(13065),u=e.i(79231),d=e.i(81789),c=e.i(2586),f=e.i(54495),h=e.i(94966),p=e.i(30086),g=e.i(71645),m=e.i(9875);e.i(10119);let x="Couldn't make a link. Try again.",b={"title-link":"Titles can't contain links.","invalid-flight":"This flight can't be shared yet.","sharing-unavailable":"Sharing isn't available right now. Try again later."};function v(e){let[a,i]=(0,g.useState)(!1),[n,r]=(0,g.useState)(""),[l,s]=(0,g.useState)(null),[o,u]=(0,g.useState)(!1),[d,c]=(0,g.useState)(null),[f,h]=(0,g.useState)(!1),v=(0,g.useRef)(null);async function y(){let t;c(null);let a={flight:e.flight,origin:e.origin,destination:e.destination,date:e.date};try{t=await fetch((0,m.withBase)("/api/v1/share"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a,title:n})})}catch{return c(x),null}let i=await t.json().catch(()=>({}));if(!t.ok||!i.path){var r;return c(b[r=i.error,r?.code==="not-configured"?"sharing-unavailable":r?.code==="invalid-param"?r.message?.split(": ").at(-1)??"invalid-flight":""]??x),null}let l=`${window.location.origin}${i.path}`;return s(l),l}async function w(){h(!0),u(!1);try{let e=await y();if(!e)return;try{await navigator.clipboard.writeText(e),u(!0)}catch{}}finally{h(!1)}}async function j(){h(!0);try{let e=await y()??null;e&&await navigator.share({title:n.trim()||"Follow my flight",url:e})}catch{}finally{h(!1)}}return(0,g.useEffect)(()=>{if(!a)return;let e=e=>{"Escape"===e.key&&(i(!1),v.current?.querySelector("button")?.focus())},t=e=>{v.current?.contains(e.target)||i(!1)};return document.addEventListener("keydown",e),document.addEventListener("pointerdown",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("pointerdown",t)}},[a]),(0,t.jsxs)("div",{ref:v,className:"shrink-0",children:["icon"===e.appearance?(0,t.jsx)("button",{type:"button","data-testid":"share-flight",onClick:()=>i(e=>!e),"aria-expanded":a,"aria-label":"Share this flight",className:"flex size-10 items-center justify-center rounded-full bg-surface-muted text-fg transition-colors hover:bg-surface-raised focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:(0,t.jsx)(p.Share2,{size:18,"aria-hidden":"true"})}):(0,t.jsxs)("button",{type:"button","data-testid":"share-flight",onClick:()=>i(e=>!e),"aria-expanded":a,"aria-label":"Share this flight",className:"flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold",style:{color:"var(--color-fg-interactive)",border:"1px solid var(--border-color-info-subtle)",backgroundColor:"var(--color-surface)"},children:[(0,t.jsx)(p.Share2,{size:14,"aria-hidden":"true"}),"Share"]}),a&&(0,t.jsxs)("div",{"data-testid":"share-popover",className:"absolute top-full right-3 left-3 z-20 mt-1 ml-auto max-w-xs rounded-lg p-3 text-left shadow-lg",style:{border:"1px solid var(--border-color-subtle)",backgroundColor:"var(--color-surface)"},children:[(0,t.jsx)("p",{className:"text-sm font-bold",style:{color:"var(--color-fg)"},children:"Share this flight"}),(0,t.jsx)("p",{className:"mt-1 text-xs",style:{color:"var(--color-fg-secondary)"},children:"Anyone with the link can follow its status, arrival time and gate. It doesn't include your name unless you add a title."}),(0,t.jsxs)("label",{className:"mt-3 block text-xs font-semibold",style:{color:"var(--color-fg-secondary)"},children:["Title (optional)",(0,t.jsx)("input",{"data-testid":"share-title",value:n,maxLength:40,onChange:e=>{r(e.target.value),s(null),u(!1)},placeholder:function(e){let t=function(e){if(!e)return null;let t=e.replace(/[\u0000-\u001f\u007f]/g," ").replace(/\s+/g," ").trim().slice(0,40).trim();return""===t?null:t}(e);if(!t)return;let a=`Flight to ${t}`;return a.lengthtypeof navigator&&"share"in navigator&&(0,t.jsx)("button",{type:"button",disabled:f,onClick:j,className:"rounded px-3 py-1.5 text-sm font-semibold disabled:opacity-60",style:{color:"var(--color-fg-interactive)",border:"1px solid var(--border-color-info-subtle)"},children:"Share…"})]}),l&&(0,t.jsx)("input",{"data-testid":"share-url",readOnly:!0,value:l,onFocus:e=>e.currentTarget.select(),className:"mt-2 w-full rounded px-2 py-1 text-xs",style:{border:"1px solid var(--border-color-subtle)",color:"var(--color-fg-secondary)"},"aria-label":"Share link"})]})]})}e.s(["default",0,v],45291);let y="1"===e.i(47167).default.env.NEXT_PUBLIC_SHARING_ENABLED;e.s(["SHARING_ENABLED",0,y],920);var w=e.i(52236);let j={neutral:"",success:"text-fg-success",warning:"text-fg-warning",danger:"text-fg-danger"};function N({icon:e,gate:a}){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5 rounded-control bg-warning px-2 py-1 text-body-strong text-fg-on-warning tabular",children:[(0,t.jsx)(e,{className:"size-4 shrink-0",strokeWidth:2.5,"aria-hidden":!0}),a]})}function k({icon:e,gateIcon:a,endpoint:i}){return(0,t.jsxs)("div",{className:"flex flex-col gap-stack-2xs",children:[(0,t.jsxs)("p",{className:"flex items-center gap-inline-xs text-label",children:[(0,t.jsx)(e,{className:"size-3.5 shrink-0","aria-hidden":!0}),i.code,i.place?` • ${i.place}`:""]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-inline",children:[(0,t.jsxs)("p",{className:"flex items-baseline gap-inline-sm",children:[(0,t.jsx)("span",{className:(0,w.cn)("text-display tabular",j[i.delay.tone]),children:i.time??"—"}),i.changed&&(0,t.jsx)("span",{className:"text-caption text-fg-tertiary tabular line-through",children:i.scheduled})]}),i.gate?(0,t.jsx)(N,{icon:a,gate:i.gate}):(0,t.jsx)("span",{className:"text-caption text-fg-tertiary",children:"Gate not assigned"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-inline text-caption text-fg-secondary tabular",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:(0,w.cn)("font-semibold",j[i.delay.tone]),children:i.delay.label}),i.relative?` • ${i.relative}`:""]}),i.terminal&&(0,t.jsxs)("p",{children:["Terminal ",(0,t.jsx)("span",{className:"font-semibold text-fg",children:i.terminal})]})]})]})}function $({carrier:e,identLabel:a,dateLabel:i,title:n,departure:r,arrival:l,duration:o,children:u}){return(0,t.jsxs)(s.default,{children:[(0,t.jsxs)("header",{"data-testid":"flight-overview",className:"flex items-center gap-inline",children:[(0,t.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-control bg-surface-muted text-label text-fg-secondary",children:e}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-stack-2xs",children:[(0,t.jsxs)("p",{className:"text-overline text-fg-secondary",children:[a,i?` • ${i}`:""]}),(0,t.jsx)("h2",{className:"text-title",children:n})]})]}),(0,t.jsxs)(s.FlightCardSection,{className:"gap-stack",children:[(0,t.jsx)(k,{icon:p.PlaneTakeoff,gateIcon:p.ArrowUpRight,endpoint:r}),o&&(0,t.jsxs)("div",{className:"flex items-center gap-inline-sm text-caption text-fg-tertiary tabular",children:[(0,t.jsx)(p.Clock,{className:"size-3 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"shrink-0",children:o}),(0,t.jsx)("hr",{className:"flex-1 border-subtle"})]}),(0,t.jsx)(k,{icon:p.PlaneLanding,gateIcon:p.ArrowDownRight,endpoint:l})]}),u]})}function M(e,t){let a=Date.parse(e.asOf);return(0,r.flightFreshness)((0,n.phaseAt)(e,t),Number.isFinite(a)?a:null,t)}function A({flight:e,share:r,children:s}){let o=(0,f.useCardVariant)(),u=(0,i.useUnits)(),d=(0,c.useNow)(3e4),p=(0,n.flightOverview)(e,d,{freshness:null==d?null:M(e,d)});return"flint"===o?(0,t.jsx)(h.default,{overview:p,status:e.status,inFlight:null==d?null:(0,l.inFlightModel)({flight:e,now:d,units:u,stale:p.freshness?.stale}),actions:y?(0,t.jsx)(v,{...r,appearance:"icon"}):void 0,distance:p.miles>0?(0,a.formatMiles)(p.miles,u):null,children:s}):(0,t.jsx)($,{carrier:p.carrier,identLabel:p.ident,dateLabel:p.dateLabel,title:`${e.origin.city||p.departure.code} to ${e.destination.city||p.arrival.code}`,departure:p.departure,arrival:p.arrival,duration:p.duration,children:s})}e.s(["default",0,function({context:e,title:a}){let{status:i}=(0,d.useFlightResource)("flight-leg"===e.kind?(0,d.selectionRef)(e):null);if("flight-leg"!==e.kind)return null;if((0,u.flightPending)(e)&&!i?.failed)return(0,t.jsx)(u.default,{title:a,shape:"flight"});let{data:n}=e,r=n?.arc,l=n?.flight;return r&&l?(0,t.jsx)(A,{flight:l,share:{flight:e.identIcao,origin:e.originIata,destination:e.destinationIata,date:e.date,destinationCity:r.destination.city},children:(0,t.jsx)(o.default,{status:i,what:"flight data"})}):(0,t.jsx)(s.default,{title:a,children:i?.failed?(0,t.jsx)(o.default,{status:i,what:"flight data"}):(0,t.jsx)("p",{className:"text-body-sm text-fg-tertiary",children:n?.loading?"Loading flight…":"Flight data unavailable."})})},"freshnessOf",0,M],943)},88924,45780,25275,43277,51615,77494,e=>{"use strict";var t=e.i(43476),a=e.i(71645),i=e.i(78438),n=e.i(13065);let r=(0,i.catchError)(function({title:e},{error:i,retry:r}){return(0,a.useEffect)(()=>{console.error(`Card "${e}" failed to render`,i)},[e,i]),(0,t.jsxs)("div",{"data-testid":"card-error",className:"flex flex-col items-start gap-2",children:[(0,t.jsx)(n.default,{status:{failed:!0,at:null},what:e}),(0,t.jsx)("button",{type:"button",onClick:()=>r(),className:"text-caption text-fg-secondary underline",children:"Try again"})]})});e.s(["default",0,r],88924);var l=e.i(65161),s=e.i(4534);function o(e){let t=new Map;return e.querySelectorAll(":scope > [data-card-slot]").forEach(e=>{let a=e.getBoundingClientRect();t.set(e.dataset.cardSlot,{el:e,rect:a,shown:a.height>0&&!!e.textContent?.trim()})}),t}e.s(["useCardReorderMotion",0,function(e,t,i){let n=(0,a.useRef)({order:t,stage:i}),r=(0,a.useRef)(null);if((t!==n.current.order||i!==n.current.stage)&&e.current&&!r.current){let t=new Map;for(let[a,i]of o(e.current))t.set(a,{...i,ghost:i.shown?i.el.cloneNode(!0):null,skeleton:!!i.el.querySelector("[data-card-skeleton]")});r.current={at:performance.now(),slots:t}}(0,a.useLayoutEffect)(()=>{let a=n.current;n.current={order:t,stage:i};let u=r.current;if(u){if(performance.now()-u.at>300){r.current=null;return}t!==a.order&&(r.current=null,e.current&&function(e,t){if((0,s.reducedMotion)())return;let a=o(e),i=e=>[...e].filter(([,e])=>e.shown).map(([e])=>e),n=(0,l.reorderPlan)(i(t.slots),i(a)),r=e.getBoundingClientRect();for(let[e,i]of a){let a=t.slots.get(e);if(!i.shown||!a)continue;if(!a.shown){i.el.animate([{opacity:0,transform:"translateY(16px) scale(0.985)"},{opacity:1,transform:"none"}],{duration:l.SLOT.riseMs,easing:(0,s.ease)("arrive"),fill:"backwards"});continue}let n=a.rect.left-i.rect.left,r=a.rect.top-i.rect.top;Math.abs(n)+Math.abs(r){}).finally(()=>o.remove()))}}(e.current,u))}},[t,i,e])}],45780);var u=e.i(13737);let{fadeMs:d,heightMs:c,closeMs:f,waveWindowMs:h,waveStepMs:p,riseMs:g,riseFromPx:m,riseFromScale:x}=l.SLOT,b=e=>e.querySelector("[data-card-skeleton]")?"skeleton":e.textContent?.trim()||e.querySelector("img,svg,canvas")?"content":"empty";e.s(["useCardSlotMotion",0,function(){let e=(0,a.useRef)({at:-1/0,delay:0}),t=(0,a.useRef)({at:-1/0,i:-1});return(0,a.useCallback)(a=>{if(!a)return;if(!(0,s.reducedMotion)()&&null!==a.offsetParent){let e=performance.now(),i=t.current,n=e-i.at{let t=b(a),g=i;if(i=t,"skeleton"===t){r=a.querySelector("[data-card-skeleton]")?.cloneNode(!0)??null,n=a.offsetHeight;return}if("skeleton"!==g){if("empty"===g&&"content"===t&&!(0,s.reducedMotion)()){let e=a.offsetHeight;a.animate([{height:"0px"},{height:`${e}px`}],{duration:c,easing:(0,s.ease)("arrive")}),a.style.overflow="hidden",a.firstElementChild?.animate([{opacity:0},{opacity:1}],{duration:d,easing:(0,s.ease)("glide"),fill:"backwards"}).finished.catch(()=>{}).finally(()=>a.style.overflow="")}n=a.offsetHeight;return}let m=(0,s.reducedMotion)();if("content"===t){let t=performance.now(),i=e.current,r=t-i.at{}).finally(()=>{y.remove(),v.takeRecords(),l=!1,a.style.overflow="",i="empty",n=0,o()})},v=new MutationObserver(()=>{l||o()});return v.observe(a,{childList:!0,subtree:!0}),()=>v.disconnect()},[])}],25275);var v=e.i(9694),y=e.i(64864),w=e.i(30086),j=e.i(36966),N=e.i(55529),k=e.i(2052);let $={unknown:null,short:0,moderate:1,long:2,"very-long":3},M={0:[0,10],1:[10,20],2:[20,30],3:[30,45]};function A(e,t){let a=t??(ee%24`${e%12||12} ${C(e)}`;e.s(["meterPercent",0,A,"tsaOutlook",0,function({minutes:e,level:t,live:a,observedAt:i,timeZone:n,precheckAvailable:r,typical:l,nowHour:s,nowMs:o}){let u=Math.max(0,Math.round(e)),d=$[t],c=n?function(e,t,a){let i=(0,N.formatClock)(e,t);if(!i||null==a||(0,k.localDateStr)(e,t)===(0,k.localDateStr)(new Date(a).toISOString(),t))return i;let n=new Intl.DateTimeFormat("en-US",{timeZone:t,month:"short",day:"numeric"}).format(Date.parse(e));return`${n}, ${i}`}(i,n,o):null,f=a?0===u?"No wait right now":`${j.TSA_LEVEL_PRESENTATION[t].label} wait, about ${u} min`:`${c?`Reported ${c}`:"Last reported"}: ${0===u?"no wait":`about ${u} min`}`,h=null==s?[]:l??[],p=h.find(e=>e.hour===s),g=p?{minutes:Math.round(p.waitMinutes),step:$[p.level]}:null,m=h.filter(e=>e.hour>s),x=a&&m.length?function(e,t,a){let i=e.map(e=>{let a,i=Math.round(e.waitMinutes);return{hour:e.hour,time:C(a=e.hour)===C(a+1)?`${a%12||12}–${(a+1)%12||12} ${C(a)}`:`${S(a)}–${S(a+1)}`,minutes:i,step:$[e.level],saves:t-i}}).filter(e=>e.saves>=2),n=new Set;if(null!=a&&a>0)for(let e of[i.find(e=>null!=e.step&&e.step0===e.step)])e&&n.add(e);for(let e of[...i].sort((e,t)=>e.minutes-t.minutes||e.hour-t.hour)){if(n.size>=3)break;n.add(e)}return[...n].slice(0,3).sort((e,t)=>e.hour-t.hour)}(m,u,d):null,b=[];if(a&&g){let e=u-g.minutes,t=S(s);b.push(e>=5?`Longer than usual for ${t}.`:e90?"-translate-x-full":"-translate-x-1/2",a),style:{left:`${e}%`},children:i})}function R({minutes:e,step:a,live:i,usual:n}){let r=A(e,a),l=n?A(n.minutes,n.step):null;return(0,t.jsxs)("div",{role:"img","aria-label":`About ${e} min ${i?"now":"when last reported"}${n?`; usually ${n.minutes} min at this hour`:""}`,"data-testid":"tsa-wait-meter",className:"flex flex-col gap-stack-2xs",children:[(0,t.jsx)("div",{className:"relative mb-1.5 h-3.5","aria-hidden":!0,children:(0,t.jsxs)(T,{pct:r,className:(0,I.cn)("bottom-0 font-semibold",null==a?"text-fg":O[a]),children:[i?"Now":"Last"," ",e]})}),(0,t.jsxs)("div",{className:"relative flex gap-0.5","aria-hidden":!0,children:[E.map(e=>(0,t.jsx)("div",{className:(0,I.cn)("h-2 flex-1 rounded-full",e===a?L[e]:"bg-surface-muted")},e)),null!=l&&(0,t.jsx)("span",{className:"absolute -inset-y-1 -ml-px w-0.5 rounded-full bg-fg-tertiary",style:{left:`${l}%`}}),(0,t.jsx)("span",{className:"absolute -inset-y-1.5 -ml-0.5 w-1 rounded-full bg-fg ring-2 ring-surface",style:{left:`${r}%`}})]}),n&&null!=l&&(0,t.jsx)("div",{className:"relative mt-1 h-3.5","aria-hidden":!0,children:(0,t.jsxs)(T,{pct:l,className:"top-0 text-fg-secondary",children:["Usual ",n.minutes]})}),(0,t.jsxs)("div",{className:"relative flex text-caption text-fg-tertiary tabular","aria-hidden":!0,children:[["0","10","20","30"].map(e=>(0,t.jsx)("span",{className:"flex-1",children:e},e)),(0,t.jsx)("span",{className:"absolute right-0",children:"45+ min"})]})]})}e.s(["default",0,function({title:e,code:a,outlook:i}){let{later:n}=i;return(0,t.jsx)(v.default,{title:e,meta:(0,t.jsx)(y.Pill,{children:a}),children:(0,t.jsxs)(v.FlightCardSection,{className:"gap-stack",children:[(0,t.jsx)(D.OutlookVerdict,{testId:"tsa-wait-headline",subtitleTestId:"tsa-wait-subtitle",headline:i.headline,subtitle:i.subtitle}),(0,t.jsx)(R,{minutes:i.minutes,step:i.step,live:i.live,usual:i.usual}),n&&(0,t.jsxs)("div",{className:"flex flex-col gap-stack-sm border-t border-subtle pt-stack",children:[(0,t.jsx)(v.SectionLabel,{children:"Shorter later today"}),n.length>0?(0,t.jsx)("ul",{"aria-label":"Shorter later today",className:"grid grid-cols-3 gap-inline",children:n.map(e=>{let a;return(0,t.jsxs)("li",{"aria-label":`${e.time}: about ${e.minutes} min, ${e.saves} min shorter`,className:"flex min-w-0 flex-col gap-stack-2xs",children:[(0,t.jsx)("span",{className:"text-caption whitespace-nowrap text-fg-secondary tabular","aria-hidden":!0,children:e.time}),(0,t.jsxs)("span",{className:"flex items-center gap-inline-xs text-body-strong tabular","aria-hidden":!0,children:[(0,t.jsx)("span",{className:(0,I.cn)("size-2 shrink-0 rounded-full",null==(a=e.step)?"bg-fg-tertiary":L[a])}),e.minutes," min"]}),(0,t.jsxs)("span",{className:"text-caption font-semibold whitespace-nowrap text-fg-success tabular","aria-hidden":!0,children:[e.saves," min less"]})]},e.hour)})}):(0,t.jsxs)("p",{"data-testid":"tsa-wait-none-shorter",className:"flex items-center gap-inline-xs text-body-sm text-fg-secondary",children:[(0,t.jsx)(w.CircleCheck,{className:"size-4 shrink-0 text-fg-success","aria-hidden":!0}),"This is about as short as it gets today."]})]})]})})}],77494)},13065,e=>{"use strict";var t=e.i(43476),a=e.i(11383);e.s(["default",0,function({status:e,what:i,text:n,className:r=""}){let l=e?.failed&&n?n:function(e,t,i=Date.now()){return e?.failed?null==e.at?`Couldn't load ${t}`:`Couldn't refresh ${t}. ${(0,a.updatedLabel)(new Date(e.at),i)}`:null}(e,i);return l?(0,t.jsxs)("p",{role:"status","data-testid":"load-failure-note",className:`flex items-center gap-1.5 text-caption text-fg-secondary ${r}`,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-2 rounded-full bg-warning"}),l]}):null}],13065)},1673,e=>{"use strict";var t=e.i(43476),a=e.i(52236);let i={0:"bg-sev-none",1:"bg-sev-light",2:"bg-sev-moderate",3:"bg-sev-severe"};e.s(["FILL_TEXT",0,{0:"text-fg-sev-none",1:"text-fg-sev-light",2:"text-fg-sev-moderate",3:"text-fg-sev-severe"},"OutlookBar",0,function({level:e,height:n,i:r=0}){return(0,t.jsx)("div",{className:"flex h-16 w-full max-w-5 flex-col justify-end overflow-hidden rounded-inner bg-surface-muted","aria-hidden":!0,children:(0,t.jsx)("div",{className:(0,a.cn)("rounded-inner",null!=e&&i[e],"origin-bottom animate-bar-grow"),style:{height:n,"--bar-i":r}})})},"OutlookVerdict",0,function({headline:e,subtitle:a,testId:i,subtitleTestId:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-stack-2xs",children:[(0,t.jsx)("p",{"data-testid":i,className:"text-headline",children:e}),a&&(0,t.jsx)("p",{"data-testid":n,className:"text-body text-fg-secondary tabular",children:a})]})},"YouMarker",0,function({label:e,className:i,testId:n}){return(0,t.jsxs)("span",{"data-testid":n,className:(0,a.cn)("flex flex-col items-center gap-stack-2xs",i),"aria-hidden":!0,children:[(0,t.jsx)("span",{className:"text-caption font-semibold",children:e}),(0,t.jsx)("svg",{viewBox:"0 0 8 6",className:"h-1.5 w-2 fill-current",children:(0,t.jsx)("path",{d:"M0 0h8L4 6z"})})]})}])},92409,40998,48918,40195,30215,37385,90920,e=>{"use strict";var t=e.i(14394),a=e.i(27737),i=e.i(88107),n=e.i(43476);e.i(8199);var r=e.i(50798),l=e.i(81614),s=e.i(66528),o=e.i(79231),u=e.i(13065),d=e.i(9694),c=e.i(80279),f=e.i(47448),h=e.i(2586);let p={label:"Now",aria:"now"};var g=e.i(65766),m=e.i(94311),x=e.i(71645),b=e.i(51871),v=e.i(30374);let y=(0,b.createStore)({fetcher:async e=>{let[t="",a]=e.split("|"),i=await v.v1.board(t,a);if(!i.ok)throw Error("http"===i.reason?`status ${i.status}`:i.message);return i.data},fallback:null,ttlMs:6e4});var w=e.i(64864),j=e.i(1673);function N({taxi:e,timeZone:t}){let{points:a,line:i,scheduledMinutes:r}=e,l=a[0].ms,s=Math.max(a.at(-1).ms,l+6e4),o=a.map(e=>e.minutes),u=Math.min(...o,...null!=r?[r-4]:[]),d=Math.max(...o,...null!=r?[r+10]:[]),c=e=>6+(e-l)/(s-l)*308,f=e=>72-(e-u)/(d-u||1)*48,h=`M${i.map(e=>`${c(e.ms).toFixed(1)},${f(e.minutes).toFixed(1)}`).join("L")}`,p=i.at(-1),m=[];for(let e=Math.ceil(l/g.HOUR)*g.HOUR;e(0,n.jsx)("circle",{cx:c(e.ms),cy:f(e.minutes),r:2.6,className:"fill-info/55"},`${e.ms}-${t}`)),(0,n.jsx)("path",{d:h,fill:"none",strokeWidth:2,strokeLinejoin:"round",className:"stroke-info"}),(0,n.jsx)("circle",{cx:c(p.ms),cy:f(p.minutes),r:4,strokeWidth:2,className:"fill-fg stroke-surface"}),(0,n.jsxs)("text",{x:Math.max(48,Math.min(272,c(p.ms))),y:f(p.minutes)-9,textAnchor:"middle",className:"fill-fg text-caption font-bold",children:["Latest · ",e.nowMinutes," min"]}),(x?[l,s]:m).map(e=>{let a;return(0,n.jsx)("text",{x:c(e),y:91,textAnchor:(a=c(e))300?"end":"middle",className:"fill-fg-secondary text-caption",children:x?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",timeZone:t}):(0,g.hourTick)(e,t)},e)})]})}function k({title:e,code:t,taxi:a,timeZone:i}){return(0,n.jsx)(d.default,{title:e,meta:(0,n.jsx)(w.Pill,{children:t}),children:(0,n.jsxs)(d.FlightCardSection,{className:"gap-stack",children:[(0,n.jsx)(j.OutlookVerdict,{testId:"taxi-time-headline",headline:a.headline,subtitle:a.subtitle}),(0,n.jsx)(N,{taxi:a,timeZone:i}),(0,n.jsx)("p",{className:"border-t border-subtle pt-stack text-body-sm text-fg-secondary",children:a.note})]})})}function $({icao:e,code:t,timeZone:a,direction:i,title:r}){var l;let s,c,f,{board:h,status:p}=(s=(l=e||null)?`${l}|${i}`:null,c=(0,b.useStoreVersion)(),(0,x.useEffect)(()=>{s&&y.ensure(s)},[s,c]),f=(0,b.useLoadStatus)(y,s),s?{board:f?y.get(s):void 0,status:f}:{board:null,status:null});if(void 0===h||!a)return(0,n.jsx)(o.default,{title:r,shape:"bars"});let m="departures"===i?h?.taxiOut&&(0,g.taxiTime)(h.taxiOut):h?.taxiIn&&(0,g.taxiTimeIn)(h.taxiIn);return m?(0,n.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,n.jsx)(k,{title:r,code:t,taxi:m,timeZone:a}),(0,n.jsx)(u.default,{status:p,what:i})]}):p?.failed?(0,n.jsx)(d.default,{title:r,children:(0,n.jsx)(u.default,{status:p,what:i})}):null}function M({context:e,title:t}){let a="airport"===e.kind?e.icao:"",i="airport"===e.kind?e.iata:"",r=(0,f.useKnownAirportTimezone)(i);return(0,n.jsx)($,{icao:a,code:i,timeZone:r,direction:"departures",title:t})}function A({context:e,title:t,end:a}){let i=(0,h.useNow)(6e4),r="flight-leg"===e.kind?e.data?.flight:null,l=r?.[a];return r&&l&&null!=i&&("origin"!==a||(0,m.departsToday)(r.times.gateOut.best,l.timezone,i))&&("destination"!==a||(0,m.beforeGateIn)(r))?(0,n.jsx)($,{icao:l.icao,code:l.iata??l.icao,timeZone:l.timezone,direction:"origin"===a?"departures":"arrivals",title:t}):null}e.s(["TaxiInCard",0,function(e){return(0,n.jsx)(A,{...e,end:"destination"})},"TaxiOutCard",0,function(e){return(0,n.jsx)(A,{...e,end:"origin"})},"default",0,M],40998);var C=e.i(75004);function S(e){return Array.isArray(e)?{cards:e,malformed:!1}:{cards:[],malformed:null!=e}}function I(e){return{icao:e.icao,iata:e.iata,name:e.name,city:e.city,state:e.state,country:e.country,timezone:e.timezone,position:e.position}}let D="AlYPSLVO",E=e=>e.replace(//gi," ").replace(/]*>/gi,"\n").replace(/]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/[^\S\n]+/g," ").replace(/ +([.,;:!?])/g,"$1").replace(/ *\n\s*/g,"\n").trim(),L=e=>e.replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/^#+\s*/gm,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(^|\s)[*_]([^*_]+)[*_](?=\s|[.,;:!?]|$)/g,"$1$2"),O=(e,t)=>t.split("\n").map(e=>e.trim()).filter(t=>t&&t.toLowerCase()!==e.title.toLowerCase()),T=(e,t,a)=>`${Math.abs(e).toFixed(2)}\xb0 ${e>=0?t:a}`;function R(e,t){var a;let i=t??[],n=i.find(e=>"NqJAr3rn"===e.id||"About This Airport"===e.title);return{code:e.iata??e.icao,name:e.name,place:[e.city,e.state??e.country].filter(Boolean).join(", "),airportClass:function(e){if(!e?.content)return null;let t="html"===e.format?E(e.content):L(e.content),a=/Class\s+[A-E]\b[^·|\n.]*/i.exec(t);return a?a[0].replace(/\s*[—–-]\s*/,", ").replace(/\s+/g," ").trim():null}(n),summary:(a=i.find(e=>e.id===D||"Airport Summary"===e.title),a?.content?"html"===a.format?O(a,E(a.content)).join(" ")||null:L(a.content).replace(/\s+/g," ").trim()||null:null),about:function(e,t){if(!e?.content)return[];let a="html"===e.format?E(e.content):L(e.content),i=t.filter(e=>!!e);return O(e,a).filter(e=>!/Class\s+[A-E]\b/i.test(e)&&!i.some(t=>e.split(/\s/)[0]===t))}(n,[e.icao,e.iata]),timezone:e.timezone,coordinates:e.position?`${T(e.position.lat,"N","S")}, ${T(e.position.lon,"E","W")}`:null}}e.s(["AIRPORT_SUMMARY_ID",0,D,"airportFactsOf",0,I,"airportSummaryAbout",0,R,"narrativeList",0,S],48918);var F=e.i(26320),_=e.i(64891);function z({m:e,note:t}){return(0,n.jsx)(d.default,{title:"Airport Summary",meta:(0,n.jsx)(w.Pill,{children:e.code}),children:(0,n.jsxs)("div",{"data-testid":"airport-summary-about",className:"flex flex-col gap-stack",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-stack-2xs",children:[(0,n.jsx)("p",{"data-testid":"airport-about-name",className:"text-title",children:e.name}),(0,n.jsx)("p",{className:"text-body-sm text-fg-secondary",children:[e.place,e.airportClass].filter(Boolean).join(" · ")})]}),e.summary&&(0,n.jsx)("div",{"data-testid":"airport-summary",className:"flex flex-col gap-stack-xs text-body-sm text-fg-secondary",children:(0,n.jsx)("p",{children:e.summary})}),e.about.length>0&&(0,n.jsx)("div",{"data-testid":"airport-about-text",className:"flex flex-col gap-stack-2xs text-body-sm text-fg-secondary",children:e.about.map((e,t)=>(0,n.jsx)("p",{children:e},`${t}-${e}`))}),t,(e.timezone||e.coordinates)&&(0,n.jsx)("p",{"data-testid":"airport-about-zone",className:"border-t border-subtle pt-stack text-caption text-fg-tertiary tabular",children:[e.timezone,e.coordinates].filter(Boolean).join(" · ")})]})})}function P({context:e,title:t}){let a="airport"===e.kind?e.icao:"flight-leg"===e.kind?e.data?.flight?.destination.icao??"":"",i=(0,C.v1Units)((0,F.useUnits)()),r=(0,b.useStoreVersion)();(0,x.useEffect)(()=>{a&&(0,_.ensureAirport)(a,i)},[a,i,r]);let l=a?(0,_.readAirport)(a,i):null,s=a?(0,_.airportSectionStatus)(a,"narratives",i):null;if(!l)return s?.failed?(0,n.jsx)(d.default,{title:t,children:(0,n.jsx)(u.default,{status:s,what:"airport insights"})}):(0,n.jsx)(o.default,{title:t,shape:"text"});let{cards:c,malformed:f}=S(l.resource.narratives);return(0,n.jsx)(z,{m:R(I(l.resource.airport),c),note:(0,n.jsx)(u.default,{status:f?{failed:!0,at:null}:s,what:"airport insights"})})}e.s(["default",0,P],40195);var U=e.i(40875),W=e.i(52236);let B="1.5rem",K={arrivals:"arrival",departures:"departure"};function H({title:e,code:t,direction:a,outlook:i}){let r=K[a],l=i.bars.some(e=>e.you);return(0,n.jsx)(d.default,{title:e,meta:(0,n.jsx)(w.Pill,{children:t}),children:(0,n.jsxs)(d.FlightCardSection,{className:"gap-stack",children:[(0,n.jsx)(j.OutlookVerdict,{testId:`${r}-capacity-headline`,headline:i.headline,subtitle:i.subtitle}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("ol",{className:"flex justify-between gap-0.5","aria-label":`${"arrivals"===a?"Arrivals":"Departures"} against capacity`,children:i.bars.map((e,t)=>(0,n.jsxs)("li",{"aria-label":`${e.name}: ${null==e.percent?"capacity not known":`${Math.round(e.percent)}% of capacity`}${e.you?`, your ${r}`:""}`,className:"flex min-w-0 flex-1 flex-col items-center gap-stack-sm",children:[l&&(0,n.jsx)("div",{className:"flex items-end",style:{height:B},children:e.you&&null!=e.level&&(0,n.jsx)(j.YouMarker,{label:"You",className:j.FILL_TEXT[e.level],testId:`${r}-capacity-you`})}),(0,n.jsx)(j.OutlookBar,{level:e.level,height:`${null==e.percent?0:Math.min(100,e.percent/120*100)}%`,i:t}),(0,n.jsx)("span",{className:(0,W.cn)("text-caption tabular",(l?e.you:e.current)?"font-semibold text-fg":"text-fg-secondary"),"aria-hidden":!0,children:e.label})]},e.ms))}),(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 h-16",style:{top:l?`calc(${B} + var(--spacing-stack-sm))`:0},"aria-hidden":!0,children:(0,n.jsx)("div",{className:"absolute inset-x-0 border-t border-dashed border-strong",style:{bottom:"83.33333333333334%"}})})]}),(0,n.jsx)("p",{className:"border-t border-subtle pt-stack text-body-sm text-fg-secondary",children:i.note})]})})}function G(e,t){let a=(0,b.useStoreVersion)();return(0,x.useEffect)(()=>{t&&e.ensure(t)},[e,t,a]),t?e.get(t):null}e.s(["default",0,H],30215);let Y=e=>G(_.v1CapacityStore,e);function V(e){return(0,b.useLoadStatus)(_.v1CapacityStore,e)}let Z=e=>G(_.v1DeicingStore,e);function q(e){return(0,b.useLoadStatus)(_.v1DeicingStore,e)}function Q({context:e,title:t,direction:a}){let i="airport"===e.kind?e.icao:"",r="airport"===e.kind?e.iata:"",l=Y(i),s=V(i),c=(0,f.useKnownAirportTimezone)(r),p=(0,h.useNow)(6e4),m=`${"arrivals"===a?"arrival":"departure"} capacity`;if(void 0===l||null==p||!c)return(0,n.jsx)(o.default,{title:t,shape:"bars"});let x=l?(0,g.hourlyCapacityOutlook)(l,p,c,{direction:a}):null,b="arrivals"===a;return x?(0,n.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,n.jsx)(H,{title:t,code:r,direction:a,outlook:x}),b&&(0,n.jsx)(u.default,{status:s,what:m})]}):b&&s?.failed?(0,n.jsx)(d.default,{title:t,children:(0,n.jsx)(u.default,{status:s,what:m})}):null}e.s(["useAirportCapacity",0,Y,"useAirportCapacityStatus",0,V,"useAirportDeicing",0,Z,"useAirportDeicingStatus",0,q],37385);var J=e.i(99847);let X={label:"You",aria:"your departure"},ee={label:"Now",aria:"now"},et={danger:"text-fg-sev-severe",warning:"text-fg-sev-moderate",success:"text-fg-sev-none",neutral:"text-fg"};function ea({title:e,code:t,outlook:a,marker:i}){return(0,n.jsx)(d.default,{title:e,meta:(0,n.jsx)(w.Pill,{children:t}),children:(0,n.jsxs)(d.FlightCardSection,{className:"gap-stack",children:[(0,n.jsx)(j.OutlookVerdict,{testId:"deicing-headline",subtitleTestId:"deicing-subtitle",headline:a.headline,subtitle:a.subtitle}),(0,n.jsxs)("div",{className:"flex flex-col gap-stack-sm",children:[(0,n.jsx)("div",{className:"flex h-6 items-end justify-between gap-0.5","aria-hidden":!0,children:a.bars.map(e=>(0,n.jsx)("div",{className:"flex min-w-0 flex-1 justify-center",children:e.focus&&(0,n.jsx)(j.YouMarker,{label:i.label,className:"Now"===i.label?"text-fg-secondary":j.FILL_TEXT[e.level],testId:"deicing-marker"})},e.ms))}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("ol",{className:"flex items-end justify-between gap-0.5","aria-label":a.chartLabel,children:a.bars.map((e,t)=>(0,n.jsxs)("li",{"data-level":e.level,"aria-label":`${e.name}: ${e.chancePercent}% chance, ${J.DEICING_LEVEL_WORD[e.level]}${e.focus?`, ${i.aria}`:""}`,className:"flex min-w-0 flex-1 flex-col items-center gap-stack-sm",children:[(0,n.jsx)(j.OutlookBar,{level:e.level,height:`${e.chancePercent}%`,i:t}),(0,n.jsx)("span",{className:(0,W.cn)("text-caption tabular",e.focus?"font-semibold text-fg":"text-fg-secondary",!e.focus&&t%2==1&&"invisible"),"aria-hidden":!0,children:e.label})]},e.ms))}),(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-16","aria-hidden":!0,children:(0,n.jsx)("div",{className:"absolute inset-x-0 flex justify-end border-t border-dashed border-strong",style:{bottom:`${J.DEICING_LIKELY_PERCENT}%`},children:(0,n.jsxs)("span",{className:"-mt-4 rounded-inner bg-surface px-1 text-caption text-fg-secondary",children:[J.DEICING_LIKELY_PERCENT,"% likely"]})})})]})]}),(0,n.jsxs)("dl",{className:"grid auto-cols-fr grid-flow-col gap-inline",children:[a.window&&(0,n.jsx)(w.StatCell,{label:a.windowLabel,value:a.window}),a.severity&&(0,n.jsx)(w.StatCell,{label:"Severity",value:a.severity,valueClassName:et[a.severityTone??"neutral"]}),a.conditions&&(0,n.jsx)(w.StatCell,{label:a.conditionsLabel,value:a.conditions})]}),(0,n.jsx)("p",{className:"border-t border-subtle pt-stack text-body-sm text-fg-secondary",children:a.note})]})})}function ei({icao:e,code:t,timeZone:a,focusIso:i,title:r,marker:l}){let s=Z(e),c=q(e),f=(0,h.useNow)(6e4),p=(0,F.useUnits)();if(void 0===s||null==f||!a)return(0,n.jsx)(o.default,{title:r,shape:"bars"});let g=s?(0,J.deicingOutlook)(s,i,t,a,f,p):null;return g?(0,n.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,n.jsx)(ea,{title:r,code:t,outlook:g,marker:l}),(0,n.jsx)(u.default,{status:c,what:"the de-icing forecast"})]}):c?.failed?(0,n.jsx)(d.default,{title:r,children:(0,n.jsx)(u.default,{status:c,what:"the de-icing forecast"})}):null}function en({context:e,title:t}){let a="airport"===e.kind?e.icao:"",i="airport"===e.kind?e.iata:"",r=(0,f.useKnownAirportTimezone)(i);return(0,n.jsx)(ei,{icao:a,code:i,timeZone:r,focusIso:null,title:t,marker:ee})}for(let[g,m]of(e.s(["DeicingOutCard",0,function({context:e,title:t}){let a="flight-leg"===e.kind?e.data?.flight:null;return(0,o.flightPending)(e)?(0,n.jsx)(o.default,{title:t,shape:"bars"}):!a||a.times.gateOut.actual?null:(0,n.jsx)(ei,{icao:a.origin.icao,code:a.origin.iata??a.origin.icao,timeZone:a.origin.timezone,focusIso:a.times.gateOut.best,title:t,marker:X})},"default",0,en],90920),Object.entries({"tsa-wait":{title:"TSA Wait Time",Component:a.default},"weather-now":{title:"Weather now",Component:i.default},"airport-impact":{title:"Weather impact today",Component:function({context:e,title:t}){let a="airport"===e.kind?e.iata:"",i=(0,c.useAirportImpact)(a),g=(0,c.useAirportImpactStatus)(a),m=(0,f.useKnownAirportTimezone)(a),x=(0,h.useNow)(6e4);if(!a)return null;if(null==x||!m||void 0===i&&!g?.failed)return(0,n.jsx)(o.default,{title:t,shape:"bars"});let b=i?(0,r.impactWindowV1)(i,(0,l.hourIndexAt)(i,new Date(x).toISOString()),a,m,void 0,!0):null;return b?(0,n.jsxs)("div",{className:"flex flex-col gap-stack",children:[(0,n.jsx)(s.default,{code:a,window:b,title:t,marker:p,headlineTestId:"airport-impact-headline"}),(0,n.jsx)(u.default,{status:g,what:"the weather impact forecast"})]}):g?.failed?(0,n.jsx)(d.default,{title:t,children:(0,n.jsx)(u.default,{status:g,what:"the weather impact forecast"})}):null}},"airport-deicing":{title:"De-icing Risk",Component:en},"taxi-time":{title:"Taxi time",Component:M},"airport-summary":{title:"Airport Summary",Component:P},"delays-now":{title:"Delays right now",Component:function({context:e,title:t}){if("airport"!==e.kind)return null;let a=e.data?.status;if(void 0===a)return(0,n.jsx)(o.default,{title:t,shape:"stats"});if(!a)return null;let i=function(e){if("unknown"===e.level)return{kind:"note",text:"Delays unavailable."};if("no-data"===e.level)return{kind:"note",text:(0,U.airportLevelWords)(e.level).label};let t=[["Departures late",e.departures.delayedPercent,"%"],["Arrivals late",e.arrivals.delayedPercent,"%"],["Avg dep delay",e.departures.averageDelayMinutes,"m"]].flatMap(([e,t,a])=>null==t?[]:[{label:e,value:`${t}${a}`}]);return t.length?{kind:"stats",stats:t}:{kind:"note",text:"No delays reported."}}(a);return"note"===i.kind?(0,n.jsx)(d.default,{title:t,children:(0,n.jsx)("p",{className:"text-body-sm text-fg-tertiary",children:i.text})}):(0,n.jsx)(d.default,{title:t,children:(0,n.jsx)("dl",{className:"grid grid-cols-3 gap-inline",children:i.stats.map(({label:e,value:t})=>(0,n.jsxs)("div",{className:"flex flex-col-reverse",children:[(0,n.jsx)("dt",{className:"text-caption text-fg-tertiary",children:e}),(0,n.jsx)("dd",{className:"text-stat tabular",children:t})]},e))})})}},"airport-departure-capacity":{title:"Departure Capacity",Component:function(e){return(0,n.jsx)(Q,{...e,direction:"departures"})}},"airport-arrival-capacity":{title:"Arrival Capacity",Component:function(e){return(0,n.jsx)(Q,{...e,direction:"arrivals"})}}})))(0,t.registerCard)({id:g,contexts:["airport"],size:"full",...m});e.s([],92409)},22869,33541,e=>{"use strict";var t=e.i(84275),a=e.i(42132),i=e.i(55529),n=e.i(99847),r=e.i(31590),l=e.i(36966),s=e.i(58785),o=e.i(78944),u=e.i(2194);let d=e=>{if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:t};e.s(["buildObservations",0,function(e,c,f,h){let p=[];for(let g of e)for(let e of(0,t.buildLegChains)(g))e.forEach((g,m)=>{let x=g.snapshot;if(!x||!(0,u.hasLiveData)(g))return;let b=(0,r.scheduledOutMs)(g),v=null!==b&&b>=h-r.BEHIND_MS&&b{let t=Math.max(0,Math.round(e)),a=Math.floor(t/60);return 0===a?`${t}m`:t%60==0?`${a}h`:`${a}h ${t%60}m`};L={level:e.riskLevel,airport:e.layoverAirportIata,label:`${e.layoverAirportIata} layover ${t(e.estimatedLayoverMinutes)} (minimum ${t(e.minimumConnectionMinutes)})`}}}p.push({legKey:(0,u.flightKey)(g),ident:g.identIata,routeLabel:`${C} → ${S}`,target:(0,o.alertTargetFor)(g,e),cancelled:y,diverted:w,departed:$,landed:j,arrival:{place:x.destination.city||S,earlyLateMin:"estimated"===I.bestSource||"actual"===I.bestSource?x.delay.arrivalMinutes:null,weather:function(e,t){if(!e||!Number.isFinite(e.current.temperatureC))return null;let a=Date.parse(e.observedAt);if(Number.isFinite(a)&&t-a>108e5)return null;let i=`${(0,s.cToF)(e.current.temperatureC)}\xb0`,n="unknown"===e.current.condition?"":l.CONDITION_PRESENTATION[e.current.condition].label.toLowerCase();return n?`${i} and ${n}`:i}(D?.weather,h),weatherPending:!!D?.pending},hoursToDeparture:null===M?1/0:(M-h)/36e5,delayMin:(0,r.knownDelayMinutes)(g),risk:A&&"unknown"!==A.level?A.level:"unknown",riskLabel:A?.factors[0]?.label??null,gateOrigin:x.origin.gate,gateDestination:x.destination.gate,connection:L,inbound:x.inbound?{ident:x.inbound.ident.iata??x.inbound.ident.icao,origin:x.inbound.origin.iata??x.inbound.origin.icao,delayMin:x.inbound.delay.arrivalMinutes??0,landed:"landed"===x.inbound.status||"arrived"===x.inbound.status}:null,deicing:E&&(0,n.deicingShown)(E.level)?{level:E.level,chancePercent:E.chancePercent,airport:C||x.origin.icao,departureClock:(0,i.formatClock)(x.times.gateOut.best,x.origin.timezone)}:null})});return p}],33541),e.s([],22869)},46470,56642,55299,e=>{"use strict";let t;var a=e.i(71645),i=e.i(64891),n=e.i(16350),r=e.i(76818),l=e.i(61522);e.i(22869);var s=e.i(33541),o=e.i(2194),u=e.i(55529),d=e.i(99847),c=e.i(31590),f=e.i(97510),h=e.i(57556);let p={low:0,elevated:1,high:2},g={safe:"safe",tight:"tight","at-risk":"at risk",impossible:"missed"},m={safe:0,tight:1,"at-risk":2,impossible:3},x={minor:"info",moderate:"warning",severe:"critical"};function b(e,t,a){return t?t.delayMin{let a=Date.parse(e);return Number.isNaN(a)?1/0:t-a},y=()=>({alerts:[],legState:{}}),w=0,j=e=>`${e.toString(36)}-${(w++).toString(36)}`;function N(e,t,a){let i={...e.legState},n=[];for(let e of t){let{state:t,alerts:r}=function(e,t,a){let i=new Date(a).toISOString();if(!e)return{state:{landed:t.landed,inbound:b(void 0,t.inbound,i),cancelled:t.cancelled,diverted:t.diverted,lastAlertedDelay:t.delayMin>=f.DELAY_FLOOR_MIN?t.delayMin:0,confirmedRisk:null,riskStreak:"unknown"===t.risk?null:{level:t.risk,count:1},gateOrigin:t.gateOrigin,gateDestination:t.gateDestination,connection:t.connection?.level??null,lastAlertAt:{},updatedAt:i},alerts:[]};let n=[],r={...e,lastAlertAt:{...e.lastAlertAt},updatedAt:i},l=t=>{let i=e.lastAlertAt[t];return!i||a-Date.parse(i)>=18e5},s=(e,a,l,s,o)=>{n.push({dedupeKey:`${t.legKey}:${e}:${l}`,kind:e,severity:a,legKey:t.legKey,ident:t.ident,title:s,body:o,createdAt:i,target:t.target}),r.lastAlertAt[e]=i};if(t.cancelled&&!e.cancelled&&s("cancelled","critical","cancelled",`${t.ident} was cancelled`,`${t.routeLabel} is cancelled. Check rebooking options with your airline.`),t.diverted&&!e.diverted&&s("diverted","critical","diverted",`${t.ident} was diverted`,`${t.routeLabel} is not going to its scheduled destination.`),r.inbound=b(e.inbound,t.inbound,i),r.cancelled=t.cancelled,r.diverted=t.diverted,t.cancelled||t.diverted)return{state:r,alerts:n};if(r.landed=e.landed??t.landed,t.landed&&!1===e.landed&&!t.arrival.weatherPending){let{place:e,earlyLateMin:a,weather:i}=t.arrival,n=[null!=a?4>=Math.abs(a)?"on time":`${(0,u.formatCountdown)(Math.abs(a))} ${a0?`${n.join(", ").replace(/^./,e=>e.toUpperCase())}.`:`${t.routeLabel} is complete.`),r.landed=!0}if(t.landed);else if(t.delayMin=i&&l("delay")){let e=(0,c.delayLevel)(t.delayMin);s("delay",e?x[e]:"info",String(t.delayMin),`${t.ident} delayed ${t.delayMin} min`,`${t.routeLabel} is running about ${t.delayMin} minutes late.`),r.lastAlertedDelay=t.delayMin}}if("unknown"!==t.risk){let a=e.riskStreak?.level===t.risk?{level:t.risk,count:e.riskStreak.count+1}:{level:t.risk,count:1};if(r.riskStreak=a,a.count>=2){let i=e.confirmedRisk,n=null!==i&&"low"!==a.level&&p[a.level]>p[i],o=!t.departed&&t.hoursToDeparturem[a]&&!t.departed?l("connection")&&(s("connection","tight"===i?"warning":"critical",i,`Your ${t.connection.airport} connection is ${g[i]}`,`${t.connection.label} before ${t.ident}.`),r.connection=i):r.connection=i}return{state:r,alerts:n}}(i[e.legKey]??null,e,a);i[e.legKey]=t,n.push(...r)}for(let[e,t]of Object.entries(i))v(t.updatedAt,a)>2592e5&&delete i[e];let r=[],l=[...e.alerts];for(let e of n){if(l.some(t=>t.dedupeKey===e.dedupeKey&&216e5>v(t.createdAt,a)))continue;let t={...e,id:j(a),readAt:null};l.push(t),r.push(t)}return{store:{alerts:l.filter(e=>6048e5>=v(e.createdAt,a)).sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt)).slice(0,50),legState:i},added:r}}function k(e,t,a){return{...e,alerts:e.alerts.map(e=>e.id!==t||e.readAt?e:{...e,readAt:new Date(a).toISOString()})}}function $(e,t){let a=new Date(t).toISOString();return{...e,alerts:e.alerts.map(e=>e.readAt?e:{...e,readAt:a})}}let M=e=>e.alerts.reduce((e,t)=>e+ +!t.readAt,0);function A(e){try{let t=e?JSON.parse(e):null;return{alerts:Array.isArray(t?.alerts)?t.alerts:[],legState:t?.legState&&"object"==typeof t.legState?t.legState:{}}}catch{return y()}}e.s(["applyEvaluation",0,N,"badgeText",0,e=>e>9?"9+":String(e),"emptyStore",0,y,"markAllRead",0,$,"markRead",0,k,"parseAlertStore",0,A,"unreadCount",0,M],56642);let C=e=>{if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:t};function S(e,t,a){let i=t.get(e);if(!i)return!1;if("tracked"===i.kind)return!0;let n="cancelled"===i.kind?1728e5:864e5;return a-i.atS(e.legKey,n,a)),l=Object.keys(e.legState),s=l.filter(e=>S(e,n,a));return r.length===e.alerts.length&&s.length===l.length?e:{alerts:r,legState:Object.fromEntries(s.map(t=>[t,e.legState[t]]))}}(a,e,Date.now(),t);i!==a&&O(i)}e.s(["ALERTS_CHANGED",0,D,"pruneStoredAlerts",0,F,"readStore",0,L,"removeStoredAlertsOfLegs",0,function(e,t){let a=L(),i=function(e,t,a){let i=new Set(a.flatMap(e=>e.legs).map(o.flightKey)),n=new Set(t.map(o.flightKey).filter(e=>!i.has(e)));if(0===n.size)return e;let r=e.alerts.filter(e=>!n.has(e.legKey)),l=Object.keys(e.legState),s=l.filter(e=>!n.has(e));return r.length===e.alerts.length&&s.length===l.length?e:{alerts:r,legState:Object.fromEntries(s.map(t=>[t,e.legState[t]]))}}(a,e,t);i!==a&&O(i)},"runEvaluation",0,T,"updateStore",0,R],55299);let _=e=>(window.addEventListener(D,e),window.addEventListener("storage",e),()=>{window.removeEventListener(D,e),window.removeEventListener("storage",e)}),z=y(),P=(0,l.createArrivalWeatherLookup)(i.v1WeatherStore);function U(e,t){let i=(0,a.useSyncExternalStore)(_,L,()=>z),n=e?i.legState[e]?.inbound:void 0;return(0,a.useMemo)(()=>(0,r.usableInboundMemory)(n,t,Date.now()),[n,t])}e.s(["useAlertStore",0,function(){return(0,a.useSyncExternalStore)(_,L,()=>z)},"useAlerts",0,function(){let e=(0,a.useSyncExternalStore)(_,L,()=>z),t=(0,a.useCallback)(e=>R(t=>k(t,e,Date.now())),[]),i=(0,a.useCallback)(()=>R(e=>$(e,Date.now())),[]);return{alerts:e.alerts,unread:M(e),markRead:t,markAllRead:i}},"useAlertsEngine",0,function(e){let{itineraries:t,riskFor:n,weatherConnections:r,version:l}=e;(0,a.useEffect)(()=>{T((0,s.buildObservations)(t,n,{weatherConnections:r,arrivalWeather:P,deicing:i.v1DeicingStore.get},Date.now())),F(t)},[t,n,r,l])},"useFlightInboundMemory",0,function(e,t){return U(e?(0,o.flightResourceKey)(e,t):null,e?.inbound!=null)},"useGateChanges",0,function(e){let t=(0,a.useSyncExternalStore)(_,L,()=>z).legState[(0,o.flightKey)(e)],i=e.snapshot?.origin.gate??null,r=e.snapshot?.destination.gate??null;return(0,a.useMemo)(()=>(0,n.currentGateChanges)(t,e.snapshot?{gateOrigin:i,gateDestination:r}:null,Date.now()),[t,e.snapshot,i,r])},"useInboundMemory",0,function(e){return U(e?(0,o.flightKey)(e):null,!!e?.snapshot?.inbound)}],46470)},14394,e=>{"use strict";let t=new Map;e.s(["getCard",0,function(e){return t.get(e)},"registerCard",0,function(e){t.set(e.id,e)}])},8199,50798,66528,e=>{"use strict";var t=e.i(36966),a=e.i(81614),i=e.i(36655),n=e.i(70053),r=e.i(30787);let l={none:0,light:1,moderate:2,severe:3},s=e=>l[e]>=l.moderate,o=e=>Math.min(1,.08+.92*e/r.HIGH_AT),u=e=>e.replace(" ","").replace("AM","a").replace("PM","p");function d(e,t,a,i=!1){let n=e.findIndex(e=>e.flight),r=e[n];if(!r)return null;let l=a??r.time,o=e.reduce((e,t)=>t.points>e.points?t:e),u=e.slice(n+1).find(e=>!s(e.level)),c=function(e){let t=Math.max(...e.map(e=>e.points)),a=e.findIndex(e=>e.points===t),i=a;for(;e[i+1]?.points===t;)i++;let n=e[a],r=e[i];return{text:a===i?n.time:n.time.slice(-2)===r.time.slice(-2)?`${n.time.replace(/ (AM|PM)$/,"")}\u2013${r.time}`:`${n.time}\u2013${r.time}`,reason:n.reasons[0]?.replace(/ at [A-Z]{3}$/,"")??null}}(e),f=`Peak impact ${c.text}${c.reason?`: ${c.reason}`:""}.`;if(s(r.level)){let a=r.reasons[0]??"Weather";return{bars:e,source:t,tone:"severe"===r.level?"danger":"warning",headline:u?`Improves by ${u.time}`:"No clearing in this window",subtitle:i?`${a} right now`:`${a} around your ${l} departure`,footer:u?`${f} Later flights fare better.`:f}}if(s(o.level)){let a=e.indexOf(o)>n,r=o.reasons[0]?.replace(/ at [A-Z]{3}$/,"")??"Weather";return{bars:e,source:t,tone:"success",headline:a?`${r} peak ${c.text}`:"The worst of it is behind you",subtitle:i?a?"Calm now, rougher later":"The roughest hour has passed":a?`Your ${l} departure beats the peak`:`Your ${l} departure is after the roughest hour`,footer:a?`${f} Later departures are more exposed.`:f}}return{bars:e,source:t,tone:"success",headline:"No weather trouble expected",subtitle:i?"No hour in this window is a weather risk":`No hour around your ${l} departure is a weather risk`,footer:null}}function c(e,t){let a=Math.max(0,Math.min(t-2,e.length-10));return{start:a,hours:e.slice(a,a+10)}}let f={unknown:"none",minimal:"none",low:"light",moderate:"moderate",high:"severe"},h={unknown:0,minimal:0,low:4,moderate:10,high:20};e.s(["departureWindowV1",0,function(e,t,l,s,f){if(null==t||!e[t])return null;let{start:h,hours:p}=c(e,t);return d(p.map((e,d)=>{var c;let f,{points:p,reasons:g}=(c=(0,n.snapshotFromHour)(e),{points:Math.round(10*(f=(0,i.scoreAirportWeather)(c,l,"origin")).reduce((e,t)=>e+t.points,0))/10,reasons:[...f].sort((e,t)=>t.points-e.points).map(e=>e.label)}),m=(0,a.hourLabelAt)(e.validAt,s);return{key:e.validAt,label:u(m),time:m,points:p,level:p>=r.HIGH_AT?"severe":p>=r.ELEVATED_AT?"moderate":p>0?"light":"none",flight:h+d===t,reasons:g,height:o(p)}}),"forecast",f)},"impactWindowV1",0,function(e,i,n,r,l,s=!1){if(null==i||!e[i])return null;let{start:p,hours:g}=c(e,i);return d(g.map((e,l)=>{let s=(0,a.hourLabelAt)(e.validAt,r);return{key:e.validAt,label:u(s),time:s,points:h[e.level],level:f[e.level],flight:p+l===i,reasons:e.hazards.map(e=>`${t.HAZARD_KIND_PRESENTATION[e].label} at ${n}`),height:o(h[e.level])}}),"twc",l,s)}],50798),e.s([],8199);var p=e.i(43476),g=e.i(9694),m=e.i(64864),x=e.i(1673),b=e.i(52236);let v={none:"bg-sev-none",light:"bg-sev-light",moderate:"bg-sev-moderate",severe:"bg-sev-severe"},y={none:"text-fg-sev-none",light:"text-fg-sev-light",moderate:"text-fg-sev-moderate",severe:"text-fg-sev-severe"},w={none:"clear",light:"light impact",moderate:"moderate impact",severe:"severe impact"},j={label:"You",aria:"your departure"};e.s(["default",0,function({code:e,window:t,title:a="Departure Window",marker:i=j,headlineTestId:n="departure-window-headline"}){return(0,p.jsx)(g.default,{title:a,meta:(0,p.jsx)(m.Pill,{children:e}),children:(0,p.jsxs)(g.FlightCardSection,{className:"gap-stack",children:[(0,p.jsxs)("div",{className:"flex flex-col gap-stack-2xs",children:[(0,p.jsx)("p",{"data-testid":n,className:"text-headline",children:t.headline}),(0,p.jsx)("p",{className:"text-body text-fg-secondary tabular",children:t.subtitle})]}),(0,p.jsx)("ol",{className:"flex items-end justify-between","aria-label":"Weather impact by hour",children:t.bars.map((e,t)=>{let a;return(0,p.jsxs)("li",{"data-level":e.level,"aria-label":`${e.label}: ${w[e.level]}${e.reasons[0]?`, ${e.reasons[0]}`:""}${e.flight?`, ${i.aria}`:""}`,title:e.reasons.join(" · ")||void 0,className:"flex flex-col items-center gap-stack-sm",children:[(0,p.jsx)("div",{className:"flex h-6 items-end",children:e.flight&&(0,p.jsx)(x.YouMarker,{label:i.label,className:y[e.level]})}),(0,p.jsx)("div",{className:"flex h-16 w-5 flex-col justify-end overflow-hidden rounded-inner bg-surface-muted","aria-hidden":!0,children:(0,p.jsx)("div",{className:(0,b.cn)("rounded-inner",v[e.level],"origin-bottom animate-bar-grow"),style:{height:(a=e.height,`${Math.round(100*a)}%`),"--bar-i":t}})}),(0,p.jsx)("span",{className:(0,b.cn)("text-caption tabular",e.flight?"font-semibold text-fg":"text-fg-secondary"),"aria-hidden":!0,children:e.label})]},e.key)})}),t.footer&&(0,p.jsx)("p",{className:"border-t border-subtle pt-stack text-body-sm text-fg-secondary tabular",children:t.footer})]})})}],66528)},55104,e=>{"use strict";var t=e.i(71645),a=e.i(6191);let i=a.INITIAL_REFRESH_STATE,n=null,r=new Set,l=()=>r.forEach(e=>e()),s=e=>(r.add(e),()=>r.delete(e));e.s(["recordRefreshCycle",0,function(e){i=(0,a.afterRefreshCycle)(i,e,Date.now()),l()},"setDataAt",0,function(e){e!==n&&(n=e,l())},"useDataAt",0,()=>(0,t.useSyncExternalStore)(s,()=>n,()=>null),"useRefreshState",0,()=>(0,t.useSyncExternalStore)(s,()=>i,()=>a.INITIAL_REFRESH_STATE)])},24944,80637,e=>{"use strict";var t=e.i(71645);let a=["hotel","meeting","pickup","notes","booking","seat","group","cabin","barcode","barcodeFormat"];function i(e){let t;if(!e)return{};try{t=JSON.parse(e)}catch{return{}}if(!t||"object"!=typeof t||Array.isArray(t))return{};let i={};for(let[e,n]of Object.entries(t)){if(!n||"object"!=typeof n)continue;let t={};for(let e of a){let a=n[e];"string"==typeof a&&(t[e]=a)}i[e]=t}return i}function n(e,t){let a=t-2592e6;return Object.fromEntries(Object.entries(e).filter(([e])=>{let t=Date.parse(e.slice(e.indexOf(":")+1));return!Number.isFinite(t)||t>=a}))}e.s(["parseTripNotes",0,i,"tripNotesKey",0,function(e,t){return`${e.trim().toUpperCase()}:${t??""}`},"withoutStaleNotes",0,n],80637);let r="flights-trip-notes",l="trip-notes-changed",s={raw:null,all:{}};function o(){let e=null;try{e=localStorage.getItem(r)}catch{return s.all}return e!==s.raw&&(s={raw:e,all:i(e)}),s.all}function u(e){try{localStorage.setItem(r,JSON.stringify(e))}catch{return!1}return window.dispatchEvent(new Event(l)),!0}function d(e){let t=t=>{t.key===r&&e()};return window.addEventListener(l,e),window.addEventListener("storage",t),()=>{window.removeEventListener(l,e),window.removeEventListener("storage",t)}}let c={};e.s(["forgetTripNotes",0,function(e){let t=o();if(!e.some(e=>e in t))return;let a=new Set(e);u(Object.fromEntries(Object.entries(t).filter(([e])=>!a.has(e))))},"pruneTripNotes",0,function(e=Date.now()){let t=o(),a=n(t,e);Object.keys(a).lengthe?o()[e]??c:c,()=>c),[i,r]=(0,t.useState)(null),l=(0,t.useRef)(null),s=(0,t.useRef)(void 0),f=(0,t.useCallback)(()=>{window.clearTimeout(s.current);let e=l.current;if(!e)return;let t=n(o(),Date.now());l.current=u({...t,[e.key]:{...t[e.key],...e.patch}})?null:{...e,failed:!0},r(l.current)},[]);(0,t.useEffect)(()=>(window.addEventListener("pagehide",f),()=>{window.removeEventListener("pagehide",f),f()}),[f]);let h=(0,t.useCallback)(t=>{if(!e)return;l.current&&l.current.key!==e&&f();let a=l.current?.key===e?l.current:null;l.current={key:e,patch:{...a?.patch,...t},failed:a?.failed??!1},r(l.current),window.clearTimeout(s.current),s.current=window.setTimeout(f,400)},[e,f]),p=i?.key===e?i:null;return{notes:p?{...a,...p.patch}:a,update:h,saveFailed:p?.failed??!1}}],24944)},80279,e=>{"use strict";var t=e.i(71645),a=e.i(51871),i=e.i(64891);e.s(["useAirportImpact",0,function(e){let n=(0,a.useStoreVersion)();return(0,t.useEffect)(()=>{e&&i.v1ImpactStore.ensure(e)},[e,n]),e?i.v1ImpactStore.get(e):null},"useAirportImpactStatus",0,function(e){return(0,a.useLoadStatus)(i.v1ImpactStore,e)}])},47448,e=>{"use strict";var t=e.i(71645),a=e.i(56669),i=e.i(64891);let n=new Map,r=new Map;async function l(e){let t=e?.toUpperCase();if(!t)return"UTC";let l=(0,a.getAirportByIata)(t)?.timezone;if(l)return l;if(n.has(t))return n.get(t);let s=r.get(t);return s||(s=(0,i.loadAirport)(t).then(e=>{let a=e?.resource.airport.timezone||null;return a&&n.set(t,a),a}).catch(()=>null).finally(()=>{r.delete(t)}),r.set(t,s)),await s??"UTC"}function s(e){let i=e?.toUpperCase()||null,r=i?(0,a.getAirportByIata)(i)?.timezone:void 0,[s,o]=(0,t.useState)(i?n.get(i)??null:null);return(0,t.useEffect)(()=>{if(!i||r)return;let e=!1;return l(i).then(t=>{e||o(t)}),()=>{e=!0}},[i,r]),r??s}e.s(["resolveAirportTimezone",0,l,"useAirportTimezone",0,function(e){return s(e)??"UTC"},"useKnownAirportTimezone",0,s])},21291,22786,41666,e=>{"use strict";var t=e.i(71645),a=e.i(70053);let i="false"!==e.i(47167).default.env.NEXT_PUBLIC_FLAG_WEATHER_RISK;function n(e,t,r,l,s=Date.now()){return i?(0,a.computeFlightRiskV1)(e,t,r,l,s):null}e.s(["WEATHER_RISK_ENABLED",0,i],22786),e.s(["computeFlightRisk",0,n],41666);var r=e.i(51871),l=e.i(64891),s=e.i(81789);let o=e=>[e.origin.icao,e.destination.icao];function u(e,t){if(!e)return null;let[a="",i=""]=o(e);return n(e,l.v1WeatherStore.get(a)??null,l.v1WeatherStore.get(i)??null,t)}function d(e,a){let n=e.map(e=>e?o(e).join("-"):"").join("|");(0,t.useEffect)(()=>{if(i)for(let e of n.split(/[|-]/))e&&l.v1WeatherStore.ensure(e)},[n,a])}function c(e,a,i){let n=(0,r.useStoreVersion)();return d([e],n),(0,t.useMemo)(()=>u(e,a()),[e,i,n])}e.s(["useFlightRisk",0,function(e,t){return c(e,()=>t,t)},"useLegRisk",0,function(e){return c(e?.snapshot??null,()=>e?(0,s.v1HistoryFor)(e):null,e)},"useLegsRisk",0,function(e){let a=(0,r.useStoreVersion)();return d(e.map(e=>e.snapshot??null),a),(0,t.useMemo)(()=>{let t=new Map;for(let a of e)t.set(a.id,u(a.snapshot??null,(0,s.v1HistoryFor)(a)));return t},[e,a])}],21291)},66447,(e,t,a)=>{"use strict";e.i(47167),Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"catchError",{enumerable:!0,get:function(){return p}});let i=e.r(90809),n=e.r(43476),r=i._(e.r(71645)),l=e.r(99112),s=e.r(65713);e.r(78377);let o=e.r(12354),u=e.r(82604),d=e.r(8372),c=e.r(65856),f="u">typeof window&&(0,u.isBot)(window.navigator.userAgent);class h extends r.default.Component{static{this.contextType=d.AppRouterContext}static{this.displayName="catchError(Next.CatchError)"}constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.retry=()=>{if(this.props.isPagesRouter)throw Object.defineProperty(Error("`retry()` can only be used in the App Router. Use `reset()` in the Pages Router."),"__NEXT_ERROR_CODE",{value:"E1360",enumerable:!1,configurable:!0});(0,r.startTransition)(()=>{this.context?.refresh(),this.reset()})},this.state={error:null,previousPathname:this.props.pathname}}static getDerivedStateFromError(e){if((0,s.isNextRouterError)(e))throw e;return{error:{thrownValue:e}}}static getDerivedStateFromProps(e,t){let{error:a}=t;return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){if(this.state.error&&!f){let e=this.state.error.thrownValue;return(0,o.handleISRError)({error:e}),(0,n.jsx)(this.props.fallback,{props:this.props.props,errorInfo:{error:e,reset:this.reset,retry:this.retry}})}return this.props.children}}function p(e){let t=({props:t,errorInfo:a})=>e(t,a);return t.displayName=e.name||"CatchErrorFallback",({children:e,...a})=>{let i=(0,l.useUntrackedPathname)(),s=null!==(0,r.useContext)(c.RouterContext);return(0,n.jsx)(h,{pathname:i,isPagesRouter:s,fallback:t,props:a,children:e})}}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},78438,(e,t,a)=>{t.exports=e.r(50691),Object.defineProperty(t.exports,"catchError",{enumerable:!0,get:()=>e.r(66447).catchError})},22973,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var i={NEXT_REQUEST_META:function(){return r},addRequestMeta:function(){return o},getRequestMeta:function(){return l},removeRequestMeta:function(){return u},setRequestMeta:function(){return s}};for(var n in i)Object.defineProperty(a,n,{enumerable:!0,get:i[n]});let r=Symbol.for("NextInternalRequestMeta");function l(e,t){let a=e[r]||{};return"string"==typeof t?a[t]:a}function s(e,t){return e[r]=t,t}function o(e,t,a){let i=l(e);return i[t]=a,s(e,i)}function u(e,t){let a=l(e);return delete a[t],s(e,a)}},50691,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return p}});let i=e.r(55682),n=e.r(43476),r=i._(e.r(71645)),l=i._(e.r(25633)),s={400:"Bad Request",404:"This page could not be found",405:"Method Not Allowed",500:"Internal Server Error"};function o({req:t,res:a,err:i}){let n,r=a&&a.statusCode?a.statusCode:i?i.statusCode:404;if("u">typeof window)n=window.location.hostname;else if(t){let{getRequestMeta:a}=e.r(22973),i=a(t,"initURL");i&&(n=new URL(i).hostname)}return{statusCode:r,hostname:n}}let u={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},d={lineHeight:"48px"},c={display:"inline-block",margin:"0 20px 0 0",paddingRight:23,fontSize:24,fontWeight:500,verticalAlign:"top"},f={fontSize:14,fontWeight:400,lineHeight:"28px"},h={display:"inline-block"};class p extends r.default.Component{static{this.displayName="ErrorPage"}static{this.getInitialProps=o}static{this.origGetInitialProps=o}render(){let{statusCode:e,withDarkMode:t=!0}=this.props,a=this.props.title||s[e]||"An unexpected error has occurred";return(0,n.jsxs)("div",{style:u,children:[(0,n.jsx)(l.default,{children:(0,n.jsx)("title",{children:e?`${e}: ${a}`:"Application error: a client-side exception has occurred"})}),(0,n.jsxs)("div",{style:d,children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:`body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}${t?"@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}":""}`}}),e?(0,n.jsx)("h1",{className:"next-error-h1",style:c,children:e}):null,(0,n.jsx)("div",{style:h,children:(0,n.jsxs)("h2",{style:f,children:[this.props.title||e?a:(0,n.jsxs)(n.Fragment,{children:["Application error: a client-side exception has occurred"," ",!!this.props.hostname&&(0,n.jsxs)(n.Fragment,{children:["while loading ",this.props.hostname]})," ","(see the browser console for more information)"]}),"."]})})]})]})}}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},61522,e=>{"use strict";e.s(["createArrivalWeatherLookup",0,function(e,t=Date.now){let a=new Map;return i=>{if(!i)return{weather:null,pending:!1};let n=e.get(i);if(void 0!==n)return a.delete(i),{weather:n,pending:!1};e.ensure(i);let r=a.get(i)??t();return a.set(i,r),{weather:null,pending:t()-r{"use strict";e.s(["currentGateChanges",0,function(e,t,a){let i=e?.gateChange;if(!i||!t||a-Date.parse(i.at)>864e5)return[];let n=[];return i.origin&&t.gateOrigin===i.origin.to&&n.push({label:"Departure",...i.origin}),i.destination&&t.gateDestination===i.destination.to&&n.push({label:"Arrival",...i.destination}),n}])},76818,e=>{"use strict";e.s(["describeInboundMemory",0,function(e){let t=e.origin?` from ${e.origin}`:"";return`${e.ident}${t} ${e.landed?"arrived":"was"} ${e.delayMin} min late`},"usableInboundMemory",0,function(e,t,a){return!e||t||a-Date.parse(e.seenAt)>864e5?null:e}])},78944,e=>{"use strict";var t=e.i(27629),a=e.i(6658);e.s(["alertTargetFor",0,function(e,i){return{flight:e.faFlightId??e.identIcao??e.identIata,origin:(0,a.legOriginIcao)(e),destination:(0,a.legDestinationIcao)(e),date:e.scheduledDate||null,siblings:(0,t.buildSiblingsParam)(i.filter(t=>t.id!==e.id))}},"routeLabelFor",0,function(e){return`${(e.snapshot?.origin.iata||e.originIata||null)??""} → ${(e.snapshot?.destination.iata||e.destinationIata||null)??""}`}])},27629,6658,e=>{"use strict";var t=e.i(84275),a=e.i(56669),i=e.i(74518);function n(e){return e?(0,i.icaoParam)(e)??(0,a.getAirportByIata)(e)?.icao??null:null}function r(e){return e.snapshot?.origin.icao||n(e.originIata)}function l(e){return e.snapshot?.destination.icao||n(e.destinationIata)}function s(e,t){let a=r(e);return(e.faFlightId===t.identIcao||e.identIcao===t.identIcao||e.identIata===t.identIcao)&&(!t.date||e.scheduledDate===t.date)&&(!t.originIcao||!a||a===t.originIcao)}e.s(["icaoOfStored",0,n,"legDestinationIcao",0,l,"legOriginIcao",0,r],6658),e.s(["buildSiblingsParam",0,function(e){return e.map(e=>{let t=e.faFlightId??e.identIcao??e.identIata;return`${t}|${e.scheduledDate}|${r(e)??""}|${l(e)??""}`}).join(",")},"legMatchesSelection",0,s,"pickPrimaryChain",0,function(e,a=Date.now()){let i=(0,t.pickNextLeg)(e.flat(),a);if(!i)return null;let n=e.find(e=>e.includes(i))??[i];return[i,...n.filter(e=>e!==i)]},"trackedSiblingsParam",0,function(e,a){if(!a)return null;let i=e.flatMap(e=>e.legs).find(e=>s(e,a));return i?function(e,a){if(!a)return null;let i=e.find(e=>e.legs.some(e=>e.id===a));return i?((0,t.buildLegChains)(i).find(e=>e.some(e=>e.id===a))??[]).filter(e=>e.id!==a).map(e=>{let t=e.identIcao??e.faFlightId??e.identIata;return`${t}|${e.scheduledDate}|${r(e)??""}|${l(e)??""}`}).join(","):null}(e,i.id):null}],27629)},2194,e=>{"use strict";var t=e.i(2052);e.s(["flightKey",0,function(e){let t=e.snapshot;return[e.identIata,e.scheduledDate,t?.origin.iata||e.originIata||"",t?.destination.iata||e.destinationIata||""].join("|")},"flightResourceKey",0,function(e,a){let i=e.times.gateOut.scheduled;return[e.ident.iata??e.ident.icao,a??(i?(0,t.localDateStr)(i,e.origin.timezone):""),e.origin.iata??e.origin.icao,e.destination.iata??e.destination.icao].join("|")},"hasLiveData",0,function(e){let t=e.snapshot;return!!t&&"schedule"!==t.resolution&&"schedule"!==e.dataSource&&"intent"!==e.dataSource&&Object.values(t.times).some(e=>!!(e.estimated||e.actual))}])},74518,e=>{"use strict";function t(e){let t=e?.trim().toUpperCase();return t&&/^[A-Z0-9]{4}$/.test(t)?t:null}e.s(["SELECTION_KEYS",0,["iata","icao","flight","origin","destination","date","trip"],"icaoParam",0,t,"parseSelection",0,function(e){let a=e.get("flight");if(a)return{kind:"flight-leg",identIcao:a,originIcao:t(e.get("origin")),destinationIcao:t(e.get("destination")),date:e.get("date")};let i=t(e.get("icao"));if(i)return{kind:"airport",icao:i};let n=e.get("trip");return n?{kind:"trip",itineraryId:n}:null},"selectionParams",0,function(e){if(e?.kind==="airport")return[["icao",e.icao]];if(e?.kind==="trip")return[["trip",e.itineraryId]];if(e?.kind!=="flight-leg")return[];let t=[["flight",e.identIcao]];return e.originIcao&&t.push(["origin",e.originIcao]),e.destinationIcao&&t.push(["destination",e.destinationIcao]),e.date&&t.push(["date",e.date]),t}])},42132,e=>{"use strict";var t=e.i(84275);let a={low:0,elevated:15,high:60,unknown:0},i=["safe","tight","at-risk","impossible"],n=(e,t)=>i.indexOf(e)>=i.indexOf(t)?e:t;e.s(["escalateConnection",0,function(e,r,l){let s=r?a[r.level]:0,o=l?.level==="high";if("impossible"===e.riskLevel||0===s&&!o)return e;let u=e.riskLevel;s>0&&(u=n(u,(0,t.bucketForLayover)(e.estimatedLayoverMinutes-s,e.minimumConnectionMinutes))),o&&(u=n(u,i[Math.min(i.indexOf(e.riskLevel)+1,2)])),"impossible"===u&&(u="at-risk");let d=[...s>0?(r?.factors??[]).slice(0,2):[],...o?(l?.factors??[]).slice(0,1):[]].map(e=>({label:e.label}));return{...e,riskLevel:u,baseRiskLevel:e.riskLevel,weatherAdjusted:u!==e.riskLevel,extraDelayMinutes:s,weatherFactors:d}}])},31590,e=>{"use strict";var t=e.i(78944),a=e.i(2194),i=e.i(84275),n=e.i(42132),r=e.i(97510);let l={level:null,label:""},s={minor:1,moderate:2,severe:3};function o(e){let t=e.snapshot?.delay;return t?Math.max(t.departureMinutes??0,t.arrivalMinutes??0):0}function u(e){let t=e.snapshot?.delay.level;return"minor"===t||"moderate"===t||"severe"===t?t:null}function d(e){var t=e.snapshot?.times.gateOut.scheduled??e.scheduledDepartureAt;if(!t)return null;let a=Date.parse(t);return Number.isNaN(a)?null:a}let c=new Set(["taxiing-out","airborne","landed"]);function f(e,t){let a=e.snapshot;if(!a||"arrived"===a.status)return!1;if(c.has(a.status))return!0;let i=d(e);return null!==i&&i>=t-432e5&&i45?"severe":e>15?"moderate":"minor"},"hasDeparted",0,h,"isRelevantLeg",0,f,"knownDelayLevel",0,u,"knownDelayMinutes",0,o,"listFlightsIssues",0,function(e,r,l,c=Date.now()){let g=new Map,m=new Map,x=(e,i,n,r,l)=>{if(!n)return;let o=(0,a.flightKey)(e),u=g.get(o);u||(m.set(o,e),u={key:o,ident:e.identIata,routeLabel:(0,t.routeLabelFor)(e),level:n,reasons:[],target:(0,t.alertTargetFor)(e,i)},g.set(o,u)),u.reasons.push({level:n,text:r,label:l}),s[n]>s[u.level]&&(u.level=n)};for(let t of e)for(let e of(0,i.buildLegChains)(t))e.forEach((t,a)=>{let s=t.snapshot;if(!s)return;let g=d(t),m=null!==g&&g>=c-432e5&&ge.text.startsWith("Delayed"))){let a=l.explain?.(t);a&&(e.note=a)}}return[...g.values()].sort((e,t)=>s[t.level]-s[e.level])},"scheduledOutMs",0,d,"statusFromIssues",0,function(e){let t=l;for(let a of e)for(let e of a.reasons)(null===t.level||s[e.level]>s[t.level])&&(t={level:e.level,label:e.label});return t}])},57556,e=>{"use strict";var t=e.i(84275),a=e.i(42132),i=e.i(31590);let n={tight:1,"at-risk":2,impossible:3};function r(e){let t=Math.max(0,Math.round(e)),a=Math.floor(t/60),i=t%60;return 0===a?`${i}m`:0===i?`${a}h`:`${a}h ${i}m`}e.s(["KNOWN_DELAY_QUIET_MIN",0,60,"summarizeTripRisk",0,function(e,l,s){let o=null,u=null;for(let d of e){for(let e of d){let t=l(e);if(!t||"elevated"!==t.level&&"high"!==t.level||(e.snapshot?.delay.departureMinutes??0)>=60)continue;let a=1e3*("high"===t.level)+t.score;(!o||a>o.score)&&(o={level:t.level,label:t.factors[0]?.label??"Delay risk",score:a})}for(let e=1;en[u.level])&&(u={level:h.riskLevel,label:`${h.layoverAirportIata} layover ${r(h.estimatedLayoverMinutes)} (minimum ${r(h.minimumConnectionMinutes)})`}))}}return{delay:o?{level:o.level,label:o.label}:null,connection:u}}])},70053,23246,e=>{"use strict";var t=e.i(58785);let a=(e,t)=>null===e?t:null===t?e:Math.min(e,t),i=(e,t)=>null===e?t:null===t?e:Math.max(e,t);function n(e){let[t,...n]=e;return t?n.reduce((e,t)=>({visibilityMi:a(e.visibilityMi,t.visibilityMi),ceilingFt:a(e.ceilingFt,t.ceilingFt),windMph:i(e.windMph,t.windMph),gustMph:i(e.gustMph,t.gustMph),thunder:e.thunder||t.thunder,thunderChance:e.thunder&&t.thunder?null==e.thunderChance||null==t.thunderChance?null:Math.max(e.thunderChance,t.thunderChance):e.thunder?e.thunderChance:t.thunder?t.thunderChance:void 0,freezingPrecip:e.freezingPrecip||t.freezingPrecip,snow:e.snow||t.snow,heavyPrecip:e.heavyPrecip||t.heavyPrecip}),t):null}e.s(["mergeWorst",0,n,"parseValidTime",0,function(e){let t=Date.parse(e.replace(/([+-]\d{2})(\d{2})$/,"$1:$2"));return Number.isNaN(t)?null:t}],23246);var r=e.i(30787);let l={thunder:!1,freezingPrecip:!1,snow:!1,heavyPrecip:!1},s={unknown:l,clear:l,"mostly-clear":l,"partly-cloudy":l,"mostly-cloudy":l,cloudy:l,fog:l,haze:l,smoke:l,dust:l,windy:l,drizzle:l,"freezing-drizzle":{...l,freezingPrecip:!0},showers:l,rain:l,"heavy-rain":{...l,heavyPrecip:!0},"freezing-rain":{...l,freezingPrecip:!0},sleet:{...l,freezingPrecip:!0},"wintry-mix":{...l,freezingPrecip:!0,snow:!0},flurries:{...l,snow:!0},"snow-showers":{...l,snow:!0},snow:{...l,snow:!0},"heavy-snow":{...l,snow:!0,heavyPrecip:!0},"blowing-snow":{...l,snow:!0},hail:l,"scattered-thunderstorms":{...l,thunder:!0},thunderstorms:{...l,thunder:!0},"tropical-storm":l,hurricane:l,tornado:l};function o(e){let a=s[e.condition],i=e.precipitationChancePercent;return{visibilityMi:(0,t.mToMi)(e.visibilityM),ceilingFt:null,windMph:(0,t.ktToMph)(e.windKt),gustMph:null==e.gustKt?null:(0,t.ktToMph)(e.gustKt),...a,thunderChance:a.thunder?i>0?Math.min(1,i/100):null:void 0}}function u(e,a,i){let r=e.hourly.filter(e=>{let t=Date.parse(e.validAt);return Number.isFinite(t)&&36e5>=Math.abs(t-a)}).map(o);if(54e5>=Math.abs(a-i)){var l;return{snapshot:n([(l=e.current,{visibilityMi:(0,t.mToMi)(l.visibilityM),ceilingFt:l.ceilingFt,windMph:(0,t.ktToMph)(l.windKt),gustMph:null==l.gustKt?null:(0,t.ktToMph)(l.gustKt),...s[l.condition]}),...r]),horizon:"live"}}let u=n(r);return{snapshot:u,horizon:u?"forecast":"beyond-forecast"}}let d=new Intl.DateTimeFormat("en-US",{month:"short",timeZone:"UTC"}),c=e=>e?{n:e.flights,late:e.late,cancelled:e.cancelled}:null;function f(e){return{flight:c(e.flight),route:c(e.route),globalLateRate:e.allFlightsLatePercent/100,windowLabel:function(e,t){let a=e=>{let[t,a]=e.split("-").map(Number);return{y:t,ym:`${t}-${a}`,label:d.format(new Date(Date.UTC(t,a-1,1)))}};if(!e||!t)return"";let i=a(e),n=a(t);return i.ym===n.ym?`${i.label} ${i.y}`:i.y===n.y?`${i.label}–${n.label} ${n.y}`:`${i.label} ${i.y}–${n.label} ${n.y}`}(e.sampleFrom,e.sampleTo),recent:e.recent?{n:e.recent.flights,late:e.recent.late,cancelled:e.recent.cancelled,lateArrivals:e.recent.lateArrivals,days:e.recent.days}:null}}let h=e=>{if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:t},p=new Set(["taxiing-out","airborne"]),g=new Set(["landed","arrived","cancelled","diverted"]);e.s(["computeFlightRiskV1",0,function(e,t,a,i,n=Date.now()){if(!e||!t||!a||g.has(e.status)||e.cancelled||e.diverted)return null;let l=h(e.times.gateOut.best),s=h(e.times.gateIn.best);if(null===l||null===s)return null;let o=p.has(e.status),d=o?{snapshot:null,horizon:"live"}:u(t,l,n),c=u(a,s,n),m="beyond-forecast"===c.horizon&&(o||"beyond-forecast"===d.horizon)?"beyond-forecast":"live"===d.horizon||"live"===c.horizon?"live":"forecast",x=e.inbound,b=h(e.times.gateOut.scheduled),v=h(x?.times.gateIn.scheduled),y=null!==b&&null!==v?Math.round((b-v)/6e4):null;return(0,r.scoreFlightRisk)({origin:{iata:e.origin.iata??e.origin.icao,snapshot:d.snapshot},destination:{iata:e.destination.iata??e.destination.icao,snapshot:c.snapshot},horizon:m,inboundArrivalDelayMin:o?null:x?.delay.arrivalMinutes??null,inboundTurnMin:y,history:i?f(i):null})},"historyStatsFromV1",0,f,"snapshotFromHour",0,o],70053)}]);